mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-08 10:15:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72c5b9828e | ||
|
|
bd02cd5d3a | ||
|
|
9126263e13 | ||
|
|
fa6aa7b3dd | ||
|
|
013cb7f4e1 | ||
|
|
d30b312dfe | ||
|
|
64f10cfe7e | ||
|
|
138d4cd916 | ||
|
|
8f7e2e1ff2 | ||
|
|
f55efa38ef | ||
|
|
2c5fa059a3 | ||
|
|
f3d88f7c7a | ||
|
|
096c9f9d64 | ||
|
|
0f664b89d4 | ||
|
|
1cfe6375ce | ||
|
|
8452fdd914 | ||
|
|
74c52fc840 | ||
|
|
8e55b3aac2 | ||
|
|
59c5ac7244 | ||
|
|
118d497883 | ||
|
|
7020f1e9e2 | ||
|
|
59da312bc7 | ||
|
|
2bb3ebec21 | ||
|
|
2643e36cff | ||
|
|
333e670c85 | ||
|
|
798096e1de | ||
|
|
e021811add | ||
|
|
9ca7f077a0 | ||
|
|
42ee26bb96 | ||
|
|
b1cc23c4e3 | ||
|
|
ab7f29f8f9 | ||
|
|
80d2c3adcc | ||
|
|
f8cec99b70 | ||
|
|
455ff80eac | ||
|
|
c2a9899730 | ||
|
|
e9ab707766 | ||
|
|
691972493b | ||
|
|
988a9d670d | ||
|
|
a6580aa38b | ||
|
|
21449d7337 | ||
|
|
5c70666cf7 | ||
|
|
38b5fb0c18 | ||
|
|
f3a4495d67 | ||
|
|
a924ef368d | ||
|
|
389c8cfd1c | ||
|
|
29b6015c38 | ||
|
|
5d1cfef46d | ||
|
|
e2dcf9964a | ||
|
|
3a74df7a5b | ||
|
|
327cd1f209 | ||
|
|
247b8c214c | ||
|
|
da730230ce | ||
|
|
408476bca9 | ||
|
|
d4a26c4832 | ||
|
|
ef1b427325 | ||
|
|
0f6cd9e3f8 | ||
|
|
d80fb37a26 | ||
|
|
1bb2bd75f0 | ||
|
|
a005a9c4dc | ||
|
|
cff03fb2b9 | ||
|
|
66f0441da3 | ||
|
|
d0ee410565 | ||
|
|
e8b1fb9b99 | ||
|
|
2f7a96b58f | ||
|
|
be252c3968 | ||
|
|
f4101aa612 | ||
|
|
727a14014b | ||
|
|
6aeb9c579b | ||
|
|
d7be408576 | ||
|
|
730739e41d | ||
|
|
d9df47b656 | ||
|
|
c373bf8bb8 | ||
|
|
32f19b6b47 | ||
|
|
255a6b901a | ||
|
|
31984206a7 | ||
|
|
88c7874756 | ||
|
|
b7a7016204 | ||
|
|
36c48187a6 | ||
|
|
cd4a9a598f | ||
|
|
a0de5091fc | ||
|
|
4c20d18dc1 | ||
|
|
95134bc179 | ||
|
|
85a6eb13f8 | ||
|
|
fc8b70bf14 | ||
|
|
25f6da67d3 | ||
|
|
f506ad1cbf | ||
|
|
21f1b063d8 | ||
|
|
793fbca50a | ||
|
|
35b8730d01 | ||
|
|
7dc4a6940c | ||
|
|
d4bd229569 | ||
|
|
34cdeddfa5 | ||
|
|
d782395d52 | ||
|
|
3f999f78be | ||
|
|
ca2cc7aeec | ||
|
|
bbeff19643 | ||
|
|
9fb1f8d8f7 | ||
|
|
dc6025ffeb | ||
|
|
a4f75309f2 | ||
|
|
ad5feac4e2 | ||
|
|
41d7a5f24d | ||
|
|
6d8e724de2 | ||
|
|
922bdd7ffa | ||
|
|
1b17b01d0f | ||
|
|
9987d1b3cc | ||
|
|
f16b08196c | ||
|
|
728c4be290 | ||
|
|
5d31a2162d | ||
|
|
91661ebbe3 | ||
|
|
a2ea208d82 | ||
|
|
cbd5054909 | ||
|
|
eb1b07409f | ||
|
|
9d774affba | ||
|
|
b541ffdf2c | ||
|
|
10159d2a67 | ||
|
|
953b39351a | ||
|
|
6ce2d93a9b | ||
|
|
ce3448d5b9 | ||
|
|
8a86eef0fa | ||
|
|
71b61d4db5 | ||
|
|
b1a8161341 | ||
|
|
2a6b783def | ||
|
|
14462c2b1b | ||
|
|
efa02545e0 | ||
|
|
61fee93ecb | ||
|
|
0c650a2027 | ||
|
|
5a43d4184f | ||
|
|
f124d4233f | ||
|
|
75ad86eebd | ||
|
|
5967f0cf59 | ||
|
|
b09f4f4851 | ||
|
|
9b33de72cd | ||
|
|
bbb44d83f8 | ||
|
|
2955354793 | ||
|
|
01b477c6b6 | ||
|
|
7cfc1553a3 | ||
|
|
a7309d7d90 | ||
|
|
0d1c1cab3c | ||
|
|
7ac22ca61d | ||
|
|
90f09655c1 | ||
|
|
122bea3ab9 | ||
|
|
ea3bcc0fcb | ||
|
|
c4d505179a | ||
|
|
50a843778a | ||
|
|
7b30971d7b | ||
|
|
9611cfa20b | ||
|
|
0bf9249152 | ||
|
|
d3b129885f | ||
|
|
28b806cbd5 | ||
|
|
f57a753663 | ||
|
|
6404a5bf3f | ||
|
|
1ab41b2a2e | ||
|
|
c7c8ecd1df | ||
|
|
2c061cb015 | ||
|
|
12ab1c9dd1 | ||
|
|
e4e0963996 | ||
|
|
d7e0a1a776 | ||
|
|
deee93a132 | ||
|
|
574add857a | ||
|
|
e785ccf715 | ||
|
|
1cfe1ed7c8 | ||
|
|
0049ec8628 | ||
|
|
8a93f8e60c | ||
|
|
2c2b72205a | ||
|
|
b2b81dae23 | ||
|
|
c1d19e10c3 | ||
|
|
8405b70c05 | ||
|
|
87b0a37597 | ||
|
|
3eb82471fa | ||
|
|
148d66d861 | ||
|
|
665f0c2454 | ||
|
|
592d0b1eb5 | ||
|
|
5f340b4884 | ||
|
|
d4bdb91677 | ||
|
|
a7867f53b3 | ||
|
|
830c9b1847 | ||
|
|
db89d400f2 | ||
|
|
a8c2e813f2 | ||
|
|
279cabb657 | ||
|
|
bb32f4f284 | ||
|
|
7cff04b572 | ||
|
|
a4e25e1dec | ||
|
|
e37c665c41 | ||
|
|
7d2d521fb8 | ||
|
|
e0ac9b4bb0 | ||
|
|
78143faa16 | ||
|
|
8f7ebfc81f | ||
|
|
5c80250c8d | ||
|
|
7ecec4ddf9 | ||
|
|
16dc6a9ebf | ||
|
|
e9813cd4f8 | ||
|
|
6afc30cc87 | ||
|
|
7eb8a0bcca | ||
|
|
3fc65ead4d | ||
|
|
1c7b7e1d87 | ||
|
|
08af01c2fc | ||
|
|
8e0a5e9e73 | ||
|
|
95021767a1 | ||
|
|
f6857bbf8c | ||
|
|
7c0c61812d | ||
|
|
28e52c0d62 | ||
|
|
9603498306 | ||
|
|
945e396c8a | ||
|
|
7d59638490 | ||
|
|
7172e23e8f | ||
|
|
2e7944cbb2 | ||
|
|
c3d503425f | ||
|
|
94ebeba53f | ||
|
|
a063317885 | ||
|
|
8646b6a3fd | ||
|
|
9baf4d74a6 | ||
|
|
2352216441 | ||
|
|
bb010fe51a | ||
|
|
2d212f8ca6 | ||
|
|
e6e704dc78 | ||
|
|
fd575f05a4 | ||
|
|
5e6feb866a | ||
|
|
0e021770cc | ||
|
|
db06f0ce72 | ||
|
|
5691bf57fb | ||
|
|
791934e4b5 | ||
|
|
ee5abb379b | ||
|
|
16ca01f9bf | ||
|
|
ab8e7e1a82 | ||
|
|
9bf32be3a0 | ||
|
|
f02e2948bd | ||
|
|
38eb7751e4 | ||
|
|
bd9d212b13 | ||
|
|
3f7ca62853 | ||
|
|
178e123eec | ||
|
|
8def5cd0c3 | ||
|
|
ea17f233e6 | ||
|
|
55a30bda17 | ||
|
|
8589431355 | ||
|
|
02975b9aad | ||
|
|
287b314eef | ||
|
|
3ebecc240d | ||
|
|
26b8a43805 | ||
|
|
b0f4c4eaa1 | ||
|
|
40cb301cd8 | ||
|
|
76290368d4 | ||
|
|
405d53b724 | ||
|
|
07c39ae908 | ||
|
|
580b892607 | ||
|
|
4502eadc2f | ||
|
|
7746c8f63d | ||
|
|
ff8d8df2e6 | ||
|
|
eb09565001 | ||
|
|
ac564be451 | ||
|
|
17bd8a736a | ||
|
|
89eb3c7653 | ||
|
|
ba7560e26b | ||
|
|
31283fc38a | ||
|
|
12e3584054 | ||
|
|
f91b162944 | ||
|
|
519d000408 | ||
|
|
a501eca911 | ||
|
|
67a9768ed4 | ||
|
|
2cbe6b7f8f | ||
|
|
f209868ed0 | ||
|
|
b36e835baa | ||
|
|
179de98b6e | ||
|
|
e557d3eac6 | ||
|
|
27bd5d67d1 | ||
|
|
136a0f766b | ||
|
|
10f429ef19 | ||
|
|
c4bd5bf7c5 | ||
|
|
231ed89af1 | ||
|
|
46356ea426 | ||
|
|
cf2a5f7c47 | ||
|
|
fcab4a2ee2 | ||
|
|
35fe08345e | ||
|
|
dd4bf07827 | ||
|
|
efdd742137 | ||
|
|
f317f99734 | ||
|
|
96a1981a77 | ||
|
|
c1630a8b80 | ||
|
|
90b9908d8c | ||
|
|
cf8067530b | ||
|
|
0e2f006a23 | ||
|
|
e3ddc1e355 | ||
|
|
01e972b3f5 | ||
|
|
c63d3e90b3 | ||
|
|
e70f46d132 | ||
|
|
a92be413b2 | ||
|
|
3b2942e671 | ||
|
|
41f58bae8b | ||
|
|
3acc03086e | ||
|
|
4f82b42a9d | ||
|
|
3fa3725adb | ||
|
|
31c10e38db |
+4
-5
@@ -1,6 +1,8 @@
|
||||
*.cache
|
||||
*.flc
|
||||
*.patch *.log log patches applied
|
||||
*.prj
|
||||
.version
|
||||
ABOUT-NLS
|
||||
COPYING
|
||||
INSTALL
|
||||
@@ -10,20 +12,17 @@ _*
|
||||
a.exe
|
||||
a.out
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
b.out
|
||||
bison-*
|
||||
conf[0-9]*
|
||||
confdefs*
|
||||
config.cache
|
||||
config.h
|
||||
config.hin
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
configure.lineno
|
||||
conftest*
|
||||
intl
|
||||
javacomp.sh
|
||||
javaexec.sh
|
||||
patches
|
||||
releases
|
||||
stamp-h*
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
@VERSION@
|
||||
@@ -1,285 +1,626 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
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
|
||||
this service 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.
|
||||
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 make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
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 give the recipients all the rights that
|
||||
you have. 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.
|
||||
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.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
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.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
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.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
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.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
0. Definitions.
|
||||
|
||||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
"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.
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
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.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
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.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
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.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
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.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
1. Source Code.
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
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.
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
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.
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
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 source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
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.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program 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.
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
2. 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.
|
||||
|
||||
3. 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.
|
||||
|
||||
4. 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.
|
||||
|
||||
5. 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:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) 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".
|
||||
|
||||
c) 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.
|
||||
|
||||
d) 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.
|
||||
|
||||
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.
|
||||
|
||||
6. 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:
|
||||
|
||||
a) 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.
|
||||
|
||||
b) 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.
|
||||
|
||||
c) 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.
|
||||
|
||||
d) 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.
|
||||
|
||||
e) 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.
|
||||
|
||||
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.
|
||||
|
||||
7. 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:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) 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
|
||||
|
||||
c) 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
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) 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.
|
||||
|
||||
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.
|
||||
|
||||
8. 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.
|
||||
|
||||
9. 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.
|
||||
|
||||
10. 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.
|
||||
|
||||
11. 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.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
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.
|
||||
|
||||
12. 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
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
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.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
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.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
14. Revised Versions of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
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 a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
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.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
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.
|
||||
|
||||
NO WARRANTY
|
||||
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.
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE 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.
|
||||
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.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
16. 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.
|
||||
|
||||
17. 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 OF TERMS AND CONDITIONS
|
||||
|
||||
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
|
||||
@@ -287,15 +628,15 @@ 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
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -304,37 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
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 your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
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
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This 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 Library General
|
||||
Public License instead of this License.
|
||||
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
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
+23
-10
@@ -4,21 +4,20 @@
|
||||
# It is necessary if you want to build targets usually of interest
|
||||
# only to the maintainer.
|
||||
|
||||
# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001, 2003, 2006-2007, 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Systems where /bin/sh is not the default shell need this. The $(shell)
|
||||
# command below won't work with e.g. stock DOS/Windows shells.
|
||||
@@ -40,14 +39,28 @@ ifeq ($(have-Makefile),yes)
|
||||
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
|
||||
|
||||
include Makefile
|
||||
|
||||
# Ensure that $(VERSION) is up to date for dist-related targets, but not
|
||||
# for others: rerunning autoconf and recompiling everything isn't cheap.
|
||||
ifeq (0,$(MAKELEVEL))
|
||||
_is-dist-target = $(filter dist% alpha beta major,$(MAKECMDGOALS))
|
||||
ifneq (,$(_is-dist-target))
|
||||
_curr-ver := $(shell build-aux/git-version-gen .version)
|
||||
ifneq ($(_curr-ver),$(VERSION))
|
||||
$(info INFO: rerunning autoconf for new version string: $(_curr-ver))
|
||||
dummy := $(shell rm -rf autom4te.cache; $(AUTOCONF))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
include $(srcdir)/Makefile.cfg
|
||||
include $(srcdir)/Makefile.maint
|
||||
|
||||
else
|
||||
|
||||
all:
|
||||
@echo There seems to be no Makefile in this directory.
|
||||
@echo "You must run ./configure before running \`make'."
|
||||
@echo There seems to be no Makefile in this directory. 1>&2
|
||||
@echo "You must run ./configure before running \`make'." 1>&2
|
||||
@exit 1
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
-*- outline -*-
|
||||
|
||||
This file attempts to describe the rules to use when hacking Bison.
|
||||
Don't put this file into the distribution. Don't mention it in the
|
||||
ChangeLog.
|
||||
Don't put this file into the distribution.
|
||||
|
||||
Everything related to the development of Bison is on Savannah:
|
||||
|
||||
@@ -57,6 +56,18 @@ release:
|
||||
- runs the parsers under Valgrind.
|
||||
- runs the test suite with G++ as C compiler...
|
||||
|
||||
- run `make maintainer-push-check', which runs `make maintainer-check'
|
||||
while activating the push implementation and its pull interface wrappers
|
||||
in many test cases that were originally written to exercise only the
|
||||
pull implementation. This makes certain the push implementation can
|
||||
perform every task the pull implementation can.
|
||||
|
||||
- run `make maintainer-xml-check', which runs `make maintainer-check'
|
||||
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
|
||||
Bison's included XSLT style sheets with the output of --report=all and
|
||||
--graph.
|
||||
|
||||
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
||||
instance, `-traditional' to check that the parsers are K&R. Note
|
||||
that it does not make sense for glr.c, which should be ANSI,
|
||||
@@ -92,6 +103,8 @@ 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.).
|
||||
FIXME: `make alpha' is not maintained and is broken. These
|
||||
instructions need to be replaced or removed.
|
||||
|
||||
If it fails, you're on your own...
|
||||
|
||||
@@ -108,7 +121,7 @@ In configure.ac. Run `make', check this in.
|
||||
Complete/fix the announcement file, and send it at least to
|
||||
[email protected] (if a real release, or a ``serious beta''),
|
||||
[email protected], [email protected], [email protected],
|
||||
and [email protected].
|
||||
and [email protected].
|
||||
|
||||
Send the same announcement on the comp.compilers newsgroup by sending
|
||||
email to [email protected]. Do not make any Cc as the moderator will
|
||||
@@ -118,21 +131,19 @@ separate message.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
GNU Bison 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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GNU Bison is distributed in the hope that it will be useful,
|
||||
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 GNU Bison; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
+24
-17
@@ -1,24 +1,23 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
||||
## Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
# 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/>.
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = build-aux po runtime-po lib data src doc examples tests
|
||||
SUBDIRS = build-aux po runtime-po lib data src doc examples tests etc
|
||||
|
||||
# Files installed for use by Automake.
|
||||
aclocaldir = @aclocaldir@
|
||||
@@ -29,9 +28,17 @@ EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
|
||||
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
||||
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
||||
djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \
|
||||
djgpp/fnchange.lst
|
||||
djgpp/fnchange.lst djgpp/testsuite.sed
|
||||
|
||||
|
||||
.PHONY: maintainer-check
|
||||
maintainer-check:
|
||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||
|
||||
.PHONY: maintainer-push-check
|
||||
maintainer-push-check:
|
||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||
|
||||
.PHONY: maintainer-xml-check
|
||||
maintainer-xml-check:
|
||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||
|
||||
+20
-33
@@ -1,48 +1,35 @@
|
||||
# Customize Makefile.maint for Bison. -*- makefile -*-
|
||||
# Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Customize Makefile.maint. -*- makefile -*-
|
||||
# Copyright (C) 2003, 2005, 2006, 2007 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
|
||||
# the Free Software Foundation; either version 2, or (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
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
build_aux_dir = $(srcdir)/build-aux
|
||||
prev_version_file = $(build_aux_dir)/prev-version.txt
|
||||
announce_gen = $(build_aux_dir)/announce-gen
|
||||
release_archive_dir = releases
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Use alpha.gnu.org for alpha and beta releases.
|
||||
# Use ftp.gnu.org for major releases.
|
||||
gnu_ftp_host-alpha = alpha
|
||||
gnu_ftp_host-beta = alpha
|
||||
gnu_ftp_host-major = ftp
|
||||
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 = \
|
||||
ftp://$(gnu_rel_host).gnu.org/gnu/bison
|
||||
ftp://$(gnu_rel_host)/gnu/bison
|
||||
|
||||
# Files to update automatically.
|
||||
wget_files = \
|
||||
$(build_aux_dir)/config.guess \
|
||||
$(build_aux_dir)/config.sub \
|
||||
$(build_aux_dir)/texinfo.tex \
|
||||
# Tests not to run as part of "make distcheck".
|
||||
# Exclude changelog-check here so that there's less churn in ChangeLog
|
||||
# files -- otherwise, you'd need to have the upcoming version number
|
||||
# at the top of the file for each `make distcheck' run.
|
||||
local-checks-to-skip = changelog-check
|
||||
|
||||
cvs_files = \
|
||||
$(build_aux_dir)/install-sh \
|
||||
$(build_aux_dir)/mdate-sh \
|
||||
$(build_aux_dir)/missing \
|
||||
$(build_aux_dir)/mkinstalldirs
|
||||
|
||||
# Tests not to run.
|
||||
local-checks-to-skip = \
|
||||
changelog-check
|
||||
# The local directory containing the checked-out copy of gnulib used in
|
||||
# this release. Used solely to get a date for the "announcement" target.
|
||||
gnulib_dir = /gnulib
|
||||
|
||||
+13
-15
@@ -3,21 +3,19 @@
|
||||
# CPPI, Bison, and Autoconf.
|
||||
|
||||
## Copyright (C) 2001-2006 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2, or (at your option)
|
||||
## any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301, USA.
|
||||
|
||||
# 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/>.
|
||||
|
||||
# This is reported not to work with make-3.79.1
|
||||
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||
|
||||
@@ -1,6 +1,190 @@
|
||||
Bison News
|
||||
----------
|
||||
|
||||
Changes in version 2.3b (2008-05-27):
|
||||
|
||||
* The quotes around NAME that used to be required in the following directive
|
||||
are now deprecated:
|
||||
|
||||
%define NAME "VALUE"
|
||||
|
||||
* The directive `%pure-parser' is now deprecated in favor of:
|
||||
|
||||
%define api.pure
|
||||
|
||||
which has the same effect except that Bison is more careful to warn about
|
||||
unreasonable usage in the latter case.
|
||||
|
||||
* Push Parsing
|
||||
|
||||
Bison can now generate an LALR(1) parser in C with a push interface. That
|
||||
is, instead of invoking `yyparse', which pulls tokens from `yylex', you can
|
||||
push one token at a time to the parser using `yypush_parse', which will
|
||||
return to the caller after processing each token. By default, the push
|
||||
interface is disabled. Either of the following directives will enable it:
|
||||
|
||||
%define api.push_pull "push" // Just push; does not require yylex.
|
||||
%define api.push_pull "both" // Push and pull; requires yylex.
|
||||
|
||||
See the new section `A Push Parser' in the Bison manual for details.
|
||||
|
||||
The current push parsing interface is experimental and may evolve. More user
|
||||
feedback will help to stabilize it.
|
||||
|
||||
* The -g and --graph options now output graphs in Graphviz DOT format,
|
||||
not VCG format. Like --graph, -g now also takes an optional FILE argument
|
||||
and thus cannot be bundled with other short options.
|
||||
|
||||
* Java
|
||||
|
||||
Bison can now generate an LALR(1) parser in Java. The skeleton is
|
||||
`data/lalr1.java'. Consider using the new %language directive instead of
|
||||
%skeleton to select it.
|
||||
|
||||
See the new section `Java Parsers' in the Bison manual for details.
|
||||
|
||||
The current Java interface is experimental and may evolve. More user
|
||||
feedback will help to stabilize it.
|
||||
|
||||
* %language
|
||||
|
||||
This new directive specifies the programming language of the generated
|
||||
parser, which can be C (the default), C++, or Java. This directive affects
|
||||
the skeleton used and the names of the generated files if the grammar file's
|
||||
name ends in ".y".
|
||||
|
||||
* XML Automaton Report
|
||||
|
||||
Bison can now generate an XML report of the LALR(1) automaton using the new
|
||||
`--xml' option. The current XML schema is experimental and may evolve. More
|
||||
user feedback will help to stabilize it.
|
||||
|
||||
* The grammar file may now specify the name of the parser header file using
|
||||
%defines. For example:
|
||||
|
||||
%defines "parser.h"
|
||||
|
||||
* When reporting useless rules, useless nonterminals, and unused terminals,
|
||||
Bison now employs the terms "useless in grammar" instead of "useless",
|
||||
"useless in parser" instead of "never reduced", and "unused in grammar"
|
||||
instead of "unused".
|
||||
|
||||
* Unreachable State Removal
|
||||
|
||||
Previously, Bison sometimes generated parser tables containing unreachable
|
||||
states. A state can become unreachable during conflict resolution if Bison
|
||||
disables a shift action leading to it from a predecessor state. Bison now:
|
||||
|
||||
1. Removes unreachable states.
|
||||
|
||||
2. Does not report any conflicts that appeared in unreachable states.
|
||||
WARNING: As a result, you may need to update %expect and %expect-rr
|
||||
directives in existing grammar files.
|
||||
|
||||
3. For any rule used only in such states, Bison now reports the rule as
|
||||
"useless in parser due to conflicts".
|
||||
|
||||
This feature can be disabled with the following directive:
|
||||
|
||||
%define lr.keep_unreachable_states
|
||||
|
||||
See the %define entry in the `Bison Declaration Summary' in the Bison manual
|
||||
for further discussion.
|
||||
|
||||
* Lookahead Set Correction in the `.output' Report
|
||||
|
||||
When instructed to generate a `.output' file including lookahead sets
|
||||
(using `--report=lookahead', for example), Bison now prints each reduction's
|
||||
lookahead set only next to the associated state's one item that (1) is
|
||||
associated with the same rule as the reduction and (2) has its dot at the end
|
||||
of its RHS. Previously, Bison also erroneously printed the lookahead set
|
||||
next to all of the state's other items associated with the same rule. This
|
||||
bug affected only the `.output' file and not the generated parser source
|
||||
code.
|
||||
|
||||
* --report-file=FILE is a new option to override the default `.output' file
|
||||
name.
|
||||
|
||||
* The `=' that used to be required in the following directives is now
|
||||
deprecated:
|
||||
|
||||
%file-prefix "parser"
|
||||
%name-prefix "c_"
|
||||
%output "parser.c"
|
||||
|
||||
* An Alternative to `%{...%}' -- `%code QUALIFIER {CODE}'
|
||||
|
||||
Bison 2.3a provided a new set of directives as a more flexible alternative to
|
||||
the traditional Yacc prologue blocks. Those have now been consolidated into
|
||||
a single %code directive with an optional qualifier field, which identifies
|
||||
the purpose of the code and thus the location(s) where Bison should generate
|
||||
it:
|
||||
|
||||
1. `%code {CODE}' replaces `%after-header {CODE}'
|
||||
2. `%code requires {CODE}' replaces `%start-header {CODE}'
|
||||
3. `%code provides {CODE}' replaces `%end-header {CODE}'
|
||||
4. `%code top {CODE}' replaces `%before-header {CODE}'
|
||||
|
||||
See the %code entries in section `Bison Declaration Summary' in the Bison
|
||||
manual for a summary of the new functionality. See the new section `Prologue
|
||||
Alternatives' for a detailed discussion including the advantages of %code
|
||||
over the traditional Yacc prologues.
|
||||
|
||||
The prologue alternatives are experimental. More user feedback will help to
|
||||
determine whether they should become permanent features.
|
||||
|
||||
* Revised warning: unset or unused mid-rule values
|
||||
|
||||
Since Bison 2.2, Bison has warned about mid-rule values that are set but not
|
||||
used within any of the actions of the parent rule. For example, Bison warns
|
||||
about unused $2 in:
|
||||
|
||||
exp: '1' { $$ = 1; } '+' exp { $$ = $1 + $4; };
|
||||
|
||||
Now, Bison also warns about mid-rule values that are used but not set. For
|
||||
example, Bison warns about unset $$ in the mid-rule action in:
|
||||
|
||||
exp: '1' { $1 = 1; } '+' exp { $$ = $2 + $4; };
|
||||
|
||||
However, Bison now disables both of these warnings by default since they
|
||||
sometimes prove to be false alarms in existing grammars employing the Yacc
|
||||
constructs $0 or $-N (where N is some positive integer).
|
||||
|
||||
To enable these warnings, specify the option `--warnings=midrule-values' or
|
||||
`-W', which is a synonym for `--warnings=all'.
|
||||
|
||||
* Default %destructor or %printer with `<*>' or `<>'
|
||||
|
||||
Bison now recognizes two separate kinds of default %destructor's and
|
||||
%printer's:
|
||||
|
||||
1. Place `<*>' in a %destructor/%printer symbol list to define a default
|
||||
%destructor/%printer for all grammar symbols for which you have formally
|
||||
declared semantic type tags.
|
||||
|
||||
2. Place `<>' in a %destructor/%printer symbol list to define a default
|
||||
%destructor/%printer for all grammar symbols without declared semantic
|
||||
type tags.
|
||||
|
||||
Bison no longer supports the `%symbol-default' notation from Bison 2.3a.
|
||||
`<*>' and `<>' combined achieve the same effect with one exception: Bison no
|
||||
longer applies any %destructor to a mid-rule value if that mid-rule value is
|
||||
not actually ever referenced using either $$ or $n in a semantic action.
|
||||
|
||||
The default %destructor's and %printer's are experimental. More user
|
||||
feedback will help to determine whether they should become permanent
|
||||
features.
|
||||
|
||||
See the section `Freeing Discarded Symbols' in the Bison manual for further
|
||||
details.
|
||||
|
||||
* %left, %right, and %nonassoc can now declare token numbers. This is required
|
||||
by POSIX. However, see the end of section `Operator Precedence' in the Bison
|
||||
manual for a caveat concerning the treatment of literal strings.
|
||||
|
||||
* The nonfunctional --no-parser, -n, and %no-parser options have been
|
||||
completely removed from Bison.
|
||||
|
||||
Changes in version 2.3a, 2006-09-13:
|
||||
|
||||
* Instead of %union, you can define and use your own union type
|
||||
@@ -34,6 +218,10 @@ Changes in version 2.3a, 2006-09-13:
|
||||
also prints its line number to `stdout'. It performs only the second
|
||||
`%destructor' in this case, so it invokes `free' only once.
|
||||
|
||||
[Although we failed to mention this here in the 2.3a release, the default
|
||||
%destructor's and %printer's were experimental, and they were rewritten in
|
||||
future versions.]
|
||||
|
||||
* Except for LALR(1) parsers in C with POSIX Yacc emulation enabled (with `-y',
|
||||
`--yacc', or `%yacc'), Bison no longer generates #define statements for
|
||||
associating token numbers with token names. Removing the #define statements
|
||||
@@ -104,6 +292,9 @@ Changes in version 2.3a, 2006-09-13:
|
||||
If you have multiple occurrences of any one of the above declarations, Bison
|
||||
will concatenate the contents in declaration order.
|
||||
|
||||
[Although we failed to mention this here in the 2.3a release, the prologue
|
||||
alternatives were experimental, and they were rewritten in future versions.]
|
||||
|
||||
* The option `--report=look-ahead' has been changed to `--report=lookahead'.
|
||||
The old spelling still works, but is not documented and may be removed
|
||||
in a future release.
|
||||
@@ -818,21 +1009,19 @@ End:
|
||||
-----
|
||||
|
||||
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
||||
2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
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 autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -40,17 +40,15 @@ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
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 autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -25,17 +25,15 @@ Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
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 autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
+5
-7
@@ -16,17 +16,15 @@ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
GNU Bison 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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GNU Bison is distributed in the hope that it will be useful,
|
||||
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 Bison; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
+28
-27
@@ -1,24 +1,24 @@
|
||||
-*- outline -*-
|
||||
|
||||
These notes intend to help people working on the CVS versions of
|
||||
Bison.
|
||||
These notes intend to help people working on the checked-out sources.
|
||||
These requirements do not apply when building from a distribution tarball.
|
||||
|
||||
* Requirements
|
||||
|
||||
Only the sources are installed in the CVS repository (to ease the
|
||||
maintenance, merges etc.), therefore you will have to get the latest
|
||||
stable versions of the maintainer tools we depend upon, including:
|
||||
We've opted to keep only the highest-level sources in the repository.
|
||||
This eases our maintenance burden, (fewer merges etc.), but imposes more
|
||||
requirements on anyone wishing to build from the just-checked-out sources.
|
||||
For example, you have to use the latest stable versions of the maintainer
|
||||
tools we depend upon, including:
|
||||
|
||||
- Automake <http://www.gnu.org/software/automake/>
|
||||
- Autoconf <http://www.gnu.org/software/autoconf/>
|
||||
- Flex <http://www.gnu.org/software/flex/>
|
||||
- Gettext <http://www.gnu.org/software/gettext/>
|
||||
- Gzip <http://www.gnu.org/software/gzip/>
|
||||
- Perl <http://www.cpan.org/>
|
||||
- Rsync <http://samba.anu.edu.au/rsync/>
|
||||
- Tar <http://www.gnu.org/software/tar/>
|
||||
- Wget <http://www.gnu.org/software/wget/>
|
||||
|
||||
As of this writing, the latest stable version of Gzip is 1.2.4 but we
|
||||
suggest using test version 1.3.5 (or later, if one becomes available).
|
||||
|
||||
Valgrind <http://valgrind.org/> is also highly recommended, if
|
||||
Valgrind supports your architecture.
|
||||
@@ -29,27 +29,31 @@ generated from the grammars is out of date, and to bootstrap with an
|
||||
out-of-date version of the C code, but the process is not foolproof.
|
||||
Also, you may run into similar problems yourself if you modify Bison.
|
||||
|
||||
Only building the initial full source tree will be a bit painful,
|
||||
later, a plain `cvs update -P && make' should be sufficient.
|
||||
Only building the initial full source tree will be a bit painful.
|
||||
Later, after synchronizing from the repository a plain `make' should
|
||||
be sufficient.
|
||||
|
||||
* First CVS checkout
|
||||
* First checkout
|
||||
|
||||
Obviously, if you are reading these notes, you did manage to check out
|
||||
Bison from CVS. For the records, you will find all the relevant
|
||||
information on:
|
||||
this package from the repository. For the record, you will find all the
|
||||
relevant information on:
|
||||
|
||||
http://savannah.gnu.org/cvs/?group_id=56
|
||||
|
||||
The next step is asking the installation of all the missing files:
|
||||
The next step is to get other files needed to build, which are
|
||||
extracted from other source packages:
|
||||
|
||||
$ ./bootstrap
|
||||
|
||||
And there you are! Just
|
||||
|
||||
$ ./configure && make && make check
|
||||
$ ./configure
|
||||
$ make
|
||||
$ make check
|
||||
|
||||
At this point, there should be no difference between your local copy,
|
||||
and the CVS master copy:
|
||||
and the master copy:
|
||||
|
||||
$ cvs diff
|
||||
|
||||
@@ -59,21 +63,18 @@ Enjoy!
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
GNU Bison 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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GNU Bison is distributed in the hope that it will be useful,
|
||||
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 Bison; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
@@ -14,13 +14,6 @@ find something clean (not like YYLSP_NEEDED...).
|
||||
|
||||
* Installation
|
||||
|
||||
** Disable installation of yacc.
|
||||
|
||||
Add an option to 'configure' that allows people to install Bison
|
||||
without installing the yacc wrapper script or the rarely-used little
|
||||
yacc library required by Posix. This is for people who prefer some
|
||||
other implementation of yacc.
|
||||
|
||||
* Documentation
|
||||
Before releasing, make sure the documentation ("Understanding your
|
||||
parser") refers to the current `output' format.
|
||||
@@ -56,6 +49,9 @@ Provide better assistance for understanding the conflicts by providing
|
||||
a sample text exhibiting the (LALR) ambiguity. See the paper from
|
||||
DeRemer and Penello: they already provide the algorithm.
|
||||
|
||||
** Statically check for potential ambiguities in GLR grammars. See
|
||||
<http://www.i3s.unice.fr/~schmitz/papers.html#expamb> for an approach.
|
||||
|
||||
|
||||
* Extensions
|
||||
|
||||
@@ -151,23 +147,6 @@ Are there any Texinfo standards for bibliography?
|
||||
* Java, Fortran, etc.
|
||||
|
||||
|
||||
** Java
|
||||
|
||||
There are a couple of proposed outputs:
|
||||
|
||||
- BYACC/J
|
||||
which is based on Byacc.
|
||||
<http://troi.lincom-asg.com/~rjamison/byacc/>
|
||||
|
||||
- Bison Java
|
||||
which is based on Bison.
|
||||
<http://www.goice.co.jp/member/mo/hack-progs/bison-java.html>
|
||||
|
||||
Sebastien Serrurier ([email protected]) is working on this: he is
|
||||
expected to contact the authors, design the output, and implement it
|
||||
into Bison.
|
||||
|
||||
|
||||
* Coding system independence
|
||||
Paul notes:
|
||||
|
||||
@@ -189,10 +168,9 @@ Paul notes:
|
||||
Show reductions.
|
||||
|
||||
* Broken options ?
|
||||
** %no-parser
|
||||
** %token-table
|
||||
** Skeleton strategy
|
||||
Must we keep %no-parser? %token-table?
|
||||
Must we keep %token-table?
|
||||
|
||||
* src/print_graph.c
|
||||
Find the best graph parameters.
|
||||
@@ -228,9 +206,6 @@ It is unfortunate that there is a total order for precedence. It
|
||||
makes it impossible to have modular precedence information. We should
|
||||
move to partial orders (sounds like series/parallel orders to me).
|
||||
|
||||
This will be possible with a Bison parser for the grammar, as it will
|
||||
make it much easier to extend the grammar.
|
||||
|
||||
** Correlation b/w precedence and associativity
|
||||
Also, I fail to understand why we have to assign the same
|
||||
associativity to operators with the same precedence. For instance,
|
||||
@@ -310,9 +285,8 @@ at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
|
||||
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
|
||||
to bison. If you're interested, I'll work on a patch.
|
||||
|
||||
* Move to Graphviz
|
||||
Well, VCG seems really dead. Move to Graphviz instead. Also, equip
|
||||
the parser with a means to create the (visual) parse tree.
|
||||
* Better graphics
|
||||
Equip the parser with a means to create the (visual) parse tree.
|
||||
|
||||
-----
|
||||
|
||||
@@ -321,17 +295,15 @@ Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison 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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
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 Bison; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Bootstrap this package from CVS.
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (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
|
||||
@@ -15,29 +16,179 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Written by Paul Eggert.
|
||||
|
||||
package=bison
|
||||
|
||||
# Translation Project URL, for the registry of all projects.
|
||||
TP_URL='http://www.iro.umontreal.ca/translation/registry.cgi?domain='
|
||||
nl='
|
||||
'
|
||||
|
||||
# Ensure file names are sorted consistently across platforms.
|
||||
# Also, ensure diagnostics are in English, e.g., "wget --help" below.
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
local_gl_dir=gl
|
||||
|
||||
# Temporary directory names.
|
||||
bt='._bootmp'
|
||||
bt_regex=`echo "$bt"| sed 's/\./[.]/g'`
|
||||
bt2=${bt}2
|
||||
|
||||
usage() {
|
||||
echo >&2 "\
|
||||
Usage: $0 [OPTION]...
|
||||
Bootstrap this package from the checked-out sources.
|
||||
|
||||
Options:
|
||||
--gnulib-srcdir=DIRNAME Specify the local directory where gnulib
|
||||
sources reside. Use this if you already
|
||||
have gnulib sources on your machine, and
|
||||
do not want to waste your bandwidth downloading
|
||||
them again.
|
||||
--copy Copy files instead of creating symbolic links.
|
||||
--force Attempt to bootstrap even if the sources seem
|
||||
not to have been checked out.
|
||||
--skip-po Do not download po files.
|
||||
--cvs-user=USERNAME Set the username to use when checking out
|
||||
sources from the gnulib repository.
|
||||
|
||||
If the file bootstrap.conf exists in the current working directory, its
|
||||
contents are read as shell variables to configure the bootstrap.
|
||||
|
||||
Running without arguments will suffice in most cases.
|
||||
"
|
||||
}
|
||||
|
||||
# Configuration.
|
||||
|
||||
# Name of the Makefile.am
|
||||
gnulib_mk=gnulib.mk
|
||||
|
||||
# List of gnulib modules needed.
|
||||
gnulib_modules=
|
||||
|
||||
# Any gnulib files needed that are not in modules.
|
||||
gnulib_files=
|
||||
|
||||
# The command to download all .po files for a specified domain into
|
||||
# a specified directory. Fill in the first %s is the domain name, and
|
||||
# the second with the destination directory. Use rsync's -L and -r
|
||||
# options because the latest/%s directory and the .po files within are
|
||||
# all symlinks.
|
||||
po_download_command_format=\
|
||||
"rsync -Lrtvz 'translationproject.org::tp/latest/%s/' '%s'"
|
||||
|
||||
extract_package_name='
|
||||
/^AC_INIT(/{
|
||||
/.*,.*,.*,/{
|
||||
s///
|
||||
s/[][]//g
|
||||
p
|
||||
q
|
||||
}
|
||||
s/AC_INIT(\[*//
|
||||
s/]*,.*//
|
||||
s/^GNU //
|
||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
s/[^A-Za-z0-9_]/-/g
|
||||
p
|
||||
}
|
||||
'
|
||||
package=`sed -n "$extract_package_name" configure.ac` || exit
|
||||
gnulib_name=lib$package
|
||||
|
||||
build_aux=build-aux
|
||||
# Extra files from gnulib, which override files from other sources.
|
||||
gnulib_extra_files="
|
||||
$build_aux/install-sh
|
||||
$build_aux/missing
|
||||
$build_aux/mdate-sh
|
||||
$build_aux/texinfo.tex
|
||||
$build_aux/depcomp
|
||||
$build_aux/config.guess
|
||||
$build_aux/config.sub
|
||||
doc/INSTALL
|
||||
"
|
||||
|
||||
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
||||
gnulib_tool_option_extras=
|
||||
|
||||
# Other locale categories that need message catalogs.
|
||||
EXTRA_LOCALE_CATEGORIES=
|
||||
|
||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||
XGETTEXT_OPTIONS='\\\
|
||||
--flag=_:1:pass-c-format\\\
|
||||
--flag=N_:1:pass-c-format\\\
|
||||
--flag=error:3:c-format --flag=error_at_line:5:c-format\\\
|
||||
'
|
||||
|
||||
# Files we don't want to import.
|
||||
excluded_files=
|
||||
|
||||
# File that should exist in the top directory of a checked out hierarchy,
|
||||
# but not in a distribution tarball.
|
||||
checkout_only_file=README-hacking
|
||||
|
||||
# Whether to use copies instead of symlinks.
|
||||
copy=false
|
||||
|
||||
# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want
|
||||
# those files to be generated in directories like lib/, m4/, and po/.
|
||||
# Or set it to 'auto' to make this script select which to use based
|
||||
# on which version control system (if any) is used in the source directory.
|
||||
vc_ignore=auto
|
||||
|
||||
# find_tool ENVVAR NAMES...
|
||||
# -------------------------
|
||||
find_tool ()
|
||||
{
|
||||
# Find sha1sum, named gsha1sum on MacPorts.
|
||||
find_tool_envvar=$1
|
||||
shift
|
||||
if eval test x"\$$find_tool_envvar" = x; then
|
||||
for i
|
||||
do
|
||||
if ($i --version </dev/null) >/dev/null 2>&1; then
|
||||
find_tool_res=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if test x"$find_tool_res" = x; then
|
||||
echo >&2 "$0: $find_tool_name is required"
|
||||
exit 1
|
||||
fi
|
||||
($find_tool_res --version </dev/null) >/dev/null 2>&1 || {
|
||||
echo >&2 "$0: cannot run $find_tool_res --version"
|
||||
exit 1
|
||||
}
|
||||
eval "$find_tool_envvar=\"$find_tool_res\""
|
||||
eval "export $find_tool_envvar"
|
||||
}
|
||||
|
||||
# Find sha1sum, named gsha1sum on MacPorts.
|
||||
find_tool SHA1SUM sha1sum gsha1sum
|
||||
|
||||
# Override the default configuration, if necessary.
|
||||
test -r bootstrap.conf && . ./bootstrap.conf
|
||||
|
||||
if test "$vc_ignore" = auto; then
|
||||
vc_ignore=
|
||||
test -d .git && vc_ignore=.gitignore
|
||||
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
|
||||
fi
|
||||
|
||||
# Translate configuration into internal form.
|
||||
|
||||
# Parse options.
|
||||
|
||||
for option
|
||||
do
|
||||
case $option in
|
||||
--help)
|
||||
echo "$0: usage: $0 [--gnulib-srcdir=DIR] [--cvs-user=USERNAME] [--skip-po]"
|
||||
usage
|
||||
exit;;
|
||||
--gnulib-srcdir=*)
|
||||
GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
|
||||
@@ -45,13 +196,55 @@ do
|
||||
CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;;
|
||||
--skip-po)
|
||||
SKIP_PO=t;;
|
||||
--force)
|
||||
checkout_only_file=;;
|
||||
--copy)
|
||||
copy=true;;
|
||||
*)
|
||||
echo >&2 "$0: $option: unknown option"
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "$0: Bootstrapping CVS $package..."
|
||||
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||
echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If $STR is not already on a line by itself in $FILE, insert it,
|
||||
# sorting the new contents of the file and replacing $FILE with the result.
|
||||
insert_sorted_if_absent() {
|
||||
file=$1
|
||||
str=$2
|
||||
test -f $file || touch $file
|
||||
echo "$str" | sort -u - $file | cmp -s - $file \
|
||||
|| echo "$str" | sort -u - $file -o $file \
|
||||
|| exit 1
|
||||
}
|
||||
|
||||
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
||||
found_aux_dir=no
|
||||
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
|
||||
>/dev/null && found_aux_dir=yes
|
||||
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
|
||||
>/dev/null && found_aux_dir=yes
|
||||
if test $found_aux_dir = no; then
|
||||
echo "$0: expected line not found in configure.ac. Add the following:" >&2
|
||||
echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If $build_aux doesn't exist, create it now, otherwise some bits
|
||||
# below will malfunction. If creating it, also mark it as ignored.
|
||||
if test ! -d $build_aux; then
|
||||
mkdir $build_aux
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
insert_sorted_if_absent $dot_ig $build_aux
|
||||
done
|
||||
fi
|
||||
|
||||
echo "$0: Bootstrapping from checked-out $package sources..."
|
||||
|
||||
cleanup_gnulib() {
|
||||
status=$?
|
||||
@@ -77,12 +270,12 @@ case ${GNULIB_SRCDIR--} in
|
||||
esac
|
||||
|
||||
case $CVS_RSH in
|
||||
'') export CVS_RSH=ssh;;
|
||||
'') CVS_RSH=ssh; export CVS_RSH;;
|
||||
esac
|
||||
|
||||
trap cleanup_gnulib 1 2 13 15
|
||||
|
||||
cvs -z3 -q -d ${CVS_PREFIX}cvs.savannah.gnu.org:/cvsroot/gnulib co gnulib ||
|
||||
cvs -z3 -q -d ${CVS_PREFIX}pserver.git.sv.gnu.org:/gnulib.git co -d gnulib HEAD ||
|
||||
cleanup_gnulib
|
||||
|
||||
trap - 1 2 13 15
|
||||
@@ -93,253 +286,365 @@ esac
|
||||
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||
<$gnulib_tool || exit
|
||||
|
||||
gnulib_modules='
|
||||
argmatch
|
||||
dirname
|
||||
error
|
||||
extensions
|
||||
fopen-safer
|
||||
getopt
|
||||
gettext
|
||||
hash
|
||||
malloc
|
||||
mbswidth
|
||||
obstack
|
||||
quote
|
||||
quotearg
|
||||
stdbool
|
||||
stdint
|
||||
stpcpy
|
||||
strerror
|
||||
strtoul
|
||||
strverscmp
|
||||
unistd-safer
|
||||
unlocked-io
|
||||
verify
|
||||
xalloc
|
||||
xalloc-die
|
||||
xstrndup
|
||||
'
|
||||
|
||||
previous_gnulib_modules=
|
||||
while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
|
||||
previous_gnulib_modules=$gnulib_modules
|
||||
gnulib_modules=`
|
||||
(echo "$gnulib_modules"
|
||||
for gnulib_module in $gnulib_modules; do
|
||||
$gnulib_tool --extract-dependencies $gnulib_module
|
||||
done) | sort -u
|
||||
`
|
||||
done
|
||||
|
||||
gnulib_files=`
|
||||
(echo m4/warning.m4
|
||||
for gnulib_module in $gnulib_modules; do
|
||||
$gnulib_tool --extract-filelist $gnulib_module
|
||||
done) | sort -u
|
||||
`
|
||||
|
||||
gnulib_dirs=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
|
||||
mkdir -p $gnulib_dirs || exit
|
||||
|
||||
for gnulib_file in $gnulib_files; do
|
||||
dest=$gnulib_file
|
||||
rm -f $dest &&
|
||||
echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
|
||||
cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
|
||||
done
|
||||
|
||||
# This suppresses a bogus diagnostic
|
||||
# "warning: macro `AM_LANGINFO_CODESET' not found in library".
|
||||
echo "$0: patching m4/gettext.m4 to remove need for intl/* ..."
|
||||
sed '
|
||||
/^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
|
||||
AC_DEFUN([AM_INTL_SUBDIR], [])
|
||||
/^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\
|
||||
AC_DEFUN([gt_INTL_SUBDIR_CORE], [])
|
||||
' m4/gettext.m4 >m4/gettext_gl.m4 || exit
|
||||
|
||||
|
||||
# Get translations.
|
||||
|
||||
get_translations() {
|
||||
download_po_files() {
|
||||
subdir=$1
|
||||
domain=$2
|
||||
|
||||
echo "$0: getting translations into $subdir for $domain..."
|
||||
(cd $subdir && rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'`) &&
|
||||
cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
|
||||
eval "$cmd"
|
||||
}
|
||||
|
||||
$WGET_COMMAND -O "$subdir/$domain.html" "$TP_URL$domain" &&
|
||||
# Download .po files to $po_dir/.reference and copy only the new
|
||||
# or modified ones into $po_dir. Also update $po_dir/LINGUAS.
|
||||
update_po_files() {
|
||||
# Directory containing primary .po files.
|
||||
# Overwrite them only when we're sure a .po file is new.
|
||||
po_dir=$1
|
||||
domain=$2
|
||||
|
||||
sed -n 's|.*"http://[^"]*/translation/teams/PO/\([^/"]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\1.\2|p' <"$subdir/$domain.html" |
|
||||
sort -k 1,1 -k 2,2n -k2,2 -k3,3n -k3,3 -k4,4n -k4,4 -k5,5n -k5.5 |
|
||||
awk -F. '
|
||||
{ if (lang && $1 != lang) print lang, ver }
|
||||
{ lang = $1; ver = substr($0, index($0, ".") + 1) }
|
||||
END { if (lang) print lang, ver }
|
||||
' | awk -v domain="$domain" -v subdir="$subdir" '
|
||||
{
|
||||
lang = $1
|
||||
# Download *.po files into this dir.
|
||||
# Usually contains *.s1 checksum files.
|
||||
ref_po_dir="$po_dir/.reference"
|
||||
|
||||
# Work around bugs in Bison 2.3 translations uncovered by gettext 0.15.
|
||||
# This workaround can be removed once the translations are fixed.
|
||||
if (lang == "id" || lang == "tr") next
|
||||
test -d $ref_po_dir || mkdir $ref_po_dir || return
|
||||
download_po_files $ref_po_dir $domain \
|
||||
&& ls "$ref_po_dir"/*.po 2>/dev/null |
|
||||
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS"
|
||||
|
||||
ver = $2
|
||||
urlfmt = ""
|
||||
printf "$WGET_COMMAND -O %s/%s.po 'http://www.iro.umontreal.ca/translation/teams/PO/%s/%s-%s.%s.po' &&\n", subdir, lang, lang, domain, ver, lang
|
||||
}
|
||||
END { print ":" }
|
||||
' | sh &&
|
||||
ls "$subdir"/*.po | sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" &&
|
||||
rm "$subdir/$domain.html"
|
||||
for po in `cd $ref_po_dir && echo *.po|sed 's/\.po//g'`; do
|
||||
new_po="$ref_po_dir/$po.po"
|
||||
cksum_file="$ref_po_dir/$po.s1"
|
||||
if ! "$SHA1SUM" -c --status "$cksum_file" < "$new_po" > /dev/null; then
|
||||
echo "updated $po_dir/$po.po..."
|
||||
cp "$new_po" "$po_dir/$po.po" && "$SHA1SUM" < "$new_po" > "$cksum_file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
case $SKIP_PO in
|
||||
'')
|
||||
case `wget --help` in
|
||||
*'--no-cache'*)
|
||||
no_cache='--no-cache';;
|
||||
*'--cache=on/off'*)
|
||||
no_cache='--cache=off';;
|
||||
*)
|
||||
no_cache='';;
|
||||
esac
|
||||
if test -d po; then
|
||||
update_po_files po $package || exit
|
||||
fi
|
||||
|
||||
WGET_COMMAND="wget -nv $no_cache"
|
||||
export WGET_COMMAND
|
||||
|
||||
get_translations po $package || exit
|
||||
|
||||
case $package in
|
||||
bison)
|
||||
get_translations runtime-po $package-runtime || exit
|
||||
esac;;
|
||||
if test -d runtime-po; then
|
||||
update_po_files runtime-po $package-runtime || exit
|
||||
fi;;
|
||||
esac
|
||||
|
||||
check_dst_dir()
|
||||
{
|
||||
dst=$1
|
||||
# If the destination directory doesn't exist, create it.
|
||||
# This is required at least for "lib/uniwidth/cjk.h".
|
||||
dst_dir=`dirname "$dst"`
|
||||
if ! test -d "$dst_dir"; then
|
||||
mkdir -p "$dst_dir"
|
||||
|
||||
# Generate autoconf and automake snippets.
|
||||
# If we've just created a directory like lib/uniwidth,
|
||||
# tell version control system(s) it's ignorable.
|
||||
# FIXME: for now, this does only one level
|
||||
parent=`dirname "$dst_dir"`
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
ig=$parent/$dot_ig
|
||||
insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'`
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
(echo '# This file is generated automatically by "bootstrap".' &&
|
||||
echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
|
||||
$gnulib_tool --extract-autoconf-snippet $gnulib_modules |
|
||||
sed 's/AM_GNU_GETTEXT(\[external]/&, [need-ngettext]/' &&
|
||||
echo '])'
|
||||
) >m4/gnulib.m4 || exit
|
||||
symlink_to_dir()
|
||||
{
|
||||
src=$1/$2
|
||||
dst=${3-$2}
|
||||
|
||||
(echo '# This file is generated automatically by "bootstrap".' &&
|
||||
$gnulib_tool --extract-automake-snippet $gnulib_modules |
|
||||
sed 's/^[ ]*AM_CPPFLAGS[ ]*+=/# (commented out by bootstrap) &/'
|
||||
) >lib/gnulib.mk || exit
|
||||
test -f "$src" && {
|
||||
|
||||
check_dst_dir "$dst"
|
||||
|
||||
if $copy; then
|
||||
{
|
||||
test ! -h "$dst" || {
|
||||
echo "$0: rm -f $dst" &&
|
||||
rm -f "$dst"
|
||||
}
|
||||
} &&
|
||||
test -f "$dst" &&
|
||||
cmp -s "$src" "$dst" || {
|
||||
echo "$0: cp -fp $src $dst" &&
|
||||
cp -fp "$src" "$dst"
|
||||
}
|
||||
else
|
||||
test -h "$dst" &&
|
||||
src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
|
||||
dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
|
||||
test "$src_i" = "$dst_i" || {
|
||||
dot_dots=
|
||||
case $src in
|
||||
/*) ;;
|
||||
*)
|
||||
case /$dst/ in
|
||||
*//* | */../* | */./* | /*/*/*/*/*/)
|
||||
echo >&2 "$0: invalid symlink calculation: $src -> $dst"
|
||||
exit 1;;
|
||||
/*/*/*/*/) dot_dots=../../../;;
|
||||
/*/*/*/) dot_dots=../../;;
|
||||
/*/*/) dot_dots=../;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
echo "$0: ln -fs $dot_dots$src $dst" &&
|
||||
ln -fs "$dot_dots$src" "$dst"
|
||||
}
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
cp_mark_as_generated()
|
||||
{
|
||||
cp_src=$1
|
||||
cp_dst=$2
|
||||
|
||||
if cmp -s "$cp_src" "$GNULIB_SRCDIR/$cp_dst"; then
|
||||
symlink_to_dir "$GNULIB_SRCDIR" "$cp_dst"
|
||||
elif cmp -s "$cp_src" "$local_gl_dir/$cp_dst"; then
|
||||
symlink_to_dir $local_gl_dir "$cp_dst"
|
||||
else
|
||||
case $cp_dst in
|
||||
*.[ch]) c1='/* '; c2=' */';;
|
||||
*.texi) c1='@c '; c2= ;;
|
||||
*.m4|*/Make*|Make*) c1='# ' ; c2= ;;
|
||||
*) c1= ; c2= ;;
|
||||
esac
|
||||
|
||||
if test -z "$c1"; then
|
||||
cmp -s "$cp_src" "$cp_dst" || {
|
||||
echo "$0: cp -f $cp_src $cp_dst" &&
|
||||
rm -f "$cp_dst" &&
|
||||
sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst"
|
||||
}
|
||||
else
|
||||
check_dst_dir "$cp_dst"
|
||||
# Copy the file first to get proper permissions if it
|
||||
# doesn't already exist. Then overwrite the copy.
|
||||
cp "$cp_src" "$cp_dst-t" &&
|
||||
(
|
||||
echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" &&
|
||||
echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" &&
|
||||
sed "s!$bt_regex/!!g" "$cp_src"
|
||||
) > $cp_dst-t &&
|
||||
if cmp -s "$cp_dst-t" "$cp_dst"; then
|
||||
rm -f "$cp_dst-t"
|
||||
else
|
||||
echo "$0: cp $cp_src $cp_dst # with edits" &&
|
||||
mv -f "$cp_dst-t" "$cp_dst"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
version_controlled_file() {
|
||||
dir=$1
|
||||
file=$2
|
||||
found=no
|
||||
if test -d CVS; then
|
||||
grep -F "/$file/" $dir/CVS/Entries 2>/dev/null |
|
||||
grep '^/[^/]*/[0-9]' > /dev/null && found=yes
|
||||
elif test -d .git; then
|
||||
git-rm -n "$dir/$file" > /dev/null 2>&1 && found=yes
|
||||
else
|
||||
echo "$0: no version control for $dir/$file?" >&2
|
||||
fi
|
||||
test $found = yes
|
||||
}
|
||||
|
||||
slurp() {
|
||||
for dir in . `(cd $1 && find * -type d -print)`; do
|
||||
copied=
|
||||
sep=
|
||||
for file in `ls -a $1/$dir`; do
|
||||
case $file in
|
||||
.|..) continue;;
|
||||
.*) continue;; # FIXME: should all file names starting with "." be ignored?
|
||||
esac
|
||||
test -d $1/$dir/$file && continue
|
||||
for excluded_file in $excluded_files; do
|
||||
test "$dir/$file" = "$excluded_file" && continue 2
|
||||
done
|
||||
if test $file = Makefile.am; then
|
||||
copied=$copied${sep}$gnulib_mk; sep=$nl
|
||||
remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g"
|
||||
sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/$gnulib_mk || {
|
||||
echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
|
||||
rm -f $dir/$gnulib_mk &&
|
||||
sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk
|
||||
}
|
||||
elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
|
||||
version_controlled_file $dir $file; then
|
||||
echo "$0: $dir/$file overrides $1/$dir/$file"
|
||||
else
|
||||
copied=$copied$sep$file; sep=$nl
|
||||
if test $file = gettext.m4; then
|
||||
echo "$0: patching m4/gettext.m4 to remove need for intl/* ..."
|
||||
rm -f $dir/$file
|
||||
sed '
|
||||
/^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
|
||||
AC_DEFUN([AM_INTL_SUBDIR], [
|
||||
/^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\
|
||||
AC_DEFUN([gt_INTL_SUBDIR_CORE], [])
|
||||
$a\
|
||||
AC_DEFUN([gl_LOCK_EARLY], [])
|
||||
' $1/$dir/$file >$dir/$file
|
||||
else
|
||||
cp_mark_as_generated $1/$dir/$file $dir/$file
|
||||
fi
|
||||
fi || exit
|
||||
done
|
||||
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
ig=$dir/$dot_ig
|
||||
if test -n "$copied"; then
|
||||
insert_sorted_if_absent $ig "$copied"
|
||||
# If an ignored file name ends with _.h, then also add
|
||||
# the name with just ".h". Many gnulib headers are generated,
|
||||
# e.g., stdint_.h -> stdint.h, dirent_.h ->..., etc.
|
||||
# Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed
|
||||
f=`echo "$copied"|sed 's/_\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'`
|
||||
insert_sorted_if_absent $ig "$f"
|
||||
|
||||
# For files like sys_stat_.h and sys_time_.h, record as
|
||||
# ignorable the directory we might eventually create: sys/.
|
||||
f=`echo "$copied"|sed 's/sys_.*_\.h$/sys/'`
|
||||
insert_sorted_if_absent $ig "$f"
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# Create boot temporary directories to import from gnulib and gettext.
|
||||
rm -fr $bt $bt2 &&
|
||||
mkdir $bt $bt2 || exit
|
||||
|
||||
# Import from gnulib.
|
||||
|
||||
gnulib_tool_options="\
|
||||
--import\
|
||||
--no-changelog\
|
||||
--aux-dir $bt/$build_aux\
|
||||
--doc-base $bt/doc\
|
||||
--lib $gnulib_name\
|
||||
--m4-base $bt/m4/\
|
||||
--source-base $bt/lib/\
|
||||
--tests-base $bt/tests\
|
||||
--local-dir $local_gl_dir\
|
||||
$gnulib_tool_option_extras\
|
||||
"
|
||||
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
||||
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
|
||||
slurp $bt || exit
|
||||
|
||||
for file in $gnulib_files; do
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file || exit
|
||||
done
|
||||
|
||||
|
||||
# Import from gettext.
|
||||
with_gettext=yes
|
||||
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
|
||||
with_gettext=no
|
||||
|
||||
if test $with_gettext = yes; then
|
||||
echo "$0: (cd $bt2; autopoint) ..."
|
||||
cp configure.ac $bt2 &&
|
||||
(cd $bt2 && autopoint && rm configure.ac) &&
|
||||
slurp $bt2 $bt || exit
|
||||
|
||||
rm -fr $bt $bt2 || exit
|
||||
fi
|
||||
|
||||
# Coreutils is unusual in that it generates some of its test-related
|
||||
# Makefile.am files. That must be done before invoking automake.
|
||||
mam_template=tests/Makefile.am.in
|
||||
if test -f $mam_template; then
|
||||
PERL=perl
|
||||
for tool in cut head join pr sort tac tail test tr uniq wc; do
|
||||
m=tests/$tool/Makefile.am
|
||||
t=${m}t
|
||||
rm -f $m $t
|
||||
sed -n '1,/^##test-files-begin/p' $mam_template > $t
|
||||
echo "x = $tool" >> $t
|
||||
srcdir=tests/$tool
|
||||
$PERL -I$srcdir -w -- tests/mk-script $srcdir --list >> $t
|
||||
sed -n '/^##test-files-end/,$p' $mam_template >> $t
|
||||
chmod -w $t
|
||||
mv $t $m
|
||||
done
|
||||
fi
|
||||
|
||||
# Reconfigure, getting other files.
|
||||
|
||||
echo "$0: autopoint --force ..."
|
||||
autopoint --force || exit
|
||||
|
||||
# We don't need intl, so remove it.
|
||||
intl_files_to_remove='
|
||||
intl
|
||||
m4/codeset.m4
|
||||
m4/gettext.m4
|
||||
m4/glibc2.m4
|
||||
m4/glibc21.m4
|
||||
m4/intdiv0.m4
|
||||
m4/intmax.m4
|
||||
m4/inttypes-h.m4
|
||||
m4/inttypes-pri.m4
|
||||
m4/lcmessage.m4
|
||||
m4/lock.m4
|
||||
m4/longdouble.m4
|
||||
m4/printf-posix.m4
|
||||
m4/signed.m4
|
||||
m4/size_max.m4
|
||||
m4/visibility.m4
|
||||
m4/wint_t.m4
|
||||
m4/xsize.m4
|
||||
'
|
||||
echo $0: rm -fr $intl_files_to_remove ...
|
||||
rm -fr $intl_files_to_remove || exit
|
||||
|
||||
|
||||
# Undo changes to gnulib files that autoreconf made.
|
||||
for gnulib_file in $gnulib_files; do
|
||||
test ! -f $gnulib_file || cmp -s $gnulib_file $GNULIB_SRCDIR/$gnulib_file || {
|
||||
rm -f $gnulib_file &&
|
||||
echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file again" &&
|
||||
cp -p $GNULIB_SRCDIR/$gnulib_file $gnulib_file || exit
|
||||
}
|
||||
done
|
||||
|
||||
# Make sure aclocal.m4 is not older than input files.
|
||||
sleep 1
|
||||
|
||||
for command in \
|
||||
libtool \
|
||||
'aclocal --force -I m4' \
|
||||
'autoconf --force' \
|
||||
'autoheader --force' \
|
||||
'automake --add-missing --copy --force-missing';
|
||||
do
|
||||
if test "$command" = libtool; then
|
||||
grep '^[ ]*AM_PROG_LIBTOOL\>' configure.ac >/dev/null ||
|
||||
continue
|
||||
command='libtoolize -c -f'
|
||||
fi
|
||||
echo "$0: $command ..."
|
||||
$command || exit
|
||||
done
|
||||
|
||||
|
||||
# Put bug-reporting address into po/Makevars.
|
||||
echo "$0: Creating po/Makevars from po/Makevars.template ..."
|
||||
sed '
|
||||
/^MSGID_BUGS_ADDRESS *=/s/=.*/= [email protected]/
|
||||
/^XGETTEXT_OPTIONS *=/{
|
||||
s/$/ \\/
|
||||
a\
|
||||
--flag=_:1:pass-c-format \\\
|
||||
--flag=N_:1:pass-c-format \\\
|
||||
--flag=error:3:c-format --flag=error_at_line:5:c-format \\\
|
||||
--flag=warn:1:c-format --flag=warn_at:2:c-format \\\
|
||||
--flag=complain:1:c-format --flag=complain_at:2:c-format \\\
|
||||
--flag=fatal:1:c-format --flag=fatal_at:2:c-format
|
||||
}
|
||||
' po/Makevars.template >po/Makevars
|
||||
# Get some extra files from gnulib, overriding existing files.
|
||||
for file in $gnulib_extra_files; do
|
||||
case $file in
|
||||
*/INSTALL) dst=INSTALL;;
|
||||
build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
|
||||
*) dst=$file;;
|
||||
esac
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
|
||||
done
|
||||
|
||||
# Likewise for runtime-po/Makevars, except also change a few other parameters.
|
||||
sed '
|
||||
s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
|
||||
s/^\(subdir\) *=.*/\1 = runtime-po/
|
||||
s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
|
||||
' <po/Makevars >runtime-po/Makevars
|
||||
if test $with_gettext = yes; then
|
||||
# Create gettext configuration.
|
||||
echo "$0: Creating po/Makevars from po/Makevars.template ..."
|
||||
rm -f po/Makevars
|
||||
sed '
|
||||
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
|
||||
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
|
||||
/^XGETTEXT_OPTIONS *=/{
|
||||
s/$/ \\/
|
||||
a\
|
||||
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
|
||||
}
|
||||
' po/Makevars.template >po/Makevars
|
||||
|
||||
# Copy identical files from po to runtime-po.
|
||||
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||
if test -d runtime-po; then
|
||||
# Similarly for runtime-po/Makevars, but not quite the same.
|
||||
rm -f runtime-po/Makevars
|
||||
sed '
|
||||
/^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/
|
||||
/^subdir *=.*/s/=.*/= runtime-po/
|
||||
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
|
||||
/^XGETTEXT_OPTIONS *=/{
|
||||
s/$/ \\/
|
||||
a\
|
||||
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
|
||||
}
|
||||
' <po/Makevars.template >runtime-po/Makevars
|
||||
|
||||
# if src/parse-gram.[ch] are out of date, rebuild them.
|
||||
parse_gram_y=`find src/parse-gram.y \
|
||||
'(' -newer src/parse-gram.c -o -newer src/parse-gram.h ')' \
|
||||
-print` || exit
|
||||
case $parse_gram_y in
|
||||
?*)
|
||||
echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
|
||||
|
||||
echo "$0: touch -c src/parse-gram.[ch] ... "
|
||||
touch -c src/parse-gram.[ch] || exit
|
||||
|
||||
echo "$0: ./configure --disable-nls ..."
|
||||
./configure --disable-nls || exit
|
||||
|
||||
echo "$0: (cd lib && make) ..."
|
||||
(cd lib && make) || exit
|
||||
|
||||
echo "$0: (cd src && make) ..."
|
||||
(cd src && make) || exit
|
||||
|
||||
echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
|
||||
rm -f src/parse-gram.c src/parse-gram.h || exit
|
||||
|
||||
echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
|
||||
(cd src && make parse-gram.c parse-gram.h) || exit
|
||||
|
||||
echo "$0: make distclean ..."
|
||||
make distclean || exit;;
|
||||
esac
|
||||
# Copy identical files from po to runtime-po.
|
||||
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$0: done. Now you can run './configure'."
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# gnulib modules used by this package.
|
||||
gnulib_modules='
|
||||
argmatch config-h c-strcase configmake
|
||||
dirname error extensions fopen-safer git-version-gen
|
||||
getopt gettext hash inttypes javacomp-script javaexec-script malloc
|
||||
mbswidth obstack quote quotearg stdbool stpcpy strerror strtoul
|
||||
strverscmp unistd unistd-safer unlocked-io verify xalloc xalloc-die
|
||||
xstrndup
|
||||
'
|
||||
|
||||
# Any gnulib files needed that are not in modules.
|
||||
gnulib_files='
|
||||
m4/warning.m4
|
||||
'
|
||||
|
||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
|
||||
--from-code=UTF-8\\\
|
||||
--flag=asprintf:2:c-format\\\
|
||||
--flag=complain:1:c-format --flag=complain_at:2:c-format\\\
|
||||
--flag=fatal:1:c-format --flag=fatal_at:2:c-format\\\
|
||||
--flag=warn:1:c-format --flag=warn_at:2:c-format\\\
|
||||
--flag=unexpected_end:2:c-format\\\
|
||||
'
|
||||
XGETTEXT_OPTIONS_RUNTIME=$XGETTEXT_OPTIONS'\\\
|
||||
--keyword=YY_ \\\
|
||||
'
|
||||
|
||||
# Gettext supplies these files, but we don't need them since
|
||||
# we don't have an intl subdirectory.
|
||||
excluded_files='
|
||||
m4/codeset.m4
|
||||
m4/glibc2.m4
|
||||
m4/glibc21.m4
|
||||
m4/intdiv0.m4
|
||||
m4/intl.m4
|
||||
m4/intldir.m4
|
||||
m4/intmax.m4
|
||||
m4/inttypes_h.m4
|
||||
m4/lcmessage.m4
|
||||
m4/lock.m4
|
||||
m4/longdouble.m4
|
||||
m4/printf-posix.m4
|
||||
m4/signed.m4
|
||||
m4/size_max.m4
|
||||
m4/uintmax_t.m4
|
||||
m4/ulonglong.m4
|
||||
m4/visibility.m4
|
||||
m4/xsize.m4
|
||||
'
|
||||
@@ -1,13 +1,16 @@
|
||||
*.t
|
||||
Makefile
|
||||
Makefile.in
|
||||
compile
|
||||
config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
git-version-gen
|
||||
install-sh
|
||||
javacomp.sh.in
|
||||
javaexec.sh.in
|
||||
link-warning.h
|
||||
mdate-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
texinfo.tex
|
||||
ylwrap
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
EXTRA_DIST = prev-version.txt
|
||||
EXTRA_DIST = prev-version.txt cross-options.pl
|
||||
|
||||
@@ -1,338 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
# Generate an announcement message.
|
||||
use strict;
|
||||
|
||||
use Getopt::Long;
|
||||
use Digest::MD5;
|
||||
use Digest::SHA1;
|
||||
|
||||
(my $VERSION = '$Revision$ ') =~ tr/[0-9].//cd;
|
||||
(my $ME = $0) =~ s|.*/||;
|
||||
|
||||
my %valid_release_types = map {$_ => 1} qw (alpha beta major);
|
||||
|
||||
END
|
||||
{
|
||||
# Nobody ever checks the status of print()s. That's okay, because
|
||||
# if any do fail, we're guaranteed to get an indicator when we close()
|
||||
# the filehandle.
|
||||
#
|
||||
# Close stdout now, and if there were no errors, return happy status.
|
||||
# If stdout has already been closed by the script, though, do nothing.
|
||||
defined fileno STDOUT
|
||||
or return;
|
||||
close STDOUT
|
||||
and return;
|
||||
|
||||
# Errors closing stdout. Indicate that, and hope stderr is OK.
|
||||
warn "$ME: closing standard output: $!\n";
|
||||
|
||||
# Don't be so arrogant as to assume that we're the first END handler
|
||||
# defined, and thus the last one invoked. There may be others yet
|
||||
# to come. $? will be passed on to them, and to the final _exit().
|
||||
#
|
||||
# If it isn't already an error, make it one (and if it _is_ an error,
|
||||
# preserve the value: it might be important).
|
||||
$? ||= 1;
|
||||
}
|
||||
|
||||
sub usage ($)
|
||||
{
|
||||
my ($exit_code) = @_;
|
||||
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
|
||||
if ($exit_code != 0)
|
||||
{
|
||||
print $STREAM "Try `$ME --help' for more information.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
my @types = sort keys %valid_release_types;
|
||||
print $STREAM <<EOF;
|
||||
Usage: $ME [OPTIONS]
|
||||
|
||||
OPTIONS:
|
||||
|
||||
Generate an announcement message.
|
||||
|
||||
FIXME: describe the following
|
||||
|
||||
--release-type=TYPE TYPE must be one of @types
|
||||
--package-name=PACKAGE_NAME
|
||||
--previous-version=VER
|
||||
--current-version=VER
|
||||
--release-archive-directory=DIR
|
||||
--url-directory=URL_DIR
|
||||
--news=NEWS_FILE optional
|
||||
|
||||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
||||
EOF
|
||||
}
|
||||
exit $exit_code;
|
||||
}
|
||||
|
||||
sub print_changelog_deltas ($$)
|
||||
{
|
||||
my ($package_name, $prev_version) = @_;
|
||||
|
||||
# Print new ChangeLog entries.
|
||||
|
||||
# First find all CVS-controlled ChangeLog files.
|
||||
use File::Find;
|
||||
my @changelog;
|
||||
find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS'
|
||||
and push @changelog, $File::Find::name}},
|
||||
'.');
|
||||
|
||||
# If there are no ChangeLog files, we're done.
|
||||
@changelog
|
||||
or return;
|
||||
my %changelog = map {$_ => 1} @changelog;
|
||||
|
||||
# Reorder the list of files so that if there are ChangeLog
|
||||
# files in the specified directories, they're listed first,
|
||||
# in this order:
|
||||
my @dir = qw ( . src lib m4 config doc );
|
||||
|
||||
# A typical @changelog array might look like this:
|
||||
# ./ChangeLog
|
||||
# ./po/ChangeLog
|
||||
# ./m4/ChangeLog
|
||||
# ./lib/ChangeLog
|
||||
# ./doc/ChangeLog
|
||||
# ./config/ChangeLog
|
||||
my @reordered;
|
||||
foreach my $d (@dir)
|
||||
{
|
||||
my $dot_slash = $d eq '.' ? $d : "./$d";
|
||||
my $target = "$dot_slash/ChangeLog";
|
||||
delete $changelog{$target}
|
||||
and push @reordered, $target;
|
||||
}
|
||||
|
||||
# Append any remaining ChangeLog files.
|
||||
push @reordered, sort keys %changelog;
|
||||
|
||||
# Remove leading `./'.
|
||||
@reordered = map { s!^\./!!; $_ } @reordered;
|
||||
|
||||
print "\nChangeLog entries:\n\n";
|
||||
# print join ("\n", @reordered), "\n";
|
||||
|
||||
$prev_version =~ s/\./_/g;
|
||||
my $prev_cvs_tag = "\U$package_name\E-$prev_version";
|
||||
|
||||
my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered";
|
||||
open DIFF, '-|', $cmd
|
||||
or die "$ME: cannot run `$cmd': $!\n";
|
||||
# Print two types of lines, making minor changes:
|
||||
# Lines starting with `+++ ', e.g.,
|
||||
# +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247
|
||||
# and those starting with `+'.
|
||||
# Don't print the others.
|
||||
my $prev_printed_line_empty = 1;
|
||||
while (defined (my $line = <DIFF>))
|
||||
{
|
||||
if ($line =~ /^\+\+\+ /)
|
||||
{
|
||||
my $separator = "*"x70 ."\n";
|
||||
$line =~ s///;
|
||||
$line =~ s/\s.*//;
|
||||
$prev_printed_line_empty
|
||||
or print "\n";
|
||||
print $separator, $line, $separator;
|
||||
}
|
||||
elsif ($line =~ /^\+/)
|
||||
{
|
||||
$line =~ s///;
|
||||
print $line;
|
||||
$prev_printed_line_empty = ($line =~ /^$/);
|
||||
}
|
||||
}
|
||||
close DIFF;
|
||||
|
||||
# The exit code should be 1.
|
||||
# Allow in case there are no modified ChangeLog entries.
|
||||
$? == 256 || $? == 128
|
||||
or warn "$ME: warning: `cmd' had unexpected exit code or signal ($?)\n";
|
||||
}
|
||||
|
||||
{
|
||||
my $release_type;
|
||||
my $package_name;
|
||||
my $prev_version;
|
||||
my $curr_version;
|
||||
my $release_archive_dir;
|
||||
my @url_dir_list;
|
||||
my $news_file;
|
||||
|
||||
GetOptions
|
||||
(
|
||||
'release-type=s' => \$release_type,
|
||||
'package-name=s' => \$package_name,
|
||||
'previous-version=s' => \$prev_version,
|
||||
'current-version=s' => \$curr_version,
|
||||
'release-archive-directory=s' => \$release_archive_dir,
|
||||
'url-directory=s@' => \@url_dir_list,
|
||||
'news=s@' => \$news_file,
|
||||
|
||||
help => sub { usage 0 },
|
||||
version => sub { print "$ME version $VERSION\n"; exit },
|
||||
) or usage 1;
|
||||
|
||||
my $fail = 0;
|
||||
# Ensure that sure each required option is specified.
|
||||
$release_type
|
||||
or (warn "$ME: release type not specified\n"), $fail = 1;
|
||||
$package_name
|
||||
or (warn "$ME: package name not specified\n"), $fail = 1;
|
||||
$prev_version
|
||||
or (warn "$ME: previous version string not specified\n"), $fail = 1;
|
||||
$curr_version
|
||||
or (warn "$ME: current version string not specified\n"), $fail = 1;
|
||||
$release_archive_dir
|
||||
or (warn "$ME: release directory name not specified\n"), $fail = 1;
|
||||
@url_dir_list
|
||||
or (warn "$ME: URL directory name(s) not specified\n"), $fail = 1;
|
||||
|
||||
exists $valid_release_types{$release_type}
|
||||
or (warn "$ME: `$release_type': invalid release type\n"), $fail = 1;
|
||||
|
||||
@ARGV
|
||||
and (warn "$ME: too many arguments\n"), $fail = 1;
|
||||
$fail
|
||||
and usage 1;
|
||||
|
||||
my $my_distdir = "$package_name-$curr_version";
|
||||
my $tgz = "$my_distdir.tar.gz";
|
||||
my $tbz = "$my_distdir.tar.bz2";
|
||||
my $xd = "$package_name-$prev_version-$curr_version.xdelta";
|
||||
|
||||
my %size;
|
||||
|
||||
foreach my $f (($tgz, $tbz, $xd))
|
||||
{
|
||||
my $cmd = "du --human $f";
|
||||
my $t = `$cmd`;
|
||||
# FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
|
||||
$@
|
||||
and (warn "$ME: command failed: `$cmd'\n"), $fail = 1;
|
||||
chomp $t;
|
||||
$t =~ s/^([\d.]+[MkK]).*/${1}B/;
|
||||
$size{$f} = $t;
|
||||
}
|
||||
|
||||
$fail
|
||||
and exit 1;
|
||||
|
||||
# The markup is escaped as <\# so that when this script is sent by
|
||||
# mail (or part of a diff), Gnus is not triggered.
|
||||
print <<EOF;
|
||||
|
||||
Subject: $my_distdir released
|
||||
|
||||
<\#secure method=pgpmime mode=sign>
|
||||
|
||||
FIXME: put comments here
|
||||
|
||||
EOF
|
||||
|
||||
print "Here are the compressed sources:\n";
|
||||
foreach my $url (@url_dir_list)
|
||||
{
|
||||
print " $url/$tgz ($size{$tgz})\n";
|
||||
print " $url/$tbz ($size{$tbz})\n";
|
||||
}
|
||||
|
||||
print "\nAnd here are xdelta-style diffs:\n";
|
||||
foreach my $url (@url_dir_list)
|
||||
{
|
||||
print " $url/$xd ($size{$xd})\n";
|
||||
}
|
||||
|
||||
print "\nHere are GPG detached signatures:\n";
|
||||
foreach my $url (@url_dir_list)
|
||||
{
|
||||
print " $url/$tgz.asc\n";
|
||||
print " $url/$tbz.asc\n";
|
||||
}
|
||||
|
||||
# FIXME: clean up upon interrupt or die
|
||||
my $tmpdir = $ENV{TMPDIR} || '/tmp';
|
||||
my $tmp = "$tmpdir/$ME-$$";
|
||||
unlink $tmp; # ignore failure
|
||||
|
||||
print "\nHere are the MD5 and SHA1 signatures:\n";
|
||||
print "\n";
|
||||
# The markup is escaped as <\# so that when this script is sent by
|
||||
# mail (or part of a diff), Gnus is not triggered.
|
||||
print "<\#part type=text/plain filename=\"$tmp\" disposition=inline>\n"
|
||||
. "<\#/part>\n";
|
||||
|
||||
open OUT, '>', $tmp
|
||||
or die "$ME: $tmp: cannot open for writing: $!\n";
|
||||
|
||||
foreach my $meth (qw (md5 sha1))
|
||||
{
|
||||
foreach my $f (($tgz, $tbz, $xd))
|
||||
{
|
||||
open IN, '<', $f
|
||||
or die "$ME: $f: cannot open for reading: $!\n";
|
||||
binmode IN;
|
||||
my $dig =
|
||||
($meth eq 'md5'
|
||||
? Digest::MD5->new->addfile(*IN)->hexdigest
|
||||
: Digest::SHA1->new->addfile(*IN)->hexdigest);
|
||||
close IN;
|
||||
print OUT "$dig $f\n";
|
||||
}
|
||||
}
|
||||
|
||||
close OUT
|
||||
or die "$ME: $tmp: while writing: $!\n";
|
||||
chmod 0400, $tmp; # ignore failure
|
||||
|
||||
if ($news_file)
|
||||
{
|
||||
print "\nNEWS\n\n";
|
||||
|
||||
# Print all lines from $news_file, starting with the first one
|
||||
# that mentions $curr_version up to but not including
|
||||
# the first occurrence of $prev_version.
|
||||
my $in_items;
|
||||
open NEWS, '<', $news_file
|
||||
or die "$ME: $news_file: cannot open for reading: $!\n";
|
||||
while (defined (my $line = <NEWS>))
|
||||
{
|
||||
if ( ! $in_items)
|
||||
{
|
||||
# Match lines like this one:
|
||||
# * Major changes in release 5.0.1:
|
||||
# but not any other line that starts with a space, *, or -.
|
||||
$line =~ /^(\* Major changes.*|[^ *-].*)\Q$curr_version\E/o
|
||||
or next;
|
||||
$in_items = 1;
|
||||
print $line;
|
||||
}
|
||||
else
|
||||
{
|
||||
# Be careful that this regexp cannot match version numbers
|
||||
# in NEWS items -- they might well say `introduced in 4.5.5',
|
||||
# and we don't want that to match.
|
||||
$line =~ /^(\* Major changes.*|[^ *-].*)\Q$prev_version\E/o
|
||||
and last;
|
||||
print $line;
|
||||
}
|
||||
}
|
||||
close NEWS;
|
||||
|
||||
$in_items
|
||||
or die "$ME: $news_file: no matching lines for `$curr_version'\n";
|
||||
}
|
||||
|
||||
$release_type eq 'major'
|
||||
or print_changelog_deltas ($package_name, $prev_version);
|
||||
|
||||
exit 0;
|
||||
}
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use warnings;
|
||||
use 5.005;
|
||||
use strict;
|
||||
|
||||
my %option;
|
||||
while (<>)
|
||||
{
|
||||
if (/^\s* # Initial spaces.
|
||||
(?:(-\w),\s+)? # $1: Possible short option.
|
||||
(--[-\w]+) # $2: Long option.
|
||||
(\[?) # $3: '[' iff the argument is optional.
|
||||
(?:=([-\w]+))? # $4: Possible argument name.
|
||||
/x)
|
||||
{
|
||||
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
|
||||
$short = defined $short ? '@option{' . $short . '}' : '';
|
||||
if ($arg)
|
||||
{
|
||||
$arg =~ s/^=//;
|
||||
$arg = '@var{' . lc ($arg) . '}';
|
||||
$arg = '[' . $arg . ']'
|
||||
if $opt eq '[';
|
||||
$option{"$long=$arg"} = $short ? "$short $arg" : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$option{"$long"} = "$short";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $long (sort keys %option)
|
||||
{
|
||||
printf "\@item %-40s \@tab %s\n", '@option{' . $long . '}', $option{$long};
|
||||
}
|
||||
+45
-28
@@ -1,11 +1,11 @@
|
||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
|
||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
|
||||
# Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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,
|
||||
@@ -14,39 +14,42 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# We use macros like AC_CHECK_HEADERS_ONCE, so we need Autoconf 2.60 or better.
|
||||
AC_PREREQ(2.60)
|
||||
# We have strange test case titles, so we need Autoconf 2.61 or better.
|
||||
AC_PREREQ(2.61)
|
||||
|
||||
AC_INIT([GNU Bison], [2.3b], [[email protected]])
|
||||
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2008],
|
||||
[The copyright year for this package])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2008])
|
||||
|
||||
AC_INIT([GNU Bison], [2.3a], [[email protected]])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
||||
AM_INIT_AUTOMAKE([1.8 check-news readme-alpha dist-bzip2])
|
||||
AC_CONFIG_HEADERS([config.h:config.hin])
|
||||
|
||||
gl_USE_SYSTEM_EXTENSIONS
|
||||
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
||||
|
||||
# Checks for the compiler.
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_STDC
|
||||
AC_PROG_CC_STDC
|
||||
|
||||
# Gnulib (early checks).
|
||||
gl_EARLY
|
||||
|
||||
AC_ARG_ENABLE(gcc-warnings,
|
||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||
[case "${enableval}" in
|
||||
yes|no) ;;
|
||||
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
||||
esac],
|
||||
[enableval=no])
|
||||
[enableval=no])
|
||||
if test "${enableval}" = yes; then
|
||||
gl_WARNING_CFLAGS([-Werror])
|
||||
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
||||
WARNING_CFLAGS=
|
||||
gl_WARNING_CFLAGS([-Wextra -Wno-sign-compare])
|
||||
gl_WARNING_CFLAGS([-Wall])
|
||||
gl_WARNING_CFLAGS([-Wextra -Wno-sign-compare])
|
||||
gl_WARNING_CFLAGS([-Wcast-align])
|
||||
gl_WARNING_CFLAGS([-Wcast-qual])
|
||||
gl_WARNING_CFLAGS([-Wformat])
|
||||
@@ -88,23 +91,29 @@ if test x"$ac_cv_prog_gnu_m4" != xyes; then
|
||||
AC_MSG_ERROR([GNU M4 1.4 is required])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
||||
AM_MISSING_PROG([HELP2MAN], [help2man])
|
||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||
AC_SUBST([XSLTPROC])
|
||||
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS_ONCE([locale.h])
|
||||
AM_STDBOOL_H
|
||||
|
||||
# Checks for compiler characteristics.
|
||||
AC_C_INLINE
|
||||
|
||||
# Gnulib (later checks). Putting them here rather than right after
|
||||
# gl_EARLY avoids some redundant checks.
|
||||
gl_INIT
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||
AM_WITH_DMALLOC
|
||||
BISON_PREREQ_SUBPIPE
|
||||
BISON_PREREQ_TIMEVAR
|
||||
|
||||
# gnulib and gettext.
|
||||
GNULIB_AUTOCONF_SNIPPET
|
||||
# Gettext.
|
||||
# We've never tested with gettext versions before 0.15, so play it safe.
|
||||
AM_GNU_GETTEXT([external], [need-formatstring-macros])
|
||||
AM_GNU_GETTEXT_VERSION([0.15])
|
||||
BISON_I18N
|
||||
|
||||
@@ -114,6 +123,9 @@ AC_CONFIG_FILES([runtime-po/Makefile.in])
|
||||
aclocaldir='${datadir}/aclocal'
|
||||
AC_SUBST([aclocaldir])
|
||||
|
||||
# Create the benchmark script.
|
||||
AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
|
||||
|
||||
# Initialize the test suite.
|
||||
AC_CONFIG_TESTDIR(tests)
|
||||
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
||||
@@ -124,16 +136,21 @@ BISON_TEST_FOR_WORKING_CXX_COMPILER
|
||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||
# Needed by tests/atlocal.in.
|
||||
AC_SUBST([GCC])
|
||||
O0CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]] *//'`
|
||||
AC_SUBST([O0CFLAGS])
|
||||
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`
|
||||
AC_SUBST([O0CXXFLAGS])
|
||||
AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||
AC_SUBST([O0CXXFLAGS], [`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
build-aux/Makefile
|
||||
po/Makefile.in
|
||||
data/Makefile
|
||||
gt_JAVACOMP([1.3])
|
||||
gt_JAVAEXEC
|
||||
|
||||
AC_CONFIG_FILES([.version
|
||||
Makefile
|
||||
build-aux/Makefile
|
||||
po/Makefile.in
|
||||
data/Makefile
|
||||
etc/Makefile
|
||||
examples/Makefile
|
||||
examples/calc++/Makefile
|
||||
lib/Makefile src/Makefile doc/Makefile])
|
||||
lib/Makefile src/Makefile
|
||||
doc/Makefile
|
||||
doc/yacc.1])
|
||||
AC_OUTPUT
|
||||
|
||||
+24
-18
@@ -1,23 +1,29 @@
|
||||
## Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2002, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
# 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/>.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
|
||||
dist_pkgdata_DATA = README \
|
||||
c.m4 yacc.c glr.c \
|
||||
c++.m4 location.cc lalr1.cc glr.cc
|
||||
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 \
|
||||
java-skel.m4 java.m4 lalr1.java
|
||||
|
||||
m4sugardir = $(pkgdatadir)/m4sugar
|
||||
dist_m4sugar_DATA = m4sugar/m4sugar.m4
|
||||
|
||||
xsltdir = $(pkgdatadir)/xslt
|
||||
dist_xslt_DATA = \
|
||||
xslt/bison.xsl \
|
||||
xslt/xml2dot.xsl \
|
||||
xslt/xml2text.xsl \
|
||||
xslt/xml2xhtml.xsl
|
||||
|
||||
+5
-7
@@ -29,17 +29,15 @@ Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
GNU Bison 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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GNU Bison is distributed in the hope that it will be useful,
|
||||
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 Bison; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
+556
@@ -0,0 +1,556 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Language-independent M4 Macros for Bison.
|
||||
# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Identification. ##
|
||||
## ---------------- ##
|
||||
|
||||
# b4_copyright(TITLE, YEARS)
|
||||
# --------------------------
|
||||
m4_define([b4_copyright],
|
||||
[b4_comment([A Bison parser, made by GNU Bison b4_version.])
|
||||
|
||||
b4_comment([$1
|
||||
|
||||
m4_text_wrap([Copyright (C) $2 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/>.])
|
||||
|
||||
b4_comment([As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison.])])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Error handling. ##
|
||||
## ---------------- ##
|
||||
|
||||
# The following error handling macros print error directives that should not
|
||||
# become arguments of other macro invocations since they would likely then be
|
||||
# mangled. Thus, they print to stdout directly.
|
||||
|
||||
# b4_cat(TEXT)
|
||||
# ------------
|
||||
# Write TEXT to stdout. Precede the final newline with an @ so that it's
|
||||
# escaped. For example:
|
||||
#
|
||||
# b4_cat([[@complain(invalid input@)]])
|
||||
m4_define([b4_cat],
|
||||
[m4_syscmd([cat <<'_m4eof'
|
||||
]m4_bpatsubst(m4_dquote($1), [_m4eof], [_m4@`eof])[@
|
||||
_m4eof
|
||||
])dnl
|
||||
m4_if(m4_sysval, [0], [], [m4_fatal([$0: cannot write to stdout])])])
|
||||
|
||||
# b4_error(KIND, FORMAT, [ARG1], [ARG2], ...)
|
||||
# -------------------------------------------
|
||||
# Write @KIND(FORMAT@,ARG1@,ARG2@,...@) to stdout.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_error([[warn]], [[invalid value for `%s': %s]], [[foo]], [[3]])
|
||||
m4_define([b4_error],
|
||||
[b4_cat([[@]$1[(]$2[]]dnl
|
||||
[m4_if([$#], [2], [],
|
||||
[m4_foreach([b4_arg],
|
||||
m4_dquote(m4_shift(m4_shift($@))),
|
||||
[[@,]b4_arg])])[@)]])])
|
||||
|
||||
# b4_error_at(KIND, START, END, FORMAT, [ARG1], [ARG2], ...)
|
||||
# ----------------------------------------------------------
|
||||
# Write @KIND_at(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_error_at([[complain]], [[input.y:2.3]], [[input.y:5.4]],
|
||||
# [[invalid %s]], [[foo]])
|
||||
m4_define([b4_error_at],
|
||||
[b4_cat([[@]$1[_at(]$2[@,]$3[@,]$4[]]dnl
|
||||
[m4_if([$#], [4], [],
|
||||
[m4_foreach([b4_arg],
|
||||
m4_dquote(m4_shift(m4_shift(m4_shift(m4_shift($@))))),
|
||||
[[@,]b4_arg])])[@)]])])
|
||||
|
||||
# b4_warn(FORMAT, [ARG1], [ARG2], ...)
|
||||
# ------------------------------------
|
||||
# Write @warn(FORMAT@,ARG1@,ARG2@,...@) to stdout.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_warn([[invalid value for `%s': %s]], [[foo]], [[3]])
|
||||
#
|
||||
# As a simple test suite, this:
|
||||
#
|
||||
# m4_divert(-1)
|
||||
# m4_define([asdf], [ASDF])
|
||||
# m4_define([fsa], [FSA])
|
||||
# m4_define([fdsa], [FDSA])
|
||||
# b4_warn([[[asdf), asdf]]], [[[fsa), fsa]]], [[[fdsa), fdsa]]])
|
||||
# b4_warn([[asdf), asdf]], [[fsa), fsa]], [[fdsa), fdsa]])
|
||||
# b4_warn()
|
||||
# b4_warn(1)
|
||||
# b4_warn(1, 2)
|
||||
#
|
||||
# Should produce this without newlines:
|
||||
#
|
||||
# @warn([asdf), asdf]@,[fsa), fsa]@,[fdsa), fdsa]@)
|
||||
# @warn(asdf), asdf@,fsa), fsa@,fdsa), fdsa@)
|
||||
# @warn(@)
|
||||
# @warn(1@)
|
||||
# @warn(1@,2@)
|
||||
m4_define([b4_warn],
|
||||
[b4_error([[warn]], $@)])
|
||||
|
||||
# b4_warn_at(START, END, FORMAT, [ARG1], [ARG2], ...)
|
||||
# ---------------------------------------------------
|
||||
# Write @warn(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_warn_at([[input.y:2.3]], [[input.y:5.4]], [[invalid %s]], [[foo]])
|
||||
m4_define([b4_warn_at],
|
||||
[b4_error_at([[warn]], $@)])
|
||||
|
||||
# b4_complain(FORMAT, [ARG1], [ARG2], ...)
|
||||
# ----------------------------------------
|
||||
# Write @complain(FORMAT@,ARG1@,ARG2@,...@) to stdout.
|
||||
#
|
||||
# See b4_warn example.
|
||||
m4_define([b4_complain],
|
||||
[b4_error([[complain]], $@)])
|
||||
|
||||
# b4_complain_at(START, END, FORMAT, [ARG1], [ARG2], ...)
|
||||
# -------------------------------------------------------
|
||||
# Write @complain(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout.
|
||||
#
|
||||
# See b4_warn_at example.
|
||||
m4_define([b4_complain_at],
|
||||
[b4_error_at([[complain]], $@)])
|
||||
|
||||
# b4_fatal(FORMAT, [ARG1], [ARG2], ...)
|
||||
# -------------------------------------
|
||||
# Write @fatal(FORMAT@,ARG1@,ARG2@,...@) to stdout and exit.
|
||||
#
|
||||
# See b4_warn example.
|
||||
m4_define([b4_fatal],
|
||||
[b4_error([[fatal]], $@)dnl
|
||||
m4_exit(1)])
|
||||
|
||||
# b4_fatal_at(START, END, FORMAT, [ARG1], [ARG2], ...)
|
||||
# ----------------------------------------------------
|
||||
# Write @fatal(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout and exit.
|
||||
#
|
||||
# See b4_warn_at example.
|
||||
m4_define([b4_fatal_at],
|
||||
[b4_error_at([[fatal]], $@)dnl
|
||||
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. ##
|
||||
## ------------ ##
|
||||
|
||||
# b4_ints_in(INT1, INT2, LOW, HIGH)
|
||||
# ---------------------------------
|
||||
# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
|
||||
m4_define([b4_ints_in],
|
||||
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
|
||||
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## Decoding options. ##
|
||||
## ------------------ ##
|
||||
|
||||
# b4_flag_if(FLAG, IF-TRUE, IF-FALSE)
|
||||
# -----------------------------------
|
||||
# Run IF-TRUE if b4_FLAG_flag is 1, IF-FALSE if FLAG is 0, otherwise fail.
|
||||
m4_define([b4_flag_if],
|
||||
[m4_case(b4_$1_flag,
|
||||
[0], [$3],
|
||||
[1], [$2],
|
||||
[m4_fatal([invalid $1 value: ]$1)])])
|
||||
|
||||
|
||||
# b4_define_flag_if(FLAG)
|
||||
# -----------------------
|
||||
# Define "b4_FLAG_if(IF-TRUE, IF-FALSE)" that depends on the
|
||||
# value of the Boolean FLAG.
|
||||
m4_define([b4_define_flag_if],
|
||||
[_b4_define_flag_if($[1], $[2], [$1])])
|
||||
|
||||
# _b4_define_flag_if($1, $2, FLAG)
|
||||
# --------------------------------
|
||||
# This macro works around the impossibility to define macros
|
||||
# inside macros, because issuing `[$1]' is not possible in M4 :(.
|
||||
# This sucks hard, GNU M4 should really provide M5 like $$1.
|
||||
m4_define([_b4_define_flag_if],
|
||||
[m4_if([$1$2], $[1]$[2], [],
|
||||
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
||||
m4_define([b4_$3_if],
|
||||
[b4_flag_if([$3], [$1], [$2])])])
|
||||
|
||||
|
||||
# b4_FLAG_if(IF-TRUE, IF-FALSE)
|
||||
# -----------------------------
|
||||
# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise.
|
||||
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([locations]) # Whether locations are tracked.
|
||||
b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled.
|
||||
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
## Assigning token numbers. ##
|
||||
## ------------------------- ##
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Synclines. ##
|
||||
## ----------- ##
|
||||
|
||||
# b4_basename(NAME)
|
||||
# -----------------
|
||||
# Similar to POSIX basename; the differences don't matter here.
|
||||
# Beware that NAME is not evaluated.
|
||||
m4_define([b4_basename],
|
||||
[m4_bpatsubst([$1], [^.*/\([^/]+\)/*$], [\1])])
|
||||
|
||||
|
||||
# b4_syncline(LINE, FILE)
|
||||
# -----------------------
|
||||
m4_define([b4_syncline],
|
||||
[b4_flag_if([synclines], [
|
||||
b4_sync_end([__line__], [b4_basename(m4_quote(__file__))])
|
||||
b4_sync_start([$1], [$2])])])
|
||||
|
||||
m4_define([b4_sync_end], [b4_comment([Line $1 of $2])])
|
||||
m4_define([b4_sync_start], [b4_comment([Line $1 of $2])])
|
||||
|
||||
# b4_user_code(USER-CODE)
|
||||
# -----------------------
|
||||
# Emit code from the user, ending it with synclines.
|
||||
m4_define([b4_user_code],
|
||||
[$1
|
||||
b4_syncline([@oline@], [@ofile@])])
|
||||
|
||||
|
||||
# b4_define_user_code(MACRO)
|
||||
# --------------------------
|
||||
# From b4_MACRO, build b4_user_MACRO that includes the synclines.
|
||||
m4_define([b4_define_user_code],
|
||||
[m4_define([b4_user_$1],
|
||||
[b4_user_code([b4_$1])])])
|
||||
|
||||
|
||||
# b4_user_actions
|
||||
# b4_user_initial_action
|
||||
# b4_user_post_prologue
|
||||
# b4_user_pre_prologue
|
||||
# b4_user_stype
|
||||
# ----------------------
|
||||
# Macros that issue user code, ending with synclines.
|
||||
b4_define_user_code([actions])
|
||||
b4_define_user_code([initial_action])
|
||||
b4_define_user_code([post_prologue])
|
||||
b4_define_user_code([pre_prologue])
|
||||
b4_define_user_code([stype])
|
||||
|
||||
|
||||
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
|
||||
# --------------------------------------------------------
|
||||
# Warn if any name of type WHAT is used by the user (as recorded in USER-LIST)
|
||||
# but is not used by Bison (as recorded by macros in the namespace
|
||||
# BISON-NAMESPACE).
|
||||
#
|
||||
# USER-LIST must expand to a list specifying all grammar occurrences of all
|
||||
# names of type WHAT. Each item in the list must be a triplet specifying one
|
||||
# occurrence: name, start boundary, and end boundary. Empty string names are
|
||||
# fine. An empty list is fine.
|
||||
#
|
||||
# For example, to define b4_foo_user_names to be used for USER-LIST with three
|
||||
# name occurrences and with correct quoting:
|
||||
#
|
||||
# m4_define([b4_foo_user_names],
|
||||
# [[[[[[bar]], [[parser.y:1.7]], [[parser.y:1.16]]]],
|
||||
# [[[[bar]], [[parser.y:5.7]], [[parser.y:5.16]]]],
|
||||
# [[[[baz]], [[parser.y:8.7]], [[parser.y:8.16]]]]]])
|
||||
#
|
||||
# The macro BISON-NAMESPACE(bar) must be defined iff the name bar of type WHAT
|
||||
# is used by Bison (in the front-end or in the skeleton). Empty string names
|
||||
# are fine, but it would be ugly for Bison to actually use one.
|
||||
#
|
||||
# For example, to use b4_foo_bison_names for BISON-NAMESPACE and define that
|
||||
# the names bar and baz are used by Bison:
|
||||
#
|
||||
# m4_define([b4_foo_bison_names(bar)])
|
||||
# m4_define([b4_foo_bison_names(baz)])
|
||||
#
|
||||
# To invoke b4_check_user_names with TYPE foo, with USER-LIST
|
||||
# b4_foo_user_names, with BISON-NAMESPACE b4_foo_bison_names, and with correct
|
||||
# quoting:
|
||||
#
|
||||
# b4_check_user_names([[foo]], [b4_foo_user_names],
|
||||
# [[b4_foo_bison_names]])
|
||||
m4_define([b4_check_user_names],
|
||||
[m4_foreach([b4_occurrence], $2,
|
||||
[m4_pushdef([b4_occurrence], b4_occurrence)dnl
|
||||
m4_pushdef([b4_user_name], m4_car(b4_occurrence))dnl
|
||||
m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl
|
||||
m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl
|
||||
m4_ifndef($3[(]m4_quote(b4_user_name)[)],
|
||||
[b4_warn_at([b4_start], [b4_end],
|
||||
[[%s `%s' is not used]],
|
||||
[$1], [b4_user_name])])[]dnl
|
||||
m4_popdef([b4_occurrence])dnl
|
||||
m4_popdef([b4_user_name])dnl
|
||||
m4_popdef([b4_start])dnl
|
||||
m4_popdef([b4_end])dnl
|
||||
])])
|
||||
|
||||
# b4_percent_define_get(VARIABLE)
|
||||
# -------------------------------
|
||||
# Mimic muscle_percent_define_get in ../src/muscle_tab.h exactly. That is, if
|
||||
# the %define variable VARIABLE is defined, emit its value. Also, record
|
||||
# Bison's usage of VARIABLE by defining
|
||||
# b4_percent_define_bison_variables(VARIABLE).
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_percent_define_get([[foo]])
|
||||
m4_define([b4_percent_define_get],
|
||||
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
|
||||
m4_ifdef([b4_percent_define(]$1[)], [m4_indir([b4_percent_define(]$1[)])])])
|
||||
|
||||
# b4_percent_define_get_loc(VARIABLE)
|
||||
# -----------------------------------
|
||||
# Mimic muscle_percent_define_get_loc in ../src/muscle_tab.h exactly. That is,
|
||||
# if the %define variable VARIABLE is undefined, complain fatally since that's
|
||||
# a Bison or skeleton error. Otherwise, return its definition location in a
|
||||
# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or
|
||||
# b4_fatal_at. Don't record this as a Bison usage of VARIABLE as there's no
|
||||
# reason to suspect that the user-supplied value has yet influenced the output.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_complain_at(b4_percent_define_get_loc([[foo]]), [[invalid foo]])
|
||||
m4_define([b4_percent_define_get_loc],
|
||||
[m4_ifdef([b4_percent_define_loc(]$1[)],
|
||||
[m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl
|
||||
b4_loc[]dnl
|
||||
m4_popdef([b4_loc])],
|
||||
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_get_loc]], [$1])])])
|
||||
|
||||
# b4_percent_define_get_syncline(VARIABLE)
|
||||
# ----------------------------------------
|
||||
# Mimic muscle_percent_define_get_syncline in ../src/muscle_tab.h exactly.
|
||||
# That is, if the %define variable VARIABLE is undefined, complain fatally
|
||||
# since that's a Bison or skeleton error. Otherwise, return its definition
|
||||
# location as a b4_syncline invocation. Don't record this as a Bison usage of
|
||||
# VARIABLE as there's no reason to suspect that the user-supplied value has yet
|
||||
# influenced the output.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_percent_define_get_syncline([[foo]])
|
||||
m4_define([b4_percent_define_get_syncline],
|
||||
[m4_ifdef([b4_percent_define_syncline(]$1[)],
|
||||
[m4_indir([b4_percent_define_syncline(]$1[)])],
|
||||
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_get_syncline]], [$1])])])
|
||||
|
||||
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||
# ------------------------------------------------------
|
||||
# Mimic muscle_percent_define_ifdef in ../src/muscle_tab.h exactly. That is,
|
||||
# if the %define variable VARIABLE is defined, expand IF-TRUE, else expand
|
||||
# IF-FALSE. Also, record Bison's usage of VARIABLE by defining
|
||||
# b4_percent_define_bison_variables(VARIABLE).
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
|
||||
m4_define([b4_percent_define_ifdef],
|
||||
[m4_ifdef([b4_percent_define(]$1[)],
|
||||
[m4_define([b4_percent_define_bison_variables(]$1[)])$2],
|
||||
[$3])])
|
||||
|
||||
# b4_percent_define_flag_if(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||
# --------------------------------------------------------
|
||||
# Mimic muscle_percent_define_flag_if in ../src/muscle_tab.h exactly. That is,
|
||||
# if the %define variable VARIABLE is defined to "" or "true", expand IF-TRUE.
|
||||
# If it is defined to "false", expand IF-FALSE. Complain if it is undefined
|
||||
# (a Bison or skeleton error since the default value should have been set
|
||||
# already) or defined to any other value (possibly a user error). Also, record
|
||||
# Bison's usage of VARIABLE by defining
|
||||
# b4_percent_define_bison_variables(VARIABLE).
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_percent_define_flag_if([[foo]], [[it's true]], [[it's false]])
|
||||
m4_define([b4_percent_define_flag_if],
|
||||
[b4_percent_define_ifdef([$1],
|
||||
[m4_case(b4_percent_define_get([$1]),
|
||||
[], [$2], [true], [$2], [false], [$3],
|
||||
[m4_expand_once([b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||
[[invalid value for %%define Boolean variable `%s']],
|
||||
[$1])],
|
||||
[[b4_percent_define_flag_if($1)]])])],
|
||||
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_flag_if]], [$1])])])
|
||||
|
||||
# b4_percent_define_default(VARIABLE, DEFAULT)
|
||||
# --------------------------------------------
|
||||
# Mimic muscle_percent_define_default in ../src/muscle_tab.h exactly. That is,
|
||||
# if the %define variable VARIABLE is undefined, set its value to DEFAULT.
|
||||
# Don't record this as a Bison usage of VARIABLE as there's no reason to
|
||||
# suspect that the value has yet influenced the output.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_percent_define_default([[foo]], [[default value]])
|
||||
m4_define([b4_percent_define_default],
|
||||
[m4_ifndef([b4_percent_define(]$1[)],
|
||||
[m4_define([b4_percent_define(]$1[)], [$2])dnl
|
||||
m4_define([b4_percent_define_loc(]$1[)],
|
||||
[[[[[Bison:b4_percent_define_default]:1.0]], [[[Bison:b4_percent_define_default]:1.0]]]])dnl
|
||||
m4_define([b4_percent_define_syncline(]$1[)],
|
||||
[[]b4_syncline(1, [["[Bison:b4_percent_define_default]"]])[
|
||||
]])])])
|
||||
|
||||
# b4_percent_define_check_values(VALUES)
|
||||
# --------------------------------------
|
||||
# Mimic muscle_percent_define_check_values in ../src/muscle_tab.h exactly
|
||||
# except that the VALUES structure is more appropriate for M4. That is, VALUES
|
||||
# is a list of sublists of strings. For each sublist, the first string is the
|
||||
# name of a %define variable, and all remaining strings in that sublist are the
|
||||
# valid values for that variable. Complain if such a variable is undefined (a
|
||||
# Bison error since the default value should have been set already) or defined
|
||||
# to any other value (possibly a user error). Don't record this as a Bison
|
||||
# usage of the variable as there's no reason to suspect that the value has yet
|
||||
# influenced the output.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_percent_define_check_values([[[[foo]], [[foo-value1]], [[foo-value2]]]],
|
||||
# [[[[bar]], [[bar-value1]]]])
|
||||
m4_define([b4_percent_define_check_values],
|
||||
[m4_foreach([b4_sublist], m4_quote($@),
|
||||
[_b4_percent_define_check_values(b4_sublist)])])
|
||||
|
||||
m4_define([_b4_percent_define_check_values],
|
||||
[m4_ifdef([b4_percent_define(]$1[)],
|
||||
[m4_pushdef([b4_good_value], [0])dnl
|
||||
m4_if($#, 1, [],
|
||||
[m4_foreach([b4_value], m4_dquote(m4_shift($@)),
|
||||
[m4_if(m4_indir([b4_percent_define(]$1[)]), b4_value,
|
||||
[m4_define([b4_good_value], [1])])])])dnl
|
||||
m4_if(b4_good_value, [0],
|
||||
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||
[[invalid value for %%define variable `%s': `%s']],
|
||||
[$1],
|
||||
m4_dquote(m4_indir([b4_percent_define(]$1[)])))])dnl
|
||||
m4_popdef([b4_good_value])],
|
||||
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_check_values]], [$1])])])
|
||||
|
||||
# b4_percent_code_get([QUALIFIER])
|
||||
# --------------------------------
|
||||
# If any %code blocks for QUALIFIER are defined, emit them beginning with a
|
||||
# comment and ending with synclines and a newline. If QUALIFIER is not
|
||||
# specified or empty, do this for the unqualified %code blocks. Also, record
|
||||
# Bison's usage of QUALIFIER (if specified) by defining
|
||||
# b4_percent_code_bison_qualifiers(QUALIFIER).
|
||||
#
|
||||
# For example, to emit any unqualified %code blocks followed by any %code
|
||||
# blocks for the qualifier foo:
|
||||
#
|
||||
# b4_percent_code_get
|
||||
# b4_percent_code_get([[foo]])
|
||||
m4_define([b4_percent_code_get],
|
||||
[m4_pushdef([b4_macro_name], [[b4_percent_code(]$1[)]])dnl
|
||||
m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])dnl
|
||||
m4_ifdef(b4_macro_name,
|
||||
[b4_comment([m4_if([$#], [0], [[Unqualified %code]],
|
||||
[["%code ]$1["]])[ blocks.]])
|
||||
b4_user_code([m4_indir(b4_macro_name)])
|
||||
])dnl
|
||||
m4_popdef([b4_macro_name])])
|
||||
|
||||
# b4_percent_code_ifdef(QUALIFIER, IF-TRUE, [IF-FALSE])
|
||||
# -----------------------------------------------------
|
||||
# If any %code blocks for QUALIFIER (or unqualified %code blocks if
|
||||
# QUALIFIER is empty) are defined, expand IF-TRUE, else expand IF-FALSE.
|
||||
# Also, record Bison's usage of QUALIFIER (if specified) by defining
|
||||
# b4_percent_code_bison_qualifiers(QUALIFIER).
|
||||
m4_define([b4_percent_code_ifdef],
|
||||
[m4_ifdef([b4_percent_code(]$1[)],
|
||||
[m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])$2],
|
||||
[$3])])
|
||||
|
||||
|
||||
## ----------------------------------------------------------- ##
|
||||
## After processing the skeletons, check that all the user's ##
|
||||
## %define variables and %code qualifiers were used by Bison. ##
|
||||
## ----------------------------------------------------------- ##
|
||||
|
||||
m4_define([b4_check_user_names_wrap],
|
||||
[m4_ifdef([b4_percent_]$1[_user_]$2[s],
|
||||
[b4_check_user_names([[%]$1 $2],
|
||||
[b4_percent_]$1[_user_]$2[s],
|
||||
[[b4_percent_]$1[_bison_]$2[s]])])])
|
||||
|
||||
m4_wrap([
|
||||
b4_check_user_names_wrap([[define]], [[variable]])
|
||||
b4_check_user_names_wrap([[code]], [[qualifier]])
|
||||
])
|
||||
@@ -0,0 +1,25 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C++ skeleton dispatching for Bison.
|
||||
# Copyright (C) 2006, 2007 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/>.
|
||||
|
||||
b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])])
|
||||
b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])])
|
||||
|
||||
m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.cc]])
|
||||
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
|
||||
|
||||
m4_include(b4_used_skeleton)
|
||||
+61
-15
@@ -1,23 +1,22 @@
|
||||
m4_divert(-1) -*- Autoconf -*-
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
|
||||
@@ -26,12 +25,59 @@ m4_include(b4_pkgdatadir/[c.m4])
|
||||
## ---------------- ##
|
||||
|
||||
# Default parser class name.
|
||||
m4_define_default([b4_parser_class_name], [parser])
|
||||
m4_define_default([b4_location_type], [location])
|
||||
m4_define_default([b4_filename_type], [std::string])
|
||||
m4_define_default([b4_namespace], m4_defn([b4_prefix]))
|
||||
m4_define_default([b4_define_location_comparison],
|
||||
m4_if(b4_filename_type, [std::string], [1], [0]))
|
||||
b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||
b4_percent_define_default([[location_type]], [[location]])
|
||||
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
|
||||
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
||||
b4_percent_define_default([[define_location_comparison]],
|
||||
[m4_if(b4_percent_define_get([[filename_type]]),
|
||||
[std::string], [[true]], [[false]])])
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Namespace. ##
|
||||
## ----------- ##
|
||||
|
||||
m4_define([b4_namespace_ref], [b4_percent_define_get([[namespace]])])
|
||||
|
||||
# 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.
|
||||
# b4_namespace_open would open an anonymous namespace and thus establish
|
||||
# internal linkage. This would compile. However, it's cryptic, and internal
|
||||
# linkage for the parser would be specified in all translation units that
|
||||
# include the header, which is always generated. If we ever need to permit
|
||||
# internal linkage somehow, surely we can find a cleaner approach.
|
||||
m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
||||
[[namespace reference is empty]])])
|
||||
|
||||
# Instead of assuming the C++ compiler will do it, Bison should reject any
|
||||
# invalid b4_namepsace_ref that would be converted to a valid
|
||||
# b4_namespace_open. The problem is that Bison doesn't always output
|
||||
# b4_namespace_ref to uncommented code but should reserve the ability to do so
|
||||
# in future releases without risking breaking any existing user grammars.
|
||||
# Specifically, don't allow empty names as b4_namespace_open would just convert
|
||||
# those into anonymous namespaces, and that might tempt some users.
|
||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
||||
[[namespace reference has consecutive "::"]])])
|
||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
||||
[[namespace reference has a trailing "::"]])])
|
||||
|
||||
m4_define([b4_namespace_open],
|
||||
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
||||
[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
||||
[^\(.\)[ ]*::], [\1])),
|
||||
[::], [ { namespace ])[ {]])])
|
||||
|
||||
m4_define([b4_namespace_close],
|
||||
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
||||
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
||||
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^][:]\)*],
|
||||
[\1])),
|
||||
[::\([^][:]\|:[^][:]\)*], [} ])[} // ]b4_namespace_ref])])
|
||||
|
||||
|
||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C skeleton dispatching for Bison.
|
||||
# Copyright (C) 2006, 2007 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/>.
|
||||
|
||||
b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])])
|
||||
b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])])
|
||||
|
||||
m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[yacc.c]])
|
||||
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
|
||||
|
||||
m4_include(b4_used_skeleton)
|
||||
@@ -1,99 +1,69 @@
|
||||
m4_divert(-1) -*- Autoconf -*-
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C M4 Macros for Bison.
|
||||
# Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2004, 2005, 2006, 2007 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
## ---------------- ##
|
||||
## Identification. ##
|
||||
## ---------------- ##
|
||||
|
||||
# b4_copyright(TITLE, YEARS)
|
||||
# --------------------------
|
||||
m4_define([b4_copyright],
|
||||
[/* A Bison parser, made by GNU Bison b4_version. */
|
||||
|
||||
/* $1
|
||||
|
||||
m4_text_wrap([Copyright (C) $2 Free Software Foundation, Inc.], [ ])
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */])
|
||||
|
||||
# b4_comment(TEXT)
|
||||
# ----------------
|
||||
m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
||||
], [
|
||||
]) */])
|
||||
|
||||
# b4_identification
|
||||
# -----------------
|
||||
# Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or
|
||||
# b4_pull_flag if they use the values of the %define variables api.pure or
|
||||
# api.push_pull.
|
||||
m4_define([b4_identification],
|
||||
[/* Identify Bison output. */
|
||||
[#]define YYBISON 1
|
||||
[[/* Identify Bison output. */
|
||||
#define YYBISON 1
|
||||
|
||||
/* Bison version. */
|
||||
[#]define YYBISON_VERSION "b4_version"
|
||||
#define YYBISON_VERSION "]b4_version["
|
||||
|
||||
/* Skeleton name. */
|
||||
[#]define YYSKELETON_NAME b4_skeleton
|
||||
#define YYSKELETON_NAME ]b4_skeleton[]m4_ifdef([b4_pure_flag], [[
|
||||
|
||||
/* Pure parsers. */
|
||||
[#]define YYPURE b4_pure_flag
|
||||
#define YYPURE ]b4_pure_flag])[]m4_ifdef([b4_push_flag], [[
|
||||
|
||||
/* Push parsers. */
|
||||
#define YYPUSH ]b4_push_flag])[]m4_ifdef([b4_pull_flag], [[
|
||||
|
||||
/* Pull parsers. */
|
||||
#define YYPULL ]b4_pull_flag])[
|
||||
|
||||
/* Using locations. */
|
||||
[#]define YYLSP_NEEDED b4_locations_flag
|
||||
])
|
||||
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||
]])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
m4_define_default([b4_epilogue], [])
|
||||
|
||||
# If the %union is not named, its name is YYSTYPE.
|
||||
m4_define_default([b4_union_name], [YYSTYPE])
|
||||
|
||||
# The initial column and line.
|
||||
m4_define_default([b4_location_initial_column], [1])
|
||||
m4_define_default([b4_location_initial_line], [1])
|
||||
|
||||
# If the %name-prefix is not given, it is yy.
|
||||
m4_define_default([b4_prefix], [yy])
|
||||
|
||||
## ------------------------ ##
|
||||
## Pure/impure interfaces. ##
|
||||
@@ -109,9 +79,8 @@ m4_define([b4_user_args],
|
||||
# --------------
|
||||
# If defined, b4_parse_param arrives double quoted, but below we prefer
|
||||
# it to be single quoted.
|
||||
m4_define_default([b4_parse_param])
|
||||
m4_define([b4_parse_param],
|
||||
b4_parse_param))
|
||||
b4_parse_param)
|
||||
|
||||
|
||||
# b4_parse_param_for(DECL, FORMAL, BODY)
|
||||
@@ -140,13 +109,6 @@ m4_define([b4_parse_param_use],
|
||||
## Data Types. ##
|
||||
## ------------ ##
|
||||
|
||||
# b4_ints_in(INT1, INT2, LOW, HIGH)
|
||||
# ---------------------------------
|
||||
# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
|
||||
m4_define([b4_ints_in],
|
||||
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
|
||||
|
||||
|
||||
# b4_int_type(MIN, MAX)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
@@ -170,7 +132,6 @@ m4_define([b4_int_type],
|
||||
m4_define([b4_int_type_for],
|
||||
[b4_int_type($1_min, $1_max)])
|
||||
|
||||
|
||||
## ---------##
|
||||
## Values. ##
|
||||
## ---------##
|
||||
@@ -182,50 +143,6 @@ m4_define([b4_int_type_for],
|
||||
m4_define([b4_null], [0])
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## Decoding options. ##
|
||||
## ------------------ ##
|
||||
|
||||
# b4_flag_if(FLAG, IF-TRUE, IF-FALSE)
|
||||
# -----------------------------------
|
||||
# Run IF-TRUE if b4_FLAG_flag is 1, IF-FALSE if FLAG is 0, otherwise fail.
|
||||
m4_define([b4_flag_if],
|
||||
[m4_case(b4_$1_flag,
|
||||
[0], [$3],
|
||||
[1], [$2],
|
||||
[m4_fatal([invalid $1 value: ]$1)])])
|
||||
|
||||
|
||||
# b4_define_flag_if(FLAG)
|
||||
# -----------------------
|
||||
# Define "b4_FLAG_if(IF-TRUE, IF-FALSE)" that depends on the
|
||||
# value of the Boolean FLAG.
|
||||
m4_define([b4_define_flag_if],
|
||||
[_b4_define_flag_if($[1], $[2], [$1])])
|
||||
|
||||
# _b4_define_flag_if($1, $2, FLAG)
|
||||
# --------------------------------
|
||||
# This macro works around the impossibility to define macros
|
||||
# inside macros, because issuing `[$1]' is not possible in M4 :(.
|
||||
# This sucks hard, GNU M4 should really provide M5 like $$1.
|
||||
m4_define([_b4_define_flag_if],
|
||||
[m4_if([$1$2], $[1]$[2], [],
|
||||
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
||||
m4_define([b4_$3_if],
|
||||
[b4_flag_if([$3], [$1], [$2])])])
|
||||
|
||||
|
||||
# b4_FLAG_if(IF-TRUE, IF-FALSE)
|
||||
# -----------------------------
|
||||
# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise.
|
||||
b4_define_flag_if([defines]) # Whether headers are requested.
|
||||
b4_define_flag_if([error_verbose]) # Whether error are verbose.
|
||||
b4_define_flag_if([locations]) # Whether locations are tracked.
|
||||
b4_define_flag_if([pure]) # Whether the interface is pure.
|
||||
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
## Assigning token numbers. ##
|
||||
## ------------------------- ##
|
||||
@@ -417,50 +334,9 @@ m4_define([b4_c_arg],
|
||||
## Synclines. ##
|
||||
## ----------- ##
|
||||
|
||||
# b4_basename(NAME)
|
||||
# -----------------
|
||||
# Similar to POSIX basename; the differences don't matter here.
|
||||
# Beware that NAME is not evaluated.
|
||||
m4_define([b4_basename],
|
||||
[m4_bpatsubst([$1], [^.*/\([^/]+\)/*$], [\1])])
|
||||
|
||||
|
||||
# b4_syncline(LINE, FILE)
|
||||
# b4_sync_start(LINE, FILE)
|
||||
# -----------------------
|
||||
m4_define([b4_syncline],
|
||||
[b4_flag_if([synclines],
|
||||
[/* Line __line__ of b4_basename(m4_quote(__file__)). */
|
||||
[#]line $1 $2])])
|
||||
|
||||
|
||||
# b4_user_code(USER-CODE)
|
||||
# -----------------------
|
||||
# Emit code from the user, ending it with synclines.
|
||||
m4_define([b4_user_code],
|
||||
[$1
|
||||
b4_syncline([@oline@], [@ofile@])])
|
||||
|
||||
|
||||
# b4_define_user_code(MACRO)
|
||||
# --------------------------
|
||||
# From b4_MACRO, build b4_user_MACRO that includes the synclines.
|
||||
m4_define([b4_define_user_code],
|
||||
[m4_define([b4_user_$1],
|
||||
[b4_user_code([b4_$1])])])
|
||||
|
||||
|
||||
# b4_user_actions
|
||||
# b4_user_initial_action
|
||||
# b4_user_post_prologue
|
||||
# b4_user_start_header
|
||||
# b4_user_stype
|
||||
# ----------------------
|
||||
# Macros that issue user code, ending with synclines.
|
||||
b4_define_user_code([actions])
|
||||
b4_define_user_code([initial_action])
|
||||
b4_define_user_code([post_prologue])
|
||||
b4_define_user_code([start_header])
|
||||
b4_define_user_code([stype])
|
||||
m4_define([b4_sync_start], [[#]line $1 $2])
|
||||
|
||||
|
||||
## -------------- ##
|
||||
|
||||
+94
-58
@@ -1,22 +1,21 @@
|
||||
m4_divert(-1) -*- C -*-
|
||||
-*- C -*-
|
||||
|
||||
# GLR skeleton for Bison
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
@@ -35,6 +34,13 @@ m4_define_default([b4_stack_depth_init], [200])
|
||||
## Pure/impure interfaces. ##
|
||||
## ------------------------ ##
|
||||
|
||||
b4_define_flag_if([pure])
|
||||
# If glr.cc is including this file and thus has already set b4_pure_flag, don't
|
||||
# change the value of b4_pure_flag, and don't record a use of api.pure.
|
||||
m4_ifndef([b4_pure_flag],
|
||||
[b4_percent_define_default([[api.pure]], [[false]])
|
||||
m4_define([b4_pure_flag],
|
||||
[b4_percent_define_flag_if([[api.pure]], [[1]], [[0]])])])
|
||||
|
||||
# b4_user_formals
|
||||
# ---------------
|
||||
@@ -141,8 +147,8 @@ m4_define([b4_rhs_location],
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
m4_divert(0)dnl
|
||||
@output @output_parser_name@
|
||||
m4_divert_push(0)dnl
|
||||
@output(b4_parser_file_name@)
|
||||
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||
[2002, 2003, 2004, 2005, 2006])
|
||||
[
|
||||
@@ -150,6 +156,7 @@ b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||
|
||||
]b4_identification
|
||||
|
||||
b4_percent_code_get([[top]])[]dnl
|
||||
m4_if(b4_prefix, [yy], [],
|
||||
[/* Substitute the variable and function names. */
|
||||
#define yyparse b4_prefix[]parse
|
||||
@@ -162,24 +169,23 @@ m4_if(b4_prefix, [yy], [],
|
||||
#define yylloc b4_prefix[]lloc])[
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
]b4_pre_prologue
|
||||
]b4_user_pre_prologue
|
||||
|
||||
dnl # b4_shared_declarations
|
||||
dnl # ----------------------
|
||||
dnl # Declaration that might either go into the header (if --defines)
|
||||
dnl # or open coded in the parser body.
|
||||
m4_define([b4_shared_declarations],
|
||||
[m4_ifdef([b4_start_header],
|
||||
[[/* Copy the %start-header blocks. */
|
||||
]b4_start_header])[]dnl
|
||||
[b4_percent_code_get([[requires]])[]dnl
|
||||
|
||||
b4_token_enums(b4_tokens)
|
||||
|
||||
[#ifndef YYSTYPE
|
||||
]m4_ifdef([b4_stype],
|
||||
[[typedef union ]b4_union_name[
|
||||
{
|
||||
]b4_user_stype[
|
||||
YYSTYPE;
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[typedef int YYSTYPE;
|
||||
@@ -202,12 +208,10 @@ typedef struct YYLTYPE
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
]m4_ifdef([b4_end_header],
|
||||
[[/* Copy the %end-header blocks. */
|
||||
]b4_end_header])[]dnl
|
||||
]b4_percent_code_get([[provides]])[]dnl
|
||||
])
|
||||
|
||||
b4_defines_if([#include @output_header_name@],
|
||||
b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
|
||||
[b4_shared_declarations])[
|
||||
|
||||
/* Enabling traces. */
|
||||
@@ -236,12 +240,12 @@ b4_defines_if([#include @output_header_name@],
|
||||
static YYSTYPE yyval_default;
|
||||
|
||||
/* Copy the second part of user declarations. */
|
||||
]b4_user_post_prologue[
|
||||
]b4_user_post_prologue
|
||||
b4_percent_code_get[]dnl
|
||||
|
||||
#include <stdio.h>
|
||||
[#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifndef YY_
|
||||
# if YYENABLE_NLS
|
||||
@@ -346,8 +350,7 @@ static YYSTYPE yyval_default;
|
||||
#define YYMAXUTOK ]b4_user_token_number_max[
|
||||
|
||||
#define YYTRANSLATE(YYX) \
|
||||
((YYX <= 0) ? YYEOF : \
|
||||
(unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||||
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||||
|
||||
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
||||
static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
|
||||
@@ -1441,12 +1444,12 @@ yy_reduce_print (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
/* The symbols being reduced. */
|
||||
for (yyi = 0; yyi < yynrhs; yyi++)
|
||||
{
|
||||
fprintf (stderr, " $%d = ", yyi + 1);
|
||||
YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
||||
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
||||
&]b4_rhs_value(yynrhs, yyi + 1)[
|
||||
]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
|
||||
b4_user_args[);
|
||||
fprintf (stderr, "\n");
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2040,11 +2043,19 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
|
||||
{
|
||||
YYDPRINTF ((stderr, "Reading a token: "));
|
||||
yychar = YYLEX;
|
||||
}
|
||||
|
||||
if (yychar <= YYEOF)
|
||||
{
|
||||
yychar = yytoken = YYEOF;
|
||||
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
}
|
||||
else
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
|
||||
yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
|
||||
|
||||
while (*yyconflicts != 0)
|
||||
@@ -2210,8 +2221,16 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
}
|
||||
YYDPRINTF ((stderr, "Reading a token: "));
|
||||
yychar = YYLEX;
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
if (yychar <= YYEOF)
|
||||
{
|
||||
yychar = yytoken = YYEOF;
|
||||
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
}
|
||||
yyj = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
if (yyis_pact_ninf (yyj))
|
||||
return;
|
||||
@@ -2363,11 +2382,19 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
{
|
||||
YYDPRINTF ((stderr, "Reading a token: "));
|
||||
yychar = YYLEX;
|
||||
}
|
||||
|
||||
if (yychar <= YYEOF)
|
||||
{
|
||||
yychar = yytoken = YYEOF;
|
||||
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
}
|
||||
else
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
|
||||
yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
|
||||
if (*yyconflicts != 0)
|
||||
break;
|
||||
@@ -2529,7 +2556,7 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
}
|
||||
|
||||
/* DEBUGGING ONLY */
|
||||
#ifdef YYDEBUG
|
||||
#if YYDEBUG
|
||||
static void yypstack (yyGLRStack* yystackp, size_t yyk)
|
||||
__attribute__ ((__unused__));
|
||||
static void yypdumpstack (yyGLRStack* yystackp) __attribute__ ((__unused__));
|
||||
@@ -2540,19 +2567,20 @@ yy_yypstack (yyGLRState* yys)
|
||||
if (yys->yypred)
|
||||
{
|
||||
yy_yypstack (yys->yypred);
|
||||
fprintf (stderr, " -> ");
|
||||
YYFPRINTF (stderr, " -> ");
|
||||
}
|
||||
fprintf (stderr, "%d@@%lu", yys->yylrState, (unsigned long int) yys->yyposn);
|
||||
YYFPRINTF (stderr, "%d@@%lu", yys->yylrState,
|
||||
(unsigned long int) yys->yyposn);
|
||||
}
|
||||
|
||||
static void
|
||||
yypstates (yyGLRState* yyst)
|
||||
{
|
||||
if (yyst == NULL)
|
||||
fprintf (stderr, "<null>");
|
||||
YYFPRINTF (stderr, "<null>");
|
||||
else
|
||||
yy_yypstack (yyst);
|
||||
fprintf (stderr, "\n");
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2572,46 +2600,54 @@ yypdumpstack (yyGLRStack* yystackp)
|
||||
size_t yyi;
|
||||
for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1)
|
||||
{
|
||||
fprintf (stderr, "%3lu. ", (unsigned long int) (yyp - yystackp->yyitems));
|
||||
YYFPRINTF (stderr, "%3lu. ",
|
||||
(unsigned long int) (yyp - yystackp->yyitems));
|
||||
if (*(yybool *) yyp)
|
||||
{
|
||||
fprintf (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
|
||||
yyp->yystate.yyresolved, yyp->yystate.yylrState,
|
||||
(unsigned long int) yyp->yystate.yyposn,
|
||||
(long int) YYINDEX (yyp->yystate.yypred));
|
||||
YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
|
||||
yyp->yystate.yyresolved, yyp->yystate.yylrState,
|
||||
(unsigned long int) yyp->yystate.yyposn,
|
||||
(long int) YYINDEX (yyp->yystate.yypred));
|
||||
if (! yyp->yystate.yyresolved)
|
||||
fprintf (stderr, ", firstVal: %ld",
|
||||
(long int) YYINDEX (yyp->yystate.yysemantics.yyfirstVal));
|
||||
YYFPRINTF (stderr, ", firstVal: %ld",
|
||||
(long int) YYINDEX (yyp->yystate
|
||||
.yysemantics.yyfirstVal));
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "Option. rule: %d, state: %ld, next: %ld",
|
||||
yyp->yyoption.yyrule - 1,
|
||||
(long int) YYINDEX (yyp->yyoption.yystate),
|
||||
(long int) YYINDEX (yyp->yyoption.yynext));
|
||||
YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
|
||||
yyp->yyoption.yyrule - 1,
|
||||
(long int) YYINDEX (yyp->yyoption.yystate),
|
||||
(long int) YYINDEX (yyp->yyoption.yynext));
|
||||
}
|
||||
fprintf (stderr, "\n");
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
fprintf (stderr, "Tops:");
|
||||
YYFPRINTF (stderr, "Tops:");
|
||||
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
|
||||
fprintf (stderr, "%lu: %ld; ", (unsigned long int) yyi,
|
||||
(long int) YYINDEX (yystackp->yytops.yystates[yyi]));
|
||||
fprintf (stderr, "\n");
|
||||
YYFPRINTF (stderr, "%lu: %ld; ", (unsigned long int) yyi,
|
||||
(long int) YYINDEX (yystackp->yytops.yystates[yyi]));
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
#endif
|
||||
]
|
||||
|
||||
b4_epilogue
|
||||
b4_defines_if(
|
||||
[@output @output_header_name@
|
||||
dnl
|
||||
dnl glr.cc produces its own header.
|
||||
dnl
|
||||
m4_if(b4_skeleton, ["glr.c"],
|
||||
[b4_defines_if(
|
||||
[@output(b4_spec_defines_file@)
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
[2002, 2003, 2004, 2005, 2006])
|
||||
|
||||
b4_shared_declarations
|
||||
|
||||
extern YYSTYPE b4_prefix[]lval;
|
||||
b4_pure_if([],
|
||||
[[extern YYSTYPE b4_prefix][lval;]])
|
||||
|
||||
b4_locations_if([b4_pure_if([],
|
||||
[extern YYLTYPE b4_prefix[]lloc;])
|
||||
])
|
||||
])
|
||||
])])
|
||||
m4_divert_pop(0)
|
||||
|
||||
+34
-37
@@ -1,22 +1,21 @@
|
||||
m4_divert(-1) -*- C -*-
|
||||
-*- C -*-
|
||||
|
||||
# C++ GLR skeleton for Bison
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# This skeleton produces a C++ class that encapsulates a C glr parser.
|
||||
@@ -52,11 +51,13 @@ m4_define([b4_pure_flag], [1])
|
||||
|
||||
# The header is mandatory.
|
||||
b4_defines_if([],
|
||||
[m4_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/[location.cc])
|
||||
|
||||
m4_define([b4_parser_class_name],
|
||||
[b4_percent_define_get([[parser_class_name]])])
|
||||
|
||||
# Save the parse parameters.
|
||||
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
|
||||
@@ -76,9 +77,9 @@ m4_define([b4_yy_symbol_print_generate],
|
||||
[static void],
|
||||
[[FILE *], []],
|
||||
[[int yytype], [yytype]],
|
||||
[[const b4_namespace::b4_parser_class_name::semantic_type *yyvaluep],
|
||||
[[const b4_namespace_ref::b4_parser_class_name::semantic_type *yyvaluep],
|
||||
[yyvaluep]],
|
||||
[[const b4_namespace::b4_parser_class_name::location_type *yylocationp],
|
||||
[[const b4_namespace_ref::b4_parser_class_name::location_type *yylocationp],
|
||||
[yylocationp]],
|
||||
b4_parse_param)[
|
||||
{
|
||||
@@ -94,7 +95,7 @@ m4_append([b4_post_prologue],
|
||||
|
||||
b4_c_ansi_function_decl([yyerror],
|
||||
[static void],
|
||||
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||
b4_parse_param,
|
||||
[[const char* msg], [msg]])])
|
||||
|
||||
@@ -108,7 +109,7 @@ m4_append([b4_epilogue],
|
||||
|
||||
]b4_c_ansi_function_def([yyerror],
|
||||
[static void],
|
||||
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||
b4_parse_param,
|
||||
[[const char* msg], [msg]])[
|
||||
{
|
||||
@@ -117,8 +118,7 @@ m4_append([b4_epilogue],
|
||||
}
|
||||
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
]dnl In this section, the parse param are the original parse_params.
|
||||
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
[ /// Build a parser object.
|
||||
@@ -200,7 +200,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
|
||||
#endif
|
||||
]m4_popdef([b4_parse_param])dnl
|
||||
[} // namespace ]b4_namespace[
|
||||
b4_namespace_close[
|
||||
|
||||
]])
|
||||
|
||||
@@ -208,15 +208,16 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
# Let glr.c believe that the user arguments include the parser itself.
|
||||
m4_ifset([b4_parse_param],
|
||||
[m4_pushdef([b4_parse_param],
|
||||
m4_dquote([[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]],]
|
||||
m4_dquote([[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]],]
|
||||
m4_defn([b4_parse_param])))],
|
||||
[m4_pushdef([b4_parse_param],
|
||||
[[[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]]]])
|
||||
[[[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]]]])
|
||||
])
|
||||
m4_include(b4_pkgdatadir/[glr.c])
|
||||
m4_popdef([b4_parse_param])
|
||||
|
||||
@output @output_header_name@
|
||||
m4_divert_push(0)
|
||||
@output(b4_spec_defines_file@)
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])[
|
||||
|
||||
@@ -225,9 +226,7 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
#ifndef PARSER_HEADER_H
|
||||
# define PARSER_HEADER_H
|
||||
|
||||
]m4_ifdef([b4_start_header],
|
||||
[[/* Copy the %start-header blocks. */
|
||||
]b4_user_start_header])[
|
||||
]b4_percent_code_get([[requires]])[
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
@@ -235,11 +234,10 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
/* Using locations. */
|
||||
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
class position;
|
||||
class location;
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
#include "location.hh"
|
||||
|
||||
@@ -267,8 +265,7 @@ namespace ]b4_namespace[
|
||||
while (/*CONSTCOND*/ 0)
|
||||
#endif
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
/// A Bison parser.
|
||||
class ]b4_parser_class_name[
|
||||
{
|
||||
@@ -277,8 +274,9 @@ namespace ]b4_namespace[
|
||||
#ifndef YYSTYPE
|
||||
]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;]])])[
|
||||
@@ -286,7 +284,7 @@ b4_user_stype
|
||||
typedef YYSTYPE semantic_type;
|
||||
#endif
|
||||
/// Symbol locations.
|
||||
typedef ]b4_location_type[ location_type;
|
||||
typedef ]b4_percent_define_get([[location_type]])[ location_type;
|
||||
/// Tokens.
|
||||
struct token
|
||||
{
|
||||
@@ -361,20 +359,19 @@ b4_user_stype
|
||||
};
|
||||
|
||||
]dnl Redirections for glr.c.
|
||||
m4_ifset([b4_global_tokens_and_yystype],
|
||||
b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||
[b4_token_defines(b4_tokens)])
|
||||
[
|
||||
#ifndef YYSTYPE
|
||||
# define YYSTYPE ]b4_namespace[::]b4_parser_class_name[::semantic_type
|
||||
# define YYSTYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
|
||||
#endif
|
||||
#ifndef YYLTYPE
|
||||
# define YYLTYPE ]b4_namespace[::]b4_parser_class_name[::location_type
|
||||
# define YYLTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
|
||||
#endif
|
||||
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
]m4_ifdef([b4_end_header],
|
||||
[[/* Copy the %end-header blocks. */
|
||||
]b4_end_header])[]dnl
|
||||
]b4_percent_code_get([[provides]])[]dnl
|
||||
|
||||
[#endif /* ! defined PARSER_HEADER_H */]
|
||||
m4_divert_pop(0)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Java skeleton dispatching for Bison.
|
||||
# Copyright (C) 2007 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/>.
|
||||
|
||||
b4_glr_if( [b4_complain([%%glr-parser not supported for Java])])
|
||||
b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for Java])])
|
||||
|
||||
m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.java]])
|
||||
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
|
||||
|
||||
m4_include(b4_used_skeleton)
|
||||
+273
@@ -0,0 +1,273 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Java language support for Bison
|
||||
|
||||
# Copyright (C) 2007 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/>.
|
||||
|
||||
|
||||
# b4_comment(TEXT)
|
||||
# ----------------
|
||||
m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
||||
], [
|
||||
]) */])
|
||||
|
||||
|
||||
# b4_flag_value(BOOLEAN-FLAG)
|
||||
# ---------------------------
|
||||
m4_define([b4_flag_value], [b4_flag_if([$1], [true], [false])])
|
||||
|
||||
|
||||
# b4_public_if(TRUE, FALSE)
|
||||
# -------------------------
|
||||
b4_percent_define_default([[public]], [[false]])
|
||||
m4_define([b4_public_if],
|
||||
[b4_percent_define_flag_if([public], [$1], [$2])])
|
||||
|
||||
|
||||
# b4_abstract_if(TRUE, FALSE)
|
||||
# ---------------------------
|
||||
b4_percent_define_default([[abstract]], [[false]])
|
||||
m4_define([b4_abstract_if],
|
||||
[b4_percent_define_flag_if([abstract], [$1], [$2])])
|
||||
|
||||
|
||||
# b4_lexer_if(TRUE, FALSE)
|
||||
# ------------------------
|
||||
m4_define([b4_lexer_if],
|
||||
[b4_percent_code_ifdef([[lexer]], [$1], [$2])])
|
||||
|
||||
|
||||
# b4_identification
|
||||
# -----------------
|
||||
m4_define([b4_identification],
|
||||
[/** Always <tt>true</tt>, identifies Bison output. */
|
||||
public static final boolean bison = true;
|
||||
|
||||
/** Version number for the Bison executable that generated this parser. */
|
||||
public static final String bisonVersion = "b4_version";
|
||||
|
||||
/** Name of the skeleton that generated this parser. */
|
||||
public static final String bisonSkeleton = b4_skeleton;
|
||||
])
|
||||
|
||||
|
||||
## ------------ ##
|
||||
## Data types. ##
|
||||
## ------------ ##
|
||||
|
||||
# b4_int_type(MIN, MAX)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
# MIN to MAX (included).
|
||||
m4_define([b4_int_type],
|
||||
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
||||
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
||||
[int])])
|
||||
|
||||
# b4_int_type_for(NAME)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
# `NAME_min' to `NAME_max' (included).
|
||||
m4_define([b4_int_type_for],
|
||||
[b4_int_type($1_min, $1_max)])
|
||||
|
||||
# b4_null
|
||||
# -------
|
||||
m4_define([b4_null], [null])
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
## Assigning token numbers. ##
|
||||
## ------------------------- ##
|
||||
|
||||
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
|
||||
# ---------------------------------------
|
||||
# Output the definition of this token as an enum.
|
||||
m4_define([b4_token_enum],
|
||||
[ /** Token number, to be returned by the scanner. */
|
||||
public static final int $1 = $2;
|
||||
])
|
||||
|
||||
|
||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
# -----------------------------------------------------
|
||||
# Output the definition of the tokens (if there are) as enums.
|
||||
m4_define([b4_token_enums],
|
||||
[m4_if([$@], [[]], [],
|
||||
[/* Tokens. */
|
||||
m4_map([b4_token_enum], [$@])])
|
||||
])
|
||||
|
||||
# b4-case(ID, CODE)
|
||||
# -----------------
|
||||
# We need to fool Java's stupid unreachable code detection.
|
||||
m4_define([b4_case], [ case $1:
|
||||
if (yyn == $1)
|
||||
$2;
|
||||
break;
|
||||
])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
|
||||
b4_percent_define_default([[stype]], [[Object]])])
|
||||
|
||||
m4_define_default([[b4_prefix]], [[YY]])])
|
||||
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])])
|
||||
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])])
|
||||
|
||||
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])])
|
||||
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
|
||||
|
||||
b4_percent_define_default([[throws]], [b4_lex_throws])])
|
||||
m4_define([b4_throws], [b4_percent_define_get([[throws]])])
|
||||
|
||||
b4_percent_define_default([[location_type]], [Location])])
|
||||
m4_define([b4_location_type], [b4_percent_define_get([[location_type]])])
|
||||
|
||||
b4_percent_define_default([[position_type]], [Position])])
|
||||
m4_define([b4_position_type], [b4_percent_define_get([[position_type]])])
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Semantic Values. ##
|
||||
## ----------------- ##
|
||||
|
||||
|
||||
# b4_lhs_value([TYPE])
|
||||
# --------------------
|
||||
# Expansion of $<TYPE>$.
|
||||
m4_define([b4_lhs_value], [yyval])
|
||||
|
||||
|
||||
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
||||
# --------------------------------------
|
||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||
# symbols on RHS.
|
||||
#
|
||||
# In this simple implementation, %token and %type have class names
|
||||
# between the angle brackets.
|
||||
m4_define([b4_rhs_value],
|
||||
[(m4_ifval($3, [($3)])[](yystack.valueAt ($1-($2))))])
|
||||
|
||||
# b4_lhs_location()
|
||||
# -----------------
|
||||
# Expansion of @$.
|
||||
m4_define([b4_lhs_location],
|
||||
[(yyloc)])
|
||||
|
||||
|
||||
# b4_rhs_location(RULE-LENGTH, NUM)
|
||||
# ---------------------------------
|
||||
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
|
||||
# on RHS.
|
||||
m4_define([b4_rhs_location],
|
||||
[yystack.locationAt ($1-($2))])
|
||||
|
||||
|
||||
# b4_lex_param
|
||||
# b4_parse_param
|
||||
# --------------
|
||||
# If defined, b4_lex_param arrives double quoted, but below we prefer
|
||||
# it to be single quoted. Same for b4_parse_param.
|
||||
|
||||
# TODO: should be in bison.m4
|
||||
m4_define_default([b4_lex_param], [[]]))
|
||||
m4_define([b4_lex_param], b4_lex_param))
|
||||
m4_define([b4_parse_param], b4_parse_param))
|
||||
|
||||
# b4_lex_param_decl
|
||||
# -------------------
|
||||
# Extra formal arguments of the constructor.
|
||||
m4_define([b4_lex_param_decl],
|
||||
[m4_ifset([b4_lex_param],
|
||||
[b4_remove_comma([$1],
|
||||
b4_param_decls(b4_lex_param))],
|
||||
[$1])])
|
||||
|
||||
m4_define([b4_param_decls],
|
||||
[m4_map([b4_param_decl], [$@])])
|
||||
m4_define([b4_param_decl], [, $1])
|
||||
|
||||
m4_define([b4_remove_comma], [m4_ifval($1, [$1, ], [])m4_shiftn(2, $@)])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_decl
|
||||
# -------------------
|
||||
# Extra formal arguments of the constructor.
|
||||
m4_define([b4_parse_param_decl],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[b4_remove_comma([$1],
|
||||
b4_param_decls(b4_parse_param))],
|
||||
[$1])])
|
||||
|
||||
|
||||
|
||||
# b4_lex_param_call
|
||||
# -------------------
|
||||
# Delegating the lexer parameters to the lexer constructor.
|
||||
m4_define([b4_lex_param_call],
|
||||
[m4_ifset([b4_lex_param],
|
||||
[b4_remove_comma([$1],
|
||||
b4_param_calls(b4_lex_param))],
|
||||
[$1])])
|
||||
m4_define([b4_param_calls],
|
||||
[m4_map([b4_param_call], [$@])])
|
||||
m4_define([b4_param_call], [, $2])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_cons
|
||||
# -------------------
|
||||
# Extra initialisations of the constructor.
|
||||
m4_define([b4_parse_param_cons],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[b4_constructor_calls(b4_parse_param)])])
|
||||
|
||||
m4_define([b4_constructor_calls],
|
||||
[m4_map([b4_constructor_call], [$@])])
|
||||
m4_define([b4_constructor_call],
|
||||
[this.$2 = $2;
|
||||
])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_vars
|
||||
# -------------------
|
||||
# Extra instance variables.
|
||||
m4_define([b4_parse_param_vars],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[
|
||||
/* User arguments. */
|
||||
b4_var_decls(b4_parse_param)])])
|
||||
|
||||
m4_define([b4_var_decls],
|
||||
[m4_map_sep([b4_var_decl], [
|
||||
], [$@])])
|
||||
m4_define([b4_var_decl],
|
||||
[ protected final $1;])
|
||||
|
||||
|
||||
|
||||
# b4_maybe_throws(THROWS)
|
||||
# -----------------------
|
||||
# Expand to either an empty string or "throws THROWS".
|
||||
m4_define([b4_maybe_throws],
|
||||
[m4_ifval($1, [throws $1])])
|
||||
+39
-44
@@ -1,29 +1,29 @@
|
||||
m4_divert(-1)
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
m4_include(b4_pkgdatadir/[c++.m4])
|
||||
|
||||
m4_define([b4_parser_class_name],
|
||||
[b4_percent_define_get([[parser_class_name]])])
|
||||
|
||||
# The header is mandatory.
|
||||
b4_defines_if([],
|
||||
[m4_fatal(b4_skeleton[: using %defines is mandatory])])
|
||||
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||
|
||||
# Backward compatibility.
|
||||
m4_define([b4_location_constructors])
|
||||
@@ -31,9 +31,9 @@ m4_include(b4_pkgdatadir/[location.cc])
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
m4_divert(0)dnl
|
||||
m4_divert_push(0)dnl
|
||||
b4_defines_if(
|
||||
[@output @output_header_name@
|
||||
[@output(b4_spec_defines_file@)
|
||||
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])
|
||||
dnl FIXME: This is wrong, we want computed header guards.
|
||||
@@ -43,19 +43,16 @@ dnl FIXME: This is wrong, we want computed header guards.
|
||||
#ifndef PARSER_HEADER_H
|
||||
# define PARSER_HEADER_H
|
||||
|
||||
]m4_ifdef([b4_start_header],
|
||||
[[/* Copy the %start-header blocks. */
|
||||
]b4_user_start_header])[
|
||||
]b4_percent_code_get([[requires]])[
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include "stack.hh"
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
class position;
|
||||
class location;
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
#include "location.hh"
|
||||
|
||||
@@ -96,8 +93,7 @@ do { \
|
||||
} while (false)
|
||||
#endif
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
|
||||
/// A Bison parser.
|
||||
class ]b4_parser_class_name[
|
||||
@@ -107,8 +103,9 @@ namespace ]b4_namespace[
|
||||
#ifndef YYSTYPE
|
||||
]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;]])])[
|
||||
@@ -116,7 +113,7 @@ b4_user_stype
|
||||
typedef YYSTYPE semantic_type;
|
||||
#endif
|
||||
/// Symbol locations.
|
||||
typedef ]b4_location_type[ location_type;
|
||||
typedef ]b4_percent_define_get([[location_type]])[ location_type;
|
||||
/// Tokens.
|
||||
struct token
|
||||
{
|
||||
@@ -285,40 +282,40 @@ b4_error_verbose_if([, int tok])[);
|
||||
static const token_number_type yyundef_token_;
|
||||
]b4_parse_param_vars[
|
||||
};
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
]m4_ifset([b4_global_tokens_and_yystype],
|
||||
]b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||
[b4_token_defines(b4_tokens)
|
||||
|
||||
#ifndef YYSTYPE
|
||||
/* Redirection for backward compatibility. */
|
||||
# define YYSTYPE b4_namespace::b4_parser_class_name::semantic_type
|
||||
# define YYSTYPE b4_namespace_ref::b4_parser_class_name::semantic_type
|
||||
#endif
|
||||
])
|
||||
m4_ifdef([b4_end_header],
|
||||
[[/* Copy the %end-header blocks. */
|
||||
]b4_end_header])[]dnl
|
||||
b4_percent_code_get([[provides]])[]dnl
|
||||
|
||||
[#endif /* ! defined PARSER_HEADER_H */]
|
||||
])dnl
|
||||
@output @output_parser_name@
|
||||
@output(b4_parser_file_name@)
|
||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])
|
||||
b4_percent_code_get([[top]])[]dnl
|
||||
m4_if(b4_prefix, [yy], [],
|
||||
[
|
||||
// Take the name prefix into account.
|
||||
#define yylex b4_prefix[]lex])[
|
||||
|
||||
/* First part of user declarations. */
|
||||
]b4_pre_prologue
|
||||
]b4_user_pre_prologue
|
||||
|
||||
b4_defines_if([
|
||||
#include @output_header_name@])[
|
||||
b4_defines_if([[
|
||||
#include "@basename(]b4_spec_defines_file[@)"]])[
|
||||
|
||||
/* User implementation prologue. */
|
||||
]b4_user_post_prologue[
|
||||
]b4_user_post_prologue
|
||||
b4_percent_code_get[]dnl
|
||||
|
||||
#ifndef YY_
|
||||
[#ifndef YY_
|
||||
# if YYENABLE_NLS
|
||||
# if ENABLE_NLS
|
||||
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
|
||||
@@ -374,8 +371,7 @@ do { \
|
||||
#define YYABORT goto yyabortlab
|
||||
#define YYERROR goto yyerrorlab
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
#if YYERROR_VERBOSE
|
||||
|
||||
/* Return YYSTR after stripping away unnecessary quotes and
|
||||
@@ -1010,7 +1006,7 @@ b4_error_verbose_if([, int tok])[)
|
||||
int yynrhs = yyr2_[yyrule];
|
||||
/* Print the symbols being reduced, and their result. */
|
||||
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
|
||||
<< " (line " << yylno << "), ";
|
||||
<< " (line " << yylno << "):" << std::endl;
|
||||
/* The symbols being reduced. */
|
||||
for (int yyi = 0; yyi < yynrhs; yyi++)
|
||||
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
|
||||
@@ -1048,11 +1044,11 @@ b4_error_verbose_if([, int tok])[)
|
||||
const unsigned int ]b4_parser_class_name[::yyuser_token_number_max_ = ]b4_user_token_number_max[;
|
||||
const ]b4_parser_class_name[::token_number_type ]b4_parser_class_name[::yyundef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
} // namespace ]b4_namespace[
|
||||
]b4_namespace_close[
|
||||
|
||||
]b4_epilogue
|
||||
dnl
|
||||
@output b4_dir_prefix[]stack.hh
|
||||
@output(b4_dir_prefix[]stack.hh@)
|
||||
b4_copyright([Stack handling for Bison parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])[
|
||||
|
||||
@@ -1061,8 +1057,7 @@ b4_copyright([Stack handling for Bison parsers in C++],
|
||||
|
||||
#include <deque>
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
template <class T, class S = std::deque<T> >
|
||||
class stack
|
||||
{
|
||||
@@ -1148,7 +1143,7 @@ namespace ]b4_namespace[
|
||||
const S& stack_;
|
||||
unsigned int range_;
|
||||
};
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
#endif // not BISON_STACK_HH]
|
||||
m4_divert(-1)
|
||||
m4_divert_pop(0)
|
||||
|
||||
+875
@@ -0,0 +1,875 @@
|
||||
# Java skeleton for Bison -*- autoconf -*-
|
||||
|
||||
# Copyright (C) 2007 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/>.
|
||||
|
||||
m4_include(b4_pkgdatadir/[java.m4])
|
||||
|
||||
b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java], [b4_skeleton])])
|
||||
m4_ifval(m4_defn([b4_symbol_destructors]),
|
||||
[b4_fatal([%s: %%destructor does not make sense in Java], [b4_skeleton])],
|
||||
[])
|
||||
|
||||
m4_divert_push(0)dnl
|
||||
@output(b4_parser_file_name@)
|
||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
||||
[2007])
|
||||
|
||||
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
||||
])[/* First part of user declarations. */
|
||||
]b4_pre_prologue
|
||||
b4_percent_code_get([[imports]])
|
||||
[/**
|
||||
* A Bison parser, automatically generated from <tt>@ofile@</tt>.
|
||||
*
|
||||
* @@author LALR (1) parser skeleton written by Paolo Bonzini.
|
||||
*/
|
||||
]b4_public_if([public ])b4_abstract_if([abstract ])[class ]b4_parser_class_name[
|
||||
{
|
||||
]b4_identification[
|
||||
|
||||
/** True if verbose error messages are enabled. */
|
||||
public boolean errorVerbose = ]b4_flag_value([error_verbose]);
|
||||
|
||||
b4_locations_if([[
|
||||
/**
|
||||
* A class defining a pair of positions. Positions, defined by the
|
||||
* <code>]b4_position_type[</code> class, denote a point in the input.
|
||||
* Locations represent a part of the input through the beginning
|
||||
* and ending positions. */
|
||||
public class ]b4_location_type[ {
|
||||
/** The first, inclusive, position in the range. */
|
||||
public ]b4_position_type[ begin;
|
||||
|
||||
/** The first position beyond the range. */
|
||||
public ]b4_position_type[ end;
|
||||
|
||||
/**
|
||||
* Create a ]b4_location_type[ denoting an empty range located at
|
||||
* a given point.
|
||||
* @@param loc The position at which the range is anchored. */
|
||||
public ]b4_location_type[ (]b4_position_type[ loc) {
|
||||
this.begin = this.end = loc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>]b4_location_type[</code> from the endpoints of the range.
|
||||
* @@param begin The first position included in the range.
|
||||
* @@param begin The first position beyond the range. */
|
||||
public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) {
|
||||
this.begin = begin;
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print a representation of the location. For this to be correct,
|
||||
* <code>]b4_position_type[</code> should override the <code>equals</code>
|
||||
* method. */
|
||||
public String toString () {
|
||||
if (begin.equals (end))
|
||||
return begin.toString ();
|
||||
else
|
||||
return begin.toString () + "-" + end.toString ();
|
||||
}
|
||||
}
|
||||
|
||||
]])
|
||||
|
||||
[ /** 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([[
|
||||
private ]b4_location_type[ yylloc (YYStack rhs, int n)
|
||||
{
|
||||
if (n > 0)
|
||||
return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
|
||||
else
|
||||
return new ]b4_location_type[ (rhs.locationAt (0).end);
|
||||
}]])
|
||||
|
||||
/**
|
||||
* Communication interface between the scanner and the Bison-generated
|
||||
* parser <tt>]b4_parser_class_name[</tt>.
|
||||
*/
|
||||
public interface Lexer {
|
||||
]b4_locations_if([[/**
|
||||
* Method to retrieve the beginning position of the last scanned token.
|
||||
* @@return the position at which the last scanned token starts. */
|
||||
]b4_position_type[ getStartPos ();
|
||||
|
||||
/**
|
||||
* Method to retrieve the ending position of the last scanned token.
|
||||
* @@return the first position beyond the last scanned token. */
|
||||
]b4_position_type[ getEndPos ();]])[
|
||||
|
||||
/**
|
||||
* Method to retrieve the semantic value of the last scanned token.
|
||||
* @@return the semantic value of the last scanned token. */
|
||||
]b4_yystype[ getLVal ();
|
||||
|
||||
/**
|
||||
* Entry point for the scanner. Returns the token identifier corresponding
|
||||
* to the next token and prepares to return the semantic value
|
||||
* ]b4_locations_if([and beginning/ending positions ])[of the token.
|
||||
* @@return the token identifier corresponding to the next token. */
|
||||
int yylex () ]b4_maybe_throws([b4_lex_throws])[;
|
||||
|
||||
/**
|
||||
* Entry point for error reporting. Emits an error
|
||||
* ]b4_locations_if([ referring to the given location])[in a user-defined
|
||||
* way.
|
||||
*
|
||||
* ]b4_locations_if([loc], [[The location of the element to which the
|
||||
* error message is related]])[
|
||||
* @@param s The string for the error message. */
|
||||
void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s);]
|
||||
}
|
||||
|
||||
b4_lexer_if([[private class YYLexer implements Lexer {
|
||||
]b4_percent_code_get([[lexer]])[
|
||||
}
|
||||
|
||||
]])[/** The object doing lexical analysis for us. */
|
||||
private Lexer yylexer;
|
||||
]
|
||||
b4_parse_param_vars
|
||||
|
||||
b4_lexer_if([[
|
||||
/**
|
||||
* Instantiates the Bison-generated parser.
|
||||
*/
|
||||
public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) {
|
||||
this.yylexer = new YYLexer(]b4_lex_param_call[);
|
||||
]b4_parse_param_cons[
|
||||
}
|
||||
]])
|
||||
|
||||
/**
|
||||
* Instantiates the Bison-generated parser.
|
||||
* @@param yylex The scanner that will supply tokens to the parser.
|
||||
*/
|
||||
b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) {
|
||||
this.yylexer = yylexer;
|
||||
]b4_parse_param_cons[
|
||||
}
|
||||
|
||||
private java.io.PrintStream yyDebugStream = System.err;
|
||||
|
||||
/**
|
||||
* Return the <tt>PrintStream</tt> on which the debugging output is
|
||||
* printed.
|
||||
*/
|
||||
public final java.io.PrintStream getDebugStream () { return yyDebugStream; }
|
||||
|
||||
/**
|
||||
* Set the <tt>PrintStream</tt> on which the debug output is printed.
|
||||
* @@param s The stream that is used for debugging output.
|
||||
*/
|
||||
public final void setDebugStream(java.io.PrintStream s) { yyDebugStream = s; }
|
||||
|
||||
private int yydebug = 0;
|
||||
|
||||
/**
|
||||
* Answer the verbosity of the debugging output; 0 means that all kinds of
|
||||
* output from the parser are suppressed.
|
||||
*/
|
||||
public final int getDebugLevel() { return yydebug; }
|
||||
|
||||
/**
|
||||
* Set the verbosity of the debugging output; 0 means that all kinds of
|
||||
* output from the parser are suppressed.
|
||||
* @@param level The verbosity level for debugging output.
|
||||
*/
|
||||
public final void setDebugLevel(int level) { yydebug = level; }
|
||||
|
||||
private final int yylex () ]b4_maybe_throws([b4_lex_throws]) [{
|
||||
return yylexer.yylex ();
|
||||
}
|
||||
protected final void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s) {
|
||||
yylexer.yyerror (]b4_locations_if([loc, ])[s);
|
||||
}
|
||||
|
||||
]b4_locations_if([
|
||||
protected final void yyerror (String s) {
|
||||
yylexer.yyerror ((Location)null, s);
|
||||
}
|
||||
protected final void yyerror (]b4_position_type[ loc, String s) {
|
||||
yylexer.yyerror (new ]b4_location_type[ (loc), s);
|
||||
}])
|
||||
|
||||
[protected final void yycdebug (String s) {
|
||||
if (yydebug > 0)
|
||||
yyDebugStream.println (s);
|
||||
}
|
||||
|
||||
private final class YYStack {
|
||||
private int[] stateStack = new int[16];
|
||||
]b4_locations_if([[private ]b4_location_type[[] locStack = new ]b4_location_type[[16];]])[
|
||||
private ]b4_yystype[[] valueStack = new ]b4_yystype[[16];
|
||||
|
||||
public int size = 16;
|
||||
public int height = -1;
|
||||
|
||||
public final void push (int state, ]b4_yystype[ value]dnl
|
||||
b4_locations_if([, ]b4_location_type[ loc])[) {
|
||||
height++;
|
||||
if (size == height)
|
||||
{
|
||||
int[] newStateStack = new int[size * 2];
|
||||
System.arraycopy (stateStack, 0, newStateStack, 0, height);
|
||||
stateStack = newStateStack;
|
||||
]b4_locations_if([[
|
||||
]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2];
|
||||
System.arraycopy (locStack, 0, newLocStack, 0, height);
|
||||
locStack = newLocStack;]])
|
||||
|
||||
b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2];
|
||||
System.arraycopy (valueStack, 0, newValueStack, 0, height);
|
||||
valueStack = newValueStack;
|
||||
|
||||
size *= 2;
|
||||
}
|
||||
|
||||
stateStack[height] = state;
|
||||
]b4_locations_if([[locStack[height] = loc;]])[
|
||||
valueStack[height] = value;
|
||||
}
|
||||
|
||||
public final void pop () {
|
||||
height--;
|
||||
}
|
||||
|
||||
public final void pop (int num) {
|
||||
// Avoid memory leaks... garbage collection is a white lie!
|
||||
if (num > 0) {
|
||||
java.util.Arrays.fill (valueStack, height - num + 1, height, null);
|
||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
|
||||
}
|
||||
height -= num;
|
||||
}
|
||||
|
||||
public final int stateAt (int i) {
|
||||
return stateStack[height - i];
|
||||
}
|
||||
|
||||
]b4_locations_if([[public final ]b4_location_type[ locationAt (int i) {
|
||||
return locStack[height - i];
|
||||
}
|
||||
|
||||
]])[public final ]b4_yystype[ valueAt (int i) {
|
||||
return valueStack[height - i];
|
||||
}
|
||||
|
||||
// Print the state stack on the debug stream.
|
||||
public void print (java.io.PrintStream out)
|
||||
{
|
||||
out.print ("Stack now");
|
||||
|
||||
for (int i = 0; i < height; i++)
|
||||
{
|
||||
out.print (' ');
|
||||
out.print (stateStack[i]);
|
||||
}
|
||||
out.println ();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returned by a Bison action in order to stop the parsing process and
|
||||
* return success (<tt>true</tt>). */
|
||||
public static final int YYACCEPT = 0;
|
||||
|
||||
/**
|
||||
* Returned by a Bison action in order to stop the parsing process and
|
||||
* return failure (<tt>false</tt>). */
|
||||
public static final int YYABORT = 1;
|
||||
|
||||
/**
|
||||
* Returned by a Bison action in order to start error recovery without
|
||||
* printing an error message. */
|
||||
public static final int YYERROR = 2;
|
||||
|
||||
/**
|
||||
* Returned by a Bison action in order to print an error message and start
|
||||
* error recovery. */
|
||||
public static final int YYFAIL = 3;
|
||||
|
||||
private static final int YYNEWSTATE = 4;
|
||||
private static final int YYDEFAULT = 5;
|
||||
private static final int YYREDUCE = 6;
|
||||
private static final int YYERRLAB1 = 7;
|
||||
private static final int YYRETURN = 8;
|
||||
|
||||
private int yyerrstatus_ = 0;
|
||||
|
||||
/**
|
||||
* Return whether error recovery is being done. In this state, the parser
|
||||
* reads token until it reaches a known state, and then restarts normal
|
||||
* operation. */
|
||||
public final boolean recovering ()
|
||||
{
|
||||
return yyerrstatus_ == 0;
|
||||
}
|
||||
|
||||
private int yyaction (int yyn, YYStack yystack, int yylen)
|
||||
{
|
||||
]b4_yystype[ yyval;
|
||||
]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[
|
||||
|
||||
/* If YYLEN is nonzero, implement the default value of the action:
|
||||
`$$ = $1'. Otherwise, use the top of the stack.
|
||||
|
||||
Otherwise, the following line sets YYVAL to garbage.
|
||||
This behavior is undocumented and Bison
|
||||
users should not rely upon it. */
|
||||
if (yylen > 0)
|
||||
yyval = yystack.valueAt (yylen - 1);
|
||||
else
|
||||
yyval = yystack.valueAt (0);
|
||||
|
||||
yy_reduce_print (yyn, yystack);
|
||||
|
||||
switch (yyn)
|
||||
{
|
||||
]b4_user_actions[
|
||||
default: break;
|
||||
}
|
||||
|
||||
yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[);
|
||||
|
||||
yystack.pop (yylen);
|
||||
yylen = 0;
|
||||
|
||||
/* Shift the result of the reduction. */
|
||||
yyn = yyr1_[yyn];
|
||||
int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
|
||||
if (0 <= yystate && yystate <= yylast_
|
||||
&& yycheck_[yystate] == yystack.stateAt (0))
|
||||
yystate = yytable_[yystate];
|
||||
else
|
||||
yystate = yydefgoto_[yyn - yyntokens_];
|
||||
|
||||
yystack.push (yystate, yyval]b4_locations_if([, yyloc])[);
|
||||
return YYNEWSTATE;
|
||||
}
|
||||
|
||||
/* Return YYSTR after stripping away unnecessary quotes and
|
||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||
that double-quoting is unnecessary unless the string contains an
|
||||
apostrophe, a comma, or backslash (other than backslash-backslash).
|
||||
YYSTR is taken from yytname. */
|
||||
private final String yytnamerr_ (String yystr)
|
||||
{
|
||||
if (yystr.charAt (0) == '"')
|
||||
{
|
||||
StringBuffer yyr = new StringBuffer ();
|
||||
strip_quotes: for (int i = 1; i < yystr.length (); i++)
|
||||
switch (yystr.charAt (i))
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
break strip_quotes;
|
||||
|
||||
case '\\':
|
||||
if (yystr.charAt(++i) != '\\')
|
||||
break strip_quotes;
|
||||
/* Fall through. */
|
||||
default:
|
||||
yyr.append (yystr.charAt (i));
|
||||
break;
|
||||
|
||||
case '"':
|
||||
return yyr.toString ();
|
||||
}
|
||||
}
|
||||
else if (yystr.equals ("$end"))
|
||||
return "end of input";
|
||||
|
||||
return yystr;
|
||||
}
|
||||
|
||||
/*--------------------------------.
|
||||
| Print this symbol on YYOUTPUT. |
|
||||
`--------------------------------*/
|
||||
|
||||
private void yy_symbol_print (String s, int yytype,
|
||||
]b4_yystype[ yyvaluep]dnl
|
||||
b4_locations_if([, Object yylocationp])[)
|
||||
{
|
||||
if (yydebug > 0)
|
||||
yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ")
|
||||
+ yytname_[yytype] + " ("]b4_locations_if([
|
||||
+ yylocationp + ": "])[
|
||||
+ (yyvaluep == null ? "(null)" : yyvaluep) + ")");
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse input from the scanner that was specified at object construction
|
||||
* time. Return whether the end of the input was reached successfully.
|
||||
*
|
||||
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
||||
* imply that there were no syntax errors.
|
||||
*/
|
||||
public boolean parse () ]b4_maybe_throws([b4_throws])[
|
||||
{
|
||||
/// Lookahead and lookahead in internal form.
|
||||
int yychar = yyempty_;
|
||||
int yytoken = 0;
|
||||
|
||||
/* State. */
|
||||
int yyn = 0;
|
||||
int yylen = 0;
|
||||
int yystate = 0;
|
||||
|
||||
YYStack yystack = new YYStack ();
|
||||
|
||||
/* Error handling. */
|
||||
int yynerrs_ = 0;
|
||||
]b4_locations_if([/// The location where the error started.
|
||||
]b4_location_type[ yyerrloc = null;
|
||||
|
||||
/// ]b4_location_type[ of the lookahead.
|
||||
]b4_location_type[ yylloc = new ]b4_location_type[ (null, null);
|
||||
|
||||
/// @@$.
|
||||
]b4_location_type[ yyloc;])
|
||||
|
||||
/// Semantic value of the lookahead.
|
||||
b4_yystype[ yylval = null;
|
||||
|
||||
int yyresult;
|
||||
|
||||
yycdebug ("Starting parse\n");
|
||||
yyerrstatus_ = 0;
|
||||
|
||||
]m4_ifdef([b4_initial_action], [
|
||||
m4_pushdef([b4_at_dollar], [yylloc])dnl
|
||||
m4_pushdef([b4_dollar_dollar], [yylval])dnl
|
||||
/* User initialization code. */
|
||||
b4_user_initial_action
|
||||
m4_popdef([b4_dollar_dollar])dnl
|
||||
m4_popdef([b4_at_dollar])])dnl
|
||||
|
||||
[ /* Initialize the stack. */
|
||||
yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
|
||||
|
||||
int label = YYNEWSTATE;
|
||||
for (;;)
|
||||
switch (label)
|
||||
{
|
||||
/* New state. Unlike in the C/C++ skeletons, the state is already
|
||||
pushed when we come here. */
|
||||
case YYNEWSTATE:
|
||||
yycdebug ("Entering state " + yystate + "\n");
|
||||
if (yydebug > 0)
|
||||
yystack.print (yyDebugStream);
|
||||
|
||||
/* Accept? */
|
||||
if (yystate == yyfinal_)
|
||||
return true;
|
||||
|
||||
/* Take a decision. First try without lookahead. */
|
||||
yyn = yypact_[yystate];
|
||||
if (yyn == yypact_ninf_)
|
||||
{
|
||||
label = YYDEFAULT;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Read a lookahead token. */
|
||||
if (yychar == yyempty_)
|
||||
{
|
||||
yycdebug ("Reading a token: ");
|
||||
yychar = yylex ();]
|
||||
b4_locations_if([[
|
||||
yylloc = new ]b4_location_type[(yylexer.getStartPos (),
|
||||
yylexer.getEndPos ());]])
|
||||
yylval = yylexer.getLVal ();[
|
||||
}
|
||||
|
||||
/* Convert token to internal form. */
|
||||
if (yychar <= EOF)
|
||||
{
|
||||
yychar = yytoken = EOF;
|
||||
yycdebug ("Now at end of input.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
yytoken = yytranslate_ (yychar);
|
||||
yy_symbol_print ("Next token is", yytoken,
|
||||
yylval]b4_locations_if([, yylloc])[);
|
||||
}
|
||||
|
||||
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
||||
detect an error, take that action. */
|
||||
yyn += yytoken;
|
||||
if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
|
||||
label = YYDEFAULT;
|
||||
|
||||
/* <= 0 means reduce or error. */
|
||||
else if ((yyn = yytable_[yyn]) <= 0)
|
||||
{
|
||||
if (yyn == 0 || yyn == yytable_ninf_)
|
||||
label = YYFAIL;
|
||||
else
|
||||
{
|
||||
yyn = -yyn;
|
||||
label = YYREDUCE;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* Shift the lookahead token. */
|
||||
yy_symbol_print ("Shifting", yytoken,
|
||||
yylval]b4_locations_if([, yylloc])[);
|
||||
|
||||
/* Discard the token being shifted. */
|
||||
yychar = yyempty_;
|
||||
|
||||
/* Count tokens shifted since error; after three, turn off error
|
||||
status. */
|
||||
if (yyerrstatus_ > 0)
|
||||
--yyerrstatus_;
|
||||
|
||||
yystate = yyn;
|
||||
yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
|
||||
label = YYNEWSTATE;
|
||||
}
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------------.
|
||||
| yydefault -- do the default action for the current state. |
|
||||
`-----------------------------------------------------------*/
|
||||
case YYDEFAULT:
|
||||
yyn = yydefact_[yystate];
|
||||
if (yyn == 0)
|
||||
label = YYFAIL;
|
||||
else
|
||||
label = YYREDUCE;
|
||||
break;
|
||||
|
||||
/*-----------------------------.
|
||||
| yyreduce -- Do a reduction. |
|
||||
`-----------------------------*/
|
||||
case YYREDUCE:
|
||||
yylen = yyr2_[yyn];
|
||||
label = yyaction (yyn, yystack, yylen);
|
||||
yystate = yystack.stateAt (0);
|
||||
break;
|
||||
|
||||
/*------------------------------------.
|
||||
| yyerrlab -- here on detecting error |
|
||||
`------------------------------------*/
|
||||
case YYFAIL:
|
||||
/* If not already recovering from an error, report this error. */
|
||||
if (yyerrstatus_ == 0)
|
||||
{
|
||||
++yynerrs_;
|
||||
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
||||
}
|
||||
|
||||
]b4_locations_if([yyerrloc = yylloc;])[
|
||||
if (yyerrstatus_ == 3)
|
||||
{
|
||||
/* If just tried and failed to reuse lookahead token after an
|
||||
error, discard it. */
|
||||
|
||||
if (yychar <= EOF)
|
||||
{
|
||||
/* Return failure if at end of input. */
|
||||
if (yychar == EOF)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
yychar = yyempty_;
|
||||
}
|
||||
|
||||
/* Else will try to reuse lookahead token after shifting the error
|
||||
token. */
|
||||
label = YYERRLAB1;
|
||||
break;
|
||||
|
||||
/*---------------------------------------------------.
|
||||
| errorlab -- error raised explicitly by YYERROR. |
|
||||
`---------------------------------------------------*/
|
||||
case YYERROR:
|
||||
|
||||
]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYERROR. */
|
||||
yystack.pop (yylen);
|
||||
yylen = 0;
|
||||
yystate = yystack.stateAt (0);
|
||||
label = YYERRLAB1;
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------.
|
||||
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
||||
`-------------------------------------------------------------*/
|
||||
case YYERRLAB1:
|
||||
yyerrstatus_ = 3; /* Each real token shifted decrements this. */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact_[yystate];
|
||||
if (yyn != yypact_ninf_)
|
||||
{
|
||||
yyn += yyterror_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||
{
|
||||
yyn = yytable_[yyn];
|
||||
if (0 < yyn)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Pop the current state because it cannot handle the error token. */
|
||||
if (yystack.height == 1)
|
||||
return false;
|
||||
|
||||
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
|
||||
yystack.pop ();
|
||||
yystate = yystack.stateAt (0);
|
||||
if (yydebug > 0)
|
||||
yystack.print (yyDebugStream);
|
||||
}
|
||||
|
||||
]b4_locations_if([
|
||||
/* Muck with the stack to setup for yylloc. */
|
||||
yystack.push (0, null, yylloc);
|
||||
yystack.push (0, null, yyerrloc);
|
||||
yyloc = yylloc (yystack, 2);
|
||||
yystack.pop (2);])[
|
||||
|
||||
/* Shift the error token. */
|
||||
yy_symbol_print ("Shifting", yystos_[yyn],
|
||||
yylval]b4_locations_if([, yyloc])[);
|
||||
|
||||
yystate = yyn;
|
||||
yystack.push (yyn, yylval]b4_locations_if([, yyloc])[);
|
||||
label = YYNEWSTATE;
|
||||
break;
|
||||
|
||||
/* Accept. */
|
||||
case YYACCEPT:
|
||||
return true;
|
||||
|
||||
/* Abort. */
|
||||
case YYABORT:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Generate an error message.
|
||||
private String yysyntax_error (int yystate, int tok)
|
||||
{
|
||||
if (errorVerbose)
|
||||
{
|
||||
int yyn = yypact_[yystate];
|
||||
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
||||
{
|
||||
StringBuffer res;
|
||||
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
||||
++count;
|
||||
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization.
|
||||
res = new StringBuffer ("syntax error, unexpected ");
|
||||
res.append (yytnamerr_ (yytname_[tok]));
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
||||
{
|
||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||
res.append (yytnamerr_ (yytname_[x]));
|
||||
}
|
||||
}
|
||||
return res.toString ();
|
||||
}
|
||||
}
|
||||
|
||||
return "syntax error";
|
||||
}
|
||||
|
||||
|
||||
/* 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_[] =
|
||||
{
|
||||
]b4_pact[
|
||||
};
|
||||
|
||||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
|
||||
doesn't specify something else to do. Zero means the default is an
|
||||
error. */
|
||||
private static final ]b4_int_type_for([b4_defact])[ yydefact_[] =
|
||||
{
|
||||
]b4_defact[
|
||||
};
|
||||
|
||||
/* 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 zero, do what YYDEFACT says. */
|
||||
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
|
||||
private static final ]b4_int_type_for([b4_table])[
|
||||
yytable_[] =
|
||||
{
|
||||
]b4_table[
|
||||
};
|
||||
|
||||
/* YYCHECK. */
|
||||
private static final ]b4_int_type_for([b4_check])[
|
||||
yycheck_[] =
|
||||
{
|
||||
]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.
|
||||
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
|
||||
private static final String yytname_[] =
|
||||
{
|
||||
]b4_tname[
|
||||
};
|
||||
|
||||
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
||||
private static final ]b4_int_type_for([b4_rhs])[ yyrhs_[] =
|
||||
{
|
||||
]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.
|
||||
private void yy_reduce_print (int yyrule, YYStack yystack)
|
||||
{
|
||||
if (yydebug == 0)
|
||||
return;
|
||||
|
||||
int yylno = yyrline_[yyrule];
|
||||
int yynrhs = yyr2_[yyrule];
|
||||
/* Print the symbols being reduced, and their result. */
|
||||
yycdebug ("Reducing stack by rule " + (yyrule - 1)
|
||||
+ " (line " + yylno + "), ");
|
||||
|
||||
/* The symbols being reduced. */
|
||||
for (int yyi = 0; yyi < yynrhs; yyi++)
|
||||
yy_symbol_print (" $" + (yyi + 1) + " =",
|
||||
yyrhs_[yyprhs_[yyrule] + yyi],
|
||||
]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
|
||||
b4_rhs_location(yynrhs, yyi + 1)])[);
|
||||
}
|
||||
|
||||
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
||||
private static final ]b4_int_type_for([b4_translate])[ yytranslate_table_[] =
|
||||
{
|
||||
]b4_translate[
|
||||
};
|
||||
|
||||
private static final ]b4_int_type_for([b4_translate])[ yytranslate_ (int t)
|
||||
{
|
||||
if (t >= 0 && t <= yyuser_token_number_max_)
|
||||
return yytranslate_table_[t];
|
||||
else
|
||||
return yyundef_token_;
|
||||
}
|
||||
|
||||
private static final int yylast_ = ]b4_last[;
|
||||
private static final int yynnts_ = ]b4_nterms_number[;
|
||||
private static final int yyempty_ = -2;
|
||||
private static final int yyfinal_ = ]b4_final_state_number[;
|
||||
private static final int yyterror_ = 1;
|
||||
private static final int yyerrcode_ = 256;
|
||||
private static final int yyntokens_ = ]b4_tokens_number[;
|
||||
|
||||
private static final int yyuser_token_number_max_ = ]b4_user_token_number_max[;
|
||||
private static final int yyundef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
]/* User implementation code. */
|
||||
b4_percent_code_get[]dnl
|
||||
|
||||
}
|
||||
|
||||
b4_epilogue
|
||||
m4_divert_pop(0)dnl
|
||||
+22
-27
@@ -1,34 +1,31 @@
|
||||
m4_divert(-1)
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
m4_divert(0)dnl
|
||||
@output b4_dir_prefix[]position.hh
|
||||
m4_divert_push(0)dnl
|
||||
@output(b4_dir_prefix[]position.hh@)
|
||||
b4_copyright([Positions for Bison parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])[
|
||||
|
||||
/**
|
||||
** \file position.hh
|
||||
** Define the ]b4_namespace[::position class.
|
||||
** Define the ]b4_namespace_ref[::position class.
|
||||
*/
|
||||
|
||||
#ifndef BISON_POSITION_HH
|
||||
@@ -38,8 +35,7 @@ b4_copyright([Positions for Bison parsers in C++],
|
||||
# include <string>
|
||||
# include <algorithm>
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
/// Abstract a position.
|
||||
class position
|
||||
{
|
||||
@@ -53,7 +49,7 @@ namespace ]b4_namespace[
|
||||
|
||||
])[
|
||||
/// Initialization.
|
||||
inline void initialize (]b4_filename_type[* fn)
|
||||
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||
{
|
||||
filename = fn;
|
||||
line = ]b4_location_initial_line[;
|
||||
@@ -79,7 +75,7 @@ namespace ]b4_namespace[
|
||||
|
||||
public:
|
||||
/// File name to which this position refers.
|
||||
]b4_filename_type[* filename;
|
||||
]b4_percent_define_get([[filename_type]])[* filename;
|
||||
/// Current line number.
|
||||
unsigned int line;
|
||||
/// Current column number.
|
||||
@@ -115,7 +111,7 @@ namespace ]b4_namespace[
|
||||
{
|
||||
return begin + -width;
|
||||
}
|
||||
]m4_if(b4_define_location_comparison, [1], [[
|
||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||
/// Compare two position objects.
|
||||
inline bool
|
||||
operator== (const position& pos1, const position& pos2)
|
||||
@@ -145,15 +141,15 @@ namespace ]b4_namespace[
|
||||
return ostr << pos.line << '.' << pos.column;
|
||||
}
|
||||
|
||||
}
|
||||
]b4_namespace_close[
|
||||
#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++],
|
||||
[2002, 2003, 2004, 2005, 2006])[
|
||||
|
||||
/**
|
||||
** \file location.hh
|
||||
** Define the ]b4_namespace[::location class.
|
||||
** Define the ]b4_namespace_ref[::location class.
|
||||
*/
|
||||
|
||||
#ifndef BISON_LOCATION_HH
|
||||
@@ -163,8 +159,7 @@ b4_copyright([Locations for Bison parsers in C++],
|
||||
# include <string>
|
||||
# include "position.hh"
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
|
||||
/// Abstract a location.
|
||||
class location
|
||||
@@ -179,7 +174,7 @@ namespace ]b4_namespace[
|
||||
|
||||
])[
|
||||
/// Initialization.
|
||||
inline void initialize (]b4_filename_type[* fn)
|
||||
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||
{
|
||||
begin.initialize (fn);
|
||||
end = begin;
|
||||
@@ -237,7 +232,7 @@ namespace ]b4_namespace[
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
]m4_if(b4_define_location_comparison, [1], [[
|
||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||
/// Compare two location objects.
|
||||
inline bool
|
||||
operator== (const location& loc1, const location& loc2)
|
||||
@@ -273,8 +268,8 @@ namespace ]b4_namespace[
|
||||
return ostr;
|
||||
}
|
||||
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
#endif // not BISON_LOCATION_HH]
|
||||
m4_divert(-1)
|
||||
m4_divert_pop(0)
|
||||
m4_changecom([#])
|
||||
|
||||
@@ -6,10 +6,10 @@ divert(-1)# -*- Autoconf -*-
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 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
|
||||
# the Free Software Foundation; either version 2, or (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
|
||||
@@ -17,10 +17,8 @@ divert(-1)# -*- Autoconf -*-
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
#
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception, the Free Software Foundation gives unlimited
|
||||
# permission to copy, distribute and modify the configure scripts that
|
||||
# are the output of Autoconf. You need not follow the terms of the GNU
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
bison.xsl - common templates for Bison XSLT.
|
||||
$Id$
|
||||
|
||||
Copyright (C) 2007 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/>.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:bison="http://www.gnu.org/software/bison/">
|
||||
|
||||
<xsl:key
|
||||
name="bison:symbolByName"
|
||||
match="/bison-xml-report/grammar/nonterminals/nonterminal"
|
||||
use="@name"
|
||||
/>
|
||||
<xsl:key
|
||||
name="bison:symbolByName"
|
||||
match="/bison-xml-report/grammar/terminals/terminal"
|
||||
use="@name"
|
||||
/>
|
||||
<xsl:key
|
||||
name="bison:ruleByNumber"
|
||||
match="/bison-xml-report/grammar/rules/rule"
|
||||
use="@number"
|
||||
/>
|
||||
<xsl:key
|
||||
name="bison:ruleByLhs"
|
||||
match="/bison-xml-report/grammar/rules/rule[
|
||||
@usefulness != 'useless-in-grammar']"
|
||||
use="lhs"
|
||||
/>
|
||||
<xsl:key
|
||||
name="bison:ruleByRhs"
|
||||
match="/bison-xml-report/grammar/rules/rule[
|
||||
@usefulness != 'useless-in-grammar']"
|
||||
use="rhs/symbol"
|
||||
/>
|
||||
|
||||
<!-- For the specified state, output: #sr-conflicts,#rr-conflicts -->
|
||||
<xsl:template match="state" mode="bison:count-conflicts">
|
||||
<xsl:variable name="transitions" select="actions/transitions"/>
|
||||
<xsl:variable name="reductions" select="actions/reductions"/>
|
||||
<xsl:variable
|
||||
name="terminals"
|
||||
select="
|
||||
$transitions/transition[@type='shift']/@symbol
|
||||
| $reductions/reduction/@symbol
|
||||
"
|
||||
/>
|
||||
<xsl:variable name="conflict-data">
|
||||
<xsl:for-each select="$terminals">
|
||||
<xsl:variable name="name" select="."/>
|
||||
<xsl:if test="generate-id($terminals[. = $name][1]) = generate-id(.)">
|
||||
<xsl:variable
|
||||
name="shift-count"
|
||||
select="count($transitions/transition[@symbol=$name])"
|
||||
/>
|
||||
<xsl:variable
|
||||
name="reduce-count"
|
||||
select="count($reductions/reduction[@symbol=$name])"
|
||||
/>
|
||||
<xsl:if test="$shift-count > 0 and $reduce-count > 0">
|
||||
<xsl:text>s</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="$reduce-count > 1">
|
||||
<xsl:text>r</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="string-length(translate($conflict-data, 'r', ''))"/>
|
||||
<xsl:text>,</xsl:text>
|
||||
<xsl:value-of select="string-length(translate($conflict-data, 's', ''))"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,207 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||
$Id$
|
||||
|
||||
Copyright (C) 2007 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/>.
|
||||
|
||||
Written by Wojciech Polak <[email protected]>.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:bison="http://www.gnu.org/software/bison/">
|
||||
|
||||
<xsl:import href="bison.xsl"/>
|
||||
<xsl:output method="text" encoding="UTF-8" indent="no"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="bison-xml-report"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bison-xml-report">
|
||||
<xsl:apply-templates select="automaton"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton">
|
||||
<xsl:text>digraph Automaton { </xsl:text>
|
||||
<xsl:apply-templates select="state"/>
|
||||
<xsl:text>} </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton/state">
|
||||
<xsl:call-template name="output-node">
|
||||
<xsl:with-param name="number" select="@number"/>
|
||||
<xsl:with-param name="label">
|
||||
<xsl:value-of select="@number"/>
|
||||
<xsl:apply-templates select="itemset/item"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="actions/transitions"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/transitions">
|
||||
<xsl:apply-templates select="transition"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item">
|
||||
<xsl:apply-templates select="key('bison:ruleByNumber', @rule-number)">
|
||||
<xsl:with-param name="point" select="@point"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="lookaheads"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rule">
|
||||
<xsl:param name="point"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="lhs"/>
|
||||
<xsl:text> -></xsl:text>
|
||||
<xsl:if test="$point = 0">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:for-each select="rhs/symbol|rhs/empty">
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="$point = position()">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="symbol">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty"/>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:apply-templates select="symbol"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads/symbol">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:if test="position() != last()">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="transition">
|
||||
<xsl:call-template name="output-edge">
|
||||
<xsl:with-param name="src" select="../../../@number"/>
|
||||
<xsl:with-param name="dst" select="@state"/>
|
||||
<xsl:with-param name="style">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@symbol = 'error'">
|
||||
<xsl:text>dotted</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'shift'">
|
||||
<xsl:text>solid</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>dashed</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="label">
|
||||
<xsl:if test="not(@symbol = 'error')">
|
||||
<xsl:value-of select="@symbol"/>
|
||||
</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="output-node">
|
||||
<xsl:param name="number"/>
|
||||
<xsl:param name="label"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$number"/>
|
||||
<xsl:text> [label="</xsl:text>
|
||||
<xsl:call-template name="escape">
|
||||
<xsl:with-param name="subject" select="$label"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>"] </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="output-edge">
|
||||
<xsl:param name="src"/>
|
||||
<xsl:param name="dst"/>
|
||||
<xsl:param name="style"/>
|
||||
<xsl:param name="label"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$src"/>
|
||||
<xsl:text> -> </xsl:text>
|
||||
<xsl:value-of select="$dst"/>
|
||||
<xsl:text> [style=</xsl:text>
|
||||
<xsl:value-of select="$style"/>
|
||||
<xsl:if test="$label and $label != ''">
|
||||
<xsl:text> label="</xsl:text>
|
||||
<xsl:call-template name="escape">
|
||||
<xsl:with-param name="subject" select="$label"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>"</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>] </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="escape">
|
||||
<xsl:param name="subject"/> <!-- required -->
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="subject">
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="subject">
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="subject" select="$subject"/>
|
||||
<xsl:with-param name="search" select="'\'"/>
|
||||
<xsl:with-param name="replace" select="'\\'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="search" select="'"'"/>
|
||||
<xsl:with-param name="replace" select="'\"'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="search" select="' '"/>
|
||||
<xsl:with-param name="replace" select="'\n'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="string-replace">
|
||||
<xsl:param name="subject"/>
|
||||
<xsl:param name="search"/>
|
||||
<xsl:param name="replace"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($subject, $search)">
|
||||
<xsl:variable name="before" select="substring-before($subject, $search)"/>
|
||||
<xsl:variable name="after" select="substring-after($subject, $search)"/>
|
||||
<xsl:value-of select="$before"/>
|
||||
<xsl:value-of select="$replace"/>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="subject" select="$after"/>
|
||||
<xsl:with-param name="search" select="$search"/>
|
||||
<xsl:with-param name="replace" select="$replace"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$subject"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,582 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
xml2text.xsl - transform Bison XML Report into plain text.
|
||||
$Id$
|
||||
|
||||
Copyright (C) 2007 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/>.
|
||||
|
||||
Written by Wojciech Polak <[email protected]>.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:bison="http://www.gnu.org/software/bison/">
|
||||
|
||||
<xsl:import href="bison.xsl"/>
|
||||
<xsl:output method="text" encoding="UTF-8" indent="no"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="bison-xml-report"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bison-xml-report">
|
||||
<xsl:apply-templates select="grammar" mode="reductions"/>
|
||||
<xsl:apply-templates select="grammar" mode="useless-in-parser"/>
|
||||
<xsl:apply-templates select="automaton" mode="conflicts"/>
|
||||
<xsl:apply-templates select="grammar"/>
|
||||
<xsl:apply-templates select="automaton"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar" mode="reductions">
|
||||
<xsl:apply-templates select="nonterminals" mode="useless-in-grammar"/>
|
||||
<xsl:apply-templates select="terminals" mode="unused-in-grammar"/>
|
||||
<xsl:apply-templates select="rules" mode="useless-in-grammar"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nonterminals" mode="useless-in-grammar">
|
||||
<xsl:if test="nonterminal[@usefulness='useless-in-grammar']">
|
||||
<xsl:text>Nonterminals useless in grammar </xsl:text>
|
||||
<xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="terminals" mode="unused-in-grammar">
|
||||
<xsl:if test="terminal[@usefulness='unused-in-grammar']">
|
||||
<xsl:text>Terminals unused in grammar </xsl:text>
|
||||
<xsl:for-each select="terminal[@usefulness='unused-in-grammar']">
|
||||
<xsl:sort select="@symbol-number" data-type="number"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rules" mode="useless-in-grammar">
|
||||
<xsl:variable name="set" select="rule[@usefulness='useless-in-grammar']"/>
|
||||
<xsl:if test="$set">
|
||||
<xsl:text>Rules useless in grammar </xsl:text>
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param name="rule-set" select="$set"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar" mode="useless-in-parser">
|
||||
<xsl:variable
|
||||
name="set" select="rules/rule[@usefulness='useless-in-parser']"
|
||||
/>
|
||||
<xsl:if test="$set">
|
||||
<xsl:text>Rules useless in parser due to conflicts </xsl:text>
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param name="rule-set" select="$set"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar">
|
||||
<xsl:text>Grammar </xsl:text>
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param
|
||||
name="rule-set" select="rules/rule[@usefulness!='useless-in-grammar']"
|
||||
/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="terminals"/>
|
||||
<xsl:apply-templates select="nonterminals"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="style-rule-set">
|
||||
<xsl:param name="rule-set"/>
|
||||
<xsl:for-each select="$rule-set">
|
||||
<xsl:apply-templates select=".">
|
||||
<xsl:with-param name="pad" select="'3'"/>
|
||||
<xsl:with-param name="prev-lhs">
|
||||
<xsl:if test="position()>1">
|
||||
<xsl:variable name="position" select="position()"/>
|
||||
<xsl:value-of select="$rule-set[$position - 1]/lhs"/>
|
||||
</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar/terminals">
|
||||
<xsl:text>Terminals, with rules where they appear </xsl:text>
|
||||
<xsl:apply-templates select="terminal"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar/nonterminals">
|
||||
<xsl:text>Nonterminals, with rules where they appear </xsl:text>
|
||||
<xsl:apply-templates select="nonterminal[@usefulness!='useless-in-grammar']"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="terminal">
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:call-template name="line-wrap">
|
||||
<xsl:with-param name="first-line-length">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(@name) > 66">0</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="66 - string-length(@name)" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="line-length" select="66" />
|
||||
<xsl:with-param name="text">
|
||||
<xsl:value-of select="concat(' (', @token-number, ')')"/>
|
||||
<xsl:for-each select="key('bison:ruleByRhs', @name)">
|
||||
<xsl:value-of select="concat(' ', @number)"/>
|
||||
</xsl:for-each>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nonterminal">
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:value-of select="concat(' (', @symbol-number, ')')"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:variable name="output">
|
||||
<xsl:call-template name="line-wrap">
|
||||
<xsl:with-param name="line-length" select="66" />
|
||||
<xsl:with-param name="text">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="key('bison:ruleByLhs', @name)">
|
||||
<xsl:text>on@left:</xsl:text>
|
||||
<xsl:for-each select="key('bison:ruleByLhs', @name)">
|
||||
<xsl:value-of select="concat(' ', @number)"/>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
<xsl:if test="key('bison:ruleByRhs', @name)">
|
||||
<xsl:if test="key('bison:ruleByLhs', @name)">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>on@right:</xsl:text>
|
||||
<xsl:for-each select="key('bison:ruleByRhs', @name)">
|
||||
<xsl:value-of select="concat(' ', @number)"/>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="translate($output, '@', ' ')" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton" mode="conflicts">
|
||||
<xsl:variable name="conflict-report">
|
||||
<xsl:apply-templates select="state" mode="conflicts"/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="string-length($conflict-report) != 0">
|
||||
<xsl:value-of select="$conflict-report"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="state" mode="conflicts">
|
||||
<xsl:variable name="conflict-counts">
|
||||
<xsl:apply-templates select="." mode="bison:count-conflicts" />
|
||||
</xsl:variable>
|
||||
<xsl:variable
|
||||
name="sr-count" select="substring-before($conflict-counts, ',')"
|
||||
/>
|
||||
<xsl:variable
|
||||
name="rr-count" select="substring-after($conflict-counts, ',')"
|
||||
/>
|
||||
<xsl:if test="$sr-count > 0 or $rr-count > 0">
|
||||
<xsl:value-of select="concat('State ', @number, ' conflicts:')"/>
|
||||
<xsl:if test="$sr-count > 0">
|
||||
<xsl:value-of select="concat(' ', $sr-count, ' shift/reduce')"/>
|
||||
<xsl:if test="$rr-count > 0">
|
||||
<xsl:value-of select="(',')"/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
<xsl:if test="$rr-count > 0">
|
||||
<xsl:value-of select="concat(' ', $rr-count, ' reduce/reduce')"/>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="' '"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton">
|
||||
<xsl:apply-templates select="state">
|
||||
<xsl:with-param name="pad" select="'3'"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton/state">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text>state </xsl:text>
|
||||
<xsl:value-of select="@number"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="itemset/item">
|
||||
<xsl:with-param name="pad" select="$pad"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="actions/transitions">
|
||||
<xsl:with-param name="type" select="'shift'"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="actions/errors"/>
|
||||
<xsl:apply-templates select="actions/reductions"/>
|
||||
<xsl:apply-templates select="actions/transitions">
|
||||
<xsl:with-param name="type" select="'goto'"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="solved-conflicts"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/transitions">
|
||||
<xsl:param name="type"/>
|
||||
<xsl:if test="transition[@type = $type]">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="transition[@type = $type]">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="transition[@type = $type]"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/errors">
|
||||
<xsl:if test="error">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="error">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="error"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/reductions">
|
||||
<xsl:if test="reduction">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="reduction">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="reduction"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:param name="prev-rule-number"
|
||||
select="preceding-sibling::item[1]/@rule-number"/>
|
||||
<xsl:apply-templates
|
||||
select="key('bison:ruleByNumber', current()/@rule-number)"
|
||||
>
|
||||
<xsl:with-param name="itemset" select="'true'"/>
|
||||
<xsl:with-param name="pad" select="$pad"/>
|
||||
<xsl:with-param
|
||||
name="prev-lhs"
|
||||
select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]"
|
||||
/>
|
||||
<xsl:with-param name="point" select="@point"/>
|
||||
<xsl:with-param name="lookaheads">
|
||||
<xsl:apply-templates select="lookaheads"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rule">
|
||||
<xsl:param name="itemset"/>
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:param name="prev-lhs"/>
|
||||
<xsl:param name="point"/>
|
||||
<xsl:param name="lookaheads"/>
|
||||
|
||||
<xsl:if test="$itemset != 'true' and not($prev-lhs = lhs[text()])">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="string(@number)"/>
|
||||
<xsl:with-param name="pad" select="number($pad)"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<!-- LHS -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="'|'"/>
|
||||
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="'|'"/>
|
||||
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="lhs"/>
|
||||
<xsl:text>:</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!-- RHS -->
|
||||
<xsl:for-each select="rhs/*">
|
||||
<xsl:if test="position() = $point + 1">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset != 'true'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="position() = last() and position() = $point">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="$lookaheads">
|
||||
<xsl:value-of select="$lookaheads"/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="symbol">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> /* empty */</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
<xsl:text> [</xsl:text>
|
||||
<xsl:apply-templates select="symbol"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads/symbol">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:if test="position() != last()">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="transition">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type = 'shift'">
|
||||
<xsl:text>shift, and go to state </xsl:text>
|
||||
<xsl:value-of select="@state"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'goto'">
|
||||
<xsl:text>go to state </xsl:text>
|
||||
<xsl:value-of select="@state"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="error">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>error</xsl:text>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="text()"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="reduction">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:if test="@enabled = 'false'">
|
||||
<xsl:text>[</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@rule = 'accept'">
|
||||
<xsl:text>accept</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>reduce using rule </xsl:text>
|
||||
<xsl:value-of select="@rule"/>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of
|
||||
select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="@enabled = 'false'">
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="solved-conflicts">
|
||||
<xsl:if test="resolution">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="resolution"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="resolution">
|
||||
<xsl:text> Conflict between rule </xsl:text>
|
||||
<xsl:value-of select="@rule"/>
|
||||
<xsl:text> and token </xsl:text>
|
||||
<xsl:value-of select="@symbol"/>
|
||||
<xsl:text> resolved as </xsl:text>
|
||||
<xsl:if test="@type = 'error'">
|
||||
<xsl:text>an </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="@type"/>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>). </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="max-width-symbol">
|
||||
<xsl:param name="node"/>
|
||||
<xsl:variable name="longest">
|
||||
<xsl:for-each select="$node">
|
||||
<xsl:sort data-type="number" select="string-length(@symbol)"
|
||||
order="descending"/>
|
||||
<xsl:if test="position() = 1">
|
||||
<xsl:value-of select="string-length(@symbol)"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="$longest"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="lpad">
|
||||
<xsl:param name="str" select="''"/>
|
||||
<xsl:param name="pad" select="0"/>
|
||||
<xsl:variable name="diff" select="$pad - string-length($str)" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="$diff < 0">
|
||||
<xsl:value-of select="$str"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="space">
|
||||
<xsl:with-param name="repeat" select="$diff"/>
|
||||
</xsl:call-template>
|
||||
<xsl:value-of select="$str"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="rpad">
|
||||
<xsl:param name="str" select="''"/>
|
||||
<xsl:param name="pad" select="0"/>
|
||||
<xsl:variable name="diff" select="$pad - string-length($str)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$diff < 0">
|
||||
<xsl:value-of select="$str"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$str"/>
|
||||
<xsl:call-template name="space">
|
||||
<xsl:with-param name="repeat" select="$diff"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="space">
|
||||
<xsl:param name="repeat">0</xsl:param>
|
||||
<xsl:param name="fill" select="' '"/>
|
||||
<xsl:if test="number($repeat) >= 1">
|
||||
<xsl:call-template name="space">
|
||||
<xsl:with-param name="repeat" select="$repeat - 1"/>
|
||||
<xsl:with-param name="fill" select="$fill"/>
|
||||
</xsl:call-template>
|
||||
<xsl:value-of select="$fill"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="line-wrap">
|
||||
<xsl:param name="line-length"/> <!-- required -->
|
||||
<xsl:param name="first-line-length" select="$line-length"/>
|
||||
<xsl:param name="text"/> <!-- required -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="normalize-space($text) = ''" />
|
||||
<xsl:when test="string-length($text) <= $first-line-length">
|
||||
<xsl:value-of select="concat($text, ' ')" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="break-pos">
|
||||
<xsl:call-template name="ws-search">
|
||||
<xsl:with-param name="text" select="$text" />
|
||||
<xsl:with-param name="start" select="$first-line-length+1" />
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="substring($text, 1, $break-pos - 1)" />
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="line-wrap">
|
||||
<xsl:with-param name="line-length" select="$line-length" />
|
||||
<xsl:with-param
|
||||
name="text" select="concat(' ', substring($text, $break-pos+1))"
|
||||
/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="ws-search">
|
||||
<xsl:param name="text"/> <!-- required -->
|
||||
<xsl:param name="start"/> <!-- required -->
|
||||
<xsl:variable name="search-text" select="substring($text, $start)" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(contains($search-text, ' '))">
|
||||
<xsl:value-of select="string-length($text)+1" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of
|
||||
select="$start + string-length(substring-before($search-text, ' '))"
|
||||
/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,746 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||
$Id$
|
||||
|
||||
Copyright (C) 2007, 2008 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/>.
|
||||
|
||||
Written by Wojciech Polak <[email protected]>.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:bison="http://www.gnu.org/software/bison/">
|
||||
|
||||
<xsl:import href="bison.xsl"/>
|
||||
|
||||
<xsl:output method="xml" encoding="UTF-8"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
||||
indent="yes"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<xsl:value-of select="bison-xml-report/filename"/>
|
||||
<xsl:text> - GNU Bison XML Automaton Report</xsl:text>
|
||||
</title>
|
||||
<style type="text/css"><![CDATA[
|
||||
body {
|
||||
font-family: "Nimbus Sans L", Arial, sans-serif;
|
||||
font-size: 9pt;
|
||||
}
|
||||
a:link {
|
||||
color: #1f00ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:visited {
|
||||
color: #1f00ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: red;
|
||||
}
|
||||
#menu a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.i {
|
||||
font-style: italic;
|
||||
}
|
||||
.pre {
|
||||
font-family: monospace;
|
||||
white-space: pre;
|
||||
}
|
||||
ol.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
ol.lower-alpha {
|
||||
list-style-type: lower-alpha;
|
||||
}
|
||||
.point {
|
||||
color: #cc0000;
|
||||
}
|
||||
#footer {
|
||||
margin-top: 3.5em;
|
||||
font-size: 7pt;
|
||||
}
|
||||
]]></style>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates select="bison-xml-report"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<div id="footer"><hr />This document was generated using
|
||||
<a href="http://www.gnu.org/software/bison/" title="GNU Bison">
|
||||
GNU Bison <xsl:value-of select="/bison-xml-report/@version"/></a>
|
||||
XML Automaton Report.<br />
|
||||
<!-- default copying notice -->
|
||||
Verbatim copying and distribution of this entire page is
|
||||
permitted in any medium, provided this notice is preserved.</div>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bison-xml-report">
|
||||
<h1>GNU Bison XML Automaton Report</h1>
|
||||
<p>
|
||||
input grammar: <span class="i"><xsl:value-of select="filename"/></span>
|
||||
</p>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
<h3>Table of Contents</h3>
|
||||
<ul id="menu">
|
||||
<li>
|
||||
<a href="#reductions">Reductions</a>
|
||||
<ul class="lower-alpha">
|
||||
<li><a href="#nonterminals_useless_in_grammar">Nonterminals useless in grammar</a></li>
|
||||
<li><a href="#terminals_unused_in_grammar">Terminals unused in grammar</a></li>
|
||||
<li><a href="#rules_useless_in_grammar">Rules useless in grammar</a></li>
|
||||
<xsl:if test="grammar/rules/rule[@usefulness='useless-in-parser']">
|
||||
<li><a href="#rules_useless_in_parser">Rules useless in parser due to conflicts</a></li>
|
||||
</xsl:if>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#conflicts">Conflicts</a></li>
|
||||
<li>
|
||||
<a href="#grammar">Grammar</a>
|
||||
<ul class="lower-alpha">
|
||||
<li><a href="#grammar">Itemset</a></li>
|
||||
<li><a href="#terminals">Terminal symbols</a></li>
|
||||
<li><a href="#nonterminals">Nonterminal symbols</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#automaton">Automaton</a></li>
|
||||
</ul>
|
||||
<xsl:apply-templates select="grammar" mode="reductions"/>
|
||||
<xsl:apply-templates select="grammar" mode="useless-in-parser"/>
|
||||
<xsl:apply-templates select="automaton" mode="conflicts"/>
|
||||
<xsl:apply-templates select="grammar"/>
|
||||
<xsl:apply-templates select="automaton"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar" mode="reductions">
|
||||
<h2>
|
||||
<a name="reductions"/>
|
||||
<xsl:text> Reductions</xsl:text>
|
||||
</h2>
|
||||
<xsl:apply-templates select="nonterminals" mode="useless-in-grammar"/>
|
||||
<xsl:apply-templates select="terminals" mode="unused-in-grammar"/>
|
||||
<xsl:apply-templates select="rules" mode="useless-in-grammar"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nonterminals" mode="useless-in-grammar">
|
||||
<h3>
|
||||
<a name="nonterminals_useless_in_grammar"/>
|
||||
<xsl:text> Nonterminals useless in grammar</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="nonterminal[@usefulness='useless-in-grammar']">
|
||||
<p class="pre">
|
||||
<xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text> </xsl:text>
|
||||
</p>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="terminals" mode="unused-in-grammar">
|
||||
<h3>
|
||||
<a name="terminals_unused_in_grammar"/>
|
||||
<xsl:text> Terminals unused in grammar</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="terminal[@usefulness='unused-in-grammar']">
|
||||
<p class="pre">
|
||||
<xsl:for-each select="terminal[@usefulness='unused-in-grammar']">
|
||||
<xsl:sort select="@symbol-number" data-type="number"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text> </xsl:text>
|
||||
</p>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rules" mode="useless-in-grammar">
|
||||
<h3>
|
||||
<a name="rules_useless_in_grammar"/>
|
||||
<xsl:text> Rules useless in grammar</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:variable name="set" select="rule[@usefulness='useless-in-grammar']"/>
|
||||
<xsl:if test="$set">
|
||||
<p class="pre">
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param name="rule-set" select="$set"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
</p>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar" mode="useless-in-parser">
|
||||
<xsl:variable
|
||||
name="set" select="rules/rule[@usefulness='useless-in-parser']"
|
||||
/>
|
||||
<xsl:if test="$set">
|
||||
<h2>
|
||||
<a name="rules_useless_in_parser"/>
|
||||
<xsl:text> Rules useless in parser due to conflicts</xsl:text>
|
||||
</h2>
|
||||
<xsl:text> </xsl:text>
|
||||
<p class="pre">
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param name="rule-set" select="$set"/>
|
||||
</xsl:call-template>
|
||||
</p>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar">
|
||||
<h2>
|
||||
<a name="grammar"/>
|
||||
<xsl:text> Grammar</xsl:text>
|
||||
</h2>
|
||||
<xsl:text> </xsl:text>
|
||||
<p class="pre">
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param
|
||||
name="rule-set" select="rules/rule[@usefulness!='useless-in-grammar']"
|
||||
/>
|
||||
</xsl:call-template>
|
||||
</p>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="terminals"/>
|
||||
<xsl:apply-templates select="nonterminals"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="style-rule-set">
|
||||
<xsl:param name="rule-set"/>
|
||||
<xsl:for-each select="$rule-set">
|
||||
<xsl:apply-templates select=".">
|
||||
<xsl:with-param name="pad" select="'3'"/>
|
||||
<xsl:with-param name="prev-lhs">
|
||||
<xsl:if test="position()>1">
|
||||
<xsl:variable name="position" select="position()"/>
|
||||
<xsl:value-of select="$rule-set[$position - 1]/lhs"/>
|
||||
</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton" mode="conflicts">
|
||||
<h2>
|
||||
<a name="conflicts"/>
|
||||
<xsl:text> Conflicts</xsl:text>
|
||||
</h2>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:variable name="conflict-report">
|
||||
<xsl:apply-templates select="state" mode="conflicts"/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="string-length($conflict-report) != 0">
|
||||
<p class="pre">
|
||||
<xsl:copy-of select="$conflict-report"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</p>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="state" mode="conflicts">
|
||||
<xsl:variable name="conflict-counts">
|
||||
<xsl:apply-templates select="." mode="bison:count-conflicts" />
|
||||
</xsl:variable>
|
||||
<xsl:variable
|
||||
name="sr-count" select="substring-before($conflict-counts, ',')"
|
||||
/>
|
||||
<xsl:variable
|
||||
name="rr-count" select="substring-after($conflict-counts, ',')"
|
||||
/>
|
||||
<xsl:if test="$sr-count > 0 or $rr-count > 0">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#state_', @number)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('State ', @number)"/>
|
||||
</a>
|
||||
<xsl:text> conflicts:</xsl:text>
|
||||
<xsl:if test="$sr-count > 0">
|
||||
<xsl:value-of select="concat(' ', $sr-count, ' shift/reduce')"/>
|
||||
<xsl:if test="$rr-count > 0">
|
||||
<xsl:value-of select="(',')"/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
<xsl:if test="$rr-count > 0">
|
||||
<xsl:value-of select="concat(' ', $rr-count, ' reduce/reduce')"/>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="' '"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar/terminals">
|
||||
<h3>
|
||||
<a name="terminals"/>
|
||||
<xsl:text> Terminals, with rules where they appear</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<p class="pre">
|
||||
<xsl:apply-templates select="terminal"/>
|
||||
</p>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar/nonterminals">
|
||||
<h3>
|
||||
<a name="nonterminals"/>
|
||||
<xsl:text> Nonterminals, with rules where they appear</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<p class="pre">
|
||||
<xsl:apply-templates
|
||||
select="nonterminal[@usefulness!='useless-in-grammar']"
|
||||
/>
|
||||
</p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="terminal">
|
||||
<b><xsl:value-of select="@name"/></b>
|
||||
<xsl:value-of select="concat(' (', @token-number, ')')"/>
|
||||
<xsl:for-each select="key('bison:ruleByRhs', @name)">
|
||||
<xsl:apply-templates select="." mode="number-link"/>
|
||||
</xsl:for-each>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nonterminal">
|
||||
<b><xsl:value-of select="@name"/></b>
|
||||
<xsl:value-of select="concat(' (', @symbol-number, ')')"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="key('bison:ruleByLhs', @name)">
|
||||
<xsl:text>on left:</xsl:text>
|
||||
<xsl:for-each select="key('bison:ruleByLhs', @name)">
|
||||
<xsl:apply-templates select="." mode="number-link"/>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
<xsl:if test="key('bison:ruleByRhs', @name)">
|
||||
<xsl:if test="key('bison:ruleByLhs', @name)">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>on right:</xsl:text>
|
||||
<xsl:for-each select="key('bison:ruleByRhs', @name)">
|
||||
<xsl:apply-templates select="." mode="number-link"/>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rule" mode="number-link">
|
||||
<xsl:text> </xsl:text>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#rule_', @number)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="@number"/>
|
||||
</a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton">
|
||||
<h2>
|
||||
<a name="automaton"/>
|
||||
<xsl:text> Automaton</xsl:text>
|
||||
</h2>
|
||||
<xsl:apply-templates select="state">
|
||||
<xsl:with-param name="pad" select="'3'"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton/state">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<h3>
|
||||
<a>
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="concat('state_', @number)"/>
|
||||
</xsl:attribute>
|
||||
</a>
|
||||
<xsl:text>state </xsl:text>
|
||||
<xsl:value-of select="@number"/>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<p class="pre">
|
||||
<xsl:apply-templates select="itemset/item">
|
||||
<xsl:with-param name="pad" select="$pad"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="actions/transitions">
|
||||
<xsl:with-param name="type" select="'shift'"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="actions/errors"/>
|
||||
<xsl:apply-templates select="actions/reductions"/>
|
||||
<xsl:apply-templates select="actions/transitions">
|
||||
<xsl:with-param name="type" select="'goto'"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="solved-conflicts"/>
|
||||
</p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/transitions">
|
||||
<xsl:param name="type"/>
|
||||
<xsl:if test="transition[@type = $type]">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="transition[@type = $type]">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="transition[@type = $type]"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/errors">
|
||||
<xsl:if test="error">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="error">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="error"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/reductions">
|
||||
<xsl:if test="reduction">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="reduction">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="reduction"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:param name="prev-rule-number"
|
||||
select="preceding-sibling::item[1]/@rule-number"/>
|
||||
<xsl:apply-templates
|
||||
select="key('bison:ruleByNumber', current()/@rule-number)"
|
||||
>
|
||||
<xsl:with-param name="itemset" select="'true'"/>
|
||||
<xsl:with-param name="pad" select="$pad"/>
|
||||
<xsl:with-param name="prev-lhs"
|
||||
select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]"
|
||||
/>
|
||||
<xsl:with-param name="point" select="@point"/>
|
||||
<xsl:with-param name="lookaheads">
|
||||
<xsl:apply-templates select="lookaheads"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rule">
|
||||
<xsl:param name="itemset"/>
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:param name="prev-lhs"/>
|
||||
<xsl:param name="point"/>
|
||||
<xsl:param name="lookaheads"/>
|
||||
|
||||
<xsl:if test="$itemset != 'true' and not($prev-lhs = lhs[text()])">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$itemset != 'true'">
|
||||
<a>
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="concat('rule_', @number)"/>
|
||||
</xsl:attribute>
|
||||
</a>
|
||||
</xsl:if>
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$itemset = 'true'">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#rule_', @number)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="string(@number)"/>
|
||||
<xsl:with-param name="pad" select="number($pad)"/>
|
||||
</xsl:call-template>
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="string(@number)"/>
|
||||
<xsl:with-param name="pad" select="number($pad)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<!-- LHS -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="'|'"/>
|
||||
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="'|'"/>
|
||||
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<span class="i">
|
||||
<xsl:value-of select="lhs"/>
|
||||
</span>
|
||||
<xsl:text> →</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!-- RHS -->
|
||||
<xsl:for-each select="rhs/*">
|
||||
<xsl:if test="position() = $point + 1">
|
||||
<xsl:text> </xsl:text>
|
||||
<span class="point">.</span>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset != 'true'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="position() = last() and position() = $point">
|
||||
<xsl:text> </xsl:text>
|
||||
<span class="point">.</span>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="$lookaheads">
|
||||
<xsl:value-of select="$lookaheads"/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="symbol">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="name(key('bison:symbolByName', .)) = 'nonterminal'">
|
||||
<span class="i"><xsl:value-of select="."/></span>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<b><xsl:value-of select="."/></b>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> ε</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
<xsl:text> [</xsl:text>
|
||||
<xsl:apply-templates select="symbol"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads/symbol">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:if test="position() != last()">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="transition">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type = 'shift'">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#state_', @state)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('shift, and go to state ', @state)"/>
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'goto'">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#state_', @state)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('go to state ', @state)"/>
|
||||
</a>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="error">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>error</xsl:text>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="text()"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="reduction">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:if test="@enabled = 'false'">
|
||||
<xsl:text>[</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@rule = 'accept'">
|
||||
<xsl:text>accept</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#rule_', @rule)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('reduce using rule ', @rule)"/>
|
||||
</a>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of
|
||||
select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"
|
||||
/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="@enabled = 'false'">
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="solved-conflicts">
|
||||
<xsl:if test="resolution">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="resolution"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="resolution">
|
||||
<xsl:text> Conflict between </xsl:text>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#rule_', @rule)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('rule ',@rule)"/>
|
||||
</a>
|
||||
<xsl:text> and token </xsl:text>
|
||||
<xsl:value-of select="@symbol"/>
|
||||
<xsl:text> resolved as </xsl:text>
|
||||
<xsl:if test="@type = 'error'">
|
||||
<xsl:text>an </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="@type"/>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>). </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="max-width-symbol">
|
||||
<xsl:param name="node"/>
|
||||
<xsl:variable name="longest">
|
||||
<xsl:for-each select="$node">
|
||||
<xsl:sort data-type="number" select="string-length(@symbol)"
|
||||
order="descending"/>
|
||||
<xsl:if test="position() = 1">
|
||||
<xsl:value-of select="string-length(@symbol)"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="$longest"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="lpad">
|
||||
<xsl:param name="str" select="''"/>
|
||||
<xsl:param name="pad" select="0"/>
|
||||
<xsl:variable name="diff" select="$pad - string-length($str)" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="$diff < 0">
|
||||
<xsl:value-of select="$str"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="space">
|
||||
<xsl:with-param name="repeat" select="$diff"/>
|
||||
</xsl:call-template>
|
||||
<xsl:value-of select="$str"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="rpad">
|
||||
<xsl:param name="str" select="''"/>
|
||||
<xsl:param name="pad" select="0"/>
|
||||
<xsl:variable name="diff" select="$pad - string-length($str)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$diff < 0">
|
||||
<xsl:value-of select="$str"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$str"/>
|
||||
<xsl:call-template name="space">
|
||||
<xsl:with-param name="repeat" select="$diff"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="space">
|
||||
<xsl:param name="repeat">0</xsl:param>
|
||||
<xsl:param name="fill" select="' '"/>
|
||||
<xsl:if test="number($repeat) >= 1">
|
||||
<xsl:call-template name="space">
|
||||
<xsl:with-param name="repeat" select="$repeat - 1"/>
|
||||
<xsl:with-param name="fill" select="$fill"/>
|
||||
</xsl:call-template>
|
||||
<xsl:value-of select="$fill"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
+358
-152
@@ -1,24 +1,40 @@
|
||||
m4_divert(-1) -*- C -*-
|
||||
-*- C -*-
|
||||
|
||||
# Yacc compatible skeleton for Bison
|
||||
|
||||
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
# 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Check the value of %define api.push_pull.
|
||||
b4_percent_define_default([[api.push_pull]], [[pull]])
|
||||
b4_percent_define_check_values([[[[api.push_pull]],
|
||||
[[pull]], [[push]], [[both]]]])
|
||||
b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]])
|
||||
b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]])
|
||||
m4_case(b4_percent_define_get([[api.push_pull]]),
|
||||
[pull], [m4_define([b4_push_flag], [[0]])],
|
||||
[push], [m4_define([b4_pull_flag], [[0]])])
|
||||
|
||||
# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing
|
||||
# tests function as written, don't let BISON_USE_PUSH_FOR_PULL modify Bison's
|
||||
# behavior at all when push parsing is already requested.
|
||||
b4_define_flag_if([use_push_for_pull])
|
||||
b4_use_push_for_pull_if([
|
||||
b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])],
|
||||
[m4_define([b4_push_flag], [[1]])])])
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
|
||||
@@ -35,6 +51,10 @@ m4_define_default([b4_stack_depth_init], [200])
|
||||
## Pure/impure interfaces. ##
|
||||
## ------------------------ ##
|
||||
|
||||
b4_percent_define_default([[api.pure]], [[false]])
|
||||
b4_define_flag_if([pure])
|
||||
m4_define([b4_pure_flag],
|
||||
[b4_percent_define_flag_if([[api.pure]], [[1]], [[0]])])
|
||||
|
||||
# b4_yacc_pure_if(IF-TRUE, IF-FALSE)
|
||||
# ----------------------------------
|
||||
@@ -63,7 +83,6 @@ b4_locations_if([, [[YYLTYPE *], [&yylloc]]])m4_ifdef([b4_lex_param], [, ])])dnl
|
||||
m4_ifdef([b4_lex_param], b4_lex_param)))
|
||||
|
||||
|
||||
|
||||
## ------------ ##
|
||||
## Data Types. ##
|
||||
## ------------ ##
|
||||
@@ -133,8 +152,8 @@ m4_define([b4_rhs_location],
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
m4_divert(0)dnl
|
||||
@output @output_parser_name@
|
||||
m4_divert_push(0)dnl
|
||||
@output(b4_parser_file_name@)
|
||||
b4_copyright([Skeleton implementation for Bison's Yacc-like parsers in C],dnl '
|
||||
[1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006])[
|
||||
|
||||
@@ -149,19 +168,25 @@ b4_copyright([Skeleton implementation for Bison's Yacc-like parsers in C],dnl '
|
||||
USER NAME SPACE" below. */
|
||||
|
||||
]b4_identification
|
||||
b4_percent_code_get([[top]])[]dnl
|
||||
m4_if(b4_prefix, [yy], [],
|
||||
[/* Substitute the variable and function names. */
|
||||
#define yyparse b4_prefix[]parse
|
||||
#define yylex b4_prefix[]lex
|
||||
#define yyerror b4_prefix[]error
|
||||
#define yylval b4_prefix[]lval
|
||||
#define yychar b4_prefix[]char
|
||||
#define yydebug b4_prefix[]debug
|
||||
#define yynerrs b4_prefix[]nerrs
|
||||
b4_locations_if([#define yylloc b4_prefix[]lloc])])[
|
||||
[[/* Substitute the variable and function names. */
|
||||
]b4_pull_if([[#define yyparse ]b4_prefix[parse
|
||||
]])b4_push_if([[#define yypush_parse ]b4_prefix[push_parse
|
||||
]b4_pull_if([[#define yypull_parse ]b4_prefix[pull_parse
|
||||
]])[#define yypstate_new ]b4_prefix[pstate_new
|
||||
#define yypstate_delete ]b4_prefix[pstate_delete
|
||||
#define yypstate ]b4_prefix[pstate
|
||||
]])[#define yylex ]b4_prefix[lex
|
||||
#define yyerror ]b4_prefix[error
|
||||
#define yylval ]b4_prefix[lval
|
||||
#define yychar ]b4_prefix[char
|
||||
#define yydebug ]b4_prefix[debug
|
||||
#define yynerrs ]b4_prefix[nerrs
|
||||
]b4_locations_if([[#define yylloc ]b4_prefix[lloc]])])[
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
]b4_pre_prologue[
|
||||
]b4_user_pre_prologue[
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
@@ -181,26 +206,25 @@ b4_locations_if([#define yylloc b4_prefix[]lloc])])[
|
||||
# define YYTOKEN_TABLE ]b4_token_table[
|
||||
#endif
|
||||
|
||||
]m4_ifdef([b4_start_header],
|
||||
[[/* Copy the %start-header blocks. */
|
||||
]b4_start_header])[]dnl
|
||||
]b4_percent_code_get([[requires]])[]dnl
|
||||
|
||||
b4_token_enums_defines(b4_tokens)[
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
]m4_ifdef([b4_stype],
|
||||
[[typedef union ]b4_union_name[
|
||||
{
|
||||
]b4_user_stype[
|
||||
YYSTYPE;
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[typedef int YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]])])[
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
#endif]b4_locations_if([[
|
||||
|
||||
]b4_locations_if([#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
typedef struct YYLTYPE
|
||||
{
|
||||
int first_line;
|
||||
@@ -211,16 +235,36 @@ typedef struct YYLTYPE
|
||||
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYLTYPE_IS_DECLARED 1
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif])
|
||||
#endif]])b4_push_if([[
|
||||
|
||||
m4_ifdef([b4_end_header],
|
||||
[[/* Copy the %end-header blocks. */
|
||||
]b4_end_header])[]dnl
|
||||
#ifndef YYPUSH_DECLS
|
||||
# define YYPUSH_DECLS
|
||||
struct yypstate;
|
||||
typedef struct yypstate yypstate;
|
||||
enum { YYPUSH_MORE = 4 };
|
||||
|
||||
]b4_pull_if([b4_c_function_decl([[yyparse]], [[int]], b4_parse_param)
|
||||
])b4_c_function_decl([[yypush_parse]], [[int]],
|
||||
[[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
|
||||
[[[int yypushed_char]], [[yypushed_char]]],
|
||||
[[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
|
||||
[[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
|
||||
b4_parse_param]))
|
||||
b4_pull_if([b4_c_function_decl([[yypull_parse]], [[int]],
|
||||
[[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
|
||||
b4_parse_param]))])
|
||||
b4_c_function_decl([[yypstate_new]], [[yypstate *]], [[[void]], []])
|
||||
b4_c_function_decl([[yypstate_delete]], [[void]],
|
||||
[[[yypstate *yyps]], [[yyps]]])[
|
||||
#endif]])
|
||||
|
||||
b4_percent_code_get([[provides]])[]dnl
|
||||
|
||||
[/* Copy the second part of user declarations. */
|
||||
]b4_user_post_prologue[
|
||||
]b4_user_post_prologue
|
||||
b4_percent_code_get[]dnl
|
||||
|
||||
#ifdef short
|
||||
[#ifdef short
|
||||
# undef short
|
||||
#endif
|
||||
|
||||
@@ -296,7 +340,8 @@ typedef short int yytype_int16;
|
||||
|
||||
#if ! defined yyoverflow || YYERROR_VERBOSE
|
||||
|
||||
/* The parser invokes alloca or malloc; define the necessary symbols. */
|
||||
]b4_push_if([],
|
||||
[[/* The parser invokes alloca or malloc; define the necessary symbols. */
|
||||
|
||||
# ifdef YYSTACK_USE_ALLOCA
|
||||
# if YYSTACK_USE_ALLOCA
|
||||
@@ -321,7 +366,8 @@ typedef short int yytype_int16;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef YYSTACK_ALLOC
|
||||
]])dnl
|
||||
[# ifdef YYSTACK_ALLOC
|
||||
/* Pacify GCC's `empty if-body' warning. */
|
||||
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
|
||||
# ifndef YYSTACK_ALLOC_MAXIMUM
|
||||
@@ -369,11 +415,10 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
|
||||
/* A type that is properly aligned for any stack member. */
|
||||
union yyalloc
|
||||
{
|
||||
yytype_int16 yyss;
|
||||
YYSTYPE yyvs;
|
||||
]b4_locations_if([ YYLTYPE yyls;
|
||||
])dnl
|
||||
[};
|
||||
yytype_int16 yyss_alloc;
|
||||
YYSTYPE yyvs_alloc;]b4_locations_if([
|
||||
YYLTYPE yyls_alloc;])[
|
||||
};
|
||||
|
||||
/* The size of the maximum gap between one aligned stack and the next. */
|
||||
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
|
||||
@@ -411,12 +456,12 @@ union yyalloc
|
||||
elements in the stack, and YYPTR gives the new location of the
|
||||
stack. Advance YYPTR to a properly aligned location for the next
|
||||
stack. */
|
||||
# define YYSTACK_RELOCATE(Stack) \
|
||||
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yynewbytes; \
|
||||
YYCOPY (&yyptr->Stack, Stack, yysize); \
|
||||
Stack = &yyptr->Stack; \
|
||||
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
|
||||
Stack = &yyptr->Stack_alloc; \
|
||||
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
|
||||
yyptr += yynewbytes / sizeof (*yyptr); \
|
||||
} \
|
||||
@@ -702,7 +747,7 @@ do { \
|
||||
[[YYSTYPE *yyvsp], [yyvsp]],
|
||||
b4_locations_if([[[YYLTYPE *yylsp], [yylsp]],
|
||||
])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,
|
||||
])b4_parse_param)[
|
||||
b4_parse_param]))[
|
||||
{
|
||||
int yynrhs = yyr2[yyrule];
|
||||
int yyi;
|
||||
@@ -712,12 +757,12 @@ do { \
|
||||
/* The symbols being reduced. */
|
||||
for (yyi = 0; yyi < yynrhs; yyi++)
|
||||
{
|
||||
fprintf (stderr, " $%d = ", yyi + 1);
|
||||
YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
||||
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
||||
&]b4_rhs_value(yynrhs, yyi + 1)[
|
||||
]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
|
||||
b4_user_args[);
|
||||
fprintf (stderr, "\n");
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -953,59 +998,202 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
|
||||
|
||||
|
||||
]b4_yydestruct_generate([b4_c_function_def])[
|
||||
|
||||
|
||||
/* Prevent warnings from -Wmissing-prototypes. */
|
||||
|
||||
]b4_push_if([],
|
||||
[[/* Prevent warnings from -Wmissing-prototypes. */
|
||||
#ifdef YYPARSE_PARAM
|
||||
]b4_c_function_decl([yyparse], [int],
|
||||
[[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[
|
||||
#else /* ! YYPARSE_PARAM */
|
||||
]b4_c_function_decl([yyparse], [int], b4_parse_param)[
|
||||
#endif /* ! YYPARSE_PARAM */
|
||||
#endif /* ! YYPARSE_PARAM */]])
|
||||
|
||||
|
||||
]m4_divert_push([KILL])# ======================== M4 code.
|
||||
# b4_declare_parser_variables
|
||||
# ---------------------------
|
||||
m4_divert_push([KILL])# ======================== M4 code.
|
||||
# b4_declare_scanner_communication_variables
|
||||
# ------------------------------------------
|
||||
# Declare the variables that are global, or local to YYPARSE if
|
||||
# pure-parser.
|
||||
m4_define([b4_declare_parser_variables],
|
||||
[/* The lookahead symbol. */
|
||||
m4_define([b4_declare_scanner_communication_variables],
|
||||
[[/* The lookahead symbol. */
|
||||
int yychar;
|
||||
|
||||
/* The semantic value of the lookahead symbol. */
|
||||
YYSTYPE yylval;
|
||||
|
||||
/* Number of syntax errors so far. */
|
||||
int yynerrs;b4_locations_if([
|
||||
]b4_locations_if([[
|
||||
/* Location data for the lookahead symbol. */
|
||||
YYLTYPE yylloc;])
|
||||
])
|
||||
YYLTYPE yylloc;
|
||||
]])b4_pure_if([], [[
|
||||
/* Number of syntax errors so far. */
|
||||
int yynerrs;
|
||||
]])])
|
||||
|
||||
# b4_declare_parser_state_variables
|
||||
# ---------------------------------
|
||||
# Declare all the variables that are needed to maintain the parser state
|
||||
# between calls to yypush_parse.
|
||||
m4_define([b4_declare_parser_state_variables],
|
||||
[b4_pure_if([[ /* Number of syntax errors so far. */
|
||||
int yynerrs;
|
||||
]])[
|
||||
int yystate;
|
||||
/* Number of tokens to shift before error messages enabled. */
|
||||
int yyerrstatus;
|
||||
|
||||
/* The stacks and their tools:
|
||||
`yyss': related to states.
|
||||
`yyvs': related to semantic values.]b4_locations_if([[
|
||||
`yyls': related to locations.]])[
|
||||
|
||||
Refer to the stacks thru separate pointers, to allow yyoverflow
|
||||
to reallocate them elsewhere. */
|
||||
|
||||
/* The state stack. */
|
||||
yytype_int16 yyssa[YYINITDEPTH];
|
||||
yytype_int16 *yyss;
|
||||
yytype_int16 *yyssp;
|
||||
|
||||
/* The semantic value stack. */
|
||||
YYSTYPE yyvsa[YYINITDEPTH];
|
||||
YYSTYPE *yyvs;
|
||||
YYSTYPE *yyvsp;
|
||||
]b4_locations_if([[
|
||||
/* The location stack. */
|
||||
YYLTYPE yylsa[YYINITDEPTH];
|
||||
YYLTYPE *yyls;
|
||||
YYLTYPE *yylsp;
|
||||
|
||||
/* The locations where the error started and ended. */
|
||||
YYLTYPE yyerror_range[2];
|
||||
]])[
|
||||
YYSIZE_T yystacksize;
|
||||
]])
|
||||
|
||||
m4_divert_pop([KILL])dnl# ====================== End of M4 code.
|
||||
|
||||
b4_pure_if([],
|
||||
[b4_declare_parser_variables])
|
||||
b4_pure_if([], [b4_declare_scanner_communication_variables])
|
||||
|
||||
b4_push_if(
|
||||
[[struct yypstate
|
||||
{
|
||||
]b4_declare_parser_state_variables[
|
||||
/* Used to determine if this is the first time this instance has
|
||||
been used. */
|
||||
int yynew;
|
||||
};]b4_pure_if([], [[
|
||||
|
||||
/*----------.
|
||||
| yyparse. |
|
||||
`----------*/
|
||||
static char yypstate_allocated = 0;]])b4_pull_if([
|
||||
|
||||
b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
|
||||
{
|
||||
return yypull_parse (0]m4_ifset([b4_parse_param],
|
||||
[[, ]b4_c_args(b4_parse_param)])[);
|
||||
}
|
||||
|
||||
]b4_c_function_def([[yypull_parse]], [[int]],
|
||||
[[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
|
||||
b4_parse_param]))[
|
||||
{
|
||||
int yystatus;
|
||||
yypstate *yyps_local;]b4_pure_if([[
|
||||
int yychar;
|
||||
YYSTYPE yylval;]b4_locations_if([[
|
||||
YYLTYPE yylloc;]])])[
|
||||
if (yyps == 0)
|
||||
{
|
||||
yyps_local = yypstate_new ();
|
||||
if (!yyps_local)
|
||||
{]b4_pure_if([[
|
||||
yyerror (]b4_yyerror_args[YY_("memory exhausted"));]], [[
|
||||
if (!yypstate_allocated)
|
||||
yyerror (]b4_yyerror_args[YY_("memory exhausted"));]])[
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
yyps_local = yyps;
|
||||
do {
|
||||
yychar = YYLEX;
|
||||
yystatus =
|
||||
yypush_parse (yyps_local]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])[);
|
||||
} while (yystatus == YYPUSH_MORE);
|
||||
if (yyps == 0)
|
||||
yypstate_delete (yyps_local);
|
||||
return yystatus;
|
||||
}]])[
|
||||
|
||||
/* Initialize the parser data structure. */
|
||||
]b4_c_function_def([[yypstate_new]], [[yypstate *]])[
|
||||
{
|
||||
yypstate *yyps;]b4_pure_if([], [[
|
||||
if (yypstate_allocated)
|
||||
return 0;]])[
|
||||
yyps = (yypstate *) malloc (sizeof *yyps);
|
||||
if (!yyps)
|
||||
return 0;
|
||||
yyps->yynew = 1;]b4_pure_if([], [[
|
||||
yypstate_allocated = 1;]])[
|
||||
return yyps;
|
||||
}
|
||||
|
||||
]b4_c_function_def([[yypstate_delete]], [[void]],
|
||||
[[[yypstate *yyps]], [[yyps]]])[
|
||||
{
|
||||
#ifndef yyoverflow
|
||||
/* If the stack was reallocated but the parse did not complete, then the
|
||||
stack still needs to be freed. */
|
||||
if (!yyps->yynew && yyps->yyss != yyps->yyssa)
|
||||
YYSTACK_FREE (yyps->yyss);
|
||||
#endif
|
||||
free (yyps);]b4_pure_if([], [[
|
||||
yypstate_allocated = 0;]])[
|
||||
}
|
||||
|
||||
]b4_pure_if([[#define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs
|
||||
]])[#define yystate yyps->yystate
|
||||
#define yyerrstatus yyps->yyerrstatus
|
||||
#define yyssa yyps->yyssa
|
||||
#define yyss yyps->yyss
|
||||
#define yyssp yyps->yyssp
|
||||
#define yyvsa yyps->yyvsa
|
||||
#define yyvs yyps->yyvs
|
||||
#define yyvsp yyps->yyvsp
|
||||
]b4_locations_if([[#define yylsa yyps->yylsa
|
||||
#define yyls yyps->yyls
|
||||
#define yylsp yyps->yylsp
|
||||
#define yyerror_range yyps->yyerror_range
|
||||
]])[#define yystacksize yyps->yystacksize
|
||||
]])[
|
||||
/*-------------------------.
|
||||
| yyparse or yypush_parse. |
|
||||
`-------------------------*/
|
||||
]b4_push_if([
|
||||
b4_c_function_def([[yypush_parse]], [[int]],
|
||||
[[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
|
||||
[[[int yypushed_char]], [[yypushed_char]]],
|
||||
[[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
|
||||
[[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
|
||||
b4_parse_param]))], [
|
||||
#ifdef YYPARSE_PARAM
|
||||
b4_c_function_def([yyparse], [int], [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])
|
||||
#else /* ! YYPARSE_PARAM */
|
||||
b4_c_function_def([yyparse], [int], b4_parse_param)
|
||||
#endif
|
||||
{[
|
||||
]b4_pure_if([b4_declare_parser_variables])[
|
||||
int yystate;
|
||||
#endif])[
|
||||
{
|
||||
]b4_pure_if([b4_declare_scanner_communication_variables])
|
||||
b4_push_if([b4_pure_if([], [[ int yypushed_char = yychar;
|
||||
YYSTYPE yypushed_val = yylval;
|
||||
]b4_locations_if([[YYLTYPE yypushed_loc = yylloc;
|
||||
]])])],
|
||||
[b4_declare_parser_state_variables])[
|
||||
int yyn;
|
||||
int yyresult;
|
||||
/* Number of tokens to shift before error messages enabled. */
|
||||
int yyerrstatus;
|
||||
/* Lookahead token as an internal (translated) token number. */
|
||||
int yytoken = 0;
|
||||
int yytoken;
|
||||
/* The variables used to return semantic value and location from the
|
||||
action routines. */
|
||||
YYSTYPE yyval;]b4_locations_if([[
|
||||
YYLTYPE yyloc;]])[
|
||||
|
||||
#if YYERROR_VERBOSE
|
||||
/* Buffer for error messages, and its allocated size. */
|
||||
char yymsgbuf[128];
|
||||
@@ -1013,78 +1201,56 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
|
||||
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
|
||||
#endif
|
||||
|
||||
/* Three stacks and their tools:
|
||||
`yyss': related to states,
|
||||
`yyvs': related to semantic values,
|
||||
`yyls': related to locations.
|
||||
|
||||
Refer to the stacks thru separate pointers, to allow yyoverflow
|
||||
to reallocate them elsewhere. */
|
||||
|
||||
/* The state stack. */
|
||||
yytype_int16 yyssa[YYINITDEPTH];
|
||||
yytype_int16 *yyss = yyssa;
|
||||
yytype_int16 *yyssp;
|
||||
|
||||
/* The semantic value stack. */
|
||||
YYSTYPE yyvsa[YYINITDEPTH];
|
||||
YYSTYPE *yyvs = yyvsa;
|
||||
YYSTYPE *yyvsp;
|
||||
|
||||
]b4_locations_if(
|
||||
[[ /* The location stack. */
|
||||
YYLTYPE yylsa[YYINITDEPTH];
|
||||
YYLTYPE *yyls = yylsa;
|
||||
YYLTYPE *yylsp;
|
||||
/* The locations where the error started and ended. */
|
||||
YYLTYPE yyerror_range[2];]])[
|
||||
|
||||
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)]b4_locations_if([, yylsp -= (N)])[)
|
||||
|
||||
YYSIZE_T yystacksize = YYINITDEPTH;
|
||||
|
||||
/* The variables used to return semantic value and location from the
|
||||
action routines. */
|
||||
YYSTYPE yyval;
|
||||
]b4_locations_if([ YYLTYPE yyloc;])[
|
||||
|
||||
/* The number of symbols on the RHS of the reduced rule.
|
||||
Keep to zero when no symbol should be popped. */
|
||||
int yylen = 0;
|
||||
int yylen = 0;]b4_push_if([[
|
||||
|
||||
if (!yyps->yynew)
|
||||
{
|
||||
yyn = yypact[yystate];
|
||||
goto yyread_pushed_token;
|
||||
}]])[
|
||||
|
||||
yytoken = 0;
|
||||
yyss = yyssa;
|
||||
yyvs = yyvsa;]b4_locations_if([[
|
||||
yyls = yylsa;]])[
|
||||
yystacksize = YYINITDEPTH;
|
||||
|
||||
YYDPRINTF ((stderr, "Starting parse\n"));
|
||||
|
||||
yystate = 0;
|
||||
yyerrstatus = 0;
|
||||
yynerrs = 0;
|
||||
yychar = YYEMPTY; /* Cause a token to be read. */
|
||||
yychar = YYEMPTY; /* Cause a token to be read. */
|
||||
|
||||
/* Initialize stack pointers.
|
||||
Waste one element of value and location stack
|
||||
so that they stay on the same level as the state stack.
|
||||
The wasted elements are never initialized. */
|
||||
|
||||
yyssp = yyss;
|
||||
yyvsp = yyvs;
|
||||
]b4_locations_if([[ yylsp = yyls;
|
||||
yyvsp = yyvs;]b4_locations_if([[
|
||||
yylsp = yyls;
|
||||
|
||||
#if YYLTYPE_IS_TRIVIAL
|
||||
/* Initialize the default location before parsing starts. */
|
||||
yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
|
||||
yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
|
||||
#endif
|
||||
]])
|
||||
m4_ifdef([b4_initial_action], [
|
||||
#endif]])
|
||||
m4_ifdef([b4_initial_action],[
|
||||
m4_pushdef([b4_at_dollar], [m4_define([b4_at_dollar_used])yylloc])dnl
|
||||
m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl
|
||||
/* User initialization code. */
|
||||
b4_user_initial_action
|
||||
/* User initialization code. */
|
||||
b4_user_initial_action
|
||||
m4_popdef([b4_dollar_dollar])dnl
|
||||
m4_popdef([b4_at_dollar])])dnl
|
||||
m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
|
||||
]])dnl
|
||||
m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
||||
]])dnl
|
||||
[ goto yysetstate;
|
||||
]])[
|
||||
goto yysetstate;
|
||||
|
||||
/*------------------------------------------------------------.
|
||||
| yynewstate -- Push a new state, which is found in yystate. |
|
||||
@@ -1108,8 +1274,8 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
||||
these so that the &'s don't force the real ones into
|
||||
memory. */
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
yytype_int16 *yyss1 = yyss;
|
||||
]b4_locations_if([ YYLTYPE *yyls1 = yyls;])[
|
||||
yytype_int16 *yyss1 = yyss;]b4_locations_if([
|
||||
YYLTYPE *yyls1 = yyls;])[
|
||||
|
||||
/* Each stack pointer address is followed by the size of the
|
||||
data in use in that stack, in bytes. This used to be a
|
||||
@@ -1117,10 +1283,11 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
||||
be undefined if yyoverflow is a macro. */
|
||||
yyoverflow (YY_("memory exhausted"),
|
||||
&yyss1, yysize * sizeof (*yyssp),
|
||||
&yyvs1, yysize * sizeof (*yyvsp),
|
||||
]b4_locations_if([ &yyls1, yysize * sizeof (*yylsp),])[
|
||||
&yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([
|
||||
&yyls1, yysize * sizeof (*yylsp),])[
|
||||
&yystacksize);
|
||||
]b4_locations_if([ yyls = yyls1;])[
|
||||
]b4_locations_if([
|
||||
yyls = yyls1;])[
|
||||
yyss = yyss1;
|
||||
yyvs = yyvs1;
|
||||
}
|
||||
@@ -1141,9 +1308,9 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
||||
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
||||
if (! yyptr)
|
||||
goto yyexhaustedlab;
|
||||
YYSTACK_RELOCATE (yyss);
|
||||
YYSTACK_RELOCATE (yyvs);
|
||||
]b4_locations_if([ YYSTACK_RELOCATE (yyls);])[
|
||||
YYSTACK_RELOCATE (yyss_alloc, yyss);
|
||||
YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_locations_if([
|
||||
YYSTACK_RELOCATE (yyls_alloc, yyls);])[
|
||||
# undef YYSTACK_RELOCATE
|
||||
if (yyss1 != yyssa)
|
||||
YYSTACK_FREE (yyss1);
|
||||
@@ -1152,8 +1319,8 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
||||
#endif /* no yyoverflow */
|
||||
|
||||
yyssp = yyss + yysize - 1;
|
||||
yyvsp = yyvs + yysize - 1;
|
||||
]b4_locations_if([ yylsp = yyls + yysize - 1;])[
|
||||
yyvsp = yyvs + yysize - 1;]b4_locations_if([
|
||||
yylsp = yyls + yysize - 1;])[
|
||||
|
||||
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
||||
(unsigned long int) yystacksize));
|
||||
@@ -1186,9 +1353,28 @@ yybackup:
|
||||
|
||||
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
|
||||
if (yychar == YYEMPTY)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Reading a token: "));
|
||||
yychar = YYLEX;
|
||||
{]b4_push_if([[
|
||||
if (!yyps->yynew)
|
||||
{]b4_use_push_for_pull_if([], [[
|
||||
YYDPRINTF ((stderr, "Return for a new token:\n"));]])[
|
||||
yyresult = YYPUSH_MORE;
|
||||
goto yypushreturn;
|
||||
}
|
||||
yyps->yynew = 0;]b4_pure_if([], [[
|
||||
/* Restoring the pushed token is only necessary for the first
|
||||
yypush_parse invocation since subsequent invocations don't overwrite
|
||||
it before jumping to yyread_pushed_token. */
|
||||
yychar = yypushed_char;
|
||||
yylval = yypushed_val;]b4_locations_if([[
|
||||
yylloc = yypushed_loc;]])])[
|
||||
yyread_pushed_token:]])[
|
||||
YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[
|
||||
yychar = yypushed_char;
|
||||
if (yypushed_val)
|
||||
yylval = *yypushed_val;]b4_locations_if([[
|
||||
if (yypushed_loc)
|
||||
yylloc = *yypushed_loc;]])])], [[
|
||||
yychar = YYLEX;]])[
|
||||
}
|
||||
|
||||
if (yychar <= YYEOF)
|
||||
@@ -1275,8 +1461,8 @@ yyreduce:
|
||||
yylen = 0;
|
||||
YY_STACK_PRINT (yyss, yyssp);
|
||||
|
||||
*++yyvsp = yyval;
|
||||
]b4_locations_if([ *++yylsp = yyloc;])[
|
||||
*++yyvsp = yyval;]b4_locations_if([
|
||||
*++yylsp = yyloc;])[
|
||||
|
||||
/* Now `shift' the result of the reduction. Determine what state
|
||||
that goes to, based on the state we popped back to and the rule
|
||||
@@ -1446,7 +1632,7 @@ yyabortlab:
|
||||
yyresult = 1;
|
||||
goto yyreturn;
|
||||
|
||||
#ifndef yyoverflow
|
||||
#if !defined(yyoverflow) || YYERROR_VERBOSE
|
||||
/*-------------------------------------------------.
|
||||
| yyexhaustedlab -- memory exhaustion comes here. |
|
||||
`-------------------------------------------------*/
|
||||
@@ -1474,32 +1660,34 @@ yyreturn:
|
||||
if (yyss != yyssa)
|
||||
YYSTACK_FREE (yyss);
|
||||
#endif
|
||||
#if YYERROR_VERBOSE
|
||||
]b4_push_if([[ yyps->yynew = 1;
|
||||
|
||||
yypushreturn:
|
||||
]])[#if YYERROR_VERBOSE
|
||||
if (yymsg != yymsgbuf)
|
||||
YYSTACK_FREE (yymsg);
|
||||
#endif
|
||||
/* Make sure YYID is used. */
|
||||
return YYID (yyresult);
|
||||
]}
|
||||
}
|
||||
|
||||
|
||||
b4_epilogue
|
||||
]b4_epilogue
|
||||
b4_defines_if(
|
||||
[@output @output_header_name@
|
||||
[@output(b4_spec_defines_file@)
|
||||
b4_copyright([Skeleton interface for Bison's Yacc-like parsers in C],dnl '
|
||||
[1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006])
|
||||
|
||||
m4_ifdef([b4_start_header],
|
||||
[[/* Copy the %start-header blocks. */
|
||||
]b4_start_header])[]dnl
|
||||
b4_percent_code_get([[requires]])[]dnl
|
||||
|
||||
b4_token_enums_defines(b4_tokens)
|
||||
|
||||
[#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
]m4_ifdef([b4_stype],
|
||||
[[typedef union ]b4_union_name[
|
||||
{
|
||||
]b4_user_stype[
|
||||
YYSTYPE;
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[typedef int YYSTYPE;
|
||||
@@ -1508,8 +1696,7 @@ b4_token_enums_defines(b4_tokens)
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
]b4_pure_if([],
|
||||
[extern YYSTYPE b4_prefix[]lval;])
|
||||
]b4_pure_if([], [[extern YYSTYPE ]b4_prefix[lval;]])
|
||||
|
||||
b4_locations_if(
|
||||
[#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
@@ -1525,11 +1712,30 @@ typedef struct YYLTYPE
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
]b4_pure_if([],
|
||||
[extern YYLTYPE b4_prefix[]lloc;])
|
||||
]b4_pure_if([], [[extern YYLTYPE ]b4_prefix[lloc;]])
|
||||
)dnl b4_locations_if
|
||||
|
||||
m4_ifdef([b4_end_header],
|
||||
[[/* Copy the %end-header blocks. */
|
||||
]b4_end_header])[]dnl
|
||||
b4_push_if([[
|
||||
#ifndef YYPUSH_DECLS
|
||||
# define YYPUSH_DECLS
|
||||
struct ]b4_prefix[pstate;
|
||||
typedef struct ]b4_prefix[pstate ]b4_prefix[pstate;
|
||||
enum { YYPUSH_MORE = 4 };
|
||||
]b4_pull_if([b4_c_function_decl([b4_prefix[parse]], [[int]], b4_parse_param)
|
||||
])b4_c_function_decl([b4_prefix[push_parse]], [[int]],
|
||||
[[b4_prefix[pstate *yyps]], [[yyps]]]b4_pure_if([,
|
||||
[[[int yypushed_char]], [[yypushed_char]]],
|
||||
[[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
|
||||
[[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
|
||||
b4_parse_param]))
|
||||
b4_pull_if([b4_c_function_decl([b4_prefix[pull_parse]], [[int]],
|
||||
[[b4_prefix[pstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
|
||||
b4_parse_param]))])
|
||||
b4_c_function_decl([b4_prefix[pstate_new]], [b4_prefix[pstate *]],
|
||||
[[[void]], []])
|
||||
b4_c_function_decl([b4_prefix[pstate_delete]], [[void]],
|
||||
[[b4_prefix[pstate *yyps]], [[yyps]]])[
|
||||
#endif
|
||||
]])
|
||||
b4_percent_code_get([[provides]])[]dnl
|
||||
])dnl b4_defines_if
|
||||
m4_divert_pop(0)
|
||||
|
||||
+13
-14
@@ -1,21 +1,20 @@
|
||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||
# Requires GNU sed
|
||||
|
||||
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2, or (at your option)
|
||||
## any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software Foundation,
|
||||
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# 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/>.
|
||||
|
||||
top_srcdir = ..
|
||||
srcdir = .
|
||||
|
||||
+19
-18
@@ -1,11 +1,11 @@
|
||||
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (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
|
||||
@@ -13,8 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
1.: DJGPP specific changes.
|
||||
@@ -46,8 +45,13 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
This is done by forking and using pipes for the IPC. MSDOS does not
|
||||
support this functionality so this has been reproduced in the usual
|
||||
way by redirecting stdin and stdout of bison and m4 to temporary files
|
||||
and processing these files in sequence. All the changes to the sources
|
||||
are documented in the djgpp/diffs file.
|
||||
and processing these files in sequence.
|
||||
It should be noticed that due to the great amount of file names that do
|
||||
not cleanly map to 8.3 file names, you will need an OS with LFN support
|
||||
to configure and compile the sources. On Win98 this implies that the
|
||||
generation of numeric tails for 8.3 file name aliases must be enabled
|
||||
or the compilation will fail.
|
||||
|
||||
|
||||
Please **read** the docs.
|
||||
|
||||
@@ -113,22 +117,19 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
3.3.: To build the binaries you will need the following binary packages:
|
||||
djdev203.zip (or a later but NOT a prior version)
|
||||
bsh204b.zip (or a later but NOT a prior version)
|
||||
gcc410b.zip, gpp410b.zip, bnu2161b.zip, mak3791b.zip,
|
||||
fil40b.zip, shl20jb.zip, txt20b.zip,
|
||||
txi48b.zip, grep24b.zip, sed415b.zip,
|
||||
m4-144b.zip.
|
||||
gccNNNb.zip, gppNNN.zip, bnuNNNb.zip, makNNNb.zip, filNNNb.zip,
|
||||
perlNNNb.zip, shlNNNb.zip, txtNNNb.zip, txiNNNb.zip, grepNNNb.zip,
|
||||
sedNNNb.zip and m4NNN.zip
|
||||
|
||||
If you want to run the check you will need also:
|
||||
dif287b.zip
|
||||
difNNNb.zip
|
||||
|
||||
All this packages can be found in the v2gnu directory of any
|
||||
NNN represents the latest version number of the binary packages. All
|
||||
this packages can be found in the /v2gnu directory of any
|
||||
ftp.delorie.com mirror.
|
||||
You will need bsh204b.zip or later and *NOT* a prior version or
|
||||
the build will fail. The same applies to djdev203.zip. Please note
|
||||
that Bison requires m4-144b.zip or later to work properly. All the
|
||||
other packages are the ones I have used to build the binaries
|
||||
from this source. Previuos versions of this packages may do the
|
||||
job as well but I have not tested this.
|
||||
that Bison requires m4-144b.zip or later to work properly.
|
||||
|
||||
3.4.: If for some reason you want to reconfigure the package cd into the top
|
||||
srcdir (bison-@TREE_VERSION@) and run the following commands:
|
||||
|
||||
+101
-34
@@ -4,21 +4,20 @@ Rem Configure Bison for DJGPP.
|
||||
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||
|
||||
Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
Rem This program is free software; you can redistribute it and/or modify
|
||||
Rem This program is free software: you can redistribute it and/or modify
|
||||
Rem it under the terms of the GNU General Public License as published by
|
||||
Rem the Free Software Foundation; either version 2, or (at your option)
|
||||
Rem any later version.
|
||||
|
||||
Rem the Free Software Foundation, either version 3 of the License, or
|
||||
Rem (at your option) any later version.
|
||||
Rem
|
||||
Rem This program is distributed in the hope that it will be useful,
|
||||
Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
Rem GNU General Public License for more details.
|
||||
|
||||
Rem
|
||||
Rem You should have received a copy of the GNU General Public License
|
||||
Rem along with this program; if not, write to the Free Software Foundation,
|
||||
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
Rem along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
echo Configuring Bison for DJGPP v2.x...
|
||||
|
||||
@@ -143,17 +142,17 @@ shift
|
||||
if not "%1" == "" goto ArgLoop
|
||||
|
||||
Rem Create an arguments file for the configure script.
|
||||
echo --srcdir=%XSRC% > arguments
|
||||
if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> arguments
|
||||
if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> arguments
|
||||
if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments
|
||||
if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> arguments
|
||||
if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> arguments
|
||||
if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> arguments
|
||||
if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> arguments
|
||||
if "%HTML%" == "enabled" echo --enable-html >> arguments
|
||||
if "%HTML%" == "disabled" echo --disable-html >> arguments
|
||||
if not "%ARGS%" == "" echo %ARGS% >> arguments
|
||||
echo --srcdir=%XSRC% > args
|
||||
if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> args
|
||||
if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> args
|
||||
if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> args
|
||||
if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> args
|
||||
if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> args
|
||||
if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> args
|
||||
if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> args
|
||||
if "%HTML%" == "enabled" echo --enable-html >> args
|
||||
if "%HTML%" == "disabled" echo --disable-html >> args
|
||||
if not "%ARGS%" == "" echo %ARGS% >> args
|
||||
set ARGS=
|
||||
set CACHING=
|
||||
set DEPENDENCY_TRACKING=
|
||||
@@ -164,22 +163,26 @@ set HTML=
|
||||
if "%XSRC%" == "." goto InPlace
|
||||
|
||||
:NotInPlace
|
||||
redir -e /dev/null update %XSRC%/configure.orig ./configure
|
||||
redir -e /dev/null update %XSRC%/configure.org ./configure
|
||||
test -f ./configure
|
||||
if errorlevel 1 update %XSRC%/configure ./configure
|
||||
|
||||
:InPlace
|
||||
Rem Update configuration files
|
||||
echo Updating configuration scripts...
|
||||
test -f ./configure.orig
|
||||
if errorlevel 1 update configure configure.orig
|
||||
sed -f %XSRC%/djgpp/config.sed configure.orig > configure
|
||||
test -f ./configure.org
|
||||
if errorlevel 1 update configure configure.org
|
||||
sed -f %XSRC%/djgpp/config.sed configure.org > configure
|
||||
if errorlevel 1 goto SedError
|
||||
|
||||
Rem Make sure they have a config.site file
|
||||
set CONFIG_SITE=%XSRC%/djgpp/config.site
|
||||
if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
|
||||
|
||||
Rem inttypes_.h and inttypes.h map to the same 8.3 alias.
|
||||
test -f %XSRC%/lib/inttypes_.h
|
||||
if not errorlevel 1 mv -f %XSRC%/lib/inttypes_.h %XSRC%/lib/_inttypes.h
|
||||
|
||||
Rem Make sure crucial file names are not munged by unpacking
|
||||
test -f %XSRC%/po/Makefile.in.in
|
||||
if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in
|
||||
@@ -205,6 +208,51 @@ test -f %XSRC%/data/c++.m4
|
||||
if not errorlevel 1 mv -f %XSRC%/data/c++.m4 %XSRC%/data/cxx.m4
|
||||
test -f %XSRC%/data/cxx.m4
|
||||
if errorlevel 1 mv -f %XSRC%/data/cpp.m4 %XSRC%/data/cxx.m4
|
||||
test -f %XSRC%/data/c++-skel.m4
|
||||
if not errorlevel 1 mv -f %XSRC%/data/c++-skel.m4 %XSRC%/data/cxx-skel.m4
|
||||
test -f %XSRC%/data/cxx-skel.m4
|
||||
if errorlevel 1 mv -f %XSRC%/data/cpp-skel.m4 %XSRC%/data/cxx-skel.m4
|
||||
test -f %XSRC%/build-aux/javacomp.sh.in
|
||||
if not errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh.in %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javacomp.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javacomp.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.shin %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javacomp.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh_in %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javacomp.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh.in %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh.in
|
||||
if not errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh.in %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.shin %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh_in %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javaexec_sh.in %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/doc/yacc.1.in
|
||||
if not errorlevel 1 mv -f %XSRC%/doc/yacc.1.in %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/doc/yacc.1-in
|
||||
if errorlevel 1 mv -f %XSRC%/doc/yacc.1 %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/doc/yacc.1-in
|
||||
if errorlevel 1 mv -f %XSRC%/doc/yacc.1in %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/doc/yacc.1-in
|
||||
if errorlevel 1 mv -f %XSRC%/doc/yacc.1_in %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/doc/yacc.1-in
|
||||
if errorlevel 1 mv -f %XSRC%/doc/yacc_1.in %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/etc/bench.pl.in
|
||||
if not errorlevel 1 mv -f %XSRC%/etc/bench.pl.in %XSRC%/etc/bench.pl-in
|
||||
test -f %XSRC%/etc/bench.pl-in
|
||||
if errorlevel 1 mv -f %XSRC%/etc/bench.pl %XSRC%/etc/bench.pl-in
|
||||
test -f %XSRC%/etc/bench.pl-in
|
||||
if errorlevel 1 mv -f %XSRC%/etc/bench.plin %XSRC%/etc/bench.pl-in
|
||||
test -f %XSRC%/etc/bench.pl-in
|
||||
if errorlevel 1 mv -f %XSRC%/etc/bench.pl_in %XSRC%/etc/bench.pl-in
|
||||
test -f %XSRC%/etc/bench.pl-in
|
||||
if errorlevel 1 mv -f %XSRC%/etc/bench_pl.in %XSRC%/etc/bench.pl-in
|
||||
|
||||
:scan_gram_c_Test
|
||||
test -f %XSRC%/src/c-scan-gram.c
|
||||
if not errorlevel 1 goto scan_skel_c_Test
|
||||
@@ -222,25 +270,36 @@ sed "s/c++\.m4/cxx.m4/" %XSRC%/data/lalr1.cc > lalr1.cc
|
||||
if errorlevel 1 goto lalr1_ccFileError
|
||||
mv ./lalr1.cc %XSRC%/data/lalr1.cc
|
||||
sed "s/c++\.m4/cxx.m4/" %XSRC%/data/location.cc > location.cc
|
||||
if errorlevel 1 goto location.ccFileError
|
||||
if errorlevel 1 goto location_ccFileError
|
||||
mv ./location.cc %XSRC%/data/location.cc
|
||||
sed "s/c++\.m4/cxx.m4/" %XSRC%/data/glr.cc > glr.cc
|
||||
if errorlevel 1 goto glr.ccFileError
|
||||
if errorlevel 1 goto glr_ccFileError
|
||||
mv ./glr.cc %XSRC%/data/glr.cc
|
||||
|
||||
Rem Fix src/getargs.c to reflect the renaming of c++-skel.m4
|
||||
sed "s/c++-skel\.m4/cxx-skel.m4/" %XSRC%/src/getargs.c > getargs.c
|
||||
if errorlevel 1 goto getargs_cFileError
|
||||
mv ./getargs.c %XSRC%/src/getargs.c
|
||||
|
||||
Rem Define DJGPP specific defs in config.hin
|
||||
echo Editing config.hin...
|
||||
test -f %XSRC%/config_h.orig
|
||||
if errorlevel 1 update %XSRC%/config.hin %XSRC%/config_h.orig
|
||||
sed -f %XSRC%/djgpp/config_h.sed %XSRC%/config_h.orig > config.hin
|
||||
test -f %XSRC%/lib/config_h.org
|
||||
if errorlevel 1 update %XSRC%/lib/config.hin %XSRC%/lib/config_h.org
|
||||
sed -f %XSRC%/djgpp/config_h.sed %XSRC%/lib/config_h.org > config.hin
|
||||
if errorlevel 1 goto SedError2
|
||||
mv -f config.hin %XSRC%/config.hin
|
||||
mv -f config.hin %XSRC%/lib/config.hin
|
||||
|
||||
|
||||
Rem Fixing ilicit testsuite file name.
|
||||
test -f %XSRC%/tests/c++.at
|
||||
if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at
|
||||
|
||||
test -f %XSRC%/tests/testsuite.org
|
||||
if errorlevel 1 update %XSRC%/tests/testsuite %XSRC%/tests/testsuite.org
|
||||
sed -f %XSRC%/djgpp/testsuite.sed %XSRC%/tests/testsuite.org > testsuite.tmp
|
||||
if errorlevel 1 goto SedError3
|
||||
mv -f ./testsuite.tmp %XSRC%/tests/testsuite
|
||||
|
||||
Rem Fixing ilicit calc++ file names in the calc++ directory.
|
||||
test -d %XSRC%/examples/calc++
|
||||
if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx
|
||||
@@ -413,20 +472,20 @@ redir -e /dev/null rm %XSRC%/po/stamp-cat-id
|
||||
Rem Update the arguments file for the configure script.
|
||||
Rem We prefer without-included-gettext because libintl.a from gettext package
|
||||
Rem is the only one that is garanteed to have been ported to DJGPP.
|
||||
echo --enable-nls --without-included-gettext >> arguments
|
||||
echo --enable-nls --without-included-gettext >> args
|
||||
goto ConfigurePackage
|
||||
|
||||
:MissingNLSTools
|
||||
echo Needed libs/tools for NLS not found. Configuring without NLS.
|
||||
:WithoutNLS
|
||||
Rem Update the arguments file for the configure script.
|
||||
echo --disable-nls >> arguments
|
||||
echo --disable-nls >> args
|
||||
|
||||
:ConfigurePackage
|
||||
echo Running the ./configure script...
|
||||
sh ./configure @arguments
|
||||
sh ./configure @args
|
||||
if errorlevel 1 goto CfgError
|
||||
rm arguments
|
||||
rm args
|
||||
echo Done.
|
||||
goto End
|
||||
|
||||
@@ -438,6 +497,10 @@ goto End
|
||||
echo ./data/glr.cc file editing failed!
|
||||
goto End
|
||||
|
||||
:getargs_cFileError
|
||||
echo ./src/getargs.c file editing failed!
|
||||
goto End
|
||||
|
||||
:location_ccFileError
|
||||
echo ./data/location.cc file editing failed!
|
||||
goto End
|
||||
@@ -455,7 +518,11 @@ echo ./configure script editing failed!
|
||||
goto End
|
||||
|
||||
:SedError2
|
||||
echo ./config.hin editing failed!
|
||||
echo ./lib/config.hin editing failed!
|
||||
goto End
|
||||
|
||||
:SedError3
|
||||
echo ./tests/testsuite editing failed!
|
||||
goto End
|
||||
|
||||
:CfgError
|
||||
|
||||
+102
-75
@@ -1,77 +1,97 @@
|
||||
# DJGPP specific configuration file.
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the configure script generated by autoconf 2.57.
|
||||
# of the configure script generated by autoconf 2.62.
|
||||
|
||||
|
||||
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# Additional editing of Makefiles
|
||||
/(echo[ ]*':t/ a\
|
||||
/^eval sed.*ac_file_inputs.*tmp\/out \\$/ {
|
||||
:loop
|
||||
n
|
||||
/^$/!b loop
|
||||
a\
|
||||
cat > "$tmp/subs-djgpp.sed" << eof_djgpp\
|
||||
# DJGPP specific Makefile changes.\
|
||||
/^aliaspath * *=/s,:,";",g;t t\
|
||||
/TEXINPUTS=/s,:,";",g;t t\
|
||||
/PATH=/s,:,";",g;t t\
|
||||
s,\\.deps,_deps,g;t t\
|
||||
s,\\.new\\.,_new.,g;t t\
|
||||
s,\\.old\\.,_old.,g;t t\
|
||||
s,c++\\.at,cxx.at,g;t t\
|
||||
s,c++\\.m4,cxx.m4,g;t t\
|
||||
s,calc++,calcxx,g;t t\
|
||||
s,scan-gram-c,c-scan-gram,g;t t\
|
||||
s,scan-skel-c,c-scan-skel,g;t t\
|
||||
s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
|
||||
s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
|
||||
s,(MAKEINFOFLAGS),& --no-split,\
|
||||
/^install-info-am:/,/^$/ {\
|
||||
/@list=/ s,\\\$(INFO_DEPS),& bison.i,\
|
||||
/@for *file/ s,\\\$(INFO_DEPS),& bison.i,\
|
||||
s,file-\\[0-9\\]\\[0-9\\],& \\$\\$file[0-9] \\$\\$file[0-9][0-9],\
|
||||
}\
|
||||
/^\\.y\\.c:/,/^$/ {\
|
||||
/\\\$(YACCCOMPILE)/ {\
|
||||
a\\\
|
||||
-@test -f y.tab.c && mv -f y.tab.c y_tab.c\\\
|
||||
s,\\.deps,_deps,g\
|
||||
s,\\.libs,_libs,g\
|
||||
s,\\.new\\.,_new.,g\
|
||||
s,\\.old\\.,_old.,g\
|
||||
s,\\.tab\\.,_tab.,g\
|
||||
s,c++\\.at,cxx.at,g\
|
||||
s,c++\\.m4,cxx.m4,g\
|
||||
s,c++-skel\\.m4,cxx-skel.m4,g\
|
||||
s,calc++,calcxx,g\
|
||||
s,scan-gram-c,c-scan-gram,g\
|
||||
s,scan-skel-c,c-scan-skel,g\
|
||||
s,inttypes_,_inttypes,g\
|
||||
s,javacomp\\.sh\\.in,javacomp.sh-in,g\
|
||||
s,javaexec\\.sh\\.in,javaexec.sh-in,g\
|
||||
s,yacc\\.1\\.in,yacc.1-in,g\
|
||||
s,bench\\.pl\\.in,bench.pl-in,g\
|
||||
s,Makefile\\.am\\.in,Makefile.am-in,g\
|
||||
s,Makefile\\.in\\.in,Makefile.in-in,g\
|
||||
/^\\.y\\.c:/,/^$/ {\
|
||||
/\\\$(YACCCOMPILE)/ {\
|
||||
a\\\\\
|
||||
-@test -f y.tab.c && mv -f y.tab.c y_tab.c\\\\\
|
||||
-@test -f y.tab.h && mv -f y.tab.h y_tab.h\
|
||||
}\
|
||||
}\
|
||||
/^libbison.a:/ i\\\
|
||||
\\$(top_srcdir)/djgpp/subpipe.c: \\$(top_srcdir)/djgpp/subpipe.h\\\
|
||||
subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\
|
||||
}\
|
||||
/^libbison.a:/ i\\\\\
|
||||
\\$(top_srcdir)/djgpp/subpipe.c: \\$(top_srcdir)/djgpp/subpipe.h\\\\\
|
||||
subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\\\
|
||||
\\$(COMPILE) -c \\$<\
|
||||
/^yacc:/ i\\\
|
||||
yacc.bat:\\\
|
||||
/^yacc:/ i\\\\\
|
||||
yacc.bat:\\\\\
|
||||
echo "bison\\$(EXEEXT) -y %1 %2 %3 %4 %5 %6 %7 %8 %9" >\\$@\
|
||||
/^bin_SCRIPTS =/s/$/ yacc.bat/\
|
||||
/^MOSTLYCLEANFILES = yacc/s/$/ yacc.bat/
|
||||
|
||||
/^MOSTLYCLEANFILES = yacc/s/$/ yacc.bat/\
|
||||
/cross-options.texi:/,/^$/ s|bison|&.exe|g\
|
||||
/^\\.x\\.1:/,/^$/ s|\\$program|&.exe|g\
|
||||
eof_djgpp\
|
||||
sed -f "\$tmp/subs-djgpp.sed" \$tmp/out > \$tmp/out.djgpp\
|
||||
mv -f \$tmp/out.djgpp \$tmp/out
|
||||
}
|
||||
|
||||
# Makefile.in.in is renamed to Makefile.in-in.
|
||||
/ac_config_files=/,/_ACEOF/ {
|
||||
s|po/Makefile\.in|&:po/Makefile.in-in|
|
||||
/ac_config_files=/ {
|
||||
/runtime-po/!s|po/Makefile\.in|&:po/Makefile.in-in|
|
||||
s|runtime-po/Makefile\.in|&:runtime-po/Makefile.in-in|
|
||||
s|javacomp\.sh\.in|javacomp.sh-in|
|
||||
s|javaexec\.sh\.in|javaexec.sh-in|
|
||||
s|doc/yacc\.1|&:doc/yacc.1-in|
|
||||
s|etc/bench.pl|&:etc/bench.pl-in|
|
||||
}
|
||||
|
||||
/CONFIG_FILES=/ {
|
||||
/runtime-po/!s|po/Makefile\.in|&:po/Makefile.in-in|2
|
||||
s|runtime-po/Makefile\.in|&:runtime-po/Makefile.in-in|2
|
||||
s|javacomp\.sh\.in|javacomp.sh-in|
|
||||
s|javaexec\.sh\.in|javaexec.sh-in|
|
||||
s|doc/yacc\.1|&:doc/yacc.1-in|2
|
||||
s|etc/bench\.pl|&:etc/bench.pl-in|2
|
||||
}
|
||||
/CONFIG_FILES=/ s|po/Makefile\.in|&:po/Makefile.in-in|2
|
||||
|
||||
# We always use _deps and _libs instead of .deps and .libs, because
|
||||
# the latter is an invalid name on 8+3 MS-DOS file system. This makes
|
||||
# the generated Makefiles good for every DJGPP installation, not only
|
||||
# the one where the package was configured (which could happen to be
|
||||
# a Windows box, where leading dots in file names are allowed).
|
||||
s,\.deps,_deps,g
|
||||
s,\.libs,_libs,g
|
||||
/^rmdir[ ]*\.tst/ i\
|
||||
am__leading_dot=_
|
||||
|
||||
@@ -91,18 +111,6 @@ am__leading_dot=_
|
||||
# DOS-style absolute file names should be supported as well
|
||||
/\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*,
|
||||
|
||||
# Prevent the spliting of subs.sed.
|
||||
# The sed script: subs.sed is split into 48 lines long files.
|
||||
# This will produce sed scripts called subs-$ac_sed_frag.sed, where
|
||||
# $ac_sed_frag is some unique number. This will not work if the splited
|
||||
# sed script contains a multiple line sed command at line #48. In this
|
||||
# case the first part of the multiple line sed command will be written
|
||||
# at the end of one particular subs-$ac_sed_frag.sed and the rest of the
|
||||
# sed command will be written at the begining of the next subs-$ac_sed_frag.sed
|
||||
# making both sed script useless.
|
||||
# This matches the configure script produced by Autoconf 2.57
|
||||
/ac_max_sed_lines=[0-9]/ s,=.*$,=`sed -n "$=" $tmp/subs.sed`,
|
||||
|
||||
# The following two items are changes needed for configuring
|
||||
# and compiling across partitions.
|
||||
# 1) The given srcdir value is always translated from the
|
||||
@@ -120,32 +128,30 @@ am__leading_dot=_
|
||||
# which the package has not been configured for.
|
||||
/MISSING=/,/^$/ {
|
||||
/^fi$/ a\
|
||||
am_missing_run=`echo "$am_missing_run" | sed 's%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%'`
|
||||
am_missing_run=`echo "$am_missing_run" | sed 's%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%'`
|
||||
}
|
||||
/^install_sh=/a\
|
||||
install_sh=`echo "$install_sh" | sed 's%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%'`
|
||||
install_sh=`echo "$install_sh" | sed 's%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%'`
|
||||
|
||||
# This will only work if the assumption that the
|
||||
# testsuite is ran from the following path:
|
||||
# ${top_srcdir}/tests/testsuite.dir
|
||||
# holds. The explicit names are of no importance.
|
||||
# ../../. == ${top_srcdir}
|
||||
/\.)[ ]*ac_abs_builddir=/,/^esac$/ {
|
||||
/^esac$/ a\
|
||||
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
|
||||
}
|
||||
/\.)[ ]*ac_abs_top_builddir=/,/^esac$/ {
|
||||
/^esac$/ a\
|
||||
ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
|
||||
}
|
||||
/\.)[ ]*ac_abs_srcdir=/,/^esac$/ {
|
||||
/^esac$/ a\
|
||||
ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
|
||||
}
|
||||
/\.)[ ]*ac_abs_top_srcdir=/,/^esac$/ {
|
||||
/^esac$/ a\
|
||||
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
|
||||
}
|
||||
#/^esac$/,/^ac_abs_srcdir=/ {
|
||||
/^ac_abs_srcdir=/ i\
|
||||
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"`\
|
||||
ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"`\
|
||||
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"`
|
||||
#ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"`
|
||||
/^ac_abs_srcdir=/ a\
|
||||
for dj_dir in $ac_abs_builddir $ac_abs_top_builddir $ac_abs_top_srcdir $ac_abs_srcdir\
|
||||
do\
|
||||
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%//%/%g"`\
|
||||
ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%//%/%g"`\
|
||||
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%//%/%g"`\
|
||||
ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%//%/%g"`\
|
||||
done
|
||||
|
||||
# Add DJGPP version information.
|
||||
/^#define VERSION/ s/\$VERSION/& (DJGPP port (r1))/
|
||||
@@ -160,5 +166,26 @@ ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\
|
||||
ac_djgpp_path=`echo "$DJDIR" | sed 's%\\\\\\%/%g' | tr $as_cr_LETTERS $as_cr_letters`\
|
||||
ac_cv_flibs=`echo "$ac_cv_flibs" | sed "s%-L$ac_djgpp_path%-L/dev/env/DJDIR%g"`
|
||||
|
||||
# Autoconf generated configure scripts write absolute
|
||||
# paths of certain header files into Makefiles making
|
||||
# them useless for DJGPP installations for which the
|
||||
# package has not been configured for.
|
||||
/^.*echo "\$as_me:\$LINENO: result: \$gl_cv_absolute_.*$/ {
|
||||
h
|
||||
s,^.*\(gl_cv_absolute_\)\([a-z0-9_]*\)\(_h\).*$,\1\2\3=`echo $\1\2\3 | sed "s%[^:]:.*/include/%/dev/env/DJDIR/include/%"`,
|
||||
G
|
||||
}
|
||||
/^.*echo "\$as_me:\$LINENO: result: \$gl_cv_full_.*$/ {
|
||||
h
|
||||
s,^.*\(gl_cv_full_\)\([a-z0-9_]*\)\(_h\).*$,\1\2\3=`echo $\1\2\3 | sed "s%[^:]:.*/include/%/dev/env/DJDIR/include/%"`,
|
||||
G
|
||||
}
|
||||
|
||||
# The following is not a valid DOS file name
|
||||
s/calc++/calcxx/g
|
||||
|
||||
# The CR test for awk does not work for DJGPP.
|
||||
/^ac_cs_awk_cr=/,/^$/ {
|
||||
/^fi$/ a\
|
||||
ac_cs_awk_cr=$ac_cr
|
||||
}
|
||||
|
||||
+10
-8
@@ -3,21 +3,20 @@
|
||||
# This is the config.site file for configuring GNU packages
|
||||
# which are to be built with DJGPP tools.
|
||||
|
||||
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (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
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# Include the djgpp subdirectory in PATH, so that getconf is found
|
||||
@@ -68,6 +67,9 @@ ac_cv_path_FGREP=${FGREP='/dev/env/DJDIR/bin/fgrep'}
|
||||
# A sane default for sed.
|
||||
ac_cv_path_SED=${SED='/dev/env/DJDIR/bin/sed'}
|
||||
|
||||
# A sane default for mkdir.
|
||||
ac_cv_path_mkdir=${MKDIR_P='/dev/env/DJDIR/bin/mkdir -p'}
|
||||
|
||||
# These are set here so the generated libtool will be good
|
||||
# for every DJGPP installation, not only the one where the
|
||||
# package was configured.
|
||||
|
||||
+7
-8
@@ -1,20 +1,19 @@
|
||||
# sed script for DJGPP specific editing of config.hin
|
||||
|
||||
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (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
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
$ a\
|
||||
|
||||
+5
-6
@@ -7,12 +7,12 @@ Rem This batch file unpacks the Bison distribution while simultaneously
|
||||
Rem renaming some of the files whose names are invalid on DOS or conflict
|
||||
Rem with other file names after truncation to DOS 8+3 namespace.
|
||||
Rem
|
||||
Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
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 the Free Software Foundation; either version 2, or (at your option)
|
||||
Rem any later version.
|
||||
Rem the Free Software Foundation, either version 3 of the License, or
|
||||
Rem (at your option) any later version.
|
||||
Rem
|
||||
Rem This program is distributed in the hope that it will be useful,
|
||||
Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -20,8 +20,7 @@ Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
Rem GNU General Public License for more details.
|
||||
Rem
|
||||
Rem You should have received a copy of the GNU General Public License
|
||||
Rem along with this program; if not, write to the Free Software Foundation,
|
||||
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
Rem along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
Rem
|
||||
Rem
|
||||
Rem Invoke like this:
|
||||
|
||||
+27
-2
@@ -1,2 +1,27 @@
|
||||
@V@/src/scan-gram-c.c @V@/src/c-scan-gram.c
|
||||
@V@/src/scan-skel-c.c @V@/src/c-scan-skel.c
|
||||
@V@/build-aux/javacomp.sh.in @V@/build-aux/javacomp.sh-in
|
||||
@V@/build-aux/javaexec.sh.in @V@/build-aux/javaexec.sh-in
|
||||
@V@/data/c++-skel.m4 @V@/data/cxx-skel.m4
|
||||
@V@/data/c++.m4 @V@/data/cxx.m4
|
||||
@V@/doc/yacc.1.in @V@/doc/yacc.1-in
|
||||
@V@/etc/bench.pl.in @V@/etc/bench.pl-in
|
||||
@V@/examples/calc++/ @V@/examples/calcxx/
|
||||
@V@/examples/calc++/Makefile.am @V@/examples/calcxx/Makefile.am
|
||||
@V@/examples/calc++/Makefile.in @V@/examples/calcxx/Makefile.in
|
||||
@V@/examples/calc++/calc++-scanner.cc @V@/examples/calcxx/calcxx-scanner.cc
|
||||
@V@/examples/calc++/calc++-scanner.ll @V@/examples/calcxx/calcxx-scanner.ll
|
||||
@V@/examples/calc++/calc++.cc @V@/examples/calcxx/calcxx.cc
|
||||
@V@/examples/calc++/calc++-driver.hh @V@/examples/calcxx/calcxx-driver.hh
|
||||
@V@/examples/calc++/calc++-driver.cc @V@/examples/calcxx/calcxx-driver.cc
|
||||
@V@/examples/calc++/stack.hh @V@/examples/calcxx/stack.hh
|
||||
@V@/examples/calc++/position.hh @V@/examples/calcxx/position.hh
|
||||
@V@/examples/calc++/location.hh @V@/examples/calcxx/location.hh
|
||||
@V@/examples/calc++/calc++-parser.hh @V@/examples/calcxx/calcxx-parser.hh
|
||||
@V@/examples/calc++/calc++-parser.cc @V@/examples/calcxx/calcxx-parser.cc
|
||||
@V@/examples/calc++/calc++-parser.stamp @V@/examples/calcxx/calcxx-parser.stamp
|
||||
@V@/examples/calc++/calc++-parser.yy @V@/examples/calcxx/calcxx-parser.yy
|
||||
@V@/examples/calc++/test @V@/examples/calcxx/test
|
||||
@V@/po/Makefile.in.in @V@/po/Makefile.in-in
|
||||
@V@/runtime-po/Makefile.in.in @V@/runtime-po/Makefile.in-in
|
||||
@V@/src/scan-gram-c.c @V@/src/c-scan-gram.c
|
||||
@V@/src/scan-skel-c.c @V@/src/c-scan-skel.c
|
||||
@V@/tests/c++.at @V@/tests/cxx.at
|
||||
|
||||
+19
-11
@@ -1,11 +1,11 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (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
|
||||
@@ -13,15 +13,12 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Juan Manuel Guerrero <[email protected]>. */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "subpipe.h"
|
||||
|
||||
@@ -70,15 +67,26 @@ static char tmp_file_name[2][L_tmpnam];
|
||||
void
|
||||
init_subpipe(void)
|
||||
{
|
||||
char *tmpdir;
|
||||
int fd;
|
||||
|
||||
strcpy(tmp_file_name[0], "/dev/env/TMPDIR/bnXXXXXX");
|
||||
tmpdir = getenv("TMPDIR");
|
||||
if (tmpdir == NULL)
|
||||
tmpdir = getenv("TMP");
|
||||
if (tmpdir == NULL)
|
||||
tmpdir = getenv("TEMP");
|
||||
if (access(tmpdir, D_OK))
|
||||
tmpdir = ".";
|
||||
|
||||
strcpy(tmp_file_name[0], tmpdir);
|
||||
strcat(tmp_file_name[0], "/bnXXXXXX");
|
||||
fd = mkstemp(tmp_file_name[0]);
|
||||
if (fd < 0)
|
||||
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
||||
close (fd);
|
||||
|
||||
strcpy(tmp_file_name[1], "/dev/env/TMPDIR/bnXXXXXX");
|
||||
strcpy(tmp_file_name[1], tmpdir);
|
||||
strcat(tmp_file_name[1], "/bnXXXXXX");
|
||||
fd = mkstemp(tmp_file_name[1]);
|
||||
if (fd < 0)
|
||||
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
||||
|
||||
+4
-5
@@ -1,9 +1,9 @@
|
||||
/* Subprocesses with pipes.
|
||||
Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -12,8 +12,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Juan Manuel Guerrero <[email protected]>. */
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# DJGPP specific configuration file.
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the testsuite script generated by autoconf 2.61.
|
||||
|
||||
|
||||
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# Remove disallowed characters from file names.
|
||||
|
||||
s/~!@#\\\$%^&\*()-=_+{}\[\]|\\\\:;<>, ./~!@#\\$%^\&()-=_+{}[];, ./g
|
||||
+3
-1
@@ -13,10 +13,12 @@ bison.ps
|
||||
bison.toc
|
||||
bison.tp
|
||||
bison.vr
|
||||
cross-options.texi
|
||||
Makefile.in
|
||||
refcard.dvi
|
||||
refcard.log
|
||||
refcard.ps
|
||||
Makefile.in
|
||||
*.info*
|
||||
stamp-vti
|
||||
version.texi
|
||||
yacc.1
|
||||
|
||||
+83
-20
@@ -1,39 +1,102 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
# 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.texinfo
|
||||
man_MANS = bison.1
|
||||
bison_TEXINFOS = gpl.texi fdl.texi
|
||||
bison_TEXINFOS = $(srcdir)/cross-options.texi gpl-3.0.texi fdl.texi
|
||||
|
||||
EXTRA_DIST = bison.1 refcard.tex
|
||||
|
||||
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
|
||||
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)
|
||||
-rm -f $@ $@.tmp
|
||||
cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||
$(top_builddir)/src/bison --help | perl $(CROSS_OPTIONS_PL) >$@.tmp
|
||||
mv $@.tmp $@
|
||||
MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
|
||||
|
||||
## ---------- ##
|
||||
## Ref card. ##
|
||||
## ---------- ##
|
||||
|
||||
EXTRA_DIST = refcard.tex
|
||||
CLEANFILES += refcard.dvi refcard.log refcard.ps
|
||||
|
||||
refcard.dvi: refcard.tex
|
||||
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.ac to get version number changes.
|
||||
common_dep = $(top_srcdir)/configure.ac $(srcdir)/common.x
|
||||
srcsrcdir = $(top_srcdir)/bin
|
||||
$(srcdir)/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
|
||||
|
||||
# Output from --help and --version that must not appear in the man page.
|
||||
neutralize = \
|
||||
perl -0777 -pi -e 's/\.PP\nId:.*\n//g'
|
||||
|
||||
# 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:
|
||||
@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
|
||||
@echo "Updating man page $@"
|
||||
PATH="$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \
|
||||
export PATH; \
|
||||
$(HELP2MAN) \
|
||||
--include=$*.x \
|
||||
--include=$(srcdir)/common.x \
|
||||
--output=$@.t `echo '$*' | sed 's,.*/,,'`
|
||||
$(neutralize) $@.t
|
||||
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 = yacc.1
|
||||
|
||||
## -------------- ##
|
||||
## Doxygenation. ##
|
||||
|
||||
+138
-310
@@ -1,69 +1,10 @@
|
||||
.TH BISON 1 local
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
|
||||
.TH BISON "1" "May 2008" "bison 2.3b" "User Commands"
|
||||
.SH NAME
|
||||
bison \- GNU Project parser generator (yacc replacement)
|
||||
.SH SYNOPSIS
|
||||
.B bison
|
||||
[
|
||||
.BI \-b " file-prefix"
|
||||
] [
|
||||
.BI \-\-file-prefix= file-prefix
|
||||
] [
|
||||
.B \-d
|
||||
] [
|
||||
.BI \-\-defines= defines-file
|
||||
] [
|
||||
.B \-g
|
||||
] [
|
||||
.BI \-\-graph= graph-file
|
||||
] [
|
||||
.B \-k
|
||||
] [
|
||||
.B \-\-token-table
|
||||
] [
|
||||
.B \-l
|
||||
] [
|
||||
.B \-\-no-lines
|
||||
] [
|
||||
.B \-n
|
||||
] [
|
||||
.B \-\-no-parser
|
||||
] [
|
||||
.BI \-o " outfile"
|
||||
] [
|
||||
.BI \-\-output-file= outfile
|
||||
] [
|
||||
.BI \-p " prefix"
|
||||
] [
|
||||
.BI \-\-name-prefix= prefix
|
||||
] [
|
||||
.B \-t
|
||||
] [
|
||||
.B \-\-debug
|
||||
] [
|
||||
.B \-v
|
||||
] [
|
||||
.B \-\-verbose
|
||||
] [
|
||||
.B \-V
|
||||
] [
|
||||
.B \-\-version
|
||||
] [
|
||||
.B \-y
|
||||
] [
|
||||
.B \-\-yacc
|
||||
] [
|
||||
.B \-h
|
||||
] [
|
||||
.B \-\-help
|
||||
] [
|
||||
.B \-\-fixed-output-files
|
||||
]
|
||||
file
|
||||
.br
|
||||
.B yacc
|
||||
[
|
||||
.I "similar options and operands"
|
||||
]
|
||||
[\fIOPTION\fR]... \fIFILE\fR
|
||||
.SH DESCRIPTION
|
||||
.I Bison
|
||||
is a parser generator in the style of
|
||||
@@ -116,254 +57,141 @@ are unique. When a long option takes an argument, like
|
||||
.BR \-\-file-prefix ,
|
||||
connect the option name and the argument with
|
||||
.BR = .
|
||||
.SS OPTIONS
|
||||
.PP
|
||||
Generate LALR(1) and GLR parsers.
|
||||
.PP
|
||||
Mandatory arguments to long options are mandatory for short options too.
|
||||
The same is true for optional arguments.
|
||||
.SS "Operation modes:"
|
||||
.TP
|
||||
.BI \-b " file-prefix"
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
output version information and exit
|
||||
.TP
|
||||
\fB\-\-print\-localedir\fR
|
||||
output directory containing locale\-dependent data
|
||||
.TP
|
||||
\fB\-\-print\-datadir\fR
|
||||
output directory containing skeletons and XSLT
|
||||
.TP
|
||||
\fB\-y\fR, \fB\-\-yacc\fR
|
||||
emulate POSIX Yacc
|
||||
.TP
|
||||
\fB\-W\fR, \fB\-\-warnings\fR=\fI[CATEGORY]\fR
|
||||
report the warnings falling in CATEGORY
|
||||
.SS "Parser:"
|
||||
.TP
|
||||
\fB\-L\fR, \fB\-\-language\fR=\fILANGUAGE\fR
|
||||
specify the output programming language
|
||||
.TP
|
||||
\fB\-S\fR, \fB\-\-skeleton\fR=\fIFILE\fR
|
||||
specify the skeleton to use
|
||||
.TP
|
||||
\fB\-t\fR, \fB\-\-debug\fR
|
||||
instrument the parser for debugging
|
||||
.TP
|
||||
\fB\-\-locations\fR
|
||||
enable locations computation
|
||||
.TP
|
||||
\fB\-p\fR, \fB\-\-name\-prefix\fR=\fIPREFIX\fR
|
||||
prepend PREFIX to the external symbols
|
||||
.TP
|
||||
\fB\-l\fR, \fB\-\-no\-lines\fR
|
||||
don't generate `#line' directives
|
||||
.TP
|
||||
\fB\-k\fR, \fB\-\-token\-table\fR
|
||||
include a table of token names
|
||||
.SS "Output:"
|
||||
.TP
|
||||
\fB\-\-defines\fR[=\fIFILE\fR]
|
||||
also produce a header file
|
||||
.TP
|
||||
\fB\-d\fR
|
||||
likewise but cannot specify FILE (for POSIX Yacc)
|
||||
.TP
|
||||
\fB\-r\fR, \fB\-\-report\fR=\fITHINGS\fR
|
||||
also produce details on the automaton
|
||||
.TP
|
||||
\fB\-\-report\-file\fR=\fIFILE\fR
|
||||
write report to FILE
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-verbose\fR
|
||||
same as `\-\-report=state'
|
||||
.TP
|
||||
\fB\-b\fR, \fB\-\-file\-prefix\fR=\fIPREFIX\fR
|
||||
specify a PREFIX for output files
|
||||
.TP
|
||||
\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
|
||||
leave output to FILE
|
||||
.TP
|
||||
\fB\-g\fR, \fB\-\-graph\fR[=\fIFILE\fR]
|
||||
also output a graph of the automaton
|
||||
.TP
|
||||
\fB\-x\fR, \fB\-\-xml\fR[=\fIFILE\fR]
|
||||
also output an XML report of the automaton
|
||||
(the XML schema is experimental)
|
||||
.SS "Warning categories include:"
|
||||
.TP
|
||||
`midrule\-values'
|
||||
unset or unused midrule values
|
||||
.TP
|
||||
`yacc'
|
||||
incompatibilities with POSIX YACC
|
||||
.TP
|
||||
`all'
|
||||
all the warnings
|
||||
.TP
|
||||
`no\-CATEGORY'
|
||||
turn off warnings in CATEGORY
|
||||
.TP
|
||||
`none'
|
||||
turn off all the warnings
|
||||
.TP
|
||||
`error'
|
||||
treat warnings as errors
|
||||
.SS "THINGS is a list of comma separated words that can include:"
|
||||
.TP
|
||||
`state'
|
||||
describe the states
|
||||
.TP
|
||||
`itemset'
|
||||
complete the core item sets with their closure
|
||||
.TP
|
||||
`lookahead'
|
||||
explicitly associate lookahead tokens to items
|
||||
.TP
|
||||
`solved'
|
||||
describe shift/reduce conflicts solving
|
||||
.TP
|
||||
`all'
|
||||
include all the above information
|
||||
.TP
|
||||
`none'
|
||||
disable the report
|
||||
.SH AUTHOR
|
||||
Written by Robert Corbett and Richard Stallman.
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to <bug\-[email protected]>.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2008 Free Software Foundation, Inc.
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.BI \-\-file-prefix= file-prefix
|
||||
Specify a prefix to use for all
|
||||
.I bison
|
||||
output file names. The names are
|
||||
chosen as if the input file were named
|
||||
\fIfile-prefix\fP\fB.c\fP.
|
||||
.TP
|
||||
.B \-d
|
||||
.br
|
||||
.ns
|
||||
Write an extra output file containing macro definitions for the token
|
||||
type names defined in the grammar and the semantic value type
|
||||
.BR YYSTYPE ,
|
||||
as well as a few
|
||||
.B extern
|
||||
variable declarations.
|
||||
.sp
|
||||
If the parser output file is named
|
||||
.IB name .c
|
||||
then this file
|
||||
is named
|
||||
\fIname\fP\fB.h\fP.
|
||||
.sp
|
||||
This output file is essential if you wish to put the definition of
|
||||
.B yylex
|
||||
in a separate source file, because
|
||||
.B yylex
|
||||
needs to be able to refer to token type codes and the variable
|
||||
.BR yylval .
|
||||
.TP
|
||||
.BI \-\-defines= defines-file
|
||||
The behavior of
|
||||
.B \-\-defines
|
||||
is the same than
|
||||
.B \-d
|
||||
option.
|
||||
The only difference is that it has an optional argument which is
|
||||
the name of the output filename.
|
||||
.TP
|
||||
.BI \-g
|
||||
.br
|
||||
.ns
|
||||
Output a VCG definition of the LALR(1) grammar automaton computed by
|
||||
Bison. If the grammar file is
|
||||
.BR foo.y
|
||||
, the VCG output file will be
|
||||
.BR foo.vcg .
|
||||
.TP
|
||||
.BI \-\-graph= graph-file
|
||||
The behavior of
|
||||
.BI \-\-graph
|
||||
is the same than
|
||||
.BI \-g
|
||||
option. The only difference is that it has an optional argument which
|
||||
is the name of the output graph filename.
|
||||
.TP
|
||||
.B \-k
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-token-table
|
||||
This switch causes the
|
||||
.IB name .tab.c
|
||||
output to include a list of
|
||||
token names in order by their token numbers; this is defined in the array
|
||||
.IR yytname .
|
||||
Also generated
|
||||
are #defines for
|
||||
.IR YYNTOKENS ,
|
||||
.IR YYNNTS ,
|
||||
.IR YYNRULES ,
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
.SH "SEE ALSO"
|
||||
.BR lex (1),
|
||||
.BR flex (1),
|
||||
.BR yacc (1).
|
||||
.PP
|
||||
The full documentation for
|
||||
.B bison
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.IR YYNSTATES .
|
||||
.TP
|
||||
.B \-l
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-no-lines
|
||||
Don't put any
|
||||
.B #line
|
||||
preprocessor commands in the parser file.
|
||||
Ordinarily
|
||||
.I bison
|
||||
puts them in the parser file so that the C compiler
|
||||
and debuggers will associate errors with your source file, the
|
||||
grammar file. This option causes them to associate errors with the
|
||||
parser file, treating it an independent source file in its own right.
|
||||
.TP
|
||||
.B \-n
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-no-parser
|
||||
Do not generate the parser code into the output; generate only
|
||||
declarations. The generated
|
||||
.IB name .tab.c
|
||||
file will have only
|
||||
constant declarations. In addition, a
|
||||
.IB name .act
|
||||
file is
|
||||
generated containing a switch statement body containing all the
|
||||
translated actions.
|
||||
.TP
|
||||
.BI \-o " outfile"
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.BI \-\-output-file= outfile
|
||||
Specify the name
|
||||
.I outfile
|
||||
for the parser file.
|
||||
.sp
|
||||
The other output files' names are constructed from
|
||||
.I outfile
|
||||
as described under the
|
||||
.B \-v
|
||||
and
|
||||
.B \-d
|
||||
switches.
|
||||
.TP
|
||||
.BI \-p " prefix"
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.BI \-\-name-prefix= prefix
|
||||
Rename the external symbols used in the parser so that they start with
|
||||
.I prefix
|
||||
instead of
|
||||
.BR yy .
|
||||
The precise list of symbols renamed is
|
||||
.BR yyparse ,
|
||||
.BR yylex ,
|
||||
.BR yyerror ,
|
||||
.BR yylval ,
|
||||
.BR yychar ,
|
||||
and
|
||||
.BR yydebug .
|
||||
.sp
|
||||
For example, if you use
|
||||
.BR "\-p c" ,
|
||||
the names become
|
||||
.BR cparse ,
|
||||
.BR clex ,
|
||||
and so on.
|
||||
.TP
|
||||
.B \-t
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-debug
|
||||
In the parser file, define the macro
|
||||
.B YYDEBUG
|
||||
to 1 if it is not already defined,
|
||||
so that the debugging facilities are compiled.
|
||||
.TP
|
||||
.B \-v
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-verbose
|
||||
Write an extra output file containing verbose descriptions of the
|
||||
parser states and what is done for each type of lookahead token in
|
||||
that state.
|
||||
.sp
|
||||
This file also describes all the conflicts, both those resolved by
|
||||
operator precedence and the unresolved ones.
|
||||
.sp
|
||||
The file's name is made by removing
|
||||
.B .tab.c
|
||||
or
|
||||
.B .c
|
||||
from the parser output file name, and adding
|
||||
.B .output
|
||||
instead.
|
||||
.sp
|
||||
Therefore, if the input file is
|
||||
.BR foo.y ,
|
||||
then the parser file is called
|
||||
.B foo.tab.c
|
||||
by default. As a consequence, the verbose
|
||||
output file is called
|
||||
.BR foo.output .
|
||||
.TP
|
||||
.B \-V
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-version
|
||||
Print the version number of
|
||||
.I bison
|
||||
and exit.
|
||||
.TP
|
||||
.B \-h
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-help
|
||||
Print a summary of the options to
|
||||
.I bison
|
||||
and exit.
|
||||
.TP
|
||||
.B \-y
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-yacc
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-fixed-output-files
|
||||
Equivalent to
|
||||
.BR "\-o y.tab.c" ;
|
||||
the parser output file is called
|
||||
.BR y.tab.c ,
|
||||
and the other outputs are called
|
||||
.B y.output
|
||||
and
|
||||
.BR y.tab.h .
|
||||
The purpose of this switch is to imitate
|
||||
.IR yacc 's
|
||||
output file name conventions.
|
||||
Thus, the following shell script can substitute for
|
||||
.I yacc
|
||||
and is often installed as
|
||||
.IR yacc :
|
||||
.sp
|
||||
.RS
|
||||
.ft B
|
||||
bison \-y "$@"
|
||||
.ft R
|
||||
.sp
|
||||
.RE
|
||||
.SH SEE ALSO
|
||||
.IR yacc (1)
|
||||
.br
|
||||
The
|
||||
.IR "Bison Reference Manual" ,
|
||||
included as the file
|
||||
.B bison.texinfo
|
||||
in the
|
||||
.I bison
|
||||
source distribution.
|
||||
.SH DIAGNOSTICS
|
||||
Self explanatory.
|
||||
.B bison
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info bison
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
|
||||
+1469
-278
File diff suppressed because it is too large
Load Diff
+55
@@ -0,0 +1,55 @@
|
||||
[name]
|
||||
bison \- GNU Project parser generator (yacc replacement)
|
||||
|
||||
[description]
|
||||
.I Bison
|
||||
is a parser generator in the style of
|
||||
.IR yacc (1).
|
||||
It should be upwardly compatible with input files designed
|
||||
for
|
||||
.IR yacc .
|
||||
.PP
|
||||
Input files should follow the
|
||||
.I yacc
|
||||
convention of ending in
|
||||
.BR .y .
|
||||
Unlike
|
||||
.IR yacc ,
|
||||
the generated files do not have fixed names, but instead use the prefix
|
||||
of the input file.
|
||||
Moreover, if you need to put
|
||||
.I C++
|
||||
code in the input file, you can end his name by a C++-like extension
|
||||
(.ypp or .y++), then bison will follow your extension to name the
|
||||
output file (.cpp or .c++).
|
||||
For instance, a grammar description file named
|
||||
.B parse.yxx
|
||||
would produce the generated parser in a file named
|
||||
.BR parse.tab.cxx ,
|
||||
instead of
|
||||
.IR yacc 's
|
||||
.B y.tab.c
|
||||
or old
|
||||
.I Bison
|
||||
version's
|
||||
.BR parse.tab.c .
|
||||
.PP
|
||||
This description of the options that can be given to
|
||||
.I bison
|
||||
is adapted from the node
|
||||
.B Invocation
|
||||
in the
|
||||
.B bison.texinfo
|
||||
manual, which should be taken as authoritative.
|
||||
.PP
|
||||
.I Bison
|
||||
supports both traditional single-letter options and mnemonic long
|
||||
option names. Long option names are indicated with
|
||||
.B \-\-
|
||||
instead of
|
||||
.BR \- .
|
||||
Abbreviations for option names are allowed as long as they
|
||||
are unique. When a long option takes an argument, like
|
||||
.BR \-\-file-prefix ,
|
||||
connect the option name and the argument with
|
||||
.BR = .
|
||||
@@ -0,0 +1,4 @@
|
||||
[see also]
|
||||
.BR lex (1),
|
||||
.BR flex (1),
|
||||
.BR yacc (1).
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
|
||||
@node GNU Free Documentation License
|
||||
@appendixsec GNU Free Documentation License
|
||||
|
||||
@cindex FDL, GNU Free Documentation License
|
||||
@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
|
||||
@@ -408,7 +407,7 @@ as a draft) by the Free Software Foundation.
|
||||
@end enumerate
|
||||
|
||||
@page
|
||||
@appendixsubsec ADDENDUM: How to use this License for your documents
|
||||
@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
|
||||
@@ -427,7 +426,7 @@ license notices just after the title page:
|
||||
@end smallexample
|
||||
|
||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
||||
replace the ``with...Texts.'' line with this:
|
||||
replace the ``with@dots{}Texts.'' line with this:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
|
||||
@@ -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}.
|
||||
-392
@@ -1,392 +0,0 @@
|
||||
@node Copying
|
||||
@unnumbered GNU GENERAL PUBLIC LICENSE
|
||||
@center Version 2, June 1991
|
||||
|
||||
@c This file is intended to be included in another file.
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@end display
|
||||
|
||||
@unnumberedsec Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software---to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) 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
|
||||
this service 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 make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. 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.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
@iftex
|
||||
@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
@end ifinfo
|
||||
|
||||
@enumerate 0
|
||||
@item
|
||||
This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The ``Program'', below,
|
||||
refers to any such program or work, and a ``work based on the Program''
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term ``modification''.) Each licensee is addressed as ``you''.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
@item
|
||||
You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
@item
|
||||
You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
@item
|
||||
You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
@item
|
||||
If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
@end enumerate
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
@item
|
||||
You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
@item
|
||||
Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
@item
|
||||
Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
@end enumerate
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
@item
|
||||
You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program 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
|
||||
You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
@item
|
||||
Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
@item
|
||||
If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
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
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
@item
|
||||
If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
@item
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 a version number of this License which applies to it and ``any
|
||||
later version'', you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
@item
|
||||
If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
@iftex
|
||||
@heading NO WARRANTY
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center NO WARRANTY
|
||||
@end ifinfo
|
||||
|
||||
@item
|
||||
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE 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.
|
||||
@end enumerate
|
||||
|
||||
@iftex
|
||||
@heading END OF TERMS AND CONDITIONS
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center END OF TERMS AND CONDITIONS
|
||||
@end ifinfo
|
||||
|
||||
@page
|
||||
@unnumberedsec Appendix: 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
|
||||
convey 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{yyyy} @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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
@end smallexample
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
@smallexample
|
||||
Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
@end smallexample
|
||||
|
||||
The hypothetical commands @samp{show w} and @samp{show c} should show
|
||||
the appropriate parts of the General Public License. Of course, the
|
||||
commands you use may be called something other than @samp{show w} and
|
||||
@samp{show c}; they could even be mouse-clicks or menu items---whatever
|
||||
suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a ``copyright disclaimer'' for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
@example
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
@var{signature of Ty Coon}, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
@end example
|
||||
|
||||
This 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 Library General
|
||||
Public License instead of this License.
|
||||
+9
-11
@@ -23,20 +23,18 @@
|
||||
%
|
||||
% This file is part of Bison.
|
||||
%
|
||||
% Bison is free software; you can redistribute them and/or modify them
|
||||
% under the terms of the GNU General Public License as published by the
|
||||
% Free Software Foundation; either version 2, or (at your option) any
|
||||
% later version.
|
||||
% 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.
|
||||
%
|
||||
% Bison is distributed in the hope that it will be useful, but WITHOUT
|
||||
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
% for more details.
|
||||
% 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 either Flex or Bison; see the file COPYING. If not, write
|
||||
% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
% Boston, MA 02110-1301, USA.
|
||||
% along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
%
|
||||
% This file is intended to be processed by plain TeX (TeX82).
|
||||
%
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
.TH YACC "1" "November 2007" "@PACKAGE_STRING@" "User Commands"
|
||||
.SH NAME
|
||||
yacc \- GNU Project parser generator
|
||||
.SH SYNOPSIS
|
||||
.B yacc
|
||||
[\fIOPTION\fR]... \fIFILE\fR
|
||||
.SH DESCRIPTION
|
||||
.I Yacc
|
||||
(Yet Another Compiler Compiler) is a parser generator. This
|
||||
version is a simple wrapper around
|
||||
.IR bison (1).
|
||||
It passes option
|
||||
\fB\-y\fR, \fB\-\-yacc\fR
|
||||
to activate the upward compatibility mode. See
|
||||
.IR bison (1)
|
||||
for more information.
|
||||
.SH AUTHOR
|
||||
Written by Paul Eggert.
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to <@PACKAGE_BUGREPORT@>.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co @PACKAGE_COPYRIGHT_YEAR@ Free Software Foundation, Inc.
|
||||
.br
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
.SH "SEE ALSO"
|
||||
.BR lex (1),
|
||||
.BR flex (1),
|
||||
.BR bison (1).
|
||||
.PP
|
||||
The full documentation for
|
||||
.B bison
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B bison
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info bison
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
@@ -0,0 +1,3 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
bench.pl
|
||||
@@ -0,0 +1,16 @@
|
||||
## Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
nodist_noinst_SCRIPTS = bench.pl
|
||||
+5
-7
@@ -23,20 +23,18 @@ Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
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 autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Local Variables:
|
||||
mode: outline
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of Bison, the GNU Compiler Compiler.
|
||||
#
|
||||
# Bison is free software; you can redistribute it and/or modify
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Bison is distributed in the hope that it will be useful,
|
||||
# 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 autoconf; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use IO::File;
|
||||
use Benchmark qw (:all);
|
||||
|
||||
my $bison = $ENV{'BISON'} || 'bison';
|
||||
my $bison = $ENV{'BISON'} || '@abs_top_builddir@/tests/bison';
|
||||
my $cc = $ENV{'CC'} || 'gcc';
|
||||
|
||||
##################################################################
|
||||
@@ -260,12 +258,6 @@ read_signed_integer (void)
|
||||
return sign * n;
|
||||
}
|
||||
|
||||
#if YYPUSH
|
||||
#ifndef HAVE_YYSTYPE
|
||||
static YYSTYPE yylval;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static int
|
||||
#if YYPURE
|
||||
# define yylval (*yylvalp)
|
||||
@@ -310,21 +302,6 @@ power (int base, int exponent)
|
||||
}
|
||||
|
||||
|
||||
#if YYPUSH
|
||||
static int
|
||||
yyparse_wrapper ()
|
||||
{
|
||||
struct yypvars *ctx = yypvarsinit ();
|
||||
do {
|
||||
set_yychar (ctx, yylex ());
|
||||
ctx->yylval = yylval;
|
||||
yyparse (ctx);
|
||||
} while (get_yyresult (ctx) != 0);
|
||||
free (ctx);
|
||||
}
|
||||
#define yyparse yyparse_wrapper
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, const char **argv)
|
||||
{
|
||||
@@ -366,16 +343,12 @@ sub bench_grammar ($)
|
||||
my ($gram) = @_;
|
||||
my %test =
|
||||
(
|
||||
"yacc-yacc" => '',
|
||||
"yacc-pure" => '%pure-parser',
|
||||
"push-yacc" => '%skeleton "push.c"',
|
||||
"push-pure" => '%skeleton "push.c" %pure-parser',
|
||||
"push-push" => '%skeleton "push.c" %push-parser',
|
||||
"popt-yacc" => '%skeleton "push_opt.c"',
|
||||
"popt-pure" => '%skeleton "push_opt.c" %pure-parser',
|
||||
"popt-push" => '%skeleton "push_opt.c" %push-parser',
|
||||
"pull-impure" => '',
|
||||
"pull-pure" => '%define api.pure',
|
||||
"push-impure" => '%define api.push_pull "both"',
|
||||
"push-pure" => '%define api.push_pull "both" %define api.pure',
|
||||
);
|
||||
|
||||
|
||||
my %bench;
|
||||
while (my ($name, $directives) = each %test)
|
||||
{
|
||||
+12
-14
@@ -1,20 +1,18 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
# 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/>.
|
||||
|
||||
if BISON_CXX_WORKS
|
||||
SUBDIRS = calc++
|
||||
|
||||
+15
-16
@@ -1,20 +1,18 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
# 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/>.
|
||||
|
||||
## ------------------------------------- ##
|
||||
## Running the bison from this tarball. ##
|
||||
@@ -35,8 +33,8 @@ extexi = $(top_srcdir)/examples/extexi
|
||||
# Extract in src.
|
||||
$(calc_extracted): $(doc) $(extexi)
|
||||
cd $(srcdir) && \
|
||||
$(AWK) -f ../extexi ../../doc/bison.texinfo -- \
|
||||
calc++-parser.yy \
|
||||
$(AWK) -f ../extexi -v VERSION="$(VERSION)" \
|
||||
../../doc/bison.texinfo -- calc++-parser.yy \
|
||||
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
||||
|
||||
|
||||
@@ -44,6 +42,7 @@ $(calc_extracted): $(doc) $(extexi)
|
||||
## Parser generation. ##
|
||||
## ------------------- ##
|
||||
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir)
|
||||
BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
|
||||
CLEANFILES = $(srcdir)/*.output *.tmp
|
||||
MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
||||
|
||||
+4
-5
@@ -3,9 +3,9 @@
|
||||
# This file is part of GNU Bison
|
||||
# Copyright 1992, 2000, 2001, 2005, 2006 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# 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,
|
||||
@@ -14,9 +14,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This script is for use with any Awk that conforms to POSIX.
|
||||
# It was derived from a similar script tests/generate.awk in GNU m4.
|
||||
@@ -111,6 +109,7 @@ function normalize(contents, i, lines, n, line, res) {
|
||||
else
|
||||
line = "";
|
||||
|
||||
gsub (/"@value\{VERSION\}"/, "\"" VERSION "\"", line)
|
||||
gsub (/^@result\{\}/, "", line);
|
||||
gsub (/^@error\{\}/, "", line);
|
||||
gsub ("@[{]", "{", line);
|
||||
|
||||
+44
-4
@@ -4,18 +4,28 @@ Makefile.in
|
||||
argmatch.c
|
||||
argmatch.h
|
||||
basename.c
|
||||
c-ctype.c
|
||||
c-ctype.h
|
||||
c-strcase.h
|
||||
c-strcasecmp.c
|
||||
c-strncasecmp.c
|
||||
charset.alias
|
||||
config.charset
|
||||
config.h
|
||||
config.hin
|
||||
configmake.h
|
||||
dirname.c
|
||||
dirname.h
|
||||
dup-safer.c
|
||||
error.c
|
||||
error.h
|
||||
exit.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
|
||||
@@ -23,6 +33,12 @@ gettext.h
|
||||
gnulib.mk
|
||||
hash.c
|
||||
hash.h
|
||||
intprops.h
|
||||
inttypes.h
|
||||
inttypes.in.h
|
||||
inttypes_.h
|
||||
localcharset.c
|
||||
localcharset.h
|
||||
malloc.c
|
||||
mbswidth.c
|
||||
mbswidth.h
|
||||
@@ -33,28 +49,52 @@ quote.c
|
||||
quote.h
|
||||
quotearg.c
|
||||
quotearg.h
|
||||
ref-add.sed
|
||||
ref-add.sin
|
||||
ref-del.sed
|
||||
ref-del.sin
|
||||
stamp-h1
|
||||
stdbool.h
|
||||
stdbool.in.h
|
||||
stdbool_.h
|
||||
stdint.h
|
||||
stdint.in.h
|
||||
stdint_.h
|
||||
stdio--.h
|
||||
stdio-safer.h
|
||||
stdlib.h
|
||||
stdlib.in.h
|
||||
stdlib_.h
|
||||
stpcpy.c
|
||||
stpcpy.h
|
||||
streq.h
|
||||
strerror.c
|
||||
string.h
|
||||
string.in.h
|
||||
string_.h
|
||||
stripslash.c
|
||||
strndup.c
|
||||
strndup.h
|
||||
strnlen.c
|
||||
strnlen.h
|
||||
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
|
||||
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
|
||||
|
||||
+27
-35
@@ -1,39 +1,25 @@
|
||||
## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
# Make bison/lib.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
# Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
|
||||
## 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.
|
||||
# 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/>.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
include gnulib.mk
|
||||
|
||||
AM_CFLAGS = $(WARNING_CFLAGS)
|
||||
|
||||
BUILT_SOURCES =
|
||||
EXTRA_DIST =
|
||||
MOSTLYCLEANFILES =
|
||||
|
||||
lib_LIBRARIES = $(YACC_LIBRARY)
|
||||
EXTRA_LIBRARIES = liby.a
|
||||
noinst_LIBRARIES = libbison.a
|
||||
|
||||
liby_a_SOURCES = main.c yyerror.c
|
||||
|
||||
libbison_a_SOURCES = $(lib_SOURCES)
|
||||
lib_SOURCES = \
|
||||
get-errno.h get-errno.c \
|
||||
subpipe.h subpipe.c \
|
||||
$(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
|
||||
|
||||
# Implementation of bitsets
|
||||
# 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 \
|
||||
@@ -41,13 +27,19 @@ bitsets_sources = \
|
||||
|
||||
# Additional bitset operations.
|
||||
additional_bitsets_sources = \
|
||||
bitsetv-print.h bitsetv-print.c
|
||||
bitsetv-print.h bitsetv-print.c
|
||||
|
||||
# timevars, stolen from GCC.
|
||||
timevars_sources = \
|
||||
timevar.h timevar.c timevar.def
|
||||
timevar.h timevar.c timevar.def
|
||||
|
||||
libbison_a_LIBADD = $(LIBOBJS) $(ALLOCA)
|
||||
libbison_a_DEPENDENCIES = $(libbison_a_LIBADD)
|
||||
# Non-gnulib sources in Bison's internal library.
|
||||
libbison_a_SOURCES += \
|
||||
get-errno.h get-errno.c \
|
||||
subpipe.h subpipe.c \
|
||||
$(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
|
||||
|
||||
include gnulib.mk
|
||||
# The Yacc compatibility library.
|
||||
lib_LIBRARIES = $(YACC_LIBRARY)
|
||||
EXTRA_LIBRARIES = liby.a
|
||||
liby_a_SOURCES = main.c yyerror.c
|
||||
|
||||
+4
-7
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
|
||||
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
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -13,12 +13,9 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "abitset.h"
|
||||
#include <stddef.h>
|
||||
|
||||
+10
-11
@@ -2,19 +2,18 @@
|
||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is 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.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ABITSET_H
|
||||
#define _ABITSET_H
|
||||
|
||||
+10
-11
@@ -2,19 +2,18 @@
|
||||
Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is 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.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BBITSET_H
|
||||
#define _BBITSET_H
|
||||
|
||||
+6
-8
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -13,16 +13,14 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "bitset.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "bitset.h"
|
||||
#include "abitset.h"
|
||||
#include "lbitset.h"
|
||||
#include "ebitset.h"
|
||||
|
||||
+10
-11
@@ -2,19 +2,18 @@
|
||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is 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.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITSET_H
|
||||
#define _BITSET_H
|
||||
|
||||
+6
-8
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -13,8 +13,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file is a wrapper bitset implementation for the other bitset
|
||||
implementations. It provides bitset compatibility checking and
|
||||
@@ -23,16 +22,15 @@
|
||||
operations get vectored through here and we then call the appropriate
|
||||
routines. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "bitset_stats.h"
|
||||
|
||||
#include "bbitset.h"
|
||||
#include "abitset.h"
|
||||
#include "ebitset.h"
|
||||
#include "lbitset.h"
|
||||
#include "vbitset.h"
|
||||
#include "bitset_stats.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
+10
-11
@@ -2,19 +2,18 @@
|
||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is 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.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITSET_STATS_H
|
||||
#define _BITSET_STATS_H
|
||||
|
||||
+6
-8
@@ -1,9 +1,9 @@
|
||||
/* Bitset vectors.
|
||||
Copyright (C) 2001, 2002, 2004, 2006 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -12,15 +12,13 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "bitsetv-print.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "bitsetv-print.h"
|
||||
|
||||
/*--------------------------------------------------------.
|
||||
| Display the MATRIX array of SIZE bitsets of size SIZE. |
|
||||
|
||||
+10
-11
@@ -2,19 +2,18 @@
|
||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Akim Demaille (akim@freefriends.org).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is 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.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITSETV_PRINT_H
|
||||
#define _BITSETV_PRINT_H
|
||||
|
||||
+6
-8
@@ -1,9 +1,9 @@
|
||||
/* Bitset vectors.
|
||||
Copyright (C) 2001, 2002, 2004, 2005, 2006 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -12,15 +12,13 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "bitsetv.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "bitsetv.h"
|
||||
|
||||
|
||||
/* Create a vector of N_VECS bitsets, each of N_BITS, and of
|
||||
|
||||
+10
-11
@@ -2,19 +2,18 @@
|
||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is 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.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITSETV_H
|
||||
#define _BITSETV_H
|
||||
|
||||
+5
-7
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -13,14 +13,12 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "ebitset.h"
|
||||
|
||||
#include "obstack.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
+10
-11
@@ -2,19 +2,18 @@
|
||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is 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.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _EBITSET_H
|
||||
#define _EBITSET_H
|
||||
|
||||
+7
-10
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2002, 2006 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
|
||||
the Free Software Foundation; either version 2, or (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
|
||||
@@ -13,19 +13,16 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <config.h>
|
||||
|
||||
#include "get-errno.h"
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
/* Get and set errno. A source file that needs to set or get errno,
|
||||
but doesn't need to test for specific errno values, can use these
|
||||
functions to avoid namespace pollution. For example, a file that
|
||||
|
||||
+4
-5
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2002 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
|
||||
the Free Software Foundation; either version 2, or (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
|
||||
@@ -13,8 +13,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
extern int get_errno (void);
|
||||
extern void set_errno (int);
|
||||
|
||||
+5
-7
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -13,14 +13,12 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "lbitset.h"
|
||||
|
||||
#include "obstack.h"
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
+10
-11
@@ -2,19 +2,18 @@
|
||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is 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.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LBITSET_H
|
||||
#define _LBITSET_H
|
||||
|
||||
+4
-5
@@ -1,10 +1,10 @@
|
||||
/* Fake libiberty.h for Bison.
|
||||
Copyright (C) 2002, 2003, 2004 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
|
||||
the Free Software Foundation; either version 2, or (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
|
||||
@@ -12,8 +12,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* Bison depends on libiberty's implementation of bitsets, which
|
||||
|
||||
+5
-7
@@ -4,20 +4,18 @@
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison 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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
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 Bison; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
+6
-11
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2002, 2004, 2005, 2006 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
|
||||
the Free Software Foundation; either version 2, or (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
|
||||
@@ -13,15 +13,12 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert <[email protected]>
|
||||
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "subpipe.h"
|
||||
|
||||
@@ -34,9 +31,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#ifndef STDIN_FILENO
|
||||
# define STDIN_FILENO 0
|
||||
#endif
|
||||
|
||||
+3
-4
@@ -1,9 +1,9 @@
|
||||
/* Subprocesses with pipes.
|
||||
Copyright (C) 2002, 2004, 2005 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -12,8 +12,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert <[email protected]>
|
||||
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
||||
|
||||
+4
-7
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2000, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -13,12 +13,9 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#if IN_GCC
|
||||
|
||||
|
||||
+7
-8
@@ -1,24 +1,22 @@
|
||||
/* This file contains the definitions for timing variables used to -*- C -*-
|
||||
measure run-time performance of the compiler.
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2007 Free Software Foundation, Inc.
|
||||
Contributed by Akim Demaille <akim@freefriends.org>.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison 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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
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 Bison; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file contains timing variable definitions, used by timevar.h
|
||||
and timevar.c.
|
||||
@@ -48,6 +46,7 @@ DEFTIMEVAR (TV_CONFLICTS , "conflicts")
|
||||
/* Time spent outputing results. */
|
||||
DEFTIMEVAR (TV_REPORT , "outputing report")
|
||||
DEFTIMEVAR (TV_GRAPH , "outputing graph")
|
||||
DEFTIMEVAR (TV_XML , "outputing xml")
|
||||
DEFTIMEVAR (TV_ACTIONS , "parser action tables")
|
||||
DEFTIMEVAR (TV_PARSER , "outputing parser")
|
||||
DEFTIMEVAR (TV_M4 , "running m4")
|
||||
|
||||
+3
-4
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -13,8 +13,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_TIMEVAR_H
|
||||
#define GCC_TIMEVAR_H
|
||||
|
||||
+5
-7
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
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,
|
||||
@@ -13,14 +13,12 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "vbitset.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
+10
-11
@@ -2,19 +2,18 @@
|
||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is 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.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _VBITSET_H
|
||||
#define _VBITSET_H
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user