mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-16 22:25:14 +00:00
Compare commits
394
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b63a84a5b | ||
|
|
a57ca64a80 | ||
|
|
560d4c8dd9 | ||
|
|
911497f140 | ||
|
|
3bed3a757f | ||
|
|
aa0cb40d61 | ||
|
|
f2b30bdf37 | ||
|
|
53f036ce02 | ||
|
|
8741288212 | ||
|
|
e6c849d82a | ||
|
|
b0778bdd0c | ||
|
|
d8911864c2 | ||
|
|
c2724603c9 | ||
|
|
17aed602c6 | ||
|
|
9142239a59 | ||
|
|
171ad99d64 | ||
|
|
d59e456dbf | ||
|
|
ceb8b8e6b5 | ||
|
|
7580c37942 | ||
|
|
c4dc4c4671 | ||
|
|
c67e466f9d | ||
|
|
af6d235843 | ||
|
|
91a2b9b1b2 | ||
|
|
13bcafb580 | ||
|
|
585935e895 | ||
|
|
83b60c97ee | ||
|
|
28169bab1f | ||
|
|
9f14e18736 | ||
|
|
d1b55e8115 | ||
|
|
838205d547 | ||
|
|
67af719840 | ||
|
|
c467dc420d | ||
|
|
dfaa48602d | ||
|
|
ce268795cc | ||
|
|
401b73afdf | ||
|
|
a1a9422d4a | ||
|
|
0b61a8ec18 | ||
|
|
269e222e24 | ||
|
|
35905f2b45 | ||
|
|
b30e18dc8a | ||
|
|
8d90395dd7 | ||
|
|
5add20ab89 | ||
|
|
ba4184ec91 | ||
|
|
91a2af9753 | ||
|
|
3208e3f4d9 | ||
|
|
13cdf208ed | ||
|
|
e459fb0e3c | ||
|
|
c4be551734 | ||
|
|
feeb56cd36 | ||
|
|
629e4def0c | ||
|
|
f7c0fe197b | ||
|
|
872b52bc24 | ||
|
|
83ea2423f5 | ||
|
|
5ece73eaa1 | ||
|
|
ad597a7877 | ||
|
|
2f5b478e4b | ||
|
|
31b850d2d4 | ||
|
|
d70059ec73 | ||
|
|
b9f1d9a47a | ||
|
|
b5c212b61a | ||
|
|
6750106107 | ||
|
|
4197678606 | ||
|
|
44bb908485 | ||
|
|
04d1e39dd3 | ||
|
|
a887366955 | ||
|
|
b584460cc3 | ||
|
|
8893145a0c | ||
|
|
92d7a23ace | ||
|
|
12cf133f34 | ||
|
|
796a2b0ab0 | ||
|
|
0b6d43c52f | ||
|
|
de5ab9400a | ||
|
|
f8e7258f7f | ||
|
|
b987342bab | ||
|
|
4977e0a7d9 | ||
|
|
9b04dad70a | ||
|
|
4c6622c2dd | ||
|
|
3c248d705d | ||
|
|
99c08fb662 | ||
|
|
ab2a9f5793 | ||
|
|
84a1cb5ad0 | ||
|
|
cdf3f11338 | ||
|
|
98a345a219 | ||
|
|
6721294104 | ||
|
|
ba5c6d94b6 | ||
|
|
5bab9d0862 | ||
|
|
d521ee19f8 | ||
|
|
c9aded4b88 | ||
|
|
8f0d265e9d | ||
|
|
f49097730e | ||
|
|
110ef36a1a | ||
|
|
746ee38c7c | ||
|
|
eb45ef3ba6 | ||
|
|
db34f79889 | ||
|
|
7fe11bb55c | ||
|
|
7254f6a840 | ||
|
|
72e727f2ec | ||
|
|
90462b8dd9 | ||
|
|
71b00ed874 | ||
|
|
1c72905811 | ||
|
|
4f646c3794 | ||
|
|
184e317956 | ||
|
|
41253c3a9d | ||
|
|
197b82ba54 | ||
|
|
16dc0d9025 | ||
|
|
0c90a1f5e9 | ||
|
|
fa81950916 | ||
|
|
f7dae1ea51 | ||
|
|
3535c0714e | ||
|
|
cf48f6755c | ||
|
|
50cca36825 | ||
|
|
3583d96b77 | ||
|
|
00f5d57533 | ||
|
|
76bf510242 | ||
|
|
bc0f573730 | ||
|
|
697c912fa4 | ||
|
|
4920ae8b66 | ||
|
|
1d5b3c08fe | ||
|
|
62c99cf4ea | ||
|
|
1c93f35bfa | ||
|
|
86cfae0a48 | ||
|
|
ba061fa6f2 | ||
|
|
b19ebeb335 | ||
|
|
001a16a9cd | ||
|
|
0ce615753e | ||
|
|
dc450175c0 | ||
|
|
b3a2272a73 | ||
|
|
92822affc5 | ||
|
|
e021191bcf | ||
|
|
78f654185a | ||
|
|
f7e241f4af | ||
|
|
1f9d82480e | ||
|
|
31d3e51094 | ||
|
|
81535bfa35 | ||
|
|
56f772e95e | ||
|
|
11c073b7e5 | ||
|
|
91be6b283e | ||
|
|
cbf25ce74f | ||
|
|
882f02ed83 | ||
|
|
0623bacc05 | ||
|
|
5f5a90dff6 | ||
|
|
b47b6ff7fd | ||
|
|
1d6b689b26 | ||
|
|
4f84717d23 | ||
|
|
b9e4eb5b72 | ||
|
|
6a6e7f0c65 | ||
|
|
e9e61b0002 | ||
|
|
3eead995a4 | ||
|
|
87f28efe7e | ||
|
|
9be2a009c4 | ||
|
|
07a6e87d46 | ||
|
|
33c78bd23e | ||
|
|
49572920dd | ||
|
|
88654b47c9 | ||
|
|
4524c55bcf | ||
|
|
6ceccee88d | ||
|
|
9c6a89660e | ||
|
|
507aa0e2a8 | ||
|
|
51bacae6b5 | ||
|
|
06c3084fb5 | ||
|
|
253192e69a | ||
|
|
0ea583d250 | ||
|
|
402b123d0c | ||
|
|
74553c98a2 | ||
|
|
84eedf86fe | ||
|
|
5860cc8c1c | ||
|
|
2b008529ed | ||
|
|
2cd1af957a | ||
|
|
eeb2942237 | ||
|
|
e5fa6147ef | ||
|
|
6617622c9a | ||
|
|
2ca1136c7c | ||
|
|
6c63b895fb | ||
|
|
417e31d2c3 | ||
|
|
97abf54412 | ||
|
|
e8cd1ad655 | ||
|
|
ce9447fc6a | ||
|
|
d333175f63 | ||
|
|
215b40ac9e | ||
|
|
30c10fafcc | ||
|
|
3bb211139b | ||
|
|
fb7c5b1f23 | ||
|
|
cf6fb2226d | ||
|
|
e3c52a6362 | ||
|
|
2bde91138d | ||
|
|
44494bf684 | ||
|
|
fad814bd0c | ||
|
|
feda5527b3 | ||
|
|
56ddee7f8d | ||
|
|
728e89a09b | ||
|
|
2c1bf9bd68 | ||
|
|
ba206cf40a | ||
|
|
d12f8e4940 | ||
|
|
0991e29b75 | ||
|
|
3d3bc1fe30 | ||
|
|
08c81469c6 | ||
|
|
932b0c960a | ||
|
|
8452c667e6 | ||
|
|
783aa653f4 | ||
|
|
6130b75585 | ||
|
|
95a7b1c934 | ||
|
|
b4f1840114 | ||
|
|
c265fd6beb | ||
|
|
68dbdee86a | ||
|
|
6ab1adbe1e | ||
|
|
0fddb3d59f | ||
|
|
c4ddc0fb0b | ||
|
|
e0c653e7e6 | ||
|
|
4182a0a186 | ||
|
|
01466c3ebe | ||
|
|
a7c09cba09 | ||
|
|
6c88b51e83 | ||
|
|
1e03480793 | ||
|
|
e3dda35c52 | ||
|
|
bd187d7b65 | ||
|
|
6085ab0d78 | ||
|
|
9ce405ce1d | ||
|
|
a8beef7e6a | ||
|
|
d50eea6df5 | ||
|
|
f5f419debe | ||
|
|
d73e55e022 | ||
|
|
68c989dea9 | ||
|
|
90290ce5dd | ||
|
|
23ce6f4cb3 | ||
|
|
c5fc95d688 | ||
|
|
dd704c3561 | ||
|
|
dab244d548 | ||
|
|
4b4da9fb83 | ||
|
|
4ea3f53d26 | ||
|
|
b06df3c2c7 | ||
|
|
cb823b6f0c | ||
|
|
7b6e67533e | ||
|
|
dddec53788 | ||
|
|
7d3e21ba7b | ||
|
|
4fc55348e5 | ||
|
|
070e650956 | ||
|
|
0078681b6b | ||
|
|
ff084799a3 | ||
|
|
b0d79ec65d | ||
|
|
d4977ce3e7 | ||
|
|
87f1149ae2 | ||
|
|
3641590697 | ||
|
|
e2c2f69650 | ||
|
|
2ead32e61c | ||
|
|
2df9ec3774 | ||
|
|
0305d25eb0 | ||
|
|
5277c0a304 | ||
|
|
6a5aa0cdbb | ||
|
|
7cb794dcdd | ||
|
|
cd409e3b50 | ||
|
|
9a1e42148a | ||
|
|
0634493cdd | ||
|
|
fe1b448ada | ||
|
|
5679f31101 | ||
|
|
3204049e31 | ||
|
|
202598d3ab | ||
|
|
fc2476c7cd | ||
|
|
865f1e9f85 | ||
|
|
cb0b136a63 | ||
|
|
2c086d2959 | ||
|
|
1c4af3813e | ||
|
|
e51b0a82be | ||
|
|
788355718f | ||
|
|
c1e6c88ca3 | ||
|
|
4654b0c0a8 | ||
|
|
dd735e4ee6 | ||
|
|
6659366cda | ||
|
|
e9805e5743 | ||
|
|
aea10ef46f | ||
|
|
086fd1137d | ||
|
|
2ea7730c56 | ||
|
|
7ca2266adc | ||
|
|
1a7a65f9d5 | ||
|
|
c944f7f22d | ||
|
|
dada3cd19e | ||
|
|
422c18f48d | ||
|
|
a0ffc1751e | ||
|
|
00a8a0832d | ||
|
|
0927787504 | ||
|
|
64c1b92a4f | ||
|
|
2722aa42bd | ||
|
|
918eb7c5ae | ||
|
|
39be90223b | ||
|
|
a2e3fa7768 | ||
|
|
aba12ad162 | ||
|
|
27cb5b5901 | ||
|
|
fce629c0ef | ||
|
|
ce6719605b | ||
|
|
2873fdf8b1 | ||
|
|
8be046d7b8 | ||
|
|
de62edee66 | ||
|
|
11707b2b48 | ||
|
|
905f069774 | ||
|
|
09ccae9b18 | ||
|
|
1979121c96 | ||
|
|
42f832d680 | ||
|
|
247efe346c | ||
|
|
5d73144067 | ||
|
|
21db118b64 | ||
|
|
6ed15cde29 | ||
|
|
30bb2edccf | ||
|
|
b3a28fd4e9 | ||
|
|
914202bdac | ||
|
|
c17f9a4a62 | ||
|
|
b9855ea55b | ||
|
|
6e0977873a | ||
|
|
4c3cc7da5d | ||
|
|
d69c9694a7 | ||
|
|
5263bea9f7 | ||
|
|
4175f6bba2 | ||
|
|
1de69d6a33 | ||
|
|
36db78a733 | ||
|
|
e5eb92e794 | ||
|
|
763074102b | ||
|
|
f7398526b6 | ||
|
|
d78f0ac9d8 | ||
|
|
c85be41a07 | ||
|
|
db65ca1f12 | ||
|
|
9b0efa5bc2 | ||
|
|
432ac57aaa | ||
|
|
deef2a0a4d | ||
|
|
df72984aa5 | ||
|
|
f10e19fd1a | ||
|
|
5de9c59301 | ||
|
|
757f8f98fc | ||
|
|
d3be4f6d42 | ||
|
|
1f7d007bf6 | ||
|
|
bc0b0477e2 | ||
|
|
57295d14f9 | ||
|
|
e9b0834e18 | ||
|
|
6082531abb | ||
|
|
33c195cc37 | ||
|
|
e1f93869da | ||
|
|
2935744b3a | ||
|
|
bbf9ca3740 | ||
|
|
d9a9b96bb5 | ||
|
|
5136519230 | ||
|
|
9380cfd008 | ||
|
|
8901f32e4a | ||
|
|
8cdabf02ea | ||
|
|
5a893c2b26 | ||
|
|
58697c6d89 | ||
|
|
9fe5a4571e | ||
|
|
56c5eca973 | ||
|
|
9b9e0a7d46 | ||
|
|
74eae918c3 | ||
|
|
a3d4c6fbb1 | ||
|
|
2d32fc9fe2 | ||
|
|
f6038cb8c3 | ||
|
|
ccde1f98b0 | ||
|
|
58bd33b7fc | ||
|
|
639867b52f | ||
|
|
3c26260608 | ||
|
|
a2b93d5278 | ||
|
|
3a2803df74 | ||
|
|
a0d4650a09 | ||
|
|
cac9e09bbf | ||
|
|
4af4348a3f | ||
|
|
ef05c4d6f9 | ||
|
|
9718cfa902 | ||
|
|
a6df593dfe | ||
|
|
006a030300 | ||
|
|
faef34664a | ||
|
|
2141adedf4 | ||
|
|
e426d17bc5 | ||
|
|
a9ce3f5413 | ||
|
|
59c544c268 | ||
|
|
96b15448b9 | ||
|
|
f063317430 | ||
|
|
417b80040b | ||
|
|
1a5246c66f | ||
|
|
f8a95c9c12 | ||
|
|
d7f4d82382 | ||
|
|
8b9c89fb65 | ||
|
|
83243c24ba | ||
|
|
429b4848d4 | ||
|
|
414c76a461 | ||
|
|
8a5783fd0c | ||
|
|
0cc5bead40 | ||
|
|
5b421a4e8e | ||
|
|
d11ee647c3 | ||
|
|
e1b74b92a0 | ||
|
|
7e5f9c54c0 | ||
|
|
7109a18d18 | ||
|
|
922730fe36 | ||
|
|
7484f1d4f3 | ||
|
|
15129f2525 | ||
|
|
0e0ed236ab | ||
|
|
7dedf26e55 | ||
|
|
c4585f1e2d | ||
|
|
56017c172b | ||
|
|
5ab8c47bcf | ||
|
|
1fa5d8bbf9 | ||
|
|
91ba8a55b1 |
+32
@@ -0,0 +1,32 @@
|
|||||||
|
*.cache
|
||||||
|
*.flc
|
||||||
|
*.prj
|
||||||
|
*~
|
||||||
|
.tarball-version
|
||||||
|
.version
|
||||||
|
ABOUT-NLS
|
||||||
|
COPYING
|
||||||
|
GNUmakefile
|
||||||
|
INSTALL
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
_*
|
||||||
|
a.exe
|
||||||
|
a.out
|
||||||
|
aclocal.m4
|
||||||
|
b.out
|
||||||
|
bison-*
|
||||||
|
conf[0-9]*
|
||||||
|
confdefs*
|
||||||
|
config.log
|
||||||
|
config.status
|
||||||
|
configure
|
||||||
|
configure.lineno
|
||||||
|
conftest*
|
||||||
|
gnulib
|
||||||
|
javacomp.sh
|
||||||
|
javaexec.sh
|
||||||
|
maint.mk
|
||||||
|
patches
|
||||||
|
releases
|
||||||
|
stamp-h*
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
|
ChangeLog merge=merge-changelog
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
/.version
|
/.version
|
||||||
/ABOUT-NLS
|
/ABOUT-NLS
|
||||||
/COPYING
|
/COPYING
|
||||||
/ChangeLog
|
|
||||||
/GNUmakefile
|
/GNUmakefile
|
||||||
/INSTALL
|
/INSTALL
|
||||||
/Makefile
|
/Makefile
|
||||||
@@ -31,4 +30,3 @@
|
|||||||
/patches
|
/patches
|
||||||
/releases
|
/releases
|
||||||
/stamp-h*
|
/stamp-h*
|
||||||
/README-release
|
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
2.5.91
|
2.3b
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
COPYING
|
COPYING
|
||||||
^bootstrap$
|
|
||||||
^doc/fdl\.texi$
|
^doc/fdl\.texi$
|
||||||
^doc/gpl-3\.0\.texi$
|
^doc/gpl-3\.0\.texi$
|
||||||
^doc/yacc\.1\.in$
|
^doc/yacc\.1\.in$
|
||||||
|
|||||||
@@ -5,38 +5,4 @@ Bison was written primarily by Robert Corbett.
|
|||||||
Richard Stallman made it Yacc-compatible.
|
Richard Stallman made it Yacc-compatible.
|
||||||
|
|
||||||
Wilfred Hansen of Carnegie Mellon University added multicharacter
|
Wilfred Hansen of Carnegie Mellon University added multicharacter
|
||||||
string literals and other features (Bison 1.25, 1995).
|
string literals and other features.
|
||||||
|
|
||||||
Akim Demaille rewrote the parser in Bison, and changed the back end to
|
|
||||||
use M4 (1.50, 2002).
|
|
||||||
|
|
||||||
Paul Hilfinger added GLR support (Bison 1.50, 2002).
|
|
||||||
|
|
||||||
Joel E. Denny contributed canonical-LR support, and invented and added
|
|
||||||
IELR and LAC (Lookahead Correction) support (Bison 2.5, 2011).
|
|
||||||
|
|
||||||
Paolo Bonzini contributed Java support (Bison 2.4, 2008).
|
|
||||||
|
|
||||||
Alex Rozenman added named reference support (Bison 2.5, 2011).
|
|
||||||
|
|
||||||
Paul Eggert fixed a million portability issues, arbitrary limitations,
|
|
||||||
and nasty bugs.
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 1998-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|||||||
+2491
-2265
File diff suppressed because it is too large
Load Diff
+94
-144
@@ -1,3 +1,5 @@
|
|||||||
|
-*- outline -*-
|
||||||
|
|
||||||
This file attempts to describe the rules to use when hacking Bison.
|
This file attempts to describe the rules to use when hacking Bison.
|
||||||
Don't put this file into the distribution.
|
Don't put this file into the distribution.
|
||||||
|
|
||||||
@@ -13,16 +15,25 @@ First, if it is a large change, you must make sure they have signed
|
|||||||
the appropriate paperwork. Second, be sure to add their name and
|
the appropriate paperwork. Second, be sure to add their name and
|
||||||
email address to THANKS.
|
email address to THANKS.
|
||||||
|
|
||||||
** If a change fixes a test, mention the test in the commit message.
|
** If a change fixes a test, mention the test in the ChangeLog entry.
|
||||||
|
|
||||||
** Bug reports
|
** Bug reports
|
||||||
If somebody reports a new bug, mention his name in the commit message
|
If somebody reports a new bug, mention his name in the ChangeLog entry
|
||||||
and in the test case you write. Put him into THANKS.
|
and in the test case you write. Put him into THANKS.
|
||||||
|
|
||||||
The correct response to most actual bugs is to write a new test case
|
The correct response to most actual bugs is to write a new test case
|
||||||
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
||||||
and check everything in.
|
and check everything in.
|
||||||
|
|
||||||
|
** You may find it useful to install the git-merge-changelog merge driver:
|
||||||
|
|
||||||
|
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/git-merge-changelog.c
|
||||||
|
|
||||||
|
When following the generic installation instructions there, keep in mind that
|
||||||
|
your clone of Bison's git repository already contains appropriate
|
||||||
|
.gitattributes files, and running Bison's bootstrap script will make the
|
||||||
|
necessary changes to .git/config.
|
||||||
|
|
||||||
|
|
||||||
* Hacking
|
* Hacking
|
||||||
|
|
||||||
@@ -58,8 +69,8 @@ tools we depend upon, including:
|
|||||||
- Rsync <http://samba.anu.edu.au/rsync/>
|
- Rsync <http://samba.anu.edu.au/rsync/>
|
||||||
- Tar <http://www.gnu.org/software/tar/>
|
- Tar <http://www.gnu.org/software/tar/>
|
||||||
|
|
||||||
Valgrind <http://valgrind.org/> is also highly recommended, if it supports
|
Valgrind <http://valgrind.org/> is also highly recommended, if
|
||||||
your architecture.
|
Valgrind supports your architecture.
|
||||||
|
|
||||||
Bison is written using Bison grammars, so there are bootstrapping
|
Bison is written using Bison grammars, so there are bootstrapping
|
||||||
issues. The bootstrap script attempts to discover when the C code
|
issues. The bootstrap script attempts to discover when the C code
|
||||||
@@ -68,9 +79,8 @@ out-of-date version of the C code, but the process is not foolproof.
|
|||||||
Also, you may run into similar problems yourself if you modify Bison.
|
Also, you may run into similar problems yourself if you modify Bison.
|
||||||
|
|
||||||
Only building the initial full source tree will be a bit painful.
|
Only building the initial full source tree will be a bit painful.
|
||||||
Later, after synchronizing from the repository a plain 'make' should
|
Later, after synchronizing from the repository a plain `make' should
|
||||||
be sufficient. Note, however, that when gnulib is updated, running
|
be sufficient.
|
||||||
'./bootstrap' again might be needed.
|
|
||||||
|
|
||||||
** First checkout
|
** First checkout
|
||||||
|
|
||||||
@@ -117,14 +127,14 @@ explicitly by the user.
|
|||||||
|
|
||||||
*** Updating Bison
|
*** Updating Bison
|
||||||
|
|
||||||
If you pull a newer version of a branch, say via "git pull", you might
|
If you pull a newer version of a branch, say via `git pull', you might
|
||||||
import requests for updated submodules. A simple "git diff" will
|
import requests for updated submodules. A simple `git diff' will
|
||||||
reveal if the current version of the submodule (i.e., the actual
|
reveal if the current version of the submodule (i.e., the actual
|
||||||
contents of the gnulib directory) and the current request from the
|
contents of the gnulib directory) and the current request from the
|
||||||
subscriber (i.e., the reference of the version of gnulib that the
|
subscriber (i.e., the reference of the version of gnulib that the
|
||||||
Bison repository requests) differ. To upgrade the submodules (i.e.,
|
Bison reporitory requests) differ. To upgrade the submodules (i.e.,
|
||||||
to check out the version that is actually requested by the subscriber,
|
to check out the version that is actually requested by the subscriber,
|
||||||
run "git submodule update".
|
run `git submodule update'.
|
||||||
|
|
||||||
$ git pull
|
$ git pull
|
||||||
$ git submodule update
|
$ git submodule update
|
||||||
@@ -148,43 +158,12 @@ Register your changes.
|
|||||||
|
|
||||||
$ git checkin ...
|
$ git checkin ...
|
||||||
|
|
||||||
For a suggestion of what gnulib commit might be stable enough for a
|
|
||||||
formal release, see the ChangeLog in the latest gnulib snapshot at:
|
|
||||||
|
|
||||||
http://erislabs.net/ianb/projects/gnulib/
|
|
||||||
|
|
||||||
The Autoconf files we use are currently:
|
|
||||||
|
|
||||||
m4/m4.m4
|
|
||||||
lib/m4sugar/m4sugar.m4
|
|
||||||
lib/m4sugar/foreach.m4
|
|
||||||
|
|
||||||
These files don't change very often in Autoconf, so it should be
|
|
||||||
relatively straight-forward to examine the differences in order to
|
|
||||||
decide whether to update.
|
|
||||||
|
|
||||||
* Test suite
|
* Test suite
|
||||||
|
|
||||||
** make check
|
** make check
|
||||||
Use liberally.
|
Use liberally.
|
||||||
|
|
||||||
** make maintainer-check-valgrind
|
|
||||||
This target uses valgrind both to check bison, and the generated parsers.
|
|
||||||
|
|
||||||
This is not mature on Mac OS X. First, Valgrind does support the way bison
|
|
||||||
calls m4, so Valgrind cannot be used to check bison on Mac OS X.
|
|
||||||
|
|
||||||
Second, there are many errors that come from the platform itself, not from
|
|
||||||
bison. build-aux/darwin11.4.0.valgrind addresses some of them.
|
|
||||||
|
|
||||||
Third, valgrind issues warnings such as:
|
|
||||||
|
|
||||||
--99312:0:syswrap- WARNING: Ignoring sigreturn( ..., UC_RESET_ALT_STACK );
|
|
||||||
|
|
||||||
which cause the test to fail uselessly. It is hard to ignore these errors
|
|
||||||
with a major overhaul of the way instrumentation is performed in the test
|
|
||||||
suite. So currently, do not try to run valgrind on Mac OS X.
|
|
||||||
|
|
||||||
** Release checks
|
** Release checks
|
||||||
Try to run the test suite with more severe conditions before a
|
Try to run the test suite with more severe conditions before a
|
||||||
release:
|
release:
|
||||||
@@ -193,120 +172,104 @@ release:
|
|||||||
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
||||||
cleanly too.
|
cleanly too.
|
||||||
|
|
||||||
- Maybe build with -DGNULIB_POSIXCHECK, which suggests gnulib modules
|
- run `make maintainer-check' which:
|
||||||
that can fix portability issues. See if you really want to pay
|
- runs `valgrind -q bison' to run Bison under Valgrind.
|
||||||
attention to its warnings; there's no need to obey blindly to it
|
|
||||||
(<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00057.html>).
|
|
||||||
|
|
||||||
- Check with "make syntax-check" if there are issues diagnosed by
|
|
||||||
gnulib.
|
|
||||||
|
|
||||||
- run "make maintainer-check" which:
|
|
||||||
- runs "valgrind -q bison" to run Bison under Valgrind.
|
|
||||||
- runs the parsers under Valgrind.
|
- runs the parsers under Valgrind.
|
||||||
- runs the test suite with G++ as C compiler...
|
- runs the test suite with G++ as C compiler...
|
||||||
|
|
||||||
- run "make maintainer-push-check", which runs "make maintainer-check"
|
- run `make maintainer-push-check', which runs `make maintainer-check'
|
||||||
while activating the push implementation and its pull interface wrappers
|
while activating the push implementation and its pull interface wrappers
|
||||||
in many test cases that were originally written to exercise only the
|
in many test cases that were originally written to exercise only the
|
||||||
pull implementation. This makes certain the push implementation can
|
pull implementation. This makes certain the push implementation can
|
||||||
perform every task the pull implementation can.
|
perform every task the pull implementation can.
|
||||||
|
|
||||||
- run "make maintainer-xml-check", which runs "make maintainer-check"
|
- run `make maintainer-xml-check', which runs `make maintainer-check'
|
||||||
while checking Bison's XML automaton report for every working grammar
|
while checking Bison's XML automaton report for every working grammar
|
||||||
passed to Bison in the test suite. The check just diffs the output of
|
passed to Bison in the test suite. The check just diffs the output of
|
||||||
Bison's included XSLT style sheets with the output of --report=all and
|
Bison's included XSLT style sheets with the output of --report=all and
|
||||||
--graph.
|
--graph.
|
||||||
|
|
||||||
- running "make maintainer-release-check" takes care of running
|
|
||||||
maintainer-check, maintainer-push-check and maintainer-xml-check.
|
|
||||||
|
|
||||||
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
||||||
instance, "-traditional" to check that the parsers are K&R. Note
|
instance, `-traditional' to check that the parsers are K&R. Note
|
||||||
that it does not make sense for glr.c, which should be ANSI, but
|
that it does not make sense for glr.c, which should be ANSI,
|
||||||
currently is actually GNU C, nor for lalr1.cc.
|
but currently is actually GNU C, nor for lalr1.cc.
|
||||||
|
|
||||||
|
|
||||||
* Release Procedure
|
* Release Procedure
|
||||||
This section needs to be updated to take into account features from
|
|
||||||
gnulib. In particular, be sure to read README-release.
|
|
||||||
|
|
||||||
** Update the submodules. See above.
|
** Try to get the *.pot files to the Translation Project at least one week
|
||||||
|
before a stable release, to give them time to translate them.
|
||||||
** Update maintainer tools, such as Autoconf. See above.
|
|
||||||
|
|
||||||
** Try to get the *.pot files to the Translation Project at least one
|
|
||||||
week before a stable release, to give them time to translate them.
|
|
||||||
Before generating the *.pot files, make sure that po/POTFILES.in and
|
|
||||||
runtime-po/POTFILES.in list all files with translatable strings.
|
|
||||||
This helps: grep -l '\<_(' *
|
|
||||||
|
|
||||||
** Tests
|
** Tests
|
||||||
See above.
|
See above.
|
||||||
|
|
||||||
** Update the foreign files
|
** Update the foreign files
|
||||||
Running "./bootstrap" in the top level should update them all for you.
|
Running `./bootstrap' in the top level should update them all for you.
|
||||||
This covers PO files too. Sometimes a PO file contains problems that
|
This covers PO files too. Sometimes a PO file contains problems that
|
||||||
causes it to be rejected by recent Gettext releases; please report
|
causes it to be rejected by recent Gettext releases; please report
|
||||||
these to the Translation Project.
|
these to the Translation Project.
|
||||||
|
|
||||||
** Update README
|
** Update README
|
||||||
Make sure the information in README is current. Most notably, make sure
|
Make sure the information in this file is current. Most notably, make sure it
|
||||||
it recommends a version of GNU M4 that is compatible with the latest
|
recommends a version of GNU M4 that is compatible with the latest Bison
|
||||||
Bison sources.
|
sources.
|
||||||
|
|
||||||
** Check copyright years.
|
** Update NEWS
|
||||||
We update years in copyright statements throughout Bison once at the
|
The version number, *and* the date of the release (including for
|
||||||
start of every year by running "make update-copyright". However, before
|
betas).
|
||||||
a release, it's good to verify that it's actually been run. Besides the
|
|
||||||
copyright statement for each Bison file, check the copyright statements
|
|
||||||
that the skeletons insert into generated parsers, and check all
|
|
||||||
occurrences of PACKAGE_COPYRIGHT_YEAR in configure.ac.
|
|
||||||
|
|
||||||
** Update NEWS, commit and tag.
|
** Update ChangeLog
|
||||||
See do-release-commit-and-tag in README-release. For a while, we used
|
Should have an entry similar to `Version 1.49b.'.
|
||||||
beta names such as "2.6_rc1". Now that we use gnulib in the release
|
|
||||||
procedure, we must use "2.5.90", which has the additional benefit of
|
|
||||||
being properly sorted in "git tag -l".
|
|
||||||
|
|
||||||
** make alpha, beta, or stable
|
** Update configure.ac
|
||||||
See README-release.
|
Be sure PACKAGE_COPYRIGHT_YEAR is up-to-date.
|
||||||
|
|
||||||
|
** Tag the release
|
||||||
|
Before Bison will build with the right version number, you must tag the release
|
||||||
|
in git. Do this after all other changes. The command is similar to:
|
||||||
|
|
||||||
|
git tag -a v2.3b
|
||||||
|
|
||||||
|
The log message can be simply:
|
||||||
|
|
||||||
|
Bison 2.3b
|
||||||
|
|
||||||
|
** Push
|
||||||
|
Once `make distcheck' passes, push your changes and the tag.
|
||||||
|
`git push' without arguments will not push the tag.
|
||||||
|
|
||||||
|
** make alpha
|
||||||
|
FIXME: `make alpha' is not maintained and is broken. These
|
||||||
|
instructions need to be replaced or removed.
|
||||||
|
|
||||||
|
Running `make alpha' is absolutely perfect for beta releases: it makes
|
||||||
|
the tarballs, the xdeltas, and prepares (in /tmp/) a proto
|
||||||
|
announcement. It is so neat, that that's what I use anyway for
|
||||||
|
genuine releases, but adjusting things by hand (e.g., the urls in the
|
||||||
|
announcement file, the ChangeLog which is not needed etc.).
|
||||||
|
|
||||||
|
If it fails, you're on your own...
|
||||||
|
|
||||||
|
It requires GNU Make.
|
||||||
|
|
||||||
** Upload
|
** Upload
|
||||||
There are two ways to upload the tarballs to the GNU servers: using
|
The generic GNU upload procedure is at:
|
||||||
gnupload (from gnulib), or by hand. Obviously prefer the former. But
|
|
||||||
in either case, be sure to read the following paragraph.
|
|
||||||
|
|
||||||
*** Setup
|
http://www.gnu.org/prep/maintain/maintain.html#Automated-FTP-Uploads
|
||||||
You need "gnupg".
|
|
||||||
|
|
||||||
Make sure your public key has been uploaded at least to
|
Follow the instructions there to register your information so you're permitted
|
||||||
|
to upload. Make sure your public key has been uploaded at least to
|
||||||
keys.gnupg.net. You can upload it with:
|
keys.gnupg.net. You can upload it with:
|
||||||
|
|
||||||
gpg --keyserver keys.gnupg.net --send-keys F125BDF3
|
gpg --keyserver keys.gnupg.net --send-keys F125BDF3
|
||||||
|
|
||||||
where F125BDF3 should be replaced with your key ID.
|
where F125BDF3 should be replaced with your key ID.
|
||||||
|
|
||||||
*** Using gnupload
|
|
||||||
You need "ncftp".
|
|
||||||
|
|
||||||
At the end "make stable" (or alpha/beta) will display the procedure to
|
|
||||||
run. Just copy and paste it in your shell.
|
|
||||||
|
|
||||||
*** By hand
|
|
||||||
|
|
||||||
The generic GNU upload procedure is at:
|
|
||||||
|
|
||||||
http://www.gnu.org/prep/maintain/maintain.html#Automated-FTP-Uploads
|
|
||||||
|
|
||||||
Follow the instructions there to register your information so you're permitted
|
|
||||||
to upload.
|
|
||||||
|
|
||||||
Here's a brief reminder of how to roll the tarballs and upload them:
|
Here's a brief reminder of how to roll the tarballs and upload them:
|
||||||
|
|
||||||
*** make distcheck
|
*** make distcheck
|
||||||
*** gpg -b bison-2.3b.tar.gz
|
*** gpg -b bison-2.3b.tar.gz
|
||||||
*** In a file named "bison-2.3b.tar.gz.directive", type:
|
*** In a file named `bison-2.3b.tar.gz.directive', type:
|
||||||
|
|
||||||
version: 1.1
|
version: 1.1
|
||||||
directory: bison
|
directory: bison
|
||||||
@@ -318,7 +281,7 @@ Here's a brief reminder of how to roll the tarballs and upload them:
|
|||||||
*** put bison-2.3b.tar.gz # This can take a while.
|
*** put bison-2.3b.tar.gz # This can take a while.
|
||||||
*** put bison-2.3b.tar.gz.sig
|
*** put bison-2.3b.tar.gz.sig
|
||||||
*** put bison-2.3b.tar.gz.directive.asc
|
*** put bison-2.3b.tar.gz.directive.asc
|
||||||
*** Repeat all these steps for bison-2.3b.tar.xz.
|
*** Repeat all these steps for bison-2.3b.tar.bz2.
|
||||||
|
|
||||||
** Update Bison manual on www.gnu.org.
|
** Update Bison manual on www.gnu.org.
|
||||||
|
|
||||||
@@ -362,39 +325,37 @@ function 'index', once for the table of contents); you can ignore this
|
|||||||
issue.
|
issue.
|
||||||
|
|
||||||
** Announce
|
** Announce
|
||||||
The "make stable" (or alpha/beta) command just created a template,
|
To generate a template announcement file:
|
||||||
$HOME/announce-bison-X.Y. Otherwise, to generate it, run:
|
|
||||||
|
|
||||||
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
|
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
|
||||||
|
|
||||||
where alpha can be replaced by beta or stable and F125BDF3 should be
|
where alpha can be replaced by beta or major and F125BDF3 should be replaced
|
||||||
replaced with your key ID.
|
with your key ID. For an example of how to fill out the template, search the
|
||||||
|
mailing list archives for the most recent release announcement.
|
||||||
|
|
||||||
Complete/fix the announcement file. The generated list of recipients
|
Complete/fix the announcement file, and send it at least to
|
||||||
([email protected], [email protected], [email protected],
|
[email protected] (if a real release, or a ``serious beta''),
|
||||||
bison-patches@gnu.org, and [email protected]) is
|
bug-[email protected], [email protected], [email protected],
|
||||||
appropriate for a stable release or a "serious beta". For any other
|
and [email protected].
|
||||||
release, drop at least [email protected]. For an example of how to
|
|
||||||
fill out the rest of the template, search the mailing list archives
|
|
||||||
for the most recent release announcement.
|
|
||||||
|
|
||||||
For a stable release, send the same announcement on the comp.compilers
|
Send the same announcement on the comp.compilers newsgroup by sending
|
||||||
newsgroup by sending email to [email protected]. Do not make any Cc as
|
email to [email protected]. Do not make any Cc as the moderator will
|
||||||
the moderator will throw away anything cross-posted or Cc'ed. It really
|
throw away anything cross-posted or Cc'ed. It really needs to be a
|
||||||
needs to be a separate message.
|
separate message.
|
||||||
|
|
||||||
** Prepare NEWS
|
** Bump the version number
|
||||||
So that developers don't accidentally add new items to the old NEWS
|
In configure.ac. Run `make'. So that developers don't accidentally add new
|
||||||
entry, create a new empty entry in line 3 (without the two leading
|
items to the old NEWS entry, create a new empty NEWS entry something like:
|
||||||
spaces):
|
|
||||||
|
|
||||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
Changes in version ?.? (????-??-??):
|
||||||
|
|
||||||
Push these changes.
|
Push these changes.
|
||||||
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002-2005, 2007-2012 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
@@ -410,14 +371,3 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
LocalWords: Automake Autoconf Gettext Gzip Rsync Valgrind gnulib submodules
|
|
||||||
LocalWords: submodule init cd distcheck checkin ChangeLog valgrind sigreturn
|
|
||||||
LocalWords: UC gcc DGNULIB POSIXCHECK xml XSLT glr lalr README po runtime rc
|
|
||||||
LocalWords: gnupload gnupg gpg keyserver BDF ncftp filename clearsign cvs dir
|
|
||||||
LocalWords: symlinks vti html lt POSIX Cc'ed
|
|
||||||
|
|
||||||
Local Variables:
|
|
||||||
mode: outline
|
|
||||||
fill-column: 76
|
|
||||||
End:
|
|
||||||
+43
-53
@@ -1,43 +1,51 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
|
## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||||
|
## Free Software Foundation, Inc.
|
||||||
|
|
||||||
## Copyright (C) 2001-2012 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
|
||||||
# This program is free software: you can redistribute it and/or modify
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
# it under the terms of the GNU General Public License as published by
|
## (at your option) any later version.
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
##
|
||||||
# (at your option) any later version.
|
## This program is distributed in the hope that it will be useful,
|
||||||
#
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# This program is distributed in the hope that it will be useful,
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
## GNU General Public License for more details.
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
##
|
||||||
# GNU General Public License for more details.
|
## You should have received a copy of the GNU General Public License
|
||||||
#
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
SUBDIRS = build-aux po runtime-po lib data src doc examples tests etc
|
SUBDIRS = po runtime-po .
|
||||||
|
if BISON_CXX_WORKS
|
||||||
|
SUBDIRS += examples/calc++
|
||||||
|
endif
|
||||||
|
|
||||||
# Files installed for use by Automake.
|
# Files installed for use by Automake.
|
||||||
aclocaldir = @aclocaldir@
|
aclocaldir = @aclocaldir@
|
||||||
aclocal_DATA = m4/bison-i18n.m4
|
aclocal_DATA = m4/bison-i18n.m4
|
||||||
|
|
||||||
EXTRA_DIST = .prev-version .version \
|
EXTRA_DIST = .prev-version .version \
|
||||||
cfg.mk ChangeLog-1998 ChangeLog-2012 PACKAGING \
|
cfg.mk \
|
||||||
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
OChangeLog PACKAGING
|
||||||
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
|
||||||
djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \
|
|
||||||
djgpp/fnchange.lst djgpp/testsuite.sed
|
|
||||||
|
|
||||||
MAINTAINER_CHECKS = \
|
# Initialization before completion by local.mk's.
|
||||||
maintainer-check \
|
AM_CFLAGS = $(WARN_CFLAGS)
|
||||||
maintainer-push-check \
|
AM_CPPFLAGS =
|
||||||
maintainer-xml-check \
|
BUILT_SOURCES =
|
||||||
maintainer-release-check
|
DISTCLEANFILES =
|
||||||
.PHONY: $(MAINTAINER_CHECKS)
|
MOSTLYCLEANFILES =
|
||||||
$(MAINTAINER_CHECKS):
|
SUFFIXES =
|
||||||
$(AM_V_GEN)cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
include build-aux/local.mk
|
||||||
|
include data/local.mk
|
||||||
|
include djgpp/local.mk
|
||||||
|
include doc/local.mk
|
||||||
|
include etc/local.mk
|
||||||
|
include examples/local.mk
|
||||||
|
include lib/local.mk
|
||||||
|
include src/local.mk
|
||||||
|
include tests/local.mk
|
||||||
|
|
||||||
# See comments in build-aux/git-version-gen. However, we make .version depend
|
# See comments in build-aux/git-version-gen. However, we make .version depend
|
||||||
# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the
|
# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the
|
||||||
@@ -48,33 +56,15 @@ $(MAINTAINER_CHECKS):
|
|||||||
# a developer might naively reference .version in a test case while the bison
|
# a developer might naively reference .version in a test case while the bison
|
||||||
# executable still compiles with VERSION, and so the test case might fail or
|
# executable still compiles with VERSION, and so the test case might fail or
|
||||||
# pass incorrectly.
|
# pass incorrectly.
|
||||||
BUILT_SOURCES = $(top_srcdir)/.version
|
BUILT_SOURCES += $(top_srcdir)/.version
|
||||||
$(top_srcdir)/.version: configure
|
$(top_srcdir)/.version: configure
|
||||||
$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
|
echo $(VERSION) > $@-t && mv $@-t $@
|
||||||
dist-hook: gen-ChangeLog
|
dist-hook:
|
||||||
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
|
echo $(VERSION) > $(distdir)/.tarball-version
|
||||||
|
|
||||||
.PHONY: update-b4-copyright update-package-copyright-year
|
.PHONY: update-b4-copyright
|
||||||
update-b4-copyright:
|
update-b4-copyright:
|
||||||
$(AM_V_GEN) find data -type f \
|
find data -type f \
|
||||||
| grep -v -E '^data/bison.m4$$' \
|
| grep -v -E '^data/bison.m4$$' \
|
||||||
| xargs $(build_aux)/$@
|
| xargs $(build_aux)/$@
|
||||||
@echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
|
@echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
|
||||||
update-package-copyright-year:
|
|
||||||
$(AM_V_GEN)$(build_aux)/$@ configure.ac
|
|
||||||
|
|
||||||
gen_start_date = 2012-01-16
|
|
||||||
.PHONY: gen-ChangeLog
|
|
||||||
gen-ChangeLog:
|
|
||||||
$(AM_V_GEN)if test -d $(srcdir)/.git; then \
|
|
||||||
cl=$(distdir)/ChangeLog && \
|
|
||||||
rm -f $$cl.tmp && \
|
|
||||||
$(top_srcdir)/build-aux/gitlog-to-changelog \
|
|
||||||
--strip-tab \
|
|
||||||
--strip-cherry-pick \
|
|
||||||
--no-cluster \
|
|
||||||
--amend=$(srcdir)/build-aux/git-log-fix \
|
|
||||||
--srcdir=$(srcdir) \
|
|
||||||
--since=$(gen_start_date) > $$cl.tmp && \
|
|
||||||
mv -f $$cl.tmp $$cl; \
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
1996-05-12 Jim Meyering <[email protected]>
|
1996-05-12 Jim Meyering <[email protected]>
|
||||||
|
|
||||||
* src/bison.simple (__yy_memcpy) [__cplusplus]: Reorder declarations
|
* src/bison.simple (__yy_memcpy) [__cplusplus]: Reorder declarations
|
||||||
of variables f and t.
|
of variables f and t.
|
||||||
|
|
||||||
1996-05-11 Richard Stallman <[email protected]>
|
1996-05-11 Richard Stallman <[email protected]>
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ to the bison package.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2005, 2009-2012 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2005, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ Please send bug reports to <[email protected]>. Please include the
|
|||||||
version number from `bison --version', and a complete, self-contained
|
version number from `bison --version', and a complete, self-contained
|
||||||
test case in each bug report.
|
test case in each bug report.
|
||||||
|
|
||||||
* Copyright statements
|
|
||||||
For any copyright year range specified as YYYY-ZZZZ in this package,
|
|
||||||
note that the range specifies every single year in that closed interval.
|
|
||||||
|
|
||||||
|
|
||||||
Local Variables:
|
Local Variables:
|
||||||
mode: outline
|
mode: outline
|
||||||
@@ -44,8 +40,8 @@ End:
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2012 Free Software
|
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005, 2008-2009 Free
|
||||||
Foundation, Inc.
|
Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ the problems you encounter.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2004, 2009-2012 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,11 @@ Alexander Belopolsky [email protected]
|
|||||||
Alexandre Duret-Lutz [email protected]
|
Alexandre Duret-Lutz [email protected]
|
||||||
Andreas Schwab [email protected]
|
Andreas Schwab [email protected]
|
||||||
Andrew Suffield [email protected]
|
Andrew Suffield [email protected]
|
||||||
Angelo Borsotti [email protected]
|
|
||||||
Anthony Heading [email protected]
|
Anthony Heading [email protected]
|
||||||
Arnold Robbins [email protected]
|
Arnold Robbins [email protected]
|
||||||
Art Haas [email protected]
|
Art Haas [email protected]
|
||||||
Baron Schwartz [email protected]
|
Baron Schwartz [email protected]
|
||||||
Benoit Perrot [email protected]
|
Benoit Perrot [email protected]
|
||||||
Bernd Kiefer [email protected]
|
|
||||||
Bert Deknuydt [email protected]
|
Bert Deknuydt [email protected]
|
||||||
Bill Allombert [email protected]
|
Bill Allombert [email protected]
|
||||||
Bob Rossi [email protected]
|
Bob Rossi [email protected]
|
||||||
@@ -26,14 +24,11 @@ Christian Burger [email protected]
|
|||||||
Cris Bailiff [email protected]
|
Cris Bailiff [email protected]
|
||||||
Cris van Pelt [email protected]
|
Cris van Pelt [email protected]
|
||||||
Csaba Raduly [email protected]
|
Csaba Raduly [email protected]
|
||||||
Dagobert Michelsen [email protected]
|
|
||||||
Daniel Hagerty [email protected]
|
Daniel Hagerty [email protected]
|
||||||
David J. MacKenzie [email protected]
|
David J. MacKenzie [email protected]
|
||||||
David Kastrup [email protected]
|
|
||||||
Derek M. Jones [email protected]
|
Derek M. Jones [email protected]
|
||||||
Di-an Jan [email protected]
|
Di-an Jan [email protected]
|
||||||
Dick Streefland [email protected]
|
Dick Streefland [email protected]
|
||||||
Didier Godefroy [email protected]
|
|
||||||
Enrico Scholz [email protected]
|
Enrico Scholz [email protected]
|
||||||
Eric Blake [email protected]
|
Eric Blake [email protected]
|
||||||
Evgeny Stambulchik [email protected]
|
Evgeny Stambulchik [email protected]
|
||||||
@@ -42,25 +37,19 @@ Florian Krohm [email protected]
|
|||||||
Frank Heckenbach [email protected]
|
Frank Heckenbach [email protected]
|
||||||
Frans Englich [email protected]
|
Frans Englich [email protected]
|
||||||
Georg Sauthoff [email protected]
|
Georg Sauthoff [email protected]
|
||||||
George Neuner [email protected]
|
|
||||||
Gilles Espinasse [email protected]
|
|
||||||
Goran Uddeborg [email protected]
|
Goran Uddeborg [email protected]
|
||||||
Guido Trentalancia [email protected]
|
Guido Trentalancia [email protected]
|
||||||
H. Merijn Brand [email protected]
|
H. Merijn Brand [email protected]
|
||||||
Hans Aberg [email protected]
|
Hans Aberg [email protected]
|
||||||
Jan Nieuwenhuizen [email protected]
|
Jan Nieuwenhuizen [email protected]
|
||||||
Jerry Quinn [email protected]
|
|
||||||
Jesse Thilo [email protected]
|
Jesse Thilo [email protected]
|
||||||
Jim Kent [email protected]
|
Jim Kent [email protected]
|
||||||
Jim Meyering [email protected]
|
Jim Meyering [email protected]
|
||||||
Joel E. Denny joeldenny@joeldenny.org
|
Joel E. Denny jdenny@ces.clemson.edu
|
||||||
Johan van Selst [email protected]
|
|
||||||
Jonathan Nieder [email protected]
|
|
||||||
Juan Manuel Guerrero [email protected]
|
Juan Manuel Guerrero [email protected]
|
||||||
Kees Zeelenberg [email protected]
|
Kees Zeelenberg [email protected]
|
||||||
Keith Browne [email protected]
|
Keith Browne [email protected]
|
||||||
Laurent Mascherpa [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
Lie Yan [email protected]
|
|
||||||
Magnus Fromreide [email protected]
|
Magnus Fromreide [email protected]
|
||||||
Marc Autret [email protected]
|
Marc Autret [email protected]
|
||||||
Martin Jacobs [email protected]
|
Martin Jacobs [email protected]
|
||||||
@@ -69,7 +58,7 @@ Martin Nylin [email protected]
|
|||||||
Matt Kraai [email protected]
|
Matt Kraai [email protected]
|
||||||
Matt Rosing [email protected]
|
Matt Rosing [email protected]
|
||||||
Michael Hayes [email protected]
|
Michael Hayes [email protected]
|
||||||
Michael Raskin 7c6f434c@mail.ru
|
Michiel De Wilde mdewilde.agilent@gmail.com
|
||||||
Mickael Labau [email protected]
|
Mickael Labau [email protected]
|
||||||
Mike Castle [email protected]
|
Mike Castle [email protected]
|
||||||
Neil Booth [email protected]
|
Neil Booth [email protected]
|
||||||
@@ -77,7 +66,6 @@ Nelson H. F. Beebe [email protected]
|
|||||||
Nicolas Burrus [email protected]
|
Nicolas Burrus [email protected]
|
||||||
Nicolas Tisserand [email protected]
|
Nicolas Tisserand [email protected]
|
||||||
Noah Friedman [email protected]
|
Noah Friedman [email protected]
|
||||||
Odd Arild Olsen [email protected]
|
|
||||||
Oleg Smolsky [email protected]
|
Oleg Smolsky [email protected]
|
||||||
Paolo Bonzini [email protected]
|
Paolo Bonzini [email protected]
|
||||||
Pascal Bart [email protected]
|
Pascal Bart [email protected]
|
||||||
@@ -87,6 +75,7 @@ Per Allansson [email protected]
|
|||||||
Peter Fales [email protected]
|
Peter Fales [email protected]
|
||||||
Peter Hamorsky [email protected]
|
Peter Hamorsky [email protected]
|
||||||
Piotr Gackiewicz [email protected]
|
Piotr Gackiewicz [email protected]
|
||||||
|
Quentin Hocquet [email protected]
|
||||||
Quoc Peyrot [email protected]
|
Quoc Peyrot [email protected]
|
||||||
R Blake [email protected]
|
R Blake [email protected]
|
||||||
Raja R Harinath [email protected]
|
Raja R Harinath [email protected]
|
||||||
@@ -98,23 +87,17 @@ Sebastian Setzer [email protected]
|
|||||||
Sebastien Fricker [email protected]
|
Sebastien Fricker [email protected]
|
||||||
Sergei Steshenko [email protected]
|
Sergei Steshenko [email protected]
|
||||||
Shura [email protected]
|
Shura [email protected]
|
||||||
Stefano Lattarini [email protected]
|
|
||||||
Steve Murphy [email protected]
|
Steve Murphy [email protected]
|
||||||
Summum Bonum [email protected]
|
Summum Bonum [email protected]
|
||||||
Thiru Ramakrishnan [email protected]
|
|
||||||
Tim Josling [email protected]
|
Tim Josling [email protected]
|
||||||
Tim Landscheidt [email protected]
|
|
||||||
Tim Van Holder [email protected]
|
Tim Van Holder [email protected]
|
||||||
Tom Lane [email protected]
|
Tom Lane [email protected]
|
||||||
Tom Tromey [email protected]
|
Tom Tromey [email protected]
|
||||||
Tommy Nordgren [email protected]
|
Tommy Nordgren [email protected]
|
||||||
Troy A. Johnson [email protected]
|
Troy A. Johnson [email protected]
|
||||||
Tys Lefering [email protected]
|
Tys Lefering [email protected]
|
||||||
Vin Shelton [email protected]
|
Vin Shelton [email protected]
|
||||||
W.C.A. Wijngaards [email protected]
|
|
||||||
Wayne Green [email protected]
|
Wayne Green [email protected]
|
||||||
Wei Song [email protected]
|
|
||||||
Wolfgang S. Kechel [email protected]
|
|
||||||
Wolfram Wagner [email protected]
|
Wolfram Wagner [email protected]
|
||||||
Wwp [email protected]
|
Wwp [email protected]
|
||||||
Zack Weinberg [email protected]
|
Zack Weinberg [email protected]
|
||||||
@@ -125,22 +108,3 @@ thank them! Please, help us keeping this list up to date.
|
|||||||
Local Variables:
|
Local Variables:
|
||||||
mode: text
|
mode: text
|
||||||
End:
|
End:
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 2000-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Parser Generator.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
* Short term
|
-*- outline -*-
|
||||||
** Variable names.
|
|
||||||
What should we name `variant' and `lex_symbol'?
|
|
||||||
|
|
||||||
|
* Short term
|
||||||
** Use b4_symbol in all the skeleton
|
** Use b4_symbol in all the skeleton
|
||||||
Move its definition in the more standard places and deploy it in other
|
Then remove the older system, including the tables generated by
|
||||||
skeletons. Then remove the older system, including the tables
|
output.c
|
||||||
generated by output.c
|
|
||||||
|
|
||||||
** Update the documentation on gnu.org
|
** Update the documentation on gnu.org
|
||||||
|
|
||||||
@@ -38,10 +36,17 @@ as lr0.cc, why upper case?
|
|||||||
** bench several bisons.
|
** bench several bisons.
|
||||||
Enhance bench.pl with %b to run different bisons.
|
Enhance bench.pl with %b to run different bisons.
|
||||||
|
|
||||||
|
** Use b4_symbol everywhere.
|
||||||
|
Move its definition in the more standard places and deploy it in other
|
||||||
|
skeletons.
|
||||||
|
|
||||||
* Various
|
* Various
|
||||||
** Warnings
|
** YYPRINT
|
||||||
Warnings about type tags that are used in printer and dtors, but not
|
glr.c inherits its symbol_print function from c.m4, which supports
|
||||||
for symbols?
|
YYPRINT. But to use YYPRINT yytoknum is needed, which not defined by
|
||||||
|
glr.c.
|
||||||
|
|
||||||
|
Anyway, IMHO YYPRINT is obsolete and should be restricted to yacc.c.
|
||||||
|
|
||||||
** YYERRCODE
|
** YYERRCODE
|
||||||
Defined to 256, but not used, not documented. Probably the token
|
Defined to 256, but not used, not documented. Probably the token
|
||||||
@@ -91,15 +96,59 @@ so both 256 and 257 are "mysterious".
|
|||||||
** YYFAIL
|
** YYFAIL
|
||||||
It is seems to be *really* obsolete now, shall we remove it?
|
It is seems to be *really* obsolete now, shall we remove it?
|
||||||
|
|
||||||
|
** YYBACKUP
|
||||||
|
There is no test about it, no examples in the doc, and I'm not sure
|
||||||
|
what it should look like. For instance what follows crashes.
|
||||||
|
|
||||||
|
%error-verbose
|
||||||
|
%debug
|
||||||
|
%pure-parser
|
||||||
|
%code {
|
||||||
|
# include <stdio.h>
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <assert.h>
|
||||||
|
|
||||||
|
static void yyerror (const char *msg);
|
||||||
|
static int yylex (YYSTYPE *yylval);
|
||||||
|
}
|
||||||
|
%%
|
||||||
|
exp:
|
||||||
|
'a' { printf ("a: %d\n", $1); }
|
||||||
|
| 'b' { YYBACKUP('a', 123); }
|
||||||
|
;
|
||||||
|
%%
|
||||||
|
static int
|
||||||
|
yylex (YYSTYPE *yylval)
|
||||||
|
{
|
||||||
|
static char const input[] = "b";
|
||||||
|
static size_t toknum;
|
||||||
|
assert (toknum < sizeof input);
|
||||||
|
*yylval = (toknum + 1) * 10;
|
||||||
|
return input[toknum++];
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
yyerror (const char *msg)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "%s\n", msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
yydebug = !!getenv("YYDEBUG");
|
||||||
|
return yyparse ();
|
||||||
|
}
|
||||||
|
|
||||||
** yychar == yyempty_
|
** yychar == yyempty_
|
||||||
The code in yyerrlab reads:
|
The code in yyerrlab reads:
|
||||||
|
|
||||||
if (yychar <= YYEOF)
|
if (yychar <= YYEOF)
|
||||||
{
|
{
|
||||||
/* Return failure if at end of input. */
|
/* Return failure if at end of input. */
|
||||||
if (yychar == YYEOF)
|
if (yychar == YYEOF)
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
There are only two yychar that can be <= YYEOF: YYEMPTY and YYEOF.
|
There are only two yychar that can be <= YYEOF: YYEMPTY and YYEOF.
|
||||||
But I can't produce the situation where yychar is YYEMPTY here, is it
|
But I can't produce the situation where yychar is YYEMPTY here, is it
|
||||||
@@ -125,16 +174,26 @@ we do the same in yacc.c.
|
|||||||
The code bw glr.c and yacc.c is really alike, we can certainly factor
|
The code bw glr.c and yacc.c is really alike, we can certainly factor
|
||||||
some parts.
|
some parts.
|
||||||
|
|
||||||
|
* Header guards
|
||||||
|
|
||||||
|
From Franc,ois: should we keep the directory part in the CPP guard?
|
||||||
|
|
||||||
|
|
||||||
|
* Yacc.c: CPP Macros
|
||||||
|
|
||||||
|
Do some people use YYPURE, YYLSP_NEEDED like we do in the test suite?
|
||||||
|
They should not: it is not documented. But if they need to, let's
|
||||||
|
find something clean (not like YYLSP_NEEDED...).
|
||||||
|
|
||||||
|
|
||||||
|
* Installation
|
||||||
|
|
||||||
|
* Documentation
|
||||||
|
Before releasing, make sure the documentation ("Understanding your
|
||||||
|
parser") refers to the current `output' format.
|
||||||
|
|
||||||
* Report
|
* Report
|
||||||
|
|
||||||
** Figures
|
|
||||||
Some statistics about the grammar and the parser would be useful,
|
|
||||||
especially when asking the user to send some information about the
|
|
||||||
grammars she is working on. We should probably also include some
|
|
||||||
information about the variables (I'm not sure for instance we even
|
|
||||||
specify what LR variant was used).
|
|
||||||
|
|
||||||
** GLR
|
** GLR
|
||||||
How would Paul like to display the conflicted actions? In particular,
|
How would Paul like to display the conflicted actions? In particular,
|
||||||
what when two reductions are possible on a given lookahead token, but one is
|
what when two reductions are possible on a given lookahead token, but one is
|
||||||
@@ -163,11 +222,36 @@ DeRemer and Penello: they already provide the algorithm.
|
|||||||
|
|
||||||
* Extensions
|
* Extensions
|
||||||
|
|
||||||
|
** Labeling the symbols
|
||||||
|
Have a look at the Lemon parser generator: instead of $1, $2 etc. they
|
||||||
|
can name the values. This is much more pleasant. For instance:
|
||||||
|
|
||||||
|
exp (res): exp (a) '+' exp (b) { $res = $a + $b; };
|
||||||
|
|
||||||
|
I love this. I have been bitten too often by the removal of the
|
||||||
|
symbol, and forgetting to shift all the $n to $n-1. If you are
|
||||||
|
unlucky, it compiles...
|
||||||
|
|
||||||
|
But instead of using $a etc., we can use regular variables. And
|
||||||
|
instead of using (), I propose to use `:' (again). Paul suggests
|
||||||
|
supporting `->' in addition to `:' to separate LHS and RHS. In other
|
||||||
|
words:
|
||||||
|
|
||||||
|
r:exp -> a:exp '+' b:exp { r = a + b; };
|
||||||
|
|
||||||
|
That requires an significant improvement of the grammar parser. Using
|
||||||
|
GLR would be nice. It also requires that Bison know the type of the
|
||||||
|
symbols (which will be useful for %include anyway). So we have some
|
||||||
|
time before...
|
||||||
|
|
||||||
|
Note that there remains the problem of locations: `@r'?
|
||||||
|
|
||||||
|
|
||||||
** $-1
|
** $-1
|
||||||
We should find a means to provide an access to values deep in the
|
We should find a means to provide an access to values deep in the
|
||||||
stack. For instance, instead of
|
stack. For instance, instead of
|
||||||
|
|
||||||
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
|
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
|
||||||
|
|
||||||
we should be able to have:
|
we should be able to have:
|
||||||
|
|
||||||
@@ -200,13 +284,13 @@ XML output for GNU Bison
|
|||||||
* Unit rules
|
* Unit rules
|
||||||
Maybe we could expand unit rules, i.e., transform
|
Maybe we could expand unit rules, i.e., transform
|
||||||
|
|
||||||
exp: arith | bool;
|
exp: arith | bool;
|
||||||
arith: exp '+' exp;
|
arith: exp '+' exp;
|
||||||
bool: exp '&' exp;
|
bool: exp '&' exp;
|
||||||
|
|
||||||
into
|
into
|
||||||
|
|
||||||
exp: exp '+' exp | exp '&' exp;
|
exp: exp '+' exp | exp '&' exp;
|
||||||
|
|
||||||
when there are no actions. This can significantly speed up some
|
when there are no actions. This can significantly speed up some
|
||||||
grammars. I can't find the papers. In particular the book `LR
|
grammars. I can't find the papers. In particular the book `LR
|
||||||
@@ -222,22 +306,28 @@ this issue. Does anybody have it?
|
|||||||
Some history of Bison and some bibliography would be most welcome.
|
Some history of Bison and some bibliography would be most welcome.
|
||||||
Are there any Texinfo standards for bibliography?
|
Are there any Texinfo standards for bibliography?
|
||||||
|
|
||||||
|
** %printer
|
||||||
|
Wow, %printer is not documented. Clearly mark YYPRINT as obsolete.
|
||||||
|
|
||||||
|
* Java, Fortran, etc.
|
||||||
|
|
||||||
|
|
||||||
* Coding system independence
|
* Coding system independence
|
||||||
Paul notes:
|
Paul notes:
|
||||||
|
|
||||||
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
|
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
|
||||||
255). It also assumes that the 8-bit character encoding is
|
255). It also assumes that the 8-bit character encoding is
|
||||||
the same for the invocation of 'bison' as it is for the
|
the same for the invocation of 'bison' as it is for the
|
||||||
invocation of 'cc', but this is not necessarily true when
|
invocation of 'cc', but this is not necessarily true when
|
||||||
people run bison on an ASCII host and then use cc on an EBCDIC
|
people run bison on an ASCII host and then use cc on an EBCDIC
|
||||||
host. I don't think these topics are worth our time
|
host. I don't think these topics are worth our time
|
||||||
addressing (unless we find a gung-ho volunteer for EBCDIC or
|
addressing (unless we find a gung-ho volunteer for EBCDIC or
|
||||||
PDP-10 ports :-) but they should probably be documented
|
PDP-10 ports :-) but they should probably be documented
|
||||||
somewhere.
|
somewhere.
|
||||||
|
|
||||||
More importantly, Bison does not currently allow NUL bytes in
|
More importantly, Bison does not currently allow NUL bytes in
|
||||||
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
||||||
the source code. This should get fixed.
|
the source code. This should get fixed.
|
||||||
|
|
||||||
* --graph
|
* --graph
|
||||||
Show reductions.
|
Show reductions.
|
||||||
@@ -247,6 +337,29 @@ Show reductions.
|
|||||||
** Skeleton strategy
|
** Skeleton strategy
|
||||||
Must we keep %token-table?
|
Must we keep %token-table?
|
||||||
|
|
||||||
|
* BTYacc
|
||||||
|
See if we can integrate backtracking in Bison. Charles-Henri de
|
||||||
|
Boysson <[email protected]> has been working on this, but never gave
|
||||||
|
the results.
|
||||||
|
|
||||||
|
Vadim Maslow, the maintainer of BTYacc was once contacted. Adjusting
|
||||||
|
the Bison grammar parser will be needed to support some extra BTYacc
|
||||||
|
features. This is less urgent.
|
||||||
|
|
||||||
|
** Keeping the conflicted actions
|
||||||
|
First, analyze the differences between byacc and btyacc (I'm referring
|
||||||
|
to the executables). Find where the conflicts are preserved.
|
||||||
|
|
||||||
|
** Compare with the GLR tables
|
||||||
|
See how isomorphic the way BTYacc and the way the GLR adjustments in
|
||||||
|
Bison are compatible. *As much as possible* one should try to use the
|
||||||
|
same implementation in the Bison executables. I insist: it should be
|
||||||
|
very feasible to use the very same conflict tables.
|
||||||
|
|
||||||
|
** Adjust the skeletons
|
||||||
|
Import the skeletons for C and C++.
|
||||||
|
|
||||||
|
|
||||||
* Precedence
|
* Precedence
|
||||||
|
|
||||||
** Partial order
|
** Partial order
|
||||||
@@ -313,32 +426,10 @@ to bison. If you're interested, I'll work on a patch.
|
|||||||
* Better graphics
|
* Better graphics
|
||||||
Equip the parser with a means to create the (visual) parse tree.
|
Equip the parser with a means to create the (visual) parse tree.
|
||||||
|
|
||||||
* Complaint submessage indentation.
|
|
||||||
We already have an implementation that works fairly well for named
|
|
||||||
reference messages, but it would be nice to use it consistently for all
|
|
||||||
submessages from Bison. For example, the "previous definition"
|
|
||||||
submessage or the list of correct values for a %define variable might
|
|
||||||
look better with indentation.
|
|
||||||
|
|
||||||
However, the current implementation makes the assumption that the
|
|
||||||
location printed on the first line is not usually much shorter than the
|
|
||||||
locations printed on the submessage lines that follow. That assumption
|
|
||||||
may not hold true as often for some kinds of submessages especially if
|
|
||||||
we ever support multiple grammar files.
|
|
||||||
|
|
||||||
Here's a proposal for how a new implementation might look:
|
|
||||||
|
|
||||||
http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00086.html
|
|
||||||
|
|
||||||
|
|
||||||
Local Variables:
|
|
||||||
mode: outline
|
|
||||||
coding: utf-8
|
|
||||||
End:
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2001-2004, 2006, 2008-2012 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008-2009 Free Software
|
||||||
|
Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+16
-42
@@ -1,6 +1,6 @@
|
|||||||
# Bootstrap configuration.
|
# Bootstrap configuration.
|
||||||
|
|
||||||
# Copyright (C) 2006-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,24 +17,12 @@
|
|||||||
|
|
||||||
# gnulib modules used by this package.
|
# gnulib modules used by this package.
|
||||||
gnulib_modules='
|
gnulib_modules='
|
||||||
argmatch assert calloc-posix close closeout config-h c-strcase
|
announce-gen argmatch config-h c-strcase configmake dirname error
|
||||||
configmake
|
extensions fopen-safer gendocs getopt-gnu gettext git-version-gen hash
|
||||||
dirname
|
inttypes javacomp-script javaexec-script maintainer-makefile malloc
|
||||||
error extensions fdl fopen-safer getopt-gnu
|
mbswidth obstack quote quotearg stdbool stpcpy strerror strtoul
|
||||||
gettext git-version-gen gitlog-to-changelog
|
strverscmp unistd unistd-safer unlocked-io update-copyright unsetenv
|
||||||
gpl-3.0 hash inttypes isnan javacomp-script
|
verify warnings xalloc xalloc-die xstrndup
|
||||||
javaexec-script ldexpl malloc-gnu mbschr mbsrchr
|
|
||||||
mbswidth obstack perror progname
|
|
||||||
quote quotearg
|
|
||||||
readme-release
|
|
||||||
realloc-posix
|
|
||||||
spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
|
|
||||||
unistd unistd-safer unlocked-io update-copyright unsetenv verify
|
|
||||||
warnings
|
|
||||||
xalloc xalloc-die xmemdup0 xstrndup
|
|
||||||
|
|
||||||
fprintf-posix printf-posix snprintf-posix sprintf-posix
|
|
||||||
vsnprintf-posix vsprintf-posix
|
|
||||||
'
|
'
|
||||||
|
|
||||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||||
@@ -53,40 +41,26 @@ XGETTEXT_OPTIONS_RUNTIME=$XGETTEXT_OPTIONS'\\\
|
|||||||
# Gettext supplies these files, but we don't need them since
|
# Gettext supplies these files, but we don't need them since
|
||||||
# we don't have an intl subdirectory.
|
# we don't have an intl subdirectory.
|
||||||
excluded_files='
|
excluded_files='
|
||||||
|
m4/codeset.m4
|
||||||
m4/glibc2.m4
|
m4/glibc2.m4
|
||||||
|
m4/glibc21.m4
|
||||||
m4/intdiv0.m4
|
m4/intdiv0.m4
|
||||||
m4/intl.m4
|
m4/intl.m4
|
||||||
m4/intldir.m4
|
m4/intldir.m4
|
||||||
m4/intmax.m4
|
m4/intmax.m4
|
||||||
|
m4/inttypes_h.m4
|
||||||
m4/lcmessage.m4
|
m4/lcmessage.m4
|
||||||
m4/lock.m4
|
m4/lock.m4
|
||||||
m4/longdouble.m4
|
m4/longdouble.m4
|
||||||
|
m4/printf-posix.m4
|
||||||
m4/signed.m4
|
m4/signed.m4
|
||||||
|
m4/size_max.m4
|
||||||
m4/uintmax_t.m4
|
m4/uintmax_t.m4
|
||||||
m4/ulonglong.m4
|
m4/ulonglong.m4
|
||||||
m4/visibility.m4
|
m4/visibility.m4
|
||||||
|
m4/xsize.m4
|
||||||
'
|
'
|
||||||
|
|
||||||
gnulib_tool_option_extras='--symlink --makefile-name=gnulib.mk'
|
# In directories like lib/, m4/, and po/, generate both these files because we
|
||||||
|
# still try to support CVS emulation.
|
||||||
bootstrap_post_import_hook()
|
vc_ignore='.cvsignore .gitignore'
|
||||||
{
|
|
||||||
# Ensure that ChangeLog exists, for automake.
|
|
||||||
test -f ChangeLog || touch ChangeLog
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstrap_epilogue()
|
|
||||||
{
|
|
||||||
# Make sure we don't need src/bison, which usually doesn't exist at
|
|
||||||
# the time of a bootstrap.
|
|
||||||
touch src/parse-gram.[ch]
|
|
||||||
|
|
||||||
perl -pi -e "s/\@PACKAGE\@/$package/g" README-release
|
|
||||||
}
|
|
||||||
|
|
||||||
# Keep our bootstrap script in sync with gnulib's. If we ever need to
|
|
||||||
# maintain our own bootstrap script again, set this to false, remove
|
|
||||||
# the bootstrap entry from the file .x-update-copyright, and add any
|
|
||||||
# needed copyright years to the copyright statement in the bootstrap
|
|
||||||
# script.
|
|
||||||
bootstrap_sync=true
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
announce-gen
|
||||||
|
compile
|
||||||
|
config.guess
|
||||||
|
config.rpath
|
||||||
|
config.sub
|
||||||
|
depcomp
|
||||||
|
gendocs.sh
|
||||||
|
git-version-gen
|
||||||
|
install-sh
|
||||||
|
javacomp.sh.in
|
||||||
|
javaexec.sh.in
|
||||||
|
link-warning.h
|
||||||
|
mdate-sh
|
||||||
|
missing
|
||||||
|
texinfo.tex
|
||||||
|
update-copyright
|
||||||
|
useless-if-before-free
|
||||||
|
vc-list-files
|
||||||
|
ylwrap
|
||||||
@@ -1,19 +1,11 @@
|
|||||||
/Makefile
|
|
||||||
/Makefile.in
|
|
||||||
/announce-gen
|
/announce-gen
|
||||||
/arg-nonnull.h
|
|
||||||
/c++defs.h
|
|
||||||
/compile
|
/compile
|
||||||
/config.guess
|
/config.guess
|
||||||
/config.rpath
|
/config.rpath
|
||||||
/config.sub
|
/config.sub
|
||||||
/depcomp
|
/depcomp
|
||||||
/do-release-commit-and-tag
|
|
||||||
/gendocs.sh
|
/gendocs.sh
|
||||||
/git-version-gen
|
/git-version-gen
|
||||||
/gitlog-to-changelog
|
|
||||||
/gnu-web-doc-update
|
|
||||||
/gnupload
|
|
||||||
/install-sh
|
/install-sh
|
||||||
/javacomp.sh.in
|
/javacomp.sh.in
|
||||||
/javaexec.sh.in
|
/javaexec.sh.in
|
||||||
@@ -24,5 +16,4 @@
|
|||||||
/update-copyright
|
/update-copyright
|
||||||
/useless-if-before-free
|
/useless-if-before-free
|
||||||
/vc-list-files
|
/vc-list-files
|
||||||
/warn-on-use.h
|
|
||||||
/ylwrap
|
/ylwrap
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
## Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
cross-options.pl \
|
|
||||||
darwin11.4.0.valgrind \
|
|
||||||
prev-version.txt \
|
|
||||||
update-b4-copyright
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
# Copyright (C) 2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# Valgrind suppression file for Bison.
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X initialization
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:?alloc*
|
|
||||||
...
|
|
||||||
fun:*ImageLoader*
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X initialization
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:?alloc*
|
|
||||||
...
|
|
||||||
fun:*dyld*
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X initialization
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:?alloc*
|
|
||||||
...
|
|
||||||
fun:__CFInitialize
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X I/O buffer
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:malloc
|
|
||||||
fun:__smakebuf
|
|
||||||
fun:__swsetup
|
|
||||||
fun:__sfvwrite
|
|
||||||
fun:fwrite
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X I/O buffer
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:malloc
|
|
||||||
fun:__smakebuf
|
|
||||||
fun:__swsetup
|
|
||||||
fun:__swbuf
|
|
||||||
fun:putchar
|
|
||||||
}
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# End:
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# This file is expected to be used via gitlog-to-changelog's --amend=FILE
|
|
||||||
# option. It specifies what changes to make to each given SHA1's commit
|
|
||||||
# log and metadata, using Perl-eval'able expressions.
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
EXTRA_DIST += \
|
||||||
|
build-aux/cross-options.pl \
|
||||||
|
build-aux/move-if-change \
|
||||||
|
build-aux/prev-version.txt \
|
||||||
|
build-aux/update-b4-copyright
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../gnulib/build-aux/move-if-change
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
/_Noreturn.h
|
|
||||||
/arg-nonnull.h
|
|
||||||
/c++defs.h
|
|
||||||
/warn-on-use.h
|
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
# Update b4_copyright invocations or b4_copyright_years definitions to
|
# Update b4_copyright invocations or b4_copyright_years definitions to
|
||||||
# include the current year.
|
# include the current year.
|
||||||
|
|
||||||
# Copyright (C) 2009-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2009 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 3, or (at your option)
|
# the Free Software Foundation; either version 3, or (at your option)
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
#!/usr/bin/perl -0777 -pi
|
|
||||||
|
|
||||||
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
|
||||||
|
|
||||||
# Copyright (C) 2010-2012 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 3, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
|
|
||||||
if (!$this_year || $this_year !~ m/^\d{4}$/)
|
|
||||||
{
|
|
||||||
my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
|
|
||||||
$this_year = $year + 1900;
|
|
||||||
}
|
|
||||||
my $old_re = <<'EOF'
|
|
||||||
(
|
|
||||||
MACRO\(
|
|
||||||
\[PACKAGE_COPYRIGHT_YEAR],
|
|
||||||
\s*\[
|
|
||||||
)
|
|
||||||
(\d{4})
|
|
||||||
(?=])
|
|
||||||
EOF
|
|
||||||
;
|
|
||||||
foreach my $macro ("AC_DEFINE", "AC_SUBST")
|
|
||||||
{
|
|
||||||
my $this_old_re = $old_re;
|
|
||||||
$this_old_re =~ s/MACRO/$macro/;
|
|
||||||
if (!s/$this_old_re/$1$this_year/x)
|
|
||||||
{
|
|
||||||
print STDERR
|
|
||||||
"$ARGV: warning: failed to update PACKAGE_COPYRIGHT_YEAR in"
|
|
||||||
. " $macro.\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# Customize maint.mk -*- makefile -*-
|
# Customize maint.mk -*- makefile -*-
|
||||||
# Copyright (C) 2008-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2008-2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -14,17 +14,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Update version, then recompile so that tests/bison --version be
|
|
||||||
# up-to-date, then compile our parser again with our up-to-date bison.
|
|
||||||
.PHONY: regen
|
|
||||||
regen: _version
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS)
|
|
||||||
touch $(srcdir)/src/parse-gram.y
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS)
|
|
||||||
|
|
||||||
# Used in maint.mk's web-manual rule
|
|
||||||
manual_title = The Yacc-compatible Parser Generator
|
|
||||||
|
|
||||||
# It's useful to run maintainer-*check* targets during development, but we
|
# It's useful to run maintainer-*check* targets during development, but we
|
||||||
# don't want to wait on a recompile because of an update to $(VERSION). Thus,
|
# don't want to wait on a recompile because of an update to $(VERSION). Thus,
|
||||||
# override the _is-dist-target from GNUmakefile so that maintainer-*check*
|
# override the _is-dist-target from GNUmakefile so that maintainer-*check*
|
||||||
@@ -32,6 +21,13 @@ manual_title = The Yacc-compatible Parser Generator
|
|||||||
_is-dist-target = $(filter-out %clean maintainer-check% maintainer-%-check, \
|
_is-dist-target = $(filter-out %clean maintainer-check% maintainer-%-check, \
|
||||||
$(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS)))
|
$(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS)))
|
||||||
|
|
||||||
|
# Use alpha.gnu.org for alpha and beta releases.
|
||||||
|
# Use ftp.gnu.org for major releases.
|
||||||
|
gnu_ftp_host-alpha = alpha.gnu.org
|
||||||
|
gnu_ftp_host-beta = alpha.gnu.org
|
||||||
|
gnu_ftp_host-major = ftp.gnu.org
|
||||||
|
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
|
||||||
|
|
||||||
url_dir_list = \
|
url_dir_list = \
|
||||||
ftp://$(gnu_rel_host)/gnu/bison
|
ftp://$(gnu_rel_host)/gnu/bison
|
||||||
|
|
||||||
@@ -39,40 +35,14 @@ url_dir_list = \
|
|||||||
# Exclude changelog-check here so that there's less churn in ChangeLog
|
# Exclude changelog-check here so that there's less churn in ChangeLog
|
||||||
# files -- otherwise, you'd need to have the upcoming version number
|
# files -- otherwise, you'd need to have the upcoming version number
|
||||||
# at the top of the file for each `make distcheck' run.
|
# at the top of the file for each `make distcheck' run.
|
||||||
local-checks-to-skip = \
|
local-checks-to-skip = changelog-check
|
||||||
changelog-check \
|
|
||||||
sc_immutable_NEWS \
|
|
||||||
sc_prohibit_always_true_header_tests \
|
|
||||||
sc_prohibit_atoi_atof \
|
|
||||||
sc_prohibit_strcmp
|
|
||||||
|
|
||||||
# The local directory containing the checked-out copy of gnulib used in
|
# The local directory containing the checked-out copy of gnulib used in
|
||||||
# this release. Used solely to get a date for the "announcement" target.
|
# this release. Used solely to get a date for the "announcement" target.
|
||||||
gnulib_dir = $(srcdir)/gnulib
|
gnulib_dir = $(srcdir)/../../gnulib
|
||||||
|
|
||||||
bootstrap-tools = autoconf,automake,flex,gettext,gnulib
|
bootstrap-tools = autoconf,automake,flex,gnulib
|
||||||
|
|
||||||
announcement_Cc_ = \
|
update-copyright: update-b4-copyright
|
||||||
[email protected], [email protected], [email protected], \
|
|
||||||
[email protected]
|
|
||||||
|
|
||||||
update-copyright: update-b4-copyright update-package-copyright-year
|
|
||||||
update-copyright-env = \
|
update-copyright-env = \
|
||||||
UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
|
UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
|
||||||
|
|
||||||
exclude = \
|
|
||||||
$(foreach a,$(1),$(eval $(subst $$,$$$$,exclude_file_name_regexp--sc_$(a))))
|
|
||||||
$(call exclude, \
|
|
||||||
bindtextdomain=^lib/main.c$$ \
|
|
||||||
program_name=^lib/main.c$$ \
|
|
||||||
prohibit_always-defined_macros=^data/yacc.c|^djgpp/ \
|
|
||||||
prohibit_always-defined_macros+=?|^lib/timevar.c$$ \
|
|
||||||
prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \
|
|
||||||
prohibit_always-defined_macros+=?|^tests/regression.at$$ \
|
|
||||||
prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \
|
|
||||||
prohibit_empty_lines_at_EOF=^src/parse-gram.[ch]$$ \
|
|
||||||
require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \
|
|
||||||
space_tab=^tests/(input|c\+\+)\.at$$ \
|
|
||||||
trailing_blank=^src/parse-gram.[ch]$$ \
|
|
||||||
unmarked_diagnostics=^(djgpp/|doc/bison.texi$$) \
|
|
||||||
)
|
|
||||||
|
|||||||
+292
@@ -0,0 +1,292 @@
|
|||||||
|
/* config.hin. Generated from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||||
|
systems. This function is required for `alloca.c' support on those systems.
|
||||||
|
*/
|
||||||
|
#undef CRAY_STACKSEG_END
|
||||||
|
|
||||||
|
/* Define if using `alloca.c'. */
|
||||||
|
#undef C_ALLOCA
|
||||||
|
|
||||||
|
/* Define to 1 if translation of program messages to the user's native
|
||||||
|
language is requested. */
|
||||||
|
#undef ENABLE_NLS
|
||||||
|
|
||||||
|
/* Define if you have `alloca', as a function or macro. */
|
||||||
|
#undef HAVE_ALLOCA
|
||||||
|
|
||||||
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
|
/* Define if you have the <argz.h> header file. */
|
||||||
|
#undef HAVE_ARGZ_H
|
||||||
|
|
||||||
|
/* Define if you have the <ctype.h> header file. */
|
||||||
|
#undef HAVE_CTYPE_H
|
||||||
|
|
||||||
|
/* Define if backslash-a works in C strings. */
|
||||||
|
#undef HAVE_C_BACKSLASH_A
|
||||||
|
|
||||||
|
/* Define if you have the `dcgettext' function. */
|
||||||
|
#undef HAVE_DCGETTEXT
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `memchr', and to 0 if you don't.
|
||||||
|
*/
|
||||||
|
#undef HAVE_DECL_MEMCHR
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
|
||||||
|
*/
|
||||||
|
#undef HAVE_DECL_STPCPY
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#undef HAVE_DECL_STRERROR_R
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `strndup', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#undef HAVE_DECL_STRNDUP
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#undef HAVE_DECL_STRNLEN
|
||||||
|
|
||||||
|
/* Define if the malloc check has been performed. */
|
||||||
|
#undef HAVE_DONE_WORKING_MALLOC_CHECK
|
||||||
|
|
||||||
|
/* Define if the realloc check has been performed. */
|
||||||
|
#undef HAVE_DONE_WORKING_REALLOC_CHECK
|
||||||
|
|
||||||
|
/* Define if you have the `doprnt' function. */
|
||||||
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
|
/* Define if you have the `feof_unlocked' function. */
|
||||||
|
#undef HAVE_FEOF_UNLOCKED
|
||||||
|
|
||||||
|
/* Define if you have the `fgets_unlocked' function. */
|
||||||
|
#undef HAVE_FGETS_UNLOCKED
|
||||||
|
|
||||||
|
/* Define if you have the `getcwd' function. */
|
||||||
|
#undef HAVE_GETCWD
|
||||||
|
|
||||||
|
/* Define if you have the `getegid' function. */
|
||||||
|
#undef HAVE_GETEGID
|
||||||
|
|
||||||
|
/* Define if you have the `geteuid' function. */
|
||||||
|
#undef HAVE_GETEUID
|
||||||
|
|
||||||
|
/* Define if you have the `getgid' function. */
|
||||||
|
#undef HAVE_GETGID
|
||||||
|
|
||||||
|
/* Define if you have the `getpagesize' function. */
|
||||||
|
#undef HAVE_GETPAGESIZE
|
||||||
|
|
||||||
|
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||||
|
#undef HAVE_GETTEXT
|
||||||
|
|
||||||
|
/* Define if you have the `getuid' function. */
|
||||||
|
#undef HAVE_GETUID
|
||||||
|
|
||||||
|
/* Define if you have the iconv() function. */
|
||||||
|
#undef HAVE_ICONV
|
||||||
|
|
||||||
|
/* Define if you have the <inttypes.h> header file. */
|
||||||
|
#undef HAVE_INTTYPES_H
|
||||||
|
|
||||||
|
/* Define if you have the `isascii' function. */
|
||||||
|
#undef HAVE_ISASCII
|
||||||
|
|
||||||
|
/* Define if you have the `iswprint' function. */
|
||||||
|
#undef HAVE_ISWPRINT
|
||||||
|
|
||||||
|
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
|
||||||
|
#undef HAVE_LANGINFO_CODESET
|
||||||
|
|
||||||
|
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
||||||
|
#undef HAVE_LC_MESSAGES
|
||||||
|
|
||||||
|
/* Define if you have the <limits.h> header file. */
|
||||||
|
#undef HAVE_LIMITS_H
|
||||||
|
|
||||||
|
/* Define if you have the <locale.h> header file. */
|
||||||
|
#undef HAVE_LOCALE_H
|
||||||
|
|
||||||
|
/* Define if you have the <malloc.h> header file. */
|
||||||
|
#undef HAVE_MALLOC_H
|
||||||
|
|
||||||
|
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
|
||||||
|
#undef HAVE_MBRTOWC
|
||||||
|
|
||||||
|
/* Define if you have the `mbsinit' function. */
|
||||||
|
#undef HAVE_MBSINIT
|
||||||
|
|
||||||
|
/* Define if you have the `memchr' function. */
|
||||||
|
#undef HAVE_MEMCHR
|
||||||
|
|
||||||
|
/* Define if you have the <memory.h> header file. */
|
||||||
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define if you have the `mempcpy' function. */
|
||||||
|
#undef HAVE_MEMPCPY
|
||||||
|
|
||||||
|
/* Define if you have the `mkstemp' function. */
|
||||||
|
#undef HAVE_MKSTEMP
|
||||||
|
|
||||||
|
/* Define if you have a working `mmap' system call. */
|
||||||
|
#undef HAVE_MMAP
|
||||||
|
|
||||||
|
/* Define if you have the `munmap' function. */
|
||||||
|
#undef HAVE_MUNMAP
|
||||||
|
|
||||||
|
/* Define if you have the <nl_types.h> header file. */
|
||||||
|
#undef HAVE_NL_TYPES_H
|
||||||
|
|
||||||
|
/* Define if you have the `putenv' function. */
|
||||||
|
#undef HAVE_PUTENV
|
||||||
|
|
||||||
|
/* Define if you have the `setenv' function. */
|
||||||
|
#undef HAVE_SETENV
|
||||||
|
|
||||||
|
/* Define if you have the `setlocale' function. */
|
||||||
|
#undef HAVE_SETLOCALE
|
||||||
|
|
||||||
|
/* Define if you have the <stddef.h> header file. */
|
||||||
|
#undef HAVE_STDDEF_H
|
||||||
|
|
||||||
|
/* Define if you have the <stdint.h> header file. */
|
||||||
|
#undef HAVE_STDINT_H
|
||||||
|
|
||||||
|
/* Define if you have the <stdlib.h> header file. */
|
||||||
|
#undef HAVE_STDLIB_H
|
||||||
|
|
||||||
|
/* Define if you have the `stpcpy' function. */
|
||||||
|
#undef HAVE_STPCPY
|
||||||
|
|
||||||
|
/* Define if you have the `strcasecmp' function. */
|
||||||
|
#undef HAVE_STRCASECMP
|
||||||
|
|
||||||
|
/* Define if you have the `strchr' function. */
|
||||||
|
#undef HAVE_STRCHR
|
||||||
|
|
||||||
|
/* Define if you have the `strdup' function. */
|
||||||
|
#undef HAVE_STRDUP
|
||||||
|
|
||||||
|
/* Define if you have the `strerror' function. */
|
||||||
|
#undef HAVE_STRERROR
|
||||||
|
|
||||||
|
/* Define if you have the `strerror_r' function. */
|
||||||
|
#undef HAVE_STRERROR_R
|
||||||
|
|
||||||
|
/* Define if you have the <strings.h> header file. */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
|
/* Define if you have the <string.h> header file. */
|
||||||
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define if you have the `strndup' function. */
|
||||||
|
#undef HAVE_STRNDUP
|
||||||
|
|
||||||
|
/* Define if you have the `strnlen' function. */
|
||||||
|
#undef HAVE_STRNLEN
|
||||||
|
|
||||||
|
/* Define if you have the `strspn' function. */
|
||||||
|
#undef HAVE_STRSPN
|
||||||
|
|
||||||
|
/* Define if you have the `strtoul' function. */
|
||||||
|
#undef HAVE_STRTOUL
|
||||||
|
|
||||||
|
/* Define if you have the <sys/param.h> header file. */
|
||||||
|
#undef HAVE_SYS_PARAM_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/stat.h> header file. */
|
||||||
|
#undef HAVE_SYS_STAT_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/types.h> header file. */
|
||||||
|
#undef HAVE_SYS_TYPES_H
|
||||||
|
|
||||||
|
/* Define if you have the `tsearch' function. */
|
||||||
|
#undef HAVE_TSEARCH
|
||||||
|
|
||||||
|
/* Define if you have the <unistd.h> header file. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define if you have the `vprintf' function. */
|
||||||
|
#undef HAVE_VPRINTF
|
||||||
|
|
||||||
|
/* Define if you have the <wchar.h> header file. */
|
||||||
|
#undef HAVE_WCHAR_H
|
||||||
|
|
||||||
|
/* Define if you have the <wctype.h> header file. */
|
||||||
|
#undef HAVE_WCTYPE_H
|
||||||
|
|
||||||
|
/* Define to 1 if `strerror_r' returns a string. */
|
||||||
|
#undef HAVE_WORKING_STRERROR_R
|
||||||
|
|
||||||
|
/* Define if you have the `__argz_count' function. */
|
||||||
|
#undef HAVE___ARGZ_COUNT
|
||||||
|
|
||||||
|
/* Define if you have the `__argz_next' function. */
|
||||||
|
#undef HAVE___ARGZ_NEXT
|
||||||
|
|
||||||
|
/* Define if you have the `__argz_stringify' function. */
|
||||||
|
#undef HAVE___ARGZ_STRINGIFY
|
||||||
|
|
||||||
|
/* Define as const if the declaration of iconv() needs const. */
|
||||||
|
#undef ICONV_CONST
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
|
/* Define if compiler has function prototypes */
|
||||||
|
#undef PROTOTYPES
|
||||||
|
|
||||||
|
/* If using the C implementation of alloca, define if you know the
|
||||||
|
direction of stack growth for your system; otherwise it will be
|
||||||
|
automatically deduced at run-time.
|
||||||
|
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||||
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||||
|
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||||
|
#undef STACK_DIRECTION
|
||||||
|
|
||||||
|
/* Define if you have the ANSI C header files. */
|
||||||
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#undef VERSION
|
||||||
|
|
||||||
|
/* Define if using the dmalloc debugging malloc package */
|
||||||
|
#undef WITH_DMALLOC
|
||||||
|
|
||||||
|
/* Define to 1 for GNU C library extensions. */
|
||||||
|
#undef _GNU_SOURCE
|
||||||
|
|
||||||
|
/* Define if on MINIX. */
|
||||||
|
#undef _MINIX
|
||||||
|
|
||||||
|
/* Define if the system does not provide POSIX.1 features except with this
|
||||||
|
defined. */
|
||||||
|
#undef _POSIX_1_SOURCE
|
||||||
|
|
||||||
|
/* Define if you need to in order for `stat' and other things to work. */
|
||||||
|
#undef _POSIX_SOURCE
|
||||||
|
|
||||||
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
|
#undef const
|
||||||
|
|
||||||
|
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
||||||
|
if it is not supported. */
|
||||||
|
#undef inline
|
||||||
|
|
||||||
|
/* Define to rpl_malloc if the replacement function should be used. */
|
||||||
|
#undef malloc
|
||||||
|
|
||||||
|
/* Define to a type if <wchar.h> does not define. */
|
||||||
|
#undef mbstate_t
|
||||||
|
|
||||||
|
/* Define to `long' if <sys/types.h> does not define. */
|
||||||
|
#undef off_t
|
||||||
|
|
||||||
|
/* Define to rpl_realloc if the replacement function should be used. */
|
||||||
|
#undef realloc
|
||||||
|
|
||||||
|
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||||
|
#undef size_t
|
||||||
+56
-86
@@ -1,6 +1,7 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,89 +16,62 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# In order for some versions of Sun Studio to compile our C++ test cases
|
# testsuite -C appears in 2.62.
|
||||||
# correctly, we need Autoconf 2.64 or better to handle the restrict
|
AC_PREREQ(2.62)
|
||||||
# keyword in at least string.h from gnulib. We need Autoconf 2.68 or
|
|
||||||
# better to avoid a typo in the `configure --help' entry for the YACC
|
|
||||||
# environment variable.
|
|
||||||
AC_PREREQ([2.68])
|
|
||||||
m4_pattern_forbid([^gl_[A-Z]])
|
|
||||||
|
|
||||||
AC_INIT([GNU Bison],
|
AC_INIT([GNU Bison],
|
||||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||||
[[email protected]])
|
[[email protected]])
|
||||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2012])
|
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2008],
|
||||||
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
[The copyright year for this package])
|
||||||
[The copyright year for this package])
|
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2008])
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here:
|
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
||||||
#
|
# We want gnits strictness only when rolling a formal release so that we can,
|
||||||
# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131
|
# for example, run make dist at other times without being required to add a
|
||||||
#
|
# bogus NEWS entry.
|
||||||
# To avoid 1.11, we make 1.11.1 the minimum version.
|
AM_INIT_AUTOMAKE([1.8 dist-bzip2]
|
||||||
#
|
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [-], [gnu], [gnits]))
|
||||||
# We want gnits strictness only when rolling a stable release. For
|
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
||||||
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
|
||||||
# doesn't like that, so we let the underscore disable gnits. Between
|
|
||||||
# releases, we want to be able run make dist without being required to
|
|
||||||
# add a bogus NEWS entry. In that case, the version string
|
|
||||||
# automatically contains a dash, which we also let disable gnits.
|
|
||||||
AM_INIT_AUTOMAKE([1.11.1 dist-xz silent-rules]
|
|
||||||
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
|
||||||
[gnu], [gnits]))
|
|
||||||
AM_SILENT_RULES([yes])
|
|
||||||
AC_CONFIG_HEADERS([lib/config.h:lib/config.in.h])
|
|
||||||
|
|
||||||
# Checks for the compiler.
|
# Checks for the compiler.
|
||||||
AC_PROG_CC_STDC
|
AC_PROG_CC_STDC
|
||||||
AC_PROG_CXX
|
|
||||||
|
|
||||||
# Gnulib (early checks).
|
# Gnulib (early checks).
|
||||||
gl_EARLY
|
gl_EARLY
|
||||||
|
|
||||||
AC_ARG_ENABLE([gcc-warnings],
|
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)],
|
||||||
[case $enable_gcc_warnings in
|
[case "${enableval}" in
|
||||||
yes|no) ;;
|
yes|no) ;;
|
||||||
*) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);;
|
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
||||||
esac],
|
esac],
|
||||||
[enable_gcc_warnings=no])
|
[enableval=no])
|
||||||
if test "$enable_gcc_warnings" = yes; then
|
if test "${enableval}" = yes; then
|
||||||
warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align
|
|
||||||
-Wcast-qual -Wformat -Wpointer-arith -Wwrite-strings'
|
|
||||||
warn_c='-Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes
|
|
||||||
-Wshadow -Wstrict-prototypes'
|
|
||||||
warn_cxx='-Wnoexcept'
|
|
||||||
AC_LANG_PUSH([C])
|
|
||||||
for i in $warn_common $warn_c;
|
|
||||||
do
|
|
||||||
gl_WARN_ADD([$i], [WARN_CFLAGS])
|
|
||||||
done
|
|
||||||
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
||||||
# Warnings for the test suite only.
|
AC_SUBST([WERROR_CFLAGS])
|
||||||
gl_WARN_ADD([-Wundef], [WARN_CFLAGS_TEST])
|
gl_WARN_ADD([-Wall])
|
||||||
gl_WARN_ADD([-pedantic], [WARN_CFLAGS_TEST])
|
gl_WARN_ADD([-Wextra -Wno-sign-compare])
|
||||||
AC_LANG_POP([C])
|
gl_WARN_ADD([-Wcast-align])
|
||||||
|
gl_WARN_ADD([-Wcast-qual])
|
||||||
AC_LANG_PUSH([C++])
|
gl_WARN_ADD([-Wformat])
|
||||||
for i in $warn_common $warn_cxx;
|
gl_WARN_ADD([-Wpointer-arith])
|
||||||
do
|
gl_WARN_ADD([-Wwrite-strings])
|
||||||
gl_WARN_ADD([$i], [WARN_CXXFLAGS])
|
AC_SUBST([WARN_CXXFLAGS], [$WARN_CFLAGS])
|
||||||
done
|
# The following warnings are not suitable for C++.
|
||||||
gl_WARN_ADD([ -Wzero-as-null-pointer-constant], [WARN_CXXFLAGS],
|
gl_WARN_ADD([-Wbad-function-cast])
|
||||||
[AC_LANG_PROGRAM([], [nullptr])])
|
gl_WARN_ADD([-Wmissing-declarations])
|
||||||
gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS])
|
gl_WARN_ADD([-Wmissing-prototypes])
|
||||||
# Warnings for the test suite only.
|
gl_WARN_ADD([-Wshadow])
|
||||||
gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST])
|
gl_WARN_ADD([-Wstrict-prototypes])
|
||||||
gl_WARN_ADD([-pedantic], [WARN_CXXFLAGS_TEST])
|
AC_SUBST([WARN_CFLAGS])
|
||||||
AC_LANG_POP([C++])
|
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BISON_TEST_FOR_WORKING_C_COMPILER
|
BISON_TEST_FOR_WORKING_C_COMPILER
|
||||||
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([yacc],
|
AC_ARG_ENABLE([yacc],
|
||||||
[AC_HELP_STRING([--disable-yacc],
|
[AC_HELP_STRING([--disable-yacc],
|
||||||
@@ -105,8 +79,8 @@ AC_ARG_ENABLE([yacc],
|
|||||||
, [enable_yacc=yes])
|
, [enable_yacc=yes])
|
||||||
case $enable_yacc in
|
case $enable_yacc in
|
||||||
yes)
|
yes)
|
||||||
YACC_SCRIPT=yacc
|
YACC_SCRIPT=src/yacc
|
||||||
YACC_LIBRARY=liby.a;;
|
YACC_LIBRARY=lib/liby.a;;
|
||||||
*)
|
*)
|
||||||
YACC_SCRIPT=
|
YACC_SCRIPT=
|
||||||
YACC_LIBRARY=;;
|
YACC_LIBRARY=;;
|
||||||
@@ -116,7 +90,6 @@ AC_SUBST([YACC_LIBRARY])
|
|||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AC_PROG_LEX
|
AC_PROG_LEX
|
||||||
$LEX_IS_FLEX || AC_MSG_ERROR([Flex is required])
|
|
||||||
AC_PROG_YACC
|
AC_PROG_YACC
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
AC_PROG_GNU_M4
|
AC_PROG_GNU_M4
|
||||||
@@ -140,13 +113,14 @@ gl_INIT
|
|||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||||
AM_WITH_DMALLOC
|
AM_WITH_DMALLOC
|
||||||
|
BISON_PREREQ_SUBPIPE
|
||||||
BISON_PREREQ_TIMEVAR
|
BISON_PREREQ_TIMEVAR
|
||||||
|
|
||||||
# Gettext.
|
# Gettext.
|
||||||
# We use gnulib, which is only guaranteed to work properly with the
|
# We use gnulib, which is only guaranteed to work properly with the
|
||||||
# latest Gettext.
|
# latest Gettext.
|
||||||
AM_GNU_GETTEXT([external], [need-ngettext])
|
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||||
AM_GNU_GETTEXT_VERSION([0.18])
|
AM_GNU_GETTEXT_VERSION([0.17])
|
||||||
BISON_I18N
|
BISON_I18N
|
||||||
|
|
||||||
# Internationalized parsers.
|
# Internationalized parsers.
|
||||||
@@ -160,34 +134,30 @@ AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
|
|||||||
|
|
||||||
# Initialize the test suite.
|
# Initialize the test suite.
|
||||||
AC_CONFIG_TESTDIR(tests)
|
AC_CONFIG_TESTDIR(tests)
|
||||||
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
AC_CONFIG_FILES([tests/atlocal])
|
||||||
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
||||||
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
||||||
case $VALGRIND:$host_os in
|
AC_PROG_CXX
|
||||||
'':*) ;;
|
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
||||||
*:darwin*)
|
|
||||||
# See README-hacking.
|
|
||||||
# VALGRIND+=' --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind'
|
|
||||||
VALGRIND=;;
|
|
||||||
*:*)
|
|
||||||
AC_SUBST([VALGRIND_PREBISON], [$VALGRIND -q]);;
|
|
||||||
esac
|
|
||||||
|
|
||||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||||
# Needed by tests/atlocal.in.
|
# Needed by tests/atlocal.in.
|
||||||
AC_SUBST([GCC])
|
AC_SUBST([GCC])
|
||||||
|
AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||||
|
AC_SUBST([O0CXXFLAGS], [`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||||
|
|
||||||
gt_JAVACOMP([1.3])
|
gt_JAVACOMP([1.3], [1.4])
|
||||||
gt_JAVAEXEC
|
gt_JAVAEXEC
|
||||||
|
|
||||||
|
# We use gnulib, but from lib/local.mk instead of lib/Makefile.am.
|
||||||
|
# So prefix paths with lib/. See also etc/prefix-gnulib-mk.
|
||||||
|
gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, , lib/,g'`
|
||||||
|
for ac_var in ALLOCA_H ERRNO_H FCNTL_H GETOPT_H INTTYPES_H \
|
||||||
|
STDBOOL_H STDINT_H SYS_WAIT_H WCHAR_H WCTYPE_H
|
||||||
|
do
|
||||||
|
eval "test 'x$ac_var' = x || $ac_var=lib/\$$ac_var"
|
||||||
|
done
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
build-aux/Makefile
|
|
||||||
po/Makefile.in
|
po/Makefile.in
|
||||||
data/Makefile
|
examples/calc++/Makefile
|
||||||
etc/Makefile
|
doc/yacc.1])
|
||||||
examples/Makefile
|
|
||||||
examples/calc++/Makefile
|
|
||||||
lib/Makefile src/Makefile
|
|
||||||
doc/Makefile
|
|
||||||
doc/yacc.1])
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
Makefile.in
|
|
||||||
Makefile
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/Makefile.in
|
|
||||||
/Makefile
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
## Copyright (C) 2002, 2005-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
dist_pkgdata_DATA = README bison.m4 \
|
|
||||||
c-skel.m4 c.m4 yacc.c glr.c \
|
|
||||||
c++-skel.m4 c++.m4 location.cc lalr1.cc glr.cc stack.hh \
|
|
||||||
java-skel.m4 java.m4 lalr1.java
|
|
||||||
|
|
||||||
m4sugardir = $(pkgdatadir)/m4sugar
|
|
||||||
dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/foreach.m4
|
|
||||||
|
|
||||||
xsltdir = $(pkgdatadir)/xslt
|
|
||||||
dist_xslt_DATA = \
|
|
||||||
xslt/bison.xsl \
|
|
||||||
xslt/xml2dot.xsl \
|
|
||||||
xslt/xml2text.xsl \
|
|
||||||
xslt/xml2xhtml.xsl
|
|
||||||
+1
-1
@@ -52,7 +52,7 @@ into various formats.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2008-2012 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2008-2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
+306
-75
@@ -1,8 +1,8 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# Language-independent M4 Macros for Bison.
|
# Language-independent M4 Macros for Bison.
|
||||||
|
# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009
|
||||||
# Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc.
|
# Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,14 +22,17 @@
|
|||||||
## Identification. ##
|
## Identification. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# b4_copyright(TITLE, YEARS)
|
# b4_copyright(TITLE, [YEARS])
|
||||||
# --------------------------
|
# ----------------------------
|
||||||
|
# If YEARS are not defined, use b4_copyright_years.
|
||||||
m4_define([b4_copyright],
|
m4_define([b4_copyright],
|
||||||
[b4_comment([A Bison parser, made by GNU Bison b4_version.])
|
[b4_comment([A Bison parser, made by GNU Bison b4_version.])
|
||||||
|
|
||||||
b4_comment([$1
|
b4_comment([$1
|
||||||
|
|
||||||
m4_text_wrap([Copyright (C) $2 Free Software Foundation, Inc.], [ ])
|
]m4_dquote(m4_text_wrap([Copyright (C)
|
||||||
|
]m4_ifval([$2], [[$2]], [m4_defn([b4_copyright_years])])[
|
||||||
|
Free Software Foundation, Inc.]))[
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -85,7 +88,7 @@ m4_if(m4_sysval, [0], [], [m4_fatal([$0: cannot write to stdout])])])
|
|||||||
#
|
#
|
||||||
# For example:
|
# For example:
|
||||||
#
|
#
|
||||||
# b4_error([[warn]], [[invalid value for '%s': %s]], [[foo]], [[3]])
|
# b4_error([[warn]], [[invalid value for `%s': %s]], [[foo]], [[3]])
|
||||||
m4_define([b4_error],
|
m4_define([b4_error],
|
||||||
[b4_cat([[@]$1[(]$2[]]dnl
|
[b4_cat([[@]$1[(]$2[]]dnl
|
||||||
[m4_if([$#], [2], [],
|
[m4_if([$#], [2], [],
|
||||||
@@ -114,7 +117,7 @@ m4_define([b4_error_at],
|
|||||||
#
|
#
|
||||||
# For example:
|
# For example:
|
||||||
#
|
#
|
||||||
# b4_warn([[invalid value for '%s': %s]], [[foo]], [[3]])
|
# b4_warn([[invalid value for `%s': %s]], [[foo]], [[3]])
|
||||||
#
|
#
|
||||||
# As a simple test suite, this:
|
# As a simple test suite, this:
|
||||||
#
|
#
|
||||||
@@ -183,6 +186,21 @@ m4_define([b4_fatal_at],
|
|||||||
m4_exit(1)])
|
m4_exit(1)])
|
||||||
|
|
||||||
|
|
||||||
|
## ---------------- ##
|
||||||
|
## Default values. ##
|
||||||
|
## ---------------- ##
|
||||||
|
|
||||||
|
# m4_define_default([b4_lex_param], []) dnl breaks other skeletons
|
||||||
|
m4_define_default([b4_pre_prologue], [])
|
||||||
|
m4_define_default([b4_post_prologue], [])
|
||||||
|
m4_define_default([b4_epilogue], [])
|
||||||
|
m4_define_default([b4_parse_param], [])
|
||||||
|
|
||||||
|
# The initial column and line.
|
||||||
|
m4_define_default([b4_location_initial_column], [1])
|
||||||
|
m4_define_default([b4_location_initial_line], [1])
|
||||||
|
|
||||||
|
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
## Data Types. ##
|
## Data Types. ##
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
@@ -194,6 +212,87 @@ m4_define([b4_ints_in],
|
|||||||
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
|
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_subtract(LHS, RHS)
|
||||||
|
# ---------------------
|
||||||
|
# Evaluate LHS - RHS if they are integer literals, otherwise expand
|
||||||
|
# to (LHS) - (RHS).
|
||||||
|
m4_define([b4_subtract],
|
||||||
|
[m4_bmatch([$1$2], [^[0123456789]*$],
|
||||||
|
[m4_eval([$1 - $2])],
|
||||||
|
[($1) - ($2)])])
|
||||||
|
|
||||||
|
# b4_args(ARG1, ...)
|
||||||
|
# _b4_args(ARG1, ...)
|
||||||
|
# -------------------
|
||||||
|
# Join with comma, skipping empty arguments.
|
||||||
|
# b4_args calls itself recursively until it sees the first non-empty
|
||||||
|
# argument, then calls _b4_args which prepends each non-empty argument
|
||||||
|
# with a comma.
|
||||||
|
m4_define([b4_args],
|
||||||
|
[m4_if([$#$1],
|
||||||
|
[1], [],
|
||||||
|
[m4_ifval([$1],
|
||||||
|
[$1[]_$0(m4_shift($@))],
|
||||||
|
[$0(m4_shift($@))])])])
|
||||||
|
|
||||||
|
# _b4_args(ARGS1, ...)
|
||||||
|
# --------------------
|
||||||
|
m4_define([_b4_args],
|
||||||
|
[m4_if([$#$1],
|
||||||
|
[1], [],
|
||||||
|
[m4_ifval([$1], [, $1])[]$0(m4_shift($@))])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# b4_integral_parser_tables_map(MACRO)
|
||||||
|
# -------------------------------------
|
||||||
|
# Map MACRO on all the integral tables. MACRO is expected to have
|
||||||
|
# the signature MACRO(TABLE-NAME, CONTENT, COMMENT).
|
||||||
|
m4_define([b4_integral_parser_tables_map],
|
||||||
|
[$1([pact], [b4_pact],
|
||||||
|
[[YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
||||||
|
STATE-NUM.]])
|
||||||
|
|
||||||
|
$1([defact], [b4_defact],
|
||||||
|
[[YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||||
|
YYTABLE does not specify something else to do. Zero means the default
|
||||||
|
is an error.]])
|
||||||
|
|
||||||
|
$1([pgoto], [b4_pgoto], [[YYPGOTO[NTERM-NUM].]])
|
||||||
|
|
||||||
|
$1([defgoto], [b4_defgoto], [[YYDEFGOTO[NTERM-NUM].]])
|
||||||
|
|
||||||
|
$1([table], [b4_table],
|
||||||
|
[[YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||||
|
positive, shift that token. If negative, reduce the rule which
|
||||||
|
number is the opposite. If YYTABLE_NINF, syntax error.]])
|
||||||
|
|
||||||
|
$1([check], [b4_check])
|
||||||
|
|
||||||
|
$1([stos], [b4_stos],
|
||||||
|
[[STOS_[STATE-NUM] -- The (internal number of the) accessing
|
||||||
|
symbol of state STATE-NUM.]])
|
||||||
|
|
||||||
|
$1([r1], [b4_r1],
|
||||||
|
[[YYR1[YYN] -- Symbol number of symbol that rule YYN derives.]])
|
||||||
|
|
||||||
|
$1([r2], [b4_r2],
|
||||||
|
[[YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.]])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_parser_tables_declare
|
||||||
|
# b4_parser_tables_define
|
||||||
|
# ------------------------
|
||||||
|
# Define/declare the (deterministic) parser tables.
|
||||||
|
m4_define([b4_parser_tables_declare],
|
||||||
|
[b4_integral_parser_tables_map([b4_integral_parser_table_declare])])
|
||||||
|
|
||||||
|
m4_define([b4_parser_tables_define],
|
||||||
|
[b4_integral_parser_tables_map([b4_integral_parser_table_define])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------ ##
|
## ------------------ ##
|
||||||
## Decoding options. ##
|
## Decoding options. ##
|
||||||
@@ -218,9 +317,9 @@ m4_define([b4_define_flag_if],
|
|||||||
|
|
||||||
# _b4_define_flag_if($1, $2, FLAG)
|
# _b4_define_flag_if($1, $2, FLAG)
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
# Work around the impossibility to define macros inside macros,
|
# This macro works around the impossibility to define macros
|
||||||
# because issuing `[$1]' is not possible in M4. GNU M4 should provide
|
# inside macros, because issuing `[$1]' is not possible in M4 :(.
|
||||||
# $$1 a la M5/TeX.
|
# This sucks hard, GNU M4 should really provide M5 like $$1.
|
||||||
m4_define([_b4_define_flag_if],
|
m4_define([_b4_define_flag_if],
|
||||||
[m4_if([$1$2], $[1]$[2], [],
|
[m4_if([$1$2], $[1]$[2], [],
|
||||||
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
||||||
@@ -231,16 +330,120 @@ m4_define([b4_$3_if],
|
|||||||
# b4_FLAG_if(IF-TRUE, IF-FALSE)
|
# b4_FLAG_if(IF-TRUE, IF-FALSE)
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise.
|
# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise.
|
||||||
b4_define_flag_if([defines]) # Whether headers are requested.
|
b4_define_flag_if([defines]) # Whether headers are requested.
|
||||||
b4_define_flag_if([error_verbose]) # Whether error are verbose.
|
b4_define_flag_if([glr]) # Whether a GLR parser is requested.
|
||||||
b4_define_flag_if([glr]) # Whether a GLR parser is requested.
|
b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled.
|
||||||
b4_define_flag_if([locations]) # Whether locations are tracked.
|
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||||
b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled.
|
|
||||||
b4_define_flag_if([token_table]) # Whether yytoken_table is demanded.
|
|
||||||
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
|
||||||
|
|
||||||
# yytoken_table is needed to support verbose errors.
|
|
||||||
b4_error_verbose_if([m4_define([b4_token_table_flag], [1])])
|
## --------- ##
|
||||||
|
## Symbols. ##
|
||||||
|
## --------- ##
|
||||||
|
|
||||||
|
# b4_symbol_(NUM, FIELD)
|
||||||
|
# ----------------------
|
||||||
|
# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if
|
||||||
|
# undefined.
|
||||||
|
m4_define([b4_symbol_],
|
||||||
|
[m4_indir([b4_symbol($1, $2)])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol(NUM, FIELD)
|
||||||
|
# ---------------------
|
||||||
|
# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if
|
||||||
|
# undefined. If FIELD = id, prepend the prefix.
|
||||||
|
m4_define([b4_symbol],
|
||||||
|
[m4_case([$2],
|
||||||
|
[id], [m4_do([b4_percent_define_get([api.tokens.prefix])],
|
||||||
|
[b4_symbol_([$1], [id])])],
|
||||||
|
[b4_symbol_($@)])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_if(NUM, FIELD, IF-TRUE, IF-FALSE)
|
||||||
|
# -------------------------------------------
|
||||||
|
# If FIELD about symbol #NUM is 1 expand IF-TRUE, if is 0, expand IF-FALSE.
|
||||||
|
# Otherwise an error.
|
||||||
|
m4_define([b4_symbol_if],
|
||||||
|
[m4_case(b4_symbol([$1], [$2]),
|
||||||
|
[1], [$3],
|
||||||
|
[0], [$4],
|
||||||
|
[m4_fatal([$0: field $2 of $1 is not a Boolean:] b4_symbol([$1], [$2]))])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_action_location(SYMBOL-NUM, KIND)
|
||||||
|
# -------------------------------------------
|
||||||
|
# Report the location of the KIND action as FILE:LINE.
|
||||||
|
m4_define([b4_symbol_action_location],
|
||||||
|
[b4_symbol([$1], [$2_file]):b4_syncline([b4_symbol([$1], [$2_line])])])
|
||||||
|
|
||||||
|
|
||||||
|
# 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],
|
||||||
|
[m4_pushdef([b4_dollar_dollar],
|
||||||
|
[b4_symbol_value([(*yyvaluep)],
|
||||||
|
b4_symbol_if([$1], [has_type],
|
||||||
|
[b4_symbol([$1], [type])]))])dnl
|
||||||
|
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
|
||||||
|
b4_symbol_case_([$1])
|
||||||
|
b4_syncline([b4_symbol([$1], [$2_line])], ["b4_symbol([$1], [$2_file])"])
|
||||||
|
b4_symbol([$1], [$2])
|
||||||
|
b4_syncline([@oline@], [@ofile@])
|
||||||
|
break;
|
||||||
|
|
||||||
|
m4_popdef([b4_at_dollar])dnl
|
||||||
|
m4_popdef([b4_dollar_dollar])dnl
|
||||||
|
])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_destructor(SYMBOL-NUM)
|
||||||
|
# b4_symbol_printer(SYMBOL-NUM)
|
||||||
|
# --------------------------------
|
||||||
|
m4_define([b4_symbol_destructor], [b4_symbol_action([$1], [destructor])])
|
||||||
|
m4_define([b4_symbol_printer], [b4_symbol_action([$1], [printer])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_case_(SYMBOL-NUM)
|
||||||
|
# ---------------------------
|
||||||
|
# Issue a "case NUM" for SYMBOL-NUM.
|
||||||
|
m4_define([b4_symbol_case_],
|
||||||
|
[ case b4_symbol([$1], [number]): // b4_symbol([$1], [tag])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_foreach(MACRO)
|
||||||
|
# ------------------------
|
||||||
|
# Invoke MACRO(SYMBOL-NUM) for each SYMBOL-NUM.
|
||||||
|
m4_define([b4_symbol_foreach],
|
||||||
|
[m4_map([$1], m4_defn([b4_symbol_numbers]))])
|
||||||
|
|
||||||
|
|
||||||
|
## ------- ##
|
||||||
|
## Types. ##
|
||||||
|
## ------- ##
|
||||||
|
|
||||||
|
# b4_type_action_(NUMS)
|
||||||
|
# ---------------------
|
||||||
|
# Run actions for the symbol NUMS that all have the same type-name.
|
||||||
|
# Skip NUMS that have no type-name.
|
||||||
|
m4_define([b4_type_action_],
|
||||||
|
[b4_symbol_if([$1], [has_type],
|
||||||
|
[m4_map([b4_symbol_case_], [$@])[]dnl
|
||||||
|
b4_dollar_dollar([b4_symbol([$1], [number])],
|
||||||
|
[b4_symbol([$1], [tag])],
|
||||||
|
[b4_symbol([$1], [type])]);
|
||||||
|
break;
|
||||||
|
|
||||||
|
])])
|
||||||
|
|
||||||
|
# b4_type_foreach(MACRO)
|
||||||
|
# ----------------------
|
||||||
|
# Invoke MACRO(SYMBOL-NUMS) for each set of SYMBOL-NUMS for each type set.
|
||||||
|
m4_define([b4_type_foreach],
|
||||||
|
[m4_map([$1], m4_defn([b4_type_names]))])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -259,8 +462,8 @@ m4_define([b4_basename],
|
|||||||
# b4_syncline(LINE, FILE)
|
# b4_syncline(LINE, FILE)
|
||||||
# -----------------------
|
# -----------------------
|
||||||
m4_define([b4_syncline],
|
m4_define([b4_syncline],
|
||||||
[b4_flag_if([synclines], [
|
[b4_flag_if([synclines],
|
||||||
b4_sync_end([__line__], [b4_basename(m4_quote(__file__))])
|
[b4_sync_end([__line__], [b4_basename(m4_quote(__file__))])
|
||||||
b4_sync_start([$1], [$2])])])
|
b4_sync_start([$1], [$2])])])
|
||||||
|
|
||||||
m4_define([b4_sync_end], [b4_comment([Line $1 of $2])])
|
m4_define([b4_sync_end], [b4_comment([Line $1 of $2])])
|
||||||
@@ -297,10 +500,10 @@ b4_define_user_code([stype])
|
|||||||
|
|
||||||
|
|
||||||
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
|
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
|
||||||
# -----------------------------------------------------
|
# --------------------------------------------------------
|
||||||
# Complain if any name of type WHAT is used by the user (as recorded in
|
# Warn if any name of type WHAT is used by the user (as recorded in USER-LIST)
|
||||||
# USER-LIST) but is not used by Bison (as recorded by macros in the
|
# but is not used by Bison (as recorded by macros in the namespace
|
||||||
# namespace BISON-NAMESPACE).
|
# BISON-NAMESPACE).
|
||||||
#
|
#
|
||||||
# USER-LIST must expand to a list specifying all user occurrences of all names
|
# USER-LIST must expand to a list specifying all user occurrences of all names
|
||||||
# of type WHAT. Each item in the list must be a triplet specifying one
|
# of type WHAT. Each item in the list must be a triplet specifying one
|
||||||
@@ -338,9 +541,9 @@ m4_pushdef([b4_user_name], m4_car(b4_occurrence))dnl
|
|||||||
m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl
|
m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl
|
||||||
m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl
|
m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl
|
||||||
m4_ifndef($3[(]m4_quote(b4_user_name)[)],
|
m4_ifndef($3[(]m4_quote(b4_user_name)[)],
|
||||||
[b4_complain_at([b4_start], [b4_end],
|
[b4_warn_at([b4_start], [b4_end],
|
||||||
[[%s '%s' is not used]],
|
[[%s `%s' is not used]],
|
||||||
[$1], [b4_user_name])])[]dnl
|
[$1], [b4_user_name])])[]dnl
|
||||||
m4_popdef([b4_occurrence])dnl
|
m4_popdef([b4_occurrence])dnl
|
||||||
m4_popdef([b4_user_name])dnl
|
m4_popdef([b4_user_name])dnl
|
||||||
m4_popdef([b4_start])dnl
|
m4_popdef([b4_start])dnl
|
||||||
@@ -349,7 +552,6 @@ m4_popdef([b4_end])dnl
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## --------------------- ##
|
## --------------------- ##
|
||||||
## b4_percent_define_*. ##
|
## b4_percent_define_*. ##
|
||||||
## --------------------- ##
|
## --------------------- ##
|
||||||
@@ -362,11 +564,10 @@ m4_define([b4_percent_define_use],
|
|||||||
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
|
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
# b4_percent_define_get(VARIABLE, [DEFAULT])
|
# b4_percent_define_get(VARIABLE)
|
||||||
# ------------------------------------------
|
# -------------------------------
|
||||||
# Mimic muscle_percent_define_get in ../src/muscle-tab.h. That is, if
|
# Mimic muscle_percent_define_get in ../src/muscle_tab.h exactly. That is, if
|
||||||
# the %define variable VARIABLE is defined, emit its value. Contrary
|
# the %define variable VARIABLE is defined, emit its value. Also, record
|
||||||
# to its C counterpart, return DEFAULT otherwise. Also, record
|
|
||||||
# Bison's usage of VARIABLE by defining
|
# Bison's usage of VARIABLE by defining
|
||||||
# b4_percent_define_bison_variables(VARIABLE).
|
# b4_percent_define_bison_variables(VARIABLE).
|
||||||
#
|
#
|
||||||
@@ -375,14 +576,11 @@ m4_define([b4_percent_define_use],
|
|||||||
# b4_percent_define_get([[foo]])
|
# b4_percent_define_get([[foo]])
|
||||||
m4_define([b4_percent_define_get],
|
m4_define([b4_percent_define_get],
|
||||||
[b4_percent_define_use([$1])dnl
|
[b4_percent_define_use([$1])dnl
|
||||||
m4_ifdef([b4_percent_define(]$1[)],
|
m4_ifdef([b4_percent_define(]$1[)], [m4_indir([b4_percent_define(]$1[)])])])
|
||||||
[m4_indir([b4_percent_define(]$1[)])],
|
|
||||||
[$2])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_get_loc(VARIABLE)
|
# b4_percent_define_get_loc(VARIABLE)
|
||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
# Mimic muscle_percent_define_get_loc in ../src/muscle-tab.h exactly. That is,
|
# Mimic muscle_percent_define_get_loc in ../src/muscle_tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is undefined, complain fatally since that's
|
# if the %define variable VARIABLE is undefined, complain fatally since that's
|
||||||
# a Bison or skeleton error. Otherwise, return its definition location in a
|
# a Bison or skeleton error. Otherwise, return its definition location in a
|
||||||
# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or
|
# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or
|
||||||
@@ -397,11 +595,11 @@ m4_define([b4_percent_define_get_loc],
|
|||||||
[m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl
|
[m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl
|
||||||
b4_loc[]dnl
|
b4_loc[]dnl
|
||||||
m4_popdef([b4_loc])],
|
m4_popdef([b4_loc])],
|
||||||
[b4_fatal([[b4_percent_define_get_loc: undefined %%define variable '%s']], [$1])])])
|
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_get_loc]], [$1])])])
|
||||||
|
|
||||||
# b4_percent_define_get_syncline(VARIABLE)
|
# b4_percent_define_get_syncline(VARIABLE)
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
# Mimic muscle_percent_define_get_syncline in ../src/muscle-tab.h exactly.
|
# Mimic muscle_percent_define_get_syncline in ../src/muscle_tab.h exactly.
|
||||||
# That is, if the %define variable VARIABLE is undefined, complain fatally
|
# That is, if the %define variable VARIABLE is undefined, complain fatally
|
||||||
# since that's a Bison or skeleton error. Otherwise, return its definition
|
# since that's a Bison or skeleton error. Otherwise, return its definition
|
||||||
# location as a b4_syncline invocation. Don't record this as a Bison usage of
|
# location as a b4_syncline invocation. Don't record this as a Bison usage of
|
||||||
@@ -414,11 +612,11 @@ m4_popdef([b4_loc])],
|
|||||||
m4_define([b4_percent_define_get_syncline],
|
m4_define([b4_percent_define_get_syncline],
|
||||||
[m4_ifdef([b4_percent_define_syncline(]$1[)],
|
[m4_ifdef([b4_percent_define_syncline(]$1[)],
|
||||||
[m4_indir([b4_percent_define_syncline(]$1[)])],
|
[m4_indir([b4_percent_define_syncline(]$1[)])],
|
||||||
[b4_fatal([[b4_percent_define_get_syncline: undefined %%define variable '%s']], [$1])])])
|
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_get_syncline]], [$1])])])
|
||||||
|
|
||||||
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
|
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
# Mimic muscle_percent_define_ifdef in ../src/muscle-tab.h exactly. That is,
|
# Mimic muscle_percent_define_ifdef in ../src/muscle_tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is defined, expand IF-TRUE, else expand
|
# if the %define variable VARIABLE is defined, expand IF-TRUE, else expand
|
||||||
# IF-FALSE. Also, record Bison's usage of VARIABLE by defining
|
# IF-FALSE. Also, record Bison's usage of VARIABLE by defining
|
||||||
# b4_percent_define_bison_variables(VARIABLE).
|
# b4_percent_define_bison_variables(VARIABLE).
|
||||||
@@ -428,12 +626,18 @@ m4_define([b4_percent_define_get_syncline],
|
|||||||
# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
|
# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
|
||||||
m4_define([b4_percent_define_ifdef],
|
m4_define([b4_percent_define_ifdef],
|
||||||
[m4_ifdef([b4_percent_define(]$1[)],
|
[m4_ifdef([b4_percent_define(]$1[)],
|
||||||
[m4_define([b4_percent_define_bison_variables(]$1[)])$2],
|
[b4_percent_define_use([$1])$2],
|
||||||
[$3])])
|
[$3])])
|
||||||
|
|
||||||
|
|
||||||
|
## --------- ##
|
||||||
|
## Options. ##
|
||||||
|
## --------- ##
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_flag_if(VARIABLE, IF-TRUE, [IF-FALSE])
|
# b4_percent_define_flag_if(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
# Mimic muscle_percent_define_flag_if in ../src/muscle-tab.h exactly. That is,
|
# Mimic muscle_percent_define_flag_if in ../src/muscle_tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is defined to "" or "true", expand IF-TRUE.
|
# if the %define variable VARIABLE is defined to "" or "true", expand IF-TRUE.
|
||||||
# If it is defined to "false", expand IF-FALSE. Complain if it is undefined
|
# If it is defined to "false", expand IF-FALSE. Complain if it is undefined
|
||||||
# (a Bison or skeleton error since the default value should have been set
|
# (a Bison or skeleton error since the default value should have been set
|
||||||
@@ -449,14 +653,15 @@ m4_define([b4_percent_define_flag_if],
|
|||||||
[m4_case(b4_percent_define_get([$1]),
|
[m4_case(b4_percent_define_get([$1]),
|
||||||
[], [$2], [true], [$2], [false], [$3],
|
[], [$2], [true], [$2], [false], [$3],
|
||||||
[m4_expand_once([b4_complain_at(b4_percent_define_get_loc([$1]),
|
[m4_expand_once([b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||||
[[invalid value for %%define Boolean variable '%s']],
|
[[invalid value for %%define Boolean variable `%s']],
|
||||||
[$1])],
|
[$1])],
|
||||||
[[b4_percent_define_flag_if($1)]])])],
|
[[b4_percent_define_flag_if($1)]])])],
|
||||||
[b4_fatal([[b4_percent_define_flag_if: undefined %%define variable '%s']], [$1])])])
|
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_flag_if]], [$1])])])
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_default(VARIABLE, DEFAULT)
|
# b4_percent_define_default(VARIABLE, DEFAULT)
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
# Mimic muscle_percent_define_default in ../src/muscle-tab.h exactly. That is,
|
# Mimic muscle_percent_define_default in ../src/muscle_tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is undefined, set its value to DEFAULT.
|
# if the %define variable VARIABLE is undefined, set its value to DEFAULT.
|
||||||
# Don't record this as a Bison usage of VARIABLE as there's no reason to
|
# Don't record this as a Bison usage of VARIABLE as there's no reason to
|
||||||
# suspect that the value has yet influenced the output.
|
# suspect that the value has yet influenced the output.
|
||||||
@@ -472,9 +677,23 @@ m4_define([b4_percent_define_default],
|
|||||||
[[<skeleton default value>:-1.-1]]]])dnl
|
[[<skeleton default value>:-1.-1]]]])dnl
|
||||||
m4_define([b4_percent_define_syncline(]$1[)], [[]])])])
|
m4_define([b4_percent_define_syncline(]$1[)], [[]])])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_percent_define_if_define(VARIABLE)
|
||||||
|
# -------------------------------------
|
||||||
|
# Define b4_VARIABLE_if that executes its $1 or $2 depending whether
|
||||||
|
# VARIABLE was %defined. The characters `.' and `-' in VARIABLE are mapped
|
||||||
|
# to `_'.
|
||||||
|
m4_define([b4_percent_define_if_define_],
|
||||||
|
[m4_define(m4_bpatsubst([b4_$1_if], [[-.]], [_]),
|
||||||
|
[b4_percent_define_flag_if([$1], [$2], [$3])])])
|
||||||
|
m4_define([b4_percent_define_if_define],
|
||||||
|
[b4_percent_define_default([[$1]], [[false]])
|
||||||
|
b4_percent_define_if_define_([$1], $[1], $[2])])
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_check_values(VALUES)
|
# b4_percent_define_check_values(VALUES)
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
# Mimic muscle_percent_define_check_values in ../src/muscle-tab.h exactly
|
# Mimic muscle_percent_define_check_values in ../src/muscle_tab.h exactly
|
||||||
# except that the VALUES structure is more appropriate for M4. That is, VALUES
|
# except that the VALUES structure is more appropriate for M4. That is, VALUES
|
||||||
# is a list of sublists of strings. For each sublist, the first string is the
|
# is a list of sublists of strings. For each sublist, the first string is the
|
||||||
# name of a %define variable, and all remaining strings in that sublist are the
|
# name of a %define variable, and all remaining strings in that sublist are the
|
||||||
@@ -501,15 +720,15 @@ m4_define([_b4_percent_define_check_values],
|
|||||||
[m4_define([b4_good_value], [1])])])])dnl
|
[m4_define([b4_good_value], [1])])])])dnl
|
||||||
m4_if(b4_good_value, [0],
|
m4_if(b4_good_value, [0],
|
||||||
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||||
[[invalid value for %%define variable '%s': '%s']],
|
[[invalid value for %%define variable `%s': `%s']],
|
||||||
[$1],
|
[$1],
|
||||||
m4_dquote(m4_indir([b4_percent_define(]$1[)])))
|
m4_dquote(m4_indir([b4_percent_define(]$1[)])))
|
||||||
m4_foreach([b4_value], m4_dquote(m4_shift($@)),
|
m4_foreach([b4_value], m4_dquote(m4_shift($@)),
|
||||||
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||||
[[accepted value: '%s']],
|
[[accepted value: `%s']],
|
||||||
m4_dquote(b4_value))])])dnl
|
m4_dquote(b4_value))])])dnl
|
||||||
m4_popdef([b4_good_value])],
|
m4_popdef([b4_good_value])],
|
||||||
[b4_fatal([[b4_percent_define_check_values: undefined %%define variable '%s']], [$1])])])
|
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_check_values]], [$1])])])
|
||||||
|
|
||||||
# b4_percent_code_get([QUALIFIER])
|
# b4_percent_code_get([QUALIFIER])
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
@@ -546,6 +765,41 @@ m4_define([b4_percent_code_ifdef],
|
|||||||
[$3])])
|
[$3])])
|
||||||
|
|
||||||
|
|
||||||
|
## ------------------ ##
|
||||||
|
## Common variables. ##
|
||||||
|
## ------------------ ##
|
||||||
|
|
||||||
|
# Default values for %define.
|
||||||
|
# ---------------------------
|
||||||
|
# If the api.tokens.prefix, it is empty.
|
||||||
|
m4_percent_define_default([[api.tokens.prefix]], [[]])
|
||||||
|
|
||||||
|
# b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
|
||||||
|
# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
|
||||||
|
# b4_lex_symbol_if([IF-YYLEX-RETURNS-A-COMPLETE-SYMBOL], [IF-NOT])
|
||||||
|
# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
|
||||||
|
# ----------------------------------------------
|
||||||
|
b4_percent_define_if_define([lex_symbol])
|
||||||
|
b4_percent_define_if_define([locations]) # Whether locations are tracked.
|
||||||
|
b4_percent_define_if_define([parse.assert])
|
||||||
|
b4_percent_define_if_define([parse.trace])
|
||||||
|
b4_percent_define_if_define([variant])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_error_verbose_if([IF-ERRORS-ARE-VERBOSE], [IF-NOT])
|
||||||
|
# ------------------------------------------------------
|
||||||
|
# Map %define parse.error "(simple|verbose)" to b4_error_verbose_if and
|
||||||
|
# b4_error_verbose_flag.
|
||||||
|
b4_percent_define_default([[parse.error]], [[simple]])
|
||||||
|
b4_percent_define_check_values([[[[parse.error]],
|
||||||
|
[[simple]], [[verbose]]]])
|
||||||
|
m4_define([b4_error_verbose_flag],
|
||||||
|
m4_case(b4_percent_define_get([[parse.error]]),
|
||||||
|
[simple], [[0]],
|
||||||
|
[verbose], [[1]]))
|
||||||
|
b4_define_flag_if([error_verbose])
|
||||||
|
|
||||||
|
|
||||||
## ----------------------------------------------------------- ##
|
## ----------------------------------------------------------- ##
|
||||||
## After processing the skeletons, check that all the user's ##
|
## After processing the skeletons, check that all the user's ##
|
||||||
## %define variables and %code qualifiers were used by Bison. ##
|
## %define variables and %code qualifiers were used by Bison. ##
|
||||||
@@ -561,26 +815,3 @@ m4_wrap_lifo([
|
|||||||
b4_check_user_names_wrap([[define]], [[variable]])
|
b4_check_user_names_wrap([[define]], [[variable]])
|
||||||
b4_check_user_names_wrap([[code]], [[qualifier]])
|
b4_check_user_names_wrap([[code]], [[qualifier]])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
|
||||||
## Default values. ##
|
|
||||||
## ---------------- ##
|
|
||||||
|
|
||||||
# m4_define_default([b4_lex_param], []) dnl breaks other skeletons
|
|
||||||
m4_define_default([b4_pre_prologue], [])
|
|
||||||
m4_define_default([b4_post_prologue], [])
|
|
||||||
m4_define_default([b4_epilogue], [])
|
|
||||||
m4_define_default([b4_parse_param], [])
|
|
||||||
|
|
||||||
# The initial column and line.
|
|
||||||
m4_define_default([b4_location_initial_column], [1])
|
|
||||||
m4_define_default([b4_location_initial_line], [1])
|
|
||||||
|
|
||||||
# Sanity checks.
|
|
||||||
b4_percent_define_ifdef([api.prefix],
|
|
||||||
[m4_ifdef([b4_prefix],
|
|
||||||
[b4_complain_at(b4_percent_define_get_loc([api.prefix]),
|
|
||||||
[['%s' and '%s' cannot be used together]],
|
|
||||||
[%name-prefix],
|
|
||||||
[%define api.prefix])])])
|
|
||||||
|
|||||||
+1
-2
@@ -1,8 +1,7 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C++ skeleton dispatching for Bison.
|
# C++ skeleton dispatching for Bison.
|
||||||
|
# Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+311
-48
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,27 +24,24 @@ m4_include(b4_pkgdatadir/[c.m4])
|
|||||||
## Default values. ##
|
## Default values. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# Default parser class name.
|
|
||||||
b4_percent_define_default([[parser_class_name]], [[parser]])
|
b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||||
|
b4_percent_define_default([[location_type]], [[location]])
|
||||||
# Don't do that so that we remember whether we're using a user
|
|
||||||
# request, or the default value.
|
|
||||||
#
|
|
||||||
# b4_percent_define_default([[location_type]], [[location]])
|
|
||||||
|
|
||||||
b4_percent_define_default([[filename_type]], [[std::string]])
|
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||||
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
|
b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix]))
|
||||||
|
|
||||||
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
||||||
b4_percent_define_default([[define_location_comparison]],
|
b4_percent_define_default([[define_location_comparison]],
|
||||||
[m4_if(b4_percent_define_get([[filename_type]]),
|
[m4_if(b4_percent_define_get([[filename_type]]),
|
||||||
[std::string], [[true]], [[false]])])
|
[std::string], [[true]], [[false]])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
## Namespace. ##
|
## Namespace. ##
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
|
|
||||||
m4_define([b4_namespace_ref], [b4_percent_define_get([[namespace]])])
|
m4_define([b4_namespace_ref], [b4_percent_define_get([[api.namespace]])])
|
||||||
|
|
||||||
|
|
||||||
# Don't permit an empty b4_namespace_ref. Any `::parser::foo' appended to it
|
# Don't permit an empty b4_namespace_ref. Any `::parser::foo' appended to it
|
||||||
# would compile as an absolute reference with `parser' in the global namespace.
|
# would compile as an absolute reference with `parser' in the global namespace.
|
||||||
@@ -53,7 +51,7 @@ m4_define([b4_namespace_ref], [b4_percent_define_get([[namespace]])])
|
|||||||
# include the header, which is always generated. If we ever need to permit
|
# include the header, which is always generated. If we ever need to permit
|
||||||
# internal linkage somehow, surely we can find a cleaner approach.
|
# internal linkage somehow, surely we can find a cleaner approach.
|
||||||
m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
|
m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
|
||||||
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
|
||||||
[[namespace reference is empty]])])
|
[[namespace reference is empty]])])
|
||||||
|
|
||||||
# Instead of assuming the C++ compiler will do it, Bison should reject any
|
# Instead of assuming the C++ compiler will do it, Bison should reject any
|
||||||
@@ -64,20 +62,20 @@ m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
|
|||||||
# Specifically, don't allow empty names as b4_namespace_open would just convert
|
# Specifically, don't allow empty names as b4_namespace_open would just convert
|
||||||
# those into anonymous namespaces, and that might tempt some users.
|
# those into anonymous namespaces, and that might tempt some users.
|
||||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [],
|
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [],
|
||||||
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
|
||||||
[[namespace reference has consecutive "::"]])])
|
[[namespace reference has consecutive "::"]])])
|
||||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [],
|
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [],
|
||||||
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
|
||||||
[[namespace reference has a trailing "::"]])])
|
[[namespace reference has a trailing "::"]])])
|
||||||
|
|
||||||
m4_define([b4_namespace_open],
|
m4_define([b4_namespace_open],
|
||||||
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
[b4_user_code([b4_percent_define_get_syncline([[api.namespace]])
|
||||||
[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
||||||
[^\(.\)[ ]*::], [\1])),
|
[^\(.\)[ ]*::], [\1])),
|
||||||
[::], [ { namespace ])[ {]])])
|
[::], [ { namespace ])[ {]])])
|
||||||
|
|
||||||
m4_define([b4_namespace_close],
|
m4_define([b4_namespace_close],
|
||||||
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
[b4_user_code([b4_percent_define_get_syncline([[api.namespace]])
|
||||||
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]),
|
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]),
|
||||||
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*],
|
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*],
|
||||||
[\1])),
|
[\1])),
|
||||||
@@ -97,18 +95,311 @@ m4_map_sep([ b4_token_enum], [,
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ----------------- ##
|
## ----------------- ##
|
||||||
## Semantic Values. ##
|
## Semantic Values. ##
|
||||||
## ----------------- ##
|
## ----------------- ##
|
||||||
|
|
||||||
|
# b4_semantic_type_declare
|
||||||
|
# ------------------------
|
||||||
|
# Declare semantic_type.
|
||||||
|
m4_define([b4_semantic_type_declare],
|
||||||
|
[ /// Symbol semantic values.
|
||||||
|
m4_ifdef([b4_stype],
|
||||||
|
[ union semantic_type
|
||||||
|
{b4_user_stype
|
||||||
|
};],
|
||||||
|
[m4_if(b4_tag_seen_flag, 0,
|
||||||
|
[[ typedef int semantic_type;]],
|
||||||
|
[[ typedef YYSTYPE semantic_type;]])])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_public_types_declare
|
||||||
|
# -----------------------
|
||||||
|
# Define the public types: token, semantic value, location, and so forth.
|
||||||
|
# Depending on %define token_lex, may be output in the header or source file.
|
||||||
|
m4_define([b4_public_types_declare],
|
||||||
|
[[#ifndef YYSTYPE
|
||||||
|
]b4_semantic_type_declare[
|
||||||
|
#else
|
||||||
|
typedef YYSTYPE semantic_type;
|
||||||
|
#endif]b4_locations_if([
|
||||||
|
/// Symbol locations.
|
||||||
|
typedef b4_percent_define_get([[location_type]]) location_type;])[
|
||||||
|
|
||||||
|
/// Tokens.
|
||||||
|
struct token
|
||||||
|
{
|
||||||
|
]b4_token_enums(b4_tokens)[
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Token type.
|
||||||
|
typedef token::yytokentype token_type;
|
||||||
|
|
||||||
|
/// A complete symbol, with its type.
|
||||||
|
template <typename Exact>
|
||||||
|
struct symbol_base_type
|
||||||
|
{
|
||||||
|
/// Default constructor.
|
||||||
|
inline symbol_base_type ();
|
||||||
|
|
||||||
|
/// Constructor.]b4_locations_if([
|
||||||
|
inline symbol_base_type (const location_type& l)])[;
|
||||||
|
inline symbol_base_type (]b4_args(
|
||||||
|
[const semantic_type& v],
|
||||||
|
b4_locations_if([const location_type& l]))[);
|
||||||
|
|
||||||
|
/// Release the memory allocated to members.
|
||||||
|
/// Reclaim the semantic value using the %destructor directive.
|
||||||
|
void clear ();
|
||||||
|
|
||||||
|
/// Print the semantic value using the %printer directive.
|
||||||
|
std::ostream& print (std::ostream& o) const;
|
||||||
|
|
||||||
|
/// Print everything about the symbol (type, value, location).
|
||||||
|
std::ostream& dump (std::ostream& o) const;
|
||||||
|
|
||||||
|
/// Return this with its exact type.
|
||||||
|
const Exact& self () const;
|
||||||
|
Exact& self ();
|
||||||
|
|
||||||
|
/// Return the type of this symbol.
|
||||||
|
int type_get () const;
|
||||||
|
|
||||||
|
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||||
|
/// The name for the type.
|
||||||
|
const char *type_name () const;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/// The semantic value.
|
||||||
|
semantic_type value;]b4_locations_if([
|
||||||
|
|
||||||
|
/// The location.
|
||||||
|
location_type location;])[
|
||||||
|
};
|
||||||
|
|
||||||
|
/// External form of a symbol: its type and attributes.
|
||||||
|
struct symbol_type : symbol_base_type<symbol_type>
|
||||||
|
{
|
||||||
|
/// The parent class.
|
||||||
|
typedef symbol_base_type<symbol_type> super_type;
|
||||||
|
|
||||||
|
/// Default constructor.
|
||||||
|
inline symbol_type ();
|
||||||
|
|
||||||
|
/// Constructor.
|
||||||
|
inline symbol_type (]b4_args([int t],
|
||||||
|
[const semantic_type& v],
|
||||||
|
b4_locations_if([const location_type& l]))[);
|
||||||
|
|
||||||
|
inline symbol_type (]b4_args([int t],
|
||||||
|
b4_locations_if([const location_type& l]))[);
|
||||||
|
|
||||||
|
/// The symbol type.
|
||||||
|
int type;
|
||||||
|
|
||||||
|
/// Return the type corresponding to this state.
|
||||||
|
inline int type_get_ () const;
|
||||||
|
|
||||||
|
/// Its token.
|
||||||
|
token_type token () const;
|
||||||
|
};
|
||||||
|
]b4_symbol_constructor_declare])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_public_types_define
|
||||||
|
# ----------------------
|
||||||
|
# Provide the implementation needed by the public types.
|
||||||
|
m4_define([b4_public_types_define],
|
||||||
|
[[ // symbol_base_type.
|
||||||
|
template <typename Exact>
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::symbol_base_type ()
|
||||||
|
: value()]b4_locations_if([
|
||||||
|
, location()])[
|
||||||
|
{
|
||||||
|
}]b4_locations_if([[
|
||||||
|
|
||||||
|
template <typename Exact>
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::symbol_base_type (const location_type& l)
|
||||||
|
: value()
|
||||||
|
, location(l)
|
||||||
|
{
|
||||||
|
}]])[
|
||||||
|
|
||||||
|
template <typename Exact>
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::symbol_base_type (]b4_args(
|
||||||
|
[const semantic_type& v],
|
||||||
|
b4_locations_if([const location_type& l]))[)
|
||||||
|
: value(v)]b4_locations_if([
|
||||||
|
, location(l)])[
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Exact>
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::clear ()
|
||||||
|
{
|
||||||
|
int yytype = type_get ();
|
||||||
|
// User destructor.
|
||||||
|
switch (yytype)
|
||||||
|
{
|
||||||
|
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||||
|
[ default:
|
||||||
|
break;
|
||||||
|
}]b4_variant_if([
|
||||||
|
|
||||||
|
// Type destructor.
|
||||||
|
b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Exact>
|
||||||
|
std::ostream&
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::print (std::ostream& yystream) const
|
||||||
|
{
|
||||||
|
#define debug_stream() yystream
|
||||||
|
switch (type_get ())
|
||||||
|
{
|
||||||
|
]b4_symbol_foreach([b4_symbol_printer])dnl
|
||||||
|
[ default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#undef debug_stream
|
||||||
|
return yystream;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Exact>
|
||||||
|
std::ostream&
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::dump (std::ostream& yystream) const
|
||||||
|
{
|
||||||
|
int yytype = type_get ();
|
||||||
|
yystream << (yytype < yyntokens_ ? "token" : "nterm")
|
||||||
|
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||||
|
<< ' ' << type_name ()
|
||||||
|
#endif
|
||||||
|
<< " ("]b4_locations_if([
|
||||||
|
<< location << ": "])[;
|
||||||
|
print (yystream);
|
||||||
|
return yystream << ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Exact>
|
||||||
|
const Exact&
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::self () const
|
||||||
|
{
|
||||||
|
return static_cast<const Exact&>(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Exact>
|
||||||
|
Exact&
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::self ()
|
||||||
|
{
|
||||||
|
return static_cast<Exact&>(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Exact>
|
||||||
|
int
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::type_get () const
|
||||||
|
{
|
||||||
|
return self ().type_get_ ();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||||
|
template <typename Exact>
|
||||||
|
const char *
|
||||||
|
]b4_parser_class_name[::symbol_base_type<Exact>::type_name () const
|
||||||
|
{
|
||||||
|
return ]b4_parser_class_name[::yytname_[type_get ()];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
// symbol_type.
|
||||||
|
]b4_parser_class_name[::symbol_type::symbol_type ()
|
||||||
|
: super_type ()
|
||||||
|
, type ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
]b4_parser_class_name[::symbol_type::symbol_type (]b4_args(
|
||||||
|
[int t],
|
||||||
|
b4_locations_if([const location_type& l]))[)
|
||||||
|
: super_type (]b4_locations_if([l])[)
|
||||||
|
, type (t)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
]b4_parser_class_name[::symbol_type::symbol_type (]b4_args(
|
||||||
|
[int t],
|
||||||
|
[const semantic_type& v],
|
||||||
|
b4_locations_if([const location_type& l]))[)
|
||||||
|
: super_type (v]b4_locations_if([, l])[)
|
||||||
|
, type (t)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
]b4_parser_class_name[::symbol_type::type_get_ () const
|
||||||
|
{
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
]b4_lex_symbol_if([[
|
||||||
|
]b4_parser_class_name[::token_type
|
||||||
|
]b4_parser_class_name[::symbol_type::token () const
|
||||||
|
{
|
||||||
|
// YYTOKNUM[NUM] -- (External) token number corresponding to the
|
||||||
|
// (internal) symbol number NUM (which must be that of a token). */
|
||||||
|
static
|
||||||
|
const ]b4_int_type_for([b4_toknum])[
|
||||||
|
yytoken_number_[] =
|
||||||
|
{
|
||||||
|
]b4_toknum[
|
||||||
|
};
|
||||||
|
return static_cast<token_type> (yytoken_number_[type]);
|
||||||
|
}
|
||||||
|
]])[]dnl
|
||||||
|
b4_symbol_constructor_define])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_constructor_declare
|
||||||
|
# b4_symbol_constructor_define
|
||||||
|
# -----------------------------
|
||||||
|
# Declare/define symbol constructors for all the value types.
|
||||||
|
# Use at class-level. Redefined in variant.hh.
|
||||||
|
m4_define([b4_symbol_constructor_declare], [])
|
||||||
|
m4_define([b4_symbol_constructor_define], [])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_yytranslate_define
|
||||||
|
# ---------------------
|
||||||
|
# Define yytranslate_. Sometimes used in the header file,
|
||||||
|
# sometimes in the cc file.
|
||||||
|
m4_define([b4_yytranslate_define],
|
||||||
|
[[ // Symbol number corresponding to token number t.
|
||||||
|
]b4_parser_class_name[::token_number_type
|
||||||
|
]b4_parser_class_name[::yytranslate_ (]b4_lex_symbol_if([token_type],
|
||||||
|
[int])[ t)
|
||||||
|
{
|
||||||
|
static
|
||||||
|
const token_number_type
|
||||||
|
translate_table[] =
|
||||||
|
{
|
||||||
|
]b4_translate[
|
||||||
|
};
|
||||||
|
const unsigned int user_token_number_max_ = ]b4_user_token_number_max[;
|
||||||
|
const token_number_type undef_token_ = ]b4_undef_token_number[;
|
||||||
|
|
||||||
|
if (static_cast<int>(t) <= yyeof_)
|
||||||
|
return yyeof_;
|
||||||
|
else if (static_cast<unsigned int> (t) <= user_token_number_max_)
|
||||||
|
return translate_table[t];
|
||||||
|
else
|
||||||
|
return undef_token_;
|
||||||
|
}
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
# b4_lhs_value([TYPE])
|
# b4_lhs_value([TYPE])
|
||||||
# --------------------
|
# --------------------
|
||||||
# Expansion of $<TYPE>$.
|
# Expansion of $<TYPE>$.
|
||||||
m4_define([b4_lhs_value],
|
m4_define([b4_lhs_value],
|
||||||
[(yyval[]m4_ifval([$1], [.$1]))])
|
[b4_symbol_value([yyval], [$1])])
|
||||||
|
|
||||||
|
|
||||||
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
||||||
@@ -116,7 +407,8 @@ m4_define([b4_lhs_value],
|
|||||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||||
# symbols on RHS.
|
# symbols on RHS.
|
||||||
m4_define([b4_rhs_value],
|
m4_define([b4_rhs_value],
|
||||||
[(yysemantic_stack_@{($1) - ($2)@}m4_ifval([$3], [.$3]))])
|
[b4_symbol_value([yysemantic_stack_@{($1) - ($2)@}], [$3])])
|
||||||
|
|
||||||
|
|
||||||
# b4_lhs_location()
|
# b4_lhs_location()
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -174,32 +466,3 @@ m4_define([b4_cc_var_decls],
|
|||||||
], [$@])])
|
], [$@])])
|
||||||
m4_define([b4_cc_var_decl],
|
m4_define([b4_cc_var_decl],
|
||||||
[ $1;])
|
[ $1;])
|
||||||
|
|
||||||
|
|
||||||
## ---------##
|
|
||||||
## Values. ##
|
|
||||||
## ---------##
|
|
||||||
|
|
||||||
# b4_yylloc_default_define
|
|
||||||
# ------------------------
|
|
||||||
# Define YYLLOC_DEFAULT.
|
|
||||||
m4_define([b4_yylloc_default_define],
|
|
||||||
[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
|
||||||
If N is 0, then set CURRENT to the empty location which ends
|
|
||||||
the previous symbol: RHS[0] (always defined). */
|
|
||||||
|
|
||||||
# ifndef YYLLOC_DEFAULT
|
|
||||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
|
||||||
do \
|
|
||||||
if (N) \
|
|
||||||
{ \
|
|
||||||
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
|
||||||
(Current).end = YYRHSLOC (Rhs, N).end; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
|
||||||
} \
|
|
||||||
while (/*CONSTCOND*/ false)
|
|
||||||
# endif
|
|
||||||
]])
|
|
||||||
|
|||||||
+1
-2
@@ -1,8 +1,7 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C skeleton dispatching for Bison.
|
# C skeleton dispatching for Bison.
|
||||||
|
# Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C M4 Macros for Bison.
|
# C M4 Macros for Bison.
|
||||||
|
# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009
|
||||||
# Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc.
|
# Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,42 +17,38 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
# b4_tocpp(STRING)
|
|
||||||
# ----------------
|
|
||||||
# Convert STRING into a valid C macro name.
|
|
||||||
m4_define([b4_tocpp],
|
|
||||||
[m4_toupper(m4_bpatsubst(m4_quote($1), [[^a-zA-Z0-9]+], [_]))])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_cpp_guard(FILE)
|
|
||||||
# ------------------
|
|
||||||
# A valid C macro name to use as a CPP header guard for FILE.
|
|
||||||
m4_define([b4_cpp_guard],
|
|
||||||
[b4_tocpp(m4_defn([b4_prefix])/[$1])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_cpp_guard_open(FILE)
|
|
||||||
# b4_cpp_guard_close(FILE)
|
|
||||||
# ------------------------
|
|
||||||
# Open/close CPP inclusion guards for FILE.
|
|
||||||
m4_define([b4_cpp_guard_open],
|
|
||||||
[#ifndef b4_cpp_guard([$1])
|
|
||||||
# define b4_cpp_guard([$1])])
|
|
||||||
|
|
||||||
m4_define([b4_cpp_guard_close],
|
|
||||||
[#endif b4_comment([!b4_cpp_guard([$1])])])
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Identification. ##
|
## Identification. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# b4_comment(TEXT)
|
# b4_comment_(TEXT, OPEN, CONTINUE, END)
|
||||||
# ----------------
|
# -------------------------------------
|
||||||
m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
||||||
], [
|
# Avoid adding indentation to the first line, as the indentation comes
|
||||||
]) */])
|
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
||||||
|
#
|
||||||
|
# Prefix all the output lines with PREFIX.
|
||||||
|
m4_define([b4_comment_], [$2[]m4_bpatsubst([$1], [
|
||||||
|
\(.\)], [
|
||||||
|
$3\1])$4])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_c_comment(TEXT, [PREFIX])
|
||||||
|
# ----------------------------
|
||||||
|
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
||||||
|
# Avoid adding indentation to the first line, as the indentation comes
|
||||||
|
# from "/*". That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
||||||
|
#
|
||||||
|
# Prefix all the output lines with PREFIX.
|
||||||
|
m4_define([b4_c_comment],
|
||||||
|
[b4_comment_([$1], [$2/* ], [$2 ], [$2 */])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_comment(TEXT, [PREFIX])
|
||||||
|
# --------------------------
|
||||||
|
# By default, C comments.
|
||||||
|
m4_define([b4_comment], [b4_c_comment($@)])
|
||||||
|
|
||||||
|
|
||||||
# b4_identification
|
# b4_identification
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -77,6 +73,9 @@ m4_define([b4_identification],
|
|||||||
|
|
||||||
/* Pull parsers. */
|
/* Pull parsers. */
|
||||||
#define YYPULL ]b4_pull_flag])[
|
#define YYPULL ]b4_pull_flag])[
|
||||||
|
|
||||||
|
/* Using locations. */
|
||||||
|
#define YYLSP_NEEDED ]b4_locations_if([1], [0])[
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
@@ -84,24 +83,11 @@ m4_define([b4_identification],
|
|||||||
## Default values. ##
|
## Default values. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# b4_api_prefix, b4_api_PREFIX
|
|
||||||
# ----------------------------
|
|
||||||
# Corresponds to %define api.prefix
|
|
||||||
b4_percent_define_default([[api.prefix]], [[yy]])
|
|
||||||
m4_define([b4_api_prefix],
|
|
||||||
[b4_percent_define_get([[api.prefix]])])
|
|
||||||
m4_define([b4_api_PREFIX],
|
|
||||||
[m4_toupper(b4_api_prefix)])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_prefix
|
|
||||||
# ---------
|
|
||||||
# If the %name-prefix is not given, it is api.prefix.
|
|
||||||
m4_define_default([b4_prefix], [b4_api_prefix])
|
|
||||||
|
|
||||||
# If the %union is not named, its name is YYSTYPE.
|
# If the %union is not named, its name is YYSTYPE.
|
||||||
m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE])
|
m4_define_default([b4_union_name], [YYSTYPE])
|
||||||
|
|
||||||
|
# If the %name-prefix is not given, it is yy.
|
||||||
|
m4_define_default([b4_prefix], [yy])
|
||||||
|
|
||||||
## ------------------------ ##
|
## ------------------------ ##
|
||||||
## Pure/impure interfaces. ##
|
## Pure/impure interfaces. ##
|
||||||
@@ -183,33 +169,29 @@ m4_define([b4_table_value_equals],
|
|||||||
[[YYID (0)]],
|
[[YYID (0)]],
|
||||||
[[((]$2[) == (]$3[))]])])
|
[[((]$2[) == (]$3[))]])])
|
||||||
|
|
||||||
|
|
||||||
## ---------##
|
## ---------##
|
||||||
## Values. ##
|
## Values. ##
|
||||||
## ---------##
|
## ---------##
|
||||||
|
|
||||||
|
|
||||||
# b4_null_define
|
|
||||||
# --------------
|
|
||||||
# Portability issues: define a YY_NULL appropriate for the current
|
|
||||||
# language (C, C++98, or C++11).
|
|
||||||
m4_define([b4_null_define],
|
|
||||||
[# ifndef YY_NULL
|
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
|
||||||
# define YY_NULL nullptr
|
|
||||||
# else
|
|
||||||
# define YY_NULL 0
|
|
||||||
# endif
|
|
||||||
# endif[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_null
|
# b4_null
|
||||||
# -------
|
---------
|
||||||
# Return a null pointer constant.
|
# Return a null pointer constant. NULL infringes on the user name
|
||||||
m4_define([b4_null], [YY_NULL])
|
# space in C, so use 0 rather than NULL.
|
||||||
|
m4_define([b4_null], [0])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
# Define "yy<TABLE-NAME>" which contents is CONTENT.
|
||||||
|
m4_define([b4_integral_parser_table_define],
|
||||||
|
[m4_ifval([$3], [b4_c_comment([$3], [ ])
|
||||||
|
])dnl
|
||||||
|
static const b4_int_type_for([$2]) yy$1[[]] =
|
||||||
|
{
|
||||||
|
$2
|
||||||
|
};dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
## Assigning token numbers. ##
|
## Assigning token numbers. ##
|
||||||
@@ -219,7 +201,7 @@ m4_define([b4_null], [YY_NULL])
|
|||||||
# -----------------------------------------
|
# -----------------------------------------
|
||||||
# Output the definition of this token as #define.
|
# Output the definition of this token as #define.
|
||||||
m4_define([b4_token_define],
|
m4_define([b4_token_define],
|
||||||
[#define $1 $2
|
[#define b4_percent_define_get([api.tokens.prefix])$1 $2
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -237,7 +219,7 @@ m4_map([b4_token_define], [$@])])
|
|||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
# Output the definition of this token as an enum.
|
# Output the definition of this token as an enum.
|
||||||
m4_define([b4_token_enum],
|
m4_define([b4_token_enum],
|
||||||
[$1 = $2])
|
[b4_percent_define_get([api.tokens.prefix])$1 = $2])
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
@@ -245,18 +227,18 @@ m4_define([b4_token_enum],
|
|||||||
# Output the definition of the tokens (if there are) as enums.
|
# Output the definition of the tokens (if there are) as enums.
|
||||||
m4_define([b4_token_enums],
|
m4_define([b4_token_enums],
|
||||||
[m4_if([$#$1], [1], [],
|
[m4_if([$#$1], [1], [],
|
||||||
[[/* Tokens. */
|
[/* Tokens. */
|
||||||
#ifndef ]b4_api_PREFIX[TOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
# define ]b4_api_PREFIX[TOKENTYPE
|
# define YYTOKENTYPE
|
||||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||||
know about them. */
|
know about them. */
|
||||||
enum ]b4_api_prefix[tokentype {
|
enum yytokentype {
|
||||||
]m4_map_sep([ b4_token_enum], [,
|
m4_map_sep([ b4_token_enum], [,
|
||||||
],
|
],
|
||||||
[$@])[
|
[$@])
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
]])])
|
])])
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
@@ -268,6 +250,21 @@ m4_define([b4_token_enums_defines],
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
## ----------------- ##
|
||||||
|
## Semantic Values. ##
|
||||||
|
## ----------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_value(VAL, [TYPE])
|
||||||
|
# ----------------------------
|
||||||
|
# Given a semantic value VAL ($$, $1 etc.), extract its value of type
|
||||||
|
# TYPE if TYPE is given, otherwise just return VAL. The result can be
|
||||||
|
# used safetly, it is put in parens to avoid nasty precedence issues.
|
||||||
|
# TYPE is *not* put in braces, provide some if needed.
|
||||||
|
m4_define([b4_symbol_value],
|
||||||
|
[($1[]m4_ifval([$2], [.$2]))])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## --------------------------------------------- ##
|
## --------------------------------------------- ##
|
||||||
## Defining C functions in both K&R and ANSI-C. ##
|
## Defining C functions in both K&R and ANSI-C. ##
|
||||||
@@ -356,7 +353,7 @@ m4_define([b4_c_knr_formal_decl],
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Declare the function NAME.
|
# Declare the function NAME.
|
||||||
m4_define([b4_c_function_decl],
|
m4_define([b4_c_function_decl],
|
||||||
[#if defined __STDC__ || defined __cplusplus
|
[#if b4_c_modern
|
||||||
b4_c_ansi_function_decl($@)
|
b4_c_ansi_function_decl($@)
|
||||||
#else
|
#else
|
||||||
$2 $1 ();
|
$2 $1 ();
|
||||||
@@ -415,24 +412,8 @@ m4_define([b4_sync_start], [[#]line $1 $2])
|
|||||||
m4_define([b4_case],
|
m4_define([b4_case],
|
||||||
[ case $1:
|
[ case $1:
|
||||||
$2
|
$2
|
||||||
break;])
|
|
||||||
|
|
||||||
# b4_symbol_actions(FILENAME, LINENO,
|
|
||||||
# SYMBOL-TAG, SYMBOL-NUM,
|
|
||||||
# SYMBOL-ACTION, SYMBOL-TYPENAME)
|
|
||||||
# -------------------------------------------------
|
|
||||||
m4_define([b4_symbol_actions],
|
|
||||||
[m4_pushdef([b4_dollar_dollar],
|
|
||||||
[m4_ifval([$6], [(yyvaluep->$6)], [(*yyvaluep)])])dnl
|
|
||||||
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
|
|
||||||
case $4: /* $3 */
|
|
||||||
b4_syncline([$2], [$1])
|
|
||||||
$5;
|
|
||||||
b4_syncline([@oline@], [@ofile@])
|
b4_syncline([@oline@], [@ofile@])
|
||||||
break;
|
break;])
|
||||||
m4_popdef([b4_at_dollar])dnl
|
|
||||||
m4_popdef([b4_dollar_dollar])dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_yydestruct_generate(FUNCTION-DECLARATOR)
|
# b4_yydestruct_generate(FUNCTION-DECLARATOR)
|
||||||
@@ -465,8 +446,8 @@ b4_parse_param_use[]dnl
|
|||||||
|
|
||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
|
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||||
default:
|
[ default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}]dnl
|
}]dnl
|
||||||
@@ -493,8 +474,6 @@ m4_define_default([b4_yy_symbol_print_generate],
|
|||||||
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
FILE *yyo = yyoutput;
|
|
||||||
YYUSE (yyo);
|
|
||||||
if (!yyvaluep)
|
if (!yyvaluep)
|
||||||
return;
|
return;
|
||||||
]b4_locations_if([ YYUSE (yylocationp);
|
]b4_locations_if([ YYUSE (yylocationp);
|
||||||
@@ -508,7 +487,7 @@ b4_parse_param_use[]dnl
|
|||||||
# endif
|
# endif
|
||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
]b4_symbol_foreach([b4_symbol_printer])dnl
|
||||||
[ default:
|
[ default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -540,102 +519,3 @@ b4_locations_if([, yylocationp])[]b4_user_args[);
|
|||||||
YYFPRINTF (yyoutput, ")");
|
YYFPRINTF (yyoutput, ")");
|
||||||
}]dnl
|
}]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
## -------------- ##
|
|
||||||
## Declarations. ##
|
|
||||||
## -------------- ##
|
|
||||||
|
|
||||||
# b4_declare_yylstype
|
|
||||||
# -------------------
|
|
||||||
# Declarations that might either go into the header (if --defines) or
|
|
||||||
# in the parser body. Declare YYSTYPE/YYLTYPE, and yylval/yylloc.
|
|
||||||
m4_define([b4_declare_yylstype],
|
|
||||||
[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
|
|
||||||
]m4_ifdef([b4_stype],
|
|
||||||
[[typedef union ]b4_union_name[
|
|
||||||
{
|
|
||||||
]b4_user_stype[
|
|
||||||
} ]b4_api_PREFIX[STYPE;
|
|
||||||
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]],
|
|
||||||
[m4_if(b4_tag_seen_flag, 0,
|
|
||||||
[[typedef int ]b4_api_PREFIX[STYPE;
|
|
||||||
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]])])[
|
|
||||||
# define ]b4_api_prefix[stype ]b4_api_PREFIX[STYPE /* obsolescent; will be withdrawn */
|
|
||||||
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
|
|
||||||
#endif]b4_locations_if([[
|
|
||||||
|
|
||||||
#if ! defined ]b4_api_PREFIX[LTYPE && ! defined ]b4_api_PREFIX[LTYPE_IS_DECLARED
|
|
||||||
typedef struct ]b4_api_PREFIX[LTYPE
|
|
||||||
{
|
|
||||||
int first_line;
|
|
||||||
int first_column;
|
|
||||||
int last_line;
|
|
||||||
int last_column;
|
|
||||||
} ]b4_api_PREFIX[LTYPE;
|
|
||||||
# define ]b4_api_prefix[ltype ]b4_api_PREFIX[LTYPE /* obsolescent; will be withdrawn */
|
|
||||||
# define ]b4_api_PREFIX[LTYPE_IS_DECLARED 1
|
|
||||||
# define ]b4_api_PREFIX[LTYPE_IS_TRIVIAL 1
|
|
||||||
#endif]])
|
|
||||||
|
|
||||||
b4_pure_if([], [[extern ]b4_api_PREFIX[STYPE ]b4_prefix[lval;
|
|
||||||
]b4_locations_if([[extern ]b4_api_PREFIX[LTYPE ]b4_prefix[lloc;]])])[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
# b4_YYDEBUG_define
|
|
||||||
# ------------------
|
|
||||||
m4_define([b4_YYDEBUG_define],
|
|
||||||
[[/* Enabling traces. */
|
|
||||||
]m4_if(b4_api_prefix, [yy],
|
|
||||||
[[#ifndef YYDEBUG
|
|
||||||
# define YYDEBUG ]b4_debug_flag[
|
|
||||||
#endif]],
|
|
||||||
[[#ifndef ]b4_api_PREFIX[DEBUG
|
|
||||||
# if defined YYDEBUG
|
|
||||||
# if YYDEBUG
|
|
||||||
# define ]b4_api_PREFIX[DEBUG 1
|
|
||||||
# else
|
|
||||||
# define ]b4_api_PREFIX[DEBUG 0
|
|
||||||
# endif
|
|
||||||
# else /* ! defined YYDEBUG */
|
|
||||||
# define ]b4_api_PREFIX[DEBUG ]b4_debug_flag[
|
|
||||||
# endif /* ! defined ]b4_api_PREFIX[DEBUG */
|
|
||||||
#endif /* ! defined ]b4_api_PREFIX[DEBUG */]])[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
# b4_declare_yydebug
|
|
||||||
# ------------------
|
|
||||||
m4_define([b4_declare_yydebug],
|
|
||||||
[b4_YYDEBUG_define[
|
|
||||||
#if ]b4_api_PREFIX[DEBUG
|
|
||||||
extern int ]b4_prefix[debug;
|
|
||||||
#endif][]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
# b4_yylloc_default_define
|
|
||||||
# ------------------------
|
|
||||||
# Define YYLLOC_DEFAULT.
|
|
||||||
m4_define([b4_yylloc_default_define],
|
|
||||||
[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
|
||||||
If N is 0, then set CURRENT to the empty location which ends
|
|
||||||
the previous symbol: RHS[0] (always defined). */
|
|
||||||
|
|
||||||
#ifndef YYLLOC_DEFAULT
|
|
||||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
|
||||||
do \
|
|
||||||
if (YYID (N)) \
|
|
||||||
{ \
|
|
||||||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
|
||||||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
|
||||||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
|
||||||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
(Current).first_line = (Current).last_line = \
|
|
||||||
YYRHSLOC (Rhs, 0).last_line; \
|
|
||||||
(Current).first_column = (Current).last_column = \
|
|
||||||
YYRHSLOC (Rhs, 0).last_column; \
|
|
||||||
} \
|
|
||||||
while (YYID (0))
|
|
||||||
#endif
|
|
||||||
]])
|
|
||||||
|
|||||||
+980
-1008
File diff suppressed because it is too large
Load Diff
+97
-94
@@ -1,8 +1,6 @@
|
|||||||
-*- C -*-
|
|
||||||
|
|
||||||
# C++ GLR skeleton for Bison
|
# C++ GLR skeleton for Bison
|
||||||
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||||
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
# Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +27,7 @@
|
|||||||
#
|
#
|
||||||
# The additional arguments are stored as members of the parser
|
# The additional arguments are stored as members of the parser
|
||||||
# object, yyparser. The C routines need to carry yyparser
|
# object, yyparser. The C routines need to carry yyparser
|
||||||
# throughout the C parser; that easy: just let yyparser become an
|
# throughout the C parser; that's easy: make yyparser an
|
||||||
# additional parse-param. But because the C++ skeleton needs to
|
# additional parse-param. But because the C++ skeleton needs to
|
||||||
# know the "real" original parse-param, we save them
|
# know the "real" original parse-param, we save them
|
||||||
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
|
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
|
||||||
@@ -39,14 +37,14 @@
|
|||||||
# The locations
|
# The locations
|
||||||
#
|
#
|
||||||
# We use location.cc just like lalr1.cc, but because glr.c stores
|
# We use location.cc just like lalr1.cc, but because glr.c stores
|
||||||
# the locations in a (C++) union, the position and location classes
|
# the locations in a union, the position and location classes
|
||||||
# must not have a constructor. Therefore, contrary to lalr1.cc, we
|
# must not have a constructor. Therefore, contrary to lalr1.cc, we
|
||||||
# must not define "b4_location_constructors". As a consequence the
|
# must not define "b4_location_constructors". As a consequence the
|
||||||
# user must initialize the first positions (in particular the
|
# user must initialize the first positions (in particular the
|
||||||
# filename member).
|
# filename member).
|
||||||
|
|
||||||
# We require a pure interface using locations.
|
# We require a pure interface using locations.
|
||||||
m4_define([b4_locations_flag], [1])
|
m4_define([b4_percent_define(locations)], [])
|
||||||
m4_define([b4_pure_flag], [1])
|
m4_define([b4_pure_flag], [1])
|
||||||
|
|
||||||
# The header is mandatory.
|
# The header is mandatory.
|
||||||
@@ -54,8 +52,7 @@ b4_defines_if([],
|
|||||||
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c++.m4])
|
m4_include(b4_pkgdatadir/[c++.m4])
|
||||||
b4_percent_define_ifdef([[location_type]], [],
|
m4_include(b4_pkgdatadir/[location.cc])
|
||||||
[m4_include(b4_pkgdatadir/[location.cc])])
|
|
||||||
|
|
||||||
m4_define([b4_parser_class_name],
|
m4_define([b4_parser_class_name],
|
||||||
[b4_percent_define_get([[parser_class_name]])])
|
[b4_percent_define_get([[parser_class_name]])])
|
||||||
@@ -78,10 +75,10 @@ m4_define([b4_yy_symbol_print_generate],
|
|||||||
[static void],
|
[static void],
|
||||||
[[FILE *], []],
|
[[FILE *], []],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[const ]b4_namespace_ref::b4_parser_class_name[::semantic_type *yyvaluep],
|
[[const b4_namespace_ref::b4_parser_class_name::semantic_type *yyvaluep],
|
||||||
[yyvaluep]],
|
[yyvaluep]],
|
||||||
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
|
[[const b4_namespace_ref::b4_parser_class_name::location_type *yylocationp],
|
||||||
[yylocationp]],
|
[yylocationp]],
|
||||||
b4_parse_param)[
|
b4_parse_param)[
|
||||||
{
|
{
|
||||||
]b4_parse_param_use[]dnl
|
]b4_parse_param_use[]dnl
|
||||||
@@ -90,22 +87,18 @@ m4_define([b4_yy_symbol_print_generate],
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
# Hijack the post prologue to insert early definition of YYLLOC_DEFAULT
|
# Declare yyerror.
|
||||||
# and declaration of yyerror.
|
|
||||||
m4_append([b4_post_prologue],
|
m4_append([b4_post_prologue],
|
||||||
[b4_syncline([@oline@], [@ofile@])[
|
[b4_syncline([@oline@], [@ofile@])
|
||||||
]b4_yylloc_default_define[
|
|
||||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
|
b4_c_ansi_function_decl([yyerror],
|
||||||
]b4_c_ansi_function_decl([yyerror],
|
|
||||||
[static void],
|
[static void],
|
||||||
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
|
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||||
[yylocationp]],
|
|
||||||
b4_parse_param,
|
b4_parse_param,
|
||||||
[[const char* msg], [msg]])])
|
[[const char* msg], [msg]])])
|
||||||
|
|
||||||
|
|
||||||
# Hijack the epilogue to define implementations (yyerror, parser member
|
# Define yyerror.
|
||||||
# functions etc.).
|
|
||||||
m4_append([b4_epilogue],
|
m4_append([b4_epilogue],
|
||||||
[b4_syncline([@oline@], [@ofile@])[
|
[b4_syncline([@oline@], [@ofile@])[
|
||||||
/*------------------.
|
/*------------------.
|
||||||
@@ -114,8 +107,7 @@ m4_append([b4_epilogue],
|
|||||||
|
|
||||||
]b4_c_ansi_function_def([yyerror],
|
]b4_c_ansi_function_def([yyerror],
|
||||||
[static void],
|
[static void],
|
||||||
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
|
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||||
[yylocationp]],
|
|
||||||
b4_parse_param,
|
b4_parse_param,
|
||||||
[[const char* msg], [msg]])[
|
[[const char* msg], [msg]])[
|
||||||
{
|
{
|
||||||
@@ -130,9 +122,8 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
[ /// Build a parser object.
|
[ /// Build a parser object.
|
||||||
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||||
:])[
|
:])[
|
||||||
#if ]b4_api_PREFIX[DEBUG
|
#if YYDEBUG
|
||||||
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
|
]m4_ifset([b4_parse_param], [ ], [ :])[yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
||||||
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
|
||||||
#endif]b4_parse_param_cons[
|
#endif]b4_parse_param_cons[
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -147,38 +138,34 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
return ::yyparse (*this]b4_user_args[);
|
return ::yyparse (*this]b4_user_args[);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ]b4_api_PREFIX[DEBUG
|
#if YYDEBUG
|
||||||
/*--------------------.
|
/*--------------------.
|
||||||
| Print this symbol. |
|
| Print this symbol. |
|
||||||
`--------------------*/
|
`--------------------*/
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep,
|
const semantic_type* yyvaluep, const location_type* yylocationp)
|
||||||
const location_type* yylocationp)
|
|
||||||
{
|
{
|
||||||
YYUSE (yylocationp);
|
/* Pacify ``unused variable'' warnings. */
|
||||||
YYUSE (yyvaluep);
|
YYUSE (yyvaluep);
|
||||||
std::ostream& yyoutput = debug_stream ();
|
YYUSE (yylocationp);
|
||||||
std::ostream& yyo = yyoutput;
|
|
||||||
YYUSE (yyo);
|
|
||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
]b4_symbol_foreach([b4_symbol_printer])dnl
|
||||||
[ default:
|
[ default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
|
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep,
|
const semantic_type* yyvaluep, const location_type* yylocationp)
|
||||||
const location_type* yylocationp)
|
|
||||||
{
|
{
|
||||||
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
|
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
|
||||||
<< ' ' << yytname[yytype] << " ("
|
<< ' ' << yytname[yytype] << " ("
|
||||||
<< *yylocationp << ": ";
|
<< *yylocationp << ": ";
|
||||||
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
|
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
|
||||||
*yycdebug_ << ')';
|
*yycdebug_ << ')';
|
||||||
}
|
}
|
||||||
@@ -199,29 +186,28 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
]b4_parser_class_name[::debug_level_type
|
]b4_parser_class_name[::debug_level_type
|
||||||
]b4_parser_class_name[::debug_level () const
|
]b4_parser_class_name[::debug_level () const
|
||||||
{
|
{
|
||||||
return yydebug_;
|
return yydebug;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
||||||
{
|
{
|
||||||
yydebug_ = l;
|
yydebug = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
]m4_popdef([b4_parse_param])dnl
|
]m4_popdef([b4_parse_param])dnl
|
||||||
b4_namespace_close[
|
b4_namespace_close[
|
||||||
|
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
# Let glr.c believe that the user arguments include the parser itself.
|
# Let glr.c believe that the user arguments include the parser itself.
|
||||||
m4_ifset([b4_parse_param],
|
m4_ifset([b4_parse_param],
|
||||||
[m4_pushdef([b4_parse_param],
|
[m4_pushdef([b4_parse_param],
|
||||||
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]],]
|
m4_dquote([[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]],]
|
||||||
m4_defn([b4_parse_param]))],
|
m4_defn([b4_parse_param])))],
|
||||||
[m4_pushdef([b4_parse_param],
|
[m4_pushdef([b4_parse_param],
|
||||||
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]]])
|
[[[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]]]])
|
||||||
])
|
])
|
||||||
m4_include(b4_pkgdatadir/[glr.c])
|
m4_include(b4_pkgdatadir/[glr.c])
|
||||||
m4_popdef([b4_parse_param])
|
m4_popdef([b4_parse_param])
|
||||||
@@ -229,49 +215,58 @@ m4_popdef([b4_parse_param])
|
|||||||
m4_divert_push(0)
|
m4_divert_push(0)
|
||||||
@output(b4_spec_defines_file@)@
|
@output(b4_spec_defines_file@)@
|
||||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||||
[2002-2006, 2009-2012])[
|
[2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009])[
|
||||||
|
|
||||||
/* C++ GLR parser skeleton written by Akim Demaille. */
|
/* C++ GLR parser skeleton written by Akim Demaille. */
|
||||||
|
|
||||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
#ifndef PARSER_HEADER_H
|
||||||
|
# define PARSER_HEADER_H
|
||||||
|
|
||||||
]b4_percent_code_get([[requires]])[
|
]b4_percent_code_get([[requires]])[
|
||||||
|
|
||||||
# include <string>
|
#include <string>
|
||||||
# include <iostream>
|
#include <iostream>
|
||||||
]b4_percent_define_ifdef([[location_type]], [],
|
|
||||||
[[# include "location.hh"]])[
|
|
||||||
|
|
||||||
]b4_YYDEBUG_define[
|
/* Using locations. */
|
||||||
|
#define YYLSP_NEEDED ]b4_locations_if([1], [0])[
|
||||||
|
|
||||||
|
]b4_namespace_open[
|
||||||
|
class position;
|
||||||
|
class location;
|
||||||
|
]b4_namespace_close[
|
||||||
|
|
||||||
|
#include "location.hh"
|
||||||
|
|
||||||
|
/* Enabling traces. */
|
||||||
|
#ifndef YYDEBUG
|
||||||
|
# define YYDEBUG ]b4_parse_trace_if([1], [0])[
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||||
|
If N is 0, then set CURRENT to the empty location which ends
|
||||||
|
the previous symbol: RHS[0] (always defined). */
|
||||||
|
|
||||||
|
#ifndef YYLLOC_DEFAULT
|
||||||
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
|
do \
|
||||||
|
if (N) \
|
||||||
|
{ \
|
||||||
|
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
||||||
|
(Current).end = YYRHSLOC (Rhs, N).end; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
||||||
|
} \
|
||||||
|
while (/*CONSTCOND*/ 0)
|
||||||
|
#endif
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
/// A Bison parser.
|
/// A Bison parser.
|
||||||
class ]b4_parser_class_name[
|
class ]b4_parser_class_name[
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Symbol semantic values.
|
]b4_public_types_declare[
|
||||||
# ifndef ]b4_api_PREFIX[STYPE
|
|
||||||
]m4_ifdef([b4_stype],
|
|
||||||
[ union semantic_type
|
|
||||||
{
|
|
||||||
b4_user_stype
|
|
||||||
};],
|
|
||||||
[m4_if(b4_tag_seen_flag, 0,
|
|
||||||
[[ typedef int semantic_type;]],
|
|
||||||
[[ typedef ]b4_api_PREFIX[STYPE semantic_type;]])])[
|
|
||||||
# else
|
|
||||||
typedef ]b4_api_PREFIX[STYPE semantic_type;
|
|
||||||
# endif
|
|
||||||
/// Symbol locations.
|
|
||||||
typedef ]b4_percent_define_get([[location_type]],
|
|
||||||
[[location]])[ location_type;
|
|
||||||
/// Tokens.
|
|
||||||
struct token
|
|
||||||
{
|
|
||||||
]b4_token_enums(b4_tokens)[
|
|
||||||
};
|
|
||||||
/// Token type.
|
|
||||||
typedef token::yytokentype token_type;
|
|
||||||
|
|
||||||
/// Build a parser object.
|
/// Build a parser object.
|
||||||
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
||||||
@@ -293,36 +288,42 @@ b4_user_stype
|
|||||||
/// Set the current debugging level.
|
/// Set the current debugging level.
|
||||||
void set_debug_level (debug_level_type l);
|
void set_debug_level (debug_level_type l);
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Report a syntax error.
|
/// Report a syntax error.
|
||||||
/// \param loc where the syntax error is found.
|
/// \param loc where the syntax error is found.
|
||||||
/// \param msg a description of the syntax error.
|
/// \param msg a description of the syntax error.
|
||||||
virtual void error (const location_type& loc, const std::string& msg);
|
virtual void error (const location_type& loc, const std::string& msg);
|
||||||
private:
|
|
||||||
|
|
||||||
# if ]b4_api_PREFIX[DEBUG
|
#if YYDEBUG
|
||||||
public:
|
public:
|
||||||
/// \brief Report a symbol value on the debug stream.
|
/// \brief Report a symbol value on the debug stream.
|
||||||
/// \param yytype The token type.
|
/// \param yytype The token type.
|
||||||
/// \param yyvaluep Its semantic value.
|
/// \param yyvaluep Its semantic value.
|
||||||
/// \param yylocationp Its location.
|
/// \param yylocationp Its location.
|
||||||
virtual void yy_symbol_value_print_ (int yytype,
|
virtual void yy_symbol_value_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep,
|
const semantic_type* yyvaluep,
|
||||||
const location_type* yylocationp);
|
const location_type* yylocationp);
|
||||||
/// \brief Report a symbol on the debug stream.
|
/// \brief Report a symbol on the debug stream.
|
||||||
/// \param yytype The token type.
|
/// \param yytype The token type.
|
||||||
/// \param yyvaluep Its semantic value.
|
/// \param yyvaluep Its semantic value.
|
||||||
/// \param yylocationp Its location.
|
/// \param yylocationp Its location.
|
||||||
virtual void yy_symbol_print_ (int yytype,
|
virtual void yy_symbol_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep,
|
const semantic_type* yyvaluep,
|
||||||
const location_type* yylocationp);
|
const location_type* yylocationp);
|
||||||
private:
|
private:
|
||||||
/* Debugging. */
|
/* Debugging. */
|
||||||
int yydebug_;
|
|
||||||
std::ostream* yycdebug_;
|
std::ostream* yycdebug_;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
|
/// \brief Reclaim the memory associated to a symbol.
|
||||||
|
/// \param yymsg Why this token is reclaimed.
|
||||||
|
/// \param yytype The symbol type.
|
||||||
|
/// \param yyvaluep Its semantic value.
|
||||||
|
/// \param yylocationp Its location.
|
||||||
|
inline void yydestruct_ (const char* yymsg,
|
||||||
|
int yytype,
|
||||||
|
semantic_type* yyvaluep,
|
||||||
|
location_type* yylocationp);
|
||||||
|
|
||||||
]b4_parse_param_vars[
|
]b4_parse_param_vars[
|
||||||
};
|
};
|
||||||
@@ -331,14 +332,16 @@ b4_user_stype
|
|||||||
b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||||
[b4_token_defines(b4_tokens)])
|
[b4_token_defines(b4_tokens)])
|
||||||
[
|
[
|
||||||
#ifndef ]b4_api_PREFIX[STYPE
|
#ifndef YYSTYPE
|
||||||
# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
|
# define YYSTYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
|
||||||
#endif
|
#endif
|
||||||
#ifndef ]b4_api_PREFIX[LTYPE
|
#ifndef YYLTYPE
|
||||||
# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
|
# define YYLTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
]b4_percent_code_get([[provides]])[
|
|
||||||
]b4_cpp_guard_close([b4_spec_defines_file])[
|
]b4_percent_code_get([[provides]])[]dnl
|
||||||
]m4_divert_pop(0)
|
|
||||||
|
[#endif /* ! defined PARSER_HEADER_H */]
|
||||||
|
m4_divert_pop(0)
|
||||||
|
|||||||
+1
-2
@@ -1,8 +1,7 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# Java skeleton dispatching for Bison.
|
# Java skeleton dispatching for Bison.
|
||||||
|
# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+59
-35
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Java language support for Bison
|
# Java language support for Bison
|
||||||
|
|
||||||
# Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +29,7 @@ m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
|||||||
# --------------------------
|
# --------------------------
|
||||||
# Join two lists with a comma if necessary.
|
# Join two lists with a comma if necessary.
|
||||||
m4_define([b4_list2],
|
m4_define([b4_list2],
|
||||||
[$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
|
[$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_get3(DEF, PRE, POST, NOT)
|
# b4_percent_define_get3(DEF, PRE, POST, NOT)
|
||||||
@@ -37,8 +37,8 @@ m4_define([b4_list2],
|
|||||||
# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed,
|
# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed,
|
||||||
# otherwise NOT.
|
# otherwise NOT.
|
||||||
m4_define([b4_percent_define_get3],
|
m4_define([b4_percent_define_get3],
|
||||||
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
|
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
|
||||||
[$2[]b4_percent_define_get([$1])[]$3], [$4])])
|
[$2[]b4_percent_define_get([$1])[]$3], [$4])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ m4_define([b4_identification],
|
|||||||
m4_define([b4_int_type],
|
m4_define([b4_int_type],
|
||||||
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
||||||
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
||||||
[int])])
|
[int])])
|
||||||
|
|
||||||
# b4_int_type_for(NAME)
|
# b4_int_type_for(NAME)
|
||||||
# ---------------------
|
# ---------------------
|
||||||
@@ -117,6 +117,27 @@ m4_define([b4_int_type_for],
|
|||||||
m4_define([b4_null], [null])
|
m4_define([b4_null], [null])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_typed_parser_table_define(TYPE, NAME, DATA, COMMENT)
|
||||||
|
# -------------------------------------------------------
|
||||||
|
m4_define([b4_typed_parser_table_define],
|
||||||
|
[m4_ifval([$4], [b4_comment([$4])
|
||||||
|
])dnl
|
||||||
|
[private static final ]$1[ yy$2_[] = yy$2_init();
|
||||||
|
private static final ]$1[[] yy$2_init()
|
||||||
|
{
|
||||||
|
return new ]$1[[]
|
||||||
|
{
|
||||||
|
]$3[
|
||||||
|
};
|
||||||
|
}]])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_integral_parser_table_define(NAME, DATA, COMMENT)
|
||||||
|
#-----------------------------------------------------
|
||||||
|
m4_define([b4_integral_parser_table_define],
|
||||||
|
[b4_typed_parser_table_define([b4_int_type_for([$2])], [$1], [$2], [$3])])
|
||||||
|
|
||||||
|
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
## Assigning token numbers. ##
|
## Assigning token numbers. ##
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
@@ -125,8 +146,8 @@ m4_define([b4_null], [null])
|
|||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
# Output the definition of this token as an enum.
|
# Output the definition of this token as an enum.
|
||||||
m4_define([b4_token_enum],
|
m4_define([b4_token_enum],
|
||||||
[ /** Token number, to be returned by the scanner. */
|
[ /** Token number, to be returned by the scanner. */
|
||||||
public static final int $1 = $2;
|
static final int b4_percent_define_get([api.tokens.prefix])$1 = $2;
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -154,24 +175,27 @@ m4_define([b4_case], [ case $1:
|
|||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
|
m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
|
||||||
b4_percent_define_default([[stype]], [[Object]])])
|
b4_percent_define_default([[stype]], [[Object]])
|
||||||
|
|
||||||
# %name-prefix
|
# %name-prefix
|
||||||
m4_define_default([b4_prefix], [[YY]])
|
m4_define_default([b4_prefix], [[YY]])
|
||||||
|
|
||||||
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])])
|
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])
|
||||||
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])])
|
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])])
|
||||||
|
|
||||||
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])])
|
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])
|
||||||
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
|
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
|
||||||
|
|
||||||
b4_percent_define_default([[throws]], [])])
|
b4_percent_define_default([[throws]], [])
|
||||||
m4_define([b4_throws], [b4_percent_define_get([[throws]])])
|
m4_define([b4_throws], [b4_percent_define_get([[throws]])])
|
||||||
|
|
||||||
b4_percent_define_default([[location_type]], [Location])])
|
b4_percent_define_default([[init_throws]], [])
|
||||||
|
m4_define([b4_init_throws], [b4_percent_define_get([[init_throws]])])
|
||||||
|
|
||||||
|
b4_percent_define_default([[location_type]], [Location])
|
||||||
m4_define([b4_location_type], [b4_percent_define_get([[location_type]])])
|
m4_define([b4_location_type], [b4_percent_define_get([[location_type]])])
|
||||||
|
|
||||||
b4_percent_define_default([[position_type]], [Position])])
|
b4_percent_define_default([[position_type]], [Position])
|
||||||
m4_define([b4_position_type], [b4_percent_define_get([[position_type]])])
|
m4_define([b4_position_type], [b4_percent_define_get([[position_type]])])
|
||||||
|
|
||||||
|
|
||||||
@@ -218,21 +242,21 @@ m4_define([b4_rhs_location],
|
|||||||
# it to be single quoted. Same for b4_parse_param.
|
# it to be single quoted. Same for b4_parse_param.
|
||||||
|
|
||||||
# TODO: should be in bison.m4
|
# TODO: should be in bison.m4
|
||||||
m4_define_default([b4_lex_param], [[]]))
|
m4_define_default([b4_lex_param], [[]])
|
||||||
m4_define([b4_lex_param], b4_lex_param))
|
m4_define([b4_lex_param], b4_lex_param)
|
||||||
m4_define([b4_parse_param], b4_parse_param))
|
m4_define([b4_parse_param], b4_parse_param)
|
||||||
|
|
||||||
# b4_lex_param_decl
|
# b4_lex_param_decl
|
||||||
# -------------------
|
# -----------------
|
||||||
# Extra formal arguments of the constructor.
|
# Extra formal arguments of the constructor.
|
||||||
m4_define([b4_lex_param_decl],
|
m4_define([b4_lex_param_decl],
|
||||||
[m4_ifset([b4_lex_param],
|
[m4_ifset([b4_lex_param],
|
||||||
[b4_remove_comma([$1],
|
[b4_remove_comma([$1],
|
||||||
b4_param_decls(b4_lex_param))],
|
b4_param_decls(b4_lex_param))],
|
||||||
[$1])])
|
[$1])])
|
||||||
|
|
||||||
m4_define([b4_param_decls],
|
m4_define([b4_param_decls],
|
||||||
[m4_map([b4_param_decl], [$@])])
|
[m4_map([b4_param_decl], [$@])])
|
||||||
m4_define([b4_param_decl], [, $1])
|
m4_define([b4_param_decl], [, $1])
|
||||||
|
|
||||||
m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
||||||
@@ -245,21 +269,21 @@ m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
|||||||
m4_define([b4_parse_param_decl],
|
m4_define([b4_parse_param_decl],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[b4_remove_comma([$1],
|
[b4_remove_comma([$1],
|
||||||
b4_param_decls(b4_parse_param))],
|
b4_param_decls(b4_parse_param))],
|
||||||
[$1])])
|
[$1])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_lex_param_call
|
# b4_lex_param_call
|
||||||
# -------------------
|
# -----------------
|
||||||
# Delegating the lexer parameters to the lexer constructor.
|
# Delegating the lexer parameters to the lexer constructor.
|
||||||
m4_define([b4_lex_param_call],
|
m4_define([b4_lex_param_call],
|
||||||
[m4_ifset([b4_lex_param],
|
[m4_ifset([b4_lex_param],
|
||||||
[b4_remove_comma([$1],
|
[b4_remove_comma([$1],
|
||||||
b4_param_calls(b4_lex_param))],
|
b4_param_calls(b4_lex_param))],
|
||||||
[$1])])
|
[$1])])
|
||||||
m4_define([b4_param_calls],
|
m4_define([b4_param_calls],
|
||||||
[m4_map([b4_param_call], [$@])])
|
[m4_map([b4_param_call], [$@])])
|
||||||
m4_define([b4_param_call], [, $2])
|
m4_define([b4_param_call], [, $2])
|
||||||
|
|
||||||
|
|
||||||
@@ -269,13 +293,13 @@ m4_define([b4_param_call], [, $2])
|
|||||||
# Extra initialisations of the constructor.
|
# Extra initialisations of the constructor.
|
||||||
m4_define([b4_parse_param_cons],
|
m4_define([b4_parse_param_cons],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[b4_constructor_calls(b4_parse_param)])])
|
[b4_constructor_calls(b4_parse_param)])])
|
||||||
|
|
||||||
m4_define([b4_constructor_calls],
|
m4_define([b4_constructor_calls],
|
||||||
[m4_map([b4_constructor_call], [$@])])
|
[m4_map([b4_constructor_call], [$@])])
|
||||||
m4_define([b4_constructor_call],
|
m4_define([b4_constructor_call],
|
||||||
[this.$2 = $2;
|
[this.$2 = $2;
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -284,15 +308,15 @@ m4_define([b4_constructor_call],
|
|||||||
# Extra instance variables.
|
# Extra instance variables.
|
||||||
m4_define([b4_parse_param_vars],
|
m4_define([b4_parse_param_vars],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[
|
[
|
||||||
/* User arguments. */
|
/* User arguments. */
|
||||||
b4_var_decls(b4_parse_param)])])
|
b4_var_decls(b4_parse_param)])])
|
||||||
|
|
||||||
m4_define([b4_var_decls],
|
m4_define([b4_var_decls],
|
||||||
[m4_map_sep([b4_var_decl], [
|
[m4_map_sep([b4_var_decl], [
|
||||||
], [$@])])
|
], [$@])])
|
||||||
m4_define([b4_var_decl],
|
m4_define([b4_var_decl],
|
||||||
[ protected final $1;])
|
[ protected final $1;])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -300,4 +324,4 @@ m4_define([b4_var_decl],
|
|||||||
# -----------------------
|
# -----------------------
|
||||||
# Expand to either an empty string or "throws THROWS".
|
# Expand to either an empty string or "throws THROWS".
|
||||||
m4_define([b4_maybe_throws],
|
m4_define([b4_maybe_throws],
|
||||||
[m4_ifval($1, [throws $1])])
|
[m4_ifval($1, [throws $1])])
|
||||||
|
|||||||
+595
-626
File diff suppressed because it is too large
Load Diff
+212
-288
@@ -1,6 +1,6 @@
|
|||||||
# Java skeleton for Bison -*- autoconf -*-
|
# Java skeleton for Bison -*- autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,26 +17,36 @@
|
|||||||
|
|
||||||
m4_include(b4_pkgdatadir/[java.m4])
|
m4_include(b4_pkgdatadir/[java.m4])
|
||||||
|
|
||||||
b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java], [b4_skeleton])])
|
b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java],
|
||||||
m4_ifval(m4_defn([b4_symbol_destructors]),
|
[b4_skeleton])])
|
||||||
[b4_fatal([%s: %%destructor does not make sense in Java], [b4_skeleton])],
|
|
||||||
[])
|
# We don't depend on %debug in Java, but pacify warnings about non-used flags.
|
||||||
|
b4_parse_trace_if([0], [0])
|
||||||
|
|
||||||
|
m4_define([b4_symbol_no_destructor_assert],
|
||||||
|
[b4_symbol_if([$1], [has_destructor],
|
||||||
|
[b4_fatal([%s: %s: %%destructor does not make sense in Java],
|
||||||
|
[b4_skeleton],
|
||||||
|
[b4_symbol_action_location([$1], [destructor])])])])
|
||||||
|
b4_symbol_foreach([b4_symbol_no_destructor_assert])
|
||||||
|
|
||||||
m4_divert_push(0)dnl
|
m4_divert_push(0)dnl
|
||||||
@output(b4_parser_file_name@)@
|
@output(b4_parser_file_name@)@
|
||||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
||||||
[2007-2012])
|
[2007, 2008, 2009])
|
||||||
|
|
||||||
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
||||||
])[/* First part of user declarations. */
|
])[/* First part of user declarations. */
|
||||||
]b4_pre_prologue
|
]b4_user_pre_prologue
|
||||||
|
b4_user_post_prologue
|
||||||
b4_percent_code_get([[imports]])
|
b4_percent_code_get([[imports]])
|
||||||
[/**
|
[/**
|
||||||
* A Bison parser, automatically generated from <tt>]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[</tt>.
|
* A Bison parser, automatically generated from <tt>]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[</tt>.
|
||||||
*
|
*
|
||||||
* @@author LALR (1) parser skeleton written by Paolo Bonzini.
|
* @@author LALR (1) parser skeleton written by Paolo Bonzini.
|
||||||
*/
|
*/
|
||||||
]b4_public_if([public ])dnl
|
]b4_percent_define_get3([annotations], [], [ ])dnl
|
||||||
|
b4_public_if([public ])dnl
|
||||||
b4_abstract_if([abstract ])dnl
|
b4_abstract_if([abstract ])dnl
|
||||||
b4_final_if([final ])dnl
|
b4_final_if([final ])dnl
|
||||||
b4_strictfp_if([strictfp ])dnl
|
b4_strictfp_if([strictfp ])dnl
|
||||||
@@ -45,9 +55,22 @@ b4_percent_define_get3([extends], [ extends ])dnl
|
|||||||
b4_percent_define_get3([implements], [ implements ])[
|
b4_percent_define_get3([implements], [ implements ])[
|
||||||
{
|
{
|
||||||
]b4_identification[
|
]b4_identification[
|
||||||
|
]b4_error_verbose_if([[
|
||||||
/** True if verbose error messages are enabled. */
|
/** True if verbose error messages are enabled. */
|
||||||
public boolean errorVerbose = ]b4_flag_value([error_verbose]);
|
private boolean yyErrorVerbose = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return whether verbose error messages are enabled.
|
||||||
|
*/
|
||||||
|
public final boolean getErrorVerbose() { return yyErrorVerbose; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the verbosity of error messages.
|
||||||
|
* @@param verbose True to request verbose error messages.
|
||||||
|
*/
|
||||||
|
public final void setErrorVerbose(boolean verbose)
|
||||||
|
{ yyErrorVerbose = verbose; }
|
||||||
|
]])
|
||||||
|
|
||||||
b4_locations_if([[
|
b4_locations_if([[
|
||||||
/**
|
/**
|
||||||
@@ -93,16 +116,11 @@ b4_locations_if([[
|
|||||||
|
|
||||||
]])
|
]])
|
||||||
|
|
||||||
[ /** Token returned by the scanner to signal the end of its input. */
|
|
||||||
public static final int EOF = 0;]
|
|
||||||
|
|
||||||
b4_token_enums(b4_tokens)
|
|
||||||
|
|
||||||
b4_locations_if([[
|
b4_locations_if([[
|
||||||
private ]b4_location_type[ yylloc (YYStack rhs, int n)
|
private ]b4_location_type[ yylloc (YYStack rhs, int n)
|
||||||
{
|
{
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
return new ]b4_location_type[ (rhs.locationAt (n-1).begin, rhs.locationAt (0).end);
|
return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
|
||||||
else
|
else
|
||||||
return new ]b4_location_type[ (rhs.locationAt (0).end);
|
return new ]b4_location_type[ (rhs.locationAt (0).end);
|
||||||
}]])[
|
}]])[
|
||||||
@@ -112,6 +130,11 @@ b4_token_enums(b4_tokens)
|
|||||||
* parser <tt>]b4_parser_class_name[</tt>.
|
* parser <tt>]b4_parser_class_name[</tt>.
|
||||||
*/
|
*/
|
||||||
public interface Lexer {
|
public interface Lexer {
|
||||||
|
/** Token returned by the scanner to signal the end of its input. */
|
||||||
|
public static final int EOF = 0;
|
||||||
|
|
||||||
|
]b4_token_enums(b4_tokens)[
|
||||||
|
|
||||||
]b4_locations_if([[/**
|
]b4_locations_if([[/**
|
||||||
* Method to retrieve the beginning position of the last scanned token.
|
* Method to retrieve the beginning position of the last scanned token.
|
||||||
* @@return the position at which the last scanned token starts. */
|
* @@return the position at which the last scanned token starts. */
|
||||||
@@ -140,8 +163,8 @@ b4_token_enums(b4_tokens)
|
|||||||
*
|
*
|
||||||
* ]b4_locations_if([[@@param loc The location of the element to which the
|
* ]b4_locations_if([[@@param loc The location of the element to which the
|
||||||
* error message is related]])[
|
* error message is related]])[
|
||||||
* @@param s The string for the error message. */
|
* @@param msg The string for the error message. */
|
||||||
void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s);]
|
void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String msg);]
|
||||||
}
|
}
|
||||||
|
|
||||||
b4_lexer_if([[private class YYLexer implements Lexer {
|
b4_lexer_if([[private class YYLexer implements Lexer {
|
||||||
@@ -157,7 +180,9 @@ b4_lexer_if([[
|
|||||||
/**
|
/**
|
||||||
* Instantiates the Bison-generated parser.
|
* Instantiates the Bison-generated parser.
|
||||||
*/
|
*/
|
||||||
public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) {
|
public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) ]b4_maybe_throws([b4_init_throws])[
|
||||||
|
{
|
||||||
|
]b4_percent_code_get([[init]])[
|
||||||
this.yylexer = new YYLexer(]b4_lex_param_call[);
|
this.yylexer = new YYLexer(]b4_lex_param_call[);
|
||||||
]b4_parse_param_cons[
|
]b4_parse_param_cons[
|
||||||
}
|
}
|
||||||
@@ -167,7 +192,9 @@ b4_lexer_if([[
|
|||||||
* Instantiates the Bison-generated parser.
|
* Instantiates the Bison-generated parser.
|
||||||
* @@param yylexer The scanner that will supply tokens to the parser.
|
* @@param yylexer The scanner that will supply tokens to the parser.
|
||||||
*/
|
*/
|
||||||
b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) {
|
b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) ]b4_maybe_throws([b4_init_throws])[
|
||||||
|
{
|
||||||
|
]b4_percent_code_get([[init]])[
|
||||||
this.yylexer = yylexer;
|
this.yylexer = yylexer;
|
||||||
]b4_parse_param_cons[
|
]b4_parse_param_cons[
|
||||||
}
|
}
|
||||||
@@ -201,20 +228,35 @@ b4_lexer_if([[
|
|||||||
*/
|
*/
|
||||||
public final void setDebugLevel(int level) { yydebug = level; }
|
public final void setDebugLevel(int level) { yydebug = level; }
|
||||||
|
|
||||||
private final int yylex () ]b4_maybe_throws([b4_lex_throws]) [{
|
/**
|
||||||
return yylexer.yylex ();
|
* Print an error message via the lexer.
|
||||||
|
*]b4_locations_if([[ Use a <code>null</code> location.]])[
|
||||||
|
* @@param msg The error message.
|
||||||
|
*/
|
||||||
|
public final void yyerror (String msg)
|
||||||
|
{
|
||||||
|
yylexer.yyerror (]b4_locations_if([[(]b4_location_type[)null, ]])[msg);
|
||||||
}
|
}
|
||||||
protected final void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s) {
|
]b4_locations_if([[
|
||||||
yylexer.yyerror (]b4_locations_if([loc, ])[s);
|
/**
|
||||||
|
* Print an error message via the lexer.
|
||||||
|
* @@param loc The location associated with the message.
|
||||||
|
* @@param msg The error message.
|
||||||
|
*/
|
||||||
|
public final void yyerror (]b4_location_type[ loc, String msg)
|
||||||
|
{
|
||||||
|
yylexer.yyerror (loc, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_locations_if([
|
/**
|
||||||
protected final void yyerror (String s) {
|
* Print an error message via the lexer.
|
||||||
yylexer.yyerror ((]b4_location_type[)null, s);
|
* @@param pos The position associated with the message.
|
||||||
}
|
* @@param msg The error message.
|
||||||
protected final void yyerror (]b4_position_type[ loc, String s) {
|
*/
|
||||||
yylexer.yyerror (new ]b4_location_type[ (loc), s);
|
public final void yyerror (]b4_position_type[ pos, String msg)
|
||||||
}])
|
{
|
||||||
|
yylexer.yyerror (new ]b4_location_type[ (pos), msg);
|
||||||
|
}]])
|
||||||
|
|
||||||
[protected final void yycdebug (String s) {
|
[protected final void yycdebug (String s) {
|
||||||
if (yydebug > 0)
|
if (yydebug > 0)
|
||||||
@@ -230,24 +272,24 @@ b4_lexer_if([[
|
|||||||
public int height = -1;
|
public int height = -1;
|
||||||
|
|
||||||
public final void push (int state, ]b4_yystype[ value]dnl
|
public final void push (int state, ]b4_yystype[ value]dnl
|
||||||
b4_locations_if([, ]b4_location_type[ loc])[) {
|
b4_locations_if([, ]b4_location_type[ loc])[) {
|
||||||
height++;
|
height++;
|
||||||
if (size == height)
|
if (size == height)
|
||||||
{
|
{
|
||||||
int[] newStateStack = new int[size * 2];
|
int[] newStateStack = new int[size * 2];
|
||||||
System.arraycopy (stateStack, 0, newStateStack, 0, height);
|
System.arraycopy (stateStack, 0, newStateStack, 0, height);
|
||||||
stateStack = newStateStack;
|
stateStack = newStateStack;
|
||||||
]b4_locations_if([[
|
]b4_locations_if([[
|
||||||
]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2];
|
]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2];
|
||||||
System.arraycopy (locStack, 0, newLocStack, 0, height);
|
System.arraycopy (locStack, 0, newLocStack, 0, height);
|
||||||
locStack = newLocStack;]])
|
locStack = newLocStack;]])
|
||||||
|
|
||||||
b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2];
|
b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2];
|
||||||
System.arraycopy (valueStack, 0, newValueStack, 0, height);
|
System.arraycopy (valueStack, 0, newValueStack, 0, height);
|
||||||
valueStack = newValueStack;
|
valueStack = newValueStack;
|
||||||
|
|
||||||
size *= 2;
|
size *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
stateStack[height] = state;
|
stateStack[height] = state;
|
||||||
]b4_locations_if([[locStack[height] = loc;]])[
|
]b4_locations_if([[locStack[height] = loc;]])[
|
||||||
@@ -255,14 +297,14 @@ b4_lexer_if([[
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void pop () {
|
public final void pop () {
|
||||||
pop (1);
|
height--;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void pop (int num) {
|
public final void pop (int num) {
|
||||||
// Avoid memory leaks... garbage collection is a white lie!
|
// Avoid memory leaks... garbage collection is a white lie!
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);
|
java.util.Arrays.fill (valueStack, height - num + 1, height, null);
|
||||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
|
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
|
||||||
}
|
}
|
||||||
height -= num;
|
height -= num;
|
||||||
}
|
}
|
||||||
@@ -284,10 +326,10 @@ b4_lexer_if([[
|
|||||||
{
|
{
|
||||||
out.print ("Stack now");
|
out.print ("Stack now");
|
||||||
|
|
||||||
for (int i = 0; i <= height; i++)
|
for (int i = 0; i < height; i++)
|
||||||
{
|
{
|
||||||
out.print (' ');
|
out.print (' ');
|
||||||
out.print (stateStack[i]);
|
out.print (stateStack[i]);
|
||||||
}
|
}
|
||||||
out.println ();
|
out.println ();
|
||||||
}
|
}
|
||||||
@@ -308,9 +350,11 @@ b4_lexer_if([[
|
|||||||
* printing an error message. */
|
* printing an error message. */
|
||||||
public static final int YYERROR = 2;
|
public static final int YYERROR = 2;
|
||||||
|
|
||||||
// Internal return codes that are not supported for user semantic
|
/**
|
||||||
// actions.
|
* Returned by a Bison action in order to print an error message and start
|
||||||
private static final int YYERRLAB = 3;
|
* error recovery. */
|
||||||
|
public static final int YYFAIL = 3;
|
||||||
|
|
||||||
private static final int YYNEWSTATE = 4;
|
private static final int YYNEWSTATE = 4;
|
||||||
private static final int YYDEFAULT = 5;
|
private static final int YYDEFAULT = 5;
|
||||||
private static final int YYREDUCE = 6;
|
private static final int YYREDUCE = 6;
|
||||||
@@ -348,8 +392,8 @@ b4_lexer_if([[
|
|||||||
|
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
]b4_user_actions[
|
]b4_user_actions[
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[);
|
yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[);
|
||||||
@@ -361,7 +405,7 @@ b4_lexer_if([[
|
|||||||
yyn = yyr1_[yyn];
|
yyn = yyr1_[yyn];
|
||||||
int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
|
int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
|
||||||
if (0 <= yystate && yystate <= yylast_
|
if (0 <= yystate && yystate <= yylast_
|
||||||
&& yycheck_[yystate] == yystack.stateAt (0))
|
&& yycheck_[yystate] == yystack.stateAt (0))
|
||||||
yystate = yytable_[yystate];
|
yystate = yytable_[yystate];
|
||||||
else
|
else
|
||||||
yystate = yydefgoto_[yyn - yyntokens_];
|
yystate = yydefgoto_[yyn - yyntokens_];
|
||||||
@@ -370,6 +414,7 @@ b4_lexer_if([[
|
|||||||
return YYNEWSTATE;
|
return YYNEWSTATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
]b4_error_verbose_if([[
|
||||||
/* Return YYSTR after stripping away unnecessary quotes and
|
/* Return YYSTR after stripping away unnecessary quotes and
|
||||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||||
that double-quoting is unnecessary unless the string contains an
|
that double-quoting is unnecessary unless the string contains an
|
||||||
@@ -388,7 +433,7 @@ b4_lexer_if([[
|
|||||||
break strip_quotes;
|
break strip_quotes;
|
||||||
|
|
||||||
case '\\':
|
case '\\':
|
||||||
if (yystr.charAt(++i) != '\\')
|
if (yystr.charAt(++i) != '\\')
|
||||||
break strip_quotes;
|
break strip_quotes;
|
||||||
/* Fall through. */
|
/* Fall through. */
|
||||||
default:
|
default:
|
||||||
@@ -404,20 +449,21 @@ b4_lexer_if([[
|
|||||||
|
|
||||||
return yystr;
|
return yystr;
|
||||||
}
|
}
|
||||||
|
]])[
|
||||||
|
|
||||||
/*--------------------------------.
|
/*--------------------------------.
|
||||||
| Print this symbol on YYOUTPUT. |
|
| Print this symbol on YYOUTPUT. |
|
||||||
`--------------------------------*/
|
`--------------------------------*/
|
||||||
|
|
||||||
private void yy_symbol_print (String s, int yytype,
|
private void yy_symbol_print (String s, int yytype,
|
||||||
]b4_yystype[ yyvaluep]dnl
|
]b4_yystype[ yyvaluep]dnl
|
||||||
b4_locations_if([, Object yylocationp])[)
|
b4_locations_if([, Object yylocationp])[)
|
||||||
{
|
{
|
||||||
if (yydebug > 0)
|
if (yydebug > 0)
|
||||||
yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ")
|
yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ")
|
||||||
+ yytname_[yytype] + " ("]b4_locations_if([
|
+ yytname_[yytype] + " ("]b4_locations_if([
|
||||||
+ yylocationp + ": "])[
|
+ yylocationp + ": "])[
|
||||||
+ (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
|
+ (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -454,6 +500,8 @@ b4_lexer_if([[
|
|||||||
/// Semantic value of the lookahead.
|
/// Semantic value of the lookahead.
|
||||||
b4_yystype[ yylval = null;
|
b4_yystype[ yylval = null;
|
||||||
|
|
||||||
|
int yyresult;
|
||||||
|
|
||||||
yycdebug ("Starting parse\n");
|
yycdebug ("Starting parse\n");
|
||||||
yyerrstatus_ = 0;
|
yyerrstatus_ = 0;
|
||||||
|
|
||||||
@@ -473,7 +521,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
switch (label)
|
switch (label)
|
||||||
{
|
{
|
||||||
/* New state. Unlike in the C/C++ skeletons, the state is already
|
/* New state. Unlike in the C/C++ skeletons, the state is already
|
||||||
pushed when we come here. */
|
pushed when we come here. */
|
||||||
case YYNEWSTATE:
|
case YYNEWSTATE:
|
||||||
yycdebug ("Entering state " + yystate + "\n");
|
yycdebug ("Entering state " + yystate + "\n");
|
||||||
if (yydebug > 0)
|
if (yydebug > 0)
|
||||||
@@ -488,31 +536,31 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
if (yy_pact_value_is_default_ (yyn))
|
if (yy_pact_value_is_default_ (yyn))
|
||||||
{
|
{
|
||||||
label = YYDEFAULT;
|
label = YYDEFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read a lookahead token. */
|
/* Read a lookahead token. */
|
||||||
if (yychar == yyempty_)
|
if (yychar == yyempty_)
|
||||||
{
|
{
|
||||||
yycdebug ("Reading a token: ");
|
yycdebug ("Reading a token: ");
|
||||||
yychar = yylex ();]
|
yychar = yylexer.yylex ();]
|
||||||
b4_locations_if([[
|
b4_locations_if([[
|
||||||
yylloc = new ]b4_location_type[(yylexer.getStartPos (),
|
yylloc = new ]b4_location_type[(yylexer.getStartPos (),
|
||||||
yylexer.getEndPos ());]])
|
yylexer.getEndPos ());]])
|
||||||
yylval = yylexer.getLVal ();[
|
yylval = yylexer.getLVal ();[
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert token to internal form. */
|
/* Convert token to internal form. */
|
||||||
if (yychar <= EOF)
|
if (yychar <= Lexer.EOF)
|
||||||
{
|
{
|
||||||
yychar = yytoken = EOF;
|
yychar = yytoken = Lexer.EOF;
|
||||||
yycdebug ("Now at end of input.\n");
|
yycdebug ("Now at end of input.\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yytoken = yytranslate_ (yychar);
|
yytoken = yytranslate_ (yychar);
|
||||||
yy_symbol_print ("Next token is", yytoken,
|
yy_symbol_print ("Next token is", yytoken,
|
||||||
yylval]b4_locations_if([, yylloc])[);
|
yylval]b4_locations_if([, yylloc])[);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
||||||
@@ -524,20 +572,20 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
/* <= 0 means reduce or error. */
|
/* <= 0 means reduce or error. */
|
||||||
else if ((yyn = yytable_[yyn]) <= 0)
|
else if ((yyn = yytable_[yyn]) <= 0)
|
||||||
{
|
{
|
||||||
if (yy_table_value_is_error_ (yyn))
|
if (yy_table_value_is_error_ (yyn))
|
||||||
label = YYERRLAB;
|
label = YYFAIL;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yyn = -yyn;
|
yyn = -yyn;
|
||||||
label = YYREDUCE;
|
label = YYREDUCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Shift the lookahead token. */
|
/* Shift the lookahead token. */
|
||||||
yy_symbol_print ("Shifting", yytoken,
|
yy_symbol_print ("Shifting", yytoken,
|
||||||
yylval]b4_locations_if([, yylloc])[);
|
yylval]b4_locations_if([, yylloc])[);
|
||||||
|
|
||||||
/* Discard the token being shifted. */
|
/* Discard the token being shifted. */
|
||||||
yychar = yyempty_;
|
yychar = yyempty_;
|
||||||
@@ -559,7 +607,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
case YYDEFAULT:
|
case YYDEFAULT:
|
||||||
yyn = yydefact_[yystate];
|
yyn = yydefact_[yystate];
|
||||||
if (yyn == 0)
|
if (yyn == 0)
|
||||||
label = YYERRLAB;
|
label = YYFAIL;
|
||||||
else
|
else
|
||||||
label = YYREDUCE;
|
label = YYREDUCE;
|
||||||
break;
|
break;
|
||||||
@@ -570,36 +618,34 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
case YYREDUCE:
|
case YYREDUCE:
|
||||||
yylen = yyr2_[yyn];
|
yylen = yyr2_[yyn];
|
||||||
label = yyaction (yyn, yystack, yylen);
|
label = yyaction (yyn, yystack, yylen);
|
||||||
yystate = yystack.stateAt (0);
|
yystate = yystack.stateAt (0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*------------------------------------.
|
/*------------------------------------.
|
||||||
| yyerrlab -- here on detecting error |
|
| yyerrlab -- here on detecting error |
|
||||||
`------------------------------------*/
|
`------------------------------------*/
|
||||||
case YYERRLAB:
|
case YYFAIL:
|
||||||
/* If not already recovering from an error, report this error. */
|
/* If not already recovering from an error, report this error. */
|
||||||
if (yyerrstatus_ == 0)
|
if (yyerrstatus_ == 0)
|
||||||
{
|
{
|
||||||
++yynerrs_;
|
++yynerrs_;
|
||||||
if (yychar == yyempty_)
|
|
||||||
yytoken = yyempty_;
|
|
||||||
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_locations_if([yyerrloc = yylloc;])[
|
]b4_locations_if([yyerrloc = yylloc;])[
|
||||||
if (yyerrstatus_ == 3)
|
if (yyerrstatus_ == 3)
|
||||||
{
|
{
|
||||||
/* If just tried and failed to reuse lookahead token after an
|
/* If just tried and failed to reuse lookahead token after an
|
||||||
error, discard it. */
|
error, discard it. */
|
||||||
|
|
||||||
if (yychar <= EOF)
|
if (yychar <= Lexer.EOF)
|
||||||
{
|
{
|
||||||
/* Return failure if at end of input. */
|
/* Return failure if at end of input. */
|
||||||
if (yychar == EOF)
|
if (yychar == Lexer.EOF)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
yychar = yyempty_;
|
yychar = yyempty_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Else will try to reuse lookahead token after shifting the error
|
/* Else will try to reuse lookahead token after shifting the error
|
||||||
@@ -625,46 +671,46 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
||||||
`-------------------------------------------------------------*/
|
`-------------------------------------------------------------*/
|
||||||
case YYERRLAB1:
|
case YYERRLAB1:
|
||||||
yyerrstatus_ = 3; /* Each real token shifted decrements this. */
|
yyerrstatus_ = 3; /* Each real token shifted decrements this. */
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
yyn = yypact_[yystate];
|
yyn = yypact_[yystate];
|
||||||
if (!yy_pact_value_is_default_ (yyn))
|
if (!yy_pact_value_is_default_ (yyn))
|
||||||
{
|
{
|
||||||
yyn += yyterror_;
|
yyn += yyterror_;
|
||||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||||
{
|
{
|
||||||
yyn = yytable_[yyn];
|
yyn = yytable_[yyn];
|
||||||
if (0 < yyn)
|
if (0 < yyn)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pop the current state because it cannot handle the error token. */
|
/* Pop the current state because it cannot handle the error token. */
|
||||||
if (yystack.height == 0)
|
if (yystack.height == 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
|
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
|
||||||
yystack.pop ();
|
yystack.pop ();
|
||||||
yystate = yystack.stateAt (0);
|
yystate = yystack.stateAt (0);
|
||||||
if (yydebug > 0)
|
if (yydebug > 0)
|
||||||
yystack.print (yyDebugStream);
|
yystack.print (yyDebugStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_locations_if([
|
]b4_locations_if([
|
||||||
/* Muck with the stack to setup for yylloc. */
|
/* Muck with the stack to setup for yylloc. */
|
||||||
yystack.push (0, null, yylloc);
|
yystack.push (0, null, yylloc);
|
||||||
yystack.push (0, null, yyerrloc);
|
yystack.push (0, null, yyerrloc);
|
||||||
yyloc = yylloc (yystack, 2);
|
yyloc = yylloc (yystack, 2);
|
||||||
yystack.pop (2);])[
|
yystack.pop (2);])[
|
||||||
|
|
||||||
/* Shift the error token. */
|
/* Shift the error token. */
|
||||||
yy_symbol_print ("Shifting", yystos_[yyn],
|
yy_symbol_print ("Shifting", yystos_[yyn],
|
||||||
yylval]b4_locations_if([, yyloc])[);
|
yylval]b4_locations_if([, yyloc])[);
|
||||||
|
|
||||||
yystate = yyn;
|
yystate = yyn;
|
||||||
yystack.push (yyn, yylval]b4_locations_if([, yyloc])[);
|
yystack.push (yyn, yylval]b4_locations_if([, yyloc])[);
|
||||||
label = YYNEWSTATE;
|
label = YYNEWSTATE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -680,79 +726,47 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
|
|
||||||
// Generate an error message.
|
// Generate an error message.
|
||||||
private String yysyntax_error (int yystate, int tok)
|
private String yysyntax_error (int yystate, int tok)
|
||||||
{
|
{]b4_error_verbose_if([[
|
||||||
if (errorVerbose)
|
if (yyErrorVerbose)
|
||||||
{
|
{
|
||||||
/* There are many possibilities here to consider:
|
int yyn = yypact_[yystate];
|
||||||
- Assume YYFAIL is not used. It's too flawed to consider.
|
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
||||||
See
|
|
||||||
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
|
|
||||||
for details. YYERROR is fine as it does not invoke this
|
|
||||||
function.
|
|
||||||
- If this state is a consistent state with a default action,
|
|
||||||
then the only way this function was invoked is if the
|
|
||||||
default action is an error action. In that case, don't
|
|
||||||
check for expected tokens because there are none.
|
|
||||||
- The only way there can be no lookahead present (in tok) is
|
|
||||||
if this state is a consistent state with a default action.
|
|
||||||
Thus, detecting the absence of a lookahead is sufficient to
|
|
||||||
determine that there is no unexpected or expected token to
|
|
||||||
report. In that case, just report a simple "syntax error".
|
|
||||||
- Don't assume there isn't a lookahead just because this
|
|
||||||
state is a consistent state with a default action. There
|
|
||||||
might have been a previous inconsistent state, consistent
|
|
||||||
state with a non-default action, or user semantic action
|
|
||||||
that manipulated yychar. (However, yychar is currently out
|
|
||||||
of scope during semantic actions.)
|
|
||||||
- Of course, the expected token list depends on states to
|
|
||||||
have correct lookahead information, and it depends on the
|
|
||||||
parser not to perform extra reductions after fetching a
|
|
||||||
lookahead from the scanner and before detecting a syntax
|
|
||||||
error. Thus, state merging (from LALR or IELR) and default
|
|
||||||
reductions corrupt the expected token list. However, the
|
|
||||||
list is correct for canonical LR with one exception: it
|
|
||||||
will still contain any token that will not be accepted due
|
|
||||||
to an error action in a later state.
|
|
||||||
*/
|
|
||||||
if (tok != yyempty_)
|
|
||||||
{
|
{
|
||||||
|
StringBuffer res;
|
||||||
|
|
||||||
|
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||||
|
YYCHECK. In other words, skip the first -YYN actions for this
|
||||||
|
state because they are default actions. */
|
||||||
|
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||||
|
|
||||||
|
/* Stay within bounds of both yycheck and yytname. */
|
||||||
|
int yychecklim = yylast_ - yyn + 1;
|
||||||
|
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||||
|
int count = 0;
|
||||||
|
for (int x = yyxbegin; x < yyxend; ++x)
|
||||||
|
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||||
|
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||||
|
++count;
|
||||||
|
|
||||||
// FIXME: This method of building the message is not compatible
|
// FIXME: This method of building the message is not compatible
|
||||||
// with internationalization.
|
// with internationalization.
|
||||||
StringBuffer res =
|
res = new StringBuffer ("syntax error, unexpected ");
|
||||||
new StringBuffer ("syntax error, unexpected ");
|
|
||||||
res.append (yytnamerr_ (yytname_[tok]));
|
res.append (yytnamerr_ (yytname_[tok]));
|
||||||
int yyn = yypact_[yystate];
|
if (count < 5)
|
||||||
if (!yy_pact_value_is_default_ (yyn))
|
|
||||||
{
|
{
|
||||||
/* Start YYX at -YYN if negative to avoid negative
|
count = 0;
|
||||||
indexes in YYCHECK. In other words, skip the first
|
|
||||||
-YYN actions for this state because they are default
|
|
||||||
actions. */
|
|
||||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
|
||||||
/* Stay within bounds of both yycheck and yytname. */
|
|
||||||
int yychecklim = yylast_ - yyn + 1;
|
|
||||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
|
||||||
int count = 0;
|
|
||||||
for (int x = yyxbegin; x < yyxend; ++x)
|
for (int x = yyxbegin; x < yyxend; ++x)
|
||||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||||
++count;
|
{
|
||||||
if (count < 5)
|
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||||
{
|
res.append (yytnamerr_ (yytname_[x]));
|
||||||
count = 0;
|
}
|
||||||
for (int x = yyxbegin; x < yyxend; ++x)
|
|
||||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
|
||||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
|
||||||
{
|
|
||||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
|
||||||
res.append (yytnamerr_ (yytname_[x]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return res.toString ();
|
return res.toString ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
]])[
|
||||||
return "syntax error";
|
return "syntax error";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -774,107 +788,20 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
return yyvalue == yytable_ninf_;
|
return yyvalue == yytable_ninf_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
|
||||||
STATE-NUM. */
|
|
||||||
private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[;
|
private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[;
|
||||||
private static final ]b4_int_type_for([b4_pact])[ yypact_[] =
|
|
||||||
{
|
|
||||||
]b4_pact[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
|
||||||
YYTABLE doesn't specify something else to do. Zero means the
|
|
||||||
default is an error. */
|
|
||||||
private static final ]b4_int_type_for([b4_defact])[ yydefact_[] =
|
|
||||||
{
|
|
||||||
]b4_defact[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYPGOTO[NTERM-NUM]. */
|
|
||||||
private static final ]b4_int_type_for([b4_pgoto])[ yypgoto_[] =
|
|
||||||
{
|
|
||||||
]b4_pgoto[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYDEFGOTO[NTERM-NUM]. */
|
|
||||||
private static final ]b4_int_type_for([b4_defgoto])[
|
|
||||||
yydefgoto_[] =
|
|
||||||
{
|
|
||||||
]b4_defgoto[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
|
||||||
positive, shift that token. If negative, reduce the rule which
|
|
||||||
number is the opposite. If YYTABLE_NINF_, syntax error. */
|
|
||||||
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
|
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
|
||||||
private static final ]b4_int_type_for([b4_table])[
|
|
||||||
yytable_[] =
|
|
||||||
{
|
|
||||||
]b4_table[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYCHECK. */
|
]b4_parser_tables_define[
|
||||||
private static final ]b4_int_type_for([b4_check])[
|
]b4_integral_parser_table_define([token_number], [b4_toknum],
|
||||||
yycheck_[] =
|
[TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
|
||||||
{
|
to YYLEX-NUM.])[
|
||||||
]b4_check[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* STOS_[STATE-NUM] -- The (internal number of the) accessing
|
|
||||||
symbol of state STATE-NUM. */
|
|
||||||
private static final ]b4_int_type_for([b4_stos])[
|
|
||||||
yystos_[] =
|
|
||||||
{
|
|
||||||
]b4_stos[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
|
|
||||||
to YYLEX-NUM. */
|
|
||||||
private static final ]b4_int_type_for([b4_toknum])[
|
|
||||||
yytoken_number_[] =
|
|
||||||
{
|
|
||||||
]b4_toknum[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
|
||||||
private static final ]b4_int_type_for([b4_r1])[
|
|
||||||
yyr1_[] =
|
|
||||||
{
|
|
||||||
]b4_r1[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
|
||||||
private static final ]b4_int_type_for([b4_r2])[
|
|
||||||
yyr2_[] =
|
|
||||||
{
|
|
||||||
]b4_r2[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||||
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
|
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
|
||||||
private static final String yytname_[] =
|
]b4_typed_parser_table_define([String], [tname], [b4_tname])[
|
||||||
{
|
|
||||||
]b4_tname[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
]b4_integral_parser_table_define([rline], [b4_rline],
|
||||||
private static final ]b4_int_type_for([b4_rhs])[ yyrhs_[] =
|
[YYRLINE[YYN] -- Source line where rule number YYN was defined.])[
|
||||||
{
|
|
||||||
]b4_rhs[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
|
|
||||||
YYRHS. */
|
|
||||||
private static final ]b4_int_type_for([b4_prhs])[ yyprhs_[] =
|
|
||||||
{
|
|
||||||
]b4_prhs[
|
|
||||||
};
|
|
||||||
|
|
||||||
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
|
|
||||||
private static final ]b4_int_type_for([b4_rline])[ yyrline_[] =
|
|
||||||
{
|
|
||||||
]b4_rline[
|
|
||||||
};
|
|
||||||
|
|
||||||
// Report on the debug stream that the rule yyrule is going to be reduced.
|
// Report on the debug stream that the rule yyrule is going to be reduced.
|
||||||
private void yy_reduce_print (int yyrule, YYStack yystack)
|
private void yy_reduce_print (int yyrule, YYStack yystack)
|
||||||
@@ -886,21 +813,18 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
int yynrhs = yyr2_[yyrule];
|
int yynrhs = yyr2_[yyrule];
|
||||||
/* Print the symbols being reduced, and their result. */
|
/* Print the symbols being reduced, and their result. */
|
||||||
yycdebug ("Reducing stack by rule " + (yyrule - 1)
|
yycdebug ("Reducing stack by rule " + (yyrule - 1)
|
||||||
+ " (line " + yylno + "), ");
|
+ " (line " + yylno + "), ");
|
||||||
|
|
||||||
/* The symbols being reduced. */
|
/* The symbols being reduced. */
|
||||||
for (int yyi = 0; yyi < yynrhs; yyi++)
|
for (int yyi = 0; yyi < yynrhs; yyi++)
|
||||||
yy_symbol_print (" $" + (yyi + 1) + " =",
|
yy_symbol_print (" $" + (yyi + 1) + " =",
|
||||||
yyrhs_[yyprhs_[yyrule] + yyi],
|
yystos_[yystack.stateAt(yyi + 1 - yynrhs)],
|
||||||
]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
|
]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
|
||||||
b4_rhs_location(yynrhs, yyi + 1)])[);
|
b4_rhs_location(yynrhs, yyi + 1)])[);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
||||||
private static final ]b4_int_type_for([b4_translate])[ yytranslate_table_[] =
|
]b4_integral_parser_table_define([translate_table], [b4_translate])[
|
||||||
{
|
|
||||||
]b4_translate[
|
|
||||||
};
|
|
||||||
|
|
||||||
private static final ]b4_int_type_for([b4_translate])[ yytranslate_ (int t)
|
private static final ]b4_int_type_for([b4_translate])[ yytranslate_ (int t)
|
||||||
{
|
{
|
||||||
@@ -926,5 +850,5 @@ b4_percent_code_get[]dnl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
b4_epilogue
|
b4_epilogue[]dnl
|
||||||
m4_divert_pop(0)dnl
|
m4_divert_pop(0)dnl
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
## Copyright (C) 2002, 2005, 2006, 2007, 2008-2009 Free Software
|
||||||
|
## Foundation, Inc.
|
||||||
|
|
||||||
|
## This program is free software: you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
dist_pkgdata_DATA = \
|
||||||
|
data/README \
|
||||||
|
data/bison.m4 \
|
||||||
|
data/c++-skel.m4 \
|
||||||
|
data/c++.m4 \
|
||||||
|
data/c-skel.m4 \
|
||||||
|
data/c.m4 \
|
||||||
|
data/glr.c \
|
||||||
|
data/glr.cc \
|
||||||
|
data/java-skel.m4 \
|
||||||
|
data/java.m4 \
|
||||||
|
data/lalr1.cc \
|
||||||
|
data/lalr1.java \
|
||||||
|
data/location.cc \
|
||||||
|
data/stack.hh \
|
||||||
|
data/variant.hh \
|
||||||
|
data/yacc.c
|
||||||
|
|
||||||
|
m4sugardir = $(pkgdatadir)/m4sugar
|
||||||
|
dist_m4sugar_DATA = \
|
||||||
|
data/m4sugar/foreach.m4 \
|
||||||
|
data/m4sugar/m4sugar.m4
|
||||||
|
|
||||||
|
xsltdir = $(pkgdatadir)/xslt
|
||||||
|
dist_xslt_DATA = \
|
||||||
|
data/xslt/bison.xsl \
|
||||||
|
data/xslt/xml2dot.xsl \
|
||||||
|
data/xslt/xml2text.xsl \
|
||||||
|
data/xslt/xml2xhtml.xsl
|
||||||
+30
-30
@@ -1,6 +1,7 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,25 +16,26 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
m4_pushdef([b4_copyright_years],
|
||||||
|
[2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009])
|
||||||
|
|
||||||
# We do want M4 expansion after # for CPP macros.
|
# We do want M4 expansion after # for CPP macros.
|
||||||
m4_changecom()
|
m4_changecom()
|
||||||
m4_divert_push(0)dnl
|
m4_divert_push(0)dnl
|
||||||
@output(b4_dir_prefix[]position.hh@)@
|
@output(b4_dir_prefix[]position.hh@)@
|
||||||
b4_copyright([Positions for Bison parsers in C++],
|
b4_copyright([Positions for Bison parsers in C++])[
|
||||||
[2002-2007, 2009-2012])[
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** \file ]b4_dir_prefix[position.hh
|
** \file position.hh
|
||||||
** Define the ]b4_namespace_ref[::position class.
|
** Define the ]b4_namespace_ref[::position class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[
|
#ifndef BISON_POSITION_HH
|
||||||
|
# define BISON_POSITION_HH
|
||||||
|
|
||||||
# include <algorithm> // std::max
|
# include <iostream>
|
||||||
# include <iosfwd>
|
|
||||||
# include <string>
|
# include <string>
|
||||||
|
# include <algorithm>
|
||||||
]b4_null_define[
|
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
/// Abstract a position.
|
/// Abstract a position.
|
||||||
@@ -42,7 +44,7 @@ b4_copyright([Positions for Bison parsers in C++],
|
|||||||
public:
|
public:
|
||||||
]m4_ifdef([b4_location_constructors], [[
|
]m4_ifdef([b4_location_constructors], [[
|
||||||
/// Construct a position.
|
/// Construct a position.
|
||||||
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
explicit position (]b4_percent_define_get([[filename_type]])[* f = 0,
|
||||||
unsigned int l = ]b4_location_initial_line[u,
|
unsigned int l = ]b4_location_initial_line[u,
|
||||||
unsigned int c = ]b4_location_initial_column[u)
|
unsigned int c = ]b4_location_initial_column[u)
|
||||||
: filename (f)
|
: filename (f)
|
||||||
@@ -53,26 +55,25 @@ b4_copyright([Positions for Bison parsers in C++],
|
|||||||
|
|
||||||
]])[
|
]])[
|
||||||
/// Initialization.
|
/// Initialization.
|
||||||
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL,
|
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||||
unsigned int l = ]b4_location_initial_line[u,
|
|
||||||
unsigned int c = ]b4_location_initial_column[u)
|
|
||||||
{
|
{
|
||||||
filename = fn;
|
filename = fn;
|
||||||
line = l;
|
line = ]b4_location_initial_line[u;
|
||||||
column = c;
|
column = ]b4_location_initial_column[u;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \name Line and Column related manipulators
|
/** \name Line and Column related manipulators
|
||||||
** \{ */
|
** \{ */
|
||||||
/// (line related) Advance to the COUNT next lines.
|
/// (line related) Advance to the COUNT next lines.
|
||||||
void lines (int count = 1)
|
/// Set current column to initial value.
|
||||||
|
inline void lines (int count = 1)
|
||||||
{
|
{
|
||||||
column = ]b4_location_initial_column[u;
|
column = ]b4_location_initial_column[u;
|
||||||
line += count;
|
line += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// (column related) Advance to the COUNT next columns.
|
/// (column related) Advance to the COUNT next columns.
|
||||||
void columns (int count = 1)
|
inline void columns (int count = 1)
|
||||||
{
|
{
|
||||||
column = std::max (]b4_location_initial_column[u, column + count);
|
column = std::max (]b4_location_initial_column[u, column + count);
|
||||||
}
|
}
|
||||||
@@ -147,17 +148,17 @@ b4_copyright([Positions for Bison parsers in C++],
|
|||||||
}
|
}
|
||||||
|
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
]b4_cpp_guard_close([b4_dir_prefix[]position.hh])
|
#endif // not BISON_POSITION_HH]
|
||||||
@output(b4_dir_prefix[]location.hh@)@
|
@output(b4_dir_prefix[]location.hh@)@
|
||||||
b4_copyright([Locations for Bison parsers in C++],
|
b4_copyright([Locations for Bison parsers in C++])[
|
||||||
[2002-2007, 2009-2012])[
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** \file ]b4_dir_prefix[location.hh
|
** \file location.hh
|
||||||
** Define the ]b4_namespace_ref[::location class.
|
** Define the ]b4_namespace_ref[::location class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[
|
#ifndef BISON_LOCATION_HH
|
||||||
|
# define BISON_LOCATION_HH
|
||||||
|
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
# include <string>
|
# include <string>
|
||||||
@@ -195,11 +196,9 @@ b4_copyright([Locations for Bison parsers in C++],
|
|||||||
|
|
||||||
])[
|
])[
|
||||||
/// Initialization.
|
/// Initialization.
|
||||||
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||||
unsigned int l = ]b4_location_initial_line[u,
|
|
||||||
unsigned int c = ]b4_location_initial_column[u)
|
|
||||||
{
|
{
|
||||||
begin.initialize (f, l, c);
|
begin.initialize (fn);
|
||||||
end = begin;
|
end = begin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,19 +206,19 @@ b4_copyright([Locations for Bison parsers in C++],
|
|||||||
** \{ */
|
** \{ */
|
||||||
public:
|
public:
|
||||||
/// Reset initial location to final location.
|
/// Reset initial location to final location.
|
||||||
void step ()
|
inline void step ()
|
||||||
{
|
{
|
||||||
begin = end;
|
begin = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extend the current location to the COUNT next columns.
|
/// Extend the current location to the COUNT next columns.
|
||||||
void columns (unsigned int count = 1)
|
inline void columns (unsigned int count = 1)
|
||||||
{
|
{
|
||||||
end += count;
|
end += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extend the current location to the COUNT next lines.
|
/// Extend the current location to the COUNT next lines.
|
||||||
void lines (unsigned int count = 1)
|
inline void lines (unsigned int count = 1)
|
||||||
{
|
{
|
||||||
end.lines (count);
|
end.lines (count);
|
||||||
}
|
}
|
||||||
@@ -293,6 +292,7 @@ b4_copyright([Locations for Bison parsers in C++],
|
|||||||
|
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
|
|
||||||
]b4_cpp_guard_close([b4_dir_prefix[]location.hh])
|
#endif // not BISON_LOCATION_HH]
|
||||||
m4_divert_pop(0)
|
m4_divert_pop(0)
|
||||||
|
m4_popdef([b4_copyright_years])dnl
|
||||||
m4_changecom([#])
|
m4_changecom([#])
|
||||||
|
|||||||
+32
-21
@@ -1,6 +1,7 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008-2009 Free
|
||||||
|
# Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,23 +17,18 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
m4_pushdef([b4_copyright_years],
|
m4_pushdef([b4_copyright_years],
|
||||||
[2002-2012])
|
[2002, 2003, 2004, 2005, 2006, 2007, 2008-2009])
|
||||||
|
|
||||||
# We do want M4 expansion after # for CPP macros.
|
# We do want M4 expansion after # for CPP macros.
|
||||||
m4_changecom()
|
m4_changecom()
|
||||||
m4_divert_push(0)dnl
|
m4_divert_push(0)dnl
|
||||||
@output(b4_dir_prefix[]stack.hh@)@
|
@output(b4_dir_prefix[]stack.hh@)@
|
||||||
b4_copyright([Stack handling for Bison parsers in C++],
|
b4_copyright([Stack handling for Bison parsers in C++])[
|
||||||
[2002-2012])[
|
|
||||||
|
|
||||||
/**
|
#ifndef BISON_STACK_HH
|
||||||
** \file ]b4_dir_prefix[stack.hh
|
# define BISON_STACK_HH
|
||||||
** Define the ]b4_namespace_ref[::stack class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
]b4_cpp_guard_open([b4_dir_prefix[]stack.hh])[
|
#include <deque>
|
||||||
|
|
||||||
# include <deque>
|
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
template <class T, class S = std::deque<T> >
|
template <class T, class S = std::deque<T> >
|
||||||
@@ -43,11 +39,13 @@ b4_copyright([Stack handling for Bison parsers in C++],
|
|||||||
typedef typename S::reverse_iterator iterator;
|
typedef typename S::reverse_iterator iterator;
|
||||||
typedef typename S::const_reverse_iterator const_iterator;
|
typedef typename S::const_reverse_iterator const_iterator;
|
||||||
|
|
||||||
stack () : seq_ ()
|
stack ()
|
||||||
|
: seq_ ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
stack (unsigned int n) : seq_ (n)
|
stack (unsigned int n)
|
||||||
|
: seq_ (n)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,20 +75,32 @@ b4_copyright([Stack handling for Bison parsers in C++],
|
|||||||
pop (unsigned int n = 1)
|
pop (unsigned int n = 1)
|
||||||
{
|
{
|
||||||
for (; n; --n)
|
for (; n; --n)
|
||||||
seq_.pop_front ();
|
seq_.pop_front ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
unsigned int
|
typename S::size_type
|
||||||
height () const
|
size () const
|
||||||
{
|
{
|
||||||
return seq_.size ();
|
return seq_.size ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const_iterator begin () const { return seq_.rbegin (); }
|
inline
|
||||||
inline const_iterator end () const { return seq_.rend (); }
|
const_iterator
|
||||||
|
begin () const
|
||||||
|
{
|
||||||
|
return seq_.rbegin ();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
const_iterator
|
||||||
|
end () const
|
||||||
|
{
|
||||||
|
return seq_.rend ();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// The wrapped container.
|
||||||
S seq_;
|
S seq_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -100,8 +110,8 @@ b4_copyright([Stack handling for Bison parsers in C++],
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
slice (const S& stack, unsigned int range)
|
slice (const S& stack, unsigned int range)
|
||||||
: stack_ (stack)
|
: stack_ (stack),
|
||||||
, range_ (range)
|
range_ (range)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +128,8 @@ b4_copyright([Stack handling for Bison parsers in C++],
|
|||||||
};
|
};
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
|
|
||||||
]b4_cpp_guard_close([b4_dir_prefix[]stack.hh])
|
#endif // not BISON_STACK_HH[]dnl
|
||||||
|
]
|
||||||
m4_divert_pop(0)
|
m4_divert_pop(0)
|
||||||
m4_popdef([b4_copyright_years])dnl
|
m4_popdef([b4_copyright_years])dnl
|
||||||
m4_changecom([#])
|
m4_changecom([#])
|
||||||
|
|||||||
+278
@@ -0,0 +1,278 @@
|
|||||||
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008-2009 Free
|
||||||
|
# Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
## --------- ##
|
||||||
|
## variant. ##
|
||||||
|
## --------- ##
|
||||||
|
|
||||||
|
# b4_symbol_variant(YYTYPE, YYVAL, ACTION, [ARGS])
|
||||||
|
# ------------------------------------------------
|
||||||
|
# Run some ACTION ("build", or "destroy") on YYVAL of symbol type
|
||||||
|
# YYTYPE.
|
||||||
|
m4_define([b4_symbol_variant],
|
||||||
|
[m4_pushdef([b4_dollar_dollar],
|
||||||
|
[$2.$3< $][3 >(m4_shift3($@))])dnl
|
||||||
|
switch ($1)
|
||||||
|
{
|
||||||
|
b4_type_foreach([b4_type_action_])[]dnl
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
m4_popdef([b4_dollar_dollar])dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# _b4_char_sizeof_counter
|
||||||
|
# -----------------------
|
||||||
|
# A counter used by _b4_char_sizeof_dummy to create fresh symbols.
|
||||||
|
m4_define([_b4_char_sizeof_counter],
|
||||||
|
[0])
|
||||||
|
|
||||||
|
# _b4_char_sizeof_dummy
|
||||||
|
# ---------------------
|
||||||
|
# At each call return a new C++ identifier.
|
||||||
|
m4_define([_b4_char_sizeof_dummy],
|
||||||
|
[m4_define([_b4_char_sizeof_counter], m4_incr(_b4_char_sizeof_counter))dnl
|
||||||
|
dummy[]_b4_char_sizeof_counter])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_char_sizeof_(SYMBOL-NUM)
|
||||||
|
# ---------------------------
|
||||||
|
# A comment describing this symbol.
|
||||||
|
m4_define([b4_char_sizeof_],
|
||||||
|
[ // b4_symbol([$1], [tag])
|
||||||
|
])
|
||||||
|
|
||||||
|
# b4_char_sizeof(SYMBOL-NUMS)
|
||||||
|
# ---------------------------
|
||||||
|
# To be mapped on the list of type names to produce:
|
||||||
|
#
|
||||||
|
# char dummy1[sizeof(type_name_1)];
|
||||||
|
# char dummy2[sizeof(type_name_2)];
|
||||||
|
#
|
||||||
|
# for defined type names.
|
||||||
|
m4_define([b4_char_sizeof],
|
||||||
|
[b4_symbol_if([$1], [has_type],
|
||||||
|
[
|
||||||
|
m4_map([b4_char_sizeof_], [$@])dnl
|
||||||
|
char _b4_char_sizeof_dummy@{sizeof([b4_symbol([$1], [type])])@};
|
||||||
|
])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_variant_define
|
||||||
|
# -----------------
|
||||||
|
# Define "variant".
|
||||||
|
m4_define([b4_variant_define],
|
||||||
|
[[
|
||||||
|
/// A char[S] buffer to store and retrieve objects.
|
||||||
|
///
|
||||||
|
/// Sort of a variant, but does not keep track of the nature
|
||||||
|
/// of the stored data, since that knowledge is available
|
||||||
|
/// via the current state.
|
||||||
|
template <size_t S>
|
||||||
|
struct variant
|
||||||
|
{]b4_parse_assert_if([
|
||||||
|
/// Whether something is contained.
|
||||||
|
bool built;
|
||||||
|
])[
|
||||||
|
/// Empty construction.
|
||||||
|
inline
|
||||||
|
variant ()]b4_parse_assert_if([
|
||||||
|
: built (false)])[
|
||||||
|
{}
|
||||||
|
|
||||||
|
/// Instantiate a \a T in here.
|
||||||
|
template <typename T>
|
||||||
|
inline T&
|
||||||
|
build ()
|
||||||
|
{]b4_parse_assert_if([
|
||||||
|
assert (!built);
|
||||||
|
built = true;])[
|
||||||
|
return *new (buffer.raw) T;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Instantiate a \a T in here from \a t.
|
||||||
|
template <typename T>
|
||||||
|
inline T&
|
||||||
|
build (const T& t)
|
||||||
|
{]b4_parse_assert_if([
|
||||||
|
assert(!built);
|
||||||
|
built = true;])[
|
||||||
|
return *new (buffer.raw) T(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Construct and fill.
|
||||||
|
template <typename T>
|
||||||
|
inline
|
||||||
|
variant (const T& t)]b4_parse_assert_if([
|
||||||
|
: built (true)])[
|
||||||
|
{
|
||||||
|
new (buffer.raw) T(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Accessor to a built \a T.
|
||||||
|
template <typename T>
|
||||||
|
inline T&
|
||||||
|
as ()
|
||||||
|
{]b4_parse_assert_if([
|
||||||
|
assert (built);])[
|
||||||
|
return reinterpret_cast<T&>(buffer.raw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Const accessor to a built \a T (for %printer).
|
||||||
|
template <typename T>
|
||||||
|
inline const T&
|
||||||
|
as () const
|
||||||
|
{]b4_parse_assert_if([
|
||||||
|
assert(built);])[
|
||||||
|
return reinterpret_cast<const T&>(buffer.raw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Swap the content with \a other.
|
||||||
|
template <typename T>
|
||||||
|
inline void
|
||||||
|
swap (variant<S>& other)
|
||||||
|
{
|
||||||
|
std::swap (as<T>(), other.as<T>());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Assign the content of \a other to this.
|
||||||
|
/// Destroys \a other.
|
||||||
|
template <typename T>
|
||||||
|
inline void
|
||||||
|
build (variant<S>& other)
|
||||||
|
{
|
||||||
|
build<T>();
|
||||||
|
swap<T>(other);
|
||||||
|
other.destroy<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Destroy the stored \a T.
|
||||||
|
template <typename T>
|
||||||
|
inline void
|
||||||
|
destroy ()
|
||||||
|
{
|
||||||
|
as<T>().~T();]b4_parse_assert_if([
|
||||||
|
built = false;])[
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A buffer large enough to store any of the semantic values.
|
||||||
|
/// Long double is chosen as it has the strongest alignment
|
||||||
|
/// constraints.
|
||||||
|
union
|
||||||
|
{
|
||||||
|
long double align_me;
|
||||||
|
char raw[S];
|
||||||
|
} buffer;
|
||||||
|
};
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
## -------------------------- ##
|
||||||
|
## Adjustments for variants. ##
|
||||||
|
## -------------------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
# b4_semantic_type_declare
|
||||||
|
# ------------------------
|
||||||
|
# Declare semantic_type.
|
||||||
|
m4_define([b4_semantic_type_declare],
|
||||||
|
[ /// An auxiliary type to compute the largest semantic type.
|
||||||
|
union union_type
|
||||||
|
{]b4_type_foreach([b4_char_sizeof])[};
|
||||||
|
|
||||||
|
/// Symbol semantic values.
|
||||||
|
typedef variant<sizeof(union_type)> semantic_type;])
|
||||||
|
|
||||||
|
|
||||||
|
# How the semantic value is extracted when using variants.
|
||||||
|
|
||||||
|
# b4_symbol_value(VAL, [TYPE])
|
||||||
|
# ----------------------------
|
||||||
|
m4_define([b4_symbol_value],
|
||||||
|
[m4_ifval([$2],
|
||||||
|
[$1.as< $2 >()],
|
||||||
|
[$1])])
|
||||||
|
|
||||||
|
# b4_symbol_value_template(VAL, [TYPE])
|
||||||
|
# -------------------------------------
|
||||||
|
# Same as b4_symbol_value, but used in a template method.
|
||||||
|
m4_define([b4_symbol_value_template],
|
||||||
|
[m4_ifval([$2],
|
||||||
|
[$1.template as< $2 >()],
|
||||||
|
[$1])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## ------------- ##
|
||||||
|
## make_SYMBOL. ##
|
||||||
|
## ------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_constructor_declare_(SYMBOL-NUMBER)
|
||||||
|
# ---------------------------------------------
|
||||||
|
# Declare the overloaded version of make_symbol for the (common) type of
|
||||||
|
# these SYMBOL-NUMBERS. Use at class-level.
|
||||||
|
m4_define([b4_symbol_constructor_declare_],
|
||||||
|
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
|
||||||
|
[ static // inline
|
||||||
|
symbol_type
|
||||||
|
make_[]b4_symbol_([$1], [id]) (dnl
|
||||||
|
b4_args(b4_symbol_if([$1], [has_type],
|
||||||
|
[const b4_symbol([$1], [type])& v]),
|
||||||
|
b4_locations_if([const location_type& l])));
|
||||||
|
|
||||||
|
])])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_constructor_declare
|
||||||
|
# -----------------------------
|
||||||
|
# Declare symbol constructors for all the value types.
|
||||||
|
# Use at class-level.
|
||||||
|
m4_define([b4_symbol_constructor_declare],
|
||||||
|
[ // Symbol constructors declarations.
|
||||||
|
b4_symbol_foreach([b4_symbol_constructor_declare_])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_constructor_define_(SYMBOL-NUMBER)
|
||||||
|
# --------------------------------------------
|
||||||
|
# Define symbol constructor for this SYMBOL-NUMBER.
|
||||||
|
m4_define([b4_symbol_constructor_define_],
|
||||||
|
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
|
||||||
|
[ b4_parser_class_name::symbol_type
|
||||||
|
b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl
|
||||||
|
b4_args(b4_symbol_if([$1], [has_type],
|
||||||
|
[const b4_symbol([$1], [type])& v]),
|
||||||
|
b4_locations_if([const location_type& l])))
|
||||||
|
{
|
||||||
|
return symbol_type (b4_args([yytranslate_ (token::b4_symbol([$1], [id]))],
|
||||||
|
b4_symbol_if([$1], [has_type], [v]),
|
||||||
|
b4_locations_if([l])));
|
||||||
|
}
|
||||||
|
|
||||||
|
])])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_constructor_define
|
||||||
|
# ----------------------------
|
||||||
|
# Define the overloaded versions of make_symbol for all the value types.
|
||||||
|
m4_define([b4_symbol_constructor_define],
|
||||||
|
[ // Implementation of make_symbol for each symbol type.
|
||||||
|
b4_symbol_foreach([b4_symbol_constructor_define_])])
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
bison.xsl - common templates for Bison XSLT.
|
bison.xsl - common templates for Bison XSLT.
|
||||||
|
|
||||||
Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2008-2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+3
-19
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||||
|
|
||||||
Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -35,27 +35,11 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="bison-xml-report">
|
<xsl:template match="bison-xml-report">
|
||||||
<xsl:text>// Generated by GNU Bison </xsl:text>
|
<xsl:apply-templates select="automaton"/>
|
||||||
<xsl:value-of select="@version"/>
|
|
||||||
<xsl:text>. </xsl:text>
|
|
||||||
<xsl:text>// Report bugs to <</xsl:text>
|
|
||||||
<xsl:value-of select="@bug-report"/>
|
|
||||||
<xsl:text>>. </xsl:text>
|
|
||||||
<xsl:text>// Home page: <</xsl:text>
|
|
||||||
<xsl:value-of select="@url"/>
|
|
||||||
<xsl:text>>. </xsl:text>
|
|
||||||
<xsl:apply-templates select="automaton">
|
|
||||||
<xsl:with-param name="filename" select="filename"/>
|
|
||||||
</xsl:apply-templates>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="automaton">
|
<xsl:template match="automaton">
|
||||||
<xsl:param name="filename"/>
|
<xsl:text>digraph Automaton { </xsl:text>
|
||||||
<xsl:text>digraph "</xsl:text>
|
|
||||||
<xsl:call-template name="escape">
|
|
||||||
<xsl:with-param name="subject" select="$filename"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:text>" { </xsl:text>
|
|
||||||
<xsl:apply-templates select="state"/>
|
<xsl:apply-templates select="state"/>
|
||||||
<xsl:text>} </xsl:text>
|
<xsl:text>} </xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
xml2text.xsl - transform Bison XML Report into plain text.
|
xml2text.xsl - transform Bison XML Report into plain text.
|
||||||
|
|
||||||
Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2008-2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||||
|
|
||||||
Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+507
-891
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,8 @@
|
|||||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||||
# Requires GNU sed
|
# Requires GNU sed
|
||||||
|
|
||||||
## Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
## Copyright (C) 2005, 2006, 2007, 2008-2009 Free Software Foundation,
|
||||||
|
## Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||||
|
|
||||||
Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
Copyright (C) 2005, 2006, 2007, 2008-2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -84,7 +84,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
some more work to unpack, if LFN support is not available. If LFN is
|
some more work to unpack, if LFN support is not available. If LFN is
|
||||||
available then you can extract the source files from the archive with
|
available then you can extract the source files from the archive with
|
||||||
any unzip program and proceed to the paragraph 3.3, below. Any file
|
any unzip program and proceed to the paragraph 3.3, below. Any file
|
||||||
name issue will be handled by the DJGPP configuration files.
|
name issue will be handled by the the DJGPP configuration files.
|
||||||
To unpack the source distribution on SFN systems, first, you MUST use
|
To unpack the source distribution on SFN systems, first, you MUST use
|
||||||
the `djunpack' batch file to unzip the package. That is because some
|
the `djunpack' batch file to unzip the package. That is because some
|
||||||
file names in the official distributions need to be changed to avoid
|
file names in the official distributions need to be changed to avoid
|
||||||
@@ -179,7 +179,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
This will install the products into your DJGPP installation tree given
|
This will install the products into your DJGPP installation tree given
|
||||||
by the default prefix "/dev/env/DJDIR". If you prefer to install them
|
by the default prefix "/dev/env/DJDIR". If you prefer to install them
|
||||||
into some other directory you will have to set prefix to the appropriate
|
into some other directory you will have to set prefix to the appropiate
|
||||||
value:
|
value:
|
||||||
make install prefix=z:/some/other/place
|
make install prefix=z:/some/other/place
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -4,7 +4,8 @@ Rem Configure Bison for DJGPP.
|
|||||||
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||||
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||||
|
|
||||||
Rem Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005, 2006, 2007, 2008-2009 Free Software Foundation,
|
||||||
|
Rem Inc.
|
||||||
|
|
||||||
Rem This program is free software: you can redistribute it and/or modify
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
Rem it under the terms of the GNU General Public License as published by
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
@@ -471,7 +472,7 @@ redir -e /dev/null rm %XSRC%/po/stamp-cat-id
|
|||||||
|
|
||||||
Rem Update the arguments file for the configure script.
|
Rem Update the arguments file for the configure script.
|
||||||
Rem We prefer without-included-gettext because libintl.a from gettext package
|
Rem We prefer without-included-gettext because libintl.a from gettext package
|
||||||
Rem is the only one that is guaranteed to have been ported to DJGPP.
|
Rem is the only one that is garanteed to have been ported to DJGPP.
|
||||||
echo --enable-nls --without-included-gettext >> args
|
echo --enable-nls --without-included-gettext >> args
|
||||||
goto ConfigurePackage
|
goto ConfigurePackage
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -2,7 +2,9 @@
|
|||||||
# Sed script for additional DJGPP specific editing
|
# Sed script for additional DJGPP specific editing
|
||||||
# of the configure script generated by autoconf 2.62.
|
# of the configure script generated by autoconf 2.62.
|
||||||
|
|
||||||
# Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 2005, 2006, 2007, 2008-2009 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+2
-1
@@ -3,7 +3,8 @@
|
|||||||
# This is the config.site file for configuring GNU packages
|
# This is the config.site file for configuring GNU packages
|
||||||
# which are to be built with DJGPP tools.
|
# which are to be built with DJGPP tools.
|
||||||
|
|
||||||
# Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2005, 2006, 2007, 2008-2009 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
# sed script for DJGPP specific editing of config.hin
|
# sed script for DJGPP specific editing of config.hin
|
||||||
|
|
||||||
# Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2005, 2006, 2007, 2008-2009 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+2
-1
@@ -7,7 +7,8 @@ Rem This batch file unpacks the Bison distribution while simultaneously
|
|||||||
Rem renaming some of the files whose names are invalid on DOS or conflict
|
Rem renaming some of the files whose names are invalid on DOS or conflict
|
||||||
Rem with other file names after truncation to DOS 8+3 namespace.
|
Rem with other file names after truncation to DOS 8+3 namespace.
|
||||||
Rem
|
Rem
|
||||||
Rem Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005, 2006, 2007, 2008-2009 Free Software Foundation,
|
||||||
|
Rem Inc.
|
||||||
Rem
|
Rem
|
||||||
Rem This program is free software: you can redistribute it and/or modify
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
Rem it under the terms of the GNU General Public License as published by
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
## Copyright (C) 2008-2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
## This program is free software: you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
EXTRA_DIST += \
|
||||||
|
djgpp/Makefile.maint \
|
||||||
|
djgpp/README.in \
|
||||||
|
djgpp/config.bat \
|
||||||
|
djgpp/config.sed \
|
||||||
|
djgpp/config.site \
|
||||||
|
djgpp/config_h.sed \
|
||||||
|
djgpp/djunpack.bat \
|
||||||
|
djgpp/fnchange.lst \
|
||||||
|
djgpp/subpipe.c \
|
||||||
|
djgpp/subpipe.h \
|
||||||
|
djgpp/testsuite.sed
|
||||||
+9
-8
@@ -1,6 +1,7 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
Copyright (C) 2005, 2006, 2007, 2008-2009 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -60,7 +61,7 @@ static char tmp_file_name[2][L_tmpnam];
|
|||||||
do { \
|
do { \
|
||||||
close ((fd)); \
|
close ((fd)); \
|
||||||
if (unlink ((name))) \
|
if (unlink ((name))) \
|
||||||
error (EXIT_FAILURE, 0, _("removing of '%s' failed"), (name)); \
|
error (EXIT_FAILURE, 0, _("removing of `%s' failed"), (name)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
@@ -231,17 +232,17 @@ end_of_output_subpipe(pid_t pid, int fd[2])
|
|||||||
{
|
{
|
||||||
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
error(EXIT_FAILURE, 0, _("subsidiary program '%s' interrupted"), program);
|
error(EXIT_FAILURE, 0, _("subsidiary program `%s' interrupted"), program);
|
||||||
}
|
}
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
error(EXIT_FAILURE, 0, _(errno == ENOENT
|
error(EXIT_FAILURE, 0, _(errno == ENOENT
|
||||||
? "subsidiary program '%s' not found"
|
? "subsidiary program `%s' not found"
|
||||||
: status < 1
|
: status < 1
|
||||||
? "subsidiary program '%s' failed"
|
? "subsidiary program `%s' failed"
|
||||||
: "subsidiary program '%s' failed (status=%i, errno=%i)"), program, status, errno);
|
: "subsidiary program `%s' failed (status=%i, errno=%i)"), program, status, errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -283,9 +284,9 @@ reap_subpipe(pid_t pid, char const *program)
|
|||||||
free(arguments);
|
free(arguments);
|
||||||
|
|
||||||
if (unlink(tmp_file_name[0]))
|
if (unlink(tmp_file_name[0]))
|
||||||
error(EXIT_FAILURE, 0, _("removing of '%s' failed"), tmp_file_name[0]);
|
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[0]);
|
||||||
if (unlink(tmp_file_name[1]))
|
if (unlink(tmp_file_name[1]))
|
||||||
error(EXIT_FAILURE, 0, _("removing of '%s' failed"), tmp_file_name[1]);
|
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[1]);
|
||||||
|
|
||||||
if (dup2(old_stdin, STDIN_FILENO) < 0)
|
if (dup2(old_stdin, STDIN_FILENO) < 0)
|
||||||
error(EXIT_FAILURE, 0, "restore of bison's stdin failed");
|
error(EXIT_FAILURE, 0, "restore of bison's stdin failed");
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
Copyright (C) 2005, 2006, 2007, 2008-2009 Free Software Foundation,
|
||||||
Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@
|
|||||||
# Sed script for additional DJGPP specific editing
|
# Sed script for additional DJGPP specific editing
|
||||||
# of the testsuite script generated by autoconf 2.61.
|
# of the testsuite script generated by autoconf 2.61.
|
||||||
|
|
||||||
# Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 2007, 2008-2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
*.info*
|
||||||
|
bison.1
|
||||||
|
bison.aux
|
||||||
|
bison.cp
|
||||||
|
bison.cps
|
||||||
|
bison.dvi
|
||||||
|
bison.fn
|
||||||
|
bison.help
|
||||||
|
bison.html
|
||||||
|
bison.ky
|
||||||
|
bison.log
|
||||||
|
bison.pdf
|
||||||
|
bison.pg
|
||||||
|
bison.ps
|
||||||
|
bison.toc
|
||||||
|
bison.tp
|
||||||
|
bison.vr
|
||||||
|
cross-options.texi
|
||||||
|
gendocs_template
|
||||||
|
refcard.dvi
|
||||||
|
refcard.log
|
||||||
|
refcard.ps
|
||||||
|
stamp-vti
|
||||||
|
version.texi
|
||||||
|
yacc.1
|
||||||
+1
-6
@@ -1,14 +1,11 @@
|
|||||||
/*.info*
|
/*.info*
|
||||||
/*~
|
|
||||||
/.dirstamp
|
|
||||||
/Makefile
|
|
||||||
/Makefile.in
|
|
||||||
/bison.1
|
/bison.1
|
||||||
/bison.aux
|
/bison.aux
|
||||||
/bison.cp
|
/bison.cp
|
||||||
/bison.cps
|
/bison.cps
|
||||||
/bison.dvi
|
/bison.dvi
|
||||||
/bison.fn
|
/bison.fn
|
||||||
|
/bison.help
|
||||||
/bison.html
|
/bison.html
|
||||||
/bison.ky
|
/bison.ky
|
||||||
/bison.log
|
/bison.log
|
||||||
@@ -19,9 +16,7 @@
|
|||||||
/bison.tp
|
/bison.tp
|
||||||
/bison.vr
|
/bison.vr
|
||||||
/cross-options.texi
|
/cross-options.texi
|
||||||
/fdl.texi
|
|
||||||
/gendocs_template
|
/gendocs_template
|
||||||
/gpl-3.0.texi
|
|
||||||
/refcard.dvi
|
/refcard.dvi
|
||||||
/refcard.log
|
/refcard.log
|
||||||
/refcard.ps
|
/refcard.ps
|
||||||
|
|||||||
+2
-2
@@ -391,7 +391,7 @@ EXCLUDE = @top_srcdir@/src/scan-gram.c \
|
|||||||
@top_builddir@/src/parse-*.[ch]
|
@top_builddir@/src/parse-*.[ch]
|
||||||
|
|
||||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||||
# directories that are symbolic links (a Unix file system feature) are
|
# directories that are symbolic links (a Unix filesystem feature) are
|
||||||
# excluded from the input.
|
# excluded from the input.
|
||||||
|
|
||||||
EXCLUDE_SYMLINKS = YES
|
EXCLUDE_SYMLINKS = YES
|
||||||
@@ -982,7 +982,7 @@ CLASS_GRAPH = YES
|
|||||||
COLLABORATION_GRAPH = YES
|
COLLABORATION_GRAPH = YES
|
||||||
|
|
||||||
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
|
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
|
||||||
# collaboration diagrams in a style similar to the OMG's Unified Modeling
|
# collaboration diagrams in a style similiar to the OMG's Unified Modeling
|
||||||
# Language.
|
# Language.
|
||||||
|
|
||||||
UML_LOOK = NO
|
UML_LOOK = NO
|
||||||
|
|||||||
-124
@@ -1,124 +0,0 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
|
||||||
|
|
||||||
## Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
AM_MAKEINFOFLAGS = --no-split
|
|
||||||
info_TEXINFOS = bison.texi
|
|
||||||
bison_TEXINFOS = $(srcdir)/cross-options.texi gpl-3.0.texi fdl.texi
|
|
||||||
|
|
||||||
CLEANFILES = bison.fns
|
|
||||||
CLEANDIRS = *.t2d
|
|
||||||
clean-local:
|
|
||||||
rm -rf $(CLEANDIRS)
|
|
||||||
|
|
||||||
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
|
||||||
$(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
|
|
||||||
$(AM_V_GEN)mv -f $@ $@~ || : >$@~
|
|
||||||
$(AM_V_at)rm -f $@.tmp
|
|
||||||
$(AM_V_at)cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
|
|
||||||
$(AM_V_at)$(top_builddir)/src/bison --help \
|
|
||||||
| perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
|
||||||
$(AM_V_at)diff -u $@~ $@.tmp || true
|
|
||||||
$(AM_V_at)mv $@.tmp $@
|
|
||||||
MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
|
|
||||||
|
|
||||||
## ---------- ##
|
|
||||||
## Ref card. ##
|
|
||||||
## ---------- ##
|
|
||||||
|
|
||||||
EXTRA_DIST = refcard.tex
|
|
||||||
CLEANFILES += refcard.dvi refcard.log refcard.ps
|
|
||||||
|
|
||||||
refcard.dvi: refcard.tex
|
|
||||||
$(AM_V_GEN)tex refcard.tex
|
|
||||||
|
|
||||||
refcard.ps: refcard.dvi
|
|
||||||
|
|
||||||
|
|
||||||
## ----------- ##
|
|
||||||
## Man Pages. ##
|
|
||||||
## ----------- ##
|
|
||||||
|
|
||||||
dist_man_MANS = $(srcdir)/bison.1
|
|
||||||
|
|
||||||
EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
|
|
||||||
MAINTAINERCLEANFILES += $(dist_man_MANS)
|
|
||||||
|
|
||||||
# Depend on configure to get version number changes.
|
|
||||||
common_dep = $(top_srcdir)/configure $(srcdir)/common.x
|
|
||||||
srcsrcdir = $(top_srcdir)/bin
|
|
||||||
$(srcdir)/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
|
|
||||||
|
|
||||||
# Differences to ignore when comparing the man page (the date).
|
|
||||||
remove_time_stamp = \
|
|
||||||
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
|
||||||
|
|
||||||
MOSTLYCLEANFILES = $(srcdir)/*.t
|
|
||||||
|
|
||||||
SUFFIXES = .x .1
|
|
||||||
|
|
||||||
PREPATH = $(top_builddir)/src
|
|
||||||
.x.1:
|
|
||||||
$(AM_V_GEN)program=`expr "/$*" : '.*/\(.*\)'` && \
|
|
||||||
save_IFS=$IFS; \
|
|
||||||
IFS=$(PATH_SEPARATOR); \
|
|
||||||
for dir in $(PREPATH); do \
|
|
||||||
IFS=$save_IFS; \
|
|
||||||
echo cd $$dir '&&' $(MAKE) $(AM_MAKEFLAGS) $$program && \
|
|
||||||
(cd $$dir && $(MAKE) $(AM_MAKEFLAGS) $$program) || exit; \
|
|
||||||
done
|
|
||||||
$(AM_V_at)PATH="$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \
|
|
||||||
export PATH; \
|
|
||||||
$(HELP2MAN) \
|
|
||||||
--include=$*.x \
|
|
||||||
--include=$(srcdir)/common.x \
|
|
||||||
--output=$@.t `echo '$*' | sed 's,.*/,,'`
|
|
||||||
$(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
|
|
||||||
$(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
|
|
||||||
touch $@; \
|
|
||||||
else \
|
|
||||||
mv $@.t $@; \
|
|
||||||
fi
|
|
||||||
$(AM_V_at)rm -f $@*.t
|
|
||||||
|
|
||||||
nodist_man_MANS = yacc.1
|
|
||||||
|
|
||||||
## -------------- ##
|
|
||||||
## Doxygenation. ##
|
|
||||||
## -------------- ##
|
|
||||||
|
|
||||||
DOXYGEN = doxygen
|
|
||||||
|
|
||||||
.PHONY: doc html
|
|
||||||
|
|
||||||
doc: html
|
|
||||||
|
|
||||||
html-local: Doxyfile
|
|
||||||
$(DOXYGEN)
|
|
||||||
|
|
||||||
edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
|
||||||
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
|
||||||
-e 's,@top_builddir\@,$(top_builddir),g' \
|
|
||||||
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
|
||||||
|
|
||||||
EXTRA_DIST += Doxyfile.in
|
|
||||||
CLEANFILES += Doxyfile
|
|
||||||
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
|
||||||
# configure, because the former is way faster than the latter.
|
|
||||||
Doxyfile: $(srcdir)/Doxyfile.in
|
|
||||||
$(AM_V_GEN)$(edit) $(srcdir)/Doxyfile.in >Doxyfile
|
|
||||||
|
|
||||||
CLEANDIRS += html latex
|
|
||||||
+2189
-3116
File diff suppressed because it is too large
Load Diff
@@ -53,3 +53,8 @@ are unique. When a long option takes an argument, like
|
|||||||
.BR \-\-file-prefix ,
|
.BR \-\-file-prefix ,
|
||||||
connect the option name and the argument with
|
connect the option name and the argument with
|
||||||
.BR = .
|
.BR = .
|
||||||
|
|
||||||
|
[see also]
|
||||||
|
.BR lex (1),
|
||||||
|
.BR flex (1),
|
||||||
|
.BR yacc (1).
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
[see also]
|
|
||||||
.BR lex (1),
|
|
||||||
.BR flex (1),
|
|
||||||
.BR yacc (1).
|
|
||||||
+451
@@ -0,0 +1,451 @@
|
|||||||
|
@c The GNU Free Documentation License.
|
||||||
|
@center Version 1.2, November 2002
|
||||||
|
|
||||||
|
@c This file is intended to be included within another document,
|
||||||
|
@c hence no sectioning command or @node.
|
||||||
|
|
||||||
|
@display
|
||||||
|
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
||||||
|
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
@end display
|
||||||
|
|
||||||
|
@enumerate 0
|
||||||
|
@item
|
||||||
|
PREAMBLE
|
||||||
|
|
||||||
|
The purpose of this License is to make a manual, textbook, or other
|
||||||
|
functional and useful document @dfn{free} in the sense of freedom: to
|
||||||
|
assure everyone the effective freedom to copy and redistribute it,
|
||||||
|
with or without modifying it, either commercially or noncommercially.
|
||||||
|
Secondarily, this License preserves for the author and publisher a way
|
||||||
|
to get credit for their work, while not being considered responsible
|
||||||
|
for modifications made by others.
|
||||||
|
|
||||||
|
This License is a kind of ``copyleft'', which means that derivative
|
||||||
|
works of the document must themselves be free in the same sense. It
|
||||||
|
complements the GNU General Public License, which is a copyleft
|
||||||
|
license designed for free software.
|
||||||
|
|
||||||
|
We have designed this License in order to use it for manuals for free
|
||||||
|
software, because free software needs free documentation: a free
|
||||||
|
program should come with manuals providing the same freedoms that the
|
||||||
|
software does. But this License is not limited to software manuals;
|
||||||
|
it can be used for any textual work, regardless of subject matter or
|
||||||
|
whether it is published as a printed book. We recommend this License
|
||||||
|
principally for works whose purpose is instruction or reference.
|
||||||
|
|
||||||
|
@item
|
||||||
|
APPLICABILITY AND DEFINITIONS
|
||||||
|
|
||||||
|
This License applies to any manual or other work, in any medium, that
|
||||||
|
contains a notice placed by the copyright holder saying it can be
|
||||||
|
distributed under the terms of this License. Such a notice grants a
|
||||||
|
world-wide, royalty-free license, unlimited in duration, to use that
|
||||||
|
work under the conditions stated herein. The ``Document'', below,
|
||||||
|
refers to any such manual or work. Any member of the public is a
|
||||||
|
licensee, and is addressed as ``you''. You accept the license if you
|
||||||
|
copy, modify or distribute the work in a way requiring permission
|
||||||
|
under copyright law.
|
||||||
|
|
||||||
|
A ``Modified Version'' of the Document means any work containing the
|
||||||
|
Document or a portion of it, either copied verbatim, or with
|
||||||
|
modifications and/or translated into another language.
|
||||||
|
|
||||||
|
A ``Secondary Section'' is a named appendix or a front-matter section
|
||||||
|
of the Document that deals exclusively with the relationship of the
|
||||||
|
publishers or authors of the Document to the Document's overall
|
||||||
|
subject (or to related matters) and contains nothing that could fall
|
||||||
|
directly within that overall subject. (Thus, if the Document is in
|
||||||
|
part a textbook of mathematics, a Secondary Section may not explain
|
||||||
|
any mathematics.) The relationship could be a matter of historical
|
||||||
|
connection with the subject or with related matters, or of legal,
|
||||||
|
commercial, philosophical, ethical or political position regarding
|
||||||
|
them.
|
||||||
|
|
||||||
|
The ``Invariant Sections'' are certain Secondary Sections whose titles
|
||||||
|
are designated, as being those of Invariant Sections, in the notice
|
||||||
|
that says that the Document is released under this License. If a
|
||||||
|
section does not fit the above definition of Secondary then it is not
|
||||||
|
allowed to be designated as Invariant. The Document may contain zero
|
||||||
|
Invariant Sections. If the Document does not identify any Invariant
|
||||||
|
Sections then there are none.
|
||||||
|
|
||||||
|
The ``Cover Texts'' are certain short passages of text that are listed,
|
||||||
|
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
|
||||||
|
the Document is released under this License. A Front-Cover Text may
|
||||||
|
be at most 5 words, and a Back-Cover Text may be at most 25 words.
|
||||||
|
|
||||||
|
A ``Transparent'' copy of the Document means a machine-readable copy,
|
||||||
|
represented in a format whose specification is available to the
|
||||||
|
general public, that is suitable for revising the document
|
||||||
|
straightforwardly with generic text editors or (for images composed of
|
||||||
|
pixels) generic paint programs or (for drawings) some widely available
|
||||||
|
drawing editor, and that is suitable for input to text formatters or
|
||||||
|
for automatic translation to a variety of formats suitable for input
|
||||||
|
to text formatters. A copy made in an otherwise Transparent file
|
||||||
|
format whose markup, or absence of markup, has been arranged to thwart
|
||||||
|
or discourage subsequent modification by readers is not Transparent.
|
||||||
|
An image format is not Transparent if used for any substantial amount
|
||||||
|
of text. A copy that is not ``Transparent'' is called ``Opaque''.
|
||||||
|
|
||||||
|
Examples of suitable formats for Transparent copies include plain
|
||||||
|
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
|
||||||
|
format, @acronym{SGML} or @acronym{XML} using a publicly available
|
||||||
|
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
|
||||||
|
PostScript or @acronym{PDF} designed for human modification. Examples
|
||||||
|
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
|
||||||
|
@acronym{JPG}. Opaque formats include proprietary formats that can be
|
||||||
|
read and edited only by proprietary word processors, @acronym{SGML} or
|
||||||
|
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
|
||||||
|
not generally available, and the machine-generated @acronym{HTML},
|
||||||
|
PostScript or @acronym{PDF} produced by some word processors for
|
||||||
|
output purposes only.
|
||||||
|
|
||||||
|
The ``Title Page'' means, for a printed book, the title page itself,
|
||||||
|
plus such following pages as are needed to hold, legibly, the material
|
||||||
|
this License requires to appear in the title page. For works in
|
||||||
|
formats which do not have any title page as such, ``Title Page'' means
|
||||||
|
the text near the most prominent appearance of the work's title,
|
||||||
|
preceding the beginning of the body of the text.
|
||||||
|
|
||||||
|
A section ``Entitled XYZ'' means a named subunit of the Document whose
|
||||||
|
title either is precisely XYZ or contains XYZ in parentheses following
|
||||||
|
text that translates XYZ in another language. (Here XYZ stands for a
|
||||||
|
specific section name mentioned below, such as ``Acknowledgements'',
|
||||||
|
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
|
||||||
|
of such a section when you modify the Document means that it remains a
|
||||||
|
section ``Entitled XYZ'' according to this definition.
|
||||||
|
|
||||||
|
The Document may include Warranty Disclaimers next to the notice which
|
||||||
|
states that this License applies to the Document. These Warranty
|
||||||
|
Disclaimers are considered to be included by reference in this
|
||||||
|
License, but only as regards disclaiming warranties: any other
|
||||||
|
implication that these Warranty Disclaimers may have is void and has
|
||||||
|
no effect on the meaning of this License.
|
||||||
|
|
||||||
|
@item
|
||||||
|
VERBATIM COPYING
|
||||||
|
|
||||||
|
You may copy and distribute the Document in any medium, either
|
||||||
|
commercially or noncommercially, provided that this License, the
|
||||||
|
copyright notices, and the license notice saying this License applies
|
||||||
|
to the Document are reproduced in all copies, and that you add no other
|
||||||
|
conditions whatsoever to those of this License. You may not use
|
||||||
|
technical measures to obstruct or control the reading or further
|
||||||
|
copying of the copies you make or distribute. However, you may accept
|
||||||
|
compensation in exchange for copies. If you distribute a large enough
|
||||||
|
number of copies you must also follow the conditions in section 3.
|
||||||
|
|
||||||
|
You may also lend copies, under the same conditions stated above, and
|
||||||
|
you may publicly display copies.
|
||||||
|
|
||||||
|
@item
|
||||||
|
COPYING IN QUANTITY
|
||||||
|
|
||||||
|
If you publish printed copies (or copies in media that commonly have
|
||||||
|
printed covers) of the Document, numbering more than 100, and the
|
||||||
|
Document's license notice requires Cover Texts, you must enclose the
|
||||||
|
copies in covers that carry, clearly and legibly, all these Cover
|
||||||
|
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
||||||
|
the back cover. Both covers must also clearly and legibly identify
|
||||||
|
you as the publisher of these copies. The front cover must present
|
||||||
|
the full title with all words of the title equally prominent and
|
||||||
|
visible. You may add other material on the covers in addition.
|
||||||
|
Copying with changes limited to the covers, as long as they preserve
|
||||||
|
the title of the Document and satisfy these conditions, can be treated
|
||||||
|
as verbatim copying in other respects.
|
||||||
|
|
||||||
|
If the required texts for either cover are too voluminous to fit
|
||||||
|
legibly, you should put the first ones listed (as many as fit
|
||||||
|
reasonably) on the actual cover, and continue the rest onto adjacent
|
||||||
|
pages.
|
||||||
|
|
||||||
|
If you publish or distribute Opaque copies of the Document numbering
|
||||||
|
more than 100, you must either include a machine-readable Transparent
|
||||||
|
copy along with each Opaque copy, or state in or with each Opaque copy
|
||||||
|
a computer-network location from which the general network-using
|
||||||
|
public has access to download using public-standard network protocols
|
||||||
|
a complete Transparent copy of the Document, free of added material.
|
||||||
|
If you use the latter option, you must take reasonably prudent steps,
|
||||||
|
when you begin distribution of Opaque copies in quantity, to ensure
|
||||||
|
that this Transparent copy will remain thus accessible at the stated
|
||||||
|
location until at least one year after the last time you distribute an
|
||||||
|
Opaque copy (directly or through your agents or retailers) of that
|
||||||
|
edition to the public.
|
||||||
|
|
||||||
|
It is requested, but not required, that you contact the authors of the
|
||||||
|
Document well before redistributing any large number of copies, to give
|
||||||
|
them a chance to provide you with an updated version of the Document.
|
||||||
|
|
||||||
|
@item
|
||||||
|
MODIFICATIONS
|
||||||
|
|
||||||
|
You may copy and distribute a Modified Version of the Document under
|
||||||
|
the conditions of sections 2 and 3 above, provided that you release
|
||||||
|
the Modified Version under precisely this License, with the Modified
|
||||||
|
Version filling the role of the Document, thus licensing distribution
|
||||||
|
and modification of the Modified Version to whoever possesses a copy
|
||||||
|
of it. In addition, you must do these things in the Modified Version:
|
||||||
|
|
||||||
|
@enumerate A
|
||||||
|
@item
|
||||||
|
Use in the Title Page (and on the covers, if any) a title distinct
|
||||||
|
from that of the Document, and from those of previous versions
|
||||||
|
(which should, if there were any, be listed in the History section
|
||||||
|
of the Document). You may use the same title as a previous version
|
||||||
|
if the original publisher of that version gives permission.
|
||||||
|
|
||||||
|
@item
|
||||||
|
List on the Title Page, as authors, one or more persons or entities
|
||||||
|
responsible for authorship of the modifications in the Modified
|
||||||
|
Version, together with at least five of the principal authors of the
|
||||||
|
Document (all of its principal authors, if it has fewer than five),
|
||||||
|
unless they release you from this requirement.
|
||||||
|
|
||||||
|
@item
|
||||||
|
State on the Title page the name of the publisher of the
|
||||||
|
Modified Version, as the publisher.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Preserve all the copyright notices of the Document.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Add an appropriate copyright notice for your modifications
|
||||||
|
adjacent to the other copyright notices.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Include, immediately after the copyright notices, a license notice
|
||||||
|
giving the public permission to use the Modified Version under the
|
||||||
|
terms of this License, in the form shown in the Addendum below.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Preserve in that license notice the full lists of Invariant Sections
|
||||||
|
and required Cover Texts given in the Document's license notice.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Include an unaltered copy of this License.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Preserve the section Entitled ``History'', Preserve its Title, and add
|
||||||
|
to it an item stating at least the title, year, new authors, and
|
||||||
|
publisher of the Modified Version as given on the Title Page. If
|
||||||
|
there is no section Entitled ``History'' in the Document, create one
|
||||||
|
stating the title, year, authors, and publisher of the Document as
|
||||||
|
given on its Title Page, then add an item describing the Modified
|
||||||
|
Version as stated in the previous sentence.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Preserve the network location, if any, given in the Document for
|
||||||
|
public access to a Transparent copy of the Document, and likewise
|
||||||
|
the network locations given in the Document for previous versions
|
||||||
|
it was based on. These may be placed in the ``History'' section.
|
||||||
|
You may omit a network location for a work that was published at
|
||||||
|
least four years before the Document itself, or if the original
|
||||||
|
publisher of the version it refers to gives permission.
|
||||||
|
|
||||||
|
@item
|
||||||
|
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
|
||||||
|
the Title of the section, and preserve in the section all the
|
||||||
|
substance and tone of each of the contributor acknowledgements and/or
|
||||||
|
dedications given therein.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Preserve all the Invariant Sections of the Document,
|
||||||
|
unaltered in their text and in their titles. Section numbers
|
||||||
|
or the equivalent are not considered part of the section titles.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Delete any section Entitled ``Endorsements''. Such a section
|
||||||
|
may not be included in the Modified Version.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Do not retitle any existing section to be Entitled ``Endorsements'' or
|
||||||
|
to conflict in title with any Invariant Section.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Preserve any Warranty Disclaimers.
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
If the Modified Version includes new front-matter sections or
|
||||||
|
appendices that qualify as Secondary Sections and contain no material
|
||||||
|
copied from the Document, you may at your option designate some or all
|
||||||
|
of these sections as invariant. To do this, add their titles to the
|
||||||
|
list of Invariant Sections in the Modified Version's license notice.
|
||||||
|
These titles must be distinct from any other section titles.
|
||||||
|
|
||||||
|
You may add a section Entitled ``Endorsements'', provided it contains
|
||||||
|
nothing but endorsements of your Modified Version by various
|
||||||
|
parties---for example, statements of peer review or that the text has
|
||||||
|
been approved by an organization as the authoritative definition of a
|
||||||
|
standard.
|
||||||
|
|
||||||
|
You may add a passage of up to five words as a Front-Cover Text, and a
|
||||||
|
passage of up to 25 words as a Back-Cover Text, to the end of the list
|
||||||
|
of Cover Texts in the Modified Version. Only one passage of
|
||||||
|
Front-Cover Text and one of Back-Cover Text may be added by (or
|
||||||
|
through arrangements made by) any one entity. If the Document already
|
||||||
|
includes a cover text for the same cover, previously added by you or
|
||||||
|
by arrangement made by the same entity you are acting on behalf of,
|
||||||
|
you may not add another; but you may replace the old one, on explicit
|
||||||
|
permission from the previous publisher that added the old one.
|
||||||
|
|
||||||
|
The author(s) and publisher(s) of the Document do not by this License
|
||||||
|
give permission to use their names for publicity for or to assert or
|
||||||
|
imply endorsement of any Modified Version.
|
||||||
|
|
||||||
|
@item
|
||||||
|
COMBINING DOCUMENTS
|
||||||
|
|
||||||
|
You may combine the Document with other documents released under this
|
||||||
|
License, under the terms defined in section 4 above for modified
|
||||||
|
versions, provided that you include in the combination all of the
|
||||||
|
Invariant Sections of all of the original documents, unmodified, and
|
||||||
|
list them all as Invariant Sections of your combined work in its
|
||||||
|
license notice, and that you preserve all their Warranty Disclaimers.
|
||||||
|
|
||||||
|
The combined work need only contain one copy of this License, and
|
||||||
|
multiple identical Invariant Sections may be replaced with a single
|
||||||
|
copy. If there are multiple Invariant Sections with the same name but
|
||||||
|
different contents, make the title of each such section unique by
|
||||||
|
adding at the end of it, in parentheses, the name of the original
|
||||||
|
author or publisher of that section if known, or else a unique number.
|
||||||
|
Make the same adjustment to the section titles in the list of
|
||||||
|
Invariant Sections in the license notice of the combined work.
|
||||||
|
|
||||||
|
In the combination, you must combine any sections Entitled ``History''
|
||||||
|
in the various original documents, forming one section Entitled
|
||||||
|
``History''; likewise combine any sections Entitled ``Acknowledgements'',
|
||||||
|
and any sections Entitled ``Dedications''. You must delete all
|
||||||
|
sections Entitled ``Endorsements.''
|
||||||
|
|
||||||
|
@item
|
||||||
|
COLLECTIONS OF DOCUMENTS
|
||||||
|
|
||||||
|
You may make a collection consisting of the Document and other documents
|
||||||
|
released under this License, and replace the individual copies of this
|
||||||
|
License in the various documents with a single copy that is included in
|
||||||
|
the collection, provided that you follow the rules of this License for
|
||||||
|
verbatim copying of each of the documents in all other respects.
|
||||||
|
|
||||||
|
You may extract a single document from such a collection, and distribute
|
||||||
|
it individually under this License, provided you insert a copy of this
|
||||||
|
License into the extracted document, and follow this License in all
|
||||||
|
other respects regarding verbatim copying of that document.
|
||||||
|
|
||||||
|
@item
|
||||||
|
AGGREGATION WITH INDEPENDENT WORKS
|
||||||
|
|
||||||
|
A compilation of the Document or its derivatives with other separate
|
||||||
|
and independent documents or works, in or on a volume of a storage or
|
||||||
|
distribution medium, is called an ``aggregate'' if the copyright
|
||||||
|
resulting from the compilation is not used to limit the legal rights
|
||||||
|
of the compilation's users beyond what the individual works permit.
|
||||||
|
When the Document is included in an aggregate, this License does not
|
||||||
|
apply to the other works in the aggregate which are not themselves
|
||||||
|
derivative works of the Document.
|
||||||
|
|
||||||
|
If the Cover Text requirement of section 3 is applicable to these
|
||||||
|
copies of the Document, then if the Document is less than one half of
|
||||||
|
the entire aggregate, the Document's Cover Texts may be placed on
|
||||||
|
covers that bracket the Document within the aggregate, or the
|
||||||
|
electronic equivalent of covers if the Document is in electronic form.
|
||||||
|
Otherwise they must appear on printed covers that bracket the whole
|
||||||
|
aggregate.
|
||||||
|
|
||||||
|
@item
|
||||||
|
TRANSLATION
|
||||||
|
|
||||||
|
Translation is considered a kind of modification, so you may
|
||||||
|
distribute translations of the Document under the terms of section 4.
|
||||||
|
Replacing Invariant Sections with translations requires special
|
||||||
|
permission from their copyright holders, but you may include
|
||||||
|
translations of some or all Invariant Sections in addition to the
|
||||||
|
original versions of these Invariant Sections. You may include a
|
||||||
|
translation of this License, and all the license notices in the
|
||||||
|
Document, and any Warranty Disclaimers, provided that you also include
|
||||||
|
the original English version of this License and the original versions
|
||||||
|
of those notices and disclaimers. In case of a disagreement between
|
||||||
|
the translation and the original version of this License or a notice
|
||||||
|
or disclaimer, the original version will prevail.
|
||||||
|
|
||||||
|
If a section in the Document is Entitled ``Acknowledgements'',
|
||||||
|
``Dedications'', or ``History'', the requirement (section 4) to Preserve
|
||||||
|
its Title (section 1) will typically require changing the actual
|
||||||
|
title.
|
||||||
|
|
||||||
|
@item
|
||||||
|
TERMINATION
|
||||||
|
|
||||||
|
You may not copy, modify, sublicense, or distribute the Document except
|
||||||
|
as expressly provided for under this License. Any other attempt to
|
||||||
|
copy, modify, sublicense or distribute the Document is void, and will
|
||||||
|
automatically terminate your rights under this License. However,
|
||||||
|
parties who have received copies, or rights, from you under this
|
||||||
|
License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
@item
|
||||||
|
FUTURE REVISIONS OF THIS LICENSE
|
||||||
|
|
||||||
|
The Free Software Foundation may publish new, revised versions
|
||||||
|
of the GNU Free Documentation License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns. See
|
||||||
|
@uref{http://www.gnu.org/copyleft/}.
|
||||||
|
|
||||||
|
Each version of the License is given a distinguishing version number.
|
||||||
|
If the Document specifies that a particular numbered version of this
|
||||||
|
License ``or any later version'' applies to it, you have the option of
|
||||||
|
following the terms and conditions either of that specified version or
|
||||||
|
of any later version that has been published (not as a draft) by the
|
||||||
|
Free Software Foundation. If the Document does not specify a version
|
||||||
|
number of this License, you may choose any version ever published (not
|
||||||
|
as a draft) by the Free Software Foundation.
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
@page
|
||||||
|
@heading ADDENDUM: How to use this License for your documents
|
||||||
|
|
||||||
|
To use this License in a document you have written, include a copy of
|
||||||
|
the License in the document and put the following copyright and
|
||||||
|
license notices just after the title page:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
@group
|
||||||
|
Copyright (C) @var{year} @var{your name}.
|
||||||
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
|
under the terms of the GNU Free Documentation License, Version 1.2
|
||||||
|
or any later version published by the Free Software Foundation;
|
||||||
|
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||||
|
Texts. A copy of the license is included in the section entitled ``GNU
|
||||||
|
Free Documentation License''.
|
||||||
|
@end group
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
||||||
|
replace the ``with@dots{}Texts.'' line with this:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
@group
|
||||||
|
with the Invariant Sections being @var{list their titles}, with
|
||||||
|
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
|
||||||
|
being @var{list}.
|
||||||
|
@end group
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
If you have Invariant Sections without Cover Texts, or some other
|
||||||
|
combination of the three, merge those two alternatives to suit the
|
||||||
|
situation.
|
||||||
|
|
||||||
|
If your document contains nontrivial examples of program code, we
|
||||||
|
recommend releasing these examples in parallel under your choice of
|
||||||
|
free software license, such as the GNU General Public License,
|
||||||
|
to permit their use in free software.
|
||||||
|
|
||||||
|
@c Local Variables:
|
||||||
|
@c ispell-local-pdict: "ispell-dict"
|
||||||
|
@c End:
|
||||||
|
|
||||||
@@ -0,0 +1,717 @@
|
|||||||
|
@c The GNU General Public License.
|
||||||
|
@center Version 3, 29 June 2007
|
||||||
|
|
||||||
|
@c This file is intended to be included within another document,
|
||||||
|
@c hence no sectioning command or @node.
|
||||||
|
|
||||||
|
@display
|
||||||
|
Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
|
license document, but changing it is not allowed.
|
||||||
|
@end display
|
||||||
|
|
||||||
|
@heading Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom
|
||||||
|
to share and change all versions of a program---to make sure it remains
|
||||||
|
free software for all its users. We, the Free Software Foundation,
|
||||||
|
use the GNU General Public License for most of our software; it
|
||||||
|
applies also to any other work released this way by its authors. You
|
||||||
|
can apply it to your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you
|
||||||
|
have certain responsibilities if you distribute copies of the
|
||||||
|
software, or if you modify it: responsibilities to respect the freedom
|
||||||
|
of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too,
|
||||||
|
receive or can get the source code. And you must show them these
|
||||||
|
terms so they know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the
|
||||||
|
manufacturer can do so. This is fundamentally incompatible with the
|
||||||
|
aim of protecting users' freedom to change the software. The
|
||||||
|
systematic pattern of such abuse occurs in the area of products for
|
||||||
|
individuals to use, which is precisely where it is most unacceptable.
|
||||||
|
Therefore, we have designed this version of the GPL to prohibit the
|
||||||
|
practice for those products. If such problems arise substantially in
|
||||||
|
other domains, we stand ready to extend this provision to those
|
||||||
|
domains in future versions of the GPL, as needed to protect the
|
||||||
|
freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish
|
||||||
|
to avoid the special danger that patents applied to a free program
|
||||||
|
could make it effectively proprietary. To prevent this, the GPL
|
||||||
|
assures that patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
@heading TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
@enumerate 0
|
||||||
|
@item Definitions.
|
||||||
|
|
||||||
|
``This License'' refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
``Copyright'' also means copyright-like laws that apply to other kinds
|
||||||
|
of works, such as semiconductor masks.
|
||||||
|
|
||||||
|
``The Program'' refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as ``you''. ``Licensees'' and
|
||||||
|
``recipients'' may be individuals or organizations.
|
||||||
|
|
||||||
|
To ``modify'' a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of
|
||||||
|
an exact copy. The resulting work is called a ``modified version'' of
|
||||||
|
the earlier work or a work ``based on'' the earlier work.
|
||||||
|
|
||||||
|
A ``covered work'' means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To ``propagate'' a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To ``convey'' a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user
|
||||||
|
through a computer network, with no transfer of a copy, is not
|
||||||
|
conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays ``Appropriate Legal Notices'' to
|
||||||
|
the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
@item Source Code.
|
||||||
|
|
||||||
|
The ``source code'' for a work means the preferred form of the work for
|
||||||
|
making modifications to it. ``Object code'' means any non-source form
|
||||||
|
of a work.
|
||||||
|
|
||||||
|
A ``Standard Interface'' means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The ``System Libraries'' of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
``Major Component'', in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The ``Corresponding Source'' for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users can
|
||||||
|
regenerate automatically from other parts of the Corresponding Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that same
|
||||||
|
work.
|
||||||
|
|
||||||
|
@item Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not convey,
|
||||||
|
without conditions so long as your license otherwise remains in force.
|
||||||
|
You may convey covered works to others for the sole purpose of having
|
||||||
|
them make modifications exclusively for you, or provide you with
|
||||||
|
facilities for running those works, provided that you comply with the
|
||||||
|
terms of this License in conveying all material for which you do not
|
||||||
|
control copyright. Those thus making or running the covered works for
|
||||||
|
you must do so exclusively on your behalf, under your direction and
|
||||||
|
control, on terms that prohibit them from making any copies of your
|
||||||
|
copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under the
|
||||||
|
conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
@item Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such
|
||||||
|
circumvention is effected by exercising rights under this License with
|
||||||
|
respect to the covered work, and you disclaim any intention to limit
|
||||||
|
operation or modification of the work as a means of enforcing, against
|
||||||
|
the work's users, your or third parties' legal rights to forbid
|
||||||
|
circumvention of technological measures.
|
||||||
|
|
||||||
|
@item Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
@item Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these
|
||||||
|
conditions:
|
||||||
|
|
||||||
|
@enumerate a
|
||||||
|
@item
|
||||||
|
The work must carry prominent notices stating that you modified it,
|
||||||
|
and giving a relevant date.
|
||||||
|
|
||||||
|
@item
|
||||||
|
The work must carry prominent notices stating that it is released
|
||||||
|
under this License and any conditions added under section 7. This
|
||||||
|
requirement modifies the requirement in section 4 to ``keep intact all
|
||||||
|
notices''.
|
||||||
|
|
||||||
|
@item
|
||||||
|
You must license the entire work, as a whole, under this License to
|
||||||
|
anyone who comes into possession of a copy. This License will
|
||||||
|
therefore apply, along with any applicable section 7 additional terms,
|
||||||
|
to the whole of the work, and all its parts, regardless of how they
|
||||||
|
are packaged. This License gives no permission to license the work in
|
||||||
|
any other way, but it does not invalidate such permission if you have
|
||||||
|
separately received it.
|
||||||
|
|
||||||
|
@item
|
||||||
|
If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your work
|
||||||
|
need not make them do so.
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
``aggregate'' if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
@item Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms of
|
||||||
|
sections 4 and 5, provided that you also convey the machine-readable
|
||||||
|
Corresponding Source under the terms of this License, in one of these
|
||||||
|
ways:
|
||||||
|
|
||||||
|
@enumerate a
|
||||||
|
@item
|
||||||
|
Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium customarily
|
||||||
|
used for software interchange.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a written
|
||||||
|
offer, valid for at least three years and valid for as long as you
|
||||||
|
offer spare parts or customer support for that product model, to give
|
||||||
|
anyone who possesses the object code either (1) a copy of the
|
||||||
|
Corresponding Source for all the software in the product that is
|
||||||
|
covered by this License, on a durable physical medium customarily used
|
||||||
|
for software interchange, for a price no more than your reasonable
|
||||||
|
cost of physically performing this conveying of source, or (2) access
|
||||||
|
to copy the Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Convey individual copies of the object code with a copy of the written
|
||||||
|
offer to provide the Corresponding Source. This alternative is
|
||||||
|
allowed only occasionally and noncommercially, and only if you
|
||||||
|
received the object code with such an offer, in accord with subsection
|
||||||
|
6b.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Convey the object code by offering access from a designated place
|
||||||
|
(gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to copy
|
||||||
|
the object code is a network server, the Corresponding Source may be
|
||||||
|
on a different server (operated by you or a third party) that supports
|
||||||
|
equivalent copying facilities, provided you maintain clear directions
|
||||||
|
next to the object code saying where to find the Corresponding Source.
|
||||||
|
Regardless of what server hosts the Corresponding Source, you remain
|
||||||
|
obligated to ensure that it is available for as long as needed to
|
||||||
|
satisfy these requirements.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Convey the object code using peer-to-peer transmission, provided you
|
||||||
|
inform other peers where the object code and Corresponding Source of
|
||||||
|
the work are being offered to the general public at no charge under
|
||||||
|
subsection 6d.
|
||||||
|
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A ``User Product'' is either (1) a ``consumer product'', which means any
|
||||||
|
tangible personal property which is normally used for personal,
|
||||||
|
family, or household purposes, or (2) anything designed or sold for
|
||||||
|
incorporation into a dwelling. In determining whether a product is a
|
||||||
|
consumer product, doubtful cases shall be resolved in favor of
|
||||||
|
coverage. For a particular product received by a particular user,
|
||||||
|
``normally used'' refers to a typical or common use of that class of
|
||||||
|
product, regardless of the status of the particular user or of the way
|
||||||
|
in which the particular user actually uses, or expects or is expected
|
||||||
|
to use, the product. A product is a consumer product regardless of
|
||||||
|
whether the product has substantial commercial, industrial or
|
||||||
|
non-consumer uses, unless such uses represent the only significant
|
||||||
|
mode of use of the product.
|
||||||
|
|
||||||
|
``Installation Information'' for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to
|
||||||
|
install and execute modified versions of a covered work in that User
|
||||||
|
Product from a modified version of its Corresponding Source. The
|
||||||
|
information must suffice to ensure that the continued functioning of
|
||||||
|
the modified object code is in no case prevented or interfered with
|
||||||
|
solely because modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or
|
||||||
|
updates for a work that has been modified or installed by the
|
||||||
|
recipient, or for the User Product in which it has been modified or
|
||||||
|
installed. Access to a network may be denied when the modification
|
||||||
|
itself materially and adversely affects the operation of the network
|
||||||
|
or violates the rules and protocols for communication across the
|
||||||
|
network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
@item Additional Terms.
|
||||||
|
|
||||||
|
``Additional permissions'' are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders
|
||||||
|
of that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
@enumerate a
|
||||||
|
@item
|
||||||
|
Disclaiming warranty or limiting liability differently from the terms
|
||||||
|
of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Requiring preservation of specified reasonable legal notices or author
|
||||||
|
attributions in that material or in the Appropriate Legal Notices
|
||||||
|
displayed by works containing it; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Declining to grant rights under trademark law for use of some trade
|
||||||
|
names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Requiring indemnification of licensors and authors of that material by
|
||||||
|
anyone who conveys the material (or modified versions of it) with
|
||||||
|
contractual assumptions of liability to the recipient, for any
|
||||||
|
liability that these contractual assumptions directly impose on those
|
||||||
|
licensors and authors.
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered ``further
|
||||||
|
restrictions'' within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions; the
|
||||||
|
above requirements apply either way.
|
||||||
|
|
||||||
|
@item Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your license
|
||||||
|
from a particular copyright holder is reinstated (a) provisionally,
|
||||||
|
unless and until the copyright holder explicitly and finally
|
||||||
|
terminates your license, and (b) permanently, if the copyright holder
|
||||||
|
fails to notify you of the violation by some reasonable means prior to
|
||||||
|
60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
@item Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or run
|
||||||
|
a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
@item Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An ``entity transaction'' is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
@item Patents.
|
||||||
|
|
||||||
|
A ``contributor'' is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's ``contributor version''.
|
||||||
|
|
||||||
|
A contributor's ``essential patent claims'' are all patent claims owned
|
||||||
|
or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, ``control'' includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a ``patent license'' is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To ``grant'' such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. ``Knowingly relying'' means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is ``discriminatory'' if it does not include within the
|
||||||
|
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||||
|
the non-exercise of one or more of the rights that are specifically
|
||||||
|
granted under this License. You may not convey a covered work if you
|
||||||
|
are a party to an arrangement with a third party that is in the
|
||||||
|
business of distributing software, under which you make payment to the
|
||||||
|
third party based on the extent of your activity of conveying the
|
||||||
|
work, and under which the third party grants, to any of the parties
|
||||||
|
who would receive the covered work from you, a discriminatory patent
|
||||||
|
license (a) in connection with copies of the covered work conveyed by
|
||||||
|
you (or copies made from those copies), or (b) primarily for and in
|
||||||
|
connection with specific products or compilations that contain the
|
||||||
|
covered work, unless you entered into that arrangement, or that patent
|
||||||
|
license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
@item No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey
|
||||||
|
a covered work so as to satisfy simultaneously your obligations under
|
||||||
|
this License and any other pertinent obligations, then as a
|
||||||
|
consequence you may not convey it at all. For example, if you agree
|
||||||
|
to terms that obligate you to collect a royalty for further conveying
|
||||||
|
from those to whom you convey the Program, the only way you could
|
||||||
|
satisfy both those terms and this License would be to refrain entirely
|
||||||
|
from conveying the Program.
|
||||||
|
|
||||||
|
@item Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
@item Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies that a certain numbered version of the GNU General Public
|
||||||
|
License ``or any later version'' applies to it, you have the option of
|
||||||
|
following the terms and conditions either of that numbered version or
|
||||||
|
of any later version published by the Free Software Foundation. If
|
||||||
|
the Program does not specify a version number of the GNU General
|
||||||
|
Public License, you may choose any version ever published by the Free
|
||||||
|
Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future versions
|
||||||
|
of the GNU General Public License can be used, that proxy's public
|
||||||
|
statement of acceptance of a version permanently authorizes you to
|
||||||
|
choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
@item Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
|
||||||
|
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||||
|
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||||
|
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||||
|
CORRECTION.
|
||||||
|
|
||||||
|
@item Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||||
|
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||||
|
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||||
|
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||||
|
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||||
|
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||||
|
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
@item Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
@heading END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
@heading How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these
|
||||||
|
terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the ``copyright'' line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
@var{one line to give the program's name and a brief idea of what it does.}
|
||||||
|
Copyright (C) @var{year} @var{name of author}
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or (at
|
||||||
|
your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see @url{http://www.gnu.org/licenses/}.
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
@var{program} Copyright (C) @var{year} @var{name of author}
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type @samp{show c} for details.
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
The hypothetical commands @samp{show w} and @samp{show c} should show
|
||||||
|
the appropriate parts of the General Public License. Of course, your
|
||||||
|
program's commands might be different; for a GUI interface, you would
|
||||||
|
use an ``about box''.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a ``copyright disclaimer'' for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
@url{http://www.gnu.org/licenses/}.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your
|
||||||
|
program into proprietary programs. If your program is a subroutine
|
||||||
|
library, you may consider it more useful to permit linking proprietary
|
||||||
|
applications with the library. If this is what you want to do, use
|
||||||
|
the GNU Lesser General Public License instead of this License. But
|
||||||
|
first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
|
||||||
+143
@@ -0,0 +1,143 @@
|
|||||||
|
## Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009
|
||||||
|
## Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
## This program is free software: you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
AM_MAKEINFOFLAGS = --no-split
|
||||||
|
info_TEXINFOS = doc/bison.texinfo
|
||||||
|
doc_bison_TEXINFOS = \
|
||||||
|
$(CROSS_OPTIONS_TEXI) \
|
||||||
|
doc/fdl.texi \
|
||||||
|
doc/gpl-3.0.texi
|
||||||
|
|
||||||
|
CLEANFILES = doc/bison.fns
|
||||||
|
CLEANDIRS = doc/*.t2d
|
||||||
|
clean-local:
|
||||||
|
rm -rf $(CLEANDIRS)
|
||||||
|
|
||||||
|
MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t
|
||||||
|
|
||||||
|
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
||||||
|
CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi
|
||||||
|
$(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL)
|
||||||
|
# Create $@~ which is the previous contents. Don't use `mv' here so
|
||||||
|
# that even if we are interrupted, the file is still available for
|
||||||
|
# diff in the next run. Note that $@ might not exist yet.
|
||||||
|
{ test ! -f $@ || cat $@; } >$@~
|
||||||
|
test ! -f $@.tmp || rm -f $@.tmp
|
||||||
|
src/bison$(EXEEXT) --help | \
|
||||||
|
perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
||||||
|
diff -u $@~ $@.tmp || true
|
||||||
|
mv $@.tmp $@
|
||||||
|
MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI)
|
||||||
|
|
||||||
|
## ---------- ##
|
||||||
|
## Ref card. ##
|
||||||
|
## ---------- ##
|
||||||
|
|
||||||
|
EXTRA_DIST += doc/refcard.tex
|
||||||
|
CLEANFILES += doc/refcard.dvi doc/refcard.log doc/refcard.ps
|
||||||
|
|
||||||
|
doc/refcard.dvi: doc/refcard.tex
|
||||||
|
cd doc && tex refcard.tex
|
||||||
|
|
||||||
|
doc/refcard.ps: doc/refcard.dvi
|
||||||
|
|
||||||
|
|
||||||
|
## ---------------- ##
|
||||||
|
## doc/bison.help. ##
|
||||||
|
## ---------------- ##
|
||||||
|
|
||||||
|
# Some of our targets (cross-option.texi, bison.1) use "bison --help".
|
||||||
|
# Since we want to ship the generated file to avoid additional
|
||||||
|
# requirements over the user environment, we used not depend on
|
||||||
|
# src/bison itself, but on src/getargs.c and other files. Yet, we
|
||||||
|
# need "bison --help" to work to make help2man happy, so we used to
|
||||||
|
# include "make src/bison" in the commands. Then we may have a
|
||||||
|
# problem with concurrent builds, since one make might be aiming one
|
||||||
|
# of its jobs at compiling src/bison, and another job at generating
|
||||||
|
# the man page. If the latter is faster than the former, then we have
|
||||||
|
# two makes that concurrently try to compile src/bison. Doomed to
|
||||||
|
# failure.
|
||||||
|
#
|
||||||
|
# As a simple scheme to get our way out, make a stamp file,
|
||||||
|
# bison.help, which contains --version then --help. This file can
|
||||||
|
# depend on bison, which ensures its correctness. But update it
|
||||||
|
# *only* if needed (content changes). This way, we avoid useless
|
||||||
|
# compilations of cross-option.texi and bison.1. At the cost of
|
||||||
|
# repeated builds of bison.help.
|
||||||
|
|
||||||
|
EXTRA_DIST += $(top_srcdir)/doc/bison.help
|
||||||
|
MAINTAINERCLEANFILES += $(top_srcdir)/doc/bison.help
|
||||||
|
$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT)
|
||||||
|
$< --version >doc/bison.help.t
|
||||||
|
$< --help >>doc/bison.help.t
|
||||||
|
$(top_srcdir)/build-aux/move-if-change doc/bison.help.t $@
|
||||||
|
|
||||||
|
|
||||||
|
## ----------- ##
|
||||||
|
## Man Pages. ##
|
||||||
|
## ----------- ##
|
||||||
|
|
||||||
|
dist_man_MANS = $(top_srcdir)/doc/bison.1
|
||||||
|
|
||||||
|
EXTRA_DIST += $(dist_man_MANS:.1=.x)
|
||||||
|
MAINTAINERCLEANFILES += $(dist_man_MANS)
|
||||||
|
|
||||||
|
# Differences to ignore when comparing the man page (the date).
|
||||||
|
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
|
||||||
|
@echo "Updating man page $@"
|
||||||
|
$(HELP2MAN) \
|
||||||
|
--include=$(top_srcdir)/doc/bison.x \
|
||||||
|
--output=$@.t src/bison$(EXEEXT)
|
||||||
|
if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
|
||||||
|
$(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
|
||||||
|
touch $@; \
|
||||||
|
else \
|
||||||
|
mv $@.t $@; \
|
||||||
|
fi
|
||||||
|
rm -f $@*.t
|
||||||
|
|
||||||
|
nodist_man_MANS = doc/yacc.1
|
||||||
|
|
||||||
|
## -------------- ##
|
||||||
|
## Doxygenation. ##
|
||||||
|
## -------------- ##
|
||||||
|
|
||||||
|
DOXYGEN = doxygen
|
||||||
|
|
||||||
|
.PHONY: doc html
|
||||||
|
|
||||||
|
doc: html
|
||||||
|
|
||||||
|
html-local: doc/Doxyfile
|
||||||
|
cd doc && $(DOXYGEN)
|
||||||
|
|
||||||
|
edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
||||||
|
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
||||||
|
-e 's,@top_builddir\@,$(top_builddir),g' \
|
||||||
|
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
||||||
|
|
||||||
|
EXTRA_DIST += doc/Doxyfile.in
|
||||||
|
CLEANFILES += doc/Doxyfile
|
||||||
|
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
||||||
|
# configure, because the former is way faster than the latter.
|
||||||
|
doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in
|
||||||
|
$(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile
|
||||||
|
|
||||||
|
CLEANDIRS += html latex
|
||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
\def\finalout{\overfullrule=0pt}
|
\def\finalout{\overfullrule=0pt}
|
||||||
%\finalout
|
%\finalout
|
||||||
|
|
||||||
% Copyright (c) 1998, 2001, 2009-2012 Free Software Foundation, Inc.
|
% Copyright (c) 1998, 2001, 2009 Free Software Foundation, Inc.
|
||||||
%
|
%
|
||||||
% This file is part of Bison.
|
% This file is part of Bison.
|
||||||
%
|
%
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
bench.pl
|
||||||
@@ -1,3 +1 @@
|
|||||||
/Makefile
|
|
||||||
/Makefile.in
|
|
||||||
/bench.pl
|
/bench.pl
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
## Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
nodist_noinst_SCRIPTS = bench.pl
|
|
||||||
+4
-1
@@ -1,3 +1,6 @@
|
|||||||
|
A directory of tools provided to people using CVS Bison. None of
|
||||||
|
these is distributed.
|
||||||
|
|
||||||
* bench.pl
|
* bench.pl
|
||||||
A primitive Perl script to run benches. Currently its only bench is
|
A primitive Perl script to run benches. Currently its only bench is
|
||||||
the usual calculator: it has a lightweight processing part (but not
|
the usual calculator: it has a lightweight processing part (but not
|
||||||
@@ -16,7 +19,7 @@ straightforward use of _build/src/bison would.)
|
|||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
|
Copyright (C) 2006, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+788
-35
@@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/perl -w
|
#! /usr/bin/perl -w
|
||||||
|
|
||||||
# Copyright (C) 2006, 2008-2012 Free Software Foundation, Inc.
|
# Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is part of Bison, the GNU Compiler Compiler.
|
# This file is part of Bison, the GNU Compiler Compiler.
|
||||||
#
|
#
|
||||||
@@ -17,17 +17,230 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use IO::File;
|
=head1 NAME
|
||||||
use Benchmark qw (:all);
|
|
||||||
|
|
||||||
my $bison = $ENV{'BISON'} || '@abs_top_builddir@/tests/bison';
|
bench.pl - bench marks for Bison parsers.
|
||||||
my $cc = $ENV{'CC'} || 'gcc';
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
./bench.pl [OPTIONS]... DIRECTIVES
|
||||||
|
|
||||||
|
=head1 DIRECTIVES
|
||||||
|
|
||||||
|
Specify the set of benches to run. The following grammar defines the
|
||||||
|
I<directives>:
|
||||||
|
|
||||||
|
directives ::=
|
||||||
|
directives | directives -- Alternation
|
||||||
|
| directives & directives -- Concatenation
|
||||||
|
| [ directives> ] -- Optional
|
||||||
|
| ( directives> ) -- Parentheses
|
||||||
|
| #d NAME[=VALUE] -- %code { #define NAME [VALUE] }
|
||||||
|
| %d NAME[=VALUE] -- %define NAME ["VALUE"]
|
||||||
|
| %s skeleton -- %skeleton "skeleton"
|
||||||
|
| directive
|
||||||
|
|
||||||
|
Parentheses only group to override precedence. For instance:
|
||||||
|
|
||||||
|
[ %debug ] & [ %error-verbose ] & [ %define variant ]
|
||||||
|
|
||||||
|
will generate eight different cases.
|
||||||
|
|
||||||
|
=head1 OPTIONS
|
||||||
|
|
||||||
|
=over 4
|
||||||
|
|
||||||
|
=item B<-b>, B<--bench>
|
||||||
|
|
||||||
|
Predefined benches, that is, combimation between a grammar and a I<directives>
|
||||||
|
request.
|
||||||
|
|
||||||
|
=over 4
|
||||||
|
|
||||||
|
=item I<push>
|
||||||
|
|
||||||
|
Test the push parser vs. the pull interface. Use the C parser.
|
||||||
|
|
||||||
|
=item I<variant>
|
||||||
|
|
||||||
|
Test the use of variants instead of union in the C++ parser.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=item B<-c>, B<--cflags>=I<flags>
|
||||||
|
|
||||||
|
Flags to pass to the C or C++ compiler. Defaults to -O2.
|
||||||
|
|
||||||
|
=item B<-d>, B<--directive>=I<directives>
|
||||||
|
|
||||||
|
Add a set of Bison directives to bench against each other.
|
||||||
|
|
||||||
|
=item B<-g>, B<--grammar>=I<grammar>
|
||||||
|
|
||||||
|
Select the base I<grammar> to use. Defaults to I<calc>.
|
||||||
|
|
||||||
|
=over 4
|
||||||
|
|
||||||
|
=item I<calc>
|
||||||
|
|
||||||
|
Traditional calculator.
|
||||||
|
|
||||||
|
=item I<list>
|
||||||
|
|
||||||
|
C++ grammar that uses std::string and std::list. Can be used with
|
||||||
|
or without %define variant.
|
||||||
|
|
||||||
|
=item I<triangular>
|
||||||
|
|
||||||
|
Artificial grammar with very long rules.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=item B<-h>, B<--help>
|
||||||
|
|
||||||
|
Display this message and exit succesfully. The more verbose, the more
|
||||||
|
details.
|
||||||
|
|
||||||
|
=item B<-i>, B<--iterations>=I<integer>
|
||||||
|
|
||||||
|
Say how many times a single test of the bench must be run. If
|
||||||
|
negative, specify the minimum number of CPU seconds to run. Defaults
|
||||||
|
to -1.
|
||||||
|
|
||||||
|
=item B<-q>, B<--quiet>
|
||||||
|
|
||||||
|
Decrease the verbosity level (defaults to 1).
|
||||||
|
|
||||||
|
=item B<-v>, B<--verbose>
|
||||||
|
|
||||||
|
Raise the verbosity level (defaults to 1).
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use IO::File;
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
sub triangular_grammar ($$$)
|
=head1 VARIABLES
|
||||||
|
|
||||||
|
=over 4
|
||||||
|
|
||||||
|
=item C<@bench>
|
||||||
|
|
||||||
|
The list of benches to run.
|
||||||
|
|
||||||
|
=item C<$bison>
|
||||||
|
|
||||||
|
The Bison program to use to compile the grammar.
|
||||||
|
|
||||||
|
=item C<$cc>
|
||||||
|
|
||||||
|
The C compiler.
|
||||||
|
|
||||||
|
=item C<$cxx>
|
||||||
|
|
||||||
|
The C++ compiler.
|
||||||
|
|
||||||
|
=item C<$cflags>
|
||||||
|
|
||||||
|
Compiler flags (C or C++).
|
||||||
|
|
||||||
|
=item C<@directive>
|
||||||
|
|
||||||
|
A list of directive sets to measure against each other.
|
||||||
|
|
||||||
|
=item C<$iterations>
|
||||||
|
|
||||||
|
The number of times the parser is run for a bench.
|
||||||
|
|
||||||
|
=item C<$verbose>
|
||||||
|
|
||||||
|
Verbosity level.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
my $bench;
|
||||||
|
my $bison = $ENV{'BISON'} || '@abs_top_builddir@/tests/bison';
|
||||||
|
my $cc = $ENV{'CC'} || 'gcc';
|
||||||
|
my $cxx = $ENV{'CXX'} || 'g++';
|
||||||
|
my $cflags = '-O2';
|
||||||
|
my @directive = ();
|
||||||
|
my $grammar = 'calc';
|
||||||
|
my $iterations = -1;
|
||||||
|
my $verbose = 1;
|
||||||
|
|
||||||
|
=head1 FUNCTIONS
|
||||||
|
|
||||||
|
=over 4
|
||||||
|
|
||||||
|
=item C<verbose($level, $message)>
|
||||||
|
|
||||||
|
Report the C<$message> is C<$level> E<lt>= C<$verbose>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub verbose($$)
|
||||||
{
|
{
|
||||||
my ($base, $max, $directives) = @_;
|
my ($level, $message) = @_;
|
||||||
|
print STDERR $message
|
||||||
|
if $level <= $verbose;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
=item C<directives($bench, @directive)>
|
||||||
|
|
||||||
|
Format the list of directives for Bison for bench named C<$bench>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub directives($@)
|
||||||
|
{
|
||||||
|
my ($bench, @directive) = @_;
|
||||||
|
my $res = "/* Directives for bench `$bench'. */\n";
|
||||||
|
$res .= join ("\n", @directive) . "\n";
|
||||||
|
$res .= "/* End of directives for bench `$bench'. */\n";
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
=item C<generate_grammar_triangular ($base, $max, @directive)>
|
||||||
|
|
||||||
|
Create a large triangular grammar which looks like :
|
||||||
|
|
||||||
|
input:
|
||||||
|
exp { if ($1 != 0) abort (); $$ = $1; }
|
||||||
|
| input exp { if ($2 != $1 + 1) abort (); $$ = $2; }
|
||||||
|
;
|
||||||
|
|
||||||
|
exp:
|
||||||
|
END { $$ = 0; }
|
||||||
|
| "1" END { $$ = 1; }
|
||||||
|
| "1" "2" END { $$ = 2; }
|
||||||
|
| "1" "2" "3" END { $$ = 3; }
|
||||||
|
| "1" "2" "3" "4" END { $$ = 4; }
|
||||||
|
| "1" "2" "3" "4" "5" END { $$ = 5; }
|
||||||
|
;
|
||||||
|
|
||||||
|
C<$base> is the base name for the file to create (F<$base.y>).
|
||||||
|
C<$max> is the number of such rules (here, 5). You may pass
|
||||||
|
additional Bison C<@directive>.
|
||||||
|
|
||||||
|
The created parser is self contained: it includes its scanner, and
|
||||||
|
source of input.
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub generate_grammar_triangular ($$@)
|
||||||
|
{
|
||||||
|
my ($base, $max, @directive) = @_;
|
||||||
|
my $directives = directives ($base, @directive);
|
||||||
|
|
||||||
my $out = new IO::File ">$base.y"
|
my $out = new IO::File ">$base.y"
|
||||||
or die;
|
or die;
|
||||||
@@ -41,6 +254,7 @@ sub triangular_grammar ($$$)
|
|||||||
static int yylex (void);
|
static int yylex (void);
|
||||||
static void yyerror (const char *msg);
|
static void yyerror (const char *msg);
|
||||||
%}
|
%}
|
||||||
|
$directives
|
||||||
%union
|
%union
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
@@ -112,6 +326,15 @@ EOF
|
|||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
|
=item C<calc_input ($base, $max)>
|
||||||
|
|
||||||
|
Generate the input file F<$base.input> for the calc parser. The input
|
||||||
|
is composed of two expressions. The first one is using left recursion
|
||||||
|
only and consumes no stack. The second one requires a deep stack.
|
||||||
|
These two expressions are repeated C<$max> times in the output file.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub calc_input ($$)
|
sub calc_input ($$)
|
||||||
{
|
{
|
||||||
my ($base, $max) = @_;
|
my ($base, $max) = @_;
|
||||||
@@ -126,16 +349,29 @@ sub calc_input ($$)
|
|||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
sub calc_grammar ($$$)
|
=item C<generate_grammar_calc ($base, $max, @directive)>
|
||||||
|
|
||||||
|
Generate a Bison file F<$base.y> for a calculator parser in C. Pass
|
||||||
|
the additional Bison C<@directive>. C<$max> is ignored, but left to
|
||||||
|
have the same interface as C<triangular_grammar>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub generate_grammar_calc ($$@)
|
||||||
{
|
{
|
||||||
my ($base, $max, $directives) = @_;
|
my ($base, $max, @directive) = @_;
|
||||||
|
my $directives = directives ($base, @directive);
|
||||||
|
|
||||||
|
# Putting this request here is stupid, since the input will be
|
||||||
|
# generated each time we generate a grammar.
|
||||||
|
calc_input ('calc', 200);
|
||||||
|
|
||||||
my $out = new IO::File ">$base.y"
|
my $out = new IO::File ">$base.y"
|
||||||
or die;
|
or die;
|
||||||
print $out <<EOF;
|
print $out <<EOF;
|
||||||
%{
|
%{
|
||||||
#include <assert.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -148,9 +384,9 @@ static semantic_value global_result = 0;
|
|||||||
static int global_count = 0;
|
static int global_count = 0;
|
||||||
%}
|
%}
|
||||||
|
|
||||||
/* Exercise %union. */
|
|
||||||
$directives
|
$directives
|
||||||
%error-verbose
|
%error-verbose
|
||||||
|
/* Exercise %union. */
|
||||||
%union
|
%union
|
||||||
{
|
{
|
||||||
semantic_value ival;
|
semantic_value ival;
|
||||||
@@ -291,8 +527,9 @@ yylex (void)
|
|||||||
static int
|
static int
|
||||||
power (int base, int exponent)
|
power (int base, int exponent)
|
||||||
{
|
{
|
||||||
assert (0 <= exponent);
|
|
||||||
int res = 1;
|
int res = 1;
|
||||||
|
if (exponent < 0)
|
||||||
|
exit (3);
|
||||||
for (/* Niente */; exponent; --exponent)
|
for (/* Niente */; exponent; --exponent)
|
||||||
res *= base;
|
res *= base;
|
||||||
return res;
|
return res;
|
||||||
@@ -326,44 +563,560 @@ EOF
|
|||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
|
=item C<generate_grammar_list ($base, $max, @directive)>
|
||||||
|
|
||||||
|
Generate a Bison file F<$base.y> for a C++ parser that uses C++
|
||||||
|
objects (std::string, std::list). Tailored for using %define variant.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub generate_grammar_list ($$@)
|
||||||
|
{
|
||||||
|
my ($base, $max, @directive) = @_;
|
||||||
|
my $directives = directives ($base, @directive);
|
||||||
|
my $variant = grep { /%define "?variant"?/ } @directive;
|
||||||
|
my $lex_symbol = grep { /%define "?lex_symbol"?/ } @directive;
|
||||||
|
my $out = new IO::File ">$base.y"
|
||||||
|
or die;
|
||||||
|
print $out <<EOF;
|
||||||
|
%language "C++"
|
||||||
|
%defines
|
||||||
|
%locations
|
||||||
|
$directives
|
||||||
|
|
||||||
|
%code requires // *.h
|
||||||
|
{
|
||||||
|
#include <string>
|
||||||
|
}
|
||||||
|
|
||||||
|
%code // *.c
|
||||||
|
{
|
||||||
|
#include <algorithm>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
#define STAGE_MAX ($max * 10) // max = $max
|
||||||
|
|
||||||
|
#define USE_LEX_SYMBOL $lex_symbol
|
||||||
|
#define USE_VARIANTS $variant
|
||||||
|
|
||||||
|
// Prototype of the yylex function providing subsequent tokens.
|
||||||
|
static
|
||||||
|
#if USE_LEX_SYMBOL
|
||||||
|
yy::parser::symbol_type yylex();
|
||||||
|
#else
|
||||||
|
yy::parser::token_type yylex(yy::parser::semantic_type* yylval,
|
||||||
|
yy::parser::location_type* yylloc);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Conversion to string.
|
||||||
|
template <typename T>
|
||||||
|
inline
|
||||||
|
std::string
|
||||||
|
string_cast (const T& t)
|
||||||
|
{
|
||||||
|
std::ostringstream o;
|
||||||
|
o << t;
|
||||||
|
return o.str ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%token END_OF_FILE 0
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if ($variant)
|
||||||
|
{
|
||||||
|
print $out <<'EOF';
|
||||||
|
%token <std::string> TEXT
|
||||||
|
%token <int> NUMBER
|
||||||
|
%printer { std::cerr << "Number: " << $$; } <int>
|
||||||
|
%printer { std::cerr << "Text: " << $$; } <std::string>
|
||||||
|
%type <std::string> text result
|
||||||
|
|
||||||
|
%%
|
||||||
|
result:
|
||||||
|
text { /* Throw away the result. */ }
|
||||||
|
;
|
||||||
|
|
||||||
|
text:
|
||||||
|
/* nothing */ { /* This will generate an empty string */ }
|
||||||
|
| text TEXT { std::swap ($$, $2); }
|
||||||
|
| text NUMBER { $$ = string_cast($2); }
|
||||||
|
;
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
# Not using Bison variants.
|
||||||
|
print $out <<'EOF';
|
||||||
|
%union {int ival; std::string* sval;}
|
||||||
|
%token <sval> TEXT
|
||||||
|
%token <ival> NUMBER
|
||||||
|
%printer { std::cerr << "Number: " << $$; } <ival>
|
||||||
|
%printer { std::cerr << "Text: " << *$$; } <sval>
|
||||||
|
%type <sval> text result
|
||||||
|
|
||||||
|
%%
|
||||||
|
result:
|
||||||
|
text { delete $1; }
|
||||||
|
;
|
||||||
|
|
||||||
|
text:
|
||||||
|
/* nothing */ { $$ = new std::string; }
|
||||||
|
| text TEXT { delete $1; $$ = $2; }
|
||||||
|
| text NUMBER { delete $1; $$ = new std::string (string_cast ($2)); }
|
||||||
|
;
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
print $out <<'EOF';
|
||||||
|
%%
|
||||||
|
#
|
||||||
|
|
||||||
|
static
|
||||||
|
#if USE_LEX_SYMBOL
|
||||||
|
yy::parser::symbol_type yylex()
|
||||||
|
#else
|
||||||
|
yy::parser::token_type yylex(yy::parser::semantic_type* yylval,
|
||||||
|
yy::parser::location_type* yylloc)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
typedef yy::parser::location_type location_type;
|
||||||
|
typedef yy::parser::token token;
|
||||||
|
static int stage = -1;
|
||||||
|
++stage;
|
||||||
|
if (stage == STAGE_MAX)
|
||||||
|
{
|
||||||
|
#if USE_LEX_SYMBOL
|
||||||
|
return yy::parser::make_END_OF_FILE (location_type ());
|
||||||
|
#else
|
||||||
|
*yylloc = location_type ();
|
||||||
|
return token::END_OF_FILE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else if (stage % 2)
|
||||||
|
{
|
||||||
|
#if USE_LEX_SYMBOL
|
||||||
|
return yy::parser::make_NUMBER (stage, location_type ());
|
||||||
|
#else
|
||||||
|
# if defined ONE_STAGE_BUILD
|
||||||
|
yylval->build(stage);
|
||||||
|
# elif USE_VARIANTS
|
||||||
|
yylval->build<int>() = stage;
|
||||||
|
# else
|
||||||
|
yylval->ival = stage;
|
||||||
|
# endif
|
||||||
|
*yylloc = location_type ();
|
||||||
|
return token::NUMBER;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#if USE_LEX_SYMBOL
|
||||||
|
return yy::parser::make_TEXT ("A string.", location_type ());
|
||||||
|
#else
|
||||||
|
# if defined ONE_STAGE_BUILD
|
||||||
|
yylval->build(std::string("A string."));
|
||||||
|
# elif USE_VARIANTS
|
||||||
|
yylval->build<std::string>() = std::string("A string.");
|
||||||
|
# else
|
||||||
|
yylval->sval = new std::string("A string.");
|
||||||
|
# endif
|
||||||
|
*yylloc = location_type ();
|
||||||
|
return token::TEXT;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mandatory error function
|
||||||
|
void
|
||||||
|
yy::parser::error(const yy::parser::location_type& loc, const std::string& msg)
|
||||||
|
{
|
||||||
|
std::cerr << loc << ": " << msg << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
yy::parser p;
|
||||||
|
#if YYDEBUG
|
||||||
|
p.set_debug_level(!!getenv("YYDEBUG"));
|
||||||
|
#endif
|
||||||
|
p.parse();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
|
||||||
|
=item C<generate_grammar ($name, $base, @directive)>
|
||||||
|
|
||||||
|
Generate F<$base.y> by calling C<&generate_grammar_$name>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub generate_grammar ($$@)
|
||||||
|
{
|
||||||
|
my ($name, $base, @directive) = @_;
|
||||||
|
verbose 3, "Generating $base.y\n";
|
||||||
|
my %generator =
|
||||||
|
(
|
||||||
|
"calc" => \&generate_grammar_calc,
|
||||||
|
"list" => \&generate_grammar_list,
|
||||||
|
"triangular" => \&generate_grammar_triangular,
|
||||||
|
);
|
||||||
|
&{$generator{$name}}($base, 200, @directive);
|
||||||
|
}
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
|
||||||
|
=item C<run ($command)>
|
||||||
|
|
||||||
|
Run, possibly verbosely, the shell C<$command>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub run ($)
|
||||||
|
{
|
||||||
|
my ($command) = @_;
|
||||||
|
verbose 3, "$command\n";
|
||||||
|
system ("$command") == 0
|
||||||
|
or die "$command failed";
|
||||||
|
}
|
||||||
|
|
||||||
|
##################################################################
|
||||||
|
|
||||||
|
=item C<compile ($base)>
|
||||||
|
|
||||||
|
Compile C<$base.y> to an executable C, Using the C or C++ compiler
|
||||||
|
depending on the %language specification in C<$base.y>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub compile ($)
|
sub compile ($)
|
||||||
{
|
{
|
||||||
my ($base) = @_;
|
my ($base) = @_;
|
||||||
system ("$bison $base.y -o $base.c") == 0
|
my $language = `sed -ne '/%language "\\(.*\\)"/{s//\\1/;p;q;}' $base.y`;
|
||||||
or die;
|
chomp $language;
|
||||||
system ("$cc -o $base $base.c") == 0
|
|
||||||
or die;
|
my $compiler = $language eq 'C++' ? $cxx : $cc;
|
||||||
|
|
||||||
|
run "$bison $base.y -o $base.c";
|
||||||
|
run "$compiler -o $base $cflags $base.c";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub bench_grammar ($)
|
######################################################################
|
||||||
{
|
|
||||||
my ($gram) = @_;
|
|
||||||
my %test =
|
|
||||||
(
|
|
||||||
"pull-impure" => '',
|
|
||||||
"pull-pure" => '%define api.pure',
|
|
||||||
"push-impure" => '%define api.push-pull "both"',
|
|
||||||
"push-pure" => '%define api.push-pull "both" %define api.pure',
|
|
||||||
);
|
|
||||||
|
|
||||||
|
=item C<bench ($grammar, @token)>
|
||||||
|
|
||||||
|
Generate benches for the C<$grammar> and the directive specification
|
||||||
|
given in the list of C<@token>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub bench ($@)
|
||||||
|
{
|
||||||
|
my ($grammar, @token) = @_;
|
||||||
|
use Benchmark qw (:all :hireswallclock);
|
||||||
|
|
||||||
|
my @directive = parse (@token);
|
||||||
|
|
||||||
|
# Set up the benches as expected by timethese.
|
||||||
my %bench;
|
my %bench;
|
||||||
while (my ($name, $directives) = each %test)
|
# A counter of directive sets.
|
||||||
|
my $count = 1;
|
||||||
|
for my $d (@directive)
|
||||||
{
|
{
|
||||||
print STDERR "$name\n";
|
$bench{$count} = $d;
|
||||||
my $generator = "$gram" . "_grammar";
|
printf " %2d. %s\n", $count, join (' ', split ("\n", $d));
|
||||||
&$generator ($name, 200, $directives);
|
$count++;
|
||||||
|
};
|
||||||
|
|
||||||
|
# For each bench, capture the size.
|
||||||
|
my %size;
|
||||||
|
|
||||||
|
while (my ($name, $directives) = each %bench)
|
||||||
|
{
|
||||||
|
generate_grammar ($grammar, $name, $directives);
|
||||||
|
# Compile the executable.
|
||||||
compile ($name);
|
compile ($name);
|
||||||
$bench{$name} = "system ('./$name');";
|
$bench{$name} = "system ('./$name');";
|
||||||
|
chop($size{$name} = `wc -c <$name`);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "$gram:\n";
|
# Run the benches.
|
||||||
my $res = timethese (50, \%bench, 'nop');
|
#
|
||||||
|
# STYLE can be any of 'all', 'none', 'noc', 'nop' or 'auto'. 'all'
|
||||||
|
# shows each of the 5 times available ('wallclock' time, user time,
|
||||||
|
# system time, user time of children, and system time of
|
||||||
|
# children). 'noc' shows all except the two children times. 'nop'
|
||||||
|
# shows only wallclock and the two children times. 'auto' (the
|
||||||
|
# default) will act as 'all' unless the children times are both
|
||||||
|
# zero, in which case it acts as 'noc'. 'none' prevents output.
|
||||||
|
verbose 3, "Running the benches for $grammar\n";
|
||||||
|
my $res = timethese ($iterations, \%bench, 'nop');
|
||||||
|
|
||||||
|
# Output the speed result.
|
||||||
cmpthese ($res, 'nop');
|
cmpthese ($res, 'nop');
|
||||||
|
|
||||||
|
# Display the sizes.
|
||||||
|
print "Sizes (decreasing):\n";
|
||||||
|
my $width = 10;
|
||||||
|
for my $bench (keys %size)
|
||||||
|
{
|
||||||
|
$width = length $bench
|
||||||
|
if $width < length $bench;
|
||||||
|
}
|
||||||
|
# Benches sorted by decreasing size.
|
||||||
|
my @benches_per_size = sort {$size{$b} <=> $size{$a}} keys %size;
|
||||||
|
for my $bench (@benches_per_size)
|
||||||
|
{
|
||||||
|
printf "%${width}s: %5.2fkB\n", $bench, $size{$bench} / 1024;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print STDERR "Using $bison, $cc.\n";
|
######################################################################
|
||||||
calc_input ('calc', 200);
|
|
||||||
bench_grammar ('calc');
|
=item C<bench_push_parser ()>
|
||||||
|
|
||||||
|
Bench the C push parser against the pull parser, pure and impure
|
||||||
|
interfaces.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub bench_push_parser ()
|
||||||
|
{
|
||||||
|
bench ('calc',
|
||||||
|
qw(
|
||||||
|
[ %d api.pure ]
|
||||||
|
&
|
||||||
|
[ %d api.push-pull=both ]
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
=item C<bench_variant_parser ()>
|
||||||
|
|
||||||
|
Bench the C++ lalr1.cc parser using variants or %union.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub bench_variant_parser ()
|
||||||
|
{
|
||||||
|
bench ('list',
|
||||||
|
qw(
|
||||||
|
[
|
||||||
|
%d variant
|
||||||
|
&
|
||||||
|
[ #d ONE_STAGE_BUILD | %d lex_symbol ]
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
sub help ($)
|
||||||
|
{
|
||||||
|
my ($verbose) = @_;
|
||||||
|
use Pod::Usage;
|
||||||
|
# See <URL:http://perldoc.perl.org/pod2man.html#NOTES>.
|
||||||
|
pod2usage( { -message => "Bench Bison parsers",
|
||||||
|
-exitval => 0,
|
||||||
|
-verbose => $verbose,
|
||||||
|
-output => \*STDOUT });
|
||||||
|
}
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
# The end of the directives to parse.
|
||||||
|
my $eod = "end of directives";
|
||||||
|
# The list of tokens parsed by the following functions.
|
||||||
|
my @token;
|
||||||
|
|
||||||
|
# eat ($EXPECTED)
|
||||||
|
# ---------------
|
||||||
|
# Check that the current token is $EXPECTED, and move to the next.
|
||||||
|
sub eat ($)
|
||||||
|
{
|
||||||
|
my ($expected) = @_;
|
||||||
|
die "expected $expected, unexpected: $token[0] (@token)\n"
|
||||||
|
unless $token[0] eq $expected;
|
||||||
|
shift @token;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse directive specifications:
|
||||||
|
# expr: term (| term)*
|
||||||
|
# term: fact (& fact)*
|
||||||
|
# fact: ( expr ) | [ expr ] | dirs
|
||||||
|
# dirs: %s SKELETON | #d NAME[=VALUE] | %d NAME[=VALUE] | directive
|
||||||
|
sub parse (@)
|
||||||
|
{
|
||||||
|
@token = (@_, $eod);
|
||||||
|
verbose 3, "Parsing: @token\n";
|
||||||
|
my @res = parse_expr ();
|
||||||
|
eat ($eod);
|
||||||
|
return @res;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub parse_expr ()
|
||||||
|
{
|
||||||
|
my @res = parse_term ();
|
||||||
|
while ($token[0] eq '|')
|
||||||
|
{
|
||||||
|
eat ('|');
|
||||||
|
# Alternation.
|
||||||
|
push @res, parse_term ();
|
||||||
|
}
|
||||||
|
return @res;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub parse_term ()
|
||||||
|
{
|
||||||
|
my @res = parse_fact ();
|
||||||
|
while ($token[0] eq '&')
|
||||||
|
{
|
||||||
|
eat ('&');
|
||||||
|
# Cartesian product.
|
||||||
|
my @lhs = @res;
|
||||||
|
@res = ();
|
||||||
|
for my $rhs (parse_fact ())
|
||||||
|
{
|
||||||
|
for my $lhs (@lhs)
|
||||||
|
{
|
||||||
|
push @res, $lhs . ($lhs && $rhs ? "\n" : "") . $rhs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return @res;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub parse_fact ()
|
||||||
|
{
|
||||||
|
my @res;
|
||||||
|
die "unexpected end of expression"
|
||||||
|
unless defined $token[0];
|
||||||
|
|
||||||
|
if ($token[0] eq '(')
|
||||||
|
{
|
||||||
|
eat ('(');
|
||||||
|
@res = parse_expr ();
|
||||||
|
eat (')');
|
||||||
|
}
|
||||||
|
elsif ($token[0] eq '[')
|
||||||
|
{
|
||||||
|
eat ('[');
|
||||||
|
@res = (parse_expr (), '');
|
||||||
|
eat (']');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@res = parse_dirs ();
|
||||||
|
}
|
||||||
|
return @res;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub parse_dirs ()
|
||||||
|
{
|
||||||
|
my @res;
|
||||||
|
die "unexpected end of expression"
|
||||||
|
unless defined $token[0];
|
||||||
|
|
||||||
|
if ($token[0] eq '#d')
|
||||||
|
{
|
||||||
|
eat ('#d');
|
||||||
|
$token[0] =~ s/(.*?)=(.*)/$1 $2/;
|
||||||
|
@res = ("%code {\n#define $token[0]\n}");
|
||||||
|
shift @token;
|
||||||
|
}
|
||||||
|
elsif ($token[0] eq '%d')
|
||||||
|
{
|
||||||
|
shift @token;
|
||||||
|
$token[0] =~ s/(.*?)=(.*)/$1 "$2"/;
|
||||||
|
@res = ("%define $token[0]");
|
||||||
|
shift @token;
|
||||||
|
}
|
||||||
|
elsif ($token[0] eq '%s')
|
||||||
|
{
|
||||||
|
shift @token;
|
||||||
|
@res = ("%skeleton \"$token[0]\"");
|
||||||
|
shift @token;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@res = $token[0];
|
||||||
|
shift @token;
|
||||||
|
}
|
||||||
|
|
||||||
|
return @res;
|
||||||
|
}
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
sub getopt ()
|
||||||
|
{
|
||||||
|
use Getopt::Long;
|
||||||
|
my %option = (
|
||||||
|
"b|bench=s" => \$bench,
|
||||||
|
"c|cflags=s" => \$cflags,
|
||||||
|
"d|directive=s" => \@directive,
|
||||||
|
"g|grammar=s" => \$grammar,
|
||||||
|
"h|help" => sub { help ($verbose) },
|
||||||
|
"i|iterations=i" => \$iterations,
|
||||||
|
"q|quiet" => sub { --$verbose },
|
||||||
|
"v|verbose" => sub { ++$verbose },
|
||||||
|
);
|
||||||
|
Getopt::Long::Configure ("bundling", "pass_through");
|
||||||
|
GetOptions (%option)
|
||||||
|
or exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
getopt;
|
||||||
|
|
||||||
|
# Create the directory we work in.
|
||||||
|
mkdir "benches" or die "cannot create benches"
|
||||||
|
unless -d "benches";
|
||||||
|
my $count = 1;
|
||||||
|
++$count
|
||||||
|
while -d "benches/$count";
|
||||||
|
my $dir = "benches/$count";
|
||||||
|
mkdir $dir
|
||||||
|
or die "cannot create $dir";
|
||||||
|
chdir $dir
|
||||||
|
or die "cannot chdir $dir";
|
||||||
|
|
||||||
|
# The following message is tailored to please Emacs' compilation-mode.
|
||||||
|
verbose 1, "Entering directory `$dir'\n";
|
||||||
|
verbose 1, "Using bison=$bison.\n";
|
||||||
|
verbose 2, "Using cc=$cc.\n";
|
||||||
|
verbose 2, "Using cxx=$cxx.\n";
|
||||||
|
verbose 2, "Using cflags=$cflags.\n";
|
||||||
|
verbose 2, "Grammar: $grammar\n";
|
||||||
|
|
||||||
|
|
||||||
|
# Support -b: predefined benches.
|
||||||
|
my %bench =
|
||||||
|
(
|
||||||
|
"push" => \&bench_push_parser,
|
||||||
|
"variant" => \&bench_variant_parser,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (defined $bench)
|
||||||
|
{
|
||||||
|
die "invalid argument for --bench: $bench"
|
||||||
|
unless defined $bench{$bench};
|
||||||
|
&{$bench{$bench}}();
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
# Launch the bench marking.
|
||||||
|
bench ($grammar, @ARGV);
|
||||||
|
}
|
||||||
|
|
||||||
### Setup "GNU" style for perl-mode and cperl-mode.
|
### Setup "GNU" style for perl-mode and cperl-mode.
|
||||||
## Local Variables:
|
## Local Variables:
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
## Copyright (C) 2006, 2008-2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
## This program is free software: you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
nodist_noinst_SCRIPTS = etc/bench.pl
|
||||||
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
for dir in . po src doc; do
|
||||||
|
(
|
||||||
|
cd $dir && rcs2log -r -l \
|
||||||
|
-u 'akim Akim Demaille [email protected]' \
|
||||||
|
-u 'djm David J. MacKenzie [email protected]' \
|
||||||
|
-u 'eggert Paul Eggert [email protected]' \
|
||||||
|
-u 'friedman Noah Friedman [email protected]' \
|
||||||
|
-u 'hag Daniel Hagerty [email protected]' \
|
||||||
|
-u 'jthilo Jesse Thilo [email protected]' \
|
||||||
|
-u 'meyering Jim Meyering [email protected]' \
|
||||||
|
-u 'rms Richard Stallman [email protected]' \
|
||||||
|
| sed -e 's,/opt/cvs/bison/bison/,,g' > ChangeLog
|
||||||
|
)
|
||||||
|
done
|
||||||
Executable
+152
@@ -0,0 +1,152 @@
|
|||||||
|
#! /usr/bin/perl -w
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use IO::File;
|
||||||
|
|
||||||
|
my $prefix = "lib/";
|
||||||
|
|
||||||
|
# contents ($FILE_NAME)
|
||||||
|
# ---------------------
|
||||||
|
sub contents ($)
|
||||||
|
{
|
||||||
|
my ($file) = @_;
|
||||||
|
local $/; # Turn on slurp-mode.
|
||||||
|
my $f = new IO::File "< $file" or die "$file";
|
||||||
|
my $contents = $f->getline or die "$file";
|
||||||
|
$f->close;
|
||||||
|
return $contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
# prefix_word ($WORD)
|
||||||
|
# -------------------
|
||||||
|
# Do not prefix special words such as variable dereferences. Also,
|
||||||
|
# "Makefile" is really "Makefile", since precisely there is no
|
||||||
|
# lib/Makefile.
|
||||||
|
sub prefix_word ($)
|
||||||
|
{
|
||||||
|
local ($_) = @_;
|
||||||
|
$_ = $prefix . $_
|
||||||
|
unless m{^\$\(\w+\)} || $_ eq "Makefile";
|
||||||
|
return $_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# prefix_words ($TEXT)
|
||||||
|
# --------------------
|
||||||
|
sub prefix_words ($)
|
||||||
|
{
|
||||||
|
local ($_) = @_;
|
||||||
|
s{(\S+)}{prefix_word($1)}gem;
|
||||||
|
return $_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# prefix_assignment ($LHS-AND-ASSIGN-OP, $RHS)
|
||||||
|
# --------------------------------------------
|
||||||
|
sub prefix_assignment ($$)
|
||||||
|
{
|
||||||
|
my ($lhs_and_assign_op, $rhs) = @_;
|
||||||
|
my $res;
|
||||||
|
|
||||||
|
# Some variables are initialized by gnulib.mk, and we don't want
|
||||||
|
# that. Change '=' to '+='.
|
||||||
|
if ($lhs_and_assign_op =~ /^(SUBDIRS|EXTRA_DIST|BUILT_SOURCES|SUFFIXES|MOSTLYCLEANFILES|CLEANFILES|DISTCLEANFILES|MAINTAINERCLEANFILES|AM_CFLAGS|AM_CPPFLAGS|AM_GNU_GETTEXT) =/)
|
||||||
|
{
|
||||||
|
$lhs_and_assign_op =~ s/=/+=/;
|
||||||
|
}
|
||||||
|
# We don't want to inherit gnulib's AUTOMAKE_OPTIONS, comment them.
|
||||||
|
elsif ($lhs_and_assign_op =~ /^AUTOMAKE_OPTIONS =/)
|
||||||
|
{
|
||||||
|
$lhs_and_assign_op =~ s/^/# /;
|
||||||
|
}
|
||||||
|
# Don't touch suffixes.
|
||||||
|
elsif ($lhs_and_assign_op =~ /^SUFFIXES /)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
# The words are (probably) paths to files in lib/: prefix them.
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$rhs = prefix_words($rhs)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Variables which name depend on the location: libbison_a_SOURCES =>
|
||||||
|
# lib_libbison_a_SOURCES.
|
||||||
|
$lhs_and_assign_op =~ s/(libbison)/lib_$1/g;
|
||||||
|
|
||||||
|
return $lhs_and_assign_op . $rhs;
|
||||||
|
}
|
||||||
|
|
||||||
|
# prefix $CONTENTS
|
||||||
|
# ----------------
|
||||||
|
# $CONTENTS is a Makefile content. Post-process it so that each file-name
|
||||||
|
# is prefixed with $prefix (e.g., "lib/").
|
||||||
|
#
|
||||||
|
# Relies heavily on the regularity of the file generated by gnulib-tool.
|
||||||
|
sub prefix ($)
|
||||||
|
{
|
||||||
|
# Work on $_.
|
||||||
|
local ($_) = @_;
|
||||||
|
|
||||||
|
# Prefix all the occurrence of files in rules. If there is nothing
|
||||||
|
# after in the :, it's probably a phony target, or a suffix rule.
|
||||||
|
# Don't touch it.
|
||||||
|
s{^([\w./]+ *: *\w.*)$}
|
||||||
|
{prefix_words($1)}gem;
|
||||||
|
|
||||||
|
# Prefix files in variables.
|
||||||
|
s{^([\w.]+\s*\+?=)(.*)$}
|
||||||
|
{prefix_assignment($1, $2)}gem;
|
||||||
|
|
||||||
|
# These three guys escape all the other regular rules.
|
||||||
|
s{(charset\.alias|ref-add\.sed|ref-del\.sed)}{$prefix$1}g;
|
||||||
|
# Unfortunately, as a result we sometimes have lib/lib.
|
||||||
|
s{($prefix){2}}{$1}g;
|
||||||
|
|
||||||
|
# $(srcdir) is actually $(top_srcdir)/lib.
|
||||||
|
s{\$\(srcdir\)}{\$(top_srcdir)/lib}g;
|
||||||
|
|
||||||
|
# Sometimes, t-$@ is used instead of $@-t, which, of course, does
|
||||||
|
# not work when we have a $@ with a directory in it.
|
||||||
|
s{t-\$\@}{\$\@-t}g;
|
||||||
|
|
||||||
|
# Some AC_SUBST patterns remain and would better be Make macros.
|
||||||
|
s{\@(MKDIR_P)\@}{\$($1)}g;
|
||||||
|
|
||||||
|
# Adjust paths in mkdir.
|
||||||
|
s{(\$\(MKDIR_P\))\s*(\w+)}{$1 $prefix$2}g;
|
||||||
|
|
||||||
|
return $_;
|
||||||
|
}
|
||||||
|
|
||||||
|
# process ($IN)
|
||||||
|
# -------------
|
||||||
|
sub process ($)
|
||||||
|
{
|
||||||
|
my ($file) = @_;
|
||||||
|
my ($bak) = "$file.bak";
|
||||||
|
rename ($file, $bak) or die;
|
||||||
|
my $contents = contents ($bak);
|
||||||
|
$contents = prefix ($contents);
|
||||||
|
my $out = new IO::File(">$file") or die;
|
||||||
|
print $out $contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
process ("${prefix}gnulib.mk")
|
||||||
|
|
||||||
|
|
||||||
|
### Setup "GNU" style for perl-mode and cperl-mode.
|
||||||
|
## Local Variables:
|
||||||
|
## perl-indent-level: 2
|
||||||
|
## perl-continued-statement-offset: 2
|
||||||
|
## perl-continued-brace-offset: 0
|
||||||
|
## perl-brace-offset: 0
|
||||||
|
## perl-brace-imaginary-offset: 0
|
||||||
|
## perl-label-offset: -2
|
||||||
|
## cperl-indent-level: 2
|
||||||
|
## cperl-brace-offset: 0
|
||||||
|
## cperl-continued-brace-offset: 0
|
||||||
|
## cperl-label-offset: -2
|
||||||
|
## cperl-extra-newline-before-brace: t
|
||||||
|
## cperl-merge-trailing-else: nil
|
||||||
|
## cperl-continued-statement-offset: 2
|
||||||
|
## End:
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/Makefile
|
|
||||||
/Makefile.in
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
*.cc
|
||||||
|
*.hh
|
||||||
|
*.ll
|
||||||
|
*.output
|
||||||
|
*.stamp
|
||||||
|
*.tmp
|
||||||
|
*.yy
|
||||||
|
.deps
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
calc++
|
||||||
+16
-16
@@ -1,5 +1,5 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
|
## Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,23 +22,23 @@ BISON = $(top_builddir)/tests/bison
|
|||||||
BISON_IN = $(top_srcdir)/tests/bison.in
|
BISON_IN = $(top_srcdir)/tests/bison.in
|
||||||
|
|
||||||
$(BISON): $(BISON_IN)
|
$(BISON): $(BISON_IN)
|
||||||
$(AM_V_GEN)cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) bison
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) tests/bison
|
||||||
|
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
## Extracting. ##
|
## Extracting. ##
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
|
|
||||||
doc = $(top_srcdir)/doc/bison.texi
|
doc = $(top_srcdir)/doc/bison.texinfo
|
||||||
extexi = $(top_srcdir)/examples/extexi
|
extexi = $(top_srcdir)/examples/extexi
|
||||||
# Extract in src.
|
# Extract in src.
|
||||||
$(srcdir)/calc.stamp: $(doc) $(extexi)
|
$(srcdir)/calc.stamp: $(doc) $(extexi)
|
||||||
$(AM_V_GEN)rm -f $@ $@.tmp
|
rm -f $@ $@.tmp
|
||||||
$(AM_V_at)touch $@.tmp
|
touch $@.tmp
|
||||||
$(AM_V_at)cd $(srcdir) && \
|
cd $(srcdir) && \
|
||||||
$(AWK) -f ../extexi -v VERSION="$(VERSION)" \
|
$(AWK) -f ../extexi -v VERSION="$(VERSION)" \
|
||||||
../../doc/bison.texi -- calc++-parser.yy \
|
../../doc/bison.texinfo -- calc++-parser.yy \
|
||||||
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
||||||
$(AM_V_at)mv $@.tmp $@
|
mv $@.tmp $@
|
||||||
|
|
||||||
$(calc_extracted): $(srcdir)/calc.stamp
|
$(calc_extracted): $(srcdir)/calc.stamp
|
||||||
|
|
||||||
@@ -61,14 +61,14 @@ EXTRA_DIST = \
|
|||||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||||
# in srcdir, including during distcheck, which is forbidden.
|
# in srcdir, including during distcheck, which is forbidden.
|
||||||
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
||||||
$(AM_V_GEN)rm -f calc++-parser.tmp
|
@rm -f calc++-parser.tmp
|
||||||
$(AM_V_at)touch calc++-parser.tmp
|
@touch calc++-parser.tmp
|
||||||
$(AM_V_at)$(BISON) -d -ra -S lalr1.cc -o $(srcdir)/calc++-parser.cc \
|
$(BISON) -d -ra -o $(srcdir)/calc++-parser.cc \
|
||||||
$(srcdir)/calc++-parser.yy
|
$(srcdir)/calc++-parser.yy
|
||||||
$(AM_V_at)mv -f calc++-parser.tmp $@
|
@mv -f calc++-parser.tmp $@
|
||||||
|
|
||||||
$(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
$(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
||||||
$(AM_V_GEN)if test -f $@; then :; else \
|
@if test -f $@; then :; else \
|
||||||
rm -f $(srcdir)/calc++-parser.stamp && \
|
rm -f $(srcdir)/calc++-parser.stamp && \
|
||||||
$(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
|
$(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
|
||||||
fi
|
fi
|
||||||
@@ -81,11 +81,11 @@ $(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
|||||||
check_PROGRAMS = calc++
|
check_PROGRAMS = calc++
|
||||||
|
|
||||||
calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
|
calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
|
||||||
$(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
|
$(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
|
||||||
calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
|
calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
|
||||||
calc_sources_generated = \
|
calc_sources_generated = \
|
||||||
$(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
|
$(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
|
||||||
$(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
|
$(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
|
||||||
|
|
||||||
calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
|
calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
|
||||||
|
|
||||||
|
|||||||
+53
-20
@@ -1,25 +1,46 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
# Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
test -z "$VERBOSE" && {
|
test -z "$VERBOSE" && {
|
||||||
exec > /dev/null 2>&1
|
exec > /dev/null 2>&1
|
||||||
set -x
|
set -x
|
||||||
}
|
}
|
||||||
|
|
||||||
|
me=`basename $0`
|
||||||
|
|
||||||
|
# Number of the current test.
|
||||||
|
number=1
|
||||||
|
|
||||||
|
# Exit status of this script.
|
||||||
|
exit=true
|
||||||
|
|
||||||
|
# run EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
run ()
|
||||||
|
{
|
||||||
|
# Effective and expected exit status.
|
||||||
|
local sta_exp=$1
|
||||||
|
shift
|
||||||
|
local out_exp=$1
|
||||||
|
shift
|
||||||
|
./calc++ "$@" input >out_eff
|
||||||
|
local sta_eff=$?
|
||||||
|
local out_eff=`cat out_eff`
|
||||||
|
if test $sta_eff -eq $sta_exp; then
|
||||||
|
if test "$out_eff" = "$out_exp"; then
|
||||||
|
printf "$me: PASS: %2d\n" $number
|
||||||
|
else
|
||||||
|
printf "$me: FAIL: %2d (expected output: %s, effective: %s\n" \
|
||||||
|
$number "$out_exp" "$out_eff"
|
||||||
|
exit=false
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
printf "$me: FAIL: %2d (expected status: %d, effective: %d\n" \
|
||||||
|
$number $sta_exp $sta_eff
|
||||||
|
exit=false
|
||||||
|
fi
|
||||||
|
number=`expr $number + 1`
|
||||||
|
}
|
||||||
|
|
||||||
cat >input <<EOF
|
cat >input <<EOF
|
||||||
a := 1
|
a := 1
|
||||||
b := 2
|
b := 2
|
||||||
@@ -27,20 +48,32 @@ c := 3
|
|||||||
d := a + b * c
|
d := a + b * c
|
||||||
d
|
d
|
||||||
EOF
|
EOF
|
||||||
|
run 0 7
|
||||||
|
run 0 7 -p
|
||||||
|
|
||||||
|
|
||||||
|
cat >input <<EOF
|
||||||
|
a := 1
|
||||||
|
b := 2
|
||||||
|
c := 3
|
||||||
|
d := (a + b) * c
|
||||||
|
d
|
||||||
|
EOF
|
||||||
|
run 0 9
|
||||||
|
|
||||||
./calc++ input
|
|
||||||
./calc++ -p input
|
|
||||||
|
|
||||||
cat >input <<EOF
|
cat >input <<EOF
|
||||||
a := 1
|
a := 1
|
||||||
d := a + b * c
|
d := a + b * c
|
||||||
EOF
|
EOF
|
||||||
./calc++ input
|
run 1 '' input
|
||||||
|
|
||||||
|
|
||||||
cat >input <<EOF
|
cat >input <<EOF
|
||||||
toto := 1
|
toto := 1
|
||||||
toto
|
toto
|
||||||
EOF
|
EOF
|
||||||
./calc++ -s input
|
run 0 1 -s
|
||||||
|
|
||||||
rm input
|
rm input out_eff
|
||||||
|
$exit
|
||||||
|
|||||||
+1
-2
@@ -1,8 +1,7 @@
|
|||||||
# Extract all examples from the manual source. -*- AWK -*-
|
# Extract all examples from the manual source. -*- AWK -*-
|
||||||
|
|
||||||
# This file is part of GNU Bison
|
# This file is part of GNU Bison
|
||||||
|
# Copyright (C) 1992, 2000, 2001, 2005, 2006, 2009 Free Software
|
||||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2012 Free Software
|
|
||||||
# Foundation, Inc.
|
# Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
## Copyright (C) 2005, 2008-2009 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
## This program is free software: you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
dist_noinst_SCRIPTS = examples/extexi
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
%skeleton "lalr1.cc"
|
||||||
|
%defines
|
||||||
|
%define parse.assert
|
||||||
|
%define parse.trace
|
||||||
|
%define variant
|
||||||
|
%define lex_symbol
|
||||||
|
%locations
|
||||||
|
|
||||||
|
%code requires // *.hh
|
||||||
|
{
|
||||||
|
#include <list>
|
||||||
|
#include <string>
|
||||||
|
typedef std::list<std::string> strings_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
%code // *.cc
|
||||||
|
{
|
||||||
|
#include <algorithm>
|
||||||
|
#include <iostream>
|
||||||
|
#include <iterator>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
// Prototype of the yylex function providing subsequent tokens.
|
||||||
|
static yy::parser::symbol_type yylex ();
|
||||||
|
|
||||||
|
// Printing a list of strings.
|
||||||
|
// Koening look up will look into std, since that's an std::list.
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
std::ostream&
|
||||||
|
operator<< (std::ostream& o, const strings_type& s)
|
||||||
|
{
|
||||||
|
std::copy (s.begin (), s.end (),
|
||||||
|
std::ostream_iterator<strings_type::value_type> (o, "\n"));
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Conversion to string.
|
||||||
|
template <typename T>
|
||||||
|
inline
|
||||||
|
std::string
|
||||||
|
string_cast (const T& t)
|
||||||
|
{
|
||||||
|
std::ostringstream o;
|
||||||
|
o << t;
|
||||||
|
return o.str ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%token <::std::string> TEXT;
|
||||||
|
%token <int> NUMBER;
|
||||||
|
%printer { debug_stream () << $$; }
|
||||||
|
<int> <::std::string> <::std::list<std::string>>;
|
||||||
|
%token END_OF_FILE 0;
|
||||||
|
|
||||||
|
%type <::std::string> item;
|
||||||
|
%type <::std::list<std::string>> list;
|
||||||
|
|
||||||
|
%%
|
||||||
|
|
||||||
|
result:
|
||||||
|
list { std::cout << $1 << std::endl; }
|
||||||
|
;
|
||||||
|
|
||||||
|
list:
|
||||||
|
/* nothing */ { /* Generates an empty string list */ }
|
||||||
|
| list item { std::swap ($$, $1); $$.push_back ($2); }
|
||||||
|
;
|
||||||
|
|
||||||
|
item:
|
||||||
|
TEXT { std::swap ($$, $1); }
|
||||||
|
| NUMBER { $$ = string_cast ($1); }
|
||||||
|
;
|
||||||
|
%%
|
||||||
|
|
||||||
|
// The yylex function providing subsequent tokens:
|
||||||
|
// TEXT "I have three numbers for you:"
|
||||||
|
// NUMBER 1
|
||||||
|
// NUMBER 2
|
||||||
|
// NUMBER 3
|
||||||
|
// TEXT " and that's all!"
|
||||||
|
// END_OF_FILE
|
||||||
|
|
||||||
|
static
|
||||||
|
yy::parser::symbol_type
|
||||||
|
yylex ()
|
||||||
|
{
|
||||||
|
static int stage = -1;
|
||||||
|
++stage;
|
||||||
|
yy::parser::location_type loc(0, stage + 1, stage + 1);
|
||||||
|
switch (stage)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return yy::parser::make_TEXT ("I have three numbers for you.", loc);
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
return yy::parser::make_NUMBER (stage, loc);
|
||||||
|
case 4:
|
||||||
|
return yy::parser::make_TEXT ("And that's all!", loc);
|
||||||
|
default:
|
||||||
|
return yy::parser::make_END_OF_FILE (loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mandatory error function
|
||||||
|
void
|
||||||
|
yy::parser::error (const yy::parser::location_type& loc, const std::string& msg)
|
||||||
|
{
|
||||||
|
std::cerr << loc << ": " << msg << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
yy::parser p;
|
||||||
|
p.set_debug_level (!!getenv ("YYDEBUG"));
|
||||||
|
return p.parse ();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: C++
|
||||||
|
// End:
|
||||||
+1
-1
Submodule gnulib updated: cabce6b8f2...3ef64012bf
+112
@@ -0,0 +1,112 @@
|
|||||||
|
.deps
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
argmatch.c
|
||||||
|
argmatch.h
|
||||||
|
basename.c
|
||||||
|
bitrotate.h
|
||||||
|
c-ctype.c
|
||||||
|
c-ctype.h
|
||||||
|
c-strcase.h
|
||||||
|
c-strcasecmp.c
|
||||||
|
c-strncasecmp.c
|
||||||
|
charset.alias
|
||||||
|
config.charset
|
||||||
|
config.h
|
||||||
|
config.hin
|
||||||
|
configmake.h
|
||||||
|
dirname.c
|
||||||
|
dirname.h
|
||||||
|
dup-safer.c
|
||||||
|
errno.in.h
|
||||||
|
error.c
|
||||||
|
error.h
|
||||||
|
exitfail.c
|
||||||
|
exitfail.h
|
||||||
|
fd-safer.c
|
||||||
|
fopen-safer.c
|
||||||
|
getopt.c
|
||||||
|
getopt.h
|
||||||
|
getopt.in.h
|
||||||
|
getopt1.c
|
||||||
|
getopt_.h
|
||||||
|
getopt_int.h
|
||||||
|
getpagesize.c
|
||||||
|
gettext.h
|
||||||
|
gnulib.mk
|
||||||
|
hash.c
|
||||||
|
hash.h
|
||||||
|
intprops.h
|
||||||
|
inttypes.h
|
||||||
|
inttypes.in.h
|
||||||
|
inttypes_.h
|
||||||
|
localcharset.c
|
||||||
|
localcharset.h
|
||||||
|
malloc.c
|
||||||
|
mbrtowc.c
|
||||||
|
mbsinit.c
|
||||||
|
mbswidth.c
|
||||||
|
mbswidth.h
|
||||||
|
memchr.c
|
||||||
|
memchr.valgrind
|
||||||
|
obstack.c
|
||||||
|
obstack.h
|
||||||
|
pipe-safer.c
|
||||||
|
quote.c
|
||||||
|
quote.h
|
||||||
|
quotearg.c
|
||||||
|
quotearg.h
|
||||||
|
ref-add.sed
|
||||||
|
ref-add.sin
|
||||||
|
ref-del.sed
|
||||||
|
ref-del.sin
|
||||||
|
stamp-h1
|
||||||
|
stdbool.h
|
||||||
|
stdbool.in.h
|
||||||
|
stdbool_.h
|
||||||
|
stddef.in.h
|
||||||
|
stdint.h
|
||||||
|
stdint.in.h
|
||||||
|
stdint_.h
|
||||||
|
stdio--.h
|
||||||
|
stdio-safer.h
|
||||||
|
stdlib.h
|
||||||
|
stdlib.in.h
|
||||||
|
stdlib_.h
|
||||||
|
stpcpy.c
|
||||||
|
streq.h
|
||||||
|
strerror.c
|
||||||
|
string.h
|
||||||
|
string.in.h
|
||||||
|
string_.h
|
||||||
|
stripslash.c
|
||||||
|
strndup.c
|
||||||
|
strnlen.c
|
||||||
|
strtol.c
|
||||||
|
strtoul.c
|
||||||
|
strverscmp.c
|
||||||
|
strverscmp.h
|
||||||
|
unistd--.h
|
||||||
|
unistd-safer.h
|
||||||
|
unistd.h
|
||||||
|
unistd.in.h
|
||||||
|
unistd_.h
|
||||||
|
unitypes.h
|
||||||
|
uniwidth
|
||||||
|
uniwidth.h
|
||||||
|
unlocked-io.h
|
||||||
|
unsetenv.c
|
||||||
|
verify.h
|
||||||
|
wchar.h
|
||||||
|
wchar.in.h
|
||||||
|
wchar_.h
|
||||||
|
wctype.h
|
||||||
|
wctype.in.h
|
||||||
|
wctype_.h
|
||||||
|
wcwidth.c
|
||||||
|
wcwidth.h
|
||||||
|
xalloc-die.c
|
||||||
|
xalloc.h
|
||||||
|
xmalloc.c
|
||||||
|
xstrndup.c
|
||||||
|
xstrndup.h
|
||||||
+13
-168
@@ -1,88 +1,40 @@
|
|||||||
/*.a
|
/*.a
|
||||||
/*.bak
|
|
||||||
/*.o
|
/*.o
|
||||||
/*~
|
/*~
|
||||||
/.deps
|
/.deps
|
||||||
/.dirstamp
|
|
||||||
/Makefile
|
/Makefile
|
||||||
/Makefile.in
|
/Makefile.in
|
||||||
/alignof.h
|
|
||||||
/alloca.h
|
|
||||||
/alloca.in.h
|
|
||||||
/arg-nonnull.h
|
|
||||||
/argmatch.c
|
/argmatch.c
|
||||||
/argmatch.h
|
/argmatch.h
|
||||||
/asnprintf.c
|
|
||||||
/basename-lgpl.c
|
|
||||||
/basename.c
|
/basename.c
|
||||||
/binary-io.h
|
|
||||||
/bitrotate.h
|
/bitrotate.h
|
||||||
/c++defs.h
|
|
||||||
/c-ctype.c
|
/c-ctype.c
|
||||||
/c-ctype.h
|
/c-ctype.h
|
||||||
/c-strcase.h
|
/c-strcase.h
|
||||||
/c-strcasecmp.c
|
/c-strcasecmp.c
|
||||||
/c-strcaseeq.h
|
|
||||||
/c-strncasecmp.c
|
/c-strncasecmp.c
|
||||||
/calloc.c
|
|
||||||
/charset.alias
|
/charset.alias
|
||||||
/cloexec.c
|
|
||||||
/cloexec.h
|
|
||||||
/close-hook.c
|
|
||||||
/close-hook.h
|
|
||||||
/close-stream.c
|
|
||||||
/close-stream.h
|
|
||||||
/close.c
|
|
||||||
/closeout.c
|
|
||||||
/closeout.h
|
|
||||||
/config.charset
|
/config.charset
|
||||||
/config.h
|
/config.h
|
||||||
/config.in.h
|
/config.hin
|
||||||
/configmake.h
|
/configmake.h
|
||||||
/dirname-lgpl.c
|
|
||||||
/dirname.c
|
/dirname.c
|
||||||
/dirname.h
|
/dirname.h
|
||||||
/dosname.h
|
|
||||||
/dup-safer-flag.c
|
|
||||||
/dup-safer.c
|
/dup-safer.c
|
||||||
/dup2.c
|
|
||||||
/errno.h
|
|
||||||
/errno.in.h
|
/errno.in.h
|
||||||
/error.c
|
/error.c
|
||||||
/error.h
|
/error.h
|
||||||
/exitfail.c
|
/exitfail.c
|
||||||
/exitfail.h
|
/exitfail.h
|
||||||
/fatal-signal.c
|
|
||||||
/fatal-signal.h
|
|
||||||
/fclose.c
|
|
||||||
/fcntl.c
|
|
||||||
/fcntl.h
|
|
||||||
/fcntl.in.h
|
|
||||||
/fd-hook.c
|
|
||||||
/fd-hook.h
|
|
||||||
/fd-safer-flag.c
|
|
||||||
/fd-safer.c
|
/fd-safer.c
|
||||||
/float+.h
|
|
||||||
/float.c
|
|
||||||
/float.h
|
|
||||||
/float.in.h
|
|
||||||
/fopen-safer.c
|
/fopen-safer.c
|
||||||
/fopen.c
|
|
||||||
/fpending.c
|
|
||||||
/fpending.h
|
|
||||||
/fprintf.c
|
|
||||||
/fpucw.h
|
|
||||||
/frexp.c
|
|
||||||
/frexpl.c
|
|
||||||
/fseterr.c
|
|
||||||
/fseterr.h
|
|
||||||
/fstat.c
|
|
||||||
/getdtablesize.c
|
|
||||||
/getopt.c
|
/getopt.c
|
||||||
/getopt.h
|
/getopt.h
|
||||||
/getopt.in.h
|
/getopt.in.h
|
||||||
/getopt1.c
|
/getopt1.c
|
||||||
|
/getopt_.h
|
||||||
/getopt_int.h
|
/getopt_int.h
|
||||||
|
/getpagesize.c
|
||||||
/gettext.h
|
/gettext.h
|
||||||
/gnulib.mk
|
/gnulib.mk
|
||||||
/hash.c
|
/hash.c
|
||||||
@@ -90,181 +42,74 @@
|
|||||||
/intprops.h
|
/intprops.h
|
||||||
/inttypes.h
|
/inttypes.h
|
||||||
/inttypes.in.h
|
/inttypes.in.h
|
||||||
/ioctl.c
|
/inttypes_.h
|
||||||
/isnan.c
|
|
||||||
/isnand-nolibm.h
|
|
||||||
/isnand.c
|
|
||||||
/isnanf-nolibm.h
|
|
||||||
/isnanf.c
|
|
||||||
/isnanl-nolibm.h
|
|
||||||
/isnanl.c
|
|
||||||
/iswblank.c
|
|
||||||
/itold.c
|
|
||||||
/ldexpl.c
|
|
||||||
/localcharset.c
|
/localcharset.c
|
||||||
/localcharset.h
|
/localcharset.h
|
||||||
/malloc.c
|
/malloc.c
|
||||||
/math.h
|
|
||||||
/math.in.h
|
|
||||||
/mbchar.c
|
|
||||||
/mbchar.h
|
|
||||||
/mbrtowc.c
|
/mbrtowc.c
|
||||||
/mbschr.c
|
|
||||||
/mbsinit.c
|
/mbsinit.c
|
||||||
/mbsrchr.c
|
|
||||||
/mbswidth.c
|
/mbswidth.c
|
||||||
/mbswidth.h
|
/mbswidth.h
|
||||||
/mbuiter.h
|
|
||||||
/memchr.c
|
/memchr.c
|
||||||
/memchr.valgrind
|
/memchr.valgrind
|
||||||
/msvc-inval.c
|
|
||||||
/msvc-inval.h
|
|
||||||
/msvc-nothrow.c
|
|
||||||
/msvc-nothrow.h
|
|
||||||
/nonblocking.c
|
|
||||||
/nonblocking.h
|
|
||||||
/obstack.c
|
/obstack.c
|
||||||
/obstack.h
|
/obstack.h
|
||||||
/open.c
|
|
||||||
/pathmax.h
|
|
||||||
/perror.c
|
|
||||||
/pipe-safer.c
|
/pipe-safer.c
|
||||||
/pipe2-safer.c
|
|
||||||
/pipe2.c
|
|
||||||
/printf-args.c
|
|
||||||
/printf-args.h
|
|
||||||
/printf-frexp.c
|
|
||||||
/printf-frexp.h
|
|
||||||
/printf-frexpl.c
|
|
||||||
/printf-frexpl.h
|
|
||||||
/printf-parse.c
|
|
||||||
/printf-parse.h
|
|
||||||
/printf.c
|
|
||||||
/progname.c
|
|
||||||
/progname.h
|
|
||||||
/quote.c
|
/quote.c
|
||||||
/quote.h
|
/quote.h
|
||||||
/quotearg.c
|
/quotearg.c
|
||||||
/quotearg.h
|
/quotearg.h
|
||||||
/raise.c
|
|
||||||
/rawmemchr.c
|
|
||||||
/rawmemchr.valgrind
|
|
||||||
/realloc.c
|
|
||||||
/ref-add.sed
|
/ref-add.sed
|
||||||
/ref-add.sin
|
/ref-add.sin
|
||||||
/ref-del.sed
|
/ref-del.sed
|
||||||
/ref-del.sin
|
/ref-del.sin
|
||||||
/sched.h
|
|
||||||
/sched.in.h
|
|
||||||
/sig-handler.h
|
|
||||||
/sigaction.c
|
|
||||||
/signal.h
|
|
||||||
/signal.in.h
|
|
||||||
/signbitd.c
|
|
||||||
/signbitf.c
|
|
||||||
/signbitl.c
|
|
||||||
/sigprocmask.c
|
|
||||||
/size_max.h
|
|
||||||
/snprintf.c
|
|
||||||
/spawn-pipe.c
|
|
||||||
/spawn-pipe.h
|
|
||||||
/spawn.h
|
|
||||||
/spawn.in.h
|
|
||||||
/spawn_faction_addclose.c
|
|
||||||
/spawn_faction_adddup2.c
|
|
||||||
/spawn_faction_addopen.c
|
|
||||||
/spawn_faction_destroy.c
|
|
||||||
/spawn_faction_init.c
|
|
||||||
/spawn_int.h
|
|
||||||
/spawnattr_destroy.c
|
|
||||||
/spawnattr_init.c
|
|
||||||
/spawnattr_setflags.c
|
|
||||||
/spawnattr_setsigmask.c
|
|
||||||
/spawni.c
|
|
||||||
/spawnp.c
|
|
||||||
/sprintf.c
|
|
||||||
/stamp-h1
|
/stamp-h1
|
||||||
/stat.c
|
|
||||||
/stdbool.h
|
/stdbool.h
|
||||||
/stdbool.in.h
|
/stdbool.in.h
|
||||||
/stddef.h
|
/stdbool_.h
|
||||||
/stddef.in.h
|
/stddef.in.h
|
||||||
/stdint.h
|
/stdint.h
|
||||||
/stdint.in.h
|
/stdint.in.h
|
||||||
|
/stdint_.h
|
||||||
/stdio--.h
|
/stdio--.h
|
||||||
/stdio-impl.h
|
|
||||||
/stdio-safer.h
|
/stdio-safer.h
|
||||||
/stdio-write.c
|
|
||||||
/stdio.h
|
|
||||||
/stdio.in.h
|
|
||||||
/stdlib.h
|
/stdlib.h
|
||||||
/stdlib.in.h
|
/stdlib.in.h
|
||||||
|
/stdlib_.h
|
||||||
/stpcpy.c
|
/stpcpy.c
|
||||||
/strchrnul.c
|
|
||||||
/strchrnul.valgrind
|
|
||||||
/strdup.c
|
|
||||||
/streq.h
|
/streq.h
|
||||||
/strerror-override.c
|
|
||||||
/strerror-override.h
|
|
||||||
/strerror.c
|
/strerror.c
|
||||||
/strerror_r.c
|
|
||||||
/string.h
|
/string.h
|
||||||
/string.in.h
|
/string.in.h
|
||||||
|
/string_.h
|
||||||
/stripslash.c
|
/stripslash.c
|
||||||
/strndup.c
|
/strndup.c
|
||||||
/strnlen.c
|
/strnlen.c
|
||||||
/strnlen1.c
|
|
||||||
/strnlen1.h
|
|
||||||
/strtol.c
|
/strtol.c
|
||||||
/strtoul.c
|
/strtoul.c
|
||||||
/strverscmp.c
|
/strverscmp.c
|
||||||
/sys
|
/strverscmp.h
|
||||||
/sys_ioctl.h
|
|
||||||
/sys_ioctl.in.h
|
|
||||||
/sys_socket.h
|
|
||||||
/sys_socket.in.h
|
|
||||||
/sys_stat.h
|
|
||||||
/sys_stat.in.h
|
|
||||||
/sys_wait.h
|
|
||||||
/sys_wait.in.h
|
|
||||||
/sysexits.in.h
|
|
||||||
/time.h
|
|
||||||
/time.in.h
|
|
||||||
/unistd--.h
|
/unistd--.h
|
||||||
/unistd-safer.h
|
/unistd-safer.h
|
||||||
/unistd.h
|
/unistd.h
|
||||||
/unistd.in.h
|
/unistd.in.h
|
||||||
|
/unistd_.h
|
||||||
/unitypes.h
|
/unitypes.h
|
||||||
/unitypes.in.h
|
|
||||||
/uniwidth
|
/uniwidth
|
||||||
/uniwidth.h
|
/uniwidth.h
|
||||||
/uniwidth.in.h
|
|
||||||
/unlocked-io.h
|
/unlocked-io.h
|
||||||
/unsetenv.c
|
/unsetenv.c
|
||||||
/vasnprintf.c
|
|
||||||
/vasnprintf.h
|
|
||||||
/verify.h
|
/verify.h
|
||||||
/vfprintf.c
|
|
||||||
/vsnprintf.c
|
|
||||||
/vsprintf.c
|
|
||||||
/w32sock.h
|
|
||||||
/w32spawn.h
|
|
||||||
/wait-process.c
|
|
||||||
/wait-process.h
|
|
||||||
/waitpid.c
|
|
||||||
/warn-on-use.h
|
|
||||||
/wchar.h
|
/wchar.h
|
||||||
/wchar.in.h
|
/wchar.in.h
|
||||||
|
/wchar_.h
|
||||||
/wctype.h
|
/wctype.h
|
||||||
/wctype.in.h
|
/wctype.in.h
|
||||||
|
/wctype_.h
|
||||||
/wcwidth.c
|
/wcwidth.c
|
||||||
|
/wcwidth.h
|
||||||
/xalloc-die.c
|
/xalloc-die.c
|
||||||
/xalloc-oversized.h
|
|
||||||
/xalloc.h
|
/xalloc.h
|
||||||
/xmalloc.c
|
/xmalloc.c
|
||||||
/xsize.h
|
|
||||||
/xstrndup.c
|
/xstrndup.c
|
||||||
/xstrndup.h
|
/xstrndup.h
|
||||||
/xmemdup0.c
|
|
||||||
/xmemdup0.h
|
|
||||||
/sys_types.in.h
|
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
# Make bison/lib.
|
|
||||||
|
|
||||||
# Copyright (C) 2001-2004, 2006, 2008-2012 Free Software Foundation,
|
|
||||||
# Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
AM_CFLAGS =
|
|
||||||
AM_CPPFLAGS =
|
|
||||||
BUILT_SOURCES =
|
|
||||||
CLEANFILES =
|
|
||||||
EXTRA_DIST =
|
|
||||||
MOSTLYCLEANDIRS =
|
|
||||||
MOSTLYCLEANFILES =
|
|
||||||
SUFFIXES =
|
|
||||||
noinst_LIBRARIES =
|
|
||||||
|
|
||||||
include gnulib.mk
|
|
||||||
|
|
||||||
AM_CFLAGS += $(WARN_CFLAGS)
|
|
||||||
|
|
||||||
# Implementation of bitsets.
|
|
||||||
bitsets_sources = \
|
|
||||||
abitset.c abitset.h bbitset.h bitset.c bitset.h bitset_stats.c \
|
|
||||||
bitset_stats.h bitsetv.c bitsetv.h ebitset.c ebitset.h lbitset.c \
|
|
||||||
lbitset.h libiberty.h vbitset.c vbitset.h
|
|
||||||
|
|
||||||
# Additional bitset operations.
|
|
||||||
additional_bitsets_sources = \
|
|
||||||
bitsetv-print.h bitsetv-print.c
|
|
||||||
|
|
||||||
# timevars, stolen from GCC.
|
|
||||||
timevars_sources = \
|
|
||||||
timevar.h timevar.c timevar.def
|
|
||||||
|
|
||||||
# Non-gnulib sources in Bison's internal library.
|
|
||||||
libbison_a_SOURCES += \
|
|
||||||
get-errno.h get-errno.c \
|
|
||||||
$(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
|
|
||||||
|
|
||||||
# The Yacc compatibility library.
|
|
||||||
lib_LIBRARIES = $(YACC_LIBRARY)
|
|
||||||
EXTRA_LIBRARIES = liby.a
|
|
||||||
liby_a_SOURCES = main.c yyerror.c
|
|
||||||
+1
-4
@@ -1,8 +1,5 @@
|
|||||||
/* Array bitsets.
|
/* Array bitsets.
|
||||||
|
Copyright (C) 2002, 2003, 2006, 2009 Free Software Foundation, Inc.
|
||||||
Copyright (C) 2002-2003, 2006, 2009-2012 Free Software Foundation,
|
|
||||||
Inc.
|
|
||||||
|
|
||||||
Contributed by Michael Hayes ([email protected]).
|
Contributed by Michael Hayes ([email protected]).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+1
-3
@@ -1,7 +1,5 @@
|
|||||||
/* Functions to support abitsets.
|
/* Functions to support abitsets.
|
||||||
|
Copyright (C) 2002, 2004, 2009 Free Software Foundation, Inc.
|
||||||
Copyright (C) 2002, 2004, 2009-2012 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Contributed by Michael Hayes ([email protected]).
|
Contributed by Michael Hayes ([email protected]).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
+1
-3
@@ -1,8 +1,6 @@
|
|||||||
/* Base bitset stuff.
|
/* Base bitset stuff.
|
||||||
|
Copyright (C) 2002, 2003, 2004, 2006, 2009 Free Software Foundation,
|
||||||
Copyright (C) 2002-2004, 2006, 2009-2012 Free Software Foundation,
|
|
||||||
Inc.
|
Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes ([email protected]).
|
Contributed by Michael Hayes ([email protected]).
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user