* NEWS: Version 2.0b.

* data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
the user's name space.  All uses changed to __attribute__
((__unused__)).
(yyFail, yyMemoryExhausted, yyreportAmbiguity):
Add __attribute__ ((__noreturn__)).

* etc/clcommit: Remove.  We weren't using it, and it failed
"make maintainer-distcheck".
* Makefile.maint: Merge from coreutils.
(CVS_LIST, CVS_LIST_EXCEPT): New macros.
(syntax-check-rules): Change list of rules as described below.
(sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
(sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
(sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
(sc_trailing_space): New rules.
(sc_xalloc_h_in_src): Remove.
(sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
(sc_space_tab, sc_error_exit_success, sc_changelog):
(sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
(makefile-check, po-check, author_mark_check):
(makefile_path_separator_check, copyright-check):
Use grep -n, to make it easier to find violations.
Use CVS_LIST and CVS_LIST_EXCEPT.
(header_regexp, h_re): Remove.
(dd_c): New macro.
(sc_dd_max_sym_length, .re-list, news-date-check): New rules.
(my-distcheck): Use more-modern GCC flags.
(signatures, %.asc): Remove.
(rel-files, announcement): Remove signatures.
Restore old updating code, even though we don't use it, so
that we're the same as coreutils.
(alpha, beta, major): Depend on news-date-check.
Make the upload commands.

* data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
* lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
* lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
* lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
* src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
* src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
* src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
* tests/sets.at: Likewise.

* data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
we comment out the Autoconf version number.
* doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
it's error-prone and "make maintainer-distcheck" rejects it.

* lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
Indent calls to "error" to pacify "make maintainer-distcheck",
when the calls are not intended to be translated.
* m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.

* src/Makefile.am (DEFS): Use +=, to pacify
"make maintainer-distcheck".
(bison_SOURCES): Add scan-skel.h.
(sc_tight_scope): New rule, from coreutils.

* src/files.c (src_extension, header_extension):
Now static, not extern.
* src/getargs.c (short_options): Likewise.
* src/muscle_tab.c (muscle_table): Likewise.
* src/parse-gram.y (current_class, current_type, current_prec):
Likewise.
* src/reader.c (grammar_end, previous_rule_end): Likewise.
* src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
* src/main.c (main): Cast bindtextdomain and textdomain calls to
void, to avoid warning when NLS is disabled.
* src/output.c: Include scan-skel.h.
(scan_skel): Remove decl, since scan-skel.h does this.
(output_skeleton):
Indent calls to "error" to pacify "make maintainer-distcheck".
* src/print_graph.c: Don't include <obstack.h>, as system.h does this.
* src/reader.h (gram_end, gram_lineno): New decls to pacify
"make maintainer-distcheck".
* src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
(skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
(skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
(skel_lex_destroy, scan_skel): Move these decls to...
* src/scan-skel.h: New file.
* src/uniqstr.c (uniqstr_assert):
Indent calls to "error" to pacify "make maintainer-distcheck".

* tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
not @VAR@.

* tests/torture.at: Revamp to avoid misuse of atoi that
"make maintainer-distcheck" complained about.
This commit is contained in:
Paul Eggert
2005-07-24 07:24:22 +00:00
parent 135bc829bd
commit 040984073a
46 changed files with 1008 additions and 1026 deletions

165
ChangeLog
View File

@@ -1,3 +1,139 @@
2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: Version 2.0b.
* data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
the user's name space. All uses changed to __attribute__
((__unused__)).
(yyFail, yyMemoryExhausted, yyreportAmbiguity):
Add __attribute__ ((__noreturn__)).
* etc/clcommit: Remove. We weren't using it, and it failed
"make maintainer-distcheck".
* Makefile.maint: Merge from coreutils.
(CVS_LIST, CVS_LIST_EXCEPT): New macros.
(syntax-check-rules): Change list of rules as described below.
(sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
(sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
(sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
(sc_trailing_space): New rules.
(sc_xalloc_h_in_src): Remove.
(sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
(sc_space_tab, sc_error_exit_success, sc_changelog):
(sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
(makefile-check, po-check, author_mark_check):
(makefile_path_separator_check, copyright-check):
Use grep -n, to make it easier to find violations.
Use CVS_LIST and CVS_LIST_EXCEPT.
(header_regexp, h_re): Remove.
(dd_c): New macro.
(sc_dd_max_sym_length, .re-list, news-date-check): New rules.
(my-distcheck): Use more-modern GCC flags.
(signatures, %.asc): Remove.
(rel-files, announcement): Remove signatures.
Restore old updating code, even though we don't use it, so
that we're the same as coreutils.
(alpha, beta, major): Depend on news-date-check.
Make the upload commands.
* data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
* lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
* lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
* lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
* src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
* src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
* src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
* tests/sets.at: Likewise.
* data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
we comment out the Autoconf version number.
* doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
it's error-prone and "make maintainer-distcheck" rejects it.
* lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
Indent calls to "error" to pacify "make maintainer-distcheck",
when the calls are not intended to be translated.
* m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
* src/Makefile.am (DEFS): Use +=, to pacify
"make maintainer-distcheck".
(bison_SOURCES): Add scan-skel.h.
(sc_tight_scope): New rule, from coreutils.
* src/files.c (src_extension, header_extension):
Now static, not extern.
* src/getargs.c (short_options): Likewise.
* src/muscle_tab.c (muscle_table): Likewise.
* src/parse-gram.y (current_class, current_type, current_prec):
Likewise.
* src/reader.c (grammar_end, previous_rule_end): Likewise.
* src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
* src/main.c (main): Cast bindtextdomain and textdomain calls to
void, to avoid warning when NLS is disabled.
* src/output.c: Include scan-skel.h.
(scan_skel): Remove decl, since scan-skel.h does this.
(output_skeleton):
Indent calls to "error" to pacify "make maintainer-distcheck".
* src/print_graph.c: Don't include <obstack.h>, as system.h does this.
* src/reader.h (gram_end, gram_lineno): New decls to pacify
"make maintainer-distcheck".
* src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
(skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
(skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
(skel_lex_destroy, scan_skel): Move these decls to...
* src/scan-skel.h: New file.
* src/uniqstr.c (uniqstr_assert):
Indent calls to "error" to pacify "make maintainer-distcheck".
* tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
not @VAR@.
* tests/torture.at: Revamp to avoid misuse of atoi that
"make maintainer-distcheck" complained about.
* examples/extexi (message): Don't print a message more than once,
and omit line-number decoration that makes Emacs compile think
that informative messages are worth worrying about.
2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
* configure.ac: Update version number.
* Makefile.am (SUBDIRS): Add examples; somehow this got removed
accidentally.
* examples/calc++/calc++-parser.yy: Remove from CVS, as it's
autogenerated by the maintainer.
* examples/calc++/.cvsignore: Add *.yy.
* lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
* lib/bitset_stats.c (bitset_stats_init): Likewise.
* lib/bitsetv.c (bitsetv_alloc): Likewise.
* po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
* src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
from maintainer-distcheck about casting the argument of 'free'.
* NEWS: Mention recent yytname changes.
* THANKS: Add Anthony Heading, twlevo@xs4all.nl.
* bootstrap: For translations that have not yet been upgraded to
the new runtime-po domain, prime the pump by extracting the
relevant strings from the obsolete translations. This code can be
removed once the bison-runtime domain has been translated by each
team.
* src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
now that token names are already quoted.
Fix problem reported by Anthony Heading.
* data/glr.c (YYTOKEN_TABLE): New macro.
(yytname): Define if YYTOKEN_TABLE.
* data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
* data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
(YYERROR_VERBOSE): Define the same way the other skeletons do.
* src/output.c (prepare_symbols): Output token_table_flag.
2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
* data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
@@ -1283,7 +1419,7 @@
line.
2004-10-22 Akim Demaille <akim@epita.fr>
and Paul Eggert <eggert@cs.ucla.edu>
and Paul Eggert <eggert@cs.ucla.edu>
Remove some arbitrary limits on goto numbers and relations.
* src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
@@ -1513,7 +1649,7 @@
2004-09-06 Akim Demaille <akim@epita.fr>
* data/lalr1.cc: Adjust the indentation of the labels.
(Parser::pop): New.
(Parser::pop): New.
Use it.
2004-09-06 Akim Demaille <akim@epita.fr>
@@ -13886,24 +14022,13 @@
* REFERENCES: entered into RCS
-----
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-----
This file is part of Bison, the GNU Compiler Compiler.
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
Foundation, Inc.
Bison 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 2, or (at your option)
any later version.
Bison 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 Bison; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Copying and distribution of this file, with or without
modification, are permitted provided the copyright notice and this
notice are preserved.

View File

@@ -2,7 +2,7 @@
# This Makefile fragment is shared between the coreutils,
# CPPI, Bison, and Autoconf.
## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
## Copyright (C) 2001, 2002, 2003, 2004, 2005 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
@@ -24,6 +24,7 @@
ME := Makefile.maint
# Do not save the original name or timestamp in the .tar.gz file.
# Use --rsyncable if available.
GZIP_ENV = \
"--no-name --best$$( \
case $$(gzip --help) in \
@@ -33,6 +34,20 @@ GZIP_ENV = \
CVS = cvs
CVS_LIST = sh -c ' \
(cvsu --find --types=AFGM $$*) 2>/dev/null || \
awk -F/ '\''{ \
if (!$$1 && $$3 !~ /^-/) { \
f=FILENAME; \
sub(/CVS\/Entries/, "", f); \
print f $$2; \
}}'\'' \
$$(find $${*-*} -name Entries -print) /dev/null \
' dummy
CVS_LIST_EXCEPT = \
$(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
ifeq ($(origin prev_version_file), undefined)
prev_version_file = .prev-version
endif
@@ -69,126 +84,184 @@ local-checks-available = \
local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
# Make sure C source files in src/ don't include xalloc.h directly,
# since they all already include it via sys2.h.
# It's not a big deal -- just aesthetics.
.PHONY: $(syntax-check-rules)
syntax-check-rules = \
sc_cast_of_argument_to_free \
sc_cast_of_x_alloc_return_value \
sc_cast_of_alloca_return_value \
sc_changelog \
sc_dd_max_sym_length \
sc_error_exit_success \
sc_file_system \
sc_obsolete_symbols \
sc_prohibit_atoi_atof \
sc_prohibit_jm_in_m4 \
sc_root_tests \
sc_space_tab \
sc_sun_os_names \
sc_system_h_headers \
sc_unmarked_diagnostics \
sc_xalloc_h_in_src
sc_tight_scope \
sc_trailing_space \
sc_unmarked_diagnostics
syntax-check: $(syntax-check-rules)
# @grep -E '# *include <(limits|std(def|arg|bool))\.h>' \
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
# $$(find -type f -name '*.[chly]') && \
# { echo '$(ME): found conditional include' 1>&2; \
# exit 1; } || :
# grep -E '^# *include <(string|stdlib)\.h>' \
# grep -nE '^# *include <(string|stdlib)\.h>' \
# $(srcdir)/{lib,src}/*.[chy] && \
# { echo '$(ME): FIXME' 1>&2; \
# exit 1; } || :
# FIXME: don't allow `#include .strings\.h' anywhere
# Look for diagnostics that aren't marked for translation.
# This won't find any for which error's format string is on a separate line.
sc_unmarked_diagnostics:
@grep --exclude=$(srcdir)/src/shred.c -E \
'\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c \
| grep -v '_(' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
sc_cast_of_argument_to_free:
@grep -E '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
@grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
exit 1; } || :
sc_cast_of_x_alloc_return_value:
@grep -E --exclude=$(srcdir)/lib/regex.c \
'\*\) *x(m|c|re)alloc\>' $(srcdir)/{lib,src}/*.[chy] && \
@grep -nE --exclude=$(srcdir)/lib/regex.c \
'\*\) *x(m|c|re)alloc\>' \
$(srcdir)/{lib,src}/*.[chy] && \
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
exit 1; } || :
sc_cast_of_alloca_return_value:
@grep -nE '\*\) *alloca\>' \
$(srcdir)/src/*.[chy] && \
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
exit 1; } || :
sc_space_tab:
@( cvsu --list ) > /dev/null 2>&1 || : && \
grep '[ ] ' \
$$(cvsu --list | grep -vEf .x-$@ ) && \
@grep -n '[ ] ' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
1>&2; exit 1; } || :
# Don't use the old ato* functions in `real' code.
# They provide no error checking mechanism.
# Instead, use strto* functions.
sc_prohibit_atoi_atof:
@grep -nE '\<(ato[filq]|ato''ll)\>' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \
1>&2; exit 1; } || :
# Using EXIT_SUCCESS as the first argument to error is misleading,
# since when that parameter is 0, error does not exit. Use `0' instead.
sc_error_exit_success:
@grep -F 'error (EXIT_SUCCESS,' \
@grep -nF 'error (EXIT_SUCCESS,' \
$$(find -type f -name '*.[chly]') && \
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
exit 1; } || :
# FIXME: merge this with sc_system_h_headers below.
# xalloc.h is included via system.h, so should not be included
# directly by any file in src/.
sc_xalloc_h_in_src:
@if test -f $(srcdir)/src/sys2.h; then \
if grep 'xalloc\.h' $(srcdir)/src/*.c; then \
exit 1; \
fi; \
fi
sc_file_system:
@grep -ni 'file''system' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found use of "file''system";' \
'rewrite to use "file system"' 1>&2; \
exit 1; } || :
sc_obsolete_symbols:
@grep -nE '\<(HAVE_''FCNTL_H)\>' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): do not use HAVE_''FCNTL_H' \
1>&2; exit 1; } || :
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
# Each nonempty line must start with a year number, or a TAB.
sc_changelog:
@grep '^[^12 ]' $$(find . -name ChangeLog -maxdepth 2) && \
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
exit 1; } || :
header_regexp = \
alloca\
|closeout\
|ctype\
|dirent\
|errno\
|fcntl\
|inttypes\
|limits\
|locale\
|pathmax\
|std(lib|bool)\
|string\
|sys/(stat|dir|time)\
|time\
|unistd\
|utime\
|version-etc\
|xalloc
h_re := $(shell echo '$(header_regexp)'|tr -d ' ')
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
# with the strings from the two affected variables.
dd_c = $(srcdir)/src/dd.c
sc_dd_max_sym_length:
ifneq ($(wildcard $(dd_c)),)
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
| wc --max-line-length); \
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|tr -d '"' | wc --max-line-length); \
if test "$$len" = "$$max"; then :; else \
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
exit 1; \
fi
endif
# Many m4 macros names once began with `jm_'.
# On 2004-04-13, they were all changed to start with gl_ instead.
# Make sure that none are inadvertently reintroduced.
sc_prohibit_jm_in_m4:
@grep -nE 'jm_[A-Z]' \
$$($(CVS_LIST) $(srcdir)/m4 |grep '\.m4$$') && \
{ echo '$(ME): do not use jm_ in m4 macro names' \
1>&2; exit 1; } || :
sc_root_tests:
@t1=sc-root.expected; t2=sc-root.actual; \
grep -nl '^PRIV_CHECK_ARG=require-root' \
$$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
$(srcdir)/tests/Makefile.am |sort > $$t2; \
diff -u $$t1 $$t2 || diff=1; \
rm -f $$t1 $$t2; \
test "$$diff" \
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
exit 1; } || :
# Create a list of regular expressions matching the names
# of files included from system.h. Exclude a couple.
.re-list:
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
| grep -Ev 'sys/(param|file)\.h' \
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
> $@-t
@mv $@-t $@
# Files in src/ should not include directly any of
# the headers already included via system.h.
# Get list of candidates with this:
# grep -h include src/sys*.h|sed 's/.*include //'|sort -
sc_system_h_headers:
@( cvsu --list ) > /dev/null 2>&1 || : && \
grep -E '^# *include ["<]($(h_re))\.h[">]' \
$$(cvsu --list src | grep -Ev 'sys(2|tem)\.h$$') \
&& { echo '$(ME): the above are already included via system.h'\
1>&2; exit 1; } || :
sc_system_h_headers: .re-list
if test -f $(srcdir)/src/system.h; then \
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
grep -nE -f .re-list \
$$($(CVS_LIST) src | \
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
&& { echo '$(ME): the above are already included via system.h'\
1>&2; exit 1; } || :; \
fi
sc_sun_os_names:
@( cvsu --list ) > /dev/null 2>&1 || : && \
grep -Ei \
@grep -nEi \
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
$$(cvsu --list | grep -vEf .x-$@ ) && \
$$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
exit 1; } || :
sc_tight_scope:
$(MAKE) -C src $@
sc_trailing_space:
@grep -n '[ ]$$' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found trailing space(s)' \
1>&2; exit 1; } || :
# Look for diagnostics that aren't marked for translation.
# This won't find any for which error's format string is on a separate line.
sc_unmarked_diagnostics:
@grep -nE \
'\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c \
| grep -v '_(' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
# Ensure that date's --help output stays in sync with the info
# documentation for GNU strftime. The only exception is %N,
# which date accepts but GNU strftime does not.
@@ -208,8 +281,17 @@ strftime-check:
# not @...@ in Makefile.am, now that we can rely on automake
# to emit a definition for each substituted variable.
makefile-check:
grep -E '@[A-Z_0-9]+@' `find . -name Makefile.am` \
&& { echo 'Makefile.maint: use $(...), not @...@' 1>&2; exit 1; } || :
grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
&& { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
news-date-check: NEWS
today=`date +%Y-%m-%d`; \
if head NEWS | grep '^\*.*'$$today >/dev/null; then \
:; \
else \
echo "today's date is not in NEWS" 1>&2; \
exit 1; \
fi
changelog-check:
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
@@ -225,28 +307,30 @@ m4-check:
exit 1; } || :
# Verify that all source files using _() are listed in po/POTFILES.in.
# FIXME: don't hard-code src/false.c below; use a more general mechanism.
po-check:
if test -f po/POTFILES.in; then \
grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
files=; \
if test -f po/POTFILES.in; then \
grep -E -v '^(#|$$)' po/POTFILES.in \
| grep -v '^src/false\.c$$' | sort > $@-1; \
files=; \
for file in lib/*.[chly] src/*.[chly]; do \
case $$file in \
*.[ch]) \
base=`expr " $$file" : ' \(.*\)\..'`; \
{ test -f $$base.l || test -f $$base.y; } && continue;; \
esac; \
files="$$files $$file"; \
done; \
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort > $@-2; \
diff -u $@-1 $@-2 || exit 1; \
rm -f $@-1 $@-2; \
case $$file in \
*.[ch]) \
base=`expr " $$file" : ' \(.*\)\..'`; \
{ test -f $$base.l || test -f $$base.y; } && continue;; \
esac; \
files="$$files $$file"; \
done; \
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort > $@-2; \
diff -u $@-1 $@-2 || exit 1; \
rm -f $@-1 $@-2; \
fi
# In a definition of #define AUTHORS "... and ..." where the RHS contains
# the English word `and', the string must be marked with `N_ (...)' so that
# gettext recognizes it as a string requiring translation.
author_mark_check:
@grep '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
exit 1; } || :
@@ -258,7 +342,7 @@ author_mark_check:
# that we'd have to worry about limits on command line length.
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
makefile_path_separator_check:
@grep 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
&& { echo $(msg) 1>&2; exit 1; } || :
# Check that `make alpha' will not fail at the end of the process.
@@ -279,7 +363,7 @@ v_etc_file = lib/version-etc.c
# Make sure that the copyright date in $(v_etc_file) is up to date.
copyright-check:
@if test -f $(v_etc_file); then \
grep '"Copyright (C) $(shell date +%Y) Free' $(v_etc_file) \
grep 'enum { COPYRIGHT_YEAR = 2005 };' $(v_etc_file) \
>/dev/null \
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
exit 1; }; \
@@ -330,21 +414,23 @@ null_AM_MAKEFLAGS = \
# Detect format-string/arg-list mismatches that would normally be obscured
# by the use of _(). The --disable-nls effectively defines away that macro,
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
# treated as a failure.
# treated as a failure. Also, check for shadowing problems with -Wshadow.
# These CFLAGS are pretty strict. If you build this target, you probably
# have to have a recent version of gcc and glibc headers.
TMPDIR ?= /tmp
t=$(TMPDIR)/$(PACKAGE)/test
my-distcheck: $(local-check)
-rm -rf $(t)
mkdir -p $(t)
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
cd $(t)/$(distdir) \
&& ./configure --disable-nls \
&& $(MAKE) CFLAGS='-Wformat -Werror' \
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
&& $(MAKE) dvi \
&& $(MAKE) check \
cd $(t)/$(distdir) \
&& ./configure --disable-nls \
&& $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow' \
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
&& $(MAKE) dvi \
&& $(MAKE) check \
&& $(MAKE) distclean
(cd $(t) && mv $(distdir) $(distdir).old \
(cd $(t) && mv $(distdir) $(distdir).old \
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
-rm -rf $(t)
@@ -377,15 +463,9 @@ rel-check:
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
signatures ?= $(distdir).tar.bz2.asc $(distdir).tar.gz.asc
%.asc: %
rm -f $@
gpg --armor --detach-sign -o $@ $<
rel-files = $(xd-delta) $(distdir).tar.bz2 $(distdir).tar.gz $(signatures)
announce_gen ?= ./announce-gen
announcement: NEWS ChangeLog $(rel-files) $(signatures)
@$(announce_gen) \
rel-files = $(xd-delta) $(DIST_ARCHIVES)
announcement: NEWS ChangeLog $(rel-files)
@./announce-gen \
--release-type=$(RELEASE_TYPE) \
--package=$(PACKAGE) \
--prev=$(PREV_VERSION) \
@@ -395,25 +475,125 @@ announcement: NEWS ChangeLog $(rel-files) $(signatures)
$(addprefix --url-dir=, $(url_dir_list)) \
define emit-upload-commands
echo =====================================
echo =====================================
echo upload $(PACKAGE) $(PREV_VERSION) $(VERSION)
echo '# send the /tmp/announcement e-mail'
echo =====================================
echo =====================================
endef
## ---------------- ##
## Updating files. ##
## ---------------- ##
ftp-gnu = ftp://ftp.gnu.org/gnu
www-gnu = http://www.gnu.org
# Use mv, if you don't have/want move-if-change.
move_if_change ?= move-if-change
# --------------------- #
# Updating everything. #
# --------------------- #
.PHONY: update
local_updates ?= wget-update cvs-update po-update
update: $(local_updates)
# ------------------- #
# Updating PO files. #
# ------------------- #
po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
.PHONY: do-po-update po-update
do-po-update:
tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
rm -rf $$tmppo && \
mkdir $$tmppo && \
(cd $$tmppo && \
$(WGET) $(WGETFLAGS) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
cp $$tmppo/*.po po
cd po && $(MAKE) update-po
$(MAKE) po-check
po-update:
if test -d "po"; then \
$(MAKE) do-po-update; \
fi
# -------------------------- #
# Updating GNU build tools. #
# -------------------------- #
# The following pseudo table associates a local directory and a URL
# with each of the files that belongs to some other package and is
# regularly updated from the specified URL.
wget_files ?= \
$(srcdir)/build-aux/config.guess \
$(srcdir)/build-aux/config.sub \
$(srcdir)/build-aux/texinfo.tex \
$(srcdir)/src/ansi2knr.c
get-targets = $(patsubst %, get-%, $(wget_files))
config.guess-url_prefix = $(ftp-gnu)/build-aux/
config.sub-url_prefix = $(ftp-gnu)/build-aux/
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
standards.texi-url_prefix = $(www-gnu)/prep/
make-stds.texi-url_prefix = $(standards.texi-url_prefix)
target = $(patsubst get-%, %, $@)
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
.PHONY: $(get-targets)
$(get-targets):
$(WGET) $(WGETFLAGS) $(url) -O $(target).t \
&& $(move_if_change) $(target).t $(target)
cvs_files ?= \
$(srcdir)/build-aux/depcomp \
$(srcdir)/build-aux/install-sh \
$(srcdir)/build-aux/missing \
$(srcdir)/build-aux/mkinstalldirs \
$(srcdir)/src/ansi2knr.c
automake_repo=:pserver:anoncvs:anoncvs@sources.redhat.com:/cvs/automake
.PHONY: wget-update
wget-update: $(get-targets)
.PHONY: cvs-update
cvs-update:
fail=; \
for f in $(cvs_files); do \
test -f $$f || { echo "*** skipping $$f" 1>&2; continue; }; \
cvs diff $$f > /dev/null \
|| { echo "*** $$f is locally modified; skipping it" 1>&2; \
fail=yes; continue; }; \
file=$$(basename $$f); \
echo checking out $$file...; \
$(CVS) -d $(automake_repo) co -p automake/lib/$$file> $$f.t \
&& $(move_if_change) $$f.t $$f; \
done; \
test "$$fail" && exit 1
emit_upload_commands:
@echo =====================================
@echo =====================================
@echo "$(srcdir)/gnupload $(GNUPLOADFLAGS) \\"
@echo " --to $(gnu_rel_host):coreutils \\"
@echo " $(rel-files)"
@echo '# send the /tmp/announcement e-mail'
@echo =====================================
@echo =====================================
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
xdelta delta -9 $^ $@ || :
.PHONY: alpha beta major
alpha beta major: $(local-check)
alpha beta major: news-date-check $(local-check)
$(MAKE) cvs-dist
$(MAKE) $(xd-delta)
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
ln $(rel-files) $(release_archive_dir)
chmod a-w $(rel-files)
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
echo $(VERSION) > $(prev_version_file)
$(CVS) ci -m. $(prev_version_file)
@$(emit-upload-commands)

7
NEWS
View File

@@ -1,7 +1,7 @@
Bison News
----------
Changes in the next version (not yet released):
Changes in version 2.0b, 2005-07-24:
* Bison-generated parsers now support the translation of diagnostics like
"syntax error" into languages other than English. The default
@@ -19,7 +19,10 @@ Changes in the next version (not yet released):
behind on the stack. Also, the start symbol is now destroyed after a
successful parse. In both cases, the behavior was formerly inconsistent.
The following change was also in version 2.0a, 2005-05-22:
* The yytname array now contains the same contents that it did in 2.0,
undoing an incompatible and undocumented change made in 2.0a.
Changes in version 2.0a, 2005-05-22:
* When generating verbose diagnostics, Bison-generated parsers no longer
quote the literal strings associated with tokens. For example, for

View File

@@ -119,7 +119,7 @@ m4_define([b4_int_type],
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
[int])])
# b4_int_type_for(NAME)

View File

@@ -946,7 +946,7 @@ yy::]b4_parser_class_name[::yyreport_syntax_error_ ()
{
message += (!count++) ? ", expecting " : " or ";
message += yytnamerr_ (yytname_[x]);
}
}
}
}
else

File diff suppressed because it is too large Load Diff

View File

@@ -82,7 +82,7 @@ m4_define([b4_int_type],
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
[int])])
## ----------------- ##
@@ -390,7 +390,7 @@ union yyalloc
#define YYUNDEFTOK ]b4_undef_token_number[
#define YYMAXUTOK ]b4_user_token_number_max[
#define YYTRANSLATE(YYX) \
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
@@ -529,7 +529,7 @@ do \
goto yybackup; \
} \
else \
{ \
{ \
yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
YYERROR; \
} \
@@ -609,7 +609,7 @@ do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yysymprint (stderr, \
yysymprint (stderr, \
Type, Value]b4_location_if([, Location])[); \
YYFPRINTF (stderr, "\n"); \
} \

View File

@@ -7425,6 +7425,9 @@ parser's to get the set of defined tokens.
@comment file: calc++-scanner.ll
@example
%@{ /* -*- C++ -*- */
# include <cstdlib>
# include <errno.h>
# include <limits.h>
# include <string>
# include "calc++-driver.hh"
# include "calc++-parser.hh"
@@ -7482,7 +7485,14 @@ errors.
@example
[-+*/] return yytext[0];
":=" return TOKEN_ASSIGN;
@{int@} yylval->ival = atoi (yytext); return TOKEN_NUMBER;
@{int@} @{
errno = 0;
long n = strtol (yytext, NULL, 10);
if (! (INT_MIN <= n && n <= INT_MAX && errno != ERANGE))
driver.error (*yylloc, "integer is out of range");
yylval->ival = n;
return TOKEN_NUMBER;
@}
@{id@} yylval->sval = new std::string (yytext); return TOKEN_IDENTIFIER;
. driver.error (*yylloc, "invalid character");
%%

View File

@@ -1,300 +0,0 @@
#! /bin/sh
# clcommit version 0.9.5
# Copyright (C) 1999, 2000, Free Software Foundation
# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License. A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
# Originally by Gary V. Vaughan <gvaughan@oranda.demon.co.uk>
# Pretty much rewritten by Alexandre Oliva <aoliva@redhat.com>
# This scripts eases checking in changes to CVS-maintained projects
# with ChangeLog files. It will check that there have been no
# conflicting commits in the CVS repository and print which files it
# is going to commit to stderr. A list of files to compare and to
# check in can be given in the command line. If it is not given, all
# files in the current directory (and below, unless `-l' is given) are
# considered for check in.
# The commit message will be extracted from the differences between a
# file named ChangeLog* in the commit list, or named after -C, and the
# one in the repository (unless a message was specified with `-m' or
# `-F'). An empty message is not accepted (but a blank line is). If
# the message is acceptable, it will be presented for verification
# (and possible edition) using the $PAGER environment variable (or
# `more', if it is not set, or `cat', if the `-f' switch is given).
# If $PAGER exits successfully, the modified files (at that moment)
# are checked in, unless `-n' was specified, in which case nothing is
# checked in.
# usage: clcommit [-v] [-h] [-f] [-l] [-n] [-q] [-z N] [-C ChangeLog_file]
# [-m msg|-F msg_file|-1] [--] [file|dir ...]
# -f --force don't check (unless *followed* by -n), and just
# display commit message instead of running $PAGER
# -l --local don't descend into subdirectories
# -m msg --message=msg set commit message
# --msg=msg same as -m
# -F file --file=file read commit message from file
# -1 --first extract first entry from ChangeLog, no cvs diff
# -C file --changelog=file extract commit message from specified ChangeLog
# --fast same as --force --first
# -n --dry-run don't commit anything
# -q --quiet run cvs in quiet mode
# -zN --compress=N set compression level (0-9, 0=none, 9=max)
# -v --version print version information
# -h,-? --help print short or long help message
name=clcommit
: ${CVS=cvs}
cvsopt=
updateopt=
commitopt=
dry_run=false
commit=:
update=:
log_file="${TMPDIR-/tmp}/commitlog.$$"
first=false
rm -f "$log_file"
trap 'rm -f "$log_file"; exit 1' 1 2 15
# this just eases exit handling
main_repeat=":"
while $main_repeat; do
repeat="test $# -gt 0"
while $repeat; do
case "$1" in
--fast)
shift
set fnord --force --first ${1+"$@"}
shift
;;
-f|--force)
update=false
PAGER=cat
shift
;;
-l|--local)
updateopt="$updateopt -l"
commitopt="$commitopt -l"
shift
;;
-m|--message|--msg)
if test $# = 1; then
echo "$name: missing argument for $1" >&2
break
fi
if $first || test -f "$log_file"; then
echo "$name: you can have at most one of -m, -F and -1" >&2
break
fi
shift
echo "$1" > "$log_file"
shift
;;
-F|--file)
if $first || test -f "$log_file"; then
echo "$name: you can have at most one of -m, -F and -1" >&2
break
fi
if test $# = 1; then
echo "$name: missing argument for $1" >&2
break
fi
shift
if cat < "$1" > "$log_file"; then :; else
break
fi
shift
;;
-1|--first)
if test -f "$log_File"; then
echo "$name: you can have at most one of -m, -F and -1" >&2
break
fi
first=:
shift
;;
-C|--[cC]hange[lL]og)
if test $# = 1; then
echo "$name: missing argument for $1" >&2
break
fi
shift
if test ! -f "$1"; then
echo "$name: ChangeLog file \`$1' does not exist" >&2
break
fi
ChangeLog="$1"
shift
;;
-n|--dry-run)
commit=false
update=true
shift
;;
-q|--quiet)
cvsopt="$cvsopt -q"
shift
;;
-v|--verbose)
cvsopt="$cvsopt -t"
shift
;;
-z|--compress)
if test $# = 1; then
echo "$name: missing argument for $1" >&2
break
fi
case "$2" in
[0-9]) :;;
*) echo "$name: invalid argument for $1" >&2
break
;;
esac
cvsopt="$cvsopt -z$2"
shift
shift
;;
-m*|-F*|-C*|-z*)
opt=`echo "$1" | sed '1s/^\(..\).*$/\1/;q'`
arg=`echo "$1" | sed '1s/^-[a-zA-Z0-9]//'`
shift
set -- "$opt" "$arg" ${1+"$@"}
;;
--message=*|--msg=*|--file=*|--[Cc]hange[Ll]og=*|--compress=*)
opt=`echo "$1" | sed '1s/^\(--[^=]*\)=.*/\1/;q'`
arg=`echo "$1" | sed '1s/^--[^=]*=//'`
shift
set -- "$opt" "$arg" ${1+"$@"}
;;
-v|--version)
sed '/^# '$name' version /,/^# Heavily modified by/ { s/^# //; p; }; d' < $0
exit 0
;;
-\?|-h)
sed '/^# usage:/,/# -h/ { s/^# //; p; }; d' < $0 &&
echo
echo "run \`$name --help | more' for full usage"
exit 0
;;
--help)
sed '/^# '$name' version /,/^[^#]/ { /^[^#]/ d; s/^# //; p; }; d' < $0
exit 0
;;
--)
shift
repeat=false
;;
-*)
echo "$name: invalid flag $1" >&2
break
;;
*)
repeat=false
;;
esac
done
# might have used break 2 within the previous loop, but so what
$repeat && break
$update && \
if echo "$name: checking for conflicts..." >&2
($CVS $cvsopt -q -n update $updateopt ${1+"$@"} 2>/dev/null \
| while read line; do
echo "$line"
echo "$line" >&3
done | grep '^C') 3>&1 >/dev/null; then
echo "$name: some conflicts were found, aborting..." >&2
break
fi
if test ! -f "$log_file"; then
if test -z "$ChangeLog"; then
for f in ${1+"$@"}; do
case "$f" in
ChangeLog* | */ChangeLog*)
if test -z "$ChangeLog"; then
ChangeLog="$f"
else
echo "$name: multiple ChangeLog files: $ChangeLog and $f" >&2
break
fi
;;
esac
done
fi
echo "$name: checking commit message..." >&2
if $first; then
skipping=:
sed 's,^,+,' < ${ChangeLog-ChangeLog} |
while read line; do
case "$line" in
"+2"*) if $skipping; then skipping=false; else break; fi;;
"+ "*)
echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
echo "$line" | sed 's/^.//' >&2;;
"+ "*)
$skipping || echo "$line" ;;
esac
done |
sed 's,^\+ ,,' > "$log_file" || break
else
$CVS $cvsopt diff -u ${ChangeLog-ChangeLog} |
while read line; do
case $line in
"--- "*) :;;
"-"*)
echo "$name: *** Warning: the following line in ChangeLog diff is suspicious:" >&2
echo "$line" | sed 's/^.//' >&2;;
"+ "*)
echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
echo "$line" | sed 's/^.//' >&2;;
"+") echo;;
"+ "*) echo "$line";;
esac
done |
sed -e 's,\+ ,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \
|| break
fi
# The sed script above removes "+TAB" from the beginning of a line, then
# deletes the first and/or the last line, when they happen to be empty
fi
if grep '[^ ]' < "$log_file" > /dev/null; then :; else
echo "$name: empty commit message, aborting" >&2
break
fi
if grep '^$' < "$log_file" > /dev/null; then
echo "$name: *** Warning: blank lines should not appear within commit messages." >&2
echo "$name: *** They should be used to separate distinct commits." >&2
fi
${PAGER-more} "$log_file" || break
sleep 1 # give the user some time for a ^C
# Do not check for empty $log_file again, even though the user might have
# zeroed it out. If s/he did, it was probably intentional.
if $commit; then
$CVS $cvsopt commit $commitopt -F $log_file ${1+"$@"} || break
fi
main_repeat=false
done
rm -f "$log_file"
# if main_repeat was not set to `false', we failed
$main_repeat && exit 1
exit 0

