%expext was not functioning at all.

* src/conflicts.c (expected_conflicts): Set to -1.
(conflict_report): Use ngettext.
(conflicts_print): Check %expect and make its violation an error.
* doc/bison.texinfo (Expect Decl): Adjust.
* configure.in (AM_GNU_GETTEXT): Ask for ngettext.
* tests/regression.at (%expect not enough, %expect right)
(%expect too much): New.
This commit is contained in:
Akim Demaille
2001-11-12 09:19:48 +00:00
parent fb28699f95
commit badfc69c26
20 changed files with 512 additions and 177 deletions

View File

@@ -1,3 +1,15 @@
2001-11-12 Akim Demaille <akim@epita.fr>
%expext was not functioning at all.
* src/conflicts.c (expected_conflicts): Set to -1.
(conflict_report): Use ngettext.
(conflicts_print): Check %expect and make its violation an error.
* doc/bison.texinfo (Expect Decl): Adjust.
* configure.in (AM_GNU_GETTEXT): Ask for ngettext.
* tests/regression.at (%expect not enough, %expect right)
(%expect too much): New.
2001-11-12 Akim Demaille <akim@epita.fr>
* tests/regression.at (Conflicts): Rename as...

View File

@@ -84,8 +84,8 @@ INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIB = @LIB@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@

15
NEWS
View File

@@ -3,6 +3,21 @@ Bison News
Changes in version 1.30b:
* Fixed parser memory leaks.
When the generated parser was using malloc to extend its stacks, the
previous allocations were not freed.
* Fixed verbose output file.
Some newlines were missing.
Some conflicts in state descriptions were missing.
* Fixed conflict report.
Option -v was needed to get the result.
* %expect
Was not used.
Mismatches are errors, not warnings.
* Fixed incorrect processing of some invalid input.
* Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.

View File

@@ -84,8 +84,8 @@ INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIB = @LIB@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@

273
configure vendored
View File

