mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-12 04:05:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08090fe64c | ||
|
|
c76f5dfb03 | ||
|
|
2ad7e09e96 | ||
|
|
a3d760ef5d | ||
|
|
22cc8d813e | ||
|
|
9398411bfc | ||
|
|
d093cf8cbd | ||
|
|
c412a490ec | ||
|
|
2d2a7d608e | ||
|
|
5ea72c19da | ||
|
|
97d520633b | ||
|
|
af8a609a90 | ||
|
|
73edad9a25 | ||
|
|
9736697d6d | ||
|
|
e2f3fda11a | ||
|
|
3c0be43411 | ||
|
|
d45708d418 | ||
|
|
219c26ea51 | ||
|
|
f1ceed0774 | ||
|
|
d2829fdc04 | ||
|
|
43dc3c8bc4 | ||
|
|
3d04b5673d | ||
|
|
39c2566994 | ||
|
|
1694ac5cf2 | ||
|
|
dfff662817 | ||
|
|
adf1725fdb | ||
|
|
7aaf9ce758 | ||
|
|
2ceb8c617c | ||
|
|
87b9c9bc43 | ||
|
|
dc25ce6bb1 | ||
|
|
ace92a2691 | ||
|
|
397bb3932f | ||
|
|
bbbbe221d7 | ||
|
|
4d7b57b527 | ||
|
|
321fe707f4 | ||
|
|
1266b63674 | ||
|
|
b9ad39c1fb | ||
|
|
b1a4261e6d | ||
|
|
a022ff4186 | ||
|
|
b5b94bd5e6 | ||
|
|
b9e42bb439 | ||
|
|
75ac158b82 | ||
|
|
f23cd66008 | ||
|
|
9874460819 | ||
|
|
915becaa5d | ||
|
|
ae50972393 | ||
|
|
c9e0a88079 | ||
|
|
50bcb22c4c | ||
|
|
cfc9e431c3 | ||
|
|
42f8609bbd | ||
|
|
9e408f848d | ||
|
|
48578d6c12 | ||
|
|
914e713d07 | ||
|
|
94505fb7e2 | ||
|
|
1bcbca4368 | ||
|
|
a17352a9da | ||
|
|
c984dee8d1 | ||
|
|
cefb18280b | ||
|
|
2f3064f08e | ||
|
|
ab3a683f05 | ||
|
|
ecd1b61cd4 | ||
|
|
f67c40374e | ||
|
|
0213d65176 | ||
|
|
c19178bfaf | ||
|
|
0d2b2ab033 | ||
|
|
8ba62e3e10 | ||
|
|
f490771b4b | ||
|
|
5bc993d947 | ||
|
|
580c075d7f | ||
|
|
5d3a1ecbbe | ||
|
|
015e86a7b2 | ||
|
|
c1455babda | ||
|
|
2075a82a18 | ||
|
|
26fccd4d7b | ||
|
|
6469c4d72b | ||
|
|
b328890a9e | ||
|
|
f307943941 | ||
|
|
5339158d01 | ||
|
|
8defe11bfa | ||
|
|
41930e7ad8 | ||
|
|
d07932ef3d | ||
|
|
0364b3344f | ||
|
|
876fd8357a | ||
|
|
1eb0b14659 | ||
|
|
bee1df15b2 | ||
|
|
7e6d1e2296 | ||
|
|
a957d06cef | ||
|
|
462503f825 | ||
|
|
bf151b75ff | ||
|
|
f56274a8f9 | ||
|
|
b5775a81c1 | ||
|
|
7ed73f82ad | ||
|
|
4b1ebc495b | ||
|
|
738cde3e93 | ||
|
|
d6fb461dd8 | ||
|
|
14da0cdd07 | ||
|
|
c9ba9e5978 | ||
|
|
bfb40910e3 | ||
|
|
241fda7a8d | ||
|
|
ed4d67dcbe | ||
|
|
e254a580b5 | ||
|
|
f259e4e63c | ||
|
|
74d6c0fe17 | ||
|
|
cae5057f47 | ||
|
|
4af432ba25 | ||
|
|
e26d4e4314 | ||
|
|
c0ee9e2115 | ||
|
|
482dc52fb7 | ||
|
|
52cbbe845a | ||
|
|
0925d5bfd4 | ||
|
|
cf98343c1d | ||
|
|
9f467b7d84 | ||
|
|
0f0e1ace60 | ||
|
|
548e2104e2 | ||
|
|
ddf17a6e0e | ||
|
|
e1145ad8bd | ||
|
|
0df72d78ff | ||
|
|
9a90b6bbc6 | ||
|
|
6501566813 | ||
|
|
98e26a9201 | ||
|
|
86c0e78460 | ||
|
|
8851116612 | ||
|
|
d67c52e852 | ||
|
|
6bbb2ed5ef | ||
|
|
8dce3875bc | ||
|
|
a3764451d3 | ||
|
|
882a1fbf72 | ||
|
|
dfcc595944 | ||
|
|
a30e920d17 | ||
|
|
445b74704f | ||
|
|
a1e50014a0 | ||
|
|
d43f77e7ee | ||
|
|
fee2ed87aa | ||
|
|
fdd2c97c0b | ||
|
|
78029cd561 | ||
|
|
c53d18b157 | ||
|
|
5523ac79a0 | ||
|
|
8fa369111f | ||
|
|
bcf07cb707 | ||
|
|
9aacab9ae9 | ||
|
|
a9fc7990fa | ||
|
|
0f1d6f10d7 | ||
|
|
7bd1665a86 | ||
|
|
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 | ||
|
|
21fe08cadc | ||
|
|
e8ec4d9b33 | ||
|
|
1ef30650b8 | ||
|
|
a36b333cc2 | ||
|
|
fa7b79c063 | ||
|
|
4ec13d6058 | ||
|
|
8e1687aef6 | ||
|
|
aef3da8689 | ||
|
|
84567a1b1c | ||
|
|
afac5ba023 | ||
|
|
3dc5e96b85 | ||
|
|
b2a0b7ca70 | ||
|
|
3be03b13e5 | ||
|
|
3508ce361b | ||
|
|
9350499cfc | ||
|
|
4d7370cb4f | ||
|
|
6d0ef4ec20 | ||
|
|
965537bc54 | ||
|
|
5362ed19b6 | ||
|
|
2d2c1a2dec | ||
|
|
47aee066cc | ||
|
|
1f6b3679b2 | ||
|
|
219741d873 | ||
|
|
11daa4e73b | ||
|
|
b4c2a79743 | ||
|
|
34ec357927 | ||
|
|
f9bfc42aa7 | ||
|
|
06e8700a00 | ||
|
|
9c4371263f | ||
|
|
284d8a13e8 | ||
|
|
ec5479ce35 | ||
|
|
868d2d9638 | ||
|
|
62a9592d3d | ||
|
|
10d6970fb1 | ||
|
|
50a339934c | ||
|
|
2ce4ed68c9 | ||
|
|
db7e5eb5ef | ||
|
|
a5d80ba505 | ||
|
|
23eb2a692f | ||
|
|
b321737f20 | ||
|
|
1f4cc0f4ae | ||
|
|
ddc8ede1ab | ||
|
|
b37acfe18c | ||
|
|
08bc001306 | ||
|
|
80ac75bcb6 | ||
|
|
f2e690d8c3 | ||
|
|
7b42569e12 | ||
|
|
3b452f4ea6 | ||
|
|
b8a4155924 | ||
|
|
cd9e1ba28d | ||
|
|
b8445a158c | ||
|
|
b3d9b5ba18 | ||
|
|
cb48f1919c | ||
|
|
cd48d21d94 | ||
|
|
8ec0a172bc | ||
|
|
4a678af8c6 | ||
|
|
dd60572a8b | ||
|
|
fab044e6da | ||
|
|
2073e1b602 | ||
|
|
8ee5b53874 | ||
|
|
ad6b1efa2f | ||
|
|
ffa4ba3aef | ||
|
|
300a193064 | ||
|
|
e256e17f57 | ||
|
|
381ecb0687 | ||
|
|
4210cd0bfc | ||
|
|
34f98f46ee | ||
|
|
31b2b07ef7 | ||
|
|
9bc0dd679f | ||
|
|
203b927414 | ||
|
|
1b818f33ad | ||
|
|
a7ee59cfb4 | ||
|
|
d2a1a60ab6 | ||
|
|
33ad1a9c2d | ||
|
|
5a2baae7b3 | ||
|
|
58d7a1a1c7 | ||
|
|
40637e8169 | ||
|
|
b931235eb9 | ||
|
|
9e6e7ed2b2 | ||
|
|
742e4900c8 | ||
|
|
3c40d0b52d | ||
|
|
5d27808262 | ||
|
|
9e6688995e | ||
|
|
a898d2780f | ||
|
|
0c8e079fa6 | ||
|
|
9f936c5e9c | ||
|
|
2346344a08 | ||
|
|
4862bdfd61 | ||
|
|
e9071366c3 | ||
|
|
184e42f065 | ||
|
|
7891a7c449 | ||
|
|
4ad3ed84f6 | ||
|
|
0210398466 | ||
|
|
2c08afa5dd | ||
|
|
6077da5824 | ||
|
|
c211f84be6 | ||
|
|
2a26b6c28b | ||
|
|
e4f0316ae0 | ||
|
|
aefef0d6cf | ||
|
|
fcd8e2011d | ||
|
|
7b5cdcbd17 | ||
|
|
566ac1b4a7 | ||
|
|
5ad0a449d6 | ||
|
|
50cce58e9a | ||
|
|
95c0638353 | ||
|
|
aca1717341 | ||
|
|
0d2c8934a5 | ||
|
|
ab8d9dc52f | ||
|
|
9138c575d8 | ||
|
|
d664514801 | ||
|
|
276f48df88 | ||
|
|
cd8b579166 | ||
|
|
34376418e2 | ||
|
|
327afc7c84 | ||
|
|
ba9ecd1910 | ||
|
|
4e83ea15f7 | ||
|
|
0a9f1c7d45 | ||
|
|
b15296ff31 | ||
|
|
04c12cb83d | ||
|
|
6e93d810ca | ||
|
|
eaea13f59f | ||
|
|
3cf084ecae | ||
|
|
f94705b204 | ||
|
|
32c96bd755 | ||
|
|
193d7c7054 | ||
|
|
f5d5ecdfaf | ||
|
|
7c7993487d | ||
|
|
f21ce5a3f7 | ||
|
|
ebe8ee4235 | ||
|
|
6e2d1146f2 | ||
|
|
4767105543 | ||
|
|
ed2e6384ed | ||
|
|
3cedc2dc0d | ||
|
|
b2ddc3f337 | ||
|
|
91e3ac9ab0 | ||
|
|
1bddda4d85 | ||
|
|
8c5b881de5 | ||
|
|
5cf61e933d | ||
|
|
aa08666d72 | ||
|
|
455671735e | ||
|
|
e9d8f881ce | ||
|
|
55ba27be34 | ||
|
|
c095d689c3 | ||
|
|
6e0f828781 | ||
|
|
d6b771c345 | ||
|
|
1e137b710b | ||
|
|
6d05403db4 | ||
|
|
73f2e47e51 | ||
|
|
8710fc41aa | ||
|
|
ae952af227 | ||
|
|
35ee866a32 | ||
|
|
520181ab91 | ||
|
|
18d9185cae | ||
|
|
841a773708 | ||
|
|
5f4236a0c2 | ||
|
|
765f22f0f4 | ||
|
|
fc3f467ff1 | ||
|
|
4d7bc38cdc | ||
|
|
a3af26dd7e | ||
|
|
4e26c69eb6 | ||
|
|
498e897c67 | ||
|
|
57bb17ca85 | ||
|
|
0be105dc42 | ||
|
|
c28adce59b | ||
|
|
7870f699e4 | ||
|
|
6fc0c02473 | ||
|
|
1a1a58269d | ||
|
|
fe6c2fdef2 | ||
|
|
927b425baa | ||
|
|
f6a6af9575 | ||
|
|
127bcae693 | ||
|
|
b947188419 | ||
|
|
b01df0368a | ||
|
|
d9735e9e3e | ||
|
|
8c86f0ef98 | ||
|
|
de35dd590c | ||
|
|
67a0dc4fa9 | ||
|
|
5a6755afcb | ||
|
|
3f0014152b | ||
|
|
e2a8c0f591 | ||
|
|
a7086c4f27 | ||
|
|
27622431dc | ||
|
|
6b7022680e | ||
|
|
d40ba6c272 | ||
|
|
bf8b3d9821 | ||
|
|
401aace63c | ||
|
|
d42cf84421 | ||
|
|
02d12d0de2 | ||
|
|
06f01bc496 | ||
|
|
f0064700f8 | ||
|
|
b66dfcd26f | ||
|
|
02650b7f0e | ||
|
|
68cae94e0b | ||
|
|
287c78f6ab | ||
|
|
c21493b89f | ||
|
|
b6e3facf99 | ||
|
|
b4068c7cf3 | ||
|
|
c66dfaddf4 | ||
|
|
ed94ef2ae4 | ||
|
|
51cbef6f63 | ||
|
|
d6ca7905ab | ||
|
|
2073ce56f5 | ||
|
|
ef1b70e009 | ||
|
|
cc14efa5bc | ||
|
|
db0dcbf315 | ||
|
|
e9ad4aeca5 | ||
|
|
02d7cce6e2 | ||
|
|
b7691f15bd | ||
|
|
ddee1b0666 | ||
|
|
12f4614d07 | ||
|
|
32c292920e | ||
|
|
de366a2f6b | ||
|
|
2781dbd121 | ||
|
|
bf70fa8729 | ||
|
|
05449a2c1b | ||
|
|
fd2493f7c4 | ||
|
|
4158e0a143 | ||
|
|
d659304d0a | ||
|
|
6ec2c0f295 | ||
|
|
7a0db73e6f | ||
|
|
2e4c30fa07 | ||
|
|
dd9010375b | ||
|
|
a2a3e98977 | ||
|
|
1b9c21fb18 | ||
|
|
8486615972 | ||
|
|
378f4bd846 | ||
|
|
f52b276c55 | ||
|
|
5466269793 | ||
|
|
9ae1f0c6a9 | ||
|
|
4d56beff96 | ||
|
|
073f92889f | ||
|
|
1221b78adb | ||
|
|
ff5150d9a4 | ||
|
|
e2a21b6f0c | ||
|
|
8f7e3cf9d0 | ||
|
|
0a96ba819f | ||
|
|
3953ed882a | ||
|
|
9ecafbbfe7 | ||
|
|
c4d497a010 | ||
|
|
a51d426a63 | ||
|
|
4517da3757 | ||
|
|
668c5d1927 | ||
|
|
e3233bf6b6 | ||
|
|
8f3596a633 | ||
|
|
f8e1c9e55b | ||
|
|
3b0ffc7ec1 | ||
|
|
721be13c5b | ||
|
|
a0af42fce6 | ||
|
|
affac6132a | ||
|
|
8bb4c753e2 | ||
|
|
9d9b8b7006 | ||
|
|
2c3b392a9a | ||
|
|
d6cff4dc6f | ||
|
|
a85284cfbd | ||
|
|
e14d0ab687 | ||
|
|
d508c2816f | ||
|
|
375234d9ff | ||
|
|
bf60087f69 | ||
|
|
90ddbd5eed | ||
|
|
69474954ac | ||
|
|
b09a18c50d | ||
|
|
3e7a2cd95f | ||
|
|
26546b4258 | ||
|
|
0eca5a39a7 | ||
|
|
72c4d3365a | ||
|
|
6c65b1525f | ||
|
|
2cec9080f6 | ||
|
|
7029f8927f | ||
|
|
877519f839 | ||
|
|
12ce2df60d | ||
|
|
f5228370c5 | ||
|
|
6ff9971122 | ||
|
|
69ce078b8c | ||
|
|
32b5b719e4 | ||
|
|
66809587a7 | ||
|
|
af3412cdea | ||
|
|
d9963c8597 | ||
|
|
035aa4a0bb | ||
|
|
d1ff7a7cc6 | ||
|
|
6de5398de3 | ||
|
|
a1373f559a | ||
|
|
3dc4aa8c36 | ||
|
|
613d8952e3 | ||
|
|
b2741627b1 | ||
|
|
422494834c | ||
|
|
5059b5c887 | ||
|
|
4626a15dd1 | ||
|
|
98ae96438e | ||
|
|
1989d9476c | ||
|
|
62b08cfcd7 | ||
|
|
0299809431 | ||
|
|
5210672f6b | ||
|
|
a8991a1da4 | ||
|
|
36b5e963e6 | ||
|
|
317fce927c | ||
|
|
44e7ead165 | ||
|
|
e10a80eeac | ||
|
|
067b32eef4 | ||
|
|
4b3673159e | ||
|
|
24cc23d96d | ||
|
|
d4476375cf | ||
|
|
302c0aeeba | ||
|
|
7625ec2c83 | ||
|
|
2ed284440f | ||
|
|
ba0fe3c710 | ||
|
|
9b8a5ce03b | ||
|
|
52d9d4112f | ||
|
|
4d7aa45e75 | ||
|
|
4f6e011e2e | ||
|
|
a1b3bf8c21 | ||
|
|
e764d4df76 | ||
|
|
2a4647a32f | ||
|
|
74e543d21f | ||
|
|
412e44aa0e | ||
|
|
2888e8b946 | ||
|
|
2f4f028d8b | ||
|
|
88c6637fa9 | ||
|
|
f8333ce5fd | ||
|
|
c59929c351 | ||
|
|
fb32e3730e | ||
|
|
2aee5b7e1e | ||
|
|
fb9c0b3360 | ||
|
|
edb8f44f06 | ||
|
|
b50d2359d7 | ||
|
|
21667f64cd | ||
|
|
2b81e969ea | ||
|
|
ad6a9b97e2 | ||
|
|
ec4d88f496 | ||
|
|
3d86656c1d | ||
|
|
3768a1ae18 | ||
|
|
fc695704a1 | ||
|
|
24dfa6ec84 | ||
|
|
6bebb37320 | ||
|
|
cd72b08b23 | ||
|
|
5215c87f14 | ||
|
|
fb9712a962 | ||
|
|
55f0c7b1f2 | ||
|
|
d4fb5e3cb9 | ||
|
|
8a6f72f3d7 | ||
|
|
ebc3737ebf | ||
|
|
58b90cc2d8 | ||
|
|
62c4328e00 | ||
|
|
2fc90989b7 | ||
|
|
0d50976f3c | ||
|
|
ac2434287d | ||
|
|
9069e5de23 | ||
|
|
552893661b | ||
|
|
a05b79dff9 | ||
|
|
ddc65ffdd1 | ||
|
|
3ab2ca2206 | ||
|
|
2abdfeefce | ||
|
|
a702593e05 | ||
|
|
b4c1f9d2b6 | ||
|
|
8a2800e787 | ||
|
|
a9739e7c4c | ||
|
|
c7e8607f6b | ||
|
|
f479c6c61e | ||
|
|
e2586f82b0 | ||
|
|
2e8cf949a5 | ||
|
|
c7fb0b9079 |
+9
-7
@@ -1,8 +1,12 @@
|
|||||||
|
*.cache
|
||||||
*.flc
|
*.flc
|
||||||
*.patch *.log log patches applied
|
|
||||||
*.prj
|
*.prj
|
||||||
|
*~
|
||||||
|
.tarball-version
|
||||||
|
.version
|
||||||
ABOUT-NLS
|
ABOUT-NLS
|
||||||
COPYING
|
COPYING
|
||||||
|
GNUmakefile
|
||||||
INSTALL
|
INSTALL
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
@@ -10,21 +14,19 @@ _*
|
|||||||
a.exe
|
a.exe
|
||||||
a.out
|
a.out
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
autom4te.cache
|
|
||||||
b.out
|
b.out
|
||||||
bison-*
|
bison-*
|
||||||
build-aux
|
|
||||||
conf[0-9]*
|
conf[0-9]*
|
||||||
confdefs*
|
confdefs*
|
||||||
config.cache
|
|
||||||
config.h
|
|
||||||
config.hin
|
|
||||||
config.log
|
config.log
|
||||||
config.status
|
config.status
|
||||||
configure
|
configure
|
||||||
configure.lineno
|
configure.lineno
|
||||||
conftest*
|
conftest*
|
||||||
intl
|
gnulib
|
||||||
|
javacomp.sh
|
||||||
|
javaexec.sh
|
||||||
|
maint.mk
|
||||||
patches
|
patches
|
||||||
releases
|
releases
|
||||||
stamp-h*
|
stamp-h*
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ChangeLog merge=merge-changelog
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
/*.cache
|
||||||
|
/*.flc
|
||||||
|
/*.prj
|
||||||
|
/*~
|
||||||
|
/.tarball-version
|
||||||
|
/.version
|
||||||
|
/ABOUT-NLS
|
||||||
|
/COPYING
|
||||||
|
/GNUmakefile
|
||||||
|
/INSTALL
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/_*
|
||||||
|
/a.exe
|
||||||
|
/a.out
|
||||||
|
/aclocal.m4
|
||||||
|
/b.out
|
||||||
|
/bison-*
|
||||||
|
/conf[0-9]*
|
||||||
|
/confdefs*
|
||||||
|
/config.log
|
||||||
|
/config.status
|
||||||
|
/configure
|
||||||
|
/configure.lineno
|
||||||
|
/conftest*
|
||||||
|
/gnulib
|
||||||
|
/javacomp.sh
|
||||||
|
/javaexec.sh
|
||||||
|
/maint.mk
|
||||||
|
/patches
|
||||||
|
/releases
|
||||||
|
/stamp-h*
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "gnulib"]
|
||||||
|
path = gnulib
|
||||||
|
url = git://git.savannah.gnu.org/gnulib.git
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
2.3b
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
data/glr.c
|
||||||
|
data/yacc.c
|
||||||
|
lib/yyerror.c
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
doc/bison.texinfo
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
COPYING
|
||||||
|
^doc/fdl\.texi$
|
||||||
|
^doc/gpl-3\.0\.texi$
|
||||||
|
^doc/yacc\.1\.in$
|
||||||
|
^src/parse-gram\.h$
|
||||||
|
^data/m4sugar/
|
||||||
@@ -1,285 +1,626 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
The GNU General Public License is a free, copyleft license for
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
software and other kinds of works.
|
||||||
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
|
The licenses for most software and other practical works are designed
|
||||||
General Public License applies to most of the Free Software
|
to take away your freedom to share and change the works. By contrast,
|
||||||
Foundation's software and to any other program whose authors commit to
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
share and change all versions of a program--to make sure it remains free
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
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.
|
your programs, too.
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
When we speak of free software, we are referring to freedom, not
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
have the freedom to distribute copies of free software (and charge for
|
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
|
them if you wish), that you receive source code or can get it if you
|
||||||
if you want it, that you can change the software or use pieces of it
|
want it, that you can change the software or use pieces of it in new
|
||||||
in new free programs; and that you know you can do these things.
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
To protect your rights, we need to prevent others from denying you
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
These restrictions translate to certain responsibilities for you if you
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
distribute copies of the software, or if you modify it.
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
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
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
you have. You must make sure that they, too, receive or can get the
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
source code. And you must show them these terms so they know their
|
or can get the source code. And you must show them these terms so they
|
||||||
rights.
|
know their rights.
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
distribute and/or modify the software.
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
that everyone understands that there is no warranty for this free
|
that there is no warranty for this free software. For both users' and
|
||||||
software. If the software is modified by someone else and passed on, we
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
want its recipients to know that what they have is not the original, so
|
changed, so that their problems will not be attributed erroneously to
|
||||||
that any problems introduced by others will not reflect on the original
|
authors of previous versions.
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
Some devices are designed to deny users access to install or run
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
modified versions of the software inside them, although the manufacturer
|
||||||
program will individually obtain patent licenses, in effect making the
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
protecting users' freedom to change the software. The systematic
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
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
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
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
|
TERMS AND CONDITIONS
|
||||||
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
|
0. Definitions.
|
||||||
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.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
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
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
of it, thus forming a work based on the Program, and copy and
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
distribute such modifications or work under the terms of Section 1
|
"recipients" may be individuals or organizations.
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
stating that you changed the files and the date of any change.
|
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
|
A "covered work" means either the unmodified Program or a work based
|
||||||
whole or in part contains or is derived from the Program or any
|
on the Program.
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
To "propagate" a work means to do anything with it that, without
|
||||||
when run, you must cause it, when started running for such
|
permission, would make you directly or secondarily liable for
|
||||||
interactive use in the most ordinary way, to print or display an
|
infringement under applicable copyright law, except executing it on a
|
||||||
announcement including an appropriate copyright notice and a
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
notice that there is no warranty (or else, saying that you provide
|
distribution (with or without modification), making available to the
|
||||||
a warranty) and that users may redistribute the program under
|
public, and in some countries other activities as well.
|
||||||
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.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
To "convey" a work means any kind of propagation that enables other
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
exercise the right to control the distribution of derivative or
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
collective works based on the Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
to the extent that it includes a convenient and prominently visible
|
||||||
a storage or distribution medium does not bring the other work under
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
the scope of this License.
|
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,
|
1. Source Code.
|
||||||
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:
|
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
The "source code" for a work means the preferred form of the work
|
||||||
source code, which must be distributed under the terms of Sections
|
for making modifications to it. "Object code" means any non-source
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
form of a work.
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
A "Standard Interface" means an interface that either is an official
|
||||||
years, to give any third party, for a charge no more than your
|
standard defined by a recognized standards body, or, in the case of
|
||||||
cost of physically performing source distribution, a complete
|
interfaces specified for a particular programming language, one that
|
||||||
machine-readable copy of the corresponding source code, to be
|
is widely used among developers working in that language.
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
The "System Libraries" of an executable work include anything, other
|
||||||
to distribute corresponding source code. (This alternative is
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
allowed only for noncommercial distribution and only if you
|
packaging a Major Component, but which is not part of that Major
|
||||||
received the program in object code or executable form with such
|
Component, and (b) serves only to enable use of the work with that
|
||||||
an offer, in accord with Subsection b above.)
|
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
|
The "Corresponding Source" for a work in object code form means all
|
||||||
making modifications to it. For an executable work, complete source
|
the source code needed to generate, install, and (for an executable
|
||||||
code means all the source code for all modules it contains, plus any
|
work) run the object code and to modify the work, including scripts to
|
||||||
associated interface definition files, plus the scripts used to
|
control those activities. However, it does not include the work's
|
||||||
control compilation and installation of the executable. However, as a
|
System Libraries, or general-purpose tools or generally available free
|
||||||
special exception, the source code distributed need not include
|
programs which are used unmodified in performing those activities but
|
||||||
anything that is normally distributed (in either source or binary
|
which are not part of the work. For example, Corresponding Source
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
includes interface definition files associated with source files for
|
||||||
operating system on which the executable runs, unless that component
|
the work, and the source code for shared libraries and dynamically
|
||||||
itself accompanies the executable.
|
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
|
The Corresponding Source need not include anything that users
|
||||||
access to copy from a designated place, then offering equivalent
|
can regenerate automatically from other parts of the Corresponding
|
||||||
access to copy the source code from the same place counts as
|
Source.
|
||||||
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.
|
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
The Corresponding Source for a work in source code form is that
|
||||||
signed it. However, nothing else grants you permission to modify or
|
same work.
|
||||||
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.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
2. Basic Permissions.
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
All rights granted under this License are granted for the term of
|
||||||
these terms and conditions. You may not impose any further
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
You are not responsible for enforcing compliance by third parties to
|
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.
|
this License.
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
infringement or for any other reason (not limited to patent issues),
|
patent license under the contributor's essential patent claims, to
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
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
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
excuse you from the conditions of this License. If you cannot
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
License and any other pertinent obligations, then as a consequence you
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
may not distribute the Program at all. For example, if a patent
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
license would not permit royalty-free redistribution of the Program by
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
all those who receive copies directly or indirectly through you, then
|
the Program, the only way you could satisfy both those terms and this
|
||||||
the only way you could satisfy both it and this License would be to
|
License would be to refrain entirely from conveying the Program.
|
||||||
refrain entirely from distribution of the Program.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
13. Use with the GNU Affero General Public License.
|
||||||
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
|
Notwithstanding any other provision of this License, you have
|
||||||
patents or other property right claims or to contest validity of any
|
permission to link or combine any covered work with a work licensed
|
||||||
such claims; this section has the sole purpose of protecting the
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
integrity of the free software distribution system, which is
|
combined work, and to convey the resulting work. The terms of this
|
||||||
implemented by public license practices. Many people have made
|
License will continue to apply to the part which is the covered work,
|
||||||
generous contributions to the wide range of software distributed
|
but the special requirements of the GNU Affero General Public License,
|
||||||
through that system in reliance on consistent application of that
|
section 13, concerning interaction through a network will apply to the
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
combination as such.
|
||||||
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
|
14. Revised Versions of this License.
|
||||||
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.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
of the General Public License from time to time. Such new versions will
|
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
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
address new problems or concerns.
|
address new problems or concerns.
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
Each version is given a distinguishing version number. If the
|
||||||
specifies a version number of this License which applies to it and "any
|
Program specifies that a certain numbered version of the GNU General
|
||||||
later version", you have the option of following the terms and conditions
|
Public License "or any later version" applies to it, you have the
|
||||||
either of that version or of any later version published by the Free
|
option of following the terms and conditions either of that numbered
|
||||||
Software Foundation. If the Program does not specify a version number of
|
version or of any later version published by the Free Software
|
||||||
this License, you may choose any version ever published by the Free Software
|
Foundation. If the Program does not specify a version number of the
|
||||||
Foundation.
|
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
|
If the Program specifies that a proxy can decide which future
|
||||||
programs whose distribution conditions are different, write to the author
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
public statement of acceptance of a version permanently authorizes you
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
to choose that version for the Program.
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
15. Disclaimer of 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.
|
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
16. Limitation of Liability.
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
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
|
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
|
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 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
|
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.
|
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.>
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
Copyright (C) <year> <name of author>
|
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
|
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.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
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.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
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
|
If the program does terminal interaction, make it output a short
|
||||||
when it starts in an interactive mode:
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) year name of author
|
<program> Copyright (C) <year> <name of author>
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
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
|
parts of the General Public License. Of course, your program's commands
|
||||||
be called something other than `show w' and `show c'; they could even be
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
necessary. Here is a sample; alter the names:
|
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
|
The GNU General Public License does not permit incorporating your program
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
<signature of Ty Coon>, 1 April 1989
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
Ty Coon, President of Vice
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
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.
|
|
||||||
|
|||||||
-58
@@ -1,58 +0,0 @@
|
|||||||
# Having a separate GNUmakefile lets me `include' the dynamically
|
|
||||||
# generated rules created via Makefile.maint as well as Makefile.maint itself.
|
|
||||||
# This makefile is used only if you run GNU Make.
|
|
||||||
# It is necessary if you want to build targets usually of interest
|
|
||||||
# only to the maintainer.
|
|
||||||
|
|
||||||
# Copyright (C) 2001, 2003 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.
|
|
||||||
|
|
||||||
# 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.
|
|
||||||
ifeq ($(wildcard /bin/s[h]),/bin/sh)
|
|
||||||
SHELL = /bin/sh
|
|
||||||
else
|
|
||||||
# will be used only with the next shell-test line, then overwritten
|
|
||||||
# by a configured-in value
|
|
||||||
SHELL = sh
|
|
||||||
endif
|
|
||||||
|
|
||||||
have-Makefile := $(shell test -f Makefile && echo yes)
|
|
||||||
|
|
||||||
# If the user runs GNU make but has not yet run ./configure,
|
|
||||||
# give them a diagnostic.
|
|
||||||
ifeq ($(have-Makefile),yes)
|
|
||||||
|
|
||||||
# Make tar archive easier to reproduce.
|
|
||||||
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
|
|
||||||
|
|
||||||
include Makefile
|
|
||||||
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'."
|
|
||||||
@exit 1
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Tell version 3.79 and up of GNU make to not build goals in this
|
|
||||||
# directory in parallel. This is necessary in case someone tries to
|
|
||||||
# build multiple targets on one command line.
|
|
||||||
.NOTPARALLEL:
|
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
-*- outline -*-
|
-*- outline -*-
|
||||||
|
|
||||||
This file attempts to describe the rules to use when hacking Bison.
|
This file attempts to describe the rules to use when hacking Bison.
|
||||||
Don't put this file into the distribution. Don't mention it in the
|
Don't put this file into the distribution.
|
||||||
ChangeLog.
|
|
||||||
|
|
||||||
Everything related to the development of Bison is on Savannah:
|
Everything related to the development of Bison is on Savannah:
|
||||||
|
|
||||||
http://savannah.gnu.org/projects/bison/
|
http://savannah.gnu.org/projects/bison/
|
||||||
|
|
||||||
|
|
||||||
* Administrivia
|
* Administrivia
|
||||||
@@ -26,6 +25,15 @@ The correct response to most actual bugs is to write a new test case
|
|||||||
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
||||||
and check everything in.
|
and check everything in.
|
||||||
|
|
||||||
|
** You may find it useful to install the git-merge-changelog merge driver:
|
||||||
|
|
||||||
|
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/git-merge-changelog.c
|
||||||
|
|
||||||
|
When following the generic installation instructions there, keep in mind that
|
||||||
|
your clone of Bison's git repository already contains appropriate
|
||||||
|
.gitattributes files, and running Bison's bootstrap script will make the
|
||||||
|
necessary changes to .git/config.
|
||||||
|
|
||||||
|
|
||||||
* Hacking
|
* Hacking
|
||||||
|
|
||||||
@@ -39,6 +47,118 @@ of the .output file etc. This excludes impossible error messages
|
|||||||
meant for the maintainers only.
|
meant for the maintainers only.
|
||||||
|
|
||||||
|
|
||||||
|
* Working from the repository
|
||||||
|
|
||||||
|
These notes intend to help people working on the checked-out sources.
|
||||||
|
These requirements do not apply when building from a distribution tarball.
|
||||||
|
|
||||||
|
** Requirements
|
||||||
|
|
||||||
|
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/>
|
||||||
|
|
||||||
|
Valgrind <http://valgrind.org/> is also highly recommended, if
|
||||||
|
Valgrind supports your architecture.
|
||||||
|
|
||||||
|
Bison is written using Bison grammars, so there are bootstrapping
|
||||||
|
issues. The bootstrap script attempts to discover when the C code
|
||||||
|
generated from the grammars is out of date, and to bootstrap with an
|
||||||
|
out-of-date version of the 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, after synchronizing from the repository a plain `make' should
|
||||||
|
be sufficient.
|
||||||
|
|
||||||
|
** First checkout
|
||||||
|
|
||||||
|
Obviously, if you are reading these notes, you did manage to check out
|
||||||
|
this package from the repository. For the record, you will find all the
|
||||||
|
relevant information on:
|
||||||
|
|
||||||
|
http://savannah.gnu.org/git/?group=bison
|
||||||
|
|
||||||
|
Bison uses Git submodules: subscriptions to other Git repositories.
|
||||||
|
In particular it uses gnulib, the GNU portability library. To ask Git
|
||||||
|
to perform the first checkout of the submodules, run
|
||||||
|
|
||||||
|
$ git submodule update --init
|
||||||
|
|
||||||
|
Git submodule support is weak before versions 1.6 and later, you
|
||||||
|
should probably upgrade Git if your version is older.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
At this point, there should be no difference between your local copy,
|
||||||
|
and the master copy:
|
||||||
|
|
||||||
|
$ git diff
|
||||||
|
|
||||||
|
should output no difference.
|
||||||
|
|
||||||
|
Enjoy!
|
||||||
|
|
||||||
|
** Updating
|
||||||
|
|
||||||
|
The use of submodules make things somewhat different because git does
|
||||||
|
not support recursive operations: submodules must be taken care of
|
||||||
|
explicitly by the user.
|
||||||
|
|
||||||
|
*** Updating Bison
|
||||||
|
|
||||||
|
If you pull a newer version of a branch, say via `git pull', you might
|
||||||
|
import requests for updated submodules. A simple `git diff' will
|
||||||
|
reveal if the current version of the submodule (i.e., the actual
|
||||||
|
contents of the gnulib directory) and the current request from the
|
||||||
|
subscriber (i.e., the reference of the version of gnulib that the
|
||||||
|
Bison reporitory requests) differ. To upgrade the submodules (i.e.,
|
||||||
|
to check out the version that is actually requested by the subscriber,
|
||||||
|
run `git submodule update'.
|
||||||
|
|
||||||
|
$ git pull
|
||||||
|
$ git submodule update
|
||||||
|
|
||||||
|
*** Updating a submodule
|
||||||
|
To update a submodule, say gnulib, do as follows:
|
||||||
|
|
||||||
|
Get the most recent version of the master branch from git.
|
||||||
|
|
||||||
|
$ cd gnulib
|
||||||
|
$ git fetch
|
||||||
|
$ git checkout -b master --track origin/master
|
||||||
|
|
||||||
|
Make sure Bison can live with that version of gnulib.
|
||||||
|
|
||||||
|
$ cd ..
|
||||||
|
$ ./bootstrap
|
||||||
|
$ make distcheck
|
||||||
|
|
||||||
|
Register your changes.
|
||||||
|
|
||||||
|
$ git checkin ...
|
||||||
|
|
||||||
|
|
||||||
* Test suite
|
* Test suite
|
||||||
|
|
||||||
** make check
|
** make check
|
||||||
@@ -57,15 +177,32 @@ release:
|
|||||||
- runs the parsers under Valgrind.
|
- runs the parsers under Valgrind.
|
||||||
- runs the test suite with G++ as C compiler...
|
- runs the test suite with G++ as C compiler...
|
||||||
|
|
||||||
|
- run `make maintainer-push-check', which runs `make maintainer-check'
|
||||||
|
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
|
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
||||||
instance, `-traditional' to check that the parsers are K&R. Note
|
instance, `-traditional' to check that the parsers are K&R. Note
|
||||||
that it does not make sense for glr.c, which should be ANSI,
|
that it does not make sense for glr.c, which should be ANSI,
|
||||||
but currently is actually GNU C, nor for lalr1.cc, which anyway is
|
but currently is actually GNU C, nor for lalr1.cc.
|
||||||
not exercised yet in the test suite.
|
|
||||||
|
|
||||||
|
|
||||||
* Release Procedure
|
* Release Procedure
|
||||||
|
|
||||||
|
** Try to get the *.pot files to the Translation Project at least one
|
||||||
|
week before a stable release, to give them time to translate them.
|
||||||
|
Before generating the *.pot files, make sure that po/POTFILES.in and
|
||||||
|
runtime-po/POTFILES.in list all files with translatable strings.
|
||||||
|
This helps: grep -l '\<_(' *
|
||||||
|
|
||||||
** Tests
|
** Tests
|
||||||
See above.
|
See above.
|
||||||
|
|
||||||
@@ -75,15 +212,44 @@ This covers PO files too. Sometimes a PO file contains problems that
|
|||||||
causes it to be rejected by recent Gettext releases; please report
|
causes it to be rejected by recent Gettext releases; please report
|
||||||
these to the Translation Project.
|
these to the Translation Project.
|
||||||
|
|
||||||
|
** Update README
|
||||||
|
Make sure the information in README is current. Most notably, make sure
|
||||||
|
it recommends a version of GNU M4 that is compatible with the latest
|
||||||
|
Bison sources.
|
||||||
|
|
||||||
|
** Check copyright years.
|
||||||
|
We update years in copyright statements throughout Bison once at the
|
||||||
|
start of every year by running `make update-copyright'. However, before
|
||||||
|
a release, it's good to verify that it's actually been run. Besides the
|
||||||
|
copyright statement for each Bison file, check the copyright statements
|
||||||
|
that the skeletons insert into generated parsers, and check all
|
||||||
|
occurrences of PACKAGE_COPYRIGHT_YEAR in configure.ac.
|
||||||
|
|
||||||
** Update NEWS
|
** Update NEWS
|
||||||
The version number, *and* the date of the release (including for
|
The version number, *and* the date of the release (including for
|
||||||
betas).
|
betas).
|
||||||
|
|
||||||
** Update ChangeLog
|
** Update ChangeLog
|
||||||
Should have an entry similar to `Version 1.49b.'.
|
Should have an entry similar to `Version 1.49b.'.
|
||||||
Check all this in once `make distcheck' passes.
|
|
||||||
|
** Tag the release
|
||||||
|
Before Bison will build with the right version number, you must tag the release
|
||||||
|
in git. Do this after all other changes. The command is similar to:
|
||||||
|
|
||||||
|
git tag -a v2.3b
|
||||||
|
|
||||||
|
The log message can be simply:
|
||||||
|
|
||||||
|
Bison 2.3b
|
||||||
|
|
||||||
|
** Push
|
||||||
|
Once `make distcheck' passes, push your changes and the tag.
|
||||||
|
`git push' without arguments will not push the tag.
|
||||||
|
|
||||||
** make alpha
|
** make alpha
|
||||||
|
FIXME: `make alpha' is not maintained and is broken. These
|
||||||
|
instructions need to be replaced or removed.
|
||||||
|
|
||||||
Running `make alpha' is absolutely perfect for beta releases: it makes
|
Running `make alpha' is absolutely perfect for beta releases: it makes
|
||||||
the tarballs, the xdeltas, and prepares (in /tmp/) a proto
|
the tarballs, the xdeltas, and prepares (in /tmp/) a proto
|
||||||
announcement. It is so neat, that that's what I use anyway for
|
announcement. It is so neat, that that's what I use anyway for
|
||||||
@@ -95,41 +261,120 @@ If it fails, you're on your own...
|
|||||||
It requires GNU Make.
|
It requires GNU Make.
|
||||||
|
|
||||||
** Upload
|
** Upload
|
||||||
Put the tarballs/xdeltas where they should be. Or put it somewhere,
|
The generic GNU upload procedure is at:
|
||||||
and send the URL to [email protected].
|
|
||||||
|
|
||||||
** Bump the version number
|
http://www.gnu.org/prep/maintain/maintain.html#Automated-FTP-Uploads
|
||||||
In configure.ac. Run `make', check this in.
|
|
||||||
|
Follow the instructions there to register your information so you're permitted
|
||||||
|
to upload. Make sure your public key has been uploaded at least to
|
||||||
|
keys.gnupg.net. You can upload it with:
|
||||||
|
|
||||||
|
gpg --keyserver keys.gnupg.net --send-keys F125BDF3
|
||||||
|
|
||||||
|
where F125BDF3 should be replaced with your key ID.
|
||||||
|
|
||||||
|
Here's a brief reminder of how to roll the tarballs and upload them:
|
||||||
|
|
||||||
|
*** make distcheck
|
||||||
|
*** gpg -b bison-2.3b.tar.gz
|
||||||
|
*** In a file named `bison-2.3b.tar.gz.directive', type:
|
||||||
|
|
||||||
|
version: 1.1
|
||||||
|
directory: bison
|
||||||
|
filename: bison-2.3b.tar.gz
|
||||||
|
|
||||||
|
*** gpg --clearsign bison-2.3b.tar.gz.directive
|
||||||
|
*** ftp ftp-upload.gnu.org # Log in as anonymous.
|
||||||
|
*** cd /incoming/alpha # cd /incoming/ftp for full release.
|
||||||
|
*** put bison-2.3b.tar.gz # This can take a while.
|
||||||
|
*** put bison-2.3b.tar.gz.sig
|
||||||
|
*** put bison-2.3b.tar.gz.directive.asc
|
||||||
|
*** Repeat all these steps for bison-2.3b.tar.bz2.
|
||||||
|
|
||||||
|
** Update Bison manual on www.gnu.org.
|
||||||
|
|
||||||
|
*** You need a non-anonymous checkout of the web pages directory.
|
||||||
|
|
||||||
|
$ cvs -d [email protected]:/web/bison checkout bison
|
||||||
|
|
||||||
|
*** Get familiar with the instructions for web page maintainers.
|
||||||
|
http://www.gnu.org/server/standards/readme_index.html
|
||||||
|
http://www.gnu.org/server/standards/README.software.html
|
||||||
|
especially the note about symlinks.
|
||||||
|
|
||||||
|
*** Build the web pages.
|
||||||
|
Assuming BISON_CHECKOUT refers to a checkout of the Bison dir, and
|
||||||
|
BISON_WWW_CHECKOUT refers to the web directory created above, do:
|
||||||
|
|
||||||
|
$ cd $BISON_CHECKOUT/doc
|
||||||
|
$ make stamp-vti
|
||||||
|
$ ../build-aux/gendocs.sh -o "$BISON_WWW_CHECKOUT/manual" \
|
||||||
|
bison "Bison - GNU parser generator"
|
||||||
|
$ cd $BISON_WWW_CHECKOUT
|
||||||
|
|
||||||
|
Verify that the result looks sane.
|
||||||
|
|
||||||
|
*** Commit the modified and the new files.
|
||||||
|
|
||||||
|
*** Remove old files.
|
||||||
|
Find the files which have not been overwritten (because they belonged to
|
||||||
|
sections that have been removed or renamed):
|
||||||
|
|
||||||
|
$ cd manual/html_node
|
||||||
|
$ ls -lt
|
||||||
|
|
||||||
|
Remove these files and commit their removal to CVS. For each of these
|
||||||
|
files, add a line to the file .symlinks. This will ensure that
|
||||||
|
hyperlinks to the removed files will redirect to the entire manual; this
|
||||||
|
is better than a 404 error.
|
||||||
|
|
||||||
|
There is a problem with 'index.html' being written twice (once for POSIX
|
||||||
|
function 'index', once for the table of contents); you can ignore this
|
||||||
|
issue.
|
||||||
|
|
||||||
** Announce
|
** Announce
|
||||||
|
To generate a template announcement file:
|
||||||
|
|
||||||
|
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
|
||||||
|
|
||||||
|
where alpha can be replaced by beta or major and F125BDF3 should be replaced
|
||||||
|
with your key ID. For an example of how to fill out the template, search the
|
||||||
|
mailing list archives for the most recent release announcement.
|
||||||
|
|
||||||
Complete/fix the announcement file, and send it at least to
|
Complete/fix the announcement file, and send it at least to
|
||||||
[email protected] (if a real release, or a ``serious beta''),
|
[email protected] (if a real release, or a ``serious beta''),
|
||||||
[email protected], [email protected], [email protected],
|
[email protected], [email protected], [email protected],
|
||||||
and [email protected].
|
and [email protected].
|
||||||
|
|
||||||
Send the same announcement on the comp.compilers newsgroup by sending
|
Send the same announcement on the comp.compilers newsgroup by sending
|
||||||
email to [email protected]. Do not make any Cc as the moderator will
|
email to [email protected]. Do not make any Cc as the moderator will
|
||||||
throw away anything cross-posted or Cc'ed. It really needs to be a
|
throw away anything cross-posted or Cc'ed. It really needs to be a
|
||||||
separate message.
|
separate message.
|
||||||
|
|
||||||
|
** Bump the version number
|
||||||
|
In configure.ac. Run `make'. So that developers don't accidentally add new
|
||||||
|
items to the old NEWS entry, create a new empty NEWS entry something like:
|
||||||
|
|
||||||
|
Changes in version ?.? (????-??-??):
|
||||||
|
|
||||||
|
Push these changes.
|
||||||
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002-2005, 2007-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GNU Bison; see the file COPYING. If not, write to the Free
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
02110-1301, USA.
|
|
||||||
|
|||||||
+53
-18
@@ -1,32 +1,67 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
## Copyright (C) 2001-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
## This program 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
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
## You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
## along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
SUBDIRS = config 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.
|
# Files installed for use by Automake.
|
||||||
aclocaldir = @aclocaldir@
|
aclocaldir = @aclocaldir@
|
||||||
aclocal_DATA = m4/bison-i18n.m4
|
aclocal_DATA = m4/bison-i18n.m4
|
||||||
|
|
||||||
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
|
EXTRA_DIST = .prev-version .version cfg.mk \
|
||||||
OChangeLog PACKAGING
|
OChangeLog PACKAGING \
|
||||||
|
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/testsuite.sed
|
||||||
|
|
||||||
|
|
||||||
.PHONY: maintainer-check
|
.PHONY: maintainer-check
|
||||||
maintainer-check:
|
maintainer-check:
|
||||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
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) $@
|
||||||
|
|
||||||
|
# See comments in build-aux/git-version-gen. However, we make .version depend
|
||||||
|
# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the
|
||||||
|
# working copy (for example, when you run autoreconf && make). Allowing these
|
||||||
|
# to fall out of sync appears to have little potential to improve Bison build
|
||||||
|
# efficiency (even if we were to replace VERSION/PACKAGE_VERSION with .version
|
||||||
|
# everywhere possible). On the other hand, it could be harmful. For example,
|
||||||
|
# a developer might naively reference .version in a test case while the bison
|
||||||
|
# executable still compiles with VERSION, and so the test case might fail or
|
||||||
|
# pass incorrectly.
|
||||||
|
BUILT_SOURCES = $(top_srcdir)/.version
|
||||||
|
$(top_srcdir)/.version: configure
|
||||||
|
echo $(VERSION) > $@-t && mv $@-t $@
|
||||||
|
dist-hook:
|
||||||
|
echo $(VERSION) > $(distdir)/.tarball-version
|
||||||
|
|
||||||
|
.PHONY: update-b4-copyright update-package-copyright-year
|
||||||
|
update-b4-copyright:
|
||||||
|
find data -type f \
|
||||||
|
| grep -v -E '^data/bison.m4$$' \
|
||||||
|
| xargs $(build_aux)/$@
|
||||||
|
@echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
|
||||||
|
update-package-copyright-year:
|
||||||
|
$(build_aux)/$@ configure.ac
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
# Customize Makefile.maint for Bison. -*- makefile -*-
|
|
||||||
# Copyright (C) 2003 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.
|
|
||||||
|
|
||||||
prev_version_file = $(srcdir)/config/prev-version.txt
|
|
||||||
announce_gen = $(srcdir)/config/announce-gen
|
|
||||||
release_archive_dir = releases
|
|
||||||
|
|
||||||
# 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_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
|
|
||||||
|
|
||||||
url_dir_list = \
|
|
||||||
ftp://$(gnu_rel_host).gnu.org/gnu/bison
|
|
||||||
|
|
||||||
# Files to update automatically.
|
|
||||||
wget_files = \
|
|
||||||
$(srcdir)/config/config.guess \
|
|
||||||
$(srcdir)/config/config.sub \
|
|
||||||
$(srcdir)/config/texinfo.tex \
|
|
||||||
|
|
||||||
cvs_files = \
|
|
||||||
$(srcdir)/config/install-sh \
|
|
||||||
$(srcdir)/config/mdate-sh \
|
|
||||||
$(srcdir)/config/missing \
|
|
||||||
$(srcdir)/config/mkinstalldirs
|
|
||||||
|
|
||||||
# Tests not to run.
|
|
||||||
# local-checks-to-skip ?= \
|
|
||||||
# author_mark_check \
|
|
||||||
# strftime-check syntax-check makefile_path_separator_check \
|
|
||||||
# makefile-check
|
|
||||||
-599
@@ -1,599 +0,0 @@
|
|||||||
# -*-Makefile-*-
|
|
||||||
# This Makefile fragment is shared between the coreutils,
|
|
||||||
# CPPI, Bison, and Autoconf.
|
|
||||||
|
|
||||||
## Copyright (C) 2001, 2002, 2003, 2004, 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, 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 is reported not to work with make-3.79.1
|
|
||||||
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
|
||||||
ME := Makefile.maint
|
|
||||||
|
|
||||||
# Do not save the original name or timestamp in the .tar.gz file.
|
|
||||||
# Use --rsyncable if available.
|
|
||||||
GZIP_ENV = \
|
|
||||||
"--no-name --best$$( \
|
|
||||||
case $$(gzip --help) in \
|
|
||||||
(*--rsyncable*) echo ' --rsyncable';; \
|
|
||||||
esac \
|
|
||||||
)"
|
|
||||||
|
|
||||||
CVS = cvs
|
|
||||||
|
|
||||||
CVS_LIST = sh -c ' \
|
|
||||||
(cvsu --find --types=AFGM $$*) 2>/dev/null || \
|
|
||||||
awk -F/ '\''{ \
|
|
||||||
if (!$$1 && $$3 !~ /^-/) { \
|
|
||||||
f=FILENAME; \
|
|
||||||
sub(/CVS\/Entries/, "", f); \
|
|
||||||
print f $$2; \
|
|
||||||
}}'\'' \
|
|
||||||
$$(find $${*-*} -name Entries -print) /dev/null \
|
|
||||||
' dummy
|
|
||||||
|
|
||||||
CVS_LIST_EXCEPT = \
|
|
||||||
$(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
|
|
||||||
|
|
||||||
ifeq ($(origin prev_version_file), undefined)
|
|
||||||
prev_version_file = .prev-version
|
|
||||||
endif
|
|
||||||
|
|
||||||
PREV_VERSION := $(shell cat $(prev_version_file))
|
|
||||||
|
|
||||||
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
|
||||||
tag-this-version = $(subst .,_,$(VERSION))
|
|
||||||
this-cvs-tag = $(tag-package)-$(tag-this-version)
|
|
||||||
my_distdir = $(PACKAGE)-$(VERSION)
|
|
||||||
|
|
||||||
# Old releases are stored here.
|
|
||||||
# Used for diffs and xdeltas.
|
|
||||||
release_archive_dir ?= ../release
|
|
||||||
|
|
||||||
# Prevent programs like 'sort' from considering distinct strings to be equal.
|
|
||||||
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
|
|
||||||
export LC_ALL = C
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## --------------- ##
|
|
||||||
## Sanity checks. ##
|
|
||||||
## --------------- ##
|
|
||||||
|
|
||||||
# Checks that don't require cvs.
|
|
||||||
# Run `changelog-check' last, as previous test may reveal problems requiring
|
|
||||||
# new ChangeLog entries.
|
|
||||||
local-checks-available = \
|
|
||||||
po-check copyright-check writable-files m4-check author_mark_check \
|
|
||||||
changelog-check strftime-check syntax-check makefile_path_separator_check \
|
|
||||||
makefile-check
|
|
||||||
.PHONY: $(local-checks-available)
|
|
||||||
|
|
||||||
local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
|
||||||
|
|
||||||
.PHONY: $(syntax-check-rules)
|
|
||||||
syntax-check-rules = \
|
|
||||||
sc_cast_of_argument_to_free \
|
|
||||||
sc_cast_of_x_alloc_return_value \
|
|
||||||
sc_cast_of_alloca_return_value \
|
|
||||||
sc_changelog \
|
|
||||||
sc_dd_max_sym_length \
|
|
||||||
sc_error_exit_success \
|
|
||||||
sc_file_system \
|
|
||||||
sc_obsolete_symbols \
|
|
||||||
sc_prohibit_atoi_atof \
|
|
||||||
sc_prohibit_jm_in_m4 \
|
|
||||||
sc_root_tests \
|
|
||||||
sc_space_tab \
|
|
||||||
sc_sun_os_names \
|
|
||||||
sc_system_h_headers \
|
|
||||||
sc_tight_scope \
|
|
||||||
sc_trailing_space \
|
|
||||||
sc_unmarked_diagnostics
|
|
||||||
|
|
||||||
syntax-check: $(syntax-check-rules)
|
|
||||||
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
|
|
||||||
# $$(find -type f -name '*.[chly]') && \
|
|
||||||
# { echo '$(ME): found conditional include' 1>&2; \
|
|
||||||
# exit 1; } || :
|
|
||||||
|
|
||||||
# grep -nE '^# *include <(string|stdlib)\.h>' \
|
|
||||||
# $(srcdir)/{lib,src}/*.[chy] && \
|
|
||||||
# { echo '$(ME): FIXME' 1>&2; \
|
|
||||||
# exit 1; } || :
|
|
||||||
# FIXME: don't allow `#include .strings\.h' anywhere
|
|
||||||
|
|
||||||
sc_cast_of_argument_to_free:
|
|
||||||
@grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
|
|
||||||
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_cast_of_x_alloc_return_value:
|
|
||||||
@grep -nE --exclude=$(srcdir)/lib/regex.c \
|
|
||||||
'\*\) *x(m|c|re)alloc\>' \
|
|
||||||
$(srcdir)/{lib,src}/*.[chy] && \
|
|
||||||
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_cast_of_alloca_return_value:
|
|
||||||
@grep -nE '\*\) *alloca\>' \
|
|
||||||
$(srcdir)/src/*.[chy] && \
|
|
||||||
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_space_tab:
|
|
||||||
@grep -n '[ ] ' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Don't use the old ato* functions in `real' code.
|
|
||||||
# They provide no error checking mechanism.
|
|
||||||
# Instead, use strto* functions.
|
|
||||||
sc_prohibit_atoi_atof:
|
|
||||||
@grep -nE '\<(ato[filq]|ato''ll)\>' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
|
||||||
# since when that parameter is 0, error does not exit. Use `0' instead.
|
|
||||||
sc_error_exit_success:
|
|
||||||
@grep -nF 'error (EXIT_SUCCESS,' \
|
|
||||||
$$(find -type f -name '*.[chly]') && \
|
|
||||||
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_file_system:
|
|
||||||
@grep -ni 'file''system' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found use of "file''system";' \
|
|
||||||
'rewrite to use "file system"' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_obsolete_symbols:
|
|
||||||
@grep -nE '\<(HAVE_''FCNTL_H)\>' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): do not use HAVE_''FCNTL_H' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
|
||||||
|
|
||||||
# Each nonempty line must start with a year number, or a TAB.
|
|
||||||
sc_changelog:
|
|
||||||
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
|
|
||||||
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
|
||||||
# with the strings from the two affected variables.
|
|
||||||
dd_c = $(srcdir)/src/dd.c
|
|
||||||
sc_dd_max_sym_length:
|
|
||||||
ifneq ($(wildcard $(dd_c)),)
|
|
||||||
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
|
||||||
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
|
||||||
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
|
||||||
| wc --max-line-length); \
|
|
||||||
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
|
||||||
|tr -d '"' | wc --max-line-length); \
|
|
||||||
if test "$$len" = "$$max"; then :; else \
|
|
||||||
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Many m4 macros names once began with `jm_'.
|
|
||||||
# On 2004-04-13, they were all changed to start with gl_ instead.
|
|
||||||
# Make sure that none are inadvertently reintroduced.
|
|
||||||
sc_prohibit_jm_in_m4:
|
|
||||||
@grep -nE 'jm_[A-Z]' \
|
|
||||||
$$($(CVS_LIST) $(srcdir)/m4 |grep '\.m4$$') && \
|
|
||||||
{ echo '$(ME): do not use jm_ in m4 macro names' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
sc_root_tests:
|
|
||||||
@t1=sc-root.expected; t2=sc-root.actual; \
|
|
||||||
grep -nl '^PRIV_CHECK_ARG=require-root' \
|
|
||||||
$$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \
|
|
||||||
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
|
|
||||||
$(srcdir)/tests/Makefile.am |sort > $$t2; \
|
|
||||||
diff -u $$t1 $$t2 || diff=1; \
|
|
||||||
rm -f $$t1 $$t2; \
|
|
||||||
test "$$diff" \
|
|
||||||
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Create a list of regular expressions matching the names
|
|
||||||
# of files included from system.h. Exclude a couple.
|
|
||||||
.re-list:
|
|
||||||
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
|
|
||||||
| grep -Ev 'sys/(param|file)\.h' \
|
|
||||||
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
|
|
||||||
> $@-t
|
|
||||||
@mv $@-t $@
|
|
||||||
|
|
||||||
# Files in src/ should not include directly any of
|
|
||||||
# the headers already included via system.h.
|
|
||||||
sc_system_h_headers: .re-list
|
|
||||||
if test -f $(srcdir)/src/system.h; then \
|
|
||||||
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
|
|
||||||
grep -nE -f .re-list \
|
|
||||||
$$($(CVS_LIST) src | \
|
|
||||||
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
|
|
||||||
&& { echo '$(ME): the above are already included via system.h'\
|
|
||||||
1>&2; exit 1; } || :; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
sc_sun_os_names:
|
|
||||||
@grep -nEi \
|
|
||||||
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_tight_scope:
|
|
||||||
$(MAKE) -C src $@
|
|
||||||
|
|
||||||
sc_trailing_space:
|
|
||||||
@grep -n '[ ]$$' \
|
|
||||||
$$($(CVS_LIST_EXCEPT)) && \
|
|
||||||
{ echo '$(ME): found trailing space(s)' \
|
|
||||||
1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Look for diagnostics that aren't marked for translation.
|
|
||||||
# This won't find any for which error's format string is on a separate line.
|
|
||||||
sc_unmarked_diagnostics:
|
|
||||||
@grep -nE \
|
|
||||||
'\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c \
|
|
||||||
| grep -v '_(' && \
|
|
||||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Ensure that date's --help output stays in sync with the info
|
|
||||||
# documentation for GNU strftime. The only exception is %N,
|
|
||||||
# which date accepts but GNU strftime does not.
|
|
||||||
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
|
|
||||||
strftime-check:
|
|
||||||
if test -f $(srcdir)/src/date.c; then \
|
|
||||||
grep '^ %. ' $(srcdir)/src/date.c | sort \
|
|
||||||
| $(extract_char) > $@-src; \
|
|
||||||
{ echo N; \
|
|
||||||
info libc date calendar format | grep '^ `%.'\' \
|
|
||||||
| $(extract_char); } | sort > $@-info; \
|
|
||||||
diff -u $@-src $@-info || exit 1; \
|
|
||||||
rm -f $@-src $@-info; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure that we use only the standard $(VAR) notation,
|
|
||||||
# not @...@ in Makefile.am, now that we can rely on automake
|
|
||||||
# to emit a definition for each substituted variable.
|
|
||||||
makefile-check:
|
|
||||||
grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
|
|
||||||
&& { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
news-date-check: NEWS
|
|
||||||
today=`date +%Y-%m-%d`; \
|
|
||||||
if head NEWS | grep '^\*.*'$$today >/dev/null; then \
|
|
||||||
:; \
|
|
||||||
else \
|
|
||||||
echo "today's date is not in NEWS" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
changelog-check:
|
|
||||||
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
|
||||||
:; \
|
|
||||||
else \
|
|
||||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
m4-check:
|
|
||||||
@grep 'AC_DEFUN([^[]' m4/*.m4 \
|
|
||||||
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
|
||||||
# FIXME: don't hard-code src/false.c below; use a more general mechanism.
|
|
||||||
po-check:
|
|
||||||
if test -f po/POTFILES.in; then \
|
|
||||||
grep -E -v '^(#|$$)' po/POTFILES.in \
|
|
||||||
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
|
||||||
files=; \
|
|
||||||
for file in lib/*.[chly] src/*.[chly]; do \
|
|
||||||
case $$file in \
|
|
||||||
*.[ch]) \
|
|
||||||
base=`expr " $$file" : ' \(.*\)\..'`; \
|
|
||||||
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
|
||||||
esac; \
|
|
||||||
files="$$files $$file"; \
|
|
||||||
done; \
|
|
||||||
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort > $@-2; \
|
|
||||||
diff -u $@-1 $@-2 || exit 1; \
|
|
||||||
rm -f $@-1 $@-2; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# In a definition of #define AUTHORS "... and ..." where the RHS contains
|
|
||||||
# the English word `and', the string must be marked with `N_ (...)' so that
|
|
||||||
# gettext recognizes it as a string requiring translation.
|
|
||||||
author_mark_check:
|
|
||||||
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
|
|
||||||
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
# Sometimes it is useful to change the PATH environment variable
|
|
||||||
# in Makefiles. When doing so, it's better not to use the Unix-centric
|
|
||||||
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
|
|
||||||
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
|
|
||||||
# and there probably aren't many projects with so many Makefile.am files
|
|
||||||
# that we'd have to worry about limits on command line length.
|
|
||||||
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
|
||||||
makefile_path_separator_check:
|
|
||||||
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
|
||||||
&& { echo $(msg) 1>&2; exit 1; } || :
|
|
||||||
|
|
||||||
# Check that `make alpha' will not fail at the end of the process.
|
|
||||||
writable-files:
|
|
||||||
if test -d $(release_archive_dir); then :; else \
|
|
||||||
mkdir $(release_archive_dir); \
|
|
||||||
fi
|
|
||||||
for file in $(distdir).tar.gz $(xd-delta) \
|
|
||||||
$(release_archive_dir)/$(distdir).tar.gz \
|
|
||||||
$(release_archive_dir)/$(xd-delta); do \
|
|
||||||
test -e $$file || continue; \
|
|
||||||
test -w $$file \
|
|
||||||
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
|
||||||
done; \
|
|
||||||
test "$$fail" && exit 1 || :
|
|
||||||
|
|
||||||
v_etc_file = lib/version-etc.c
|
|
||||||
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
|
||||||
copyright-check:
|
|
||||||
@if test -f $(v_etc_file); then \
|
|
||||||
grep 'enum { COPYRIGHT_YEAR = 2005 };' $(v_etc_file) \
|
|
||||||
>/dev/null \
|
|
||||||
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
|
||||||
exit 1; }; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Sanity checks with the CVS repository.
|
|
||||||
cvs-tag-check:
|
|
||||||
echo $(this-cvs-tag); \
|
|
||||||
if $(CVS) -n log -h README | grep -e $(this-cvs-tag): >/dev/null; then \
|
|
||||||
echo "$(this-cvs-tag) as already been used; not tagging" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
else :; fi
|
|
||||||
|
|
||||||
cvs-diff-check:
|
|
||||||
if $(CVS) diff >cvs-diffs; then \
|
|
||||||
rm cvs-diffs; \
|
|
||||||
else \
|
|
||||||
echo "Some files are locally modified:" 1>&2; \
|
|
||||||
cat cvs-diffs; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
cvs-check: cvs-diff-check cvs-tag-check
|
|
||||||
|
|
||||||
maintainer-distcheck: changelog-check
|
|
||||||
$(MAKE) distcheck
|
|
||||||
$(MAKE) my-distcheck
|
|
||||||
|
|
||||||
|
|
||||||
# Tag before making distribution. Also, don't make a distribution if
|
|
||||||
# checks fail. Also, make sure the NEWS file is up-to-date.
|
|
||||||
# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
|
|
||||||
cvs-dist: $(local-check) cvs-check maintainer-distcheck
|
|
||||||
$(CVS) update po
|
|
||||||
$(CVS) tag -c $(this-cvs-tag)
|
|
||||||
$(MAKE) dist
|
|
||||||
|
|
||||||
# Use this to make sure we don't run these programs when building
|
|
||||||
# from a virgin tgz file, below.
|
|
||||||
null_AM_MAKEFLAGS = \
|
|
||||||
ACLOCAL=false \
|
|
||||||
AUTOCONF=false \
|
|
||||||
AUTOMAKE=false \
|
|
||||||
AUTOHEADER=false \
|
|
||||||
MAKEINFO=false
|
|
||||||
|
|
||||||
# Detect format-string/arg-list mismatches that would normally be obscured
|
|
||||||
# by the use of _(). The --disable-nls effectively defines away that macro,
|
|
||||||
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
|
|
||||||
# treated as a failure. Also, check for shadowing problems with -Wshadow.
|
|
||||||
# These CFLAGS are pretty strict. If you build this target, you probably
|
|
||||||
# have to have a recent version of gcc and glibc headers.
|
|
||||||
TMPDIR ?= /tmp
|
|
||||||
t=$(TMPDIR)/$(PACKAGE)/test
|
|
||||||
my-distcheck: $(local-check)
|
|
||||||
-rm -rf $(t)
|
|
||||||
mkdir -p $(t)
|
|
||||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
|
||||||
cd $(t)/$(distdir) \
|
|
||||||
&& ./configure --disable-nls \
|
|
||||||
&& $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow' \
|
|
||||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
|
||||||
&& $(MAKE) dvi \
|
|
||||||
&& $(MAKE) check \
|
|
||||||
&& $(MAKE) distclean
|
|
||||||
(cd $(t) && mv $(distdir) $(distdir).old \
|
|
||||||
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
|
||||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
|
||||||
-rm -rf $(t)
|
|
||||||
@echo "========================"; \
|
|
||||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
|
||||||
echo "========================"
|
|
||||||
|
|
||||||
WGET = wget
|
|
||||||
WGETFLAGS = -C off
|
|
||||||
|
|
||||||
tgz-md5 = $(shell md5sum < $(my_distdir).tar.gz|sed 's/ -//')
|
|
||||||
tgz-sha1 = $(shell sha1sum < $(my_distdir).tar.gz|sed 's/ -//')
|
|
||||||
bz2-md5 = $(shell md5sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
|
||||||
bz2-sha1 = $(shell sha1sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
|
||||||
xdelta-md5 = $(shell md5sum < $(xd-delta)|sed 's/ -//')
|
|
||||||
xdelta-sha1 = $(shell sha1sum < $(xd-delta)|sed 's/ -//')
|
|
||||||
tgz-size = $(shell du --human $(my_distdir).tar.gz|sed 's/\([MkK]\).*/ \1B/')
|
|
||||||
bz2-size = $(shell du --human $(my_distdir).tar.bz2|sed 's/\([MkK]\).*/ \1B/')
|
|
||||||
xd-size = $(shell du --human $(xd-delta)|sed 's/\([MkK]\).*/ \1B/')
|
|
||||||
|
|
||||||
rel-check:
|
|
||||||
tarz=/tmp/rel-check-tarz-$$$$; \
|
|
||||||
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
|
||||||
set -e; \
|
|
||||||
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
|
|
||||||
$(WGET) $(WGETFLAGS) -q --output-document=$$tarz $(url); \
|
|
||||||
echo "$(md5) -" > $$md5_tmp; \
|
|
||||||
md5sum -c $$md5_tmp < $$tarz
|
|
||||||
|
|
||||||
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
|
||||||
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
|
||||||
|
|
||||||
rel-files = $(xd-delta) $(DIST_ARCHIVES)
|
|
||||||
announcement: NEWS ChangeLog $(rel-files)
|
|
||||||
@./announce-gen \
|
|
||||||
--release-type=$(RELEASE_TYPE) \
|
|
||||||
--package=$(PACKAGE) \
|
|
||||||
--prev=$(PREV_VERSION) \
|
|
||||||
--curr=$(VERSION) \
|
|
||||||
--release-archive-directory=$(release_archive_dir) \
|
|
||||||
--news=NEWS \
|
|
||||||
$(addprefix --url-dir=, $(url_dir_list)) \
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
|
||||||
## Updating files. ##
|
|
||||||
## ---------------- ##
|
|
||||||
|
|
||||||
ftp-gnu = ftp://ftp.gnu.org/gnu
|
|
||||||
www-gnu = http://www.gnu.org
|
|
||||||
|
|
||||||
# Use mv, if you don't have/want move-if-change.
|
|
||||||
move_if_change ?= move-if-change
|
|
||||||
|
|
||||||
|
|
||||||
# --------------------- #
|
|
||||||
# Updating everything. #
|
|
||||||
# --------------------- #
|
|
||||||
|
|
||||||
.PHONY: update
|
|
||||||
local_updates ?= wget-update cvs-update po-update
|
|
||||||
update: $(local_updates)
|
|
||||||
|
|
||||||
|
|
||||||
# ------------------- #
|
|
||||||
# Updating PO files. #
|
|
||||||
# ------------------- #
|
|
||||||
|
|
||||||
po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
|
|
||||||
.PHONY: do-po-update po-update
|
|
||||||
do-po-update:
|
|
||||||
tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
|
|
||||||
rm -rf $$tmppo && \
|
|
||||||
mkdir $$tmppo && \
|
|
||||||
(cd $$tmppo && \
|
|
||||||
$(WGET) $(WGETFLAGS) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
|
|
||||||
cp $$tmppo/*.po po
|
|
||||||
cd po && $(MAKE) update-po
|
|
||||||
$(MAKE) po-check
|
|
||||||
|
|
||||||
po-update:
|
|
||||||
if test -d "po"; then \
|
|
||||||
$(MAKE) do-po-update; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -------------------------- #
|
|
||||||
# Updating GNU build tools. #
|
|
||||||
# -------------------------- #
|
|
||||||
|
|
||||||
# The following pseudo table associates a local directory and a URL
|
|
||||||
# with each of the files that belongs to some other package and is
|
|
||||||
# regularly updated from the specified URL.
|
|
||||||
wget_files ?= \
|
|
||||||
$(srcdir)/build-aux/config.guess \
|
|
||||||
$(srcdir)/build-aux/config.sub \
|
|
||||||
$(srcdir)/build-aux/texinfo.tex \
|
|
||||||
$(srcdir)/src/ansi2knr.c
|
|
||||||
|
|
||||||
get-targets = $(patsubst %, get-%, $(wget_files))
|
|
||||||
|
|
||||||
config.guess-url_prefix = $(ftp-gnu)/build-aux/
|
|
||||||
config.sub-url_prefix = $(ftp-gnu)/build-aux/
|
|
||||||
|
|
||||||
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
|
|
||||||
|
|
||||||
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
|
|
||||||
|
|
||||||
standards.texi-url_prefix = $(www-gnu)/prep/
|
|
||||||
make-stds.texi-url_prefix = $(standards.texi-url_prefix)
|
|
||||||
|
|
||||||
target = $(patsubst get-%, %, $@)
|
|
||||||
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
|
|
||||||
|
|
||||||
.PHONY: $(get-targets)
|
|
||||||
$(get-targets):
|
|
||||||
$(WGET) $(WGETFLAGS) $(url) -O $(target).t \
|
|
||||||
&& $(move_if_change) $(target).t $(target)
|
|
||||||
|
|
||||||
cvs_files ?= \
|
|
||||||
$(srcdir)/build-aux/depcomp \
|
|
||||||
$(srcdir)/build-aux/install-sh \
|
|
||||||
$(srcdir)/build-aux/missing \
|
|
||||||
$(srcdir)/build-aux/mkinstalldirs \
|
|
||||||
$(srcdir)/src/ansi2knr.c
|
|
||||||
automake_repo=:pserver:anoncvs:[email protected]:/cvs/automake
|
|
||||||
.PHONY: wget-update
|
|
||||||
wget-update: $(get-targets)
|
|
||||||
|
|
||||||
.PHONY: cvs-update
|
|
||||||
cvs-update:
|
|
||||||
fail=; \
|
|
||||||
for f in $(cvs_files); do \
|
|
||||||
test -f $$f || { echo "*** skipping $$f" 1>&2; continue; }; \
|
|
||||||
cvs diff $$f > /dev/null \
|
|
||||||
|| { echo "*** $$f is locally modified; skipping it" 1>&2; \
|
|
||||||
fail=yes; continue; }; \
|
|
||||||
file=$$(basename $$f); \
|
|
||||||
echo checking out $$file...; \
|
|
||||||
$(CVS) -d $(automake_repo) co -p automake/lib/$$file> $$f.t \
|
|
||||||
&& $(move_if_change) $$f.t $$f; \
|
|
||||||
done; \
|
|
||||||
test "$$fail" && exit 1
|
|
||||||
|
|
||||||
emit_upload_commands:
|
|
||||||
@echo =====================================
|
|
||||||
@echo =====================================
|
|
||||||
@echo "$(srcdir)/gnupload $(GNUPLOADFLAGS) \\"
|
|
||||||
@echo " --to $(gnu_rel_host):coreutils \\"
|
|
||||||
@echo " $(rel-files)"
|
|
||||||
@echo '# send the /tmp/announcement e-mail'
|
|
||||||
@echo =====================================
|
|
||||||
@echo =====================================
|
|
||||||
|
|
||||||
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
|
||||||
xdelta delta -9 $^ $@ || :
|
|
||||||
|
|
||||||
.PHONY: alpha beta major
|
|
||||||
alpha beta major: news-date-check $(local-check)
|
|
||||||
$(MAKE) cvs-dist
|
|
||||||
$(MAKE) $(xd-delta)
|
|
||||||
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
|
|
||||||
ln $(rel-files) $(release_archive_dir)
|
|
||||||
chmod a-w $(rel-files)
|
|
||||||
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
|
|
||||||
echo $(VERSION) > $(prev_version_file)
|
|
||||||
$(CVS) ci -m. $(prev_version_file)
|
|
||||||
@@ -36,21 +36,19 @@ to the bison package.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2005, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with autoconf; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
@@ -1,41 +1,59 @@
|
|||||||
This directory contains the Bison parser generator.
|
This package contains the GNU Bison parser generator.
|
||||||
|
|
||||||
See the file INSTALL for generic compilation and installation instructions.
|
* Installation
|
||||||
See the file doc/FAQ for frequently asked questions.
|
** Build
|
||||||
|
See the file INSTALL for generic compilation and installation
|
||||||
|
instructions.
|
||||||
|
|
||||||
Bison requires GNU m4 1.4.3 or later. See:
|
Bison requires GNU m4 1.4.6 or later. See:
|
||||||
|
|
||||||
ftp://ftp.gnu.org/gnu/m4/m4-1.4.3.tar.gz
|
ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
|
||||||
|
|
||||||
Bison can work with pre-1.4.3 distributions of GNU m4 if they are
|
** Internationalization
|
||||||
sufficiently patched, but if you encounter a bug with an older
|
Bison supports two catalogues: one for Bison itself (i.e., for the
|
||||||
distribution and report a bug we will probably suggest that you
|
maintainer-side parser generation), and one for the generated parsers
|
||||||
upgrade to 1.4.3 as the first step in trying to fix it.
|
(i.e., for the user-side parser execution). The requirements between
|
||||||
|
both differ: bison needs ngettext, the generated parsers do not. To
|
||||||
|
simplify the build system, neither are installed if ngettext is not
|
||||||
|
supported, even if generated parsers could have been localized. See
|
||||||
|
http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html for
|
||||||
|
more details.
|
||||||
|
|
||||||
Please send bug reports to <[email protected]>. Please include the
|
* Questions
|
||||||
version number from `bison --version', and a complete, self-contained
|
See the section FAQ in the documentation (doc/bison.info) for
|
||||||
test case in each bug report.
|
frequently asked questions. The documentation is also available in
|
||||||
|
PDF and HTML, provided you have a recent version of Texinfo installed:
|
||||||
|
run "make pdf" or "make html".
|
||||||
|
|
||||||
If you have questions about using Bison and the documentation does
|
If you have questions about using Bison and the documentation does
|
||||||
not answer them, please send mail to <[email protected]>.
|
not answer them, please send mail to <[email protected]>.
|
||||||
|
|
||||||
|
* Bug reports
|
||||||
|
Please send bug reports to <[email protected]>. Please include the
|
||||||
|
version number from `bison --version', and a complete, self-contained
|
||||||
|
test case in each bug report.
|
||||||
|
|
||||||
|
|
||||||
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
End:
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
|
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2010 Free Software
|
||||||
|
Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with autoconf; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
+6
-8
@@ -12,21 +12,19 @@ the problems you encounter.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Bison; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
-79
@@ -1,79 +0,0 @@
|
|||||||
-*- outline -*-
|
|
||||||
|
|
||||||
These notes intend to help people working on the CVS versions of
|
|
||||||
Bison.
|
|
||||||
|
|
||||||
* 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:
|
|
||||||
|
|
||||||
- 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/>
|
|
||||||
- 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.
|
|
||||||
|
|
||||||
Bison is written using Bison grammars, so there are bootstrapping
|
|
||||||
issues. The bootstrap script attempts to discover when the C code
|
|
||||||
generated from the grammars is out of date, and to bootstrap with an
|
|
||||||
out-of-date version of the 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.
|
|
||||||
|
|
||||||
* First CVS 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:
|
|
||||||
|
|
||||||
http://savannah.gnu.org/cvs/?group_id=56
|
|
||||||
|
|
||||||
The next step is asking the installation of all the missing files:
|
|
||||||
|
|
||||||
$ ./bootstrap
|
|
||||||
|
|
||||||
And there you are! Just
|
|
||||||
|
|
||||||
$ ./configure && make && make check
|
|
||||||
|
|
||||||
At this point, there should be no difference between your local copy,
|
|
||||||
and the CVS master copy:
|
|
||||||
|
|
||||||
$ cvs diff
|
|
||||||
|
|
||||||
should output no difference.
|
|
||||||
|
|
||||||
Enjoy!
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
|
||||||
|
|
||||||
GNU Bison 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.
|
|
||||||
|
|
||||||
GNU 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.
|
|
||||||
|
|
||||||
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.
|
|
||||||
+1
-1
@@ -19,7 +19,7 @@ kludges that Johnson had to perpetrate to make Yacc fit in a PDP-11.
|
|||||||
Also, Bison uses a faster but less space-efficient encoding for the
|
Also, Bison uses a faster but less space-efficient encoding for the
|
||||||
parse tables (see Corbett's PhD thesis from Berkeley, "Static
|
parse tables (see Corbett's PhD thesis from Berkeley, "Static
|
||||||
Semantics in Compiler Error Recovery", June 1985, Report No. UCB/CSD
|
Semantics in Compiler Error Recovery", June 1985, Report No. UCB/CSD
|
||||||
85/251), and more modern technique for generating the look-ahead sets.
|
85/251), and more modern technique for generating the lookahead sets.
|
||||||
(See Frank DeRemer and Thomas Pennello, "Efficient Computation of
|
(See Frank DeRemer and Thomas Pennello, "Efficient Computation of
|
||||||
LALR(1) Look-Ahead Sets", ACM Transactions on Programming Languages
|
LALR(1) Look-Ahead Sets", ACM Transactions on Programming Languages
|
||||||
and Systems (TOPLAS) 4, 4 (October 1982), 615-649. Their
|
and Systems (TOPLAS) 4, 4 (October 1982), 615-649. Their
|
||||||
|
|||||||
@@ -14,19 +14,31 @@ Art Haas [email protected]
|
|||||||
Baron Schwartz [email protected]
|
Baron Schwartz [email protected]
|
||||||
Benoit Perrot [email protected]
|
Benoit Perrot [email protected]
|
||||||
Bert Deknuydt [email protected]
|
Bert Deknuydt [email protected]
|
||||||
|
Bill Allombert [email protected]
|
||||||
|
Bob Rossi [email protected]
|
||||||
|
Brandon Lucia [email protected]
|
||||||
Bruce Lilly [email protected]
|
Bruce Lilly [email protected]
|
||||||
Bruno Haible [email protected]
|
Bruno Haible [email protected]
|
||||||
Charles-Henri de Boysson [email protected]
|
Charles-Henri de Boysson [email protected]
|
||||||
|
Christian Burger [email protected]
|
||||||
Cris Bailiff [email protected]
|
Cris Bailiff [email protected]
|
||||||
Cris van Pelt [email protected]
|
Cris van Pelt [email protected]
|
||||||
|
Csaba Raduly [email protected]
|
||||||
Daniel Hagerty [email protected]
|
Daniel Hagerty [email protected]
|
||||||
David J. MacKenzie [email protected]
|
David J. MacKenzie [email protected]
|
||||||
|
Derek M. Jones [email protected]
|
||||||
|
Di-an Jan [email protected]
|
||||||
Dick Streefland [email protected]
|
Dick Streefland [email protected]
|
||||||
|
Didier Godefroy [email protected]
|
||||||
Enrico Scholz [email protected]
|
Enrico Scholz [email protected]
|
||||||
|
Eric Blake [email protected]
|
||||||
Evgeny Stambulchik [email protected]
|
Evgeny Stambulchik [email protected]
|
||||||
Fabrice Bauzac [email protected]
|
Fabrice Bauzac [email protected]
|
||||||
Florian Krohm [email protected]
|
Florian Krohm [email protected]
|
||||||
Frank Heckenbach [email protected]
|
Frank Heckenbach [email protected]
|
||||||
|
Frans Englich [email protected]
|
||||||
|
Georg Sauthoff [email protected]
|
||||||
|
Goran Uddeborg [email protected]
|
||||||
Guido Trentalancia [email protected]
|
Guido Trentalancia [email protected]
|
||||||
H. Merijn Brand [email protected]
|
H. Merijn Brand [email protected]
|
||||||
Hans Aberg [email protected]
|
Hans Aberg [email protected]
|
||||||
@@ -34,23 +46,31 @@ Jan Nieuwenhuizen [email protected]
|
|||||||
Jesse Thilo [email protected]
|
Jesse Thilo [email protected]
|
||||||
Jim Kent [email protected]
|
Jim Kent [email protected]
|
||||||
Jim Meyering [email protected]
|
Jim Meyering [email protected]
|
||||||
Joel E. Denny jdenny@hubcap.clemson.edu
|
Joel E. Denny jdenny@ces.clemson.edu
|
||||||
Juan Manuel Guerrero [email protected]
|
Jonathan Nieder [email protected]
|
||||||
|
Juan Manuel Guerrero [email protected]
|
||||||
Kees Zeelenberg [email protected]
|
Kees Zeelenberg [email protected]
|
||||||
Keith Browne [email protected]
|
Keith Browne [email protected]
|
||||||
Laurent Mascherpa [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
Magnus Fromreide [email protected]
|
Magnus Fromreide [email protected]
|
||||||
Marc Autret [email protected]
|
Marc Autret [email protected]
|
||||||
|
Martin Jacobs [email protected]
|
||||||
Martin Mokrejs [email protected]
|
Martin Mokrejs [email protected]
|
||||||
|
Martin Nylin [email protected]
|
||||||
Matt Kraai [email protected]
|
Matt Kraai [email protected]
|
||||||
Matt Rosing [email protected]
|
Matt Rosing [email protected]
|
||||||
Michael Hayes [email protected]
|
Michael Hayes [email protected]
|
||||||
|
Michael Raskin [email protected]
|
||||||
|
Mickael Labau [email protected]
|
||||||
Mike Castle [email protected]
|
Mike Castle [email protected]
|
||||||
Neil Booth [email protected]
|
Neil Booth [email protected]
|
||||||
Nelson H. F. Beebe [email protected]
|
Nelson H. F. Beebe [email protected]
|
||||||
Nicolas Burrus [email protected]
|
Nicolas Burrus [email protected]
|
||||||
Nicolas Tisserand [email protected]
|
Nicolas Tisserand [email protected]
|
||||||
Noah Friedman [email protected]
|
Noah Friedman [email protected]
|
||||||
|
Odd Arild Olsen [email protected]
|
||||||
|
Oleg Smolsky [email protected]
|
||||||
|
Paolo Bonzini [email protected]
|
||||||
Pascal Bart [email protected]
|
Pascal Bart [email protected]
|
||||||
Paul Eggert [email protected]
|
Paul Eggert [email protected]
|
||||||
Paul Hilfinger [email protected]
|
Paul Hilfinger [email protected]
|
||||||
@@ -61,20 +81,28 @@ Piotr Gackiewicz [email protected]
|
|||||||
Quoc Peyrot [email protected]
|
Quoc Peyrot [email protected]
|
||||||
R Blake [email protected]
|
R Blake [email protected]
|
||||||
Raja R Harinath [email protected]
|
Raja R Harinath [email protected]
|
||||||
|
Ralf Wildenhues [email protected]
|
||||||
Richard Stallman [email protected]
|
Richard Stallman [email protected]
|
||||||
Robert Anisko [email protected]
|
Robert Anisko [email protected]
|
||||||
|
Satya Kiran Popuri [email protected]
|
||||||
|
Sebastian Setzer [email protected]
|
||||||
|
Sebastien Fricker [email protected]
|
||||||
|
Sergei Steshenko [email protected]
|
||||||
Shura [email protected]
|
Shura [email protected]
|
||||||
|
Steve Murphy [email protected]
|
||||||
|
Summum Bonum [email protected]
|
||||||
Tim Josling [email protected]
|
Tim Josling [email protected]
|
||||||
Tim Van Holder [email protected]
|
Tim Van Holder [email protected]
|
||||||
Tom Lane [email protected]
|
Tom Lane [email protected]
|
||||||
Tom Tromey [email protected]
|
Tom Tromey [email protected]
|
||||||
|
Tommy Nordgren [email protected]
|
||||||
Troy A. Johnson [email protected]
|
Troy A. Johnson [email protected]
|
||||||
|
Tys Lefering [email protected]
|
||||||
Vin Shelton [email protected]
|
Vin Shelton [email protected]
|
||||||
Wayne Green [email protected]
|
Wayne Green [email protected]
|
||||||
Wolfram Wagner [email protected]
|
Wolfram Wagner [email protected]
|
||||||
Wwp [email protected]
|
Wwp [email protected]
|
||||||
Zack Weinberg [email protected]
|
Zack Weinberg [email protected]
|
||||||
[email protected]
|
|
||||||
|
|
||||||
Many people are not named here because we lost track of them. We
|
Many people are not named here because we lost track of them. We
|
||||||
thank them! Please, help us keeping this list up to date.
|
thank them! Please, help us keeping this list up to date.
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ They should not: it is not documented. But if they need to, let's
|
|||||||
find something clean (not like YYLSP_NEEDED...).
|
find something clean (not like YYLSP_NEEDED...).
|
||||||
|
|
||||||
|
|
||||||
|
* Installation
|
||||||
|
|
||||||
* Documentation
|
* Documentation
|
||||||
Before releasing, make sure the documentation ("Understanding your
|
Before releasing, make sure the documentation ("Understanding your
|
||||||
parser") refers to the current `output' format.
|
parser") refers to the current `output' format.
|
||||||
@@ -27,7 +29,7 @@ Catch up with yacc.c.
|
|||||||
|
|
||||||
** GLR
|
** GLR
|
||||||
How would Paul like to display the conflicted actions? In particular,
|
How would Paul like to display the conflicted actions? In particular,
|
||||||
what when two reductions are possible on a given look-ahead token, but one is
|
what when two reductions are possible on a given lookahead token, but one is
|
||||||
part of $default. Should we make the two reductions explicit, or just
|
part of $default. Should we make the two reductions explicit, or just
|
||||||
keep $default? See the following point.
|
keep $default? See the following point.
|
||||||
|
|
||||||
@@ -47,6 +49,9 @@ Provide better assistance for understanding the conflicts by providing
|
|||||||
a sample text exhibiting the (LALR) ambiguity. See the paper from
|
a sample text exhibiting the (LALR) ambiguity. See the paper from
|
||||||
DeRemer and Penello: they already provide the algorithm.
|
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
|
* Extensions
|
||||||
|
|
||||||
@@ -87,32 +92,6 @@ we should be able to have:
|
|||||||
|
|
||||||
Or something like this.
|
Or something like this.
|
||||||
|
|
||||||
** yysymprint interface
|
|
||||||
It should be improved, in particular when using Bison features such as
|
|
||||||
locations, and YYPARSE_PARAMS. For the time being, it is almost
|
|
||||||
recommended to yyprint to steal internal variables...
|
|
||||||
|
|
||||||
** Several %unions
|
|
||||||
I think this is a pleasant (but useless currently) feature, but in the
|
|
||||||
future, I want a means to %include other bits of grammars, and _then_
|
|
||||||
it will be important for the various bits to define their needs in
|
|
||||||
%union.
|
|
||||||
|
|
||||||
When implementing multiple-%union support, bare the following in mind:
|
|
||||||
|
|
||||||
- when --yacc, this must be flagged as an error. Don't make it fatal
|
|
||||||
though.
|
|
||||||
|
|
||||||
- The #line must now appear *inside* the definition of yystype.
|
|
||||||
Something like
|
|
||||||
|
|
||||||
{
|
|
||||||
#line 12 "foo.y"
|
|
||||||
int ival;
|
|
||||||
#line 23 "foo.y"
|
|
||||||
char *sval;
|
|
||||||
}
|
|
||||||
|
|
||||||
** %if and the like
|
** %if and the like
|
||||||
It should be possible to have %if/%else/%endif. The implementation is
|
It should be possible to have %if/%else/%endif. The implementation is
|
||||||
not clear: should it be lexical or syntactic. Vadim Maslow thinks it
|
not clear: should it be lexical or syntactic. Vadim Maslow thinks it
|
||||||
@@ -168,23 +147,6 @@ Are there any Texinfo standards for bibliography?
|
|||||||
* Java, Fortran, etc.
|
* 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
|
* Coding system independence
|
||||||
Paul notes:
|
Paul notes:
|
||||||
|
|
||||||
@@ -203,28 +165,15 @@ Paul notes:
|
|||||||
the source code. This should get fixed.
|
the source code. This should get fixed.
|
||||||
|
|
||||||
* --graph
|
* --graph
|
||||||
Show reductions. []
|
Show reductions.
|
||||||
|
|
||||||
* Broken options ?
|
* Broken options ?
|
||||||
** %no-parser []
|
** %token-table
|
||||||
** %token-table []
|
** Skeleton strategy
|
||||||
** Skeleton strategy. []
|
Must we keep %token-table?
|
||||||
Must we keep %no-parser?
|
|
||||||
%token-table?
|
|
||||||
|
|
||||||
* src/print_graph.c
|
* src/print_graph.c
|
||||||
Find the best graph parameters. []
|
Find the best graph parameters.
|
||||||
|
|
||||||
* doc/bison.texinfo
|
|
||||||
** Update
|
|
||||||
informations about ERROR_VERBOSE. []
|
|
||||||
** Add explanations about
|
|
||||||
skeleton muscles. []
|
|
||||||
%skeleton. []
|
|
||||||
|
|
||||||
* testsuite
|
|
||||||
** tests/pure-parser.at []
|
|
||||||
New tests.
|
|
||||||
|
|
||||||
* BTYacc
|
* BTYacc
|
||||||
See if we can integrate backtracking in Bison. Charles-Henri de
|
See if we can integrate backtracking in Bison. Charles-Henri de
|
||||||
@@ -257,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
|
makes it impossible to have modular precedence information. We should
|
||||||
move to partial orders (sounds like series/parallel orders to me).
|
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
|
** Correlation b/w precedence and associativity
|
||||||
Also, I fail to understand why we have to assign the same
|
Also, I fail to understand why we have to assign the same
|
||||||
associativity to operators with the same precedence. For instance,
|
associativity to operators with the same precedence. For instance,
|
||||||
@@ -339,27 +285,24 @@ at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
|
|||||||
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
|
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
|
||||||
to bison. If you're interested, I'll work on a patch.
|
to bison. If you're interested, I'll work on a patch.
|
||||||
|
|
||||||
* Move to Graphviz
|
* Better graphics
|
||||||
Well, VCG seems really dead. Move to Graphviz instead. Also, equip
|
Equip the parser with a means to create the (visual) parse tree.
|
||||||
the parser with a means to create the (visual) parse tree.
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2001-2004, 2006, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Bison; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# Bootstrap configuration.
|
||||||
|
|
||||||
|
# Copyright (C) 2006-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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='
|
||||||
|
announce-gen argmatch assert config-h c-strcase configmake dirname
|
||||||
|
error extensions fopen-safer gendocs getopt-gnu gettext
|
||||||
|
git-version-gen hash inttypes javacomp-script javaexec-script
|
||||||
|
maintainer-makefile malloc mbswidth obstack pipe quote quotearg
|
||||||
|
stdbool stpcpy strerror strtoul strverscmp unistd unistd-safer
|
||||||
|
unlocked-io update-copyright unsetenv verify warnings xalloc
|
||||||
|
xalloc-die xstrndup
|
||||||
|
'
|
||||||
|
|
||||||
|
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||||
|
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
|
||||||
|
'
|
||||||
|
|
||||||
|
# In directories like lib/, m4/, and po/, generate both these files because we
|
||||||
|
# still try to support CVS emulation.
|
||||||
|
vc_ignore='.cvsignore .gitignore'
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
announce-gen
|
||||||
|
arg-nonnull.h
|
||||||
|
compile
|
||||||
|
config.guess
|
||||||
|
config.rpath
|
||||||
|
config.sub
|
||||||
|
depcomp
|
||||||
|
gendocs.sh
|
||||||
|
git-version-gen
|
||||||
|
install-sh
|
||||||
|
javacomp.sh.in
|
||||||
|
javaexec.sh.in
|
||||||
|
link-warning.h
|
||||||
|
mdate-sh
|
||||||
|
missing
|
||||||
|
texinfo.tex
|
||||||
|
update-copyright
|
||||||
|
useless-if-before-free
|
||||||
|
vc-list-files
|
||||||
|
warn-on-use.h
|
||||||
|
ylwrap
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/announce-gen
|
||||||
|
/arg-nonnull.h
|
||||||
|
/compile
|
||||||
|
/config.guess
|
||||||
|
/config.rpath
|
||||||
|
/config.sub
|
||||||
|
/depcomp
|
||||||
|
/gendocs.sh
|
||||||
|
/git-version-gen
|
||||||
|
/install-sh
|
||||||
|
/javacomp.sh.in
|
||||||
|
/javaexec.sh.in
|
||||||
|
/link-warning.h
|
||||||
|
/mdate-sh
|
||||||
|
/missing
|
||||||
|
/texinfo.tex
|
||||||
|
/update-copyright
|
||||||
|
/useless-if-before-free
|
||||||
|
/vc-list-files
|
||||||
|
/warn-on-use.h
|
||||||
|
/ylwrap
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
EXTRA_DIST = prev-version.txt
|
EXTRA_DIST = prev-version.txt cross-options.pl update-b4-copyright
|
||||||
Executable
+51
@@ -0,0 +1,51 @@
|
|||||||
|
#! /usr/bin/env perl
|
||||||
|
|
||||||
|
use warnings;
|
||||||
|
use 5.005;
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my %option;
|
||||||
|
while (<>)
|
||||||
|
{
|
||||||
|
if (/^\s* # Initial spaces.
|
||||||
|
(?:(-\w),\s+)? # $1: $short: Possible short option.
|
||||||
|
(--[-\w]+) # $2: $long: Long option.
|
||||||
|
(\[?) # $3: $opt: '[' iff the argument is optional.
|
||||||
|
(?:=(\S+))? # $4: $arg: Possible argument name.
|
||||||
|
\s # Spaces.
|
||||||
|
/x)
|
||||||
|
{
|
||||||
|
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
|
||||||
|
$short = defined $short ? '@option{' . $short . '}' : '';
|
||||||
|
if ($arg)
|
||||||
|
{
|
||||||
|
# if $opt, $arg contains the closing ].
|
||||||
|
substr ($arg, -1) = ''
|
||||||
|
if $opt eq '[';
|
||||||
|
$arg =~ s/^=//;
|
||||||
|
$arg = lc ($arg);
|
||||||
|
# If the argument is compite (e.g., for --define[=NAME[=VALUE]]),
|
||||||
|
# put each word in @var, to build @var{name}[=@var{value}], not
|
||||||
|
# @var{name[=value]}].
|
||||||
|
$arg =~ s/(\w+)/\@var{$1}/g;
|
||||||
|
my $long_arg = "=$arg";
|
||||||
|
if ($opt eq '[') {
|
||||||
|
$long_arg = "[$long_arg]";
|
||||||
|
$arg = "[$arg]";
|
||||||
|
}
|
||||||
|
$option{"$long$long_arg"} = $short ? "$short $arg" : '';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$option{"$long"} = "$short";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach my $long (sort keys %option)
|
||||||
|
{
|
||||||
|
# Avoid trailing spaces.
|
||||||
|
printf ("\@item %-40s \@tab%s\n",
|
||||||
|
'@option{' . $long . '}',
|
||||||
|
$option{$long} ? " $option{$long}" : "");
|
||||||
|
}
|
||||||
Executable
+152
@@ -0,0 +1,152 @@
|
|||||||
|
#!/usr/bin/perl -0777 -pi
|
||||||
|
|
||||||
|
# Update b4_copyright invocations or b4_copyright_years definitions to
|
||||||
|
# include the current year.
|
||||||
|
|
||||||
|
# Copyright (C) 2009-2010 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 3, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my $margin = 72;
|
||||||
|
|
||||||
|
my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
|
||||||
|
if (!$this_year || $this_year !~ m/^\d{4}$/)
|
||||||
|
{
|
||||||
|
my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
|
||||||
|
$this_year = $year + 1900;
|
||||||
|
}
|
||||||
|
my $old_re = <<'EOF'
|
||||||
|
(
|
||||||
|
(?:^|\n)
|
||||||
|
#BEFORE
|
||||||
|
(?:
|
||||||
|
b4_copyright\(\[[^][]*]
|
||||||
|
| m4_(?:push|pop)def\(\[b4_copyright_years]
|
||||||
|
)
|
||||||
|
#AFTER
|
||||||
|
)
|
||||||
|
(?:
|
||||||
|
,\s*
|
||||||
|
(
|
||||||
|
\[\s* (?:\d{4}(?:,\s*|-))* (\d{4}) \s*]
|
||||||
|
)
|
||||||
|
)?
|
||||||
|
\)
|
||||||
|
EOF
|
||||||
|
;
|
||||||
|
|
||||||
|
while (/($old_re)/gx)
|
||||||
|
{
|
||||||
|
my $start = pos() - length ($1);
|
||||||
|
my $b4_copyright_line = $2;
|
||||||
|
my $year_lines = $3;
|
||||||
|
my $final_year = $4;
|
||||||
|
$year_lines .= ')';
|
||||||
|
|
||||||
|
# If there was a second argument, it contains years, so update them.
|
||||||
|
if ($final_year)
|
||||||
|
{
|
||||||
|
$b4_copyright_line .= ',';
|
||||||
|
if ($final_year != $this_year)
|
||||||
|
{
|
||||||
|
# Update the year.
|
||||||
|
$year_lines =~ s/$final_year/$final_year, $this_year/;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Normalize all whitespace.
|
||||||
|
$year_lines =~ s/\s+/ /g;
|
||||||
|
|
||||||
|
# Put spaces after commas.
|
||||||
|
$year_lines =~ s/, ?/, /g;
|
||||||
|
|
||||||
|
# Compress to intervals.
|
||||||
|
$year_lines =~
|
||||||
|
s/
|
||||||
|
(\d{4})
|
||||||
|
(?:
|
||||||
|
(,\ |-)
|
||||||
|
((??{
|
||||||
|
if ($2 eq '-') { '\d{4}'; }
|
||||||
|
elsif (!$3) { $1 + 1; }
|
||||||
|
else { $3 + 1; }
|
||||||
|
}))
|
||||||
|
)+
|
||||||
|
/$1-$3/gx;
|
||||||
|
|
||||||
|
# Format within margin.
|
||||||
|
my $year_lines_new;
|
||||||
|
my $indent = index ($b4_copyright_line, '[');
|
||||||
|
--$indent if ($b4_copyright_line =~ m/^\n/);
|
||||||
|
while (length $year_lines)
|
||||||
|
{
|
||||||
|
my $text_margin = $margin - $indent;
|
||||||
|
if (($year_lines =~ s/^(.{1,$text_margin})(?: |$)//)
|
||||||
|
|| ($year_lines =~ s/^([\S]+)(?: |$)//))
|
||||||
|
{
|
||||||
|
my $line = "\n" . (' 'x$indent) . $1;
|
||||||
|
++$indent if (!$year_lines_new);
|
||||||
|
$year_lines_new .= $line;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
# Should be unreachable, but we don't want an infinite
|
||||||
|
# loop if it can be reached.
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Replace the old invocation. Should never die.
|
||||||
|
die if (!s/$old_re\G/$b4_copyright_line$year_lines_new/x);
|
||||||
|
|
||||||
|
# Prepare for the next search.
|
||||||
|
pos () = $start + length ("$b4_copyright_line$year_lines_new");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (/(\bb4_copyright\()/g)
|
||||||
|
{
|
||||||
|
my $start = pos () - length ($1);
|
||||||
|
my $end = pos ();
|
||||||
|
my $re = $old_re;
|
||||||
|
pos () = $start;
|
||||||
|
$re =~ s/\#BEFORE/\\G/;
|
||||||
|
if (!/$re/x)
|
||||||
|
{
|
||||||
|
my $line = (substr ($_, 0, $start) =~ s/\n/\n/g) + 1;
|
||||||
|
print STDERR
|
||||||
|
"$ARGV:$line: warning: failed to update a b4_copyright\n";
|
||||||
|
}
|
||||||
|
pos () = $end;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (/(\[b4_copyright_years])/g)
|
||||||
|
{
|
||||||
|
my $start = pos () - length ($1);
|
||||||
|
my $end = pos ();
|
||||||
|
my $re = $old_re;
|
||||||
|
$re =~ s/\#AFTER/\\G/;
|
||||||
|
if (!/$re/x)
|
||||||
|
{
|
||||||
|
# The substr operation blows away pos (), so restoring pos ()
|
||||||
|
# at the end is necessary.
|
||||||
|
my $line = (substr ($_, 0, $start) =~ s/\n/\n/g) + 1;
|
||||||
|
print STDERR
|
||||||
|
"$ARGV:$line: warning: failed to update a"
|
||||||
|
. " b4_copyright_years\n";
|
||||||
|
}
|
||||||
|
pos () = $end;
|
||||||
|
}
|
||||||
Executable
+49
@@ -0,0 +1,49 @@
|
|||||||
|
#!/usr/bin/perl -0777 -pi
|
||||||
|
|
||||||
|
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
||||||
|
|
||||||
|
# Copyright (C) 2010 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 3, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
|
||||||
|
if (!$this_year || $this_year !~ m/^\d{4}$/)
|
||||||
|
{
|
||||||
|
my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
|
||||||
|
$this_year = $year + 1900;
|
||||||
|
}
|
||||||
|
my $old_re = <<'EOF'
|
||||||
|
(
|
||||||
|
MACRO\(
|
||||||
|
\[PACKAGE_COPYRIGHT_YEAR],
|
||||||
|
\s*\[
|
||||||
|
)
|
||||||
|
(\d{4})
|
||||||
|
(?=])
|
||||||
|
EOF
|
||||||
|
;
|
||||||
|
foreach my $macro ("AC_DEFINE", "AC_SUBST")
|
||||||
|
{
|
||||||
|
my $this_old_re = $old_re;
|
||||||
|
$this_old_re =~ s/MACRO/$macro/;
|
||||||
|
if (!s/$this_old_re/$1$this_year/x)
|
||||||
|
{
|
||||||
|
print STDERR
|
||||||
|
"$ARGV: warning: failed to update PACKAGE_COPYRIGHT_YEAR in"
|
||||||
|
. " $macro.\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# Customize maint.mk -*- makefile -*-
|
||||||
|
# Copyright (C) 2008-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
# It's useful to run maintainer-*check* targets during development, but we
|
||||||
|
# don't want to wait on a recompile because of an update to $(VERSION). Thus,
|
||||||
|
# override the _is-dist-target from GNUmakefile so that maintainer-*check*
|
||||||
|
# targets are filtered out.
|
||||||
|
_is-dist-target = $(filter-out %clean maintainer-check% maintainer-%-check, \
|
||||||
|
$(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS)))
|
||||||
|
|
||||||
|
# Use alpha.gnu.org for alpha and beta releases.
|
||||||
|
# Use ftp.gnu.org for major releases.
|
||||||
|
gnu_ftp_host-alpha = alpha.gnu.org
|
||||||
|
gnu_ftp_host-beta = alpha.gnu.org
|
||||||
|
gnu_ftp_host-major = ftp.gnu.org
|
||||||
|
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
|
||||||
|
|
||||||
|
url_dir_list = \
|
||||||
|
ftp://$(gnu_rel_host)/gnu/bison
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# 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 = $(srcdir)/gnulib
|
||||||
|
|
||||||
|
bootstrap-tools = autoconf,automake,flex,gnulib
|
||||||
|
|
||||||
|
update-copyright: update-b4-copyright update-package-copyright-year
|
||||||
|
update-copyright-env = \
|
||||||
|
UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
+83
-55
@@ -1,10 +1,10 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2010 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -13,57 +13,76 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
# This file uses AC_CONFIG_MACRO_DIR, so we need Autoconf 2.58 or better.
|
# We have strange test case titles, so we need Autoconf 2.61 or better.
|
||||||
# But Autoconf 2.58 has a bug in the way that it generates tests: it
|
AC_PREREQ(2.61)
|
||||||
# puts the wrong absolute path names in the tests. So we need at
|
|
||||||
# least Autoconf 2.59.
|
AC_INIT([GNU Bison],
|
||||||
AC_PREREQ(2.59)
|
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||||
|
[[email protected]])
|
||||||
|
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2010],
|
||||||
|
[The copyright year for this package])
|
||||||
|
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2010])
|
||||||
|
|
||||||
AC_INIT([GNU Bison], [2.1], [[email protected]])
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here:
|
||||||
AM_INIT_AUTOMAKE([1.8 check-news readme-alpha dist-bzip2])
|
#
|
||||||
AC_CONFIG_HEADERS([config.h:config.hin])
|
# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131
|
||||||
|
#
|
||||||
gl_USE_SYSTEM_EXTENSIONS
|
# To avoid 1.11, we make 1.11.1 the minimum version.
|
||||||
|
#
|
||||||
|
# We want gnits strictness only when rolling a formal release so that we can,
|
||||||
|
# for example, run make dist at other times without being required to add a
|
||||||
|
# bogus NEWS entry.
|
||||||
|
AM_INIT_AUTOMAKE([1.11.1 dist-bzip2]
|
||||||
|
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [-], [gnu], [gnits]))
|
||||||
|
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
||||||
|
|
||||||
# Checks for the compiler.
|
# Checks for the compiler.
|
||||||
AC_PROG_CC
|
AC_PROG_CC_STDC
|
||||||
AM_PROG_CC_STDC
|
|
||||||
|
# Gnulib (early checks).
|
||||||
|
gl_EARLY
|
||||||
|
|
||||||
AC_ARG_ENABLE(gcc-warnings,
|
AC_ARG_ENABLE(gcc-warnings,
|
||||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||||
[case "${enableval}" in
|
[case "${enableval}" in
|
||||||
yes|no) ;;
|
yes|no) ;;
|
||||||
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
||||||
esac],
|
esac],
|
||||||
[enableval=no])
|
[enableval=no])
|
||||||
if test "${enableval}" = yes; then
|
if test "${enableval}" = yes; then
|
||||||
BISON_WARNING(-Werror)
|
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
||||||
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
AC_SUBST([WERROR_CFLAGS])
|
||||||
WARNING_CFLAGS=
|
gl_WARN_ADD([-Wall])
|
||||||
BISON_WARNING(-W)
|
gl_WARN_ADD([-Wextra -Wno-sign-compare])
|
||||||
BISON_WARNING(-Wall)
|
gl_WARN_ADD([-Wcast-align])
|
||||||
BISON_WARNING(-Wcast-align)
|
gl_WARN_ADD([-Wcast-qual])
|
||||||
BISON_WARNING(-Wcast-qual)
|
gl_WARN_ADD([-Wformat])
|
||||||
BISON_WARNING(-Wformat)
|
gl_WARN_ADD([-Wpointer-arith])
|
||||||
BISON_WARNING(-Wwrite-strings)
|
gl_WARN_ADD([-Wwrite-strings])
|
||||||
AC_SUBST([WARNING_CXXFLAGS], [$WARNING_CFLAGS])
|
AC_SUBST([WARN_CXXFLAGS], [$WARN_CFLAGS])
|
||||||
# The following warnings are not suitable for C++.
|
# The following warnings are not suitable for C++.
|
||||||
BISON_WARNING(-Wbad-function-cast)
|
gl_WARN_ADD([-Wbad-function-cast])
|
||||||
BISON_WARNING(-Wmissing-declarations)
|
gl_WARN_ADD([-Wmissing-declarations])
|
||||||
BISON_WARNING(-Wmissing-prototypes)
|
gl_WARN_ADD([-Wmissing-prototypes])
|
||||||
BISON_WARNING(-Wnested-externs)
|
gl_WARN_ADD([-Wshadow])
|
||||||
BISON_WARNING(-Wshadow)
|
gl_WARN_ADD([-Wstrict-prototypes])
|
||||||
BISON_WARNING(-Wstrict-prototypes)
|
AC_SUBST([WARN_CFLAGS])
|
||||||
|
# Warnings for the test suite only.
|
||||||
|
gl_WARN_ADD([-Wundef], [WARN_CFLAGS_TEST])
|
||||||
|
WARN_CXXFLAGS_TEST="$WARN_CXXFLAGS $WARN_CFLAGS_TEST"
|
||||||
|
WARN_CFLAGS_TEST="$WARN_CFLAGS $WARN_CFLAGS_TEST"
|
||||||
|
AC_SUBST([WARN_CXXFLAGS_TEST])
|
||||||
|
AC_SUBST([WARN_CFLAGS_TEST])
|
||||||
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
BISON_TEST_FOR_WORKING_C_COMPILER
|
||||||
|
|
||||||
AC_ARG_ENABLE([yacc],
|
AC_ARG_ENABLE([yacc],
|
||||||
[AC_HELP_STRING([--disable-yacc],
|
[AC_HELP_STRING([--disable-yacc],
|
||||||
[do not build a yacc command or an -ly library])],
|
[do not build a yacc command or an -ly library])],
|
||||||
@@ -83,21 +102,23 @@ AC_SUBST([YACC_LIBRARY])
|
|||||||
AC_PROG_LEX
|
AC_PROG_LEX
|
||||||
AC_PROG_YACC
|
AC_PROG_YACC
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
BISON_PROG_GNU_M4
|
AC_PROG_GNU_M4
|
||||||
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.])
|
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
||||||
|
AC_DEFINE_UNQUOTED([M4_GNU_OPTION], ["$M4_GNU"], [Define to "-g" if GNU M4
|
||||||
|
supports -g, otherwise to "".])
|
||||||
|
AM_MISSING_PROG([HELP2MAN], [help2man])
|
||||||
|
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||||
|
AC_SUBST([XSLTPROC])
|
||||||
|
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_CHECK_HEADERS_ONCE([locale.h])
|
AC_CHECK_HEADERS_ONCE([locale.h])
|
||||||
AM_STDBOOL_H
|
|
||||||
|
|
||||||
# Checks for compiler characteristics.
|
# Checks for compiler characteristics.
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
|
|
||||||
# Checks for types.
|
# Gnulib (later checks). Putting them here rather than right after
|
||||||
AC_CHECK_TYPES([uintptr_t])
|
# gl_EARLY avoids some redundant checks.
|
||||||
|
gl_INIT
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||||
@@ -105,10 +126,10 @@ AM_WITH_DMALLOC
|
|||||||
BISON_PREREQ_SUBPIPE
|
BISON_PREREQ_SUBPIPE
|
||||||
BISON_PREREQ_TIMEVAR
|
BISON_PREREQ_TIMEVAR
|
||||||
|
|
||||||
# gnulib and gettext.
|
# Gettext.
|
||||||
GNULIB_AUTOCONF_SNIPPET
|
# We've never tested with gettext versions before 0.15, so play it safe.
|
||||||
# We use po/Makevars, so we need at least gettext 0.12.
|
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||||
AM_GNU_GETTEXT_VERSION([0.12])
|
AM_GNU_GETTEXT_VERSION([0.15])
|
||||||
BISON_I18N
|
BISON_I18N
|
||||||
|
|
||||||
# Internationalized parsers.
|
# Internationalized parsers.
|
||||||
@@ -117,6 +138,9 @@ AC_CONFIG_FILES([runtime-po/Makefile.in])
|
|||||||
aclocaldir='${datadir}/aclocal'
|
aclocaldir='${datadir}/aclocal'
|
||||||
AC_SUBST([aclocaldir])
|
AC_SUBST([aclocaldir])
|
||||||
|
|
||||||
|
# Create the benchmark script.
|
||||||
|
AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
|
||||||
|
|
||||||
# Initialize the test suite.
|
# Initialize the test suite.
|
||||||
AC_CONFIG_TESTDIR(tests)
|
AC_CONFIG_TESTDIR(tests)
|
||||||
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
||||||
@@ -127,16 +151,20 @@ BISON_TEST_FOR_WORKING_CXX_COMPILER
|
|||||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||||
# Needed by tests/atlocal.in.
|
# Needed by tests/atlocal.in.
|
||||||
AC_SUBST([GCC])
|
AC_SUBST([GCC])
|
||||||
O0CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]] *//'`
|
AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||||
AC_SUBST([O0CFLAGS])
|
AC_SUBST([O0CXXFLAGS], [`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||||
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`
|
|
||||||
AC_SUBST([O0CXXFLAGS])
|
gt_JAVACOMP([1.3])
|
||||||
|
gt_JAVAEXEC
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
config/Makefile
|
build-aux/Makefile
|
||||||
po/Makefile.in
|
po/Makefile.in
|
||||||
data/Makefile
|
data/Makefile
|
||||||
|
etc/Makefile
|
||||||
examples/Makefile
|
examples/Makefile
|
||||||
examples/calc++/Makefile
|
examples/calc++/Makefile
|
||||||
lib/Makefile src/Makefile doc/Makefile])
|
lib/Makefile src/Makefile
|
||||||
|
doc/Makefile
|
||||||
|
doc/yacc.1])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/Makefile.in
|
||||||
|
/Makefile
|
||||||
+25
-19
@@ -1,23 +1,29 @@
|
|||||||
## Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
## Copyright (C) 2002, 2005-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## (at your option) any later version.
|
# (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,
|
dist_pkgdata_DATA = README bison.m4 \
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
c-skel.m4 c.m4 yacc.c glr.c \
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
c++-skel.m4 c++.m4 location.cc lalr1.cc glr.cc \
|
||||||
## GNU General Public License for more details.
|
java-skel.m4 java.m4 lalr1.java
|
||||||
|
|
||||||
## 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 lalr1.cc
|
|
||||||
|
|
||||||
m4sugardir = $(pkgdatadir)/m4sugar
|
m4sugardir = $(pkgdatadir)/m4sugar
|
||||||
dist_m4sugar_DATA = m4sugar/m4sugar.m4
|
dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/foreach.m4
|
||||||
|
|
||||||
|
xsltdir = $(pkgdatadir)/xslt
|
||||||
|
dist_xslt_DATA = \
|
||||||
|
xslt/bison.xsl \
|
||||||
|
xslt/xml2dot.xsl \
|
||||||
|
xslt/xml2text.xsl \
|
||||||
|
xslt/xml2xhtml.xsl
|
||||||
|
|||||||
+39
-14
@@ -1,45 +1,70 @@
|
|||||||
-*- outline -*-
|
-*- outline -*-
|
||||||
|
|
||||||
This directory contains Bison skeletons: the general shapes of the
|
This directory contains data needed by Bison.
|
||||||
different parser kinds, that are specialized for specific grammars by
|
|
||||||
the bison program.
|
|
||||||
|
|
||||||
Currently, there are only three supported skeletons:
|
* Skeletons
|
||||||
|
Bison skeletons: the general shapes of the different parser kinds,
|
||||||
|
that are specialized for specific grammars by the bison program.
|
||||||
|
|
||||||
|
Currently, the supported skeletons are:
|
||||||
|
|
||||||
- yacc.c
|
- yacc.c
|
||||||
It used to be named bison.simple: it corresponds to C Yacc
|
It used to be named bison.simple: it corresponds to C Yacc
|
||||||
compatible LALR(1) parsers.
|
compatible LALR(1) parsers.
|
||||||
|
|
||||||
- lalr1.cc
|
- lalr1.cc
|
||||||
Produces a C++ parser class. It is still very experimental, and not
|
Produces a C++ parser class.
|
||||||
yet supported. Please, subscribe to [email protected].
|
|
||||||
|
- lalr1.java
|
||||||
|
Produces a Java parser class.
|
||||||
|
|
||||||
- glr.c
|
- glr.c
|
||||||
A Generalized LR C parser based on Bison's LALR(1) tables.
|
A Generalized LR C parser based on Bison's LALR(1) tables.
|
||||||
|
|
||||||
|
- glr.cc
|
||||||
|
A Generalized LR C++ parser. Actually a C++ wrapper around glr.c.
|
||||||
|
|
||||||
These skeletons are the only ones supported by the Bison team.
|
These skeletons are the only ones supported by the Bison team.
|
||||||
Because the interface between skeletons and the bison program is not
|
Because the interface between skeletons and the bison program is not
|
||||||
finished, *we are not bound to it*. In particular, Bison is not
|
finished, *we are not bound to it*. In particular, Bison is not
|
||||||
mature enough for us to consider that ``foreign skeletons'' are
|
mature enough for us to consider that ``foreign skeletons'' are
|
||||||
supported.
|
supported.
|
||||||
|
|
||||||
|
* m4sugar
|
||||||
|
This directory contains M4sugar, sort of an extended library for M4,
|
||||||
|
which is used by Bison to instantiate the skeletons.
|
||||||
|
|
||||||
|
* xslt
|
||||||
|
This directory contains XSLT programs that transform Bison's XML output
|
||||||
|
into various formats.
|
||||||
|
|
||||||
|
- bison.xsl
|
||||||
|
A library of routines used by the other XSLT programs.
|
||||||
|
|
||||||
|
- xml2dot.xsl
|
||||||
|
Conversion into GraphViz's dot format.
|
||||||
|
|
||||||
|
- xml2text.xsl
|
||||||
|
Conversion into text.
|
||||||
|
|
||||||
|
- xml2xhtml.xsl
|
||||||
|
Conversion into XHTML.
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2008-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Bison; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
+554
@@ -0,0 +1,554 @@
|
|||||||
|
-*- Autoconf -*-
|
||||||
|
|
||||||
|
# Language-independent M4 Macros for Bison.
|
||||||
|
# Copyright (C) 2002, 2004-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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[)],
|
||||||
|
[[[[<skeleton default value>:-1.-1]],
|
||||||
|
[[<skeleton default value>:-1.-1]]]])dnl
|
||||||
|
m4_define([b4_percent_define_syncline(]$1[)], [[]])])])
|
||||||
|
|
||||||
|
# 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_lifo([
|
||||||
|
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, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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)
|
||||||
+66
-18
@@ -1,47 +1,95 @@
|
|||||||
m4_divert(-1)
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program 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
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
m4_include(b4_pkgdatadir/[c.m4])
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Default values. ##
|
## Default values. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# Default parser class name.
|
# Default parser class name.
|
||||||
m4_define_default([b4_parser_class_name], [parser])
|
b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||||
m4_define_default([b4_location_type], [location])
|
b4_percent_define_default([[location_type]], [[location]])
|
||||||
m4_define_default([b4_filename_type], [std::string])
|
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||||
|
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
|
||||||
|
b4_percent_define_default([[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)
|
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as enums.
|
# Output the definition of the tokens as enums.
|
||||||
m4_define([b4_token_enums],
|
m4_define([b4_token_enums],
|
||||||
[m4_if([$@], [[]], [],
|
|
||||||
[/* Tokens. */
|
[/* Tokens. */
|
||||||
enum yytokentype {
|
enum yytokentype {
|
||||||
m4_map_sep([ b4_token_enum], [,
|
m4_map_sep([ b4_token_enum], [,
|
||||||
],
|
],
|
||||||
[$@])
|
[$@])
|
||||||
};
|
};
|
||||||
])])
|
])
|
||||||
|
|
||||||
|
|
||||||
## ----------------- ##
|
## ----------------- ##
|
||||||
@@ -61,7 +109,7 @@ m4_define([b4_lhs_value],
|
|||||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||||
# symbols on RHS.
|
# symbols on RHS.
|
||||||
m4_define([b4_rhs_value],
|
m4_define([b4_rhs_value],
|
||||||
[(yysemantic_stack_@{m4_eval([$1 - $2])@}m4_ifval([$3], [.$3]))])
|
[(yysemantic_stack_@{($1) - ($2)@}m4_ifval([$3], [.$3]))])
|
||||||
|
|
||||||
# b4_lhs_location()
|
# b4_lhs_location()
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -75,7 +123,7 @@ m4_define([b4_lhs_location],
|
|||||||
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
|
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
|
||||||
# on RHS.
|
# on RHS.
|
||||||
m4_define([b4_rhs_location],
|
m4_define([b4_rhs_location],
|
||||||
[(yylocation_stack_@{m4_eval([$1 - $2])@})])
|
[(yylocation_stack_@{($1) - ($2)@})])
|
||||||
|
|
||||||
|
|
||||||
# b4_parse_param_decl
|
# b4_parse_param_decl
|
||||||
@@ -98,7 +146,7 @@ m4_define([b4_parse_param_decl_1],
|
|||||||
# Extra initialisations of the constructor.
|
# Extra initialisations of the constructor.
|
||||||
m4_define([b4_parse_param_cons],
|
m4_define([b4_parse_param_cons],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[,
|
[
|
||||||
b4_cc_constructor_calls(b4_parse_param)])])
|
b4_cc_constructor_calls(b4_parse_param)])])
|
||||||
m4_define([b4_cc_constructor_calls],
|
m4_define([b4_cc_constructor_calls],
|
||||||
[m4_map_sep([b4_cc_constructor_call], [,
|
[m4_map_sep([b4_cc_constructor_call], [,
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
-*- Autoconf -*-
|
||||||
|
|
||||||
|
# C skeleton dispatching for Bison.
|
||||||
|
# Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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,86 +1,74 @@
|
|||||||
m4_divert(-1) -*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C M4 Macros for Bison.
|
# C M4 Macros for Bison.
|
||||||
# Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2004-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program 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
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Identification. ##
|
## Identification. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# b4_copyright(TITLE, YEARS)
|
# b4_comment(TEXT)
|
||||||
# --------------------------
|
# ----------------
|
||||||
m4_define([b4_copyright],
|
m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
||||||
[/* A Bison parser, made by GNU Bison b4_version. */
|
], [
|
||||||
|
]) */])
|
||||||
/* $1,
|
|
||||||
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. */])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_identification
|
# 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],
|
m4_define([b4_identification],
|
||||||
[/* Identify Bison output. */
|
[[/* Identify Bison output. */
|
||||||
[#]define YYBISON 1
|
#define YYBISON 1
|
||||||
|
|
||||||
/* Bison version. */
|
/* Bison version. */
|
||||||
[#]define YYBISON_VERSION "b4_version"
|
#define YYBISON_VERSION "]b4_version["
|
||||||
|
|
||||||
/* Skeleton name. */
|
/* Skeleton name. */
|
||||||
[#]define YYSKELETON_NAME b4_skeleton
|
#define YYSKELETON_NAME ]b4_skeleton[]m4_ifdef([b4_pure_flag], [[
|
||||||
|
|
||||||
/* Pure parsers. */
|
/* Pure parsers. */
|
||||||
[#]define YYPURE b4_pure
|
#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. */
|
/* Using locations. */
|
||||||
[#]define YYLSP_NEEDED b4_locations_flag
|
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||||
])
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Default values. ##
|
## Default values. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
m4_define_default([b4_epilogue], [])
|
# If the %union is not named, its name is YYSTYPE.
|
||||||
|
m4_define_default([b4_union_name], [YYSTYPE])
|
||||||
|
|
||||||
|
# If the %name-prefix is not given, it is yy.
|
||||||
|
m4_define_default([b4_prefix], [yy])
|
||||||
|
|
||||||
## ------------------------ ##
|
## ------------------------ ##
|
||||||
## Pure/impure interfaces. ##
|
## Pure/impure interfaces. ##
|
||||||
## ------------------------ ##
|
## ------------------------ ##
|
||||||
|
|
||||||
|
|
||||||
# b4_user_args
|
# b4_user_args
|
||||||
# ------------
|
# ------------
|
||||||
m4_define([b4_user_args],
|
m4_define([b4_user_args],
|
||||||
@@ -91,24 +79,36 @@ m4_define([b4_user_args],
|
|||||||
# --------------
|
# --------------
|
||||||
# If defined, b4_parse_param arrives double quoted, but below we prefer
|
# If defined, b4_parse_param arrives double quoted, but below we prefer
|
||||||
# it to be single quoted.
|
# it to be single quoted.
|
||||||
m4_define_default([b4_parse_param])
|
|
||||||
m4_define([b4_parse_param],
|
m4_define([b4_parse_param],
|
||||||
b4_parse_param))
|
b4_parse_param)
|
||||||
|
|
||||||
|
|
||||||
|
# b4_parse_param_for(DECL, FORMAL, BODY)
|
||||||
|
# ---------------------------------------
|
||||||
|
# Iterate over the user parameters, binding the declaration to DECL,
|
||||||
|
# the formal name to FORMAL, and evaluating the BODY.
|
||||||
|
m4_define([b4_parse_param_for],
|
||||||
|
[m4_foreach([$1_$2], m4_defn([b4_parse_param]),
|
||||||
|
[m4_pushdef([$1], m4_unquote(m4_car($1_$2)))dnl
|
||||||
|
m4_pushdef([$2], m4_shift($1_$2))dnl
|
||||||
|
$3[]dnl
|
||||||
|
m4_popdef([$2])dnl
|
||||||
|
m4_popdef([$1])dnl
|
||||||
|
])])
|
||||||
|
|
||||||
|
# b4_parse_param_use
|
||||||
|
# ------------------
|
||||||
|
# `YYUSE' all the parse-params.
|
||||||
|
m4_define([b4_parse_param_use],
|
||||||
|
[b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal);
|
||||||
|
])dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
## Data Types. ##
|
## 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)
|
# b4_int_type(MIN, MAX)
|
||||||
# ---------------------
|
# ---------------------
|
||||||
# Return the smallest int type able to handle numbers ranging from
|
# Return the smallest int type able to handle numbers ranging from
|
||||||
@@ -122,7 +122,7 @@ m4_define([b4_int_type],
|
|||||||
|
|
||||||
m4_eval([0 <= $1]), [1], [unsigned int],
|
m4_eval([0 <= $1]), [1], [unsigned int],
|
||||||
|
|
||||||
[int])])
|
[int])])
|
||||||
|
|
||||||
|
|
||||||
# b4_int_type_for(NAME)
|
# b4_int_type_for(NAME)
|
||||||
@@ -133,28 +133,18 @@ m4_define([b4_int_type_for],
|
|||||||
[b4_int_type($1_min, $1_max)])
|
[b4_int_type($1_min, $1_max)])
|
||||||
|
|
||||||
|
|
||||||
## ------------------ ##
|
|
||||||
## Decoding options. ##
|
|
||||||
## ------------------ ##
|
|
||||||
|
|
||||||
|
## ---------##
|
||||||
|
## Values. ##
|
||||||
|
## ---------##
|
||||||
|
|
||||||
# b4_location_if(IF-TRUE, IF-FALSE)
|
# b4_null
|
||||||
# ---------------------------------
|
---------
|
||||||
# Expand IF-TRUE, if locations are used, IF-FALSE otherwise.
|
# Return a null pointer constant. NULL infringes on the user name
|
||||||
m4_define([b4_location_if],
|
# space in C, so use 0 rather than NULL.
|
||||||
[m4_if(b4_locations_flag, [1],
|
m4_define([b4_null], [0])
|
||||||
[$1],
|
|
||||||
[$2])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_pure_if(IF-TRUE, IF-FALSE)
|
|
||||||
# -----------------------------
|
|
||||||
# Expand IF-TRUE, if %pure-parser, IF-FALSE otherwise.
|
|
||||||
m4_define([b4_pure_if],
|
|
||||||
[m4_if(b4_pure, [1],
|
|
||||||
[$1],
|
|
||||||
[$2])])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
@@ -173,7 +163,7 @@ m4_define([b4_token_define],
|
|||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as #defines.
|
# Output the definition of the tokens (if there are) as #defines.
|
||||||
m4_define([b4_token_defines],
|
m4_define([b4_token_defines],
|
||||||
[m4_if([$@], [[]], [],
|
[m4_if([$#$1], [1], [],
|
||||||
[/* Tokens. */
|
[/* Tokens. */
|
||||||
m4_map([b4_token_define], [$@])])
|
m4_map([b4_token_define], [$@])])
|
||||||
])
|
])
|
||||||
@@ -190,7 +180,7 @@ m4_define([b4_token_enum],
|
|||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as enums.
|
# Output the definition of the tokens (if there are) as enums.
|
||||||
m4_define([b4_token_enums],
|
m4_define([b4_token_enums],
|
||||||
[m4_if([$@], [[]], [],
|
[m4_if([$#$1], [1], [],
|
||||||
[/* Tokens. */
|
[/* Tokens. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
# define YYTOKENTYPE
|
# define YYTOKENTYPE
|
||||||
@@ -199,7 +189,7 @@ m4_define([b4_token_enums],
|
|||||||
enum yytokentype {
|
enum yytokentype {
|
||||||
m4_map_sep([ b4_token_enum], [,
|
m4_map_sep([ b4_token_enum], [,
|
||||||
],
|
],
|
||||||
[$@])
|
[$@])
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
])])
|
])])
|
||||||
@@ -207,9 +197,10 @@ m4_map_sep([ b4_token_enum], [,
|
|||||||
|
|
||||||
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as enums and #defines.
|
# Output the definition of the tokens (if there are any) as enums and, if POSIX
|
||||||
|
# Yacc is enabled, as #defines.
|
||||||
m4_define([b4_token_enums_defines],
|
m4_define([b4_token_enums_defines],
|
||||||
[b4_token_enums($@)b4_token_defines($@)
|
[b4_token_enums($@)b4_yacc_if([b4_token_defines($@)], [])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -219,16 +210,30 @@ m4_define([b4_token_enums_defines],
|
|||||||
## --------------------------------------------- ##
|
## --------------------------------------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
# b4_modern_c
|
||||||
|
# -----------
|
||||||
|
# A predicate useful in #if to determine whether C is ancient or modern.
|
||||||
|
#
|
||||||
|
# If __STDC__ is defined, the compiler is modern. IBM xlc 7.0 when run
|
||||||
|
# as 'cc' doesn't define __STDC__ (or __STDC_VERSION__) for pedantic
|
||||||
|
# reasons, but it defines __C99__FUNC__ so check that as well.
|
||||||
|
# Microsoft C normally doesn't define these macros, but it defines _MSC_VER.
|
||||||
|
# Consider a C++ compiler to be modern if it defines __cplusplus.
|
||||||
|
#
|
||||||
|
m4_define([b4_c_modern],
|
||||||
|
[[(defined __STDC__ || defined __C99__FUNC__ \
|
||||||
|
|| defined __cplusplus || defined _MSC_VER)]])
|
||||||
|
|
||||||
# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# Declare the function NAME.
|
# Declare the function NAME.
|
||||||
m4_define([b4_c_function_def],
|
m4_define([b4_c_function_def],
|
||||||
[#if defined (__STDC__) || defined (__cplusplus)
|
[#if b4_c_modern
|
||||||
b4_c_ansi_function_def($@)
|
b4_c_ansi_function_def($@)
|
||||||
#else
|
#else
|
||||||
$2
|
$2
|
||||||
$1 (b4_c_knr_formal_names(m4_shiftn(2, $@)))
|
$1 (b4_c_knr_formal_names(m4_shift2($@)))
|
||||||
b4_c_knr_formal_decls(m4_shiftn(2, $@))
|
b4_c_knr_formal_decls(m4_shift2($@))
|
||||||
#endif[]dnl
|
#endif[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -238,7 +243,7 @@ b4_c_knr_formal_decls(m4_shiftn(2, $@))
|
|||||||
# Declare the function NAME in ANSI.
|
# Declare the function NAME in ANSI.
|
||||||
m4_define([b4_c_ansi_function_def],
|
m4_define([b4_c_ansi_function_def],
|
||||||
[$2
|
[$2
|
||||||
$1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
$1 (b4_c_ansi_formals(m4_shift2($@)))[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -246,10 +251,9 @@ $1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
|||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
# Output the arguments ANSI-C definition.
|
# Output the arguments ANSI-C definition.
|
||||||
m4_define([b4_c_ansi_formals],
|
m4_define([b4_c_ansi_formals],
|
||||||
[m4_case([$@],
|
[m4_if([$#], [0], [void],
|
||||||
[], [void],
|
[$#$1], [1], [void],
|
||||||
[[]], [void],
|
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
||||||
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
|
||||||
|
|
||||||
m4_define([b4_c_ansi_formal],
|
m4_define([b4_c_ansi_formal],
|
||||||
[$1])
|
[$1])
|
||||||
@@ -270,9 +274,9 @@ m4_define([b4_c_knr_formal_name],
|
|||||||
# Output the K&R argument declarations.
|
# Output the K&R argument declarations.
|
||||||
m4_define([b4_c_knr_formal_decls],
|
m4_define([b4_c_knr_formal_decls],
|
||||||
[m4_map_sep([b4_c_knr_formal_decl],
|
[m4_map_sep([b4_c_knr_formal_decl],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
[$@])])
|
[$@])])
|
||||||
|
|
||||||
m4_define([b4_c_knr_formal_decl],
|
m4_define([b4_c_knr_formal_decl],
|
||||||
[ $1;])
|
[ $1;])
|
||||||
@@ -288,7 +292,7 @@ m4_define([b4_c_knr_formal_decl],
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Declare the function NAME.
|
# Declare the function NAME.
|
||||||
m4_define([b4_c_function_decl],
|
m4_define([b4_c_function_decl],
|
||||||
[#if defined (__STDC__) || defined (__cplusplus)
|
[#if defined __STDC__ || defined __cplusplus
|
||||||
b4_c_ansi_function_decl($@)
|
b4_c_ansi_function_decl($@)
|
||||||
#else
|
#else
|
||||||
$2 $1 ();
|
$2 $1 ();
|
||||||
@@ -300,7 +304,7 @@ $2 $1 ();
|
|||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# Declare the function NAME.
|
# Declare the function NAME.
|
||||||
m4_define([b4_c_ansi_function_decl],
|
m4_define([b4_c_ansi_function_decl],
|
||||||
[$2 $1 (b4_c_ansi_formals(m4_shiftn(2, $@)));[]dnl
|
[$2 $1 (b4_c_ansi_formals(m4_shift2($@)));[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -315,7 +319,7 @@ m4_define([b4_c_ansi_function_decl],
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Call the function NAME with arguments NAME1, NAME2 etc.
|
# Call the function NAME with arguments NAME1, NAME2 etc.
|
||||||
m4_define([b4_c_function_call],
|
m4_define([b4_c_function_call],
|
||||||
[$1 (b4_c_args(m4_shiftn(2, $@)))[]dnl
|
[$1 (b4_c_args(m4_shift2($@)))[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -333,14 +337,22 @@ m4_define([b4_c_arg],
|
|||||||
## Synclines. ##
|
## Synclines. ##
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
|
|
||||||
|
# b4_sync_start(LINE, FILE)
|
||||||
# b4_syncline(LINE, FILE)
|
|
||||||
# -----------------------
|
# -----------------------
|
||||||
m4_define([b4_syncline],
|
m4_define([b4_sync_start], [[#]line $1 $2])
|
||||||
[m4_if(b4_synclines_flag, 1,
|
|
||||||
[[#]line $1 $2])])
|
|
||||||
|
|
||||||
|
|
||||||
|
## -------------- ##
|
||||||
|
## User actions. ##
|
||||||
|
## -------------- ##
|
||||||
|
|
||||||
|
# b4_case(LABEL, STATEMENTS)
|
||||||
|
# --------------------------
|
||||||
|
m4_define([b4_case],
|
||||||
|
[ case $1:
|
||||||
|
$2
|
||||||
|
break;])
|
||||||
|
|
||||||
# b4_symbol_actions(FILENAME, LINENO,
|
# b4_symbol_actions(FILENAME, LINENO,
|
||||||
# SYMBOL-TAG, SYMBOL-NUM,
|
# SYMBOL-TAG, SYMBOL-NUM,
|
||||||
# SYMBOL-ACTION, SYMBOL-TYPENAME)
|
# SYMBOL-ACTION, SYMBOL-TYPENAME)
|
||||||
@@ -351,9 +363,9 @@ m4_define([b4_symbol_actions],
|
|||||||
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
|
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
|
||||||
case $4: /* $3 */
|
case $4: /* $3 */
|
||||||
b4_syncline([$2], [$1])
|
b4_syncline([$2], [$1])
|
||||||
$5;
|
$5;
|
||||||
b4_syncline([@oline@], [@ofile@])
|
b4_syncline([@oline@], [@ofile@])
|
||||||
break;
|
break;
|
||||||
m4_popdef([b4_at_dollar])dnl
|
m4_popdef([b4_at_dollar])dnl
|
||||||
m4_popdef([b4_dollar_dollar])dnl
|
m4_popdef([b4_dollar_dollar])dnl
|
||||||
])
|
])
|
||||||
@@ -369,17 +381,20 @@ m4_define_default([b4_yydestruct_generate],
|
|||||||
| Release the memory associated to this symbol. |
|
| Release the memory associated to this symbol. |
|
||||||
`-----------------------------------------------*/
|
`-----------------------------------------------*/
|
||||||
|
|
||||||
|
/*ARGSUSED*/
|
||||||
]$1([yydestruct],
|
]$1([yydestruct],
|
||||||
[static void],
|
[static void],
|
||||||
[[const char *yymsg], [yymsg]],
|
[[const char *yymsg], [yymsg]],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[YYSTYPE *yyvaluep], [yyvaluep]]b4_location_if([,
|
[[YYSTYPE *yyvaluep], [yyvaluep]][]dnl
|
||||||
[[YYLTYPE *yylocationp], [yylocationp]]]))[
|
b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl
|
||||||
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
/* Pacify ``unused variable'' warnings. */
|
YYUSE (yyvaluep);
|
||||||
(void) yyvaluep;
|
]b4_locations_if([ YYUSE (yylocationp);
|
||||||
]b4_location_if([ (void) yylocationp;
|
])dnl
|
||||||
])[
|
b4_parse_param_use[]dnl
|
||||||
|
[
|
||||||
if (!yymsg)
|
if (!yymsg)
|
||||||
yymsg = "Deleting";
|
yymsg = "Deleting";
|
||||||
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
||||||
@@ -388,53 +403,74 @@ m4_define_default([b4_yydestruct_generate],
|
|||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}]dnl
|
}]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_yysymprint_generate(FUNCTION-DECLARATOR)
|
# b4_yy_symbol_print_generate(FUNCTION-DECLARATOR)
|
||||||
# -------------------------------------------
|
# ------------------------------------------------
|
||||||
# Generate the "yysymprint" function, which declaration is issued using
|
# Generate the "yy_symbol_print" function, which declaration is issued using
|
||||||
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
||||||
# or "b4_c_function_def" for K&R.
|
# or "b4_c_function_def" for K&R.
|
||||||
m4_define_default([b4_yysymprint_generate],
|
m4_define_default([b4_yy_symbol_print_generate],
|
||||||
[[/*--------------------------------.
|
[[
|
||||||
|
/*--------------------------------.
|
||||||
| Print this symbol on YYOUTPUT. |
|
| Print this symbol on YYOUTPUT. |
|
||||||
`--------------------------------*/
|
`--------------------------------*/
|
||||||
|
|
||||||
]$1([yysymprint],
|
/*ARGSUSED*/
|
||||||
|
]$1([yy_symbol_value_print],
|
||||||
[static void],
|
[static void],
|
||||||
[[FILE *yyoutput], [yyoutput]],
|
[[FILE *yyoutput], [yyoutput]],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[YYSTYPE *yyvaluep], [yyvaluep]]b4_location_if([,
|
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
||||||
[[YYLTYPE *yylocationp], [yylocationp]]]))
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
/* Pacify ``unused variable'' warnings. */
|
if (!yyvaluep)
|
||||||
(void) yyvaluep;
|
return;
|
||||||
b4_location_if([ (void) yylocationp;
|
]b4_locations_if([ YYUSE (yylocationp);
|
||||||
])dnl
|
])dnl
|
||||||
[
|
b4_parse_param_use[]dnl
|
||||||
if (yytype < YYNTOKENS)
|
[# ifdef YYPRINT
|
||||||
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
|
|
||||||
else
|
|
||||||
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
|
||||||
|
|
||||||
]b4_location_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
|
|
||||||
YYFPRINTF (yyoutput, ": ");
|
|
||||||
])dnl
|
|
||||||
[
|
|
||||||
# ifdef YYPRINT
|
|
||||||
if (yytype < YYNTOKENS)
|
if (yytype < YYNTOKENS)
|
||||||
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
||||||
|
# else
|
||||||
|
YYUSE (yyoutput);
|
||||||
# endif
|
# endif
|
||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
||||||
[ default:
|
[ default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
YYFPRINTF (yyoutput, ")");
|
|
||||||
}
|
}
|
||||||
]])
|
|
||||||
|
|
||||||
|
/*--------------------------------.
|
||||||
|
| Print this symbol on YYOUTPUT. |
|
||||||
|
`--------------------------------*/
|
||||||
|
|
||||||
|
]$1([yy_symbol_print],
|
||||||
|
[static void],
|
||||||
|
[[FILE *yyoutput], [yyoutput]],
|
||||||
|
[[int yytype], [yytype]],
|
||||||
|
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
||||||
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
|
{
|
||||||
|
if (yytype < YYNTOKENS)
|
||||||
|
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
|
||||||
|
else
|
||||||
|
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
||||||
|
|
||||||
|
]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
|
||||||
|
YYFPRINTF (yyoutput, ": ");
|
||||||
|
])dnl
|
||||||
|
[ yy_symbol_value_print (yyoutput, yytype, yyvaluep]dnl
|
||||||
|
b4_locations_if([, yylocationp])[]b4_user_args[);
|
||||||
|
YYFPRINTF (yyoutput, ")");
|
||||||
|
}]dnl
|
||||||
|
])
|
||||||
|
|||||||
+965
-671
File diff suppressed because it is too large
Load Diff
+376
@@ -0,0 +1,376 @@
|
|||||||
|
-*- C -*-
|
||||||
|
|
||||||
|
# C++ GLR skeleton for Bison
|
||||||
|
# Copyright (C) 2002-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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 skeleton produces a C++ class that encapsulates a C glr parser.
|
||||||
|
# This is in order to reduce the maintenance burden. The glr.c
|
||||||
|
# skeleton is clean and pure enough so that there are no real
|
||||||
|
# problems. The C++ interface is the same as that of lalr1.cc. In
|
||||||
|
# fact, glr.c can replace yacc.c without the user noticing any
|
||||||
|
# difference, and similarly for glr.cc replacing lalr1.cc.
|
||||||
|
#
|
||||||
|
# The passing of parse-params
|
||||||
|
#
|
||||||
|
# The additional arguments are stored as members of the parser
|
||||||
|
# object, yyparser. The C routines need to carry yyparser
|
||||||
|
# throughout the C parser; that easy: just let yyparser become an
|
||||||
|
# additional parse-param. But because the C++ skeleton needs to
|
||||||
|
# know the "real" original parse-param, we save them
|
||||||
|
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
|
||||||
|
# (and c.m4 strips one level of quotes). This is a PITA, and
|
||||||
|
# explains why there are so many levels of quotes.
|
||||||
|
#
|
||||||
|
# The locations
|
||||||
|
#
|
||||||
|
# We use location.cc just like lalr1.cc, but because glr.c stores
|
||||||
|
# the locations in a (C++) union, the position and location classes
|
||||||
|
# must not have a constructor. Therefore, contrary to lalr1.cc, we
|
||||||
|
# must not define "b4_location_constructors". As a consequence the
|
||||||
|
# user must initialize the first positions (in particular the
|
||||||
|
# filename member).
|
||||||
|
|
||||||
|
# We require a pure interface using locations.
|
||||||
|
m4_define([b4_locations_flag], [1])
|
||||||
|
m4_define([b4_pure_flag], [1])
|
||||||
|
|
||||||
|
# The header is mandatory.
|
||||||
|
b4_defines_if([],
|
||||||
|
[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]))
|
||||||
|
|
||||||
|
|
||||||
|
# b4_yy_symbol_print_generate
|
||||||
|
# ---------------------------
|
||||||
|
# Bypass the default implementation to generate the "yy_symbol_print"
|
||||||
|
# and "yy_symbol_value_print" functions.
|
||||||
|
m4_define([b4_yy_symbol_print_generate],
|
||||||
|
[[
|
||||||
|
/*--------------------.
|
||||||
|
| Print this symbol. |
|
||||||
|
`--------------------*/
|
||||||
|
|
||||||
|
]b4_c_ansi_function_def([yy_symbol_print],
|
||||||
|
[static void],
|
||||||
|
[[FILE *], []],
|
||||||
|
[[int yytype], [yytype]],
|
||||||
|
[[const b4_namespace_ref::b4_parser_class_name::semantic_type *yyvaluep],
|
||||||
|
[yyvaluep]],
|
||||||
|
[[const b4_namespace_ref::b4_parser_class_name::location_type *yylocationp],
|
||||||
|
[yylocationp]],
|
||||||
|
b4_parse_param)[
|
||||||
|
{
|
||||||
|
]b4_parse_param_use[]dnl
|
||||||
|
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[);
|
||||||
|
}
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
# Declare yyerror.
|
||||||
|
m4_append([b4_post_prologue],
|
||||||
|
[b4_syncline([@oline@], [@ofile@])
|
||||||
|
|
||||||
|
b4_c_ansi_function_decl([yyerror],
|
||||||
|
[static void],
|
||||||
|
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||||
|
b4_parse_param,
|
||||||
|
[[const char* msg], [msg]])])
|
||||||
|
|
||||||
|
|
||||||
|
# Define yyerror.
|
||||||
|
m4_append([b4_epilogue],
|
||||||
|
[b4_syncline([@oline@], [@ofile@])[
|
||||||
|
/*------------------.
|
||||||
|
| Report an error. |
|
||||||
|
`------------------*/
|
||||||
|
|
||||||
|
]b4_c_ansi_function_def([yyerror],
|
||||||
|
[static void],
|
||||||
|
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||||
|
b4_parse_param,
|
||||||
|
[[const char* msg], [msg]])[
|
||||||
|
{
|
||||||
|
]b4_parse_param_use[]dnl
|
||||||
|
[ yyparser.error (*yylocationp, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
]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.
|
||||||
|
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||||
|
:])[
|
||||||
|
#if YYDEBUG
|
||||||
|
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
|
||||||
|
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
||||||
|
#endif]b4_parse_param_cons[
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
]b4_parser_class_name::~b4_parser_class_name[ ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
]b4_parser_class_name[::parse ()
|
||||||
|
{
|
||||||
|
return ::yyparse (*this]b4_user_args[);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if YYDEBUG
|
||||||
|
/*--------------------.
|
||||||
|
| Print this symbol. |
|
||||||
|
`--------------------*/
|
||||||
|
|
||||||
|
inline void
|
||||||
|
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
||||||
|
const semantic_type* yyvaluep, const location_type* yylocationp)
|
||||||
|
{
|
||||||
|
/* Pacify ``unused variable'' warnings. */
|
||||||
|
YYUSE (yyvaluep);
|
||||||
|
YYUSE (yylocationp);
|
||||||
|
switch (yytype)
|
||||||
|
{
|
||||||
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
||||||
|
[ default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
|
||||||
|
const semantic_type* yyvaluep, const location_type* yylocationp)
|
||||||
|
{
|
||||||
|
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
|
||||||
|
<< ' ' << yytname[yytype] << " ("
|
||||||
|
<< *yylocationp << ": ";
|
||||||
|
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
|
||||||
|
*yycdebug_ << ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ostream&
|
||||||
|
]b4_parser_class_name[::debug_stream () const
|
||||||
|
{
|
||||||
|
return *yycdebug_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::set_debug_stream (std::ostream& o)
|
||||||
|
{
|
||||||
|
yycdebug_ = &o;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
]b4_parser_class_name[::debug_level_type
|
||||||
|
]b4_parser_class_name[::debug_level () const
|
||||||
|
{
|
||||||
|
return yydebug_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
||||||
|
{
|
||||||
|
yydebug_ = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
]m4_popdef([b4_parse_param])dnl
|
||||||
|
b4_namespace_close[
|
||||||
|
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
# 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_ref::b4_parser_class_name& yyparser], [[yyparser]]],]
|
||||||
|
m4_defn([b4_parse_param])))],
|
||||||
|
[m4_pushdef([b4_parse_param],
|
||||||
|
[[[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]]]])
|
||||||
|
])
|
||||||
|
m4_include(b4_pkgdatadir/[glr.c])
|
||||||
|
m4_popdef([b4_parse_param])
|
||||||
|
|
||||||
|
m4_divert_push(0)
|
||||||
|
@output(b4_spec_defines_file@)@
|
||||||
|
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||||
|
[2002-2006, 2009-2010])[
|
||||||
|
|
||||||
|
/* C++ GLR parser skeleton written by Akim Demaille. */
|
||||||
|
|
||||||
|
#ifndef PARSER_HEADER_H
|
||||||
|
# define PARSER_HEADER_H
|
||||||
|
|
||||||
|
]b4_percent_code_get([[requires]])[
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
/* Using locations. */
|
||||||
|
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||||
|
|
||||||
|
]b4_namespace_open[
|
||||||
|
class position;
|
||||||
|
class location;
|
||||||
|
]b4_namespace_close[
|
||||||
|
|
||||||
|
#include "location.hh"
|
||||||
|
|
||||||
|
/* Enabling traces. */
|
||||||
|
#ifndef YYDEBUG
|
||||||
|
# define YYDEBUG ]b4_debug_flag[
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||||
|
If N is 0, then set CURRENT to the empty location which ends
|
||||||
|
the previous symbol: RHS[0] (always defined). */
|
||||||
|
|
||||||
|
#ifndef YYLLOC_DEFAULT
|
||||||
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
|
do \
|
||||||
|
if (N) \
|
||||||
|
{ \
|
||||||
|
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
||||||
|
(Current).end = YYRHSLOC (Rhs, N).end; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
||||||
|
} \
|
||||||
|
while (/*CONSTCOND*/ 0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
]b4_namespace_open[
|
||||||
|
/// A Bison parser.
|
||||||
|
class ]b4_parser_class_name[
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/// Symbol semantic values.
|
||||||
|
#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;]])])[
|
||||||
|
#else
|
||||||
|
typedef YYSTYPE semantic_type;
|
||||||
|
#endif
|
||||||
|
/// Symbol locations.
|
||||||
|
typedef ]b4_percent_define_get([[location_type]])[ location_type;
|
||||||
|
/// Tokens.
|
||||||
|
struct token
|
||||||
|
{
|
||||||
|
]b4_token_enums(b4_tokens)[
|
||||||
|
};
|
||||||
|
/// Token type.
|
||||||
|
typedef token::yytokentype token_type;
|
||||||
|
|
||||||
|
/// Build a parser object.
|
||||||
|
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
||||||
|
virtual ~]b4_parser_class_name[ ();
|
||||||
|
|
||||||
|
/// Parse.
|
||||||
|
/// \returns 0 iff parsing succeeded.
|
||||||
|
virtual int parse ();
|
||||||
|
|
||||||
|
/// The current debugging stream.
|
||||||
|
std::ostream& debug_stream () const;
|
||||||
|
/// Set the current debugging stream.
|
||||||
|
void set_debug_stream (std::ostream &);
|
||||||
|
|
||||||
|
/// Type for debugging levels.
|
||||||
|
typedef int debug_level_type;
|
||||||
|
/// The current debugging level.
|
||||||
|
debug_level_type debug_level () const;
|
||||||
|
/// Set the current debugging level.
|
||||||
|
void set_debug_level (debug_level_type l);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// Report a syntax error.
|
||||||
|
/// \param loc where the syntax error is found.
|
||||||
|
/// \param msg a description of the syntax error.
|
||||||
|
virtual void error (const location_type& loc, const std::string& msg);
|
||||||
|
private:
|
||||||
|
|
||||||
|
#if YYDEBUG
|
||||||
|
public:
|
||||||
|
/// \brief Report a symbol value on the debug stream.
|
||||||
|
/// \param yytype The token type.
|
||||||
|
/// \param yyvaluep Its semantic value.
|
||||||
|
/// \param yylocationp Its location.
|
||||||
|
virtual void yy_symbol_value_print_ (int yytype,
|
||||||
|
const semantic_type* yyvaluep,
|
||||||
|
const location_type* yylocationp);
|
||||||
|
/// \brief Report a symbol on the debug stream.
|
||||||
|
/// \param yytype The token type.
|
||||||
|
/// \param yyvaluep Its semantic value.
|
||||||
|
/// \param yylocationp Its location.
|
||||||
|
virtual void yy_symbol_print_ (int yytype,
|
||||||
|
const semantic_type* yyvaluep,
|
||||||
|
const location_type* yylocationp);
|
||||||
|
private:
|
||||||
|
/* Debugging. */
|
||||||
|
int yydebug_;
|
||||||
|
std::ostream* yycdebug_;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/// \brief Reclaim the memory associated to a symbol.
|
||||||
|
/// \param yymsg Why this token is reclaimed.
|
||||||
|
/// \param yytype The symbol type.
|
||||||
|
/// \param yyvaluep Its semantic value.
|
||||||
|
/// \param yylocationp Its location.
|
||||||
|
inline void yydestruct_ (const char* yymsg,
|
||||||
|
int yytype,
|
||||||
|
semantic_type* yyvaluep,
|
||||||
|
location_type* yylocationp);
|
||||||
|
|
||||||
|
]b4_parse_param_vars[
|
||||||
|
};
|
||||||
|
|
||||||
|
]dnl Redirections for glr.c.
|
||||||
|
b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||||
|
[b4_token_defines(b4_tokens)])
|
||||||
|
[
|
||||||
|
#ifndef YYSTYPE
|
||||||
|
# define YYSTYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
|
||||||
|
#endif
|
||||||
|
#ifndef YYLTYPE
|
||||||
|
# define YYLTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
|
||||||
|
#endif
|
||||||
|
|
||||||
|
]b4_namespace_close[
|
||||||
|
|
||||||
|
]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, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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)
|
||||||
+303
@@ -0,0 +1,303 @@
|
|||||||
|
-*- Autoconf -*-
|
||||||
|
|
||||||
|
# Java language support for Bison
|
||||||
|
|
||||||
|
# Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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_list2(LIST1, LIST2)
|
||||||
|
# --------------------------
|
||||||
|
# Join two lists with a comma if necessary.
|
||||||
|
m4_define([b4_list2],
|
||||||
|
[$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_percent_define_get3(DEF, PRE, POST, NOT)
|
||||||
|
# -------------------------------------------
|
||||||
|
# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed,
|
||||||
|
# otherwise NOT.
|
||||||
|
m4_define([b4_percent_define_get3],
|
||||||
|
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
|
||||||
|
[$2[]b4_percent_define_get([$1])[]$3], [$4])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# 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_final_if(TRUE, FALSE)
|
||||||
|
# ---------------------------
|
||||||
|
b4_percent_define_default([[final]], [[false]])
|
||||||
|
m4_define([b4_final_if],
|
||||||
|
[b4_percent_define_flag_if([final], [$1], [$2])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_strictfp_if(TRUE, FALSE)
|
||||||
|
# ---------------------------
|
||||||
|
b4_percent_define_default([[strictfp]], [[false]])
|
||||||
|
m4_define([b4_strictfp_if],
|
||||||
|
[b4_percent_define_flag_if([strictfp], [$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],
|
||||||
|
[ /** 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([$#$1], [1], [],
|
||||||
|
[/* 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]])])
|
||||||
|
|
||||||
|
# %name-prefix
|
||||||
|
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]], [])])
|
||||||
|
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(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# 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])])
|
||||||
+700
-907
File diff suppressed because it is too large
Load Diff
+881
@@ -0,0 +1,881 @@
|
|||||||
|
# Java skeleton for Bison -*- autoconf -*-
|
||||||
|
|
||||||
|
# Copyright (C) 2007-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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-2010])
|
||||||
|
|
||||||
|
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>]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[</tt>.
|
||||||
|
*
|
||||||
|
* @@author LALR (1) parser skeleton written by Paolo Bonzini.
|
||||||
|
*/
|
||||||
|
]b4_public_if([public ])dnl
|
||||||
|
b4_abstract_if([abstract ])dnl
|
||||||
|
b4_final_if([final ])dnl
|
||||||
|
b4_strictfp_if([strictfp ])dnl
|
||||||
|
[class ]b4_parser_class_name[]dnl
|
||||||
|
b4_percent_define_get3([extends], [ extends ])dnl
|
||||||
|
b4_percent_define_get3([implements], [ implements ])[
|
||||||
|
{
|
||||||
|
]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 <code>]b4_location_type[</code> 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 end 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([[@@param 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 yylexer The scanner that will supply tokens to the parser.
|
||||||
|
*/
|
||||||
|
b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) {
|
||||||
|
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 ((]b4_location_type[)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. Formally deprecated in Bison 2.4.2's NEWS entry, where
|
||||||
|
* a plan to phase it out is discussed. */
|
||||||
|
public static final int YYFAIL = 3;
|
||||||
|
|
||||||
|
private static final int YYNEWSTATE = 4;
|
||||||
|
private static final int YYDEFAULT = 5;
|
||||||
|
private static final int YYREDUCE = 6;
|
||||||
|
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_maybe_throws([b4_throws])[
|
||||||
|
{
|
||||||
|
]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.toString ()) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_list2([b4_lex_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
|
||||||
@@ -0,0 +1,275 @@
|
|||||||
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
|
# Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
# We do want M4 expansion after # for CPP macros.
|
||||||
|
m4_changecom()
|
||||||
|
m4_divert_push(0)dnl
|
||||||
|
@output(b4_dir_prefix[]position.hh@)@
|
||||||
|
b4_copyright([Positions for Bison parsers in C++],
|
||||||
|
[2002-2007, 2009-2010])[
|
||||||
|
|
||||||
|
/**
|
||||||
|
** \file position.hh
|
||||||
|
** Define the ]b4_namespace_ref[::position class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BISON_POSITION_HH
|
||||||
|
# define BISON_POSITION_HH
|
||||||
|
|
||||||
|
# include <iostream>
|
||||||
|
# include <string>
|
||||||
|
# include <algorithm>
|
||||||
|
|
||||||
|
]b4_namespace_open[
|
||||||
|
/// Abstract a position.
|
||||||
|
class position
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
]m4_ifdef([b4_location_constructors], [
|
||||||
|
/// Construct a position.
|
||||||
|
position ()
|
||||||
|
: filename (0), line (]b4_location_initial_line[), column (]b4_location_initial_column[)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
])[
|
||||||
|
/// Initialization.
|
||||||
|
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||||
|
{
|
||||||
|
filename = fn;
|
||||||
|
line = ]b4_location_initial_line[;
|
||||||
|
column = ]b4_location_initial_column[;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \name Line and Column related manipulators
|
||||||
|
** \{ */
|
||||||
|
public:
|
||||||
|
/// (line related) Advance to the COUNT next lines.
|
||||||
|
inline void lines (int count = 1)
|
||||||
|
{
|
||||||
|
column = ]b4_location_initial_column[;
|
||||||
|
line += count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// (column related) Advance to the COUNT next columns.
|
||||||
|
inline void columns (int count = 1)
|
||||||
|
{
|
||||||
|
column = std::max (]b4_location_initial_column[u, column + count);
|
||||||
|
}
|
||||||
|
/** \} */
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// File name to which this position refers.
|
||||||
|
]b4_percent_define_get([[filename_type]])[* filename;
|
||||||
|
/// Current line number.
|
||||||
|
unsigned int line;
|
||||||
|
/// Current column number.
|
||||||
|
unsigned int column;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Add and assign a position.
|
||||||
|
inline const position&
|
||||||
|
operator+= (position& res, const int width)
|
||||||
|
{
|
||||||
|
res.columns (width);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add two position objects.
|
||||||
|
inline const position
|
||||||
|
operator+ (const position& begin, const int width)
|
||||||
|
{
|
||||||
|
position res = begin;
|
||||||
|
return res += width;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add and assign a position.
|
||||||
|
inline const position&
|
||||||
|
operator-= (position& res, const int width)
|
||||||
|
{
|
||||||
|
return res += -width;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add two position objects.
|
||||||
|
inline const position
|
||||||
|
operator- (const position& begin, const int width)
|
||||||
|
{
|
||||||
|
return begin + -width;
|
||||||
|
}
|
||||||
|
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||||
|
/// Compare two position objects.
|
||||||
|
inline bool
|
||||||
|
operator== (const position& pos1, const position& pos2)
|
||||||
|
{
|
||||||
|
return (pos1.line == pos2.line
|
||||||
|
&& pos1.column == pos2.column
|
||||||
|
&& (pos1.filename == pos2.filename
|
||||||
|
|| (pos1.filename && pos2.filename
|
||||||
|
&& *pos1.filename == *pos2.filename)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Compare two position objects.
|
||||||
|
inline bool
|
||||||
|
operator!= (const position& pos1, const position& pos2)
|
||||||
|
{
|
||||||
|
return !(pos1 == pos2);
|
||||||
|
}
|
||||||
|
]])[
|
||||||
|
/** \brief Intercept output stream redirection.
|
||||||
|
** \param ostr the destination output stream
|
||||||
|
** \param pos a reference to the position to redirect
|
||||||
|
*/
|
||||||
|
inline std::ostream&
|
||||||
|
operator<< (std::ostream& ostr, const position& pos)
|
||||||
|
{
|
||||||
|
if (pos.filename)
|
||||||
|
ostr << *pos.filename << ':';
|
||||||
|
return ostr << pos.line << '.' << pos.column;
|
||||||
|
}
|
||||||
|
|
||||||
|
]b4_namespace_close[
|
||||||
|
#endif // not BISON_POSITION_HH]
|
||||||
|
@output(b4_dir_prefix[]location.hh@)@
|
||||||
|
b4_copyright([Locations for Bison parsers in C++],
|
||||||
|
[2002-2007, 2009-2010])[
|
||||||
|
|
||||||
|
/**
|
||||||
|
** \file location.hh
|
||||||
|
** Define the ]b4_namespace_ref[::location class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BISON_LOCATION_HH
|
||||||
|
# define BISON_LOCATION_HH
|
||||||
|
|
||||||
|
# include <iostream>
|
||||||
|
# include <string>
|
||||||
|
# include "position.hh"
|
||||||
|
|
||||||
|
]b4_namespace_open[
|
||||||
|
|
||||||
|
/// Abstract a location.
|
||||||
|
class location
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
]m4_ifdef([b4_location_constructors], [
|
||||||
|
/// Construct a location.
|
||||||
|
location ()
|
||||||
|
: begin (), end ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
])[
|
||||||
|
/// Initialization.
|
||||||
|
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||||
|
{
|
||||||
|
begin.initialize (fn);
|
||||||
|
end = begin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \name Line and Column related manipulators
|
||||||
|
** \{ */
|
||||||
|
public:
|
||||||
|
/// Reset initial location to final location.
|
||||||
|
inline void step ()
|
||||||
|
{
|
||||||
|
begin = end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Extend the current location to the COUNT next columns.
|
||||||
|
inline void columns (unsigned int count = 1)
|
||||||
|
{
|
||||||
|
end += count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Extend the current location to the COUNT next lines.
|
||||||
|
inline void lines (unsigned int count = 1)
|
||||||
|
{
|
||||||
|
end.lines (count);
|
||||||
|
}
|
||||||
|
/** \} */
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// Beginning of the located region.
|
||||||
|
position begin;
|
||||||
|
/// End of the located region.
|
||||||
|
position end;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Join two location objects to create a location.
|
||||||
|
inline const location operator+ (const location& begin, const location& end)
|
||||||
|
{
|
||||||
|
location res = begin;
|
||||||
|
res.end = end.end;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add two location objects.
|
||||||
|
inline const location operator+ (const location& begin, unsigned int width)
|
||||||
|
{
|
||||||
|
location res = begin;
|
||||||
|
res.columns (width);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add and assign a location.
|
||||||
|
inline location& operator+= (location& res, unsigned int width)
|
||||||
|
{
|
||||||
|
res.columns (width);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||||
|
/// Compare two location objects.
|
||||||
|
inline bool
|
||||||
|
operator== (const location& loc1, const location& loc2)
|
||||||
|
{
|
||||||
|
return loc1.begin == loc2.begin && loc1.end == loc2.end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Compare two location objects.
|
||||||
|
inline bool
|
||||||
|
operator!= (const location& loc1, const location& loc2)
|
||||||
|
{
|
||||||
|
return !(loc1 == loc2);
|
||||||
|
}
|
||||||
|
]])[
|
||||||
|
/** \brief Intercept output stream redirection.
|
||||||
|
** \param ostr the destination output stream
|
||||||
|
** \param loc a reference to the location to redirect
|
||||||
|
**
|
||||||
|
** Avoid duplicate information.
|
||||||
|
*/
|
||||||
|
inline std::ostream& operator<< (std::ostream& ostr, const location& loc)
|
||||||
|
{
|
||||||
|
position last = loc.end - 1;
|
||||||
|
ostr << loc.begin;
|
||||||
|
if (last.filename
|
||||||
|
&& (!loc.begin.filename
|
||||||
|
|| *loc.begin.filename != *last.filename))
|
||||||
|
ostr << '-' << last;
|
||||||
|
else if (loc.begin.line != last.line)
|
||||||
|
ostr << '-' << last.line << '.' << last.column;
|
||||||
|
else if (loc.begin.column != last.column)
|
||||||
|
ostr << '-' << last.column;
|
||||||
|
return ostr;
|
||||||
|
}
|
||||||
|
|
||||||
|
]b4_namespace_close[
|
||||||
|
|
||||||
|
#endif // not BISON_LOCATION_HH]
|
||||||
|
m4_divert_pop(0)
|
||||||
|
m4_changecom([#])
|
||||||
@@ -0,0 +1,400 @@
|
|||||||
|
# -*- Autoconf -*-
|
||||||
|
# This file is part of Autoconf.
|
||||||
|
# foreach-based replacements for recursive functions.
|
||||||
|
# Speeds up GNU M4 1.4.x by avoiding quadratic $@ recursion, but penalizes
|
||||||
|
# GNU M4 1.6 by requiring more memory and macro expansions.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2008 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# As a special exception, the Free Software Foundation gives unlimited
|
||||||
|
# permission to copy, distribute and modify the configure scripts that
|
||||||
|
# are the output of Autoconf. You need not follow the terms of the GNU
|
||||||
|
# General Public License when using or distributing such scripts, even
|
||||||
|
# though portions of the text of Autoconf appear in them. The GNU
|
||||||
|
# General Public License (GPL) does govern all other use of the material
|
||||||
|
# that constitutes the Autoconf program.
|
||||||
|
#
|
||||||
|
# Certain portions of the Autoconf source text are designed to be copied
|
||||||
|
# (in certain cases, depending on the input) into the output of
|
||||||
|
# Autoconf. We call these the "data" portions. The rest of the Autoconf
|
||||||
|
# source text consists of comments plus executable code that decides which
|
||||||
|
# of the data portions to output in any given case. We call these
|
||||||
|
# comments and executable code the "non-data" portions. Autoconf never
|
||||||
|
# copies any of the non-data portions into its output.
|
||||||
|
#
|
||||||
|
# This special exception to the GPL applies to versions of Autoconf
|
||||||
|
# released by the Free Software Foundation. When you make and
|
||||||
|
# distribute a modified version of Autoconf, you may extend this special
|
||||||
|
# exception to the GPL to apply to your modified version as well, *unless*
|
||||||
|
# your modified version has the potential to copy into its output some
|
||||||
|
# of the text that was the non-data portion of the version that you started
|
||||||
|
# with. (In other words, unless your change moves or copies text from
|
||||||
|
# the non-data portions to the data portions.) If your modification has
|
||||||
|
# such potential, you must delete any notice of this special exception
|
||||||
|
# to the GPL from your modified version.
|
||||||
|
#
|
||||||
|
# Written by Eric Blake.
|
||||||
|
#
|
||||||
|
|
||||||
|
# In M4 1.4.x, every byte of $@ is rescanned. This means that an
|
||||||
|
# algorithm on n arguments that recurses with one less argument each
|
||||||
|
# iteration will scan n * (n + 1) / 2 arguments, for O(n^2) time. In
|
||||||
|
# M4 1.6, this was fixed so that $@ is only scanned once, then
|
||||||
|
# back-references are made to information stored about the scan.
|
||||||
|
# Thus, n iterations need only scan n arguments, for O(n) time.
|
||||||
|
# Additionally, in M4 1.4.x, recursive algorithms did not clean up
|
||||||
|
# memory very well, requiring O(n^2) memory rather than O(n) for n
|
||||||
|
# iterations.
|
||||||
|
#
|
||||||
|
# This file is designed to overcome the quadratic nature of $@
|
||||||
|
# recursion by writing a variant of m4_foreach that uses m4_for rather
|
||||||
|
# than $@ recursion to operate on the list. This involves more macro
|
||||||
|
# expansions, but avoids the need to rescan a quadratic number of
|
||||||
|
# arguments, making these replacements very attractive for M4 1.4.x.
|
||||||
|
# On the other hand, in any version of M4, expanding additional macros
|
||||||
|
# costs additional time; therefore, in M4 1.6, where $@ recursion uses
|
||||||
|
# fewer macros, these replacements actually pessimize performance.
|
||||||
|
# Additionally, the use of $10 to mean the tenth argument violates
|
||||||
|
# POSIX; although all versions of m4 1.4.x support this meaning, a
|
||||||
|
# future m4 version may switch to take it as the first argument
|
||||||
|
# concatenated with a literal 0, so the implementations in this file
|
||||||
|
# are not future-proof. Thus, this file is conditionally included as
|
||||||
|
# part of m4_init(), only when it is detected that M4 probably has
|
||||||
|
# quadratic behavior (ie. it lacks the macro __m4_version__).
|
||||||
|
#
|
||||||
|
# Please keep this file in sync with m4sugar.m4.
|
||||||
|
|
||||||
|
# m4_foreach(VARIABLE, LIST, EXPRESSION)
|
||||||
|
# --------------------------------------
|
||||||
|
# Expand EXPRESSION assigning each value of the LIST to VARIABLE.
|
||||||
|
# LIST should have the form `item_1, item_2, ..., item_n', i.e. the
|
||||||
|
# whole list must *quoted*. Quote members too if you don't want them
|
||||||
|
# to be expanded.
|
||||||
|
#
|
||||||
|
# This version minimizes the number of times that $@ is evaluated by
|
||||||
|
# using m4_for to generate a boilerplate into VARIABLE then passing $@
|
||||||
|
# to that temporary macro. Thus, the recursion is done in m4_for
|
||||||
|
# without reparsing any user input, and is not quadratic. For an idea
|
||||||
|
# of how this works, note that m4_foreach(i,[1,2],[i]) defines i to be
|
||||||
|
# m4_define([$1],[$3])$2[]m4_define([$1],[$4])$2[]m4_popdef([i])
|
||||||
|
# then calls i([i],[i],[1],[2]).
|
||||||
|
m4_define([m4_foreach],
|
||||||
|
[m4_if([$2], [], [], [_$0([$1], [$3], $2)])])
|
||||||
|
|
||||||
|
m4_define([_m4_foreach],
|
||||||
|
[m4_define([$1], m4_pushdef([$1])_m4_for([$1], [3], [$#], [1],
|
||||||
|
[$0_([1], [2], _m4_defn([$1]))])[m4_popdef([$1])])m4_indir([$1], $@)])
|
||||||
|
|
||||||
|
m4_define([_m4_foreach_],
|
||||||
|
[[m4_define([$$1], [$$3])$$2[]]])
|
||||||
|
|
||||||
|
# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT)
|
||||||
|
# -----------------------------------------------------------
|
||||||
|
# Find the first VAL that SWITCH matches, and expand the corresponding
|
||||||
|
# IF-VAL. If there are no matches, expand DEFAULT.
|
||||||
|
#
|
||||||
|
# Use m4_for to create a temporary macro in terms of a boilerplate
|
||||||
|
# m4_if with final cleanup. If $# is even, we have DEFAULT; if it is
|
||||||
|
# odd, then rounding the last $# up in the temporary macro is
|
||||||
|
# harmless. For example, both m4_case(1,2,3,4,5) and
|
||||||
|
# m4_case(1,2,3,4,5,6) result in the intermediate _m4_case being
|
||||||
|
# m4_if([$1],[$2],[$3],[$1],[$4],[$5],_m4_popdef([_m4_case])[$6])
|
||||||
|
m4_define([m4_case],
|
||||||
|
[m4_if(m4_eval([$# <= 2]), [1], [$2],
|
||||||
|
[m4_pushdef([_$0], [m4_if(]m4_for([_m4_count], [2], m4_decr([$#]), [2],
|
||||||
|
[_$0_([1], _m4_count, m4_incr(_m4_count))])[_m4_popdef(
|
||||||
|
[_$0])]m4_dquote($m4_eval([($# + 1) & ~1]))[)])_$0($@)])])
|
||||||
|
|
||||||
|
m4_define([_m4_case_],
|
||||||
|
[[[$$1],[$$2],[$$3],]])
|
||||||
|
|
||||||
|
# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
|
||||||
|
# -----------------------------------------------------
|
||||||
|
# m4 equivalent of
|
||||||
|
#
|
||||||
|
# if (SWITCH =~ RE1)
|
||||||
|
# VAL1;
|
||||||
|
# elif (SWITCH =~ RE2)
|
||||||
|
# VAL2;
|
||||||
|
# elif ...
|
||||||
|
# ...
|
||||||
|
# else
|
||||||
|
# DEFAULT
|
||||||
|
#
|
||||||
|
# We build the temporary macro _m4_b:
|
||||||
|
# m4_define([_m4_b], _m4_defn([_m4_bmatch]))_m4_b([$1], [$2], [$3])...
|
||||||
|
# _m4_b([$1], [$m-1], [$m])_m4_b([], [], [$m+1]_m4_popdef([_m4_b]))
|
||||||
|
# then invoke m4_unquote(_m4_b($@)), for concatenation with later text.
|
||||||
|
m4_define([m4_bmatch],
|
||||||
|
[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
|
||||||
|
[$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
|
||||||
|
[$#], 2, [$2],
|
||||||
|
[m4_define([_m4_b], m4_pushdef([_m4_b])[m4_define([_m4_b],
|
||||||
|
_m4_defn([_$0]))]_m4_for([_m4_b], [3], m4_eval([($# + 1) / 2 * 2 - 1]),
|
||||||
|
[2], [_$0_([1], m4_decr(_m4_b), _m4_b)])[_m4_b([], [],]m4_dquote(
|
||||||
|
[$]m4_incr(_m4_b))[_m4_popdef([_m4_b]))])m4_unquote(_m4_b($@))])])
|
||||||
|
|
||||||
|
m4_define([_m4_bmatch],
|
||||||
|
[m4_if(m4_bregexp([$1], [$2]), [-1], [], [[$3]m4_define([$0])])])
|
||||||
|
|
||||||
|
m4_define([_m4_bmatch_],
|
||||||
|
[[_m4_b([$$1], [$$2], [$$3])]])
|
||||||
|
|
||||||
|
|
||||||
|
# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT])
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
# Similar to m4_if, except that each TEST is expanded when encountered.
|
||||||
|
# If the expansion of TESTn matches the string VALn, the result is IF-VALn.
|
||||||
|
# The result is DEFAULT if no tests passed. This macro allows
|
||||||
|
# short-circuiting of expensive tests, where it pays to arrange quick
|
||||||
|
# filter tests to run first.
|
||||||
|
#
|
||||||
|
# m4_cond already guarantees either 3*n or 3*n + 1 arguments, 1 <= n.
|
||||||
|
# We only have to speed up _m4_cond, by building the temporary _m4_c:
|
||||||
|
# m4_define([_m4_c], _m4_defn([m4_unquote]))_m4_c([m4_if(($1), [($2)],
|
||||||
|
# [[$3]m4_define([_m4_c])])])_m4_c([m4_if(($4), [($5)],
|
||||||
|
# [[$6]m4_define([_m4_c])])])..._m4_c([m4_if(($m-2), [($m-1)],
|
||||||
|
# [[$m]m4_define([_m4_c])])])_m4_c([[$m+1]]_m4_popdef([_m4_c]))
|
||||||
|
# We invoke m4_unquote(_m4_c($@)), for concatenation with later text.
|
||||||
|
m4_define([_m4_cond],
|
||||||
|
[m4_define([_m4_c], m4_pushdef([_m4_c])[m4_define([_m4_c],
|
||||||
|
_m4_defn([m4_unquote]))]_m4_for([_m4_c], [2], m4_eval([$# / 3 * 3 - 1]), [3],
|
||||||
|
[$0_(m4_decr(_m4_c), _m4_c, m4_incr(_m4_c))])[_m4_c(]m4_dquote(m4_dquote(
|
||||||
|
[$]m4_eval([$# / 3 * 3 + 1])))[_m4_popdef([_m4_c]))])m4_unquote(_m4_c($@))])
|
||||||
|
|
||||||
|
m4_define([_m4_cond_],
|
||||||
|
[[_m4_c([m4_if(($$1), [($$2)], [[$$3]m4_define([_m4_c])])])]])
|
||||||
|
|
||||||
|
# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
|
||||||
|
# ----------------------------------------------------
|
||||||
|
# m4 equivalent of
|
||||||
|
#
|
||||||
|
# $_ = STRING;
|
||||||
|
# s/RE1/SUBST1/g;
|
||||||
|
# s/RE2/SUBST2/g;
|
||||||
|
# ...
|
||||||
|
#
|
||||||
|
# m4_bpatsubsts already validated an odd number of arguments; we only
|
||||||
|
# need to speed up _m4_bpatsubsts. To avoid nesting, we build the
|
||||||
|
# temporary _m4_p:
|
||||||
|
# m4_define([_m4_p], [$1])m4_define([_m4_p],
|
||||||
|
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$2], [$3]))m4_define([_m4_p],
|
||||||
|
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$4], [$5]))m4_define([_m4_p],...
|
||||||
|
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$m-1], [$m]))m4_unquote(
|
||||||
|
# _m4_defn([_m4_p])_m4_popdef([_m4_p]))
|
||||||
|
m4_define([_m4_bpatsubsts],
|
||||||
|
[m4_define([_m4_p], m4_pushdef([_m4_p])[m4_define([_m4_p],
|
||||||
|
]m4_dquote([$]1)[)]_m4_for([_m4_p], [3], [$#], [2], [$0_(m4_decr(_m4_p),
|
||||||
|
_m4_p)])[m4_unquote(_m4_defn([_m4_p])_m4_popdef([_m4_p]))])_m4_p($@)])
|
||||||
|
|
||||||
|
m4_define([_m4_bpatsubsts_],
|
||||||
|
[[m4_define([_m4_p],
|
||||||
|
m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$$1], [$$2]))]])
|
||||||
|
|
||||||
|
# m4_shiftn(N, ...)
|
||||||
|
# -----------------
|
||||||
|
# Returns ... shifted N times. Useful for recursive "varargs" constructs.
|
||||||
|
#
|
||||||
|
# m4_shiftn already validated arguments; we only need to speed up
|
||||||
|
# _m4_shiftn. If N is 3, then we build the temporary _m4_s, defined as
|
||||||
|
# ,[$5],[$6],...,[$m]_m4_popdef([_m4_s])
|
||||||
|
# before calling m4_shift(_m4_s($@)).
|
||||||
|
m4_define([_m4_shiftn],
|
||||||
|
[m4_if(m4_incr([$1]), [$#], [], [m4_define([_m4_s],
|
||||||
|
m4_pushdef([_m4_s])_m4_for([_m4_s], m4_eval([$1 + 2]), [$#], [1],
|
||||||
|
[[,]m4_dquote([$]_m4_s)])[_m4_popdef([_m4_s])])m4_shift(_m4_s($@))])])
|
||||||
|
|
||||||
|
# m4_do(STRING, ...)
|
||||||
|
# ------------------
|
||||||
|
# This macro invokes all its arguments (in sequence, of course). It is
|
||||||
|
# useful for making your macros more structured and readable by dropping
|
||||||
|
# unnecessary dnl's and have the macros indented properly.
|
||||||
|
#
|
||||||
|
# Here, we use the temporary macro _m4_do, defined as
|
||||||
|
# $1[]$2[]...[]$n[]_m4_popdef([_m4_do])
|
||||||
|
m4_define([m4_do],
|
||||||
|
[m4_if([$#], [0], [],
|
||||||
|
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [1], [$#], [1],
|
||||||
|
[$_$0[[]]])[_m4_popdef([_$0])])_$0($@)])])
|
||||||
|
|
||||||
|
# m4_dquote_elt(ARGS)
|
||||||
|
# -------------------
|
||||||
|
# Return ARGS as an unquoted list of double-quoted arguments.
|
||||||
|
#
|
||||||
|
# m4_foreach to the rescue. It's easier to shift off the leading comma.
|
||||||
|
m4_define([m4_dquote_elt],
|
||||||
|
[m4_shift(m4_foreach([_m4_elt], [$@], [,m4_dquote(_m4_defn([_m4_elt]))]))])
|
||||||
|
|
||||||
|
# m4_reverse(ARGS)
|
||||||
|
# ----------------
|
||||||
|
# Output ARGS in reverse order.
|
||||||
|
#
|
||||||
|
# Invoke _m4_r($@) with the temporary _m4_r built as
|
||||||
|
# [$m], [$m-1], ..., [$2], [$1]_m4_popdef([_m4_r])
|
||||||
|
m4_define([m4_reverse],
|
||||||
|
[m4_if([$#], [0], [], [$#], [1], [[$1]],
|
||||||
|
[m4_define([_m4_r], m4_dquote([$$#])m4_pushdef([_m4_r])_m4_for([_m4_r],
|
||||||
|
m4_decr([$#]), [1], [-1],
|
||||||
|
[[, ]m4_dquote([$]_m4_r)])[_m4_popdef([_m4_r])])_m4_r($@)])])
|
||||||
|
|
||||||
|
|
||||||
|
# m4_map(MACRO, LIST)
|
||||||
|
# -------------------
|
||||||
|
# Invoke MACRO($1), MACRO($2) etc. where $1, $2... are the elements
|
||||||
|
# of LIST. $1, $2... must in turn be lists, appropriate for m4_apply.
|
||||||
|
#
|
||||||
|
# m4_map/m4_map_sep only execute once; the speedup comes in fixing
|
||||||
|
# _m4_map. The mismatch in () is intentional, since $1 supplies the
|
||||||
|
# opening `(' (but it sure looks odd!). Build the temporary _m4_m:
|
||||||
|
# $1, [$3])$1, [$4])...$1, [$m])_m4_popdef([_m4_m])
|
||||||
|
m4_define([_m4_map],
|
||||||
|
[m4_if([$#], [2], [],
|
||||||
|
[m4_define([_m4_m], m4_pushdef([_m4_m])_m4_for([_m4_m], [3], [$#], [1],
|
||||||
|
[$0_([1], _m4_m)])[_m4_popdef([_m4_m])])_m4_m($@)])])
|
||||||
|
|
||||||
|
m4_define([_m4_map_],
|
||||||
|
[[$$1, [$$2])]])
|
||||||
|
|
||||||
|
# m4_transform(EXPRESSION, ARG...)
|
||||||
|
# --------------------------------
|
||||||
|
# Expand EXPRESSION([ARG]) for each argument. More efficient than
|
||||||
|
# m4_foreach([var], [ARG...], [EXPRESSION(m4_defn([var]))])
|
||||||
|
#
|
||||||
|
# Invoke the temporary macro _m4_transform, defined as:
|
||||||
|
# $1([$2])[]$1([$3])[]...$1([$m])[]_m4_popdef([_m4_transform])
|
||||||
|
m4_define([m4_transform],
|
||||||
|
[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
|
||||||
|
[$#], [1], [],
|
||||||
|
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [2], [$#], [1],
|
||||||
|
[_$0_([1], _$0)])[_m4_popdef([_$0])])_$0($@)])])
|
||||||
|
|
||||||
|
m4_define([_m4_transform_],
|
||||||
|
[[$$1([$$2])[]]])
|
||||||
|
|
||||||
|
# m4_transform_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...)
|
||||||
|
# --------------------------------------------------------------
|
||||||
|
# Perform a pairwise grouping of consecutive ARGs, by expanding
|
||||||
|
# EXPRESSION([ARG1], [ARG2]). If there are an odd number of ARGs, the
|
||||||
|
# final argument is expanded with END-EXPR([ARGn]).
|
||||||
|
#
|
||||||
|
# Build the temporary macro _m4_transform_pair, with the $2([$m+1])
|
||||||
|
# only output if $# is odd:
|
||||||
|
# $1([$3], [$4])[]$1([$5], [$6])[]...$1([$m-1],
|
||||||
|
# [$m])[]m4_default([$2], [$1])([$m+1])[]_m4_popdef([_m4_transform_pair])
|
||||||
|
m4_define([m4_transform_pair],
|
||||||
|
[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
|
||||||
|
[$#], [1], [m4_fatal([$0: too few arguments: $#: $1])],
|
||||||
|
[$#], [2], [],
|
||||||
|
[$#], [3], [m4_default([$2], [$1])([$3])[]],
|
||||||
|
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [3],
|
||||||
|
m4_eval([$# / 2 * 2 - 1]), [2], [_$0_([1], _$0, m4_incr(_$0))])_$0_end(
|
||||||
|
[1], [2], [$#])[_m4_popdef([_$0])])_$0($@)])])
|
||||||
|
|
||||||
|
m4_define([_m4_transform_pair_],
|
||||||
|
[[$$1([$$2], [$$3])[]]])
|
||||||
|
|
||||||
|
m4_define([_m4_transform_pair_end],
|
||||||
|
[m4_if(m4_eval([$3 & 1]), [1], [[m4_default([$$2], [$$1])([$$3])[]]])])
|
||||||
|
|
||||||
|
# m4_join(SEP, ARG1, ARG2...)
|
||||||
|
# ---------------------------
|
||||||
|
# Produce ARG1SEPARG2...SEPARGn. Avoid back-to-back SEP when a given ARG
|
||||||
|
# is the empty string. No expansion is performed on SEP or ARGs.
|
||||||
|
#
|
||||||
|
# Use a self-modifying separator, since we don't know how many
|
||||||
|
# arguments might be skipped before a separator is first printed, but
|
||||||
|
# be careful if the separator contains $. m4_foreach to the rescue.
|
||||||
|
m4_define([m4_join],
|
||||||
|
[m4_pushdef([_m4_sep], [m4_define([_m4_sep], _m4_defn([m4_echo]))])]dnl
|
||||||
|
[m4_foreach([_m4_arg], [m4_shift($@)],
|
||||||
|
[m4_ifset([_m4_arg], [_m4_sep([$1])_m4_defn([_m4_arg])])])]dnl
|
||||||
|
[_m4_popdef([_m4_sep])])
|
||||||
|
|
||||||
|
# m4_joinall(SEP, ARG1, ARG2...)
|
||||||
|
# ------------------------------
|
||||||
|
# Produce ARG1SEPARG2...SEPARGn. An empty ARG results in back-to-back SEP.
|
||||||
|
# No expansion is performed on SEP or ARGs.
|
||||||
|
#
|
||||||
|
# A bit easier than m4_join. m4_foreach to the rescue.
|
||||||
|
m4_define([m4_joinall],
|
||||||
|
[[$2]m4_if(m4_eval([$# <= 2]), [1], [],
|
||||||
|
[m4_foreach([_m4_arg], [m4_shift2($@)],
|
||||||
|
[[$1]_m4_defn([_m4_arg])])])])
|
||||||
|
|
||||||
|
# m4_list_cmp(A, B)
|
||||||
|
# -----------------
|
||||||
|
# Compare the two lists of integer expressions A and B.
|
||||||
|
#
|
||||||
|
# m4_list_cmp takes care of any side effects; we only override
|
||||||
|
# _m4_list_cmp_raw, where we can safely expand lists multiple times.
|
||||||
|
# First, insert padding so that both lists are the same length; the
|
||||||
|
# trailing +0 is necessary to handle a missing list. Next, create a
|
||||||
|
# temporary macro to perform pairwise comparisons until an inequality
|
||||||
|
# is found. For example, m4_list_cmp([1], [1,2]) creates _m4_cmp as
|
||||||
|
# m4_if(m4_eval([($1) != ($3)]), [1], [m4_cmp([$1], [$3])],
|
||||||
|
# m4_eval([($2) != ($4)]), [1], [m4_cmp([$2], [$4])],
|
||||||
|
# [0]_m4_popdef([_m4_cmp], [_m4_size]))
|
||||||
|
# then calls _m4_cmp([1+0], [0], [1], [2+0])
|
||||||
|
m4_define([_m4_list_cmp_raw],
|
||||||
|
[m4_if([$1], [$2], 0, [m4_pushdef(
|
||||||
|
[_m4_size])_m4_list_cmp($1+0_m4_list_pad(m4_count($1), m4_count($2)),
|
||||||
|
$2+0_m4_list_pad(m4_count($2), m4_count($1)))])])
|
||||||
|
|
||||||
|
m4_define([_m4_list_pad],
|
||||||
|
[m4_if(m4_eval($1 < $2), [1],
|
||||||
|
[_m4_for([_m4_size], m4_incr([$1]), [$2], [1], [,0])])])
|
||||||
|
|
||||||
|
m4_define([_m4_list_cmp],
|
||||||
|
[m4_define([_m4_size], m4_eval([$# >> 1]))]dnl
|
||||||
|
[m4_define([_m4_cmp], m4_pushdef([_m4_cmp])[m4_if(]_m4_for([_m4_cmp],
|
||||||
|
[1], _m4_size, [1], [$0_(_m4_cmp, m4_eval(_m4_cmp + _m4_size))])[
|
||||||
|
[0]_m4_popdef([_m4_cmp], [_m4_size]))])_m4_cmp($@)])
|
||||||
|
|
||||||
|
m4_define([_m4_list_cmp_],
|
||||||
|
[[m4_eval([($$1) != ($$2)]), [1], [m4_cmp([$$1], [$$2])],
|
||||||
|
]])
|
||||||
|
|
||||||
|
# m4_max(EXPR, ...)
|
||||||
|
# m4_min(EXPR, ...)
|
||||||
|
# -----------------
|
||||||
|
# Return the decimal value of the maximum (or minimum) in a series of
|
||||||
|
# integer expressions.
|
||||||
|
#
|
||||||
|
# m4_foreach to the rescue; we only need to replace _m4_minmax. Here,
|
||||||
|
# we need a temporary macro to track the best answer so far, so that
|
||||||
|
# the foreach expression is tractable.
|
||||||
|
m4_define([_m4_minmax],
|
||||||
|
[m4_pushdef([_m4_best], m4_eval([$2]))m4_foreach([_m4_arg], [m4_shift2($@)],
|
||||||
|
[m4_define([_m4_best], $1(_m4_best, _m4_defn([_m4_arg])))])]dnl
|
||||||
|
[_m4_best[]_m4_popdef([_m4_best])])
|
||||||
|
|
||||||
|
# m4_set_add_all(SET, VALUE...)
|
||||||
|
# -----------------------------
|
||||||
|
# Add each VALUE into SET. This is O(n) in the number of VALUEs, and
|
||||||
|
# can be faster than calling m4_set_add for each VALUE.
|
||||||
|
#
|
||||||
|
# m4_foreach to the rescue. If no deletions have occurred, then avoid
|
||||||
|
# the speed penalty of m4_set_add.
|
||||||
|
m4_define([m4_set_add_all],
|
||||||
|
[m4_if([$#], [0], [], [$#], [1], [],
|
||||||
|
[m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1])
|
||||||
|
+ m4_len(m4_foreach([_m4_arg], [m4_shift($@)],
|
||||||
|
m4_ifdef([_m4_set_cleanup($1)],
|
||||||
|
[[m4_set_add([$1], _m4_defn([_m4_arg]))]],
|
||||||
|
[[m4_ifdef([_m4_set([$1],]_m4_defn([_m4_arg])[)], [],
|
||||||
|
[m4_define([_m4_set([$1],]_m4_defn([_m4_arg])[)],
|
||||||
|
[1])m4_pushdef([_m4_set([$1])],
|
||||||
|
_m4_defn([_m4_arg]))-])]])))))])])
|
||||||
+1393
-371
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
bison.xsl - common templates for Bison XSLT.
|
||||||
|
|
||||||
|
Copyright (C) 2007-2010 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,206 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||||
|
|
||||||
|
Copyright (C) 2007-2010 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,581 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
xml2text.xsl - transform Bison XML Report into plain text.
|
||||||
|
|
||||||
|
Copyright (C) 2007-2010 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,745 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||||
|
|
||||||
|
Copyright (C) 2007-2010 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>
|
||||||
+796
-493
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
|||||||
|
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||||
|
# Requires GNU sed
|
||||||
|
|
||||||
|
## Copyright (C) 2005-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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 = .
|
||||||
|
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
all: README
|
||||||
|
|
||||||
|
README: README.in $(top_srcdir)/configure
|
||||||
|
PACKAGE=`grep "^[ ]*PACKAGE=" $(top_srcdir)/configure | sed -e 's/^[ ]*PACKAGE=//' -e s/[\"\']//g`; \
|
||||||
|
VERSION=`grep "^[ ]*VERSION=" $(top_srcdir)/configure | sed -e 's/^[ ]*VERSION=//' -e s/[\"\']//g`; \
|
||||||
|
package_version=`echo "$${VERSION}" | sed 's/\.//g'`; \
|
||||||
|
tree_version=`echo "$${VERSION}" | sed 's/\.//2g'`; \
|
||||||
|
sed \
|
||||||
|
-e "s/@V@/$${PACKAGE}-$${VERSION}/g" \
|
||||||
|
-e "s/@VERSION@/$${VERSION}/g" \
|
||||||
|
-e "s/@PACKAGE_VERSION@/$$package_version/g" \
|
||||||
|
-e "s/@TREE_VERSION@/$$tree_version/g" \
|
||||||
|
$(srcdir)/README.in > t-$@
|
||||||
|
mv t-$@ $@
|
||||||
+195
@@ -0,0 +1,195 @@
|
|||||||
|
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||||
|
|
||||||
|
Copyright (C) 2005-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
1.: DJGPP specific changes.
|
||||||
|
=======================
|
||||||
|
|
||||||
|
The DJGPP port of Bison offers LFN and SFN support depending on which
|
||||||
|
OS it is running. If LFN support is available or not is determinated at
|
||||||
|
run time. If LFN support is available (DOS session under Win9X, Win2K,
|
||||||
|
WinXP, etc.) the standard posix file name extensions will be used.
|
||||||
|
These are: y.tab.c, y.tab.c++, y.tab.h, y.output, etc. If only SFN
|
||||||
|
support is available (plain DOS), then the standard MSDOS short file
|
||||||
|
names will be used. These are: y_tab.c, y_tab.h, y.out, etc.
|
||||||
|
It should be noticed that this bison version needs the m4 program as
|
||||||
|
back end to generate the parser file (y.tab.c etc.) from the skeleton
|
||||||
|
files. This implies that m4 must always be installed to get bison
|
||||||
|
working. m4 will use a couple of m4 scripts that will be installed in
|
||||||
|
/dev/env/DJDIR/share/bison and shall not be removed.
|
||||||
|
It should also be noticed that the skeleton files bison.simple and
|
||||||
|
bison.hairy are no longer supported. This applies also to the environ-
|
||||||
|
ment variables BISON_HAIRY and BISON_SIMPLE. Those variables are *no*
|
||||||
|
longer honored at all.
|
||||||
|
The kind of skeleton file bison.hairy is no longer supported at all.
|
||||||
|
The skeleton file bison.simple is now called yacc.c and is an m4 script.
|
||||||
|
The other two skeleton files supported by this bison version are glr.c
|
||||||
|
and lalr1.cc. The first one is a generalized LR C parser based on
|
||||||
|
Bison's LALR(1) tables and the second one is a experimental C++ parser
|
||||||
|
class.
|
||||||
|
As has been told before, bison uses m4 to generate the parser file.
|
||||||
|
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.
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
2.: Installing the binary package.
|
||||||
|
==============================
|
||||||
|
|
||||||
|
2.1.: Copy the binary distribution into the top DJGPP installation directory,
|
||||||
|
just unzip it preserving the directory structure running *ONE* of the
|
||||||
|
following commands:
|
||||||
|
unzip32 bsn@[email protected] or
|
||||||
|
djtarx bsn@[email protected] or
|
||||||
|
pkunzip -d bsn@[email protected]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3.: Building the binaries from sources.
|
||||||
|
===================================
|
||||||
|
|
||||||
|
3.1.: Create a temporary directory and copy the source package into the
|
||||||
|
directory. If you download the source distribution from one of the
|
||||||
|
DJGPP sites, just unzip it preserving the directory structure
|
||||||
|
running *ONE* of the following commands:
|
||||||
|
unzip32 bsn@[email protected] or
|
||||||
|
djtarx bsn@[email protected] or
|
||||||
|
pkunzip -d bsn@[email protected]
|
||||||
|
and proceed to the paragraph 3.3, below.
|
||||||
|
|
||||||
|
3.2.: Source distributions downloaded from one of the GNU FTP sites need
|
||||||
|
some more work to unpack, if LFN support is not available. If LFN is
|
||||||
|
available then you can extract the source files from the archive with
|
||||||
|
any unzip program and proceed to the paragraph 3.3, below. Any file
|
||||||
|
name issue will be handled by the the DJGPP configuration files.
|
||||||
|
To unpack the source distribution on SFN systems, first, you MUST use
|
||||||
|
the `djunpack' batch file to unzip the package. That is because some
|
||||||
|
file names in the official distributions need to be changed to avoid
|
||||||
|
problems on the various platforms supported by DJGPP.
|
||||||
|
`djunpack' invokes the `djtar' program (that is part of the basic DJGPP
|
||||||
|
development kit) to rename these files on the fly given a file with
|
||||||
|
name mappings; the distribution includes a file `djgpp/fnchange.lst'
|
||||||
|
with the necessary mappings. So you need first to retrieve that batch
|
||||||
|
file, and then invoke it to unpack the distribution. Here's how:
|
||||||
|
|
||||||
|
djtar -x -p -o bison-@VERSION@/djgpp/djunpack.bat bison-@[email protected] > djunpack.bat
|
||||||
|
djunpack bison-@[email protected]
|
||||||
|
|
||||||
|
(The name of the distribution archive and the leading directory of the
|
||||||
|
path to `djunpack.bat' in the distribution will be different for
|
||||||
|
versions of Bison other than @VERSION@.)
|
||||||
|
|
||||||
|
If the argument to `djunpack.bat' include leading directories, it MUST
|
||||||
|
be given with the DOS-style backslashes; Unix-style forward slashes
|
||||||
|
will NOT work.
|
||||||
|
|
||||||
|
If the distribution comes as a .tar.bz2 archive, and your version of
|
||||||
|
`djtar' doesn't support bzip2 decompression, you need to unpack it as
|
||||||
|
follows:
|
||||||
|
|
||||||
|
bnzip2 bison-@[email protected]
|
||||||
|
djtar -x -p -o bison-@VERSION@/djgpp/djunpack.bat bison-@[email protected] > djunpack.bat
|
||||||
|
djunpack bison-@[email protected]
|
||||||
|
|
||||||
|
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)
|
||||||
|
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:
|
||||||
|
difNNNb.zip
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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:
|
||||||
|
del djgpp\config.cache
|
||||||
|
make clean
|
||||||
|
djgpp\config
|
||||||
|
|
||||||
|
Please note that you *MUST* delete the config.cache file in the djgpp
|
||||||
|
subdir or you will not really reconfigure the sources because the
|
||||||
|
configuration informations will be read from the cache file instead
|
||||||
|
of being newly computed.
|
||||||
|
To build the programs in a directory other than where the sources are,
|
||||||
|
you must add the parameter that specifies the source directory,
|
||||||
|
e.g:
|
||||||
|
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
|
||||||
|
|
||||||
|
Lets assume you want to build the binaries in a directory placed on a
|
||||||
|
different drive (z:\build in this case) from where the sources are,
|
||||||
|
then you will run the following commands:
|
||||||
|
z:
|
||||||
|
md \build
|
||||||
|
cd \build
|
||||||
|
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
|
||||||
|
|
||||||
|
The order of the options and the srcdir option does not matter. You
|
||||||
|
*MUST* use forward slashes to specify the source directory.
|
||||||
|
|
||||||
|
The batch file will set same environment variables, make MSDOS specific
|
||||||
|
modifications to the Makefile.in's and supply all other needed options
|
||||||
|
to the configure script.
|
||||||
|
|
||||||
|
3.5.: To compile the package run from the top srcdir the command:
|
||||||
|
make
|
||||||
|
|
||||||
|
3.6.: Now you can run the tests if you like. From the top srcdir run the
|
||||||
|
command:
|
||||||
|
make check
|
||||||
|
|
||||||
|
No test should fail but the tests #131 (Doxygen Public Documentation)
|
||||||
|
and #132 (Doxygen Private Documentation) will be skipped. Please note
|
||||||
|
that the testsuite only works with LFN available. On plain DOS, most
|
||||||
|
of the tests will fail due to invalid DOS names.
|
||||||
|
|
||||||
|
3.7.: To install the binaries, header, library, catalogs, and info docs
|
||||||
|
run the following command from the top srcdir:
|
||||||
|
make install
|
||||||
|
|
||||||
|
This will install the products into your DJGPP installation tree given
|
||||||
|
by the default prefix "/dev/env/DJDIR". If you prefer to install them
|
||||||
|
into some other directory you will have to set prefix to the appropiate
|
||||||
|
value:
|
||||||
|
make install prefix=z:/some/other/place
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Send GNU bison specific bug reports to <[email protected]>.
|
||||||
|
Send suggestions and bug reports concerning the DJGPP port to
|
||||||
|
comp.os.msdos.djgpp or <[email protected]>.
|
||||||
|
|
||||||
|
|
||||||
|
Enjoy.
|
||||||
|
|
||||||
|
Guerrero, Juan Manuel <[email protected]>
|
||||||
@@ -0,0 +1,547 @@
|
|||||||
|
@echo off
|
||||||
|
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-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
|
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, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
echo Configuring Bison for DJGPP v2.x...
|
||||||
|
|
||||||
|
Rem The SmallEnv tests protect against fixed and too small size
|
||||||
|
Rem of the environment in stock DOS shell.
|
||||||
|
|
||||||
|
Rem Find out if NLS is wanted or not,
|
||||||
|
Rem if dependency-tracking is wanted or not,
|
||||||
|
Rem if caching is wanted or not
|
||||||
|
Rem and where the sources are.
|
||||||
|
Rem We always default to NLS support,
|
||||||
|
Rem no dependency tracking
|
||||||
|
Rem and to in place configuration.
|
||||||
|
set ARGS=
|
||||||
|
set NLS=enabled
|
||||||
|
if not "%NLS%" == "enabled" goto SmallEnv
|
||||||
|
set CACHING=enabled
|
||||||
|
if not "%CACHING%" == "enabled" goto SmallEnv
|
||||||
|
set DEPENDENCY_TRACKING=disabled
|
||||||
|
if not "%DEPENDENCY_TRACKING%" == "disabled" goto SmallEnv
|
||||||
|
set LIBICONV_PREFIX=disabled
|
||||||
|
if not "%LIBICONV_PREFIX%" == "disabled" goto SmallEnv
|
||||||
|
set LIBINTL_PREFIX=disabled
|
||||||
|
if not "%LIBINTL_PREFIX%" == "disabled" goto SmallEnv
|
||||||
|
set HTML=enabled
|
||||||
|
if not "%HTML%" == "enabled" goto SmallEnv
|
||||||
|
set XSRC=.
|
||||||
|
if not "%XSRC%" == "." goto SmallEnv
|
||||||
|
|
||||||
|
Rem Loop over all arguments.
|
||||||
|
Rem Special arguments are: NLS, XSRC, CACHE, STATIC_LIBS, LIBICONV_PREFIX, LIBINTL_PREFIX and DEPS.
|
||||||
|
Rem All other arguments are stored into ARGS.
|
||||||
|
:ArgLoop
|
||||||
|
if "%1" == "nls" goto NextArgument
|
||||||
|
if "%1" == "NLS" goto NextArgument
|
||||||
|
if "%1" == "no-nls" goto NoNLS
|
||||||
|
if "%1" == "no-NLS" goto NoNLS
|
||||||
|
if "%1" == "NO-NLS" goto NoNLS
|
||||||
|
goto CachingOption
|
||||||
|
:NoNLS
|
||||||
|
if "%1" == "no-nls" set NLS=disabled
|
||||||
|
if "%1" == "no-NLS" set NLS=disabled
|
||||||
|
if "%1" == "NO-NLS" set NLS=disabled
|
||||||
|
if not "%NLS%" == "disabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:CachingOption
|
||||||
|
if "%1" == "cache" goto NextArgument
|
||||||
|
if "%1" == "CACHE" goto NextArgument
|
||||||
|
if "%1" == "no-cache" goto NoCaching
|
||||||
|
if "%1" == "no-CACHE" goto NoCaching
|
||||||
|
if "%1" == "NO-CACHE" goto NoCaching
|
||||||
|
goto DependencyOption
|
||||||
|
:NoCaching
|
||||||
|
if "%1" == "no-cache" set CACHING=disabled
|
||||||
|
if "%1" == "no-CACHE" set CACHING=disabled
|
||||||
|
if "%1" == "NO-CACHE" set CACHING=disabled
|
||||||
|
if not "%CACHING%" == "disabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:DependencyOption
|
||||||
|
if "%1" == "no-dep" goto NextArgument
|
||||||
|
if "%1" == "no-DEP" goto NextArgument
|
||||||
|
if "%1" == "NO-DEP" goto NextArgument
|
||||||
|
if "%1" == "dep" goto DependecyTraking
|
||||||
|
if "%1" == "DEP" goto DependecyTraking
|
||||||
|
goto LibiconvPrefixOption
|
||||||
|
:DependecyTraking
|
||||||
|
if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
|
||||||
|
if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
|
||||||
|
if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:LibiconvPrefixOption
|
||||||
|
if "%1" == "no-libiconvprefix" goto NextArgument
|
||||||
|
if "%1" == "no-LIBICONVPREFIX" goto NextArgument
|
||||||
|
if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
|
||||||
|
if "%1" == "libiconvprefix" goto WithLibiconvPrefix
|
||||||
|
if "%1" == "LIBICONVPREFIX" goto WithLibiconvPrefix
|
||||||
|
goto LibintlPrefixOption
|
||||||
|
:WithLibiconvPrefix
|
||||||
|
if "%1" == "libiconvprefix" set LIBICONV_PREFIX=enabled
|
||||||
|
if "%1" == "LIBICONVPREFIX" set LIBICONV_PREFIX=enabled
|
||||||
|
if not "%LIBICONV_PREFIX%" == "enabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:LibintlPrefixOption
|
||||||
|
if "%1" == "no-libiconvprefix" goto NextArgument
|
||||||
|
if "%1" == "no-LIBICONVPREFIX" goto NextArgument
|
||||||
|
if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
|
||||||
|
if "%1" == "libintlprefix" goto _WithLibintlPrefix
|
||||||
|
if "%1" == "LIBINTLPREFIX" goto _WithLibintlPrefix
|
||||||
|
goto HTMLOption
|
||||||
|
:_WithLibintlPrefix
|
||||||
|
if "%1" == "libintlprefix" set LIBINTL_PREFIX=enabled
|
||||||
|
if "%1" == "LIBINTLPREFIX" set LIBINTL_PREFIX=enabled
|
||||||
|
if not "%LIBINTL_PREFIX%" == "enabled" goto SmallEnv
|
||||||
|
:HTMLOption
|
||||||
|
if "%1" == "withhtml" goto NextArgument
|
||||||
|
if "%1" == "withHTML" goto NextArgument
|
||||||
|
if "%1" == "WITHHTML" goto NextArgument
|
||||||
|
if "%1" == "withouthtml" goto _WithoutHTML
|
||||||
|
if "%1" == "withoutHTML" goto _WithoutHTML
|
||||||
|
if "%1" == "WITHOUTHTML" goto _WithoutHTML
|
||||||
|
goto SrcDirOption
|
||||||
|
:_WithoutHTML
|
||||||
|
if "%1" == "withouthtml" set HTML=disabled
|
||||||
|
if "%1" == "withoutHTML" set HTML=disabled
|
||||||
|
if "%1" == "WITHOUTHTML" set HTML=disabled
|
||||||
|
if not "%HTML%" == "disabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:SrcDirOption
|
||||||
|
echo %1 | grep -q "/"
|
||||||
|
if errorlevel 1 goto CollectArgument
|
||||||
|
set XSRC=%1
|
||||||
|
if not "%XSRC%" == "%1" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:CollectArgument
|
||||||
|
set _ARGS=%ARGS% %1
|
||||||
|
if not "%_ARGS%" == "%ARGS% %1" if not "%_ARGS%" == "%ARGS%%1" goto SmallEnv
|
||||||
|
echo %_ARGS% | grep -q "[^ ]"
|
||||||
|
if not errorlevel 0 set ARGS=%_ARGS%
|
||||||
|
set _ARGS=
|
||||||
|
:NextArgument
|
||||||
|
shift
|
||||||
|
if not "%1" == "" goto ArgLoop
|
||||||
|
|
||||||
|
Rem Create an arguments file for the configure script.
|
||||||
|
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=
|
||||||
|
set LIBICONV_PREFIX=
|
||||||
|
set LIBINTL_PREFIX=
|
||||||
|
set HTML=
|
||||||
|
|
||||||
|
if "%XSRC%" == "." goto InPlace
|
||||||
|
|
||||||
|
:NotInPlace
|
||||||
|
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.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
|
||||||
|
test -f %XSRC%/po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/po/Makefile.in %XSRC%/po/Makefile.in-in
|
||||||
|
test -f %XSRC%/po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/po/Makefile.inin %XSRC%/po/Makefile.in-in
|
||||||
|
test -f %XSRC%/po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/po/Makefile.in_in %XSRC%/po/Makefile.in-in
|
||||||
|
test -f %XSRC%/po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/po/Makefile_in.in %XSRC%/po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in.in
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in.in %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.inin %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in_in %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile_in.in %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
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
|
||||||
|
test -f %XSRC%/src/scan-gram-c.c
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/src/scan-gram-c.c %XSRC%/src/c-scan-gram.c
|
||||||
|
:scan_skel_c_Test
|
||||||
|
test -f %XSRC%/src/c-scan-skel.c
|
||||||
|
if not errorlevel 1 goto FixFiles
|
||||||
|
test -f %XSRC%/src/scan-skel-c.c
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/src/scan-skel-c.c %XSRC%/src/c-scan-skel.c
|
||||||
|
|
||||||
|
:FixFiles
|
||||||
|
Rem Fix data/lalr1.cc and data/location.cc to reflect the renaming of c++.m4
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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%/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%/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
|
||||||
|
test -d %XSRC%/examples/calcxx
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcpp %XSRC%/examples/calcxx
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-scanner.cc
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-scanner.cc
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-scanner.ll
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-scanner.ll
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-driver.cc
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-driver.cc
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-driver.hh
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-driver.hh
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-parser.cc
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-parser.cc
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-parser.hh
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-parser.hh
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-parser.stamp
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-parser.stamp
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-parser.yy
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-parser.yy
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++.cc
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++.cc %XSRC%/examples/calcxx/calcxx.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx.cc
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp.cc %XSRC%/examples/calcxx/calcxx.cc
|
||||||
|
|
||||||
|
Rem Fixing #include lines in calcxx files.
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx.cc %XSRC%/examples/calcxx/calcxx.cc
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh
|
||||||
|
:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy
|
||||||
|
:if errorlevel 1 goto calcxxFileError
|
||||||
|
:mv ./calcxx-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc
|
||||||
|
:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll
|
||||||
|
:if errorlevel 1 goto calcxxFileError
|
||||||
|
:mv ./calcxx-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll
|
||||||
|
sed "s/calc++/calcxx/" %XSRC%/examples/calcxx/test > test
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./test %XSRC%/examples/calcxx/test
|
||||||
|
|
||||||
|
|
||||||
|
Rem Fixing the scanner files to make file names 8.3 valid.
|
||||||
|
Rem Use only if you want to change the scan-gram.l and scan-skel.l files.
|
||||||
|
: sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-gram.l > scan-gram.l
|
||||||
|
: if errorlevel 1 goto ScannerFileError
|
||||||
|
: mv ./scan-gram.l %XSRC%/src/scan-gram.l
|
||||||
|
: sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-skel.l > scan-skel.l
|
||||||
|
: if errorlevel 1 goto ScannerFileError
|
||||||
|
: mv ./scan-skel.l %XSRC%/src/scan-skel.l
|
||||||
|
|
||||||
|
|
||||||
|
Rem This is required because DOS/Windows are case-insensitive
|
||||||
|
Rem to file names, and "make install" will do nothing if Make
|
||||||
|
Rem finds a file called `install'.
|
||||||
|
if exist INSTALL ren INSTALL INSTALL.txt
|
||||||
|
|
||||||
|
Rem Set SHELL to a sane default or some configure tests stop working
|
||||||
|
Rem if the package is configured across partitions.
|
||||||
|
if not "%SHELL%" == "" goto HomeName
|
||||||
|
set SHELL=/bin/sh
|
||||||
|
if not "%SHELL%" == "/bin/sh" goto SmallEnv
|
||||||
|
echo No SHELL found in the environment, using default value
|
||||||
|
|
||||||
|
:HomeName
|
||||||
|
Rem Set HOME to a sane default so configure stops complaining.
|
||||||
|
if not "%HOME%" == "" goto HostName
|
||||||
|
set HOME=%XSRC%/djgpp
|
||||||
|
if not "%HOME%" == "%XSRC%/djgpp" goto SmallEnv
|
||||||
|
echo No HOME found in the environment, using default value
|
||||||
|
|
||||||
|
:HostName
|
||||||
|
Rem Set HOSTNAME so it shows in config.status
|
||||||
|
if not "%HOSTNAME%" == "" goto hostdone
|
||||||
|
if "%windir%" == "" goto msdos
|
||||||
|
set OS=MS-Windows
|
||||||
|
if not "%OS%" == "MS-Windows" goto SmallEnv
|
||||||
|
goto haveos
|
||||||
|
:msdos
|
||||||
|
set OS=MS-DOS
|
||||||
|
if not "%OS%" == "MS-DOS" goto SmallEnv
|
||||||
|
:haveos
|
||||||
|
if not "%USERNAME%" == "" goto haveuname
|
||||||
|
if not "%USER%" == "" goto haveuser
|
||||||
|
echo No USERNAME and no USER found in the environment, using default values
|
||||||
|
set HOSTNAME=Unknown PC
|
||||||
|
if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
|
||||||
|
goto userdone
|
||||||
|
:haveuser
|
||||||
|
set HOSTNAME=%USER%'s PC
|
||||||
|
if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
|
||||||
|
goto userdone
|
||||||
|
:haveuname
|
||||||
|
set HOSTNAME=%USERNAME%'s PC
|
||||||
|
if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
|
||||||
|
:userdone
|
||||||
|
set _HOSTNAME=%HOSTNAME%, %OS%
|
||||||
|
if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
|
||||||
|
set HOSTNAME=%_HOSTNAME%
|
||||||
|
:hostdone
|
||||||
|
set _HOSTNAME=
|
||||||
|
set OS=
|
||||||
|
|
||||||
|
Rem install-sh is required by the configure script but clashes with the
|
||||||
|
Rem various Makefile install-foo targets, so we MUST have it before the
|
||||||
|
Rem script runs and rename it afterwards
|
||||||
|
test -f %XSRC%/install-sh
|
||||||
|
if not errorlevel 1 goto NoRen0
|
||||||
|
test -f %XSRC%/install-sh.sh
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
|
||||||
|
:NoRen0
|
||||||
|
|
||||||
|
if "%NLS%" == "disabled" goto WithoutNLS
|
||||||
|
|
||||||
|
:WithNLS
|
||||||
|
Rem Check for the needed libraries and binaries.
|
||||||
|
test -x /dev/env/DJDIR/bin/msgfmt.exe
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -x /dev/env/DJDIR/bin/xgettext.exe
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/include/libcharset.h
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/lib/libcharset.a
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/include/iconv.h
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/lib/libiconv.a
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/include/libintl.h
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/lib/libintl.a
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
|
||||||
|
Rem Recreate the files in the %XSRC%/po subdir with our ported tools.
|
||||||
|
redir -e /dev/null rm %XSRC%/po/*.gmo
|
||||||
|
redir -e /dev/null rm %XSRC%/po/bison.pot
|
||||||
|
redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c
|
||||||
|
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 >> 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 >> args
|
||||||
|
|
||||||
|
:ConfigurePackage
|
||||||
|
echo Running the ./configure script...
|
||||||
|
sh ./configure @args
|
||||||
|
if errorlevel 1 goto CfgError
|
||||||
|
rm args
|
||||||
|
echo Done.
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:lalr1_ccFileError
|
||||||
|
echo ./data/lalr1.cc file editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:glr_ccFileError
|
||||||
|
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
|
||||||
|
|
||||||
|
:calcxxFileError
|
||||||
|
echo ./examples/calcxx file editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:ScannerFileError
|
||||||
|
echo ./scanner file editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:SedError
|
||||||
|
echo ./configure script editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:SedError2
|
||||||
|
echo ./lib/config.hin editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:SedError3
|
||||||
|
echo ./tests/testsuite editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:CfgError
|
||||||
|
echo ./configure script exited abnormally!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:SmallEnv
|
||||||
|
echo Your environment size is too small. Enlarge it and run me again.
|
||||||
|
echo Configuration NOT done!
|
||||||
|
|
||||||
|
:End
|
||||||
|
test -f %XSRC%/install-sh.sh
|
||||||
|
if not errorlevel 1 goto NoRen1
|
||||||
|
test -f %XSRC%/install-sh
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh
|
||||||
|
:NoRen1
|
||||||
|
if "%SHELL%" == "/bin/sh" set SHELL=
|
||||||
|
if "%HOME%" == "%XSRC%/djgpp" set HOME=
|
||||||
|
set CONFIG_SITE=
|
||||||
|
set HOSTNAME=
|
||||||
|
set NLS=
|
||||||
|
set XSRC=
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
# DJGPP specific configuration file.
|
||||||
|
# Sed script for additional DJGPP specific editing
|
||||||
|
# of the configure script generated by autoconf 2.62.
|
||||||
|
|
||||||
|
|
||||||
|
# Copyright (C) 2005-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
|
||||||
|
# Additional editing of Makefiles
|
||||||
|
/^eval sed.*ac_file_inputs.*tmp\/out \\$/ {
|
||||||
|
:loop
|
||||||
|
n
|
||||||
|
/^$/!b loop
|
||||||
|
a\
|
||||||
|
cat > "$tmp/subs-djgpp.sed" << eof_djgpp\
|
||||||
|
# DJGPP specific Makefile changes.\
|
||||||
|
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\\\\\
|
||||||
|
\\$(COMPILE) -c \\$<\
|
||||||
|
/^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/\
|
||||||
|
/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=/ {
|
||||||
|
/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
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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).
|
||||||
|
/^rmdir[ ]*\.tst/ i\
|
||||||
|
am__leading_dot=_
|
||||||
|
|
||||||
|
# Replace (command) > /dev/null with `command > /dev/null`, since
|
||||||
|
# parenthesized commands always return zero status in the ported Bash,
|
||||||
|
# even if the named command doesn't exist
|
||||||
|
/if ([^|;`]*null/{
|
||||||
|
s,(,`,
|
||||||
|
s,),,
|
||||||
|
/null[ ]*2>&1/ s,2>&1,&`,
|
||||||
|
/null.*null/ s,null.*null,&`,
|
||||||
|
/null.*null/ !{
|
||||||
|
/null[ ]*2>&1/ !s,null,&`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# DOS-style absolute file names should be supported as well
|
||||||
|
/\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*,
|
||||||
|
|
||||||
|
# The following two items are changes needed for configuring
|
||||||
|
# and compiling across partitions.
|
||||||
|
# 1) The given srcdir value is always translated from the
|
||||||
|
# "x:" syntax into "/dev/x" syntax while we run configure.
|
||||||
|
/^[ ]*-srcdir=\*.*$/ a\
|
||||||
|
ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
|
||||||
|
/set X `ls -Lt \$srcdir/ i\
|
||||||
|
if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
|
||||||
|
srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Autoconf 2.52e generated configure scripts
|
||||||
|
# write absolute paths into Makefiles and bison.in
|
||||||
|
# making them useless for DJGPP installations for
|
||||||
|
# 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-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-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}
|
||||||
|
#/^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))/
|
||||||
|
|
||||||
|
# We need makeinfo to make the html formated docs.
|
||||||
|
/\$am_missing_run[ ]*makeinfo/ s,\$am_missing_run,,
|
||||||
|
|
||||||
|
# The path to the FORTRAN compiler and libraries
|
||||||
|
# shall contain no absolute path reference so it
|
||||||
|
# will be good for all djgpp installations.
|
||||||
|
/^FLIBS="\$ac_cv_flibs"/ i\
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# This is the config.site file for configuring GNU packages
|
||||||
|
# which are to be built with DJGPP tools.
|
||||||
|
|
||||||
|
# Copyright (C) 2005-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
|
||||||
|
# Include the djgpp subdirectory in PATH, so that getconf is found
|
||||||
|
PATH="$srcdir/djgpp:$PATH"
|
||||||
|
|
||||||
|
# These two variables are required, otherwise looking for
|
||||||
|
# programs along the PATH will not work.
|
||||||
|
PATH_SEPARATOR=:
|
||||||
|
PATH_EXPAND=y
|
||||||
|
|
||||||
|
# This is required in for "test -f foo" to find foo.exe
|
||||||
|
export TEST_FINDS_EXE=y
|
||||||
|
|
||||||
|
# The root of the DJGPP tree serves as the default prefix
|
||||||
|
test "x$prefix" = xNONE && prefix='/dev/env/DJDIR'
|
||||||
|
|
||||||
|
# This is required for config.status script to be run, since
|
||||||
|
# ./configure runs it by invoking ${CONFIG_SHELL-/bin/sh}
|
||||||
|
CONFIG_SHELL=${CONFIG_SHELL='sh'}
|
||||||
|
|
||||||
|
# These are set here so the generated Makefile's will be good
|
||||||
|
# for every DJGPP installation, not only the one where the
|
||||||
|
# package was configured.
|
||||||
|
# $INSTALL must be an absolute path name, otherwise config.status
|
||||||
|
# will try to prepend ./ and ../ to it when it goes into subdirs.
|
||||||
|
INSTALL=${INSTALL='/dev/env/DJDIR/bin/ginstall -c'}
|
||||||
|
RANLIB=${RANLIB='ranlib'}
|
||||||
|
GMSGFMT=${GMSGFMT='/dev/env/DJDIR/bin/msgfmt'}
|
||||||
|
MSGFMT=${MSGFMT='/dev/env/DJDIR/bin/msgfmt'}
|
||||||
|
XGETTEXT=${XGETTEXT='/dev/env/DJDIR/bin/xgettext'}
|
||||||
|
AWK=${AWK='gawk'}
|
||||||
|
|
||||||
|
# A sane default for emacs.
|
||||||
|
ac_cv_path_EMACS=${EMACS='/dev/env/DJDIR/gnu/emacs/bin/emacs'}
|
||||||
|
|
||||||
|
# A sane default for m4.
|
||||||
|
ac_cv_path_M4=${M4='/dev/env/DJDIR/bin/m4'}
|
||||||
|
|
||||||
|
# A sane default for grep.
|
||||||
|
ac_cv_path_GREP=${GREP='/dev/env/DJDIR/bin/grep'}
|
||||||
|
|
||||||
|
# A sane default for egrep.
|
||||||
|
ac_cv_path_EGREP=${EGREP='/dev/env/DJDIR/bin/egrep'}
|
||||||
|
|
||||||
|
# A sane default for fgrep.
|
||||||
|
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.
|
||||||
|
NM=${NM='nm'}
|
||||||
|
LD=${LD='ld'}
|
||||||
|
|
||||||
|
# Force the test for 'ln -s' to report 'cp -pf'.
|
||||||
|
ac_cv_prog_LN_S='cp -pf'
|
||||||
|
|
||||||
|
# There is no fork and vfork functionality.
|
||||||
|
ac_cv_func_fork=no
|
||||||
|
ac_cv_func_vfork=no
|
||||||
|
ac_cv_func_pipe=no
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# sed script for DJGPP specific editing of config.hin
|
||||||
|
|
||||||
|
# Copyright (C) 2005-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
|
||||||
|
$ a\
|
||||||
|
\
|
||||||
|
\
|
||||||
|
/* DJGPP specific defines. */\
|
||||||
|
\
|
||||||
|
#include <unistd.h>\
|
||||||
|
#define TAB_EXT ((pathconf(NULL, _PC_NAME_MAX) > 12) ? ".tab" : "_tab")\
|
||||||
|
#define OUTPUT_EXT ((pathconf(NULL, _PC_NAME_MAX) > 12) ? ".output" : ".out")\
|
||||||
|
\
|
||||||
|
#define DEFAULT_TMPDIR "/dev/env/DJDIR/tmp"
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
@echo off
|
||||||
|
Rem
|
||||||
|
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
|
||||||
|
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-2010 Free Software Foundation, Inc.
|
||||||
|
Rem
|
||||||
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
|
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, see <http://www.gnu.org/licenses/>.
|
||||||
|
Rem
|
||||||
|
Rem
|
||||||
|
Rem Invoke like this:
|
||||||
|
Rem
|
||||||
|
Rem djunpack bison-XYZ.tar.gz
|
||||||
|
Rem or
|
||||||
|
Rem djunpack bison-XYZ.tar.bz2
|
||||||
|
Rem
|
||||||
|
Rem where XYZ is the version number. If the argument includes leading
|
||||||
|
Rem directories, it MUST use backslashes, not forward slashes.
|
||||||
|
Rem
|
||||||
|
|
||||||
|
set ENVIRONMENT_SIZE_TEST_STRING=ENVIRONMENT_SIZE_TEST_STRING
|
||||||
|
if "%ENVIRONMENT_SIZE_TEST_STRING%"=="ENVIRONMENT_SIZE_TEST_STRING" GoTo EnvOk
|
||||||
|
Rem If their environment space is too small, re-exec with a larger one
|
||||||
|
command.com /e:4096 /c %0 %1
|
||||||
|
GoTo End
|
||||||
|
|
||||||
|
:EnvOk
|
||||||
|
set ENVIRONMENT_SIZE_TEST_STRING=
|
||||||
|
if "%1" == "" GoTo NoArgument
|
||||||
|
if not exist %1 GoTo NoArchive
|
||||||
|
Rem Extract top src dir from archive file.
|
||||||
|
djtar -t %1 > top_src.dir
|
||||||
|
Rem The following uses a feature of COPY whereby it does not copy
|
||||||
|
Rem empty files. We need that because the previous line will create
|
||||||
|
Rem an empty fnchange.tmp even if the command failed for some reason.
|
||||||
|
copy top_src.dir junk.tmp > nul
|
||||||
|
if not exist junk.tmp GoTo NoDjTar
|
||||||
|
del junk.tmp
|
||||||
|
sed "1{s/^.*bison-/djtar -x -p -o bison-/;s|$|djgpp/fnchange.lst %%1 > fnchange.tmp|};2,$d" top_src.dir > ext_list.bat
|
||||||
|
Rem See the comment above about the reason for using COPY.
|
||||||
|
copy ext_list.bat junk.tmp > nul
|
||||||
|
if not exist junk.tmp GoTo NoSed
|
||||||
|
del junk.tmp
|
||||||
|
Rem Extract fnchange.lst from archive.
|
||||||
|
call ext_list.bat %1
|
||||||
|
del ext_list.bat
|
||||||
|
sed "1{s|^.*bison-|s/@V@/bison-|;s|$|g|};2,$d" top_src.dir > version.sed
|
||||||
|
sed -f version.sed < fnchange.tmp > fnchange.lst
|
||||||
|
del version.sed
|
||||||
|
del fnchange.tmp
|
||||||
|
del top_src.dir
|
||||||
|
Rem unpack the source distribution
|
||||||
|
djtar -x -n fnchange.lst %1
|
||||||
|
del fnchange.lst
|
||||||
|
GoTo End
|
||||||
|
|
||||||
|
:NoSed
|
||||||
|
del junk.tmp
|
||||||
|
echo FAIL: Sed is not available.
|
||||||
|
GoTo End
|
||||||
|
:NoDjTar
|
||||||
|
del junk.tmp
|
||||||
|
echo FAIL: DJTAR is not available or no fnchange.lst file in %1.
|
||||||
|
GoTo End
|
||||||
|
:NoArchive
|
||||||
|
echo FAIL: the file %1 does not seem to exist.
|
||||||
|
echo Remember that %1 cannot use forward slashes, only backslashes.
|
||||||
|
GoTo End
|
||||||
|
:NoArgument
|
||||||
|
echo FAIL: no archive file has been specified.
|
||||||
|
echo Remember that the file name cannot use forward slashes, only backslashes.
|
||||||
|
:End
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
@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
|
||||||
+293
@@ -0,0 +1,293 @@
|
|||||||
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
|
Copyright (C) 2005-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
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 Juan Manuel Guerrero <[email protected]>. */
|
||||||
|
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#include "subpipe.h"
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <process.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include "xalloc.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef STDIN_FILENO
|
||||||
|
# define STDIN_FILENO 0
|
||||||
|
#endif
|
||||||
|
#ifndef STDOUT_FILENO
|
||||||
|
# define STDOUT_FILENO 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include "error.h"
|
||||||
|
|
||||||
|
#include "gettext.h"
|
||||||
|
#define _(Msgid) gettext (Msgid)
|
||||||
|
|
||||||
|
|
||||||
|
/* Initialize this module. */
|
||||||
|
|
||||||
|
|
||||||
|
static int old_stdin;
|
||||||
|
static int old_stdout;
|
||||||
|
static char **arguments;
|
||||||
|
static char tmp_file_name[2][L_tmpnam];
|
||||||
|
|
||||||
|
#define remove_tmp_file(fd, name) \
|
||||||
|
do { \
|
||||||
|
close ((fd)); \
|
||||||
|
if (unlink ((name))) \
|
||||||
|
error (EXIT_FAILURE, 0, _("removing of `%s' failed"), (name)); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
init_subpipe(void)
|
||||||
|
{
|
||||||
|
char *tmpdir;
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
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], 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"));
|
||||||
|
close (fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Create a subprocess that is run as a filter. ARGV is the
|
||||||
|
NULL-terminated argument vector for the subprocess. Store read and
|
||||||
|
write file descriptors for communication with the subprocess into
|
||||||
|
FD[0] and FD[1]: input meant for the process can be written into
|
||||||
|
FD[0], and output from the process can be read from FD[1]. Return
|
||||||
|
the subprocess id.
|
||||||
|
|
||||||
|
Because DOS has neither fork nor pipe functionality to run the subprocess
|
||||||
|
as a filter, the filter is reproduced using temporary files. First bison's
|
||||||
|
stdout is redirected to a temporary file. After bison has produced all of
|
||||||
|
is output, this file is closed and connected to m4's stdin. All m4's output
|
||||||
|
is redirected from m4's stdout to a second temporary file and reopened as
|
||||||
|
bison's stdin. */
|
||||||
|
|
||||||
|
pid_t
|
||||||
|
create_subpipe(char const *const *argv, int fd[2])
|
||||||
|
{
|
||||||
|
int argc;
|
||||||
|
int from_in_fd; /* pipe from bison to m4. */
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
|
|
||||||
|
pid = getpid();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Save original stdin and stdout
|
||||||
|
* for later restauration.
|
||||||
|
*/
|
||||||
|
old_stdin = dup(STDIN_FILENO);
|
||||||
|
if (old_stdin < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("saving stdin failed"));
|
||||||
|
|
||||||
|
old_stdout = dup(STDOUT_FILENO);
|
||||||
|
if (old_stdout < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("saving stdout failed"));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Save argv for later use.
|
||||||
|
*/
|
||||||
|
for (argc = 0; argv[argc]; argc++)
|
||||||
|
;
|
||||||
|
argc++;
|
||||||
|
arguments = xmalloc(argc * sizeof(arguments[0]));
|
||||||
|
for (argc = 0; argv[argc]; argc++)
|
||||||
|
{
|
||||||
|
arguments[argc] = xmalloc((strlen(argv[argc]) + 1) * sizeof(arguments[0][0]));
|
||||||
|
strcpy(arguments[argc], argv[argc]);
|
||||||
|
}
|
||||||
|
arguments[argc] = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* All bison's output will be gathered in this temporary file
|
||||||
|
* and will be redirected to m4's stdin.
|
||||||
|
*/
|
||||||
|
from_in_fd = open(tmp_file_name[0], O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR);
|
||||||
|
if (from_in_fd < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("opening of tmpfile failed"));
|
||||||
|
if (dup2(from_in_fd, STDOUT_FILENO) < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(from_in_fd, tmp_file_name[0]);
|
||||||
|
error(EXIT_FAILURE, 0, _("redirecting bison's stdout to the temporary file failed"));
|
||||||
|
}
|
||||||
|
close(from_in_fd);
|
||||||
|
|
||||||
|
|
||||||
|
fd[0] = STDOUT_FILENO;
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* A signal handler that just records that a signal has happened. */
|
||||||
|
static int child_interrupted;
|
||||||
|
|
||||||
|
static void
|
||||||
|
signal_catcher(int signo)
|
||||||
|
{
|
||||||
|
child_interrupted++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
end_of_output_subpipe(pid_t pid, int fd[2])
|
||||||
|
{
|
||||||
|
char *program;
|
||||||
|
int from_out_fd = open(tmp_file_name[0], O_RDONLY, S_IRUSR); /* pipe from bison to m4. */
|
||||||
|
int to_in_fd = open(tmp_file_name[1], O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR); /* pipe from m4 to bison. */
|
||||||
|
int status;
|
||||||
|
void (*previous_handler)(int);
|
||||||
|
|
||||||
|
|
||||||
|
program = strrchr(arguments[0], '/');
|
||||||
|
if (program)
|
||||||
|
program++;
|
||||||
|
else
|
||||||
|
program = arguments[0];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Redirect bison's output to m4's stdin.
|
||||||
|
*/
|
||||||
|
if (from_out_fd < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("opening of tmpfile failed"));
|
||||||
|
if (dup2(from_out_fd, STDIN_FILENO) < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(from_out_fd, tmp_file_name[0]);
|
||||||
|
error(EXIT_FAILURE, 0, _("redirecting m4's stdin from the temporary file failed"));
|
||||||
|
}
|
||||||
|
close(from_out_fd);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* All m4's output will be gathered in this temporary file
|
||||||
|
* and will be redirected to bison's stdin.
|
||||||
|
*/
|
||||||
|
if (to_in_fd < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
error(EXIT_FAILURE, 0, _("opening of a temporary file failed"));
|
||||||
|
}
|
||||||
|
if (dup2(to_in_fd, STDOUT_FILENO) < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
remove_tmp_file(to_in_fd, tmp_file_name[1]);
|
||||||
|
error(EXIT_FAILURE, 0, _("redirecting m4's stdout to a temporary file failed"));
|
||||||
|
}
|
||||||
|
close(to_in_fd);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Run m4.
|
||||||
|
*/
|
||||||
|
child_interrupted = 0;
|
||||||
|
errno = 0;
|
||||||
|
previous_handler = signal(SIGINT, signal_catcher);
|
||||||
|
status = spawnvp(P_WAIT, program, arguments);
|
||||||
|
signal(SIGINT, previous_handler);
|
||||||
|
if (child_interrupted)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
|
error(EXIT_FAILURE, 0, _("subsidiary program `%s' interrupted"), program);
|
||||||
|
}
|
||||||
|
if (status)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
|
error(EXIT_FAILURE, 0, _(errno == ENOENT
|
||||||
|
? "subsidiary program `%s' not found"
|
||||||
|
: status < 1
|
||||||
|
? "subsidiary program `%s' failed"
|
||||||
|
: "subsidiary program `%s' failed (status=%i, errno=%i)"), program, status, errno);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Redirect m4's output to bison's stdin.
|
||||||
|
*/
|
||||||
|
if (dup2(old_stdout, STDOUT_FILENO) < 0)
|
||||||
|
error(EXIT_FAILURE, 0, "restore of bison's stdout failed");
|
||||||
|
close(old_stdout);
|
||||||
|
to_in_fd = open(tmp_file_name[1], O_RDONLY, S_IRUSR); /* pipe from m4 to bison. */
|
||||||
|
if (to_in_fd < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
error(EXIT_FAILURE, 0, _("opening of tmpfile failed"));
|
||||||
|
}
|
||||||
|
if (dup2(to_in_fd, STDIN_FILENO) < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
remove_tmp_file(to_in_fd, tmp_file_name[1]);
|
||||||
|
error(EXIT_FAILURE, -1, "dup2");
|
||||||
|
error(EXIT_FAILURE, 0, _("redirecting bison's stdin from the temporary file failed"));
|
||||||
|
}
|
||||||
|
close(to_in_fd);
|
||||||
|
|
||||||
|
|
||||||
|
fd[1] = STDIN_FILENO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Free resources, unlink temporary files and restore stdin and stdout. */
|
||||||
|
|
||||||
|
void
|
||||||
|
reap_subpipe(pid_t pid, char const *program)
|
||||||
|
{
|
||||||
|
int argc;
|
||||||
|
|
||||||
|
for (argc = 0; arguments[argc]; argc++)
|
||||||
|
free(arguments[argc]);
|
||||||
|
free(arguments);
|
||||||
|
|
||||||
|
if (unlink(tmp_file_name[0]))
|
||||||
|
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[0]);
|
||||||
|
if (unlink(tmp_file_name[1]))
|
||||||
|
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[1]);
|
||||||
|
|
||||||
|
if (dup2(old_stdin, STDIN_FILENO) < 0)
|
||||||
|
error(EXIT_FAILURE, 0, "restore of bison's stdin failed");
|
||||||
|
close(old_stdin);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/* Subprocesses with pipes.
|
||||||
|
Copyright (C) 2005-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
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 Juan Manuel Guerrero <[email protected]>. */
|
||||||
|
|
||||||
|
#if HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void init_subpipe(void);
|
||||||
|
pid_t create_subpipe(char const * const *, int[2]);
|
||||||
|
void end_of_output_subpipe(pid_t, int[2]);
|
||||||
|
void reap_subpipe(pid_t, char const *);
|
||||||
@@ -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-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
# Remove disallowed characters from file names.
|
||||||
|
|
||||||
|
s/~!@#\\\$%^&\*()-=_+{}\[\]|\\\\:;<>, ./~!@#\\$%^\&()-=_+{}[];, ./g
|
||||||
+7
-2
@@ -1,9 +1,13 @@
|
|||||||
|
*.info*
|
||||||
Makefile
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
bison.1
|
||||||
bison.aux
|
bison.aux
|
||||||
bison.cp
|
bison.cp
|
||||||
bison.cps
|
bison.cps
|
||||||
bison.dvi
|
bison.dvi
|
||||||
bison.fn
|
bison.fn
|
||||||
|
bison.html
|
||||||
bison.ky
|
bison.ky
|
||||||
bison.log
|
bison.log
|
||||||
bison.pdf
|
bison.pdf
|
||||||
@@ -12,10 +16,11 @@ bison.ps
|
|||||||
bison.toc
|
bison.toc
|
||||||
bison.tp
|
bison.tp
|
||||||
bison.vr
|
bison.vr
|
||||||
|
cross-options.texi
|
||||||
|
gendocs_template
|
||||||
refcard.dvi
|
refcard.dvi
|
||||||
refcard.log
|
refcard.log
|
||||||
refcard.ps
|
refcard.ps
|
||||||
Makefile.in
|
|
||||||
*.info*
|
|
||||||
stamp-vti
|
stamp-vti
|
||||||
version.texi
|
version.texi
|
||||||
|
yacc.1
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/*.info*
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/bison.1
|
||||||
|
/bison.aux
|
||||||
|
/bison.cp
|
||||||
|
/bison.cps
|
||||||
|
/bison.dvi
|
||||||
|
/bison.fn
|
||||||
|
/bison.html
|
||||||
|
/bison.ky
|
||||||
|
/bison.log
|
||||||
|
/bison.pdf
|
||||||
|
/bison.pg
|
||||||
|
/bison.ps
|
||||||
|
/bison.toc
|
||||||
|
/bison.tp
|
||||||
|
/bison.vr
|
||||||
|
/cross-options.texi
|
||||||
|
/gendocs_template
|
||||||
|
/refcard.dvi
|
||||||
|
/refcard.log
|
||||||
|
/refcard.ps
|
||||||
|
/stamp-vti
|
||||||
|
/version.texi
|
||||||
|
/yacc.1
|
||||||
+1087
File diff suppressed because it is too large
Load Diff
@@ -1,109 +0,0 @@
|
|||||||
Frequently Asked Questions about Bison:
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q1. Is Bison Y2K compliant?
|
|
||||||
|
|
||||||
A1. If you're looking for a guarantee or certification, I can't
|
|
||||||
provide it. With a little thought you can answer this one for
|
|
||||||
yourself, though. (Hint: does a parser generator rely on the
|
|
||||||
date or time for anything?) If you're still confused, see
|
|
||||||
http://www.gnu.org/software/year2000.html for more information.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q2. I can't build Bison because "make" complains that "msgfmt" is not
|
|
||||||
found. What should I do?
|
|
||||||
|
|
||||||
A2. Like most GNU packages with internationalization support, that
|
|
||||||
feature is turned on by default. If you have problems building
|
|
||||||
in the "po" subdirectory, it indicates that your system's
|
|
||||||
internationalization support is lacking. You can re-configure
|
|
||||||
Bison with "--disable-nls" to turn off this support, or you can
|
|
||||||
install GNU gettext from ftp://ftp.gnu.org/gnu/gettext/ and
|
|
||||||
re-configure Bison. See the file "ABOUT-NLS" for more
|
|
||||||
information.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q3. I'm having trouble using Bison. Where can I find help?
|
|
||||||
|
|
||||||
A3. First, read the fine manual which comes with bison. Beyond that,
|
|
||||||
you can send mail to <[email protected]>. This mailing list is
|
|
||||||
intended to be populated with people who are willing to answer
|
|
||||||
questions about using and installing Bison. Please keep in mind
|
|
||||||
that (most of) the people on the list have aspects of their lives
|
|
||||||
which are not related to Bison (!), so you may not receive an
|
|
||||||
answer to your question right away. This can be frustrating, but
|
|
||||||
please try not to honk them off; remember that any help they
|
|
||||||
provide is purely voluntary and out of the kindness of their
|
|
||||||
hearts.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q4. I found a bug. What should I include in the bug report?
|
|
||||||
|
|
||||||
A4. Before you send a bug report, make sure you are using the latest
|
|
||||||
version. Check ftp://ftp.gnu.org/pub/gnu/bison/ or one of its
|
|
||||||
mirrors. Be sure to include the version number in your bug
|
|
||||||
report. If the bug is present in the latest version but not in a
|
|
||||||
previous version, try to determine the most recent version which
|
|
||||||
did not contain the bug.
|
|
||||||
|
|
||||||
If the bug is parser-related, you should include the smallest
|
|
||||||
grammar you can which demonstrates the bug. The grammar file
|
|
||||||
should also be complete (i.e., I should be able to run it through
|
|
||||||
Bison without having to edit or add anything). The smaller and
|
|
||||||
simpler the grammar, the easier it will be to fix the bug.
|
|
||||||
|
|
||||||
Include information about your compilation environment, including
|
|
||||||
your operating system's name and version and your compiler's name
|
|
||||||
and version. If you have trouble compiling, you should also
|
|
||||||
include a transcript of the build session, starting with the
|
|
||||||
invocation of `configure'. Depending on the nature of the bug,
|
|
||||||
you may be asked to send additional files as well (such as
|
|
||||||
`config.h' or `config.cache').
|
|
||||||
|
|
||||||
Patches are most welcome, but not required. That is, do not
|
|
||||||
hesitate to send a bug report just because you can not provide a
|
|
||||||
fix.
|
|
||||||
|
|
||||||
Send bug reports to <[email protected]>.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q5. Will Bison ever have C++ support?
|
|
||||||
|
|
||||||
A5. Yes, it's in the works. Things are very chaotic right now, but
|
|
||||||
what little information floats around is posted to the bug-bison
|
|
||||||
mailing list. If you're interested in testing C++ support when
|
|
||||||
it becomes available, please consider subscribing to the list,
|
|
||||||
especially if you are willing to beta test other releases as
|
|
||||||
well.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q6. What is involved in being a beta tester?
|
|
||||||
|
|
||||||
A6. It's not terribly involved. Basically, you would download a test
|
|
||||||
release, compile it, and use it to build and run a parser or two.
|
|
||||||
After that, you would submit either a bug report or a message
|
|
||||||
saying that everything is okay. It is important to report
|
|
||||||
successes as well as failures because test releases eventually
|
|
||||||
become mainstream releases, but only if they are adequately
|
|
||||||
tested. If no one tests, development is essentially halted.
|
|
||||||
|
|
||||||
Beta testers are particularly needed for operating systems to
|
|
||||||
which I do not have access. I currently have easy access to
|
|
||||||
Linux (x86 glibc 2.1), Solaris (SPARC) 2.6 and 2.7, and HP-UX
|
|
||||||
10.20. Reports about other operating systems are especially
|
|
||||||
welcome.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q7. How do I join the help-bison and bug-bison mailing lists?
|
|
||||||
|
|
||||||
A7. See http://www.gnu.org/ (the section about "GNU mailing lists")
|
|
||||||
for more information.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
+109
-22
@@ -1,34 +1,121 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
## Copyright (C) 2001-2003, 2005-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
## This program 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
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
## You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
## along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
AM_MAKEINFOFLAGS = --no-split
|
AM_MAKEINFOFLAGS = --no-split
|
||||||
info_TEXINFOS = bison.texinfo
|
info_TEXINFOS = bison.texinfo
|
||||||
man_MANS = bison.1
|
bison_TEXINFOS = $(srcdir)/cross-options.texi gpl-3.0.texi fdl.texi
|
||||||
bison_TEXINFOS = gpl.texi fdl.texi
|
|
||||||
|
|
||||||
EXTRA_DIST = FAQ bison.1 refcard.tex
|
|
||||||
|
|
||||||
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
|
|
||||||
|
|
||||||
|
CLEANFILES = bison.fns
|
||||||
|
CLEANDIRS = *.t2d
|
||||||
clean-local:
|
clean-local:
|
||||||
rm -rf *.t2d
|
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
|
refcard.dvi: refcard.tex
|
||||||
tex refcard.tex
|
tex refcard.tex
|
||||||
|
|
||||||
refcard.ps: refcard.dvi
|
refcard.ps: refcard.dvi
|
||||||
|
|
||||||
|
|
||||||
|
## ----------- ##
|
||||||
|
## Man Pages. ##
|
||||||
|
## ----------- ##
|
||||||
|
|
||||||
|
dist_man_MANS = $(srcdir)/bison.1
|
||||||
|
|
||||||
|
EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
|
||||||
|
MAINTAINERCLEANFILES += $(dist_man_MANS)
|
||||||
|
|
||||||
|
# Depend on configure to get version number changes.
|
||||||
|
common_dep = $(top_srcdir)/configure $(srcdir)/common.x
|
||||||
|
srcsrcdir = $(top_srcdir)/bin
|
||||||
|
$(srcdir)/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
|
||||||
|
|
||||||
|
# Differences to ignore when comparing the man page (the date).
|
||||||
|
remove_time_stamp = \
|
||||||
|
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
||||||
|
|
||||||
|
MOSTLYCLEANFILES = $(srcdir)/*.t
|
||||||
|
|
||||||
|
SUFFIXES = .x .1
|
||||||
|
|
||||||
|
PREPATH = $(top_builddir)/src
|
||||||
|
.x.1:
|
||||||
|
@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,.*/,,'`
|
||||||
|
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. ##
|
||||||
|
## -------------- ##
|
||||||
|
|
||||||
|
DOXYGEN = doxygen
|
||||||
|
|
||||||
|
.PHONY: doc html
|
||||||
|
|
||||||
|
doc: html
|
||||||
|
|
||||||
|
html-local: Doxyfile
|
||||||
|
$(DOXYGEN)
|
||||||
|
|
||||||
|
edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
||||||
|
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
||||||
|
-e 's,@top_builddir\@,$(top_builddir),g' \
|
||||||
|
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
||||||
|
|
||||||
|
EXTRA_DIST += Doxyfile.in
|
||||||
|
CLEANFILES += Doxyfile
|
||||||
|
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
||||||
|
# configure, because the former is way faster than the latter.
|
||||||
|
Doxyfile: $(srcdir)/Doxyfile.in
|
||||||
|
$(edit) $(srcdir)/Doxyfile.in >Doxyfile
|
||||||
|
|
||||||
|
CLEANDIRS += html latex
|
||||||
|
|||||||
-369
@@ -1,369 +0,0 @@
|
|||||||
.TH BISON 1 local
|
|
||||||
.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"
|
|
||||||
]
|
|
||||||
.SH 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 = .
|
|
||||||
.SS OPTIONS
|
|
||||||
.TP
|
|
||||||
.BI \-b " file-prefix"
|
|
||||||
.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 ,
|
|
||||||
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 look-ahead 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.
|
|
||||||
+2723
-714
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 @@
|
|||||||
|
@c The GNU Free Documentation License.
|
||||||
@node GNU Free Documentation License
|
|
||||||
@appendixsec GNU Free Documentation License
|
|
||||||
|
|
||||||
@cindex FDL, GNU Free Documentation License
|
|
||||||
@center Version 1.2, November 2002
|
@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
|
@display
|
||||||
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
@@ -408,7 +407,7 @@ as a draft) by the Free Software Foundation.
|
|||||||
@end enumerate
|
@end enumerate
|
||||||
|
|
||||||
@page
|
@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
|
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
|
the License in the document and put the following copyright and
|
||||||
@@ -427,7 +426,7 @@ license notices just after the title page:
|
|||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
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
|
@smallexample
|
||||||
@group
|
@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.
|
|
||||||
+13
-15
@@ -19,24 +19,22 @@
|
|||||||
\def\finalout{\overfullrule=0pt}
|
\def\finalout{\overfullrule=0pt}
|
||||||
%\finalout
|
%\finalout
|
||||||
|
|
||||||
% Copyright (c) 1998, 2001 Free Software Foundation, Inc.
|
% Copyright (c) 1998, 2001, 2009-2010 Free Software Foundation, Inc.
|
||||||
%
|
%
|
||||||
% This file is part of Bison.
|
% This file is part of Bison.
|
||||||
%
|
%
|
||||||
% Bison is free software; you can redistribute them and/or modify them
|
% This program is free software: you can redistribute it and/or modify
|
||||||
% under the terms of the GNU General Public License as published by the
|
% it under the terms of the GNU General Public License as published by
|
||||||
% Free Software Foundation; either version 2, or (at your option) any
|
% the Free Software Foundation, either version 3 of the License, or
|
||||||
% later version.
|
% (at your option) any later version.
|
||||||
%
|
%
|
||||||
% Bison is distributed in the hope that it will be useful, but WITHOUT
|
% This program is distributed in the hope that it will be useful,
|
||||||
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
% for more details.
|
% GNU General Public License for more details.
|
||||||
%
|
%
|
||||||
% You should have received a copy of the GNU General Public License
|
% You should have received a copy of the GNU General Public License
|
||||||
% along with either Flex or Bison; see the file COPYING. If not, write
|
% along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
% Boston, MA 02110-1301, USA.
|
|
||||||
%
|
%
|
||||||
% This file is intended to be processed by plain TeX (TeX82).
|
% This file is intended to be processed by plain TeX (TeX82).
|
||||||
%
|
%
|
||||||
@@ -458,7 +456,7 @@ as either {\tt first_column} or {\tt last_column}.
|
|||||||
\section {Variables and Types}
|
\section {Variables and Types}
|
||||||
%*****************************
|
%*****************************
|
||||||
|
|
||||||
\key{Current look ahead token.} {yychar}
|
\key{Current lookahead token.} {yychar}
|
||||||
\key{Debug mode flag.} {yydebug}
|
\key{Debug mode flag.} {yydebug}
|
||||||
\key{Data associated with the current token.} {yylval}
|
\key{Data associated with the current token.} {yylval}
|
||||||
\key{Source position of current token.} {yylloc}
|
\key{Source position of current token.} {yylloc}
|
||||||
@@ -489,8 +487,8 @@ as either {\tt first_column} or {\tt last_column}.
|
|||||||
\key{Quit parsing immediately. Return 1.} {YYABORT}
|
\key{Quit parsing immediately. Return 1.} {YYABORT}
|
||||||
\key{Quit parsing immediately. Return 0.} {YYACCEPT}
|
\key{Quit parsing immediately. Return 0.} {YYACCEPT}
|
||||||
\key{Pretend a syntax error occurred.} {YYERROR}
|
\key{Pretend a syntax error occurred.} {YYERROR}
|
||||||
\key{Value in {\tt yychar} if no look-ahead token.} {YYEMPTY}
|
\key{Value in {\tt yychar} if no lookahead token.} {YYEMPTY}
|
||||||
\key{Clear previous look ahead token.} {yyclearin}
|
\key{Clear previous lookahead token.} {yyclearin}
|
||||||
\key{Recover normally from an error.} {yyerrok}
|
\key{Recover normally from an error.} {yyerrok}
|
||||||
|
|
||||||
% **************
|
% **************
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
*.t
|
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
|
bench.pl
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/bench.pl
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
## Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# 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
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
A directory of tools provided to people using CVS Bison. None of
|
||||||
|
these is distributed.
|
||||||
|
|
||||||
|
* bench.pl
|
||||||
|
A primitive Perl script to run benches. Currently its only bench is
|
||||||
|
the usual calculator: it has a lightweight processing part (but not
|
||||||
|
null), so it is really emphasizing the cost of the whole parsing
|
||||||
|
(including scanning and I/O).
|
||||||
|
|
||||||
|
Set the envvars BISON and CC to the programs and flags you want to
|
||||||
|
use. They default to bison and gcc. To run a non-installed bison
|
||||||
|
from a tarball built in _build, I suggest the following.
|
||||||
|
|
||||||
|
BISON=_build/tests/bison CC='gcc -O2' ./bench.pl
|
||||||
|
|
||||||
|
(The _build/tests/bison wrapper makes sure that _build/src/bison will
|
||||||
|
use the tarballs' skeletons, not those already installed as a
|
||||||
|
straightforward use of _build/src/bison would.)
|
||||||
|
|
||||||
|
--
|
||||||
|
|
||||||
|
Copyright (C) 2006, 2009-2010 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/>.
|
||||||
|
|
||||||
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
End:
|
||||||
Executable
+384
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
|||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
+15
-15
@@ -1,21 +1,21 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2005 Free Software Foundation, Inc.
|
## Copyright (C) 2005, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
## This program 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
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
## You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
## along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
|
if BISON_CXX_WORKS
|
||||||
SUBDIRS = calc++
|
SUBDIRS = calc++
|
||||||
|
endif
|
||||||
|
|
||||||
dist_noinst_SCRIPTS = extexi
|
dist_noinst_SCRIPTS = extexi
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*.cc
|
||||||
|
/*.hh
|
||||||
|
/*.ll
|
||||||
|
/*.o
|
||||||
|
/*.output
|
||||||
|
/*.stamp
|
||||||
|
/*.tmp
|
||||||
|
/*.yy
|
||||||
|
/.deps
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/calc++
|
||||||
|
/calc++.exe
|
||||||
+26
-20
@@ -1,20 +1,18 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2005 Free Software Foundation, Inc.
|
## Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
## This program 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
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
## You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
## along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
## ------------------------------------- ##
|
## ------------------------------------- ##
|
||||||
## Running the bison from this tarball. ##
|
## Running the bison from this tarball. ##
|
||||||
@@ -33,17 +31,22 @@ $(BISON): $(BISON_IN)
|
|||||||
doc = $(top_srcdir)/doc/bison.texinfo
|
doc = $(top_srcdir)/doc/bison.texinfo
|
||||||
extexi = $(top_srcdir)/examples/extexi
|
extexi = $(top_srcdir)/examples/extexi
|
||||||
# Extract in src.
|
# Extract in src.
|
||||||
$(calc_extracted): $(doc) $(extexi)
|
$(srcdir)/calc.stamp: $(doc) $(extexi)
|
||||||
|
rm -f $@ $@.tmp
|
||||||
|
touch $@.tmp
|
||||||
cd $(srcdir) && \
|
cd $(srcdir) && \
|
||||||
$(AWK) -f ../extexi ../../doc/bison.texinfo -- \
|
$(AWK) -f ../extexi -v VERSION="$(VERSION)" \
|
||||||
calc++-parser.yy \
|
../../doc/bison.texinfo -- calc++-parser.yy \
|
||||||
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
$(calc_extracted): $(srcdir)/calc.stamp
|
||||||
|
|
||||||
## ------------------- ##
|
## ------------------- ##
|
||||||
## Parser generation. ##
|
## Parser generation. ##
|
||||||
## ------------------- ##
|
## ------------------- ##
|
||||||
|
|
||||||
|
DEFAULT_INCLUDES = -I. -I$(srcdir)
|
||||||
BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
|
BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
|
||||||
CLEANFILES = $(srcdir)/*.output *.tmp
|
CLEANFILES = $(srcdir)/*.output *.tmp
|
||||||
MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
||||||
@@ -51,7 +54,10 @@ MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
|||||||
# Compile the parser and save cycles.
|
# Compile the parser and save cycles.
|
||||||
# This code comes from "Handling Tools that Produce Many Outputs",
|
# This code comes from "Handling Tools that Produce Many Outputs",
|
||||||
# from the Automake documentation.
|
# from the Automake documentation.
|
||||||
EXTRA_DIST = $(srcdir)/calc++-parser.stamp $(srcdir)/calc++-parser.yy
|
EXTRA_DIST = \
|
||||||
|
$(srcdir)/calc++-parser.stamp \
|
||||||
|
$(srcdir)/calc++-parser.yy \
|
||||||
|
$(srcdir)/calc.stamp
|
||||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||||
# in srcdir, including during distcheck, which is forbidden.
|
# in srcdir, including during distcheck, which is forbidden.
|
||||||
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
||||||
@@ -72,7 +78,7 @@ $(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
|||||||
## Building & testing calc++. ##
|
## Building & testing calc++. ##
|
||||||
## --------------------------- ##
|
## --------------------------- ##
|
||||||
|
|
||||||
noinst_PROGRAMS = calc++
|
check_PROGRAMS = calc++
|
||||||
|
|
||||||
calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
|
calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
|
||||||
$(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
|
$(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
set +e
|
test -z "$VERBOSE" && {
|
||||||
|
exec > /dev/null 2>&1
|
||||||
|
set -x
|
||||||
|
}
|
||||||
|
|
||||||
cat >input <<EOF
|
cat >input <<EOF
|
||||||
a := 1
|
a := 1
|
||||||
b := 2
|
b := 2
|
||||||
@@ -18,8 +22,6 @@ d := a + b * c
|
|||||||
EOF
|
EOF
|
||||||
./calc++ input
|
./calc++ input
|
||||||
|
|
||||||
set -x
|
|
||||||
echo toto
|
|
||||||
cat >input <<EOF
|
cat >input <<EOF
|
||||||
toto := 1
|
toto := 1
|
||||||
toto
|
toto
|
||||||
|
|||||||
+10
-8
@@ -1,11 +1,12 @@
|
|||||||
# Extract all examples from the manual source. -*- AWK -*-
|
# Extract all examples from the manual source. -*- AWK -*-
|
||||||
|
|
||||||
# This file is part of GNU Bison
|
# This file is part of GNU Bison
|
||||||
# Copyright 1992, 2000, 2001, 2005 Free Software Foundation, Inc.
|
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2010 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -14,9 +15,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
||||||
# 02111-1307 USA
|
|
||||||
|
|
||||||
# This script is for use with any Awk that conforms to POSIX.
|
# 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.
|
# It was derived from a similar script tests/generate.awk in GNU m4.
|
||||||
@@ -77,9 +76,11 @@ BEGIN {
|
|||||||
input = normalize(input);
|
input = normalize(input);
|
||||||
# No spurious end of line: use printf.
|
# No spurious end of line: use printf.
|
||||||
if (files_output[file])
|
if (files_output[file])
|
||||||
printf ("%s", input) >> output_dir "/" file;
|
# The parens around the output file seem to be required
|
||||||
|
# by awk on Mac OS X Tiger (darwin 8.4.6).
|
||||||
|
printf ("%s", input) >> (output_dir "/" file);
|
||||||
else
|
else
|
||||||
printf ("%s", input) > output_dir "/" file;
|
printf ("%s", input) > (output_dir "/" file);
|
||||||
close (output_dir "/" file);
|
close (output_dir "/" file);
|
||||||
files_output[file] = 1;
|
files_output[file] = 1;
|
||||||
|
|
||||||
@@ -109,6 +110,7 @@ function normalize(contents, i, lines, n, line, res) {
|
|||||||
else
|
else
|
||||||
line = "";
|
line = "";
|
||||||
|
|
||||||
|
gsub (/"@value\{VERSION\}"/, "\"" VERSION "\"", line)
|
||||||
gsub (/^@result\{\}/, "", line);
|
gsub (/^@result\{\}/, "", line);
|
||||||
gsub (/^@error\{\}/, "", line);
|
gsub (/^@error\{\}/, "", line);
|
||||||
gsub ("@[{]", "{", line);
|
gsub ("@[{]", "{", line);
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
external: gnulib
|
||||||
Submodule
+1
Submodule gnulib added at 9d0ad652de
+124
-10
@@ -1,59 +1,173 @@
|
|||||||
.deps
|
.deps
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
alloca.c
|
|
||||||
alloca.h
|
alloca.h
|
||||||
alloca_.h
|
alloca.in.h
|
||||||
argmatch.c
|
argmatch.c
|
||||||
argmatch.h
|
argmatch.h
|
||||||
|
basename-lgpl.c
|
||||||
basename.c
|
basename.c
|
||||||
|
binary-io.h
|
||||||
|
bitrotate.h
|
||||||
|
c-ctype.c
|
||||||
|
c-ctype.h
|
||||||
|
c-strcase.h
|
||||||
|
c-strcasecmp.c
|
||||||
|
c-strncasecmp.c
|
||||||
|
charset.alias
|
||||||
|
cloexec.c
|
||||||
|
cloexec.h
|
||||||
|
config.charset
|
||||||
|
config.h
|
||||||
|
config.hin
|
||||||
|
configmake.h
|
||||||
|
dirname-lgpl.c
|
||||||
dirname.c
|
dirname.c
|
||||||
dirname.h
|
dirname.h
|
||||||
|
dup-safer-flag.c
|
||||||
dup-safer.c
|
dup-safer.c
|
||||||
|
dup2.c
|
||||||
|
errno.h
|
||||||
|
errno.in.h
|
||||||
error.c
|
error.c
|
||||||
error.h
|
error.h
|
||||||
exit.h
|
|
||||||
exitfail.c
|
exitfail.c
|
||||||
exitfail.h
|
exitfail.h
|
||||||
|
fatal-signal.c
|
||||||
|
fatal-signal.h
|
||||||
|
fcntl.c
|
||||||
|
fcntl.h
|
||||||
|
fcntl.in.h
|
||||||
|
fd-safer-flag.c
|
||||||
fd-safer.c
|
fd-safer.c
|
||||||
fopen-safer.c
|
fopen-safer.c
|
||||||
|
fopen.c
|
||||||
|
getdtablesize.c
|
||||||
getopt.c
|
getopt.c
|
||||||
getopt.h
|
getopt.h
|
||||||
|
getopt.in.h
|
||||||
getopt1.c
|
getopt1.c
|
||||||
getopt_.h
|
getopt_.h
|
||||||
getopt_int.h
|
getopt_int.h
|
||||||
|
getpagesize.c
|
||||||
gettext.h
|
gettext.h
|
||||||
gnulib.mk
|
gnulib.mk
|
||||||
hard-locale.c
|
|
||||||
hard-locale.h
|
|
||||||
hash.c
|
hash.c
|
||||||
hash.h
|
hash.h
|
||||||
|
intprops.h
|
||||||
|
inttypes.h
|
||||||
|
inttypes.in.h
|
||||||
|
inttypes_.h
|
||||||
|
localcharset.c
|
||||||
|
localcharset.h
|
||||||
malloc.c
|
malloc.c
|
||||||
|
mbrtowc.c
|
||||||
|
mbsinit.c
|
||||||
mbswidth.c
|
mbswidth.c
|
||||||
mbswidth.h
|
mbswidth.h
|
||||||
|
memchr.c
|
||||||
|
memchr.valgrind
|
||||||
obstack.c
|
obstack.c
|
||||||
obstack.h
|
obstack.h
|
||||||
|
open.c
|
||||||
pipe-safer.c
|
pipe-safer.c
|
||||||
|
pipe.c
|
||||||
|
pipe.h
|
||||||
|
pipe2-safer.c
|
||||||
|
pipe2.c
|
||||||
quote.c
|
quote.c
|
||||||
quote.h
|
quote.h
|
||||||
quotearg.c
|
quotearg.c
|
||||||
quotearg.h
|
quotearg.h
|
||||||
|
rawmemchr.c
|
||||||
|
rawmemchr.valgrind
|
||||||
|
ref-add.sed
|
||||||
|
ref-add.sin
|
||||||
|
ref-del.sed
|
||||||
|
ref-del.sin
|
||||||
|
sched.h
|
||||||
|
sched.in.h
|
||||||
|
sig-handler.h
|
||||||
|
sigaction.c
|
||||||
|
signal.h
|
||||||
|
signal.in.h
|
||||||
|
sigprocmask.c
|
||||||
|
spawn.h
|
||||||
|
spawn.in.h
|
||||||
|
spawn_faction_addclose.c
|
||||||
|
spawn_faction_adddup2.c
|
||||||
|
spawn_faction_addopen.c
|
||||||
|
spawn_faction_destroy.c
|
||||||
|
spawn_faction_init.c
|
||||||
|
spawn_int.h
|
||||||
|
spawnattr_destroy.c
|
||||||
|
spawnattr_init.c
|
||||||
|
spawnattr_setflags.c
|
||||||
|
spawnattr_setsigmask.c
|
||||||
|
spawni.c
|
||||||
|
spawnp.c
|
||||||
|
stamp-h1
|
||||||
|
stat.c
|
||||||
stdbool.h
|
stdbool.h
|
||||||
|
stdbool.in.h
|
||||||
stdbool_.h
|
stdbool_.h
|
||||||
|
stddef.h
|
||||||
|
stddef.in.h
|
||||||
|
stdint.h
|
||||||
|
stdint.in.h
|
||||||
|
stdint_.h
|
||||||
stdio--.h
|
stdio--.h
|
||||||
stdio-safer.h
|
stdio-safer.h
|
||||||
|
stdio-write.c
|
||||||
|
stdio.h
|
||||||
|
stdio.in.h
|
||||||
|
stdlib.h
|
||||||
|
stdlib.in.h
|
||||||
|
stdlib_.h
|
||||||
stpcpy.c
|
stpcpy.c
|
||||||
stpcpy.h
|
strchrnul.c
|
||||||
strdup.c
|
strchrnul.valgrind
|
||||||
strdup.h
|
streq.h
|
||||||
|
strerror.c
|
||||||
|
string.h
|
||||||
|
string.in.h
|
||||||
|
string_.h
|
||||||
stripslash.c
|
stripslash.c
|
||||||
strndup.c
|
strndup.c
|
||||||
strndup.h
|
|
||||||
strnlen.c
|
strnlen.c
|
||||||
strnlen.h
|
strtol.c
|
||||||
|
strtoul.c
|
||||||
|
strverscmp.c
|
||||||
|
strverscmp.h
|
||||||
|
sys
|
||||||
|
sys_stat.h
|
||||||
|
sys_stat.in.h
|
||||||
|
sys_wait.h
|
||||||
|
sys_wait.in.h
|
||||||
|
time.h
|
||||||
|
time.in.h
|
||||||
unistd--.h
|
unistd--.h
|
||||||
unistd-safer.h
|
unistd-safer.h
|
||||||
|
unistd.h
|
||||||
|
unistd.in.h
|
||||||
|
unistd_.h
|
||||||
|
unitypes.h
|
||||||
|
uniwidth
|
||||||
|
uniwidth.h
|
||||||
unlocked-io.h
|
unlocked-io.h
|
||||||
|
unsetenv.c
|
||||||
|
verify.h
|
||||||
|
w32spawn.h
|
||||||
|
wait-process.c
|
||||||
|
wait-process.h
|
||||||
|
wchar.h
|
||||||
|
wchar.in.h
|
||||||
|
wchar_.h
|
||||||
|
wctype.h
|
||||||
|
wctype.in.h
|
||||||
|
wctype_.h
|
||||||
|
wcwidth.c
|
||||||
|
wcwidth.h
|
||||||
xalloc-die.c
|
xalloc-die.c
|
||||||
xalloc.h
|
xalloc.h
|
||||||
xmalloc.c
|
xmalloc.c
|
||||||
|
|||||||
+178
@@ -0,0 +1,178 @@
|
|||||||
|
/*.a
|
||||||
|
/*.o
|
||||||
|
/*~
|
||||||
|
/.deps
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/alloca.h
|
||||||
|
/alloca.in.h
|
||||||
|
/argmatch.c
|
||||||
|
/argmatch.h
|
||||||
|
/basename-lgpl.c
|
||||||
|
/basename.c
|
||||||
|
/binary-io.h
|
||||||
|
/bitrotate.h
|
||||||
|
/c-ctype.c
|
||||||
|
/c-ctype.h
|
||||||
|
/c-strcase.h
|
||||||
|
/c-strcasecmp.c
|
||||||
|
/c-strncasecmp.c
|
||||||
|
/charset.alias
|
||||||
|
/cloexec.c
|
||||||
|
/cloexec.h
|
||||||
|
/config.charset
|
||||||
|
/config.h
|
||||||
|
/config.hin
|
||||||
|
/configmake.h
|
||||||
|
/dirname-lgpl.c
|
||||||
|
/dirname.c
|
||||||
|
/dirname.h
|
||||||
|
/dup-safer-flag.c
|
||||||
|
/dup-safer.c
|
||||||
|
/dup2.c
|
||||||
|
/errno.h
|
||||||
|
/errno.in.h
|
||||||
|
/error.c
|
||||||
|
/error.h
|
||||||
|
/exitfail.c
|
||||||
|
/exitfail.h
|
||||||
|
/fatal-signal.c
|
||||||
|
/fatal-signal.h
|
||||||
|
/fcntl.c
|
||||||
|
/fcntl.h
|
||||||
|
/fcntl.in.h
|
||||||
|
/fd-safer-flag.c
|
||||||
|
/fd-safer.c
|
||||||
|
/fopen-safer.c
|
||||||
|
/fopen.c
|
||||||
|
/getdtablesize.c
|
||||||
|
/getopt.c
|
||||||
|
/getopt.h
|
||||||
|
/getopt.in.h
|
||||||
|
/getopt1.c
|
||||||
|
/getopt_.h
|
||||||
|
/getopt_int.h
|
||||||
|
/getpagesize.c
|
||||||
|
/gettext.h
|
||||||
|
/gnulib.mk
|
||||||
|
/hash.c
|
||||||
|
/hash.h
|
||||||
|
/intprops.h
|
||||||
|
/inttypes.h
|
||||||
|
/inttypes.in.h
|
||||||
|
/inttypes_.h
|
||||||
|
/localcharset.c
|
||||||
|
/localcharset.h
|
||||||
|
/malloc.c
|
||||||
|
/mbrtowc.c
|
||||||
|
/mbsinit.c
|
||||||
|
/mbswidth.c
|
||||||
|
/mbswidth.h
|
||||||
|
/memchr.c
|
||||||
|
/memchr.valgrind
|
||||||
|
/obstack.c
|
||||||
|
/obstack.h
|
||||||
|
/open.c
|
||||||
|
/pipe-safer.c
|
||||||
|
/pipe.c
|
||||||
|
/pipe.h
|
||||||
|
/pipe2-safer.c
|
||||||
|
/pipe2.c
|
||||||
|
/quote.c
|
||||||
|
/quote.h
|
||||||
|
/quotearg.c
|
||||||
|
/quotearg.h
|
||||||
|
/rawmemchr.c
|
||||||
|
/rawmemchr.valgrind
|
||||||
|
/ref-add.sed
|
||||||
|
/ref-add.sin
|
||||||
|
/ref-del.sed
|
||||||
|
/ref-del.sin
|
||||||
|
/sched.h
|
||||||
|
/sched.in.h
|
||||||
|
/sig-handler.h
|
||||||
|
/sigaction.c
|
||||||
|
/signal.h
|
||||||
|
/signal.in.h
|
||||||
|
/sigprocmask.c
|
||||||
|
/spawn.h
|
||||||
|
/spawn.in.h
|
||||||
|
/spawn_faction_addclose.c
|
||||||
|
/spawn_faction_adddup2.c
|
||||||
|
/spawn_faction_addopen.c
|
||||||
|
/spawn_faction_destroy.c
|
||||||
|
/spawn_faction_init.c
|
||||||
|
/spawn_int.h
|
||||||
|
/spawnattr_destroy.c
|
||||||
|
/spawnattr_init.c
|
||||||
|
/spawnattr_setflags.c
|
||||||
|
/spawnattr_setsigmask.c
|
||||||
|
/spawni.c
|
||||||
|
/spawnp.c
|
||||||
|
/stamp-h1
|
||||||
|
/stat.c
|
||||||
|
/stdbool.h
|
||||||
|
/stdbool.in.h
|
||||||
|
/stdbool_.h
|
||||||
|
/stddef.h
|
||||||
|
/stddef.in.h
|
||||||
|
/stdint.h
|
||||||
|
/stdint.in.h
|
||||||
|
/stdint_.h
|
||||||
|
/stdio--.h
|
||||||
|
/stdio-safer.h
|
||||||
|
/stdio-write.c
|
||||||
|
/stdio.h
|
||||||
|
/stdio.in.h
|
||||||
|
/stdlib.h
|
||||||
|
/stdlib.in.h
|
||||||
|
/stdlib_.h
|
||||||
|
/stpcpy.c
|
||||||
|
/strchrnul.c
|
||||||
|
/strchrnul.valgrind
|
||||||
|
/streq.h
|
||||||
|
/strerror.c
|
||||||
|
/string.h
|
||||||
|
/string.in.h
|
||||||
|
/string_.h
|
||||||
|
/stripslash.c
|
||||||
|
/strndup.c
|
||||||
|
/strnlen.c
|
||||||
|
/strtol.c
|
||||||
|
/strtoul.c
|
||||||
|
/strverscmp.c
|
||||||
|
/strverscmp.h
|
||||||
|
/sys
|
||||||
|
/sys_stat.h
|
||||||
|
/sys_stat.in.h
|
||||||
|
/sys_wait.h
|
||||||
|
/sys_wait.in.h
|
||||||
|
/time.h
|
||||||
|
/time.in.h
|
||||||
|
/unistd--.h
|
||||||
|
/unistd-safer.h
|
||||||
|
/unistd.h
|
||||||
|
/unistd.in.h
|
||||||
|
/unistd_.h
|
||||||
|
/unitypes.h
|
||||||
|
/uniwidth
|
||||||
|
/uniwidth.h
|
||||||
|
/unlocked-io.h
|
||||||
|
/unsetenv.c
|
||||||
|
/verify.h
|
||||||
|
/w32spawn.h
|
||||||
|
/wait-process.c
|
||||||
|
/wait-process.h
|
||||||
|
/wchar.h
|
||||||
|
/wchar.in.h
|
||||||
|
/wchar_.h
|
||||||
|
/wctype.h
|
||||||
|
/wctype.in.h
|
||||||
|
/wctype_.h
|
||||||
|
/wcwidth.c
|
||||||
|
/wcwidth.h
|
||||||
|
/xalloc-die.c
|
||||||
|
/xalloc.h
|
||||||
|
/xmalloc.c
|
||||||
|
/xstrndup.c
|
||||||
|
/xstrndup.h
|
||||||
+28
-36
@@ -1,39 +1,26 @@
|
|||||||
## 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
|
# Copyright (C) 2001-2004, 2006, 2008-2010 Free Software Foundation,
|
||||||
## it under the terms of the GNU General Public License as published by
|
# Inc.
|
||||||
## 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,
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# it under the terms of the GNU General Public License as published by
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## GNU General Public License for more details.
|
# (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
|
include gnulib.mk
|
||||||
## along with this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
AM_CFLAGS = $(WARNING_CFLAGS)
|
AM_CFLAGS += $(WARN_CFLAGS)
|
||||||
|
|
||||||
BUILT_SOURCES =
|
# Implementation of bitsets.
|
||||||
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
|
|
||||||
bitsets_sources = \
|
bitsets_sources = \
|
||||||
abitset.c abitset.h bbitset.h bitset.c bitset.h bitset_stats.c \
|
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 \
|
bitset_stats.h bitsetv.c bitsetv.h ebitset.c ebitset.h lbitset.c \
|
||||||
@@ -41,13 +28,18 @@ bitsets_sources = \
|
|||||||
|
|
||||||
# Additional bitset operations.
|
# Additional bitset operations.
|
||||||
additional_bitsets_sources = \
|
additional_bitsets_sources = \
|
||||||
bitsetv-print.h bitsetv-print.c
|
bitsetv-print.h bitsetv-print.c
|
||||||
|
|
||||||
# timevars, stolen from GCC.
|
# timevars, stolen from GCC.
|
||||||
timevars_sources = \
|
timevars_sources = \
|
||||||
timevar.h timevar.c timevar.def
|
timevar.h timevar.c timevar.def
|
||||||
|
|
||||||
libbison_a_LIBADD = $(LIBOBJS) $(ALLOCA)
|
# Non-gnulib sources in Bison's internal library.
|
||||||
libbison_a_DEPENDENCIES = $(libbison_a_LIBADD)
|
libbison_a_SOURCES += \
|
||||||
|
get-errno.h get-errno.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
|
||||||
|
|||||||
+11
-15
@@ -1,10 +1,11 @@
|
|||||||
/* Array bitsets.
|
/* Array bitsets.
|
||||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
Copyright (C) 2002-2003, 2006, 2009-2010 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
Contributed by Michael Hayes ([email protected]).
|
Contributed by Michael Hayes ([email protected]).
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
@@ -13,13 +14,9 @@
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#include <config.h>
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "abitset.h"
|
#include "abitset.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@@ -34,14 +31,13 @@
|
|||||||
|
|
||||||
|
|
||||||
static bitset_bindex
|
static bitset_bindex
|
||||||
abitset_resize (bitset src ATTRIBUTE_UNUSED,
|
abitset_resize (bitset src, bitset_bindex size)
|
||||||
bitset_bindex size ATTRIBUTE_UNUSED)
|
|
||||||
{
|
{
|
||||||
if (BITSET_SIZE_ (src) == size)
|
|
||||||
return size;
|
|
||||||
|
|
||||||
/* These bitsets have a fixed size. */
|
/* These bitsets have a fixed size. */
|
||||||
abort ();
|
if (BITSET_SIZE_ (src) != size)
|
||||||
|
abort ();
|
||||||
|
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find list of up to NUM bits set in BSET starting from and including
|
/* Find list of up to NUM bits set in BSET starting from and including
|
||||||
|
|||||||
+11
-12
@@ -1,20 +1,19 @@
|
|||||||
/* Functions to support abitsets.
|
/* Functions to support abitsets.
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2009-2010 Free Software Foundation, Inc.
|
||||||
Contributed by Michael Hayes ([email protected]).
|
Contributed by Michael Hayes ([email protected]).
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program 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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
|
||||||
|
|
||||||
#ifndef _ABITSET_H
|
#ifndef _ABITSET_H
|
||||||
#define _ABITSET_H
|
#define _ABITSET_H
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user