mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-09 02:35:15 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d2a7d608e | ||
|
|
5ea72c19da | ||
|
|
97d520633b | ||
|
|
af8a609a90 | ||
|
|
73edad9a25 | ||
|
|
9736697d6d | ||
|
|
e2f3fda11a | ||
|
|
3c0be43411 | ||
|
|
d45708d418 | ||
|
|
219c26ea51 | ||
|
|
f1ceed0774 | ||
|
|
d2829fdc04 | ||
|
|
43dc3c8bc4 | ||
|
|
3d04b5673d | ||
|
|
39c2566994 | ||
|
|
1694ac5cf2 | ||
|
|
dfff662817 | ||
|
|
adf1725fdb | ||
|
|
7aaf9ce758 | ||
|
|
2ceb8c617c | ||
|
|
87b9c9bc43 | ||
|
|
dc25ce6bb1 | ||
|
|
ace92a2691 | ||
|
|
397bb3932f | ||
|
|
bbbbe221d7 | ||
|
|
4d7b57b527 | ||
|
|
321fe707f4 | ||
|
|
1266b63674 | ||
|
|
b9ad39c1fb | ||
|
|
b1a4261e6d | ||
|
|
a022ff4186 | ||
|
|
b5b94bd5e6 | ||
|
|
b9e42bb439 | ||
|
|
75ac158b82 | ||
|
|
f23cd66008 | ||
|
|
9874460819 | ||
|
|
915becaa5d | ||
|
|
ae50972393 | ||
|
|
c9e0a88079 | ||
|
|
50bcb22c4c | ||
|
|
cfc9e431c3 | ||
|
|
42f8609bbd | ||
|
|
9e408f848d | ||
|
|
48578d6c12 | ||
|
|
914e713d07 | ||
|
|
94505fb7e2 | ||
|
|
1bcbca4368 | ||
|
|
a17352a9da | ||
|
|
c984dee8d1 | ||
|
|
cefb18280b | ||
|
|
2f3064f08e | ||
|
|
ab3a683f05 |
+32
@@ -0,0 +1,32 @@
|
||||
*.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
|
||||
maint.mk
|
||||
patches
|
||||
releases
|
||||
stamp-h*
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*.cache
|
||||
/*.flc
|
||||
/*.prj
|
||||
@@ -31,4 +30,3 @@
|
||||
/patches
|
||||
/releases
|
||||
/stamp-h*
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
[submodule "gnulib"]
|
||||
path = gnulib
|
||||
url = git://git.savannah.gnu.org/gnulib.git
|
||||
[submodule "submodules/autoconf"]
|
||||
path = submodules/autoconf
|
||||
url = git://git.sv.gnu.org/autoconf.git
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
COPYING
|
||||
^bootstrap$
|
||||
^doc/fdl\.texi$
|
||||
^doc/gpl-3\.0\.texi$
|
||||
^doc/yacc\.1\.in$
|
||||
^src/parse-gram\.h$
|
||||
^data/m4sugar/
|
||||
|
||||
+14
-38
@@ -158,20 +158,6 @@ Register your changes.
|
||||
|
||||
$ 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
|
||||
|
||||
@@ -186,9 +172,6 @@ release:
|
||||
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
||||
cleanly too.
|
||||
|
||||
- Build with -DGNULIB_POSIXCHECK. It suggests gnulib modules that can
|
||||
fix portability issues.
|
||||
|
||||
- run `make maintainer-check' which:
|
||||
- runs `valgrind -q bison' to run Bison under Valgrind.
|
||||
- runs the parsers under Valgrind.
|
||||
@@ -214,13 +197,8 @@ release:
|
||||
|
||||
* Release Procedure
|
||||
|
||||
** Update the submodules. See above.
|
||||
|
||||
** 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 '\<_(' *
|
||||
** 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.
|
||||
|
||||
** Tests
|
||||
See above.
|
||||
@@ -356,21 +334,19 @@ To generate a template announcement file:
|
||||
|
||||
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
|
||||
|
||||
where alpha can be replaced by beta or stable and F125BDF3 should be
|
||||
replaced with your key ID.
|
||||
where alpha can be replaced by beta or major and F125BDF3 should be replaced
|
||||
with your key ID. For an example of how to fill out the template, search the
|
||||
mailing list archives for the most recent release announcement.
|
||||
|
||||
Complete/fix the announcement file. The generated list of recipients
|
||||
([email protected], [email protected], [email protected],
|
||||
bison-patches@gnu.org, and [email protected]) is
|
||||
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.
|
||||
Complete/fix the announcement file, and send it at least to
|
||||
[email protected] (if a real release, or a ``serious beta''),
|
||||
bug-[email protected], [email protected], [email protected],
|
||||
and [email protected].
|
||||
|
||||
For a stable release, send the same announcement on the comp.compilers
|
||||
newsgroup by sending email to [email protected]. Do not make any Cc as
|
||||
the moderator will throw away anything cross-posted or Cc'ed. It really
|
||||
needs to be a separate message.
|
||||
Send the same announcement on the comp.compilers newsgroup by sending
|
||||
email to [email protected]. Do not make any Cc as the moderator will
|
||||
throw away anything cross-posted or Cc'ed. It really needs to be a
|
||||
separate message.
|
||||
|
||||
** Bump the version number
|
||||
In configure.ac. Run `make'. So that developers don't accidentally add new
|
||||
@@ -383,7 +359,7 @@ Push these changes.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002-2005, 2007-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2005, 2007-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
|
||||
## Copyright (C) 2001-2011 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001-2010 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
|
||||
|
||||
@@ -1,385 +1,7 @@
|
||||
Bison News
|
||||
----------
|
||||
|
||||
* 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.
|
||||
* Changes in version 2.4.1a (2010-01-22):
|
||||
|
||||
** `%prec IDENTIFIER' requires IDENTIFIER to be defined separately.
|
||||
|
||||
@@ -390,8 +12,6 @@ Bison News
|
||||
%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.
|
||||
|
||||
@@ -456,10 +76,10 @@ Bison News
|
||||
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
|
||||
this release (2.4.1a), 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.
|
||||
2.4.1a is not necessary.
|
||||
|
||||
** Internationalization.
|
||||
|
||||
@@ -1514,7 +1134,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1995-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Parser Generator.
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ to the bison package.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2005, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2005, 2009-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -33,10 +33,6 @@ Please send bug reports to <[email protected]>. Please include the
|
||||
version number from `bison --version', and a complete, self-contained
|
||||
test case in each bug report.
|
||||
|
||||
* Copyright statements
|
||||
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
|
||||
@@ -44,7 +40,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2011 Free Software
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2010 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ the problems you encounter.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
@@ -8,13 +8,11 @@ Alexander Belopolsky [email protected]
|
||||
Alexandre Duret-Lutz [email protected]
|
||||
Andreas Schwab [email protected]
|
||||
Andrew Suffield [email protected]
|
||||
Angelo Borsotti [email protected]
|
||||
Anthony Heading [email protected]
|
||||
Arnold Robbins [email protected]
|
||||
Art Haas [email protected]
|
||||
Baron Schwartz [email protected]
|
||||
Benoit Perrot [email protected]
|
||||
Bernd Kiefer [email protected]
|
||||
Bert Deknuydt [email protected]
|
||||
Bill Allombert [email protected]
|
||||
Bob Rossi [email protected]
|
||||
@@ -26,13 +24,11 @@ Christian Burger [email protected]
|
||||
Cris Bailiff [email protected]
|
||||
Cris van Pelt [email protected]
|
||||
Csaba Raduly [email protected]
|
||||
Dagobert Michelsen [email protected]
|
||||
Daniel Hagerty [email protected]
|
||||
David J. MacKenzie [email protected]
|
||||
Derek M. Jones [email protected]
|
||||
Di-an Jan [email protected]
|
||||
Dick Streefland [email protected]
|
||||
Didier Godefroy [email protected]
|
||||
Enrico Scholz [email protected]
|
||||
Eric Blake [email protected]
|
||||
Evgeny Stambulchik [email protected]
|
||||
@@ -41,18 +37,15 @@ Florian Krohm [email protected]
|
||||
Frank Heckenbach [email protected]
|
||||
Frans Englich [email protected]
|
||||
Georg Sauthoff [email protected]
|
||||
George Neuner [email protected]
|
||||
Goran Uddeborg [email protected]
|
||||
Guido Trentalancia [email protected]
|
||||
H. Merijn Brand [email protected]
|
||||
Hans Aberg [email protected]
|
||||
Jan Nieuwenhuizen [email protected]
|
||||
Jerry Quinn [email protected]
|
||||
Jesse Thilo [email protected]
|
||||
Jim Kent [email protected]
|
||||
Jim Meyering [email protected]
|
||||
Joel E. Denny joeldenny@joeldenny.org
|
||||
Johan van Selst [email protected]
|
||||
Joel E. Denny jdenny@ces.clemson.edu
|
||||
Jonathan Nieder [email protected]
|
||||
Juan Manuel Guerrero [email protected]
|
||||
Kees Zeelenberg [email protected]
|
||||
@@ -103,7 +96,7 @@ Tom Lane [email protected]
|
||||
Tom Tromey [email protected]
|
||||
Tommy Nordgren [email protected]
|
||||
Troy A. Johnson [email protected]
|
||||
Tys Lefering twlevo@gmail.com
|
||||
Tys Lefering twlevo@xs4all.nl
|
||||
Vin Shelton [email protected]
|
||||
Wayne Green [email protected]
|
||||
Wolfram Wagner [email protected]
|
||||
|
||||
@@ -22,6 +22,9 @@ parser") refers to the current `output' format.
|
||||
** vector
|
||||
Move to using vector, drop stack.hh.
|
||||
|
||||
** I18n
|
||||
Catch up with yacc.c.
|
||||
|
||||
* Report
|
||||
|
||||
** GLR
|
||||
@@ -287,7 +290,7 @@ Equip the parser with a means to create the (visual) parse tree.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2001-2004, 2006, 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2004, 2006, 2009-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#! /bin/sh
|
||||
# Print a version string.
|
||||
scriptversion=2011-04-05.18; # UTC
|
||||
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
# Copyright (C) 2003-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2010 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -19,20 +17,13 @@ scriptversion=2011-04-05.18; # UTC
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Originally written by Paul Eggert. The canonical version of this
|
||||
# script is maintained as build-aux/bootstrap in gnulib, however, to
|
||||
# be useful to your project, you should place a copy of it under
|
||||
# version control in the top-level directory of your project. The
|
||||
# intent is that all customization can be done with a bootstrap.conf
|
||||
# file also maintained in your version control; gnulib comes with a
|
||||
# template build-aux/bootstrap.conf to get you started.
|
||||
|
||||
# Please report bugs or propose patches to [email protected].
|
||||
# Written by Paul Eggert.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# Ensure file names are sorted consistently across platforms.
|
||||
# Also, ensure diagnostics are in English, e.g., "wget --help" below.
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
@@ -42,32 +33,24 @@ local_gl_dir=gl
|
||||
bt='._bootmp'
|
||||
bt_regex=`echo "$bt"| sed 's/\./[.]/g'`
|
||||
bt2=${bt}2
|
||||
me=$0
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $me [OPTION]...
|
||||
Usage: $0 [OPTION]...
|
||||
Bootstrap this package from the checked-out sources.
|
||||
|
||||
Options:
|
||||
--gnulib-srcdir=DIRNAME specify the local directory where gnulib
|
||||
--gnulib-srcdir=DIRNAME Specify the local directory where gnulib
|
||||
sources reside. Use this if you already
|
||||
have gnulib sources on your machine, and
|
||||
do not want to waste your bandwidth downloading
|
||||
them again. Defaults to \$GNULIB_SRCDIR
|
||||
--bootstrap-sync if this bootstrap script is not identical to
|
||||
the version in the local gnulib sources,
|
||||
update this script, and then restart it with
|
||||
/bin/sh or the shell \$CONFIG_SHELL
|
||||
--no-bootstrap-sync do not check whether bootstrap is out of sync
|
||||
--copy copy files instead of creating symbolic links
|
||||
--force attempt to bootstrap even if the sources seem
|
||||
not to have been checked out
|
||||
--no-git do not use git to update gnulib. Requires that
|
||||
--gnulib-srcdir point to a correct gnulib snapshot
|
||||
--skip-po do not download po files
|
||||
them again.
|
||||
--copy Copy files instead of creating symbolic links.
|
||||
--force Attempt to bootstrap even if the sources seem
|
||||
not to have been checked out.
|
||||
--skip-po Do not download po files.
|
||||
|
||||
If the file $me.conf exists in the same directory as this script, its
|
||||
If the file $0.conf exists in the same directory as this script, its
|
||||
contents are read as shell variables to configure the bootstrap.
|
||||
|
||||
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||
@@ -88,10 +71,6 @@ gnulib_modules=
|
||||
# Any gnulib files needed that are not in modules.
|
||||
gnulib_files=
|
||||
|
||||
# A function to be called to edit gnulib.mk right after it's created.
|
||||
# Override it via your own definition in bootstrap.conf.
|
||||
gnulib_mk_hook() { :; }
|
||||
|
||||
# A function to be called after everything else in this script.
|
||||
# Override it via your own definition in bootstrap.conf.
|
||||
bootstrap_epilogue() { :; }
|
||||
@@ -102,8 +81,7 @@ bootstrap_epilogue() { :; }
|
||||
# options because the latest/%s directory and the .po files within are
|
||||
# all symlinks.
|
||||
po_download_command_format=\
|
||||
"rsync --delete --exclude '*.s1' -Lrtvz \
|
||||
'translationproject.org::tp/latest/%s/' '%s'"
|
||||
"rsync -Lrtvz 'translationproject.org::tp/latest/%s/' '%s'"
|
||||
|
||||
extract_package_name='
|
||||
/^AC_INIT(/{
|
||||
@@ -130,7 +108,18 @@ source_base=lib
|
||||
m4_base=m4
|
||||
doc_base=doc
|
||||
tests_base=tests
|
||||
gnulib_extra_files=''
|
||||
|
||||
# Extra files from gnulib, which override files from other sources.
|
||||
gnulib_extra_files="
|
||||
$build_aux/install-sh
|
||||
$build_aux/missing
|
||||
$build_aux/mdate-sh
|
||||
$build_aux/texinfo.tex
|
||||
$build_aux/depcomp
|
||||
$build_aux/config.guess
|
||||
$build_aux/config.sub
|
||||
doc/INSTALL
|
||||
"
|
||||
|
||||
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
||||
gnulib_tool_option_extras=
|
||||
@@ -145,8 +134,7 @@ XGETTEXT_OPTIONS='\\\
|
||||
--flag=error:3:c-format --flag=error_at_line:5:c-format\\\
|
||||
'
|
||||
|
||||
# Package bug report address and copyright holder for gettext files
|
||||
COPYRIGHT_HOLDER='Free Software Foundation, Inc.'
|
||||
# Package bug report address for gettext files
|
||||
[email protected]
|
||||
|
||||
# Files we don't want to import.
|
||||
@@ -154,7 +142,7 @@ excluded_files=
|
||||
|
||||
# File that should exist in the top directory of a checked out hierarchy,
|
||||
# but not in a distribution tarball.
|
||||
checkout_only_file=README-hacking
|
||||
checkout_only_file=HACKING
|
||||
|
||||
# Whether to use copies instead of symlinks.
|
||||
copy=false
|
||||
@@ -165,13 +153,6 @@ copy=false
|
||||
# on which version control system (if any) is used in the source directory.
|
||||
vc_ignore=auto
|
||||
|
||||
# Set this to true in bootstrap.conf to enable --bootstrap-sync by
|
||||
# default.
|
||||
bootstrap_sync=false
|
||||
|
||||
# Use git to update gnulib sources
|
||||
use_git=true
|
||||
|
||||
# find_tool ENVVAR NAMES...
|
||||
# -------------------------
|
||||
# Search for a required program. Use the value of ENVVAR, if set,
|
||||
@@ -180,6 +161,7 @@ use_git=true
|
||||
# die otherwise.
|
||||
find_tool ()
|
||||
{
|
||||
# Find sha1sum, named gsha1sum on MacPorts.
|
||||
find_tool_envvar=$1
|
||||
shift
|
||||
find_tool_names=$@
|
||||
@@ -196,19 +178,19 @@ find_tool ()
|
||||
find_tool_error_prefix="\$$find_tool_envvar: "
|
||||
fi
|
||||
if test x"$find_tool_res" = x; then
|
||||
echo >&2 "$me: one of these is required: $find_tool_names"
|
||||
echo >&2 "$0: one of these is required: $find_tool_names"
|
||||
exit 1
|
||||
fi
|
||||
($find_tool_res --version </dev/null) >/dev/null 2>&1 || {
|
||||
echo >&2 "$me: ${find_tool_error_prefix}cannot run $find_tool_res --version"
|
||||
echo >&2 "$0: ${find_tool_error_prefix}cannot run $find_tool_res --version"
|
||||
exit 1
|
||||
}
|
||||
eval "$find_tool_envvar=\$find_tool_res"
|
||||
eval "export $find_tool_envvar"
|
||||
}
|
||||
|
||||
# Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6.
|
||||
find_tool SHA1SUM sha1sum gsha1sum shasum
|
||||
# Find sha1sum, named gsha1sum on MacPorts.
|
||||
find_tool SHA1SUM sha1sum gsha1sum
|
||||
|
||||
# Override the default configuration, if necessary.
|
||||
# Make sure that bootstrap.conf is sourced from the current directory
|
||||
@@ -218,18 +200,6 @@ case "$0" in
|
||||
*) test -r "$0.conf" && . ./"$0.conf" ;;
|
||||
esac
|
||||
|
||||
# Extra files from gnulib, which override files from other sources.
|
||||
test -z "${gnulib_extra_files}" && \
|
||||
gnulib_extra_files="
|
||||
$build_aux/install-sh
|
||||
$build_aux/missing
|
||||
$build_aux/mdate-sh
|
||||
$build_aux/texinfo.tex
|
||||
$build_aux/depcomp
|
||||
$build_aux/config.guess
|
||||
$build_aux/config.sub
|
||||
doc/INSTALL
|
||||
"
|
||||
|
||||
if test "$vc_ignore" = auto; then
|
||||
vc_ignore=
|
||||
@@ -255,53 +225,25 @@ do
|
||||
checkout_only_file=;;
|
||||
--copy)
|
||||
copy=true;;
|
||||
--bootstrap-sync)
|
||||
bootstrap_sync=true;;
|
||||
--no-bootstrap-sync)
|
||||
bootstrap_sync=false;;
|
||||
--no-git)
|
||||
use_git=false;;
|
||||
*)
|
||||
echo >&2 "$0: $option: unknown option"
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
if $use_git || test -d "$GNULIB_SRCDIR"; then
|
||||
:
|
||||
else
|
||||
echo "$0: Error: --no-git requires --gnulib-srcdir" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||
echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure that lines starting with ! sort last, per gitignore conventions
|
||||
# for whitelisting exceptions after a more generic blacklist pattern.
|
||||
sort_patterns() {
|
||||
sort -u "$@" | sed '/^!/ {
|
||||
H
|
||||
d
|
||||
}
|
||||
$ {
|
||||
P
|
||||
x
|
||||
s/^\n//
|
||||
}'
|
||||
}
|
||||
|
||||
# If $STR is not already on a line by itself in $FILE, insert it,
|
||||
# sorting the new contents of the file and replacing $FILE with the result.
|
||||
insert_sorted_if_absent() {
|
||||
file=$1
|
||||
str=$2
|
||||
test -f $file || touch $file
|
||||
echo "$str" | sort_patterns - $file | cmp - $file > /dev/null \
|
||||
|| { echo "$str" | sort_patterns - $file > $file.bak \
|
||||
&& mv $file.bak $file; } \
|
||||
echo "$str" | sort -u - $file | cmp - $file > /dev/null \
|
||||
|| echo "$str" | sort -u - $file -o $file \
|
||||
|| exit 1
|
||||
}
|
||||
|
||||
@@ -309,13 +251,13 @@ insert_sorted_if_absent() {
|
||||
# insert_sorted_if_absent.
|
||||
insert_vc_ignore() {
|
||||
vc_ignore_file="$1"
|
||||
pattern="$2"
|
||||
case $vc_ignore_file in
|
||||
*.gitignore)
|
||||
# A .gitignore entry that does not start with `/' applies
|
||||
# recursively to subdirectories, so prepend `/' to every
|
||||
# .gitignore entry.
|
||||
pattern=`echo "$pattern" | sed s,^,/,`;;
|
||||
# A .gitignore entry that does not start with `/' applies recursively to
|
||||
# subdirectories, so prepend `/' to every .gitignore entry.
|
||||
pattern=`echo "$2" | sed s,^,/,`;;
|
||||
*)
|
||||
pattern="$2";;
|
||||
esac
|
||||
insert_sorted_if_absent "$vc_ignore_file" "$pattern"
|
||||
}
|
||||
@@ -388,18 +330,17 @@ get_version() {
|
||||
$app --version >/dev/null 2>&1 || return 1
|
||||
|
||||
$app --version 2>&1 |
|
||||
sed -n '# Move version to start of line.
|
||||
s/.*[v ]\([0-9]\)/\1/
|
||||
sed -n '# extract version within line
|
||||
s/.*[v ]\{1,\}\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/
|
||||
t done
|
||||
|
||||
# Skip lines that do not start with version.
|
||||
/^[0-9]/!d
|
||||
# extract version at start of line
|
||||
s/^\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/
|
||||
t done
|
||||
|
||||
# Remove characters after the version.
|
||||
s/[^.a-z0-9-].*//
|
||||
|
||||
# The first component must be digits only.
|
||||
s/^\([0-9]*\)[a-z-].*/\1/
|
||||
d
|
||||
|
||||
:done
|
||||
#the following essentially does s/5.005/5.5/
|
||||
s/\.0*\([1-9]\)/.\1/g
|
||||
p
|
||||
@@ -410,26 +351,18 @@ check_versions() {
|
||||
ret=0
|
||||
|
||||
while read app req_ver; do
|
||||
# We only need libtoolize from the libtool package.
|
||||
if test "$app" = libtool; then
|
||||
app=libtoolize
|
||||
fi
|
||||
# Exempt git if --no-git is in effect.
|
||||
if test "$app" = git; then
|
||||
$use_git || continue
|
||||
fi
|
||||
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
|
||||
appvar=`echo $app | tr '[a-z]-' '[A-Z]_'`
|
||||
appvar=`echo $app | tr '[a-z]' '[A-Z]'`
|
||||
test "$appvar" = TAR && appvar=AMTAR
|
||||
eval "app=\${$appvar-$app}"
|
||||
inst_ver=$(get_version $app)
|
||||
if [ ! "$inst_ver" ]; then
|
||||
echo "$me: Error: '$app' not found" >&2
|
||||
echo "Error: '$app' not found" >&2
|
||||
ret=1
|
||||
elif [ ! "$req_ver" = "-" ]; then
|
||||
latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
|
||||
if [ ! "$latest_ver" = "$inst_ver" ]; then
|
||||
echo "$me: Error: '$app' version == $inst_ver is too old" >&2
|
||||
echo "Error: '$app' version == $inst_ver is too old" >&2
|
||||
echo " '$app' version >= $req_ver is required" >&2
|
||||
ret=1
|
||||
fi
|
||||
@@ -442,30 +375,16 @@ check_versions() {
|
||||
print_versions() {
|
||||
echo "Program Min_version"
|
||||
echo "----------------------"
|
||||
printf %s "$buildreq"
|
||||
printf "$buildreq"
|
||||
echo "----------------------"
|
||||
# can't depend on column -t
|
||||
}
|
||||
|
||||
use_libtool=0
|
||||
# We'd like to use grep -E, to see if any of LT_INIT,
|
||||
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
|
||||
# but that's not portable enough (e.g., for Solaris).
|
||||
grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
|
||||
&& use_libtool=1
|
||||
grep '^[ ]*LT_INIT' configure.ac >/dev/null \
|
||||
&& use_libtool=1
|
||||
if test $use_libtool = 1; then
|
||||
find_tool LIBTOOLIZE glibtoolize libtoolize
|
||||
fi
|
||||
|
||||
if ! printf "$buildreq" | check_versions; then
|
||||
echo >&2
|
||||
if test -f README-prereq; then
|
||||
echo "$0: See README-prereq for how to get the prerequisite programs" >&2
|
||||
else
|
||||
echo "$0: Please install the prerequisite programs" >&2
|
||||
fi
|
||||
test -f README-prereq &&
|
||||
echo "See README-prereq for notes on obtaining these prerequisite programs:" >&2
|
||||
echo
|
||||
print_versions
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -476,18 +395,18 @@ if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
|
||||
if git config merge.merge-changelog.driver >/dev/null ; then
|
||||
:
|
||||
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
|
||||
echo "$0: initializing git-merge-changelog driver"
|
||||
echo "initializing git-merge-changelog driver"
|
||||
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
|
||||
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
|
||||
else
|
||||
echo "$0: consider installing git-merge-changelog from gnulib"
|
||||
echo "consider installing git-merge-changelog from gnulib"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
cleanup_gnulib() {
|
||||
status=$?
|
||||
rm -fr "$gnulib_path"
|
||||
rm -fr gnulib
|
||||
exit $status
|
||||
}
|
||||
|
||||
@@ -495,9 +414,6 @@ git_modules_config () {
|
||||
test -f .gitmodules && git config --file .gitmodules "$@"
|
||||
}
|
||||
|
||||
gnulib_path=`git_modules_config submodule.gnulib.path`
|
||||
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||
|
||||
# Get gnulib files.
|
||||
|
||||
case ${GNULIB_SRCDIR--} in
|
||||
@@ -507,58 +423,34 @@ case ${GNULIB_SRCDIR--} in
|
||||
git submodule init || exit $?
|
||||
git submodule update || exit $?
|
||||
|
||||
elif [ ! -d "$gnulib_path" ]; then
|
||||
elif [ ! -d gnulib ]; then
|
||||
echo "$0: getting gnulib files..."
|
||||
|
||||
trap cleanup_gnulib 1 2 13 15
|
||||
|
||||
shallow=
|
||||
git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
|
||||
git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
|
||||
git clone --help|grep depth > /dev/null && shallow='--depth 2' || shallow=
|
||||
git clone $shallow git://git.sv.gnu.org/gnulib ||
|
||||
cleanup_gnulib
|
||||
|
||||
trap - 1 2 13 15
|
||||
fi
|
||||
GNULIB_SRCDIR=$gnulib_path
|
||||
GNULIB_SRCDIR=gnulib
|
||||
;;
|
||||
*)
|
||||
# Use GNULIB_SRCDIR as a reference.
|
||||
# Redirect the gnulib submodule to the directory on the command line
|
||||
# if possible.
|
||||
if test -d "$GNULIB_SRCDIR"/.git && \
|
||||
git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
git submodule init
|
||||
GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd`
|
||||
git_modules_config --replace-all submodule.gnulib.url $GNULIB_SRCDIR
|
||||
echo "$0: getting gnulib files..."
|
||||
if git submodule -h|grep -- --reference > /dev/null; then
|
||||
# Prefer the one-liner available in git 1.6.4 or newer.
|
||||
git submodule update --init --reference "$GNULIB_SRCDIR" \
|
||||
"$gnulib_path" || exit $?
|
||||
else
|
||||
# This fallback allows at least git 1.5.5.
|
||||
if test -f "$gnulib_path"/gnulib-tool; then
|
||||
# Since file already exists, assume submodule init already complete.
|
||||
git submodule update || exit $?
|
||||
else
|
||||
# Older git can't clone into an empty directory.
|
||||
rmdir "$gnulib_path" 2>/dev/null
|
||||
git clone --reference "$GNULIB_SRCDIR" \
|
||||
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
||||
&& git submodule init && git submodule update \
|
||||
|| exit $?
|
||||
fi
|
||||
fi
|
||||
GNULIB_SRCDIR=$gnulib_path
|
||||
git submodule update || exit $?
|
||||
GNULIB_SRCDIR=gnulib
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if $bootstrap_sync; then
|
||||
cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
|
||||
echo "$0: updating bootstrap and restarting..."
|
||||
exec sh -c \
|
||||
'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
||||
-- "$GNULIB_SRCDIR/build-aux/bootstrap" \
|
||||
"$0" "$@" --no-bootstrap-sync
|
||||
}
|
||||
fi
|
||||
|
||||
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||
<$gnulib_tool || exit
|
||||
|
||||
@@ -567,29 +459,27 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||
download_po_files() {
|
||||
subdir=$1
|
||||
domain=$2
|
||||
echo "$me: getting translations into $subdir for $domain..."
|
||||
echo "$0: getting translations into $subdir for $domain..."
|
||||
cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
|
||||
eval "$cmd"
|
||||
}
|
||||
|
||||
# Mirror .po files to $po_dir/.reference and copy only the new
|
||||
# Download .po files to $po_dir/.reference and copy only the new
|
||||
# or modified ones into $po_dir. Also update $po_dir/LINGUAS.
|
||||
# Note po files that exist locally only are left in $po_dir but will
|
||||
# not be included in LINGUAS and hence will not be distributed.
|
||||
update_po_files() {
|
||||
# Directory containing primary .po files.
|
||||
# Overwrite them only when we're sure a .po file is new.
|
||||
po_dir=$1
|
||||
domain=$2
|
||||
|
||||
# Mirror *.po files into this dir.
|
||||
# Download *.po files into this dir.
|
||||
# Usually contains *.s1 checksum files.
|
||||
ref_po_dir="$po_dir/.reference"
|
||||
|
||||
test -d $ref_po_dir || mkdir $ref_po_dir || return
|
||||
download_po_files $ref_po_dir $domain \
|
||||
&& ls "$ref_po_dir"/*.po 2>/dev/null |
|
||||
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
|
||||
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS"
|
||||
|
||||
langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'`
|
||||
test "$langs" = '*' && langs=x
|
||||
@@ -601,7 +491,7 @@ update_po_files() {
|
||||
! test -f "$po_dir/$po.po" ||
|
||||
! $SHA1SUM -c --status "$cksum_file" \
|
||||
< "$new_po" > /dev/null; then
|
||||
echo "$me: updated $po_dir/$po.po..."
|
||||
echo "updated $po_dir/$po.po..."
|
||||
cp "$new_po" "$po_dir/$po.po" \
|
||||
&& $SHA1SUM < "$new_po" > "$cksum_file"
|
||||
fi
|
||||
@@ -619,6 +509,27 @@ case $SKIP_PO in
|
||||
fi;;
|
||||
esac
|
||||
|
||||
check_dst_dir()
|
||||
{
|
||||
dst=$1
|
||||
# If the destination directory doesn't exist, create it.
|
||||
# This is required at least for "lib/uniwidth/cjk.h".
|
||||
dst_dir=`dirname "$dst"`
|
||||
if ! test -d "$dst_dir"; then
|
||||
mkdir -p "$dst_dir"
|
||||
|
||||
# If we've just created a directory like lib/uniwidth,
|
||||
# tell version control system(s) it's ignorable.
|
||||
# FIXME: for now, this does only one level
|
||||
parent=`dirname "$dst_dir"`
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
ig=$parent/$dot_ig
|
||||
insert_vc_ignore $ig `echo "$dst_dir"|sed 's,.*/,,'`
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
symlink_to_dir()
|
||||
{
|
||||
src=$1/$2
|
||||
@@ -626,33 +537,18 @@ symlink_to_dir()
|
||||
|
||||
test -f "$src" && {
|
||||
|
||||
# If the destination directory doesn't exist, create it.
|
||||
# This is required at least for "lib/uniwidth/cjk.h".
|
||||
dst_dir=`dirname "$dst"`
|
||||
if ! test -d "$dst_dir"; then
|
||||
mkdir -p "$dst_dir"
|
||||
|
||||
# If we've just created a directory like lib/uniwidth,
|
||||
# tell version control system(s) it's ignorable.
|
||||
# FIXME: for now, this does only one level
|
||||
parent=`dirname "$dst_dir"`
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
ig=$parent/$dot_ig
|
||||
insert_vc_ignore $ig `echo "$dst_dir"|sed 's,.*/,,'`
|
||||
done
|
||||
fi
|
||||
check_dst_dir "$dst"
|
||||
|
||||
if $copy; then
|
||||
{
|
||||
test ! -h "$dst" || {
|
||||
echo "$me: rm -f $dst" &&
|
||||
echo "$0: rm -f $dst" &&
|
||||
rm -f "$dst"
|
||||
}
|
||||
} &&
|
||||
test -f "$dst" &&
|
||||
cmp -s "$src" "$dst" || {
|
||||
echo "$me: cp -fp $src $dst" &&
|
||||
echo "$0: cp -fp $src $dst" &&
|
||||
cp -fp "$src" "$dst"
|
||||
}
|
||||
else
|
||||
@@ -666,7 +562,7 @@ symlink_to_dir()
|
||||
*)
|
||||
case /$dst/ in
|
||||
*//* | */../* | */./* | /*/*/*/*/*/)
|
||||
echo >&2 "$me: invalid symlink calculation: $src -> $dst"
|
||||
echo >&2 "$0: invalid symlink calculation: $src -> $dst"
|
||||
exit 1;;
|
||||
/*/*/*/*/) dot_dots=../../../;;
|
||||
/*/*/*/) dot_dots=../../;;
|
||||
@@ -674,7 +570,7 @@ symlink_to_dir()
|
||||
esac;;
|
||||
esac
|
||||
|
||||
echo "$me: ln -fs $dot_dots$src $dst" &&
|
||||
echo "$0: ln -fs $dot_dots$src $dst" &&
|
||||
ln -fs "$dot_dots$src" "$dst"
|
||||
}
|
||||
fi
|
||||
@@ -698,22 +594,18 @@ cp_mark_as_generated()
|
||||
*) c1= ; c2= ;;
|
||||
esac
|
||||
|
||||
# If the destination directory doesn't exist, create it.
|
||||
# This is required at least for "lib/uniwidth/cjk.h".
|
||||
dst_dir=`dirname "$cp_dst"`
|
||||
test -d "$dst_dir" || mkdir -p "$dst_dir"
|
||||
|
||||
if test -z "$c1"; then
|
||||
cmp -s "$cp_src" "$cp_dst" || {
|
||||
# Copy the file first to get proper permissions if it
|
||||
# doesn't already exist. Then overwrite the copy.
|
||||
echo "$me: cp -f $cp_src $cp_dst" &&
|
||||
echo "$0: cp -f $cp_src $cp_dst" &&
|
||||
rm -f "$cp_dst" &&
|
||||
cp "$cp_src" "$cp_dst-t" &&
|
||||
sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" &&
|
||||
mv -f "$cp_dst-t" "$cp_dst"
|
||||
}
|
||||
else
|
||||
check_dst_dir "$cp_dst"
|
||||
# Copy the file first to get proper permissions if it
|
||||
# doesn't already exist. Then overwrite the copy.
|
||||
cp "$cp_src" "$cp_dst-t" &&
|
||||
@@ -725,7 +617,7 @@ cp_mark_as_generated()
|
||||
if cmp -s "$cp_dst-t" "$cp_dst"; then
|
||||
rm -f "$cp_dst-t"
|
||||
else
|
||||
echo "$me: cp $cp_src $cp_dst # with edits" &&
|
||||
echo "$0: cp $cp_src $cp_dst # with edits" &&
|
||||
mv -f "$cp_dst-t" "$cp_dst"
|
||||
fi
|
||||
fi
|
||||
@@ -744,7 +636,7 @@ version_controlled_file() {
|
||||
elif test -d .svn; then
|
||||
svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes
|
||||
else
|
||||
echo "$me: no version control for $dir/$file?" >&2
|
||||
echo "$0: no version control for $dir/$file?" >&2
|
||||
fi
|
||||
test $found = yes
|
||||
}
|
||||
@@ -756,34 +648,31 @@ slurp() {
|
||||
for file in `ls -a $1/$dir`; do
|
||||
case $file in
|
||||
.|..) continue;;
|
||||
# FIXME: should all file names starting with "." be ignored?
|
||||
.*) continue;;
|
||||
.*) continue;; # FIXME: should all file names starting with "." be ignored?
|
||||
esac
|
||||
test -d $1/$dir/$file && continue
|
||||
for excluded_file in $excluded_files; do
|
||||
test "$dir/$file" = "$excluded_file" && continue 2
|
||||
done
|
||||
if test $file = Makefile.am && test "X$gnulib_mk" != XMakefile.am; then
|
||||
if test $file = Makefile.am; then
|
||||
copied=$copied${sep}$gnulib_mk; sep=$nl
|
||||
remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g"
|
||||
sed "$remove_intl" $1/$dir/$file |
|
||||
cmp - $dir/$gnulib_mk > /dev/null || {
|
||||
echo "$me: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
|
||||
sed "$remove_intl" $1/$dir/$file | cmp - $dir/$gnulib_mk > /dev/null || {
|
||||
echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
|
||||
rm -f $dir/$gnulib_mk &&
|
||||
sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk &&
|
||||
gnulib_mk_hook $dir/$gnulib_mk
|
||||
sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk
|
||||
}
|
||||
elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
|
||||
version_controlled_file $dir $file; then
|
||||
echo "$me: $dir/$file overrides $1/$dir/$file"
|
||||
echo "$0: $dir/$file overrides $1/$dir/$file"
|
||||
else
|
||||
copied=$copied$sep$file; sep=$nl
|
||||
if test $file = gettext.m4; then
|
||||
echo "$me: patching m4/gettext.m4 to remove need for intl/* ..."
|
||||
echo "$0: patching m4/gettext.m4 to remove need for intl/* ..."
|
||||
rm -f $dir/$file
|
||||
sed '
|
||||
/^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
|
||||
AC_DEFUN([AM_INTL_SUBDIR], [])
|
||||
AC_DEFUN([AM_INTL_SUBDIR], [
|
||||
/^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\
|
||||
AC_DEFUN([gt_INTL_SUBDIR_CORE], [])
|
||||
$a\
|
||||
@@ -804,14 +693,7 @@ slurp() {
|
||||
# the name with just ".h". Many gnulib headers are generated,
|
||||
# e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc.
|
||||
# Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed
|
||||
f=`echo "$copied" |
|
||||
sed '
|
||||
s/\.in\.h$/.h/
|
||||
s/\.sin$/.sed/
|
||||
s/\.y$/.c/
|
||||
s/\.gperf$/.h/
|
||||
'
|
||||
`
|
||||
f=`echo "$copied"|sed 's/\.in\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'`
|
||||
insert_vc_ignore $ig "$f"
|
||||
|
||||
# For files like sys_stat.in.h and sys_time.in.h, record as
|
||||
@@ -842,12 +724,6 @@ gnulib_tool_options="\
|
||||
--local-dir $local_gl_dir\
|
||||
$gnulib_tool_option_extras\
|
||||
"
|
||||
if test $use_libtool = 1; then
|
||||
case "$gnulib_tool_options " in
|
||||
*' --libtool '*) ;;
|
||||
*) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
|
||||
esac
|
||||
fi
|
||||
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
||||
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
|
||||
slurp $bt || exit
|
||||
@@ -890,18 +766,26 @@ grep -E '^[ ]*AC_CONFIG_HEADERS?\>' configure.ac >/dev/null ||
|
||||
|
||||
for command in \
|
||||
libtool \
|
||||
"${ACLOCAL-aclocal} --force -I '$m4_base' $ACLOCAL_FLAGS" \
|
||||
"${ACLOCAL-aclocal} --force -I m4" \
|
||||
"${AUTOCONF-autoconf} --force" \
|
||||
"${AUTOHEADER-autoheader} --force" \
|
||||
"${AUTOMAKE-automake} --add-missing --copy --force-missing"
|
||||
do
|
||||
if test "$command" = libtool; then
|
||||
use_libtool=0
|
||||
# We'd like to use grep -E, to see if any of LT_INIT,
|
||||
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
|
||||
# but that's not portable enough (e.g., for Solaris).
|
||||
grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
|
||||
&& use_libtool=1
|
||||
grep '^[ ]*LT_INIT' configure.ac >/dev/null \
|
||||
&& use_libtool=1
|
||||
test $use_libtool = 0 \
|
||||
&& continue
|
||||
command="${LIBTOOLIZE-libtoolize} -c -f"
|
||||
fi
|
||||
echo "$0: $command ..."
|
||||
eval "$command" || exit
|
||||
$command || exit
|
||||
done
|
||||
|
||||
|
||||
@@ -921,14 +805,13 @@ if test $with_gettext = yes; then
|
||||
rm -f po/Makevars
|
||||
sed '
|
||||
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
|
||||
/^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/
|
||||
/^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$MSGID_BUGS_ADDRESS"'|
|
||||
/^MSGID_BUGS_ADDRESS *=/s/=.*/= '"$MSGID_BUGS_ADDRESS"'/
|
||||
/^XGETTEXT_OPTIONS *=/{
|
||||
s/$/ \\/
|
||||
a\
|
||||
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
|
||||
}
|
||||
' po/Makevars.template >po/Makevars || exit 1
|
||||
' po/Makevars.template >po/Makevars
|
||||
|
||||
if test -d runtime-po; then
|
||||
# Similarly for runtime-po/Makevars, but not quite the same.
|
||||
@@ -942,7 +825,7 @@ if test $with_gettext = yes; then
|
||||
a\
|
||||
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
|
||||
}
|
||||
' po/Makevars.template >runtime-po/Makevars || exit 1
|
||||
' <po/Makevars.template >runtime-po/Makevars
|
||||
|
||||
# Copy identical files from po to runtime-po.
|
||||
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||
@@ -953,10 +836,6 @@ bootstrap_epilogue
|
||||
|
||||
echo "$0: done. Now you can run './configure'."
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# Local Variables:
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
|
||||
+16
-25
@@ -1,6 +1,6 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2010 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -17,17 +17,12 @@
|
||||
|
||||
# gnulib modules used by this package.
|
||||
gnulib_modules='
|
||||
announce-gen argmatch assert calloc-posix close config-h c-strcase
|
||||
configmake dirname error extensions fopen-safer gendocs getopt-gnu
|
||||
gettext git-version-gen hash inttypes isnan javacomp-script
|
||||
javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr
|
||||
mbswidth obstack perror pipe-posix quote quotearg realloc-posix
|
||||
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
|
||||
announce-gen argmatch assert config-h c-strcase configmake dirname
|
||||
error extensions fopen-safer gendocs getopt-gnu gettext
|
||||
git-version-gen hash inttypes javacomp-script javaexec-script
|
||||
maintainer-makefile malloc mbswidth obstack quote quotearg stdbool
|
||||
stpcpy strerror strtoul strverscmp unistd unistd-safer unlocked-io
|
||||
update-copyright unsetenv verify warnings xalloc xalloc-die xstrndup
|
||||
'
|
||||
|
||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||
@@ -46,30 +41,26 @@ XGETTEXT_OPTIONS_RUNTIME=$XGETTEXT_OPTIONS'\\\
|
||||
# Gettext supplies these files, but we don't need them since
|
||||
# we don't have an intl subdirectory.
|
||||
excluded_files='
|
||||
m4/codeset.m4
|
||||
m4/glibc2.m4
|
||||
m4/glibc21.m4
|
||||
m4/intdiv0.m4
|
||||
m4/intl.m4
|
||||
m4/intldir.m4
|
||||
m4/intmax.m4
|
||||
m4/inttypes_h.m4
|
||||
m4/lcmessage.m4
|
||||
m4/lock.m4
|
||||
m4/longdouble.m4
|
||||
m4/printf-posix.m4
|
||||
m4/signed.m4
|
||||
m4/size_max.m4
|
||||
m4/uintmax_t.m4
|
||||
m4/ulonglong.m4
|
||||
m4/visibility.m4
|
||||
m4/xsize.m4
|
||||
'
|
||||
|
||||
bootstrap_epilogue()
|
||||
{
|
||||
# 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
|
||||
# In directories like lib/, m4/, and po/, generate both these files because we
|
||||
# still try to support CVS emulation.
|
||||
vc_ignore='.cvsignore .gitignore'
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
announce-gen
|
||||
arg-nonnull.h
|
||||
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
|
||||
update-copyright
|
||||
useless-if-before-free
|
||||
vc-list-files
|
||||
warn-on-use.h
|
||||
ylwrap
|
||||
@@ -1,9 +1,7 @@
|
||||
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/announce-gen
|
||||
/arg-nonnull.h
|
||||
/c++defs.h
|
||||
/compile
|
||||
/config.guess
|
||||
/config.rpath
|
||||
@@ -23,4 +21,3 @@
|
||||
/vc-list-files
|
||||
/warn-on-use.h
|
||||
/ylwrap
|
||||
|
||||
|
||||
+10
-38
@@ -5,10 +5,7 @@ use 5.005;
|
||||
use strict;
|
||||
|
||||
my %option;
|
||||
my %directive;
|
||||
my $scanner = `grep -i '"%[a-z]' $ARGV[0]`;
|
||||
$scanner =~ s/"\[-_\]"/-/g;
|
||||
while (<STDIN>)
|
||||
while (<>)
|
||||
{
|
||||
if (/^\s* # Initial spaces.
|
||||
(?:(-\w),\s+)? # $1: $short: Possible short option.
|
||||
@@ -19,14 +16,7 @@ while (<STDIN>)
|
||||
/x)
|
||||
{
|
||||
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
|
||||
$short = '' if ! defined $short;
|
||||
$short = '-d' if $long eq '--defines' && ! $short;
|
||||
my $dir = '%' . substr($long, 2);
|
||||
if (index ($scanner, "\"$dir\"") < 0)
|
||||
{
|
||||
if ($long eq '--force-define') { $dir = '%define'; }
|
||||
else { $dir = ''; }
|
||||
}
|
||||
$short = defined $short ? '@option{' . $short . '}' : '';
|
||||
if ($arg)
|
||||
{
|
||||
# if $opt, $arg contains the closing ].
|
||||
@@ -34,7 +24,6 @@ while (<STDIN>)
|
||||
if $opt eq '[';
|
||||
$arg =~ s/^=//;
|
||||
$arg = lc ($arg);
|
||||
my $dir_arg = $arg;
|
||||
# If the argument is compite (e.g., for --define[=NAME[=VALUE]]),
|
||||
# put each word in @var, to build @var{name}[=@var{value}], not
|
||||
# @var{name[=value]}].
|
||||
@@ -44,36 +33,19 @@ while (<STDIN>)
|
||||
$long_arg = "[$long_arg]";
|
||||
$arg = "[$arg]";
|
||||
}
|
||||
# For arguments of directives: this only works if all arguments
|
||||
# are strings and have the same syntax as on the command line.
|
||||
if ($dir_arg eq 'name[=value]')
|
||||
{
|
||||
$dir_arg = '@var{name} ["@var{value}"]';
|
||||
}
|
||||
else
|
||||
{
|
||||
$dir_arg =~ s/(\w+)/\@var{"$1"}/g;
|
||||
$dir_arg = '[' . $dir_arg . ']'
|
||||
if $opt eq '[';
|
||||
}
|
||||
$long = "$long$long_arg";
|
||||
$short = "$short $arg" if $short && $short ne '-d';
|
||||
$dir = "$dir $dir_arg" if $dir;
|
||||
$option{"$long$long_arg"} = $short ? "$short $arg" : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$option{"$long"} = "$short";
|
||||
}
|
||||
$option{$long} = $short;
|
||||
$directive{$long} = $dir;
|
||||
}
|
||||
}
|
||||
|
||||
my $sep = '';
|
||||
foreach my $long (sort keys %option)
|
||||
{
|
||||
# Avoid trailing spaces.
|
||||
print $sep;
|
||||
$sep = "\n";
|
||||
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";
|
||||
printf ("\@item %-40s \@tab%s\n",
|
||||
'@option{' . $long . '}',
|
||||
$option{$long} ? " $option{$long}" : "");
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# Update b4_copyright invocations or b4_copyright_years definitions to
|
||||
# include the current year.
|
||||
|
||||
# Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 2009-2010 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)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
||||
|
||||
# Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2010 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
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# Customize maint.mk -*- makefile -*-
|
||||
|
||||
# Copyright (C) 2008-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2008-2010 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
|
||||
@@ -42,11 +41,7 @@ local-checks-to-skip = changelog-check
|
||||
# this release. Used solely to get a date for the "announcement" target.
|
||||
gnulib_dir = $(srcdir)/gnulib
|
||||
|
||||
bootstrap-tools = autoconf,automake,flex,gettext,gnulib
|
||||
|
||||
announcement_Cc_ = \
|
||||
[email protected], [email protected], [email protected], \
|
||||
[email protected]
|
||||
bootstrap-tools = autoconf,automake,flex,gnulib
|
||||
|
||||
update-copyright: update-b4-copyright update-package-copyright-year
|
||||
update-copyright-env = \
|
||||
|
||||
+12
-18
@@ -1,6 +1,6 @@
|
||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2001-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2010 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -15,17 +15,15 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# In order for some versions of Sun Studio to compile our C++ test cases
|
||||
# correctly, we need Autoconf 2.64 or better to handle the restrict
|
||||
# keyword in at least string.h from gnulib.
|
||||
AC_PREREQ(2.64)
|
||||
# We have strange test case titles, so we need Autoconf 2.61 or better.
|
||||
AC_PREREQ(2.61)
|
||||
|
||||
AC_INIT([GNU Bison],
|
||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||
[[email protected]])
|
||||
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2011],
|
||||
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2010],
|
||||
[The copyright year for this package])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2011])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2010])
|
||||
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
@@ -36,15 +34,11 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||
#
|
||||
# To avoid 1.11, we make 1.11.1 the minimum version.
|
||||
#
|
||||
# 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.
|
||||
# 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
|
||||
# bogus NEWS entry.
|
||||
AM_INIT_AUTOMAKE([1.11.1 dist-bzip2]
|
||||
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
||||
[gnu], [gnits]))
|
||||
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [-], [gnu], [gnu]))
|
||||
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
||||
|
||||
# Checks for the compiler.
|
||||
@@ -84,6 +78,7 @@ if test "${enableval}" = yes; then
|
||||
WARN_CFLAGS_TEST="$WARN_CFLAGS $WARN_CFLAGS_TEST"
|
||||
AC_SUBST([WARN_CXXFLAGS_TEST])
|
||||
AC_SUBST([WARN_CFLAGS_TEST])
|
||||
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
||||
fi
|
||||
|
||||
BISON_TEST_FOR_WORKING_C_COMPILER
|
||||
@@ -132,10 +127,9 @@ BISON_PREREQ_SUBPIPE
|
||||
BISON_PREREQ_TIMEVAR
|
||||
|
||||
# Gettext.
|
||||
# We use gnulib, which is only guaranteed to work properly with the
|
||||
# latest Gettext.
|
||||
# We've never tested with gettext versions before 0.15, so play it safe.
|
||||
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||
AM_GNU_GETTEXT_VERSION([0.18])
|
||||
AM_GNU_GETTEXT_VERSION([0.15])
|
||||
BISON_I18N
|
||||
|
||||
# Internationalized parsers.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2002, 2005-2011 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2002, 2005-2010 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
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ into various formats.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2008-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
+22
-46
@@ -1,8 +1,7 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Language-independent M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2004-2010 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
|
||||
@@ -312,13 +311,13 @@ b4_define_user_code([stype])
|
||||
|
||||
|
||||
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
|
||||
# -----------------------------------------------------
|
||||
# Complain if any name of type WHAT is used by the user (as recorded in
|
||||
# USER-LIST) but is not used by Bison (as recorded by macros in the
|
||||
# namespace BISON-NAMESPACE).
|
||||
# --------------------------------------------------------
|
||||
# Warn if any name of type WHAT is used by the user (as recorded in USER-LIST)
|
||||
# but is not used by Bison (as recorded by macros in the namespace
|
||||
# BISON-NAMESPACE).
|
||||
#
|
||||
# USER-LIST must expand to a list specifying all user occurrences of all names
|
||||
# of type WHAT. Each item in the list must be a triplet specifying one
|
||||
# USER-LIST must expand to a list specifying all grammar occurrences of all
|
||||
# names 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
|
||||
# fine. An empty list is fine.
|
||||
#
|
||||
@@ -353,35 +352,19 @@ m4_pushdef([b4_user_name], m4_car(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_ifndef($3[(]m4_quote(b4_user_name)[)],
|
||||
[b4_complain_at([b4_start], [b4_end],
|
||||
[[%s `%s' is not used]],
|
||||
[$1], [b4_user_name])])[]dnl
|
||||
[b4_warn_at([b4_start], [b4_end],
|
||||
[[%s `%s' is not used]],
|
||||
[$1], [b4_user_name])])[]dnl
|
||||
m4_popdef([b4_occurrence])dnl
|
||||
m4_popdef([b4_user_name])dnl
|
||||
m4_popdef([b4_start])dnl
|
||||
m4_popdef([b4_end])dnl
|
||||
])])
|
||||
|
||||
|
||||
|
||||
|
||||
## --------------------- ##
|
||||
## b4_percent_define_*. ##
|
||||
## --------------------- ##
|
||||
|
||||
|
||||
# b4_percent_define_use(VARIABLE)
|
||||
# b4_percent_define_get(VARIABLE)
|
||||
# -------------------------------
|
||||
# Declare that VARIABLE was used.
|
||||
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
|
||||
# Mimic muscle_percent_define_get in ../src/muscle_tab.h exactly. That is, if
|
||||
# the %define variable VARIABLE is defined, emit its value. Also, record
|
||||
# Bison's usage of VARIABLE by defining
|
||||
# b4_percent_define_bison_variables(VARIABLE).
|
||||
#
|
||||
@@ -389,15 +372,12 @@ m4_define([b4_percent_define_use],
|
||||
#
|
||||
# b4_percent_define_get([[foo]])
|
||||
m4_define([b4_percent_define_get],
|
||||
[b4_percent_define_use([$1])dnl
|
||||
m4_ifdef([b4_percent_define(]$1[)],
|
||||
[m4_indir([b4_percent_define(]$1[)])],
|
||||
[$2])])
|
||||
|
||||
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
|
||||
m4_ifdef([b4_percent_define(]$1[)], [m4_indir([b4_percent_define(]$1[)])])])
|
||||
|
||||
# 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
|
||||
# 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
|
||||
@@ -416,7 +396,7 @@ m4_popdef([b4_loc])],
|
||||
|
||||
# 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
|
||||
# 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
|
||||
@@ -433,7 +413,7 @@ m4_define([b4_percent_define_get_syncline],
|
||||
|
||||
# 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-FALSE. Also, record Bison's usage of VARIABLE by defining
|
||||
# b4_percent_define_bison_variables(VARIABLE).
|
||||
@@ -448,7 +428,7 @@ m4_define([b4_percent_define_ifdef],
|
||||
|
||||
# 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 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
|
||||
@@ -471,7 +451,7 @@ m4_define([b4_percent_define_flag_if],
|
||||
|
||||
# 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.
|
||||
# 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.
|
||||
@@ -489,7 +469,7 @@ m4_define([b4_percent_define_default],
|
||||
|
||||
# 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
|
||||
# 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
|
||||
@@ -518,11 +498,7 @@ m4_define([_b4_percent_define_check_values],
|
||||
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||
[[invalid value for %%define variable `%s': `%s']],
|
||||
[$1],
|
||||
m4_dquote(m4_indir([b4_percent_define(]$1[)])))
|
||||
m4_foreach([b4_value], m4_dquote(m4_shift($@)),
|
||||
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||
[[accepted value: `%s']],
|
||||
m4_dquote(b4_value))])])dnl
|
||||
m4_dquote(m4_indir([b4_percent_define(]$1[)])))])dnl
|
||||
m4_popdef([b4_good_value])],
|
||||
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_check_values]], [$1])])])
|
||||
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C++ skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2007, 2009-2010 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
|
||||
|
||||
+4
-9
@@ -2,7 +2,7 @@
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2010 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
|
||||
@@ -25,12 +25,7 @@ m4_include(b4_pkgdatadir/[c.m4])
|
||||
|
||||
# Default parser class name.
|
||||
b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||
|
||||
# Don't do that so that we remember whether we're using a user
|
||||
# request, or the default value.
|
||||
#
|
||||
# b4_percent_define_default([[location_type]], [[location]])
|
||||
|
||||
b4_percent_define_default([[location_type]], [[location]])
|
||||
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
|
||||
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
||||
@@ -79,9 +74,9 @@ m4_define([b4_namespace_open],
|
||||
m4_define([b4_namespace_close],
|
||||
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
||||
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]),
|
||||
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*],
|
||||
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^][:]\)*],
|
||||
[\1])),
|
||||
[::\([^][:]\|:[^:]\)*], [} ])[} // ]b4_namespace_ref])])
|
||||
[::\([^][:]\|:[^][:]\)*], [} ])[} // ]b4_namespace_ref])])
|
||||
|
||||
|
||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2007, 2009-2010 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
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2004-2010 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
|
||||
@@ -31,7 +30,7 @@ m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
||||
# -----------------
|
||||
# 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
|
||||
# api.push-pull.
|
||||
# api.push_pull.
|
||||
m4_define([b4_identification],
|
||||
[[/* Identify Bison output. */
|
||||
#define YYBISON 1
|
||||
@@ -134,17 +133,6 @@ m4_define([b4_int_type_for],
|
||||
[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. ##
|
||||
|
||||
+118
-143
@@ -1,8 +1,7 @@
|
||||
-*- C -*-
|
||||
|
||||
# GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2010 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
|
||||
@@ -35,8 +34,8 @@ m4_define_default([b4_stack_depth_init], [200])
|
||||
## ------------------------ ##
|
||||
|
||||
b4_define_flag_if([pure])
|
||||
# If glr.cc is including this file and thus has already set b4_pure_flag,
|
||||
# do not change the value of b4_pure_flag, and do not record a use of api.pure.
|
||||
# If glr.cc is including this file and thus has already set b4_pure_flag, don't
|
||||
# change the value of b4_pure_flag, and don't record a use of api.pure.
|
||||
m4_ifndef([b4_pure_flag],
|
||||
[b4_percent_define_default([[api.pure]], [[false]])
|
||||
m4_define([b4_pure_flag],
|
||||
@@ -150,7 +149,7 @@ m4_changecom()
|
||||
m4_divert_push(0)dnl
|
||||
@output(b4_parser_file_name@)@
|
||||
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||
[2002-2011])
|
||||
[2002-2006, 2009-2010])
|
||||
[
|
||||
/* C GLR parser skeleton written by Paul Hilfinger. */
|
||||
|
||||
@@ -413,9 +412,9 @@ static const ]b4_int_type_for([b4_merger])[ yymerger[] =
|
||||
]b4_merger[
|
||||
};
|
||||
|
||||
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||
YYTABLE doesn't specify something else to do. Zero means the default
|
||||
is an error. */
|
||||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
|
||||
doesn't specify something else to do. Zero means the default is an
|
||||
error. */
|
||||
static const ]b4_int_type_for([b4_defact])[ yydefact[] =
|
||||
{
|
||||
]b4_defact[
|
||||
@@ -443,7 +442,8 @@ static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] =
|
||||
|
||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||
positive, shift that token. If negative, reduce the rule which
|
||||
number is the opposite. If YYTABLE_NINF, syntax error. */
|
||||
number is the opposite. If zero, do what YYDEFACT says.
|
||||
If YYTABLE_NINF, syntax error. */
|
||||
#define YYTABLE_NINF ]b4_table_ninf[
|
||||
static const ]b4_int_type_for([b4_table])[ yytable[] =
|
||||
{
|
||||
@@ -1013,15 +1013,17 @@ yylhsNonterm (yyRuleNum yyrule)
|
||||
return yyr1[yyrule];
|
||||
}
|
||||
|
||||
#define yypact_value_is_default(yystate) \
|
||||
]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[
|
||||
#define yyis_pact_ninf(yystate) \
|
||||
]m4_if(m4_eval(b4_pact_ninf < b4_pact_min), [1],
|
||||
[0],
|
||||
[((yystate) == YYPACT_NINF)])[
|
||||
|
||||
/** True iff LR state STATE has only a default reduction (regardless
|
||||
* of token). */
|
||||
static inline yybool
|
||||
yyisDefaultedState (yyStateNum yystate)
|
||||
{
|
||||
return yypact_value_is_default (yypact[yystate]);
|
||||
return yyis_pact_ninf (yypact[yystate]);
|
||||
}
|
||||
|
||||
/** The default reduction for STATE, assuming it has one. */
|
||||
@@ -1031,8 +1033,10 @@ yydefaultAction (yyStateNum yystate)
|
||||
return yydefact[yystate];
|
||||
}
|
||||
|
||||
#define yytable_value_is_error(yytable_value) \
|
||||
]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[
|
||||
#define yyis_table_ninf(yytable_value) \
|
||||
]m4_if(m4_eval(b4_table_ninf < b4_table_min), [1],
|
||||
[YYID (0)],
|
||||
[((yytable_value) == YYTABLE_NINF)])[
|
||||
|
||||
/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
|
||||
* Result R means
|
||||
@@ -1047,13 +1051,12 @@ yygetLRActions (yyStateNum yystate, int yytoken,
|
||||
int* yyaction, const short int** yyconflicts)
|
||||
{
|
||||
int yyindex = yypact[yystate] + yytoken;
|
||||
if (yypact_value_is_default (yypact[yystate])
|
||||
|| yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
|
||||
if (yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
|
||||
{
|
||||
*yyaction = -yydefact[yystate];
|
||||
*yyconflicts = yyconfl;
|
||||
}
|
||||
else if (! yytable_value_is_error (yytable[yyindex]))
|
||||
else if (! yyis_table_ninf (yytable[yyindex]))
|
||||
{
|
||||
*yyaction = yytable[yyindex];
|
||||
*yyconflicts = yyconfl + yyconflp[yyindex];
|
||||
@@ -1802,7 +1805,7 @@ yyreportAmbiguity (yySemanticOption* yyx0,
|
||||
|
||||
yyerror (]b4_yyerror_args[YY_("syntax is ambiguous"));
|
||||
return yyabort;
|
||||
}]b4_locations_if([[
|
||||
}
|
||||
|
||||
/** Starting at and including state S1, resolve the location for each of the
|
||||
* previous N1 states that is unresolved. The first semantic option of a state
|
||||
@@ -1860,7 +1863,7 @@ yyresolveLocations (yyGLRState* yys1, int yyn1,
|
||||
yylloc = yylloc_current;
|
||||
}
|
||||
}
|
||||
}]])[
|
||||
}
|
||||
|
||||
/** Resolve the ambiguity represented in state S, perform the indicated
|
||||
* actions, and set the semantic value of S. If result != yyok, the chain of
|
||||
@@ -1894,8 +1897,8 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
switch (yypreference (yybest, yyp))
|
||||
{
|
||||
case 0:]b4_locations_if([[
|
||||
yyresolveLocations (yys, 1, yystackp]b4_user_args[);]])[
|
||||
case 0:
|
||||
yyresolveLocations (yys, 1, yystackp]b4_user_args[);
|
||||
return yyreportAmbiguity (yybest, yyp]b4_pure_args[);
|
||||
break;
|
||||
case 1:
|
||||
@@ -2088,130 +2091,102 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
|
||||
/*ARGSUSED*/ static void
|
||||
yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
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 (yystackp->yyerrState == 0)
|
||||
{
|
||||
int yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
yyarg[yycount++] = yytokenName (yytoken);
|
||||
if (!yypact_value_is_default (yyn))
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for this
|
||||
state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = YYLAST - yyn + 1;
|
||||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||||
int yyx;
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
|
||||
&& !yytable_value_is_error (yytable[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytokenName (yyx);
|
||||
yysize1 = yysize + yytnamerr (NULL, yytokenName (yyx));
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if YYERROR_VERBOSE
|
||||
int yyn;
|
||||
yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
if (YYPACT_NINF < yyn && yyn <= YYLAST)
|
||||
{
|
||||
yySymbol yytoken = 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 };
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
int yyx;
|
||||
char *yyfmt;
|
||||
char const *yyf;
|
||||
static char const yyunexpected[] = "syntax error, unexpected %s";
|
||||
static char const yyexpecting[] = ", expecting %s";
|
||||
static char const yyor[] = " or %s";
|
||||
char yyformat[sizeof yyunexpected
|
||||
+ sizeof yyexpecting - 1
|
||||
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
||||
* (sizeof yyor - 1))];
|
||||
char const *yyprefix = yyexpecting;
|
||||
|
||||
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_
|
||||
}
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
yysize1 = yysize + strlen (yyformat);
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = YYLAST - yyn + 1;
|
||||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||||
int yycount = 1;
|
||||
|
||||
if (!yysize_overflow)
|
||||
yymsg = (char *) YYMALLOC (yysize);
|
||||
yyarg[0] = yytokenName (yytoken);
|
||||
yyfmt = yystpcpy (yyformat, yyunexpected);
|
||||
|
||||
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);
|
||||
}
|
||||
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 */
|
||||
yynerrs += 1;
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
yynerrs += 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
|
||||
@@ -2257,7 +2232,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
}
|
||||
yyj = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
if (yypact_value_is_default (yyj))
|
||||
if (yyis_pact_ninf (yyj))
|
||||
return;
|
||||
yyj += yytoken;
|
||||
if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken)
|
||||
@@ -2265,7 +2240,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0)
|
||||
return;
|
||||
}
|
||||
else if (! yytable_value_is_error (yytable[yyj]))
|
||||
else if (yytable[yyj] != 0 && ! yyis_table_ninf (yytable[yyj]))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2286,7 +2261,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
yyGLRState *yys = yystackp->yytops.yystates[0];
|
||||
yyj = yypact[yys->yylrState];
|
||||
if (! yypact_value_is_default (yyj))
|
||||
if (! yyis_pact_ninf (yyj))
|
||||
{
|
||||
yyj += YYTERROR;
|
||||
if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR
|
||||
@@ -2664,7 +2639,7 @@ m4_if(b4_skeleton, ["glr.c"],
|
||||
[b4_defines_if(
|
||||
[@output(b4_spec_defines_file@)@
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
[2002-2011])
|
||||
[2002-2006, 2009-2010])
|
||||
|
||||
b4_shared_declarations
|
||||
|
||||
|
||||
+11
-9
@@ -1,8 +1,7 @@
|
||||
-*- C -*-
|
||||
|
||||
# C++ GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2010 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
|
||||
@@ -54,8 +53,7 @@ b4_defines_if([],
|
||||
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||
|
||||
m4_include(b4_pkgdatadir/[c++.m4])
|
||||
b4_percent_define_ifdef([[location_type]], [],
|
||||
[m4_include(b4_pkgdatadir/[location.cc])])
|
||||
m4_include(b4_pkgdatadir/[location.cc])
|
||||
|
||||
m4_define([b4_parser_class_name],
|
||||
[b4_percent_define_get([[parser_class_name]])])
|
||||
@@ -220,7 +218,7 @@ m4_popdef([b4_parse_param])
|
||||
m4_divert_push(0)
|
||||
@output(b4_spec_defines_file@)@
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
[2002-2006, 2009-2011])[
|
||||
[2002-2006, 2009-2010])[
|
||||
|
||||
/* C++ GLR parser skeleton written by Akim Demaille. */
|
||||
|
||||
@@ -231,12 +229,17 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
]b4_percent_define_ifdef([[location_type]], [],
|
||||
[[#include "location.hh"]])[
|
||||
|
||||
/* Using locations. */
|
||||
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||
|
||||
]b4_namespace_open[
|
||||
class position;
|
||||
class location;
|
||||
]b4_namespace_close[
|
||||
|
||||
#include "location.hh"
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG ]b4_debug_flag[
|
||||
@@ -280,8 +283,7 @@ b4_user_stype
|
||||
typedef YYSTYPE semantic_type;
|
||||
#endif
|
||||
/// Symbol locations.
|
||||
typedef ]b4_percent_define_get([[location_type]],
|
||||
[[location]])[ location_type;
|
||||
typedef ]b4_percent_define_get([[location_type]])[ location_type;
|
||||
/// Tokens.
|
||||
struct token
|
||||
{
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Java skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007, 2009-2010 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
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# Java language support for Bison
|
||||
|
||||
# Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2010 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
|
||||
|
||||
+105
-188
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2010 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -24,10 +24,9 @@ m4_define([b4_parser_class_name],
|
||||
b4_defines_if([],
|
||||
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||
|
||||
b4_percent_define_ifdef([[location_type]], [],
|
||||
[# Backward compatibility.
|
||||
m4_define([b4_location_constructors])
|
||||
m4_include(b4_pkgdatadir/[location.cc])])
|
||||
# Backward compatibility.
|
||||
m4_define([b4_location_constructors])
|
||||
m4_include(b4_pkgdatadir/[location.cc])
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
@@ -35,7 +34,7 @@ m4_divert_push(0)dnl
|
||||
b4_defines_if(
|
||||
[@output(b4_spec_defines_file@)@
|
||||
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
|
||||
[2002-2011])
|
||||
[2002-2010])
|
||||
dnl FIXME: This is wrong, we want computed header guards.
|
||||
[
|
||||
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
||||
@@ -48,8 +47,13 @@ dnl FIXME: This is wrong, we want computed header guards.
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include "stack.hh"
|
||||
]b4_percent_define_ifdef([[location_type]], [],
|
||||
[[#include "location.hh"]])[
|
||||
|
||||
]b4_namespace_open[
|
||||
class position;
|
||||
class location;
|
||||
]b4_namespace_close[
|
||||
|
||||
#include "location.hh"
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
@@ -69,6 +73,25 @@ dnl FIXME: This is wrong, we want computed header guards.
|
||||
# define YYTOKEN_TABLE ]b4_token_table[
|
||||
#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[
|
||||
|
||||
/// A Bison parser.
|
||||
@@ -89,8 +112,7 @@ b4_user_stype
|
||||
typedef YYSTYPE semantic_type;
|
||||
#endif
|
||||
/// Symbol locations.
|
||||
typedef ]b4_percent_define_get([[location_type]],
|
||||
[[location]])[ location_type;
|
||||
typedef ]b4_percent_define_get([[location_type]])[ location_type;
|
||||
/// Tokens.
|
||||
struct token
|
||||
{
|
||||
@@ -130,7 +152,8 @@ b4_user_stype
|
||||
/// Generate an error message.
|
||||
/// \param state the state where the error occurred.
|
||||
/// \param tok the lookahead token.
|
||||
virtual std::string yysyntax_error_ (int yystate, int tok);
|
||||
virtual std::string yysyntax_error_ (int yystate]dnl
|
||||
b4_error_verbose_if([, int tok])[);
|
||||
|
||||
#if YYDEBUG
|
||||
/// \brief Report a symbol value on the debug stream.
|
||||
@@ -166,14 +189,6 @@ b4_user_stype
|
||||
/// The location 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.
|
||||
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
||||
/* Tables. */
|
||||
@@ -181,7 +196,7 @@ b4_user_stype
|
||||
static const ]b4_int_type_for([b4_pact])[ yypact_[];
|
||||
static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_;
|
||||
|
||||
/// For a state, default reduction number.
|
||||
/// For a state, default rule to reduce.
|
||||
/// Unless\a yytable_ specifies something else to do.
|
||||
/// Zero means the default is an error.
|
||||
static const ]b4_int_type_for([b4_defact])[ yydefact_[];
|
||||
@@ -210,10 +225,12 @@ b4_user_stype
|
||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||
/// For a symbol, its name in clear.
|
||||
static const char* const yytname_[];
|
||||
#endif]b4_error_verbose_if([
|
||||
#endif
|
||||
|
||||
#if YYERROR_VERBOSE
|
||||
/// Convert the symbol name \a n to a form suitable for a diagnostic.
|
||||
static std::string yytnamerr_ (const char *n);])[
|
||||
virtual std::string yytnamerr_ (const char *n);
|
||||
#endif
|
||||
|
||||
#if YYDEBUG
|
||||
/// A type to store symbol numbers and -1.
|
||||
@@ -282,7 +299,7 @@ b4_percent_code_get([[provides]])[]dnl
|
||||
])dnl
|
||||
@output(b4_parser_file_name@)@
|
||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
|
||||
[2002-2011])
|
||||
[2002-2010])
|
||||
b4_percent_code_get([[top]])[]dnl
|
||||
m4_if(b4_prefix, [yy], [],
|
||||
[
|
||||
@@ -311,26 +328,6 @@ b4_percent_code_get[]dnl
|
||||
# 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. */
|
||||
#define YYUSE(e) ((void) (e))
|
||||
|
||||
@@ -379,7 +376,8 @@ do { \
|
||||
#define YYERROR goto yyerrorlab
|
||||
#define YYRECOVERING() (!!yyerrstatus_)
|
||||
|
||||
]b4_namespace_open[]b4_error_verbose_if([[
|
||||
]b4_namespace_open[
|
||||
#if YYERROR_VERBOSE
|
||||
|
||||
/* Return YYSTR after stripping away unnecessary quotes and
|
||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||
@@ -417,7 +415,8 @@ do { \
|
||||
|
||||
return yystr;
|
||||
}
|
||||
]])[
|
||||
|
||||
#endif
|
||||
|
||||
/// Build a parser object.
|
||||
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||
@@ -518,18 +517,6 @@ do { \
|
||||
}
|
||||
#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
|
||||
]b4_parser_class_name[::parse ()
|
||||
{
|
||||
@@ -551,7 +538,7 @@ do { \
|
||||
/// Location of the lookahead.
|
||||
location_type yylloc;
|
||||
/// The locations where the error started and ended.
|
||||
location_type yyerror_range[3];
|
||||
location_type yyerror_range[2];
|
||||
|
||||
/// $$.
|
||||
semantic_type yyval;
|
||||
@@ -596,7 +583,7 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
|
||||
/* Try to take a decision without lookahead. */
|
||||
yyn = yypact_[yystate];
|
||||
if (yy_pact_value_is_default_ (yyn))
|
||||
if (yyn == yypact_ninf_)
|
||||
goto yydefault;
|
||||
|
||||
/* Read a lookahead token. */
|
||||
@@ -632,8 +619,8 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
yyn = yytable_[yyn];
|
||||
if (yyn <= 0)
|
||||
{
|
||||
if (yy_table_value_is_error_ (yyn))
|
||||
goto yyerrlab;
|
||||
if (yyn == 0 || yyn == yytable_ninf_)
|
||||
goto yyerrlab;
|
||||
yyn = -yyn;
|
||||
goto yyreduce;
|
||||
}
|
||||
@@ -691,17 +678,6 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* User semantic actions sometimes alter yychar, and that requires
|
||||
that yytoken be updated with the new translation. We take the
|
||||
approach of translating immediately before every use of yytoken.
|
||||
One alternative is translating here after every semantic action,
|
||||
but that translation would be missed if the semantic action
|
||||
invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
|
||||
yychar. In the case of YYABORT or YYACCEPT, an incorrect
|
||||
destructor might then be invoked immediately. In the case of
|
||||
YYERROR, subsequent parser actions might lead to an incorrect
|
||||
destructor call or verbose syntax error message before the
|
||||
lookahead is translated. */
|
||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
|
||||
|
||||
yypop_ (yylen);
|
||||
@@ -725,20 +701,15 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
| yyerrlab -- here on detecting error |
|
||||
`------------------------------------*/
|
||||
yyerrlab:
|
||||
/* Make sure we have latest lookahead translation. See comments at
|
||||
user semantic actions for why this is necessary. */
|
||||
yytoken = yytranslate_ (yychar);
|
||||
|
||||
/* If not already recovering from an error, report this error. */
|
||||
if (!yyerrstatus_)
|
||||
{
|
||||
++yynerrs_;
|
||||
if (yychar == yyempty_)
|
||||
yytoken = yyempty_;
|
||||
error (yylloc, yysyntax_error_ (yystate, yytoken));
|
||||
error (yylloc, yysyntax_error_ (yystate]dnl
|
||||
b4_error_verbose_if([, yytoken])[));
|
||||
}
|
||||
|
||||
yyerror_range[1] = yylloc;
|
||||
yyerror_range[0] = yylloc;
|
||||
if (yyerrstatus_ == 3)
|
||||
{
|
||||
/* If just tried and failed to reuse lookahead token after an
|
||||
@@ -773,7 +744,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
if (false)
|
||||
goto yyerrorlab;
|
||||
|
||||
yyerror_range[1] = yylocation_stack_[yylen - 1];
|
||||
yyerror_range[0] = yylocation_stack_[yylen - 1];
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYERROR. */
|
||||
yypop_ (yylen);
|
||||
@@ -790,7 +761,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
if (yyn != yypact_ninf_)
|
||||
{
|
||||
yyn += yyterror_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||
@@ -805,7 +776,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
if (yystate_stack_.height () == 1)
|
||||
YYABORT;
|
||||
|
||||
yyerror_range[1] = yylocation_stack_[0];
|
||||
yyerror_range[0] = yylocation_stack_[0];
|
||||
yydestruct_ ("Error: popping",
|
||||
yystos_[yystate],
|
||||
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
||||
@@ -814,10 +785,10 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
YY_STACK_PRINT ();
|
||||
}
|
||||
|
||||
yyerror_range[2] = yylloc;
|
||||
yyerror_range[1] = yylloc;
|
||||
// Using YYLLOC is tempting, but would change the location of
|
||||
// the lookahead. YYLOC is available though.
|
||||
YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
|
||||
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
|
||||
yysemantic_stack_.push (yylval);
|
||||
yylocation_stack_.push (yyloc);
|
||||
|
||||
@@ -840,13 +811,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
|
||||
yyreturn:
|
||||
if (yychar != yyempty_)
|
||||
{
|
||||
/* Make sure we have latest lookahead translation. See comments
|
||||
at user semantic actions for why this is necessary. */
|
||||
yytoken = yytranslate_ (yychar);
|
||||
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval,
|
||||
&yylloc);
|
||||
}
|
||||
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
|
||||
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYABORT or YYACCEPT. */
|
||||
@@ -865,100 +830,52 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
|
||||
// Generate an error message.
|
||||
std::string
|
||||
]b4_parser_class_name[::yysyntax_error_ (]dnl
|
||||
b4_error_verbose_if([int yystate, int yytoken],
|
||||
[int, int])[)
|
||||
{]b4_error_verbose_if([[
|
||||
std::string yyres;
|
||||
// Number of reported tokens (one for the "unexpected", one per
|
||||
// "expected").
|
||||
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_)
|
||||
]b4_parser_class_name[::yysyntax_error_ (int yystate]dnl
|
||||
b4_error_verbose_if([, int tok])[)
|
||||
{
|
||||
std::string res;
|
||||
YYUSE (yystate);
|
||||
#if YYERROR_VERBOSE
|
||||
int yyn = yypact_[yystate];
|
||||
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
||||
{
|
||||
yyarg[yycount++] = yytname_[yytoken];
|
||||
int yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for
|
||||
this state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
yyarg[yycount++] = yytname_[yyx];
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
char const* yyformat = 0;
|
||||
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_
|
||||
}
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
||||
++count;
|
||||
|
||||
// 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");]])[
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization. It should work like yacc.c does it.
|
||||
// That is, first build a string that looks like this:
|
||||
// "syntax error, unexpected %s or %s or %s"
|
||||
// Then, invoke YY_ on this string.
|
||||
// Finally, use the string as a format to output
|
||||
// yytname_[tok], etc.
|
||||
// Until this gets fixed, this message appears in English only.
|
||||
res = "syntax error, unexpected ";
|
||||
res += yytnamerr_ (yytname_[tok]);
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
||||
{
|
||||
res += (!count++) ? ", expecting " : " or ";
|
||||
res += yytnamerr_ (yytname_[x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
res = YY_("syntax error");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -971,9 +888,9 @@ b4_error_verbose_if([int yystate, int yytoken],
|
||||
]b4_pact[
|
||||
};
|
||||
|
||||
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||
YYTABLE doesn't specify something else to do. Zero means the
|
||||
default is an error. */
|
||||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
|
||||
doesn't specify something else to do. Zero means the default is an
|
||||
error. */
|
||||
const ]b4_int_type_for([b4_defact])[
|
||||
]b4_parser_class_name[::yydefact_[] =
|
||||
{
|
||||
@@ -996,7 +913,7 @@ b4_error_verbose_if([int yystate, int yytoken],
|
||||
|
||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||
positive, shift that token. If negative, reduce the rule which
|
||||
number is the opposite. If YYTABLE_NINF_, syntax error. */
|
||||
number is the opposite. If zero, do what YYDEFACT says. */
|
||||
const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[;
|
||||
const ]b4_int_type_for([b4_table])[
|
||||
]b4_parser_class_name[::yytable_[] =
|
||||
@@ -1139,7 +1056,7 @@ b4_error_verbose_if([int yystate, int yytoken],
|
||||
dnl
|
||||
@output(b4_dir_prefix[]stack.hh@)@
|
||||
b4_copyright([Stack handling for Bison parsers in C++],
|
||||
[2002-2011])[
|
||||
[2002-2010])[
|
||||
|
||||
#ifndef BISON_STACK_HH
|
||||
# define BISON_STACK_HH
|
||||
|
||||
+56
-107
@@ -1,6 +1,6 @@
|
||||
# Java skeleton for Bison -*- autoconf -*-
|
||||
|
||||
# Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2010 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
|
||||
@@ -25,7 +25,7 @@ m4_ifval(m4_defn([b4_symbol_destructors]),
|
||||
m4_divert_push(0)dnl
|
||||
@output(b4_parser_file_name@)@
|
||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
||||
[2007-2011])
|
||||
[2007-2010])
|
||||
|
||||
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
||||
])[/* First part of user declarations. */
|
||||
@@ -102,7 +102,7 @@ b4_token_enums(b4_tokens)
|
||||
private ]b4_location_type[ yylloc (YYStack rhs, int n)
|
||||
{
|
||||
if (n > 0)
|
||||
return new ]b4_location_type[ (rhs.locationAt (n-1).begin, rhs.locationAt (0).end);
|
||||
return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
|
||||
else
|
||||
return new ]b4_location_type[ (rhs.locationAt (0).end);
|
||||
}]])[
|
||||
@@ -255,14 +255,14 @@ b4_lexer_if([[
|
||||
}
|
||||
|
||||
public final void pop () {
|
||||
pop (1);
|
||||
height--;
|
||||
}
|
||||
|
||||
public final void pop (int num) {
|
||||
// Avoid memory leaks... garbage collection is a white lie!
|
||||
if (num > 0) {
|
||||
java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);
|
||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
|
||||
java.util.Arrays.fill (valueStack, height - num + 1, height, null);
|
||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
|
||||
}
|
||||
height -= num;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ b4_lexer_if([[
|
||||
{
|
||||
out.print ("Stack now");
|
||||
|
||||
for (int i = 0; i <= height; i++)
|
||||
for (int i = 0; i < height; i++)
|
||||
{
|
||||
out.print (' ');
|
||||
out.print (stateStack[i]);
|
||||
@@ -308,9 +308,12 @@ b4_lexer_if([[
|
||||
* printing an error message. */
|
||||
public static final int YYERROR = 2;
|
||||
|
||||
// Internal return codes that are not supported for user semantic
|
||||
// actions.
|
||||
private static final int YYERRLAB = 3;
|
||||
/**
|
||||
* Returned by a Bison action in order to print an error message and start
|
||||
* error recovery. Formally deprecated in Bison 2.4.2's NEWS entry, where
|
||||
* a plan to phase it out is discussed. */
|
||||
public static final int YYFAIL = 3;
|
||||
|
||||
private static final int YYNEWSTATE = 4;
|
||||
private static final int YYDEFAULT = 5;
|
||||
private static final int YYREDUCE = 6;
|
||||
@@ -487,7 +490,7 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
|
||||
/* Take a decision. First try without lookahead. */
|
||||
yyn = yypact_[yystate];
|
||||
if (yy_pact_value_is_default_ (yyn))
|
||||
if (yyn == yypact_ninf_)
|
||||
{
|
||||
label = YYDEFAULT;
|
||||
break;
|
||||
@@ -526,8 +529,8 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
/* <= 0 means reduce or error. */
|
||||
else if ((yyn = yytable_[yyn]) <= 0)
|
||||
{
|
||||
if (yy_table_value_is_error_ (yyn))
|
||||
label = YYERRLAB;
|
||||
if (yyn == 0 || yyn == yytable_ninf_)
|
||||
label = YYFAIL;
|
||||
else
|
||||
{
|
||||
yyn = -yyn;
|
||||
@@ -561,7 +564,7 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
case YYDEFAULT:
|
||||
yyn = yydefact_[yystate];
|
||||
if (yyn == 0)
|
||||
label = YYERRLAB;
|
||||
label = YYFAIL;
|
||||
else
|
||||
label = YYREDUCE;
|
||||
break;
|
||||
@@ -578,14 +581,12 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
/*------------------------------------.
|
||||
| yyerrlab -- here on detecting error |
|
||||
`------------------------------------*/
|
||||
case YYERRLAB:
|
||||
case YYFAIL:
|
||||
/* If not already recovering from an error, report this error. */
|
||||
if (yyerrstatus_ == 0)
|
||||
{
|
||||
++yynerrs_;
|
||||
if (yychar == yyempty_)
|
||||
yytoken = yyempty_;
|
||||
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
||||
++yynerrs_;
|
||||
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
||||
}
|
||||
|
||||
]b4_locations_if([yyerrloc = yylloc;])[
|
||||
@@ -632,7 +633,7 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
if (yyn != yypact_ninf_)
|
||||
{
|
||||
yyn += yyterror_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||
@@ -685,96 +686,44 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
{
|
||||
if (errorVerbose)
|
||||
{
|
||||
/* There are many possibilities here to consider:
|
||||
- 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_)
|
||||
int yyn = yypact_[yystate];
|
||||
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
||||
{
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization.
|
||||
StringBuffer res =
|
||||
new StringBuffer ("syntax error, unexpected ");
|
||||
res.append (yytnamerr_ (yytname_[tok]));
|
||||
int yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative
|
||||
indexes in YYCHECK. In other words, skip the first
|
||||
-YYN actions for this state because they are default
|
||||
actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
++count;
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
{
|
||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||
res.append (yytnamerr_ (yytname_[x]));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res.toString ();
|
||||
StringBuffer res;
|
||||
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
||||
++count;
|
||||
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization.
|
||||
res = new StringBuffer ("syntax error, unexpected ");
|
||||
res.append (yytnamerr_ (yytname_[tok]));
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
||||
{
|
||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||
res.append (yytnamerr_ (yytname_[x]));
|
||||
}
|
||||
}
|
||||
return res.toString ();
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
STATE-NUM. */
|
||||
@@ -784,9 +733,9 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
]b4_pact[
|
||||
};
|
||||
|
||||
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||
YYTABLE doesn't specify something else to do. Zero means the
|
||||
default is an error. */
|
||||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
|
||||
doesn't specify something else to do. Zero means the default is an
|
||||
error. */
|
||||
private static final ]b4_int_type_for([b4_defact])[ yydefact_[] =
|
||||
{
|
||||
]b4_defact[
|
||||
@@ -807,7 +756,7 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
|
||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||
positive, shift that token. If negative, reduce the rule which
|
||||
number is the opposite. If YYTABLE_NINF_, syntax error. */
|
||||
number is the opposite. If zero, do what YYDEFACT says. */
|
||||
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
|
||||
private static final ]b4_int_type_for([b4_table])[
|
||||
yytable_[] =
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -20,7 +20,7 @@ m4_changecom()
|
||||
m4_divert_push(0)dnl
|
||||
@output(b4_dir_prefix[]position.hh@)@
|
||||
b4_copyright([Positions for Bison parsers in C++],
|
||||
[2002-2007, 2009-2011])[
|
||||
[2002-2007, 2009-2010])[
|
||||
|
||||
/**
|
||||
** \file position.hh
|
||||
@@ -145,7 +145,7 @@ b4_copyright([Positions for Bison parsers in C++],
|
||||
#endif // not BISON_POSITION_HH]
|
||||
@output(b4_dir_prefix[]location.hh@)@
|
||||
b4_copyright([Locations for Bison parsers in C++],
|
||||
[2002-2007, 2009-2011])[
|
||||
[2002-2007, 2009-2010])[
|
||||
|
||||
/**
|
||||
** \file location.hh
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../submodules/autoconf/lib/m4sugar/foreach.m4
|
||||
@@ -0,0 +1,400 @@
|
||||
# -*- 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]))-])]])))))])])
|
||||
@@ -1 +0,0 @@
|
||||
../../submodules/autoconf/lib/m4sugar/m4sugar.m4
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
bison.xsl - common templates for Bison XSLT.
|
||||
|
||||
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+6
-22
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||
|
||||
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -35,27 +35,11 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bison-xml-report">
|
||||
<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:apply-templates select="automaton"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton">
|
||||
<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:text>digraph Automaton { </xsl:text>
|
||||
<xsl:apply-templates select="state"/>
|
||||
<xsl:text>} </xsl:text>
|
||||
</xsl:template>
|
||||
@@ -212,11 +196,11 @@
|
||||
<xsl:with-param name="search" select="$search"/>
|
||||
<xsl:with-param name="replace" select="$replace"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$subject"/>
|
||||
<xsl:value-of select="$subject"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2text.xsl - transform Bison XML Report into plain text.
|
||||
|
||||
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||
|
||||
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -48,15 +48,15 @@
|
||||
font-size: 9pt;
|
||||
}
|
||||
a:link {
|
||||
color: #1f00ff;
|
||||
color: #1f00ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:visited {
|
||||
color: #1f00ff;
|
||||
color: #1f00ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: red;
|
||||
color: red;
|
||||
}
|
||||
#menu a {
|
||||
text-decoration: underline;
|
||||
|
||||
+310
-693
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||
# Requires GNU sed
|
||||
|
||||
## Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2005-2010 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||
|
||||
Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2010 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
|
||||
|
||||
+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 format, or else stock DOS/Windows shells will refuse to run it.
|
||||
|
||||
Rem Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005-2010 Free Software Foundation, Inc.
|
||||
|
||||
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
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the configure script generated by autoconf 2.62.
|
||||
|
||||
# Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 2005-2010 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
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
# This is the config.site file for configuring GNU packages
|
||||
# which are to be built with DJGPP tools.
|
||||
|
||||
# Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2010 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# sed script for DJGPP specific editing of config.hin
|
||||
|
||||
# Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2010 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
|
||||
|
||||
+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 with other file names after truncation to DOS 8+3 namespace.
|
||||
Rem
|
||||
Rem Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005-2010 Free Software Foundation, Inc.
|
||||
Rem
|
||||
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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2010 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
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2010 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
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the testsuite script generated by autoconf 2.61.
|
||||
|
||||
# Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 2007-2010 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
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
*.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,7 +1,4 @@
|
||||
|
||||
/*.info*
|
||||
/*~
|
||||
/.dirstamp
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/bison.1
|
||||
@@ -27,4 +24,3 @@
|
||||
/stamp-vti
|
||||
/version.texi
|
||||
/yacc.1
|
||||
|
||||
|
||||
+3
-7
@@ -1,6 +1,5 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
|
||||
## Copyright (C) 2001-2003, 2005-2011 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001-2003, 2005-2010 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
|
||||
@@ -26,12 +25,9 @@ clean-local:
|
||||
|
||||
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
||||
$(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
|
||||
mv -f $@ $@~ || : >$@~
|
||||
-rm -f $@.tmp
|
||||
-rm -f $@ $@.tmp
|
||||
cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||
$(top_builddir)/src/bison --help \
|
||||
| perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
||||
diff -u $@~ $@.tmp || true
|
||||
$(top_builddir)/src/bison --help | perl $(CROSS_OPTIONS_PL) >$@.tmp
|
||||
mv $@.tmp $@
|
||||
MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
|
||||
|
||||
|
||||
+844
-1652
File diff suppressed because it is too large
Load Diff
+13
-68
@@ -1,12 +1,12 @@
|
||||
@c The GNU Free Documentation License.
|
||||
@center Version 1.3, 3 November 2008
|
||||
@center Version 1.2, November 2002
|
||||
|
||||
@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
|
||||
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
|
||||
@uref{http://fsf.org/}
|
||||
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@@ -111,9 +111,6 @@ 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,
|
||||
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
|
||||
title either is precisely XYZ or contains XYZ in parentheses following
|
||||
text that translates XYZ in another language. (Here XYZ stands for a
|
||||
@@ -382,30 +379,13 @@ title.
|
||||
@item
|
||||
TERMINATION
|
||||
|
||||
You may not copy, modify, sublicense, or distribute the Document
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense, or distribute it is void, and
|
||||
will automatically terminate your rights under this License.
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
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.
|
||||
You may not copy, modify, sublicense, or distribute the Document except
|
||||
as expressly provided for under this License. Any other attempt to
|
||||
copy, modify, sublicense or distribute the Document is void, and will
|
||||
automatically terminate your rights under this License. However,
|
||||
parties who have received copies, or rights, from you under this
|
||||
License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
@item
|
||||
FUTURE REVISIONS OF THIS LICENSE
|
||||
@@ -423,42 +403,7 @@ 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
|
||||
Free Software Foundation. If the Document does not specify a version
|
||||
number of this License, you may choose any version ever published (not
|
||||
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.
|
||||
|
||||
as a draft) by the Free Software Foundation.
|
||||
@end enumerate
|
||||
|
||||
@page
|
||||
@@ -472,7 +417,7 @@ license notices just after the title page:
|
||||
@group
|
||||
Copyright (C) @var{year} @var{your name}.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3
|
||||
under the terms of the GNU Free Documentation License, Version 1.2
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||
Texts. A copy of the license is included in the section entitled ``GNU
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
\def\finalout{\overfullrule=0pt}
|
||||
%\finalout
|
||||
|
||||
% Copyright (c) 1998, 2001, 2009-2011 Free Software Foundation, Inc.
|
||||
% Copyright (c) 1998, 2001, 2009-2010 Free Software Foundation, Inc.
|
||||
%
|
||||
% This file is part of Bison.
|
||||
%
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
bench.pl
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2006, 2009-2010 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
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ straightforward use of _build/src/bison would.)
|
||||
|
||||
--
|
||||
|
||||
Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of Bison, the GNU Compiler Compiler.
|
||||
#
|
||||
@@ -343,8 +343,8 @@ sub bench_grammar ($)
|
||||
(
|
||||
"pull-impure" => '',
|
||||
"pull-pure" => '%define api.pure',
|
||||
"push-impure" => '%define api.push-pull "both"',
|
||||
"push-pure" => '%define api.push-pull "both" %define api.pure',
|
||||
"push-impure" => '%define api.push_pull "both"',
|
||||
"push-pure" => '%define api.push_pull "both" %define api.pure',
|
||||
);
|
||||
|
||||
my %bench;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2005, 2009-2010 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
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
*.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-*-
|
||||
## Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2005-2006, 2009-2010 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
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
# Extract all examples from the manual source. -*- AWK -*-
|
||||
|
||||
# This file is part of GNU Bison
|
||||
|
||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2011 Free Software
|
||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2010 Free Software
|
||||
# Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
Submodule gnulib updated: eff4c0360a...102c411be0
+124
@@ -0,0 +1,124 @@
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
argmatch.c
|
||||
argmatch.h
|
||||
basename-lgpl.c
|
||||
basename.c
|
||||
bitrotate.h
|
||||
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-lgpl.c
|
||||
dirname.c
|
||||
dirname.h
|
||||
dup-safer.c
|
||||
dup2.c
|
||||
errno.h
|
||||
errno.in.h
|
||||
error.c
|
||||
error.h
|
||||
exitfail.c
|
||||
exitfail.h
|
||||
fcntl.c
|
||||
fcntl.h
|
||||
fcntl.in.h
|
||||
fd-safer.c
|
||||
fopen-safer.c
|
||||
fopen.c
|
||||
getopt.c
|
||||
getopt.h
|
||||
getopt.in.h
|
||||
getopt1.c
|
||||
getopt_.h
|
||||
getopt_int.h
|
||||
getpagesize.c
|
||||
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
|
||||
memchr.c
|
||||
memchr.valgrind
|
||||
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
|
||||
stddef.h
|
||||
stddef.in.h
|
||||
stdint.h
|
||||
stdint.in.h
|
||||
stdint_.h
|
||||
stdio--.h
|
||||
stdio-safer.h
|
||||
stdio-write.c
|
||||
stdio.h
|
||||
stdio.in.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
|
||||
+12
-130
@@ -1,36 +1,20 @@
|
||||
|
||||
/*.a
|
||||
/*.bak
|
||||
/*.o
|
||||
/*~
|
||||
/.deps
|
||||
/.dirstamp
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/alignof.h
|
||||
/alloca.h
|
||||
/alloca.in.h
|
||||
/arg-nonnull.h
|
||||
/argmatch.c
|
||||
/argmatch.h
|
||||
/asnprintf.c
|
||||
/basename-lgpl.c
|
||||
/basename.c
|
||||
/binary-io.h
|
||||
/bitrotate.h
|
||||
/c++defs.h
|
||||
/c-ctype.c
|
||||
/c-ctype.h
|
||||
/c-strcase.h
|
||||
/c-strcasecmp.c
|
||||
/c-strncasecmp.c
|
||||
/calloc.c
|
||||
/charset.alias
|
||||
/cloexec.c
|
||||
/cloexec.h
|
||||
/close-hook.c
|
||||
/close-hook.h
|
||||
/close.c
|
||||
/config.charset
|
||||
/config.h
|
||||
/config.hin
|
||||
@@ -38,8 +22,6 @@
|
||||
/dirname-lgpl.c
|
||||
/dirname.c
|
||||
/dirname.h
|
||||
/dosname.h
|
||||
/dup-safer-flag.c
|
||||
/dup-safer.c
|
||||
/dup2.c
|
||||
/errno.h
|
||||
@@ -48,31 +30,19 @@
|
||||
/error.h
|
||||
/exitfail.c
|
||||
/exitfail.h
|
||||
/fatal-signal.c
|
||||
/fatal-signal.h
|
||||
/fclose.c
|
||||
/fcntl.c
|
||||
/fcntl.h
|
||||
/fcntl.in.h
|
||||
/fd-safer-flag.c
|
||||
/fd-safer.c
|
||||
/float+.h
|
||||
/float.h
|
||||
/float.in.h
|
||||
/fopen-safer.c
|
||||
/fopen.c
|
||||
/fprintf.c
|
||||
/fpucw.h
|
||||
/frexp.c
|
||||
/frexpl.c
|
||||
/fseterr.c
|
||||
/fseterr.h
|
||||
/getdtablesize.c
|
||||
/getopt.c
|
||||
/getopt.h
|
||||
/getopt.in.h
|
||||
/getopt1.c
|
||||
/getopt_.h
|
||||
/getopt_int.h
|
||||
/getpagesize.c
|
||||
/gettext.h
|
||||
/gnulib.mk
|
||||
/hash.c
|
||||
@@ -80,166 +50,78 @@
|
||||
/intprops.h
|
||||
/inttypes.h
|
||||
/inttypes.in.h
|
||||
/ioctl.c
|
||||
/isnan.c
|
||||
/isnand-nolibm.h
|
||||
/isnand.c
|
||||
/isnanf-nolibm.h
|
||||
/isnanf.c
|
||||
/isnanl-nolibm.h
|
||||
/isnanl.c
|
||||
/iswblank.c
|
||||
/ldexpl.c
|
||||
/inttypes_.h
|
||||
/localcharset.c
|
||||
/localcharset.h
|
||||
/malloc.c
|
||||
/math.h
|
||||
/math.in.h
|
||||
/mbchar.c
|
||||
/mbchar.h
|
||||
/mbrtowc.c
|
||||
/mbschr.c
|
||||
/mbsinit.c
|
||||
/mbsrchr.c
|
||||
/mbswidth.c
|
||||
/mbswidth.h
|
||||
/mbuiter.h
|
||||
/memchr.c
|
||||
/memchr.valgrind
|
||||
/nonblocking.c
|
||||
/nonblocking.h
|
||||
/obstack.c
|
||||
/obstack.h
|
||||
/open.c
|
||||
/perror.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.h
|
||||
/quotearg.c
|
||||
/quotearg.h
|
||||
/rawmemchr.c
|
||||
/rawmemchr.valgrind
|
||||
/realloc.c
|
||||
/ref-add.sed
|
||||
/ref-add.sin
|
||||
/ref-del.sed
|
||||
/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
|
||||
/stat.c
|
||||
/stdbool.h
|
||||
/stdbool.in.h
|
||||
/stdbool_.h
|
||||
/stddef.h
|
||||
/stddef.in.h
|
||||
/stdint.h
|
||||
/stdint.in.h
|
||||
/stdint_.h
|
||||
/stdio--.h
|
||||
/stdio-impl.h
|
||||
/stdio-safer.h
|
||||
/stdio-write.c
|
||||
/stdio.h
|
||||
/stdio.in.h
|
||||
/stdlib.h
|
||||
/stdlib.in.h
|
||||
/stdlib_.h
|
||||
/stpcpy.c
|
||||
/strchrnul.c
|
||||
/strchrnul.valgrind
|
||||
/strdup.c
|
||||
/streq.h
|
||||
/strerror.c
|
||||
/string.h
|
||||
/string.in.h
|
||||
/string_.h
|
||||
/stripslash.c
|
||||
/strndup.c
|
||||
/strnlen.c
|
||||
/strnlen1.c
|
||||
/strnlen1.h
|
||||
/strtol.c
|
||||
/strtoul.c
|
||||
/strverscmp.c
|
||||
/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
|
||||
/strverscmp.h
|
||||
/unistd--.h
|
||||
/unistd-safer.h
|
||||
/unistd.h
|
||||
/unistd.in.h
|
||||
/unistd_.h
|
||||
/unitypes.h
|
||||
/unitypes.in.h
|
||||
/uniwidth
|
||||
/uniwidth.h
|
||||
/uniwidth.in.h
|
||||
/unlocked-io.h
|
||||
/unsetenv.c
|
||||
/vasnprintf.c
|
||||
/vasnprintf.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.in.h
|
||||
/wchar_.h
|
||||
/wctype.h
|
||||
/wctype.in.h
|
||||
/wctype_.h
|
||||
/wcwidth.c
|
||||
/wcwidth.h
|
||||
/xalloc-die.c
|
||||
/xalloc.h
|
||||
/xmalloc.c
|
||||
/xsize.h
|
||||
/xstrndup.c
|
||||
/xstrndup.h
|
||||
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
# Make bison/lib.
|
||||
|
||||
# Copyright (C) 2001-2004, 2006, 2008-2011 Free Software Foundation,
|
||||
# Copyright (C) 2001-2004, 2006, 2008-2010 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,7 @@ timevars_sources = \
|
||||
# Non-gnulib sources in Bison's internal library.
|
||||
libbison_a_SOURCES += \
|
||||
get-errno.h get-errno.c \
|
||||
subpipe.h subpipe.c \
|
||||
$(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
|
||||
|
||||
# The Yacc compatibility library.
|
||||
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
/* Array bitsets.
|
||||
|
||||
Copyright (C) 2002-2003, 2006, 2009-2011 Free Software Foundation,
|
||||
Copyright (C) 2002-2003, 2006, 2009-2010 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Functions to support abitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
/* Base bitset stuff.
|
||||
|
||||
Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation,
|
||||
Copyright (C) 2002-2004, 2006, 2009-2010 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* General bitsets.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Generic bitsets.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Bitset statistics.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Functions to support bitset statistics.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2001-2002, 2004, 2006, 2009-2011 Free Software
|
||||
Copyright (C) 2001-2002, 2004, 2006, 2009-2010 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Akim Demaille (akim@freefriends.org).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2001-2002, 2004-2006, 2009-2011 Free Software
|
||||
Copyright (C) 2001-2002, 2004-2006, 2009-2010 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Functions to support expandable bitsets.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Functions to support ebitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* get-errno.c - get and set errno.
|
||||
|
||||
Copyright (C) 2002, 2006, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2006, 2009-2010 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* get-errno.h - get and set errno.
|
||||
|
||||
Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2009-2010 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
|
||||
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
/* Functions to support link list bitsets.
|
||||
|
||||
Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation,
|
||||
Copyright (C) 2002-2004, 2006, 2009-2010 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Functions to support lbitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
/* Fake libiberty.h for Bison.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2004, 2009-2010 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Yacc library main function.
|
||||
|
||||
Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2009-2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+177
@@ -0,0 +1,177 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2002, 2004-2006, 2009-2010 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)
|
||||
{
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
/* Named symbol references for Bison
|
||||
|
||||
Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
/* Subprocesses with pipes.
|
||||
Copyright (C) 2002, 2004-2005, 2009-2010 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -17,30 +15,14 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
#include "system.h"
|
||||
/* Written by Paul Eggert <[email protected]>
|
||||
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
||||
|
||||
#include "named-ref.h"
|
||||
#if HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
named_ref *
|
||||
named_ref_new (uniqstr id, location loc)
|
||||
{
|
||||
named_ref *res = xmalloc (sizeof *res);
|
||||
|
||||
res->id = id;
|
||||
res->loc = loc;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
named_ref *
|
||||
named_ref_copy (const named_ref *r)
|
||||
{
|
||||
return named_ref_new (r->id, r->loc);
|
||||
}
|
||||
|
||||
void
|
||||
named_ref_free (named_ref *r)
|
||||
{
|
||||
free (r);
|
||||
}
|
||||
void init_subpipe (void);
|
||||
pid_t create_subpipe (char const * const *, int[2]);
|
||||
void end_of_output_subpipe (pid_t, int[2]);
|
||||
void reap_subpipe (pid_t, char const *);
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
/* Timing variables for measuring compiler performance.
|
||||
|
||||
Copyright (C) 2000, 2002, 2004, 2006, 2009-2011 Free Software
|
||||
Copyright (C) 2000, 2002, 2004-2006, 2009-2010 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-7
@@ -1,8 +1,6 @@
|
||||
/* This file contains the definitions for timing variables used to -*- C -*-
|
||||
measure run-time performance of the compiler.
|
||||
|
||||
Copyright (C) 2002, 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002, 2007, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Akim Demaille <akim@freefriends.org>.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
@@ -43,10 +41,6 @@ DEFTIMEVAR (TV_REDUCE , "reducing the grammar")
|
||||
DEFTIMEVAR (TV_SETS , "computing the sets")
|
||||
DEFTIMEVAR (TV_LR0 , "LR(0)")
|
||||
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")
|
||||
|
||||
/* Time spent outputing results. */
|
||||
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
/* Timing variables for measuring compiler performance.
|
||||
|
||||
Copyright (C) 2000, 2002, 2004, 2009-2011 Free Software Foundation,
|
||||
Copyright (C) 2000, 2002, 2004, 2009-2010 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Variable array bitsets.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
/* Functions to support vbitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2010 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Yacc library error-printing function.
|
||||
|
||||
Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2009-2010 Free Software Foundation, Inc.
|
||||
|
||||
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