@@ -15,6 +15,7 @@ else
as_expr=false
fi
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
@@ -60,6 +61,7 @@ fi
{ $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
{ LC_MESSAGES=C; export LC_MESSAGES; }
# Name of the executable.
as_me=`(basename "$0") 2>/dev/null ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
@@ -93,6 +95,7 @@ if test "${PATH_SEPARATOR+set}" != set; then
rm -f conftest.sh
fi
as_lineno_1=$LINENO
as_lineno_2=$LINENO
as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
@@ -177,6 +180,7 @@ done
exit
}
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C='
' ECHO_T=' ' ;;
@@ -216,6 +220,7 @@ as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
@@ -225,6 +230,7 @@ IFS=" $as_nl"
# CDPATH.
$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
@@ -284,6 +290,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
@@ -679,6 +686,7 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
@@ -971,12 +979,14 @@ done
cat >&5 <<_ACEOF
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell meta-characters.
@@ -1149,6 +1159,31 @@ 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_aux_dir=
for ac_dir in config $srcdir/config; do
if test -f $ac_dir/install-sh; then
@@ -1174,6 +1209,7 @@ ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@@ -1228,6 +1264,7 @@ case $as_dir/ in
esac
done
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
@@ -1308,6 +1345,7 @@ _ACEOF
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
rm conftest.sed
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
@@ -1401,6 +1439,7 @@ if test "x$enable_dependency_tracking" != xno; then
AMDEPBACKSLASH='\'
fi
if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
AMDEP_FALSE='#'
@@ -1409,6 +1448,7 @@ else
AMDEP_FALSE=
fi
rm -f .deps 2>/dev/null
mkdir .deps 2>/dev/null
if test -d .deps; then
@@ -1419,6 +1459,7 @@ else
fi
rmdir .deps 2>/dev/null
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
@@ -1435,22 +1476,30 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
_ACEOF
# Some tools Automake needs.
ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"}
AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
AMTAR=${AMTAR-"${am_missing_run}tar"}
install_sh=${install_sh-"$am_aux_dir/install-sh"}
@@ -1464,17 +1513,23 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
# along with our hook.
ac_config_headers="$ac_config_headers config.h:config.hin"
# Initialize the test suite.
ac_config_commands="$ac_config_commands tests/package.m4"
ac_config_commands="$ac_config_commands tests/atconfig"
ac_config_files="$ac_config_files tests/bison"
ac_config_files="$ac_config_files tests/Makefile tests/atlocal"
# Needed by tests/atlocal.in.
# Checks for programs.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -1786,6 +1841,7 @@ fi
fi
test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable cc found in \$PATH" >&5
echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
{ (exit 1); exit 1; }; }
@@ -2230,6 +2286,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
doit:
@@ -2263,10 +2320,12 @@ if test "$am__include" = "#"; then
fi
fi
echo "$as_me:$LINENO: result: $_am_result" >&5
echo "${ECHO_T}$_am_result" >&6
rm -f confinc confmf
depcc="$CC" am_compiler_list=
echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
@@ -2335,6 +2394,8 @@ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2535,6 +2596,7 @@ 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
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then
@@ -2676,6 +2738,14 @@ 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
@@ -2723,6 +2793,7 @@ fi
done
if test "${ac_cv_header_minix_config_h+set}" = set; then
echo "$as_me:$LINENO: checking for minix/config.h" >&5
echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
@@ -2830,22 +2901,26 @@ else
MINIX=
fi
if test "$MINIX" = yes; then
cat >>confdefs.h <<\_ACEOF
#define _POSIX_SOURCE 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define _POSIX_1_SOURCE 2
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define _MINIX 1
_ACEOF
fi
echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
if test "${ac_cv_lib_cposix_strerror+set}" = set; then
@@ -2905,6 +2980,11 @@ if test $ac_cv_lib_cposix_strerror = yes; then
LIBS="$LIBS -lcposix"
fi
echo "$as_me:$LINENO: checking for ${CC-cc} option to accept ANSI C" >&5
echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6
if test "${am_cv_prog_cc_stdc+set}" = set; then
@@ -3085,8 +3165,10 @@ else
RANLIB="$ac_cv_prog_RANLIB"
fi
AUTOM4TE=${AUTOM4TE-"${am_missing_run}autom4te"}
# Check whether --enable-gcc-warnings or --disable-gcc-warnings was given.
if test "${enable_gcc_warnings+set}" = set; then
enableval="$enable_gcc_warnings"
@@ -3661,6 +3743,7 @@ cat >>confdefs.h <<\_ACEOF
#define _GNU_SOURCE 1
_ACEOF
# Checks for header files.
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
@@ -3801,6 +3884,12 @@ _ACEOF
fi
for ac_header in ctype.h locale.h memory.h stdlib.h string.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -3914,6 +4003,7 @@ fi
done
# Checks for typedefs.
# Checks for structures.
@@ -4167,6 +4257,8 @@ _ACEOF
;;
esac
echo "$as_me:$LINENO: checking for function prototypes" >&5
echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6
if test "$am_cv_prog_cc_stdc" != no; then
@@ -4323,6 +4415,7 @@ _ACEOF
fi
for ac_header in string.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -4436,6 +4529,8 @@ fi
done
# Checks for library functions.
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
@@ -4576,6 +4671,7 @@ cat >>confdefs.h <<\_ACEOF
#define C_ALLOCA 1
_ACEOF
echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
if test "${ac_cv_os_cray+set}" = set; then
@@ -4741,8 +4837,11 @@ cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
_ACEOF
fi
for ac_func in mkstemp setlocale
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -4872,11 +4971,13 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STPCPY 1
_ACEOF
else
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STPCPY 0
_ACEOF
fi
echo "$as_me:$LINENO: checking whether strndup is declared" >&5
echo $ECHO_N "checking whether strndup is declared... $ECHO_C" >&6
@@ -4932,11 +5033,13 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRNDUP 1
_ACEOF
else
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRNDUP 0
_ACEOF
fi
echo "$as_me:$LINENO: checking whether strnlen is declared" >&5
echo $ECHO_N "checking whether strnlen is declared... $ECHO_C" >&6
@@ -4992,11 +5095,13 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRNLEN 1
_ACEOF
else
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRNLEN 0
_ACEOF
fi
echo "$as_me:$LINENO: checking whether memchr is declared" >&5
echo $ECHO_N "checking whether memchr is declared... $ECHO_C" >&6
@@ -5052,13 +5157,21 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_MEMCHR 1
_ACEOF
else
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_MEMCHR 0
_ACEOF
fi
for ac_func in stpcpy strndup strnlen strspn memchr
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -5136,10 +5249,14 @@ else
fi
done
cat >>confdefs.h <<\_ACEOF
#define HAVE_DONE_WORKING_MALLOC_CHECK 1
_ACEOF
echo "$as_me:$LINENO: checking for working malloc" >&5
echo $ECHO_N "checking for working malloc... $ECHO_C" >&6
if test "${jm_cv_func_working_malloc+set}" = set; then
@@ -5194,10 +5311,13 @@ _ACEOF
fi
cat >>confdefs.h <<\_ACEOF
#define HAVE_DONE_WORKING_REALLOC_CHECK 1
_ACEOF
echo "$as_me:$LINENO: checking for working realloc" >&5
echo $ECHO_N "checking for working realloc... $ECHO_C" >&6
if test "${jm_cv_func_working_realloc+set}" = set; then
@@ -5252,6 +5372,10 @@ _ACEOF
fi
for ac_func in isascii iswprint mbsinit
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -5327,6 +5451,7 @@ _ACEOF
fi
done
echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5
echo $ECHO_N "checking whether mbrtowc and mbstate_t are properly declared... $ECHO_C" >&6
if test "${jm_cv_func_mbrtowc+set}" = set; then
@@ -5380,6 +5505,12 @@ _ACEOF
fi
for ac_header in limits.h stddef.h stdlib.h string.h wchar.h wctype.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5632,6 +5763,7 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking whether backslash-a works in strings" >&5
echo $ECHO_N "checking whether backslash-a works in strings... $ECHO_C" >&6
if test "${ac_cv_c_backslash_a+set}" = set; then
@@ -5692,6 +5824,8 @@ _ACEOF
fi
for ac_header in stdlib.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5805,6 +5939,7 @@ fi
done
echo "$as_me:$LINENO: checking for mbstate_t" >&5
echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
if test "${ac_cv_type_mbstate_t+set}" = set; then
@@ -5862,6 +5997,7 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking for function prototypes" >&5
echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6
if test "$am_cv_prog_cc_stdc" != no; then
@@ -6018,6 +6154,7 @@ _ACEOF
fi
for ac_header in string.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -6131,6 +6268,12 @@ fi
done
for ac_func in strerror vprintf doprnt
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -6260,13 +6403,16 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRERROR 1
_ACEOF
else
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRERROR 0
_ACEOF
fi
echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5
echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_strerror_r+set}" = set; then
@@ -6321,13 +6467,17 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRERROR_R 1
_ACEOF
else
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRERROR_R 0
_ACEOF
fi
for ac_func in strerror_r
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -6653,6 +6803,7 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking if malloc debugging is wanted" >&5
echo $ECHO_N "checking if malloc debugging is wanted... $ECHO_C" >&6
@@ -6678,6 +6829,7 @@ else
echo "${ECHO_T}no" >&6
fi;
ALL_LINGUAS="de es et fr ja nl tr ru"
# Make sure we can run config.sub.
$ac_config_sub sun4 >/dev/null 2>&1 ||
@@ -6710,6 +6862,7 @@ build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$as_me:$LINENO: checking host system type" >&5
echo $ECHO_N "checking host system type... $ECHO_C" >&6
if test "${ac_cv_host+set}" = set; then
@@ -6731,6 +6884,7 @@ host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$as_me:$LINENO: checking for off_t" >&5
echo $ECHO_N "checking for off_t... $ECHO_C" >&6
if test "${ac_cv_type_off_t+set}" = set; then
@@ -6847,6 +7001,8 @@ _ACEOF
fi
for ac_header in stdlib.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -6960,6 +7116,7 @@ fi
done
for ac_func in getpagesize
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -7203,6 +7360,7 @@ _ACEOF
fi
rm -f conftest.mmap
echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5
echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6
if test "${ac_cv_gnu_library_2_1+set}" = set; then
@@ -7228,12 +7386,26 @@ else
fi
rm -f conftest*
fi
echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5
echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6
GLIBC21="$ac_cv_gnu_library_2_1"
for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h
do
@@ -7348,6 +7520,27 @@ fi
done
for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \
getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
strdup strtoul tsearch __argz_count __argz_stringify __argz_next
@@ -7425,6 +7618,10 @@ _ACEOF
fi
done
# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
if test "${with_libiconv_prefix+set}" = set; then
withval="$with_libiconv_prefix"
@@ -7612,6 +7809,8 @@ _ACEOF
LIBICONV="-liconv"
fi
echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
if test "${am_cv_langinfo_codeset+set}" = set; then
@@ -7732,6 +7931,7 @@ fi;
echo "$as_me:$LINENO: result: $USE_NLS" >&5
echo "${ECHO_T}$USE_NLS" >&6
BUILD_INCLUDED_LIBINTL=no
USE_INCLUDED_LIBINTL=no
INTLLIBS=
@@ -7759,6 +7959,9 @@ echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
CATOBJEXT=NONE
if test "${ac_cv_header_libintl_h+set}" = set; then
echo "$as_me:$LINENO: checking for libintl.h" >&5
echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6
@@ -7863,7 +8066,7 @@ fi
if test $ac_cv_header_libintl_h = yes; then
echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5
echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6
if test "${gt_cv_func_gnugettext1_libc+set}" = set; then
if test "${gt_cv_func_gnugettext2_libc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
@@ -7881,7 +8084,7 @@ int
main ()
{
bindtextdomain ("", "");
return (int) gettext ("") + _nl_msg_cat_cntr
return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr
;
return 0;
}
@@ -7898,21 +8101,21 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
gt_cv_func_gnugettext1_libc=yes
gt_cv_func_gnugettext2_libc=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
gt_cv_func_gnugettext1_libc=no
gt_cv_func_gnugettext2_libc=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5
echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6
echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext2_libc" >&5
echo "${ECHO_T}$gt_cv_func_gnugettext2_libc" >&6
if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
if test "$gt_cv_func_gnugettext2_libc" != "yes"; then
echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5
echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6
if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then
if test "${gt_cv_func_gnugettext2_libintl+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
gt_save_LIBS="$LIBS"
@@ -7932,7 +8135,7 @@ int
main ()
{
bindtextdomain ("", "");
return (int) gettext ("") + _nl_msg_cat_cntr
return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr
;
return 0;
}
@@ -7949,28 +8152,29 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
gt_cv_func_gnugettext1_libintl=yes
gt_cv_func_gnugettext2_libintl=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
gt_cv_func_gnugettext1_libintl=no
gt_cv_func_gnugettext2_libintl=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS="$gt_save_LIBS"
fi
echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5
echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6
echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext2_libintl" >&5
echo "${ECHO_T}$gt_cv_func_gnugettext2_libintl" >&6
fi
if test "$gt_cv_func_gnugettext1_libc" = "yes" \
|| { test "$gt_cv_func_gnugettext1_libintl" = "yes" \
if test "$gt_cv_func_gnugettext2_libc" = "yes" \
|| { test "$gt_cv_func_gnugettext2_libintl" = "yes" \
&& test "$PACKAGE" != gettext; }; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETTEXT 1
_ACEOF
if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
if test "$gt_cv_func_gnugettext2_libintl" = "yes"; then
INTLLIBS="-lintl $LIBICONV"
fi
@@ -8130,6 +8334,7 @@ else
echo "${ECHO_T}no" >&6
fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -8166,11 +8371,14 @@ else
echo "${ECHO_T}no" >&6
fi
CATOBJEXT=.gmo
fi
fi
if test "$CATOBJEXT" = "NONE"; then
nls_cv_use_gnu_gettext=yes
fi
@@ -8290,6 +8498,7 @@ else
echo "${ECHO_T}no" >&6
fi
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
@@ -8321,6 +8530,8 @@ echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6
fi
ac_config_commands="$ac_config_commands default-1"
if test "$PACKAGE" = gettext; then
BUILD_INCLUDED_LIBINTL=yes
fi
@@ -8389,15 +8600,29 @@ echo "${ECHO_T}$ac_prog_version" >&6
POFILES="$POFILES $lang.po"
done
nls_cv_header_intl=
nls_cv_header_libgt=
DATADIRNAME=share
INSTOBJEXT=.mo
GENCAT=gencat
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
@@ -8439,12 +8664,16 @@ echo "${ECHO_T}$LINGUAS" >&6
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
INTL_LIBTOOL_SUFFIX_PREFIX=
# This is necessary so that .o files in LIBOBJS are also built via
# the ANSI2KNR-filtering rules.
LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
ac_config_files="$ac_config_files Makefile config/Makefile intl/Makefile po/Makefile.in lib/Makefile src/Makefile doc/Makefile m4/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -8522,6 +8751,7 @@ fi
DEFS=-DHAVE_CONFIG_H
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -8585,6 +8815,7 @@ fi
{ $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
{ LC_MESSAGES=C; export LC_MESSAGES; }
# Name of the executable.
as_me=`(basename "$0") 2>/dev/null ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
@@ -8618,6 +8849,7 @@ if test "${PATH_SEPARATOR+set}" != set; then
rm -f conftest.sh
fi
as_lineno_1=$LINENO
as_lineno_2=$LINENO
as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
@@ -8704,6 +8936,7 @@ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;
exit
}
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C='
' ECHO_T=' ' ;;
@@ -8743,6 +8976,7 @@ as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
@@ -8919,8 +9153,11 @@ PACKAGE_BUGREPORT='$PACKAGE_BUGREPORT'
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
for ac_config_target in $ac_config_targets
do
@@ -9214,6 +9451,7 @@ ac_top_buildpath=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
ac_srcpath=`cd "$ac_dir" && cd $ac_srcdir && pwd`
ac_top_srcpath=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_builddir$INSTALL ;;
@@ -9570,6 +9808,7 @@ ac_top_buildpath=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
ac_srcpath=`cd "$ac_dir" && cd $ac_srcdir && pwd`
ac_top_srcpath=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
{ echo "$as_me:$LINENO: executing $ac_dest commands" >&5
echo "$as_me: executing $ac_dest commands" >&6;}
case $ac_dest in
@@ -9719,6 +9958,7 @@ _ACEOF
chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
@@ -9736,3 +9976,4 @@ if test "$no_create" != yes; then
# would make configure fail if this is the last instruction.
$ac_cs_success || { (exit 1); exit 1; }
fi

