mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-09 18:55:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5109f5af0 | ||
|
|
1bd0dedaaa | ||
|
|
c1432f6538 | ||
|
|
cf147260d2 | ||
|
|
3a73c9ae44 | ||
|
|
dbcdae2d04 | ||
|
|
70d8f2910e | ||
|
|
d110145422 | ||
|
|
ae199bf10f | ||
|
|
b47dbebee5 | ||
|
|
94306d5282 | ||
|
|
00292f6611 | ||
|
|
c89b4c032c | ||
|
|
d83a9c402c | ||
|
|
55f64b82cd | ||
|
|
127287e9c4 | ||
|
|
48b16bbc04 | ||
|
|
a420f9620e | ||
|
|
fa4d969f11 | ||
|
|
326eb46f40 | ||
|
|
7812f29985 | ||
|
|
7e7b77c138 | ||
|
|
9d5b26c682 | ||
|
|
42a6501d1a | ||
|
|
5b4aaf787b | ||
|
|
b5240ba555 | ||
|
|
ef9a1fafaf | ||
|
|
a4cf101a98 | ||
|
|
e6efa9dacc | ||
|
|
adc90f13ab | ||
|
|
15d29c1ffe | ||
|
|
6250acbdb1 | ||
|
|
ec5d1a8a24 | ||
|
|
dd5f2af2bd | ||
|
|
eab522e49a | ||
|
|
fe3816515c | ||
|
|
19e251af0f | ||
|
|
f9315de5a4 | ||
|
|
1fb38e78c2 | ||
|
|
ca5d201376 | ||
|
|
3d54b57635 | ||
|
|
d53ae497dc | ||
|
|
3bc00d6c4b | ||
|
|
e0045d49b6 | ||
|
|
fc01665ea5 | ||
|
|
57beea5776 | ||
|
|
5f3df3960e | ||
|
|
040984073a | ||
|
|
135bc829bd | ||
|
|
f938a7e7b8 | ||
|
|
f38b17c9bf | ||
|
|
aacbb77a75 | ||
|
|
89519adfbe | ||
|
|
26a69b31fa | ||
|
|
a9401edbf5 | ||
|
|
b3d0c7a208 | ||
|
|
1d0737fa58 | ||
|
|
1eeda0abd5 | ||
|
|
4ff8b7f7c9 | ||
|
|
6d07bacfc0 | ||
|
|
141f57937b | ||
|
|
0ffda36340 | ||
|
|
3922956abd | ||
|
|
9cbfdc9e01 | ||
|
|
9e0876fb0c | ||
|
|
49b1cf794d | ||
|
|
6fdb09caac | ||
|
|
dc9701e848 | ||
|
|
802b9687d0 | ||
|
|
ab703f2c9b | ||
|
|
0fab8d7b36 | ||
|
|
df9a1ba4de | ||
|
|
d11e0cfa89 | ||
|
|
258b75caaa | ||
|
|
6088a2a04d | ||
|
|
4cf31ef8e7 | ||
|
|
1a05945136 | ||
|
|
a778f668a1 | ||
|
|
8c27717915 | ||
|
|
97460c7864 | ||
|
|
9662b51284 | ||
|
|
30757c8c93 | ||
|
|
ac8c5689f8 | ||
|
|
6100a9aa2e | ||
|
|
67fd79c427 | ||
|
|
15f40952f7 | ||
|
|
c70fdfcd20 | ||
|
|
e2688cd96e | ||
|
|
1beb0b24f3 | ||
|
|
a22ff96f32 | ||
|
|
31d7addbf5 | ||
|
|
f32c66b5f4 | ||
|
|
71206cce8e | ||
|
|
d741bd1bfd | ||
|
|
0410a6e0cc | ||
|
|
a7db4add01 | ||
|
|
d2aaf69e73 | ||
|
|
eb520e4cc0 | ||
|
|
baf785db2e | ||
|
|
f7ab6a5010 | ||
|
|
22dda0f004 | ||
|
|
82b248ada6 | ||
|
|
2cbd078f51 | ||
|
|
1c02d4bfbf | ||
|
|
716f248dcd | ||
|
|
867a3e0085 | ||
|
|
fa0e93148c | ||
|
|
e054b19038 | ||
|
|
5f6da1c0f8 | ||
|
|
407d4a75bb | ||
|
|
34160ec4ec | ||
|
|
6770ae09d3 | ||
|
|
b34d96c1c3 | ||
|
|
c3d5a4a783 | ||
|
|
828c373b6d | ||
|
|
fd2df2ede4 | ||
|
|
63cb01d656 | ||
|
|
1c59e0a121 | ||
|
|
8a0adb0183 | ||
|
|
12545799f9 | ||
|
|
99be023555 | ||
|
|
0ffd4fd1a2 | ||
|
|
0925ebb4fa | ||
|
|
43d3b66471 | ||
|
|
73e561d51a | ||
|
|
3062864d2c | ||
|
|
681c331d2c | ||
|
|
989b5b8e3d | ||
|
|
4b43d40257 | ||
|
|
bedf57f515 | ||
|
|
4d1801f1a8 | ||
|
|
85ac3861e7 | ||
|
|
b94a9e1ed1 | ||
|
|
009ce67dbe | ||
|
|
f2a97c6294 | ||
|
|
c8775f9398 | ||
|
|
3ea5f0ec81 | ||
|
|
51c30d2144 | ||
|
|
ad7458633d | ||
|
|
010f91c341 | ||
|
|
bd134904da | ||
|
|
cea1469d47 | ||
|
|
5e6f62f2f1 | ||
|
|
0fb669f9d6 | ||
|
|
51f4735e22 | ||
|
|
7768896a25 | ||
|
|
80ce3401e9 | ||
|
|
b9c9f76197 | ||
|
|
9f666b5106 | ||
|
|
c19683bb19 | ||
|
|
ba20a26459 | ||
|
|
72f000b088 | ||
|
|
1094323fe4 | ||
|
|
f79b4f5ce1 | ||
|
|
2ce37586de | ||
|
|
ca407bdf9d | ||
|
|
506ffb1f74 | ||
|
|
ffc9da3a52 | ||
|
|
1ce590705a | ||
|
|
a749a69501 | ||
|
|
e8fd72d5bb | ||
|
|
e59adf8f04 | ||
|
|
8fb1053bfe | ||
|
|
4f136612d9 | ||
|
|
ff498c4aed | ||
|
|
65211d70bc | ||
|
|
72d848c21d | ||
|
|
9577fb1f47 | ||
|
|
f508a6a0d6 | ||
|
|
a2599d0fc2 | ||
|
|
727e8b0bde | ||
|
|
4b3017faf2 | ||
|
|
78b178f716 | ||
|
|
baf073c6c5 | ||
|
|
7296e729ce | ||
|
|
7cf96b1a9e | ||
|
|
05ac60f348 | ||
|
|
080e734812 | ||
|
|
7eb453acd5 | ||
|
|
3a4f411faa | ||
|
|
4c04c52a9d | ||
|
|
a730d142be | ||
|
|
a61e1620e7 | ||
|
|
e4f85c39b2 | ||
|
|
9ec93868c1 | ||
|
|
d46c3fc694 | ||
|
|
d6d67dbdcb | ||
|
|
73ce7e7e63 | ||
|
|
f8b30d02ec | ||
|
|
2e72b98ed8 | ||
|
|
a8999f947d | ||
|
|
ccf830a458 | ||
|
|
9b9642fca4 | ||
|
|
e0d634e5c3 | ||
|
|
e62f1a8991 | ||
|
|
7bbc8cb035 | ||
|
|
38989c080e | ||
|
|
b4fb989f02 | ||
|
|
08b770bc1b | ||
|
|
cb530ce9e2 | ||
|
|
e105489549 | ||
|
|
95f22ad2a7 | ||
|
|
d229d15c76 | ||
|
|
deb63d8117 | ||
|
|
ecadd90f94 | ||
|
|
419ab1055e | ||
|
|
213744b51e | ||
|
|
b47217154a | ||
|
|
c7a65b99a6 | ||
|
|
249d3236d0 | ||
|
|
d521d95a3d | ||
|
|
987cc1fb28 | ||
|
|
7ec5ab2e48 | ||
|
|
08fe02d9fc | ||
|
|
6201a1a70f | ||
|
|
f1bbfccee2 | ||
|
|
1821246647 | ||
|
|
010c0266ef | ||
|
|
592fde9564 | ||
|
|
508a43be8c |
@@ -7,9 +7,15 @@ INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
_*
|
||||
a.exe
|
||||
a.out
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
b.out
|
||||
bison-*
|
||||
build-aux
|
||||
conf[0-9]*
|
||||
confdefs*
|
||||
config.cache
|
||||
config.h
|
||||
config.hin
|
||||
@@ -17,6 +23,7 @@ config.log
|
||||
config.status
|
||||
configure
|
||||
configure.lineno
|
||||
conftest*
|
||||
intl
|
||||
patches
|
||||
releases
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
@@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail.
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
# Systems where /bin/sh is not the default shell need this. The $(shell)
|
||||
# command below won't work with e.g. stock DOS/Windows shells.
|
||||
|
||||
@@ -131,5 +131,5 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU Bison; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA.
|
||||
|
||||
+10
-5
@@ -1,5 +1,5 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## 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
|
||||
@@ -13,14 +13,19 @@
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
## 02111-1307 USA
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = config po lib data src doc tests
|
||||
SUBDIRS = config po runtime-po lib data src doc examples tests
|
||||
|
||||
EXTRA_DIST = REFERENCES OChangeLog Makefile.maint GNUmakefile Makefile.cfg
|
||||
# Files installed for use by Automake.
|
||||
aclocaldir = @aclocaldir@
|
||||
aclocal_DATA = m4/bison-i18n.m4
|
||||
|
||||
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
|
||||
OChangeLog PACKAGING
|
||||
|
||||
.PHONY: maintainer-check
|
||||
maintainer-check:
|
||||
|
||||
+2
-3
@@ -13,11 +13,10 @@
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
prev_version_file = $(srcdir)/config/prev-version.txt
|
||||
move_if_change = $(srcdir)/config/move-if-change
|
||||
announce_gen = $(srcdir)/config/announce-gen
|
||||
release_archive_dir = releases
|
||||
|
||||
|
||||
+206
-123
@@ -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
|
||||
@@ -16,14 +16,15 @@
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
## 02111-1307, USA.
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301, USA.
|
||||
|
||||
# This is reported not to work with make-3.79.1
|
||||
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||
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) \
|
||||
@@ -443,14 +523,16 @@ po-update:
|
||||
# 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)/config/config.guess \
|
||||
$(srcdir)/config/config.sub \
|
||||
$(srcdir)/src/ansi2knr.c \
|
||||
$(srcdir)/config/texinfo.tex
|
||||
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)/config/
|
||||
config.sub-url_prefix = $(ftp-gnu)/config/
|
||||
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/
|
||||
|
||||
@@ -468,11 +550,11 @@ $(get-targets):
|
||||
&& $(move_if_change) $(target).t $(target)
|
||||
|
||||
cvs_files ?= \
|
||||
$(srcdir)/src/ansi2knr.c \
|
||||
$(srcdir)/config/depcomp \
|
||||
$(srcdir)/config/install-sh \
|
||||
$(srcdir)/config/missing \
|
||||
$(srcdir)/config/mkinstalldirs
|
||||
$(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:[email protected]:/cvs/automake
|
||||
.PHONY: wget-update
|
||||
wget-update: $(get-targets)
|
||||
@@ -492,25 +574,26 @@ cvs-update:
|
||||
done; \
|
||||
test "$$fail" && exit 1
|
||||
|
||||
define emit-upload-commands
|
||||
echo =====================================
|
||||
echo =====================================
|
||||
echo upload $(PACKAGE) $(PREV_VERSION) $(VERSION)
|
||||
echo '# send the /tmp/announcement e-mail'
|
||||
echo =====================================
|
||||
echo =====================================
|
||||
endef
|
||||
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)
|
||||
|
||||
@@ -1,6 +1,30 @@
|
||||
Bison News
|
||||
----------
|
||||
|
||||
Changes in version 2.1, 2005-09-16:
|
||||
|
||||
* Bison-generated parsers now support the translation of diagnostics like
|
||||
"syntax error" into languages other than English. The default
|
||||
language is still English. For details, please see the new
|
||||
Internationalization section of the Bison manual. Software
|
||||
distributors should also see the new PACKAGING file. Thanks to
|
||||
Bruno Haible for this new feature.
|
||||
|
||||
* Wording in the Bison-generated parsers has been changed slightly to
|
||||
simplify translation. In particular, the message "memory exhausted"
|
||||
has replaced "parser stack overflow", as the old message was not
|
||||
always accurate for modern Bison-generated parsers.
|
||||
|
||||
* Destructors are now called when the parser aborts, for all symbols left
|
||||
behind on the stack. Also, the start symbol is now destroyed after a
|
||||
successful parse. In both cases, the behavior was formerly inconsistent.
|
||||
|
||||
* When generating verbose diagnostics, Bison-generated parsers no longer
|
||||
quote the literal strings associated with tokens. For example, for
|
||||
a syntax error associated with '%token NUM "number"' they might
|
||||
print 'syntax error, unexpected number' instead of 'syntax error,
|
||||
unexpected "number"'.
|
||||
|
||||
Changes in version 2.0, 2004-12-25:
|
||||
|
||||
* Possibly-incompatible changes
|
||||
@@ -399,6 +423,8 @@ Changes in version 1.31, 2002-01-14:
|
||||
alloca is used only when compiled with GCC, to avoid portability
|
||||
problems as on AIX.
|
||||
|
||||
* yyparse now returns 2 if memory is exhausted; formerly it dumped core.
|
||||
|
||||
* When the generated parser lacks debugging code, YYDEBUG is now 0
|
||||
(as POSIX requires) instead of being undefined.
|
||||
|
||||
@@ -593,7 +619,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
Copyright (C) 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.
|
||||
@@ -610,5 +636,5 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
Packaging hints for binary package distributors
|
||||
===============================================
|
||||
|
||||
Although the source of the bison package comes as a single package,
|
||||
in distributions of binary packages the installed files should
|
||||
be split into two packages:
|
||||
|
||||
bison-runtime
|
||||
Contents: Runtime libraries and programs.
|
||||
Audience: Anyone who wants to run internationalized programs
|
||||
that contain Bison-generated parsers.
|
||||
|
||||
bison
|
||||
Contents: Tools and documentation for developers that use Bison.
|
||||
Audience: Anyone who wants to develop programs that use parsers.
|
||||
Dependencies: requires bison-runtime.
|
||||
|
||||
The 'bison-runtime' binary package is much smaller than the 'bison'
|
||||
binary package. It should be included in any distribution that
|
||||
contains localized programs that use the diagnostics contained in
|
||||
Bison-generated parsers.
|
||||
|
||||
If you want to install both packages at the same time, you simply do
|
||||
at the toplevel directory:
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
After installation, the file
|
||||
|
||||
$prefix/share/locale/*/LC_MESSAGES/bison-runtime.mo
|
||||
|
||||
belongs to the bison-runtime package; all other installed files belong
|
||||
to the bison package.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 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 autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
@@ -3,34 +3,25 @@ This directory contains the Bison parser generator.
|
||||
See the file INSTALL for generic compilation and installation instructions.
|
||||
See the file doc/FAQ for frequently asked questions.
|
||||
|
||||
Bison requires GNU m4 1.4 or later. Vanilla GNU m4 1.4 has some
|
||||
serious bugs, so we recommend using m4 1.4 as patched by the standard
|
||||
GNU/Linux distributions. If you're building GNU m4 1.4 from scratch
|
||||
we suggest using this version:
|
||||
Bison requires GNU m4 1.4.3 or later. See:
|
||||
|
||||
ftp://ftp.gnu.org/gnu/m4/m4-1.4.2.tar.gz
|
||||
ftp://ftp.gnu.org/gnu/m4/m4-1.4.3.tar.gz
|
||||
|
||||
Older versions of Sun Forte Developer 6 update 2 have a compiler bug
|
||||
that cause "make check" to fail with a "Encounter BINCL entry"
|
||||
diagnostic. To fix the bug, update to the latest set of Solaris and
|
||||
Forte patches recommended by Sun.
|
||||
Bison can work with pre-1.4.3 distributions of GNU m4 if they are
|
||||
sufficiently patched, but if you encounter a bug with an older
|
||||
distribution and report a bug we will probably suggest that you
|
||||
upgrade to 1.4.3 as the first step in trying to fix it.
|
||||
|
||||
VMS and MS-DOS builds are probably broken right now. If you are able
|
||||
to build Bison on either platform and you need to make changes to do
|
||||
so, please submit those changes as a bug report. On VMS, you will
|
||||
probably have to create Makefile from Makefile.in by hand. Remember
|
||||
to do `SET COMMAND BISON' to install the data in `BISON.CLD'.
|
||||
Please send bug reports to <[email protected]>. Please include the
|
||||
version number from `bison --version', and a complete, self-contained
|
||||
test case in each bug report.
|
||||
|
||||
Send bug reports to <[email protected]>. Please include the version
|
||||
number from `bison --version', and a complete, self-contained test
|
||||
case in each bug report.
|
||||
|
||||
If you have questions about using Bison which the documentation does
|
||||
not answer, send mail to <[email protected]>.
|
||||
If you have questions about using Bison and the documentation does
|
||||
not answer them, please send mail to <[email protected]>.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1992, 1998, 1999, 2003, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -46,5 +37,5 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
+2
-2
@@ -28,5 +28,5 @@ 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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
+23
-29
@@ -9,11 +9,25 @@ Only the sources are installed in the CVS repository (to ease the
|
||||
maintenance, merges etc.), therefore you will have to get the latest
|
||||
stable versions of the maintainer tools we depend upon, including:
|
||||
|
||||
- Automake
|
||||
- Autoconf
|
||||
- Flex
|
||||
- Gettext
|
||||
- CVS Bison itself
|
||||
- Automake <http://www.gnu.org/software/automake/>
|
||||
- Autoconf <http://www.gnu.org/software/autoconf/>
|
||||
- Flex <http://www.gnu.org/software/flex/>
|
||||
- Gettext <http://www.gnu.org/software/gettext/>
|
||||
- Gzip <http://www.gnu.org/software/gzip/>
|
||||
- Tar <http://www.gnu.org/software/tar/>
|
||||
- Wget <http://www.gnu.org/software/wget/>
|
||||
|
||||
As of this writing, the latest stable version of Gzip is 1.2.4 but we
|
||||
suggest using test version 1.3.5 (or later, if one becomes available).
|
||||
|
||||
Valgrind <http://valgrind.org/> is also highly recommended, if
|
||||
Valgrind supports your architecture.
|
||||
|
||||
Bison is written using Bison grammars, so there are bootstrapping
|
||||
issues. The bootstrap script attempts to discover when the C code
|
||||
generated from the grammars is out of date, and to bootstrap with an
|
||||
out-of-date version of the C code, but the process is not foolproof.
|
||||
Also, you may run into similar problems yourself if you modify Bison.
|
||||
|
||||
Only building the initial full source tree will be a bit painful,
|
||||
later, a plain `cvs update -P & make' should be sufficient.
|
||||
@@ -39,33 +53,13 @@ and the CVS master copy:
|
||||
|
||||
$ cvs diff
|
||||
|
||||
should output no difference, except maybe the date in po/*.po files.
|
||||
should output no difference.
|
||||
|
||||
Enjoy!
|
||||
|
||||
* Troubleshooting
|
||||
|
||||
Unfortunately the current Gettext still does not include all the
|
||||
needed tools so that the bootstrapping always perform successfully.
|
||||
|
||||
If you experience problems, I suggest the following:
|
||||
|
||||
1. Do a regular CVS checkout
|
||||
|
||||
2. Fetch a recent tarball in:
|
||||
ftp://alpha.gnu.org/gnu/bison/
|
||||
|
||||
3. Extract it
|
||||
|
||||
4. Override the content of your checkout with the content of this
|
||||
tarball, i.e.:
|
||||
cp -r bison-1.875c/* bison-cvs
|
||||
|
||||
5. Proceed on ./configure && make etc.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
@@ -81,5 +75,5 @@ 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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
@@ -8,6 +8,7 @@ Alexander Belopolsky [email protected]
|
||||
Alexandre Duret-Lutz [email protected]
|
||||
Andreas Schwab [email protected]
|
||||
Andrew Suffield [email protected]
|
||||
Anthony Heading [email protected]
|
||||
Arnold Robbins [email protected]
|
||||
Art Haas [email protected]
|
||||
Baron Schwartz [email protected]
|
||||
@@ -33,6 +34,7 @@ Jan Nieuwenhuizen [email protected]
|
||||
Jesse Thilo [email protected]
|
||||
Jim Kent [email protected]
|
||||
Jim Meyering [email protected]
|
||||
Joel E. Denny [email protected]
|
||||
Juan Manuel Guerrero [email protected]
|
||||
Kees Zeelenberg [email protected]
|
||||
Keith Browne [email protected]
|
||||
@@ -72,6 +74,7 @@ Wayne Green [email protected]
|
||||
Wolfram Wagner [email protected]
|
||||
Wwp [email protected]
|
||||
Zack Weinberg [email protected]
|
||||
[email protected]
|
||||
|
||||
Many people are not named here because we lost track of them. We
|
||||
thank them! Please, help us keeping this list up to date.
|
||||
|
||||
@@ -12,18 +12,16 @@ They should not: it is not documented. But if they need to, let's
|
||||
find something clean (not like YYLSP_NEEDED...).
|
||||
|
||||
|
||||
* URGENT: Documenting C++ output
|
||||
Write a first documentation for C++ output.
|
||||
|
||||
|
||||
* Documentation
|
||||
Before releasing, make sure the documentation ("Understanding your
|
||||
parser") refers to the current `output' format.
|
||||
|
||||
* lalr1.cc
|
||||
** vector
|
||||
Move to using vector, drop stack.hh.
|
||||
|
||||
* GLR & C++
|
||||
Currently, the GLR parser cannot compile with a C++ compiler.
|
||||
|
||||
** I18n
|
||||
Catch up with yacc.c.
|
||||
|
||||
* Report
|
||||
|
||||
@@ -52,14 +50,7 @@ DeRemer and Penello: they already provide the algorithm.
|
||||
|
||||
* Extensions
|
||||
|
||||
** %destructor
|
||||
I think we should document it as experimental, and allow its use in
|
||||
the next releases. But we also need to port it to GLR. What about
|
||||
lalr1.cc? Well, read what Hans reported, maybe we don't want
|
||||
%detructor. On the other hand, there is no reason not to provide it:
|
||||
users can avoid its use.
|
||||
|
||||
** $foo
|
||||
** Labeling the symbols
|
||||
Have a look at the Lemon parser generator: instead of $1, $2 etc. they
|
||||
can name the values. This is much more pleasant. For instance:
|
||||
|
||||
@@ -69,6 +60,21 @@ I love this. I have been bitten too often by the removal of the
|
||||
symbol, and forgetting to shift all the $n to $n-1. If you are
|
||||
unlucky, it compiles...
|
||||
|
||||
But instead of using $a etc., we can use regular variables. And
|
||||
instead of using (), I propose to use `:' (again). Paul suggests
|
||||
supporting `->' in addition to `:' to separate LHS and RHS. In other
|
||||
words:
|
||||
|
||||
r:exp -> a:exp '+' b:exp { r = a + b; };
|
||||
|
||||
That requires an significant improvement of the grammar parser. Using
|
||||
GLR would be nice. It also requires that Bison know the type of the
|
||||
symbols (which will be useful for %include anyway). So we have some
|
||||
time before...
|
||||
|
||||
Note that there remains the problem of locations: `@r'?
|
||||
|
||||
|
||||
** $-1
|
||||
We should find a means to provide an access to values deep in the
|
||||
stack. For instance, instead of
|
||||
@@ -192,7 +198,9 @@ Paul notes:
|
||||
PDP-10 ports :-) but they should probably be documented
|
||||
somewhere.
|
||||
|
||||
|
||||
More importantly, Bison does not currently allow NUL bytes in
|
||||
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
||||
the source code. This should get fixed.
|
||||
|
||||
* --graph
|
||||
Show reductions. []
|
||||
@@ -353,5 +361,5 @@ 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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Bootstrap this package from CVS.
|
||||
|
||||
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
# Copyright (C) 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
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# Written by Paul Eggert.
|
||||
|
||||
@@ -25,6 +25,7 @@ package=bison
|
||||
|
||||
# Ensure file names are sorted consistently across platforms;
|
||||
# e.g., m4/ulonglong_gl.m4 should follow m4/ulonglong.m4.
|
||||
# Also, ensure diagnostics are in English, e.g., "wget --help" below.
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
@@ -83,7 +84,7 @@ case ${GNULIB_SRCDIR--} in
|
||||
|
||||
cvs -z3 -q -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib co gnulib || exit
|
||||
|
||||
trap 0
|
||||
trap - 0
|
||||
fi
|
||||
GNULIB_SRCDIR=gnulib
|
||||
esac
|
||||
@@ -97,6 +98,7 @@ dirname
|
||||
error
|
||||
extensions
|
||||
getopt
|
||||
gettext
|
||||
hard-locale
|
||||
hash
|
||||
malloc
|
||||
@@ -105,7 +107,9 @@ obstack
|
||||
quote
|
||||
quotearg
|
||||
stdbool
|
||||
stdio-safer
|
||||
stpcpy
|
||||
unistd-safer
|
||||
xalloc
|
||||
xalloc-die
|
||||
xstrndup
|
||||
@@ -150,6 +154,8 @@ for gnulib_file in $gnulib_files; do
|
||||
cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
|
||||
done
|
||||
|
||||
# This suppresses a bogus diagnostic
|
||||
# "warning: macro `AM_LANGINFO_CODESET' not found in library".
|
||||
echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
|
||||
sed '
|
||||
/^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
|
||||
@@ -161,13 +167,61 @@ sed '
|
||||
|
||||
case $SKIP_PO in
|
||||
'')
|
||||
case `wget --help` in
|
||||
*'--no-cache'*)
|
||||
no_cache='--no-cache';;
|
||||
*'--cache=on/off'*)
|
||||
no_cache='--cache=off';;
|
||||
*)
|
||||
no_cache='';;
|
||||
esac
|
||||
|
||||
echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
|
||||
(cd po &&
|
||||
rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'` &&
|
||||
wget -nv -nd -r -l 1 -A .po -C off \
|
||||
http://www2.iro.umontreal.ca/~gnutra/po/maint/$package/ &&
|
||||
wget -nv -nd -r -l 1 -A .po $no_cache \
|
||||
http://www.iro.umontreal.ca/translation/maint/$package/ &&
|
||||
ls *.po | sed 's/\.po$//' >LINGUAS
|
||||
) || exit;;
|
||||
) || exit
|
||||
|
||||
case $package in
|
||||
bison)
|
||||
echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
|
||||
(cd runtime-po &&
|
||||
rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po$/p'` &&
|
||||
wget -nv -nd -r -l 1 -A .po $no_cache \
|
||||
http://www.iro.umontreal.ca/translation/maint/$package-runtime/ &&
|
||||
|
||||
# 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.
|
||||
for po in ../po/*.po; do
|
||||
test -f "$po" || continue
|
||||
runpo=`basename $po`
|
||||
test -f $runpo || {
|
||||
msggrep -K \
|
||||
-e 'memory exhausted' \
|
||||
-e 'syntax error' \
|
||||
$po 2>/dev/null |
|
||||
sed '
|
||||
s/^#~ //
|
||||
/^msgid "syntax error; also memory exhausted"$/,/^$/d
|
||||
/^$/,${ /^#/d; }
|
||||
' >$runpo-
|
||||
if cmp -s $runpo- $runpo; then
|
||||
rm $runpo-
|
||||
else
|
||||
mv $runpo- $runpo
|
||||
fi
|
||||
test -s $runpo || rm -f $runpo
|
||||
} || exit
|
||||
done &&
|
||||
|
||||
ls *.po | sed 's/\.po$//' >LINGUAS
|
||||
) || exit
|
||||
esac;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -197,6 +251,7 @@ intl_files_to_remove='
|
||||
intl
|
||||
m4/codeset.m4
|
||||
m4/gettext.m4
|
||||
m4/glibc2.m4
|
||||
m4/glibc21.m4
|
||||
m4/intdiv0.m4
|
||||
m4/intmax.m4
|
||||
@@ -223,21 +278,19 @@ intl_files_to_remove='
|
||||
echo $0: rm -fr $intl_files_to_remove ...
|
||||
rm -fr $intl_files_to_remove || exit
|
||||
|
||||
# Patch what appears to be a bug in gettext 0.14.1;
|
||||
# remove this once the bug is fixed.
|
||||
grep @top_builddir@ po/Makefile.in.in >/dev/null || {
|
||||
echo "$0: prepending 'top_builddir=@top_builddir@' to po/Makefile.in.in ... "
|
||||
old_contents=`cat po/Makefile.in.in` || exit
|
||||
cat >po/Makefile.in.in <<EOF
|
||||
top_builddir=@top_builddir@
|
||||
$old_contents
|
||||
EOF
|
||||
}
|
||||
|
||||
# Put bug-reporting address into po/Makevars.
|
||||
echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= [email protected]/' po/Makevars.template >po/Makevars ..."
|
||||
sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= [email protected]/' po/Makevars.template >po/Makevars
|
||||
|
||||
# Likewise for runtime-po/Makevars, except also change a few other parameters.
|
||||
sed '
|
||||
s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
|
||||
s/^\(subdir\) *=.*/\1 = runtime-po/
|
||||
s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
|
||||
' <po/Makevars >runtime-po/Makevars
|
||||
|
||||
# Copy identical files from po to runtime-po.
|
||||
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||
|
||||
# if src/parse-gram.[ch] are out of date, rebuild them.
|
||||
parse_gram_y=`find src/parse-gram.y \
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
*.t
|
||||
Makefile
|
||||
Makefile.in
|
||||
config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
install-sh
|
||||
mdate-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
texinfo.tex
|
||||
ylwrap
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
EXTRA_DIST = move-if-change prev-version.txt config.rpath
|
||||
EXTRA_DIST = prev-version.txt
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Like mv $1 $2, but if the files are the same, just delete $1.
|
||||
# Status is 0 if $2 is changed, 1 otherwise.
|
||||
if
|
||||
test -r $2
|
||||
then
|
||||
if
|
||||
cmp -s $1 $2
|
||||
then
|
||||
echo $2 is unchanged
|
||||
rm -f $1
|
||||
else
|
||||
mv -f $1 $2
|
||||
fi
|
||||
else
|
||||
mv -f $1 $2
|
||||
fi
|
||||
@@ -1 +1 @@
|
||||
1.75
|
||||
2.0
|
||||
|
||||
+17
-8
@@ -1,6 +1,6 @@
|
||||
# Configure template for GNU Bison. -*-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
|
||||
@@ -14,8 +14,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
# This file uses AC_CONFIG_MACRO_DIR, so we need Autoconf 2.58 or better.
|
||||
# But Autoconf 2.58 has a bug in the way that it generates tests: it
|
||||
@@ -23,8 +23,8 @@
|
||||
# least Autoconf 2.59.
|
||||
AC_PREREQ(2.59)
|
||||
|
||||
AC_INIT([GNU Bison], [2.0], [[email protected]])
|
||||
AC_CONFIG_AUX_DIR([config])
|
||||
AC_INIT([GNU Bison], [2.1], [[email protected]])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
||||
@@ -107,8 +107,15 @@ BISON_PREREQ_TIMEVAR
|
||||
|
||||
# gnulib and gettext.
|
||||
GNULIB_AUTOCONF_SNIPPET
|
||||
# We use po/Makevars.template, so we need at least gettext 0.12.
|
||||
# We use po/Makevars, so we need at least gettext 0.12.
|
||||
AM_GNU_GETTEXT_VERSION([0.12])
|
||||
BISON_I18N
|
||||
|
||||
# Internationalized parsers.
|
||||
AC_CONFIG_FILES([runtime-po/Makefile.in])
|
||||
# Autoconf macros for packages using internationalized parsers.
|
||||
aclocaldir='${datadir}/aclocal'
|
||||
AC_SUBST([aclocaldir])
|
||||
|
||||
# Initialize the test suite.
|
||||
AC_CONFIG_TESTDIR(tests)
|
||||
@@ -120,14 +127,16 @@ BISON_TEST_FOR_WORKING_CXX_COMPILER
|
||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||
# Needed by tests/atlocal.in.
|
||||
AC_SUBST([GCC])
|
||||
O0CFLAGS=`echo $CFLAGS | sed 's/-O[0-9] *//'`
|
||||
O0CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]] *//'`
|
||||
AC_SUBST([O0CFLAGS])
|
||||
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[0-9] *//'`
|
||||
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`
|
||||
AC_SUBST([O0CXXFLAGS])
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
config/Makefile
|
||||
po/Makefile.in
|
||||
data/Makefile
|
||||
examples/Makefile
|
||||
examples/calc++/Makefile
|
||||
lib/Makefile src/Makefile doc/Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
+6
-4
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
## Copyright (C) 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
|
||||
@@ -12,10 +12,12 @@
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
## 02111-1307 USA
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
|
||||
dist_pkgdata_DATA = README c.m4 yacc.c lalr1.cc glr.c
|
||||
dist_pkgdata_DATA = README \
|
||||
c.m4 yacc.c glr.c \
|
||||
c++.m4 lalr1.cc
|
||||
|
||||
m4sugardir = $(pkgdatadir)/m4sugar
|
||||
dist_m4sugar_DATA = m4sugar/m4sugar.m4
|
||||
|
||||
+2
-2
@@ -41,5 +41,5 @@ 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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
m4_divert(-1)
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
# Default parser class name.
|
||||
m4_define_default([b4_parser_class_name], [parser])
|
||||
m4_define_default([b4_location_type], [location])
|
||||
m4_define_default([b4_filename_type], [std::string])
|
||||
|
||||
|
||||
|
||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
# -----------------------------------------------------
|
||||
# Output the definition of the tokens (if there are) as enums.
|
||||
m4_define([b4_token_enums],
|
||||
[m4_if([$@], [[]], [],
|
||||
[/* Tokens. */
|
||||
enum yytokentype {
|
||||
m4_map_sep([ b4_token_enum], [,
|
||||
],
|
||||
[$@])
|
||||
};
|
||||
])])
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Semantic Values. ##
|
||||
## ----------------- ##
|
||||
|
||||
|
||||
# b4_lhs_value([TYPE])
|
||||
# --------------------
|
||||
# Expansion of $<TYPE>$.
|
||||
m4_define([b4_lhs_value],
|
||||
[(yyval[]m4_ifval([$1], [.$1]))])
|
||||
|
||||
|
||||
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
||||
# --------------------------------------
|
||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||
# symbols on RHS.
|
||||
m4_define([b4_rhs_value],
|
||||
[(yysemantic_stack_@{m4_eval([$1 - $2])@}m4_ifval([$3], [.$3]))])
|
||||
|
||||
# b4_lhs_location()
|
||||
# -----------------
|
||||
# Expansion of @$.
|
||||
m4_define([b4_lhs_location],
|
||||
[(yyloc)])
|
||||
|
||||
|
||||
# b4_rhs_location(RULE-LENGTH, NUM)
|
||||
# ---------------------------------
|
||||
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
|
||||
# on RHS.
|
||||
m4_define([b4_rhs_location],
|
||||
[(yylocation_stack_@{m4_eval([$1 - $2])@})])
|
||||
|
||||
|
||||
# b4_parse_param_decl
|
||||
# -------------------
|
||||
# Extra formal arguments of the constructor.
|
||||
# Change the parameter names from "foo" into "foo_yyarg", so that
|
||||
# there is no collision bw the user chosen attribute name, and the
|
||||
# argument name in the constructor.
|
||||
m4_define([b4_parse_param_decl],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
|
||||
|
||||
m4_define([b4_parse_param_decl_1],
|
||||
[$1_yyarg])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_cons
|
||||
# -------------------
|
||||
# Extra initialisations of the constructor.
|
||||
m4_define([b4_parse_param_cons],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[,
|
||||
b4_cc_constructor_calls(b4_parse_param)])])
|
||||
m4_define([b4_cc_constructor_calls],
|
||||
[m4_map_sep([b4_cc_constructor_call], [,
|
||||
], [$@])])
|
||||
m4_define([b4_cc_constructor_call],
|
||||
[$2 ($2_yyarg)])
|
||||
|
||||
# b4_parse_param_vars
|
||||
# -------------------
|
||||
# Extra instance variables.
|
||||
m4_define([b4_parse_param_vars],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[
|
||||
/* User arguments. */
|
||||
b4_cc_var_decls(b4_parse_param)])])
|
||||
m4_define([b4_cc_var_decls],
|
||||
[m4_map_sep([b4_cc_var_decl], [
|
||||
], [$@])])
|
||||
m4_define([b4_cc_var_decl],
|
||||
[ $1;])
|
||||
@@ -1,7 +1,7 @@
|
||||
m4_divert(-1) -*- Autoconf -*-
|
||||
|
||||
# C M4 Macros for Bison.
|
||||
# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 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
|
||||
@@ -15,8 +15,8 @@ m4_divert(-1) -*- Autoconf -*-
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
@@ -43,8 +43,8 @@ m4_define([b4_copyright],
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */])
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */])
|
||||
|
||||
|
||||
# b4_identification
|
||||
@@ -53,6 +53,9 @@ m4_define([b4_identification],
|
||||
[/* Identify Bison output. */
|
||||
[#]define YYBISON 1
|
||||
|
||||
/* Bison version. */
|
||||
[#]define YYBISON_VERSION "b4_version"
|
||||
|
||||
/* Skeleton name. */
|
||||
[#]define YYSKELETON_NAME b4_skeleton
|
||||
|
||||
@@ -119,7 +122,7 @@ m4_define([b4_int_type],
|
||||
|
||||
m4_eval([0 <= $1]), [1], [unsigned int],
|
||||
|
||||
[int])])
|
||||
[int])])
|
||||
|
||||
|
||||
# b4_int_type_for(NAME)
|
||||
@@ -166,6 +169,16 @@ m4_define([b4_token_define],
|
||||
])
|
||||
|
||||
|
||||
# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
# -------------------------------------------------------
|
||||
# Output the definition of the tokens (if there are) as #defines.
|
||||
m4_define([b4_token_defines],
|
||||
[m4_if([$@], [[]], [],
|
||||
[/* Tokens. */
|
||||
m4_map([b4_token_define], [$@])])
|
||||
])
|
||||
|
||||
|
||||
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
|
||||
# ---------------------------------------
|
||||
# Output the definition of this token as an enum.
|
||||
@@ -173,10 +186,10 @@ m4_define([b4_token_enum],
|
||||
[$1 = $2])
|
||||
|
||||
|
||||
# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
# -------------------------------------------------------
|
||||
# Output the definition of the tokens (if there are) as enums and #define.
|
||||
m4_define([b4_token_defines],
|
||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
# -----------------------------------------------------
|
||||
# Output the definition of the tokens (if there are) as enums.
|
||||
m4_define([b4_token_enums],
|
||||
[m4_if([$@], [[]], [],
|
||||
[/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
@@ -189,8 +202,14 @@ m4_map_sep([ b4_token_enum], [,
|
||||
[$@])
|
||||
};
|
||||
#endif
|
||||
m4_map([b4_token_define], [$@])
|
||||
])
|
||||
])])
|
||||
|
||||
|
||||
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
# -------------------------------------------------------------
|
||||
# Output the definition of the tokens (if there are) as enums and #defines.
|
||||
m4_define([b4_token_enums_defines],
|
||||
[b4_token_enums($@)b4_token_defines($@)
|
||||
])
|
||||
|
||||
|
||||
@@ -345,7 +364,7 @@ m4_popdef([b4_dollar_dollar])dnl
|
||||
# Generate the "yydestruct" function, which declaration is issued using
|
||||
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
||||
# or "b4_c_function_def" for K&R.
|
||||
m4_define([b4_yydestruct_generate],
|
||||
m4_define_default([b4_yydestruct_generate],
|
||||
[[/*-----------------------------------------------.
|
||||
| Release the memory associated to this symbol. |
|
||||
`-----------------------------------------------*/
|
||||
@@ -380,7 +399,7 @@ m4_define([b4_yydestruct_generate],
|
||||
# Generate the "yysymprint" function, which declaration is issued using
|
||||
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
||||
# or "b4_c_function_def" for K&R.
|
||||
m4_define([b4_yysymprint_generate],
|
||||
m4_define_default([b4_yysymprint_generate],
|
||||
[[/*--------------------------------.
|
||||
| Print this symbol on YYOUTPUT. |
|
||||
`--------------------------------*/
|
||||
@@ -403,7 +422,7 @@ b4_location_if([ (void) yylocationp;
|
||||
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
||||
|
||||
]b4_location_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
|
||||
fprintf (yyoutput, ": ");
|
||||
YYFPRINTF (yyoutput, ": ");
|
||||
])dnl
|
||||
[
|
||||
# ifdef YYPRINT
|
||||
|
||||
+497
-227
File diff suppressed because it is too large
Load Diff
+218
-227
@@ -1,6 +1,8 @@
|
||||
m4_divert(-1)
|
||||
|
||||
# C++ skeleton for Bison
|
||||
# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 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
|
||||
@@ -14,98 +16,10 @@ m4_divert(-1)
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
# Default parser class name.
|
||||
m4_define_default([b4_parser_class_name], [parser])
|
||||
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Semantic Values. ##
|
||||
## ----------------- ##
|
||||
|
||||
|
||||
# b4_lhs_value([TYPE])
|
||||
# --------------------
|
||||
# Expansion of $<TYPE>$.
|
||||
m4_define([b4_lhs_value],
|
||||
[(yyval[]m4_ifval([$1], [.$1]))])
|
||||
|
||||
|
||||
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
||||
# --------------------------------------
|
||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||
# symbols on RHS.
|
||||
m4_define([b4_rhs_value],
|
||||
[(yysemantic_stack_@{m4_eval([$1 - $2])@}m4_ifval([$3], [.$3]))])
|
||||
|
||||
m4_define_default([b4_location_type], [location])
|
||||
m4_define_default([b4_filename_type], [std::string])
|
||||
|
||||
# b4_lhs_location()
|
||||
# -----------------
|
||||
# Expansion of @$.
|
||||
m4_define([b4_lhs_location],
|
||||
[(yyloc)])
|
||||
|
||||
|
||||
# b4_rhs_location(RULE-LENGTH, NUM)
|
||||
# ---------------------------------
|
||||
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
|
||||
# on RHS.
|
||||
m4_define([b4_rhs_location],
|
||||
[(yylocation_stack_@{m4_eval([$1 - $2])@})])
|
||||
|
||||
|
||||
# b4_parse_param_decl
|
||||
# -------------------
|
||||
# Extra formal arguments of the constructor.
|
||||
# Change the parameter names from "foo" into "foo_yyarg", so that
|
||||
# there is no collision bw the user chosen attribute name, and the
|
||||
# argument name in the constructor.
|
||||
m4_define([b4_parse_param_decl],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
|
||||
|
||||
m4_define([b4_parse_param_decl_1],
|
||||
[$1_yyarg])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_cons
|
||||
# -------------------
|
||||
# Extra initialisations of the constructor.
|
||||
m4_define([b4_parse_param_cons],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[,
|
||||
b4_cc_constructor_calls(b4_parse_param)])])
|
||||
m4_define([b4_cc_constructor_calls],
|
||||
[m4_map_sep([b4_cc_constructor_call], [,
|
||||
], [$@])])
|
||||
m4_define([b4_cc_constructor_call],
|
||||
[$2 ($2_yyarg)])
|
||||
|
||||
# b4_parse_param_vars
|
||||
# -------------------
|
||||
# Extra instance variables.
|
||||
m4_define([b4_parse_param_vars],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[
|
||||
/* User arguments. */
|
||||
b4_cc_var_decls(b4_parse_param)])])
|
||||
m4_define([b4_cc_var_decls],
|
||||
[m4_map_sep([b4_cc_var_decl], [
|
||||
], [$@])])
|
||||
m4_define([b4_cc_var_decl],
|
||||
[ $1;])
|
||||
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
m4_include(b4_pkgdatadir/[c++.m4])
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
@@ -113,7 +27,7 @@ m4_divert(0)dnl
|
||||
m4_if(b4_defines_flag, 0, [],
|
||||
[@output @output_header_name@
|
||||
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
|
||||
[2002, 2003, 2004])[
|
||||
[2002, 2003, 2004, 2005])[
|
||||
/* FIXME: This is wrong, we want computed header guards.
|
||||
I don't know why the macros are missing now. :( */
|
||||
#ifndef PARSER_HEADER_H
|
||||
@@ -131,7 +45,7 @@ namespace yy
|
||||
class location;
|
||||
}
|
||||
|
||||
]b4_token_defines(b4_tokens)[
|
||||
]b4_token_enums(b4_tokens)[
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
]b4_pre_prologue[
|
||||
@@ -147,14 +61,28 @@ b4_syncline([@oline@], [@ofile@])[
|
||||
# define YYDEBUG ]b4_debug[
|
||||
#endif
|
||||
|
||||
/* Enabling verbose error message. */
|
||||
#ifndef YYERROR_VERBOSE
|
||||
/* Enabling verbose error messages. */
|
||||
#ifdef YYERROR_VERBOSE
|
||||
# undef YYERROR_VERBOSE
|
||||
# define YYERROR_VERBOSE 1
|
||||
#else
|
||||
# define YYERROR_VERBOSE ]b4_error_verbose[
|
||||
#endif
|
||||
|
||||
#if YYERROR_VERBOSE
|
||||
# define YYERROR_VERBOSE_IF(x) x
|
||||
#else
|
||||
# define YYERROR_VERBOSE_IF(x) /* empty */
|
||||
#endif
|
||||
|
||||
/* Enabling the token table. */
|
||||
#ifndef YYTOKEN_TABLE
|
||||
# define YYTOKEN_TABLE ]b4_token_table[
|
||||
#endif
|
||||
|
||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||
]m4_ifdef([b4_stype],
|
||||
[b4_syncline([b4_stype_line], [b4_filename])
|
||||
[b4_syncline([b4_stype_line], [b4_file_name])
|
||||
union YYSTYPE b4_stype;
|
||||
/* Line __line__ of lalr1.cc. */
|
||||
b4_syncline([@oline@], [@ofile@])],
|
||||
@@ -247,17 +175,14 @@ namespace yy
|
||||
void set_debug_level (debug_level_type l);
|
||||
|
||||
private:
|
||||
|
||||
/// Call the scanner.
|
||||
virtual void yylex_ ();
|
||||
|
||||
/// Report a syntax error.
|
||||
/// \param loc where the syntax error is found.
|
||||
/// \param msg a description of the syntax error.
|
||||
virtual void error (const location_type& loc, const std::string& msg);
|
||||
|
||||
/// Generate an error message, and invoke error.
|
||||
virtual void yyreport_syntax_error_ ();
|
||||
/// Generate an error message.
|
||||
/// \param tok the look-ahead token.
|
||||
virtual std::string yysyntax_error_ (YYERROR_VERBOSE_IF (int tok));
|
||||
|
||||
#if YYDEBUG
|
||||
/// \brief Report a symbol on the debug stream.
|
||||
@@ -319,9 +244,14 @@ namespace yy
|
||||
/// For a rule, its RHS length.
|
||||
static const ]b4_int_type_for([b4_r2])[ yyr2_[];
|
||||
|
||||
#if YYDEBUG || YYERROR_VERBOSE
|
||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||
/// For a symbol, its name in clear.
|
||||
static const char* const yyname_[];
|
||||
static const char* const yytname_[];
|
||||
#endif
|
||||
|
||||
#if YYERROR_VERBOSE
|
||||
/// Convert the symbol name \a n to a form suitable for a diagnostic.
|
||||
virtual std::string yytnamerr_ (const char *n);
|
||||
#endif
|
||||
|
||||
#if YYDEBUG
|
||||
@@ -383,21 +313,6 @@ namespace yy
|
||||
int yydebug_;
|
||||
std::ostream* yycdebug_;
|
||||
|
||||
/* Look-ahead and look-ahead in internal form. */
|
||||
int yylooka_;
|
||||
int yyilooka_;
|
||||
|
||||
/// Semantic value of the look-ahead.
|
||||
semantic_type yylval;
|
||||
/// Location of the look-ahead.
|
||||
location_type yylloc;
|
||||
/// The locations where the error started and ended.
|
||||
location yyerror_range_[2];
|
||||
|
||||
/// $$.
|
||||
semantic_type yyval;
|
||||
/// @@$.
|
||||
location_type yyloc;
|
||||
]b4_parse_param_vars[
|
||||
};
|
||||
}
|
||||
@@ -406,7 +321,7 @@ namespace yy
|
||||
])dnl
|
||||
@output @output_parser_name@
|
||||
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
|
||||
[2002, 2003, 2004])
|
||||
[2002, 2003, 2004, 2005])
|
||||
m4_if(b4_prefix[], [yy], [],
|
||||
[
|
||||
// Take the name prefix into account.
|
||||
@@ -415,6 +330,18 @@ m4_if(b4_defines_flag, 0, [],
|
||||
[
|
||||
#include @output_header_name@])[
|
||||
|
||||
#ifndef YY_
|
||||
# if YYENABLE_NLS
|
||||
# if ENABLE_NLS
|
||||
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
|
||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||
# endif
|
||||
# endif
|
||||
# ifndef YY_
|
||||
# define YY_(msgid) msgid
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* A pseudo ostream that takes yydebug_ into account. */
|
||||
# define YYCDEBUG \
|
||||
for (bool yydebugcond_ = yydebug_; yydebugcond_; yydebugcond_ = false) \
|
||||
@@ -457,6 +384,47 @@ do { \
|
||||
#define YYABORT goto yyabortlab
|
||||
#define YYERROR goto yyerrorlab
|
||||
|
||||
#if YYERROR_VERBOSE
|
||||
|
||||
/* Return YYSTR after stripping away unnecessary quotes and
|
||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||
that double-quoting is unnecessary unless the string contains an
|
||||
apostrophe, a comma, or backslash (other than backslash-backslash).
|
||||
YYSTR is taken from yytname. */
|
||||
std::string
|
||||
yy::]b4_parser_class_name[::yytnamerr_ (const char *yystr)
|
||||
{
|
||||
if (*yystr == '"')
|
||||
{
|
||||
std::string yyr = "";
|
||||
char const *yyp = yystr;
|
||||
|
||||
for (;;)
|
||||
switch (*++yyp)
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
goto do_not_strip_quotes;
|
||||
|
||||
case '\\':
|
||||
if (*++yyp != '\\')
|
||||
goto do_not_strip_quotes;
|
||||
/* Fall through. */
|
||||
default:
|
||||
yyr += *yyp;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
return yyr;
|
||||
}
|
||||
do_not_strip_quotes: ;
|
||||
}
|
||||
|
||||
return yystr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if YYDEBUG
|
||||
/*--------------------------------.
|
||||
| Print this symbol on YYOUTPUT. |
|
||||
@@ -474,7 +442,7 @@ yy::]b4_parser_class_name[::yysymprint_ (int yytype,
|
||||
(void) cdebug_;
|
||||
|
||||
*yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
|
||||
<< ' ' << yyname_[yytype] << " ("
|
||||
<< ' ' << yytname_[yytype] << " ("
|
||||
<< *yylocationp << ": ";
|
||||
switch (yytype)
|
||||
{
|
||||
@@ -542,6 +510,24 @@ yy::]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
||||
int
|
||||
yy::]b4_parser_class_name[::parse ()
|
||||
{
|
||||
/* Look-ahead and look-ahead in internal form. */
|
||||
int yylooka;
|
||||
int yyilooka;
|
||||
|
||||
/// Semantic value of the look-ahead.
|
||||
semantic_type yylval;
|
||||
/// Location of the look-ahead.
|
||||
location_type yylloc;
|
||||
/// The locations where the error started and ended.
|
||||
location yyerror_range[2];
|
||||
|
||||
/// $$.
|
||||
semantic_type yyval;
|
||||
/// @@$.
|
||||
location_type yyloc;
|
||||
|
||||
int yyresult_;
|
||||
|
||||
YYCDEBUG << "Starting parse" << std::endl;
|
||||
|
||||
yynerrs_ = 0;
|
||||
@@ -549,7 +535,7 @@ yy::]b4_parser_class_name[::parse ()
|
||||
|
||||
/* Start. */
|
||||
yystate_ = 0;
|
||||
yylooka_ = yyempty_;
|
||||
yylooka = yyempty_;
|
||||
|
||||
]m4_ifdef([b4_initial_action], [
|
||||
m4_pushdef([b4_at_dollar], [yylloc])dnl
|
||||
@@ -586,25 +572,32 @@ yybackup:
|
||||
goto yydefault;
|
||||
|
||||
/* Read a look-ahead token. */
|
||||
if (yylooka_ == yyempty_)
|
||||
yylex_ ();
|
||||
if (yylooka == yyempty_)
|
||||
{
|
||||
YYCDEBUG << "Reading a token: ";
|
||||
yylooka = ]b4_c_function_call([yylex], [int],
|
||||
[[YYSTYPE*], [&yylval]][]dnl
|
||||
b4_location_if([, [[location*], [&yylloc]]])dnl
|
||||
m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
}
|
||||
|
||||
|
||||
/* Convert token to internal form. */
|
||||
if (yylooka_ <= yyeof_)
|
||||
if (yylooka <= yyeof_)
|
||||
{
|
||||
yylooka_ = yyilooka_ = yyeof_;
|
||||
yylooka = yyilooka = yyeof_;
|
||||
YYCDEBUG << "Now at end of input." << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyilooka_ = yytranslate_ (yylooka_);
|
||||
YY_SYMBOL_PRINT ("Next token is", yyilooka_, &yylval, &yylloc);
|
||||
yyilooka = yytranslate_ (yylooka);
|
||||
YY_SYMBOL_PRINT ("Next token is", yyilooka, &yylval, &yylloc);
|
||||
}
|
||||
|
||||
/* If the proper action on seeing token ILOOKA_ is to reduce or to
|
||||
detect an error, take that action. */
|
||||
yyn_ += yyilooka_;
|
||||
if (yyn_ < 0 || yylast_ < yyn_ || yycheck_[yyn_] != yyilooka_)
|
||||
yyn_ += yyilooka;
|
||||
if (yyn_ < 0 || yylast_ < yyn_ || yycheck_[yyn_] != yyilooka)
|
||||
goto yydefault;
|
||||
|
||||
/* Reduce or error. */
|
||||
@@ -627,11 +620,11 @@ yybackup:
|
||||
goto yyacceptlab;
|
||||
|
||||
/* Shift the look-ahead token. */
|
||||
YY_SYMBOL_PRINT ("Shifting", yyilooka_, &yylval, &yylloc);
|
||||
YY_SYMBOL_PRINT ("Shifting", yyilooka, &yylval, &yylloc);
|
||||
|
||||
/* Discard the token being shifted unless it is eof. */
|
||||
if (yylooka_ != yyeof_)
|
||||
yylooka_ = yyempty_;
|
||||
if (yylooka != yyeof_)
|
||||
yylooka = yyempty_;
|
||||
|
||||
yysemantic_stack_.push (yylval);
|
||||
yylocation_stack_.push (yylloc);
|
||||
@@ -677,6 +670,7 @@ yyreduce:
|
||||
switch (yyn_)
|
||||
{
|
||||
]b4_actions[
|
||||
default: break;
|
||||
}
|
||||
|
||||
]/* Line __line__ of lalr1.cc. */
|
||||
@@ -704,36 +698,28 @@ b4_syncline([@oline@], [@ofile@])[
|
||||
`------------------------------------*/
|
||||
yyerrlab:
|
||||
/* If not already recovering from an error, report this error. */
|
||||
yyreport_syntax_error_ ();
|
||||
if (!yyerrstatus_)
|
||||
{
|
||||
++yynerrs_;
|
||||
error (yylloc, yysyntax_error_ (YYERROR_VERBOSE_IF (yyilooka)));
|
||||
}
|
||||
|
||||
yyerror_range_[0] = yylloc;
|
||||
yyerror_range[0] = yylloc;
|
||||
if (yyerrstatus_ == 3)
|
||||
{
|
||||
/* If just tried and failed to reuse look-ahead token after an
|
||||
error, discard it. */
|
||||
|
||||
/* Return failure if at end of input. */
|
||||
if (yylooka_ <= yyeof_)
|
||||
if (yylooka <= yyeof_)
|
||||
{
|
||||
/* If at end of input, pop the error token,
|
||||
then the rest of the stack, then return failure. */
|
||||
if (yylooka_ == yyeof_)
|
||||
for (;;)
|
||||
{
|
||||
yyerror_range_[0] = yylocation_stack_[0];
|
||||
yypop_ ();
|
||||
if (yystate_stack_.height () == 1)
|
||||
YYABORT;
|
||||
yydestruct_ ("Error: popping",
|
||||
yystos_[yystate_stack_[0]],
|
||||
&yysemantic_stack_[0],
|
||||
&yylocation_stack_[0]);
|
||||
}
|
||||
/* Return failure if at end of input. */
|
||||
if (yylooka == yyeof_)
|
||||
YYABORT;
|
||||
}
|
||||
else
|
||||
{
|
||||
yydestruct_ ("Error: discarding", yyilooka_, &yylval, &yylloc);
|
||||
yylooka_ = yyempty_;
|
||||
yydestruct_ ("Error: discarding", yyilooka, &yylval, &yylloc);
|
||||
yylooka = yyempty_;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -747,14 +733,13 @@ yyerrlab:
|
||||
`---------------------------------------------------*/
|
||||
yyerrorlab:
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* Pacify GCC when the user code never invokes YYERROR and the label
|
||||
yyerrorlab therefore never appears in user code. */
|
||||
if (0)
|
||||
goto yyerrorlab;
|
||||
#endif
|
||||
/* Pacify compilers like GCC when the user code never invokes
|
||||
YYERROR and the label yyerrorlab therefore never appears in user
|
||||
code. */
|
||||
if (false)
|
||||
goto yyerrorlab;
|
||||
|
||||
yyerror_range_[0] = yylocation_stack_[yylen_ - 1];
|
||||
yyerror_range[0] = yylocation_stack_[yylen_ - 1];
|
||||
yypop_ (yylen_);
|
||||
yystate_ = yystate_stack_[0];
|
||||
goto yyerrlab1;
|
||||
@@ -783,7 +768,7 @@ yyerrlab1:
|
||||
if (yystate_stack_.height () == 1)
|
||||
YYABORT;
|
||||
|
||||
yyerror_range_[0] = yylocation_stack_[0];
|
||||
yyerror_range[0] = yylocation_stack_[0];
|
||||
yydestruct_ ("Error: popping",
|
||||
yystos_[yystate_],
|
||||
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
||||
@@ -795,10 +780,10 @@ yyerrlab1:
|
||||
if (yyn_ == yyfinal_)
|
||||
goto yyacceptlab;
|
||||
|
||||
yyerror_range_[1] = yylloc;
|
||||
yyerror_range[1] = yylloc;
|
||||
// Using YYLLOC is tempting, but would change the location of
|
||||
// the look-ahead. YYLOC is available though.
|
||||
YYLLOC_DEFAULT (yyloc, yyerror_range_ - 1, 2);
|
||||
YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
|
||||
yysemantic_stack_.push (yylval);
|
||||
yylocation_stack_.push (yyloc);
|
||||
|
||||
@@ -811,70 +796,76 @@ yyerrlab1:
|
||||
|
||||
/* Accept. */
|
||||
yyacceptlab:
|
||||
return 0;
|
||||
yyresult_ = 0;
|
||||
goto yyreturn;
|
||||
|
||||
/* Abort. */
|
||||
yyabortlab:
|
||||
/* Free the lookahead. */
|
||||
yydestruct_ ("Error: discarding lookahead", yyilooka_, &yylval, &yylloc);
|
||||
yylooka_ = yyempty_;
|
||||
return 1;
|
||||
}
|
||||
yyresult_ = 1;
|
||||
goto yyreturn;
|
||||
|
||||
void
|
||||
yy::]b4_parser_class_name[::yylex_ ()
|
||||
{
|
||||
YYCDEBUG << "Reading a token: ";
|
||||
#if YYLSP_NEEDED
|
||||
yylooka_ = yylex (&yylval, &yylloc);
|
||||
#else
|
||||
yylooka_ = yylex (&yylval);
|
||||
#endif
|
||||
}
|
||||
yyreturn:
|
||||
if (yylooka != yyeof_ && yylooka != yyempty_)
|
||||
yydestruct_ ("Cleanup: discarding lookahead", yyilooka, &yylval, &yylloc);
|
||||
|
||||
// Generate an error message, and invoke error.
|
||||
void
|
||||
yy::]b4_parser_class_name[::yyreport_syntax_error_ ()
|
||||
{
|
||||
/* If not already recovering from an error, report this error. */
|
||||
if (!yyerrstatus_)
|
||||
while (yystate_stack_.height () != 1)
|
||||
{
|
||||
++yynerrs_;
|
||||
std::string message;
|
||||
#if YYERROR_VERBOSE
|
||||
yyn_ = yypact_[yystate_];
|
||||
if (yypact_ninf_ < yyn_ && yyn_ < yylast_)
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. */
|
||||
int yyxbegin = yyn_ < 0 ? -yyn_ : 0;
|
||||
yydestruct_ ("Cleanup: popping",
|
||||
yystos_[yystate_stack_[0]],
|
||||
&yysemantic_stack_[0],
|
||||
&yylocation_stack_[0]);
|
||||
yypop_ ();
|
||||
}
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn_;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
return yyresult_;
|
||||
}
|
||||
|
||||
// Generate an error message.
|
||||
std::string
|
||||
yy::]b4_parser_class_name[::yysyntax_error_ (YYERROR_VERBOSE_IF (int tok))
|
||||
{
|
||||
std::string res;
|
||||
#if YYERROR_VERBOSE
|
||||
yyn_ = yypact_[yystate_];
|
||||
if (yypact_ninf_ < yyn_ && yyn_ < yylast_)
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. */
|
||||
int yyxbegin = yyn_ < 0 ? -yyn_ : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn_;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn_] == x && x != yyterror_)
|
||||
++count;
|
||||
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization. It should work like yacc.c does it.
|
||||
// That is, first build a string that looks like this:
|
||||
// "syntax error, unexpected %s or %s or %s"
|
||||
// Then, invoke YY_ on this string.
|
||||
// Finally, use the string as a format to output
|
||||
// yytname_[tok], etc.
|
||||
// Until this gets fixed, this message appears in English only.
|
||||
res = "syntax error, unexpected ";
|
||||
res += yytnamerr_ (yytname_[tok]);
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn_] == x && x != yyterror_)
|
||||
++count;
|
||||
|
||||
message = "syntax error, unexpected ";
|
||||
message += yyname_[yyilooka_];
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn_] == x && x != yyterror_)
|
||||
{
|
||||
message += (!count++) ? ", expecting " : " or ";
|
||||
message += yyname_[x];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
message = "syntax error";
|
||||
error (yylloc, message);
|
||||
{
|
||||
res += (!count++) ? ", expecting " : " or ";
|
||||
res += yytnamerr_ (yytname_[x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
res = YY_("syntax error");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -959,11 +950,11 @@ yy::]b4_parser_class_name[::yyr2_[] =
|
||||
]b4_r2[
|
||||
};
|
||||
|
||||
#if YYDEBUG || YYERROR_VERBOSE
|
||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
|
||||
const char*
|
||||
const yy::]b4_parser_class_name[::yyname_[] =
|
||||
const yy::]b4_parser_class_name[::yytname_[] =
|
||||
{
|
||||
]b4_tname[
|
||||
};
|
||||
@@ -1009,12 +1000,12 @@ yy::]b4_parser_class_name[::yyreduce_print_ (int yyrule)
|
||||
{
|
||||
unsigned int yylno = yyrline_[yyrule];
|
||||
/* Print the symbols being reduced, and their result. */
|
||||
*yycdebug_ << "Reducing stack by rule " << yyn_ - 1
|
||||
<< " (line " << yylno << "), ";
|
||||
*yycdebug_ << "Reducing stack by rule " << yyn_ - 1
|
||||
<< " (line " << yylno << "), ";
|
||||
for (]b4_int_type_for([b4_prhs])[ i = yyprhs_[yyn_];
|
||||
0 <= yyrhs_[i]; ++i)
|
||||
*yycdebug_ << yyname_[yyrhs_[i]] << ' ';
|
||||
*yycdebug_ << "-> " << yyname_[yyr1_[yyn_]] << std::endl;
|
||||
*yycdebug_ << yytname_[yyrhs_[i]] << ' ';
|
||||
*yycdebug_ << "-> " << yytname_[yyr1_[yyn_]] << std::endl;
|
||||
}
|
||||
#endif // YYDEBUG
|
||||
|
||||
@@ -1049,7 +1040,7 @@ const yy::]b4_parser_class_name[::token_number_type yy::]b4_parser_class_name[::
|
||||
]b4_epilogue
|
||||
dnl
|
||||
@output stack.hh
|
||||
b4_copyright([stack handling for Bison C++ parsers], [2002, 2003, 2004])[
|
||||
b4_copyright([stack handling for Bison C++ parsers], [2002, 2003, 2004, 2005])[
|
||||
|
||||
#ifndef BISON_STACK_HH
|
||||
# define BISON_STACK_HH
|
||||
@@ -1148,7 +1139,7 @@ namespace yy
|
||||
#endif // not BISON_STACK_HH]
|
||||
dnl
|
||||
@output position.hh
|
||||
b4_copyright([Position class for Bison C++ parsers], [2002, 2003, 2004])[
|
||||
b4_copyright([Position class for Bison C++ parsers], [2002, 2003, 2004, 2005])[
|
||||
|
||||
/**
|
||||
** \file position.hh
|
||||
@@ -1261,7 +1252,7 @@ namespace yy
|
||||
}
|
||||
#endif // not BISON_POSITION_HH]
|
||||
@output location.hh
|
||||
b4_copyright([Location class for Bison C++ parsers], [2002, 2003, 2004])[
|
||||
b4_copyright([Location class for Bison C++ parsers], [2002, 2003, 2004, 2005])[
|
||||
|
||||
/**
|
||||
** \file location.hh
|
||||
|
||||
+339
-375
File diff suppressed because it is too large
Load Diff
+246
-117
@@ -1,7 +1,8 @@
|
||||
m4_divert(-1) -*- C -*-
|
||||
|
||||
# Yacc compatible skeleton for Bison
|
||||
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004
|
||||
|
||||
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -16,8 +17,8 @@ m4_divert(-1) -*- C -*-
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +82,7 @@ m4_define([b4_int_type],
|
||||
|
||||
m4_eval([0 <= $1]), [1], [unsigned int],
|
||||
|
||||
[int])])
|
||||
[int])])
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
@@ -134,7 +135,7 @@ m4_changecom()
|
||||
m4_divert(0)dnl
|
||||
@output @output_parser_name@
|
||||
b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
|
||||
[1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004])[
|
||||
[1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005])[
|
||||
|
||||
/* As a special exception, when this file is copied by Bison into a
|
||||
Bison output file, you may use that output file without restriction.
|
||||
@@ -163,7 +164,7 @@ m4_if(b4_prefix[], [yy], [],
|
||||
#define yynerrs b4_prefix[]nerrs
|
||||
b4_location_if([#define yylloc b4_prefix[]lloc])])[
|
||||
|
||||
]b4_token_defines(b4_tokens)[
|
||||
]b4_token_enums_defines(b4_tokens)[
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
]b4_pre_prologue[
|
||||
@@ -181,9 +182,14 @@ b4_location_if([#define yylloc b4_prefix[]lloc])])[
|
||||
# define YYERROR_VERBOSE ]b4_error_verbose[
|
||||
#endif
|
||||
|
||||
/* Enabling the token table. */
|
||||
#ifndef YYTOKEN_TABLE
|
||||
# define YYTOKEN_TABLE ]b4_token_table[
|
||||
#endif
|
||||
|
||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||
]m4_ifdef([b4_stype],
|
||||
[b4_syncline([b4_stype_line], [b4_filename])
|
||||
[b4_syncline([b4_stype_line], [b4_file_name])
|
||||
typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])b4_stype YYSTYPE;
|
||||
/* Line __line__ of yacc.c. */
|
||||
b4_syncline([@oline@], [@ofile@])],
|
||||
@@ -213,14 +219,33 @@ typedef struct YYLTYPE
|
||||
/* Line __line__ of yacc.c. */
|
||||
b4_syncline([@oline@], [@ofile@])[
|
||||
|
||||
#if ! defined (yyoverflow) || YYERROR_VERBOSE
|
||||
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
|
||||
# define YYSIZE_T __SIZE_TYPE__
|
||||
#endif
|
||||
#if ! defined (YYSIZE_T) && defined (size_t)
|
||||
# define YYSIZE_T size_t
|
||||
#endif
|
||||
#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
|
||||
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YYSIZE_T size_t
|
||||
#endif
|
||||
#if ! defined (YYSIZE_T)
|
||||
# define YYSIZE_T unsigned int
|
||||
#endif
|
||||
|
||||
# ifndef YYFREE
|
||||
# define YYFREE free
|
||||
#ifndef YY_
|
||||
# if YYENABLE_NLS
|
||||
# if ENABLE_NLS
|
||||
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||
# endif
|
||||
# endif
|
||||
# ifndef YYMALLOC
|
||||
# define YYMALLOC malloc
|
||||
# ifndef YY_
|
||||
# define YY_(msgid) msgid
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if ! defined (yyoverflow) || YYERROR_VERBOSE
|
||||
|
||||
/* The parser invokes alloca or malloc; define the necessary symbols. */
|
||||
|
||||
@@ -230,6 +255,10 @@ b4_syncline([@oline@], [@ofile@])[
|
||||
# define YYSTACK_ALLOC __builtin_alloca
|
||||
# else
|
||||
# define YYSTACK_ALLOC alloca
|
||||
# if defined (__STDC__) || defined (__cplusplus)
|
||||
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YYINCLUDED_STDLIB_H
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
@@ -237,13 +266,39 @@ b4_syncline([@oline@], [@ofile@])[
|
||||
# ifdef YYSTACK_ALLOC
|
||||
/* Pacify GCC's `empty if-body' warning. */
|
||||
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
|
||||
# else
|
||||
# if defined (__STDC__) || defined (__cplusplus)
|
||||
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YYSIZE_T size_t
|
||||
# ifndef YYSTACK_ALLOC_MAXIMUM
|
||||
/* The OS might guarantee only one guard page at the bottom of the stack,
|
||||
and a page size can be as small as 4096 bytes. So we cannot safely
|
||||
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
|
||||
to allow for a few compiler-allocated temporary stack slots. */
|
||||
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
|
||||
# endif
|
||||
# else
|
||||
# define YYSTACK_ALLOC YYMALLOC
|
||||
# define YYSTACK_FREE YYFREE
|
||||
# ifndef YYSTACK_ALLOC_MAXIMUM
|
||||
# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
|
||||
# endif
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
# ifndef YYMALLOC
|
||||
# define YYMALLOC malloc
|
||||
# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
|
||||
&& (defined (__STDC__) || defined (__cplusplus)))
|
||||
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
|
||||
# endif
|
||||
# endif
|
||||
# ifndef YYFREE
|
||||
# define YYFREE free
|
||||
# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
|
||||
&& (defined (__STDC__) || defined (__cplusplus)))
|
||||
void free (void *); /* INFRINGES ON USER NAME SPACE */
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
|
||||
|
||||
@@ -285,7 +340,7 @@ union yyalloc
|
||||
# define YYCOPY(To, From, Count) \
|
||||
do \
|
||||
{ \
|
||||
register YYSIZE_T yyi; \
|
||||
YYSIZE_T yyi; \
|
||||
for (yyi = 0; yyi < (Count); yyi++) \
|
||||
(To)[yyi] = (From)[yyi]; \
|
||||
} \
|
||||
@@ -335,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. */
|
||||
@@ -365,8 +420,8 @@ static const ]b4_int_type_for([b4_rline])[ yyrline[] =
|
||||
};
|
||||
#endif
|
||||
|
||||
#if YYDEBUG || YYERROR_VERBOSE
|
||||
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
||||
static const char *const yytname[] =
|
||||
{
|
||||
@@ -445,22 +500,6 @@ static const ]b4_int_type_for([b4_stos])[ yystos[] =
|
||||
]b4_stos[
|
||||
};
|
||||
|
||||
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
|
||||
# define YYSIZE_T __SIZE_TYPE__
|
||||
#endif
|
||||
#if ! defined (YYSIZE_T) && defined (size_t)
|
||||
# define YYSIZE_T size_t
|
||||
#endif
|
||||
#if ! defined (YYSIZE_T)
|
||||
# if defined (__STDC__) || defined (__cplusplus)
|
||||
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YYSIZE_T size_t
|
||||
# endif
|
||||
#endif
|
||||
#if ! defined (YYSIZE_T)
|
||||
# define YYSIZE_T unsigned int
|
||||
#endif
|
||||
|
||||
#define yyerrok (yyerrstatus = 0)
|
||||
#define yyclearin (yychar = YYEMPTY)
|
||||
#define YYEMPTY (-2)
|
||||
@@ -490,8 +529,8 @@ do \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
yyerror (]b4_yyerror_args["syntax error: cannot back up");\
|
||||
{ \
|
||||
yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
|
||||
YYERROR; \
|
||||
} \
|
||||
while (0)
|
||||
@@ -570,7 +609,7 @@ do { \
|
||||
if (yydebug) \
|
||||
{ \
|
||||
YYFPRINTF (stderr, "%s ", Title); \
|
||||
yysymprint (stderr, \
|
||||
yysymprint (stderr, \
|
||||
Type, Value]b4_location_if([, Location])[); \
|
||||
YYFPRINTF (stderr, "\n"); \
|
||||
} \
|
||||
@@ -606,13 +645,13 @@ do { \
|
||||
[[int yyrule], [yyrule]])[
|
||||
{
|
||||
int yyi;
|
||||
unsigned int yylno = yyrline[yyrule];
|
||||
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
|
||||
unsigned long int yylno = yyrline[yyrule];
|
||||
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
|
||||
yyrule - 1, yylno);
|
||||
/* Print the symbols being reduced, and their result. */
|
||||
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
|
||||
YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
|
||||
YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
|
||||
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
|
||||
YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
|
||||
}
|
||||
|
||||
# define YY_REDUCE_PRINT(Rule) \
|
||||
@@ -641,7 +680,7 @@ int yydebug;
|
||||
if the built-in stack extension method is used).
|
||||
|
||||
Do not make this value too large; the results are undefined if
|
||||
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
|
||||
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
|
||||
evaluated with infinite-precision integer arithmetic. */
|
||||
|
||||
#ifndef YYMAXDEPTH
|
||||
@@ -665,7 +704,7 @@ yystrlen (yystr)
|
||||
const char *yystr;
|
||||
# endif
|
||||
{
|
||||
register const char *yys = yystr;
|
||||
const char *yys = yystr;
|
||||
|
||||
while (*yys++ != '\0')
|
||||
continue;
|
||||
@@ -690,8 +729,8 @@ yystpcpy (yydest, yysrc)
|
||||
const char *yysrc;
|
||||
# endif
|
||||
{
|
||||
register char *yyd = yydest;
|
||||
register const char *yys = yysrc;
|
||||
char *yyd = yydest;
|
||||
const char *yys = yysrc;
|
||||
|
||||
while ((*yyd++ = *yys++) != '\0')
|
||||
continue;
|
||||
@@ -701,7 +740,55 @@ yystpcpy (yydest, yysrc)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif /* !YYERROR_VERBOSE */
|
||||
# ifndef yytnamerr
|
||||
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
|
||||
quotes and backslashes, so that it's suitable for yyerror. The
|
||||
heuristic is that double-quoting is unnecessary unless the string
|
||||
contains an apostrophe, a comma, or backslash (other than
|
||||
backslash-backslash). YYSTR is taken from yytname. If YYRES is
|
||||
null, do not copy; instead, return the length of what the result
|
||||
would have been. */
|
||||
static YYSIZE_T
|
||||
yytnamerr (char *yyres, const char *yystr)
|
||||
{
|
||||
if (*yystr == '"')
|
||||
{
|
||||
size_t yyn = 0;
|
||||
char const *yyp = yystr;
|
||||
|
||||
for (;;)
|
||||
switch (*++yyp)
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
goto do_not_strip_quotes;
|
||||
|
||||
case '\\':
|
||||
if (*++yyp != '\\')
|
||||
goto do_not_strip_quotes;
|
||||
/* Fall through. */
|
||||
default:
|
||||
if (yyres)
|
||||
yyres[yyn] = *yyp;
|
||||
yyn++;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
if (yyres)
|
||||
yyres[yyn] = '\0';
|
||||
return yyn;
|
||||
}
|
||||
do_not_strip_quotes: ;
|
||||
}
|
||||
|
||||
if (! yyres)
|
||||
return yystrlen (yystr);
|
||||
|
||||
return yystpcpy (yyres, yystr) - yyres;
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
|
||||
|
||||
|
||||
@@ -763,8 +850,8 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
|
||||
#endif
|
||||
{[
|
||||
]b4_pure_if([b4_declare_parser_variables])[
|
||||
register int yystate;
|
||||
register int yyn;
|
||||
int yystate;
|
||||
int yyn;
|
||||
int yyresult;
|
||||
/* Number of tokens to shift before error messages enabled. */
|
||||
int yyerrstatus;
|
||||
@@ -782,12 +869,12 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
|
||||
/* The state stack. */
|
||||
short int yyssa[YYINITDEPTH];
|
||||
short int *yyss = yyssa;
|
||||
register short int *yyssp;
|
||||
short int *yyssp;
|
||||
|
||||
/* The semantic value stack. */
|
||||
YYSTYPE yyvsa[YYINITDEPTH];
|
||||
YYSTYPE *yyvs = yyvsa;
|
||||
register YYSTYPE *yyvsp;
|
||||
YYSTYPE *yyvsp;
|
||||
|
||||
]b4_location_if(
|
||||
[[ /* The location stack. */
|
||||
@@ -832,18 +919,19 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
|
||||
#endif
|
||||
]])
|
||||
m4_ifdef([b4_initial_action], [
|
||||
m4_pushdef([b4_at_dollar], [yylloc])dnl
|
||||
m4_pushdef([b4_dollar_dollar], [yylval])dnl
|
||||
m4_pushdef([b4_at_dollar], [m4_define([b4_at_dollar_used])yylloc])dnl
|
||||
m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl
|
||||
/* User initialization code. */
|
||||
b4_initial_action
|
||||
b4_initial_action
|
||||
m4_popdef([b4_dollar_dollar])dnl
|
||||
m4_popdef([b4_at_dollar])dnl
|
||||
/* Line __line__ of yacc.c. */
|
||||
b4_syncline([@oline@], [@ofile@])])dnl
|
||||
[
|
||||
yyvsp[0] = yylval;
|
||||
]b4_location_if([[ yylsp[0] = yylloc;
|
||||
]])
|
||||
b4_syncline([@oline@], [@ofile@])
|
||||
])dnl
|
||||
m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
|
||||
]])dnl
|
||||
m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
||||
]])dnl
|
||||
[ goto yysetstate;
|
||||
|
||||
/*------------------------------------------------------------.
|
||||
@@ -876,7 +964,7 @@ b4_syncline([@oline@], [@ofile@])])dnl
|
||||
data in use in that stack, in bytes. This used to be a
|
||||
conditional around just the two extra args, but that might
|
||||
be undefined if yyoverflow is a macro. */
|
||||
yyoverflow ("parser stack overflow",
|
||||
yyoverflow (YY_("memory exhausted"),
|
||||
&yyss1, yysize * sizeof (*yyssp),
|
||||
&yyvs1, yysize * sizeof (*yyvsp),
|
||||
]b4_location_if([ &yyls1, yysize * sizeof (*yylsp),])[
|
||||
@@ -887,11 +975,11 @@ b4_syncline([@oline@], [@ofile@])])dnl
|
||||
}
|
||||
#else /* no yyoverflow */
|
||||
# ifndef YYSTACK_RELOCATE
|
||||
goto yyoverflowlab;
|
||||
goto yyexhaustedlab;
|
||||
# else
|
||||
/* Extend the stack our own way. */
|
||||
if (YYMAXDEPTH <= yystacksize)
|
||||
goto yyoverflowlab;
|
||||
goto yyexhaustedlab;
|
||||
yystacksize *= 2;
|
||||
if (YYMAXDEPTH < yystacksize)
|
||||
yystacksize = YYMAXDEPTH;
|
||||
@@ -901,7 +989,7 @@ b4_syncline([@oline@], [@ofile@])])dnl
|
||||
union yyalloc *yyptr =
|
||||
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
||||
if (! yyptr)
|
||||
goto yyoverflowlab;
|
||||
goto yyexhaustedlab;
|
||||
YYSTACK_RELOCATE (yyss);
|
||||
YYSTACK_RELOCATE (yyvs);
|
||||
]b4_location_if([ YYSTACK_RELOCATE (yyls);])[
|
||||
@@ -1032,6 +1120,7 @@ yyreduce:
|
||||
switch (yyn)
|
||||
]{
|
||||
b4_actions
|
||||
default: break;
|
||||
}
|
||||
|
||||
/* Line __line__ of yacc.c. */
|
||||
@@ -1074,12 +1163,36 @@ yyerrlab:
|
||||
|
||||
if (YYPACT_NINF < yyn && yyn < YYLAST)
|
||||
{
|
||||
YYSIZE_T yysize = 0;
|
||||
int yytype = YYTRANSLATE (yychar);
|
||||
const char* yyprefix;
|
||||
char *yymsg;
|
||||
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
|
||||
YYSIZE_T yysize = yysize0;
|
||||
YYSIZE_T yysize1;
|
||||
int yysize_overflow = 0;
|
||||
char *yymsg = 0;
|
||||
# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
int yyx;
|
||||
|
||||
#if 0
|
||||
/* This is so xgettext sees the translatable formats that are
|
||||
constructed on the fly. */
|
||||
YY_("syntax error, unexpected %s");
|
||||
YY_("syntax error, unexpected %s, expecting %s");
|
||||
YY_("syntax error, unexpected %s, expecting %s or %s");
|
||||
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
|
||||
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
|
||||
#endif
|
||||
char *yyfmt;
|
||||
char const *yyf;
|
||||
static char const yyunexpected[] = "syntax error, unexpected %s";
|
||||
static char const yyexpecting[] = ", expecting %s";
|
||||
static char const yyor[] = " or %s";
|
||||
char yyformat[sizeof yyunexpected
|
||||
+ sizeof yyexpecting - 1
|
||||
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
||||
* (sizeof yyor - 1))];
|
||||
char const *yyprefix = yyexpecting;
|
||||
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
@@ -1087,48 +1200,68 @@ yyerrlab:
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = YYLAST - yyn;
|
||||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||||
int yycount = 0;
|
||||
int yycount = 1;
|
||||
|
||||
yyarg[0] = yytname[yytype];
|
||||
yyfmt = yystpcpy (yyformat, yyunexpected);
|
||||
|
||||
yyprefix = ", expecting ";
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
{
|
||||
yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
|
||||
yycount += 1;
|
||||
if (yycount == 5)
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yysize = 0;
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
yyformat[sizeof yyunexpected - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
yyfmt = yystpcpy (yyfmt, yyprefix);
|
||||
yyprefix = yyor;
|
||||
}
|
||||
yysize += (sizeof ("syntax error, unexpected ")
|
||||
+ yystrlen (yytname[yytype]));
|
||||
yymsg = (char *) YYSTACK_ALLOC (yysize);
|
||||
if (yymsg != 0)
|
||||
{
|
||||
char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
|
||||
yyp = yystpcpy (yyp, yytname[yytype]);
|
||||
|
||||
if (yycount < 5)
|
||||
yyf = YY_(yyformat);
|
||||
yysize1 = yysize + yystrlen (yyf);
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
|
||||
if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
|
||||
yymsg = (char *) YYSTACK_ALLOC (yysize);
|
||||
if (yymsg)
|
||||
{
|
||||
/* Avoid sprintf, as that infringes on the user's name space.
|
||||
Don't have undefined behavior even if the translation
|
||||
produced a string with the wrong number of "%s"s. */
|
||||
char *yyp = yymsg;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyf))
|
||||
{
|
||||
yyprefix = ", expecting ";
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
{
|
||||
yyp = yystpcpy (yyp, yyprefix);
|
||||
yyp = yystpcpy (yyp, yytname[yyx]);
|
||||
yyprefix = " or ";
|
||||
}
|
||||
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyf += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyf++;
|
||||
}
|
||||
}
|
||||
yyerror (]b4_yyerror_args[yymsg);
|
||||
YYSTACK_FREE (yymsg);
|
||||
}
|
||||
else
|
||||
yyerror (]b4_yyerror_args["syntax error; also virtual memory exhausted");
|
||||
{
|
||||
yyerror (]b4_yyerror_args[YY_("syntax error"));
|
||||
goto yyexhaustedlab;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
yyerror (]b4_yyerror_args["syntax error");
|
||||
yyerror (]b4_yyerror_args[YY_("syntax error"));
|
||||
}
|
||||
|
||||
]b4_location_if([[ yyerror_range[0] = yylloc;]])[
|
||||
@@ -1140,18 +1273,9 @@ yyerrlab:
|
||||
|
||||
if (yychar <= YYEOF)
|
||||
{
|
||||
/* If at end of input, pop the error token,
|
||||
then the rest of the stack, then return failure. */
|
||||
/* Return failure if at end of input. */
|
||||
if (yychar == YYEOF)
|
||||
for (;;)
|
||||
{
|
||||
]b4_location_if([[ yyerror_range[0] = *yylsp;]])[
|
||||
YYPOPSTACK;
|
||||
if (yyssp == yyss)
|
||||
YYABORT;
|
||||
yydestruct ("Error: popping",
|
||||
yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[);
|
||||
}
|
||||
YYABORT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1170,12 +1294,11 @@ yyerrlab:
|
||||
`---------------------------------------------------*/
|
||||
yyerrorlab:
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* Pacify GCC when the user code never invokes YYERROR and the label
|
||||
yyerrorlab therefore never appears in user code. */
|
||||
/* Pacify compilers like GCC when the user code never invokes
|
||||
YYERROR and the label yyerrorlab therefore never appears in user
|
||||
code. */
|
||||
if (0)
|
||||
goto yyerrorlab;
|
||||
#endif
|
||||
|
||||
]b4_location_if([[ yyerror_range[0] = yylsp[1-yylen];
|
||||
yylsp -= yylen;
|
||||
@@ -1245,23 +1368,29 @@ yyacceptlab:
|
||||
| yyabortlab -- YYABORT comes here. |
|
||||
`-----------------------------------*/
|
||||
yyabortlab:
|
||||
yydestruct ("Error: discarding lookahead",
|
||||
yytoken, &yylval]b4_location_if([, &yylloc])[);
|
||||
yychar = YYEMPTY;
|
||||
yyresult = 1;
|
||||
goto yyreturn;
|
||||
|
||||
#ifndef yyoverflow
|
||||
/*----------------------------------------------.
|
||||
| yyoverflowlab -- parser overflow comes here. |
|
||||
`----------------------------------------------*/
|
||||
yyoverflowlab:
|
||||
yyerror (]b4_yyerror_args["parser stack overflow");
|
||||
/*-------------------------------------------------.
|
||||
| yyexhaustedlab -- memory exhaustion comes here. |
|
||||
`-------------------------------------------------*/
|
||||
yyexhaustedlab:
|
||||
yyerror (]b4_yyerror_args[YY_("memory exhausted"));
|
||||
yyresult = 2;
|
||||
/* Fall through. */
|
||||
#endif
|
||||
|
||||
yyreturn:
|
||||
if (yychar != YYEOF && yychar != YYEMPTY)
|
||||
yydestruct ("Cleanup: discarding lookahead",
|
||||
yytoken, &yylval]b4_location_if([, &yylloc])[);
|
||||
while (yyssp != yyss)
|
||||
{
|
||||
yydestruct ("Cleanup: popping",
|
||||
yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[);
|
||||
YYPOPSTACK;
|
||||
}
|
||||
#ifndef yyoverflow
|
||||
if (yyss != yyssa)
|
||||
YYSTACK_FREE (yyss);
|
||||
@@ -1274,18 +1403,18 @@ b4_epilogue
|
||||
m4_if(b4_defines_flag, 0, [],
|
||||
[@output @output_header_name@
|
||||
b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
|
||||
[1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004])
|
||||
[1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005])
|
||||
|
||||
/* As a special exception, when this file is copied by Bison into a
|
||||
Bison output file, you may use that output file without restriction.
|
||||
This special exception was added by the Free Software Foundation
|
||||
in version 1.24 of Bison. */
|
||||
|
||||
b4_token_defines(b4_tokens)
|
||||
b4_token_enums_defines(b4_tokens)
|
||||
|
||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||
m4_ifdef([b4_stype],
|
||||
[b4_syncline([b4_stype_line], [b4_filename])
|
||||
[b4_syncline([b4_stype_line], [b4_file_name])
|
||||
typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])b4_stype YYSTYPE;
|
||||
/* Line __line__ of yacc.c. */
|
||||
b4_syncline([@oline@], [@ofile@])],
|
||||
|
||||
+6
-3
@@ -1,5 +1,5 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001, 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
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
## 02111-1307 USA
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
|
||||
AM_MAKEINFOFLAGS = --no-split
|
||||
info_TEXINFOS = bison.texinfo
|
||||
@@ -25,6 +25,9 @@ EXTRA_DIST = FAQ bison.1 refcard.tex
|
||||
|
||||
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
|
||||
|
||||
clean-local:
|
||||
rm -rf *.t2d
|
||||
|
||||
refcard.dvi: refcard.tex
|
||||
tex refcard.tex
|
||||
|
||||
|
||||
+923
-120
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -7,7 +7,7 @@
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@@ -420,8 +420,8 @@ license notices just after the title page:
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled ``GNU
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||
Texts. A copy of the license is included in the section entitled ``GNU
|
||||
Free Documentation License''.
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@@ -352,7 +352,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
@end smallexample
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
+6
-6
@@ -35,8 +35,8 @@
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with either Flex or Bison; see the file COPYING. If not, write
|
||||
% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
% Boston, MA 02111-1307, USA.
|
||||
% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
% Boston, MA 02110-1301, USA.
|
||||
%
|
||||
% This file is intended to be processed by plain TeX (TeX82).
|
||||
%
|
||||
@@ -96,9 +96,9 @@ For information, write to the:
|
||||
\vskip .2\baselineskip
|
||||
\centerline{Free Software Foundation, Inc.}
|
||||
\vskip .2\baselineskip
|
||||
\centerline{59 Temple Place - Suite 330}
|
||||
\centerline{51 Franklin Street, Fifth Floor}
|
||||
\vskip .2\baselineskip
|
||||
\centerline{Boston, MA 02111-1307 USA}
|
||||
\centerline{Boston, MA 02110-1301 USA}
|
||||
\endgroup}
|
||||
|
||||
%%%% smallcopyrightnotice for two column printing on one page.
|
||||
@@ -121,9 +121,9 @@ For information, write to the:
|
||||
\vskip .2\baselineskip
|
||||
\centerline{Free Software Foundation, Inc.}
|
||||
\vskip .2\baselineskip
|
||||
\centerline{59 Temple Place - Suite 330}
|
||||
\centerline{51 Franklin Street, Fifth Floor}
|
||||
\vskip .2\baselineskip
|
||||
\centerline{Boston, MA 02111-1307 USA}
|
||||
\centerline{Boston, MA 02110-1301 USA}
|
||||
\endgroup}
|
||||
|
||||
% make \bye not \outer so that the \def\bye in the \else clause below
|
||||
|
||||
-300
@@ -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 <[email protected]>
|
||||
# Pretty much rewritten by Alexandre Oliva <[email protected]>
|
||||
|
||||
# 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
|
||||
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -0,0 +1,21 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 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
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
|
||||
SUBDIRS = calc++
|
||||
|
||||
dist_noinst_SCRIPTS = extexi
|
||||
@@ -0,0 +1,11 @@
|
||||
*.cc
|
||||
*.hh
|
||||
*.ll
|
||||
*.output
|
||||
*.stamp
|
||||
*.tmp
|
||||
*.yy
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
calc++
|
||||
@@ -0,0 +1,87 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 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
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
|
||||
## ------------------------------------- ##
|
||||
## Running the bison from this tarball. ##
|
||||
## ------------------------------------- ##
|
||||
|
||||
BISON = $(top_builddir)/tests/bison
|
||||
BISON_IN = $(top_srcdir)/tests/bison.in
|
||||
|
||||
$(BISON): $(BISON_IN)
|
||||
cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||
|
||||
## ------------ ##
|
||||
## Extracting. ##
|
||||
## ------------ ##
|
||||
|
||||
doc = $(top_srcdir)/doc/bison.texinfo
|
||||
extexi = $(top_srcdir)/examples/extexi
|
||||
# Extract in src.
|
||||
$(calc_extracted): $(doc) $(extexi)
|
||||
cd $(srcdir) && \
|
||||
$(AWK) -f ../extexi ../../doc/bison.texinfo -- \
|
||||
calc++-parser.yy \
|
||||
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
||||
|
||||
|
||||
## ------------------- ##
|
||||
## Parser generation. ##
|
||||
## ------------------- ##
|
||||
|
||||
BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
|
||||
CLEANFILES = $(srcdir)/*.output *.tmp
|
||||
MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
||||
|
||||
# Compile the parser and save cycles.
|
||||
# This code comes from "Handling Tools that Produce Many Outputs",
|
||||
# from the Automake documentation.
|
||||
EXTRA_DIST = $(srcdir)/calc++-parser.stamp $(srcdir)/calc++-parser.yy
|
||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||
# in srcdir, including during distcheck, which is forbidden.
|
||||
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
||||
@rm -f calc++-parser.tmp
|
||||
@touch calc++-parser.tmp
|
||||
$(BISON) -d -ra -S lalr1.cc -o $(srcdir)/calc++-parser.cc \
|
||||
$(srcdir)/calc++-parser.yy
|
||||
@mv -f calc++-parser.tmp $@
|
||||
|
||||
$(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
||||
@if test -f $@; then :; else \
|
||||
rm -f $(srcdir)/calc++-parser.stamp && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
|
||||
fi
|
||||
|
||||
|
||||
## --------------------------- ##
|
||||
## Building & testing calc++. ##
|
||||
## --------------------------- ##
|
||||
|
||||
noinst_PROGRAMS = calc++
|
||||
|
||||
calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
|
||||
$(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
|
||||
calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
|
||||
calc_sources_generated = \
|
||||
$(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
|
||||
$(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
|
||||
|
||||
calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
|
||||
|
||||
TESTS = test
|
||||
EXTRA_DIST += $(TESTS)
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#! /bin/sh
|
||||
|
||||
set +e
|
||||
cat >input <<EOF
|
||||
a := 1
|
||||
b := 2
|
||||
c := 3
|
||||
d := a + b * c
|
||||
d
|
||||
EOF
|
||||
|
||||
./calc++ input
|
||||
./calc++ -p input
|
||||
|
||||
cat >input <<EOF
|
||||
a := 1
|
||||
d := a + b * c
|
||||
EOF
|
||||
./calc++ input
|
||||
|
||||
set -x
|
||||
echo toto
|
||||
cat >input <<EOF
|
||||
toto := 1
|
||||
toto
|
||||
EOF
|
||||
./calc++ -s input
|
||||
|
||||
rm input
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
# Extract all examples from the manual source. -*- AWK -*-
|
||||
|
||||
# This file is part of GNU Bison
|
||||
# Copyright 1992, 2000, 2001, 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
|
||||
# This script is for use with any Awk that conforms to POSIX.
|
||||
# It was derived from a similar script tests/generate.awk in GNU m4.
|
||||
#
|
||||
# Usage: extexi input-file.texi ... -- [FILES to extract]
|
||||
BEGIN {
|
||||
if (!output_dir)
|
||||
output_dir = ".";
|
||||
for (argc = 1; argc < ARGC; ++argc)
|
||||
if (ARGV[argc] == "--")
|
||||
break;
|
||||
for (i = argc + 1; i < ARGC; ++i)
|
||||
file_wanted[ARGV[i]] = 1;
|
||||
ARGC = argc;
|
||||
}
|
||||
|
||||
/^@node / {
|
||||
if (seq > 0)
|
||||
print "AT_CLEANUP";
|
||||
|
||||
split ($0, tmp, ",");
|
||||
node = substr(tmp[1], 7);
|
||||
seq = 0;
|
||||
}
|
||||
|
||||
/^@comment file: / {
|
||||
if (!file_wanted[$3])
|
||||
message("ignoring " $3);
|
||||
else
|
||||
{
|
||||
message("extracting " $3);
|
||||
file = $3;
|
||||
}
|
||||
}
|
||||
|
||||
/^@example$/, /^@end example$/ {
|
||||
if (!file)
|
||||
next;
|
||||
|
||||
if ($0 ~ /^@example$/)
|
||||
{
|
||||
input = files_output[file] ? "\n" : "";
|
||||
|
||||
# FNR is starting at 0 instead of 1, and
|
||||
# #line report the line number of the *next* line.
|
||||
# => + 2.
|
||||
# Note that recent Bison support it, but not Flex.
|
||||
if (file ~ /\.[chy]*$/)
|
||||
input = "#line " (FNR + 1) " \"" FILENAME "\"\n";
|
||||
next;
|
||||
}
|
||||
|
||||
if ($0 ~ /^@end example$/)
|
||||
{
|
||||
if (input == "")
|
||||
fatal("no contents: " file);
|
||||
|
||||
input = normalize(input);
|
||||
# No spurious end of line: use printf.
|
||||
if (files_output[file])
|
||||
printf ("%s", input) >> output_dir "/" file;
|
||||
else
|
||||
printf ("%s", input) > output_dir "/" file;
|
||||
close (output_dir "/" file);
|
||||
files_output[file] = 1;
|
||||
|
||||
file = input = "";
|
||||
next;
|
||||
}
|
||||
|
||||
input = input $0 "\n";
|
||||
}
|
||||
|
||||
|
||||
# We have to handle CONTENTS line per line, since anchors in AWK are
|
||||
# referring to the whole string, not the lines.
|
||||
function normalize(contents, i, lines, n, line, res) {
|
||||
# Remove the Texinfo tags.
|
||||
n = split (contents, lines, "\n");
|
||||
# We don't want the last field which empty: it's behind the last \n.
|
||||
for (i = 1; i < n; ++i)
|
||||
{
|
||||
line = lines[i];
|
||||
|
||||
# Whole line commands.
|
||||
if (line ~ /^@(c |comment|dots|end (ignore|group)|ignore|group)/)
|
||||
# Gperf accepts empty lines as valid input!!!
|
||||
if (file ~ /\.gperf$/)
|
||||
continue;
|
||||
else
|
||||
line = "";
|
||||
|
||||
gsub (/^@result\{\}/, "", line);
|
||||
gsub (/^@error\{\}/, "", line);
|
||||
gsub ("@[{]", "{", line);
|
||||
gsub ("@}", "}", line);
|
||||
gsub ("@@", "@", line);
|
||||
gsub ("@comment.*", "", line);
|
||||
|
||||
res = res line "\n";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
function message(msg) {
|
||||
if (! message_printed[msg])
|
||||
{
|
||||
print "extexi: " msg > "/dev/stderr";
|
||||
message_printed[msg] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
function fatal(msg) {
|
||||
message(msg);
|
||||
exit 1
|
||||
}
|
||||
+9
-3
@@ -9,11 +9,14 @@ argmatch.h
|
||||
basename.c
|
||||
dirname.c
|
||||
dirname.h
|
||||
dup-safer.c
|
||||
error.c
|
||||
error.h
|
||||
exit.h
|
||||
exitfail.c
|
||||
exitfail.h
|
||||
fd-safer.c
|
||||
fopen-safer.c
|
||||
getopt.c
|
||||
getopt.h
|
||||
getopt1.c
|
||||
@@ -30,26 +33,29 @@ mbswidth.c
|
||||
mbswidth.h
|
||||
obstack.c
|
||||
obstack.h
|
||||
pipe-safer.c
|
||||
quote.c
|
||||
quote.h
|
||||
quotearg.c
|
||||
quotearg.h
|
||||
realloc.c
|
||||
stdbool.h
|
||||
stdbool_.h
|
||||
stdio--.h
|
||||
stdio-safer.h
|
||||
stpcpy.c
|
||||
stpcpy.h
|
||||
strdup.c
|
||||
strdup.h
|
||||
stripslash.c
|
||||
strncasecmp.c
|
||||
strndup.c
|
||||
strndup.h
|
||||
strnlen.c
|
||||
strnlen.h
|
||||
unistd--.h
|
||||
unistd-safer.h
|
||||
unlocked-io.h
|
||||
xalloc-die.c
|
||||
xalloc.h
|
||||
xmalloc.c
|
||||
xstrdup.c
|
||||
xstrndup.c
|
||||
xstrndup.h
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
## 02111-1307 USA
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
|
||||
AM_CFLAGS = $(WARNING_CFLAGS)
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
||||
+2
-2
@@ -14,10 +14,10 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _ABITSET_H
|
||||
#define _ABITSET_H
|
||||
#define _ABITSET_H
|
||||
|
||||
#include "bitset.h"
|
||||
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BBITSET_H
|
||||
#define _BBITSET_H
|
||||
@@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
/* General bitsets.
|
||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes ([email protected]).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@@ -111,7 +111,7 @@ bitset_type_choose (bitset_bindex n_bits ATTRIBUTE_UNUSED, unsigned int attr)
|
||||
/* Choose the type of bitset. Note that sometimes we will be asked
|
||||
for a zero length fixed size bitset. */
|
||||
|
||||
|
||||
|
||||
/* If no attributes selected, choose a good compromise. */
|
||||
if (!attr)
|
||||
return BITSET_VARRAY;
|
||||
@@ -138,7 +138,7 @@ bitset_alloc (bitset_bindex n_bits, enum bitset_type type)
|
||||
|
||||
bytes = bitset_bytes (type, n_bits);
|
||||
|
||||
bset = (bitset) xcalloc (1, bytes);
|
||||
bset = xcalloc (1, bytes);
|
||||
|
||||
/* The cache is disabled until some elements are allocated. If we
|
||||
have variable length arrays, then we may need to allocate a dummy
|
||||
@@ -307,7 +307,7 @@ bitset_print (FILE *file, bitset bset, bool verbose)
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
fprintf (file, "%d ", i);
|
||||
fprintf (file, "%lu ", (unsigned long int) i);
|
||||
pos += 1 + (i >= 10) + (i >= 100);
|
||||
};
|
||||
|
||||
|
||||
+6
-7
@@ -14,7 +14,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BITSET_H
|
||||
#define _BITSET_H
|
||||
@@ -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; \
|
||||
@@ -371,10 +371,10 @@ extern void bitset_stats_enable (void);
|
||||
extern void bitset_stats_disable (void);
|
||||
|
||||
/* Read bitset stats file of accummulated stats. */
|
||||
void bitset_stats_read (const char *filename);
|
||||
void bitset_stats_read (const char *file_name);
|
||||
|
||||
/* Write bitset stats file of accummulated stats. */
|
||||
void bitset_stats_write (const char *filename);
|
||||
void bitset_stats_write (const char *file_name);
|
||||
|
||||
/* Dump bitset stats. */
|
||||
extern void bitset_stats_dump (FILE *);
|
||||
@@ -386,4 +386,3 @@ extern void debug_bitset (bitset);
|
||||
extern void debug_bitset_stats (void);
|
||||
|
||||
#endif /* _BITSET_H */
|
||||
|
||||
|
||||
+26
-26
@@ -1,5 +1,5 @@
|
||||
/* Bitset statistics.
|
||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes ([email protected]).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* This file is a wrapper bitset implementation for the other bitset
|
||||
@@ -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)]++
|
||||
|
||||
|
||||
@@ -241,17 +241,17 @@ bitset_stats_disable (void)
|
||||
|
||||
/* Read bitset statistics file. */
|
||||
void
|
||||
bitset_stats_read (const char *filename)
|
||||
bitset_stats_read (const char *file_name)
|
||||
{
|
||||
FILE *file;
|
||||
|
||||
if (!bitset_stats_info)
|
||||
return;
|
||||
|
||||
if (!filename)
|
||||
filename = BITSET_STATS_FILE;
|
||||
if (!file_name)
|
||||
file_name = BITSET_STATS_FILE;
|
||||
|
||||
file = fopen (filename, "r");
|
||||
file = fopen (file_name, "r");
|
||||
if (file)
|
||||
{
|
||||
if (fread (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
|
||||
@@ -271,17 +271,17 @@ bitset_stats_read (const char *filename)
|
||||
|
||||
/* Write bitset statistics file. */
|
||||
void
|
||||
bitset_stats_write (const char *filename)
|
||||
bitset_stats_write (const char *file_name)
|
||||
{
|
||||
FILE *file;
|
||||
|
||||
if (!bitset_stats_info)
|
||||
return;
|
||||
|
||||
if (!filename)
|
||||
filename = BITSET_STATS_FILE;
|
||||
if (!file_name)
|
||||
file_name = BITSET_STATS_FILE;
|
||||
|
||||
file = fopen (filename, "w");
|
||||
file = fopen (file_name, "w");
|
||||
if (file)
|
||||
{
|
||||
if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
|
||||
@@ -698,25 +698,25 @@ bitset_stats_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
|
||||
{
|
||||
case BITSET_ARRAY:
|
||||
bytes = abitset_bytes (n_bits);
|
||||
sbset = (bitset) xcalloc (1, bytes);
|
||||
sbset = xcalloc (1, bytes);
|
||||
abitset_init (sbset, n_bits);
|
||||
break;
|
||||
|
||||
case BITSET_LIST:
|
||||
bytes = lbitset_bytes (n_bits);
|
||||
sbset = (bitset) xcalloc (1, bytes);
|
||||
sbset = xcalloc (1, bytes);
|
||||
lbitset_init (sbset, n_bits);
|
||||
break;
|
||||
|
||||
case BITSET_TABLE:
|
||||
bytes = ebitset_bytes (n_bits);
|
||||
sbset = (bitset) xcalloc (1, bytes);
|
||||
sbset = xcalloc (1, bytes);
|
||||
ebitset_init (sbset, n_bits);
|
||||
break;
|
||||
|
||||
case BITSET_VARRAY:
|
||||
bytes = vbitset_bytes (n_bits);
|
||||
sbset = (bitset) xcalloc (1, bytes);
|
||||
sbset = xcalloc (1, bytes);
|
||||
vbitset_init (sbset, n_bits);
|
||||
break;
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BITSET_STATS_H
|
||||
#define _BITSET_STATS_H
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ 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, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BITSETV_PRINT_H
|
||||
#define _BITSETV_PRINT_H
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/* Bitset vectors.
|
||||
Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@@ -15,8 +15,8 @@ for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@@ -47,7 +47,7 @@ bitsetv_alloc (bitset_bindex n_vecs, bitset_bindex n_bits,
|
||||
/* Allocate vector table at head of bitset array. */
|
||||
vector_bytes = (n_vecs + 1) * sizeof (bitset) + bytes - 1;
|
||||
vector_bytes -= vector_bytes % bytes;
|
||||
bsetv = (bitset *) xcalloc (1, vector_bytes + bytes * n_vecs);
|
||||
bsetv = xcalloc (1, vector_bytes + bytes * n_vecs);
|
||||
|
||||
for (i = 0; i < n_vecs; i++)
|
||||
{
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BITSETV_H
|
||||
#define _BITSETV_H
|
||||
|
||||
+14
-14
@@ -1,5 +1,5 @@
|
||||
/* Functions to support expandable bitsets.
|
||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes ([email protected]).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -115,11 +115,11 @@ static ebitset_elt *ebitset_free_list; /* Free list of bitset elements. */
|
||||
((BSET)->b.cindex = (EINDEX) * EBITSET_ELT_WORDS, \
|
||||
(BSET)->b.cdata = EBITSET_WORDS (EBITSET_ELTS (BSET) [EINDEX]))
|
||||
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
#define min(a, b) ((a) > (b) ? (b) : (a))
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
|
||||
static bitset_bindex
|
||||
ebitset_resize (bitset src, bitset_bindex n_bits)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ ebitset_resize (bitset src, bitset_bindex n_bits)
|
||||
{
|
||||
bitset_windex size;
|
||||
|
||||
/* The bitset needs to grow. If we already have enough memory
|
||||
/* The bitset needs to grow. If we already have enough memory
|
||||
allocated, then just zero what we need. */
|
||||
if (newsize > EBITSET_ASIZE (src))
|
||||
{
|
||||
@@ -149,13 +149,13 @@ ebitset_resize (bitset src, bitset_bindex n_bits)
|
||||
size = newsize;
|
||||
else
|
||||
size = newsize + newsize / 4;
|
||||
|
||||
|
||||
EBITSET_ELTS (src)
|
||||
= realloc (EBITSET_ELTS (src), size * sizeof (ebitset_elt *));
|
||||
EBITSET_ASIZE (src) = size;
|
||||
}
|
||||
|
||||
memset (EBITSET_ELTS (src) + oldsize, 0,
|
||||
memset (EBITSET_ELTS (src) + oldsize, 0,
|
||||
(newsize - oldsize) * sizeof (ebitset_elt *));
|
||||
}
|
||||
else
|
||||
@@ -838,10 +838,10 @@ ebitset_unused_clear (bitset dst)
|
||||
{
|
||||
unsigned int last_bit;
|
||||
bitset_bindex n_bits;
|
||||
|
||||
|
||||
n_bits = BITSET_NBITS_ (dst);
|
||||
last_bit = n_bits % EBITSET_ELT_BITS;
|
||||
|
||||
|
||||
if (last_bit)
|
||||
{
|
||||
bitset_windex eindex;
|
||||
@@ -849,20 +849,20 @@ ebitset_unused_clear (bitset dst)
|
||||
ebitset_elt *elt;
|
||||
|
||||
elts = EBITSET_ELTS (dst);
|
||||
|
||||
|
||||
eindex = n_bits / EBITSET_ELT_BITS;
|
||||
|
||||
|
||||
elt = elts[eindex];
|
||||
if (elt)
|
||||
{
|
||||
bitset_windex windex;
|
||||
bitset_windex woffset;
|
||||
bitset_word *srcp = EBITSET_WORDS (elt);
|
||||
|
||||
|
||||
windex = n_bits / BITSET_WORD_BITS;
|
||||
woffset = eindex * EBITSET_ELT_WORDS;
|
||||
|
||||
srcp[windex - woffset] &= ((bitset_word) 1 << last_bit) - 1;
|
||||
|
||||
srcp[windex - woffset] &= ((bitset_word) 1 << last_bit) - 1;
|
||||
windex++;
|
||||
for (; (windex - woffset) < EBITSET_ELT_WORDS; windex++)
|
||||
srcp[windex - woffset] = 0;
|
||||
|
||||
+2
-2
@@ -14,10 +14,10 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _EBITSET_H
|
||||
#define _EBITSET_H
|
||||
#define _EBITSET_H
|
||||
|
||||
#include "bitset.h"
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
extern int get_errno (void);
|
||||
extern void set_errno (int);
|
||||
|
||||
+6
-6
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -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++)
|
||||
|
||||
+2
-2
@@ -14,10 +14,10 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _LBITSET_H
|
||||
#define _LBITSET_H
|
||||
#define _LBITSET_H
|
||||
|
||||
#include "bitset.h"
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
|
||||
/* Bison depends on libiberty's implementation of bitsets, which
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
+26
-38
@@ -1,6 +1,6 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 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
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Written by Paul Eggert <[email protected]>
|
||||
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
||||
@@ -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
|
||||
|
||||
@@ -68,6 +66,7 @@
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
#include "unistd-safer.h"
|
||||
|
||||
#include "gettext.h"
|
||||
#define _(Msgid) gettext (Msgid)
|
||||
@@ -99,56 +98,44 @@ pid_t
|
||||
create_subpipe (char const * const *argv, int fd[2])
|
||||
{
|
||||
int pipe_fd[2];
|
||||
int from_in_fd;
|
||||
int from_out_fd;
|
||||
int to_in_fd;
|
||||
int to_out_fd;
|
||||
int child_fd[2];
|
||||
pid_t pid;
|
||||
|
||||
if (pipe (pipe_fd) != 0)
|
||||
error (EXIT_FAILURE, errno, "pipe");
|
||||
to_in_fd = pipe_fd[0];
|
||||
to_out_fd = pipe_fd[1];
|
||||
|
||||
if (pipe (pipe_fd) != 0)
|
||||
error (EXIT_FAILURE, errno, "pipe");
|
||||
from_in_fd = pipe_fd[0];
|
||||
from_out_fd = pipe_fd[1];
|
||||
if (pipe (child_fd) != 0
|
||||
|| (child_fd[0] = fd_safer (child_fd[0])) < 0
|
||||
|| (fd[0] = fd_safer (child_fd[1])) < 0
|
||||
|| 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");
|
||||
|
||||
pid = vfork ();
|
||||
if (pid < 0)
|
||||
error (EXIT_FAILURE, errno, "fork");
|
||||
error (EXIT_FAILURE, errno,
|
||||
"fork");
|
||||
|
||||
if (! pid)
|
||||
{
|
||||
/* Child. */
|
||||
close (to_out_fd);
|
||||
close (from_in_fd);
|
||||
|
||||
if (to_in_fd != STDIN_FILENO)
|
||||
{
|
||||
dup2 (to_in_fd, STDIN_FILENO);
|
||||
close (to_in_fd);
|
||||
}
|
||||
if (from_out_fd != STDOUT_FILENO)
|
||||
{
|
||||
dup2 (from_out_fd, STDOUT_FILENO);
|
||||
close (from_out_fd);
|
||||
}
|
||||
close (fd[0]);
|
||||
close (fd[1]);
|
||||
dup2 (child_fd[0], STDIN_FILENO);
|
||||
close (child_fd[0]);
|
||||
dup2 (child_fd[1], STDOUT_FILENO);
|
||||
close (child_fd[1]);
|
||||
|
||||
/* The cast to (char **) rather than (char * const *) is needed
|
||||
for portability to older hosts with a nonstandard prototype
|
||||
for execvp. */
|
||||
execvp (argv[0], (char **) argv);
|
||||
|
||||
|
||||
_exit (errno == ENOENT ? 127 : 126);
|
||||
}
|
||||
|
||||
/* Parent. */
|
||||
close (to_in_fd);
|
||||
close (from_out_fd);
|
||||
fd[0] = to_out_fd;
|
||||
fd[1] = from_in_fd;
|
||||
close (child_fd[0]);
|
||||
close (child_fd[1]);
|
||||
return pid;
|
||||
}
|
||||
|
||||
@@ -161,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;
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
|
||||
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, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
/* Written by Paul Eggert <[email protected]>
|
||||
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
||||
|
||||
+3
-3
@@ -16,8 +16,8 @@ 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, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#if IN_GCC
|
||||
|
||||
@@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, 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>
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
|
||||
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, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* This file contains timing variable definitions, used by timevar.h
|
||||
and timevar.c.
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@
|
||||
|
||||
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, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_TIMEVAR_H
|
||||
#define GCC_TIMEVAR_H
|
||||
|
||||
+39
-38
@@ -1,5 +1,5 @@
|
||||
/* Variable array bitsets.
|
||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
/* This file implements variable size bitsets stored as a variable
|
||||
length array of words. Any unused bits in the last word must be
|
||||
zero.
|
||||
zero.
|
||||
|
||||
Note that binary or ternary operations assume that each bitset operand
|
||||
has the same size.
|
||||
@@ -38,7 +38,7 @@ static void vbitset_unused_clear (bitset);
|
||||
static void vbitset_set (bitset, bitset_bindex);
|
||||
static void vbitset_reset (bitset, bitset_bindex);
|
||||
static bool vbitset_test (bitset, bitset_bindex);
|
||||
static bitset_bindex vbitset_list (bitset, bitset_bindex *,
|
||||
static bitset_bindex vbitset_list (bitset, bitset_bindex *,
|
||||
bitset_bindex, bitset_bindex *);
|
||||
static bitset_bindex vbitset_list_reverse (bitset, bitset_bindex *,
|
||||
bitset_bindex, bitset_bindex *);
|
||||
@@ -48,7 +48,8 @@ static bitset_bindex vbitset_list_reverse (bitset, bitset_bindex *,
|
||||
#define VBITSET_SIZE(X) ((X)->b.csize)
|
||||
#define VBITSET_ASIZE(X) ((X)->v.size)
|
||||
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
#define min(a, b) ((a) > (b) ? (b) : (a))
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
@@ -68,7 +69,7 @@ vbitset_resize (bitset src, bitset_bindex n_bits)
|
||||
{
|
||||
bitset_windex size;
|
||||
|
||||
/* The bitset needs to grow. If we already have enough memory
|
||||
/* The bitset needs to grow. If we already have enough memory
|
||||
allocated, then just zero what we need. */
|
||||
if (newsize > VBITSET_ASIZE (src))
|
||||
{
|
||||
@@ -81,13 +82,13 @@ vbitset_resize (bitset src, bitset_bindex n_bits)
|
||||
size = newsize;
|
||||
else
|
||||
size = newsize + newsize / 4;
|
||||
|
||||
|
||||
VBITSET_WORDS (src)
|
||||
= realloc (VBITSET_WORDS (src), size * sizeof (bitset_word));
|
||||
VBITSET_ASIZE (src) = size;
|
||||
}
|
||||
|
||||
memset (VBITSET_WORDS (src) + oldsize, 0,
|
||||
memset (VBITSET_WORDS (src) + oldsize, 0,
|
||||
(newsize - oldsize) * sizeof (bitset_word));
|
||||
VBITSET_SIZE (src) = newsize;
|
||||
}
|
||||
@@ -426,7 +427,7 @@ vbitset_not (bitset dst, bitset src)
|
||||
sizeof (bitset_word) * (dsize - ssize));
|
||||
}
|
||||
|
||||
|
||||
|
||||
static bool
|
||||
vbitset_equal_p (bitset dst, bitset src)
|
||||
{
|
||||
@@ -465,7 +466,7 @@ vbitset_subset_p (bitset dst, bitset src)
|
||||
bitset_word *dstp = VBITSET_WORDS (dst);
|
||||
bitset_windex ssize = VBITSET_SIZE (src);
|
||||
bitset_windex dsize = VBITSET_SIZE (dst);
|
||||
|
||||
|
||||
for (i = 0; i < min (ssize, dsize); i++, dstp++, srcp++)
|
||||
if (*dstp != (*srcp | *dstp))
|
||||
return 0;
|
||||
@@ -520,7 +521,7 @@ vbitset_and (bitset dst, bitset src1, bitset src2)
|
||||
|
||||
for (i = 0; i < min (ssize1, ssize2); i++)
|
||||
*dstp++ = *src1p++ & *src2p++;
|
||||
|
||||
|
||||
memset (dstp, 0, sizeof (bitset_word) * (dsize - min (ssize1, ssize2)));
|
||||
}
|
||||
|
||||
@@ -549,14 +550,14 @@ vbitset_and_cmp (bitset dst, bitset src1, bitset src2)
|
||||
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = *src1p++ & *src2p++;
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
*dstp = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ssize2 > ssize1)
|
||||
{
|
||||
src1p = src2p;
|
||||
@@ -600,7 +601,7 @@ vbitset_andn (bitset dst, bitset src1, bitset src2)
|
||||
|
||||
for (i = 0; i < min (ssize1, ssize2); i++)
|
||||
*dstp++ = *src1p++ & ~(*src2p++);
|
||||
|
||||
|
||||
if (ssize2 > ssize1)
|
||||
{
|
||||
for (; i < ssize2; i++)
|
||||
@@ -642,14 +643,14 @@ vbitset_andn_cmp (bitset dst, bitset src1, bitset src2)
|
||||
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = *src1p++ & ~(*src2p++);
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
*dstp = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ssize2 > ssize1)
|
||||
{
|
||||
for (; i < ssize2; i++, dstp++)
|
||||
@@ -668,7 +669,7 @@ vbitset_andn_cmp (bitset dst, bitset src1, bitset src2)
|
||||
for (; i < ssize1; i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = *src1p++;
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
@@ -705,7 +706,7 @@ vbitset_or (bitset dst, bitset src1, bitset src2)
|
||||
|
||||
for (i = 0; i < min (ssize1, ssize2); i++)
|
||||
*dstp++ = *src1p++ | *src2p++;
|
||||
|
||||
|
||||
if (ssize2 > ssize1)
|
||||
{
|
||||
src1p = src2p;
|
||||
@@ -743,14 +744,14 @@ vbitset_or_cmp (bitset dst, bitset src1, bitset src2)
|
||||
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = *src1p++ | *src2p++;
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
*dstp = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ssize2 > ssize1)
|
||||
{
|
||||
src1p = src2p;
|
||||
@@ -760,7 +761,7 @@ vbitset_or_cmp (bitset dst, bitset src1, bitset src2)
|
||||
for (; i < ssize1; i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = *src1p++;
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
@@ -796,7 +797,7 @@ vbitset_xor (bitset dst, bitset src1, bitset src2)
|
||||
|
||||
for (i = 0; i < min (ssize1, ssize2); i++)
|
||||
*dstp++ = *src1p++ ^ *src2p++;
|
||||
|
||||
|
||||
if (ssize2 > ssize1)
|
||||
{
|
||||
src1p = src2p;
|
||||
@@ -834,14 +835,14 @@ vbitset_xor_cmp (bitset dst, bitset src1, bitset src2)
|
||||
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = *src1p++ ^ *src2p++;
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
*dstp = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ssize2 > ssize1)
|
||||
{
|
||||
src1p = src2p;
|
||||
@@ -851,7 +852,7 @@ vbitset_xor_cmp (bitset dst, bitset src1, bitset src2)
|
||||
for (; i < ssize1; i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = *src1p++;
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
@@ -877,7 +878,7 @@ vbitset_and_or (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
bitset_word *src3p;
|
||||
bitset_word *dstp;
|
||||
bitset_windex size;
|
||||
|
||||
|
||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||
{
|
||||
@@ -908,7 +909,7 @@ vbitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
bitset_word *src3p;
|
||||
bitset_word *dstp;
|
||||
bitset_windex size;
|
||||
|
||||
|
||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||
return bitset_and_or_cmp_ (dst, src1, src2, src3);
|
||||
@@ -920,11 +921,11 @@ vbitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
src3p = VBITSET_WORDS (src3);
|
||||
dstp = VBITSET_WORDS (dst);
|
||||
size = VBITSET_SIZE (dst);
|
||||
|
||||
|
||||
for (i = 0; i < size; i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = (*src1p++ & *src2p++) | *src3p++;
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
@@ -944,7 +945,7 @@ vbitset_andn_or (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
bitset_word *src3p;
|
||||
bitset_word *dstp;
|
||||
bitset_windex size;
|
||||
|
||||
|
||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||
{
|
||||
@@ -975,7 +976,7 @@ vbitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
bitset_word *src3p;
|
||||
bitset_word *dstp;
|
||||
bitset_windex size;
|
||||
|
||||
|
||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||
return bitset_andn_or_cmp_ (dst, src1, src2, src3);
|
||||
@@ -987,11 +988,11 @@ vbitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
src3p = VBITSET_WORDS (src3);
|
||||
dstp = VBITSET_WORDS (dst);
|
||||
size = VBITSET_SIZE (dst);
|
||||
|
||||
|
||||
for (i = 0; i < size; i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = (*src1p++ & ~(*src2p++)) | *src3p++;
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
@@ -1011,7 +1012,7 @@ vbitset_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
bitset_word *src3p;
|
||||
bitset_word *dstp;
|
||||
bitset_windex size;
|
||||
|
||||
|
||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||
{
|
||||
@@ -1026,7 +1027,7 @@ vbitset_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
src3p = VBITSET_WORDS (src3);
|
||||
dstp = VBITSET_WORDS (dst);
|
||||
size = VBITSET_SIZE (dst);
|
||||
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
*dstp++ = (*src1p++ | *src2p++) & *src3p++;
|
||||
}
|
||||
@@ -1042,7 +1043,7 @@ vbitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
bitset_word *src3p;
|
||||
bitset_word *dstp;
|
||||
bitset_windex size;
|
||||
|
||||
|
||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||
return bitset_or_and_cmp_ (dst, src1, src2, src3);
|
||||
@@ -1054,11 +1055,11 @@ vbitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||
src3p = VBITSET_WORDS (src3);
|
||||
dstp = VBITSET_WORDS (dst);
|
||||
size = VBITSET_SIZE (dst);
|
||||
|
||||
|
||||
for (i = 0; i < size; i++, dstp++)
|
||||
{
|
||||
bitset_word tmp = (*src1p++ | *src2p++) & *src3p++;
|
||||
|
||||
|
||||
if (*dstp != tmp)
|
||||
{
|
||||
changed = 1;
|
||||
|
||||
+2
-2
@@ -14,10 +14,10 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _VBITSET_H
|
||||
#define _VBITSET_H
|
||||
#define _VBITSET_H
|
||||
|
||||
#include "bitset.h"
|
||||
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
+2
-5
@@ -1,36 +1,33 @@
|
||||
*_gl.m4
|
||||
alloca.m4
|
||||
codeset.m4
|
||||
dirname.m4
|
||||
dos.m4
|
||||
error.m4
|
||||
exitfail.m4
|
||||
extensions.m4
|
||||
getopt.m4
|
||||
gettext.m4
|
||||
gnulib.m4
|
||||
hard-locale.m4
|
||||
hash.m4
|
||||
iconv.m4
|
||||
lib-ld.m4
|
||||
lib-link.m4
|
||||
lib-prefix.m4
|
||||
mbrtowc.m4
|
||||
mbstate_t.m4
|
||||
mbswidth.m4
|
||||
nls.m4
|
||||
obstack.m4
|
||||
onceonly.m4
|
||||
po.m4
|
||||
progtest.m4
|
||||
quote.m4
|
||||
quotearg.m4
|
||||
stdbool.m4
|
||||
stdio-safer.m4
|
||||
stpcpy.m4
|
||||
strdup.m4
|
||||
strerror_r.m4
|
||||
strndup.m4
|
||||
strnlen.m4
|
||||
unistd-safer.m4
|
||||
unlocked-io.m4
|
||||
xalloc.m4
|
||||
xstrndup.m4
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# bison-i18n.m4 serial 1 (bison-2.1)
|
||||
dnl Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
dnl Support for internationalization of bison-generated parsers.
|
||||
|
||||
dnl BISON_I18N
|
||||
dnl should be used in configure.ac, after AM_GNU_GETTEXT. If USE_NLS is yes, it
|
||||
dnl sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files
|
||||
dnl and defines YYENABLE_NLS if there are bison-runtime.mo files at all.
|
||||
AC_DEFUN([BISON_I18N],
|
||||
[
|
||||
if test -z "$USE_NLS"; then
|
||||
echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
BISON_LOCALEDIR=
|
||||
if test "$USE_NLS" = yes; then
|
||||
dnl AC_PROG_YACC sets the YACC variable; other macros set the BISON variable.
|
||||
if test -n "$YACC"; then
|
||||
case "$YACC" in
|
||||
*bison*)
|
||||
if ($YACC --print-localedir) >/dev/null 2>&1; then
|
||||
BISON_LOCALEDIR=`$YACC --print-localedir`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
if test -n "$BISON"; then
|
||||
if test "$BISON" != ":"; then
|
||||
if ($BISON --print-localedir) >/dev/null 2>&1; then
|
||||
BISON_LOCALEDIR=`$BISON --print-localedir`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([BISON_LOCALEDIR])
|
||||
if test -n "$BISON_LOCALEDIR"; then
|
||||
USER_LINGUAS="${LINGUAS-%UNSET%}"
|
||||
if test -n "$USER_LINGUAS"; then
|
||||
BISON_USE_NLS=yes
|
||||
else
|
||||
BISON_USE_NLS=no
|
||||
fi
|
||||
else
|
||||
BISON_USE_NLS=no
|
||||
fi
|
||||
else
|
||||
BISON_USE_NLS=no
|
||||
fi
|
||||
if test $BISON_USE_NLS = yes; then
|
||||
AC_DEFINE([YYENABLE_NLS], 1,
|
||||
[Define to 1 to internationalize bison runtime messages.])
|
||||
fi
|
||||
])
|
||||
@@ -15,8 +15,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
# Written by Paul Eggert <[email protected]>.
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# BISON_PROG_GNU_M4
|
||||
# -----------------
|
||||
|
||||
+3
-4
@@ -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
|
||||
@@ -15,15 +15,14 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
# Written by Paul Eggert <[email protected]>.
|
||||
|
||||
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
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
# serial 2
|
||||
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
# serial 1
|
||||
|
||||
|
||||
+1
-1
@@ -20,4 +20,4 @@ lib/obstack.c
|
||||
lib/quotearg.c
|
||||
lib/subpipe.c
|
||||
lib/timevar.c
|
||||
lib/xmalloc.c
|
||||
lib/xalloc-die.c
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
*.gmo
|
||||
*.po
|
||||
LINGUAS
|
||||
Makefile
|
||||
Makefile.in
|
||||
Makefile.in.in
|
||||
Makevars
|
||||
POTFILES
|
||||
Rules-quot
|
||||
bison-runtime.pot
|
||||
boldquot.sed
|
||||
[email protected]
|
||||
[email protected]
|
||||
insert-header.sin
|
||||
quot.sed
|
||||
remove-potcdate.sed
|
||||
remove-potcdate.sin
|
||||
stamp-po
|
||||
@@ -0,0 +1,3 @@
|
||||
data/glr.c
|
||||
data/lalr1.cc
|
||||
data/yacc.c
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
|
||||
/* See comments in state.h for the data structures that represent it.
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef LR0_H_
|
||||
# define LR0_H_
|
||||
|
||||
+37
-8
@@ -1,4 +1,4 @@
|
||||
## 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
|
||||
@@ -12,12 +12,10 @@
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
## 02111-1307 USA
|
||||
## 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
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "system.h"
|
||||
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef ASSOC_H_
|
||||
# define ASSOC_H_
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "system.h"
|
||||
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef CLOSURE_H_
|
||||
# define CLOSURE_H_
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
USA. */
|
||||
|
||||
/* Based on error.c and error.h,
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
USA. */
|
||||
|
||||
#ifndef COMPLAIN_H_
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "system.h"
|
||||
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef CONFLICTS_H_
|
||||
# define CONFLICTS_H_
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
|
||||
#include "system.h"
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef DERIVES_H_
|
||||
# define DERIVES_H_
|
||||
|
||||
+16
-17
@@ -1,6 +1,6 @@
|
||||
/* Open and close files 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.
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
|
||||
#include "system.h"
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "files.h"
|
||||
#include "getargs.h"
|
||||
#include "gram.h"
|
||||
#include "stdio-safer.h"
|
||||
|
||||
/* From basename.c. Almost a lie, as it returns a char *. */
|
||||
const char *base_name (char const *name);
|
||||
@@ -65,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 |
|
||||
@@ -95,7 +96,7 @@ xfopen (const char *name, const char *mode)
|
||||
{
|
||||
FILE *ptr;
|
||||
|
||||
ptr = fopen (name, mode);
|
||||
ptr = fopen_safer (name, mode);
|
||||
if (!ptr)
|
||||
error (EXIT_FAILURE, get_errno (), _("cannot open file `%s'"), name);
|
||||
|
||||
@@ -164,8 +165,8 @@ compute_exts_from_src (const char *ext)
|
||||
}
|
||||
|
||||
|
||||
/* Decompose FILENAME in four parts: *BASE, *TAB, and *EXT, the fourth
|
||||
part, (the directory) is ranging from FILENAME to the char before
|
||||
/* Decompose FILE_NAME in four parts: *BASE, *TAB, and *EXT, the fourth
|
||||
part, (the directory) is ranging from FILE_NAME to the char before
|
||||
*BASE, so we don't need an additional parameter.
|
||||
|
||||
*EXT points to the last period in the basename, or NULL if none.
|
||||
@@ -174,7 +175,7 @@ compute_exts_from_src (const char *ext)
|
||||
`.tab' or `_tab' if present right before *EXT, or is NULL. *TAB
|
||||
cannot be equal to *BASE.
|
||||
|
||||
None are allocated, they are simply pointers to parts of FILENAME.
|
||||
None are allocated, they are simply pointers to parts of FILE_NAME.
|
||||
Examples:
|
||||
|
||||
'/tmp/foo.tab.c' -> *BASE = 'foo.tab.c', *TAB = '.tab.c', *EXT =
|
||||
@@ -193,10 +194,10 @@ compute_exts_from_src (const char *ext)
|
||||
'foo' -> *BASE = 'foo', *TAB = NULL, *EXT = NULL. */
|
||||
|
||||
static void
|
||||
filename_split (const char *filename,
|
||||
const char **base, const char **tab, const char **ext)
|
||||
file_name_split (const char *file_name,
|
||||
const char **base, const char **tab, const char **ext)
|
||||
{
|
||||
*base = base_name (filename);
|
||||
*base = base_name (file_name);
|
||||
|
||||
/* Look for the extension, i.e., look for the last dot. */
|
||||
*ext = strrchr (*base, '.');
|
||||
@@ -216,8 +217,6 @@ filename_split (const char *filename,
|
||||
}
|
||||
|
||||
|
||||
/* FIXME: Should use xstrndup. */
|
||||
|
||||
static void
|
||||
compute_base_names (void)
|
||||
{
|
||||
@@ -233,7 +232,7 @@ compute_base_names (void)
|
||||
files, remove the ".c" or ".tab.c" suffix. */
|
||||
if (spec_outfile)
|
||||
{
|
||||
filename_split (spec_outfile, &base, &tab, &ext);
|
||||
file_name_split (spec_outfile, &base, &tab, &ext);
|
||||
|
||||
/* The full base name goes up the EXT, excluding it. */
|
||||
full_base_name =
|
||||
@@ -271,7 +270,7 @@ compute_base_names (void)
|
||||
{
|
||||
/* Otherwise, the short base name is computed from the input
|
||||
grammar: `foo/bar.yy' => `bar'. */
|
||||
filename_split (grammar_file, &base, &tab, &ext);
|
||||
file_name_split (grammar_file, &base, &tab, &ext);
|
||||
short_base_name =
|
||||
xstrndup (base,
|
||||
(strlen (base) - (ext ? strlen (ext) : 0)));
|
||||
@@ -282,7 +281,7 @@ compute_base_names (void)
|
||||
stpcpy (stpcpy (full_base_name, short_base_name), TAB_EXT);
|
||||
|
||||
/* Compute the extensions from the grammar file name. */
|
||||
filename_split (grammar_file, &base, &tab, &ext);
|
||||
file_name_split (grammar_file, &base, &tab, &ext);
|
||||
if (ext && !yacc_flag)
|
||||
compute_exts_from_gf (ext);
|
||||
}
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef FILES_H_
|
||||
# define FILES_H_
|
||||
|
||||
+18
-11
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "system.h"
|
||||
|
||||
@@ -207,9 +207,10 @@ for the equivalent short option also. Similarly for optional arguments.\n"),
|
||||
|
||||
fputs (_("\
|
||||
Operation modes:\n\
|
||||
-h, --help display this help and exit\n\
|
||||
-V, --version output version information and exit\n\
|
||||
-y, --yacc emulate POSIX yacc\n"), stdout);
|
||||
-h, --help display this help and exit\n\
|
||||
-V, --version output version information and exit\n\
|
||||
--print-localedir output directory containing locale-dependent data\n\
|
||||
-y, --yacc emulate POSIX yacc\n"), stdout);
|
||||
putc ('\n', stdout);
|
||||
|
||||
fputs (_("\
|
||||
@@ -269,7 +270,7 @@ version (void)
|
||||
putc ('\n', stdout);
|
||||
|
||||
fprintf (stdout,
|
||||
_("Copyright (C) %d Free Software Foundation, Inc.\n"), 2004);
|
||||
_("Copyright (C) %d Free Software Foundation, Inc.\n"), 2005);
|
||||
|
||||
fputs (_("\
|
||||
This is free software; see the source for copying conditions. There is NO\n\
|
||||
@@ -284,19 +285,21 @@ 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
|
||||
{
|
||||
LOCATIONS_OPTION = CHAR_MAX + 1
|
||||
LOCATIONS_OPTION = CHAR_MAX + 1,
|
||||
PRINT_LOCALEDIR_OPTION
|
||||
};
|
||||
|
||||
static struct option const long_options[] =
|
||||
{
|
||||
/* Operation modes. */
|
||||
{ "help", no_argument, 0, 'h' },
|
||||
{ "version", no_argument, 0, 'V' },
|
||||
{ "help", no_argument, 0, 'h' },
|
||||
{ "version", no_argument, 0, 'V' },
|
||||
{ "print-localedir", no_argument, 0, PRINT_LOCALEDIR_OPTION },
|
||||
|
||||
/* Parser. */
|
||||
{ "name-prefix", required_argument, 0, 'p' },
|
||||
@@ -364,6 +367,10 @@ getargs (int argc, char *argv[])
|
||||
version ();
|
||||
exit (EXIT_SUCCESS);
|
||||
|
||||
case PRINT_LOCALEDIR_OPTION:
|
||||
printf ("%s\n", LOCALEDIR);
|
||||
exit (EXIT_SUCCESS);
|
||||
|
||||
case 'g':
|
||||
/* Here, the -g and --graph=FILE options are differentiated. */
|
||||
graph_flag = true;
|
||||
|
||||
+9
-5
@@ -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.
|
||||
@@ -16,15 +16,19 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GETARGS_H_
|
||||
# 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 */
|
||||
|
||||
+3
-3
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
|
||||
#include "system.h"
|
||||
@@ -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;
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef GRAM_H_
|
||||
# define GRAM_H_
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
|
||||
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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
|
||||
/* Compute how to make the finite state machine deterministic; find
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user