mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-08 18:25:13 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d8565537b | ||
|
|
d6445ec10b | ||
|
|
7ca7a3abf3 | ||
|
|
c4e686a1ab | ||
|
|
2646fd012d | ||
|
|
a2c525b34c | ||
|
|
658b189348 | ||
|
|
a06344172a | ||
|
|
573654ca9e | ||
|
|
0b0370ff42 | ||
|
|
eaa476a7e9 | ||
|
|
16832bf546 | ||
|
|
eabb3df7aa | ||
|
|
0ab29b7c20 | ||
|
|
559b30881d | ||
|
|
88ffc4b907 | ||
|
|
3e82dfaa0d | ||
|
|
11d820174f | ||
|
|
da6f07468a | ||
|
|
93ee7a47e7 | ||
|
|
875ef1b90c | ||
|
|
650af77812 | ||
|
|
c03a8db0cc | ||
|
|
8b06c6b871 | ||
|
|
c5da1a2adc | ||
|
|
dfd5b89d01 | ||
|
|
ca5a716303 | ||
|
|
d72642d691 | ||
|
|
9a91e7f246 | ||
|
|
671850a1c3 | ||
|
|
ee028dceff | ||
|
|
e1d06b5235 | ||
|
|
821394a3c8 | ||
|
|
00cebd11d4 | ||
|
|
ee2f433512 | ||
|
|
5422471cbb | ||
|
|
8a4ec3595b | ||
|
|
7cf84b13a0 | ||
|
|
56351d4c7b | ||
|
|
478c4a8f49 | ||
|
|
13e294ee55 | ||
|
|
a16074bb09 | ||
|
|
8386f6ef28 | ||
|
|
827bc59ca1 | ||
|
|
3209eb1c4c | ||
|
|
975bb56431 | ||
|
|
8d4dc896cb | ||
|
|
a3c3c6f242 | ||
|
|
179b2419ba | ||
|
|
b702ec61ab | ||
|
|
ab96bb2457 | ||
|
|
fc51acddb4 | ||
|
|
957255b82c | ||
|
|
8044fda634 | ||
|
|
b7d4c48e55 | ||
|
|
b167e7ba0d | ||
|
|
85d57e27d2 | ||
|
|
461f1516f8 | ||
|
|
26eb4f0bdc | ||
|
|
fc6c85664a | ||
|
|
0bd5ee5f89 | ||
|
|
a3efd13e44 | ||
|
|
a4122000c6 | ||
|
|
461983270c | ||
|
|
ea99d6e6a0 | ||
|
|
184b42c85b | ||
|
|
be29c71dd8 | ||
|
|
d439985436 | ||
|
|
f3d2a1b2ac | ||
|
|
21cf80399f | ||
|
|
7b0ca050f7 | ||
|
|
a339aef48a | ||
|
|
44186fc4ec | ||
|
|
5c77412162 | ||
|
|
5cf6e669af | ||
|
|
16bb9f1647 | ||
|
|
edb2e90531 | ||
|
|
6d94eebba7 | ||
|
|
c2ecada32b | ||
|
|
458171e6df | ||
|
|
8d0b7cef7d | ||
|
|
afc4457605 | ||
|
|
60dcc936ce | ||
|
|
ad9d4f9f2e | ||
|
|
3cc83855d9 | ||
|
|
5407fc7d76 | ||
|
|
516652b474 | ||
|
|
026816664f | ||
|
|
265640d56e | ||
|
|
ee9cdb8595 | ||
|
|
a810712331 | ||
|
|
1a9646fc91 | ||
|
|
67411a88a0 | ||
|
|
0bfe22b6d5 | ||
|
|
3a684d611e | ||
|
|
a9733794bb | ||
|
|
19fe1aa332 | ||
|
|
39bace5da8 | ||
|
|
071863b3d8 | ||
|
|
e4678430c2 | ||
|
|
2b7fe38c36 | ||
|
|
4c4191cec2 | ||
|
|
ae7cd18c98 | ||
|
|
4f3cc9c21b | ||
|
|
55a2063005 | ||
|
|
77482f2783 | ||
|
|
5a6e85fb8d | ||
|
|
9e87ff5472 | ||
|
|
3afe18fd1f | ||
|
|
b51cf830a6 | ||
|
|
66b03e134f | ||
|
|
3dc50b3bc2 | ||
|
|
0a244a2269 | ||
|
|
b5e27aa262 | ||
|
|
0149d39e6e | ||
|
|
1d91bfdf1c | ||
|
|
db40c3f869 | ||
|
|
b663fd5322 |
+10
-1
@@ -1,7 +1,16 @@
|
||||
*.eps
|
||||
*.log
|
||||
*.o
|
||||
*.pdf
|
||||
*.png
|
||||
*.stamp
|
||||
*.trs
|
||||
*~
|
||||
.deps
|
||||
.dirstamp
|
||||
/*.cache
|
||||
/*.flc
|
||||
/*.prj
|
||||
/*~
|
||||
/.tarball-version
|
||||
/.version
|
||||
/ABOUT-NLS
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
3.0
|
||||
3.0.4
|
||||
|
||||
@@ -24,7 +24,7 @@ and nasty bugs.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+1
-1
@@ -26733,7 +26733,7 @@
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1987-1988, 1991-2013 Free Software Foundation,
|
||||
Copyright (C) 1987-1988, 1991-2015 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Copying and distribution of this file, with or without
|
||||
|
||||
+8
-5
@@ -1,6 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2015 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,8 +24,10 @@ SUBDIRS = po runtime-po .
|
||||
aclocaldir = @aclocaldir@
|
||||
aclocal_DATA = m4/bison-i18n.m4
|
||||
|
||||
EXTRA_DIST = .prev-version .version \
|
||||
cfg.mk ChangeLog-1998 ChangeLog-2012 PACKAGING
|
||||
EXTRA_DIST = .prev-version .version cfg.mk PACKAGING \
|
||||
ChangeLog-1998 ChangeLog-2012 ChangeLog
|
||||
|
||||
dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO
|
||||
|
||||
## Running the bison from this tarball. To generate our own parser,
|
||||
## but also to run the tests. Of course, you ought to keep a sane
|
||||
@@ -37,8 +39,9 @@ AM_YFLAGS = -d -v -Werror -Wall -Wno-yacc --report=all
|
||||
|
||||
# Initialization before completion by local.mk's.
|
||||
AM_CFLAGS = $(WARN_CFLAGS)
|
||||
# Find builddir/src/scan-code.c etc.
|
||||
AM_CPPFLAGS = -I. -Ilib -I$(top_srcdir) -I$(top_srcdir)/lib
|
||||
# Find builddir/src/scan-code.c etc. For some reason "-I./lib"
|
||||
# instead of "-Ilib" avoids infinite recursions on #include_next.
|
||||
AM_CPPFLAGS = -I. -I./lib -I$(top_srcdir) -I$(top_srcdir)/lib
|
||||
BUILT_SOURCES =
|
||||
CLEANFILES =
|
||||
DISTCLEANFILES =
|
||||
|
||||
@@ -2,6 +2,171 @@ GNU Bison NEWS
|
||||
|
||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||
|
||||
** Diagnostics about useless rules
|
||||
|
||||
In the following grammar, the 'exp' nonterminal is trivially useless. So,
|
||||
of course, its rules are useless too.
|
||||
|
||||
%%
|
||||
input: '0' | exp
|
||||
exp: exp '+' exp | exp '-' exp | '(' exp ')'
|
||||
|
||||
Previously all the useless rules were reported, including those whose
|
||||
left-hand side is the 'exp' nonterminal:
|
||||
|
||||
warning: 1 nonterminal useless in grammar [-Wother]
|
||||
warning: 4 rules useless in grammar [-Wother]
|
||||
2.14-16: warning: nonterminal useless in grammar: exp [-Wother]
|
||||
input: '0' | exp
|
||||
^^^
|
||||
2.14-16: warning: rule useless in grammar [-Wother]
|
||||
input: '0' | exp
|
||||
^^^
|
||||
3.6-16: warning: rule useless in grammar [-Wother]
|
||||
exp: exp '+' exp | exp '-' exp | '(' exp ')'
|
||||
^^^^^^^^^^^
|
||||
3.20-30: warning: rule useless in grammar [-Wother]
|
||||
exp: exp '+' exp | exp '-' exp | '(' exp ')'
|
||||
^^^^^^^^^^^
|
||||
3.34-44: warning: rule useless in grammar [-Wother]
|
||||
exp: exp '+' exp | exp '-' exp | '(' exp ')'
|
||||
^^^^^^^^^^^
|
||||
|
||||
Now, rules whose left-hand side symbol is useless are no longer reported
|
||||
as useless. The locations of the errors have also been adjusted to point
|
||||
to the first use of the nonterminal as a left-hand side of a rule:
|
||||
|
||||
warning: 1 nonterminal useless in grammar [-Wother]
|
||||
warning: 4 rules useless in grammar [-Wother]
|
||||
3.1-3: warning: nonterminal useless in grammar: exp [-Wother]
|
||||
exp: exp '+' exp | exp '-' exp | '(' exp ')'
|
||||
^^^
|
||||
2.14-16: warning: rule useless in grammar [-Wother]
|
||||
input: '0' | exp
|
||||
^^^
|
||||
|
||||
* Noteworthy changes in release 3.0.4 (2015-01-23) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
*** C++ with Variants (lalr1.cc)
|
||||
|
||||
Fix a compiler warning when no %destructor use $$.
|
||||
|
||||
*** Test suites
|
||||
|
||||
Several portability issues in tests were fixed.
|
||||
|
||||
* Noteworthy changes in release 3.0.3 (2015-01-15) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
*** C++ with Variants (lalr1.cc)
|
||||
|
||||
Problems with %destructor and '%define parse.assert' have been fixed.
|
||||
|
||||
*** Named %union support (yacc.c, glr.c)
|
||||
|
||||
Bison 3.0 introduced a regression on named %union such as
|
||||
|
||||
%union foo { int ival; };
|
||||
|
||||
The possibility to use a name was introduced "for Yacc compatibility".
|
||||
It is however not required by POSIX Yacc, and its usefulness is not clear.
|
||||
|
||||
*** %define api.value.type union with %defines (yacc.c, glr.c)
|
||||
|
||||
The C parsers were broken when %defines was used together with "%define
|
||||
api.value.type union".
|
||||
|
||||
*** Redeclarations are reported in proper order
|
||||
|
||||
On
|
||||
|
||||
%token FOO "foo"
|
||||
%printer {} "foo"
|
||||
%printer {} FOO
|
||||
|
||||
bison used to report:
|
||||
|
||||
/tmp/foo.yy:2.10-11: error: %printer redeclaration for FOO
|
||||
%printer {} "foo"
|
||||
^^
|
||||
/tmp/foo.yy:3.10-11: previous declaration
|
||||
%printer {} FOO
|
||||
^^
|
||||
|
||||
Now, the "previous" declaration is always the first one.
|
||||
|
||||
|
||||
** Documentation
|
||||
|
||||
Bison now installs various files in its docdir (which defaults to
|
||||
'/usr/local/share/doc/bison'), including the three fully blown examples
|
||||
extracted from the documentation:
|
||||
|
||||
- rpcalc
|
||||
Reverse polish calculator, a simple introductory example.
|
||||
- mfcalc
|
||||
Multi-function Calc, a calculator with memory and functions and located
|
||||
error messages.
|
||||
- calc++
|
||||
a calculator in C++ using variant support and token constructors.
|
||||
|
||||
* Noteworthy changes in release 3.0.2 (2013-12-05) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
*** Generated source files when errors are reported
|
||||
|
||||
When warnings are issued and -Werror is set, bison would still generate
|
||||
the source files (*.c, *.h...). As a consequence, some runs of "make"
|
||||
could fail the first time, but not the second (as the files were generated
|
||||
anyway).
|
||||
|
||||
This is fixed: bison no longer generates this source files, but, of
|
||||
course, still produces the various reports (*.output, *.xml, etc.).
|
||||
|
||||
*** %empty is used in reports
|
||||
|
||||
Empty right-hand sides are denoted by '%empty' in all the reports (text,
|
||||
dot, XML and formats derived from it).
|
||||
|
||||
*** YYERROR and variants
|
||||
|
||||
When C++ variant support is enabled, an error triggered via YYERROR, but
|
||||
not caught via error recovery, resulted in a double deletion.
|
||||
|
||||
* Noteworthy changes in release 3.0.1 (2013-11-12) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
*** Errors in caret diagnostics
|
||||
|
||||
On some platforms, some errors could result in endless diagnostics.
|
||||
|
||||
*** Fixes of the -Werror option
|
||||
|
||||
Options such as "-Werror -Wno-error=foo" were still turning "foo"
|
||||
diagnostics into errors instead of warnings. This is fixed.
|
||||
|
||||
Actually, for consistency with GCC, "-Wno-error=foo -Werror" now also
|
||||
leaves "foo" diagnostics as warnings. Similarly, with "-Werror=foo
|
||||
-Wno-error", "foo" diagnostics are now errors.
|
||||
|
||||
*** GLR Predicates
|
||||
|
||||
As demonstrated in the documentation, one can now leave spaces between
|
||||
"%?" and its "{".
|
||||
|
||||
*** Installation
|
||||
|
||||
The yacc.1 man page is no longer installed if --disable-yacc was
|
||||
specified.
|
||||
|
||||
*** Fixes in the test suite
|
||||
|
||||
Bugs and portability issues.
|
||||
|
||||
* Noteworthy changes in release 3.0 (2013-07-25) [stable]
|
||||
|
||||
@@ -2628,7 +2793,7 @@ Output file does not redefine const for C++.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2015 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-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2005, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2013 Free Software
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015 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-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
+15
-4
@@ -62,13 +62,22 @@ tools we depend upon, including:
|
||||
- Gettext <http://www.gnu.org/software/gettext/>
|
||||
- Graphviz <http://www.graphviz.org>
|
||||
- Gzip <http://www.gnu.org/software/gzip/>
|
||||
- Help2man <http://www.gnu.org/software/help2man/>
|
||||
- Perl <http://www.cpan.org/>
|
||||
- Rsync <http://samba.anu.edu.au/rsync/>
|
||||
- Tar <http://www.gnu.org/software/tar/>
|
||||
- Texinfo <http://www.gnu.org/software/texinfo/>
|
||||
|
||||
Valgrind <http://valgrind.org/> is also highly recommended, if it supports
|
||||
your architecture.
|
||||
|
||||
If you're using a GNU/Linux distribution, the easiest way to install the
|
||||
above packages depends on your system. The following shell command should
|
||||
work for Debian-based systems such as Ubuntu:
|
||||
|
||||
sudo apt-get install \
|
||||
autoconf automake autopoint flex graphviz help2man texinfo valgrind
|
||||
|
||||
Bison is written using Bison grammars, so there are bootstrapping issues.
|
||||
The bootstrap script attempts to discover when the C code generated from the
|
||||
grammars is out of date, and to bootstrap with an out-of-date version of the
|
||||
@@ -94,15 +103,17 @@ to perform the first checkout of the submodules, run
|
||||
|
||||
$ git submodule update --init
|
||||
|
||||
Git submodule support is weak before versions 1.6 and later, you
|
||||
should probably upgrade Git if your version is older.
|
||||
Git submodule support is weak before versions 1.6 and later, upgrade Git if
|
||||
your version is older.
|
||||
|
||||
The next step is to get other files needed to build, which are
|
||||
extracted from other source packages:
|
||||
|
||||
$ ./bootstrap
|
||||
|
||||
And there you are! Just
|
||||
If it fails with missing symbols (e.g., "error: possibly undefined macro:
|
||||
AC_PROG_GNU_M4"), you are likely to have forgotten the submodule
|
||||
initialization part. Otherwise, there you are! Just
|
||||
|
||||
$ ./configure
|
||||
$ make
|
||||
@@ -440,7 +451,7 @@ Push these changes.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002-2005, 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2005, 2007-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
Bison was originally written by Robert Corbett. It would not be what
|
||||
it is today without the invaluable help of these people:
|
||||
|
||||
Аскар Сафин [email protected]
|
||||
Aaro Koskinen [email protected]
|
||||
Аскар Сафин [email protected]
|
||||
Airy Andre [email protected]
|
||||
Akim Demaille [email protected]
|
||||
Albert Chin-A-Young [email protected]
|
||||
@@ -11,11 +12,13 @@ Andreas Schwab [email protected]
|
||||
Andrew Suffield [email protected]
|
||||
Angelo Borsotti [email protected]
|
||||
Anthony Heading [email protected]
|
||||
Antonio Silva Correia [email protected]
|
||||
Arnold Robbins [email protected]
|
||||
Art Haas [email protected]
|
||||
Baron Schwartz [email protected]
|
||||
Ben Pfaff [email protected]
|
||||
Benoit Perrot [email protected]
|
||||
Bernd Edlinger [email protected]
|
||||
Bernd Kiefer [email protected]
|
||||
Bert Deknuydt [email protected]
|
||||
Bill Allombert [email protected]
|
||||
@@ -31,6 +34,7 @@ Cris van Pelt [email protected]
|
||||
Csaba Raduly [email protected]
|
||||
Dagobert Michelsen [email protected]
|
||||
Daniel Frużyński [email protected]
|
||||
Daniel Galloway [email protected]
|
||||
Daniel Hagerty [email protected]
|
||||
David J. MacKenzie [email protected]
|
||||
David Kastrup [email protected]
|
||||
@@ -62,11 +66,13 @@ Jim Kent [email protected]
|
||||
Jim Meyering [email protected]
|
||||
Joel E. Denny [email protected]
|
||||
Johan van Selst [email protected]
|
||||
John Horigan [email protected]
|
||||
Jonathan Fabrizio [email protected]
|
||||
Jonathan Nieder [email protected]
|
||||
Juan Manuel Guerrero [email protected]
|
||||
Kees Zeelenberg [email protected]
|
||||
Keith Browne [email protected]
|
||||
Ken Moffat [email protected]
|
||||
Laurent Mascherpa [email protected]
|
||||
Lie Yan [email protected]
|
||||
Magnus Fromreide [email protected]
|
||||
@@ -78,14 +84,19 @@ Martin Mokrejs [email protected]
|
||||
Martin Nylin [email protected]
|
||||
Matt Kraai [email protected]
|
||||
Matt Rosing [email protected]
|
||||
Michael Catanzaro [email protected]
|
||||
Michael Felt [email protected]
|
||||
Michael Hayes [email protected]
|
||||
Michael Raskin [email protected]
|
||||
Michel d'Hooge [email protected]
|
||||
Michiel De Wilde [email protected]
|
||||
Mickael Labau [email protected]
|
||||
Mike Castle [email protected]
|
||||
Mike Sullivan [email protected]
|
||||
Neil Booth [email protected]
|
||||
Nelson H. F. Beebe [email protected]
|
||||
Nick Bowler [email protected]
|
||||
Nicolas Bedon [email protected]
|
||||
Nicolas Burrus [email protected]
|
||||
Nicolas Tisserand [email protected]
|
||||
Noah Friedman [email protected]
|
||||
@@ -93,6 +104,7 @@ Odd Arild Olsen [email protected]
|
||||
Oleg Smolsky [email protected]
|
||||
Oleksii Taran [email protected]
|
||||
Paolo Bonzini [email protected]
|
||||
Paolo Simone Gasparello [email protected]
|
||||
Pascal Bart [email protected]
|
||||
Paul Eggert [email protected]
|
||||
Paul Hilfinger [email protected]
|
||||
@@ -102,16 +114,19 @@ Peter Fales [email protected]
|
||||
Peter Hamorsky [email protected]
|
||||
Peter Simons [email protected]
|
||||
Petr Machata [email protected]
|
||||
Pho [email protected]
|
||||
Piotr Gackiewicz [email protected]
|
||||
Quentin Hocquet [email protected]
|
||||
Quoc Peyrot [email protected]
|
||||
R Blake [email protected]
|
||||
Raja R Harinath [email protected]
|
||||
Ralf Wildenhues [email protected]
|
||||
Rich Wilson [email protected]
|
||||
Richard Stallman [email protected]
|
||||
Rici Lake [email protected]
|
||||
Rob Conde [email protected]
|
||||
Rob Vermaas [email protected]
|
||||
Robert Anisko [email protected]
|
||||
Rob Conde [email protected]
|
||||
Roland Levillain [email protected]
|
||||
Satya Kiran Popuri [email protected]
|
||||
Sebastian Setzer [email protected]
|
||||
@@ -119,13 +134,16 @@ Sebastien Fricker [email protected]
|
||||
Sergei Steshenko [email protected]
|
||||
Shura [email protected]
|
||||
Stefano Lattarini [email protected]
|
||||
Stephen Cameron [email protected]
|
||||
Steve Murphy [email protected]
|
||||
Sum Wu [email protected]
|
||||
Théophile Ranquet [email protected]
|
||||
Thiru Ramakrishnan [email protected]
|
||||
Thomas Jahns [email protected]
|
||||
Tim Josling [email protected]
|
||||
Tim Landscheidt [email protected]
|
||||
Tim Van Holder [email protected]
|
||||
Tobias Frost [email protected]
|
||||
Tom Lane [email protected]
|
||||
Tom Tromey [email protected]
|
||||
Tommy Nordgren [email protected]
|
||||
@@ -141,6 +159,7 @@ Wojciech Polak [email protected]
|
||||
Wolfgang S. Kechel [email protected]
|
||||
Wolfram Wagner [email protected]
|
||||
Wwp [email protected]
|
||||
xolodho [email protected]
|
||||
Zack Weinberg [email protected]
|
||||
|
||||
Many people are not named here because we lost track of them. We
|
||||
@@ -153,7 +172,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Parser Generator.
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2001-2004, 2006, 2008-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2004, 2006, 2008-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Print a version string.
|
||||
scriptversion=2013-07-03.20; # UTC
|
||||
scriptversion=2014-12-08.12; # UTC
|
||||
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2015 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,6 +42,9 @@ export LC_ALL
|
||||
|
||||
local_gl_dir=gl
|
||||
|
||||
# Honour $PERL, but work even if there is none
|
||||
PERL="${PERL-perl}"
|
||||
|
||||
me=$0
|
||||
|
||||
usage() {
|
||||
@@ -209,12 +212,26 @@ bootstrap_sync=false
|
||||
# Use git to update gnulib sources
|
||||
use_git=true
|
||||
|
||||
check_exists() {
|
||||
if test "$1" = "--verbose"; then
|
||||
($2 --version </dev/null) >/dev/null 2>&1
|
||||
if test $? -ge 126; then
|
||||
# If not found, run with diagnostics as one may be
|
||||
# presented with env variables to set to find the right version
|
||||
($2 --version </dev/null)
|
||||
fi
|
||||
else
|
||||
($1 --version </dev/null) >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
test $? -lt 126
|
||||
}
|
||||
|
||||
# find_tool ENVVAR NAMES...
|
||||
# -------------------------
|
||||
# Search for a required program. Use the value of ENVVAR, if set,
|
||||
# otherwise find the first of the NAMES that can be run (i.e.,
|
||||
# supports --version). If found, set ENVVAR to the program name,
|
||||
# die otherwise.
|
||||
# otherwise find the first of the NAMES that can be run.
|
||||
# If found, set ENVVAR to the program name, die otherwise.
|
||||
#
|
||||
# FIXME: code duplication, see also gnu-web-doc-update.
|
||||
find_tool ()
|
||||
@@ -224,27 +241,21 @@ find_tool ()
|
||||
find_tool_names=$@
|
||||
eval "find_tool_res=\$$find_tool_envvar"
|
||||
if test x"$find_tool_res" = x; then
|
||||
for i
|
||||
do
|
||||
if ($i --version </dev/null) >/dev/null 2>&1; then
|
||||
find_tool_res=$i
|
||||
break
|
||||
for i; do
|
||||
if check_exists $i; then
|
||||
find_tool_res=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
find_tool_error_prefix="\$$find_tool_envvar: "
|
||||
fi
|
||||
test x"$find_tool_res" != x \
|
||||
|| die "one of these is required: $find_tool_names"
|
||||
($find_tool_res --version </dev/null) >/dev/null 2>&1 \
|
||||
|| die "${find_tool_error_prefix}cannot run $find_tool_res --version"
|
||||
if test x"$find_tool_res" = x; then
|
||||
warn_ "one of these is required: $find_tool_names;"
|
||||
die "alternatively set $find_tool_envvar to a compatible tool"
|
||||
fi
|
||||
eval "$find_tool_envvar=\$find_tool_res"
|
||||
eval "export $find_tool_envvar"
|
||||
}
|
||||
|
||||
# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6.
|
||||
find_tool SHA1SUM sha1sum gsha1sum shasum
|
||||
|
||||
# Override the default configuration, if necessary.
|
||||
# Make sure that bootstrap.conf is sourced from the current directory
|
||||
# if we were invoked as "sh bootstrap".
|
||||
@@ -326,7 +337,7 @@ insert_if_absent() {
|
||||
die "Error: Duplicate entries in $file: " $duplicate_entries
|
||||
fi
|
||||
linesold=$(gitignore_entries $file | wc -l)
|
||||
linesnew=$(echo "$str" | gitignore_entries - $file | sort -u | wc -l)
|
||||
linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
|
||||
if [ $linesold != $linesnew ] ; then
|
||||
{ echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|
||||
|| die "insert_if_absent $file $str: failed"
|
||||
@@ -410,7 +421,7 @@ sort_ver() { # sort -V is not generally available
|
||||
get_version() {
|
||||
app=$1
|
||||
|
||||
$app --version >/dev/null 2>&1 || return 1
|
||||
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
|
||||
|
||||
$app --version 2>&1 |
|
||||
sed -n '# Move version to start of line.
|
||||
@@ -448,6 +459,7 @@ check_versions() {
|
||||
test "$appvar" = TAR && appvar=AMTAR
|
||||
case $appvar in
|
||||
GZIP) ;; # Do not use $GZIP: it contains gzip options.
|
||||
PERL::*) ;; # Keep perl modules as-is
|
||||
*) eval "app=\${$appvar-$app}" ;;
|
||||
esac
|
||||
|
||||
@@ -465,12 +477,22 @@ check_versions() {
|
||||
ret=1
|
||||
continue
|
||||
} ;;
|
||||
# Another check is for perl modules. These can be written as
|
||||
# e.g. perl::XML::XPath in case of XML::XPath module, etc.
|
||||
perl::*)
|
||||
# Extract module name
|
||||
app="${app#perl::}"
|
||||
if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
|
||||
warn_ "Error: perl module '$app' not found"
|
||||
ret=1
|
||||
fi
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
if [ "$req_ver" = "-" ]; then
|
||||
# Merely require app to exist; not all prereq apps are well-behaved
|
||||
# so we have to rely on $? rather than get_version.
|
||||
$app --version >/dev/null 2>&1
|
||||
if [ 126 -le $? ]; then
|
||||
if ! check_exists --verbose $app; then
|
||||
warn_ "Error: '$app' not found"
|
||||
ret=1
|
||||
fi
|
||||
@@ -503,6 +525,12 @@ print_versions() {
|
||||
# can't depend on column -t
|
||||
}
|
||||
|
||||
# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
|
||||
# Also find the compatible sha1 utility on the BSDs
|
||||
if test x"$SKIP_PO" = x; then
|
||||
find_tool SHA1SUM sha1sum gsha1sum shasum sha1
|
||||
fi
|
||||
|
||||
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,
|
||||
@@ -548,13 +576,21 @@ if ! printf "$buildreq" | check_versions; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Warn the user if autom4te appears to be broken; this causes known
|
||||
# issues with at least gettext 0.18.3.
|
||||
probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -)
|
||||
if test "x$probe" != xhi; then
|
||||
warn_ "WARNING: your autom4te wrapper eats stdin;"
|
||||
warn_ "if bootstrap fails, consider upgrading your autotools"
|
||||
fi
|
||||
|
||||
echo "$0: Bootstrapping from checked-out $package sources..."
|
||||
|
||||
# See if we can use gnulib's git-merge-changelog merge driver.
|
||||
if $use_git && test -d .git && (git --version) >/dev/null 2>/dev/null ; then
|
||||
if $use_git && test -d .git && check_exists git; then
|
||||
if git config merge.merge-changelog.driver >/dev/null ; then
|
||||
:
|
||||
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
|
||||
elif check_exists git-merge-changelog; then
|
||||
echo "$0: 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'
|
||||
@@ -587,8 +623,8 @@ case ${GNULIB_SRCDIR--} in
|
||||
# Note that $use_git is necessarily true in this case.
|
||||
if git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
echo "$0: getting gnulib files..."
|
||||
git submodule init || exit $?
|
||||
git submodule update || exit $?
|
||||
git submodule init -- "$gnulib_path" || exit $?
|
||||
git submodule update -- "$gnulib_path" || exit $?
|
||||
|
||||
elif [ ! -d "$gnulib_path" ]; then
|
||||
echo "$0: getting gnulib files..."
|
||||
@@ -617,13 +653,14 @@ case ${GNULIB_SRCDIR--} in
|
||||
# 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 $?
|
||||
git submodule update -- "$gnulib_path" || 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 \
|
||||
&& git submodule init -- "$gnulib_path" \
|
||||
&& git submodule update -- "$gnulib_path" \
|
||||
|| exit $?
|
||||
fi
|
||||
fi
|
||||
@@ -692,11 +729,10 @@ update_po_files() {
|
||||
cksum_file="$ref_po_dir/$po.s1"
|
||||
if ! test -f "$cksum_file" ||
|
||||
! test -f "$po_dir/$po.po" ||
|
||||
! $SHA1SUM -c --status "$cksum_file" \
|
||||
< "$new_po" > /dev/null; then
|
||||
! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
|
||||
echo "$me: updated $po_dir/$po.po..."
|
||||
cp "$new_po" "$po_dir/$po.po" \
|
||||
&& $SHA1SUM < "$new_po" > "$cksum_file"
|
||||
&& $SHA1SUM < "$new_po" > "$cksum_file" || return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2015 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
|
||||
@@ -33,8 +33,9 @@ gnulib_modules='
|
||||
quote quotearg
|
||||
readme-release
|
||||
realloc-posix
|
||||
spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
|
||||
unistd unistd-safer unlocked-io update-copyright unsetenv verify
|
||||
spawn-pipe stdbool stpcpy strdup-posix strerror strverscmp
|
||||
unistd unistd-safer unlink unlocked-io
|
||||
update-copyright unsetenv verify
|
||||
warnings
|
||||
xalloc
|
||||
xalloc-die
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2015 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,6 +2,9 @@
|
||||
# option. It specifies what changes to make to each given SHA1's commit
|
||||
# log and metadata, using Perl-eval'able expressions.
|
||||
|
||||
975bb564319aa4f4204c48aba265757ba207a80f
|
||||
s/Edligner/Edlinger/;
|
||||
|
||||
0db2648930e3b6c376a539aabe368aade83ee29a
|
||||
s/--flags/--feature/;
|
||||
s/flag_flag/feature_flag/;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2000-2015 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Update b4_copyright invocations or b4_copyright_years definitions to
|
||||
# include the current year.
|
||||
|
||||
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2009-2015 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,7 +2,7 @@
|
||||
|
||||
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
||||
|
||||
# Copyright (C) 2010-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2010-2015 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,5 +1,5 @@
|
||||
# Customize maint.mk -*- makefile -*-
|
||||
# Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2008-2015 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
-21
@@ -1,6 +1,6 @@
|
||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2015 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,18 +26,14 @@ m4_pattern_forbid([^gl_[A-Z]])
|
||||
AC_INIT([GNU Bison],
|
||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||
[[email protected]])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2013])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2015])
|
||||
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
||||
[The copyright year for this package])
|
||||
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here:
|
||||
#
|
||||
# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131
|
||||
#
|
||||
# To avoid 1.11, we make 1.11.1 the minimum version.
|
||||
# We use Automake 1.14's %D% and %C%.
|
||||
#
|
||||
# We want gnits strictness only when rolling a stable release. For
|
||||
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
||||
@@ -45,7 +41,7 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||
# releases, we want to be able run make dist without being required to
|
||||
# add a bogus NEWS entry. In that case, the version string
|
||||
# automatically contains a dash, which we also let disable gnits.
|
||||
AM_INIT_AUTOMAKE([1.11.1 dist-xz nostdinc
|
||||
AM_INIT_AUTOMAKE([1.14 dist-xz nostdinc
|
||||
color-tests parallel-tests
|
||||
silent-rules]
|
||||
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
||||
@@ -75,14 +71,17 @@ AC_CACHE_CHECK([whether pragma GCC diagnostic push works],
|
||||
CFLAGS=$save_CFLAGS])
|
||||
|
||||
AC_ARG_ENABLE([gcc-warnings],
|
||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended).
|
||||
Also, issue synclines from the examples/ to
|
||||
the corresponding source in the Texinfo doc.],
|
||||
[case $enable_gcc_warnings in
|
||||
yes|no) ;;
|
||||
*) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);;
|
||||
esac],
|
||||
[enable_gcc_warnings=no])
|
||||
AM_CONDITIONAL([ENABLE_GCC_WARNINGS], [test "$enable_gcc_warnings" = yes])
|
||||
if test "$enable_gcc_warnings" = yes; then
|
||||
warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align
|
||||
warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align -Wdocumentation
|
||||
-Wformat -Wpointer-arith -Wwrite-strings'
|
||||
warn_c='-Wbad-function-cast -Wshadow -Wstrict-prototypes'
|
||||
warn_cxx='-Wnoexcept'
|
||||
@@ -161,21 +160,17 @@ AC_ARG_ENABLE([yacc],
|
||||
[AC_HELP_STRING([--disable-yacc],
|
||||
[do not build a yacc command or an -ly library])],
|
||||
, [enable_yacc=yes])
|
||||
case $enable_yacc in
|
||||
yes)
|
||||
YACC_SCRIPT=src/yacc
|
||||
YACC_LIBRARY=lib/liby.a;;
|
||||
*)
|
||||
YACC_SCRIPT=
|
||||
YACC_LIBRARY=;;
|
||||
esac
|
||||
AC_SUBST([YACC_SCRIPT])
|
||||
AC_SUBST([YACC_LIBRARY])
|
||||
AM_CONDITIONAL([ENABLE_YACC], [test "$enable_yacc" = yes])
|
||||
|
||||
# Checks for programs.
|
||||
AM_MISSING_PROG([DOT], [dot])
|
||||
AC_PROG_LEX
|
||||
$LEX_IS_FLEX || AC_MSG_ERROR([Flex is required])
|
||||
$LEX_IS_FLEX || test "X$LEX" = X: || {
|
||||
AC_MSG_WARN([bypassing lex because flex is required])
|
||||
LEX=:
|
||||
}
|
||||
AM_CONDITIONAL([FLEX_CXX_WORKS],
|
||||
[$LEX_IS_FLEX && test $bison_cv_cxx_works = yes])
|
||||
AC_PROG_YACC
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_GNU_M4
|
||||
@@ -242,6 +237,9 @@ case $VALGRIND:$host_os in
|
||||
;;
|
||||
esac
|
||||
|
||||
# Whether we cannot run the compiled bison.
|
||||
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
|
||||
|
||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||
# Needed by tests/atlocal.in.
|
||||
AC_SUBST([GCC])
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ into various formats.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2008-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2008-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
+4
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
# Language-independent M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2004-2015 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
|
||||
@@ -437,7 +437,6 @@ m4_define([b4_symbol_action_location],
|
||||
# b4_symbol_action(SYMBOL-NUM, KIND)
|
||||
# ----------------------------------
|
||||
# Run the action KIND (destructor or printer) for SYMBOL-NUM.
|
||||
# Same as in C, but using references instead of pointers.
|
||||
m4_define([b4_symbol_action],
|
||||
[b4_symbol_if([$1], [has_$2],
|
||||
[b4_dollar_pushdef([(*yyvaluep)],
|
||||
@@ -1061,3 +1060,6 @@ b4_percent_define_ifdef([api.value.type],
|
||||
[['%s' and '%s' cannot be used together]],
|
||||
[%yacc],
|
||||
[%define api.value.type "union"])])])])
|
||||
|
||||
# api.value.union.name.
|
||||
b4_percent_define_check_kind([api.value.union.name], [keyword])
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# C++ skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2007, 2009-2015 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
|
||||
|
||||
+52
-9
@@ -2,7 +2,7 @@
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015 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,6 +17,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Sanity checks, before defaults installed by c.m4.
|
||||
b4_percent_define_ifdef([[api.value.union.name]],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]),
|
||||
[named %union is invalid in C++])])
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
|
||||
# b4_comment(TEXT, [PREFIX])
|
||||
@@ -169,9 +174,12 @@ m4_define([b4_public_types_declare],
|
||||
/// (External) token type, as returned by yylex.
|
||||
typedef token::yytokentype token_type;
|
||||
|
||||
/// Internal symbol number.
|
||||
/// Symbol type: an internal symbol number.
|
||||
typedef int symbol_number_type;
|
||||
|
||||
/// The symbol type number to denote an empty symbol.
|
||||
enum { empty_symbol = -2 };
|
||||
|
||||
/// Internal symbol number for tokens (subsumed by symbol_number_type).
|
||||
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
||||
|
||||
@@ -204,8 +212,15 @@ m4_define([b4_public_types_declare],
|
||||
const semantic_type& v]b4_locations_if([,
|
||||
const location_type& l])[);
|
||||
|
||||
/// Destroy the symbol.
|
||||
~basic_symbol ();
|
||||
|
||||
/// Destroy contents, and record that is empty.
|
||||
void clear ();
|
||||
|
||||
/// Whether empty.
|
||||
bool empty () const;
|
||||
|
||||
/// Destructive move, \a s is emptied into this.
|
||||
void move (basic_symbol& s);
|
||||
|
||||
@@ -235,21 +250,23 @@ m4_define([b4_public_types_declare],
|
||||
/// Constructor from (external) token numbers.
|
||||
by_type (kind_type t);
|
||||
|
||||
/// Record that this symbol is empty.
|
||||
void clear ();
|
||||
|
||||
/// Steal the symbol type from \a that.
|
||||
void move (by_type& that);
|
||||
|
||||
/// The (internal) type number (corresponding to \a type).
|
||||
/// -1 when this symbol is empty.
|
||||
/// \a empty when empty.
|
||||
symbol_number_type type_get () const;
|
||||
|
||||
/// The token.
|
||||
token_type token () const;
|
||||
|
||||
enum { empty = 0 };
|
||||
|
||||
/// The symbol type.
|
||||
/// -1 when this symbol is empty.
|
||||
token_number_type type;
|
||||
/// \a empty_symbol when empty.
|
||||
/// An int, not token_number_type, to be able to store empty_symbol.
|
||||
int type;
|
||||
};
|
||||
|
||||
/// "External" symbols: returned by the scanner.
|
||||
@@ -318,9 +335,19 @@ m4_define([b4_public_types_define],
|
||||
template <typename Base>
|
||||
inline
|
||||
]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol ()
|
||||
{
|
||||
clear ();
|
||||
}
|
||||
|
||||
template <typename Base>
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::basic_symbol<Base>::clear ()
|
||||
{]b4_variant_if([[
|
||||
// User destructor.
|
||||
symbol_number_type yytype = this->type_get ();
|
||||
basic_symbol<Base>& yysym = *this;
|
||||
(void) yysym;
|
||||
switch (yytype)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||
@@ -330,6 +357,15 @@ m4_define([b4_public_types_define],
|
||||
|
||||
// Type destructor.
|
||||
]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[
|
||||
Base::clear ();
|
||||
}
|
||||
|
||||
template <typename Base>
|
||||
inline
|
||||
bool
|
||||
]b4_parser_class_name[::basic_symbol<Base>::empty () const
|
||||
{
|
||||
return Base::type_get () == empty_symbol;
|
||||
}
|
||||
|
||||
template <typename Base>
|
||||
@@ -347,7 +383,7 @@ m4_define([b4_public_types_define],
|
||||
// by_type.
|
||||
inline
|
||||
]b4_parser_class_name[::by_type::by_type ()
|
||||
: type (empty)
|
||||
: type (empty_symbol)
|
||||
{}
|
||||
|
||||
inline
|
||||
@@ -360,12 +396,19 @@ m4_define([b4_public_types_define],
|
||||
: type (yytranslate_ (t))
|
||||
{}
|
||||
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::by_type::clear ()
|
||||
{
|
||||
type = empty_symbol;
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::by_type::move (by_type& that)
|
||||
{
|
||||
type = that.type;
|
||||
that.type = empty;
|
||||
that.clear ();
|
||||
}
|
||||
|
||||
inline
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# Common code for C-like languages (C, C++, Java, etc.)
|
||||
|
||||
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2015 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 @@
|
||||
|
||||
# C skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2007, 2009-2015 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,7 +2,7 @@
|
||||
|
||||
# C M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2004-2015 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
|
||||
@@ -97,7 +97,8 @@ m4_define([b4_api_PREFIX],
|
||||
m4_define_default([b4_prefix], [b4_api_prefix])
|
||||
|
||||
# If the %union is not named, its name is YYSTYPE.
|
||||
m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE])
|
||||
b4_percent_define_default([[api.value.union.name]],
|
||||
[b4_api_PREFIX[][STYPE]])
|
||||
|
||||
|
||||
## ------------------------ ##
|
||||
@@ -205,13 +206,32 @@ m4_define([b4_table_value_equals],
|
||||
|
||||
# b4_attribute_define
|
||||
# -------------------
|
||||
# Provide portability for __attribute__.
|
||||
# Provide portable compiler "attributes".
|
||||
m4_define([b4_attribute_define],
|
||||
[#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if (! defined __GNUC__ || __GNUC__ < 2 \
|
||||
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
|
||||
# define __attribute__(Spec) /* empty */
|
||||
[#ifndef YY_ATTRIBUTE
|
||||
# if (defined __GNUC__ \
|
||||
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
|
||||
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
|
||||
# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
|
||||
# else
|
||||
# define YY_ATTRIBUTE(Spec) /* empty */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef YY_ATTRIBUTE_PURE
|
||||
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
|
||||
#endif
|
||||
|
||||
#ifndef YY_ATTRIBUTE_UNUSED
|
||||
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
|
||||
#endif
|
||||
|
||||
#if !defined _Noreturn \
|
||||
&& (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
|
||||
# if defined _MSC_VER && 1200 <= _MSC_VER
|
||||
# define _Noreturn __declspec (noreturn)
|
||||
# else
|
||||
# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -250,14 +270,14 @@ m4_define([b4_attribute_define],
|
||||
|
||||
# b4_null_define
|
||||
# --------------
|
||||
# Portability issues: define a YY_NULL appropriate for the current
|
||||
# Portability issues: define a YY_NULLPTR appropriate for the current
|
||||
# language (C, C++98, or C++11).
|
||||
m4_define([b4_null_define],
|
||||
[# ifndef YY_NULL
|
||||
[# ifndef YY_NULLPTR
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
# define YY_NULL nullptr
|
||||
# define YY_NULLPTR nullptr
|
||||
# else
|
||||
# define YY_NULL 0
|
||||
# define YY_NULLPTR 0
|
||||
# endif
|
||||
# endif[]dnl
|
||||
])
|
||||
@@ -266,7 +286,7 @@ m4_define([b4_null_define],
|
||||
# b4_null
|
||||
# -------
|
||||
# Return a null pointer constant.
|
||||
m4_define([b4_null], [YY_NULL])
|
||||
m4_define([b4_null], [YY_NULLPTR])
|
||||
|
||||
# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
|
||||
# -------------------------------------------------------------
|
||||
@@ -541,15 +561,15 @@ b4_locations_if([, yylocationp])[]b4_user_args[);
|
||||
# b4_symbol_type_register(SYMBOL-NUM)
|
||||
# -----------------------------------
|
||||
# Symbol SYMBOL-NUM has a type (for variant) instead of a type-tag.
|
||||
# Extend the definition of %union's body with a field of that type,
|
||||
# and extend the symbol's "type" field to point to the field name,
|
||||
# instead of the type name.
|
||||
# Extend the definition of %union's body (b4_union_members) with a
|
||||
# field of that type, and extend the symbol's "type" field to point to
|
||||
# the field name, instead of the type name.
|
||||
m4_define([b4_symbol_type_register],
|
||||
[m4_define([b4_symbol($1, type_tag)],
|
||||
[b4_symbol_if([$1], [has_id],
|
||||
[b4_symbol([$1], [id])],
|
||||
[yytype_[]b4_symbol([$1], [number])])])dnl
|
||||
m4_append([b4_user_union_members],
|
||||
m4_append([b4_union_members],
|
||||
m4_expand([
|
||||
b4_symbol_tag_comment([$1])dnl
|
||||
b4_symbol([$1], [type]) b4_symbol([$1], [type_tag]);]))
|
||||
@@ -589,10 +609,9 @@ m4_copy_force([b4_symbol_value_union], [b4_symbol_value])
|
||||
])
|
||||
|
||||
|
||||
# ---------------- #
|
||||
# api.value.type. #
|
||||
# ---------------- #
|
||||
|
||||
# -------------------------- #
|
||||
# api.value.type = variant. #
|
||||
# -------------------------- #
|
||||
|
||||
# b4_value_type_setup_variant
|
||||
# ---------------------------
|
||||
@@ -667,11 +686,13 @@ typedef ]b4_percent_define_get([[api.value.type]])[ ]b4_api_PREFIX[STYPE;
|
||||
[m4_bmatch(b4_percent_define_get([[api.value.type]]),
|
||||
[union\|union-directive],
|
||||
[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
|
||||
typedef union ]b4_union_name[ ]b4_api_PREFIX[STYPE;
|
||||
union ]b4_union_name[
|
||||
]b4_percent_define_get_syncline([[api.value.union.name]])[
|
||||
union ]b4_percent_define_get([[api.value.union.name]])[
|
||||
{
|
||||
]b4_user_union_members[
|
||||
};
|
||||
]b4_percent_define_get_syncline([[api.value.union.name]])[
|
||||
typedef union ]b4_percent_define_get([[api.value.union.name]])[ ]b4_api_PREFIX[STYPE;
|
||||
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1
|
||||
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
|
||||
#endif
|
||||
@@ -783,7 +804,7 @@ m4_define([b4_yy_location_print_define],
|
||||
|
||||
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
|
||||
|
||||
__attribute__((__unused__))
|
||||
YY_ATTRIBUTE_UNUSED
|
||||
]b4_function_define([yy_location_print_],
|
||||
[static unsigned],
|
||||
[[FILE *yyo], [yyo]],
|
||||
|
||||
+119
-108
@@ -2,7 +2,7 @@
|
||||
|
||||
# GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015 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
|
||||
@@ -178,9 +178,42 @@ m4_if(b4_skeleton, ["glr.c"],
|
||||
## Output files. ##
|
||||
## -------------- ##
|
||||
|
||||
# Unfortunately the order of generation between the header and the
|
||||
# implementation file matters (for glr.c) because of the current
|
||||
# implementation of api.value.type=union. In that case we still use a
|
||||
# union for YYSTYPE, but we generate the contents of this union when
|
||||
# setting up YYSTYPE. This is needed for other aspects, such as
|
||||
# defining yy_symbol_value_print, since we need to now the name of the
|
||||
# members of this union.
|
||||
#
|
||||
# To avoid this issue, just generate the header before the
|
||||
# implementation file. But we should also make them more independant.
|
||||
|
||||
# ----------------- #
|
||||
# The header file. #
|
||||
# ----------------- #
|
||||
|
||||
# glr.cc produces its own header.
|
||||
m4_if(b4_skeleton, ["glr.c"],
|
||||
[b4_defines_if(
|
||||
[b4_output_begin([b4_spec_defines_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
[2002-2015])[
|
||||
|
||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||
]b4_shared_declarations[
|
||||
]b4_cpp_guard_close([b4_spec_defines_file])[
|
||||
]b4_output_end()
|
||||
])])
|
||||
|
||||
|
||||
# ------------------------- #
|
||||
# The implementation file. #
|
||||
# ------------------------- #
|
||||
|
||||
b4_output_begin([b4_parser_file_name])
|
||||
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||
[2002-2013])[
|
||||
[2002-2015])[
|
||||
|
||||
/* C GLR parser skeleton written by Paul Hilfinger. */
|
||||
|
||||
@@ -445,9 +478,9 @@ int yydebug;
|
||||
|
||||
struct yyGLRStack;
|
||||
static void yypstack (struct yyGLRStack* yystackp, size_t yyk)
|
||||
__attribute__ ((__unused__));
|
||||
YY_ATTRIBUTE_UNUSED;
|
||||
static void yypdumpstack (struct yyGLRStack* yystackp)
|
||||
__attribute__ ((__unused__));
|
||||
YY_ATTRIBUTE_UNUSED;
|
||||
|
||||
#else /* !]b4_api_PREFIX[DEBUG */
|
||||
|
||||
@@ -669,19 +702,15 @@ struct yyGLRStack {
|
||||
static void yyexpandGLRStack (yyGLRStack* yystackp);
|
||||
#endif
|
||||
|
||||
static void yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
||||
__attribute__ ((__noreturn__));
|
||||
static void
|
||||
static _Noreturn void
|
||||
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
||||
{
|
||||
if (yymsg != YY_NULL)
|
||||
if (yymsg != YY_NULLPTR)
|
||||
yyerror (]b4_yyerror_args[yymsg);
|
||||
YYLONGJMP (yystackp->yyexception_buffer, 1);
|
||||
}
|
||||
|
||||
static void yyMemoryExhausted (yyGLRStack* yystackp)
|
||||
__attribute__ ((__noreturn__));
|
||||
static void
|
||||
static _Noreturn void
|
||||
yyMemoryExhausted (yyGLRStack* yystackp)
|
||||
{
|
||||
YYLONGJMP (yystackp->yyexception_buffer, 2);
|
||||
@@ -702,7 +731,7 @@ yytokenName (yySymbol yytoken)
|
||||
/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting
|
||||
* at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred
|
||||
* containing the pointer to the next state in the chain. */
|
||||
static void yyfillin (yyGLRStackItem *, int, int) __attribute__ ((__unused__));
|
||||
static void yyfillin (yyGLRStackItem *, int, int) YY_ATTRIBUTE_UNUSED;
|
||||
static void
|
||||
yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
|
||||
{
|
||||
@@ -719,7 +748,7 @@ yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
|
||||
else
|
||||
/* The effect of using yysval or yyloc (in an immediate rule) is
|
||||
* undefined. */
|
||||
yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULL;]b4_locations_if([[
|
||||
yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULLPTR;]b4_locations_if([[
|
||||
yyvsp[i].yystate.yyloc = s->yyloc;]])[
|
||||
s = yyvsp[i].yystate.yypred = s->yypred;
|
||||
}
|
||||
@@ -729,7 +758,7 @@ yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
|
||||
* YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
|
||||
* For convenience, always return YYLOW1. */
|
||||
static inline int yyfill (yyGLRStackItem *, int *, int, yybool)
|
||||
__attribute__ ((__unused__));
|
||||
YY_ATTRIBUTE_UNUSED;
|
||||
static inline int
|
||||
yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal)
|
||||
{
|
||||
@@ -751,8 +780,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp,
|
||||
yyGLRStack* yystackp,
|
||||
YYSTYPE* yyvalp]b4_locuser_formals[)
|
||||
{
|
||||
yybool yynormal __attribute__ ((__unused__)) =
|
||||
(yystackp->yysplitPoint == YY_NULL);
|
||||
yybool yynormal YY_ATTRIBUTE_UNUSED = (yystackp->yysplitPoint == YY_NULLPTR);
|
||||
int yylow;
|
||||
]b4_parse_param_use([yyvalp], [yylocp])dnl
|
||||
[ YYUSE (yyrhslen);
|
||||
@@ -836,12 +864,10 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[)
|
||||
if (yydebug)
|
||||
{
|
||||
if (yys->yysemantics.yyfirstVal)
|
||||
YYFPRINTF (stderr, "%s unresolved ", yymsg);
|
||||
YYFPRINTF (stderr, "%s unresolved", yymsg);
|
||||
else
|
||||
YYFPRINTF (stderr, "%s incomplete ", yymsg);
|
||||
yy_symbol_print (stderr, yystos[yys->yylrState],
|
||||
YY_NULL]b4_locuser_args([&yys->yyloc])[);
|
||||
YYFPRINTF (stderr, "\n");
|
||||
YYFPRINTF (stderr, "%s incomplete", yymsg);
|
||||
YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -917,14 +943,18 @@ yygetLRActions (yyStateNum yystate, int yytoken,
|
||||
}
|
||||
}
|
||||
|
||||
/** Compute post-reduction state.
|
||||
* \param yystate the current state
|
||||
* \param yysym the nonterminal to push on the stack
|
||||
*/
|
||||
static inline yyStateNum
|
||||
yyLRgotoState (yyStateNum yystate, yySymbol yylhs)
|
||||
yyLRgotoState (yyStateNum yystate, yySymbol yysym)
|
||||
{
|
||||
int yyr = yypgoto[yylhs - YYNTOKENS] + yystate;
|
||||
int yyr = yypgoto[yysym - YYNTOKENS] + yystate;
|
||||
if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate)
|
||||
return yytable[yyr];
|
||||
else
|
||||
return yydefgoto[yylhs - YYNTOKENS];
|
||||
return yydefgoto[yysym - YYNTOKENS];
|
||||
}
|
||||
|
||||
static inline yybool
|
||||
@@ -966,6 +996,7 @@ yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
|
||||
{
|
||||
yySemanticOption* yynewOption =
|
||||
&yynewGLRStackItem (yystackp, yyfalse)->yyoption;
|
||||
YYASSERT (!yynewOption->yyisState);
|
||||
yynewOption->yystate = yyrhs;
|
||||
yynewOption->yyrule = yyrule;
|
||||
if (yystackp->yytops.yylookaheadNeeds[yyk])
|
||||
@@ -993,7 +1024,7 @@ yyinitStateSet (yyGLRStateSet* yyset)
|
||||
yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
|
||||
if (! yyset->yystates)
|
||||
return yyfalse;
|
||||
yyset->yystates[0] = YY_NULL;
|
||||
yyset->yystates[0] = YY_NULLPTR;
|
||||
yyset->yylookaheadNeeds =
|
||||
(yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
|
||||
if (! yyset->yylookaheadNeeds)
|
||||
@@ -1023,8 +1054,8 @@ yyinitGLRStack (yyGLRStack* yystackp, size_t yysize)
|
||||
if (!yystackp->yyitems)
|
||||
return yyfalse;
|
||||
yystackp->yynextFree = yystackp->yyitems;
|
||||
yystackp->yysplitPoint = YY_NULL;
|
||||
yystackp->yylastDeleted = YY_NULL;
|
||||
yystackp->yysplitPoint = YY_NULLPTR;
|
||||
yystackp->yylastDeleted = YY_NULLPTR;
|
||||
return yyinitStateSet (&yystackp->yytops);
|
||||
}
|
||||
|
||||
@@ -1063,10 +1094,10 @@ yyexpandGLRStack (yyGLRStack* yystackp)
|
||||
{
|
||||
yyGLRState* yys0 = &yyp0->yystate;
|
||||
yyGLRState* yys1 = &yyp1->yystate;
|
||||
if (yys0->yypred != YY_NULL)
|
||||
if (yys0->yypred != YY_NULLPTR)
|
||||
yys1->yypred =
|
||||
YYRELOC (yyp0, yyp1, yys0->yypred, yystate);
|
||||
if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULL)
|
||||
if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULLPTR)
|
||||
yys1->yysemantics.yyfirstVal =
|
||||
YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption);
|
||||
}
|
||||
@@ -1074,18 +1105,18 @@ yyexpandGLRStack (yyGLRStack* yystackp)
|
||||
{
|
||||
yySemanticOption* yyv0 = &yyp0->yyoption;
|
||||
yySemanticOption* yyv1 = &yyp1->yyoption;
|
||||
if (yyv0->yystate != YY_NULL)
|
||||
if (yyv0->yystate != YY_NULLPTR)
|
||||
yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate);
|
||||
if (yyv0->yynext != YY_NULL)
|
||||
if (yyv0->yynext != YY_NULLPTR)
|
||||
yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption);
|
||||
}
|
||||
}
|
||||
if (yystackp->yysplitPoint != YY_NULL)
|
||||
if (yystackp->yysplitPoint != YY_NULLPTR)
|
||||
yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems,
|
||||
yystackp->yysplitPoint, yystate);
|
||||
yystackp->yysplitPoint, yystate);
|
||||
|
||||
for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1)
|
||||
if (yystackp->yytops.yystates[yyn] != YY_NULL)
|
||||
if (yystackp->yytops.yystates[yyn] != YY_NULLPTR)
|
||||
yystackp->yytops.yystates[yyn] =
|
||||
YYRELOC (yystackp->yyitems, yynewItems,
|
||||
yystackp->yytops.yystates[yyn], yystate);
|
||||
@@ -1109,7 +1140,7 @@ yyfreeGLRStack (yyGLRStack* yystackp)
|
||||
static inline void
|
||||
yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
|
||||
{
|
||||
if (yystackp->yysplitPoint != YY_NULL && yystackp->yysplitPoint > yys)
|
||||
if (yystackp->yysplitPoint != YY_NULLPTR && yystackp->yysplitPoint > yys)
|
||||
yystackp->yysplitPoint = yys;
|
||||
}
|
||||
|
||||
@@ -1117,9 +1148,9 @@ yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
|
||||
static inline void
|
||||
yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
|
||||
{
|
||||
if (yystackp->yytops.yystates[yyk] != YY_NULL)
|
||||
if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
||||
yystackp->yylastDeleted = yystackp->yytops.yystates[yyk];
|
||||
yystackp->yytops.yystates[yyk] = YY_NULL;
|
||||
yystackp->yytops.yystates[yyk] = YY_NULLPTR;
|
||||
}
|
||||
|
||||
/** Undelete the last stack in *YYSTACKP that was marked as deleted. Can
|
||||
@@ -1128,12 +1159,12 @@ yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
|
||||
static void
|
||||
yyundeleteLastStack (yyGLRStack* yystackp)
|
||||
{
|
||||
if (yystackp->yylastDeleted == YY_NULL || yystackp->yytops.yysize != 0)
|
||||
if (yystackp->yylastDeleted == YY_NULLPTR || yystackp->yytops.yysize != 0)
|
||||
return;
|
||||
yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
|
||||
yystackp->yytops.yysize = 1;
|
||||
YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
|
||||
yystackp->yylastDeleted = YY_NULL;
|
||||
yystackp->yylastDeleted = YY_NULLPTR;
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -1143,7 +1174,7 @@ yyremoveDeletes (yyGLRStack* yystackp)
|
||||
yyi = yyj = 0;
|
||||
while (yyj < yystackp->yytops.yysize)
|
||||
{
|
||||
if (yystackp->yytops.yystates[yyi] == YY_NULL)
|
||||
if (yystackp->yytops.yystates[yyi] == YY_NULLPTR)
|
||||
{
|
||||
if (yyi == yyj)
|
||||
{
|
||||
@@ -1201,12 +1232,13 @@ yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
|
||||
size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)
|
||||
{
|
||||
yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
|
||||
YYASSERT (yynewState->yyisState);
|
||||
|
||||
yynewState->yylrState = yylrState;
|
||||
yynewState->yyposn = yyposn;
|
||||
yynewState->yyresolved = yyfalse;
|
||||
yynewState->yypred = yystackp->yytops.yystates[yyk];
|
||||
yynewState->yysemantics.yyfirstVal = YY_NULL;
|
||||
yynewState->yysemantics.yyfirstVal = YY_NULLPTR;
|
||||
yystackp->yytops.yystates[yyk] = yynewState;
|
||||
|
||||
/* Invokes YY_RESERVE_GLRSTACK. */
|
||||
@@ -1266,7 +1298,7 @@ yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
{
|
||||
int yynrhs = yyrhsLength (yyrule);
|
||||
|
||||
if (yystackp->yysplitPoint == YY_NULL)
|
||||
if (yystackp->yysplitPoint == YY_NULLPTR)
|
||||
{
|
||||
/* Standard special case: single stack. */
|
||||
yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
|
||||
@@ -1318,14 +1350,13 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
{
|
||||
size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn;
|
||||
|
||||
if (yyforceEval || yystackp->yysplitPoint == YY_NULL)
|
||||
if (yyforceEval || yystackp->yysplitPoint == YY_NULLPTR)
|
||||
{
|
||||
YYRESULTTAG yyflag;
|
||||
YYSTYPE yysval;]b4_locations_if([
|
||||
YYLTYPE yyloc;])[
|
||||
YYSTYPE yysval;]b4_locations_if([[
|
||||
YYLTYPE yyloc;]])[
|
||||
|
||||
yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[);
|
||||
if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULL)
|
||||
YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[);
|
||||
if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n",
|
||||
(unsigned long int) yyk, yyrule - 1));
|
||||
@@ -1358,7 +1389,7 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
"Now in state %d.\n",
|
||||
(unsigned long int) yyk, yyrule - 1, yynewLRState));
|
||||
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
|
||||
if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULL)
|
||||
if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR)
|
||||
{
|
||||
yyGLRState *yysplit = yystackp->yysplitPoint;
|
||||
yyGLRState *yyp = yystackp->yytops.yystates[yyi];
|
||||
@@ -1385,7 +1416,7 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
static size_t
|
||||
yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
||||
{
|
||||
if (yystackp->yysplitPoint == YY_NULL)
|
||||
if (yystackp->yysplitPoint == YY_NULLPTR)
|
||||
{
|
||||
YYASSERT (yyk == 0);
|
||||
yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
|
||||
@@ -1395,7 +1426,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
||||
yyGLRState** yynewStates;
|
||||
yybool* yynewLookaheadNeeds;
|
||||
|
||||
yynewStates = YY_NULL;
|
||||
yynewStates = YY_NULLPTR;
|
||||
|
||||
if (yystackp->yytops.yycapacity
|
||||
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
|
||||
@@ -1406,7 +1437,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
||||
(yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
|
||||
(yystackp->yytops.yycapacity
|
||||
* sizeof yynewStates[0]));
|
||||
if (yynewStates == YY_NULL)
|
||||
if (yynewStates == YY_NULLPTR)
|
||||
yyMemoryExhausted (yystackp);
|
||||
yystackp->yytops.yystates = yynewStates;
|
||||
|
||||
@@ -1414,7 +1445,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
||||
(yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds,
|
||||
(yystackp->yytops.yycapacity
|
||||
* sizeof yynewLookaheadNeeds[0]));
|
||||
if (yynewLookaheadNeeds == YY_NULL)
|
||||
if (yynewLookaheadNeeds == YY_NULLPTR)
|
||||
yyMemoryExhausted (yystackp);
|
||||
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
|
||||
}
|
||||
@@ -1478,9 +1509,9 @@ yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
|
||||
yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal;
|
||||
while (yytrue)
|
||||
{
|
||||
if (yyz1 == *yyz0p || yyz1 == YY_NULL)
|
||||
if (yyz1 == *yyz0p || yyz1 == YY_NULLPTR)
|
||||
break;
|
||||
else if (*yyz0p == YY_NULL)
|
||||
else if (*yyz0p == YY_NULLPTR)
|
||||
{
|
||||
*yyz0p = yyz1;
|
||||
break;
|
||||
@@ -1601,7 +1632,7 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
|
||||
|
||||
for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
|
||||
yystates[yyi] = yys;
|
||||
if (yys == YY_NULL)
|
||||
if (yys == YY_NULLPTR)
|
||||
{
|
||||
yyleftmost_state.yyposn = 0;
|
||||
yystates[0] = &yyleftmost_state;
|
||||
@@ -1661,7 +1692,7 @@ yyreportAmbiguity (yySemanticOption* yyx0,
|
||||
* ending at YYS1. Has no effect on previously resolved states.
|
||||
* The first semantic option of a state is always chosen. */
|
||||
static void
|
||||
yyresolveLocations (yyGLRState* yys1, int yyn1,
|
||||
yyresolveLocations (yyGLRState *yys1, int yyn1,
|
||||
yyGLRStack *yystackp]b4_user_formals[)
|
||||
{
|
||||
if (0 < yyn1)
|
||||
@@ -1672,9 +1703,9 @@ yyresolveLocations (yyGLRState* yys1, int yyn1,
|
||||
yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
|
||||
int yynrhs;
|
||||
yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
|
||||
YYASSERT (yyoption != YY_NULL);
|
||||
YYASSERT (yyoption);
|
||||
yynrhs = yyrhsLength (yyoption->yyrule);
|
||||
if (yynrhs > 0)
|
||||
if (0 < yynrhs)
|
||||
{
|
||||
yyGLRState *yys;
|
||||
int yyn;
|
||||
@@ -1697,18 +1728,7 @@ yyresolveLocations (yyGLRState* yys1, int yyn1,
|
||||
yyGLRState *yyprevious = yyoption->yystate;
|
||||
yyrhsloc[0].yystate.yyloc = yyprevious->yyloc;
|
||||
}
|
||||
{
|
||||
int yychar_current = yychar;
|
||||
YYSTYPE yylval_current = yylval;
|
||||
YYLTYPE yylloc_current = yylloc;
|
||||
yychar = yyoption->yyrawchar;
|
||||
yylval = yyoption->yyval;
|
||||
yylloc = yyoption->yyloc;
|
||||
YYLLOC_DEFAULT ((yys1->yyloc), yyrhsloc, yynrhs);
|
||||
yychar = yychar_current;
|
||||
yylval = yylval_current;
|
||||
yylloc = yylloc_current;
|
||||
}
|
||||
YYLLOC_DEFAULT ((yys1->yyloc), yyrhsloc, yynrhs);
|
||||
}
|
||||
}
|
||||
}]])[
|
||||
@@ -1731,7 +1751,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
||||
YYRESULTTAG yyflag;]b4_locations_if([
|
||||
YYLTYPE *yylocp = &yys->yyloc;])[
|
||||
|
||||
for (yypp = &yyoptionList->yynext; *yypp != YY_NULL; )
|
||||
for (yypp = &yyoptionList->yynext; *yypp != YY_NULLPTR; )
|
||||
{
|
||||
yySemanticOption* yyp = *yypp;
|
||||
|
||||
@@ -1773,7 +1793,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
||||
int yyprec = yydprec[yybest->yyrule];
|
||||
yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args[);
|
||||
if (yyflag == yyok)
|
||||
for (yyp = yybest->yynext; yyp != YY_NULL; yyp = yyp->yynext)
|
||||
for (yyp = yybest->yynext; yyp != YY_NULLPTR; yyp = yyp->yynext)
|
||||
{
|
||||
if (yyprec == yydprec[yyp->yyrule])
|
||||
{
|
||||
@@ -1800,14 +1820,14 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
||||
yys->yysemantics.yysval = yysval;
|
||||
}
|
||||
else
|
||||
yys->yysemantics.yyfirstVal = YY_NULL;
|
||||
yys->yysemantics.yyfirstVal = YY_NULLPTR;
|
||||
return yyflag;
|
||||
}
|
||||
|
||||
static YYRESULTTAG
|
||||
yyresolveStack (yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
if (yystackp->yysplitPoint != YY_NULL)
|
||||
if (yystackp->yysplitPoint != YY_NULLPTR)
|
||||
{
|
||||
yyGLRState* yys;
|
||||
int yyn;
|
||||
@@ -1827,10 +1847,10 @@ yycompressStack (yyGLRStack* yystackp)
|
||||
{
|
||||
yyGLRState* yyp, *yyq, *yyr;
|
||||
|
||||
if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULL)
|
||||
if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULLPTR)
|
||||
return;
|
||||
|
||||
for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULL;
|
||||
for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULLPTR;
|
||||
yyp != yystackp->yysplitPoint;
|
||||
yyr = yyp, yyp = yyq, yyq = yyp->yypred)
|
||||
yyp->yypred = yyr;
|
||||
@@ -1838,10 +1858,10 @@ yycompressStack (yyGLRStack* yystackp)
|
||||
yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
|
||||
yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1;
|
||||
yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
|
||||
yystackp->yysplitPoint = YY_NULL;
|
||||
yystackp->yylastDeleted = YY_NULL;
|
||||
yystackp->yysplitPoint = YY_NULLPTR;
|
||||
yystackp->yylastDeleted = YY_NULLPTR;
|
||||
|
||||
while (yyr != YY_NULL)
|
||||
while (yyr != YY_NULLPTR)
|
||||
{
|
||||
yystackp->yynextFree->yystate = *yyr;
|
||||
yyr = yyr->yypred;
|
||||
@@ -1856,7 +1876,7 @@ static YYRESULTTAG
|
||||
yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
|
||||
size_t yyposn]b4_pure_formals[)
|
||||
{
|
||||
while (yystackp->yytops.yystates[yyk] != YY_NULL)
|
||||
while (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
||||
{
|
||||
yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
|
||||
YYDPRINTF ((stderr, "Stack %lu Entering state %d\n",
|
||||
@@ -1978,13 +1998,13 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
#else
|
||||
{
|
||||
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
|
||||
size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken));
|
||||
size_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
|
||||
size_t yysize = yysize0;
|
||||
yybool yysize_overflow = yyfalse;
|
||||
char* yymsg = YY_NULL;
|
||||
char* yymsg = YY_NULLPTR;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = YY_NULL;
|
||||
const char *yyformat = YY_NULLPTR;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
@@ -2040,7 +2060,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
}
|
||||
yyarg[yycount++] = yytokenName (yyx);
|
||||
{
|
||||
size_t yysz = yysize + yytnamerr (YY_NULL, yytokenName (yyx));
|
||||
size_t yysz = yysize + yytnamerr (YY_NULLPTR, yytokenName (yyx));
|
||||
yysize_overflow |= yysz < yysize;
|
||||
yysize = yysz;
|
||||
}
|
||||
@@ -2118,7 +2138,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
yySymbol yytoken;
|
||||
if (yychar == YYEOF)
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULL);
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
|
||||
if (yychar != YYEMPTY)
|
||||
{]b4_locations_if([[
|
||||
/* We throw away the lookahead, but the error range
|
||||
@@ -2159,10 +2179,10 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
|
||||
/* Reduce to one stack. */
|
||||
for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
|
||||
if (yystackp->yytops.yystates[yyk] != YY_NULL)
|
||||
if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
||||
break;
|
||||
if (yyk >= yystackp->yytops.yysize)
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULL);
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
|
||||
for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
|
||||
yymarkStackDeleted (yystackp, yyk);
|
||||
yyremoveDeletes (yystackp);
|
||||
@@ -2170,7 +2190,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
|
||||
/* Now pop stack until we find a state that shifts the error token. */
|
||||
yystackp->yyerrState = 3;
|
||||
while (yystackp->yytops.yystates[0] != YY_NULL)
|
||||
while (yystackp->yytops.yystates[0] != YY_NULLPTR)
|
||||
{
|
||||
yyGLRState *yys = yystackp->yytops.yystates[0];
|
||||
yyj = yypact[yys->yylrState];
|
||||
@@ -2194,14 +2214,14 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
}
|
||||
}]b4_locations_if([[
|
||||
yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;]])[
|
||||
if (yys->yypred != YY_NULL)
|
||||
if (yys->yypred != YY_NULLPTR)
|
||||
yydestroyGLRState ("Error: popping", yys]b4_user_args[);
|
||||
yystackp->yytops.yystates[0] = yys->yypred;
|
||||
yystackp->yynextFree -= 1;
|
||||
yystackp->yyspaceLeft += 1;
|
||||
}
|
||||
if (yystackp->yytops.yystates[0] == YY_NULL)
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULL);
|
||||
if (yystackp->yytops.yystates[0] == YY_NULLPTR)
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
|
||||
}
|
||||
|
||||
#define YYCHK1(YYE) \
|
||||
@@ -2444,7 +2464,7 @@ b4_dollar_popdef])[]dnl
|
||||
{
|
||||
yyGLRState *yys = yystates[yyk];
|
||||
]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]]
|
||||
)[ if (yys->yypred != YY_NULL)
|
||||
)[ if (yys->yypred != YY_NULLPTR)
|
||||
yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[);
|
||||
yystates[yyk] = yys->yypred;
|
||||
yystack.yynextFree -= 1;
|
||||
@@ -2476,7 +2496,7 @@ yy_yypstack (yyGLRState* yys)
|
||||
static void
|
||||
yypstates (yyGLRState* yyst)
|
||||
{
|
||||
if (yyst == YY_NULL)
|
||||
if (yyst == YY_NULLPTR)
|
||||
YYFPRINTF (stderr, "<null>");
|
||||
else
|
||||
yy_yypstack (yyst);
|
||||
@@ -2490,7 +2510,7 @@ yypstack (yyGLRStack* yystackp, size_t yyk)
|
||||
}
|
||||
|
||||
#define YYINDEX(YYX) \
|
||||
((YYX) == YY_NULL ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
|
||||
((YYX) == YY_NULLPTR ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
|
||||
|
||||
|
||||
static void
|
||||
@@ -2504,6 +2524,8 @@ yypdumpstack (yyGLRStack* yystackp)
|
||||
(unsigned long int) (yyp - yystackp->yyitems));
|
||||
if (*(yybool *) yyp)
|
||||
{
|
||||
YYASSERT (yyp->yystate.yyisState);
|
||||
YYASSERT (yyp->yyoption.yyisState);
|
||||
YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
|
||||
yyp->yystate.yyresolved, yyp->yystate.yylrState,
|
||||
(unsigned long int) yyp->yystate.yyposn,
|
||||
@@ -2515,6 +2537,8 @@ yypdumpstack (yyGLRStack* yystackp)
|
||||
}
|
||||
else
|
||||
{
|
||||
YYASSERT (!yyp->yystate.yyisState);
|
||||
YYASSERT (!yyp->yyoption.yyisState);
|
||||
YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
|
||||
yyp->yyoption.yyrule - 1,
|
||||
(long int) YYINDEX (yyp->yyoption.yystate),
|
||||
@@ -2548,16 +2572,3 @@ m4_if(b4_prefix, [yy], [],
|
||||
|
||||
]b4_epilogue[]dnl
|
||||
b4_output_end()
|
||||
|
||||
# glr.cc produces its own header.
|
||||
m4_if(b4_skeleton, ["glr.c"],
|
||||
[b4_defines_if(
|
||||
[b4_output_begin([b4_spec_defines_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
[2002-2013])[
|
||||
|
||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||
]b4_shared_declarations[
|
||||
]b4_cpp_guard_close([b4_spec_defines_file])[
|
||||
]b4_output_end()
|
||||
])])
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# C++ GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015 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
|
||||
@@ -329,7 +329,7 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||
b4_defines_if(
|
||||
[b4_output_begin([b4_spec_defines_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
[2002-2013])[
|
||||
[2002-2015])[
|
||||
|
||||
// C++ GLR parser skeleton written by Akim Demaille.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# Java skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007, 2009-2015 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-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2015 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
|
||||
|
||||
+108
-97
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015 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
|
||||
@@ -131,7 +131,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
|
||||
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2013])
|
||||
[2002-2015])
|
||||
|
||||
m4_define([b4_parser_class_name],
|
||||
[b4_percent_define_get([[parser_class_name]])])
|
||||
@@ -149,14 +149,16 @@ b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])])
|
||||
m4_define([b4_shared_declarations],
|
||||
[b4_percent_code_get([[requires]])[
|
||||
]b4_parse_assert_if([# include <cassert>])[
|
||||
# include <vector>
|
||||
# include <cstdlib> // std::abort
|
||||
# include <iostream>
|
||||
# include <stdexcept>
|
||||
# include <string>]b4_defines_if([[
|
||||
# include <string>
|
||||
# include <vector>]b4_defines_if([[
|
||||
# include "stack.hh"
|
||||
]b4_bison_locations_if([[# include "location.hh"]])])[
|
||||
]b4_variant_if([b4_variant_includes])[
|
||||
|
||||
]b4_attribute_define[
|
||||
]b4_YYDEBUG_define[
|
||||
|
||||
]b4_namespace_open[
|
||||
@@ -183,14 +185,14 @@ b4_location_define])])[
|
||||
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
/// The current debugging stream.
|
||||
std::ostream& debug_stream () const;
|
||||
std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
|
||||
/// Set the current debugging stream.
|
||||
void set_debug_stream (std::ostream &);
|
||||
|
||||
/// Type for debugging levels.
|
||||
typedef int debug_level_type;
|
||||
/// The current debugging level.
|
||||
debug_level_type debug_level () const;
|
||||
debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
|
||||
/// Set the current debugging level.
|
||||
void set_debug_level (debug_level_type l);
|
||||
#endif
|
||||
@@ -213,14 +215,14 @@ b4_location_define])])[
|
||||
|
||||
/// Generate an error message.
|
||||
/// \param yystate the state where the error occurred.
|
||||
/// \param yytoken the lookahead token type, or yyempty_.
|
||||
/// \param yyla the lookahead token.
|
||||
virtual std::string yysyntax_error_ (state_type yystate,
|
||||
symbol_number_type yytoken) const;
|
||||
const symbol_type& yyla) const;
|
||||
|
||||
/// Compute post-reduction state.
|
||||
/// \param yystate the current state
|
||||
/// \param yylhs the nonterminal to push on the stack
|
||||
state_type yy_lr_goto_state_ (state_type yystate, int yylhs);
|
||||
/// \param yysym the nonterminal to push on the stack
|
||||
state_type yy_lr_goto_state_ (state_type yystate, int yysym);
|
||||
|
||||
/// Whether the given \c yypact_ value indicates a defaulted state.
|
||||
/// \param yyvalue the value to check
|
||||
@@ -267,7 +269,7 @@ b4_location_define])])[
|
||||
/// \brief Reclaim the memory associated to a symbol.
|
||||
/// \param yymsg Why this token is reclaimed.
|
||||
/// If null, print nothing.
|
||||
/// \param s The symbol.
|
||||
/// \param yysym The symbol.
|
||||
template <typename Base>
|
||||
void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
|
||||
|
||||
@@ -287,16 +289,21 @@ b4_location_define])])[
|
||||
/// Copy constructor.
|
||||
by_state (const by_state& other);
|
||||
|
||||
/// Record that this symbol is empty.
|
||||
void clear ();
|
||||
|
||||
/// Steal the symbol type from \a that.
|
||||
void move (by_state& that);
|
||||
|
||||
/// The (internal) type number (corresponding to \a state).
|
||||
/// "empty" when empty.
|
||||
/// \a empty_symbol when empty.
|
||||
symbol_number_type type_get () const;
|
||||
|
||||
enum { empty = 0 };
|
||||
/// The state number used to denote an empty symbol.
|
||||
enum { empty_state = -1 };
|
||||
|
||||
/// The state.
|
||||
/// \a empty when empty.
|
||||
state_type state;
|
||||
};
|
||||
|
||||
@@ -337,17 +344,16 @@ b4_location_define])])[
|
||||
/// Pop \a n symbols the three stacks.
|
||||
void yypop_ (unsigned int n = 1);
|
||||
|
||||
// Constants.
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yyeof_ = 0,
|
||||
yylast_ = ]b4_last[, //< Last index in yytable_.
|
||||
yynnts_ = ]b4_nterms_number[, //< Number of nonterminal symbols.
|
||||
yyempty_ = -2,
|
||||
yyfinal_ = ]b4_final_state_number[, //< Termination state number.
|
||||
yylast_ = ]b4_last[, ///< Last index in yytable_.
|
||||
yynnts_ = ]b4_nterms_number[, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = ]b4_final_state_number[, ///< Termination state number.
|
||||
yyterror_ = 1,
|
||||
yyerrcode_ = 256,
|
||||
yyntokens_ = ]b4_tokens_number[ //< Number of tokens.
|
||||
yyntokens_ = ]b4_tokens_number[ ///< Number of tokens.
|
||||
};
|
||||
|
||||
]b4_parse_param_vars[
|
||||
@@ -463,7 +469,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
#endif // !]b4_api_PREFIX[DEBUG
|
||||
|
||||
#define yyerrok (yyerrstatus_ = 0)
|
||||
#define yyclearin (yyempty = true)
|
||||
#define yyclearin (yyla.clear ())
|
||||
|
||||
#define YYACCEPT goto yyacceptlab
|
||||
#define YYABORT goto yyabortlab
|
||||
@@ -532,7 +538,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
// by_state.
|
||||
inline
|
||||
]b4_parser_class_name[::by_state::by_state ()
|
||||
: state (empty)
|
||||
: state (empty_state)
|
||||
{}
|
||||
|
||||
inline
|
||||
@@ -540,12 +546,19 @@ m4_if(b4_prefix, [yy], [],
|
||||
: state (other.state)
|
||||
{}
|
||||
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::by_state::clear ()
|
||||
{
|
||||
state = empty_state;
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::by_state::move (by_state& that)
|
||||
{
|
||||
state = that.state;
|
||||
that.state = empty;
|
||||
that.clear ();
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -557,7 +570,10 @@ m4_if(b4_prefix, [yy], [],
|
||||
]b4_parser_class_name[::symbol_number_type
|
||||
]b4_parser_class_name[::by_state::type_get () const
|
||||
{
|
||||
return state == empty ? 0 : yystos_[state];
|
||||
if (state == empty_state)
|
||||
return empty_symbol;
|
||||
else
|
||||
return yystos_[state];
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -573,7 +589,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
[value], [move], [that.value])],
|
||||
[[value = that.value;]])[
|
||||
// that is emptied.
|
||||
that.type = empty;
|
||||
that.type = empty_symbol;
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -610,6 +626,10 @@ m4_if(b4_prefix, [yy], [],
|
||||
std::ostream& yyoutput = yyo;
|
||||
YYUSE (yyoutput);
|
||||
symbol_number_type yytype = yysym.type_get ();
|
||||
// Avoid a (spurious) G++ 4.8 warning about "array subscript is
|
||||
// below array bounds".
|
||||
if (yysym.empty ())
|
||||
std::abort ();
|
||||
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
||||
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
||||
<< yysym.location << ": "])[;
|
||||
@@ -670,13 +690,13 @@ m4_if(b4_prefix, [yy], [],
|
||||
#endif // ]b4_api_PREFIX[DEBUG
|
||||
|
||||
inline ]b4_parser_class_name[::state_type
|
||||
]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yylhs)
|
||||
]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yysym)
|
||||
{
|
||||
int yyr = yypgoto_[yylhs - yyntokens_] + yystate;
|
||||
int yyr = yypgoto_[yysym - yyntokens_] + yystate;
|
||||
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
|
||||
return yytable_[yyr];
|
||||
else
|
||||
return yydefgoto_[yylhs - yyntokens_];
|
||||
return yydefgoto_[yysym - yyntokens_];
|
||||
}
|
||||
|
||||
inline bool
|
||||
@@ -694,11 +714,9 @@ m4_if(b4_prefix, [yy], [],
|
||||
int
|
||||
]b4_parser_class_name[::parse ()
|
||||
{
|
||||
/// Whether yyla contains a lookahead.
|
||||
bool yyempty = true;
|
||||
|
||||
// State.
|
||||
int yyn;
|
||||
/// Length of the RHS of the rule being reduced.
|
||||
int yylen = 0;
|
||||
|
||||
// Error handling.
|
||||
@@ -711,9 +729,6 @@ m4_if(b4_prefix, [yy], [],
|
||||
/// The locations where the error started and ended.
|
||||
stack_symbol_type yyerror_range[3];]])[
|
||||
|
||||
/// $$ and @@$.
|
||||
stack_symbol_type yylhs;
|
||||
|
||||
/// The return value of parse ().
|
||||
int yyresult;
|
||||
|
||||
@@ -734,7 +749,7 @@ b4_dollar_popdef])[]dnl
|
||||
location values to have been already stored, initialize these
|
||||
stacks with a primary value. */
|
||||
yystack_.clear ();
|
||||
yypush_ (YY_NULL, 0, yyla);
|
||||
yypush_ (YY_NULLPTR, 0, yyla);
|
||||
|
||||
// A new symbol was pushed on the stack.
|
||||
yynewstate:
|
||||
@@ -755,7 +770,7 @@ b4_dollar_popdef])[]dnl
|
||||
goto yydefault;
|
||||
|
||||
// Read a lookahead token.
|
||||
if (yyempty)
|
||||
if (yyla.empty ())
|
||||
{
|
||||
YYCDEBUG << "Reading a token: ";
|
||||
try
|
||||
@@ -769,7 +784,6 @@ b4_dollar_popdef])[]dnl
|
||||
error (yyexc);
|
||||
goto yyerrlab1;
|
||||
}
|
||||
yyempty = false;
|
||||
}
|
||||
YY_SYMBOL_PRINT ("Next token is", yyla);
|
||||
|
||||
@@ -789,9 +803,6 @@ b4_dollar_popdef])[]dnl
|
||||
goto yyreduce;
|
||||
}
|
||||
|
||||
// Discard the token being shifted.
|
||||
yyempty = true;
|
||||
|
||||
// Count tokens shifted since error; after three, turn off error status.
|
||||
if (yyerrstatus_)
|
||||
--yyerrstatus_;
|
||||
@@ -814,52 +825,55 @@ b4_dollar_popdef])[]dnl
|
||||
`-----------------------------*/
|
||||
yyreduce:
|
||||
yylen = yyr2_[yyn];
|
||||
yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([
|
||||
/* Variants are always initialized to an empty instance of the
|
||||
correct type. The default $$=$1 action is NOT applied when using
|
||||
variants. */
|
||||
b4_symbol_variant([[yyr1_@{yyn@}]], [yylhs.value], [build])],[
|
||||
/* If YYLEN is nonzero, implement the default value of the action:
|
||||
'$$ = $1'. Otherwise, use the top of the stack.
|
||||
{
|
||||
stack_symbol_type yylhs;
|
||||
yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([
|
||||
/* Variants are always initialized to an empty instance of the
|
||||
correct type. The default '$$ = $1' action is NOT applied
|
||||
when using variants. */
|
||||
b4_symbol_variant([[yyr1_@{yyn@}]], [yylhs.value], [build])], [
|
||||
/* If YYLEN is nonzero, implement the default value of the
|
||||
action: '$$ = $1'. Otherwise, use the top of the stack.
|
||||
|
||||
Otherwise, the following line sets YYLHS.VALUE to garbage.
|
||||
This behavior is undocumented and Bison
|
||||
users should not rely upon it. */
|
||||
if (yylen)
|
||||
yylhs.value = yystack_@{yylen - 1@}.value;
|
||||
else
|
||||
yylhs.value = yystack_@{0@}.value;])[
|
||||
Otherwise, the following line sets YYLHS.VALUE to garbage.
|
||||
This behavior is undocumented and Bison users should not rely
|
||||
upon it. */
|
||||
if (yylen)
|
||||
yylhs.value = yystack_@{yylen - 1@}.value;
|
||||
else
|
||||
yylhs.value = yystack_@{0@}.value;])[
|
||||
]b4_locations_if([dnl
|
||||
[
|
||||
// Compute the default @@$.
|
||||
{
|
||||
slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
|
||||
YYLLOC_DEFAULT (yylhs.location, slice, yylen);
|
||||
}]])[
|
||||
|
||||
// Perform the reduction.
|
||||
YY_REDUCE_PRINT (yyn);
|
||||
try
|
||||
// Compute the default @@$.
|
||||
{
|
||||
switch (yyn)
|
||||
{
|
||||
slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
|
||||
YYLLOC_DEFAULT (yylhs.location, slice, yylen);
|
||||
}]])[
|
||||
|
||||
// Perform the reduction.
|
||||
YY_REDUCE_PRINT (yyn);
|
||||
try
|
||||
{
|
||||
switch (yyn)
|
||||
{
|
||||
]b4_user_actions[
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (const syntax_error& yyexc)
|
||||
{
|
||||
error (yyexc);
|
||||
YYERROR;
|
||||
}
|
||||
YY_SYMBOL_PRINT ("-> $$ =", yylhs);
|
||||
yypop_ (yylen);
|
||||
yylen = 0;
|
||||
YY_STACK_PRINT ();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (const syntax_error& yyexc)
|
||||
{
|
||||
error (yyexc);
|
||||
YYERROR;
|
||||
}
|
||||
YY_SYMBOL_PRINT ("-> $$ =", yylhs);
|
||||
yypop_ (yylen);
|
||||
yylen = 0;
|
||||
YY_STACK_PRINT ();
|
||||
|
||||
// Shift the result of the reduction.
|
||||
yypush_ (YY_NULL, yylhs);
|
||||
// Shift the result of the reduction.
|
||||
yypush_ (YY_NULLPTR, yylhs);
|
||||
}
|
||||
goto yynewstate;
|
||||
|
||||
/*--------------------------------------.
|
||||
@@ -871,8 +885,7 @@ b4_dollar_popdef])[]dnl
|
||||
{
|
||||
++yynerrs_;
|
||||
error (]b4_join(b4_locations_if([yyla.location]),
|
||||
[[yysyntax_error_ (yystack_[0].state,
|
||||
yyempty ? yyempty_ : yyla.type_get ())]])[);
|
||||
[[yysyntax_error_ (yystack_[0].state, yyla)]])[);
|
||||
}
|
||||
|
||||
]b4_locations_if([[
|
||||
@@ -885,10 +898,10 @@ b4_dollar_popdef])[]dnl
|
||||
// Return failure if at end of input.
|
||||
if (yyla.type_get () == yyeof_)
|
||||
YYABORT;
|
||||
else if (!yyempty)
|
||||
else if (!yyla.empty ())
|
||||
{
|
||||
yy_destroy_ ("Error: discarding", yyla);
|
||||
yyempty = true;
|
||||
yyla.clear ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -906,10 +919,7 @@ b4_dollar_popdef])[]dnl
|
||||
code. */
|
||||
if (false)
|
||||
goto yyerrorlab;]b4_locations_if([[
|
||||
yyerror_range[1].location = yystack_[yylen - 1].location;]])b4_variant_if([[
|
||||
/* $$ was initialized before running the user action. */
|
||||
YY_SYMBOL_PRINT ("Error: discarding", yylhs);
|
||||
yylhs.~stack_symbol_type();]])[
|
||||
yyerror_range[1].location = yystack_[yylen - 1].location;]])[
|
||||
/* Do not reclaim the symbols of the rule whose action triggered
|
||||
this YYERROR. */
|
||||
yypop_ (yylen);
|
||||
@@ -967,7 +977,7 @@ b4_dollar_popdef])[]dnl
|
||||
goto yyreturn;
|
||||
|
||||
yyreturn:
|
||||
if (!yyempty)
|
||||
if (!yyla.empty ())
|
||||
yy_destroy_ ("Cleanup: discarding lookahead", yyla);
|
||||
|
||||
/* Do not reclaim the symbols of the rule whose action triggered
|
||||
@@ -987,12 +997,12 @@ b4_dollar_popdef])[]dnl
|
||||
<< std::endl;
|
||||
// Do not try to display the values of the reclaimed symbols,
|
||||
// as their printer might throw an exception.
|
||||
if (!yyempty)
|
||||
yy_destroy_ (YY_NULL, yyla);
|
||||
if (!yyla.empty ())
|
||||
yy_destroy_ (YY_NULLPTR, yyla);
|
||||
|
||||
while (1 < yystack_.size ())
|
||||
{
|
||||
yy_destroy_ (YY_NULL, yystack_[0]);
|
||||
yy_destroy_ (YY_NULLPTR, yystack_[0]);
|
||||
yypop_ ();
|
||||
}
|
||||
throw;
|
||||
@@ -1009,10 +1019,9 @@ b4_dollar_popdef])[]dnl
|
||||
// Generate an error message.
|
||||
std::string
|
||||
]b4_parser_class_name[::yysyntax_error_ (]dnl
|
||||
b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
||||
[state_type, symbol_number_type])[) const
|
||||
b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
|
||||
[state_type, const symbol_type&])[) const
|
||||
{]b4_error_verbose_if([[
|
||||
std::string yyres;
|
||||
// Number of reported tokens (one for the "unexpected", one per
|
||||
// "expected").
|
||||
size_t yycount = 0;
|
||||
@@ -1026,7 +1035,7 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
||||
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
|
||||
- The only way there can be no lookahead present (in yyla) 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
|
||||
@@ -1046,8 +1055,9 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
||||
token that will not be accepted due to an error action in a
|
||||
later state.
|
||||
*/
|
||||
if (yytoken != yyempty_)
|
||||
if (!yyla.empty ())
|
||||
{
|
||||
int yytoken = yyla.type_get ();
|
||||
yyarg[yycount++] = yytname_[yytoken];
|
||||
int yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
@@ -1074,7 +1084,7 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
||||
}
|
||||
}
|
||||
|
||||
char const* yyformat = YY_NULL;
|
||||
char const* yyformat = YY_NULLPTR;
|
||||
switch (yycount)
|
||||
{
|
||||
#define YYCASE_(N, S) \
|
||||
@@ -1090,6 +1100,7 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
||||
#undef YYCASE_
|
||||
}
|
||||
|
||||
std::string yyres;
|
||||
// Argument number.
|
||||
size_t yyi = 0;
|
||||
for (char const* yyp = yyformat; *yyp; ++yyp)
|
||||
|
||||
+16
-10
@@ -1,6 +1,6 @@
|
||||
# Java skeleton for Bison -*- autoconf -*-
|
||||
|
||||
# Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2015 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
|
||||
@@ -84,7 +84,7 @@ m4_define([b4_define_state],[[
|
||||
|
||||
b4_output_begin([b4_parser_file_name])
|
||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
||||
[2007-2013])
|
||||
[2007-2015])
|
||||
|
||||
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
||||
])[/* First part of user declarations. */
|
||||
@@ -453,6 +453,19 @@ b4_define_state])[
|
||||
return yyerrstatus_ == 0;
|
||||
}
|
||||
|
||||
/** Compute post-reduction state.
|
||||
* @@param yystate the current state
|
||||
* @@param yysym the nonterminal to push on the stack
|
||||
*/
|
||||
private int yy_lr_goto_state_ (int yystate, int yysym)
|
||||
{
|
||||
int yyr = yypgoto_[yysym - yyntokens_] + yystate;
|
||||
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
|
||||
return yytable_[yyr];
|
||||
else
|
||||
return yydefgoto_[yysym - yyntokens_];
|
||||
}
|
||||
|
||||
private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[
|
||||
{
|
||||
]b4_yystype[ yyval;
|
||||
@@ -483,14 +496,7 @@ b4_define_state])[
|
||||
yylen = 0;
|
||||
|
||||
/* Shift the result of the reduction. */
|
||||
yyn = yyr1_[yyn];
|
||||
int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
|
||||
if (0 <= yystate && yystate <= yylast_
|
||||
&& yycheck_[yystate] == yystack.stateAt (0))
|
||||
yystate = yytable_[yystate];
|
||||
else
|
||||
yystate = yydefgoto_[yyn - yyntokens_];
|
||||
|
||||
int yystate = yy_lr_goto_state_ (yystack.stateAt (0), yyr1_[yyn]);
|
||||
yystack.push (yystate, yyval]b4_locations_if([, yyloc])[);
|
||||
return YYNEWSTATE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2002, 2005-2013 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2002, 2005-2015 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
-19
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2013])
|
||||
[2002-2015])
|
||||
|
||||
# b4_position_define
|
||||
# ------------------
|
||||
@@ -27,7 +27,7 @@ m4_define([b4_position_define],
|
||||
{
|
||||
public:]m4_ifdef([b4_location_constructors], [[
|
||||
/// Construct a position.
|
||||
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
||||
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
|
||||
unsigned int l = ]b4_location_initial_line[u,
|
||||
unsigned int c = ]b4_location_initial_column[u)
|
||||
: filename (f)
|
||||
@@ -38,7 +38,7 @@ m4_define([b4_position_define],
|
||||
|
||||
]])[
|
||||
/// Initialization.
|
||||
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL,
|
||||
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULLPTR,
|
||||
unsigned int l = ]b4_location_initial_line[u,
|
||||
unsigned int c = ]b4_location_initial_column[u)
|
||||
{
|
||||
@@ -83,7 +83,7 @@ m4_define([b4_position_define],
|
||||
}
|
||||
};
|
||||
|
||||
/// Add and assign a position.
|
||||
/// Add \a width columns, in place.
|
||||
inline position&
|
||||
operator+= (position& res, int width)
|
||||
{
|
||||
@@ -91,21 +91,21 @@ m4_define([b4_position_define],
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add two position objects.
|
||||
/// Add \a width columns.
|
||||
inline position
|
||||
operator+ (position res, int width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Add and assign a position.
|
||||
/// Subtract \a width columns, in place.
|
||||
inline position&
|
||||
operator-= (position& res, int width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Add two position objects.
|
||||
/// Subtract \a width columns.
|
||||
inline position
|
||||
operator- (position res, int width)
|
||||
{
|
||||
@@ -178,7 +178,7 @@ m4_define([b4_location_define],
|
||||
|
||||
])[
|
||||
/// Initialization.
|
||||
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
||||
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
|
||||
unsigned int l = ]b4_location_initial_line[u,
|
||||
unsigned int c = ]b4_location_initial_column[u)
|
||||
{
|
||||
@@ -216,36 +216,42 @@ m4_define([b4_location_define],
|
||||
position end;
|
||||
};
|
||||
|
||||
/// Join two location objects to create a location.
|
||||
inline location operator+ (location res, const location& end)
|
||||
/// Join two locations, in place.
|
||||
inline location& operator+= (location& res, const location& end)
|
||||
{
|
||||
res.end = end.end;
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Change end position in place.
|
||||
/// Join two locations.
|
||||
inline location operator+ (location res, const location& end)
|
||||
{
|
||||
return res += end;
|
||||
}
|
||||
|
||||
/// Add \a width columns to the end position, in place.
|
||||
inline location& operator+= (location& res, int width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Change end position.
|
||||
/// Add \a width columns to the end position.
|
||||
inline location operator+ (location res, int width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Change end position in place.
|
||||
/// Subtract \a width columns to the end position, in place.
|
||||
inline location& operator-= (location& res, int width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Change end position.
|
||||
inline location operator- (const location& begin, int width)
|
||||
/// Subtract \a width columns to the end position.
|
||||
inline location operator- (location res, int width)
|
||||
{
|
||||
return begin + -width;
|
||||
return res -= width;
|
||||
}
|
||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||
/// Compare two location objects.
|
||||
@@ -273,8 +279,7 @@ m4_define([b4_location_define],
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
|
||||
{
|
||||
unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
|
||||
ostr << loc.begin// << "(" << loc.end << ") "
|
||||
;
|
||||
ostr << loc.begin;
|
||||
if (loc.end.filename
|
||||
&& (!loc.begin.filename
|
||||
|| *loc.begin.filename != *loc.end.filename))
|
||||
|
||||
+5
-6
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2013])
|
||||
[2002-2015])
|
||||
|
||||
# b4_stack_define
|
||||
# ---------------
|
||||
@@ -32,12 +32,12 @@ m4_define([b4_stack_define],
|
||||
stack ()
|
||||
: seq_ ()
|
||||
{
|
||||
seq_.reserve (200);
|
||||
}
|
||||
|
||||
stack (unsigned int n)
|
||||
: seq_ (n)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
inline
|
||||
T&
|
||||
@@ -114,8 +114,7 @@ m4_define([b4_stack_define],
|
||||
slice (const S& stack, unsigned int range)
|
||||
: stack_ (stack)
|
||||
, range_ (range)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
inline
|
||||
const T&
|
||||
|
||||
+15
-17
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015 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
|
||||
@@ -95,13 +95,13 @@ m4_define([b4_variant_define],
|
||||
|
||||
/// Empty construction.
|
||||
variant ()]b4_parse_assert_if([
|
||||
: yytname_ (YY_NULL)])[
|
||||
: yytypeid_ (YY_NULLPTR)])[
|
||||
{}
|
||||
|
||||
/// Construct and fill.
|
||||
template <typename T>
|
||||
variant (const T& t)]b4_parse_assert_if([
|
||||
: yytname_ (typeid (T).name ())])[
|
||||
: yytypeid_ (&typeid (T))])[
|
||||
{
|
||||
YYASSERT (sizeof (T) <= S);
|
||||
new (yyas_<T> ()) T (t);
|
||||
@@ -110,7 +110,7 @@ m4_define([b4_variant_define],
|
||||
/// Destruction, allowed only if empty.
|
||||
~variant ()
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytname_);
|
||||
YYASSERT (!yytypeid_);
|
||||
])[}
|
||||
|
||||
/// Instantiate an empty \a T in here.
|
||||
@@ -118,9 +118,9 @@ m4_define([b4_variant_define],
|
||||
T&
|
||||
build ()
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytname_);
|
||||
YYASSERT (!yytypeid_);
|
||||
YYASSERT (sizeof (T) <= S);
|
||||
yytname_ = typeid (T).name ();])[
|
||||
yytypeid_ = & typeid (T);])[
|
||||
return *new (yyas_<T> ()) T;
|
||||
}
|
||||
|
||||
@@ -129,9 +129,9 @@ m4_define([b4_variant_define],
|
||||
T&
|
||||
build (const T& t)
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytname_);
|
||||
YYASSERT (!yytypeid_);
|
||||
YYASSERT (sizeof (T) <= S);
|
||||
yytname_ = typeid (T).name ();])[
|
||||
yytypeid_ = & typeid (T);])[
|
||||
return *new (yyas_<T> ()) T (t);
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ m4_define([b4_variant_define],
|
||||
T&
|
||||
as ()
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (yytname_ == typeid (T).name ());
|
||||
YYASSERT (*yytypeid_ == typeid (T));
|
||||
YYASSERT (sizeof (T) <= S);])[
|
||||
return *yyas_<T> ();
|
||||
}
|
||||
@@ -150,7 +150,7 @@ m4_define([b4_variant_define],
|
||||
const T&
|
||||
as () const
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (yytname_ == typeid (T).name ());
|
||||
YYASSERT (*yytypeid_ == typeid (T));
|
||||
YYASSERT (sizeof (T) <= S);])[
|
||||
return *yyas_<T> ();
|
||||
}
|
||||
@@ -167,8 +167,8 @@ m4_define([b4_variant_define],
|
||||
void
|
||||
swap (self_type& other)
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (yytname_);
|
||||
YYASSERT (yytname_ == other.yytname_);])[
|
||||
YYASSERT (yytypeid_);
|
||||
YYASSERT (*yytypeid_ == *other.yytypeid_);])[
|
||||
std::swap (as<T> (), other.as<T> ());
|
||||
}
|
||||
|
||||
@@ -178,8 +178,7 @@ m4_define([b4_variant_define],
|
||||
template <typename T>
|
||||
void
|
||||
move (self_type& other)
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytname_);])[
|
||||
{
|
||||
build<T> ();
|
||||
swap<T> (other);
|
||||
other.destroy<T> ();
|
||||
@@ -199,7 +198,7 @@ m4_define([b4_variant_define],
|
||||
destroy ()
|
||||
{
|
||||
as<T> ().~T ();]b4_parse_assert_if([
|
||||
yytname_ = YY_NULL;])[
|
||||
yytypeid_ = YY_NULLPTR;])[
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -234,7 +233,7 @@ m4_define([b4_variant_define],
|
||||
} yybuffer_;]b4_parse_assert_if([
|
||||
|
||||
/// Whether the content is built: if defined, the name of the stored type.
|
||||
const char *yytname_;])[
|
||||
const std::type_info *yytypeid_;])[
|
||||
};
|
||||
]])
|
||||
|
||||
@@ -321,7 +320,6 @@ b4_join(b4_symbol_if([$1], [has_type],
|
||||
return symbol_type (b4_join([token::b4_symbol([$1], [id])],
|
||||
b4_symbol_if([$1], [has_type], [v]),
|
||||
b4_locations_if([l])));
|
||||
|
||||
}
|
||||
|
||||
])])])
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
bison.xsl - common templates for Bison XSLT.
|
||||
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -201,6 +201,8 @@
|
||||
<xsl:if test="$point = 0">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<!-- RHS -->
|
||||
<xsl:for-each select="rhs/symbol|rhs/empty">
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="$point = position()">
|
||||
@@ -214,7 +216,9 @@
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty"/>
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> %empty</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
<xsl:text> [</xsl:text>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2text.xsl - transform Bison XML Report into plain text.
|
||||
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -350,12 +350,7 @@
|
||||
<xsl:if test="position() = $point + 1">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset != 'true'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="position() = last() and position() = $point">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -532,12 +532,7 @@
|
||||
<xsl:text> </xsl:text>
|
||||
<span class="point">.</span>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset != 'true'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="position() = last() and position() = $point">
|
||||
<xsl:text> </xsl:text>
|
||||
<span class="point">.</span>
|
||||
@@ -563,7 +558,7 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> ε</xsl:text>
|
||||
<xsl:text> %empty</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
|
||||
+327
-20
@@ -1,11 +1,11 @@
|
||||
-*- C -*-
|
||||
# Yacc compatible skeleton for Bison
|
||||
|
||||
# Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation,
|
||||
# Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[1984, 1989-1990, 2000-2013])
|
||||
[1984, 1989-1990, 2000-2015])
|
||||
|
||||
# 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
|
||||
@@ -52,6 +52,8 @@ m4_define([b4_lac_flag],
|
||||
[none], [[0]], [[1]])])
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
m4_define([b4_yaxx],[$1])
|
||||
m4_define([b4_not_yaxx],[])
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
@@ -331,7 +333,11 @@ m4_if(b4_api_prefix, [yy], [],
|
||||
#define yydebug ]b4_prefix[debug
|
||||
#define yynerrs ]b4_prefix[nerrs
|
||||
]]b4_pure_if([], [[
|
||||
#define yylval ]b4_prefix[lval
|
||||
#define yylval ]b4_prefix[lval]b4_yaxx([
|
||||
#define yytext ]b4_prefix[text
|
||||
#define YYYAXX_XML "b4_prefix[]yaxx.xml"
|
||||
#define YYYAXX_DTD "b4_prefix[]yaxx.dtd"
|
||||
])[
|
||||
#define yychar ]b4_prefix[char]b4_locations_if([[
|
||||
#define yylloc ]b4_prefix[lloc]])]))[
|
||||
|
||||
@@ -420,6 +426,10 @@ typedef short int yytype_int16;
|
||||
/* The parser invokes alloca or malloc; define the necessary symbols. */]dnl
|
||||
b4_push_if([], [b4_lac_if([], [[
|
||||
|
||||
]b4_yaxx([
|
||||
#define XML_ALLOC(X) malloc(X)
|
||||
#define XML_FREE(X) free(X)
|
||||
])[
|
||||
# ifdef YYSTACK_USE_ALLOCA
|
||||
# if YYSTACK_USE_ALLOCA
|
||||
# ifdef __GNUC__
|
||||
@@ -494,7 +504,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
|
||||
union yyalloc
|
||||
{
|
||||
yytype_int16 yyss_alloc;
|
||||
YYSTYPE yyvs_alloc;]b4_locations_if([
|
||||
YYSTYPE yyvs_alloc;]b4_yaxx([char *yyxs_alloc;])[]b4_locations_if([
|
||||
YYLTYPE yyls_alloc;])[
|
||||
};
|
||||
|
||||
@@ -505,10 +515,10 @@ union yyalloc
|
||||
N elements. */
|
||||
]b4_locations_if(
|
||||
[# define YYSTACK_BYTES(N) \
|
||||
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
|
||||
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE) ]b4_yaxx([+ sizeof(char*) ])[) \
|
||||
+ 2 * YYSTACK_GAP_MAXIMUM)],
|
||||
[# define YYSTACK_BYTES(N) \
|
||||
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
|
||||
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) ]b4_yaxx([+ sizeof(char*) ])[) \
|
||||
+ YYSTACK_GAP_MAXIMUM)])[
|
||||
|
||||
# define YYCOPY_NEEDED 1
|
||||
@@ -580,19 +590,27 @@ static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
|
||||
]b4_translate[
|
||||
};
|
||||
|
||||
]b4_not_yaxx([
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
])[
|
||||
]b4_integral_parser_table_define([rline], [b4_rline],
|
||||
[[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[
|
||||
]b4_not_yaxx([
|
||||
#endif
|
||||
])[
|
||||
|
||||
]b4_not_yaxx([
|
||||
#if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE || ]b4_token_table_flag[
|
||||
])[
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
||||
static const char *const yytname[] =
|
||||
{
|
||||
]b4_tname[
|
||||
};
|
||||
]b4_not_yaxx([
|
||||
#endif
|
||||
])
|
||||
|
||||
# ifdef YYPRINT
|
||||
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
|
||||
@@ -1108,11 +1126,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes,
|
||||
YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken)
|
||||
{
|
||||
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
|
||||
YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
|
||||
YYSIZE_T yysize = yysize0;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = YY_NULL;
|
||||
const char *yyformat = YY_NULLPTR;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
@@ -1187,7 +1205,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
{
|
||||
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
|
||||
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
|
||||
if (! (yysize <= yysize1
|
||||
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
@@ -1271,7 +1289,7 @@ static char yypstate_allocated = 0;]])b4_pull_if([
|
||||
|
||||
b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
||||
{
|
||||
return yypull_parse (YY_NULL]m4_ifset([b4_parse_param],
|
||||
return yypull_parse (YY_NULLPTR]m4_ifset([b4_parse_param],
|
||||
[[, ]b4_args(b4_parse_param)])[);
|
||||
}
|
||||
|
||||
@@ -1313,10 +1331,10 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
||||
{
|
||||
yypstate *yyps;]b4_pure_if([], [[
|
||||
if (yypstate_allocated)
|
||||
return YY_NULL;]])[
|
||||
return YY_NULLPTR;]])[
|
||||
yyps = (yypstate *) malloc (sizeof *yyps);
|
||||
if (!yyps)
|
||||
return YY_NULL;
|
||||
return YY_NULLPTR;
|
||||
yyps->yynew = 1;]b4_pure_if([], [[
|
||||
yypstate_allocated = 1;]])[
|
||||
return yyps;
|
||||
@@ -1366,7 +1384,194 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
||||
[[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
|
||||
[[[YYLTYPE *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
|
||||
b4_parse_param]))], [[
|
||||
]b4_yaxx([
|
||||
extern char *b4_prefix[]text;
|
||||
// Yijun Yu: utility functions -----------------------------------------------
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
/// replace character terminals into symbolic terminals
|
||||
static char *YYTNAME(int r)
|
||||
{
|
||||
static char yytname_buf[[8]];
|
||||
if (strlen(yytname[[r]])==3 && yytname[[r]][[0]] == '\'' && yytname[[r]][[2]] == '\'')
|
||||
{
|
||||
sprintf(yytname_buf, "CHAR%d", (int)yytname[[r]][[1]]);
|
||||
return yytname_buf;
|
||||
}
|
||||
else if (strlen(yytname[[r]])>=2 && yytname[[r]][[0]] == 64 )
|
||||
{
|
||||
strcpy(yytname_buf,"ACTION");
|
||||
strcat(yytname_buf,&(yytname[[r]][[1]]));
|
||||
return yytname_buf;
|
||||
}
|
||||
|
||||
return (char *)yytname[[r]];
|
||||
}
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
static char *yytext_buf = NULL;
|
||||
|
||||
/// replace a special character in the text into an entity
|
||||
static
|
||||
void replace_entity(char c, char *s)
|
||||
{
|
||||
char *buf;
|
||||
char *i;
|
||||
int len, l;
|
||||
i = yytext_buf;
|
||||
do {
|
||||
i = (char *)index(i, c);
|
||||
if (i) {
|
||||
l = i - yytext_buf;
|
||||
len = strlen(yytext_buf) + strlen(s) - 1;
|
||||
//buf = (char*)YYSTACK_ALLOC(1000000);
|
||||
buf = (char*)YYSTACK_ALLOC(len + 1); // Myo M Thein
|
||||
if (l>0) {
|
||||
#if 1 // Myo M Thein
|
||||
strncpy(buf, yytext_buf, l);
|
||||
#else
|
||||
int t = 0;
|
||||
while (t < l) {
|
||||
buf[t] = yytext_buf[t];
|
||||
t++;
|
||||
}
|
||||
buf[t] = 0;
|
||||
#endif
|
||||
} else {
|
||||
buf[[0]] = 0;
|
||||
}
|
||||
strcat(buf, s);
|
||||
strncat(buf, yytext_buf + l + 1, strlen(yytext_buf) - l);
|
||||
buf[[len]] = 0;
|
||||
YYSTACK_FREE(yytext_buf);
|
||||
//yytext_buf = buf;
|
||||
memcpy(yytext_buf,buf,len+1);
|
||||
i++;
|
||||
if (*i=='\0')
|
||||
i=NULL;
|
||||
}
|
||||
} while (i);
|
||||
}
|
||||
|
||||
/// replace the special characters in the text into entities
|
||||
static
|
||||
char* xml_encode( char ch)
|
||||
{
|
||||
static char text[[2]];
|
||||
switch(ch)
|
||||
{
|
||||
case '&':
|
||||
return ( "&");
|
||||
break;
|
||||
case '>':
|
||||
return ( ">");
|
||||
break;
|
||||
case '<' :
|
||||
return ( "<" );
|
||||
break;
|
||||
case '\"':
|
||||
return ( """);
|
||||
break;
|
||||
case '\'':
|
||||
return ( "'");
|
||||
break;
|
||||
default:
|
||||
text[[0]]=ch;
|
||||
text[[1]]=0;
|
||||
return text;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void replace_special_entities(char *text,char *text_out)
|
||||
{
|
||||
int i,lg;
|
||||
if (!text) { strcpy(text_out,"??");return ; }
|
||||
lg = strlen(text);
|
||||
strcpy(text_out,"");
|
||||
for (i=0;i<lg;i++)
|
||||
{
|
||||
strcat(text_out,xml_encode(text[[i]]));
|
||||
}
|
||||
}
|
||||
static
|
||||
void generate_xml_output(char **yyxsp,char **yyxs)
|
||||
{
|
||||
#ifndef YYYAXX_XML
|
||||
#define YYYAXX_XML "yaxx.xml"
|
||||
#endif
|
||||
#ifndef YYYAXX_DTD
|
||||
#define YYYAXX_DTD "yaxx.dtd"
|
||||
#endif
|
||||
int r, i, j;
|
||||
char buf[[2000]];
|
||||
int old_rule = 0;
|
||||
FILE *stdout = fopen(YYYAXX_XML, "w");
|
||||
char *p = *yyxsp + 6;
|
||||
#if 0
|
||||
char *v = strsep(&p, ">");
|
||||
strcpy(buf, v);
|
||||
#else
|
||||
i = 0;
|
||||
while (p[[i]]!='>') {
|
||||
buf[[i]] = p[[i]];
|
||||
i++;
|
||||
}
|
||||
buf[[i]] = 0;
|
||||
#endif
|
||||
/// Generating the XML document
|
||||
/// version
|
||||
fprintf(stdout,"<?xml version=\"1.0\"?>\n");
|
||||
/// DTD reference
|
||||
fprintf(stdout,"<?xml-stylesheet type=\"text/xsl\" href=\"yaxx.xsl\"?>");
|
||||
fprintf(stdout,"<!DOCTYPE %s SYSTEM \"" YYYAXX_DTD "\">\n", buf);
|
||||
/// inserting name space before the XML data
|
||||
fprintf(stdout,"<yaxx:%s xmlns:yaxx=\"urn:YAcc-Xml-eXtension\"%s\n", buf,
|
||||
yyxs[[1]]+i+6); //ffprintf(stdout,f, "%s\n", yyxs[[1]]);
|
||||
/// Generating the document type definition (DTD)
|
||||
stdout = fopen(YYYAXX_DTD , "w");
|
||||
/// DTD for non-terminals
|
||||
for (r = 2; r < sizeof(yyr1)/sizeof(unsigned short); r++)
|
||||
{
|
||||
j = yyr1[[r]];
|
||||
if (j != old_rule) {
|
||||
if (old_rule!=0)
|
||||
fprintf(stdout,")>\n");
|
||||
fprintf(stdout,"<!ELEMENT %s (", YYTNAME(yyr1[[r]]));
|
||||
} else
|
||||
fprintf(stdout," | ");
|
||||
if (yyr2[[r]]==0)
|
||||
fprintf(stdout,"EMPTY");
|
||||
else {
|
||||
/*
|
||||
int multiple = 0;
|
||||
for (i = yyprhs[[r]]; yyrhs[[i]] > 0 ; i++)
|
||||
if (i!=yyprhs[[r]]) {
|
||||
multiple = 1; break;
|
||||
}
|
||||
if (multiple) fprintf(stdout,"(");
|
||||
for (i = yyprhs[[r]]; yyrhs[[i]] > 0 ; i++) {
|
||||
if (i!=yyprhs[[r]])
|
||||
fprintf(stdout,",");
|
||||
fprintf(stdout,"%s", YYTNAME(yyrhs[[i]]));
|
||||
}
|
||||
if (multiple) fprintf(stdout,")");
|
||||
*/
|
||||
}
|
||||
old_rule = j;
|
||||
}
|
||||
fprintf(stdout,")>\n");
|
||||
/// DTD for terminals
|
||||
for (r = 3; r < YYNTOKENS; r++)
|
||||
{
|
||||
fprintf(stdout,"<!ELEMENT %s (#PCDATA)>\n", YYTNAME(r));
|
||||
}
|
||||
|
||||
}
|
||||
])[
|
||||
|
||||
/*----------.
|
||||
| yyparse. |
|
||||
@@ -1398,7 +1603,26 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
||||
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
|
||||
#endif
|
||||
|
||||
]b4_yaxx([
|
||||
|
||||
/* The tags stack. */
|
||||
char *yyxsa[[YYINITDEPTH]];
|
||||
char **yyxs = yyxsa;
|
||||
char **yyxsp;
|
||||
])[
|
||||
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)]b4_locations_if([, yylsp -= (N)])[)
|
||||
]b4_yaxx([
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#undef __GNUC_PREREQ
|
||||
#define __GNUC_PREREQ(maj, min) (maj < 4)
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
static char * yyxml_str=NULL; // for XML
|
||||
// for id attribute generation (by William Candillon)
|
||||
int _id = 0;
|
||||
char str[[256]];
|
||||
])[
|
||||
|
||||
/* The number of symbols on the RHS of the reduced rule.
|
||||
Keep to zero when no symbol should be popped. */
|
||||
@@ -1410,7 +1634,9 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
||||
goto yyread_pushed_token;
|
||||
}]])[
|
||||
|
||||
yyssp = yyss = yyssa;
|
||||
yyssp = yyss = yyssa;]b4_yaxx([
|
||||
yyxsp = yyxs = yyxsa;
|
||||
])[
|
||||
yyvsp = yyvs = yyvsa;]b4_locations_if([[
|
||||
yylsp = yyls = yylsa;]])[
|
||||
yystacksize = YYINITDEPTH;]b4_lac_if([[
|
||||
@@ -1460,7 +1686,7 @@ b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yyllo
|
||||
these so that the &'s don't force the real ones into
|
||||
memory. */
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
yytype_int16 *yyss1 = yyss;]b4_locations_if([
|
||||
yytype_int16 *yyss1 = yyss;]b4_yaxx([ char **yyxs1 = yyxs;])[]b4_locations_if([
|
||||
YYLTYPE *yyls1 = yyls;])[
|
||||
|
||||
/* Each stack pointer address is followed by the size of the
|
||||
@@ -1469,9 +1695,9 @@ b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yyllo
|
||||
be undefined if yyoverflow is a macro. */
|
||||
yyoverflow (YY_("memory exhausted"),
|
||||
&yyss1, yysize * sizeof (*yyssp),
|
||||
&yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([
|
||||
&yyvs1, yysize * sizeof (*yyvsp),]b4_yaxx([&yyxs1, yysize * sizeof (*yyxsp),])[]b4_locations_if([
|
||||
&yyls1, yysize * sizeof (*yylsp),])[
|
||||
&yystacksize);
|
||||
&yystacksize);]b4_yaxx([yyxs = yyxs1;])[
|
||||
]b4_locations_if([
|
||||
yyls = yyls1;])[
|
||||
yyss = yyss1;
|
||||
@@ -1495,7 +1721,7 @@ b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yyllo
|
||||
if (! yyptr)
|
||||
goto yyexhaustedlab;
|
||||
YYSTACK_RELOCATE (yyss_alloc, yyss);
|
||||
YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_locations_if([
|
||||
YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_yaxx([YYSTACK_RELOCATE (yyxs_alloc, yyxs);])[]b4_locations_if([
|
||||
YYSTACK_RELOCATE (yyls_alloc, yyls);])[
|
||||
# undef YYSTACK_RELOCATE
|
||||
if (yyss1 != yyssa)
|
||||
@@ -1505,7 +1731,7 @@ b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yyllo
|
||||
#endif /* no yyoverflow */
|
||||
|
||||
yyssp = yyss + yysize - 1;
|
||||
yyvsp = yyvs + yysize - 1;]b4_locations_if([
|
||||
yyvsp = yyvs + yysize - 1;]b4_yaxx([yyxsp = yyxs + yysize - 1;])[]b4_locations_if([
|
||||
yylsp = yyls + yysize - 1;])[
|
||||
|
||||
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
||||
@@ -1570,7 +1796,33 @@ yyread_pushed_token:]])[
|
||||
}
|
||||
else
|
||||
{
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
yytoken = YYTRANSLATE (yychar);]b4_yaxx([
|
||||
{ // Yijun Yu: process the terminal
|
||||
yyxml_str = (char *) XML_ALLOC(200);
|
||||
strcpy(yyxml_str, "<yaxx:");
|
||||
strcat(yyxml_str, YYTNAME(yytoken));
|
||||
#if 1 //William Candillon
|
||||
strcat(yyxml_str, " id=\"");
|
||||
sprintf(str, "%x", _id);
|
||||
strcat(yyxml_str, str);
|
||||
strcat(yyxml_str, "\"");
|
||||
_id++;
|
||||
#endif
|
||||
strcat(yyxml_str, ">");
|
||||
if (yytoken < YYNTOKENS) {
|
||||
if (yytext) {
|
||||
char *tmp;
|
||||
tmp=(char *)YYSTACK_ALLOC(6*strlen(yytext)+1);
|
||||
replace_special_entities(yytext,tmp);
|
||||
strcat(yyxml_str, tmp);
|
||||
YYSTACK_FREE(tmp);
|
||||
}
|
||||
}
|
||||
strcat(yyxml_str, "</yaxx:");
|
||||
strcat(yyxml_str, YYTNAME(yytoken));
|
||||
strcat(yyxml_str, ">\n");
|
||||
}
|
||||
])[
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
}
|
||||
|
||||
@@ -1607,6 +1859,10 @@ yyread_pushed_token:]])[
|
||||
|
||||
yystate = yyn;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
]b4_yaxx([
|
||||
*++yyxsp = yyxml_str;
|
||||
yyxml_str = 0;
|
||||
])[
|
||||
*++yyvsp = yylval;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
]b4_locations_if([ *++yylsp = yylloc;])[
|
||||
@@ -1654,6 +1910,53 @@ yyreduce:
|
||||
if (yychar_backup != yychar)
|
||||
YY_LAC_DISCARD ("yychar change");
|
||||
}]], [[
|
||||
]b4_yaxx([
|
||||
{
|
||||
int len = 0;
|
||||
int alloc_len=0;
|
||||
int n = 0;
|
||||
int yyi;
|
||||
for (yyi = 0; yyi < yylen; yyi++)
|
||||
{
|
||||
int l;
|
||||
char * yyxml_str = yyxsp[[yyi+1-yylen]];
|
||||
if (yyxml_str==NULL) {
|
||||
l = 0;
|
||||
} else
|
||||
l = strlen(yyxml_str);
|
||||
len += l;
|
||||
n++;
|
||||
}
|
||||
alloc_len =len+100+2*strlen(YYTNAME(yyr1[[yyn]]));
|
||||
yyxml_str = (char *) XML_ALLOC(alloc_len);
|
||||
strcpy(yyxml_str, "<yaxx:");
|
||||
strcat(yyxml_str, YYTNAME(yyr1[[yyn]]));
|
||||
#if 1 //William Candillon
|
||||
strcat(yyxml_str, " id=\"");
|
||||
sprintf(str, "%x", _id);
|
||||
strcat(yyxml_str, str);
|
||||
strcat(yyxml_str, "\"");
|
||||
_id++;
|
||||
#endif
|
||||
strcat(yyxml_str, ">\n");
|
||||
for (yyi = 0; yyi < yylen; yyi++)
|
||||
{
|
||||
char * xml_str = yyxsp[[yyi+1-yylen]];
|
||||
if (xml_str) {
|
||||
strcat(yyxml_str, xml_str);
|
||||
XML_FREE(xml_str);
|
||||
yyxsp[[yyi+1-yylen]] = NULL;
|
||||
} else {
|
||||
fprintf(stderr, "Warning! the %d-th argument is empty", yyi+1);
|
||||
}
|
||||
}
|
||||
strcat(yyxml_str, "</yaxx:");
|
||||
strcat(yyxml_str, YYTNAME(yyr1[[yyn]]));
|
||||
strcat(yyxml_str, ">\n");
|
||||
yyxsp -= n;
|
||||
*++yyxsp = yyxml_str;
|
||||
yyxml_str = NULL;
|
||||
}])[
|
||||
switch (yyn)
|
||||
{
|
||||
]b4_user_actions[
|
||||
@@ -1829,6 +2132,10 @@ yyerrlab1:
|
||||
YY_LAC_DISCARD ("error recovery");]])[
|
||||
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
]b4_yaxx([
|
||||
*++yyxsp = yyxml_str;
|
||||
yyxml_str = 0;
|
||||
])[
|
||||
*++yyvsp = yylval;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
]b4_locations_if([[
|
||||
@@ -1848,7 +2155,7 @@ yyerrlab1:
|
||||
/*-------------------------------------.
|
||||
| yyacceptlab -- YYACCEPT comes here. |
|
||||
`-------------------------------------*/
|
||||
yyacceptlab:
|
||||
yyacceptlab:]b4_yaxx([generate_xml_output(--yyxsp,yyxs);])[
|
||||
yyresult = 0;
|
||||
goto yyreturn;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||
# Requires GNU sed
|
||||
|
||||
## Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2005-2015 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-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2015 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-2013 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005-2015 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
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the configure script generated by autoconf 2.62.
|
||||
|
||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015 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-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015 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-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015 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-2013 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005-2015 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,4 +1,4 @@
|
||||
## Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2008-2015 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 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2015 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 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2015 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 @@
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the testsuite script generated by autoconf 2.61.
|
||||
|
||||
# Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2015 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
|
||||
|
||||
@@ -27,3 +27,4 @@
|
||||
/stamp-vti
|
||||
/version.texi
|
||||
/yacc.1
|
||||
/gendocs_template_min
|
||||
|
||||
+1405
-960
File diff suppressed because it is too large
Load Diff
+78
-25
@@ -1,6 +1,8 @@
|
||||
\input texinfo @c -*-texinfo-*-
|
||||
@comment %**start of header
|
||||
@setfilename bison.info
|
||||
@documentencoding UTF-8
|
||||
@documentlanguage en
|
||||
@include version.texi
|
||||
@settitle Bison @value{VERSION}
|
||||
@setchapternewpage odd
|
||||
@@ -33,7 +35,7 @@
|
||||
This manual (@value{UPDATED}) is for GNU Bison (version
|
||||
@value{VERSION}), the GNU parser generator.
|
||||
|
||||
Copyright @copyright{} 1988-1993, 1995, 1998-2013 Free Software
|
||||
Copyright @copyright{} 1988-1993, 1995, 1998-2015 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
@quotation
|
||||
@@ -3849,7 +3851,7 @@ example:
|
||||
@noindent
|
||||
specifies the union tag @code{value}, so the corresponding C type is
|
||||
@code{union value}. If you do not specify a tag, it defaults to
|
||||
@code{YYSTYPE}.
|
||||
@code{YYSTYPE} (@pxref{%define Summary,,api.value.union.name}).
|
||||
|
||||
As another extension to POSIX, you may specify multiple @code{%union}
|
||||
declarations; their contents are concatenated. However, only the first
|
||||
@@ -5143,7 +5145,9 @@ value by default. However, when the parser displays a @code{STRING1} or a
|
||||
@code{string1}, it formats it as a string in double quotes. It performs
|
||||
only the second @code{%printer} in this case, so it prints only once.
|
||||
Finally, the parser print @samp{<>} for any symbol, such as @code{TAGLESS},
|
||||
that has no semantic type tag. See also
|
||||
that has no semantic type tag. @xref{Mfcalc Traces, ,Enabling Debug Traces
|
||||
for @code{mfcalc}}, for a complete example.
|
||||
|
||||
|
||||
|
||||
@node Expect Decl
|
||||
@@ -6010,12 +6014,12 @@ Use this @var{type} as semantic value.
|
||||
@item Default Value:
|
||||
@itemize @minus
|
||||
@item
|
||||
@code{%union} if @code{%union} is used, otherwise @dots{}
|
||||
@code{union-directive} if @code{%union} is used, otherwise @dots{}
|
||||
@item
|
||||
@code{int} if type tags are used (i.e., @samp{%token <@var{type}>@dots{}} or
|
||||
@samp{%token <@var{type}>@dots{}} is used), otherwise @dots{}
|
||||
@samp{%type <@var{type}>@dots{}} is used), otherwise @dots{}
|
||||
@item
|
||||
@code{""}
|
||||
undefined.
|
||||
@end itemize
|
||||
|
||||
@item History:
|
||||
@@ -6026,6 +6030,30 @@ introduced in Bison 3.0. Was introduced for Java only in 2.3b as
|
||||
@c api.value.type
|
||||
|
||||
|
||||
@c ================================================== api.value.union.name
|
||||
@deffn Directive {%define api.value.union.name} @var{name}
|
||||
@itemize @bullet
|
||||
@item Language(s):
|
||||
C
|
||||
|
||||
@item Purpose:
|
||||
The tag of the generated @code{union} (@emph{not} the name of the
|
||||
@code{typedef}). This variable is set to @code{@var{id}} when @samp{%union
|
||||
@var{id}} is used. There is no clear reason to give this union a name.
|
||||
|
||||
@item Accepted Values:
|
||||
Any valid identifier.
|
||||
|
||||
@item Default Value:
|
||||
@code{YYSTYPE}.
|
||||
|
||||
@item History:
|
||||
Introduced in Bison 3.0.3.
|
||||
@end itemize
|
||||
@end deffn
|
||||
@c api.value.type
|
||||
|
||||
|
||||
@c ================================================== location_type
|
||||
@deffn Directive {%define location_type}
|
||||
Obsoleted by @code{api.location.type} since Bison 2.7.
|
||||
@@ -7522,7 +7550,7 @@ in an associativity related conflict, which can be specified as follows.
|
||||
|
||||
The unary-minus is another typical example where associativity is
|
||||
usually over-specified, see @ref{Infix Calc, , Infix Notation
|
||||
Calculator: @code{calc}}. The @code{%left} directive is traditionally
|
||||
Calculator - @code{calc}}. The @code{%left} directive is traditionally
|
||||
used to declare the precedence of @code{NEG}, which is more than needed
|
||||
since it also defines its associativity. While this is harmless in the
|
||||
traditional example, who knows how @code{NEG} might be used in future
|
||||
@@ -10065,18 +10093,16 @@ A category can be turned off by prefixing its name with @samp{no-}. For
|
||||
instance, @option{-Wno-yacc} will hide the warnings about
|
||||
POSIX Yacc incompatibilities.
|
||||
|
||||
@item -Werror[=@var{category}]
|
||||
@itemx -Wno-error[=@var{category}]
|
||||
Enable warnings falling in @var{category}, and treat them as errors. If no
|
||||
@var{category} is given, it defaults to making all enabled warnings into errors.
|
||||
@item -Werror
|
||||
Turn enabled warnings for every @var{category} into errors, unless they are
|
||||
explicitly disabled by @option{-Wno-error=@var{category}}.
|
||||
|
||||
@item -Werror=@var{category}
|
||||
Enable warnings falling in @var{category}, and treat them as errors.
|
||||
|
||||
@var{category} is the same as for @option{--warnings}, with the exception that
|
||||
it may not be prefixed with @samp{no-} (see above).
|
||||
|
||||
Prefixed with @samp{no}, it deactivates the error treatment for this
|
||||
@var{category}. However, the warning itself won't be disabled, or enabled, by
|
||||
this option.
|
||||
|
||||
Note that the precedence of the @samp{=} and @samp{,} operators is such that
|
||||
the following commands are @emph{not} equivalent, as the first will not treat
|
||||
S/R conflicts as errors.
|
||||
@@ -10086,6 +10112,14 @@ $ bison -Werror=yacc,conflicts-sr input.y
|
||||
$ bison -Werror=yacc,error=conflicts-sr input.y
|
||||
@end example
|
||||
|
||||
@item -Wno-error
|
||||
Do not turn enabled warnings for every @var{category} into errors, unless
|
||||
they are explicitly enabled by @option{-Werror=@var{category}}.
|
||||
|
||||
@item -Wno-error=@var{category}
|
||||
Deactivate the error treatment for this @var{category}. However, the warning
|
||||
itself won't be disabled, or enabled, by this option.
|
||||
|
||||
@item -f [@var{feature}]
|
||||
@itemx --feature[=@var{feature}]
|
||||
Activate miscellaneous @var{feature}. @var{feature} can be one of:
|
||||
@@ -10348,9 +10382,23 @@ declare @code{yyerror} as follows:
|
||||
int yyerror (char const *);
|
||||
@end example
|
||||
|
||||
Bison ignores the @code{int} value returned by this @code{yyerror}.
|
||||
If you use the Yacc library's @code{main} function, your
|
||||
@code{yyparse} function should have the following type signature:
|
||||
@noindent
|
||||
The @code{int} value returned by this @code{yyerror} is ignored.
|
||||
|
||||
The implementation of Yacc library's @code{main} function is:
|
||||
|
||||
@example
|
||||
int main (void)
|
||||
@{
|
||||
setlocale (LC_ALL, "");
|
||||
return yyparse ();
|
||||
@}
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
so if you use it, the internationalization support is enabled (e.g., error
|
||||
messages are translated), and your @code{yyparse} function should have the
|
||||
following type signature:
|
||||
|
||||
@example
|
||||
int yyparse (void);
|
||||
@@ -10652,12 +10700,17 @@ The first, inclusive, position of the range, and the first beyond.
|
||||
Forwarded to the @code{end} position.
|
||||
@end deftypemethod
|
||||
|
||||
@deftypemethod {location} {location} operator+ (const location& @var{end})
|
||||
@deftypemethodx {location} {location} operator+ (int @var{width})
|
||||
@deftypemethod {location} {location} operator+ (int @var{width})
|
||||
@deftypemethodx {location} {location} operator+= (int @var{width})
|
||||
@deftypemethodx {location} {location} operator- (int @var{width})
|
||||
@deftypemethodx {location} {location} operator- (int @var{width})
|
||||
@deftypemethodx {location} {location} operator-= (int @var{width})
|
||||
Various forms of syntactic sugar.
|
||||
Various forms of syntactic sugar for @code{columns}.
|
||||
@end deftypemethod
|
||||
|
||||
@deftypemethod {location} {location} operator+ (const location& @var{end})
|
||||
@deftypemethodx {location} {location} operator+= (const location& @var{end})
|
||||
Join two locations: starts at the position of the first one, and ends at the
|
||||
position of the second.
|
||||
@end deftypemethod
|
||||
|
||||
@deftypemethod {location} {void} step ()
|
||||
@@ -10695,8 +10748,8 @@ it must be copyable;
|
||||
in order to compute the (default) value of @code{@@$} in a reduction, the
|
||||
parser basically runs
|
||||
@example
|
||||
@@$.begin = @@$1.begin;
|
||||
@@$.end = @@$@var{N}.end; // The location of last right-hand side symbol.
|
||||
@@$.begin = @@1.begin;
|
||||
@@$.end = @@@var{N}.end; // The location of last right-hand side symbol.
|
||||
@end example
|
||||
@noindent
|
||||
so there must be copyable @code{begin} and @code{end} members;
|
||||
@@ -11284,7 +11337,7 @@ regular destructors. All the values are printed using their
|
||||
|
||||
@noindent
|
||||
The grammar itself is straightforward (@pxref{Location Tracking Calc, ,
|
||||
Location Tracking Calculator: @code{ltcalc}}).
|
||||
Location Tracking Calculator - @code{ltcalc}}).
|
||||
|
||||
@comment file: calc++-parser.yy
|
||||
@example
|
||||
|
||||
+11
-3
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2001-2003, 2005-2013 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001-2003, 2005-2015 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
|
||||
@@ -85,11 +85,13 @@ doc/refcard.pdf: doc/refcard.tex
|
||||
# repeated builds of bison.help.
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/doc/bison.help
|
||||
if ! CROSS_COMPILING
|
||||
MAINTAINERCLEANFILES += $(top_srcdir)/doc/bison.help
|
||||
$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT)
|
||||
$(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp
|
||||
$(AM_V_at) src/bison$(EXEEXT) --help >>doc/bison.help.tmp
|
||||
$(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@
|
||||
endif ! CROSS_COMPILING
|
||||
|
||||
|
||||
## ----------- ##
|
||||
@@ -106,7 +108,11 @@ remove_time_stamp = \
|
||||
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
||||
|
||||
# Depend on configure to get version number changes.
|
||||
$(top_srcdir)/doc/bison.1: doc/bison.help doc/bison.x $(top_srcdir)/configure
|
||||
if ! CROSS_COMPILING
|
||||
MAN_DEPS = doc/bison.help doc/bison.x $(top_srcdir)/configure
|
||||
endif
|
||||
|
||||
$(top_srcdir)/doc/bison.1: $(MAN_DEPS)
|
||||
$(AM_V_GEN)$(HELP2MAN) \
|
||||
--include=$(top_srcdir)/doc/bison.x \
|
||||
--output=$@.t src/bison$(EXEEXT)
|
||||
@@ -118,13 +124,15 @@ $(top_srcdir)/doc/bison.1: doc/bison.help doc/bison.x $(top_srcdir)/configure
|
||||
fi
|
||||
$(AM_V_at)rm -f $@*.t
|
||||
|
||||
if ENABLE_YACC
|
||||
nodist_man_MANS = doc/yacc.1
|
||||
endif
|
||||
|
||||
## ----------------------------- ##
|
||||
## Graphviz examples generation. ##
|
||||
## ----------------------------- ##
|
||||
|
||||
CLEANDIRS += doc/figs
|
||||
CLEANFILES += $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) $(FIGS_GV:.gv=.png)
|
||||
FIGS_GV = \
|
||||
doc/figs/example.gv \
|
||||
doc/figs/example-reduce.gv doc/figs/example-shift.gv
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
\def\finalout{\overfullrule=0pt}
|
||||
%\finalout
|
||||
|
||||
% Copyright (c) 1998, 2001, 2009-2013 Free Software Foundation, Inc.
|
||||
% Copyright (c) 1998, 2001, 2009-2015 Free Software Foundation, Inc.
|
||||
%
|
||||
% This file is part of Bison.
|
||||
%
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ straightforward use of _build/src/bison would.)
|
||||
|
||||
--
|
||||
|
||||
Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006, 2008-2015 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of Bison, the GNU Compiler Compiler.
|
||||
#
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2006, 2008-2015 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,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015 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
|
||||
|
||||
+44
-36
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2006, 2008-2015 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,7 +19,7 @@
|
||||
|
||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||
# in srcdir, including during distcheck, which is forbidden.
|
||||
examples/calc++/calc++-parser.stamp: $(BISON_IN)
|
||||
%D%/calc++-parser.stamp: $(BISON_IN)
|
||||
SUFFIXES += .yy .stamp
|
||||
.yy.stamp:
|
||||
$(AM_V_YACC)rm -f $@
|
||||
@@ -27,14 +27,14 @@ SUFFIXES += .yy .stamp
|
||||
$(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
|
||||
$(AM_V_at)mv -f $@.tmp $@
|
||||
|
||||
$(calc_sources_generated): examples/calc++/calc++-parser.stamp
|
||||
@test -f $@ || rm -f examples/calc++/calc++-parser.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp
|
||||
$(calcxx_sources_generated): %D%/calc++-parser.stamp
|
||||
@test -f $@ || rm -f %D%/calc++-parser.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/calc++-parser.stamp
|
||||
CLEANFILES += \
|
||||
$(calc_sources_generated) \
|
||||
examples/calc++/calc++-parser.output \
|
||||
examples/calc++/calc++-parser.stamp \
|
||||
examples/calc++/calc++-scanner.cc
|
||||
$(calcxx_sources_generated) \
|
||||
%D%/calc++-parser.output \
|
||||
%D%/calc++-parser.stamp \
|
||||
%D%/calc++-scanner.cc
|
||||
|
||||
|
||||
## -------------------- ##
|
||||
@@ -42,35 +42,43 @@ CLEANFILES += \
|
||||
## -------------------- ##
|
||||
|
||||
# Avoid using BUILT_SOURCES which is too global.
|
||||
$(examples_calc___calc___OBJECTS): $(calc_sources_generated)
|
||||
$(%C%_calc___OBJECTS): $(calcxx_sources_generated)
|
||||
|
||||
calc_sources_extracted = \
|
||||
examples/calc++/calc++-driver.cc \
|
||||
examples/calc++/calc++-driver.hh \
|
||||
examples/calc++/calc++-scanner.ll \
|
||||
examples/calc++/calc++.cc
|
||||
calc_extracted = \
|
||||
$(calc_sources_extracted) \
|
||||
examples/calc++/calc++-parser.yy
|
||||
extracted += $(calc_extracted)
|
||||
calc_sources_generated = \
|
||||
examples/calc++/calc++-parser.cc \
|
||||
examples/calc++/calc++-parser.hh \
|
||||
examples/calc++/location.hh \
|
||||
examples/calc++/position.hh \
|
||||
examples/calc++/stack.hh
|
||||
calc_sources = \
|
||||
$(calc_sources_extracted) \
|
||||
$(calc_sources_generated)
|
||||
calcxx_sources_extracted = \
|
||||
%D%/calc++-driver.cc \
|
||||
%D%/calc++-driver.hh \
|
||||
%D%/calc++-scanner.ll \
|
||||
%D%/calc++.cc
|
||||
calcxx_extracted = \
|
||||
$(calcxx_sources_extracted) \
|
||||
%D%/calc++-parser.yy
|
||||
extracted += $(calcxx_extracted)
|
||||
calcxx_sources_generated = \
|
||||
%D%/calc++-parser.cc \
|
||||
%D%/calc++-parser.hh \
|
||||
%D%/location.hh \
|
||||
%D%/position.hh \
|
||||
%D%/stack.hh
|
||||
calcxx_sources = \
|
||||
$(calcxx_sources_extracted) \
|
||||
$(calcxx_sources_generated)
|
||||
|
||||
if BISON_CXX_WORKS
|
||||
check_PROGRAMS += examples/calc++/calc++
|
||||
nodist_examples_calc___calc___SOURCES = \
|
||||
$(calc_sources)
|
||||
if FLEX_CXX_WORKS
|
||||
check_PROGRAMS += %D%/calc++
|
||||
nodist_%C%_calc___SOURCES = \
|
||||
$(calcxx_sources)
|
||||
|
||||
examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
|
||||
examples_calc___calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
|
||||
dist_TESTS += examples/calc++/calc++.test
|
||||
%C%_calc___CPPFLAGS = -I$(top_builddir)/%D%
|
||||
%C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
|
||||
dist_TESTS += %D%/calc++.test
|
||||
else
|
||||
EXTRA_DIST += examples/calc++/calc++.test
|
||||
EXTRA_DIST += %D%/calc++.test
|
||||
endif
|
||||
|
||||
|
||||
## ------------ ##
|
||||
## Installing. ##
|
||||
## ------------ ##
|
||||
|
||||
calcxxdir = $(docdir)/examples/calc++
|
||||
calcxx_DATA = $(calcxx_extracted)
|
||||
|
||||
+15
-8
@@ -3,7 +3,7 @@
|
||||
|
||||
# This file is part of GNU Bison
|
||||
|
||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2013 Free Software
|
||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2015 Free Software
|
||||
# Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -19,7 +19,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Usage: extexi input-file.texi ... -- [FILES to extract]
|
||||
# Usage: extexi [OPTION...] input-file.texi ... -- [FILES to extract]
|
||||
|
||||
# Look for @example environments preceded with lines such as:
|
||||
#
|
||||
@@ -35,6 +35,9 @@
|
||||
|
||||
use strict;
|
||||
|
||||
# Whether we generate synclines.
|
||||
my $synclines = 0;
|
||||
|
||||
# normalize($block)
|
||||
# -----------------
|
||||
# Remove Texinfo mark up.
|
||||
@@ -102,7 +105,7 @@ sub process ($)
|
||||
{
|
||||
# Bison supports synclines, but not Flex.
|
||||
$input .= sprintf ("#line %s \"$in\"\n", $. + 1)
|
||||
if $file =~ /\.[chy]*$/;
|
||||
if $synclines && $file =~ /\.[chy]*$/;
|
||||
next;
|
||||
}
|
||||
elsif (/^\@end (small)?example$/)
|
||||
@@ -136,15 +139,19 @@ my @input;
|
||||
my $seen_dash = 0;
|
||||
for my $arg (@ARGV)
|
||||
{
|
||||
if ($arg eq '--')
|
||||
{
|
||||
$seen_dash = 1;
|
||||
}
|
||||
elsif ($seen_dash)
|
||||
if ($seen_dash)
|
||||
{
|
||||
use File::Basename;
|
||||
$file_wanted{basename($arg)} = $arg;
|
||||
}
|
||||
elsif ($arg eq '--')
|
||||
{
|
||||
$seen_dash = 1;
|
||||
}
|
||||
elsif ($arg eq '--synclines')
|
||||
{
|
||||
$synclines = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
push @input, $arg;
|
||||
|
||||
+16
-13
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2005, 2008-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005, 2008-2015 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -13,8 +13,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
dist_noinst_SCRIPTS = examples/extexi examples/test
|
||||
TEST_LOG_COMPILER = $(top_srcdir)/examples/test
|
||||
dist_noinst_SCRIPTS = %D%/extexi %D%/test
|
||||
TEST_LOG_COMPILER = $(top_srcdir)/%D%/test
|
||||
|
||||
AM_CXXFLAGS = \
|
||||
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
||||
@@ -24,20 +24,23 @@ AM_CXXFLAGS = \
|
||||
## ------------ ##
|
||||
|
||||
doc = $(top_srcdir)/doc/bison.texi
|
||||
extexi = $(top_srcdir)/examples/extexi
|
||||
extract = VERSION="$(VERSION)" $(PERL) -f $(extexi) $(doc) --
|
||||
extexi = $(top_srcdir)/%D%/extexi
|
||||
if ENABLE_GCC_WARNINGS
|
||||
extexiFLAGS = --synclines
|
||||
endif
|
||||
extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(extexiFLAGS) $(doc) --
|
||||
extracted =
|
||||
CLEANFILES += $(extracted) examples/extracted.stamp
|
||||
examples/extracted.stamp: $(doc) $(extexi)
|
||||
CLEANFILES += $(extracted) %D%/extracted.stamp
|
||||
%D%/extracted.stamp: $(doc) $(extexi)
|
||||
$(AM_V_GEN)rm -f $@ $@.tmp
|
||||
$(AM_V_at)touch $@.tmp
|
||||
$(AM_V_at)$(extract) $(extracted)
|
||||
$(AM_V_at)mv $@.tmp $@
|
||||
|
||||
$(extracted): examples/extracted.stamp
|
||||
@test -f $@ || rm -f examples/extracted.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/extracted.stamp
|
||||
$(extracted): %D%/extracted.stamp
|
||||
@test -f $@ || rm -f %D%/extracted.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/extracted.stamp
|
||||
|
||||
include examples/calc++/local.mk
|
||||
include examples/mfcalc/local.mk
|
||||
include examples/rpcalc/local.mk
|
||||
include %D%/calc++/local.mk
|
||||
include %D%/mfcalc/local.mk
|
||||
include %D%/rpcalc/local.mk
|
||||
|
||||
+16
-13
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2006, 2008-2015 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
|
||||
@@ -18,19 +18,22 @@
|
||||
## -------------------- ##
|
||||
|
||||
BUILT_SOURCES += $(mfcalc_sources)
|
||||
CLEANFILES += examples/mfcalc/mfcalc.[ch] examples/mfcalc/mfcalc.output
|
||||
CLEANFILES += %D%/mfcalc.[ch] %D%/mfcalc.output
|
||||
|
||||
mfcalc_extracted = \
|
||||
examples/mfcalc/calc.h \
|
||||
examples/mfcalc/mfcalc.y
|
||||
mfcalc_sources = \
|
||||
$(mfcalc_extracted)
|
||||
mfcalc_extracted = %D%/calc.h %D%/mfcalc.y
|
||||
mfcalc_sources = $(mfcalc_extracted)
|
||||
extracted += $(mfcalc_extracted)
|
||||
|
||||
check_PROGRAMS += examples/mfcalc/mfcalc
|
||||
examples_mfcalc_mfcalc_LDADD = -lm
|
||||
nodist_examples_mfcalc_mfcalc_SOURCES = \
|
||||
$(mfcalc_sources)
|
||||
check_PROGRAMS += %D%/mfcalc
|
||||
%C%_mfcalc_LDADD = -lm
|
||||
nodist_%C%_mfcalc_SOURCES = $(mfcalc_sources)
|
||||
|
||||
examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_builddir)/examples/mfcalc
|
||||
dist_TESTS += examples/mfcalc/mfcalc.test
|
||||
%C%_mfcalc_CPPFLAGS = -I$(top_builddir)/%D%
|
||||
dist_TESTS += %D%/mfcalc.test
|
||||
|
||||
## ------------ ##
|
||||
## Installing. ##
|
||||
## ------------ ##
|
||||
|
||||
mfcalcdir = $(docdir)/examples/mfcalc
|
||||
mfcalc_DATA = $(mfcalc_extracted)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015 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,4 +1,5 @@
|
||||
/calc.h
|
||||
/rpcalc
|
||||
/rpcalc.c
|
||||
/rpcalc.h
|
||||
/rpcalc.output
|
||||
|
||||
+16
-12
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2006, 2008-2015 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
|
||||
@@ -18,18 +18,22 @@
|
||||
## -------------------- ##
|
||||
|
||||
BUILT_SOURCES += $(rpcalc_sources)
|
||||
CLEANFILES += examples/rpcalc/rpcalc.[ch] examples/rpcalc/rpcalc.output
|
||||
CLEANFILES += %D%/rpcalc.[ch] %D%/rpcalc.output
|
||||
|
||||
rpcalc_extracted = \
|
||||
examples/rpcalc/rpcalc.y
|
||||
rpcalc_sources = \
|
||||
$(rpcalc_extracted)
|
||||
rpcalc_extracted = %D%/rpcalc.y
|
||||
rpcalc_sources = $(rpcalc_extracted)
|
||||
extracted += $(rpcalc_extracted)
|
||||
|
||||
check_PROGRAMS += examples/rpcalc/rpcalc
|
||||
examples_rpcalc_rpcalc_LDADD = -lm
|
||||
nodist_examples_rpcalc_rpcalc_SOURCES = \
|
||||
$(rpcalc_sources)
|
||||
check_PROGRAMS += %D%/rpcalc
|
||||
%C%_rpcalc_LDADD = -lm
|
||||
nodist_%C%_rpcalc_SOURCES = $(rpcalc_sources)
|
||||
|
||||
examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_builddir)/examples/rpcalc
|
||||
dist_TESTS += examples/rpcalc/rpcalc.test
|
||||
%C%_rpcalc_CPPFLAGS = -I$(top_builddir)/%D%
|
||||
dist_TESTS += %D%/rpcalc.test
|
||||
|
||||
## ------------ ##
|
||||
## Installing. ##
|
||||
## ------------ ##
|
||||
|
||||
rpcalcdir = $(docdir)/examples/rpcalc
|
||||
rpcalc_DATA = $(rpcalc_extracted)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015 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 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
+12
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2015 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
%debug
|
||||
%skeleton "lalr1.cc"
|
||||
%language "c++"
|
||||
%defines
|
||||
%define api.token.constructor
|
||||
%define api.value.type variant
|
||||
@@ -48,11 +48,17 @@ typedef std::list<std::string> strings_type;
|
||||
namespace std
|
||||
{
|
||||
std::ostream&
|
||||
operator<< (std::ostream& o, const strings_type& s)
|
||||
operator<< (std::ostream& o, const strings_type& ss)
|
||||
{
|
||||
std::copy (s.begin (), s.end (),
|
||||
std::ostream_iterator<strings_type::value_type> (o, "\n"));
|
||||
return o;
|
||||
o << "(" << &ss << ") {";
|
||||
const char *sep = "";
|
||||
for (strings_type::const_iterator i = ss.begin(), end = ss.end();
|
||||
i != end; ++i)
|
||||
{
|
||||
o << sep << *i;
|
||||
sep = ", ";
|
||||
}
|
||||
return o << "}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
Submodule gnulib updated: 03e96cc338...ea6cb044ca
+4
-2
@@ -211,8 +211,6 @@
|
||||
/stripslash.c
|
||||
/strndup.c
|
||||
/strnlen.c
|
||||
/strtol.c
|
||||
/strtoul.c
|
||||
/strverscmp.c
|
||||
/sys
|
||||
/sys_ioctl.h
|
||||
@@ -272,3 +270,7 @@
|
||||
/sig-handler.c
|
||||
/unistd.c
|
||||
/wctype-h.c
|
||||
/lstat.c
|
||||
/unlink.c
|
||||
/gettimeofday.c
|
||||
/sys_time.in.h
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Array bitsets.
|
||||
|
||||
Copyright (C) 2002-2003, 2006, 2009-2013 Free Software Foundation,
|
||||
Copyright (C) 2002-2003, 2006, 2009-2015 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support abitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Base bitset stuff.
|
||||
|
||||
Copyright (C) 2002-2004, 2006, 2009-2013 Free Software Foundation,
|
||||
Copyright (C) 2002-2004, 2006, 2009-2015 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* General bitsets.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Generic bitsets.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2004, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset statistics.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support bitset statistics.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2004, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2001-2002, 2004, 2006, 2009-2013 Free Software
|
||||
Copyright (C) 2001-2002, 2004, 2006, 2009-2015 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Akim Demaille (akim@freefriends.org).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2001-2002, 2004-2006, 2009-2013 Free Software
|
||||
Copyright (C) 2001-2002, 2004-2006, 2009-2015 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support expandable bitsets.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support ebitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* get-errno.c - get and set errno.
|
||||
|
||||
Copyright (C) 2002, 2006, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2006, 2009-2015 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-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2009-2015 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 @@
|
||||
/* Functions to support link list bitsets.
|
||||
|
||||
Copyright (C) 2002-2004, 2006, 2009-2013 Free Software Foundation,
|
||||
Copyright (C) 2002-2004, 2006, 2009-2015 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support lbitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Fake libiberty.h for Bison.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2004, 2009-2015 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
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2015 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
|
||||
@@ -51,6 +51,8 @@ lib_libbison_a_SOURCES += \
|
||||
lib/get-errno.c
|
||||
|
||||
# The Yacc compatibility library.
|
||||
lib_LIBRARIES = $(YACC_LIBRARY)
|
||||
if ENABLE_YACC
|
||||
lib_LIBRARIES = lib/liby.a
|
||||
EXTRA_LIBRARIES = lib/liby.a
|
||||
lib_liby_a_SOURCES = lib/main.c lib/yyerror.c
|
||||
endif
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Yacc library main function.
|
||||
|
||||
Copyright (C) 2002, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Timing variables for measuring compiler performance.
|
||||
|
||||
Copyright (C) 2000, 2002, 2004, 2006, 2009-2013 Free Software
|
||||
Copyright (C) 2000, 2002, 2004, 2006, 2009-2015 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/* This file contains the definitions for timing variables used to -*- C -*-
|
||||
measure run-time performance of the compiler.
|
||||
|
||||
Copyright (C) 2002, 2007, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2007, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Akim Demaille <akim@freefriends.org>.
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Timing variables for measuring compiler performance.
|
||||
|
||||
Copyright (C) 2000, 2002, 2004, 2009-2013 Free Software Foundation,
|
||||
Copyright (C) 2000, 2002, 2004, 2009-2015 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Variable array bitsets.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support vbitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user