View File

@@ -90,12 +90,12 @@ jm_PREREQ_ERROR
AM_WITH_DMALLOC
ALL_LINGUAS="de es et fr ja nl tr ru"
AM_GNU_GETTEXT
AM_GNU_GETTEXT(, need-ngettext)
# This is necessary so that .o files in LIBOBJS are also built via
# the ANSI2KNR-filtering rules.
LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
AC_SUBST(LIBOBJS)
LIB@&t@OBJS=`echo $LIB@&t@OBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
AC_SUBST(LIB@&t@OBJS)
AC_OUTPUT([Makefile
config/Makefile

View File

@@ -84,8 +84,8 @@ INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIB = @LIB@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@

View File

@@ -31,115 +31,115 @@ instead of in the original English.

Indirect:
bison.info-1: 1313
bison.info-2: 50689
bison.info-3: 100579
bison.info-4: 147579
bison.info-5: 197449
bison.info-2: 50690
bison.info-3: 100580
bison.info-4: 147602
bison.info-5: 197472

Tag Table:
(Indirect)
Node: Top1313
Node: Introduction8967
Node: Conditions10242
Node: Copying11706
Node: Concepts30909
Node: Language and Grammar31988
Node: Grammar in Bison37004
Node: Semantic Values38928
Node: Semantic Actions41029
Node: Locations Overview42218
Node: Bison Parser43665
Node: Stages45977
Node: Grammar Layout47260
Node: Examples48517
Node: RPN Calc49715
Node: Rpcalc Decls50689
Node: Rpcalc Rules52276
Node: Rpcalc Input54076
Node: Rpcalc Line55537
Node: Rpcalc Expr56652
Node: Rpcalc Lexer58597
Node: Rpcalc Main61169
Node: Rpcalc Error61567
Node: Rpcalc Gen62575
Node: Rpcalc Compile63724
Node: Infix Calc64599
Node: Simple Error Recovery67306
Node: Location Tracking Calc69195
Node: Ltcalc Decls69925
Node: Ltcalc Rules70834
Node: Ltcalc Lexer72895
Node: Multi-function Calc75233
Node: Mfcalc Decl76800
Node: Mfcalc Rules78823
Node: Mfcalc Symtab80203
Node: Exercises86576
Node: Grammar File87082
Node: Grammar Outline87930
Node: C Declarations88664
Node: Bison Declarations89244
Node: Grammar Rules89656
Node: C Code90116
Node: Symbols91046
Node: Rules96127
Node: Recursion97766
Node: Semantics99485
Node: Value Type100579
Node: Multiple Types101251
Node: Actions102268
Node: Action Types105053
Node: Mid-Rule Actions106356
Node: Locations111926
Node: Location Type112574
Node: Actions and Locations113132
Node: Location Default Action115288
Node: Declarations116751
Node: Token Decl118070
Node: Precedence Decl120083
Node: Union Decl121634
Node: Type Decl122478
Node: Expect Decl123384
Node: Start Decl124930
Node: Pure Decl125308
Node: Decl Summary126985
Node: Multiple Parsers133113
Node: Interface134607
Node: Parser Function135479
Node: Lexical136314
Node: Calling Convention137720
Node: Token Values140491
Node: Token Positions141640
Node: Pure Calling142525
Node: Error Reporting145457
Node: Action Features147579
Node: Algorithm150874
Node: Look-Ahead153167
Node: Shift/Reduce155299
Node: Precedence158211
Node: Why Precedence158862
Node: Using Precedence160727
Node: Precedence Examples161695
Node: How Precedence162396
Node: Contextual Precedence163545
Node: Parser States165336
Node: Reduce/Reduce166579
Node: Mystery Conflicts170140
Node: Stack Overflow173526
Node: Error Recovery174899
Node: Context Dependency180035
Node: Semantic Tokens180883
Node: Lexical Tie-ins183900
Node: Tie-in Recovery185448
Node: Debugging187620
Node: Invocation190921
Node: Bison Options192173
Node: Environment Variables195723
Node: Option Cross Key196571
Node: VMS Invocation197449
Node: Table of Symbols198233
Node: Glossary206201
Node: Copying This Manual212505
Node: GNU Free Documentation License212714
Node: Index232579
Node: Introduction8968
Node: Conditions10243
Node: Copying11707
Node: Concepts30910
Node: Language and Grammar31989
Node: Grammar in Bison37005
Node: Semantic Values38929
Node: Semantic Actions41030
Node: Locations Overview42219
Node: Bison Parser43666
Node: Stages45978
Node: Grammar Layout47261
Node: Examples48518
Node: RPN Calc49716
Node: Rpcalc Decls50690
Node: Rpcalc Rules52277
Node: Rpcalc Input54077
Node: Rpcalc Line55538
Node: Rpcalc Expr56653
Node: Rpcalc Lexer58598
Node: Rpcalc Main61170
Node: Rpcalc Error61568
Node: Rpcalc Gen62576
Node: Rpcalc Compile63725
Node: Infix Calc64600
Node: Simple Error Recovery67307
Node: Location Tracking Calc69196
Node: Ltcalc Decls69926
Node: Ltcalc Rules70835
Node: Ltcalc Lexer72896
Node: Multi-function Calc75234
Node: Mfcalc Decl76801
Node: Mfcalc Rules78824
Node: Mfcalc Symtab80204
Node: Exercises86577
Node: Grammar File87083
Node: Grammar Outline87931
Node: C Declarations88665
Node: Bison Declarations89245
Node: Grammar Rules89657
Node: C Code90117
Node: Symbols91047
Node: Rules96128
Node: Recursion97767
Node: Semantics99486
Node: Value Type100580
Node: Multiple Types101252
Node: Actions102269
Node: Action Types105054
Node: Mid-Rule Actions106357
Node: Locations111927
Node: Location Type112575
Node: Actions and Locations113133
Node: Location Default Action115289
Node: Declarations116752
Node: Token Decl118071
Node: Precedence Decl120084
Node: Union Decl121635
Node: Type Decl122479
Node: Expect Decl123385
Node: Start Decl124953
Node: Pure Decl125331
Node: Decl Summary127008
Node: Multiple Parsers133136
Node: Interface134630
Node: Parser Function135502
Node: Lexical136337
Node: Calling Convention137743
Node: Token Values140514
Node: Token Positions141663
Node: Pure Calling142548
Node: Error Reporting145480
Node: Action Features147602
Node: Algorithm150897
Node: Look-Ahead153190
Node: Shift/Reduce155322
Node: Precedence158234
Node: Why Precedence158885
Node: Using Precedence160750
Node: Precedence Examples161718
Node: How Precedence162419
Node: Contextual Precedence163568
Node: Parser States165359
Node: Reduce/Reduce166602
Node: Mystery Conflicts170163
Node: Stack Overflow173549
Node: Error Recovery174922
Node: Context Dependency180058
Node: Semantic Tokens180906
Node: Lexical Tie-ins183923
Node: Tie-in Recovery185471
Node: Debugging187643
Node: Invocation190944
Node: Bison Options192196
Node: Environment Variables195746
Node: Option Cross Key196594
Node: VMS Invocation197472
Node: Table of Symbols198256
Node: Glossary206224
Node: Copying This Manual212528
Node: GNU Free Documentation License212737
Node: Index232602

End Tag Table

View File

@@ -34,7 +34,7 @@ File: bison.info, Node: Top, Next: Introduction, Up: (dir)
Bison
*****
This manual documents version 1.30b of Bison, updated 5 November
This manual documents version 1.30b of Bison, updated 12 November
2001.
* Menu:

View File

@@ -623,19 +623,20 @@ Suppressing Conflict Warnings
Bison normally warns if there are any conflicts in the grammar
(*note Shift/Reduce Conflicts: Shift/Reduce.), but most real grammars
have harmless shift/reduce conflicts which are resolved in a
predictable way and would be difficult to eliminate. It is desirable
to suppress the warning about these conflicts unless the number of
conflicts changes. You can do this with the `%expect' declaration.
have harmless shift/reduce conflicts which are resolved in a predictable
way and would be difficult to eliminate. It is desirable to suppress
the warning about these conflicts unless the number of conflicts
changes. You can do this with the `%expect' declaration.
The declaration looks like this:
%expect N
Here N is a decimal integer. The declaration says there should be no
warning if there are N shift/reduce conflicts and no reduce/reduce
conflicts. The usual warning is given if there are either more or fewer
conflicts, or if there are any reduce/reduce conflicts.
Here N is a decimal integer. The declaration says there should be
no warning if there are N shift/reduce conflicts and no reduce/reduce
conflicts. An error, instead of the usual warning, is given if there
are either more or fewer conflicts, or if there are any reduce/reduce
conflicts.
In general, using `%expect' involves these steps:

