mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-12 20:25:13 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2bc8a1ba0 | ||
|
|
77bb73e7af | ||
|
|
9d6af15318 | ||
|
|
441735026b | ||
|
|
1e811aacd7 | ||
|
|
d143e9c33f | ||
|
|
723206df6f | ||
|
|
ac3297d501 | ||
|
|
c9e2da4f20 | ||
|
|
55dd356336 | ||
|
|
a898435b25 | ||
|
|
fea2d6b097 | ||
|
|
6f8bdce25d | ||
|
|
fc7ce9970f | ||
|
|
8ffd7912e3 | ||
|
|
dab9663283 | ||
|
|
248dba53cb | ||
|
|
20cc714980 | ||
|
|
56706c6167 | ||
|
|
a6e5a28079 | ||
|
|
49e8e901fb | ||
|
|
8f462efe92 | ||
|
|
686e83e396 | ||
|
|
f0e2c228a0 | ||
|
|
4c2a6e42ba | ||
|
|
6f75992be5 | ||
|
|
121c498280 | ||
|
|
5da0355aff | ||
|
|
d815ec4a62 | ||
|
|
6f04ee6c78 | ||
|
|
71caec0661 | ||
|
|
7776816565 | ||
|
|
8db68289d1 | ||
|
|
f3103c5b4f | ||
|
|
406dec8286 | ||
|
|
2f4518a126 | ||
|
|
8e6f226630 | ||
|
|
9913d6e45a | ||
|
|
840341d67d | ||
|
|
d89e48b3c9 | ||
|
|
eb8c66bbda | ||
|
|
448dc38bc4 | ||
|
|
7e5ef70679 | ||
|
|
8cbbf1786f | ||
|
|
354303787c | ||
|
|
d236ad946b | ||
|
|
9a4292e580 | ||
|
|
17300e83f0 | ||
|
|
ea0a767697 | ||
|
|
f52e1e5e44 | ||
|
|
210c1eef22 | ||
|
|
6ee881f6a2 | ||
|
|
3b1977eab5 | ||
|
|
4c38b19e26 | ||
|
|
723fe7d18a | ||
|
|
ea13bea8ab | ||
|
|
dcd39f1d4a | ||
|
|
3b8378825e | ||
|
|
095a1d11ca | ||
|
|
678094a2f5 | ||
|
|
f953cb20cf | ||
|
|
0e0f066b76 | ||
|
|
5f1485d8e1 | ||
|
|
2f3fd8f986 | ||
|
|
ea6046b9f6 | ||
|
|
86996fca10 | ||
|
|
32dc877a20 | ||
|
|
7527c744c0 | ||
|
|
d034d52066 | ||
|
|
cf22447c62 | ||
|
|
4631c34fb7 | ||
|
|
3e948170f7 | ||
|
|
82df2d6dd6 | ||
|
|
6e0ecb9a7d | ||
|
|
83e34842c1 | ||
|
|
0162a44c31 | ||
|
|
6e30ede87a | ||
|
|
241ac701ba | ||
|
|
3d4a0cad56 | ||
|
|
e7bab2df96 | ||
|
|
baacae4971 | ||
|
|
95a2de5695 | ||
|
|
38f9fd6439 | ||
|
|
0f404a0af0 | ||
|
|
bdc360ae58 | ||
|
|
ca7a59e838 | ||
|
|
ad6f84e550 | ||
|
|
212792959e | ||
|
|
43fdc9fd8e | ||
|
|
e02df72c2d | ||
|
|
ba3063f613 | ||
|
|
e0fda26c8d | ||
|
|
ecbca7db4b | ||
|
|
ed228e60b2 | ||
|
|
cacfdef716 | ||
|
|
2f61c4a2d0 | ||
|
|
16d9244df6 | ||
|
|
3e4a253ba9 | ||
|
|
df5df58d91 | ||
|
|
88bb35d6ac | ||
|
|
585ef2eb20 | ||
|
|
a005dbcbe3 | ||
|
|
8a8b33e8d2 | ||
|
|
a02797656e | ||
|
|
132247cd94 | ||
|
|
c0259969d7 | ||
|
|
23761f428a | ||
|
|
9097fda06c | ||
|
|
7a9c3cb3a7 | ||
|
|
5a3c69f103 | ||
|
|
ea66d039b4 | ||
|
|
c50befe615 | ||
|
|
47fa574761 | ||
|
|
d67e37a74b | ||
|
|
0ee1af2ed5 | ||
|
|
2655c7cd13 | ||
|
|
8ebc7dca63 | ||
|
|
f0a43dd1bb | ||
|
|
e4ca7a85cc | ||
|
|
8d830047ec | ||
|
|
e592664788 | ||
|
|
5a2f6eb4af | ||
|
|
1c4ad777cb | ||
|
|
1462fcee1e | ||
|
|
510df9519e | ||
|
|
2c2035282c | ||
|
|
a93cdd3d67 | ||
|
|
bb57985c2e | ||
|
|
70afaf2603 | ||
|
|
8200219a2a | ||
|
|
39f6a8d142 | ||
|
|
e657f3698e | ||
|
|
1e05521d4f | ||
|
|
2728ac7ecd | ||
|
|
abcc7c03cc | ||
|
|
62efdd2a85 | ||
|
|
41d35e54d5 | ||
|
|
692d04cb6a | ||
|
|
3473147172 | ||
|
|
3bba2dadae | ||
|
|
af2ffe5c23 | ||
|
|
874ac415b9 | ||
|
|
06caf0e144 | ||
|
|
687f011aa9 | ||
|
|
fb9a3976c2 | ||
|
|
f1fb412cf3 | ||
|
|
51c7ca01e2 | ||
|
|
1f68dca514 | ||
|
|
aa01d1934c | ||
|
|
61747047da | ||
|
|
a70596de95 | ||
|
|
51f255a530 | ||
|
|
23ec25b7c6 | ||
|
|
0ab402b48b | ||
|
|
42ec0ae176 | ||
|
|
9637e0ed1c | ||
|
|
69a2ab11cf | ||
|
|
d88cf11791 | ||
|
|
9da640eaa8 | ||
|
|
d3d3628bde | ||
|
|
4c6b13f37e | ||
|
|
f840c05ad4 | ||
|
|
17a407dc51 | ||
|
|
4b7a4c1b1c | ||
|
|
873ac263c8 | ||
|
|
232be91a83 | ||
|
|
c781580d07 | ||
|
|
348f560883 | ||
|
|
d93b5f50cf | ||
|
|
4c56b1319d | ||
|
|
93d0103dd4 | ||
|
|
628be6c97d | ||
|
|
c842365a01 | ||
|
|
14e568d744 | ||
|
|
dac8cc0d14 | ||
|
|
3710dd02e2 | ||
|
|
9852b61c2b | ||
|
|
5bf2bf7a6d | ||
|
|
f37495f601 | ||
|
|
3a414bbfa0 | ||
|
|
4bb975e1ad | ||
|
|
74baf5c966 | ||
|
|
d63e12792a | ||
|
|
833d1720f8 | ||
|
|
e4bcae3c5a | ||
|
|
d5eb0826af | ||
|
|
1fa303077d | ||
|
|
77373efad2 | ||
|
|
890ab17c84 | ||
|
|
aa50ba7bff | ||
|
|
c519609864 | ||
|
|
39fb7e6239 | ||
|
|
c33bc80009 | ||
|
|
8fbbeba2a4 | ||
|
|
1874a474b9 | ||
|
|
f4bfd5a96f | ||
|
|
2509eba631 | ||
|
|
314542f905 | ||
|
|
2498596474 | ||
|
|
47076da5b6 | ||
|
|
36dfe4662e | ||
|
|
07c0db18b4 | ||
|
|
1a323c2f71 | ||
|
|
38609c3455 | ||
|
|
642f240e22 | ||
|
|
d0caad01ab | ||
|
|
ac2def5602 | ||
|
|
dbbb64f091 | ||
|
|
bfa018d447 | ||
|
|
4521fcdf02 | ||
|
|
cbc6a70e9d | ||
|
|
992e874a7c | ||
|
|
a1ed2b71fa | ||
|
|
1e20ad112f | ||
|
|
ac9b0e954b | ||
|
|
2de160e12e | ||
|
|
cba975069a | ||
|
|
62eb2d1bd9 | ||
|
|
620b2e3691 | ||
|
|
dad6544d4a | ||
|
|
8bea3dbd84 | ||
|
|
d5e8574bf6 | ||
|
|
ae09ec8577 | ||
|
|
80d653fd30 | ||
|
|
0210a4bf5e | ||
|
|
7685e2f7ba | ||
|
|
67f8cf51c3 | ||
|
|
83b66dddb6 | ||
|
|
517cb0ad9c | ||
|
|
75c7a52a31 | ||
|
|
cc96d8ff98 | ||
|
|
66ed97537a | ||
|
|
95d176ffd9 | ||
|
|
ed15d907c5 | ||
|
|
e3a33f7c23 | ||
|
|
34d4193815 | ||
|
|
246c4efafe | ||
|
|
531683e74b | ||
|
|
e7bfa8b721 | ||
|
|
8c221795af | ||
|
|
c8bf65f07e | ||
|
|
7ac45a4687 | ||
|
|
b10dd689b6 | ||
|
|
601bdfabe2 | ||
|
|
d19123e612 | ||
|
|
ecdfea9a12 | ||
|
|
43e6aea526 | ||
|
|
c046698e6e | ||
|
|
966aba6583 | ||
|
|
812775a039 | ||
|
|
1c4aa81df1 | ||
|
|
1d0f55cc84 | ||
|
|
0b59345789 | ||
|
|
0939aa2d3c | ||
|
|
ae618dcca5 | ||
|
|
6789b8bd7b | ||
|
|
663ce7bb3e | ||
|
|
379261b3fd | ||
|
|
25029e164a | ||
|
|
620b572773 | ||
|
|
34a6c2d19b | ||
|
|
f805dfcb3f | ||
|
|
166366b28f | ||
|
|
03c07b0394 | ||
|
|
44c124a389 | ||
|
|
4266073618 | ||
|
|
a2d0567444 | ||
|
|
c4fae1ef48 | ||
|
|
42f4393a72 | ||
|
|
bd5df716a3 | ||
|
|
7ba0d59da0 | ||
|
|
b4d71a9664 | ||
|
|
4ecd368199 | ||
|
|
c65e529237 | ||
|
|
96002de2e1 | ||
|
|
fadb13b5b3 | ||
|
|
72183df4da | ||
|
|
e80b068ce1 | ||
|
|
54d8d31419 | ||
|
|
e3ee30b88f | ||
|
|
c4eb1e841e | ||
|
|
10fa0146e2 | ||
|
|
6f5be1abf7 | ||
|
|
11c4e57daf | ||
|
|
e186a28486 | ||
|
|
e14c68313b | ||
|
|
75c21b618d | ||
|
|
33d2a86079 | ||
|
|
006faedfd3 |
-31
@@ -1,31 +0,0 @@
|
|||||||
*.cache
|
|
||||||
*.flc
|
|
||||||
*.prj
|
|
||||||
*~
|
|
||||||
.tarball-version
|
|
||||||
.version
|
|
||||||
ABOUT-NLS
|
|
||||||
COPYING
|
|
||||||
GNUmakefile
|
|
||||||
INSTALL
|
|
||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
_*
|
|
||||||
a.exe
|
|
||||||
a.out
|
|
||||||
aclocal.m4
|
|
||||||
b.out
|
|
||||||
bison-*
|
|
||||||
conf[0-9]*
|
|
||||||
confdefs*
|
|
||||||
config.log
|
|
||||||
config.status
|
|
||||||
configure
|
|
||||||
configure.lineno
|
|
||||||
conftest*
|
|
||||||
gnulib
|
|
||||||
javacomp.sh
|
|
||||||
javaexec.sh
|
|
||||||
patches
|
|
||||||
releases
|
|
||||||
stamp-h*
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*.cache
|
/*.cache
|
||||||
/*.flc
|
/*.flc
|
||||||
/*.prj
|
/*.prj
|
||||||
@@ -26,6 +27,8 @@
|
|||||||
/gnulib
|
/gnulib
|
||||||
/javacomp.sh
|
/javacomp.sh
|
||||||
/javaexec.sh
|
/javaexec.sh
|
||||||
|
/maint.mk
|
||||||
/patches
|
/patches
|
||||||
/releases
|
/releases
|
||||||
/stamp-h*
|
/stamp-h*
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
[submodule "gnulib"]
|
[submodule "gnulib"]
|
||||||
path = gnulib
|
path = gnulib
|
||||||
url = git://git.savannah.gnu.org/gnulib.git
|
url = git://git.savannah.gnu.org/gnulib.git
|
||||||
|
[submodule "submodules/autoconf"]
|
||||||
|
path = submodules/autoconf
|
||||||
|
url = git://git.sv.gnu.org/autoconf.git
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
COPYING
|
||||||
|
^bootstrap$
|
||||||
|
^doc/fdl\.texi$
|
||||||
|
^doc/gpl-3\.0\.texi$
|
||||||
|
^doc/yacc\.1\.in$
|
||||||
|
^src/parse-gram\.h$
|
||||||
+12
-3
@@ -1,6 +1,6 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
|
|
||||||
## Foundation, Inc.
|
## Copyright (C) 2001-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,7 +23,7 @@ SUBDIRS = build-aux po runtime-po lib data src doc examples tests etc
|
|||||||
aclocaldir = @aclocaldir@
|
aclocaldir = @aclocaldir@
|
||||||
aclocal_DATA = m4/bison-i18n.m4
|
aclocal_DATA = m4/bison-i18n.m4
|
||||||
|
|
||||||
EXTRA_DIST = .prev-version .version cfg.mk maint.mk \
|
EXTRA_DIST = .prev-version .version cfg.mk \
|
||||||
OChangeLog PACKAGING \
|
OChangeLog PACKAGING \
|
||||||
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
||||||
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
||||||
@@ -57,3 +57,12 @@ $(top_srcdir)/.version: configure
|
|||||||
echo $(VERSION) > $@-t && mv $@-t $@
|
echo $(VERSION) > $@-t && mv $@-t $@
|
||||||
dist-hook:
|
dist-hook:
|
||||||
echo $(VERSION) > $(distdir)/.tarball-version
|
echo $(VERSION) > $(distdir)/.tarball-version
|
||||||
|
|
||||||
|
.PHONY: update-b4-copyright update-package-copyright-year
|
||||||
|
update-b4-copyright:
|
||||||
|
find data -type f \
|
||||||
|
| grep -v -E '^data/bison.m4$$' \
|
||||||
|
| xargs $(build_aux)/$@
|
||||||
|
@echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
|
||||||
|
update-package-copyright-year:
|
||||||
|
$(build_aux)/$@ configure.ac
|
||||||
|
|||||||
@@ -1,7 +1,471 @@
|
|||||||
Bison News
|
Bison News
|
||||||
----------
|
----------
|
||||||
|
|
||||||
* Changes in version 2.4.2 (????-??-??):
|
* Changes in version 2.5 (2011-05-14):
|
||||||
|
|
||||||
|
** Grammar symbol names can now contain non-initial dashes:
|
||||||
|
|
||||||
|
Consistently with directives (such as %error-verbose) and with
|
||||||
|
%define variables (e.g. push-pull), grammar symbol names may contain
|
||||||
|
dashes in any position except the beginning. This is a GNU
|
||||||
|
extension over POSIX Yacc. Thus, use of this extension is reported
|
||||||
|
by -Wyacc and rejected in Yacc mode (--yacc).
|
||||||
|
|
||||||
|
** Named references:
|
||||||
|
|
||||||
|
Historically, Yacc and Bison have supported positional references
|
||||||
|
($n, $$) to allow access to symbol values from inside of semantic
|
||||||
|
actions code.
|
||||||
|
|
||||||
|
Starting from this version, Bison can also accept named references.
|
||||||
|
When no ambiguity is possible, original symbol names may be used
|
||||||
|
as named references:
|
||||||
|
|
||||||
|
if_stmt : "if" cond_expr "then" then_stmt ';'
|
||||||
|
{ $if_stmt = mk_if_stmt($cond_expr, $then_stmt); }
|
||||||
|
|
||||||
|
In the more common case, explicit names may be declared:
|
||||||
|
|
||||||
|
stmt[res] : "if" expr[cond] "then" stmt[then] "else" stmt[else] ';'
|
||||||
|
{ $res = mk_if_stmt($cond, $then, $else); }
|
||||||
|
|
||||||
|
Location information is also accessible using @name syntax. When
|
||||||
|
accessing symbol names containing dots or dashes, explicit bracketing
|
||||||
|
($[sym.1]) must be used.
|
||||||
|
|
||||||
|
These features are experimental in this version. More user feedback
|
||||||
|
will help to stabilize them.
|
||||||
|
|
||||||
|
** IELR(1) and canonical LR(1):
|
||||||
|
|
||||||
|
IELR(1) is a minimal LR(1) parser table generation algorithm. That
|
||||||
|
is, given any context-free grammar, IELR(1) generates parser tables
|
||||||
|
with the full language-recognition power of canonical LR(1) but with
|
||||||
|
nearly the same number of parser states as LALR(1). This reduction
|
||||||
|
in parser states is often an order of magnitude. More importantly,
|
||||||
|
because canonical LR(1)'s extra parser states may contain duplicate
|
||||||
|
conflicts in the case of non-LR(1) grammars, the number of conflicts
|
||||||
|
for IELR(1) is often an order of magnitude less as well. This can
|
||||||
|
significantly reduce the complexity of developing of a grammar.
|
||||||
|
|
||||||
|
Bison can now generate IELR(1) and canonical LR(1) parser tables in
|
||||||
|
place of its traditional LALR(1) parser tables, which remain the
|
||||||
|
default. You can specify the type of parser tables in the grammar
|
||||||
|
file with these directives:
|
||||||
|
|
||||||
|
%define lr.type lalr
|
||||||
|
%define lr.type ielr
|
||||||
|
%define lr.type canonical-lr
|
||||||
|
|
||||||
|
The default-reduction optimization in the parser tables can also be
|
||||||
|
adjusted using `%define lr.default-reductions'. For details on both
|
||||||
|
of these features, see the new section `Tuning LR' in the Bison
|
||||||
|
manual.
|
||||||
|
|
||||||
|
These features are experimental. More user feedback will help to
|
||||||
|
stabilize them.
|
||||||
|
|
||||||
|
** LAC (Lookahead Correction) for syntax error handling:
|
||||||
|
|
||||||
|
Canonical LR, IELR, and LALR can suffer from a couple of problems
|
||||||
|
upon encountering a syntax error. First, the parser might perform
|
||||||
|
additional parser stack reductions before discovering the syntax
|
||||||
|
error. Such reductions can perform user semantic actions that are
|
||||||
|
unexpected because they are based on an invalid token, and they
|
||||||
|
cause error recovery to begin in a different syntactic context than
|
||||||
|
the one in which the invalid token was encountered. Second, when
|
||||||
|
verbose error messages are enabled (with %error-verbose or the
|
||||||
|
obsolete `#define YYERROR_VERBOSE'), the expected token list in the
|
||||||
|
syntax error message can both contain invalid tokens and omit valid
|
||||||
|
tokens.
|
||||||
|
|
||||||
|
The culprits for the above problems are %nonassoc, default
|
||||||
|
reductions in inconsistent states, and parser state merging. Thus,
|
||||||
|
IELR and LALR suffer the most. Canonical LR can suffer only if
|
||||||
|
%nonassoc is used or if default reductions are enabled for
|
||||||
|
inconsistent states.
|
||||||
|
|
||||||
|
LAC is a new mechanism within the parsing algorithm that solves
|
||||||
|
these problems for canonical LR, IELR, and LALR without sacrificing
|
||||||
|
%nonassoc, default reductions, or state merging. When LAC is in
|
||||||
|
use, canonical LR and IELR behave almost exactly the same for both
|
||||||
|
syntactically acceptable and syntactically unacceptable input.
|
||||||
|
While LALR still does not support the full language-recognition
|
||||||
|
power of canonical LR and IELR, LAC at least enables LALR's syntax
|
||||||
|
error handling to correctly reflect LALR's language-recognition
|
||||||
|
power.
|
||||||
|
|
||||||
|
Currently, LAC is only supported for deterministic parsers in C.
|
||||||
|
You can enable LAC with the following directive:
|
||||||
|
|
||||||
|
%define parse.lac full
|
||||||
|
|
||||||
|
See the new section `LAC' in the Bison manual for additional
|
||||||
|
details including a few caveats.
|
||||||
|
|
||||||
|
LAC is an experimental feature. More user feedback will help to
|
||||||
|
stabilize it.
|
||||||
|
|
||||||
|
** %define improvements:
|
||||||
|
|
||||||
|
*** Can now be invoked via the command line:
|
||||||
|
|
||||||
|
Each of these command-line options
|
||||||
|
|
||||||
|
-D NAME[=VALUE]
|
||||||
|
--define=NAME[=VALUE]
|
||||||
|
|
||||||
|
-F NAME[=VALUE]
|
||||||
|
--force-define=NAME[=VALUE]
|
||||||
|
|
||||||
|
is equivalent to this grammar file declaration
|
||||||
|
|
||||||
|
%define NAME ["VALUE"]
|
||||||
|
|
||||||
|
except that the manner in which Bison processes multiple definitions
|
||||||
|
for the same NAME differs. Most importantly, -F and --force-define
|
||||||
|
quietly override %define, but -D and --define do not. For further
|
||||||
|
details, see the section `Bison Options' in the Bison manual.
|
||||||
|
|
||||||
|
*** Variables renamed:
|
||||||
|
|
||||||
|
The following %define variables
|
||||||
|
|
||||||
|
api.push_pull
|
||||||
|
lr.keep_unreachable_states
|
||||||
|
|
||||||
|
have been renamed to
|
||||||
|
|
||||||
|
api.push-pull
|
||||||
|
lr.keep-unreachable-states
|
||||||
|
|
||||||
|
The old names are now deprecated but will be maintained indefinitely
|
||||||
|
for backward compatibility.
|
||||||
|
|
||||||
|
*** Values no longer need to be quoted in the grammar file:
|
||||||
|
|
||||||
|
If a %define value is an identifier, it no longer needs to be placed
|
||||||
|
within quotations marks. For example,
|
||||||
|
|
||||||
|
%define api.push-pull "push"
|
||||||
|
|
||||||
|
can be rewritten as
|
||||||
|
|
||||||
|
%define api.push-pull push
|
||||||
|
|
||||||
|
*** Unrecognized variables are now errors not warnings.
|
||||||
|
|
||||||
|
*** Multiple invocations for any variable is now an error not a warning.
|
||||||
|
|
||||||
|
** Unrecognized %code qualifiers are now errors not warnings.
|
||||||
|
|
||||||
|
** Character literals not of length one:
|
||||||
|
|
||||||
|
Previously, Bison quietly converted all character literals to length
|
||||||
|
one. For example, without warning, Bison interpreted the operators in
|
||||||
|
the following grammar to be the same token:
|
||||||
|
|
||||||
|
exp: exp '++'
|
||||||
|
| exp '+' exp
|
||||||
|
;
|
||||||
|
|
||||||
|
Bison now warns when a character literal is not of length one. In
|
||||||
|
some future release, Bison will start reporting an error instead.
|
||||||
|
|
||||||
|
** Destructor calls fixed for lookaheads altered in semantic actions:
|
||||||
|
|
||||||
|
Previously for deterministic parsers in C, if a user semantic action
|
||||||
|
altered yychar, the parser in some cases used the old yychar value to
|
||||||
|
determine which destructor to call for the lookahead upon a syntax
|
||||||
|
error or upon parser return. This bug has been fixed.
|
||||||
|
|
||||||
|
** C++ parsers use YYRHSLOC:
|
||||||
|
|
||||||
|
Similarly to the C parsers, the C++ parsers now define the YYRHSLOC
|
||||||
|
macro and use it in the default YYLLOC_DEFAULT. You are encouraged
|
||||||
|
to use it. If, for instance, your location structure has `first'
|
||||||
|
and `last' members, instead of
|
||||||
|
|
||||||
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
|
do \
|
||||||
|
if (N) \
|
||||||
|
{ \
|
||||||
|
(Current).first = (Rhs)[1].location.first; \
|
||||||
|
(Current).last = (Rhs)[N].location.last; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(Current).first = (Current).last = (Rhs)[0].location.last; \
|
||||||
|
} \
|
||||||
|
while (false)
|
||||||
|
|
||||||
|
use:
|
||||||
|
|
||||||
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
|
do \
|
||||||
|
if (N) \
|
||||||
|
{ \
|
||||||
|
(Current).first = YYRHSLOC (Rhs, 1).first; \
|
||||||
|
(Current).last = YYRHSLOC (Rhs, N).last; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \
|
||||||
|
} \
|
||||||
|
while (false)
|
||||||
|
|
||||||
|
** YYLLOC_DEFAULT in C++:
|
||||||
|
|
||||||
|
The default implementation of YYLLOC_DEFAULT used to be issued in
|
||||||
|
the header file. It is now output in the implementation file, after
|
||||||
|
the user %code sections so that its #ifndef guard does not try to
|
||||||
|
override the user's YYLLOC_DEFAULT if provided.
|
||||||
|
|
||||||
|
** YYFAIL now produces warnings and Java parsers no longer implement it:
|
||||||
|
|
||||||
|
YYFAIL has existed for many years as an undocumented feature of
|
||||||
|
deterministic parsers in C generated by Bison. More recently, it was
|
||||||
|
a documented feature of Bison's experimental Java parsers. As
|
||||||
|
promised in Bison 2.4.2's NEWS entry, any appearance of YYFAIL in a
|
||||||
|
semantic action now produces a deprecation warning, and Java parsers
|
||||||
|
no longer implement YYFAIL at all. For further details, including a
|
||||||
|
discussion of how to suppress C preprocessor warnings about YYFAIL
|
||||||
|
being unused, see the Bison 2.4.2 NEWS entry.
|
||||||
|
|
||||||
|
** Temporary hack for adding a semicolon to the user action:
|
||||||
|
|
||||||
|
Previously, Bison appended a semicolon to every user action for
|
||||||
|
reductions when the output language defaulted to C (specifically, when
|
||||||
|
neither %yacc, %language, %skeleton, or equivalent command-line
|
||||||
|
options were specified). This allowed actions such as
|
||||||
|
|
||||||
|
exp: exp "+" exp { $$ = $1 + $3 };
|
||||||
|
|
||||||
|
instead of
|
||||||
|
|
||||||
|
exp: exp "+" exp { $$ = $1 + $3; };
|
||||||
|
|
||||||
|
As a first step in removing this misfeature, Bison now issues a
|
||||||
|
warning when it appends a semicolon. Moreover, in cases where Bison
|
||||||
|
cannot easily determine whether a semicolon is needed (for example, an
|
||||||
|
action ending with a cpp directive or a braced compound initializer),
|
||||||
|
it no longer appends one. Thus, the C compiler might now complain
|
||||||
|
about a missing semicolon where it did not before. Future releases of
|
||||||
|
Bison will cease to append semicolons entirely.
|
||||||
|
|
||||||
|
** Verbose syntax error message fixes:
|
||||||
|
|
||||||
|
When %error-verbose or the obsolete `#define YYERROR_VERBOSE' is
|
||||||
|
specified, syntax error messages produced by the generated parser
|
||||||
|
include the unexpected token as well as a list of expected tokens.
|
||||||
|
The effect of %nonassoc on these verbose messages has been corrected
|
||||||
|
in two ways, but a more complete fix requires LAC, described above:
|
||||||
|
|
||||||
|
*** When %nonassoc is used, there can exist parser states that accept no
|
||||||
|
tokens, and so the parser does not always require a lookahead token
|
||||||
|
in order to detect a syntax error. Because no unexpected token or
|
||||||
|
expected tokens can then be reported, the verbose syntax error
|
||||||
|
message described above is suppressed, and the parser instead
|
||||||
|
reports the simpler message, `syntax error'. Previously, this
|
||||||
|
suppression was sometimes erroneously triggered by %nonassoc when a
|
||||||
|
lookahead was actually required. Now verbose messages are
|
||||||
|
suppressed only when all previous lookaheads have already been
|
||||||
|
shifted or discarded.
|
||||||
|
|
||||||
|
*** Previously, the list of expected tokens erroneously included tokens
|
||||||
|
that would actually induce a syntax error because conflicts for them
|
||||||
|
were resolved with %nonassoc in the current parser state. Such
|
||||||
|
tokens are now properly omitted from the list.
|
||||||
|
|
||||||
|
*** Expected token lists are still often wrong due to state merging
|
||||||
|
(from LALR or IELR) and default reductions, which can both add
|
||||||
|
invalid tokens and subtract valid tokens. Canonical LR almost
|
||||||
|
completely fixes this problem by eliminating state merging and
|
||||||
|
default reductions. However, there is one minor problem left even
|
||||||
|
when using canonical LR and even after the fixes above. That is,
|
||||||
|
if the resolution of a conflict with %nonassoc appears in a later
|
||||||
|
parser state than the one at which some syntax error is
|
||||||
|
discovered, the conflicted token is still erroneously included in
|
||||||
|
the expected token list. Bison's new LAC implementation,
|
||||||
|
described above, eliminates this problem and the need for
|
||||||
|
canonical LR. However, LAC is still experimental and is disabled
|
||||||
|
by default.
|
||||||
|
|
||||||
|
** Java skeleton fixes:
|
||||||
|
|
||||||
|
*** A location handling bug has been fixed.
|
||||||
|
|
||||||
|
*** The top element of each of the value stack and location stack is now
|
||||||
|
cleared when popped so that it can be garbage collected.
|
||||||
|
|
||||||
|
*** Parser traces now print the top element of the stack.
|
||||||
|
|
||||||
|
** -W/--warnings fixes:
|
||||||
|
|
||||||
|
*** Bison now properly recognizes the `no-' versions of categories:
|
||||||
|
|
||||||
|
For example, given the following command line, Bison now enables all
|
||||||
|
warnings except warnings for incompatibilities with POSIX Yacc:
|
||||||
|
|
||||||
|
bison -Wall,no-yacc gram.y
|
||||||
|
|
||||||
|
*** Bison now treats S/R and R/R conflicts like other warnings:
|
||||||
|
|
||||||
|
Previously, conflict reports were independent of Bison's normal
|
||||||
|
warning system. Now, Bison recognizes the warning categories
|
||||||
|
`conflicts-sr' and `conflicts-rr'. This change has important
|
||||||
|
consequences for the -W and --warnings command-line options. For
|
||||||
|
example:
|
||||||
|
|
||||||
|
bison -Wno-conflicts-sr gram.y # S/R conflicts not reported
|
||||||
|
bison -Wno-conflicts-rr gram.y # R/R conflicts not reported
|
||||||
|
bison -Wnone gram.y # no conflicts are reported
|
||||||
|
bison -Werror gram.y # any conflict is an error
|
||||||
|
|
||||||
|
However, as before, if the %expect or %expect-rr directive is
|
||||||
|
specified, an unexpected number of conflicts is an error, and an
|
||||||
|
expected number of conflicts is not reported, so -W and --warning
|
||||||
|
then have no effect on the conflict report.
|
||||||
|
|
||||||
|
*** The `none' category no longer disables a preceding `error':
|
||||||
|
|
||||||
|
For example, for the following command line, Bison now reports
|
||||||
|
errors instead of warnings for incompatibilities with POSIX Yacc:
|
||||||
|
|
||||||
|
bison -Werror,none,yacc gram.y
|
||||||
|
|
||||||
|
*** The `none' category now disables all Bison warnings:
|
||||||
|
|
||||||
|
Previously, the `none' category disabled only Bison warnings for
|
||||||
|
which there existed a specific -W/--warning category. However,
|
||||||
|
given the following command line, Bison is now guaranteed to
|
||||||
|
suppress all warnings:
|
||||||
|
|
||||||
|
bison -Wnone gram.y
|
||||||
|
|
||||||
|
** Precedence directives can now assign token number 0:
|
||||||
|
|
||||||
|
Since Bison 2.3b, which restored the ability of precedence
|
||||||
|
directives to assign token numbers, doing so for token number 0 has
|
||||||
|
produced an assertion failure. For example:
|
||||||
|
|
||||||
|
%left END 0
|
||||||
|
|
||||||
|
This bug has been fixed.
|
||||||
|
|
||||||
|
* Changes in version 2.4.3 (2010-08-05):
|
||||||
|
|
||||||
|
** Bison now obeys -Werror and --warnings=error for warnings about
|
||||||
|
grammar rules that are useless in the parser due to conflicts.
|
||||||
|
|
||||||
|
** Problems with spawning M4 on at least FreeBSD 8 and FreeBSD 9 have
|
||||||
|
been fixed.
|
||||||
|
|
||||||
|
** Failures in the test suite for GCC 4.5 have been fixed.
|
||||||
|
|
||||||
|
** Failures in the test suite for some versions of Sun Studio C++ have
|
||||||
|
been fixed.
|
||||||
|
|
||||||
|
** Contrary to Bison 2.4.2's NEWS entry, it has been decided that
|
||||||
|
warnings about undefined %prec identifiers will not be converted to
|
||||||
|
errors in Bison 2.5. They will remain warnings, which should be
|
||||||
|
sufficient for POSIX while avoiding backward compatibility issues.
|
||||||
|
|
||||||
|
** Minor documentation fixes.
|
||||||
|
|
||||||
|
* Changes in version 2.4.2 (2010-03-20):
|
||||||
|
|
||||||
|
** Some portability problems that resulted in failures and livelocks
|
||||||
|
in the test suite on some versions of at least Solaris, AIX, HP-UX,
|
||||||
|
RHEL4, and Tru64 have been addressed. As a result, fatal Bison
|
||||||
|
errors should no longer cause M4 to report a broken pipe on the
|
||||||
|
affected platforms.
|
||||||
|
|
||||||
|
** `%prec IDENTIFIER' requires IDENTIFIER to be defined separately.
|
||||||
|
|
||||||
|
POSIX specifies that an error be reported for any identifier that does
|
||||||
|
not appear on the LHS of a grammar rule and that is not defined by
|
||||||
|
%token, %left, %right, or %nonassoc. Bison 2.3b and later lost this
|
||||||
|
error report for the case when an identifier appears only after a
|
||||||
|
%prec directive. It is now restored. However, for backward
|
||||||
|
compatibility with recent Bison releases, it is only a warning for
|
||||||
|
now. In Bison 2.5 and later, it will return to being an error.
|
||||||
|
[Between the 2.4.2 and 2.4.3 releases, it was decided that this
|
||||||
|
warning will not be converted to an error in Bison 2.5.]
|
||||||
|
|
||||||
|
** Detection of GNU M4 1.4.6 or newer during configure is improved.
|
||||||
|
|
||||||
|
** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS,
|
||||||
|
YYLTYPE_IS_TRIVIAL, and __STRICT_ANSI__ in C/C++ parsers are now
|
||||||
|
avoided.
|
||||||
|
|
||||||
|
** %code is now a permanent feature.
|
||||||
|
|
||||||
|
A traditional Yacc prologue directive is written in the form:
|
||||||
|
|
||||||
|
%{CODE%}
|
||||||
|
|
||||||
|
To provide a more flexible alternative, Bison 2.3b introduced the
|
||||||
|
%code directive with the following forms for C/C++:
|
||||||
|
|
||||||
|
%code {CODE}
|
||||||
|
%code requires {CODE}
|
||||||
|
%code provides {CODE}
|
||||||
|
%code top {CODE}
|
||||||
|
|
||||||
|
These forms are now considered permanent features of Bison. See the
|
||||||
|
%code entries in the section "Bison Declaration Summary" in the Bison
|
||||||
|
manual for a summary of their functionality. See the section
|
||||||
|
"Prologue Alternatives" for a detailed discussion including the
|
||||||
|
advantages of %code over the traditional Yacc prologue directive.
|
||||||
|
|
||||||
|
Bison's Java feature as a whole including its current usage of %code
|
||||||
|
is still considered experimental.
|
||||||
|
|
||||||
|
** YYFAIL is deprecated and will eventually be removed.
|
||||||
|
|
||||||
|
YYFAIL has existed for many years as an undocumented feature of
|
||||||
|
deterministic parsers in C generated by Bison. Previously, it was
|
||||||
|
documented for Bison's experimental Java parsers. YYFAIL is no longer
|
||||||
|
documented for Java parsers and is formally deprecated in both cases.
|
||||||
|
Users are strongly encouraged to migrate to YYERROR, which is
|
||||||
|
specified by POSIX.
|
||||||
|
|
||||||
|
Like YYERROR, you can invoke YYFAIL from a semantic action in order to
|
||||||
|
induce a syntax error. The most obvious difference from YYERROR is
|
||||||
|
that YYFAIL will automatically invoke yyerror to report the syntax
|
||||||
|
error so that you don't have to. However, there are several other
|
||||||
|
subtle differences between YYERROR and YYFAIL, and YYFAIL suffers from
|
||||||
|
inherent flaws when %error-verbose or `#define YYERROR_VERBOSE' is
|
||||||
|
used. For a more detailed discussion, see:
|
||||||
|
|
||||||
|
http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html
|
||||||
|
|
||||||
|
The upcoming Bison 2.5 will remove YYFAIL from Java parsers, but
|
||||||
|
deterministic parsers in C will continue to implement it. However,
|
||||||
|
because YYFAIL is already flawed, it seems futile to try to make new
|
||||||
|
Bison features compatible with it. Thus, during parser generation,
|
||||||
|
Bison 2.5 will produce a warning whenever it discovers YYFAIL in a
|
||||||
|
rule action. In a later release, YYFAIL will be disabled for
|
||||||
|
%error-verbose and `#define YYERROR_VERBOSE'. Eventually, YYFAIL will
|
||||||
|
be removed altogether.
|
||||||
|
|
||||||
|
There exists at least one case where Bison 2.5's YYFAIL warning will
|
||||||
|
be a false positive. Some projects add phony uses of YYFAIL and other
|
||||||
|
Bison-defined macros for the sole purpose of suppressing C
|
||||||
|
preprocessor warnings (from GCC cpp's -Wunused-macros, for example).
|
||||||
|
To avoid Bison's future warning, such YYFAIL uses can be moved to the
|
||||||
|
epilogue (that is, after the second `%%') in the Bison input file. In
|
||||||
|
this release (2.4.2), Bison already generates its own code to suppress
|
||||||
|
C preprocessor warnings for YYFAIL, so projects can remove their own
|
||||||
|
phony uses of YYFAIL if compatibility with Bison releases prior to
|
||||||
|
2.4.2 is not necessary.
|
||||||
|
|
||||||
|
** Internationalization.
|
||||||
|
|
||||||
|
Fix a regression introduced in Bison 2.4: Under some circumstances,
|
||||||
|
message translations were not installed although supported by the
|
||||||
|
host system.
|
||||||
|
|
||||||
* Changes in version 2.4.1 (2008-12-11):
|
* Changes in version 2.4.1 (2008-12-11):
|
||||||
|
|
||||||
@@ -1050,8 +1514,7 @@ End:
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
Copyright (C) 1995-2011 Free Software Foundation, Inc.
|
||||||
2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Parser Generator.
|
This file is part of Bison, the GNU Parser Generator.
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ to the bison package.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2005, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,51 @@
|
|||||||
This package contains the GNU Bison parser generator.
|
This package contains the GNU Bison parser generator.
|
||||||
|
|
||||||
See the file INSTALL for generic compilation and installation instructions.
|
* Installation
|
||||||
|
** Build
|
||||||
|
See the file INSTALL for generic compilation and installation
|
||||||
|
instructions.
|
||||||
|
|
||||||
|
Bison requires GNU m4 1.4.6 or later. See:
|
||||||
|
|
||||||
|
ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
|
||||||
|
|
||||||
|
** Internationalization
|
||||||
|
Bison supports two catalogues: one for Bison itself (i.e., for the
|
||||||
|
maintainer-side parser generation), and one for the generated parsers
|
||||||
|
(i.e., for the user-side parser execution). The requirements between
|
||||||
|
both differ: bison needs ngettext, the generated parsers do not. To
|
||||||
|
simplify the build system, neither are installed if ngettext is not
|
||||||
|
supported, even if generated parsers could have been localized. See
|
||||||
|
http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html for
|
||||||
|
more details.
|
||||||
|
|
||||||
|
* Questions
|
||||||
See the section FAQ in the documentation (doc/bison.info) for
|
See the section FAQ in the documentation (doc/bison.info) for
|
||||||
frequently asked questions. The documentation is also available in
|
frequently asked questions. The documentation is also available in
|
||||||
PDF and HTML, provided you have a recent version of Texinfo installed:
|
PDF and HTML, provided you have a recent version of Texinfo installed:
|
||||||
run "make pdf" or "make html".
|
run "make pdf" or "make html".
|
||||||
|
|
||||||
Bison requires GNU m4 1.4.6 or later. See:
|
If you have questions about using Bison and the documentation does
|
||||||
|
not answer them, please send mail to <[email protected]>.
|
||||||
ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
|
|
||||||
|
|
||||||
Bison can work with pre-1.4.6 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.6 as the first step in trying to fix it.
|
|
||||||
|
|
||||||
|
* Bug reports
|
||||||
Please send bug reports to <[email protected]>. Please include the
|
Please send bug reports to <[email protected]>. Please include the
|
||||||
version number from `bison --version', and a complete, self-contained
|
version number from `bison --version', and a complete, self-contained
|
||||||
test case in each bug report.
|
test case in each bug report.
|
||||||
|
|
||||||
If you have questions about using Bison and the documentation does
|
* Copyright statements
|
||||||
not answer them, please send mail to <[email protected]>.
|
For any copyright year range specified as YYYY-ZZZZ in this package,
|
||||||
|
note that the range specifies every single year in that closed interval.
|
||||||
|
|
||||||
|
|
||||||
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
End:
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
|
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2011 Free Software
|
||||||
|
Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ the problems you encounter.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
+49
-21
@@ -158,6 +158,20 @@ Register your changes.
|
|||||||
|
|
||||||
$ git checkin ...
|
$ git checkin ...
|
||||||
|
|
||||||
|
For a suggestion of what gnulib commit might be stable enough for a
|
||||||
|
formal release, see the ChangeLog in the latest gnulib snapshot at:
|
||||||
|
|
||||||
|
http://erislabs.net/ianb/projects/gnulib/
|
||||||
|
|
||||||
|
The autoconf files we use are currently:
|
||||||
|
|
||||||
|
m4/m4.m4
|
||||||
|
lib/m4sugar/m4sugar.m4
|
||||||
|
lib/m4sugar/foreach.m4
|
||||||
|
|
||||||
|
These files don't change very often in autoconf, so it should be
|
||||||
|
relatively straight-forward to examine the differences in order to
|
||||||
|
decide whether to update.
|
||||||
|
|
||||||
* Test suite
|
* Test suite
|
||||||
|
|
||||||
@@ -172,6 +186,9 @@ release:
|
|||||||
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
||||||
cleanly too.
|
cleanly too.
|
||||||
|
|
||||||
|
- Build with -DGNULIB_POSIXCHECK. It suggests gnulib modules that can
|
||||||
|
fix portability issues.
|
||||||
|
|
||||||
- run `make maintainer-check' which:
|
- run `make maintainer-check' which:
|
||||||
- runs `valgrind -q bison' to run Bison under Valgrind.
|
- runs `valgrind -q bison' to run Bison under Valgrind.
|
||||||
- runs the parsers under Valgrind.
|
- runs the parsers under Valgrind.
|
||||||
@@ -197,8 +214,13 @@ release:
|
|||||||
|
|
||||||
* Release Procedure
|
* Release Procedure
|
||||||
|
|
||||||
** Try to get the *.pot files to the Translation Project at least one week
|
** Update the submodules. See above.
|
||||||
before a stable release, to give them time to translate them.
|
|
||||||
|
** Try to get the *.pot files to the Translation Project at least one
|
||||||
|
week before a stable release, to give them time to translate them.
|
||||||
|
Before generating the *.pot files, make sure that po/POTFILES.in and
|
||||||
|
runtime-po/POTFILES.in list all files with translatable strings.
|
||||||
|
This helps: grep -l '\<_(' *
|
||||||
|
|
||||||
** Tests
|
** Tests
|
||||||
See above.
|
See above.
|
||||||
@@ -210,9 +232,17 @@ causes it to be rejected by recent Gettext releases; please report
|
|||||||
these to the Translation Project.
|
these to the Translation Project.
|
||||||
|
|
||||||
** Update README
|
** Update README
|
||||||
Make sure the information in this file is current. Most notably, make sure it
|
Make sure the information in README is current. Most notably, make sure
|
||||||
recommends a version of GNU M4 that is compatible with the latest Bison
|
it recommends a version of GNU M4 that is compatible with the latest
|
||||||
sources.
|
Bison sources.
|
||||||
|
|
||||||
|
** Check copyright years.
|
||||||
|
We update years in copyright statements throughout Bison once at the
|
||||||
|
start of every year by running `make update-copyright'. However, before
|
||||||
|
a release, it's good to verify that it's actually been run. Besides the
|
||||||
|
copyright statement for each Bison file, check the copyright statements
|
||||||
|
that the skeletons insert into generated parsers, and check all
|
||||||
|
occurrences of PACKAGE_COPYRIGHT_YEAR in configure.ac.
|
||||||
|
|
||||||
** Update NEWS
|
** Update NEWS
|
||||||
The version number, *and* the date of the release (including for
|
The version number, *and* the date of the release (including for
|
||||||
@@ -221,9 +251,6 @@ betas).
|
|||||||
** Update ChangeLog
|
** Update ChangeLog
|
||||||
Should have an entry similar to `Version 1.49b.'.
|
Should have an entry similar to `Version 1.49b.'.
|
||||||
|
|
||||||
** Update configure.ac
|
|
||||||
Be sure PACKAGE_COPYRIGHT_YEAR is up-to-date.
|
|
||||||
|
|
||||||
** Tag the release
|
** Tag the release
|
||||||
Before Bison will build with the right version number, you must tag the release
|
Before Bison will build with the right version number, you must tag the release
|
||||||
in git. Do this after all other changes. The command is similar to:
|
in git. Do this after all other changes. The command is similar to:
|
||||||
@@ -329,19 +356,21 @@ To generate a template announcement file:
|
|||||||
|
|
||||||
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
|
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
|
||||||
|
|
||||||
where alpha can be replaced by beta or major and F125BDF3 should be replaced
|
where alpha can be replaced by beta or stable and F125BDF3 should be
|
||||||
with your key ID. For an example of how to fill out the template, search the
|
replaced with your key ID.
|
||||||
mailing list archives for the most recent release announcement.
|
|
||||||
|
|
||||||
Complete/fix the announcement file, and send it at least to
|
Complete/fix the announcement file. The generated list of recipients
|
||||||
[email protected] (if a real release, or a ``serious beta''),
|
([email protected], [email protected], [email protected],
|
||||||
bug-bison@gnu.org, [email protected], [email protected],
|
bison[email protected], and [email protected]) is
|
||||||
and [email protected].
|
appropriate for a stable release or a ``serious beta''. For any other
|
||||||
|
release, drop at least [email protected]. For an example of how to fill
|
||||||
|
out the rest of the template, search the mailing list archives for the
|
||||||
|
most recent release announcement.
|
||||||
|
|
||||||
Send the same announcement on the comp.compilers newsgroup by sending
|
For a stable release, send the same announcement on the comp.compilers
|
||||||
email to [email protected]. Do not make any Cc as the moderator will
|
newsgroup by sending email to [email protected]. Do not make any Cc as
|
||||||
throw away anything cross-posted or Cc'ed. It really needs to be a
|
the moderator will throw away anything cross-posted or Cc'ed. It really
|
||||||
separate message.
|
needs to be a separate message.
|
||||||
|
|
||||||
** Bump the version number
|
** Bump the version number
|
||||||
In configure.ac. Run `make'. So that developers don't accidentally add new
|
In configure.ac. Run `make'. So that developers don't accidentally add new
|
||||||
@@ -354,8 +383,7 @@ Push these changes.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009
|
Copyright (C) 2002-2005, 2007-2011 Free Software Foundation, Inc.
|
||||||
Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
@@ -8,12 +8,15 @@ Alexander Belopolsky [email protected]
|
|||||||
Alexandre Duret-Lutz [email protected]
|
Alexandre Duret-Lutz [email protected]
|
||||||
Andreas Schwab [email protected]
|
Andreas Schwab [email protected]
|
||||||
Andrew Suffield [email protected]
|
Andrew Suffield [email protected]
|
||||||
|
Angelo Borsotti [email protected]
|
||||||
Anthony Heading [email protected]
|
Anthony Heading [email protected]
|
||||||
Arnold Robbins [email protected]
|
Arnold Robbins [email protected]
|
||||||
Art Haas [email protected]
|
Art Haas [email protected]
|
||||||
Baron Schwartz [email protected]
|
Baron Schwartz [email protected]
|
||||||
Benoit Perrot [email protected]
|
Benoit Perrot [email protected]
|
||||||
|
Bernd Kiefer [email protected]
|
||||||
Bert Deknuydt [email protected]
|
Bert Deknuydt [email protected]
|
||||||
|
Bill Allombert [email protected]
|
||||||
Bob Rossi [email protected]
|
Bob Rossi [email protected]
|
||||||
Brandon Lucia [email protected]
|
Brandon Lucia [email protected]
|
||||||
Bruce Lilly [email protected]
|
Bruce Lilly [email protected]
|
||||||
@@ -23,11 +26,13 @@ Christian Burger [email protected]
|
|||||||
Cris Bailiff [email protected]
|
Cris Bailiff [email protected]
|
||||||
Cris van Pelt [email protected]
|
Cris van Pelt [email protected]
|
||||||
Csaba Raduly [email protected]
|
Csaba Raduly [email protected]
|
||||||
|
Dagobert Michelsen [email protected]
|
||||||
Daniel Hagerty [email protected]
|
Daniel Hagerty [email protected]
|
||||||
David J. MacKenzie [email protected]
|
David J. MacKenzie [email protected]
|
||||||
Derek M. Jones [email protected]
|
Derek M. Jones [email protected]
|
||||||
Di-an Jan [email protected]
|
Di-an Jan [email protected]
|
||||||
Dick Streefland [email protected]
|
Dick Streefland [email protected]
|
||||||
|
Didier Godefroy [email protected]
|
||||||
Enrico Scholz [email protected]
|
Enrico Scholz [email protected]
|
||||||
Eric Blake [email protected]
|
Eric Blake [email protected]
|
||||||
Evgeny Stambulchik [email protected]
|
Evgeny Stambulchik [email protected]
|
||||||
@@ -36,26 +41,32 @@ Florian Krohm [email protected]
|
|||||||
Frank Heckenbach [email protected]
|
Frank Heckenbach [email protected]
|
||||||
Frans Englich [email protected]
|
Frans Englich [email protected]
|
||||||
Georg Sauthoff [email protected]
|
Georg Sauthoff [email protected]
|
||||||
|
George Neuner [email protected]
|
||||||
Goran Uddeborg [email protected]
|
Goran Uddeborg [email protected]
|
||||||
Guido Trentalancia [email protected]
|
Guido Trentalancia [email protected]
|
||||||
H. Merijn Brand [email protected]
|
H. Merijn Brand [email protected]
|
||||||
Hans Aberg [email protected]
|
Hans Aberg [email protected]
|
||||||
Jan Nieuwenhuizen [email protected]
|
Jan Nieuwenhuizen [email protected]
|
||||||
|
Jerry Quinn [email protected]
|
||||||
Jesse Thilo [email protected]
|
Jesse Thilo [email protected]
|
||||||
Jim Kent [email protected]
|
Jim Kent [email protected]
|
||||||
Jim Meyering [email protected]
|
Jim Meyering [email protected]
|
||||||
Joel E. Denny jdenny@ces.clemson.edu
|
Joel E. Denny joeldenny@joeldenny.org
|
||||||
|
Johan van Selst [email protected]
|
||||||
|
Jonathan Nieder [email protected]
|
||||||
Juan Manuel Guerrero [email protected]
|
Juan Manuel Guerrero [email protected]
|
||||||
Kees Zeelenberg [email protected]
|
Kees Zeelenberg [email protected]
|
||||||
Keith Browne [email protected]
|
Keith Browne [email protected]
|
||||||
Laurent Mascherpa [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
Magnus Fromreide [email protected]
|
Magnus Fromreide [email protected]
|
||||||
Marc Autret [email protected]
|
Marc Autret [email protected]
|
||||||
|
Martin Jacobs [email protected]
|
||||||
Martin Mokrejs [email protected]
|
Martin Mokrejs [email protected]
|
||||||
Martin Nylin [email protected]
|
Martin Nylin [email protected]
|
||||||
Matt Kraai [email protected]
|
Matt Kraai [email protected]
|
||||||
Matt Rosing [email protected]
|
Matt Rosing [email protected]
|
||||||
Michael Hayes [email protected]
|
Michael Hayes [email protected]
|
||||||
|
Michael Raskin [email protected]
|
||||||
Mickael Labau [email protected]
|
Mickael Labau [email protected]
|
||||||
Mike Castle [email protected]
|
Mike Castle [email protected]
|
||||||
Neil Booth [email protected]
|
Neil Booth [email protected]
|
||||||
@@ -63,6 +74,7 @@ Nelson H. F. Beebe [email protected]
|
|||||||
Nicolas Burrus [email protected]
|
Nicolas Burrus [email protected]
|
||||||
Nicolas Tisserand [email protected]
|
Nicolas Tisserand [email protected]
|
||||||
Noah Friedman [email protected]
|
Noah Friedman [email protected]
|
||||||
|
Odd Arild Olsen [email protected]
|
||||||
Oleg Smolsky [email protected]
|
Oleg Smolsky [email protected]
|
||||||
Paolo Bonzini [email protected]
|
Paolo Bonzini [email protected]
|
||||||
Pascal Bart [email protected]
|
Pascal Bart [email protected]
|
||||||
@@ -91,7 +103,7 @@ Tom Lane [email protected]
|
|||||||
Tom Tromey [email protected]
|
Tom Tromey [email protected]
|
||||||
Tommy Nordgren [email protected]
|
Tommy Nordgren [email protected]
|
||||||
Troy A. Johnson [email protected]
|
Troy A. Johnson [email protected]
|
||||||
Tys Lefering twlevo@xs4all.nl
|
Tys Lefering twlevo@gmail.com
|
||||||
Vin Shelton [email protected]
|
Vin Shelton [email protected]
|
||||||
Wayne Green [email protected]
|
Wayne Green [email protected]
|
||||||
Wolfram Wagner [email protected]
|
Wolfram Wagner [email protected]
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ parser") refers to the current `output' format.
|
|||||||
** vector
|
** vector
|
||||||
Move to using vector, drop stack.hh.
|
Move to using vector, drop stack.hh.
|
||||||
|
|
||||||
** I18n
|
|
||||||
Catch up with yacc.c.
|
|
||||||
|
|
||||||
* Report
|
* Report
|
||||||
|
|
||||||
** GLR
|
** GLR
|
||||||
@@ -290,8 +287,7 @@ Equip the parser with a means to create the (visual) parse tree.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
|
Copyright (C) 2001-2004, 2006, 2008-2011 Free Software Foundation, Inc.
|
||||||
Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+25
-16
@@ -1,6 +1,6 @@
|
|||||||
# Bootstrap configuration.
|
# Bootstrap configuration.
|
||||||
|
|
||||||
# Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
# Copyright (C) 2006-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,12 +17,17 @@
|
|||||||
|
|
||||||
# gnulib modules used by this package.
|
# gnulib modules used by this package.
|
||||||
gnulib_modules='
|
gnulib_modules='
|
||||||
announce-gen argmatch config-h c-strcase configmake dirname error
|
announce-gen argmatch assert calloc-posix close config-h c-strcase
|
||||||
extensions fopen-safer gendocs getopt gettext git-version-gen
|
configmake dirname error extensions fopen-safer gendocs getopt-gnu
|
||||||
gnumakefile hash inttypes javacomp-script javaexec-script malloc
|
gettext git-version-gen hash inttypes isnan javacomp-script
|
||||||
mbswidth obstack quote quotearg stdbool stpcpy strerror strtoul
|
javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr
|
||||||
strverscmp unistd unistd-safer unlocked-io unsetenv verify warnings
|
mbswidth obstack perror pipe-posix quote quotearg realloc-posix
|
||||||
xalloc xalloc-die xstrndup
|
spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
|
||||||
|
unistd unistd-safer unlocked-io update-copyright unsetenv verify
|
||||||
|
warnings xalloc xalloc-die xstrndup
|
||||||
|
|
||||||
|
fprintf-posix printf-posix snprintf-posix sprintf-posix
|
||||||
|
vsnprintf-posix vsprintf-posix
|
||||||
'
|
'
|
||||||
|
|
||||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||||
@@ -41,26 +46,30 @@ XGETTEXT_OPTIONS_RUNTIME=$XGETTEXT_OPTIONS'\\\
|
|||||||
# Gettext supplies these files, but we don't need them since
|
# Gettext supplies these files, but we don't need them since
|
||||||
# we don't have an intl subdirectory.
|
# we don't have an intl subdirectory.
|
||||||
excluded_files='
|
excluded_files='
|
||||||
m4/codeset.m4
|
|
||||||
m4/glibc2.m4
|
m4/glibc2.m4
|
||||||
m4/glibc21.m4
|
|
||||||
m4/intdiv0.m4
|
m4/intdiv0.m4
|
||||||
m4/intl.m4
|
m4/intl.m4
|
||||||
m4/intldir.m4
|
m4/intldir.m4
|
||||||
m4/intmax.m4
|
m4/intmax.m4
|
||||||
m4/inttypes_h.m4
|
|
||||||
m4/lcmessage.m4
|
m4/lcmessage.m4
|
||||||
m4/lock.m4
|
m4/lock.m4
|
||||||
m4/longdouble.m4
|
m4/longdouble.m4
|
||||||
m4/printf-posix.m4
|
|
||||||
m4/signed.m4
|
m4/signed.m4
|
||||||
m4/size_max.m4
|
|
||||||
m4/uintmax_t.m4
|
m4/uintmax_t.m4
|
||||||
m4/ulonglong.m4
|
m4/ulonglong.m4
|
||||||
m4/visibility.m4
|
m4/visibility.m4
|
||||||
m4/xsize.m4
|
|
||||||
'
|
'
|
||||||
|
|
||||||
# In directories like lib/, m4/, and po/, generate both these files because we
|
bootstrap_epilogue()
|
||||||
# still try to support CVS emulation.
|
{
|
||||||
vc_ignore='.cvsignore .gitignore'
|
# Make sure we don't need src/bison, which usually doesn't exist at
|
||||||
|
# the time of a bootstrap.
|
||||||
|
touch src/parse-gram.[ch]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keep our bootstrap script in sync with gnulib's. If we ever need to
|
||||||
|
# maintain our own bootstrap script again, set this to false, remove
|
||||||
|
# the bootstrap entry from the file .x-update-copyright, and add any
|
||||||
|
# needed copyright years to the copyright statement in the bootstrap
|
||||||
|
# script.
|
||||||
|
bootstrap_sync=true
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
announce-gen
|
|
||||||
compile
|
|
||||||
config.guess
|
|
||||||
config.rpath
|
|
||||||
config.sub
|
|
||||||
depcomp
|
|
||||||
gendocs.sh
|
|
||||||
git-version-gen
|
|
||||||
install-sh
|
|
||||||
javacomp.sh.in
|
|
||||||
javaexec.sh.in
|
|
||||||
link-warning.h
|
|
||||||
mdate-sh
|
|
||||||
missing
|
|
||||||
texinfo.tex
|
|
||||||
ylwrap
|
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
|
|
||||||
/Makefile
|
/Makefile
|
||||||
/Makefile.in
|
/Makefile.in
|
||||||
/announce-gen
|
/announce-gen
|
||||||
|
/arg-nonnull.h
|
||||||
|
/c++defs.h
|
||||||
/compile
|
/compile
|
||||||
/config.guess
|
/config.guess
|
||||||
/config.rpath
|
/config.rpath
|
||||||
@@ -15,4 +18,9 @@
|
|||||||
/mdate-sh
|
/mdate-sh
|
||||||
/missing
|
/missing
|
||||||
/texinfo.tex
|
/texinfo.tex
|
||||||
|
/update-copyright
|
||||||
|
/useless-if-before-free
|
||||||
|
/vc-list-files
|
||||||
|
/warn-on-use.h
|
||||||
/ylwrap
|
/ylwrap
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
EXTRA_DIST = prev-version.txt cross-options.pl
|
EXTRA_DIST = prev-version.txt cross-options.pl update-b4-copyright
|
||||||
|
|||||||
+38
-10
@@ -5,7 +5,10 @@ use 5.005;
|
|||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
my %option;
|
my %option;
|
||||||
while (<>)
|
my %directive;
|
||||||
|
my $scanner = `grep -i '"%[a-z]' $ARGV[0]`;
|
||||||
|
$scanner =~ s/"\[-_\]"/-/g;
|
||||||
|
while (<STDIN>)
|
||||||
{
|
{
|
||||||
if (/^\s* # Initial spaces.
|
if (/^\s* # Initial spaces.
|
||||||
(?:(-\w),\s+)? # $1: $short: Possible short option.
|
(?:(-\w),\s+)? # $1: $short: Possible short option.
|
||||||
@@ -16,7 +19,14 @@ while (<>)
|
|||||||
/x)
|
/x)
|
||||||
{
|
{
|
||||||
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
|
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
|
||||||
$short = defined $short ? '@option{' . $short . '}' : '';
|
$short = '' if ! defined $short;
|
||||||
|
$short = '-d' if $long eq '--defines' && ! $short;
|
||||||
|
my $dir = '%' . substr($long, 2);
|
||||||
|
if (index ($scanner, "\"$dir\"") < 0)
|
||||||
|
{
|
||||||
|
if ($long eq '--force-define') { $dir = '%define'; }
|
||||||
|
else { $dir = ''; }
|
||||||
|
}
|
||||||
if ($arg)
|
if ($arg)
|
||||||
{
|
{
|
||||||
# if $opt, $arg contains the closing ].
|
# if $opt, $arg contains the closing ].
|
||||||
@@ -24,6 +34,7 @@ while (<>)
|
|||||||
if $opt eq '[';
|
if $opt eq '[';
|
||||||
$arg =~ s/^=//;
|
$arg =~ s/^=//;
|
||||||
$arg = lc ($arg);
|
$arg = lc ($arg);
|
||||||
|
my $dir_arg = $arg;
|
||||||
# If the argument is compite (e.g., for --define[=NAME[=VALUE]]),
|
# If the argument is compite (e.g., for --define[=NAME[=VALUE]]),
|
||||||
# put each word in @var, to build @var{name}[=@var{value}], not
|
# put each word in @var, to build @var{name}[=@var{value}], not
|
||||||
# @var{name[=value]}].
|
# @var{name[=value]}].
|
||||||
@@ -33,19 +44,36 @@ while (<>)
|
|||||||
$long_arg = "[$long_arg]";
|
$long_arg = "[$long_arg]";
|
||||||
$arg = "[$arg]";
|
$arg = "[$arg]";
|
||||||
}
|
}
|
||||||
$option{"$long$long_arg"} = $short ? "$short $arg" : '';
|
# For arguments of directives: this only works if all arguments
|
||||||
}
|
# are strings and have the same syntax as on the command line.
|
||||||
else
|
if ($dir_arg eq 'name[=value]')
|
||||||
{
|
{
|
||||||
$option{"$long"} = "$short";
|
$dir_arg = '@var{name} ["@var{value}"]';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$dir_arg =~ s/(\w+)/\@var{"$1"}/g;
|
||||||
|
$dir_arg = '[' . $dir_arg . ']'
|
||||||
|
if $opt eq '[';
|
||||||
|
}
|
||||||
|
$long = "$long$long_arg";
|
||||||
|
$short = "$short $arg" if $short && $short ne '-d';
|
||||||
|
$dir = "$dir $dir_arg" if $dir;
|
||||||
}
|
}
|
||||||
|
$option{$long} = $short;
|
||||||
|
$directive{$long} = $dir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $sep = '';
|
||||||
foreach my $long (sort keys %option)
|
foreach my $long (sort keys %option)
|
||||||
{
|
{
|
||||||
# Avoid trailing spaces.
|
# Avoid trailing spaces.
|
||||||
printf ("\@item %-40s \@tab%s\n",
|
print $sep;
|
||||||
'@option{' . $long . '}',
|
$sep = "\n";
|
||||||
$option{$long} ? " $option{$long}" : "");
|
print '@item @option{', $long, "}\n\@tab";
|
||||||
|
print ' @option{', $option{$long}, '}' if $option{$long};
|
||||||
|
print "\n\@tab";
|
||||||
|
print ' @code{', $directive{$long}, '}' if $directive{$long};
|
||||||
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Executable
+152
@@ -0,0 +1,152 @@
|
|||||||
|
#!/usr/bin/perl -0777 -pi
|
||||||
|
|
||||||
|
# Update b4_copyright invocations or b4_copyright_years definitions to
|
||||||
|
# include the current year.
|
||||||
|
|
||||||
|
# Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 3, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my $margin = 72;
|
||||||
|
|
||||||
|
my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
|
||||||
|
if (!$this_year || $this_year !~ m/^\d{4}$/)
|
||||||
|
{
|
||||||
|
my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
|
||||||
|
$this_year = $year + 1900;
|
||||||
|
}
|
||||||
|
my $old_re = <<'EOF'
|
||||||
|
(
|
||||||
|
(?:^|\n)
|
||||||
|
#BEFORE
|
||||||
|
(?:
|
||||||
|
b4_copyright\(\[[^][]*]
|
||||||
|
| m4_(?:push|pop)def\(\[b4_copyright_years]
|
||||||
|
)
|
||||||
|
#AFTER
|
||||||
|
)
|
||||||
|
(?:
|
||||||
|
,\s*
|
||||||
|
(
|
||||||
|
\[\s* (?:\d{4}(?:,\s*|-))* (\d{4}) \s*]
|
||||||
|
)
|
||||||
|
)?
|
||||||
|
\)
|
||||||
|
EOF
|
||||||
|
;
|
||||||
|
|
||||||
|
while (/($old_re)/gx)
|
||||||
|
{
|
||||||
|
my $start = pos() - length ($1);
|
||||||
|
my $b4_copyright_line = $2;
|
||||||
|
my $year_lines = $3;
|
||||||
|
my $final_year = $4;
|
||||||
|
$year_lines .= ')';
|
||||||
|
|
||||||
|
# If there was a second argument, it contains years, so update them.
|
||||||
|
if ($final_year)
|
||||||
|
{
|
||||||
|
$b4_copyright_line .= ',';
|
||||||
|
if ($final_year != $this_year)
|
||||||
|
{
|
||||||
|
# Update the year.
|
||||||
|
$year_lines =~ s/$final_year/$final_year, $this_year/;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Normalize all whitespace.
|
||||||
|
$year_lines =~ s/\s+/ /g;
|
||||||
|
|
||||||
|
# Put spaces after commas.
|
||||||
|
$year_lines =~ s/, ?/, /g;
|
||||||
|
|
||||||
|
# Compress to intervals.
|
||||||
|
$year_lines =~
|
||||||
|
s/
|
||||||
|
(\d{4})
|
||||||
|
(?:
|
||||||
|
(,\ |-)
|
||||||
|
((??{
|
||||||
|
if ($2 eq '-') { '\d{4}'; }
|
||||||
|
elsif (!$3) { $1 + 1; }
|
||||||
|
else { $3 + 1; }
|
||||||
|
}))
|
||||||
|
)+
|
||||||
|
/$1-$3/gx;
|
||||||
|
|
||||||
|
# Format within margin.
|
||||||
|
my $year_lines_new;
|
||||||
|
my $indent = index ($b4_copyright_line, '[');
|
||||||
|
--$indent if ($b4_copyright_line =~ m/^\n/);
|
||||||
|
while (length $year_lines)
|
||||||
|
{
|
||||||
|
my $text_margin = $margin - $indent;
|
||||||
|
if (($year_lines =~ s/^(.{1,$text_margin})(?: |$)//)
|
||||||
|
|| ($year_lines =~ s/^([\S]+)(?: |$)//))
|
||||||
|
{
|
||||||
|
my $line = "\n" . (' 'x$indent) . $1;
|
||||||
|
++$indent if (!$year_lines_new);
|
||||||
|
$year_lines_new .= $line;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
# Should be unreachable, but we don't want an infinite
|
||||||
|
# loop if it can be reached.
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Replace the old invocation. Should never die.
|
||||||
|
die if (!s/$old_re\G/$b4_copyright_line$year_lines_new/x);
|
||||||
|
|
||||||
|
# Prepare for the next search.
|
||||||
|
pos () = $start + length ("$b4_copyright_line$year_lines_new");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (/(\bb4_copyright\()/g)
|
||||||
|
{
|
||||||
|
my $start = pos () - length ($1);
|
||||||
|
my $end = pos ();
|
||||||
|
my $re = $old_re;
|
||||||
|
pos () = $start;
|
||||||
|
$re =~ s/\#BEFORE/\\G/;
|
||||||
|
if (!/$re/x)
|
||||||
|
{
|
||||||
|
my $line = (substr ($_, 0, $start) =~ s/\n/\n/g) + 1;
|
||||||
|
print STDERR
|
||||||
|
"$ARGV:$line: warning: failed to update a b4_copyright\n";
|
||||||
|
}
|
||||||
|
pos () = $end;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (/(\[b4_copyright_years])/g)
|
||||||
|
{
|
||||||
|
my $start = pos () - length ($1);
|
||||||
|
my $end = pos ();
|
||||||
|
my $re = $old_re;
|
||||||
|
$re =~ s/\#AFTER/\\G/;
|
||||||
|
if (!/$re/x)
|
||||||
|
{
|
||||||
|
# The substr operation blows away pos (), so restoring pos ()
|
||||||
|
# at the end is necessary.
|
||||||
|
my $line = (substr ($_, 0, $start) =~ s/\n/\n/g) + 1;
|
||||||
|
print STDERR
|
||||||
|
"$ARGV:$line: warning: failed to update a"
|
||||||
|
. " b4_copyright_years\n";
|
||||||
|
}
|
||||||
|
pos () = $end;
|
||||||
|
}
|
||||||
Executable
+49
@@ -0,0 +1,49 @@
|
|||||||
|
#!/usr/bin/perl -0777 -pi
|
||||||
|
|
||||||
|
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
||||||
|
|
||||||
|
# Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 3, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
|
||||||
|
if (!$this_year || $this_year !~ m/^\d{4}$/)
|
||||||
|
{
|
||||||
|
my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
|
||||||
|
$this_year = $year + 1900;
|
||||||
|
}
|
||||||
|
my $old_re = <<'EOF'
|
||||||
|
(
|
||||||
|
MACRO\(
|
||||||
|
\[PACKAGE_COPYRIGHT_YEAR],
|
||||||
|
\s*\[
|
||||||
|
)
|
||||||
|
(\d{4})
|
||||||
|
(?=])
|
||||||
|
EOF
|
||||||
|
;
|
||||||
|
foreach my $macro ("AC_DEFINE", "AC_SUBST")
|
||||||
|
{
|
||||||
|
my $this_old_re = $old_re;
|
||||||
|
$this_old_re =~ s/MACRO/$macro/;
|
||||||
|
if (!s/$this_old_re/$1$this_year/x)
|
||||||
|
{
|
||||||
|
print STDERR
|
||||||
|
"$ARGV: warning: failed to update PACKAGE_COPYRIGHT_YEAR in"
|
||||||
|
. " $macro.\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
# Customize maint.mk -*- makefile -*-
|
# Customize maint.mk -*- makefile -*-
|
||||||
# Copyright (C) 2008 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 2008-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -39,4 +40,14 @@ local-checks-to-skip = changelog-check
|
|||||||
|
|
||||||
# The local directory containing the checked-out copy of gnulib used in
|
# The local directory containing the checked-out copy of gnulib used in
|
||||||
# this release. Used solely to get a date for the "announcement" target.
|
# this release. Used solely to get a date for the "announcement" target.
|
||||||
gnulib_dir = $(srcdir)/../../gnulib
|
gnulib_dir = $(srcdir)/gnulib
|
||||||
|
|
||||||
|
bootstrap-tools = autoconf,automake,flex,gettext,gnulib
|
||||||
|
|
||||||
|
announcement_Cc_ = \
|
||||||
|
[email protected], [email protected], [email protected], \
|
||||||
|
[email protected]
|
||||||
|
|
||||||
|
update-copyright: update-b4-copyright update-package-copyright-year
|
||||||
|
update-copyright-env = \
|
||||||
|
UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
|
||||||
|
|||||||
+34
-16
@@ -1,7 +1,6 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
# Copyright (C) 2001-2011 Free Software Foundation, Inc.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,25 +15,36 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# We have strange test case titles, so we need Autoconf 2.61 or better.
|
# In order for some versions of Sun Studio to compile our C++ test cases
|
||||||
AC_PREREQ(2.61)
|
# correctly, we need Autoconf 2.64 or better to handle the restrict
|
||||||
|
# keyword in at least string.h from gnulib.
|
||||||
|
AC_PREREQ(2.64)
|
||||||
|
|
||||||
AC_INIT([GNU Bison],
|
AC_INIT([GNU Bison],
|
||||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||||
[[email protected]])
|
[[email protected]])
|
||||||
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2008],
|
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2011],
|
||||||
[The copyright year for this package])
|
[The copyright year for this package])
|
||||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2008])
|
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2011])
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here:
|
||||||
# We want gnits strictness only when rolling a formal release so that we can,
|
#
|
||||||
# for example, run make dist at other times without being required to add a
|
# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131
|
||||||
# bogus NEWS entry.
|
#
|
||||||
AM_INIT_AUTOMAKE([1.8 dist-bzip2]
|
# To avoid 1.11, we make 1.11.1 the minimum version.
|
||||||
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [-], [gnu], [gnits]))
|
#
|
||||||
|
# We want gnits strictness only when rolling a stable release. For
|
||||||
|
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
||||||
|
# doesn't like that, so we let the underscore disable gnits. Between
|
||||||
|
# releases, we want to be able run make dist without being required to
|
||||||
|
# add a bogus NEWS entry. In that case, the version string
|
||||||
|
# automatically contains a dash, which we also let disable gnits.
|
||||||
|
AM_INIT_AUTOMAKE([1.11.1 dist-bzip2]
|
||||||
|
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
||||||
|
[gnu], [gnits]))
|
||||||
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
||||||
|
|
||||||
# Checks for the compiler.
|
# Checks for the compiler.
|
||||||
@@ -68,7 +78,12 @@ if test "${enableval}" = yes; then
|
|||||||
gl_WARN_ADD([-Wshadow])
|
gl_WARN_ADD([-Wshadow])
|
||||||
gl_WARN_ADD([-Wstrict-prototypes])
|
gl_WARN_ADD([-Wstrict-prototypes])
|
||||||
AC_SUBST([WARN_CFLAGS])
|
AC_SUBST([WARN_CFLAGS])
|
||||||
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
# Warnings for the test suite only.
|
||||||
|
gl_WARN_ADD([-Wundef], [WARN_CFLAGS_TEST])
|
||||||
|
WARN_CXXFLAGS_TEST="$WARN_CXXFLAGS $WARN_CFLAGS_TEST"
|
||||||
|
WARN_CFLAGS_TEST="$WARN_CFLAGS $WARN_CFLAGS_TEST"
|
||||||
|
AC_SUBST([WARN_CXXFLAGS_TEST])
|
||||||
|
AC_SUBST([WARN_CFLAGS_TEST])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BISON_TEST_FOR_WORKING_C_COMPILER
|
BISON_TEST_FOR_WORKING_C_COMPILER
|
||||||
@@ -94,6 +109,8 @@ AC_PROG_YACC
|
|||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
AC_PROG_GNU_M4
|
AC_PROG_GNU_M4
|
||||||
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
||||||
|
AC_DEFINE_UNQUOTED([M4_GNU_OPTION], ["$M4_GNU"], [Define to "-g" if GNU M4
|
||||||
|
supports -g, otherwise to "".])
|
||||||
AM_MISSING_PROG([HELP2MAN], [help2man])
|
AM_MISSING_PROG([HELP2MAN], [help2man])
|
||||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||||
AC_SUBST([XSLTPROC])
|
AC_SUBST([XSLTPROC])
|
||||||
@@ -115,9 +132,10 @@ BISON_PREREQ_SUBPIPE
|
|||||||
BISON_PREREQ_TIMEVAR
|
BISON_PREREQ_TIMEVAR
|
||||||
|
|
||||||
# Gettext.
|
# Gettext.
|
||||||
# We've never tested with gettext versions before 0.15, so play it safe.
|
# We use gnulib, which is only guaranteed to work properly with the
|
||||||
AM_GNU_GETTEXT([external], [need-formatstring-macros])
|
# latest Gettext.
|
||||||
AM_GNU_GETTEXT_VERSION([0.15])
|
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||||
|
AM_GNU_GETTEXT_VERSION([0.18])
|
||||||
BISON_I18N
|
BISON_I18N
|
||||||
|
|
||||||
# Internationalized parsers.
|
# Internationalized parsers.
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
## Copyright (C) 2002, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
## Copyright (C) 2002, 2005-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ into various formats.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2008 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2008-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
+46
-23
@@ -1,8 +1,8 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# Language-independent M4 Macros for Bison.
|
# Language-independent M4 Macros for Bison.
|
||||||
# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
|
|
||||||
# Foundation, Inc.
|
# Copyright (C) 2002, 2004-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -312,13 +312,13 @@ b4_define_user_code([stype])
|
|||||||
|
|
||||||
|
|
||||||
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
|
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
|
||||||
# --------------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Warn if any name of type WHAT is used by the user (as recorded in USER-LIST)
|
# Complain if any name of type WHAT is used by the user (as recorded in
|
||||||
# but is not used by Bison (as recorded by macros in the namespace
|
# USER-LIST) but is not used by Bison (as recorded by macros in the
|
||||||
# BISON-NAMESPACE).
|
# namespace BISON-NAMESPACE).
|
||||||
#
|
#
|
||||||
# USER-LIST must expand to a list specifying all grammar occurrences of all
|
# USER-LIST must expand to a list specifying all user occurrences of all names
|
||||||
# names of type WHAT. Each item in the list must be a triplet specifying one
|
# of type WHAT. Each item in the list must be a triplet specifying one
|
||||||
# occurrence: name, start boundary, and end boundary. Empty string names are
|
# occurrence: name, start boundary, and end boundary. Empty string names are
|
||||||
# fine. An empty list is fine.
|
# fine. An empty list is fine.
|
||||||
#
|
#
|
||||||
@@ -353,19 +353,35 @@ m4_pushdef([b4_user_name], m4_car(b4_occurrence))dnl
|
|||||||
m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl
|
m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl
|
||||||
m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl
|
m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl
|
||||||
m4_ifndef($3[(]m4_quote(b4_user_name)[)],
|
m4_ifndef($3[(]m4_quote(b4_user_name)[)],
|
||||||
[b4_warn_at([b4_start], [b4_end],
|
[b4_complain_at([b4_start], [b4_end],
|
||||||
[[%s `%s' is not used]],
|
[[%s `%s' is not used]],
|
||||||
[$1], [b4_user_name])])[]dnl
|
[$1], [b4_user_name])])[]dnl
|
||||||
m4_popdef([b4_occurrence])dnl
|
m4_popdef([b4_occurrence])dnl
|
||||||
m4_popdef([b4_user_name])dnl
|
m4_popdef([b4_user_name])dnl
|
||||||
m4_popdef([b4_start])dnl
|
m4_popdef([b4_start])dnl
|
||||||
m4_popdef([b4_end])dnl
|
m4_popdef([b4_end])dnl
|
||||||
])])
|
])])
|
||||||
|
|
||||||
# b4_percent_define_get(VARIABLE)
|
|
||||||
|
|
||||||
|
|
||||||
|
## --------------------- ##
|
||||||
|
## b4_percent_define_*. ##
|
||||||
|
## --------------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
# b4_percent_define_use(VARIABLE)
|
||||||
# -------------------------------
|
# -------------------------------
|
||||||
# Mimic muscle_percent_define_get in ../src/muscle_tab.h exactly. That is, if
|
# Declare that VARIABLE was used.
|
||||||
# the %define variable VARIABLE is defined, emit its value. Also, record
|
m4_define([b4_percent_define_use],
|
||||||
|
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
# b4_percent_define_get(VARIABLE, [DEFAULT])
|
||||||
|
# ------------------------------------------
|
||||||
|
# Mimic muscle_percent_define_get in ../src/muscle-tab.h. That is, if
|
||||||
|
# the %define variable VARIABLE is defined, emit its value. Contrary
|
||||||
|
# to its C counterpart, return DEFAULT otherwise. Also, record
|
||||||
# Bison's usage of VARIABLE by defining
|
# Bison's usage of VARIABLE by defining
|
||||||
# b4_percent_define_bison_variables(VARIABLE).
|
# b4_percent_define_bison_variables(VARIABLE).
|
||||||
#
|
#
|
||||||
@@ -373,12 +389,15 @@ m4_popdef([b4_end])dnl
|
|||||||
#
|
#
|
||||||
# b4_percent_define_get([[foo]])
|
# b4_percent_define_get([[foo]])
|
||||||
m4_define([b4_percent_define_get],
|
m4_define([b4_percent_define_get],
|
||||||
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
|
[b4_percent_define_use([$1])dnl
|
||||||
m4_ifdef([b4_percent_define(]$1[)], [m4_indir([b4_percent_define(]$1[)])])])
|
m4_ifdef([b4_percent_define(]$1[)],
|
||||||
|
[m4_indir([b4_percent_define(]$1[)])],
|
||||||
|
[$2])])
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_get_loc(VARIABLE)
|
# b4_percent_define_get_loc(VARIABLE)
|
||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
# Mimic muscle_percent_define_get_loc in ../src/muscle_tab.h exactly. That is,
|
# Mimic muscle_percent_define_get_loc in ../src/muscle-tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is undefined, complain fatally since that's
|
# if the %define variable VARIABLE is undefined, complain fatally since that's
|
||||||
# a Bison or skeleton error. Otherwise, return its definition location in a
|
# a Bison or skeleton error. Otherwise, return its definition location in a
|
||||||
# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or
|
# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or
|
||||||
@@ -397,7 +416,7 @@ m4_popdef([b4_loc])],
|
|||||||
|
|
||||||
# b4_percent_define_get_syncline(VARIABLE)
|
# b4_percent_define_get_syncline(VARIABLE)
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
# Mimic muscle_percent_define_get_syncline in ../src/muscle_tab.h exactly.
|
# Mimic muscle_percent_define_get_syncline in ../src/muscle-tab.h exactly.
|
||||||
# That is, if the %define variable VARIABLE is undefined, complain fatally
|
# That is, if the %define variable VARIABLE is undefined, complain fatally
|
||||||
# since that's a Bison or skeleton error. Otherwise, return its definition
|
# since that's a Bison or skeleton error. Otherwise, return its definition
|
||||||
# location as a b4_syncline invocation. Don't record this as a Bison usage of
|
# location as a b4_syncline invocation. Don't record this as a Bison usage of
|
||||||
@@ -414,7 +433,7 @@ m4_define([b4_percent_define_get_syncline],
|
|||||||
|
|
||||||
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
|
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
# Mimic muscle_percent_define_ifdef in ../src/muscle_tab.h exactly. That is,
|
# Mimic muscle_percent_define_ifdef in ../src/muscle-tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is defined, expand IF-TRUE, else expand
|
# if the %define variable VARIABLE is defined, expand IF-TRUE, else expand
|
||||||
# IF-FALSE. Also, record Bison's usage of VARIABLE by defining
|
# IF-FALSE. Also, record Bison's usage of VARIABLE by defining
|
||||||
# b4_percent_define_bison_variables(VARIABLE).
|
# b4_percent_define_bison_variables(VARIABLE).
|
||||||
@@ -429,7 +448,7 @@ m4_define([b4_percent_define_ifdef],
|
|||||||
|
|
||||||
# b4_percent_define_flag_if(VARIABLE, IF-TRUE, [IF-FALSE])
|
# b4_percent_define_flag_if(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
# Mimic muscle_percent_define_flag_if in ../src/muscle_tab.h exactly. That is,
|
# Mimic muscle_percent_define_flag_if in ../src/muscle-tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is defined to "" or "true", expand IF-TRUE.
|
# if the %define variable VARIABLE is defined to "" or "true", expand IF-TRUE.
|
||||||
# If it is defined to "false", expand IF-FALSE. Complain if it is undefined
|
# If it is defined to "false", expand IF-FALSE. Complain if it is undefined
|
||||||
# (a Bison or skeleton error since the default value should have been set
|
# (a Bison or skeleton error since the default value should have been set
|
||||||
@@ -452,7 +471,7 @@ m4_define([b4_percent_define_flag_if],
|
|||||||
|
|
||||||
# b4_percent_define_default(VARIABLE, DEFAULT)
|
# b4_percent_define_default(VARIABLE, DEFAULT)
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
# Mimic muscle_percent_define_default in ../src/muscle_tab.h exactly. That is,
|
# Mimic muscle_percent_define_default in ../src/muscle-tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is undefined, set its value to DEFAULT.
|
# if the %define variable VARIABLE is undefined, set its value to DEFAULT.
|
||||||
# Don't record this as a Bison usage of VARIABLE as there's no reason to
|
# Don't record this as a Bison usage of VARIABLE as there's no reason to
|
||||||
# suspect that the value has yet influenced the output.
|
# suspect that the value has yet influenced the output.
|
||||||
@@ -470,7 +489,7 @@ m4_define([b4_percent_define_default],
|
|||||||
|
|
||||||
# b4_percent_define_check_values(VALUES)
|
# b4_percent_define_check_values(VALUES)
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
# Mimic muscle_percent_define_check_values in ../src/muscle_tab.h exactly
|
# Mimic muscle_percent_define_check_values in ../src/muscle-tab.h exactly
|
||||||
# except that the VALUES structure is more appropriate for M4. That is, VALUES
|
# except that the VALUES structure is more appropriate for M4. That is, VALUES
|
||||||
# is a list of sublists of strings. For each sublist, the first string is the
|
# is a list of sublists of strings. For each sublist, the first string is the
|
||||||
# name of a %define variable, and all remaining strings in that sublist are the
|
# name of a %define variable, and all remaining strings in that sublist are the
|
||||||
@@ -499,7 +518,11 @@ m4_define([_b4_percent_define_check_values],
|
|||||||
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||||
[[invalid value for %%define variable `%s': `%s']],
|
[[invalid value for %%define variable `%s': `%s']],
|
||||||
[$1],
|
[$1],
|
||||||
m4_dquote(m4_indir([b4_percent_define(]$1[)])))])dnl
|
m4_dquote(m4_indir([b4_percent_define(]$1[)])))
|
||||||
|
m4_foreach([b4_value], m4_dquote(m4_shift($@)),
|
||||||
|
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||||
|
[[accepted value: `%s']],
|
||||||
|
m4_dquote(b4_value))])])dnl
|
||||||
m4_popdef([b4_good_value])],
|
m4_popdef([b4_good_value])],
|
||||||
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_check_values]], [$1])])])
|
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_check_values]], [$1])])])
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C++ skeleton dispatching for Bison.
|
# C++ skeleton dispatching for Bison.
|
||||||
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+10
-6
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
|
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||||
# Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,7 +25,12 @@ m4_include(b4_pkgdatadir/[c.m4])
|
|||||||
|
|
||||||
# Default parser class name.
|
# Default parser class name.
|
||||||
b4_percent_define_default([[parser_class_name]], [[parser]])
|
b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||||
b4_percent_define_default([[location_type]], [[location]])
|
|
||||||
|
# Don't do that so that we remember whether we're using a user
|
||||||
|
# request, or the default value.
|
||||||
|
#
|
||||||
|
# b4_percent_define_default([[location_type]], [[location]])
|
||||||
|
|
||||||
b4_percent_define_default([[filename_type]], [[std::string]])
|
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||||
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
|
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
|
||||||
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
||||||
@@ -74,10 +78,10 @@ m4_define([b4_namespace_open],
|
|||||||
|
|
||||||
m4_define([b4_namespace_close],
|
m4_define([b4_namespace_close],
|
||||||
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
||||||
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]),
|
||||||
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^][:]\)*],
|
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*],
|
||||||
[\1])),
|
[\1])),
|
||||||
[::\([^][:]\|:[^][:]\)*], [} ])[} // ]b4_namespace_ref])])
|
[::\([^][:]\|:[^:]\)*], [} ])[} // ]b4_namespace_ref])])
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C skeleton dispatching for Bison.
|
# C skeleton dispatching for Bison.
|
||||||
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C M4 Macros for Bison.
|
# C M4 Macros for Bison.
|
||||||
# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008 Free Software
|
|
||||||
# Foundation, Inc.
|
# Copyright (C) 2002, 2004-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -31,7 +31,7 @@ m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
|||||||
# -----------------
|
# -----------------
|
||||||
# Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or
|
# Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or
|
||||||
# b4_pull_flag if they use the values of the %define variables api.pure or
|
# b4_pull_flag if they use the values of the %define variables api.pure or
|
||||||
# api.push_pull.
|
# api.push-pull.
|
||||||
m4_define([b4_identification],
|
m4_define([b4_identification],
|
||||||
[[/* Identify Bison output. */
|
[[/* Identify Bison output. */
|
||||||
#define YYBISON 1
|
#define YYBISON 1
|
||||||
@@ -134,6 +134,17 @@ m4_define([b4_int_type_for],
|
|||||||
[b4_int_type($1_min, $1_max)])
|
[b4_int_type($1_min, $1_max)])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_table_value_equals(TABLE, VALUE, LITERAL)
|
||||||
|
# --------------------------------------------
|
||||||
|
# Without inducing a comparison warning from the compiler, check if the
|
||||||
|
# literal value LITERAL equals VALUE from table TABLE, which must have
|
||||||
|
# TABLE_min and TABLE_max defined. YYID must be defined as an identity
|
||||||
|
# function that suppresses warnings about constant conditions.
|
||||||
|
m4_define([b4_table_value_equals],
|
||||||
|
[m4_if(m4_eval($3 < m4_indir([b4_]$1[_min])
|
||||||
|
|| m4_indir([b4_]$1[_max]) < $3), [1],
|
||||||
|
[[YYID (0)]],
|
||||||
|
[[((]$2[) == (]$3[))]])])
|
||||||
|
|
||||||
## ---------##
|
## ---------##
|
||||||
## Values. ##
|
## Values. ##
|
||||||
|
|||||||
+151
-126
@@ -1,8 +1,8 @@
|
|||||||
-*- C -*-
|
-*- C -*-
|
||||||
|
|
||||||
# GLR skeleton for Bison
|
# GLR skeleton for Bison
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
|
|
||||||
# Foundation, Inc.
|
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -35,8 +35,8 @@ m4_define_default([b4_stack_depth_init], [200])
|
|||||||
## ------------------------ ##
|
## ------------------------ ##
|
||||||
|
|
||||||
b4_define_flag_if([pure])
|
b4_define_flag_if([pure])
|
||||||
# If glr.cc is including this file and thus has already set b4_pure_flag, don't
|
# If glr.cc is including this file and thus has already set b4_pure_flag,
|
||||||
# change the value of b4_pure_flag, and don't record a use of api.pure.
|
# do not change the value of b4_pure_flag, and do not record a use of api.pure.
|
||||||
m4_ifndef([b4_pure_flag],
|
m4_ifndef([b4_pure_flag],
|
||||||
[b4_percent_define_default([[api.pure]], [[false]])
|
[b4_percent_define_default([[api.pure]], [[false]])
|
||||||
m4_define([b4_pure_flag],
|
m4_define([b4_pure_flag],
|
||||||
@@ -150,7 +150,7 @@ m4_changecom()
|
|||||||
m4_divert_push(0)dnl
|
m4_divert_push(0)dnl
|
||||||
@output(b4_parser_file_name@)@
|
@output(b4_parser_file_name@)@
|
||||||
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||||
[2002, 2003, 2004, 2005, 2006])
|
[2002-2011])
|
||||||
[
|
[
|
||||||
/* C GLR parser skeleton written by Paul Hilfinger. */
|
/* C GLR parser skeleton written by Paul Hilfinger. */
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ b4_percent_code_get[]dnl
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef YY_
|
#ifndef YY_
|
||||||
# if YYENABLE_NLS
|
# if defined YYENABLE_NLS && YYENABLE_NLS
|
||||||
# if ENABLE_NLS
|
# if ENABLE_NLS
|
||||||
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
||||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||||
@@ -310,7 +310,8 @@ b4_percent_code_get[]dnl
|
|||||||
#ifndef __attribute__
|
#ifndef __attribute__
|
||||||
/* This feature is available in gcc versions 2.5 and later. */
|
/* This feature is available in gcc versions 2.5 and later. */
|
||||||
# if (! defined __GNUC__ || __GNUC__ < 2 \
|
# if (! defined __GNUC__ || __GNUC__ < 2 \
|
||||||
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
|
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5) \
|
||||||
|
|| (defined __STRICT_ANSI__ && __STRICT_ANSI__))
|
||||||
# define __attribute__(Spec) /* empty */
|
# define __attribute__(Spec) /* empty */
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@@ -412,9 +413,9 @@ static const ]b4_int_type_for([b4_merger])[ yymerger[] =
|
|||||||
]b4_merger[
|
]b4_merger[
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
|
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||||
doesn't specify something else to do. Zero means the default is an
|
YYTABLE doesn't specify something else to do. Zero means the default
|
||||||
error. */
|
is an error. */
|
||||||
static const ]b4_int_type_for([b4_defact])[ yydefact[] =
|
static const ]b4_int_type_for([b4_defact])[ yydefact[] =
|
||||||
{
|
{
|
||||||
]b4_defact[
|
]b4_defact[
|
||||||
@@ -442,8 +443,7 @@ static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] =
|
|||||||
|
|
||||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||||
positive, shift that token. If negative, reduce the rule which
|
positive, shift that token. If negative, reduce the rule which
|
||||||
number is the opposite. If zero, do what YYDEFACT says.
|
number is the opposite. If YYTABLE_NINF, syntax error. */
|
||||||
If YYTABLE_NINF, syntax error. */
|
|
||||||
#define YYTABLE_NINF ]b4_table_ninf[
|
#define YYTABLE_NINF ]b4_table_ninf[
|
||||||
static const ]b4_int_type_for([b4_table])[ yytable[] =
|
static const ]b4_int_type_for([b4_table])[ yytable[] =
|
||||||
{
|
{
|
||||||
@@ -1013,17 +1013,15 @@ yylhsNonterm (yyRuleNum yyrule)
|
|||||||
return yyr1[yyrule];
|
return yyr1[yyrule];
|
||||||
}
|
}
|
||||||
|
|
||||||
#define yyis_pact_ninf(yystate) \
|
#define yypact_value_is_default(yystate) \
|
||||||
]m4_if(m4_eval(b4_pact_ninf < b4_pact_min), [1],
|
]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[
|
||||||
[0],
|
|
||||||
[((yystate) == YYPACT_NINF)])[
|
|
||||||
|
|
||||||
/** True iff LR state STATE has only a default reduction (regardless
|
/** True iff LR state STATE has only a default reduction (regardless
|
||||||
* of token). */
|
* of token). */
|
||||||
static inline yybool
|
static inline yybool
|
||||||
yyisDefaultedState (yyStateNum yystate)
|
yyisDefaultedState (yyStateNum yystate)
|
||||||
{
|
{
|
||||||
return yyis_pact_ninf (yypact[yystate]);
|
return yypact_value_is_default (yypact[yystate]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The default reduction for STATE, assuming it has one. */
|
/** The default reduction for STATE, assuming it has one. */
|
||||||
@@ -1033,10 +1031,8 @@ yydefaultAction (yyStateNum yystate)
|
|||||||
return yydefact[yystate];
|
return yydefact[yystate];
|
||||||
}
|
}
|
||||||
|
|
||||||
#define yyis_table_ninf(yytable_value) \
|
#define yytable_value_is_error(yytable_value) \
|
||||||
]m4_if(m4_eval(b4_table_ninf < b4_table_min), [1],
|
]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[
|
||||||
[YYID (0)],
|
|
||||||
[((yytable_value) == YYTABLE_NINF)])[
|
|
||||||
|
|
||||||
/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
|
/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
|
||||||
* Result R means
|
* Result R means
|
||||||
@@ -1051,12 +1047,13 @@ yygetLRActions (yyStateNum yystate, int yytoken,
|
|||||||
int* yyaction, const short int** yyconflicts)
|
int* yyaction, const short int** yyconflicts)
|
||||||
{
|
{
|
||||||
int yyindex = yypact[yystate] + yytoken;
|
int yyindex = yypact[yystate] + yytoken;
|
||||||
if (yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
|
if (yypact_value_is_default (yypact[yystate])
|
||||||
|
|| yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
|
||||||
{
|
{
|
||||||
*yyaction = -yydefact[yystate];
|
*yyaction = -yydefact[yystate];
|
||||||
*yyconflicts = yyconfl;
|
*yyconflicts = yyconfl;
|
||||||
}
|
}
|
||||||
else if (! yyis_table_ninf (yytable[yyindex]))
|
else if (! yytable_value_is_error (yytable[yyindex]))
|
||||||
{
|
{
|
||||||
*yyaction = yytable[yyindex];
|
*yyaction = yytable[yyindex];
|
||||||
*yyconflicts = yyconfl + yyconflp[yyindex];
|
*yyconflicts = yyconfl + yyconflp[yyindex];
|
||||||
@@ -1805,7 +1802,7 @@ yyreportAmbiguity (yySemanticOption* yyx0,
|
|||||||
|
|
||||||
yyerror (]b4_yyerror_args[YY_("syntax is ambiguous"));
|
yyerror (]b4_yyerror_args[YY_("syntax is ambiguous"));
|
||||||
return yyabort;
|
return yyabort;
|
||||||
}
|
}]b4_locations_if([[
|
||||||
|
|
||||||
/** Starting at and including state S1, resolve the location for each of the
|
/** Starting at and including state S1, resolve the location for each of the
|
||||||
* previous N1 states that is unresolved. The first semantic option of a state
|
* previous N1 states that is unresolved. The first semantic option of a state
|
||||||
@@ -1863,7 +1860,7 @@ yyresolveLocations (yyGLRState* yys1, int yyn1,
|
|||||||
yylloc = yylloc_current;
|
yylloc = yylloc_current;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}]])[
|
||||||
|
|
||||||
/** Resolve the ambiguity represented in state S, perform the indicated
|
/** Resolve the ambiguity represented in state S, perform the indicated
|
||||||
* actions, and set the semantic value of S. If result != yyok, the chain of
|
* actions, and set the semantic value of S. If result != yyok, the chain of
|
||||||
@@ -1897,8 +1894,8 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
{
|
{
|
||||||
switch (yypreference (yybest, yyp))
|
switch (yypreference (yybest, yyp))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:]b4_locations_if([[
|
||||||
yyresolveLocations (yys, 1, yystackp]b4_user_args[);
|
yyresolveLocations (yys, 1, yystackp]b4_user_args[);]])[
|
||||||
return yyreportAmbiguity (yybest, yyp]b4_pure_args[);
|
return yyreportAmbiguity (yybest, yyp]b4_pure_args[);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2091,102 +2088,130 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
|
|||||||
/*ARGSUSED*/ static void
|
/*ARGSUSED*/ static void
|
||||||
yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||||
{
|
{
|
||||||
if (yystackp->yyerrState == 0)
|
if (yystackp->yyerrState != 0)
|
||||||
|
return;
|
||||||
|
#if ! YYERROR_VERBOSE
|
||||||
|
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||||
|
#else
|
||||||
|
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
|
||||||
|
size_t yysize0 = yytnamerr (NULL, yytokenName (yytoken));
|
||||||
|
size_t yysize = yysize0;
|
||||||
|
size_t yysize1;
|
||||||
|
yybool yysize_overflow = yyfalse;
|
||||||
|
char* yymsg = NULL;
|
||||||
|
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||||
|
/* Internationalized format string. */
|
||||||
|
const char *yyformat = 0;
|
||||||
|
/* Arguments of yyformat. */
|
||||||
|
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||||
|
/* Number of reported tokens (one for the "unexpected", one per
|
||||||
|
"expected"). */
|
||||||
|
int yycount = 0;
|
||||||
|
|
||||||
|
/* There are many possibilities here to consider:
|
||||||
|
- If this state is a consistent state with a default action, then
|
||||||
|
the only way this function was invoked is if the default action
|
||||||
|
is an error action. In that case, don't check for expected
|
||||||
|
tokens because there are none.
|
||||||
|
- The only way there can be no lookahead present (in yychar) is if
|
||||||
|
this state is a consistent state with a default action. Thus,
|
||||||
|
detecting the absence of a lookahead is sufficient to determine
|
||||||
|
that there is no unexpected or expected token to report. In that
|
||||||
|
case, just report a simple "syntax error".
|
||||||
|
- Don't assume there isn't a lookahead just because this state is a
|
||||||
|
consistent state with a default action. There might have been a
|
||||||
|
previous inconsistent state, consistent state with a non-default
|
||||||
|
action, or user semantic action that manipulated yychar.
|
||||||
|
- Of course, the expected token list depends on states to have
|
||||||
|
correct lookahead information, and it depends on the parser not
|
||||||
|
to perform extra reductions after fetching a lookahead from the
|
||||||
|
scanner and before detecting a syntax error. Thus, state merging
|
||||||
|
(from LALR or IELR) and default reductions corrupt the expected
|
||||||
|
token list. However, the list is correct for canonical LR with
|
||||||
|
one exception: it will still contain any token that will not be
|
||||||
|
accepted due to an error action in a later state.
|
||||||
|
*/
|
||||||
|
if (yytoken != YYEMPTY)
|
||||||
{
|
{
|
||||||
#if YYERROR_VERBOSE
|
int yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||||
int yyn;
|
yyarg[yycount++] = yytokenName (yytoken);
|
||||||
yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
if (!yypact_value_is_default (yyn))
|
||||||
if (YYPACT_NINF < yyn && yyn <= YYLAST)
|
{
|
||||||
{
|
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||||
yySymbol yytoken = YYTRANSLATE (yychar);
|
YYCHECK. In other words, skip the first -YYN actions for this
|
||||||
size_t yysize0 = yytnamerr (NULL, yytokenName (yytoken));
|
state because they are default actions. */
|
||||||
size_t yysize = yysize0;
|
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||||
size_t yysize1;
|
/* Stay within bounds of both yycheck and yytname. */
|
||||||
yybool yysize_overflow = yyfalse;
|
int yychecklim = YYLAST - yyn + 1;
|
||||||
char* yymsg = NULL;
|
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
int yyx;
|
||||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||||
int yyx;
|
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
|
||||||
char *yyfmt;
|
&& !yytable_value_is_error (yytable[yyx + yyn]))
|
||||||
char const *yyf;
|
{
|
||||||
static char const yyunexpected[] = "syntax error, unexpected %s";
|
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||||
static char const yyexpecting[] = ", expecting %s";
|
{
|
||||||
static char const yyor[] = " or %s";
|
yycount = 1;
|
||||||
char yyformat[sizeof yyunexpected
|
yysize = yysize0;
|
||||||
+ sizeof yyexpecting - 1
|
break;
|
||||||
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
}
|
||||||
* (sizeof yyor - 1))];
|
yyarg[yycount++] = yytokenName (yyx);
|
||||||
char const *yyprefix = yyexpecting;
|
yysize1 = yysize + yytnamerr (NULL, yytokenName (yyx));
|
||||||
|
yysize_overflow |= yysize1 < yysize;
|
||||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
yysize = yysize1;
|
||||||
YYCHECK. */
|
}
|
||||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
}
|
||||||
|
|
||||||
/* Stay within bounds of both yycheck and yytname. */
|
|
||||||
int yychecklim = YYLAST - yyn + 1;
|
|
||||||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
|
||||||
int yycount = 1;
|
|
||||||
|
|
||||||
yyarg[0] = yytokenName (yytoken);
|
|
||||||
yyfmt = yystpcpy (yyformat, yyunexpected);
|
|
||||||
|
|
||||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
|
||||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
|
||||||
{
|
|
||||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
|
||||||
{
|
|
||||||
yycount = 1;
|
|
||||||
yysize = yysize0;
|
|
||||||
yyformat[sizeof yyunexpected - 1] = '\0';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
yyarg[yycount++] = yytokenName (yyx);
|
|
||||||
yysize1 = yysize + yytnamerr (NULL, yytokenName (yyx));
|
|
||||||
yysize_overflow |= yysize1 < yysize;
|
|
||||||
yysize = yysize1;
|
|
||||||
yyfmt = yystpcpy (yyfmt, yyprefix);
|
|
||||||
yyprefix = yyor;
|
|
||||||
}
|
|
||||||
|
|
||||||
yyf = YY_(yyformat);
|
|
||||||
yysize1 = yysize + strlen (yyf);
|
|
||||||
yysize_overflow |= yysize1 < yysize;
|
|
||||||
yysize = yysize1;
|
|
||||||
|
|
||||||
if (!yysize_overflow)
|
|
||||||
yymsg = (char *) YYMALLOC (yysize);
|
|
||||||
|
|
||||||
if (yymsg)
|
|
||||||
{
|
|
||||||
char *yyp = yymsg;
|
|
||||||
int yyi = 0;
|
|
||||||
while ((*yyp = *yyf))
|
|
||||||
{
|
|
||||||
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
|
||||||
{
|
|
||||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
|
||||||
yyf += 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
yyp++;
|
|
||||||
yyf++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
yyerror (]b4_lyyerror_args[yymsg);
|
|
||||||
YYFREE (yymsg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
|
||||||
yyMemoryExhausted (yystackp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif /* YYERROR_VERBOSE */
|
|
||||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
|
||||||
yynerrs += 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (yycount)
|
||||||
|
{
|
||||||
|
#define YYCASE_(N, S) \
|
||||||
|
case N: \
|
||||||
|
yyformat = S; \
|
||||||
|
break
|
||||||
|
YYCASE_(0, YY_("syntax error"));
|
||||||
|
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||||
|
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||||
|
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||||
|
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||||
|
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||||
|
#undef YYCASE_
|
||||||
|
}
|
||||||
|
|
||||||
|
yysize1 = yysize + strlen (yyformat);
|
||||||
|
yysize_overflow |= yysize1 < yysize;
|
||||||
|
yysize = yysize1;
|
||||||
|
|
||||||
|
if (!yysize_overflow)
|
||||||
|
yymsg = (char *) YYMALLOC (yysize);
|
||||||
|
|
||||||
|
if (yymsg)
|
||||||
|
{
|
||||||
|
char *yyp = yymsg;
|
||||||
|
int yyi = 0;
|
||||||
|
while ((*yyp = *yyformat))
|
||||||
|
{
|
||||||
|
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
|
||||||
|
{
|
||||||
|
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||||
|
yyformat += 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
yyp++;
|
||||||
|
yyformat++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yyerror (]b4_lyyerror_args[yymsg);
|
||||||
|
YYFREE (yymsg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||||
|
yyMemoryExhausted (yystackp);
|
||||||
|
}
|
||||||
|
#endif /* YYERROR_VERBOSE */
|
||||||
|
yynerrs += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
|
/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
|
||||||
@@ -2232,7 +2257,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||||
}
|
}
|
||||||
yyj = yypact[yystackp->yytops.yystates[0]->yylrState];
|
yyj = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||||
if (yyis_pact_ninf (yyj))
|
if (yypact_value_is_default (yyj))
|
||||||
return;
|
return;
|
||||||
yyj += yytoken;
|
yyj += yytoken;
|
||||||
if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken)
|
if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken)
|
||||||
@@ -2240,7 +2265,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0)
|
if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (yytable[yyj] != 0 && ! yyis_table_ninf (yytable[yyj]))
|
else if (! yytable_value_is_error (yytable[yyj]))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2261,7 +2286,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
{
|
{
|
||||||
yyGLRState *yys = yystackp->yytops.yystates[0];
|
yyGLRState *yys = yystackp->yytops.yystates[0];
|
||||||
yyj = yypact[yys->yylrState];
|
yyj = yypact[yys->yylrState];
|
||||||
if (! yyis_pact_ninf (yyj))
|
if (! yypact_value_is_default (yyj))
|
||||||
{
|
{
|
||||||
yyj += YYTERROR;
|
yyj += YYTERROR;
|
||||||
if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR
|
if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR
|
||||||
@@ -2323,7 +2348,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
yychar = YYEMPTY;
|
yychar = YYEMPTY;
|
||||||
yylval = yyval_default;
|
yylval = yyval_default;
|
||||||
]b4_locations_if([
|
]b4_locations_if([
|
||||||
#if YYLTYPE_IS_TRIVIAL
|
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
||||||
yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
|
yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
|
||||||
yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
|
yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
|
||||||
#endif
|
#endif
|
||||||
@@ -2639,7 +2664,7 @@ m4_if(b4_skeleton, ["glr.c"],
|
|||||||
[b4_defines_if(
|
[b4_defines_if(
|
||||||
[@output(b4_spec_defines_file@)@
|
[@output(b4_spec_defines_file@)@
|
||||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||||
[2002, 2003, 2004, 2005, 2006])
|
[2002-2011])
|
||||||
|
|
||||||
b4_shared_declarations
|
b4_shared_declarations
|
||||||
|
|
||||||
|
|||||||
+9
-12
@@ -1,8 +1,8 @@
|
|||||||
-*- C -*-
|
-*- C -*-
|
||||||
|
|
||||||
# C++ GLR skeleton for Bison
|
# C++ GLR skeleton for Bison
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
|
|
||||||
# Inc.
|
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -54,7 +54,8 @@ b4_defines_if([],
|
|||||||
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c++.m4])
|
m4_include(b4_pkgdatadir/[c++.m4])
|
||||||
m4_include(b4_pkgdatadir/[location.cc])
|
b4_percent_define_ifdef([[location_type]], [],
|
||||||
|
[m4_include(b4_pkgdatadir/[location.cc])])
|
||||||
|
|
||||||
m4_define([b4_parser_class_name],
|
m4_define([b4_parser_class_name],
|
||||||
[b4_percent_define_get([[parser_class_name]])])
|
[b4_percent_define_get([[parser_class_name]])])
|
||||||
@@ -219,7 +220,7 @@ m4_popdef([b4_parse_param])
|
|||||||
m4_divert_push(0)
|
m4_divert_push(0)
|
||||||
@output(b4_spec_defines_file@)@
|
@output(b4_spec_defines_file@)@
|
||||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006])[
|
[2002-2006, 2009-2011])[
|
||||||
|
|
||||||
/* C++ GLR parser skeleton written by Akim Demaille. */
|
/* C++ GLR parser skeleton written by Akim Demaille. */
|
||||||
|
|
||||||
@@ -230,17 +231,12 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
]b4_percent_define_ifdef([[location_type]], [],
|
||||||
|
[[#include "location.hh"]])[
|
||||||
|
|
||||||
/* Using locations. */
|
/* Using locations. */
|
||||||
#define YYLSP_NEEDED ]b4_locations_flag[
|
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||||
|
|
||||||
]b4_namespace_open[
|
|
||||||
class position;
|
|
||||||
class location;
|
|
||||||
]b4_namespace_close[
|
|
||||||
|
|
||||||
#include "location.hh"
|
|
||||||
|
|
||||||
/* Enabling traces. */
|
/* Enabling traces. */
|
||||||
#ifndef YYDEBUG
|
#ifndef YYDEBUG
|
||||||
# define YYDEBUG ]b4_debug_flag[
|
# define YYDEBUG ]b4_debug_flag[
|
||||||
@@ -284,7 +280,8 @@ b4_user_stype
|
|||||||
typedef YYSTYPE semantic_type;
|
typedef YYSTYPE semantic_type;
|
||||||
#endif
|
#endif
|
||||||
/// Symbol locations.
|
/// Symbol locations.
|
||||||
typedef ]b4_percent_define_get([[location_type]])[ location_type;
|
typedef ]b4_percent_define_get([[location_type]],
|
||||||
|
[[location]])[ location_type;
|
||||||
/// Tokens.
|
/// Tokens.
|
||||||
struct token
|
struct token
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# Java skeleton dispatching for Bison.
|
# Java skeleton dispatching for Bison.
|
||||||
# Copyright (C) 2007 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Java language support for Bison
|
# Java language support for Bison
|
||||||
|
|
||||||
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
# Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+190
-108
@@ -1,7 +1,6 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,9 +24,10 @@ m4_define([b4_parser_class_name],
|
|||||||
b4_defines_if([],
|
b4_defines_if([],
|
||||||
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||||
|
|
||||||
# Backward compatibility.
|
b4_percent_define_ifdef([[location_type]], [],
|
||||||
m4_define([b4_location_constructors])
|
[# Backward compatibility.
|
||||||
m4_include(b4_pkgdatadir/[location.cc])
|
m4_define([b4_location_constructors])
|
||||||
|
m4_include(b4_pkgdatadir/[location.cc])])
|
||||||
|
|
||||||
# We do want M4 expansion after # for CPP macros.
|
# We do want M4 expansion after # for CPP macros.
|
||||||
m4_changecom()
|
m4_changecom()
|
||||||
@@ -35,7 +35,7 @@ m4_divert_push(0)dnl
|
|||||||
b4_defines_if(
|
b4_defines_if(
|
||||||
[@output(b4_spec_defines_file@)@
|
[@output(b4_spec_defines_file@)@
|
||||||
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
|
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006, 2007, 2008])
|
[2002-2011])
|
||||||
dnl FIXME: This is wrong, we want computed header guards.
|
dnl FIXME: This is wrong, we want computed header guards.
|
||||||
[
|
[
|
||||||
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
||||||
@@ -48,13 +48,8 @@ dnl FIXME: This is wrong, we want computed header guards.
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "stack.hh"
|
#include "stack.hh"
|
||||||
|
]b4_percent_define_ifdef([[location_type]], [],
|
||||||
]b4_namespace_open[
|
[[#include "location.hh"]])[
|
||||||
class position;
|
|
||||||
class location;
|
|
||||||
]b4_namespace_close[
|
|
||||||
|
|
||||||
#include "location.hh"
|
|
||||||
|
|
||||||
/* Enabling traces. */
|
/* Enabling traces. */
|
||||||
#ifndef YYDEBUG
|
#ifndef YYDEBUG
|
||||||
@@ -74,25 +69,6 @@ dnl FIXME: This is wrong, we want computed header guards.
|
|||||||
# define YYTOKEN_TABLE ]b4_token_table[
|
# define YYTOKEN_TABLE ]b4_token_table[
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
|
||||||
If N is 0, then set CURRENT to the empty location which ends
|
|
||||||
the previous symbol: RHS[0] (always defined). */
|
|
||||||
|
|
||||||
#ifndef YYLLOC_DEFAULT
|
|
||||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
|
||||||
do { \
|
|
||||||
if (N) \
|
|
||||||
{ \
|
|
||||||
(Current).begin = (Rhs)[1].begin; \
|
|
||||||
(Current).end = (Rhs)[N].end; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
(Current).begin = (Current).end = (Rhs)[0].end; \
|
|
||||||
} \
|
|
||||||
} while (false)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
|
|
||||||
/// A Bison parser.
|
/// A Bison parser.
|
||||||
@@ -113,7 +89,8 @@ b4_user_stype
|
|||||||
typedef YYSTYPE semantic_type;
|
typedef YYSTYPE semantic_type;
|
||||||
#endif
|
#endif
|
||||||
/// Symbol locations.
|
/// Symbol locations.
|
||||||
typedef ]b4_percent_define_get([[location_type]])[ location_type;
|
typedef ]b4_percent_define_get([[location_type]],
|
||||||
|
[[location]])[ location_type;
|
||||||
/// Tokens.
|
/// Tokens.
|
||||||
struct token
|
struct token
|
||||||
{
|
{
|
||||||
@@ -153,8 +130,7 @@ b4_user_stype
|
|||||||
/// Generate an error message.
|
/// Generate an error message.
|
||||||
/// \param state the state where the error occurred.
|
/// \param state the state where the error occurred.
|
||||||
/// \param tok the lookahead token.
|
/// \param tok the lookahead token.
|
||||||
virtual std::string yysyntax_error_ (int yystate]dnl
|
virtual std::string yysyntax_error_ (int yystate, int tok);
|
||||||
b4_error_verbose_if([, int tok])[);
|
|
||||||
|
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
/// \brief Report a symbol value on the debug stream.
|
/// \brief Report a symbol value on the debug stream.
|
||||||
@@ -190,6 +166,14 @@ b4_error_verbose_if([, int tok])[);
|
|||||||
/// The location stack.
|
/// The location stack.
|
||||||
location_stack_type yylocation_stack_;
|
location_stack_type yylocation_stack_;
|
||||||
|
|
||||||
|
/// Whether the given \c yypact_ value indicates a defaulted state.
|
||||||
|
/// \param yyvalue the value to check
|
||||||
|
static bool yy_pact_value_is_default_ (int yyvalue);
|
||||||
|
|
||||||
|
/// Whether the given \c yytable_ value indicates a syntax error.
|
||||||
|
/// \param yyvalue the value to check
|
||||||
|
static bool yy_table_value_is_error_ (int yyvalue);
|
||||||
|
|
||||||
/// Internal symbol numbers.
|
/// Internal symbol numbers.
|
||||||
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
||||||
/* Tables. */
|
/* Tables. */
|
||||||
@@ -197,7 +181,7 @@ b4_error_verbose_if([, int tok])[);
|
|||||||
static const ]b4_int_type_for([b4_pact])[ yypact_[];
|
static const ]b4_int_type_for([b4_pact])[ yypact_[];
|
||||||
static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_;
|
static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_;
|
||||||
|
|
||||||
/// For a state, default rule to reduce.
|
/// For a state, default reduction number.
|
||||||
/// Unless\a yytable_ specifies something else to do.
|
/// Unless\a yytable_ specifies something else to do.
|
||||||
/// Zero means the default is an error.
|
/// Zero means the default is an error.
|
||||||
static const ]b4_int_type_for([b4_defact])[ yydefact_[];
|
static const ]b4_int_type_for([b4_defact])[ yydefact_[];
|
||||||
@@ -226,12 +210,10 @@ b4_error_verbose_if([, int tok])[);
|
|||||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||||
/// For a symbol, its name in clear.
|
/// For a symbol, its name in clear.
|
||||||
static const char* const yytname_[];
|
static const char* const yytname_[];
|
||||||
#endif
|
#endif]b4_error_verbose_if([
|
||||||
|
|
||||||
#if YYERROR_VERBOSE
|
|
||||||
/// Convert the symbol name \a n to a form suitable for a diagnostic.
|
/// Convert the symbol name \a n to a form suitable for a diagnostic.
|
||||||
virtual std::string yytnamerr_ (const char *n);
|
static std::string yytnamerr_ (const char *n);])[
|
||||||
#endif
|
|
||||||
|
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
/// A type to store symbol numbers and -1.
|
/// A type to store symbol numbers and -1.
|
||||||
@@ -300,7 +282,7 @@ b4_percent_code_get([[provides]])[]dnl
|
|||||||
])dnl
|
])dnl
|
||||||
@output(b4_parser_file_name@)@
|
@output(b4_parser_file_name@)@
|
||||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
|
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006, 2007, 2008])
|
[2002-2011])
|
||||||
b4_percent_code_get([[top]])[]dnl
|
b4_percent_code_get([[top]])[]dnl
|
||||||
m4_if(b4_prefix, [yy], [],
|
m4_if(b4_prefix, [yy], [],
|
||||||
[
|
[
|
||||||
@@ -318,7 +300,7 @@ b4_defines_if([[
|
|||||||
b4_percent_code_get[]dnl
|
b4_percent_code_get[]dnl
|
||||||
|
|
||||||
[#ifndef YY_
|
[#ifndef YY_
|
||||||
# if YYENABLE_NLS
|
# if defined YYENABLE_NLS && YYENABLE_NLS
|
||||||
# if ENABLE_NLS
|
# if ENABLE_NLS
|
||||||
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
|
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
|
||||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||||
@@ -329,6 +311,26 @@ b4_percent_code_get[]dnl
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||||
|
If N is 0, then set CURRENT to the empty location which ends
|
||||||
|
the previous symbol: RHS[0] (always defined). */
|
||||||
|
|
||||||
|
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||||
|
#ifndef YYLLOC_DEFAULT
|
||||||
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
|
do \
|
||||||
|
if (N) \
|
||||||
|
{ \
|
||||||
|
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
||||||
|
(Current).end = YYRHSLOC (Rhs, N).end; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
||||||
|
} \
|
||||||
|
while (false)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Suppress unused-variable warnings by "using" E. */
|
/* Suppress unused-variable warnings by "using" E. */
|
||||||
#define YYUSE(e) ((void) (e))
|
#define YYUSE(e) ((void) (e))
|
||||||
|
|
||||||
@@ -377,8 +379,7 @@ do { \
|
|||||||
#define YYERROR goto yyerrorlab
|
#define YYERROR goto yyerrorlab
|
||||||
#define YYRECOVERING() (!!yyerrstatus_)
|
#define YYRECOVERING() (!!yyerrstatus_)
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[]b4_error_verbose_if([[
|
||||||
#if YYERROR_VERBOSE
|
|
||||||
|
|
||||||
/* Return YYSTR after stripping away unnecessary quotes and
|
/* Return YYSTR after stripping away unnecessary quotes and
|
||||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||||
@@ -416,8 +417,7 @@ do { \
|
|||||||
|
|
||||||
return yystr;
|
return yystr;
|
||||||
}
|
}
|
||||||
|
]])[
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Build a parser object.
|
/// Build a parser object.
|
||||||
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||||
@@ -518,6 +518,18 @@ do { \
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
]b4_parser_class_name[::yy_pact_value_is_default_ (int yyvalue)
|
||||||
|
{
|
||||||
|
return yyvalue == yypact_ninf_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue)
|
||||||
|
{
|
||||||
|
return yyvalue == yytable_ninf_;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
]b4_parser_class_name[::parse ()
|
]b4_parser_class_name[::parse ()
|
||||||
{
|
{
|
||||||
@@ -539,7 +551,7 @@ do { \
|
|||||||
/// Location of the lookahead.
|
/// Location of the lookahead.
|
||||||
location_type yylloc;
|
location_type yylloc;
|
||||||
/// The locations where the error started and ended.
|
/// The locations where the error started and ended.
|
||||||
location_type yyerror_range[2];
|
location_type yyerror_range[3];
|
||||||
|
|
||||||
/// $$.
|
/// $$.
|
||||||
semantic_type yyval;
|
semantic_type yyval;
|
||||||
@@ -584,7 +596,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
|
|
||||||
/* Try to take a decision without lookahead. */
|
/* Try to take a decision without lookahead. */
|
||||||
yyn = yypact_[yystate];
|
yyn = yypact_[yystate];
|
||||||
if (yyn == yypact_ninf_)
|
if (yy_pact_value_is_default_ (yyn))
|
||||||
goto yydefault;
|
goto yydefault;
|
||||||
|
|
||||||
/* Read a lookahead token. */
|
/* Read a lookahead token. */
|
||||||
@@ -620,8 +632,8 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
|||||||
yyn = yytable_[yyn];
|
yyn = yytable_[yyn];
|
||||||
if (yyn <= 0)
|
if (yyn <= 0)
|
||||||
{
|
{
|
||||||
if (yyn == 0 || yyn == yytable_ninf_)
|
if (yy_table_value_is_error_ (yyn))
|
||||||
goto yyerrlab;
|
goto yyerrlab;
|
||||||
yyn = -yyn;
|
yyn = -yyn;
|
||||||
goto yyreduce;
|
goto yyreduce;
|
||||||
}
|
}
|
||||||
@@ -679,6 +691,17 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* User semantic actions sometimes alter yychar, and that requires
|
||||||
|
that yytoken be updated with the new translation. We take the
|
||||||
|
approach of translating immediately before every use of yytoken.
|
||||||
|
One alternative is translating here after every semantic action,
|
||||||
|
but that translation would be missed if the semantic action
|
||||||
|
invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
|
||||||
|
yychar. In the case of YYABORT or YYACCEPT, an incorrect
|
||||||
|
destructor might then be invoked immediately. In the case of
|
||||||
|
YYERROR, subsequent parser actions might lead to an incorrect
|
||||||
|
destructor call or verbose syntax error message before the
|
||||||
|
lookahead is translated. */
|
||||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
|
||||||
|
|
||||||
yypop_ (yylen);
|
yypop_ (yylen);
|
||||||
@@ -702,15 +725,20 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
|||||||
| yyerrlab -- here on detecting error |
|
| yyerrlab -- here on detecting error |
|
||||||
`------------------------------------*/
|
`------------------------------------*/
|
||||||
yyerrlab:
|
yyerrlab:
|
||||||
|
/* Make sure we have latest lookahead translation. See comments at
|
||||||
|
user semantic actions for why this is necessary. */
|
||||||
|
yytoken = yytranslate_ (yychar);
|
||||||
|
|
||||||
/* If not already recovering from an error, report this error. */
|
/* If not already recovering from an error, report this error. */
|
||||||
if (!yyerrstatus_)
|
if (!yyerrstatus_)
|
||||||
{
|
{
|
||||||
++yynerrs_;
|
++yynerrs_;
|
||||||
error (yylloc, yysyntax_error_ (yystate]dnl
|
if (yychar == yyempty_)
|
||||||
b4_error_verbose_if([, yytoken])[));
|
yytoken = yyempty_;
|
||||||
|
error (yylloc, yysyntax_error_ (yystate, yytoken));
|
||||||
}
|
}
|
||||||
|
|
||||||
yyerror_range[0] = yylloc;
|
yyerror_range[1] = yylloc;
|
||||||
if (yyerrstatus_ == 3)
|
if (yyerrstatus_ == 3)
|
||||||
{
|
{
|
||||||
/* If just tried and failed to reuse lookahead token after an
|
/* If just tried and failed to reuse lookahead token after an
|
||||||
@@ -745,7 +773,7 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
if (false)
|
if (false)
|
||||||
goto yyerrorlab;
|
goto yyerrorlab;
|
||||||
|
|
||||||
yyerror_range[0] = yylocation_stack_[yylen - 1];
|
yyerror_range[1] = yylocation_stack_[yylen - 1];
|
||||||
/* Do not reclaim the symbols of the rule which action triggered
|
/* Do not reclaim the symbols of the rule which action triggered
|
||||||
this YYERROR. */
|
this YYERROR. */
|
||||||
yypop_ (yylen);
|
yypop_ (yylen);
|
||||||
@@ -762,7 +790,7 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
yyn = yypact_[yystate];
|
yyn = yypact_[yystate];
|
||||||
if (yyn != yypact_ninf_)
|
if (!yy_pact_value_is_default_ (yyn))
|
||||||
{
|
{
|
||||||
yyn += yyterror_;
|
yyn += yyterror_;
|
||||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||||
@@ -777,7 +805,7 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
if (yystate_stack_.height () == 1)
|
if (yystate_stack_.height () == 1)
|
||||||
YYABORT;
|
YYABORT;
|
||||||
|
|
||||||
yyerror_range[0] = yylocation_stack_[0];
|
yyerror_range[1] = yylocation_stack_[0];
|
||||||
yydestruct_ ("Error: popping",
|
yydestruct_ ("Error: popping",
|
||||||
yystos_[yystate],
|
yystos_[yystate],
|
||||||
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
||||||
@@ -786,10 +814,10 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
YY_STACK_PRINT ();
|
YY_STACK_PRINT ();
|
||||||
}
|
}
|
||||||
|
|
||||||
yyerror_range[1] = yylloc;
|
yyerror_range[2] = yylloc;
|
||||||
// Using YYLLOC is tempting, but would change the location of
|
// Using YYLLOC is tempting, but would change the location of
|
||||||
// the lookahead. YYLOC is available though.
|
// the lookahead. YYLOC is available though.
|
||||||
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
|
YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
|
||||||
yysemantic_stack_.push (yylval);
|
yysemantic_stack_.push (yylval);
|
||||||
yylocation_stack_.push (yyloc);
|
yylocation_stack_.push (yyloc);
|
||||||
|
|
||||||
@@ -812,7 +840,13 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
|
|
||||||
yyreturn:
|
yyreturn:
|
||||||
if (yychar != yyempty_)
|
if (yychar != yyempty_)
|
||||||
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
|
{
|
||||||
|
/* Make sure we have latest lookahead translation. See comments
|
||||||
|
at user semantic actions for why this is necessary. */
|
||||||
|
yytoken = yytranslate_ (yychar);
|
||||||
|
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval,
|
||||||
|
&yylloc);
|
||||||
|
}
|
||||||
|
|
||||||
/* Do not reclaim the symbols of the rule which action triggered
|
/* Do not reclaim the symbols of the rule which action triggered
|
||||||
this YYABORT or YYACCEPT. */
|
this YYABORT or YYACCEPT. */
|
||||||
@@ -831,52 +865,100 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
|
|
||||||
// Generate an error message.
|
// Generate an error message.
|
||||||
std::string
|
std::string
|
||||||
]b4_parser_class_name[::yysyntax_error_ (int yystate]dnl
|
]b4_parser_class_name[::yysyntax_error_ (]dnl
|
||||||
b4_error_verbose_if([, int tok])[)
|
b4_error_verbose_if([int yystate, int yytoken],
|
||||||
{
|
[int, int])[)
|
||||||
std::string res;
|
{]b4_error_verbose_if([[
|
||||||
YYUSE (yystate);
|
std::string yyres;
|
||||||
#if YYERROR_VERBOSE
|
// Number of reported tokens (one for the "unexpected", one per
|
||||||
int yyn = yypact_[yystate];
|
// "expected").
|
||||||
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
size_t yycount = 0;
|
||||||
|
// Its maximum.
|
||||||
|
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||||
|
// Arguments of yyformat.
|
||||||
|
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||||
|
|
||||||
|
/* There are many possibilities here to consider:
|
||||||
|
- If this state is a consistent state with a default action, then
|
||||||
|
the only way this function was invoked is if the default action
|
||||||
|
is an error action. In that case, don't check for expected
|
||||||
|
tokens because there are none.
|
||||||
|
- The only way there can be no lookahead present (in yytoken) is
|
||||||
|
if this state is a consistent state with a default action.
|
||||||
|
Thus, detecting the absence of a lookahead is sufficient to
|
||||||
|
determine that there is no unexpected or expected token to
|
||||||
|
report. In that case, just report a simple "syntax error".
|
||||||
|
- Don't assume there isn't a lookahead just because this state is
|
||||||
|
a consistent state with a default action. There might have
|
||||||
|
been a previous inconsistent state, consistent state with a
|
||||||
|
non-default action, or user semantic action that manipulated
|
||||||
|
yychar.
|
||||||
|
- Of course, the expected token list depends on states to have
|
||||||
|
correct lookahead information, and it depends on the parser not
|
||||||
|
to perform extra reductions after fetching a lookahead from the
|
||||||
|
scanner and before detecting a syntax error. Thus, state
|
||||||
|
merging (from LALR or IELR) and default reductions corrupt the
|
||||||
|
expected token list. However, the list is correct for
|
||||||
|
canonical LR with one exception: it will still contain any
|
||||||
|
token that will not be accepted due to an error action in a
|
||||||
|
later state.
|
||||||
|
*/
|
||||||
|
if (yytoken != yyempty_)
|
||||||
{
|
{
|
||||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
yyarg[yycount++] = yytname_[yytoken];
|
||||||
YYCHECK. */
|
int yyn = yypact_[yystate];
|
||||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
if (!yy_pact_value_is_default_ (yyn))
|
||||||
|
{
|
||||||
/* Stay within bounds of both yycheck and yytname. */
|
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||||
int yychecklim = yylast_ - yyn + 1;
|
YYCHECK. In other words, skip the first -YYN actions for
|
||||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
this state because they are default actions. */
|
||||||
int count = 0;
|
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||||
for (int x = yyxbegin; x < yyxend; ++x)
|
/* Stay within bounds of both yycheck and yytname. */
|
||||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
int yychecklim = yylast_ - yyn + 1;
|
||||||
++count;
|
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||||
|
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||||
// FIXME: This method of building the message is not compatible
|
if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
|
||||||
// with internationalization. It should work like yacc.c does it.
|
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
|
||||||
// That is, first build a string that looks like this:
|
{
|
||||||
// "syntax error, unexpected %s or %s or %s"
|
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||||
// Then, invoke YY_ on this string.
|
{
|
||||||
// Finally, use the string as a format to output
|
yycount = 1;
|
||||||
// yytname_[tok], etc.
|
break;
|
||||||
// Until this gets fixed, this message appears in English only.
|
}
|
||||||
res = "syntax error, unexpected ";
|
else
|
||||||
res += yytnamerr_ (yytname_[tok]);
|
yyarg[yycount++] = yytname_[yyx];
|
||||||
if (count < 5)
|
}
|
||||||
{
|
}
|
||||||
count = 0;
|
|
||||||
for (int x = yyxbegin; x < yyxend; ++x)
|
|
||||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
|
||||||
{
|
|
||||||
res += (!count++) ? ", expecting " : " or ";
|
|
||||||
res += yytnamerr_ (yytname_[x]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
#endif
|
char const* yyformat = 0;
|
||||||
res = YY_("syntax error");
|
switch (yycount)
|
||||||
return res;
|
{
|
||||||
|
#define YYCASE_(N, S) \
|
||||||
|
case N: \
|
||||||
|
yyformat = S; \
|
||||||
|
break
|
||||||
|
YYCASE_(0, YY_("syntax error"));
|
||||||
|
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||||
|
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||||
|
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||||
|
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||||
|
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||||
|
#undef YYCASE_
|
||||||
|
}
|
||||||
|
|
||||||
|
// Argument number.
|
||||||
|
size_t yyi = 0;
|
||||||
|
for (char const* yyp = yyformat; *yyp; ++yyp)
|
||||||
|
if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
|
||||||
|
{
|
||||||
|
yyres += yytnamerr_ (yyarg[yyi++]);
|
||||||
|
++yyp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
yyres += *yyp;
|
||||||
|
return yyres;]], [[
|
||||||
|
return YY_("syntax error");]])[
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -889,9 +971,9 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
]b4_pact[
|
]b4_pact[
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
|
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||||
doesn't specify something else to do. Zero means the default is an
|
YYTABLE doesn't specify something else to do. Zero means the
|
||||||
error. */
|
default is an error. */
|
||||||
const ]b4_int_type_for([b4_defact])[
|
const ]b4_int_type_for([b4_defact])[
|
||||||
]b4_parser_class_name[::yydefact_[] =
|
]b4_parser_class_name[::yydefact_[] =
|
||||||
{
|
{
|
||||||
@@ -914,7 +996,7 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
|
|
||||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||||
positive, shift that token. If negative, reduce the rule which
|
positive, shift that token. If negative, reduce the rule which
|
||||||
number is the opposite. If zero, do what YYDEFACT says. */
|
number is the opposite. If YYTABLE_NINF_, syntax error. */
|
||||||
const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[;
|
const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[;
|
||||||
const ]b4_int_type_for([b4_table])[
|
const ]b4_int_type_for([b4_table])[
|
||||||
]b4_parser_class_name[::yytable_[] =
|
]b4_parser_class_name[::yytable_[] =
|
||||||
@@ -1057,7 +1139,7 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
dnl
|
dnl
|
||||||
@output(b4_dir_prefix[]stack.hh@)@
|
@output(b4_dir_prefix[]stack.hh@)@
|
||||||
b4_copyright([Stack handling for Bison parsers in C++],
|
b4_copyright([Stack handling for Bison parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006, 2007, 2008])[
|
[2002-2011])[
|
||||||
|
|
||||||
#ifndef BISON_STACK_HH
|
#ifndef BISON_STACK_HH
|
||||||
# define BISON_STACK_HH
|
# define BISON_STACK_HH
|
||||||
|
|||||||
+107
-55
@@ -1,6 +1,6 @@
|
|||||||
# Java skeleton for Bison -*- autoconf -*-
|
# Java skeleton for Bison -*- autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
# Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,7 +25,7 @@ m4_ifval(m4_defn([b4_symbol_destructors]),
|
|||||||
m4_divert_push(0)dnl
|
m4_divert_push(0)dnl
|
||||||
@output(b4_parser_file_name@)@
|
@output(b4_parser_file_name@)@
|
||||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
||||||
[2007, 2008])
|
[2007-2011])
|
||||||
|
|
||||||
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
||||||
])[/* First part of user declarations. */
|
])[/* First part of user declarations. */
|
||||||
@@ -102,7 +102,7 @@ b4_token_enums(b4_tokens)
|
|||||||
private ]b4_location_type[ yylloc (YYStack rhs, int n)
|
private ]b4_location_type[ yylloc (YYStack rhs, int n)
|
||||||
{
|
{
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
|
return new ]b4_location_type[ (rhs.locationAt (n-1).begin, rhs.locationAt (0).end);
|
||||||
else
|
else
|
||||||
return new ]b4_location_type[ (rhs.locationAt (0).end);
|
return new ]b4_location_type[ (rhs.locationAt (0).end);
|
||||||
}]])[
|
}]])[
|
||||||
@@ -255,14 +255,14 @@ b4_lexer_if([[
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void pop () {
|
public final void pop () {
|
||||||
height--;
|
pop (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void pop (int num) {
|
public final void pop (int num) {
|
||||||
// Avoid memory leaks... garbage collection is a white lie!
|
// Avoid memory leaks... garbage collection is a white lie!
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
java.util.Arrays.fill (valueStack, height - num + 1, height, null);
|
java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);
|
||||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
|
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
|
||||||
}
|
}
|
||||||
height -= num;
|
height -= num;
|
||||||
}
|
}
|
||||||
@@ -284,7 +284,7 @@ b4_lexer_if([[
|
|||||||
{
|
{
|
||||||
out.print ("Stack now");
|
out.print ("Stack now");
|
||||||
|
|
||||||
for (int i = 0; i < height; i++)
|
for (int i = 0; i <= height; i++)
|
||||||
{
|
{
|
||||||
out.print (' ');
|
out.print (' ');
|
||||||
out.print (stateStack[i]);
|
out.print (stateStack[i]);
|
||||||
@@ -308,11 +308,9 @@ b4_lexer_if([[
|
|||||||
* printing an error message. */
|
* printing an error message. */
|
||||||
public static final int YYERROR = 2;
|
public static final int YYERROR = 2;
|
||||||
|
|
||||||
/**
|
// Internal return codes that are not supported for user semantic
|
||||||
* Returned by a Bison action in order to print an error message and start
|
// actions.
|
||||||
* error recovery. */
|
private static final int YYERRLAB = 3;
|
||||||
public static final int YYFAIL = 3;
|
|
||||||
|
|
||||||
private static final int YYNEWSTATE = 4;
|
private static final int YYNEWSTATE = 4;
|
||||||
private static final int YYDEFAULT = 5;
|
private static final int YYDEFAULT = 5;
|
||||||
private static final int YYREDUCE = 6;
|
private static final int YYREDUCE = 6;
|
||||||
@@ -489,7 +487,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
|
|
||||||
/* Take a decision. First try without lookahead. */
|
/* Take a decision. First try without lookahead. */
|
||||||
yyn = yypact_[yystate];
|
yyn = yypact_[yystate];
|
||||||
if (yyn == yypact_ninf_)
|
if (yy_pact_value_is_default_ (yyn))
|
||||||
{
|
{
|
||||||
label = YYDEFAULT;
|
label = YYDEFAULT;
|
||||||
break;
|
break;
|
||||||
@@ -528,8 +526,8 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
/* <= 0 means reduce or error. */
|
/* <= 0 means reduce or error. */
|
||||||
else if ((yyn = yytable_[yyn]) <= 0)
|
else if ((yyn = yytable_[yyn]) <= 0)
|
||||||
{
|
{
|
||||||
if (yyn == 0 || yyn == yytable_ninf_)
|
if (yy_table_value_is_error_ (yyn))
|
||||||
label = YYFAIL;
|
label = YYERRLAB;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yyn = -yyn;
|
yyn = -yyn;
|
||||||
@@ -563,7 +561,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
case YYDEFAULT:
|
case YYDEFAULT:
|
||||||
yyn = yydefact_[yystate];
|
yyn = yydefact_[yystate];
|
||||||
if (yyn == 0)
|
if (yyn == 0)
|
||||||
label = YYFAIL;
|
label = YYERRLAB;
|
||||||
else
|
else
|
||||||
label = YYREDUCE;
|
label = YYREDUCE;
|
||||||
break;
|
break;
|
||||||
@@ -580,12 +578,14 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
/*------------------------------------.
|
/*------------------------------------.
|
||||||
| yyerrlab -- here on detecting error |
|
| yyerrlab -- here on detecting error |
|
||||||
`------------------------------------*/
|
`------------------------------------*/
|
||||||
case YYFAIL:
|
case YYERRLAB:
|
||||||
/* If not already recovering from an error, report this error. */
|
/* If not already recovering from an error, report this error. */
|
||||||
if (yyerrstatus_ == 0)
|
if (yyerrstatus_ == 0)
|
||||||
{
|
{
|
||||||
++yynerrs_;
|
++yynerrs_;
|
||||||
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
if (yychar == yyempty_)
|
||||||
|
yytoken = yyempty_;
|
||||||
|
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_locations_if([yyerrloc = yylloc;])[
|
]b4_locations_if([yyerrloc = yylloc;])[
|
||||||
@@ -632,7 +632,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
yyn = yypact_[yystate];
|
yyn = yypact_[yystate];
|
||||||
if (yyn != yypact_ninf_)
|
if (!yy_pact_value_is_default_ (yyn))
|
||||||
{
|
{
|
||||||
yyn += yyterror_;
|
yyn += yyterror_;
|
||||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||||
@@ -685,44 +685,96 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
{
|
{
|
||||||
if (errorVerbose)
|
if (errorVerbose)
|
||||||
{
|
{
|
||||||
int yyn = yypact_[yystate];
|
/* There are many possibilities here to consider:
|
||||||
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
- Assume YYFAIL is not used. It's too flawed to consider.
|
||||||
|
See
|
||||||
|
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
|
||||||
|
for details. YYERROR is fine as it does not invoke this
|
||||||
|
function.
|
||||||
|
- If this state is a consistent state with a default action,
|
||||||
|
then the only way this function was invoked is if the
|
||||||
|
default action is an error action. In that case, don't
|
||||||
|
check for expected tokens because there are none.
|
||||||
|
- The only way there can be no lookahead present (in tok) is
|
||||||
|
if this state is a consistent state with a default action.
|
||||||
|
Thus, detecting the absence of a lookahead is sufficient to
|
||||||
|
determine that there is no unexpected or expected token to
|
||||||
|
report. In that case, just report a simple "syntax error".
|
||||||
|
- Don't assume there isn't a lookahead just because this
|
||||||
|
state is a consistent state with a default action. There
|
||||||
|
might have been a previous inconsistent state, consistent
|
||||||
|
state with a non-default action, or user semantic action
|
||||||
|
that manipulated yychar. (However, yychar is currently out
|
||||||
|
of scope during semantic actions.)
|
||||||
|
- Of course, the expected token list depends on states to
|
||||||
|
have correct lookahead information, and it depends on the
|
||||||
|
parser not to perform extra reductions after fetching a
|
||||||
|
lookahead from the scanner and before detecting a syntax
|
||||||
|
error. Thus, state merging (from LALR or IELR) and default
|
||||||
|
reductions corrupt the expected token list. However, the
|
||||||
|
list is correct for canonical LR with one exception: it
|
||||||
|
will still contain any token that will not be accepted due
|
||||||
|
to an error action in a later state.
|
||||||
|
*/
|
||||||
|
if (tok != yyempty_)
|
||||||
{
|
{
|
||||||
StringBuffer res;
|
// FIXME: This method of building the message is not compatible
|
||||||
|
// with internationalization.
|
||||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
StringBuffer res =
|
||||||
YYCHECK. */
|
new StringBuffer ("syntax error, unexpected ");
|
||||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
res.append (yytnamerr_ (yytname_[tok]));
|
||||||
|
int yyn = yypact_[yystate];
|
||||||
/* Stay within bounds of both yycheck and yytname. */
|
if (!yy_pact_value_is_default_ (yyn))
|
||||||
int yychecklim = yylast_ - yyn + 1;
|
{
|
||||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
/* Start YYX at -YYN if negative to avoid negative
|
||||||
int count = 0;
|
indexes in YYCHECK. In other words, skip the first
|
||||||
for (int x = yyxbegin; x < yyxend; ++x)
|
-YYN actions for this state because they are default
|
||||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
actions. */
|
||||||
++count;
|
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||||
|
/* Stay within bounds of both yycheck and yytname. */
|
||||||
// FIXME: This method of building the message is not compatible
|
int yychecklim = yylast_ - yyn + 1;
|
||||||
// with internationalization.
|
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||||
res = new StringBuffer ("syntax error, unexpected ");
|
int count = 0;
|
||||||
res.append (yytnamerr_ (yytname_[tok]));
|
for (int x = yyxbegin; x < yyxend; ++x)
|
||||||
if (count < 5)
|
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||||
{
|
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||||
count = 0;
|
++count;
|
||||||
for (int x = yyxbegin; x < yyxend; ++x)
|
if (count < 5)
|
||||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
{
|
||||||
{
|
count = 0;
|
||||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
for (int x = yyxbegin; x < yyxend; ++x)
|
||||||
res.append (yytnamerr_ (yytname_[x]));
|
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||||
}
|
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||||
}
|
{
|
||||||
return res.toString ();
|
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||||
|
res.append (yytnamerr_ (yytname_[x]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res.toString ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "syntax error";
|
return "syntax error";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the given <code>yypact_</code> value indicates a defaulted state.
|
||||||
|
* @@param yyvalue the value to check
|
||||||
|
*/
|
||||||
|
private static boolean yy_pact_value_is_default_ (int yyvalue)
|
||||||
|
{
|
||||||
|
return yyvalue == yypact_ninf_;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the given <code>yytable_</code> value indicates a syntax error.
|
||||||
|
* @@param yyvalue the value to check
|
||||||
|
*/
|
||||||
|
private static boolean yy_table_value_is_error_ (int yyvalue)
|
||||||
|
{
|
||||||
|
return yyvalue == yytable_ninf_;
|
||||||
|
}
|
||||||
|
|
||||||
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
||||||
STATE-NUM. */
|
STATE-NUM. */
|
||||||
@@ -732,9 +784,9 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
]b4_pact[
|
]b4_pact[
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
|
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||||
doesn't specify something else to do. Zero means the default is an
|
YYTABLE doesn't specify something else to do. Zero means the
|
||||||
error. */
|
default is an error. */
|
||||||
private static final ]b4_int_type_for([b4_defact])[ yydefact_[] =
|
private static final ]b4_int_type_for([b4_defact])[ yydefact_[] =
|
||||||
{
|
{
|
||||||
]b4_defact[
|
]b4_defact[
|
||||||
@@ -755,7 +807,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
|
|
||||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||||
positive, shift that token. If negative, reduce the rule which
|
positive, shift that token. If negative, reduce the rule which
|
||||||
number is the opposite. If zero, do what YYDEFACT says. */
|
number is the opposite. If YYTABLE_NINF_, syntax error. */
|
||||||
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
|
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
|
||||||
private static final ]b4_int_type_for([b4_table])[
|
private static final ]b4_int_type_for([b4_table])[
|
||||||
yytable_[] =
|
yytable_[] =
|
||||||
|
|||||||
+3
-4
@@ -1,7 +1,6 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009
|
# Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,7 +20,7 @@ m4_changecom()
|
|||||||
m4_divert_push(0)dnl
|
m4_divert_push(0)dnl
|
||||||
@output(b4_dir_prefix[]position.hh@)@
|
@output(b4_dir_prefix[]position.hh@)@
|
||||||
b4_copyright([Positions for Bison parsers in C++],
|
b4_copyright([Positions for Bison parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006, 2007, 2009])[
|
[2002-2007, 2009-2011])[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** \file position.hh
|
** \file position.hh
|
||||||
@@ -146,7 +145,7 @@ b4_copyright([Positions for Bison parsers in C++],
|
|||||||
#endif // not BISON_POSITION_HH]
|
#endif // not BISON_POSITION_HH]
|
||||||
@output(b4_dir_prefix[]location.hh@)@
|
@output(b4_dir_prefix[]location.hh@)@
|
||||||
b4_copyright([Locations for Bison parsers in C++],
|
b4_copyright([Locations for Bison parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006, 2007, 2009])[
|
[2002-2007, 2009-2011])[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** \file location.hh
|
** \file location.hh
|
||||||
|
|||||||
@@ -1,400 +0,0 @@
|
|||||||
# -*- Autoconf -*-
|
|
||||||
# This file is part of Autoconf.
|
|
||||||
# foreach-based replacements for recursive functions.
|
|
||||||
# Speeds up GNU M4 1.4.x by avoiding quadratic $@ recursion, but penalizes
|
|
||||||
# GNU M4 1.6 by requiring more memory and macro expansions.
|
|
||||||
#
|
|
||||||
# Copyright (C) 2008 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# As a special exception, the Free Software Foundation gives unlimited
|
|
||||||
# permission to copy, distribute and modify the configure scripts that
|
|
||||||
# are the output of Autoconf. You need not follow the terms of the GNU
|
|
||||||
# General Public License when using or distributing such scripts, even
|
|
||||||
# though portions of the text of Autoconf appear in them. The GNU
|
|
||||||
# General Public License (GPL) does govern all other use of the material
|
|
||||||
# that constitutes the Autoconf program.
|
|
||||||
#
|
|
||||||
# Certain portions of the Autoconf source text are designed to be copied
|
|
||||||
# (in certain cases, depending on the input) into the output of
|
|
||||||
# Autoconf. We call these the "data" portions. The rest of the Autoconf
|
|
||||||
# source text consists of comments plus executable code that decides which
|
|
||||||
# of the data portions to output in any given case. We call these
|
|
||||||
# comments and executable code the "non-data" portions. Autoconf never
|
|
||||||
# copies any of the non-data portions into its output.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of Autoconf
|
|
||||||
# released by the Free Software Foundation. When you make and
|
|
||||||
# distribute a modified version of Autoconf, you may extend this special
|
|
||||||
# exception to the GPL to apply to your modified version as well, *unless*
|
|
||||||
# your modified version has the potential to copy into its output some
|
|
||||||
# of the text that was the non-data portion of the version that you started
|
|
||||||
# with. (In other words, unless your change moves or copies text from
|
|
||||||
# the non-data portions to the data portions.) If your modification has
|
|
||||||
# such potential, you must delete any notice of this special exception
|
|
||||||
# to the GPL from your modified version.
|
|
||||||
#
|
|
||||||
# Written by Eric Blake.
|
|
||||||
#
|
|
||||||
|
|
||||||
# In M4 1.4.x, every byte of $@ is rescanned. This means that an
|
|
||||||
# algorithm on n arguments that recurses with one less argument each
|
|
||||||
# iteration will scan n * (n + 1) / 2 arguments, for O(n^2) time. In
|
|
||||||
# M4 1.6, this was fixed so that $@ is only scanned once, then
|
|
||||||
# back-references are made to information stored about the scan.
|
|
||||||
# Thus, n iterations need only scan n arguments, for O(n) time.
|
|
||||||
# Additionally, in M4 1.4.x, recursive algorithms did not clean up
|
|
||||||
# memory very well, requiring O(n^2) memory rather than O(n) for n
|
|
||||||
# iterations.
|
|
||||||
#
|
|
||||||
# This file is designed to overcome the quadratic nature of $@
|
|
||||||
# recursion by writing a variant of m4_foreach that uses m4_for rather
|
|
||||||
# than $@ recursion to operate on the list. This involves more macro
|
|
||||||
# expansions, but avoids the need to rescan a quadratic number of
|
|
||||||
# arguments, making these replacements very attractive for M4 1.4.x.
|
|
||||||
# On the other hand, in any version of M4, expanding additional macros
|
|
||||||
# costs additional time; therefore, in M4 1.6, where $@ recursion uses
|
|
||||||
# fewer macros, these replacements actually pessimize performance.
|
|
||||||
# Additionally, the use of $10 to mean the tenth argument violates
|
|
||||||
# POSIX; although all versions of m4 1.4.x support this meaning, a
|
|
||||||
# future m4 version may switch to take it as the first argument
|
|
||||||
# concatenated with a literal 0, so the implementations in this file
|
|
||||||
# are not future-proof. Thus, this file is conditionally included as
|
|
||||||
# part of m4_init(), only when it is detected that M4 probably has
|
|
||||||
# quadratic behavior (ie. it lacks the macro __m4_version__).
|
|
||||||
#
|
|
||||||
# Please keep this file in sync with m4sugar.m4.
|
|
||||||
|
|
||||||
# m4_foreach(VARIABLE, LIST, EXPRESSION)
|
|
||||||
# --------------------------------------
|
|
||||||
# Expand EXPRESSION assigning each value of the LIST to VARIABLE.
|
|
||||||
# LIST should have the form `item_1, item_2, ..., item_n', i.e. the
|
|
||||||
# whole list must *quoted*. Quote members too if you don't want them
|
|
||||||
# to be expanded.
|
|
||||||
#
|
|
||||||
# This version minimizes the number of times that $@ is evaluated by
|
|
||||||
# using m4_for to generate a boilerplate into VARIABLE then passing $@
|
|
||||||
# to that temporary macro. Thus, the recursion is done in m4_for
|
|
||||||
# without reparsing any user input, and is not quadratic. For an idea
|
|
||||||
# of how this works, note that m4_foreach(i,[1,2],[i]) defines i to be
|
|
||||||
# m4_define([$1],[$3])$2[]m4_define([$1],[$4])$2[]m4_popdef([i])
|
|
||||||
# then calls i([i],[i],[1],[2]).
|
|
||||||
m4_define([m4_foreach],
|
|
||||||
[m4_if([$2], [], [], [_$0([$1], [$3], $2)])])
|
|
||||||
|
|
||||||
m4_define([_m4_foreach],
|
|
||||||
[m4_define([$1], m4_pushdef([$1])_m4_for([$1], [3], [$#], [1],
|
|
||||||
[$0_([1], [2], _m4_defn([$1]))])[m4_popdef([$1])])m4_indir([$1], $@)])
|
|
||||||
|
|
||||||
m4_define([_m4_foreach_],
|
|
||||||
[[m4_define([$$1], [$$3])$$2[]]])
|
|
||||||
|
|
||||||
# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT)
|
|
||||||
# -----------------------------------------------------------
|
|
||||||
# Find the first VAL that SWITCH matches, and expand the corresponding
|
|
||||||
# IF-VAL. If there are no matches, expand DEFAULT.
|
|
||||||
#
|
|
||||||
# Use m4_for to create a temporary macro in terms of a boilerplate
|
|
||||||
# m4_if with final cleanup. If $# is even, we have DEFAULT; if it is
|
|
||||||
# odd, then rounding the last $# up in the temporary macro is
|
|
||||||
# harmless. For example, both m4_case(1,2,3,4,5) and
|
|
||||||
# m4_case(1,2,3,4,5,6) result in the intermediate _m4_case being
|
|
||||||
# m4_if([$1],[$2],[$3],[$1],[$4],[$5],_m4_popdef([_m4_case])[$6])
|
|
||||||
m4_define([m4_case],
|
|
||||||
[m4_if(m4_eval([$# <= 2]), [1], [$2],
|
|
||||||
[m4_pushdef([_$0], [m4_if(]m4_for([_m4_count], [2], m4_decr([$#]), [2],
|
|
||||||
[_$0_([1], _m4_count, m4_incr(_m4_count))])[_m4_popdef(
|
|
||||||
[_$0])]m4_dquote($m4_eval([($# + 1) & ~1]))[)])_$0($@)])])
|
|
||||||
|
|
||||||
m4_define([_m4_case_],
|
|
||||||
[[[$$1],[$$2],[$$3],]])
|
|
||||||
|
|
||||||
# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
|
|
||||||
# -----------------------------------------------------
|
|
||||||
# m4 equivalent of
|
|
||||||
#
|
|
||||||
# if (SWITCH =~ RE1)
|
|
||||||
# VAL1;
|
|
||||||
# elif (SWITCH =~ RE2)
|
|
||||||
# VAL2;
|
|
||||||
# elif ...
|
|
||||||
# ...
|
|
||||||
# else
|
|
||||||
# DEFAULT
|
|
||||||
#
|
|
||||||
# We build the temporary macro _m4_b:
|
|
||||||
# m4_define([_m4_b], _m4_defn([_m4_bmatch]))_m4_b([$1], [$2], [$3])...
|
|
||||||
# _m4_b([$1], [$m-1], [$m])_m4_b([], [], [$m+1]_m4_popdef([_m4_b]))
|
|
||||||
# then invoke m4_unquote(_m4_b($@)), for concatenation with later text.
|
|
||||||
m4_define([m4_bmatch],
|
|
||||||
[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
|
|
||||||
[$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
|
|
||||||
[$#], 2, [$2],
|
|
||||||
[m4_define([_m4_b], m4_pushdef([_m4_b])[m4_define([_m4_b],
|
|
||||||
_m4_defn([_$0]))]_m4_for([_m4_b], [3], m4_eval([($# + 1) / 2 * 2 - 1]),
|
|
||||||
[2], [_$0_([1], m4_decr(_m4_b), _m4_b)])[_m4_b([], [],]m4_dquote(
|
|
||||||
[$]m4_incr(_m4_b))[_m4_popdef([_m4_b]))])m4_unquote(_m4_b($@))])])
|
|
||||||
|
|
||||||
m4_define([_m4_bmatch],
|
|
||||||
[m4_if(m4_bregexp([$1], [$2]), [-1], [], [[$3]m4_define([$0])])])
|
|
||||||
|
|
||||||
m4_define([_m4_bmatch_],
|
|
||||||
[[_m4_b([$$1], [$$2], [$$3])]])
|
|
||||||
|
|
||||||
|
|
||||||
# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT])
|
|
||||||
# -------------------------------------------------------------------
|
|
||||||
# Similar to m4_if, except that each TEST is expanded when encountered.
|
|
||||||
# If the expansion of TESTn matches the string VALn, the result is IF-VALn.
|
|
||||||
# The result is DEFAULT if no tests passed. This macro allows
|
|
||||||
# short-circuiting of expensive tests, where it pays to arrange quick
|
|
||||||
# filter tests to run first.
|
|
||||||
#
|
|
||||||
# m4_cond already guarantees either 3*n or 3*n + 1 arguments, 1 <= n.
|
|
||||||
# We only have to speed up _m4_cond, by building the temporary _m4_c:
|
|
||||||
# m4_define([_m4_c], _m4_defn([m4_unquote]))_m4_c([m4_if(($1), [($2)],
|
|
||||||
# [[$3]m4_define([_m4_c])])])_m4_c([m4_if(($4), [($5)],
|
|
||||||
# [[$6]m4_define([_m4_c])])])..._m4_c([m4_if(($m-2), [($m-1)],
|
|
||||||
# [[$m]m4_define([_m4_c])])])_m4_c([[$m+1]]_m4_popdef([_m4_c]))
|
|
||||||
# We invoke m4_unquote(_m4_c($@)), for concatenation with later text.
|
|
||||||
m4_define([_m4_cond],
|
|
||||||
[m4_define([_m4_c], m4_pushdef([_m4_c])[m4_define([_m4_c],
|
|
||||||
_m4_defn([m4_unquote]))]_m4_for([_m4_c], [2], m4_eval([$# / 3 * 3 - 1]), [3],
|
|
||||||
[$0_(m4_decr(_m4_c), _m4_c, m4_incr(_m4_c))])[_m4_c(]m4_dquote(m4_dquote(
|
|
||||||
[$]m4_eval([$# / 3 * 3 + 1])))[_m4_popdef([_m4_c]))])m4_unquote(_m4_c($@))])
|
|
||||||
|
|
||||||
m4_define([_m4_cond_],
|
|
||||||
[[_m4_c([m4_if(($$1), [($$2)], [[$$3]m4_define([_m4_c])])])]])
|
|
||||||
|
|
||||||
# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
|
|
||||||
# ----------------------------------------------------
|
|
||||||
# m4 equivalent of
|
|
||||||
#
|
|
||||||
# $_ = STRING;
|
|
||||||
# s/RE1/SUBST1/g;
|
|
||||||
# s/RE2/SUBST2/g;
|
|
||||||
# ...
|
|
||||||
#
|
|
||||||
# m4_bpatsubsts already validated an odd number of arguments; we only
|
|
||||||
# need to speed up _m4_bpatsubsts. To avoid nesting, we build the
|
|
||||||
# temporary _m4_p:
|
|
||||||
# m4_define([_m4_p], [$1])m4_define([_m4_p],
|
|
||||||
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$2], [$3]))m4_define([_m4_p],
|
|
||||||
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$4], [$5]))m4_define([_m4_p],...
|
|
||||||
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$m-1], [$m]))m4_unquote(
|
|
||||||
# _m4_defn([_m4_p])_m4_popdef([_m4_p]))
|
|
||||||
m4_define([_m4_bpatsubsts],
|
|
||||||
[m4_define([_m4_p], m4_pushdef([_m4_p])[m4_define([_m4_p],
|
|
||||||
]m4_dquote([$]1)[)]_m4_for([_m4_p], [3], [$#], [2], [$0_(m4_decr(_m4_p),
|
|
||||||
_m4_p)])[m4_unquote(_m4_defn([_m4_p])_m4_popdef([_m4_p]))])_m4_p($@)])
|
|
||||||
|
|
||||||
m4_define([_m4_bpatsubsts_],
|
|
||||||
[[m4_define([_m4_p],
|
|
||||||
m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$$1], [$$2]))]])
|
|
||||||
|
|
||||||
# m4_shiftn(N, ...)
|
|
||||||
# -----------------
|
|
||||||
# Returns ... shifted N times. Useful for recursive "varargs" constructs.
|
|
||||||
#
|
|
||||||
# m4_shiftn already validated arguments; we only need to speed up
|
|
||||||
# _m4_shiftn. If N is 3, then we build the temporary _m4_s, defined as
|
|
||||||
# ,[$5],[$6],...,[$m]_m4_popdef([_m4_s])
|
|
||||||
# before calling m4_shift(_m4_s($@)).
|
|
||||||
m4_define([_m4_shiftn],
|
|
||||||
[m4_if(m4_incr([$1]), [$#], [], [m4_define([_m4_s],
|
|
||||||
m4_pushdef([_m4_s])_m4_for([_m4_s], m4_eval([$1 + 2]), [$#], [1],
|
|
||||||
[[,]m4_dquote([$]_m4_s)])[_m4_popdef([_m4_s])])m4_shift(_m4_s($@))])])
|
|
||||||
|
|
||||||
# m4_do(STRING, ...)
|
|
||||||
# ------------------
|
|
||||||
# This macro invokes all its arguments (in sequence, of course). It is
|
|
||||||
# useful for making your macros more structured and readable by dropping
|
|
||||||
# unnecessary dnl's and have the macros indented properly.
|
|
||||||
#
|
|
||||||
# Here, we use the temporary macro _m4_do, defined as
|
|
||||||
# $1[]$2[]...[]$n[]_m4_popdef([_m4_do])
|
|
||||||
m4_define([m4_do],
|
|
||||||
[m4_if([$#], [0], [],
|
|
||||||
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [1], [$#], [1],
|
|
||||||
[$_$0[[]]])[_m4_popdef([_$0])])_$0($@)])])
|
|
||||||
|
|
||||||
# m4_dquote_elt(ARGS)
|
|
||||||
# -------------------
|
|
||||||
# Return ARGS as an unquoted list of double-quoted arguments.
|
|
||||||
#
|
|
||||||
# m4_foreach to the rescue. It's easier to shift off the leading comma.
|
|
||||||
m4_define([m4_dquote_elt],
|
|
||||||
[m4_shift(m4_foreach([_m4_elt], [$@], [,m4_dquote(_m4_defn([_m4_elt]))]))])
|
|
||||||
|
|
||||||
# m4_reverse(ARGS)
|
|
||||||
# ----------------
|
|
||||||
# Output ARGS in reverse order.
|
|
||||||
#
|
|
||||||
# Invoke _m4_r($@) with the temporary _m4_r built as
|
|
||||||
# [$m], [$m-1], ..., [$2], [$1]_m4_popdef([_m4_r])
|
|
||||||
m4_define([m4_reverse],
|
|
||||||
[m4_if([$#], [0], [], [$#], [1], [[$1]],
|
|
||||||
[m4_define([_m4_r], m4_dquote([$$#])m4_pushdef([_m4_r])_m4_for([_m4_r],
|
|
||||||
m4_decr([$#]), [1], [-1],
|
|
||||||
[[, ]m4_dquote([$]_m4_r)])[_m4_popdef([_m4_r])])_m4_r($@)])])
|
|
||||||
|
|
||||||
|
|
||||||
# m4_map(MACRO, LIST)
|
|
||||||
# -------------------
|
|
||||||
# Invoke MACRO($1), MACRO($2) etc. where $1, $2... are the elements
|
|
||||||
# of LIST. $1, $2... must in turn be lists, appropriate for m4_apply.
|
|
||||||
#
|
|
||||||
# m4_map/m4_map_sep only execute once; the speedup comes in fixing
|
|
||||||
# _m4_map. The mismatch in () is intentional, since $1 supplies the
|
|
||||||
# opening `(' (but it sure looks odd!). Build the temporary _m4_m:
|
|
||||||
# $1, [$3])$1, [$4])...$1, [$m])_m4_popdef([_m4_m])
|
|
||||||
m4_define([_m4_map],
|
|
||||||
[m4_if([$#], [2], [],
|
|
||||||
[m4_define([_m4_m], m4_pushdef([_m4_m])_m4_for([_m4_m], [3], [$#], [1],
|
|
||||||
[$0_([1], _m4_m)])[_m4_popdef([_m4_m])])_m4_m($@)])])
|
|
||||||
|
|
||||||
m4_define([_m4_map_],
|
|
||||||
[[$$1, [$$2])]])
|
|
||||||
|
|
||||||
# m4_transform(EXPRESSION, ARG...)
|
|
||||||
# --------------------------------
|
|
||||||
# Expand EXPRESSION([ARG]) for each argument. More efficient than
|
|
||||||
# m4_foreach([var], [ARG...], [EXPRESSION(m4_defn([var]))])
|
|
||||||
#
|
|
||||||
# Invoke the temporary macro _m4_transform, defined as:
|
|
||||||
# $1([$2])[]$1([$3])[]...$1([$m])[]_m4_popdef([_m4_transform])
|
|
||||||
m4_define([m4_transform],
|
|
||||||
[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
|
|
||||||
[$#], [1], [],
|
|
||||||
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [2], [$#], [1],
|
|
||||||
[_$0_([1], _$0)])[_m4_popdef([_$0])])_$0($@)])])
|
|
||||||
|
|
||||||
m4_define([_m4_transform_],
|
|
||||||
[[$$1([$$2])[]]])
|
|
||||||
|
|
||||||
# m4_transform_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...)
|
|
||||||
# --------------------------------------------------------------
|
|
||||||
# Perform a pairwise grouping of consecutive ARGs, by expanding
|
|
||||||
# EXPRESSION([ARG1], [ARG2]). If there are an odd number of ARGs, the
|
|
||||||
# final argument is expanded with END-EXPR([ARGn]).
|
|
||||||
#
|
|
||||||
# Build the temporary macro _m4_transform_pair, with the $2([$m+1])
|
|
||||||
# only output if $# is odd:
|
|
||||||
# $1([$3], [$4])[]$1([$5], [$6])[]...$1([$m-1],
|
|
||||||
# [$m])[]m4_default([$2], [$1])([$m+1])[]_m4_popdef([_m4_transform_pair])
|
|
||||||
m4_define([m4_transform_pair],
|
|
||||||
[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
|
|
||||||
[$#], [1], [m4_fatal([$0: too few arguments: $#: $1])],
|
|
||||||
[$#], [2], [],
|
|
||||||
[$#], [3], [m4_default([$2], [$1])([$3])[]],
|
|
||||||
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [3],
|
|
||||||
m4_eval([$# / 2 * 2 - 1]), [2], [_$0_([1], _$0, m4_incr(_$0))])_$0_end(
|
|
||||||
[1], [2], [$#])[_m4_popdef([_$0])])_$0($@)])])
|
|
||||||
|
|
||||||
m4_define([_m4_transform_pair_],
|
|
||||||
[[$$1([$$2], [$$3])[]]])
|
|
||||||
|
|
||||||
m4_define([_m4_transform_pair_end],
|
|
||||||
[m4_if(m4_eval([$3 & 1]), [1], [[m4_default([$$2], [$$1])([$$3])[]]])])
|
|
||||||
|
|
||||||
# m4_join(SEP, ARG1, ARG2...)
|
|
||||||
# ---------------------------
|
|
||||||
# Produce ARG1SEPARG2...SEPARGn. Avoid back-to-back SEP when a given ARG
|
|
||||||
# is the empty string. No expansion is performed on SEP or ARGs.
|
|
||||||
#
|
|
||||||
# Use a self-modifying separator, since we don't know how many
|
|
||||||
# arguments might be skipped before a separator is first printed, but
|
|
||||||
# be careful if the separator contains $. m4_foreach to the rescue.
|
|
||||||
m4_define([m4_join],
|
|
||||||
[m4_pushdef([_m4_sep], [m4_define([_m4_sep], _m4_defn([m4_echo]))])]dnl
|
|
||||||
[m4_foreach([_m4_arg], [m4_shift($@)],
|
|
||||||
[m4_ifset([_m4_arg], [_m4_sep([$1])_m4_defn([_m4_arg])])])]dnl
|
|
||||||
[_m4_popdef([_m4_sep])])
|
|
||||||
|
|
||||||
# m4_joinall(SEP, ARG1, ARG2...)
|
|
||||||
# ------------------------------
|
|
||||||
# Produce ARG1SEPARG2...SEPARGn. An empty ARG results in back-to-back SEP.
|
|
||||||
# No expansion is performed on SEP or ARGs.
|
|
||||||
#
|
|
||||||
# A bit easier than m4_join. m4_foreach to the rescue.
|
|
||||||
m4_define([m4_joinall],
|
|
||||||
[[$2]m4_if(m4_eval([$# <= 2]), [1], [],
|
|
||||||
[m4_foreach([_m4_arg], [m4_shift2($@)],
|
|
||||||
[[$1]_m4_defn([_m4_arg])])])])
|
|
||||||
|
|
||||||
# m4_list_cmp(A, B)
|
|
||||||
# -----------------
|
|
||||||
# Compare the two lists of integer expressions A and B.
|
|
||||||
#
|
|
||||||
# m4_list_cmp takes care of any side effects; we only override
|
|
||||||
# _m4_list_cmp_raw, where we can safely expand lists multiple times.
|
|
||||||
# First, insert padding so that both lists are the same length; the
|
|
||||||
# trailing +0 is necessary to handle a missing list. Next, create a
|
|
||||||
# temporary macro to perform pairwise comparisons until an inequality
|
|
||||||
# is found. For example, m4_list_cmp([1], [1,2]) creates _m4_cmp as
|
|
||||||
# m4_if(m4_eval([($1) != ($3)]), [1], [m4_cmp([$1], [$3])],
|
|
||||||
# m4_eval([($2) != ($4)]), [1], [m4_cmp([$2], [$4])],
|
|
||||||
# [0]_m4_popdef([_m4_cmp], [_m4_size]))
|
|
||||||
# then calls _m4_cmp([1+0], [0], [1], [2+0])
|
|
||||||
m4_define([_m4_list_cmp_raw],
|
|
||||||
[m4_if([$1], [$2], 0, [m4_pushdef(
|
|
||||||
[_m4_size])_m4_list_cmp($1+0_m4_list_pad(m4_count($1), m4_count($2)),
|
|
||||||
$2+0_m4_list_pad(m4_count($2), m4_count($1)))])])
|
|
||||||
|
|
||||||
m4_define([_m4_list_pad],
|
|
||||||
[m4_if(m4_eval($1 < $2), [1],
|
|
||||||
[_m4_for([_m4_size], m4_incr([$1]), [$2], [1], [,0])])])
|
|
||||||
|
|
||||||
m4_define([_m4_list_cmp],
|
|
||||||
[m4_define([_m4_size], m4_eval([$# >> 1]))]dnl
|
|
||||||
[m4_define([_m4_cmp], m4_pushdef([_m4_cmp])[m4_if(]_m4_for([_m4_cmp],
|
|
||||||
[1], _m4_size, [1], [$0_(_m4_cmp, m4_eval(_m4_cmp + _m4_size))])[
|
|
||||||
[0]_m4_popdef([_m4_cmp], [_m4_size]))])_m4_cmp($@)])
|
|
||||||
|
|
||||||
m4_define([_m4_list_cmp_],
|
|
||||||
[[m4_eval([($$1) != ($$2)]), [1], [m4_cmp([$$1], [$$2])],
|
|
||||||
]])
|
|
||||||
|
|
||||||
# m4_max(EXPR, ...)
|
|
||||||
# m4_min(EXPR, ...)
|
|
||||||
# -----------------
|
|
||||||
# Return the decimal value of the maximum (or minimum) in a series of
|
|
||||||
# integer expressions.
|
|
||||||
#
|
|
||||||
# m4_foreach to the rescue; we only need to replace _m4_minmax. Here,
|
|
||||||
# we need a temporary macro to track the best answer so far, so that
|
|
||||||
# the foreach expression is tractable.
|
|
||||||
m4_define([_m4_minmax],
|
|
||||||
[m4_pushdef([_m4_best], m4_eval([$2]))m4_foreach([_m4_arg], [m4_shift2($@)],
|
|
||||||
[m4_define([_m4_best], $1(_m4_best, _m4_defn([_m4_arg])))])]dnl
|
|
||||||
[_m4_best[]_m4_popdef([_m4_best])])
|
|
||||||
|
|
||||||
# m4_set_add_all(SET, VALUE...)
|
|
||||||
# -----------------------------
|
|
||||||
# Add each VALUE into SET. This is O(n) in the number of VALUEs, and
|
|
||||||
# can be faster than calling m4_set_add for each VALUE.
|
|
||||||
#
|
|
||||||
# m4_foreach to the rescue. If no deletions have occurred, then avoid
|
|
||||||
# the speed penalty of m4_set_add.
|
|
||||||
m4_define([m4_set_add_all],
|
|
||||||
[m4_if([$#], [0], [], [$#], [1], [],
|
|
||||||
[m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1])
|
|
||||||
+ m4_len(m4_foreach([_m4_arg], [m4_shift($@)],
|
|
||||||
m4_ifdef([_m4_set_cleanup($1)],
|
|
||||||
[[m4_set_add([$1], _m4_defn([_m4_arg]))]],
|
|
||||||
[[m4_ifdef([_m4_set([$1],]_m4_defn([_m4_arg])[)], [],
|
|
||||||
[m4_define([_m4_set([$1],]_m4_defn([_m4_arg])[)],
|
|
||||||
[1])m4_pushdef([_m4_set([$1])],
|
|
||||||
_m4_defn([_m4_arg]))-])]])))))])])
|
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../submodules/autoconf/lib/m4sugar/foreach.m4
|
||||||
File diff suppressed because it is too large
Load Diff
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../../submodules/autoconf/lib/m4sugar/m4sugar.m4
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
bison.xsl - common templates for Bison XSLT.
|
bison.xsl - common templates for Bison XSLT.
|
||||||
|
|
||||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+22
-6
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||||
|
|
||||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -35,11 +35,27 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="bison-xml-report">
|
<xsl:template match="bison-xml-report">
|
||||||
<xsl:apply-templates select="automaton"/>
|
<xsl:text>// Generated by GNU Bison </xsl:text>
|
||||||
|
<xsl:value-of select="@version"/>
|
||||||
|
<xsl:text>. </xsl:text>
|
||||||
|
<xsl:text>// Report bugs to <</xsl:text>
|
||||||
|
<xsl:value-of select="@bug-report"/>
|
||||||
|
<xsl:text>>. </xsl:text>
|
||||||
|
<xsl:text>// Home page: <</xsl:text>
|
||||||
|
<xsl:value-of select="@url"/>
|
||||||
|
<xsl:text>>. </xsl:text>
|
||||||
|
<xsl:apply-templates select="automaton">
|
||||||
|
<xsl:with-param name="filename" select="filename"/>
|
||||||
|
</xsl:apply-templates>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="automaton">
|
<xsl:template match="automaton">
|
||||||
<xsl:text>digraph Automaton { </xsl:text>
|
<xsl:param name="filename"/>
|
||||||
|
<xsl:text>digraph "</xsl:text>
|
||||||
|
<xsl:call-template name="escape">
|
||||||
|
<xsl:with-param name="subject" select="$filename"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:text>" { </xsl:text>
|
||||||
<xsl:apply-templates select="state"/>
|
<xsl:apply-templates select="state"/>
|
||||||
<xsl:text>} </xsl:text>
|
<xsl:text>} </xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
@@ -196,11 +212,11 @@
|
|||||||
<xsl:with-param name="search" select="$search"/>
|
<xsl:with-param name="search" select="$search"/>
|
||||||
<xsl:with-param name="replace" select="$replace"/>
|
<xsl:with-param name="replace" select="$replace"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$subject"/>
|
<xsl:value-of select="$subject"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
xml2text.xsl - transform Bison XML Report into plain text.
|
xml2text.xsl - transform Bison XML Report into plain text.
|
||||||
|
|
||||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||||
|
|
||||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -48,15 +48,15 @@
|
|||||||
font-size: 9pt;
|
font-size: 9pt;
|
||||||
}
|
}
|
||||||
a:link {
|
a:link {
|
||||||
color: #1f00ff;
|
color: #1f00ff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
a:visited {
|
a:visited {
|
||||||
color: #1f00ff;
|
color: #1f00ff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
#menu a {
|
#menu a {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
|||||||
+707
-315
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||||
# Requires GNU sed
|
# Requires GNU sed
|
||||||
|
|
||||||
## Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
## Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||||
|
|
||||||
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ Rem Configure Bison for DJGPP.
|
|||||||
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||||
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||||
|
|
||||||
Rem Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Rem This program is free software: you can redistribute it and/or modify
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
Rem it under the terms of the GNU General Public License as published by
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-2
@@ -2,8 +2,7 @@
|
|||||||
# Sed script for additional DJGPP specific editing
|
# Sed script for additional DJGPP specific editing
|
||||||
# of the configure script generated by autoconf 2.62.
|
# of the configure script generated by autoconf 2.62.
|
||||||
|
|
||||||
|
# Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
# This is the config.site file for configuring GNU packages
|
# This is the config.site file for configuring GNU packages
|
||||||
# which are to be built with DJGPP tools.
|
# which are to be built with DJGPP tools.
|
||||||
|
|
||||||
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# sed script for DJGPP specific editing of config.hin
|
# sed script for DJGPP specific editing of config.hin
|
||||||
|
|
||||||
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ Rem This batch file unpacks the Bison distribution while simultaneously
|
|||||||
Rem renaming some of the files whose names are invalid on DOS or conflict
|
Rem renaming some of the files whose names are invalid on DOS or conflict
|
||||||
Rem with other file names after truncation to DOS 8+3 namespace.
|
Rem with other file names after truncation to DOS 8+3 namespace.
|
||||||
Rem
|
Rem
|
||||||
Rem Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||||
Rem
|
Rem
|
||||||
Rem This program is free software: you can redistribute it and/or modify
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
Rem it under the terms of the GNU General Public License as published by
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-2
@@ -2,8 +2,7 @@
|
|||||||
# Sed script for additional DJGPP specific editing
|
# Sed script for additional DJGPP specific editing
|
||||||
# of the testsuite script generated by autoconf 2.61.
|
# of the testsuite script generated by autoconf 2.61.
|
||||||
|
|
||||||
|
# Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
*.info*
|
|
||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
bison.1
|
|
||||||
bison.aux
|
|
||||||
bison.cp
|
|
||||||
bison.cps
|
|
||||||
bison.dvi
|
|
||||||
bison.fn
|
|
||||||
bison.html
|
|
||||||
bison.ky
|
|
||||||
bison.log
|
|
||||||
bison.pdf
|
|
||||||
bison.pg
|
|
||||||
bison.ps
|
|
||||||
bison.toc
|
|
||||||
bison.tp
|
|
||||||
bison.vr
|
|
||||||
cross-options.texi
|
|
||||||
gendocs_template
|
|
||||||
refcard.dvi
|
|
||||||
refcard.log
|
|
||||||
refcard.ps
|
|
||||||
stamp-vti
|
|
||||||
version.texi
|
|
||||||
yacc.1
|
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
|
|
||||||
/*.info*
|
/*.info*
|
||||||
|
/*~
|
||||||
|
/.dirstamp
|
||||||
/Makefile
|
/Makefile
|
||||||
/Makefile.in
|
/Makefile.in
|
||||||
/bison.1
|
/bison.1
|
||||||
@@ -24,3 +27,4 @@
|
|||||||
/stamp-vti
|
/stamp-vti
|
||||||
/version.texi
|
/version.texi
|
||||||
/yacc.1
|
/yacc.1
|
||||||
|
|
||||||
|
|||||||
+7
-4
@@ -1,6 +1,6 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2008 Free Software
|
|
||||||
## Foundation, Inc.
|
## Copyright (C) 2001-2003, 2005-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,9 +26,12 @@ clean-local:
|
|||||||
|
|
||||||
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
||||||
$(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
|
$(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
|
||||||
-rm -f $@ $@.tmp
|
mv -f $@ $@~ || : >$@~
|
||||||
|
-rm -f $@.tmp
|
||||||
cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
|
cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||||
$(top_builddir)/src/bison --help | perl $(CROSS_OPTIONS_PL) >$@.tmp
|
$(top_builddir)/src/bison --help \
|
||||||
|
| perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
||||||
|
diff -u $@~ $@.tmp || true
|
||||||
mv $@.tmp $@
|
mv $@.tmp $@
|
||||||
MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
|
MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
|
||||||
|
|
||||||
|
|||||||
+1669
-875
File diff suppressed because it is too large
Load Diff
+68
-13
@@ -1,12 +1,12 @@
|
|||||||
@c The GNU Free Documentation License.
|
@c The GNU Free Documentation License.
|
||||||
@center Version 1.2, November 2002
|
@center Version 1.3, 3 November 2008
|
||||||
|
|
||||||
@c This file is intended to be included within another document,
|
@c This file is intended to be included within another document,
|
||||||
@c hence no sectioning command or @node.
|
@c hence no sectioning command or @node.
|
||||||
|
|
||||||
@display
|
@display
|
||||||
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
@uref{http://fsf.org/}
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
@@ -111,6 +111,9 @@ formats which do not have any title page as such, ``Title Page'' means
|
|||||||
the text near the most prominent appearance of the work's title,
|
the text near the most prominent appearance of the work's title,
|
||||||
preceding the beginning of the body of the text.
|
preceding the beginning of the body of the text.
|
||||||
|
|
||||||
|
The ``publisher'' means any person or entity that distributes copies
|
||||||
|
of the Document to the public.
|
||||||
|
|
||||||
A section ``Entitled XYZ'' means a named subunit of the Document whose
|
A section ``Entitled XYZ'' means a named subunit of the Document whose
|
||||||
title either is precisely XYZ or contains XYZ in parentheses following
|
title either is precisely XYZ or contains XYZ in parentheses following
|
||||||
text that translates XYZ in another language. (Here XYZ stands for a
|
text that translates XYZ in another language. (Here XYZ stands for a
|
||||||
@@ -379,13 +382,30 @@ title.
|
|||||||
@item
|
@item
|
||||||
TERMINATION
|
TERMINATION
|
||||||
|
|
||||||
You may not copy, modify, sublicense, or distribute the Document except
|
You may not copy, modify, sublicense, or distribute the Document
|
||||||
as expressly provided for under this License. Any other attempt to
|
except as expressly provided under this License. Any attempt
|
||||||
copy, modify, sublicense or distribute the Document is void, and will
|
otherwise to copy, modify, sublicense, or distribute it is void, and
|
||||||
automatically terminate your rights under this License. However,
|
will automatically terminate your rights under this License.
|
||||||
parties who have received copies, or rights, from you under this
|
|
||||||
License will not have their licenses terminated so long as such
|
However, if you cease all violation of this License, then your license
|
||||||
parties remain in full compliance.
|
from a particular copyright holder is reinstated (a) provisionally,
|
||||||
|
unless and until the copyright holder explicitly and finally
|
||||||
|
terminates your license, and (b) permanently, if the copyright holder
|
||||||
|
fails to notify you of the violation by some reasonable means prior to
|
||||||
|
60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, receipt of a copy of some or all of the same material does
|
||||||
|
not give you any rights to use it.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
FUTURE REVISIONS OF THIS LICENSE
|
FUTURE REVISIONS OF THIS LICENSE
|
||||||
@@ -403,7 +423,42 @@ following the terms and conditions either of that specified version or
|
|||||||
of any later version that has been published (not as a draft) by the
|
of any later version that has been published (not as a draft) by the
|
||||||
Free Software Foundation. If the Document does not specify a version
|
Free Software Foundation. If the Document does not specify a version
|
||||||
number of this License, you may choose any version ever published (not
|
number of this License, you may choose any version ever published (not
|
||||||
as a draft) by the Free Software Foundation.
|
as a draft) by the Free Software Foundation. If the Document
|
||||||
|
specifies that a proxy can decide which future versions of this
|
||||||
|
License can be used, that proxy's public statement of acceptance of a
|
||||||
|
version permanently authorizes you to choose that version for the
|
||||||
|
Document.
|
||||||
|
|
||||||
|
@item
|
||||||
|
RELICENSING
|
||||||
|
|
||||||
|
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
|
||||||
|
World Wide Web server that publishes copyrightable works and also
|
||||||
|
provides prominent facilities for anybody to edit those works. A
|
||||||
|
public wiki that anybody can edit is an example of such a server. A
|
||||||
|
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
|
||||||
|
site means any set of copyrightable works thus published on the MMC
|
||||||
|
site.
|
||||||
|
|
||||||
|
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
|
||||||
|
license published by Creative Commons Corporation, a not-for-profit
|
||||||
|
corporation with a principal place of business in San Francisco,
|
||||||
|
California, as well as future copyleft versions of that license
|
||||||
|
published by that same organization.
|
||||||
|
|
||||||
|
``Incorporate'' means to publish or republish a Document, in whole or
|
||||||
|
in part, as part of another Document.
|
||||||
|
|
||||||
|
An MMC is ``eligible for relicensing'' if it is licensed under this
|
||||||
|
License, and if all works that were first published under this License
|
||||||
|
somewhere other than this MMC, and subsequently incorporated in whole
|
||||||
|
or in part into the MMC, (1) had no cover texts or invariant sections,
|
||||||
|
and (2) were thus incorporated prior to November 1, 2008.
|
||||||
|
|
||||||
|
The operator of an MMC Site may republish an MMC contained in the site
|
||||||
|
under CC-BY-SA on the same site at any time before August 1, 2009,
|
||||||
|
provided the MMC is eligible for relicensing.
|
||||||
|
|
||||||
@end enumerate
|
@end enumerate
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@@ -417,7 +472,7 @@ license notices just after the title page:
|
|||||||
@group
|
@group
|
||||||
Copyright (C) @var{year} @var{your name}.
|
Copyright (C) @var{year} @var{your name}.
|
||||||
Permission is granted to copy, distribute and/or modify this document
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
under the terms of the GNU Free Documentation License, Version 1.2
|
under the terms of the GNU Free Documentation License, Version 1.3
|
||||||
or any later version published by the Free Software Foundation;
|
or any later version published by the Free Software Foundation;
|
||||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
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
|
Texts. A copy of the license is included in the section entitled ``GNU
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
\def\finalout{\overfullrule=0pt}
|
\def\finalout{\overfullrule=0pt}
|
||||||
%\finalout
|
%\finalout
|
||||||
|
|
||||||
% Copyright (c) 1998, 2001 Free Software Foundation, Inc.
|
% Copyright (c) 1998, 2001, 2009-2011 Free Software Foundation, Inc.
|
||||||
%
|
%
|
||||||
% This file is part of Bison.
|
% This file is part of Bison.
|
||||||
%
|
%
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
bench.pl
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
## Copyright (C) 2006 Free Software Foundation, Inc.
|
## Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ straightforward use of _build/src/bison would.)
|
|||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/perl -w
|
#! /usr/bin/perl -w
|
||||||
|
|
||||||
# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
|
# Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is part of Bison, the GNU Compiler Compiler.
|
# This file is part of Bison, the GNU Compiler Compiler.
|
||||||
#
|
#
|
||||||
@@ -343,8 +343,8 @@ sub bench_grammar ($)
|
|||||||
(
|
(
|
||||||
"pull-impure" => '',
|
"pull-impure" => '',
|
||||||
"pull-pure" => '%define api.pure',
|
"pull-pure" => '%define api.pure',
|
||||||
"push-impure" => '%define api.push_pull "both"',
|
"push-impure" => '%define api.push-pull "both"',
|
||||||
"push-pure" => '%define api.push_pull "both" %define api.pure',
|
"push-pure" => '%define api.push-pull "both" %define api.pure',
|
||||||
);
|
);
|
||||||
|
|
||||||
my %bench;
|
my %bench;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2005 Free Software Foundation, Inc.
|
## Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
*.cc
|
|
||||||
*.hh
|
|
||||||
*.ll
|
|
||||||
*.output
|
|
||||||
*.stamp
|
|
||||||
*.tmp
|
|
||||||
*.yy
|
|
||||||
.deps
|
|
||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
calc++
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
## Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -31,12 +31,16 @@ $(BISON): $(BISON_IN)
|
|||||||
doc = $(top_srcdir)/doc/bison.texinfo
|
doc = $(top_srcdir)/doc/bison.texinfo
|
||||||
extexi = $(top_srcdir)/examples/extexi
|
extexi = $(top_srcdir)/examples/extexi
|
||||||
# Extract in src.
|
# Extract in src.
|
||||||
$(calc_extracted): $(doc) $(extexi)
|
$(srcdir)/calc.stamp: $(doc) $(extexi)
|
||||||
|
rm -f $@ $@.tmp
|
||||||
|
touch $@.tmp
|
||||||
cd $(srcdir) && \
|
cd $(srcdir) && \
|
||||||
$(AWK) -f ../extexi -v VERSION="$(VERSION)" \
|
$(AWK) -f ../extexi -v VERSION="$(VERSION)" \
|
||||||
../../doc/bison.texinfo -- calc++-parser.yy \
|
../../doc/bison.texinfo -- calc++-parser.yy \
|
||||||
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
$(calc_extracted): $(srcdir)/calc.stamp
|
||||||
|
|
||||||
## ------------------- ##
|
## ------------------- ##
|
||||||
## Parser generation. ##
|
## Parser generation. ##
|
||||||
@@ -50,7 +54,10 @@ MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
|||||||
# Compile the parser and save cycles.
|
# Compile the parser and save cycles.
|
||||||
# This code comes from "Handling Tools that Produce Many Outputs",
|
# This code comes from "Handling Tools that Produce Many Outputs",
|
||||||
# from the Automake documentation.
|
# from the Automake documentation.
|
||||||
EXTRA_DIST = $(srcdir)/calc++-parser.stamp $(srcdir)/calc++-parser.yy
|
EXTRA_DIST = \
|
||||||
|
$(srcdir)/calc++-parser.stamp \
|
||||||
|
$(srcdir)/calc++-parser.yy \
|
||||||
|
$(srcdir)/calc.stamp
|
||||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||||
# in srcdir, including during distcheck, which is forbidden.
|
# in srcdir, including during distcheck, which is forbidden.
|
||||||
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
||||||
|
|||||||
+3
-1
@@ -1,7 +1,9 @@
|
|||||||
# Extract all examples from the manual source. -*- AWK -*-
|
# Extract all examples from the manual source. -*- AWK -*-
|
||||||
|
|
||||||
# This file is part of GNU Bison
|
# This file is part of GNU Bison
|
||||||
# Copyright 1992, 2000, 2001, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2011 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
Submodule gnulib updated: 5a1286a9f8...eff4c0360a
-107
@@ -1,107 +0,0 @@
|
|||||||
.deps
|
|
||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
argmatch.c
|
|
||||||
argmatch.h
|
|
||||||
basename.c
|
|
||||||
c-ctype.c
|
|
||||||
c-ctype.h
|
|
||||||
c-strcase.h
|
|
||||||
c-strcasecmp.c
|
|
||||||
c-strncasecmp.c
|
|
||||||
charset.alias
|
|
||||||
config.charset
|
|
||||||
config.h
|
|
||||||
config.hin
|
|
||||||
configmake.h
|
|
||||||
dirname.c
|
|
||||||
dirname.h
|
|
||||||
dup-safer.c
|
|
||||||
errno.in.h
|
|
||||||
error.c
|
|
||||||
error.h
|
|
||||||
exitfail.c
|
|
||||||
exitfail.h
|
|
||||||
fd-safer.c
|
|
||||||
fopen-safer.c
|
|
||||||
getopt.c
|
|
||||||
getopt.h
|
|
||||||
getopt.in.h
|
|
||||||
getopt1.c
|
|
||||||
getopt_.h
|
|
||||||
getopt_int.h
|
|
||||||
gettext.h
|
|
||||||
gnulib.mk
|
|
||||||
hash.c
|
|
||||||
hash.h
|
|
||||||
intprops.h
|
|
||||||
inttypes.h
|
|
||||||
inttypes.in.h
|
|
||||||
inttypes_.h
|
|
||||||
localcharset.c
|
|
||||||
localcharset.h
|
|
||||||
malloc.c
|
|
||||||
mbrtowc.c
|
|
||||||
mbsinit.c
|
|
||||||
mbswidth.c
|
|
||||||
mbswidth.h
|
|
||||||
obstack.c
|
|
||||||
obstack.h
|
|
||||||
pipe-safer.c
|
|
||||||
quote.c
|
|
||||||
quote.h
|
|
||||||
quotearg.c
|
|
||||||
quotearg.h
|
|
||||||
ref-add.sed
|
|
||||||
ref-add.sin
|
|
||||||
ref-del.sed
|
|
||||||
ref-del.sin
|
|
||||||
stamp-h1
|
|
||||||
stdbool.h
|
|
||||||
stdbool.in.h
|
|
||||||
stdbool_.h
|
|
||||||
stdint.h
|
|
||||||
stdint.in.h
|
|
||||||
stdint_.h
|
|
||||||
stdio--.h
|
|
||||||
stdio-safer.h
|
|
||||||
stdlib.h
|
|
||||||
stdlib.in.h
|
|
||||||
stdlib_.h
|
|
||||||
stpcpy.c
|
|
||||||
streq.h
|
|
||||||
strerror.c
|
|
||||||
string.h
|
|
||||||
string.in.h
|
|
||||||
string_.h
|
|
||||||
stripslash.c
|
|
||||||
strndup.c
|
|
||||||
strnlen.c
|
|
||||||
strtol.c
|
|
||||||
strtoul.c
|
|
||||||
strverscmp.c
|
|
||||||
strverscmp.h
|
|
||||||
unistd--.h
|
|
||||||
unistd-safer.h
|
|
||||||
unistd.h
|
|
||||||
unistd.in.h
|
|
||||||
unistd_.h
|
|
||||||
unitypes.h
|
|
||||||
uniwidth
|
|
||||||
uniwidth.h
|
|
||||||
unlocked-io.h
|
|
||||||
unsetenv.c
|
|
||||||
verify.h
|
|
||||||
wchar.h
|
|
||||||
wchar.in.h
|
|
||||||
wchar_.h
|
|
||||||
wctype.h
|
|
||||||
wctype.in.h
|
|
||||||
wctype_.h
|
|
||||||
wcwidth.c
|
|
||||||
wcwidth.h
|
|
||||||
xalloc-die.c
|
|
||||||
xalloc.h
|
|
||||||
xmalloc.c
|
|
||||||
xstrndup.c
|
|
||||||
xstrndup.h
|
|
||||||
+146
-11
@@ -1,37 +1,77 @@
|
|||||||
|
|
||||||
/*.a
|
/*.a
|
||||||
|
/*.bak
|
||||||
/*.o
|
/*.o
|
||||||
/*~
|
/*~
|
||||||
/.deps
|
/.deps
|
||||||
|
/.dirstamp
|
||||||
/Makefile
|
/Makefile
|
||||||
/Makefile.in
|
/Makefile.in
|
||||||
|
/alignof.h
|
||||||
|
/alloca.h
|
||||||
|
/alloca.in.h
|
||||||
|
/arg-nonnull.h
|
||||||
/argmatch.c
|
/argmatch.c
|
||||||
/argmatch.h
|
/argmatch.h
|
||||||
|
/asnprintf.c
|
||||||
|
/basename-lgpl.c
|
||||||
/basename.c
|
/basename.c
|
||||||
|
/binary-io.h
|
||||||
|
/bitrotate.h
|
||||||
|
/c++defs.h
|
||||||
/c-ctype.c
|
/c-ctype.c
|
||||||
/c-ctype.h
|
/c-ctype.h
|
||||||
/c-strcase.h
|
/c-strcase.h
|
||||||
/c-strcasecmp.c
|
/c-strcasecmp.c
|
||||||
/c-strncasecmp.c
|
/c-strncasecmp.c
|
||||||
|
/calloc.c
|
||||||
/charset.alias
|
/charset.alias
|
||||||
|
/cloexec.c
|
||||||
|
/cloexec.h
|
||||||
|
/close-hook.c
|
||||||
|
/close-hook.h
|
||||||
|
/close.c
|
||||||
/config.charset
|
/config.charset
|
||||||
/config.h
|
/config.h
|
||||||
/config.hin
|
/config.hin
|
||||||
/configmake.h
|
/configmake.h
|
||||||
|
/dirname-lgpl.c
|
||||||
/dirname.c
|
/dirname.c
|
||||||
/dirname.h
|
/dirname.h
|
||||||
|
/dosname.h
|
||||||
|
/dup-safer-flag.c
|
||||||
/dup-safer.c
|
/dup-safer.c
|
||||||
|
/dup2.c
|
||||||
|
/errno.h
|
||||||
/errno.in.h
|
/errno.in.h
|
||||||
/error.c
|
/error.c
|
||||||
/error.h
|
/error.h
|
||||||
/exitfail.c
|
/exitfail.c
|
||||||
/exitfail.h
|
/exitfail.h
|
||||||
|
/fatal-signal.c
|
||||||
|
/fatal-signal.h
|
||||||
|
/fclose.c
|
||||||
|
/fcntl.c
|
||||||
|
/fcntl.h
|
||||||
|
/fcntl.in.h
|
||||||
|
/fd-safer-flag.c
|
||||||
/fd-safer.c
|
/fd-safer.c
|
||||||
|
/float+.h
|
||||||
|
/float.h
|
||||||
|
/float.in.h
|
||||||
/fopen-safer.c
|
/fopen-safer.c
|
||||||
|
/fopen.c
|
||||||
|
/fprintf.c
|
||||||
|
/fpucw.h
|
||||||
|
/frexp.c
|
||||||
|
/frexpl.c
|
||||||
|
/fseterr.c
|
||||||
|
/fseterr.h
|
||||||
|
/getdtablesize.c
|
||||||
/getopt.c
|
/getopt.c
|
||||||
/getopt.h
|
/getopt.h
|
||||||
/getopt.in.h
|
/getopt.in.h
|
||||||
/getopt1.c
|
/getopt1.c
|
||||||
/getopt_.h
|
|
||||||
/getopt_int.h
|
/getopt_int.h
|
||||||
/gettext.h
|
/gettext.h
|
||||||
/gnulib.mk
|
/gnulib.mk
|
||||||
@@ -40,71 +80,166 @@
|
|||||||
/intprops.h
|
/intprops.h
|
||||||
/inttypes.h
|
/inttypes.h
|
||||||
/inttypes.in.h
|
/inttypes.in.h
|
||||||
/inttypes_.h
|
/ioctl.c
|
||||||
|
/isnan.c
|
||||||
|
/isnand-nolibm.h
|
||||||
|
/isnand.c
|
||||||
|
/isnanf-nolibm.h
|
||||||
|
/isnanf.c
|
||||||
|
/isnanl-nolibm.h
|
||||||
|
/isnanl.c
|
||||||
|
/iswblank.c
|
||||||
|
/ldexpl.c
|
||||||
/localcharset.c
|
/localcharset.c
|
||||||
/localcharset.h
|
/localcharset.h
|
||||||
/malloc.c
|
/malloc.c
|
||||||
|
/math.h
|
||||||
|
/math.in.h
|
||||||
|
/mbchar.c
|
||||||
|
/mbchar.h
|
||||||
/mbrtowc.c
|
/mbrtowc.c
|
||||||
|
/mbschr.c
|
||||||
/mbsinit.c
|
/mbsinit.c
|
||||||
|
/mbsrchr.c
|
||||||
/mbswidth.c
|
/mbswidth.c
|
||||||
/mbswidth.h
|
/mbswidth.h
|
||||||
|
/mbuiter.h
|
||||||
|
/memchr.c
|
||||||
|
/memchr.valgrind
|
||||||
|
/nonblocking.c
|
||||||
|
/nonblocking.h
|
||||||
/obstack.c
|
/obstack.c
|
||||||
/obstack.h
|
/obstack.h
|
||||||
|
/open.c
|
||||||
|
/perror.c
|
||||||
/pipe-safer.c
|
/pipe-safer.c
|
||||||
|
/pipe.c
|
||||||
|
/pipe2-safer.c
|
||||||
|
/pipe2.c
|
||||||
|
/printf-args.c
|
||||||
|
/printf-args.h
|
||||||
|
/printf-frexp.c
|
||||||
|
/printf-frexp.h
|
||||||
|
/printf-frexpl.c
|
||||||
|
/printf-frexpl.h
|
||||||
|
/printf-parse.c
|
||||||
|
/printf-parse.h
|
||||||
|
/printf.c
|
||||||
/quote.c
|
/quote.c
|
||||||
/quote.h
|
/quote.h
|
||||||
/quotearg.c
|
/quotearg.c
|
||||||
/quotearg.h
|
/quotearg.h
|
||||||
|
/rawmemchr.c
|
||||||
|
/rawmemchr.valgrind
|
||||||
|
/realloc.c
|
||||||
/ref-add.sed
|
/ref-add.sed
|
||||||
/ref-add.sin
|
/ref-add.sin
|
||||||
/ref-del.sed
|
/ref-del.sed
|
||||||
/ref-del.sin
|
/ref-del.sin
|
||||||
|
/sched.h
|
||||||
|
/sched.in.h
|
||||||
|
/sig-handler.h
|
||||||
|
/sigaction.c
|
||||||
|
/signal.h
|
||||||
|
/signal.in.h
|
||||||
|
/signbitd.c
|
||||||
|
/signbitf.c
|
||||||
|
/signbitl.c
|
||||||
|
/sigprocmask.c
|
||||||
|
/size_max.h
|
||||||
|
/snprintf.c
|
||||||
|
/spawn-pipe.c
|
||||||
|
/spawn-pipe.h
|
||||||
|
/spawn.h
|
||||||
|
/spawn.in.h
|
||||||
|
/spawn_faction_addclose.c
|
||||||
|
/spawn_faction_adddup2.c
|
||||||
|
/spawn_faction_addopen.c
|
||||||
|
/spawn_faction_destroy.c
|
||||||
|
/spawn_faction_init.c
|
||||||
|
/spawn_int.h
|
||||||
|
/spawnattr_destroy.c
|
||||||
|
/spawnattr_init.c
|
||||||
|
/spawnattr_setflags.c
|
||||||
|
/spawnattr_setsigmask.c
|
||||||
|
/spawni.c
|
||||||
|
/spawnp.c
|
||||||
|
/sprintf.c
|
||||||
/stamp-h1
|
/stamp-h1
|
||||||
|
/stat.c
|
||||||
/stdbool.h
|
/stdbool.h
|
||||||
/stdbool.in.h
|
/stdbool.in.h
|
||||||
/stdbool_.h
|
/stddef.h
|
||||||
|
/stddef.in.h
|
||||||
/stdint.h
|
/stdint.h
|
||||||
/stdint.in.h
|
/stdint.in.h
|
||||||
/stdint_.h
|
|
||||||
/stdio--.h
|
/stdio--.h
|
||||||
|
/stdio-impl.h
|
||||||
/stdio-safer.h
|
/stdio-safer.h
|
||||||
|
/stdio-write.c
|
||||||
|
/stdio.h
|
||||||
|
/stdio.in.h
|
||||||
/stdlib.h
|
/stdlib.h
|
||||||
/stdlib.in.h
|
/stdlib.in.h
|
||||||
/stdlib_.h
|
|
||||||
/stpcpy.c
|
/stpcpy.c
|
||||||
|
/strchrnul.c
|
||||||
|
/strchrnul.valgrind
|
||||||
|
/strdup.c
|
||||||
/streq.h
|
/streq.h
|
||||||
/strerror.c
|
/strerror.c
|
||||||
/string.h
|
/string.h
|
||||||
/string.in.h
|
/string.in.h
|
||||||
/string_.h
|
|
||||||
/stripslash.c
|
/stripslash.c
|
||||||
/strndup.c
|
/strndup.c
|
||||||
/strnlen.c
|
/strnlen.c
|
||||||
|
/strnlen1.c
|
||||||
|
/strnlen1.h
|
||||||
/strtol.c
|
/strtol.c
|
||||||
/strtoul.c
|
/strtoul.c
|
||||||
/strverscmp.c
|
/strverscmp.c
|
||||||
/strverscmp.h
|
/sys
|
||||||
|
/sys_ioctl.h
|
||||||
|
/sys_ioctl.in.h
|
||||||
|
/sys_socket.h
|
||||||
|
/sys_socket.in.h
|
||||||
|
/sys_stat.h
|
||||||
|
/sys_stat.in.h
|
||||||
|
/sys_wait.h
|
||||||
|
/sys_wait.in.h
|
||||||
|
/time.h
|
||||||
|
/time.in.h
|
||||||
/unistd--.h
|
/unistd--.h
|
||||||
/unistd-safer.h
|
/unistd-safer.h
|
||||||
/unistd.h
|
/unistd.h
|
||||||
/unistd.in.h
|
/unistd.in.h
|
||||||
/unistd_.h
|
|
||||||
/unitypes.h
|
/unitypes.h
|
||||||
|
/unitypes.in.h
|
||||||
/uniwidth
|
/uniwidth
|
||||||
/uniwidth.h
|
/uniwidth.h
|
||||||
|
/uniwidth.in.h
|
||||||
/unlocked-io.h
|
/unlocked-io.h
|
||||||
/unsetenv.c
|
/unsetenv.c
|
||||||
|
/vasnprintf.c
|
||||||
|
/vasnprintf.h
|
||||||
/verify.h
|
/verify.h
|
||||||
|
/vfprintf.c
|
||||||
|
/vsnprintf.c
|
||||||
|
/vsprintf.c
|
||||||
|
/w32sock.h
|
||||||
|
/w32spawn.h
|
||||||
|
/wait-process.c
|
||||||
|
/wait-process.h
|
||||||
|
/waitpid.c
|
||||||
|
/warn-on-use.h
|
||||||
/wchar.h
|
/wchar.h
|
||||||
/wchar.in.h
|
/wchar.in.h
|
||||||
/wchar_.h
|
|
||||||
/wctype.h
|
/wctype.h
|
||||||
/wctype.in.h
|
/wctype.in.h
|
||||||
/wctype_.h
|
|
||||||
/wcwidth.c
|
/wcwidth.c
|
||||||
/wcwidth.h
|
|
||||||
/xalloc-die.c
|
/xalloc-die.c
|
||||||
/xalloc.h
|
/xalloc.h
|
||||||
/xmalloc.c
|
/xmalloc.c
|
||||||
|
/xsize.h
|
||||||
/xstrndup.c
|
/xstrndup.c
|
||||||
/xstrndup.h
|
/xstrndup.h
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -1,7 +1,7 @@
|
|||||||
# Make bison/lib.
|
# Make bison/lib.
|
||||||
|
|
||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008, 2009
|
# Copyright (C) 2001-2004, 2006, 2008-2011 Free Software Foundation,
|
||||||
# Free Software Foundation, Inc.
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -37,7 +37,6 @@ timevars_sources = \
|
|||||||
# Non-gnulib sources in Bison's internal library.
|
# Non-gnulib sources in Bison's internal library.
|
||||||
libbison_a_SOURCES += \
|
libbison_a_SOURCES += \
|
||||||
get-errno.h get-errno.c \
|
get-errno.h get-errno.c \
|
||||||
subpipe.h subpipe.c \
|
|
||||||
$(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
|
$(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
|
||||||
|
|
||||||
# The Yacc compatibility library.
|
# The Yacc compatibility library.
|
||||||
|
|||||||
+4
-1
@@ -1,5 +1,8 @@
|
|||||||
/* Array bitsets.
|
/* Array bitsets.
|
||||||
Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2003, 2006, 2009-2011 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Functions to support abitsets.
|
/* Functions to support abitsets.
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+4
-1
@@ -1,5 +1,8 @@
|
|||||||
/* Base bitset stuff.
|
/* Base bitset stuff.
|
||||||
Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* General bitsets.
|
/* General bitsets.
|
||||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Generic bitsets.
|
/* Generic bitsets.
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Bitset statistics.
|
/* Bitset statistics.
|
||||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Functions to support bitset statistics.
|
/* Functions to support bitset statistics.
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Bitset vectors.
|
/* Bitset vectors.
|
||||||
Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2001-2002, 2004, 2006, 2009-2011 Free Software
|
||||||
|
Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Bitset vectors.
|
/* Bitset vectors.
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Akim Demaille (akim@freefriends.org).
|
Contributed by Akim Demaille (akim@freefriends.org).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Bitset vectors.
|
/* Bitset vectors.
|
||||||
Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2001-2002, 2004-2006, 2009-2011 Free Software
|
||||||
|
Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Bitset vectors.
|
/* Bitset vectors.
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Functions to support expandable bitsets.
|
/* Functions to support expandable bitsets.
|
||||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Functions to support ebitsets.
|
/* Functions to support ebitsets.
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/* get-errno.c - get and set errno.
|
/* get-errno.c - get and set errno.
|
||||||
|
|
||||||
Copyright (C) 2002, 2006 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2006, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/* get-errno.h - get and set errno.
|
/* get-errno.h - get and set errno.
|
||||||
|
|
||||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+4
-1
@@ -1,5 +1,8 @@
|
|||||||
/* Functions to support link list bitsets.
|
/* Functions to support link list bitsets.
|
||||||
Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Functions to support lbitsets.
|
/* Functions to support lbitsets.
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
/* Fake libiberty.h for Bison.
|
/* Fake libiberty.h for Bison.
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/* Yacc library main function.
|
/* Yacc library main function.
|
||||||
|
|
||||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
-176
@@ -1,176 +0,0 @@
|
|||||||
/* Subprocesses with pipes.
|
|
||||||
|
|
||||||
Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
/* Written by Paul Eggert <[email protected]>
|
|
||||||
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "subpipe.h"
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include <signal.h>
|
|
||||||
#if ! defined SIGCHLD && defined SIGCLD
|
|
||||||
# define SIGCHLD SIGCLD
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#ifndef STDIN_FILENO
|
|
||||||
# define STDIN_FILENO 0
|
|
||||||
#endif
|
|
||||||
#ifndef STDOUT_FILENO
|
|
||||||
# define STDOUT_FILENO 1
|
|
||||||
#endif
|
|
||||||
#if ! HAVE_DUP2 && ! defined dup2
|
|
||||||
# include <fcntl.h>
|
|
||||||
# define dup2(f, t) (close (t), fcntl (f, F_DUPFD, t))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_SYS_WAIT_H
|
|
||||||
# include <sys/wait.h>
|
|
||||||
#endif
|
|
||||||
#ifndef WEXITSTATUS
|
|
||||||
# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
|
|
||||||
#endif
|
|
||||||
#ifndef WIFEXITED
|
|
||||||
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_VFORK_H
|
|
||||||
# include <vfork.h>
|
|
||||||
#endif
|
|
||||||
#if ! HAVE_WORKING_VFORK
|
|
||||||
# define vfork fork
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "error.h"
|
|
||||||
#include "unistd-safer.h"
|
|
||||||
|
|
||||||
#include "gettext.h"
|
|
||||||
#define _(Msgid) gettext (Msgid)
|
|
||||||
|
|
||||||
#ifndef __attribute__
|
|
||||||
/* This feature is available in gcc versions 2.5 and later. */
|
|
||||||
# if ! defined __GNUC__ || __GNUC__ < 2 || \
|
|
||||||
(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
|
||||||
# define __attribute__(Spec) /* empty */
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ATTRIBUTE_UNUSED
|
|
||||||
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Initialize this module. */
|
|
||||||
|
|
||||||
void
|
|
||||||
init_subpipe (void)
|
|
||||||
{
|
|
||||||
#ifdef SIGCHLD
|
|
||||||
/* System V fork+wait does not work if SIGCHLD is ignored. */
|
|
||||||
signal (SIGCHLD, SIG_DFL);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Create a subprocess that is run as a filter. ARGV is the
|
|
||||||
NULL-terminated argument vector for the subprocess. Store read and
|
|
||||||
write file descriptors for communication with the subprocess into
|
|
||||||
FD[0] and FD[1]: input meant for the process can be written into
|
|
||||||
FD[0], and output from the process can be read from FD[1]. Return
|
|
||||||
the subprocess id.
|
|
||||||
|
|
||||||
To avoid deadlock, the invoker must not let incoming data pile up
|
|
||||||
in FD[1] while writing data to FD[0]. */
|
|
||||||
|
|
||||||
pid_t
|
|
||||||
create_subpipe (char const * const *argv, int fd[2])
|
|
||||||
{
|
|
||||||
int pipe_fd[2];
|
|
||||||
int child_fd[2];
|
|
||||||
pid_t pid;
|
|
||||||
|
|
||||||
if (pipe_safer (child_fd) != 0 || pipe_safer (pipe_fd) != 0)
|
|
||||||
error (EXIT_FAILURE, errno, "pipe");
|
|
||||||
fd[0] = child_fd[1];
|
|
||||||
fd[1] = pipe_fd[0];
|
|
||||||
child_fd[1] = pipe_fd[1];
|
|
||||||
|
|
||||||
pid = vfork ();
|
|
||||||
if (pid < 0)
|
|
||||||
error (EXIT_FAILURE, errno, "fork");
|
|
||||||
|
|
||||||
if (! pid)
|
|
||||||
{
|
|
||||||
/* Child. */
|
|
||||||
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 (child_fd[0]);
|
|
||||||
close (child_fd[1]);
|
|
||||||
return pid;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Wait for the subprocess to exit. */
|
|
||||||
|
|
||||||
void
|
|
||||||
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");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int status = WIFEXITED (wstatus) ? WEXITSTATUS (wstatus) : -1;
|
|
||||||
if (status)
|
|
||||||
error (EXIT_FAILURE, 0,
|
|
||||||
_(status == 126
|
|
||||||
? "subsidiary program `%s' could not be invoked"
|
|
||||||
: status == 127
|
|
||||||
? "subsidiary program `%s' not found"
|
|
||||||
: status < 0
|
|
||||||
? "subsidiary program `%s' failed"
|
|
||||||
: "subsidiary program `%s' failed (exit status %d)"),
|
|
||||||
program, status);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
end_of_output_subpipe (pid_t pid ATTRIBUTE_UNUSED,
|
|
||||||
int fd[2] ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
+4
-1
@@ -1,5 +1,8 @@
|
|||||||
/* Timing variables for measuring compiler performance.
|
/* Timing variables for measuring compiler performance.
|
||||||
Copyright (C) 2000, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2000, 2002, 2004, 2006, 2009-2011 Free Software
|
||||||
|
Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+7
-1
@@ -1,6 +1,8 @@
|
|||||||
/* This file contains the definitions for timing variables used to -*- C -*-
|
/* This file contains the definitions for timing variables used to -*- C -*-
|
||||||
measure run-time performance of the compiler.
|
measure run-time performance of the compiler.
|
||||||
Copyright (C) 2002, 2007 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002, 2007, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Akim Demaille <akim@freefriends.org>.
|
Contributed by Akim Demaille <akim@freefriends.org>.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
@@ -41,6 +43,10 @@ DEFTIMEVAR (TV_REDUCE , "reducing the grammar")
|
|||||||
DEFTIMEVAR (TV_SETS , "computing the sets")
|
DEFTIMEVAR (TV_SETS , "computing the sets")
|
||||||
DEFTIMEVAR (TV_LR0 , "LR(0)")
|
DEFTIMEVAR (TV_LR0 , "LR(0)")
|
||||||
DEFTIMEVAR (TV_LALR , "LALR(1)")
|
DEFTIMEVAR (TV_LALR , "LALR(1)")
|
||||||
|
DEFTIMEVAR (TV_IELR_PHASE1 , "IELR(1) Phase 1")
|
||||||
|
DEFTIMEVAR (TV_IELR_PHASE2 , "IELR(1) Phase 2")
|
||||||
|
DEFTIMEVAR (TV_IELR_PHASE3 , "IELR(1) Phase 3")
|
||||||
|
DEFTIMEVAR (TV_IELR_PHASE4 , "IELR(1) Phase 4")
|
||||||
DEFTIMEVAR (TV_CONFLICTS , "conflicts")
|
DEFTIMEVAR (TV_CONFLICTS , "conflicts")
|
||||||
|
|
||||||
/* Time spent outputing results. */
|
/* Time spent outputing results. */
|
||||||
|
|||||||
+4
-1
@@ -1,5 +1,8 @@
|
|||||||
/* Timing variables for measuring compiler performance.
|
/* Timing variables for measuring compiler performance.
|
||||||
Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2000, 2002, 2004, 2009-2011 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Variable array bitsets.
|
/* Variable array bitsets.
|
||||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
/* Functions to support vbitsets.
|
/* Functions to support vbitsets.
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
|
||||||
|
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/* Yacc library error-printing function.
|
/* Yacc library error-printing function.
|
||||||
|
|
||||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user