View File

@@ -1,66 +0,0 @@
#line 7195 "../../doc/bison.texinfo"
%skeleton "lalr1.cc" /* -*- C++ -*- */
%define "parser_class_name" "calcxx_parser"
%defines
%{
# include <string>
# include "calc++-driver.hh"
%}
#line 7211 "../../doc/bison.texinfo"
// The parsing context.
%parse-param { calcxx_driver& driver }
%lex-param { calcxx_driver& driver }
#line 7224 "../../doc/bison.texinfo"
%locations
%initial-action
{
// Initialize the initial location.
@$.begin.filename = @$.end.filename = &driver.file;
};
#line 7238 "../../doc/bison.texinfo"
%debug
%error-verbose
#line 7248 "../../doc/bison.texinfo"
// Symbols.
%union
{
int ival;
std::string *sval;
};
#line 7265 "../../doc/bison.texinfo"
%token YYEOF 0 "end of file"
%token TOKEN_ASSIGN ":="
%token <sval> TOKEN_IDENTIFIER "identifier"
%token <ival> TOKEN_NUMBER "number"
%type <ival> exp "expression"
#line 7278 "../../doc/bison.texinfo"
%printer { debug_stream () << *$$; } "identifier"
%destructor { delete $$; } "identifier"
%printer { debug_stream () << $$; } "number" "expression"
#line 7289 "../../doc/bison.texinfo"
%%
%start unit;
unit: assignments exp { driver.result = $2; };
assignments: assignments assignment {}
| /* Nothing. */ {};
assignment: TOKEN_IDENTIFIER ":=" exp { driver.variables[*$1] = $3; };
%left '+' '-';
%left '*' '/';
exp: exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp { $$ = $1 / $3; }
| TOKEN_IDENTIFIER { $$ = driver.variables[*$1]; }
| TOKEN_NUMBER { $$ = $1; };
%%
#line 7315 "../../doc/bison.texinfo"
void
yy::calcxx_parser::error (const yy::calcxx_parser::location_type& l,
const std::string& m)
{
driver.error (l, m);
}