View File

@@ -3070,11 +3070,11 @@ terminal symbol. All kinds of token declarations allow
@findex %expect
Bison normally warns if there are any conflicts in the grammar
(@pxref{Shift/Reduce, ,Shift/Reduce Conflicts}), but most real grammars have harmless shift/reduce
conflicts which are resolved in a predictable way and would be difficult to
eliminate. It is desirable to suppress the warning about these conflicts
unless the number of conflicts changes. You can do this with the
@code{%expect} declaration.
(@pxref{Shift/Reduce, ,Shift/Reduce Conflicts}), but most real grammars
have harmless shift/reduce conflicts which are resolved in a predictable
way and would be difficult to eliminate. It is desirable to suppress
the warning about these conflicts unless the number of conflicts
changes. You can do this with the @code{%expect} declaration.
The declaration looks like this:
@@ -3082,10 +3082,11 @@ The declaration looks like this:
%expect @var{n}
@end example
Here @var{n} is a decimal integer. The declaration says there should be no
warning if there are @var{n} shift/reduce conflicts and no reduce/reduce
conflicts. The usual warning is given if there are either more or fewer
conflicts, or if there are any reduce/reduce conflicts.
Here @var{n} is a decimal integer. The declaration says there should be
no warning if there are @var{n} shift/reduce conflicts and no
reduce/reduce conflicts. An error, instead of the usual warning, is
given if there are either more or fewer conflicts, or if there are any
reduce/reduce conflicts.
In general, using @code{%expect} involves these steps:

View File

@@ -1,4 +1,4 @@
@set UPDATED 5 November 2001
@set UPDATED 12 November 2001
@set UPDATED-MONTH November 2001
@set EDITION 1.30b
@set VERSION 1.30b

View File

@@ -1,4 +1,4 @@
@set UPDATED 5 November 2001
@set UPDATED 12 November 2001
@set UPDATED-MONTH November 2001
@set EDITION 1.30b
@set VERSION 1.30b

View File

@@ -84,8 +84,8 @@ INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIB = @LIB@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@

View File

@@ -84,8 +84,8 @@ INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIB = @LIB@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@

View File

@@ -84,8 +84,8 @@ INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIB = @LIB@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@

View File

@@ -19,6 +19,7 @@
02111-1307, USA. */
#include "system.h"
#include "complain.h"
#include "getargs.h"
#include "files.h"
#include "gram.h"
@@ -29,7 +30,8 @@
#include "LR0.h"
errs **err_table = NULL;
int expected_conflicts;
/* -1 stands for not specified. */
int expected_conflicts = -1;
static char *conflicts = NULL;
static unsigned *shiftset = NULL;
@@ -404,31 +406,23 @@ conflict_report (int src_num, int rrc_num)
static char res[4096];
char *cp = res;
if (src_num == 1)
if (src_num >= 1)
{
sprintf (cp, _(" 1 shift/reduce conflict"));
cp += strlen (cp);
}
else if (src_num > 1)
{
sprintf (cp, _(" %d shift/reduce conflicts"), src_num);
sprintf (cp, ngettext ("%d shift/reduce conflict",
"%d shift/reduce conflicts", src_num), src_num);
cp += strlen (cp);
}
if (src_num > 0 && rrc_num > 0)
{
sprintf (cp, _(" and"));
sprintf (cp, " %s ", _("and"));
cp += strlen (cp);
}
if (rrc_num == 1)
if (rrc_num >= 1)
{
sprintf (cp, _(" 1 reduce/reduce conflict"));
cp += strlen (cp);
}
else if (rrc_num > 1)
{
sprintf (cp, _(" %d reduce/reduce conflicts"), rrc_num);
sprintf (cp, ngettext ("%d reduce/reduce conflict",
"%d reduce/reduce conflicts", rrc_num), rrc_num);
cp += strlen (cp);
}
@@ -451,7 +445,7 @@ conflicts_output (FILE *out)
for (i = 0; i < nstates; i++)
if (conflicts[i])
{
fprintf (out, _("State %d contains"), i);
fprintf (out, _("State %d contains "), i);
fputs (conflict_report (count_sr_conflicts (i),
count_rr_conflicts (i)), out);
}
@@ -495,9 +489,19 @@ conflicts_print (void)
}
else
{
fprintf (stderr, _("%s contains"), infile);
fprintf (stderr, _("%s contains "), infile);
fputs (conflict_report (src_total, rrc_total), stderr);
}
if (expected_conflicts != -1
&& src_total != expected_conflicts)
{
complain_message_count++;
fprintf (stderr, ngettext ("expected %d shift/reduce conflict",
"expected %d shift/reduce conflicts",
expected_conflicts),
expected_conflicts);
}
}