View File

@@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _ABITSET_H
#define _ABITSET_H
#define _ABITSET_H
#include "bitset.h"

View File

@@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BITSET_TABLE: Expandable table of pointers to arrays of bits
(variable size, less storage for large sparse sets).
Faster than BITSET_LIST for random access.
BITSET_VARRAY: Variable array of bits (variable size, fast for
BITSET_VARRAY: Variable array of bits (variable size, fast for
dense bitsets).
BITSET_STATS: Wrapper bitset for internal use only. Used for gathering
statistics and/or better run-time checking.

View File

@@ -309,8 +309,8 @@ extern void bitset_dump (FILE *, bitset);
*/
#define BITSET_FOR_EACH(ITER, BSET, INDEX, MIN) \
for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
(ITER.num == BITSET_LIST_SIZE) \
&& (ITER.num = bitset_list (BSET, ITER.list, \
(ITER.num == BITSET_LIST_SIZE) \
&& (ITER.num = bitset_list (BSET, ITER.list, \
BITSET_LIST_SIZE, &ITER.next));) \
for (ITER.i = 0; \
ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1); \
@@ -331,7 +331,7 @@ extern void bitset_dump (FILE *, bitset);
*/
#define BITSET_FOR_EACH_REVERSE(ITER, BSET, INDEX, MIN) \
for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
(ITER.num == BITSET_LIST_SIZE) \
(ITER.num == BITSET_LIST_SIZE) \
&& (ITER.num = bitset_list_reverse (BSET, ITER.list, \
BITSET_LIST_SIZE, &ITER.next));) \
for (ITER.i = 0; \
@@ -386,4 +386,3 @@ extern void debug_bitset (bitset);
extern void debug_bitset_stats (void);
#endif /* _BITSET_H */

View File

@@ -50,29 +50,29 @@
/* Accessor macros. */
#define BITSET_STATS_ALLOCS_INC(TYPE) \
#define BITSET_STATS_ALLOCS_INC(TYPE) \
bitset_stats_info->types[(TYPE)].allocs++
#define BITSET_STATS_FREES_INC(BSET) \
#define BITSET_STATS_FREES_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].frees++
#define BITSET_STATS_SETS_INC(BSET) \
#define BITSET_STATS_SETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].sets++
#define BITSET_STATS_CACHE_SETS_INC(BSET) \
#define BITSET_STATS_CACHE_SETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_sets++
#define BITSET_STATS_RESETS_INC(BSET) \
#define BITSET_STATS_RESETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].resets++
#define BITSET_STATS_CACHE_RESETS_INC(BSET) \
#define BITSET_STATS_CACHE_RESETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_resets++
#define BITSET_STATS_TESTS_INC(BSET) \
#define BITSET_STATS_TESTS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].tests++
#define BITSET_STATS_CACHE_TESTS_INC(BSET) \
#define BITSET_STATS_CACHE_TESTS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_tests++
#define BITSET_STATS_LISTS_INC(BSET) \
#define BITSET_STATS_LISTS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].lists++
#define BITSET_STATS_LIST_COUNTS_INC(BSET, I) \
#define BITSET_STATS_LIST_COUNTS_INC(BSET, I) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_counts[(I)]++
#define BITSET_STATS_LIST_SIZES_INC(BSET, I) \
#define BITSET_STATS_LIST_SIZES_INC(BSET, I) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_sizes[(I)]++
#define BITSET_STATS_LIST_DENSITY_INC(BSET, I) \
#define BITSET_STATS_LIST_DENSITY_INC(BSET, I) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_density[(I)]++

View File

@@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _EBITSET_H
#define _EBITSET_H
#define _EBITSET_H
#include "bitset.h"

View File

@@ -41,7 +41,7 @@
/* Number of words to use for each element. The larger the value the
greater the size of the cache and the shorter the time to find a given bit
but the more memory wasted for sparse bitsets and the longer the time
to search for set bits.
to search for set bits.
The routines that dominate timing profiles are lbitset_elt_find
and lbitset_elt_link, especially when accessing the bits randomly. */
@@ -888,18 +888,18 @@ lbitset_unused_clear (bitset dst)
n_bits = BITSET_SIZE_ (dst);
last_bit = n_bits % LBITSET_ELT_BITS;
if (last_bit)
{
lbitset_elt *elt;
bitset_windex windex;
bitset_word *srcp;
elt = LBITSET_TAIL (dst);
srcp = elt->words;
windex = n_bits / BITSET_WORD_BITS;
srcp[windex - elt->index] &= ((bitset_word) 1 << last_bit) - 1;
srcp[windex - elt->index] &= ((bitset_word) 1 << last_bit) - 1;
windex++;
for (; (windex - elt->index) < LBITSET_ELT_WORDS; windex++)

View File

@@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _LBITSET_H
#define _LBITSET_H
#define _LBITSET_H
#include "bitset.h"

View File

@@ -44,9 +44,7 @@
# define STDOUT_FILENO 1
#endif
#if ! HAVE_DUP2 && ! defined dup2
# if HAVE_FCNTL_H
# include <fcntl.h>
# endif
# include <fcntl.h>
# define dup2(f, t) (close (t), fcntl (f, F_DUPFD, t))
#endif
@@ -109,11 +107,13 @@ create_subpipe (char const * const *argv, int fd[2])
|| pipe (pipe_fd) != 0
|| (fd[1] = fd_safer (pipe_fd[0])) < 0
|| (child_fd[1] = fd_safer (pipe_fd[1])) < 0)
error (EXIT_FAILURE, errno, "pipe");
error (EXIT_FAILURE, errno,
"pipe");
pid = vfork ();
if (pid < 0)
error (EXIT_FAILURE, errno, "fork");
error (EXIT_FAILURE, errno,
"fork");
if (! pid)
{
@@ -148,7 +148,8 @@ reap_subpipe (pid_t pid, char const *program)
#if HAVE_WAITPID || defined waitpid
int wstatus;
if (waitpid (pid, &wstatus, 0) < 0)
error (EXIT_FAILURE, errno, "waitpid");
error (EXIT_FAILURE, errno,
"waitpid");
else
{
int status = WIFEXITED (wstatus) ? WEXITSTATUS (wstatus) : -1;

View File

@@ -31,7 +31,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
/* This source file is taken from the GCC source code, with slight
modifications that are under control of the IN_GCC preprocessor
variable. The !IN_GCC part of this file is specific to Bison. */
# include "../src/system.h"
# if HAVE_SYS_TIME_H
# include <sys/time.h>

View File

@@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _VBITSET_H
#define _VBITSET_H
#define _VBITSET_H
#include "bitset.h"

View File

@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Checks required to run `subpipe'.
#
# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
# Copyright (C) 2002, 2003, 2005 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,6 @@
AC_DEFUN([BISON_PREREQ_SUBPIPE],
[
AC_TYPE_PID_T
AC_CHECK_HEADERS([fcntl.h])
AC_HEADER_SYS_WAIT
AC_CHECK_FUNCS(dup2 waitpid)
AC_FUNC_FORK

View File

@@ -15,9 +15,7 @@
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
DEFS = @DEFS@ \
-DPKGDATADIR=\"$(pkgdatadir)\" \
-DLOCALEDIR=\"$(datadir)/locale\"
DEFS += -DPKGDATADIR=\"$(pkgdatadir)\" -DLOCALEDIR=\"$(datadir)/locale\"
AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/lib -I../lib
@@ -33,7 +31,7 @@ bin_PROGRAMS = bison
bin_SCRIPTS = $(YACC_SCRIPT)
EXTRA_SCRIPTS = yacc
bison_SOURCES = \
bison_SOURCES = \
LR0.c LR0.h \
assoc.c assoc.h \
closure.c closure.h \
@@ -56,7 +54,7 @@ bison_SOURCES = \
reduce.c reduce.h \
relation.c relation.h \
scan-gram.l \
scan-skel.l \
scan-skel.h scan-skel.l \
state.c state.h \
symlist.c symlist.h \
symtab.c symtab.h \
@@ -77,3 +75,34 @@ yacc:
echo:
echo $(bison_SOURCES) $(noinst_HEADERS)
# The following rule is not designed to be portable,
# and relies on tools that not everyone has.
# Most functions in src/*.c should have static scope.
# Any that don't must be marked with `extern', but `main'
# and `usage' are exceptions. They're always extern, but
# don't need to be marked.
#
# The second nm|grep checks for file-scope variables with `extern' scope.
sc_tight_scope: $(all_programs)
@t=exceptions-$$$$; \
trap 's=$$?; rm -f $$t; exit $$s' 0 1 2 13 15; \
( printf '^main$$\n^usage$$\n'; \
grep -h -A1 '^extern .*[^;]$$' $(SOURCES) \
| grep -vE '^(extern |--)' |sed 's/^/^/;s/ .*/$$/' ) > $$t; \
if nm -e *.$(OBJEXT) \
| sed -n 's/.* T //p' \
| grep -Ev -f $$t; then \
echo 'the above functions should have static scope' 1>&2; \
exit 1; \
fi; \
( printf '^program_name$$\n'; \
sed -n 's/^extern .*[* ]\([a-zA-Z_][a-zA-Z_0-9]*\);$$/^\1$$/p' \
$$(ls $(SOURCES) | grep '\.h$$') /dev/null) > $$t; \
if nm -e *.$(OBJEXT) \
| sed -n 's/.* [BD] //p' \
| grep -Ev -f $$t; then \
echo 'the above variables should have static scope' 1>&2; \
exit 1; \
fi

View File

@@ -66,9 +66,9 @@ static char *full_base_name = NULL;
char *short_base_name = NULL;
/* C source file extension (the parser source). */
const char *src_extension = NULL;
static char const *src_extension = NULL;
/* Header file extension (if option ``-d'' is specified). */
const char *header_extension = NULL;
static char const *header_extension = NULL;
/*-----------------------------------------------------------------.
| Return a newly allocated string composed of the concatenation of |

View File

@@ -285,7 +285,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
`----------------------*/
/* Shorts options. */
const char *short_options = "yvegdhr:ltknVo:b:p:S:T::";
static char const short_options[] = "yvegdhr:ltknVo:b:p:S:T::";
/* Values for long options that do not have single-letter equivalents. */
enum

View File

@@ -1,5 +1,5 @@
/* Parse command line arguments for bison.
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -23,8 +23,12 @@
# define GETARGS_H_
/* flags set by % directives */
extern const char *skeleton; /* for -S */
extern const char *include; /* for -I */
/* for -S */
extern char const *skeleton;
/* for -I */
extern char const *include;
extern bool debug_flag; /* for -t */
extern bool defines_flag; /* for -d */

View File

@@ -269,7 +269,7 @@ grammar_dump (FILE *out, const char *title)
rule *rule_i = &rules[i];
item_number *rp = NULL;
unsigned int rhs_itemno = rule_i->rhs - ritem;
unsigned int rhs_count = 0;
unsigned int rhs_count = 0;
/* Find the last RHS index in ritems. */
for (rp = rule_i->rhs; *rp >= 0; ++rp)
++rhs_count;

View File

@@ -56,9 +56,9 @@ main (int argc, char *argv[])
{
program_name = argv[0];
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
bindtextdomain ("bison-runtime", LOCALEDIR);
textdomain (PACKAGE);
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) bindtextdomain ("bison-runtime", LOCALEDIR);
(void) textdomain (PACKAGE);
uniqstrs_new ();

View File

@@ -41,7 +41,7 @@ struct obstack muscle_obstack;
/* Initial capacity of muscles hash table. */
#define HT_INITIAL_CAPACITY 257
struct hash_table *muscle_table = NULL;
static struct hash_table *muscle_table = NULL;
static bool
hash_compare_muscles (void const *x, void const *y)

View File

@@ -40,14 +40,14 @@ extern struct obstack muscle_obstack;
#define MUSCLE_INSERT_INT(Key, Value) \
{ \
obstack_fgrow1 (&muscle_obstack, "%d", Value); \
obstack_fgrow1 (&muscle_obstack, "%d", Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
}
#define MUSCLE_INSERT_LONG_INT(Key, Value) \
{ \
obstack_fgrow1 (&muscle_obstack, "%ld", Value); \
obstack_fgrow1 (&muscle_obstack, "%ld", Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
}

View File

@@ -36,12 +36,10 @@
#include "muscle_tab.h"
#include "output.h"
#include "reader.h"
#include "scan-skel.h"
#include "symtab.h"
#include "tables.h"
/* From src/scan-skel.l. */
void scan_skel (FILE *);
static struct obstack format_obstack;
@@ -559,7 +557,8 @@ output_skeleton (void)
out = fdopen (filter_fd[0], "w");
if (! out)
error (EXIT_FAILURE, get_errno (), "fdopen");
error (EXIT_FAILURE, get_errno (),
"fdopen");
/* Output the definitions of all the muscles. */
fputs ("m4_init()\n", out);
@@ -580,7 +579,8 @@ output_skeleton (void)
timevar_push (TV_M4);
in = fdopen (filter_fd[1], "r");
if (! in)
error (EXIT_FAILURE, get_errno (), "fdopen");
error (EXIT_FAILURE, get_errno (),
"fdopen");
scan_skel (in);
xfclose (in);
reap_subpipe (pid, m4);

View File

@@ -48,12 +48,12 @@ static void gram_error (location const *, char const *);
static void add_param (char const *, char *, location);
symbol_class current_class = unknown_sym;
uniqstr current_type = 0;
static symbol_class current_class = unknown_sym;
static uniqstr current_type = 0;
symbol *current_lhs;
location current_lhs_location;
assoc current_assoc;
int current_prec = 0;
static int current_prec = 0;
%}
%debug
@@ -206,7 +206,7 @@ declaration:
| "%defines" { defines_flag = true; }
| "%error-verbose" { error_verbose = true; }
| "%expect" INT { expected_sr_conflicts = $2; }
| "%expect-rr" INT { expected_rr_conflicts = $2; }
| "%expect-rr" INT { expected_rr_conflicts = $2; }
| "%file-prefix" "=" string_content { spec_file_prefix = $3; }
| "%glr-parser"
{
@@ -221,7 +221,7 @@ declaration:
| "%locations" { locations_flag = true; }
| "%name-prefix" "=" string_content { spec_name_prefix = $3; }
| "%no-lines" { no_lines_flag = true; }
| "%nondeterministic-parser" { nondeterministic_parser = true; }
| "%nondeterministic-parser" { nondeterministic_parser = true; }
| "%output" "=" string_content { spec_outfile = $3; }
| "%parse-param {...}" { add_param ("parse_param", $1, @1); }
| "%pure-parser" { pure_parser = true; }

View File

@@ -1,6 +1,6 @@
/* Output a VCG description on generated parser, for Bison,
Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -21,7 +21,6 @@
#include "system.h"
#include <obstack.h>
#include <quotearg.h>
#include "LR0.h"

View File

@@ -159,7 +159,7 @@ free_merger_functions (void)
`-------------------------------------------------------------------*/
/* The (currently) last symbol of GRAMMAR. */
symbol_list *grammar_end = NULL;
static symbol_list *grammar_end = NULL;
/* Append SYM to the grammar. */
void
@@ -179,7 +179,7 @@ grammar_symbol_append (symbol *sym, location loc)
CURRENT_RULE points to the first LHS of the current rule, while
PREVIOUS_RULE_END points to the *end* of the previous rule (NULL). */
symbol_list *current_rule = NULL;
symbol_list *previous_rule_end = NULL;
static symbol_list *previous_rule_end = NULL;
/*----------------------------------------------.

View File

@@ -43,6 +43,11 @@ void scanner_initialize (void);
void scanner_free (void);
void scanner_last_string_free (void);
/* These are declared by the scanner, but not used. We put them here
to pacify "make syntax-check". */
extern FILE *gram_out;
extern int gram_lineno;
# define YY_DECL int gram_lex (YYSTYPE *val, location *loc)
YY_DECL;

41
src/scan-skel.h Normal file
View File

@@ -0,0 +1,41 @@
/* Scan Bison Skeletons.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
Bison 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 2, or (at your option)
any later version.
Bison 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 Bison; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
void scan_skel (FILE *);
/* Pacify "make syntax-check". */
extern FILE *skel_in;
extern FILE *skel_out;
extern int skel__flex_debug;
extern int skel_lineno;
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
int skel_get_lineno (void);
FILE *skel_get_in (void);
FILE *skel_get_out (void);
int skel_get_leng (void);
char *skel_get_text (void);
void skel_set_lineno (int);
void skel_set_in (FILE *);
void skel_set_out (FILE *);
int skel_get_debug (void);
void skel_set_debug (int);
int skel_lex_destroy (void);

View File

@@ -31,21 +31,7 @@
#include "complain.h"
#include "getargs.h"
#include "files.h"
int skel_lex (void);
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
int skel_get_lineno (void);
FILE *skel_get_in (void);
FILE *skel_get_out (void);
int skel_get_leng (void);
char *skel_get_text (void);
void skel_set_lineno (int);
void skel_set_in (FILE *);
void skel_set_out (FILE *);
int skel_get_debug (void);
void skel_set_debug (int);
int skel_lex_destroy (void);
#include "scan-skel.h"
#define QPUTS(String) \
fputs (quotearg_style (c_quoting_style, (String)), yyout)
@@ -110,8 +96,6 @@ int skel_lex_destroy (void);
| Scan a Bison skeleton. |
`------------------------*/
void scan_skel (FILE *);
void
scan_skel (FILE *in)
{

View File

@@ -130,9 +130,9 @@ typedef size_t uintptr_t;
| Obstacks. |
`-----------*/
# define obstack_chunk_alloc xmalloc
# define obstack_chunk_free free
# include <obstack.h>
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
#include <obstack.h>
#define obstack_sgrow(Obs, Str) \
obstack_grow (Obs, Str, strlen (Str))

View File

@@ -173,7 +173,7 @@ table_grow (int desired)
/*-------------------------------------------------------------------.
| For GLR parsers, for each conflicted token in S, as indicated |
| by non-zero entries in CONFLROW, create a list of possible |
| by non-zero entries in CONFLROW, create a list of possible |
| reductions that are alternatives to the shift or reduction |
| currently recorded for that token in S. Store the alternative |
| reductions followed by a 0 in CONFLICT_LIST, updating |

View File

@@ -1,6 +1,6 @@
/* Keep a unique copy of strings.
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -63,7 +63,8 @@ uniqstr_assert (char const *str)
{
if (!hash_lookup (uniqstrs_table, str))
{
error (0, 0, "not a uniqstr: %s", quotearg (str));
error (0, 0,
"not a uniqstr: %s", quotearg (str));
abort ();
}
}

View File

@@ -203,7 +203,7 @@ new_edge (edge *e)
}
/*----------------------------------------------.
| Get functions. |
| Get functions. |
| Return string corresponding to an enum value. |
`----------------------------------------------*/
@@ -374,7 +374,7 @@ get_arrowstyle_str (enum arrowstyle arrowstyle)
}
/*------------------------------.
| Add functions. |
| Add functions. |
| Edge and nodes into a graph. |
`------------------------------*/

View File

@@ -48,11 +48,11 @@
# define G_TEXTMODE centered
# define G_SHAPE box
# define G_VERTICAL_ORDER 0 /* Unspecified for subgraphs. */
# define G_HORIZONTAL_ORDER 0 /* Unspecified for subgraphs. */
# define G_VERTICAL_ORDER 0 /* Unspecified for subgraphs. */
# define G_HORIZONTAL_ORDER 0 /* Unspecified for subgraphs. */
# define G_XMAX 90 /* Not output */
# define G_YMAX 90 /* Not output */
# define G_XMAX 90 /* Not output. */
# define G_YMAX 90 /* Not output. */
# define G_XBASE 5
# define G_YBASE 5
@@ -65,9 +65,9 @@
# define G_YRASTER 1
# define G_XLRASTER 1
# define G_HIDDEN (-1) /* No default value. */
# define G_HIDDEN (-1) /* No default value. */
# define G_CLASSNAME NULL /* No class name association */
# define G_CLASSNAME NULL /* No class name association. */
# define G_INFONAME NULL
# define G_COLORENTRY NULL

View File

@@ -32,11 +32,11 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
{ \
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@])'; \
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)])'; \
} >$(srcdir)/package.m4
## ------------ ##

View File

@@ -83,7 +83,7 @@ prog :
stmt : expr ';' $2 { $$ = ]$[1; }
| decl $3
| error ';' { static char error_msg[] = "<error>"; $$ = error_msg; }
| '@' { YYACCEPT; }
| '@' { YYACCEPT; }
;
expr : ID
@@ -145,7 +145,7 @@ yylex (LEX_PARAMETERS)
break;
case ' ': case '\f':
colNum += 1;
break;
break;
case '\n':
lineNum += 1;
colNum = 0;

View File

@@ -408,7 +408,7 @@ AT_DATA([[input.y]],
HBEGPAR HENDPAR
HEQR HNER
HADD HSUB HMUL HDIV HINTDIV HEXP
HDOTDOTDOT
HDOTDOTDOT
%token <ident> HIDENTIFIER
%token <ival> HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
@@ -450,7 +450,7 @@ AT_DATA([[input.y]],
MAIN_MODULE : { categ=CLOCAL; mout(MBLOCK);
beginBlock(KBLOKK);separat_comp=FALSE;}
MODULS { endBlock(NULL,CCNO); mout(MENDBLOCK);}
| error HSTATEMENTSEPARATOR MBEE_DECLSTMS
| error HSTATEMENTSEPARATOR MBEE_DECLSTMS
;
EXT_DECLARATION : HEXTERNAL
MBEE_TYPE
@@ -548,7 +548,7 @@ MBEE_ELSE_PART : /*EMPT*/
/* | HELSE
HIF
EXPRESSION
HTHEN { mout(MELSE);
HTHEN { mout(MELSE);
mout(MIF);
OBSBLOCK();}
BLOCK { MBEEENDBLOCK();}
@@ -588,7 +588,7 @@ WHEN_CLAUSE_LIST: HWHEN
HIDENTIFIER
HDO { beginBlock(KCON); mout(MIDENTIFIER);
OBSBLOCK(); moutId($2);
mout(MWHEN);}
mout(MWHEN);}
BLOCK { endBlock(NULL,CCNO);
MBEEENDBLOCK(); mout(MENDWHEN);}
| WHEN_CLAUSE_LIST
@@ -596,7 +596,7 @@ WHEN_CLAUSE_LIST: HWHEN
HIDENTIFIER
HDO { beginBlock(KCON); mout(MIDENTIFIER);
OBSBLOCK(); moutId($3);
mout(MWHEN);}
mout(MWHEN);}
BLOCK { endBlock(NULL,CCNO);
MBEEENDBLOCK(); mout(MENDWHEN);}
;
@@ -645,8 +645,8 @@ MODULSTATEMENT : HWHILE
HDO { STOPOBSBLOCK(); mout(MWHILE);
OBSBLOCK();}
BLOCK { MBEEENDBLOCK(); mout(MENDWHILE);
$$=STATEMENT;}
| HIF
$$=STATEMENT;}
| HIF
EXPRESSION
HTHEN { STOPOBSBLOCK(); mout(MIF);
OBSBLOCK();}
@@ -709,7 +709,7 @@ MODULSTATEMENT : HWHILE
{ STOPOBSBLOCK(); $$=STATEMENT;
mout(MENDASSIGN);}
| ACTIVATOR EXPRESSION SCHEDULE
{ $$=STATEMENT;
{ $$=STATEMENT;
mout(MENDSEP);
mout(MARGUMENTSEP);
mout(MARGUMENTSEP);
@@ -836,10 +836,10 @@ MBEE_DECLSTMSU : DECLSTATEMENT { $$=$1;}
MODULS : MODULSTATEMENT { if($1==DECLARATION)
{separat_comp=TRUE;gettimestamp();}
$$=$1;}
| MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
| MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
{ if($1>=STATEMENT && $3<=DECLARATION)
yerror (26);else
if($1>=STATEMENT
if($1>=STATEMENT
&& $3!=EMPTYSTATEMENT)yerror (25);
if(separat_comp && $3==STATEMENT)
yerror (25);
@@ -939,7 +939,7 @@ FPP_CATEG : HNAME HLABELSEPARATOR
;
FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE
HIDENTIFIER
{ $<ival>$=categ;
{ $<ival>$=categ;
regDecl($3, type, KPROC, categ);
beginBlock(KPROC);}
FPP_HEADING
@@ -1008,7 +1008,7 @@ SPECIFIER : TYPE { kind=KSIMPLE;}
;
PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE
HIDENTIFIER
{ $<ival>$=categ;
{ $<ival>$=categ;
regDecl($3, type, KPROC, categ);
beginBlock(KPROC);}
HEADING
@@ -1292,7 +1292,7 @@ AT_DATA([[input.y]],
%token AND
%token HERE
%token DOT_N
%token DOT_E
%token DOT_E
%token DOT_W
%token DOT_S
%token DOT_NE
@@ -1378,7 +1378,7 @@ 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 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 '[' /* ] */
@@ -1518,7 +1518,7 @@ placeless_element:
}
| COPY TEXT THRU
{ delim_flag = 2; }
DELIMITED
DELIMITED
{ delim_flag = 0; }
until
{
@@ -1542,13 +1542,13 @@ placeless_element:
a_delete $6;
}
| FOR VARIABLE '=' expr TO expr optional_by DO
{ delim_flag = 1; }
{ delim_flag = 1; }
DELIMITED
{
{
delim_flag = 0;
if (yychar < 0)
do_lookahead();
do_for($2, $4, $6, $7.is_multiplicative, $7.val, $10);
do_for($2, $4, $6, $7.is_multiplicative, $7.val, $10);
}
| simple_if
{
@@ -1617,7 +1617,7 @@ print_args:
;
print_arg:
expr %prec ','
expr %prec ','
{
$$.str = new char[GDIGITS + 1];
sprintf($$.str, "%g", $1);
@@ -1652,14 +1652,14 @@ until:
| UNTIL TEXT
{ $$ = $2.str; }
;
any_expr:
expr
{ $$ = $1; }
| text_expr
{ $$ = $1; }
;
text_expr:
text EQUALEQUAL text
{
@@ -1831,7 +1831,7 @@ object_spec:
$3.filename, $3.lineno);
a_delete $3.str;
}
| '['
| '['
{
saved_state *p = new saved_state;
$<pstate>$ = p;
@@ -2014,7 +2014,7 @@ object_spec:
$$->segment_pos.y += $3.y;
}
| object_spec THEN
{
{
$$ = $1;
if ($$->flags & HAS_SEGMENT) {
$$->segment_list = new segment($$->segment_pos,
@@ -2088,7 +2088,7 @@ object_spec:
strcpy($$->outlined, $3.str);
}
| object_spec CHOP
{
{
$$ = $1;
// line chop chop means line chop 0 chop 0
if ($$->flags & IS_DEFAULT_CHOPPED) {
@@ -2258,10 +2258,10 @@ sprintf_args:
;
position:
position_not_place
position_not_place
{ $$ = $1; }
| place
{
{
position pos = $1;
$$.x = pos.x;
$$.y = pos.y;
@@ -2377,7 +2377,7 @@ ordinal:
optional_ordinal_last:
LAST
{ $$ = 1; }
| ordinal LAST
| ordinal LAST
{ $$ = $1; }
;
@@ -2416,7 +2416,7 @@ nth_primitive:
object_type:
BOX
{ $$ = BOX_OBJECT; }
{ $$ = BOX_OBJECT; }
| CIRCLE
{ $$ = CIRCLE_OBJECT; }
| ELLIPSE
@@ -2436,7 +2436,7 @@ object_type:
;
label_path:
'.' LABEL
'.' LABEL
{ $$ = new path($2); }
| label_path '.' LABEL
{
@@ -2450,7 +2450,7 @@ relative_path:
{ $$ = new path($1); }
/* 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 %prec TEXT
{ $$ = $1; }
| label_path corner
{
@@ -2497,7 +2497,7 @@ path:
corner:
DOT_N
{ $$ = &object::north; }
| DOT_E
| DOT_E
{ $$ = &object::east; }
| DOT_W
{ $$ = &object::west; }
@@ -2517,7 +2517,7 @@ corner:
{ $$ = &object::start; }
| DOT_END
{ $$ = &object::end; }
| TOP
| TOP
{ $$ = &object::north; }
| BOTTOM
{ $$ = &object::south; }
@@ -2573,12 +2573,12 @@ expr:
| NUMBER
{ $$ = $1; }
| place DOT_X
{
{
if ($1.obj != 0)
$$ = $1.obj->origin().x;
else
$$ = $1.x;
}
}
| place DOT_Y
{
if ($1.obj != 0)

View File

@@ -1,5 +1,5 @@
# Exercising Bison Grammar Sets. -*- Autotest -*-
# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
# Copyright (C) 2001, 2002, 2005 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,25 +29,25 @@ m4_define([AT_EXTRACT_SETS],
:null
p
n
/^[ ]*$/ !b null
/^[ ]*$/ !b null
}
/^FIRSTS$/ {
:firsts
p
n
/^[ ]*$/ !b firsts
/^[ ]*$/ !b firsts
}
/^FDERIVES$/ {
:fderiv
p
n
/^[ ]*$/ !b fderiv
/^[ ]*$/ !b fderiv
}
/^DERIVES$/ {
:deriv
p
n
/^[ ]*$/ !b deriv
/^[ ]*$/ !b deriv
}
]])
AT_CHECK([sed -f extract.sed $1], 0, [stdout])

View File

@@ -388,6 +388,8 @@ m4_define([AT_DATA_STACK_TORTURE],
# exp:
AT_DATA([input.y],
[[%{
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
]$1[
@@ -406,9 +408,6 @@ yyerror (const char *msg)
fprintf (stderr, "%s\n", msg);
}
/* There are YYLVAL_MAX of WAIT_FOR_EOFs. */
unsigned int yylval_max;
static int
yylex (void)
{
@@ -421,9 +420,14 @@ yylex (void)
int
main (int argc, const char **argv)
{
char *endp;
if (argc != 2)
abort ();
yylval = atoi (argv[1]);
yylval = strtol (argv[1], &endp, 10);
if (! (argv[1] != endp
&& 0 <= yylval && yylval <= INT_MAX
&& errno != ERANGE))
abort ();
yydebug = 1;
return yyparse ();
}