View File

@@ -62,15 +62,16 @@ main (int argc, char *argv[])
if (complain_message_count)
exit (1);
/* find useless nonterminals and productions and reduce the grammar. In
file reduce.c */
/* Find useless nonterminals and productions and reduce the grammar.
In file reduce.c. */
reduce_grammar ();
/* record other info about the grammar. In files derives and nullable. */
/* Record other info about the grammar. In files derives and
nullable. */
set_derives ();
set_nullable ();
/* convert to nondeterministic finite state machine. In file LR0.
/* Convert to nondeterministic finite state machine. In file LR0.
See state.h for more info. */
generate_states ();
@@ -101,14 +102,14 @@ main (int argc, char *argv[])
/* Output the tables and the parser to ftable. In file output. */
output ();
/* Close the input files. */
close_files ();
/* Free the symbol table data structure. */
free_symtab ();
lex_free ();
/* Close the input files. */
close_files ();
reduce_free ();
free_conflicts ();
free_nullable ();

View File

@@ -84,8 +84,8 @@ INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIB = @LIB@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@

View File

@@ -239,6 +239,66 @@ state 6
AT_CLEANUP(input.c input.output)
## -------------------- ##
## %expect not enough. ##
## -------------------- ##
AT_SETUP([%expect not enough])
AT_DATA([input.y],
[[%token NUM OP
%expect 0
%%
exp: exp OP exp | NUM;
]])
AT_CHECK([bison input.y -o input.c], 1, [],
[input.y contains 1 shift/reduce conflict.
expected 0 shift/reduce conflicts
])
AT_CLEANUP(input.c)
## --------------- ##
## %expect right. ##
## --------------- ##
AT_SETUP([%expect right])
AT_DATA([input.y],
[[%token NUM OP
%expect 1
%%
exp: exp OP exp | NUM;
]])
AT_CHECK([bison input.y -o input.c], 0, [],
[input.y contains 1 shift/reduce conflict.
])
AT_CLEANUP(input.c)
## ------------------ ##
## %expect too much. ##
## ------------------ ##
AT_SETUP([%expect too much])
AT_DATA([input.y],
[[%token NUM OP
%expect 2
%%
exp: exp OP exp | NUM;
]])
AT_CHECK([bison input.y -o input.c], 1, [],
[input.y contains 1 shift/reduce conflict.
expected 2 shift/reduce conflicts
])
AT_CLEANUP(input.c)
## ---------------------- ##
## Mixing %token styles. ##
## ---------------------- ##