mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-08 18:25:13 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e811aacd7 | ||
|
|
d143e9c33f | ||
|
|
723206df6f | ||
|
|
ac3297d501 | ||
|
|
c9e2da4f20 | ||
|
|
55dd356336 | ||
|
|
a898435b25 | ||
|
|
fea2d6b097 | ||
|
|
6f8bdce25d | ||
|
|
fc7ce9970f | ||
|
|
8ffd7912e3 | ||
|
|
dab9663283 | ||
|
|
248dba53cb | ||
|
|
20cc714980 | ||
|
|
56706c6167 | ||
|
|
a6e5a28079 | ||
|
|
49e8e901fb | ||
|
|
8f462efe92 | ||
|
|
686e83e396 | ||
|
|
f0e2c228a0 | ||
|
|
4c2a6e42ba | ||
|
|
6f75992be5 | ||
|
|
121c498280 | ||
|
|
5da0355aff | ||
|
|
d815ec4a62 | ||
|
|
6f04ee6c78 | ||
|
|
71caec0661 | ||
|
|
7776816565 | ||
|
|
8db68289d1 | ||
|
|
f3103c5b4f | ||
|
|
406dec8286 | ||
|
|
2f4518a126 | ||
|
|
8e6f226630 | ||
|
|
9913d6e45a | ||
|
|
840341d67d | ||
|
|
d89e48b3c9 | ||
|
|
eb8c66bbda | ||
|
|
448dc38bc4 | ||
|
|
7e5ef70679 | ||
|
|
8cbbf1786f | ||
|
|
354303787c | ||
|
|
d236ad946b | ||
|
|
9a4292e580 | ||
|
|
17300e83f0 | ||
|
|
ea0a767697 | ||
|
|
f52e1e5e44 | ||
|
|
210c1eef22 | ||
|
|
6ee881f6a2 | ||
|
|
3b1977eab5 | ||
|
|
4c38b19e26 | ||
|
|
723fe7d18a | ||
|
|
ea13bea8ab | ||
|
|
dcd39f1d4a | ||
|
|
3b8378825e | ||
|
|
095a1d11ca | ||
|
|
678094a2f5 | ||
|
|
f953cb20cf | ||
|
|
0e0f066b76 | ||
|
|
5f1485d8e1 | ||
|
|
2f3fd8f986 | ||
|
|
ea6046b9f6 | ||
|
|
86996fca10 | ||
|
|
32dc877a20 | ||
|
|
7527c744c0 | ||
|
|
d034d52066 | ||
|
|
cf22447c62 | ||
|
|
4631c34fb7 | ||
|
|
3e948170f7 | ||
|
|
82df2d6dd6 | ||
|
|
6e0ecb9a7d | ||
|
|
83e34842c1 | ||
|
|
0162a44c31 | ||
|
|
6e30ede87a | ||
|
|
241ac701ba | ||
|
|
3d4a0cad56 | ||
|
|
e7bab2df96 | ||
|
|
baacae4971 | ||
|
|
95a2de5695 | ||
|
|
38f9fd6439 | ||
|
|
0f404a0af0 | ||
|
|
bdc360ae58 | ||
|
|
ca7a59e838 | ||
|
|
ad6f84e550 | ||
|
|
212792959e | ||
|
|
43fdc9fd8e | ||
|
|
e02df72c2d | ||
|
|
ba3063f613 | ||
|
|
e0fda26c8d | ||
|
|
ecbca7db4b | ||
|
|
ed228e60b2 | ||
|
|
cacfdef716 | ||
|
|
2f61c4a2d0 | ||
|
|
16d9244df6 | ||
|
|
3e4a253ba9 | ||
|
|
df5df58d91 | ||
|
|
88bb35d6ac | ||
|
|
585ef2eb20 | ||
|
|
a005dbcbe3 | ||
|
|
8a8b33e8d2 | ||
|
|
a02797656e | ||
|
|
132247cd94 | ||
|
|
c0259969d7 | ||
|
|
23761f428a | ||
|
|
9097fda06c | ||
|
|
7a9c3cb3a7 | ||
|
|
5a3c69f103 | ||
|
|
ea66d039b4 | ||
|
|
c50befe615 | ||
|
|
47fa574761 | ||
|
|
d67e37a74b | ||
|
|
0ee1af2ed5 | ||
|
|
2655c7cd13 | ||
|
|
8ebc7dca63 | ||
|
|
f0a43dd1bb | ||
|
|
e4ca7a85cc | ||
|
|
8d830047ec | ||
|
|
e592664788 | ||
|
|
5a2f6eb4af | ||
|
|
1c4ad777cb | ||
|
|
1462fcee1e | ||
|
|
510df9519e | ||
|
|
2c2035282c | ||
|
|
a93cdd3d67 | ||
|
|
bb57985c2e | ||
|
|
70afaf2603 | ||
|
|
8200219a2a | ||
|
|
39f6a8d142 | ||
|
|
e657f3698e | ||
|
|
1e05521d4f | ||
|
|
2728ac7ecd | ||
|
|
abcc7c03cc | ||
|
|
62efdd2a85 | ||
|
|
41d35e54d5 | ||
|
|
692d04cb6a | ||
|
|
3473147172 | ||
|
|
3bba2dadae | ||
|
|
af2ffe5c23 | ||
|
|
874ac415b9 | ||
|
|
06caf0e144 | ||
|
|
687f011aa9 | ||
|
|
fb9a3976c2 | ||
|
|
f1fb412cf3 | ||
|
|
51c7ca01e2 | ||
|
|
1f68dca514 | ||
|
|
aa01d1934c | ||
|
|
61747047da | ||
|
|
a70596de95 | ||
|
|
51f255a530 | ||
|
|
23ec25b7c6 | ||
|
|
0ab402b48b | ||
|
|
42ec0ae176 | ||
|
|
9637e0ed1c | ||
|
|
69a2ab11cf | ||
|
|
d88cf11791 | ||
|
|
9da640eaa8 | ||
|
|
d3d3628bde | ||
|
|
4c6b13f37e | ||
|
|
f840c05ad4 | ||
|
|
17a407dc51 | ||
|
|
4b7a4c1b1c | ||
|
|
873ac263c8 | ||
|
|
232be91a83 | ||
|
|
c781580d07 | ||
|
|
348f560883 | ||
|
|
d93b5f50cf | ||
|
|
4c56b1319d | ||
|
|
93d0103dd4 | ||
|
|
628be6c97d | ||
|
|
c842365a01 | ||
|
|
14e568d744 | ||
|
|
dac8cc0d14 | ||
|
|
3710dd02e2 | ||
|
|
9852b61c2b | ||
|
|
5bf2bf7a6d | ||
|
|
f37495f601 | ||
|
|
3a414bbfa0 | ||
|
|
4bb975e1ad | ||
|
|
74baf5c966 | ||
|
|
d63e12792a | ||
|
|
833d1720f8 | ||
|
|
e4bcae3c5a | ||
|
|
d5eb0826af | ||
|
|
1fa303077d | ||
|
|
77373efad2 | ||
|
|
890ab17c84 | ||
|
|
aa50ba7bff | ||
|
|
c519609864 | ||
|
|
39fb7e6239 | ||
|
|
c33bc80009 | ||
|
|
8fbbeba2a4 | ||
|
|
1874a474b9 | ||
|
|
f4bfd5a96f | ||
|
|
2509eba631 | ||
|
|
314542f905 | ||
|
|
2498596474 | ||
|
|
47076da5b6 | ||
|
|
36dfe4662e | ||
|
|
07c0db18b4 | ||
|
|
1a323c2f71 | ||
|
|
38609c3455 | ||
|
|
642f240e22 | ||
|
|
d0caad01ab | ||
|
|
ac2def5602 | ||
|
|
dbbb64f091 | ||
|
|
bfa018d447 | ||
|
|
4521fcdf02 | ||
|
|
cbc6a70e9d | ||
|
|
992e874a7c | ||
|
|
a1ed2b71fa | ||
|
|
1e20ad112f | ||
|
|
ac9b0e954b | ||
|
|
2de160e12e | ||
|
|
cba975069a | ||
|
|
62eb2d1bd9 | ||
|
|
620b2e3691 | ||
|
|
dad6544d4a | ||
|
|
8bea3dbd84 | ||
|
|
d5e8574bf6 | ||
|
|
ae09ec8577 | ||
|
|
80d653fd30 | ||
|
|
0210a4bf5e | ||
|
|
7685e2f7ba | ||
|
|
67f8cf51c3 | ||
|
|
83b66dddb6 | ||
|
|
517cb0ad9c | ||
|
|
75c7a52a31 | ||
|
|
cc96d8ff98 | ||
|
|
66ed97537a | ||
|
|
95d176ffd9 | ||
|
|
ed15d907c5 | ||
|
|
e3a33f7c23 | ||
|
|
34d4193815 | ||
|
|
246c4efafe | ||
|
|
531683e74b | ||
|
|
e7bfa8b721 | ||
|
|
8c221795af | ||
|
|
c8bf65f07e | ||
|
|
7ac45a4687 | ||
|
|
b10dd689b6 | ||
|
|
601bdfabe2 | ||
|
|
d19123e612 | ||
|
|
ecdfea9a12 | ||
|
|
43e6aea526 | ||
|
|
c046698e6e | ||
|
|
966aba6583 | ||
|
|
812775a039 | ||
|
|
1c4aa81df1 | ||
|
|
1d0f55cc84 | ||
|
|
0b59345789 | ||
|
|
0939aa2d3c | ||
|
|
ae618dcca5 | ||
|
|
6789b8bd7b | ||
|
|
663ce7bb3e | ||
|
|
379261b3fd | ||
|
|
25029e164a | ||
|
|
620b572773 | ||
|
|
34a6c2d19b | ||
|
|
f805dfcb3f | ||
|
|
166366b28f | ||
|
|
03c07b0394 | ||
|
|
44c124a389 | ||
|
|
4266073618 | ||
|
|
a2d0567444 | ||
|
|
c4fae1ef48 | ||
|
|
42f4393a72 | ||
|
|
bd5df716a3 | ||
|
|
7ba0d59da0 | ||
|
|
b4d71a9664 | ||
|
|
4ecd368199 | ||
|
|
c65e529237 | ||
|
|
96002de2e1 | ||
|
|
fadb13b5b3 | ||
|
|
72183df4da | ||
|
|
e80b068ce1 | ||
|
|
54d8d31419 | ||
|
|
e3ee30b88f | ||
|
|
c4eb1e841e | ||
|
|
10fa0146e2 | ||
|
|
6f5be1abf7 | ||
|
|
11c4e57daf | ||
|
|
e186a28486 | ||
|
|
e14c68313b | ||
|
|
75c21b618d | ||
|
|
33d2a86079 | ||
|
|
006faedfd3 | ||
|
|
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 |
-29
@@ -1,29 +0,0 @@
|
||||
*.flc
|
||||
*.patch *.log log patches applied
|
||||
*.prj
|
||||
ABOUT-NLS
|
||||
COPYING
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
_*
|
||||
a.exe
|
||||
a.out
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
b.out
|
||||
bison-*
|
||||
conf[0-9]*
|
||||
confdefs*
|
||||
config.cache
|
||||
config.h
|
||||
config.hin
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
configure.lineno
|
||||
conftest*
|
||||
intl
|
||||
patches
|
||||
releases
|
||||
stamp-h*
|
||||
@@ -0,0 +1 @@
|
||||
ChangeLog merge=merge-changelog
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
|
||||
/*.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,6 @@
|
||||
[submodule "gnulib"]
|
||||
path = gnulib
|
||||
url = git://git.savannah.gnu.org/gnulib.git
|
||||
[submodule "submodules/autoconf"]
|
||||
path = submodules/autoconf
|
||||
url = git://git.sv.gnu.org/autoconf.git
|
||||
@@ -0,0 +1 @@
|
||||
2.3b
|
||||
@@ -0,0 +1,6 @@
|
||||
COPYING
|
||||
^bootstrap$
|
||||
^doc/fdl\.texi$
|
||||
^doc/gpl-3\.0\.texi$
|
||||
^doc/yacc\.1\.in$
|
||||
^src/parse-gram\.h$
|
||||
@@ -1,285 +1,626 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
0. Definitions.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
1. Source Code.
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
14. Revised Versions of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
NO WARRANTY
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
@@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -304,37 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
-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,138 +0,0 @@
|
||||
-*- outline -*-
|
||||
|
||||
This file attempts to describe the rules to use when hacking Bison.
|
||||
Don't put this file into the distribution. Don't mention it in the
|
||||
ChangeLog.
|
||||
|
||||
Everything related to the development of Bison is on Savannah:
|
||||
|
||||
http://savannah.gnu.org/projects/bison/
|
||||
|
||||
|
||||
* Administrivia
|
||||
|
||||
** If you incorporate a change from somebody on the net:
|
||||
First, if it is a large change, you must make sure they have signed
|
||||
the appropriate paperwork. Second, be sure to add their name and
|
||||
email address to THANKS.
|
||||
|
||||
** If a change fixes a test, mention the test in the ChangeLog entry.
|
||||
|
||||
** Bug reports
|
||||
If somebody reports a new bug, mention his name in the ChangeLog entry
|
||||
and in the test case you write. Put him into THANKS.
|
||||
|
||||
The correct response to most actual bugs is to write a new test case
|
||||
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
||||
and check everything in.
|
||||
|
||||
|
||||
* Hacking
|
||||
|
||||
** Visible changes
|
||||
Which include serious bug fixes, must be mentioned in NEWS.
|
||||
|
||||
** Translations
|
||||
Only user visible strings are to be translated: error messages, bits
|
||||
of the .output file etc. This excludes impossible error messages
|
||||
(comparable to assert/abort), and all the --trace output which is
|
||||
meant for the maintainers only.
|
||||
|
||||
|
||||
* Test suite
|
||||
|
||||
** make check
|
||||
Use liberally.
|
||||
|
||||
** Release checks
|
||||
Try to run the test suite with more severe conditions before a
|
||||
release:
|
||||
|
||||
- Configure the package with --enable-gcc-warnings, so that one checks
|
||||
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
||||
cleanly too.
|
||||
|
||||
- run `make maintainer-check' which:
|
||||
- runs `valgrind -q bison' to run Bison under Valgrind.
|
||||
- runs the parsers under Valgrind.
|
||||
- runs the test suite with G++ as C compiler...
|
||||
|
||||
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
||||
instance, `-traditional' to check that the parsers are K&R. Note
|
||||
that it does not make sense for glr.c, which should be ANSI,
|
||||
but currently is actually GNU C, nor for lalr1.cc, which anyway is
|
||||
not exercised yet in the test suite.
|
||||
|
||||
|
||||
* 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.
|
||||
|
||||
** Tests
|
||||
See above.
|
||||
|
||||
** Update the foreign files
|
||||
Running `./bootstrap' in the top level should update them all for you.
|
||||
This covers PO files too. Sometimes a PO file contains problems that
|
||||
causes it to be rejected by recent Gettext releases; please report
|
||||
these to the Translation Project.
|
||||
|
||||
** Update NEWS
|
||||
The version number, *and* the date of the release (including for
|
||||
betas).
|
||||
|
||||
** Update ChangeLog
|
||||
Should have an entry similar to `Version 1.49b.'.
|
||||
Check all this in once `make distcheck' passes.
|
||||
|
||||
** make alpha
|
||||
Running `make alpha' is absolutely perfect for beta releases: it makes
|
||||
the tarballs, the xdeltas, and prepares (in /tmp/) a proto
|
||||
announcement. It is so neat, that that's what I use anyway for
|
||||
genuine releases, but adjusting things by hand (e.g., the urls in the
|
||||
announcement file, the ChangeLog which is not needed etc.).
|
||||
|
||||
If it fails, you're on your own...
|
||||
|
||||
It requires GNU Make.
|
||||
|
||||
** Upload
|
||||
Put the tarballs/xdeltas where they should be. Or put it somewhere,
|
||||
and send the URL to [email protected].
|
||||
|
||||
** Bump the version number
|
||||
In configure.ac. Run `make', check this in.
|
||||
|
||||
** Announce
|
||||
Complete/fix the announcement file, and send it at least to
|
||||
[email protected] (if a real release, or a ``serious beta''),
|
||||
[email protected], [email protected], [email protected],
|
||||
and [email protected].
|
||||
|
||||
Send the same announcement on the comp.compilers newsgroup by sending
|
||||
email to [email protected]. Do not make any Cc as the moderator will
|
||||
throw away anything cross-posted or Cc'ed. It really needs to be a
|
||||
separate message.
|
||||
|
||||
|
||||
-----
|
||||
|
||||
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 GNU Bison; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA.
|
||||
+48
-17
@@ -1,37 +1,68 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## 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 of the License, or
|
||||
## (at your option) any later version.
|
||||
## Copyright (C) 2001-2011 Free Software Foundation, Inc.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = build-aux po runtime-po lib data src doc examples tests
|
||||
SUBDIRS = build-aux po runtime-po lib data src doc examples tests etc
|
||||
|
||||
# Files installed for use by Automake.
|
||||
aclocaldir = @aclocaldir@
|
||||
aclocal_DATA = m4/bison-i18n.m4
|
||||
|
||||
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
|
||||
EXTRA_DIST = .prev-version .version cfg.mk \
|
||||
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/fnchange.lst djgpp/testsuite.sed
|
||||
|
||||
|
||||
.PHONY: maintainer-check
|
||||
maintainer-check:
|
||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||
|
||||
.PHONY: maintainer-push-check
|
||||
maintainer-push-check:
|
||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||
|
||||
.PHONY: maintainer-xml-check
|
||||
maintainer-xml-check:
|
||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||
|
||||
# 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,48 +0,0 @@
|
||||
# Customize Makefile.maint for Bison. -*- makefile -*-
|
||||
# Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
build_aux_dir = $(srcdir)/build-aux
|
||||
prev_version_file = $(build_aux_dir)/prev-version.txt
|
||||
announce_gen = $(build_aux_dir)/announce-gen
|
||||
release_archive_dir = releases
|
||||
|
||||
# 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 = \
|
||||
$(build_aux_dir)/config.guess \
|
||||
$(build_aux_dir)/config.sub \
|
||||
$(build_aux_dir)/texinfo.tex \
|
||||
|
||||
cvs_files = \
|
||||
$(build_aux_dir)/install-sh \
|
||||
$(build_aux_dir)/mdate-sh \
|
||||
$(build_aux_dir)/missing \
|
||||
$(build_aux_dir)/mkinstalldirs
|
||||
|
||||
# Tests not to run.
|
||||
local-checks-to-skip = \
|
||||
changelog-check
|
||||
-639
@@ -1,639 +0,0 @@
|
||||
# -*-Makefile-*-
|
||||
# This Makefile fragment is shared between the coreutils,
|
||||
# CPPI, Bison, and Autoconf.
|
||||
|
||||
## Copyright (C) 2001-2006 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2, or (at your option)
|
||||
## any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301, USA.
|
||||
|
||||
# This 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_rsyncable = \
|
||||
(gzip --help|grep rsyncable) >/dev/null 2>&1 && echo --rsyncable
|
||||
GZIP_ENV = "--no-name --best `$(gzip_rsyncable)`"
|
||||
|
||||
CVS = cvs
|
||||
|
||||
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
|
||||
CVS_LIST = sh -c ' \
|
||||
if test -x $(srcdir)/build-aux/cvsu; then \
|
||||
$(srcdir)/build-aux/cvsu --find --types=AFGM $$*; \
|
||||
else \
|
||||
awk -F/ '\''{ \
|
||||
if (!$$1 && $$3 !~ /^-/) { \
|
||||
f=FILENAME; \
|
||||
sub(/CVS\/Entries/, "", f); \
|
||||
print f $$2; \
|
||||
}}'\'' \
|
||||
$$(find $${*-*} -name Entries -print) /dev/null; \
|
||||
fi \
|
||||
' 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))
|
||||
VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||
|
||||
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. ##
|
||||
## --------------- ##
|
||||
|
||||
# FIXME: add a check to prohibit definition in src/*.c of symbols defined
|
||||
# in system.h. E.g. today I removed from tail.c a useless definition of
|
||||
# ENOSYS. It was useless because system.h ensures it's defined.
|
||||
|
||||
# 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-rules) \
|
||||
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_no_if_have_config_h \
|
||||
sc_obsolete_symbols \
|
||||
sc_prohibit_atoi_atof \
|
||||
sc_prohibit_jm_in_m4 \
|
||||
sc_prohibit_assert_without_use \
|
||||
sc_require_config_h \
|
||||
sc_root_tests \
|
||||
sc_space_tab \
|
||||
sc_sun_os_names \
|
||||
sc_system_h_headers \
|
||||
sc_tight_scope \
|
||||
sc_trailing_blank \
|
||||
sc_two_space_separator_in_usage \
|
||||
sc_unmarked_diagnostics \
|
||||
sc_useless_cpp_parens
|
||||
|
||||
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]|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_no_if_have_config_h:
|
||||
@grep -n '^# *if HAVE_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found use of #if HAVE_CONFIG_H; use #ifdef' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Nearly all .c files must include <config.h>.
|
||||
sc_require_config_h:
|
||||
@grep -L '^# *include <config\.h>' \
|
||||
$$($(CVS_LIST_EXCEPT) | grep '\.c$$') \
|
||||
| grep . && \
|
||||
{ echo '$(ME): the above files do not include <config.h>' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Prohibit the inclusion of assert.h without an actual use of assert.
|
||||
sc_prohibit_assert_without_use:
|
||||
@files=$$(grep -l '# *include <assert\.h>' \
|
||||
$$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \
|
||||
grep -L '\<assert (' $$files \
|
||||
| grep . && \
|
||||
{ echo "$(ME): the above files include <assert.h> but don't use it" \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
sc_obsolete_symbols:
|
||||
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
|
||||
$$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
|
||||
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_blank:
|
||||
@grep -n '[ ]$$' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found trailing blank(s)' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
sc_two_space_separator_in_usage:
|
||||
@grep -n '^ *--[a-z][0-9A-Za-z-]* [^ ].*\\$$' \
|
||||
$$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo "$(ME): help2man requires at least two spaces between"; \
|
||||
echo "$(ME): an option and its description"; \
|
||||
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}' $$($(CVS_LIST_EXCEPT)) \
|
||||
| grep -v '_''(' && \
|
||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Avoid useless parentheses like those in this example:
|
||||
# #if defined (SYMBOL) || defined (SYM2)
|
||||
sc_useless_cpp_parens:
|
||||
@grep -n '^# *if .*defined *(' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found useless parentheses in cpp directive' \
|
||||
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 '^\*.* $(VERSION_REGEXP) ('$$today')' \
|
||||
>/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "version or today's date is not in NEWS" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
changelog-check:
|
||||
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
|
||||
>/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
m4-check:
|
||||
@grep -n '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 file names 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 $$($(CVS_LIST_EXCEPT)) lib/*.[ch]; do \
|
||||
case $$file in \
|
||||
djgpp/* | man/*) continue;; \
|
||||
esac; \
|
||||
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 -u > $@-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 = '$$(date +%Y)' };' $(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) $(release_archive_dir)/$(prev-tgz)
|
||||
-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
|
||||
|
||||
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) \
|
||||
--gpg-key-id=$(gpg_key_ID) \
|
||||
--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-2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -1,41 +1,63 @@
|
||||
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.
|
||||
See the file doc/FAQ for frequently asked questions.
|
||||
* Installation
|
||||
** 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
|
||||
sufficiently patched, but if you encounter a bug with an older
|
||||
distribution and report a bug we will probably suggest that you
|
||||
upgrade to 1.4.3 as the first step in trying to fix it.
|
||||
** Internationalization
|
||||
Bison supports two catalogues: one for Bison itself (i.e., for the
|
||||
maintainer-side parser generation), and one for the generated parsers
|
||||
(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
|
||||
version number from `bison --version', and a complete, self-contained
|
||||
test case in each bug report.
|
||||
* Questions
|
||||
See the section FAQ in the documentation (doc/bison.info) for
|
||||
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
|
||||
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.
|
||||
|
||||
* Copyright statements
|
||||
For any copyright year range specified as YYYY-ZZZZ in this package,
|
||||
note that the range specifies every single year in that closed interval.
|
||||
|
||||
|
||||
Local Variables:
|
||||
mode: outline
|
||||
End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2011 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
+6
-8
@@ -12,21 +12,19 @@ the problems you encounter.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
GNU Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GNU Bison is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bison; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
-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, 2006 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.
|
||||
+401
@@ -0,0 +1,401 @@
|
||||
-*- outline -*-
|
||||
|
||||
This file attempts to describe the rules to use when hacking Bison.
|
||||
Don't put this file into the distribution.
|
||||
|
||||
Everything related to the development of Bison is on Savannah:
|
||||
|
||||
http://savannah.gnu.org/projects/bison/
|
||||
|
||||
|
||||
* Administrivia
|
||||
|
||||
** If you incorporate a change from somebody on the net:
|
||||
First, if it is a large change, you must make sure they have signed
|
||||
the appropriate paperwork. Second, be sure to add their name and
|
||||
email address to THANKS.
|
||||
|
||||
** If a change fixes a test, mention the test in the ChangeLog entry.
|
||||
|
||||
** Bug reports
|
||||
If somebody reports a new bug, mention his name in the ChangeLog entry
|
||||
and in the test case you write. Put him into THANKS.
|
||||
|
||||
The correct response to most actual bugs is to write a new test case
|
||||
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
||||
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
|
||||
|
||||
** Visible changes
|
||||
Which include serious bug fixes, must be mentioned in NEWS.
|
||||
|
||||
** Translations
|
||||
Only user visible strings are to be translated: error messages, bits
|
||||
of the .output file etc. This excludes impossible error messages
|
||||
(comparable to assert/abort), and all the --trace output which is
|
||||
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 ...
|
||||
|
||||
For a suggestion of what gnulib commit might be stable enough for a
|
||||
formal release, see the ChangeLog in the latest gnulib snapshot at:
|
||||
|
||||
http://erislabs.net/ianb/projects/gnulib/
|
||||
|
||||
The autoconf files we use are currently:
|
||||
|
||||
m4/m4.m4
|
||||
lib/m4sugar/m4sugar.m4
|
||||
lib/m4sugar/foreach.m4
|
||||
|
||||
These files don't change very often in autoconf, so it should be
|
||||
relatively straight-forward to examine the differences in order to
|
||||
decide whether to update.
|
||||
|
||||
* Test suite
|
||||
|
||||
** make check
|
||||
Use liberally.
|
||||
|
||||
** Release checks
|
||||
Try to run the test suite with more severe conditions before a
|
||||
release:
|
||||
|
||||
- Configure the package with --enable-gcc-warnings, so that one checks
|
||||
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
||||
cleanly too.
|
||||
|
||||
- Build with -DGNULIB_POSIXCHECK. It suggests gnulib modules that can
|
||||
fix portability issues.
|
||||
|
||||
- run `make maintainer-check' which:
|
||||
- runs `valgrind -q bison' to run Bison under Valgrind.
|
||||
- runs the parsers under Valgrind.
|
||||
- runs the test suite with G++ as C compiler...
|
||||
|
||||
- run `make maintainer-push-check', which runs `make maintainer-check'
|
||||
while activating the push implementation and its pull interface wrappers
|
||||
in many test cases that were originally written to exercise only the
|
||||
pull implementation. This makes certain the push implementation can
|
||||
perform every task the pull implementation can.
|
||||
|
||||
- run `make maintainer-xml-check', which runs `make maintainer-check'
|
||||
while checking Bison's XML automaton report for every working grammar
|
||||
passed to Bison in the test suite. The check just diffs the output of
|
||||
Bison's included XSLT style sheets with the output of --report=all and
|
||||
--graph.
|
||||
|
||||
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
||||
instance, `-traditional' to check that the parsers are K&R. Note
|
||||
that it does not make sense for glr.c, which should be ANSI,
|
||||
but currently is actually GNU C, nor for lalr1.cc.
|
||||
|
||||
|
||||
* Release Procedure
|
||||
|
||||
** Update the submodules. See above.
|
||||
|
||||
** Try to get the *.pot files to the Translation Project at least one
|
||||
week before a stable release, to give them time to translate them.
|
||||
Before generating the *.pot files, make sure that po/POTFILES.in and
|
||||
runtime-po/POTFILES.in list all files with translatable strings.
|
||||
This helps: grep -l '\<_(' *
|
||||
|
||||
** Tests
|
||||
See above.
|
||||
|
||||
** Update the foreign files
|
||||
Running `./bootstrap' in the top level should update them all for you.
|
||||
This covers PO files too. Sometimes a PO file contains problems that
|
||||
causes it to be rejected by recent Gettext releases; please report
|
||||
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
|
||||
The version number, *and* the date of the release (including for
|
||||
betas).
|
||||
|
||||
** Update ChangeLog
|
||||
Should have an entry similar to `Version 1.49b.'.
|
||||
|
||||
** Tag the release
|
||||
Before Bison will build with the right version number, you must tag the release
|
||||
in git. Do this after all other changes. The command is similar to:
|
||||
|
||||
git tag -a v2.3b
|
||||
|
||||
The log message can be simply:
|
||||
|
||||
Bison 2.3b
|
||||
|
||||
** Push
|
||||
Once `make distcheck' passes, push your changes and the tag.
|
||||
`git push' without arguments will not push the tag.
|
||||
|
||||
** make alpha
|
||||
FIXME: `make alpha' is not maintained and is broken. These
|
||||
instructions need to be replaced or removed.
|
||||
|
||||
Running `make alpha' is absolutely perfect for beta releases: it makes
|
||||
the tarballs, the xdeltas, and prepares (in /tmp/) a proto
|
||||
announcement. It is so neat, that that's what I use anyway for
|
||||
genuine releases, but adjusting things by hand (e.g., the urls in the
|
||||
announcement file, the ChangeLog which is not needed etc.).
|
||||
|
||||
If it fails, you're on your own...
|
||||
|
||||
It requires GNU Make.
|
||||
|
||||
** Upload
|
||||
The generic GNU upload procedure is at:
|
||||
|
||||
http://www.gnu.org/prep/maintain/maintain.html#Automated-FTP-Uploads
|
||||
|
||||
Follow the instructions there to register your information so you're permitted
|
||||
to upload. 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
|
||||
To generate a template announcement file:
|
||||
|
||||
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
|
||||
|
||||
where alpha can be replaced by beta or stable and F125BDF3 should be
|
||||
replaced with your key ID.
|
||||
|
||||
Complete/fix the announcement file. The generated list of recipients
|
||||
([email protected], [email protected], [email protected],
|
||||
[email protected], and [email protected]) is
|
||||
appropriate for a stable release or a ``serious beta''. For any other
|
||||
release, drop at least [email protected]. For an example of how to fill
|
||||
out the rest of the template, search the mailing list archives for the
|
||||
most recent release announcement.
|
||||
|
||||
For a stable release, send the same announcement on the comp.compilers
|
||||
newsgroup by sending email to [email protected]. Do not make any Cc as
|
||||
the moderator will throw away anything cross-posted or Cc'ed. It really
|
||||
needs to be a separate message.
|
||||
|
||||
** 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-2005, 2007-2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
This 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/>.
|
||||
@@ -8,45 +8,65 @@ Alexander Belopolsky [email protected]
|
||||
Alexandre Duret-Lutz [email protected]
|
||||
Andreas Schwab [email protected]
|
||||
Andrew Suffield [email protected]
|
||||
Angelo Borsotti [email protected]
|
||||
Anthony Heading [email protected]
|
||||
Arnold Robbins [email protected]
|
||||
Art Haas [email protected]
|
||||
Baron Schwartz [email protected]
|
||||
Benoit Perrot [email protected]
|
||||
Bernd Kiefer [email protected]
|
||||
Bert Deknuydt [email protected]
|
||||
Bill Allombert [email protected]
|
||||
Bob Rossi [email protected]
|
||||
Brandon Lucia [email protected]
|
||||
Bruce Lilly [email protected]
|
||||
Bruno Haible [email protected]
|
||||
Charles-Henri de Boysson [email protected]
|
||||
Christian Burger [email protected]
|
||||
Cris Bailiff [email protected]
|
||||
Cris van Pelt [email protected]
|
||||
Csaba Raduly [email protected]
|
||||
Dagobert Michelsen [email protected]
|
||||
Daniel Hagerty [email protected]
|
||||
David J. MacKenzie [email protected]
|
||||
Derek M. Jones [email protected]
|
||||
Derek M. Jones [email protected]
|
||||
Di-an Jan [email protected]
|
||||
Dick Streefland [email protected]
|
||||
Didier Godefroy [email protected]
|
||||
Enrico Scholz [email protected]
|
||||
Eric Blake [email protected]
|
||||
Evgeny Stambulchik [email protected]
|
||||
Fabrice Bauzac [email protected]
|
||||
Florian Krohm [email protected]
|
||||
Frank Heckenbach [email protected]
|
||||
Frans Englich [email protected]
|
||||
Georg Sauthoff [email protected]
|
||||
George Neuner [email protected]
|
||||
Goran Uddeborg [email protected]
|
||||
Guido Trentalancia [email protected]
|
||||
H. Merijn Brand [email protected]
|
||||
Hans Aberg [email protected]
|
||||
Jan Nieuwenhuizen [email protected]
|
||||
Jerry Quinn [email protected]
|
||||
Jesse Thilo [email protected]
|
||||
Jim Kent [email protected]
|
||||
Jim Meyering [email protected]
|
||||
Joel E. Denny jdenny@ces.clemson.edu
|
||||
Juan Manuel Guerrero [email protected]
|
||||
Joel E. Denny joeldenny@joeldenny.org
|
||||
Johan van Selst [email protected]
|
||||
Jonathan Nieder [email protected]
|
||||
Juan Manuel Guerrero [email protected]
|
||||
Kees Zeelenberg [email protected]
|
||||
Keith Browne [email protected]
|
||||
Laurent Mascherpa [email protected]
|
||||
Magnus Fromreide [email protected]
|
||||
Marc Autret [email protected]
|
||||
Martin Jacobs [email protected]
|
||||
Martin Mokrejs [email protected]
|
||||
Martin Nylin [email protected]
|
||||
Martin Nylin [email protected]
|
||||
Matt Kraai [email protected]
|
||||
Matt Rosing [email protected]
|
||||
Michael Hayes [email protected]
|
||||
Michael Raskin [email protected]
|
||||
Mickael Labau [email protected]
|
||||
Mike Castle [email protected]
|
||||
Neil Booth [email protected]
|
||||
@@ -54,7 +74,9 @@ Nelson H. F. Beebe [email protected]
|
||||
Nicolas Burrus [email protected]
|
||||
Nicolas Tisserand [email protected]
|
||||
Noah Friedman [email protected]
|
||||
Odd Arild Olsen [email protected]
|
||||
Oleg Smolsky [email protected]
|
||||
Paolo Bonzini [email protected]
|
||||
Pascal Bart [email protected]
|
||||
Paul Eggert [email protected]
|
||||
Paul Hilfinger [email protected]
|
||||
@@ -65,17 +87,23 @@ Piotr Gackiewicz [email protected]
|
||||
Quoc Peyrot [email protected]
|
||||
R Blake [email protected]
|
||||
Raja R Harinath [email protected]
|
||||
Ralf Wildenhues [email protected]
|
||||
Richard Stallman [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]
|
||||
Steve Murphy [email protected]
|
||||
Steve Murphy [email protected]
|
||||
Summum Bonum [email protected]
|
||||
Tim Josling [email protected]
|
||||
Tim Van Holder [email protected]
|
||||
Tom Lane [email protected]
|
||||
Tom Tromey [email protected]
|
||||
Tommy Nordgren [email protected]
|
||||
Tommy Nordgren [email protected]
|
||||
Troy A. Johnson [email protected]
|
||||
Tys Lefering twlevo@xs4all.nl
|
||||
Tys Lefering twlevo@gmail.com
|
||||
Vin Shelton [email protected]
|
||||
Wayne Green [email protected]
|
||||
Wolfram Wagner [email protected]
|
||||
|
||||
@@ -14,13 +14,6 @@ find something clean (not like YYLSP_NEEDED...).
|
||||
|
||||
* Installation
|
||||
|
||||
** Disable installation of yacc.
|
||||
|
||||
Add an option to 'configure' that allows people to install Bison
|
||||
without installing the yacc wrapper script or the rarely-used little
|
||||
yacc library required by Posix. This is for people who prefer some
|
||||
other implementation of yacc.
|
||||
|
||||
* Documentation
|
||||
Before releasing, make sure the documentation ("Understanding your
|
||||
parser") refers to the current `output' format.
|
||||
@@ -29,9 +22,6 @@ parser") refers to the current `output' format.
|
||||
** vector
|
||||
Move to using vector, drop stack.hh.
|
||||
|
||||
** I18n
|
||||
Catch up with yacc.c.
|
||||
|
||||
* Report
|
||||
|
||||
** GLR
|
||||
@@ -56,6 +46,9 @@ Provide better assistance for understanding the conflicts by providing
|
||||
a sample text exhibiting the (LALR) ambiguity. See the paper from
|
||||
DeRemer and Penello: they already provide the algorithm.
|
||||
|
||||
** Statically check for potential ambiguities in GLR grammars. See
|
||||
<http://www.i3s.unice.fr/~schmitz/papers.html#expamb> for an approach.
|
||||
|
||||
|
||||
* Extensions
|
||||
|
||||
@@ -151,23 +144,6 @@ Are there any Texinfo standards for bibliography?
|
||||
* Java, Fortran, etc.
|
||||
|
||||
|
||||
** Java
|
||||
|
||||
There are a couple of proposed outputs:
|
||||
|
||||
- BYACC/J
|
||||
which is based on Byacc.
|
||||
<http://troi.lincom-asg.com/~rjamison/byacc/>
|
||||
|
||||
- Bison Java
|
||||
which is based on Bison.
|
||||
<http://www.goice.co.jp/member/mo/hack-progs/bison-java.html>
|
||||
|
||||
Sebastien Serrurier ([email protected]) is working on this: he is
|
||||
expected to contact the authors, design the output, and implement it
|
||||
into Bison.
|
||||
|
||||
|
||||
* Coding system independence
|
||||
Paul notes:
|
||||
|
||||
@@ -189,10 +165,9 @@ Paul notes:
|
||||
Show reductions.
|
||||
|
||||
* Broken options ?
|
||||
** %no-parser
|
||||
** %token-table
|
||||
** Skeleton strategy
|
||||
Must we keep %no-parser? %token-table?
|
||||
Must we keep %token-table?
|
||||
|
||||
* src/print_graph.c
|
||||
Find the best graph parameters.
|
||||
@@ -228,9 +203,6 @@ It is unfortunate that there is a total order for precedence. It
|
||||
makes it impossible to have modular precedence information. We should
|
||||
move to partial orders (sounds like series/parallel orders to me).
|
||||
|
||||
This will be possible with a Bison parser for the grammar, as it will
|
||||
make it much easier to extend the grammar.
|
||||
|
||||
** Correlation b/w precedence and associativity
|
||||
Also, I fail to understand why we have to assign the same
|
||||
associativity to operators with the same precedence. For instance,
|
||||
@@ -310,28 +282,24 @@ at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
|
||||
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
|
||||
to bison. If you're interested, I'll work on a patch.
|
||||
|
||||
* Move to Graphviz
|
||||
Well, VCG seems really dead. Move to Graphviz instead. Also, equip
|
||||
the parser with a means to create the (visual) parse tree.
|
||||
* Better graphics
|
||||
Equip the parser with a means to create the (visual) parse tree.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright (C) 2001-2004, 2006, 2008-2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bison; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006-2011 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 calloc-posix close config-h c-strcase
|
||||
configmake dirname error extensions fopen-safer gendocs getopt-gnu
|
||||
gettext git-version-gen hash inttypes isnan javacomp-script
|
||||
javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr
|
||||
mbswidth obstack perror pipe-posix quote quotearg realloc-posix
|
||||
spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
|
||||
unistd unistd-safer unlocked-io update-copyright unsetenv verify
|
||||
warnings xalloc xalloc-die xstrndup
|
||||
|
||||
fprintf-posix printf-posix snprintf-posix sprintf-posix
|
||||
vsnprintf-posix vsprintf-posix
|
||||
'
|
||||
|
||||
# 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/glibc2.m4
|
||||
m4/intdiv0.m4
|
||||
m4/intl.m4
|
||||
m4/intldir.m4
|
||||
m4/intmax.m4
|
||||
m4/lcmessage.m4
|
||||
m4/lock.m4
|
||||
m4/longdouble.m4
|
||||
m4/signed.m4
|
||||
m4/uintmax_t.m4
|
||||
m4/ulonglong.m4
|
||||
m4/visibility.m4
|
||||
'
|
||||
|
||||
bootstrap_epilogue()
|
||||
{
|
||||
# Make sure we don't need src/bison, which usually doesn't exist at
|
||||
# the time of a bootstrap.
|
||||
touch src/parse-gram.[ch]
|
||||
}
|
||||
|
||||
# Keep our bootstrap script in sync with gnulib's. If we ever need to
|
||||
# maintain our own bootstrap script again, set this to false, remove
|
||||
# the bootstrap entry from the file .x-update-copyright, and add any
|
||||
# needed copyright years to the copyright statement in the bootstrap
|
||||
# script.
|
||||
bootstrap_sync=true
|
||||
@@ -1,13 +0,0 @@
|
||||
*.t
|
||||
Makefile
|
||||
Makefile.in
|
||||
config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
install-sh
|
||||
mdate-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
texinfo.tex
|
||||
ylwrap
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/announce-gen
|
||||
/arg-nonnull.h
|
||||
/c++defs.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-*-
|
||||
EXTRA_DIST = prev-version.txt
|
||||
EXTRA_DIST = prev-version.txt cross-options.pl update-b4-copyright
|
||||
|
||||
@@ -1,338 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
# Generate an announcement message.
|
||||
use strict;
|
||||
|
||||
use Getopt::Long;
|
||||
use Digest::MD5;
|
||||
use Digest::SHA1;
|
||||
|
||||
(my $VERSION = '$Revision$ ') =~ tr/[0-9].//cd;
|
||||
(my $ME = $0) =~ s|.*/||;
|
||||
|
||||
my %valid_release_types = map {$_ => 1} qw (alpha beta major);
|
||||
|
||||
END
|
||||
{
|
||||
# Nobody ever checks the status of print()s. That's okay, because
|
||||
# if any do fail, we're guaranteed to get an indicator when we close()
|
||||
# the filehandle.
|
||||
#
|
||||
# Close stdout now, and if there were no errors, return happy status.
|
||||
# If stdout has already been closed by the script, though, do nothing.
|
||||
defined fileno STDOUT
|
||||
or return;
|
||||
close STDOUT
|
||||
and return;
|
||||
|
||||
# Errors closing stdout. Indicate that, and hope stderr is OK.
|
||||
warn "$ME: closing standard output: $!\n";
|
||||
|
||||
# Don't be so arrogant as to assume that we're the first END handler
|
||||
# defined, and thus the last one invoked. There may be others yet
|
||||
# to come. $? will be passed on to them, and to the final _exit().
|
||||
#
|
||||
# If it isn't already an error, make it one (and if it _is_ an error,
|
||||
# preserve the value: it might be important).
|
||||
$? ||= 1;
|
||||
}
|
||||
|
||||
sub usage ($)
|
||||
{
|
||||
my ($exit_code) = @_;
|
||||
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
|
||||
if ($exit_code != 0)
|
||||
{
|
||||
print $STREAM "Try `$ME --help' for more information.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
my @types = sort keys %valid_release_types;
|
||||
print $STREAM <<EOF;
|
||||
Usage: $ME [OPTIONS]
|
||||
|
||||
OPTIONS:
|
||||
|
||||
Generate an announcement message.
|
||||
|
||||
FIXME: describe the following
|
||||
|
||||
--release-type=TYPE TYPE must be one of @types
|
||||
--package-name=PACKAGE_NAME
|
||||
--previous-version=VER
|
||||
--current-version=VER
|
||||
--release-archive-directory=DIR
|
||||
--url-directory=URL_DIR
|
||||
--news=NEWS_FILE optional
|
||||
|
||||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
||||
EOF
|
||||
}
|
||||
exit $exit_code;
|
||||
}
|
||||
|
||||
sub print_changelog_deltas ($$)
|
||||
{
|
||||
my ($package_name, $prev_version) = @_;
|
||||
|
||||
# Print new ChangeLog entries.
|
||||
|
||||
# First find all CVS-controlled ChangeLog files.
|
||||
use File::Find;
|
||||
my @changelog;
|
||||
find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS'
|
||||
and push @changelog, $File::Find::name}},
|
||||
'.');
|
||||
|
||||
# If there are no ChangeLog files, we're done.
|
||||
@changelog
|
||||
or return;
|
||||
my %changelog = map {$_ => 1} @changelog;
|
||||
|
||||
# Reorder the list of files so that if there are ChangeLog
|
||||
# files in the specified directories, they're listed first,
|
||||
# in this order:
|
||||
my @dir = qw ( . src lib m4 config doc );
|
||||
|
||||
# A typical @changelog array might look like this:
|
||||
# ./ChangeLog
|
||||
# ./po/ChangeLog
|
||||
# ./m4/ChangeLog
|
||||
# ./lib/ChangeLog
|
||||
# ./doc/ChangeLog
|
||||
# ./config/ChangeLog
|
||||
my @reordered;
|
||||
foreach my $d (@dir)
|
||||
{
|
||||
my $dot_slash = $d eq '.' ? $d : "./$d";
|
||||
my $target = "$dot_slash/ChangeLog";
|
||||
delete $changelog{$target}
|
||||
and push @reordered, $target;
|
||||
}
|
||||
|
||||
# Append any remaining ChangeLog files.
|
||||
push @reordered, sort keys %changelog;
|
||||
|
||||
# Remove leading `./'.
|
||||
@reordered = map { s!^\./!!; $_ } @reordered;
|
||||
|
||||
print "\nChangeLog entries:\n\n";
|
||||
# print join ("\n", @reordered), "\n";
|
||||
|
||||
$prev_version =~ s/\./_/g;
|
||||
my $prev_cvs_tag = "\U$package_name\E-$prev_version";
|
||||
|
||||
my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered";
|
||||
open DIFF, '-|', $cmd
|
||||
or die "$ME: cannot run `$cmd': $!\n";
|
||||
# Print two types of lines, making minor changes:
|
||||
# Lines starting with `+++ ', e.g.,
|
||||
# +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247
|
||||
# and those starting with `+'.
|
||||
# Don't print the others.
|
||||
my $prev_printed_line_empty = 1;
|
||||
while (defined (my $line = <DIFF>))
|
||||
{
|
||||
if ($line =~ /^\+\+\+ /)
|
||||
{
|
||||
my $separator = "*"x70 ."\n";
|
||||
$line =~ s///;
|
||||
$line =~ s/\s.*//;
|
||||
$prev_printed_line_empty
|
||||
or print "\n";
|
||||
print $separator, $line, $separator;
|
||||
}
|
||||
elsif ($line =~ /^\+/)
|
||||
{
|
||||
$line =~ s///;
|
||||
print $line;
|
||||
$prev_printed_line_empty = ($line =~ /^$/);
|
||||
}
|
||||
}
|
||||
close DIFF;
|
||||
|
||||
# The exit code should be 1.
|
||||
# Allow in case there are no modified ChangeLog entries.
|
||||
$? == 256 || $? == 128
|
||||
or warn "$ME: warning: `cmd' had unexpected exit code or signal ($?)\n";
|
||||
}
|
||||
|
||||
{
|
||||
my $release_type;
|
||||
my $package_name;
|
||||
my $prev_version;
|
||||
my $curr_version;
|
||||
my $release_archive_dir;
|
||||
my @url_dir_list;
|
||||
my $news_file;
|
||||
|
||||
GetOptions
|
||||
(
|
||||
'release-type=s' => \$release_type,
|
||||
'package-name=s' => \$package_name,
|
||||
'previous-version=s' => \$prev_version,
|
||||
'current-version=s' => \$curr_version,
|
||||
'release-archive-directory=s' => \$release_archive_dir,
|
||||
'url-directory=s@' => \@url_dir_list,
|
||||
'news=s@' => \$news_file,
|
||||
|
||||
help => sub { usage 0 },
|
||||
version => sub { print "$ME version $VERSION\n"; exit },
|
||||
) or usage 1;
|
||||
|
||||
my $fail = 0;
|
||||
# Ensure that sure each required option is specified.
|
||||
$release_type
|
||||
or (warn "$ME: release type not specified\n"), $fail = 1;
|
||||
$package_name
|
||||
or (warn "$ME: package name not specified\n"), $fail = 1;
|
||||
$prev_version
|
||||
or (warn "$ME: previous version string not specified\n"), $fail = 1;
|
||||
$curr_version
|
||||
or (warn "$ME: current version string not specified\n"), $fail = 1;
|
||||
$release_archive_dir
|
||||
or (warn "$ME: release directory name not specified\n"), $fail = 1;
|
||||
@url_dir_list
|
||||
or (warn "$ME: URL directory name(s) not specified\n"), $fail = 1;
|
||||
|
||||
exists $valid_release_types{$release_type}
|
||||
or (warn "$ME: `$release_type': invalid release type\n"), $fail = 1;
|
||||
|
||||
@ARGV
|
||||
and (warn "$ME: too many arguments\n"), $fail = 1;
|
||||
$fail
|
||||
and usage 1;
|
||||
|
||||
my $my_distdir = "$package_name-$curr_version";
|
||||
my $tgz = "$my_distdir.tar.gz";
|
||||
my $tbz = "$my_distdir.tar.bz2";
|
||||
my $xd = "$package_name-$prev_version-$curr_version.xdelta";
|
||||
|
||||
my %size;
|
||||
|
||||
foreach my $f (($tgz, $tbz, $xd))
|
||||
{
|
||||
my $cmd = "du --human $f";
|
||||
my $t = `$cmd`;
|
||||
# FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
|
||||
$@
|
||||
and (warn "$ME: command failed: `$cmd'\n"), $fail = 1;
|
||||
chomp $t;
|
||||
$t =~ s/^([\d.]+[MkK]).*/${1}B/;
|
||||
$size{$f} = $t;
|
||||
}
|
||||
|
||||
$fail
|
||||
and exit 1;
|
||||
|
||||
# The markup is escaped as <\# so that when this script is sent by
|
||||
# mail (or part of a diff), Gnus is not triggered.
|
||||
print <<EOF;
|
||||
|
||||
Subject: $my_distdir released
|
||||
|
||||
<\#secure method=pgpmime mode=sign>
|
||||
|
||||
FIXME: put comments here
|
||||
|
||||
EOF
|
||||
|
||||
print "Here are the compressed sources:\n";
|
||||
foreach my $url (@url_dir_list)
|
||||
{
|
||||
print " $url/$tgz ($size{$tgz})\n";
|
||||
print " $url/$tbz ($size{$tbz})\n";
|
||||
}
|
||||
|
||||
print "\nAnd here are xdelta-style diffs:\n";
|
||||
foreach my $url (@url_dir_list)
|
||||
{
|
||||
print " $url/$xd ($size{$xd})\n";
|
||||
}
|
||||
|
||||
print "\nHere are GPG detached signatures:\n";
|
||||
foreach my $url (@url_dir_list)
|
||||
{
|
||||
print " $url/$tgz.asc\n";
|
||||
print " $url/$tbz.asc\n";
|
||||
}
|
||||
|
||||
# FIXME: clean up upon interrupt or die
|
||||
my $tmpdir = $ENV{TMPDIR} || '/tmp';
|
||||
my $tmp = "$tmpdir/$ME-$$";
|
||||
unlink $tmp; # ignore failure
|
||||
|
||||
print "\nHere are the MD5 and SHA1 signatures:\n";
|
||||
print "\n";
|
||||
# The markup is escaped as <\# so that when this script is sent by
|
||||
# mail (or part of a diff), Gnus is not triggered.
|
||||
print "<\#part type=text/plain filename=\"$tmp\" disposition=inline>\n"
|
||||
. "<\#/part>\n";
|
||||
|
||||
open OUT, '>', $tmp
|
||||
or die "$ME: $tmp: cannot open for writing: $!\n";
|
||||
|
||||
foreach my $meth (qw (md5 sha1))
|
||||
{
|
||||
foreach my $f (($tgz, $tbz, $xd))
|
||||
{
|
||||
open IN, '<', $f
|
||||
or die "$ME: $f: cannot open for reading: $!\n";
|
||||
binmode IN;
|
||||
my $dig =
|
||||
($meth eq 'md5'
|
||||
? Digest::MD5->new->addfile(*IN)->hexdigest
|
||||
: Digest::SHA1->new->addfile(*IN)->hexdigest);
|
||||
close IN;
|
||||
print OUT "$dig $f\n";
|
||||
}
|
||||
}
|
||||
|
||||
close OUT
|
||||
or die "$ME: $tmp: while writing: $!\n";
|
||||
chmod 0400, $tmp; # ignore failure
|
||||
|
||||
if ($news_file)
|
||||
{
|
||||
print "\nNEWS\n\n";
|
||||
|
||||
# Print all lines from $news_file, starting with the first one
|
||||
# that mentions $curr_version up to but not including
|
||||
# the first occurrence of $prev_version.
|
||||
my $in_items;
|
||||
open NEWS, '<', $news_file
|
||||
or die "$ME: $news_file: cannot open for reading: $!\n";
|
||||
while (defined (my $line = <NEWS>))
|
||||
{
|
||||
if ( ! $in_items)
|
||||
{
|
||||
# Match lines like this one:
|
||||
# * Major changes in release 5.0.1:
|
||||
# but not any other line that starts with a space, *, or -.
|
||||
$line =~ /^(\* Major changes.*|[^ *-].*)\Q$curr_version\E/o
|
||||
or next;
|
||||
$in_items = 1;
|
||||
print $line;
|
||||
}
|
||||
else
|
||||
{
|
||||
# Be careful that this regexp cannot match version numbers
|
||||
# in NEWS items -- they might well say `introduced in 4.5.5',
|
||||
# and we don't want that to match.
|
||||
$line =~ /^(\* Major changes.*|[^ *-].*)\Q$prev_version\E/o
|
||||
and last;
|
||||
print $line;
|
||||
}
|
||||
}
|
||||
close NEWS;
|
||||
|
||||
$in_items
|
||||
or die "$ME: $news_file: no matching lines for `$curr_version'\n";
|
||||
}
|
||||
|
||||
$release_type eq 'major'
|
||||
or print_changelog_deltas ($package_name, $prev_version);
|
||||
|
||||
exit 0;
|
||||
}
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use warnings;
|
||||
use 5.005;
|
||||
use strict;
|
||||
|
||||
my %option;
|
||||
my %directive;
|
||||
my $scanner = `grep -i '"%[a-z]' $ARGV[0]`;
|
||||
$scanner =~ s/"\[-_\]"/-/g;
|
||||
while (<STDIN>)
|
||||
{
|
||||
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 = '' if ! defined $short;
|
||||
$short = '-d' if $long eq '--defines' && ! $short;
|
||||
my $dir = '%' . substr($long, 2);
|
||||
if (index ($scanner, "\"$dir\"") < 0)
|
||||
{
|
||||
if ($long eq '--force-define') { $dir = '%define'; }
|
||||
else { $dir = ''; }
|
||||
}
|
||||
if ($arg)
|
||||
{
|
||||
# if $opt, $arg contains the closing ].
|
||||
substr ($arg, -1) = ''
|
||||
if $opt eq '[';
|
||||
$arg =~ s/^=//;
|
||||
$arg = lc ($arg);
|
||||
my $dir_arg = $arg;
|
||||
# If the argument is compite (e.g., for --define[=NAME[=VALUE]]),
|
||||
# put each word in @var, to build @var{name}[=@var{value}], not
|
||||
# @var{name[=value]}].
|
||||
$arg =~ s/(\w+)/\@var{$1}/g;
|
||||
my $long_arg = "=$arg";
|
||||
if ($opt eq '[') {
|
||||
$long_arg = "[$long_arg]";
|
||||
$arg = "[$arg]";
|
||||
}
|
||||
# For arguments of directives: this only works if all arguments
|
||||
# are strings and have the same syntax as on the command line.
|
||||
if ($dir_arg eq 'name[=value]')
|
||||
{
|
||||
$dir_arg = '@var{name} ["@var{value}"]';
|
||||
}
|
||||
else
|
||||
{
|
||||
$dir_arg =~ s/(\w+)/\@var{"$1"}/g;
|
||||
$dir_arg = '[' . $dir_arg . ']'
|
||||
if $opt eq '[';
|
||||
}
|
||||
$long = "$long$long_arg";
|
||||
$short = "$short $arg" if $short && $short ne '-d';
|
||||
$dir = "$dir $dir_arg" if $dir;
|
||||
}
|
||||
$option{$long} = $short;
|
||||
$directive{$long} = $dir;
|
||||
}
|
||||
}
|
||||
|
||||
my $sep = '';
|
||||
foreach my $long (sort keys %option)
|
||||
{
|
||||
# Avoid trailing spaces.
|
||||
print $sep;
|
||||
$sep = "\n";
|
||||
print '@item @option{', $long, "}\n\@tab";
|
||||
print ' @option{', $option{$long}, '}' if $option{$long};
|
||||
print "\n\@tab";
|
||||
print ' @code{', $directive{$long}, '}' if $directive{$long};
|
||||
print "\n";
|
||||
}
|
||||
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-2011 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-2011 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,53 @@
|
||||
# Customize maint.mk -*- makefile -*-
|
||||
|
||||
# Copyright (C) 2008-2011 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,gettext,gnulib
|
||||
|
||||
announcement_Cc_ = \
|
||||
[email protected], [email protected], [email protected], \
|
||||
[email protected]
|
||||
|
||||
update-copyright: update-b4-copyright update-package-copyright-year
|
||||
update-copyright-env = \
|
||||
UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
|
||||
+89
-51
@@ -1,11 +1,10 @@
|
||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 2001-2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -14,51 +13,77 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# We use macros like AC_CHECK_HEADERS_ONCE, so we need Autoconf 2.60 or better.
|
||||
AC_PREREQ(2.60)
|
||||
# In order for some versions of Sun Studio to compile our C++ test cases
|
||||
# correctly, we need Autoconf 2.64 or better to handle the restrict
|
||||
# keyword in at least string.h from gnulib.
|
||||
AC_PREREQ(2.64)
|
||||
|
||||
AC_INIT([GNU Bison],
|
||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||
[[email protected]])
|
||||
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2011],
|
||||
[The copyright year for this package])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2011])
|
||||
|
||||
AC_INIT([GNU Bison], [2.3a], [[email protected]])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
||||
AM_INIT_AUTOMAKE([1.8 check-news readme-alpha dist-bzip2])
|
||||
AC_CONFIG_HEADERS([config.h:config.hin])
|
||||
|
||||
gl_USE_SYSTEM_EXTENSIONS
|
||||
# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here:
|
||||
#
|
||||
# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131
|
||||
#
|
||||
# To avoid 1.11, we make 1.11.1 the minimum version.
|
||||
#
|
||||
# We want gnits strictness only when rolling a stable release. For
|
||||
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
||||
# doesn't like that, so we let the underscore disable gnits. Between
|
||||
# releases, we want to be able run make dist without being required to
|
||||
# add a bogus NEWS entry. In that case, the version string
|
||||
# automatically contains a dash, which we also let disable gnits.
|
||||
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.
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_STDC
|
||||
AC_PROG_CC_STDC
|
||||
|
||||
# Gnulib (early checks).
|
||||
gl_EARLY
|
||||
|
||||
AC_ARG_ENABLE(gcc-warnings,
|
||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||
[case "${enableval}" in
|
||||
yes|no) ;;
|
||||
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
||||
esac],
|
||||
[enableval=no])
|
||||
[enableval=no])
|
||||
if test "${enableval}" = yes; then
|
||||
gl_WARNING_CFLAGS([-Werror])
|
||||
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
||||
WARNING_CFLAGS=
|
||||
gl_WARNING_CFLAGS([-Wextra -Wno-sign-compare])
|
||||
gl_WARNING_CFLAGS([-Wall])
|
||||
gl_WARNING_CFLAGS([-Wcast-align])
|
||||
gl_WARNING_CFLAGS([-Wcast-qual])
|
||||
gl_WARNING_CFLAGS([-Wformat])
|
||||
gl_WARNING_CFLAGS([-Wpointer-arith])
|
||||
gl_WARNING_CFLAGS([-Wwrite-strings])
|
||||
AC_SUBST([WARNING_CXXFLAGS], [$WARNING_CFLAGS])
|
||||
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
||||
AC_SUBST([WERROR_CFLAGS])
|
||||
gl_WARN_ADD([-Wall])
|
||||
gl_WARN_ADD([-Wextra -Wno-sign-compare])
|
||||
gl_WARN_ADD([-Wcast-align])
|
||||
gl_WARN_ADD([-Wcast-qual])
|
||||
gl_WARN_ADD([-Wformat])
|
||||
gl_WARN_ADD([-Wpointer-arith])
|
||||
gl_WARN_ADD([-Wwrite-strings])
|
||||
AC_SUBST([WARN_CXXFLAGS], [$WARN_CFLAGS])
|
||||
# The following warnings are not suitable for C++.
|
||||
gl_WARNING_CFLAGS([-Wbad-function-cast])
|
||||
gl_WARNING_CFLAGS([-Wmissing-declarations])
|
||||
gl_WARNING_CFLAGS([-Wmissing-prototypes])
|
||||
gl_WARNING_CFLAGS([-Wshadow])
|
||||
gl_WARNING_CFLAGS([-Wstrict-prototypes])
|
||||
gl_WARN_ADD([-Wbad-function-cast])
|
||||
gl_WARN_ADD([-Wmissing-declarations])
|
||||
gl_WARN_ADD([-Wmissing-prototypes])
|
||||
gl_WARN_ADD([-Wshadow])
|
||||
gl_WARN_ADD([-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.])
|
||||
fi
|
||||
|
||||
@@ -83,29 +108,35 @@ AC_SUBST([YACC_LIBRARY])
|
||||
AC_PROG_LEX
|
||||
AC_PROG_YACC
|
||||
AC_PROG_RANLIB
|
||||
BISON_PROG_GNU_M4
|
||||
if test x"$ac_cv_prog_gnu_m4" != xyes; then
|
||||
AC_MSG_ERROR([GNU M4 1.4 is required])
|
||||
fi
|
||||
AC_PROG_GNU_M4
|
||||
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.
|
||||
AC_CHECK_HEADERS_ONCE([locale.h])
|
||||
AM_STDBOOL_H
|
||||
|
||||
# Checks for compiler characteristics.
|
||||
AC_C_INLINE
|
||||
|
||||
# Gnulib (later checks). Putting them here rather than right after
|
||||
# gl_EARLY avoids some redundant checks.
|
||||
gl_INIT
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||
AM_WITH_DMALLOC
|
||||
BISON_PREREQ_SUBPIPE
|
||||
BISON_PREREQ_TIMEVAR
|
||||
|
||||
# gnulib and gettext.
|
||||
GNULIB_AUTOCONF_SNIPPET
|
||||
# We've never tested with gettext versions before 0.15, so play it safe.
|
||||
AM_GNU_GETTEXT_VERSION([0.15])
|
||||
# Gettext.
|
||||
# We use gnulib, which is only guaranteed to work properly with the
|
||||
# latest Gettext.
|
||||
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||
AM_GNU_GETTEXT_VERSION([0.18])
|
||||
BISON_I18N
|
||||
|
||||
# Internationalized parsers.
|
||||
@@ -114,6 +145,9 @@ AC_CONFIG_FILES([runtime-po/Makefile.in])
|
||||
aclocaldir='${datadir}/aclocal'
|
||||
AC_SUBST([aclocaldir])
|
||||
|
||||
# Create the benchmark script.
|
||||
AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
|
||||
|
||||
# Initialize the test suite.
|
||||
AC_CONFIG_TESTDIR(tests)
|
||||
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
||||
@@ -124,16 +158,20 @@ BISON_TEST_FOR_WORKING_CXX_COMPILER
|
||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||
# Needed by tests/atlocal.in.
|
||||
AC_SUBST([GCC])
|
||||
O0CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]] *//'`
|
||||
AC_SUBST([O0CFLAGS])
|
||||
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`
|
||||
AC_SUBST([O0CXXFLAGS])
|
||||
AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||
AC_SUBST([O0CXXFLAGS], [`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||
|
||||
gt_JAVACOMP([1.3])
|
||||
gt_JAVAEXEC
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
build-aux/Makefile
|
||||
po/Makefile.in
|
||||
data/Makefile
|
||||
build-aux/Makefile
|
||||
po/Makefile.in
|
||||
data/Makefile
|
||||
etc/Makefile
|
||||
examples/Makefile
|
||||
examples/calc++/Makefile
|
||||
lib/Makefile src/Makefile doc/Makefile])
|
||||
lib/Makefile src/Makefile
|
||||
doc/Makefile
|
||||
doc/yacc.1])
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -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-2011 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
|
||||
dist_pkgdata_DATA = README \
|
||||
c.m4 yacc.c glr.c \
|
||||
c++.m4 location.cc lalr1.cc glr.cc
|
||||
dist_pkgdata_DATA = README bison.m4 \
|
||||
c-skel.m4 c.m4 yacc.c glr.c \
|
||||
c++-skel.m4 c++.m4 location.cc lalr1.cc glr.cc \
|
||||
java-skel.m4 java.m4 lalr1.java
|
||||
|
||||
m4sugardir = $(pkgdatadir)/m4sugar
|
||||
dist_m4sugar_DATA = m4sugar/m4sugar.m4
|
||||
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 -*-
|
||||
|
||||
This directory contains Bison skeletons: the general shapes of the
|
||||
different parser kinds, that are specialized for specific grammars by
|
||||
the bison program.
|
||||
This directory contains data needed by Bison.
|
||||
|
||||
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
|
||||
It used to be named bison.simple: it corresponds to C Yacc
|
||||
compatible LALR(1) parsers.
|
||||
|
||||
- lalr1.cc
|
||||
Produces a C++ parser class. It is still very experimental, and not
|
||||
yet supported. Please, subscribe to [email protected].
|
||||
Produces a C++ parser class.
|
||||
|
||||
- lalr1.java
|
||||
Produces a Java parser class.
|
||||
|
||||
- glr.c
|
||||
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.
|
||||
Because the interface between skeletons and the bison program is not
|
||||
finished, *we are not bound to it*. In particular, Bison is not
|
||||
mature enough for us to consider that ``foreign skeletons'' are
|
||||
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-2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
GNU Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GNU Bison is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bison; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
+578
@@ -0,0 +1,578 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Language-independent M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2011 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)
|
||||
# -----------------------------------------------------
|
||||
# Complain if any name of type WHAT is used by the user (as recorded in
|
||||
# USER-LIST) but is not used by Bison (as recorded by macros in the
|
||||
# namespace BISON-NAMESPACE).
|
||||
#
|
||||
# USER-LIST must expand to a list specifying all user occurrences of all names
|
||||
# of type WHAT. Each item in the list must be a triplet specifying one
|
||||
# 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_complain_at([b4_start], [b4_end],
|
||||
[[%s `%s' is not used]],
|
||||
[$1], [b4_user_name])])[]dnl
|
||||
m4_popdef([b4_occurrence])dnl
|
||||
m4_popdef([b4_user_name])dnl
|
||||
m4_popdef([b4_start])dnl
|
||||
m4_popdef([b4_end])dnl
|
||||
])])
|
||||
|
||||
|
||||
|
||||
|
||||
## --------------------- ##
|
||||
## b4_percent_define_*. ##
|
||||
## --------------------- ##
|
||||
|
||||
|
||||
# b4_percent_define_use(VARIABLE)
|
||||
# -------------------------------
|
||||
# Declare that VARIABLE was used.
|
||||
m4_define([b4_percent_define_use],
|
||||
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
|
||||
])
|
||||
|
||||
# b4_percent_define_get(VARIABLE, [DEFAULT])
|
||||
# ------------------------------------------
|
||||
# Mimic muscle_percent_define_get in ../src/muscle-tab.h. That is, if
|
||||
# the %define variable VARIABLE is defined, emit its value. Contrary
|
||||
# to its C counterpart, return DEFAULT otherwise. Also, record
|
||||
# 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],
|
||||
[b4_percent_define_use([$1])dnl
|
||||
m4_ifdef([b4_percent_define(]$1[)],
|
||||
[m4_indir([b4_percent_define(]$1[)])],
|
||||
[$2])])
|
||||
|
||||
|
||||
# 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[)])))
|
||||
m4_foreach([b4_value], m4_dquote(m4_shift($@)),
|
||||
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||
[[accepted value: `%s']],
|
||||
m4_dquote(b4_value))])])dnl
|
||||
m4_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,26 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C++ skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2011 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)
|
||||
+65
-15
@@ -1,23 +1,21 @@
|
||||
m4_divert(-1) -*- Autoconf -*-
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
|
||||
@@ -26,12 +24,64 @@ m4_include(b4_pkgdatadir/[c.m4])
|
||||
## ---------------- ##
|
||||
|
||||
# Default parser class name.
|
||||
m4_define_default([b4_parser_class_name], [parser])
|
||||
m4_define_default([b4_location_type], [location])
|
||||
m4_define_default([b4_filename_type], [std::string])
|
||||
m4_define_default([b4_namespace], m4_defn([b4_prefix]))
|
||||
m4_define_default([b4_define_location_comparison],
|
||||
m4_if(b4_filename_type, [std::string], [1], [0]))
|
||||
b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||
|
||||
# Don't do that so that we remember whether we're using a user
|
||||
# request, or the default value.
|
||||
#
|
||||
# b4_percent_define_default([[location_type]], [[location]])
|
||||
|
||||
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
|
||||
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
||||
b4_percent_define_default([[define_location_comparison]],
|
||||
[m4_if(b4_percent_define_get([[filename_type]]),
|
||||
[std::string], [[true]], [[false]])])
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Namespace. ##
|
||||
## ----------- ##
|
||||
|
||||
m4_define([b4_namespace_ref], [b4_percent_define_get([[namespace]])])
|
||||
|
||||
# Don't permit an empty b4_namespace_ref. Any `::parser::foo' appended to it
|
||||
# would compile as an absolute reference with `parser' in the global namespace.
|
||||
# b4_namespace_open would open an anonymous namespace and thus establish
|
||||
# internal linkage. This would compile. However, it's cryptic, and internal
|
||||
# linkage for the parser would be specified in all translation units that
|
||||
# include the header, which is always generated. If we ever need to permit
|
||||
# internal linkage somehow, surely we can find a cleaner approach.
|
||||
m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
||||
[[namespace reference is empty]])])
|
||||
|
||||
# Instead of assuming the C++ compiler will do it, Bison should reject any
|
||||
# invalid b4_namepsace_ref that would be converted to a valid
|
||||
# b4_namespace_open. The problem is that Bison doesn't always output
|
||||
# b4_namespace_ref to uncommented code but should reserve the ability to do so
|
||||
# in future releases without risking breaking any existing user grammars.
|
||||
# Specifically, don't allow empty names as b4_namespace_open would just convert
|
||||
# those into anonymous namespaces, and that might tempt some users.
|
||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
||||
[[namespace reference has consecutive "::"]])])
|
||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
||||
[[namespace reference has a trailing "::"]])])
|
||||
|
||||
m4_define([b4_namespace_open],
|
||||
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
||||
[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
||||
[^\(.\)[ ]*::], [\1])),
|
||||
[::], [ { namespace ])[ {]])])
|
||||
|
||||
m4_define([b4_namespace_close],
|
||||
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
||||
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]),
|
||||
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*],
|
||||
[\1])),
|
||||
[::\([^][:]\|:[^:]\)*], [} ])[} // ]b4_namespace_ref])])
|
||||
|
||||
|
||||
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])])
|
||||
b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])])
|
||||
|
||||
m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[yacc.c]])
|
||||
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
|
||||
|
||||
m4_include(b4_used_skeleton)
|
||||
@@ -1,99 +1,70 @@
|
||||
m4_divert(-1) -*- Autoconf -*-
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C M4 Macros for Bison.
|
||||
# Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# Copyright (C) 2002, 2004-2011 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
## ---------------- ##
|
||||
## Identification. ##
|
||||
## ---------------- ##
|
||||
|
||||
# b4_copyright(TITLE, YEARS)
|
||||
# --------------------------
|
||||
m4_define([b4_copyright],
|
||||
[/* A Bison parser, made by GNU Bison b4_version. */
|
||||
|
||||
/* $1
|
||||
|
||||
m4_text_wrap([Copyright (C) $2 Free Software Foundation, Inc.], [ ])
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */])
|
||||
|
||||
# b4_comment(TEXT)
|
||||
# ----------------
|
||||
m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
||||
], [
|
||||
]) */])
|
||||
|
||||
# b4_identification
|
||||
# -----------------
|
||||
# Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or
|
||||
# b4_pull_flag if they use the values of the %define variables api.pure or
|
||||
# api.push-pull.
|
||||
m4_define([b4_identification],
|
||||
[/* Identify Bison output. */
|
||||
[#]define YYBISON 1
|
||||
[[/* Identify Bison output. */
|
||||
#define YYBISON 1
|
||||
|
||||
/* Bison version. */
|
||||
[#]define YYBISON_VERSION "b4_version"
|
||||
#define YYBISON_VERSION "]b4_version["
|
||||
|
||||
/* Skeleton name. */
|
||||
[#]define YYSKELETON_NAME b4_skeleton
|
||||
#define YYSKELETON_NAME ]b4_skeleton[]m4_ifdef([b4_pure_flag], [[
|
||||
|
||||
/* Pure parsers. */
|
||||
[#]define YYPURE b4_pure_flag
|
||||
#define YYPURE ]b4_pure_flag])[]m4_ifdef([b4_push_flag], [[
|
||||
|
||||
/* Push parsers. */
|
||||
#define YYPUSH ]b4_push_flag])[]m4_ifdef([b4_pull_flag], [[
|
||||
|
||||
/* Pull parsers. */
|
||||
#define YYPULL ]b4_pull_flag])[
|
||||
|
||||
/* Using locations. */
|
||||
[#]define YYLSP_NEEDED b4_locations_flag
|
||||
])
|
||||
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||
]])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
m4_define_default([b4_epilogue], [])
|
||||
|
||||
# If the %union is not named, its name is YYSTYPE.
|
||||
m4_define_default([b4_union_name], [YYSTYPE])
|
||||
|
||||
# The initial column and line.
|
||||
m4_define_default([b4_location_initial_column], [1])
|
||||
m4_define_default([b4_location_initial_line], [1])
|
||||
|
||||
# If the %name-prefix is not given, it is yy.
|
||||
m4_define_default([b4_prefix], [yy])
|
||||
|
||||
## ------------------------ ##
|
||||
## Pure/impure interfaces. ##
|
||||
@@ -109,9 +80,8 @@ m4_define([b4_user_args],
|
||||
# --------------
|
||||
# If defined, b4_parse_param arrives double quoted, but below we prefer
|
||||
# it to be single quoted.
|
||||
m4_define_default([b4_parse_param])
|
||||
m4_define([b4_parse_param],
|
||||
b4_parse_param))
|
||||
b4_parse_param)
|
||||
|
||||
|
||||
# b4_parse_param_for(DECL, FORMAL, BODY)
|
||||
@@ -120,7 +90,7 @@ b4_parse_param))
|
||||
# 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_fst($1_$2))dnl
|
||||
[m4_pushdef([$1], m4_unquote(m4_car($1_$2)))dnl
|
||||
m4_pushdef([$2], m4_shift($1_$2))dnl
|
||||
$3[]dnl
|
||||
m4_popdef([$2])dnl
|
||||
@@ -140,13 +110,6 @@ m4_define([b4_parse_param_use],
|
||||
## Data Types. ##
|
||||
## ------------ ##
|
||||
|
||||
# b4_ints_in(INT1, INT2, LOW, HIGH)
|
||||
# ---------------------------------
|
||||
# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
|
||||
m4_define([b4_ints_in],
|
||||
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
|
||||
|
||||
|
||||
# b4_int_type(MIN, MAX)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
@@ -171,6 +134,18 @@ m4_define([b4_int_type_for],
|
||||
[b4_int_type($1_min, $1_max)])
|
||||
|
||||
|
||||
# b4_table_value_equals(TABLE, VALUE, LITERAL)
|
||||
# --------------------------------------------
|
||||
# Without inducing a comparison warning from the compiler, check if the
|
||||
# literal value LITERAL equals VALUE from table TABLE, which must have
|
||||
# TABLE_min and TABLE_max defined. YYID must be defined as an identity
|
||||
# function that suppresses warnings about constant conditions.
|
||||
m4_define([b4_table_value_equals],
|
||||
[m4_if(m4_eval($3 < m4_indir([b4_]$1[_min])
|
||||
|| m4_indir([b4_]$1[_max]) < $3), [1],
|
||||
[[YYID (0)]],
|
||||
[[((]$2[) == (]$3[))]])])
|
||||
|
||||
## ---------##
|
||||
## Values. ##
|
||||
## ---------##
|
||||
@@ -182,48 +157,6 @@ m4_define([b4_int_type_for],
|
||||
m4_define([b4_null], [0])
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## Decoding options. ##
|
||||
## ------------------ ##
|
||||
|
||||
# b4_flag_if(FLAG, IF-TRUE, IF-FALSE)
|
||||
# -----------------------------------
|
||||
# Run IF-TRUE if b4_FLAG_flag is 1, IF-FALSE if FLAG is 0, otherwise fail.
|
||||
m4_define([b4_flag_if],
|
||||
[m4_case(b4_$1_flag,
|
||||
[0], [$3],
|
||||
[1], [$2],
|
||||
[m4_fatal([invalid $1 value: ]$1)])])
|
||||
|
||||
|
||||
# b4_define_flag_if(FLAG)
|
||||
# -----------------------
|
||||
# Define "b4_FLAG_if(IF-TRUE, IF-FALSE)" that depends on the
|
||||
# value of the Boolean FLAG.
|
||||
m4_define([b4_define_flag_if],
|
||||
[_b4_define_flag_if($[1], $[2], [$1])])
|
||||
|
||||
# _b4_define_flag_if($1, $2, FLAG)
|
||||
# --------------------------------
|
||||
# This macro works around the impossibility to define macros
|
||||
# inside macros, because issuing `[$1]' is not possible in M4 :(.
|
||||
# This sucks hard, GNU M4 should really provide M5 like $$1.
|
||||
m4_define([_b4_define_flag_if],
|
||||
[m4_if([$1$2], $[1]$[2], [],
|
||||
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
||||
m4_define([b4_$3_if],
|
||||
[b4_flag_if([$3], [$1], [$2])])])
|
||||
|
||||
|
||||
# b4_FLAG_if(IF-TRUE, IF-FALSE)
|
||||
# -----------------------------
|
||||
# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise.
|
||||
b4_define_flag_if([defines]) # Whether headers are requested.
|
||||
b4_define_flag_if([error_verbose]) # Whether error are verbose.
|
||||
b4_define_flag_if([locations]) # Whether locations are tracked.
|
||||
b4_define_flag_if([pure]) # Whether the interface is pure.
|
||||
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
@@ -242,7 +175,7 @@ m4_define([b4_token_define],
|
||||
# -------------------------------------------------------
|
||||
# Output the definition of the tokens (if there are) as #defines.
|
||||
m4_define([b4_token_defines],
|
||||
[m4_if([$@], [[]], [],
|
||||
[m4_if([$#$1], [1], [],
|
||||
[/* Tokens. */
|
||||
m4_map([b4_token_define], [$@])])
|
||||
])
|
||||
@@ -259,7 +192,7 @@ m4_define([b4_token_enum],
|
||||
# -----------------------------------------------------
|
||||
# Output the definition of the tokens (if there are) as enums.
|
||||
m4_define([b4_token_enums],
|
||||
[m4_if([$@], [[]], [],
|
||||
[m4_if([$#$1], [1], [],
|
||||
[/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
@@ -311,8 +244,8 @@ m4_define([b4_c_function_def],
|
||||
b4_c_ansi_function_def($@)
|
||||
#else
|
||||
$2
|
||||
$1 (b4_c_knr_formal_names(m4_shiftn(2, $@)))
|
||||
b4_c_knr_formal_decls(m4_shiftn(2, $@))
|
||||
$1 (b4_c_knr_formal_names(m4_shift2($@)))
|
||||
b4_c_knr_formal_decls(m4_shift2($@))
|
||||
#endif[]dnl
|
||||
])
|
||||
|
||||
@@ -322,7 +255,7 @@ b4_c_knr_formal_decls(m4_shiftn(2, $@))
|
||||
# Declare the function NAME in ANSI.
|
||||
m4_define([b4_c_ansi_function_def],
|
||||
[$2
|
||||
$1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
||||
$1 (b4_c_ansi_formals(m4_shift2($@)))[]dnl
|
||||
])
|
||||
|
||||
|
||||
@@ -330,9 +263,8 @@ $1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
||||
# --------------------------------------
|
||||
# Output the arguments ANSI-C definition.
|
||||
m4_define([b4_c_ansi_formals],
|
||||
[m4_case([$@],
|
||||
[], [void],
|
||||
[[]], [void],
|
||||
[m4_if([$#], [0], [void],
|
||||
[$#$1], [1], [void],
|
||||
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
||||
|
||||
m4_define([b4_c_ansi_formal],
|
||||
@@ -384,7 +316,7 @@ $2 $1 ();
|
||||
# ----------------------------------------------------------------
|
||||
# Declare the function NAME.
|
||||
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
|
||||
])
|
||||
|
||||
|
||||
@@ -399,7 +331,7 @@ m4_define([b4_c_ansi_function_decl],
|
||||
# -----------------------------------------------------------
|
||||
# Call the function NAME with arguments NAME1, NAME2 etc.
|
||||
m4_define([b4_c_function_call],
|
||||
[$1 (b4_c_args(m4_shiftn(2, $@)))[]dnl
|
||||
[$1 (b4_c_args(m4_shift2($@)))[]dnl
|
||||
])
|
||||
|
||||
|
||||
@@ -417,50 +349,9 @@ m4_define([b4_c_arg],
|
||||
## Synclines. ##
|
||||
## ----------- ##
|
||||
|
||||
# b4_basename(NAME)
|
||||
# -----------------
|
||||
# Similar to POSIX basename; the differences don't matter here.
|
||||
# Beware that NAME is not evaluated.
|
||||
m4_define([b4_basename],
|
||||
[m4_bpatsubst([$1], [^.*/\([^/]+\)/*$], [\1])])
|
||||
|
||||
|
||||
# b4_syncline(LINE, FILE)
|
||||
# b4_sync_start(LINE, FILE)
|
||||
# -----------------------
|
||||
m4_define([b4_syncline],
|
||||
[b4_flag_if([synclines],
|
||||
[/* Line __line__ of b4_basename(m4_quote(__file__)). */
|
||||
[#]line $1 $2])])
|
||||
|
||||
|
||||
# b4_user_code(USER-CODE)
|
||||
# -----------------------
|
||||
# Emit code from the user, ending it with synclines.
|
||||
m4_define([b4_user_code],
|
||||
[$1
|
||||
b4_syncline([@oline@], [@ofile@])])
|
||||
|
||||
|
||||
# b4_define_user_code(MACRO)
|
||||
# --------------------------
|
||||
# From b4_MACRO, build b4_user_MACRO that includes the synclines.
|
||||
m4_define([b4_define_user_code],
|
||||
[m4_define([b4_user_$1],
|
||||
[b4_user_code([b4_$1])])])
|
||||
|
||||
|
||||
# b4_user_actions
|
||||
# b4_user_initial_action
|
||||
# b4_user_post_prologue
|
||||
# b4_user_start_header
|
||||
# b4_user_stype
|
||||
# ----------------------
|
||||
# Macros that issue user code, ending with synclines.
|
||||
b4_define_user_code([actions])
|
||||
b4_define_user_code([initial_action])
|
||||
b4_define_user_code([post_prologue])
|
||||
b4_define_user_code([start_header])
|
||||
b4_define_user_code([stype])
|
||||
m4_define([b4_sync_start], [[#]line $1 $2])
|
||||
|
||||
|
||||
## -------------- ##
|
||||
|
||||
+242
-181
@@ -1,22 +1,21 @@
|
||||
m4_divert(-1) -*- C -*-
|
||||
-*- C -*-
|
||||
|
||||
# GLR skeleton for Bison
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# Copyright (C) 2002-2011 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
@@ -35,6 +34,13 @@ m4_define_default([b4_stack_depth_init], [200])
|
||||
## Pure/impure interfaces. ##
|
||||
## ------------------------ ##
|
||||
|
||||
b4_define_flag_if([pure])
|
||||
# If glr.cc is including this file and thus has already set b4_pure_flag,
|
||||
# do not change the value of b4_pure_flag, and do not record a use of api.pure.
|
||||
m4_ifndef([b4_pure_flag],
|
||||
[b4_percent_define_default([[api.pure]], [[false]])
|
||||
m4_define([b4_pure_flag],
|
||||
[b4_percent_define_flag_if([[api.pure]], [[1]], [[0]])])])
|
||||
|
||||
# b4_user_formals
|
||||
# ---------------
|
||||
@@ -141,15 +147,16 @@ m4_define([b4_rhs_location],
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
m4_divert(0)dnl
|
||||
@output @output_parser_name@
|
||||
m4_divert_push(0)dnl
|
||||
@output(b4_parser_file_name@)@
|
||||
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||
[2002, 2003, 2004, 2005, 2006])
|
||||
[2002-2011])
|
||||
[
|
||||
/* C GLR parser skeleton written by Paul Hilfinger. */
|
||||
|
||||
]b4_identification
|
||||
|
||||
b4_percent_code_get([[top]])[]dnl
|
||||
m4_if(b4_prefix, [yy], [],
|
||||
[/* Substitute the variable and function names. */
|
||||
#define yyparse b4_prefix[]parse
|
||||
@@ -162,24 +169,23 @@ m4_if(b4_prefix, [yy], [],
|
||||
#define yylloc b4_prefix[]lloc])[
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
]b4_pre_prologue
|
||||
]b4_user_pre_prologue
|
||||
|
||||
dnl # b4_shared_declarations
|
||||
dnl # ----------------------
|
||||
dnl # Declaration that might either go into the header (if --defines)
|
||||
dnl # or open coded in the parser body.
|
||||
m4_define([b4_shared_declarations],
|
||||
[m4_ifdef([b4_start_header],
|
||||
[[/* Copy the %start-header blocks. */
|
||||
]b4_start_header])[]dnl
|
||||
[b4_percent_code_get([[requires]])[]dnl
|
||||
|
||||
b4_token_enums(b4_tokens)
|
||||
|
||||
[#ifndef YYSTYPE
|
||||
]m4_ifdef([b4_stype],
|
||||
[[typedef union ]b4_union_name[
|
||||
{
|
||||
]b4_user_stype[
|
||||
YYSTYPE;
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[typedef int YYSTYPE;
|
||||
@@ -202,12 +208,10 @@ typedef struct YYLTYPE
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
]m4_ifdef([b4_end_header],
|
||||
[[/* Copy the %end-header blocks. */
|
||||
]b4_end_header])[]dnl
|
||||
]b4_percent_code_get([[provides]])[]dnl
|
||||
])
|
||||
|
||||
b4_defines_if([#include @output_header_name@],
|
||||
b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
|
||||
[b4_shared_declarations])[
|
||||
|
||||
/* Enabling traces. */
|
||||
@@ -236,15 +240,15 @@ b4_defines_if([#include @output_header_name@],
|
||||
static YYSTYPE yyval_default;
|
||||
|
||||
/* Copy the second part of user declarations. */
|
||||
]b4_user_post_prologue[
|
||||
]b4_user_post_prologue
|
||||
b4_percent_code_get[]dnl
|
||||
|
||||
#include <stdio.h>
|
||||
[#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifndef YY_
|
||||
# if YYENABLE_NLS
|
||||
# if defined YYENABLE_NLS && YYENABLE_NLS
|
||||
# if ENABLE_NLS
|
||||
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||
@@ -306,7 +310,8 @@ static YYSTYPE yyval_default;
|
||||
#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if (! defined __GNUC__ || __GNUC__ < 2 \
|
||||
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
|
||||
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5) \
|
||||
|| (defined __STRICT_ANSI__ && __STRICT_ANSI__))
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
#endif
|
||||
@@ -346,8 +351,7 @@ static YYSTYPE yyval_default;
|
||||
#define YYMAXUTOK ]b4_user_token_number_max[
|
||||
|
||||
#define YYTRANSLATE(YYX) \
|
||||
((YYX <= 0) ? YYEOF : \
|
||||
(unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||||
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||||
|
||||
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
||||
static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
|
||||
@@ -409,9 +413,9 @@ static const ]b4_int_type_for([b4_merger])[ yymerger[] =
|
||||
]b4_merger[
|
||||
};
|
||||
|
||||
/* 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. */
|
||||
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||
YYTABLE doesn't specify something else to do. Zero means the default
|
||||
is an error. */
|
||||
static const ]b4_int_type_for([b4_defact])[ yydefact[] =
|
||||
{
|
||||
]b4_defact[
|
||||
@@ -439,8 +443,7 @@ static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] =
|
||||
|
||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||
positive, shift that token. If negative, reduce the rule which
|
||||
number is the opposite. If zero, do what YYDEFACT says.
|
||||
If YYTABLE_NINF, syntax error. */
|
||||
number is the opposite. If YYTABLE_NINF, syntax error. */
|
||||
#define YYTABLE_NINF ]b4_table_ninf[
|
||||
static const ]b4_int_type_for([b4_table])[ yytable[] =
|
||||
{
|
||||
@@ -1010,17 +1013,15 @@ yylhsNonterm (yyRuleNum yyrule)
|
||||
return yyr1[yyrule];
|
||||
}
|
||||
|
||||
#define yyis_pact_ninf(yystate) \
|
||||
]m4_if(m4_eval(b4_pact_ninf < b4_pact_min), [1],
|
||||
[0],
|
||||
[((yystate) == YYPACT_NINF)])[
|
||||
#define yypact_value_is_default(yystate) \
|
||||
]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[
|
||||
|
||||
/** True iff LR state STATE has only a default reduction (regardless
|
||||
* of token). */
|
||||
static inline yybool
|
||||
yyisDefaultedState (yyStateNum yystate)
|
||||
{
|
||||
return yyis_pact_ninf (yypact[yystate]);
|
||||
return yypact_value_is_default (yypact[yystate]);
|
||||
}
|
||||
|
||||
/** The default reduction for STATE, assuming it has one. */
|
||||
@@ -1030,10 +1031,8 @@ yydefaultAction (yyStateNum yystate)
|
||||
return yydefact[yystate];
|
||||
}
|
||||
|
||||
#define yyis_table_ninf(yytable_value) \
|
||||
]m4_if(m4_eval(b4_table_ninf < b4_table_min), [1],
|
||||
[YYID (0)],
|
||||
[((yytable_value) == YYTABLE_NINF)])[
|
||||
#define yytable_value_is_error(yytable_value) \
|
||||
]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[
|
||||
|
||||
/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
|
||||
* Result R means
|
||||
@@ -1048,12 +1047,13 @@ yygetLRActions (yyStateNum yystate, int yytoken,
|
||||
int* yyaction, const short int** yyconflicts)
|
||||
{
|
||||
int yyindex = yypact[yystate] + yytoken;
|
||||
if (yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
|
||||
if (yypact_value_is_default (yypact[yystate])
|
||||
|| yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
|
||||
{
|
||||
*yyaction = -yydefact[yystate];
|
||||
*yyconflicts = yyconfl;
|
||||
}
|
||||
else if (! yyis_table_ninf (yytable[yyindex]))
|
||||
else if (! yytable_value_is_error (yytable[yyindex]))
|
||||
{
|
||||
*yyaction = yytable[yyindex];
|
||||
*yyconflicts = yyconfl + yyconflp[yyindex];
|
||||
@@ -1441,12 +1441,12 @@ yy_reduce_print (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
/* The symbols being reduced. */
|
||||
for (yyi = 0; yyi < yynrhs; yyi++)
|
||||
{
|
||||
fprintf (stderr, " $%d = ", yyi + 1);
|
||||
YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
||||
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
||||
&]b4_rhs_value(yynrhs, yyi + 1)[
|
||||
]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
|
||||
b4_user_args[);
|
||||
fprintf (stderr, "\n");
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1802,7 +1802,7 @@ yyreportAmbiguity (yySemanticOption* yyx0,
|
||||
|
||||
yyerror (]b4_yyerror_args[YY_("syntax is ambiguous"));
|
||||
return yyabort;
|
||||
}
|
||||
}]b4_locations_if([[
|
||||
|
||||
/** Starting at and including state S1, resolve the location for each of the
|
||||
* previous N1 states that is unresolved. The first semantic option of a state
|
||||
@@ -1860,7 +1860,7 @@ yyresolveLocations (yyGLRState* yys1, int yyn1,
|
||||
yylloc = yylloc_current;
|
||||
}
|
||||
}
|
||||
}
|
||||
}]])[
|
||||
|
||||
/** Resolve the ambiguity represented in state S, perform the indicated
|
||||
* actions, and set the semantic value of S. If result != yyok, the chain of
|
||||
@@ -1894,8 +1894,8 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
switch (yypreference (yybest, yyp))
|
||||
{
|
||||
case 0:
|
||||
yyresolveLocations (yys, 1, yystackp]b4_user_args[);
|
||||
case 0:]b4_locations_if([[
|
||||
yyresolveLocations (yys, 1, yystackp]b4_user_args[);]])[
|
||||
return yyreportAmbiguity (yybest, yyp]b4_pure_args[);
|
||||
break;
|
||||
case 1:
|
||||
@@ -2040,11 +2040,19 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
|
||||
{
|
||||
YYDPRINTF ((stderr, "Reading a token: "));
|
||||
yychar = YYLEX;
|
||||
}
|
||||
|
||||
if (yychar <= YYEOF)
|
||||
{
|
||||
yychar = yytoken = YYEOF;
|
||||
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
}
|
||||
else
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
|
||||
yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
|
||||
|
||||
while (*yyconflicts != 0)
|
||||
@@ -2080,102 +2088,130 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
|
||||
/*ARGSUSED*/ static void
|
||||
yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
if (yystackp->yyerrState == 0)
|
||||
if (yystackp->yyerrState != 0)
|
||||
return;
|
||||
#if ! YYERROR_VERBOSE
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
#else
|
||||
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
|
||||
size_t yysize0 = yytnamerr (NULL, yytokenName (yytoken));
|
||||
size_t yysize = yysize0;
|
||||
size_t yysize1;
|
||||
yybool yysize_overflow = yyfalse;
|
||||
char* yymsg = NULL;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = 0;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
"expected"). */
|
||||
int yycount = 0;
|
||||
|
||||
/* There are many possibilities here to consider:
|
||||
- If this state is a consistent state with a default action, then
|
||||
the only way this function was invoked is if the default action
|
||||
is an error action. In that case, don't check for expected
|
||||
tokens because there are none.
|
||||
- The only way there can be no lookahead present (in yychar) is if
|
||||
this state is a consistent state with a default action. Thus,
|
||||
detecting the absence of a lookahead is sufficient to determine
|
||||
that there is no unexpected or expected token to report. In that
|
||||
case, just report a simple "syntax error".
|
||||
- Don't assume there isn't a lookahead just because this state is a
|
||||
consistent state with a default action. There might have been a
|
||||
previous inconsistent state, consistent state with a non-default
|
||||
action, or user semantic action that manipulated yychar.
|
||||
- Of course, the expected token list depends on states to have
|
||||
correct lookahead information, and it depends on the parser not
|
||||
to perform extra reductions after fetching a lookahead from the
|
||||
scanner and before detecting a syntax error. Thus, state merging
|
||||
(from LALR or IELR) and default reductions corrupt the expected
|
||||
token list. However, the list is correct for canonical LR with
|
||||
one exception: it will still contain any token that will not be
|
||||
accepted due to an error action in a later state.
|
||||
*/
|
||||
if (yytoken != YYEMPTY)
|
||||
{
|
||||
#if YYERROR_VERBOSE
|
||||
int yyn;
|
||||
yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
if (YYPACT_NINF < yyn && yyn <= YYLAST)
|
||||
{
|
||||
yySymbol yytoken = YYTRANSLATE (yychar);
|
||||
size_t yysize0 = yytnamerr (NULL, yytokenName (yytoken));
|
||||
size_t yysize = yysize0;
|
||||
size_t yysize1;
|
||||
yybool yysize_overflow = yyfalse;
|
||||
char* yymsg = NULL;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
int yyx;
|
||||
char *yyfmt;
|
||||
char const *yyf;
|
||||
static char const yyunexpected[] = "syntax error, unexpected %s";
|
||||
static char const yyexpecting[] = ", expecting %s";
|
||||
static char const yyor[] = " or %s";
|
||||
char yyformat[sizeof yyunexpected
|
||||
+ sizeof yyexpecting - 1
|
||||
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
||||
* (sizeof yyor - 1))];
|
||||
char const *yyprefix = yyexpecting;
|
||||
|
||||
/* 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 yycount = 1;
|
||||
|
||||
yyarg[0] = yytokenName (yytoken);
|
||||
yyfmt = yystpcpy (yyformat, yyunexpected);
|
||||
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
yyformat[sizeof yyunexpected - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytokenName (yyx);
|
||||
yysize1 = yysize + yytnamerr (NULL, yytokenName (yyx));
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
yyfmt = yystpcpy (yyfmt, yyprefix);
|
||||
yyprefix = yyor;
|
||||
}
|
||||
|
||||
yyf = YY_(yyformat);
|
||||
yysize1 = yysize + strlen (yyf);
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
|
||||
if (!yysize_overflow)
|
||||
yymsg = (char *) YYMALLOC (yysize);
|
||||
|
||||
if (yymsg)
|
||||
{
|
||||
char *yyp = yymsg;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyf))
|
||||
{
|
||||
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyf += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyf++;
|
||||
}
|
||||
}
|
||||
yyerror (]b4_lyyerror_args[yymsg);
|
||||
YYFREE (yymsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
yyMemoryExhausted (yystackp);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
yynerrs += 1;
|
||||
int yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
yyarg[yycount++] = yytokenName (yytoken);
|
||||
if (!yypact_value_is_default (yyn))
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for this
|
||||
state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = YYLAST - yyn + 1;
|
||||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||||
int yyx;
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
|
||||
&& !yytable_value_is_error (yytable[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytokenName (yyx);
|
||||
yysize1 = yysize + yytnamerr (NULL, yytokenName (yyx));
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (yycount)
|
||||
{
|
||||
#define YYCASE_(N, S) \
|
||||
case N: \
|
||||
yyformat = S; \
|
||||
break
|
||||
YYCASE_(0, YY_("syntax error"));
|
||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||
#undef YYCASE_
|
||||
}
|
||||
|
||||
yysize1 = yysize + strlen (yyformat);
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
|
||||
if (!yysize_overflow)
|
||||
yymsg = (char *) YYMALLOC (yysize);
|
||||
|
||||
if (yymsg)
|
||||
{
|
||||
char *yyp = yymsg;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyformat))
|
||||
{
|
||||
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyformat += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyformat++;
|
||||
}
|
||||
}
|
||||
yyerror (]b4_lyyerror_args[yymsg);
|
||||
YYFREE (yymsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
yyMemoryExhausted (yystackp);
|
||||
}
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
yynerrs += 1;
|
||||
}
|
||||
|
||||
/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
|
||||
@@ -2210,10 +2246,18 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
}
|
||||
YYDPRINTF ((stderr, "Reading a token: "));
|
||||
yychar = YYLEX;
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
if (yychar <= YYEOF)
|
||||
{
|
||||
yychar = yytoken = YYEOF;
|
||||
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
}
|
||||
yyj = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
if (yyis_pact_ninf (yyj))
|
||||
if (yypact_value_is_default (yyj))
|
||||
return;
|
||||
yyj += yytoken;
|
||||
if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken)
|
||||
@@ -2221,7 +2265,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0)
|
||||
return;
|
||||
}
|
||||
else if (yytable[yyj] != 0 && ! yyis_table_ninf (yytable[yyj]))
|
||||
else if (! yytable_value_is_error (yytable[yyj]))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2242,7 +2286,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
yyGLRState *yys = yystackp->yytops.yystates[0];
|
||||
yyj = yypact[yys->yylrState];
|
||||
if (! yyis_pact_ninf (yyj))
|
||||
if (! yypact_value_is_default (yyj))
|
||||
{
|
||||
yyj += YYTERROR;
|
||||
if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR
|
||||
@@ -2304,7 +2348,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
yychar = YYEMPTY;
|
||||
yylval = yyval_default;
|
||||
]b4_locations_if([
|
||||
#if YYLTYPE_IS_TRIVIAL
|
||||
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
||||
yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
|
||||
yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
|
||||
#endif
|
||||
@@ -2363,11 +2407,19 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
{
|
||||
YYDPRINTF ((stderr, "Reading a token: "));
|
||||
yychar = YYLEX;
|
||||
}
|
||||
|
||||
if (yychar <= YYEOF)
|
||||
{
|
||||
yychar = yytoken = YYEOF;
|
||||
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
||||
}
|
||||
else
|
||||
yytoken = YYTRANSLATE (yychar);
|
||||
|
||||
yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
|
||||
if (*yyconflicts != 0)
|
||||
break;
|
||||
@@ -2529,7 +2581,7 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
}
|
||||
|
||||
/* DEBUGGING ONLY */
|
||||
#ifdef YYDEBUG
|
||||
#if YYDEBUG
|
||||
static void yypstack (yyGLRStack* yystackp, size_t yyk)
|
||||
__attribute__ ((__unused__));
|
||||
static void yypdumpstack (yyGLRStack* yystackp) __attribute__ ((__unused__));
|
||||
@@ -2540,19 +2592,20 @@ yy_yypstack (yyGLRState* yys)
|
||||
if (yys->yypred)
|
||||
{
|
||||
yy_yypstack (yys->yypred);
|
||||
fprintf (stderr, " -> ");
|
||||
YYFPRINTF (stderr, " -> ");
|
||||
}
|
||||
fprintf (stderr, "%d@@%lu", yys->yylrState, (unsigned long int) yys->yyposn);
|
||||
YYFPRINTF (stderr, "%d@@%lu", yys->yylrState,
|
||||
(unsigned long int) yys->yyposn);
|
||||
}
|
||||
|
||||
static void
|
||||
yypstates (yyGLRState* yyst)
|
||||
{
|
||||
if (yyst == NULL)
|
||||
fprintf (stderr, "<null>");
|
||||
YYFPRINTF (stderr, "<null>");
|
||||
else
|
||||
yy_yypstack (yyst);
|
||||
fprintf (stderr, "\n");
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2572,46 +2625,54 @@ yypdumpstack (yyGLRStack* yystackp)
|
||||
size_t yyi;
|
||||
for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1)
|
||||
{
|
||||
fprintf (stderr, "%3lu. ", (unsigned long int) (yyp - yystackp->yyitems));
|
||||
YYFPRINTF (stderr, "%3lu. ",
|
||||
(unsigned long int) (yyp - yystackp->yyitems));
|
||||
if (*(yybool *) yyp)
|
||||
{
|
||||
fprintf (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
|
||||
yyp->yystate.yyresolved, yyp->yystate.yylrState,
|
||||
(unsigned long int) yyp->yystate.yyposn,
|
||||
(long int) YYINDEX (yyp->yystate.yypred));
|
||||
YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
|
||||
yyp->yystate.yyresolved, yyp->yystate.yylrState,
|
||||
(unsigned long int) yyp->yystate.yyposn,
|
||||
(long int) YYINDEX (yyp->yystate.yypred));
|
||||
if (! yyp->yystate.yyresolved)
|
||||
fprintf (stderr, ", firstVal: %ld",
|
||||
(long int) YYINDEX (yyp->yystate.yysemantics.yyfirstVal));
|
||||
YYFPRINTF (stderr, ", firstVal: %ld",
|
||||
(long int) YYINDEX (yyp->yystate
|
||||
.yysemantics.yyfirstVal));
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "Option. rule: %d, state: %ld, next: %ld",
|
||||
yyp->yyoption.yyrule - 1,
|
||||
(long int) YYINDEX (yyp->yyoption.yystate),
|
||||
(long int) YYINDEX (yyp->yyoption.yynext));
|
||||
YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
|
||||
yyp->yyoption.yyrule - 1,
|
||||
(long int) YYINDEX (yyp->yyoption.yystate),
|
||||
(long int) YYINDEX (yyp->yyoption.yynext));
|
||||
}
|
||||
fprintf (stderr, "\n");
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
fprintf (stderr, "Tops:");
|
||||
YYFPRINTF (stderr, "Tops:");
|
||||
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
|
||||
fprintf (stderr, "%lu: %ld; ", (unsigned long int) yyi,
|
||||
(long int) YYINDEX (yystackp->yytops.yystates[yyi]));
|
||||
fprintf (stderr, "\n");
|
||||
YYFPRINTF (stderr, "%lu: %ld; ", (unsigned long int) yyi,
|
||||
(long int) YYINDEX (yystackp->yytops.yystates[yyi]));
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
#endif
|
||||
]
|
||||
|
||||
b4_epilogue
|
||||
b4_defines_if(
|
||||
[@output @output_header_name@
|
||||
dnl
|
||||
dnl glr.cc produces its own header.
|
||||
dnl
|
||||
m4_if(b4_skeleton, ["glr.c"],
|
||||
[b4_defines_if(
|
||||
[@output(b4_spec_defines_file@)@
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
[2002, 2003, 2004, 2005, 2006])
|
||||
[2002-2011])
|
||||
|
||||
b4_shared_declarations
|
||||
|
||||
extern YYSTYPE b4_prefix[]lval;
|
||||
b4_pure_if([],
|
||||
[[extern YYSTYPE ]b4_prefix[lval;]])
|
||||
|
||||
b4_locations_if([b4_pure_if([],
|
||||
[extern YYLTYPE b4_prefix[]lloc;])
|
||||
])
|
||||
[extern YYLTYPE ]b4_prefix[lloc;])
|
||||
])
|
||||
])])
|
||||
m4_divert_pop(0)
|
||||
|
||||
+38
-44
@@ -1,22 +1,21 @@
|
||||
m4_divert(-1) -*- C -*-
|
||||
-*- C -*-
|
||||
|
||||
# C++ GLR skeleton for Bison
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# Copyright (C) 2002-2011 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# This skeleton produces a C++ class that encapsulates a C glr parser.
|
||||
@@ -52,11 +51,14 @@ m4_define([b4_pure_flag], [1])
|
||||
|
||||
# The header is mandatory.
|
||||
b4_defines_if([],
|
||||
[m4_fatal(b4_skeleton[: using %defines is mandatory])])
|
||||
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||
|
||||
m4_include(b4_pkgdatadir/[c++.m4])
|
||||
m4_include(b4_pkgdatadir/[location.cc])
|
||||
b4_percent_define_ifdef([[location_type]], [],
|
||||
[m4_include(b4_pkgdatadir/[location.cc])])
|
||||
|
||||
m4_define([b4_parser_class_name],
|
||||
[b4_percent_define_get([[parser_class_name]])])
|
||||
|
||||
# Save the parse parameters.
|
||||
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
|
||||
@@ -76,9 +78,9 @@ m4_define([b4_yy_symbol_print_generate],
|
||||
[static void],
|
||||
[[FILE *], []],
|
||||
[[int yytype], [yytype]],
|
||||
[[const b4_namespace::b4_parser_class_name::semantic_type *yyvaluep],
|
||||
[[const b4_namespace_ref::b4_parser_class_name::semantic_type *yyvaluep],
|
||||
[yyvaluep]],
|
||||
[[const b4_namespace::b4_parser_class_name::location_type *yylocationp],
|
||||
[[const b4_namespace_ref::b4_parser_class_name::location_type *yylocationp],
|
||||
[yylocationp]],
|
||||
b4_parse_param)[
|
||||
{
|
||||
@@ -94,7 +96,7 @@ m4_append([b4_post_prologue],
|
||||
|
||||
b4_c_ansi_function_decl([yyerror],
|
||||
[static void],
|
||||
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||
b4_parse_param,
|
||||
[[const char* msg], [msg]])])
|
||||
|
||||
@@ -108,7 +110,7 @@ m4_append([b4_epilogue],
|
||||
|
||||
]b4_c_ansi_function_def([yyerror],
|
||||
[static void],
|
||||
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||
b4_parse_param,
|
||||
[[const char* msg], [msg]])[
|
||||
{
|
||||
@@ -117,8 +119,7 @@ m4_append([b4_epilogue],
|
||||
}
|
||||
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
]dnl In this section, the parse param are the original parse_params.
|
||||
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
[ /// Build a parser object.
|
||||
@@ -200,7 +201,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
|
||||
#endif
|
||||
]m4_popdef([b4_parse_param])dnl
|
||||
[} // namespace ]b4_namespace[
|
||||
b4_namespace_close[
|
||||
|
||||
]])
|
||||
|
||||
@@ -208,41 +209,34 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
# Let glr.c believe that the user arguments include the parser itself.
|
||||
m4_ifset([b4_parse_param],
|
||||
[m4_pushdef([b4_parse_param],
|
||||
m4_dquote([[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]],]
|
||||
m4_dquote([[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]],]
|
||||
m4_defn([b4_parse_param])))],
|
||||
[m4_pushdef([b4_parse_param],
|
||||
[[[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]]]])
|
||||
[[[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]]]])
|
||||
])
|
||||
m4_include(b4_pkgdatadir/[glr.c])
|
||||
m4_popdef([b4_parse_param])
|
||||
|
||||
@output @output_header_name@
|
||||
m4_divert_push(0)
|
||||
@output(b4_spec_defines_file@)@
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])[
|
||||
[2002-2006, 2009-2011])[
|
||||
|
||||
/* C++ GLR parser skeleton written by Akim Demaille. */
|
||||
|
||||
#ifndef PARSER_HEADER_H
|
||||
# define PARSER_HEADER_H
|
||||
|
||||
]m4_ifdef([b4_start_header],
|
||||
[[/* Copy the %start-header blocks. */
|
||||
]b4_user_start_header])[
|
||||
]b4_percent_code_get([[requires]])[
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
]b4_percent_define_ifdef([[location_type]], [],
|
||||
[[#include "location.hh"]])[
|
||||
|
||||
/* Using locations. */
|
||||
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
class position;
|
||||
class location;
|
||||
}
|
||||
|
||||
#include "location.hh"
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG ]b4_debug_flag[
|
||||
@@ -267,8 +261,7 @@ namespace ]b4_namespace[
|
||||
while (/*CONSTCOND*/ 0)
|
||||
#endif
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
/// A Bison parser.
|
||||
class ]b4_parser_class_name[
|
||||
{
|
||||
@@ -277,8 +270,9 @@ namespace ]b4_namespace[
|
||||
#ifndef YYSTYPE
|
||||
]m4_ifdef([b4_stype],
|
||||
[ union semantic_type
|
||||
{
|
||||
b4_user_stype
|
||||
;],
|
||||
};],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[ typedef int semantic_type;]],
|
||||
[[ typedef YYSTYPE semantic_type;]])])[
|
||||
@@ -286,7 +280,8 @@ b4_user_stype
|
||||
typedef YYSTYPE semantic_type;
|
||||
#endif
|
||||
/// Symbol locations.
|
||||
typedef ]b4_location_type[ location_type;
|
||||
typedef ]b4_percent_define_get([[location_type]],
|
||||
[[location]])[ location_type;
|
||||
/// Tokens.
|
||||
struct token
|
||||
{
|
||||
@@ -361,20 +356,19 @@ b4_user_stype
|
||||
};
|
||||
|
||||
]dnl Redirections for glr.c.
|
||||
m4_ifset([b4_global_tokens_and_yystype],
|
||||
b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||
[b4_token_defines(b4_tokens)])
|
||||
[
|
||||
#ifndef YYSTYPE
|
||||
# define YYSTYPE ]b4_namespace[::]b4_parser_class_name[::semantic_type
|
||||
# define YYSTYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
|
||||
#endif
|
||||
#ifndef YYLTYPE
|
||||
# define YYLTYPE ]b4_namespace[::]b4_parser_class_name[::location_type
|
||||
# define YYLTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
|
||||
#endif
|
||||
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
]m4_ifdef([b4_end_header],
|
||||
[[/* Copy the %end-header blocks. */
|
||||
]b4_end_header])[]dnl
|
||||
]b4_percent_code_get([[provides]])[]dnl
|
||||
|
||||
[#endif /* ! defined PARSER_HEADER_H */]
|
||||
m4_divert_pop(0)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Java skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2007, 2009-2011 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-2011 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])])
|
||||
+234
-149
@@ -1,41 +1,41 @@
|
||||
m4_divert(-1)
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
m4_include(b4_pkgdatadir/[c++.m4])
|
||||
|
||||
m4_define([b4_parser_class_name],
|
||||
[b4_percent_define_get([[parser_class_name]])])
|
||||
|
||||
# The header is mandatory.
|
||||
b4_defines_if([],
|
||||
[m4_fatal(b4_skeleton[: using %defines is mandatory])])
|
||||
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||
|
||||
# Backward compatibility.
|
||||
m4_define([b4_location_constructors])
|
||||
m4_include(b4_pkgdatadir/[location.cc])
|
||||
b4_percent_define_ifdef([[location_type]], [],
|
||||
[# Backward compatibility.
|
||||
m4_define([b4_location_constructors])
|
||||
m4_include(b4_pkgdatadir/[location.cc])])
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
m4_divert(0)dnl
|
||||
m4_divert_push(0)dnl
|
||||
b4_defines_if(
|
||||
[@output @output_header_name@
|
||||
[@output(b4_spec_defines_file@)@
|
||||
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])
|
||||
[2002-2011])
|
||||
dnl FIXME: This is wrong, we want computed header guards.
|
||||
[
|
||||
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
||||
@@ -43,21 +43,13 @@ dnl FIXME: This is wrong, we want computed header guards.
|
||||
#ifndef PARSER_HEADER_H
|
||||
# define PARSER_HEADER_H
|
||||
|
||||
]m4_ifdef([b4_start_header],
|
||||
[[/* Copy the %start-header blocks. */
|
||||
]b4_user_start_header])[
|
||||
]b4_percent_code_get([[requires]])[
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include "stack.hh"
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
class position;
|
||||
class location;
|
||||
}
|
||||
|
||||
#include "location.hh"
|
||||
]b4_percent_define_ifdef([[location_type]], [],
|
||||
[[#include "location.hh"]])[
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
@@ -77,27 +69,7 @@ namespace ]b4_namespace[
|
||||
# define YYTOKEN_TABLE ]b4_token_table[
|
||||
#endif
|
||||
|
||||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||
If N is 0, then set CURRENT to the empty location which ends
|
||||
the previous symbol: RHS[0] (always defined). */
|
||||
|
||||
#ifndef YYLLOC_DEFAULT
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do { \
|
||||
if (N) \
|
||||
{ \
|
||||
(Current).begin = (Rhs)[1].begin; \
|
||||
(Current).end = (Rhs)[N].end; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).begin = (Current).end = (Rhs)[0].end; \
|
||||
} \
|
||||
} while (false)
|
||||
#endif
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
|
||||
/// A Bison parser.
|
||||
class ]b4_parser_class_name[
|
||||
@@ -107,8 +79,9 @@ namespace ]b4_namespace[
|
||||
#ifndef YYSTYPE
|
||||
]m4_ifdef([b4_stype],
|
||||
[ union semantic_type
|
||||
{
|
||||
b4_user_stype
|
||||
;],
|
||||
};],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[ typedef int semantic_type;]],
|
||||
[[ typedef YYSTYPE semantic_type;]])])[
|
||||
@@ -116,7 +89,8 @@ b4_user_stype
|
||||
typedef YYSTYPE semantic_type;
|
||||
#endif
|
||||
/// Symbol locations.
|
||||
typedef ]b4_location_type[ location_type;
|
||||
typedef ]b4_percent_define_get([[location_type]],
|
||||
[[location]])[ location_type;
|
||||
/// Tokens.
|
||||
struct token
|
||||
{
|
||||
@@ -133,6 +107,7 @@ b4_user_stype
|
||||
/// \returns 0 iff parsing succeeded.
|
||||
virtual int parse ();
|
||||
|
||||
#if YYDEBUG
|
||||
/// The current debugging stream.
|
||||
std::ostream& debug_stream () const;
|
||||
/// Set the current debugging stream.
|
||||
@@ -144,6 +119,7 @@ b4_user_stype
|
||||
debug_level_type debug_level () const;
|
||||
/// Set the current debugging level.
|
||||
void set_debug_level (debug_level_type l);
|
||||
#endif
|
||||
|
||||
private:
|
||||
/// Report a syntax error.
|
||||
@@ -154,8 +130,7 @@ b4_user_stype
|
||||
/// Generate an error message.
|
||||
/// \param state the state where the error occurred.
|
||||
/// \param tok the lookahead token.
|
||||
virtual std::string yysyntax_error_ (int yystate]dnl
|
||||
b4_error_verbose_if([, int tok])[);
|
||||
virtual std::string yysyntax_error_ (int yystate, int tok);
|
||||
|
||||
#if YYDEBUG
|
||||
/// \brief Report a symbol value on the debug stream.
|
||||
@@ -191,6 +166,14 @@ b4_error_verbose_if([, int tok])[);
|
||||
/// The location stack.
|
||||
location_stack_type yylocation_stack_;
|
||||
|
||||
/// Whether the given \c yypact_ value indicates a defaulted state.
|
||||
/// \param yyvalue the value to check
|
||||
static bool yy_pact_value_is_default_ (int yyvalue);
|
||||
|
||||
/// Whether the given \c yytable_ value indicates a syntax error.
|
||||
/// \param yyvalue the value to check
|
||||
static bool yy_table_value_is_error_ (int yyvalue);
|
||||
|
||||
/// Internal symbol numbers.
|
||||
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
||||
/* Tables. */
|
||||
@@ -198,7 +181,7 @@ b4_error_verbose_if([, int tok])[);
|
||||
static const ]b4_int_type_for([b4_pact])[ yypact_[];
|
||||
static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_;
|
||||
|
||||
/// For a state, default rule to reduce.
|
||||
/// For a state, default reduction number.
|
||||
/// Unless\a yytable_ specifies something else to do.
|
||||
/// Zero means the default is an error.
|
||||
static const ]b4_int_type_for([b4_defact])[ yydefact_[];
|
||||
@@ -227,12 +210,10 @@ b4_error_verbose_if([, int tok])[);
|
||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||
/// For a symbol, its name in clear.
|
||||
static const char* const yytname_[];
|
||||
#endif
|
||||
#endif]b4_error_verbose_if([
|
||||
|
||||
#if YYERROR_VERBOSE
|
||||
/// Convert the symbol name \a n to a form suitable for a diagnostic.
|
||||
virtual std::string yytnamerr_ (const char *n);
|
||||
#endif
|
||||
static std::string yytnamerr_ (const char *n);])[
|
||||
|
||||
#if YYDEBUG
|
||||
/// A type to store symbol numbers and -1.
|
||||
@@ -285,41 +266,41 @@ b4_error_verbose_if([, int tok])[);
|
||||
static const token_number_type yyundef_token_;
|
||||
]b4_parse_param_vars[
|
||||
};
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
]m4_ifset([b4_global_tokens_and_yystype],
|
||||
]b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||
[b4_token_defines(b4_tokens)
|
||||
|
||||
#ifndef YYSTYPE
|
||||
/* Redirection for backward compatibility. */
|
||||
# define YYSTYPE b4_namespace::b4_parser_class_name::semantic_type
|
||||
# define YYSTYPE b4_namespace_ref::b4_parser_class_name::semantic_type
|
||||
#endif
|
||||
])
|
||||
m4_ifdef([b4_end_header],
|
||||
[[/* Copy the %end-header blocks. */
|
||||
]b4_end_header])[]dnl
|
||||
b4_percent_code_get([[provides]])[]dnl
|
||||
|
||||
[#endif /* ! defined PARSER_HEADER_H */]
|
||||
])dnl
|
||||
@output @output_parser_name@
|
||||
@output(b4_parser_file_name@)@
|
||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])
|
||||
[2002-2011])
|
||||
b4_percent_code_get([[top]])[]dnl
|
||||
m4_if(b4_prefix, [yy], [],
|
||||
[
|
||||
// Take the name prefix into account.
|
||||
#define yylex b4_prefix[]lex])[
|
||||
|
||||
/* First part of user declarations. */
|
||||
]b4_pre_prologue
|
||||
]b4_user_pre_prologue
|
||||
|
||||
b4_defines_if([
|
||||
#include @output_header_name@])[
|
||||
b4_defines_if([[
|
||||
#include "@basename(]b4_spec_defines_file[@)"]])[
|
||||
|
||||
/* User implementation prologue. */
|
||||
]b4_user_post_prologue[
|
||||
]b4_user_post_prologue
|
||||
b4_percent_code_get[]dnl
|
||||
|
||||
#ifndef YY_
|
||||
# if YYENABLE_NLS
|
||||
[#ifndef YY_
|
||||
# if defined YYENABLE_NLS && YYENABLE_NLS
|
||||
# if ENABLE_NLS
|
||||
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
|
||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||
@@ -330,6 +311,26 @@ b4_defines_if([
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||
If N is 0, then set CURRENT to the empty location which ends
|
||||
the previous symbol: RHS[0] (always defined). */
|
||||
|
||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||
#ifndef YYLLOC_DEFAULT
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
if (N) \
|
||||
{ \
|
||||
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
||||
(Current).end = YYRHSLOC (Rhs, N).end; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
||||
} \
|
||||
while (false)
|
||||
#endif
|
||||
|
||||
/* Suppress unused-variable warnings by "using" E. */
|
||||
#define YYUSE(e) ((void) (e))
|
||||
|
||||
@@ -370,13 +371,15 @@ do { \
|
||||
|
||||
#endif /* !YYDEBUG */
|
||||
|
||||
#define yyerrok (yyerrstatus_ = 0)
|
||||
#define yyclearin (yychar = yyempty_)
|
||||
|
||||
#define YYACCEPT goto yyacceptlab
|
||||
#define YYABORT goto yyabortlab
|
||||
#define YYERROR goto yyerrorlab
|
||||
#define YYRECOVERING() (!!yyerrstatus_)
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
#if YYERROR_VERBOSE
|
||||
]b4_namespace_open[]b4_error_verbose_if([[
|
||||
|
||||
/* Return YYSTR after stripping away unnecessary quotes and
|
||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||
@@ -414,8 +417,7 @@ namespace ]b4_namespace[
|
||||
|
||||
return yystr;
|
||||
}
|
||||
|
||||
#endif
|
||||
]])[
|
||||
|
||||
/// Build a parser object.
|
||||
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||
@@ -516,6 +518,18 @@ namespace ]b4_namespace[
|
||||
}
|
||||
#endif
|
||||
|
||||
inline bool
|
||||
]b4_parser_class_name[::yy_pact_value_is_default_ (int yyvalue)
|
||||
{
|
||||
return yyvalue == yypact_ninf_;
|
||||
}
|
||||
|
||||
inline bool
|
||||
]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue)
|
||||
{
|
||||
return yyvalue == yytable_ninf_;
|
||||
}
|
||||
|
||||
int
|
||||
]b4_parser_class_name[::parse ()
|
||||
{
|
||||
@@ -537,7 +551,7 @@ namespace ]b4_namespace[
|
||||
/// Location of the lookahead.
|
||||
location_type yylloc;
|
||||
/// The locations where the error started and ended.
|
||||
location yyerror_range[2];
|
||||
location_type yyerror_range[3];
|
||||
|
||||
/// $$.
|
||||
semantic_type yyval;
|
||||
@@ -582,7 +596,7 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
|
||||
/* Try to take a decision without lookahead. */
|
||||
yyn = yypact_[yystate];
|
||||
if (yyn == yypact_ninf_)
|
||||
if (yy_pact_value_is_default_ (yyn))
|
||||
goto yydefault;
|
||||
|
||||
/* Read a lookahead token. */
|
||||
@@ -618,8 +632,8 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
yyn = yytable_[yyn];
|
||||
if (yyn <= 0)
|
||||
{
|
||||
if (yyn == 0 || yyn == yytable_ninf_)
|
||||
goto yyerrlab;
|
||||
if (yy_table_value_is_error_ (yyn))
|
||||
goto yyerrlab;
|
||||
yyn = -yyn;
|
||||
goto yyreduce;
|
||||
}
|
||||
@@ -674,8 +688,20 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
switch (yyn)
|
||||
{
|
||||
]b4_user_actions[
|
||||
default: break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* User semantic actions sometimes alter yychar, and that requires
|
||||
that yytoken be updated with the new translation. We take the
|
||||
approach of translating immediately before every use of yytoken.
|
||||
One alternative is translating here after every semantic action,
|
||||
but that translation would be missed if the semantic action
|
||||
invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
|
||||
yychar. In the case of YYABORT or YYACCEPT, an incorrect
|
||||
destructor might then be invoked immediately. In the case of
|
||||
YYERROR, subsequent parser actions might lead to an incorrect
|
||||
destructor call or verbose syntax error message before the
|
||||
lookahead is translated. */
|
||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
|
||||
|
||||
yypop_ (yylen);
|
||||
@@ -699,15 +725,20 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||
| yyerrlab -- here on detecting error |
|
||||
`------------------------------------*/
|
||||
yyerrlab:
|
||||
/* Make sure we have latest lookahead translation. See comments at
|
||||
user semantic actions for why this is necessary. */
|
||||
yytoken = yytranslate_ (yychar);
|
||||
|
||||
/* If not already recovering from an error, report this error. */
|
||||
if (!yyerrstatus_)
|
||||
{
|
||||
++yynerrs_;
|
||||
error (yylloc, yysyntax_error_ (yystate]dnl
|
||||
b4_error_verbose_if([, yytoken])[));
|
||||
if (yychar == yyempty_)
|
||||
yytoken = yyempty_;
|
||||
error (yylloc, yysyntax_error_ (yystate, yytoken));
|
||||
}
|
||||
|
||||
yyerror_range[0] = yylloc;
|
||||
yyerror_range[1] = yylloc;
|
||||
if (yyerrstatus_ == 3)
|
||||
{
|
||||
/* If just tried and failed to reuse lookahead token after an
|
||||
@@ -742,7 +773,7 @@ b4_error_verbose_if([, yytoken])[));
|
||||
if (false)
|
||||
goto yyerrorlab;
|
||||
|
||||
yyerror_range[0] = yylocation_stack_[yylen - 1];
|
||||
yyerror_range[1] = yylocation_stack_[yylen - 1];
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYERROR. */
|
||||
yypop_ (yylen);
|
||||
@@ -759,7 +790,7 @@ b4_error_verbose_if([, yytoken])[));
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact_[yystate];
|
||||
if (yyn != yypact_ninf_)
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
yyn += yyterror_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||
@@ -774,7 +805,7 @@ b4_error_verbose_if([, yytoken])[));
|
||||
if (yystate_stack_.height () == 1)
|
||||
YYABORT;
|
||||
|
||||
yyerror_range[0] = yylocation_stack_[0];
|
||||
yyerror_range[1] = yylocation_stack_[0];
|
||||
yydestruct_ ("Error: popping",
|
||||
yystos_[yystate],
|
||||
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
||||
@@ -783,16 +814,16 @@ b4_error_verbose_if([, yytoken])[));
|
||||
YY_STACK_PRINT ();
|
||||
}
|
||||
|
||||
yyerror_range[1] = yylloc;
|
||||
yyerror_range[2] = yylloc;
|
||||
// Using YYLLOC is tempting, but would change the location of
|
||||
// the lookahead. YYLOC is available though.
|
||||
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
|
||||
YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
|
||||
yysemantic_stack_.push (yylval);
|
||||
yylocation_stack_.push (yyloc);
|
||||
|
||||
/* Shift the error token. */
|
||||
YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
|
||||
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
||||
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
||||
|
||||
yystate = yyn;
|
||||
goto yynewstate;
|
||||
@@ -809,7 +840,13 @@ b4_error_verbose_if([, yytoken])[));
|
||||
|
||||
yyreturn:
|
||||
if (yychar != yyempty_)
|
||||
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
|
||||
{
|
||||
/* Make sure we have latest lookahead translation. See comments
|
||||
at user semantic actions for why this is necessary. */
|
||||
yytoken = yytranslate_ (yychar);
|
||||
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval,
|
||||
&yylloc);
|
||||
}
|
||||
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYABORT or YYACCEPT. */
|
||||
@@ -828,52 +865,100 @@ b4_error_verbose_if([, yytoken])[));
|
||||
|
||||
// Generate an error message.
|
||||
std::string
|
||||
]b4_parser_class_name[::yysyntax_error_ (int yystate]dnl
|
||||
b4_error_verbose_if([, int tok])[)
|
||||
{
|
||||
std::string res;
|
||||
YYUSE (yystate);
|
||||
#if YYERROR_VERBOSE
|
||||
int yyn = yypact_[yystate];
|
||||
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
||||
]b4_parser_class_name[::yysyntax_error_ (]dnl
|
||||
b4_error_verbose_if([int yystate, int yytoken],
|
||||
[int, int])[)
|
||||
{]b4_error_verbose_if([[
|
||||
std::string yyres;
|
||||
// Number of reported tokens (one for the "unexpected", one per
|
||||
// "expected").
|
||||
size_t yycount = 0;
|
||||
// Its maximum.
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
// Arguments of yyformat.
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
|
||||
/* There are many possibilities here to consider:
|
||||
- If this state is a consistent state with a default action, then
|
||||
the only way this function was invoked is if the default action
|
||||
is an error action. In that case, don't check for expected
|
||||
tokens because there are none.
|
||||
- The only way there can be no lookahead present (in yytoken) is
|
||||
if this state is a consistent state with a default action.
|
||||
Thus, detecting the absence of a lookahead is sufficient to
|
||||
determine that there is no unexpected or expected token to
|
||||
report. In that case, just report a simple "syntax error".
|
||||
- Don't assume there isn't a lookahead just because this state is
|
||||
a consistent state with a default action. There might have
|
||||
been a previous inconsistent state, consistent state with a
|
||||
non-default action, or user semantic action that manipulated
|
||||
yychar.
|
||||
- Of course, the expected token list depends on states to have
|
||||
correct lookahead information, and it depends on the parser not
|
||||
to perform extra reductions after fetching a lookahead from the
|
||||
scanner and before detecting a syntax error. Thus, state
|
||||
merging (from LALR or IELR) and default reductions corrupt the
|
||||
expected token list. However, the list is correct for
|
||||
canonical LR with one exception: it will still contain any
|
||||
token that will not be accepted due to an error action in a
|
||||
later state.
|
||||
*/
|
||||
if (yytoken != yyempty_)
|
||||
{
|
||||
/* 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. It should work like yacc.c does it.
|
||||
// That is, first build a string that looks like this:
|
||||
// "syntax error, unexpected %s or %s or %s"
|
||||
// Then, invoke YY_ on this string.
|
||||
// Finally, use the string as a format to output
|
||||
// yytname_[tok], etc.
|
||||
// Until this gets fixed, this message appears in English only.
|
||||
res = "syntax error, unexpected ";
|
||||
res += yytnamerr_ (yytname_[tok]);
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
||||
{
|
||||
res += (!count++) ? ", expecting " : " or ";
|
||||
res += yytnamerr_ (yytname_[x]);
|
||||
}
|
||||
}
|
||||
yyarg[yycount++] = yytname_[yytoken];
|
||||
int yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for
|
||||
this state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
yyarg[yycount++] = yytname_[yyx];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
res = YY_("syntax error");
|
||||
return res;
|
||||
|
||||
char const* yyformat = 0;
|
||||
switch (yycount)
|
||||
{
|
||||
#define YYCASE_(N, S) \
|
||||
case N: \
|
||||
yyformat = S; \
|
||||
break
|
||||
YYCASE_(0, YY_("syntax error"));
|
||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||
#undef YYCASE_
|
||||
}
|
||||
|
||||
// Argument number.
|
||||
size_t yyi = 0;
|
||||
for (char const* yyp = yyformat; *yyp; ++yyp)
|
||||
if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyres += yytnamerr_ (yyarg[yyi++]);
|
||||
++yyp;
|
||||
}
|
||||
else
|
||||
yyres += *yyp;
|
||||
return yyres;]], [[
|
||||
return YY_("syntax error");]])[
|
||||
}
|
||||
|
||||
|
||||
@@ -886,9 +971,9 @@ b4_error_verbose_if([, int tok])[)
|
||||
]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. */
|
||||
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||
YYTABLE doesn't specify something else to do. Zero means the
|
||||
default is an error. */
|
||||
const ]b4_int_type_for([b4_defact])[
|
||||
]b4_parser_class_name[::yydefact_[] =
|
||||
{
|
||||
@@ -911,7 +996,7 @@ b4_error_verbose_if([, int tok])[)
|
||||
|
||||
/* 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. */
|
||||
number is the opposite. If YYTABLE_NINF_, syntax error. */
|
||||
const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[;
|
||||
const ]b4_int_type_for([b4_table])[
|
||||
]b4_parser_class_name[::yytable_[] =
|
||||
@@ -1010,7 +1095,7 @@ b4_error_verbose_if([, int tok])[)
|
||||
int yynrhs = yyr2_[yyrule];
|
||||
/* Print the symbols being reduced, and their result. */
|
||||
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
|
||||
<< " (line " << yylno << "), ";
|
||||
<< " (line " << yylno << "):" << std::endl;
|
||||
/* The symbols being reduced. */
|
||||
for (int yyi = 0; yyi < yynrhs; yyi++)
|
||||
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
|
||||
@@ -1048,21 +1133,20 @@ b4_error_verbose_if([, int tok])[)
|
||||
const unsigned int ]b4_parser_class_name[::yyuser_token_number_max_ = ]b4_user_token_number_max[;
|
||||
const ]b4_parser_class_name[::token_number_type ]b4_parser_class_name[::yyundef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
} // namespace ]b4_namespace[
|
||||
]b4_namespace_close[
|
||||
|
||||
]b4_epilogue
|
||||
dnl
|
||||
@output b4_dir_prefix[]stack.hh
|
||||
@output(b4_dir_prefix[]stack.hh@)@
|
||||
b4_copyright([Stack handling for Bison parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])[
|
||||
[2002-2011])[
|
||||
|
||||
#ifndef BISON_STACK_HH
|
||||
# define BISON_STACK_HH
|
||||
|
||||
#include <deque>
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
template <class T, class S = std::deque<T> >
|
||||
class stack
|
||||
{
|
||||
@@ -1148,7 +1232,8 @@ namespace ]b4_namespace[
|
||||
const S& stack_;
|
||||
unsigned int range_;
|
||||
};
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
#endif // not BISON_STACK_HH]
|
||||
m4_divert(-1)
|
||||
#endif // not BISON_STACK_HH[]dnl
|
||||
]
|
||||
m4_divert_pop(0)
|
||||
|
||||
+932
@@ -0,0 +1,932 @@
|
||||
# Java skeleton for Bison -*- autoconf -*-
|
||||
|
||||
# Copyright (C) 2007-2011 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-2011])
|
||||
|
||||
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 (n-1).begin, rhs.locationAt (0).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 () {
|
||||
pop (1);
|
||||
}
|
||||
|
||||
public final void pop (int num) {
|
||||
// Avoid memory leaks... garbage collection is a white lie!
|
||||
if (num > 0) {
|
||||
java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);
|
||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
|
||||
}
|
||||
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;
|
||||
|
||||
// Internal return codes that are not supported for user semantic
|
||||
// actions.
|
||||
private static final int YYERRLAB = 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 (yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
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 (yy_table_value_is_error_ (yyn))
|
||||
label = YYERRLAB;
|
||||
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 = YYERRLAB;
|
||||
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 YYERRLAB:
|
||||
/* If not already recovering from an error, report this error. */
|
||||
if (yyerrstatus_ == 0)
|
||||
{
|
||||
++yynerrs_;
|
||||
if (yychar == yyempty_)
|
||||
yytoken = yyempty_;
|
||||
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
||||
}
|
||||
|
||||
]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 (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
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)
|
||||
{
|
||||
/* There are many possibilities here to consider:
|
||||
- Assume YYFAIL is not used. It's too flawed to consider.
|
||||
See
|
||||
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
|
||||
for details. YYERROR is fine as it does not invoke this
|
||||
function.
|
||||
- If this state is a consistent state with a default action,
|
||||
then the only way this function was invoked is if the
|
||||
default action is an error action. In that case, don't
|
||||
check for expected tokens because there are none.
|
||||
- The only way there can be no lookahead present (in tok) is
|
||||
if this state is a consistent state with a default action.
|
||||
Thus, detecting the absence of a lookahead is sufficient to
|
||||
determine that there is no unexpected or expected token to
|
||||
report. In that case, just report a simple "syntax error".
|
||||
- Don't assume there isn't a lookahead just because this
|
||||
state is a consistent state with a default action. There
|
||||
might have been a previous inconsistent state, consistent
|
||||
state with a non-default action, or user semantic action
|
||||
that manipulated yychar. (However, yychar is currently out
|
||||
of scope during semantic actions.)
|
||||
- Of course, the expected token list depends on states to
|
||||
have correct lookahead information, and it depends on the
|
||||
parser not to perform extra reductions after fetching a
|
||||
lookahead from the scanner and before detecting a syntax
|
||||
error. Thus, state merging (from LALR or IELR) and default
|
||||
reductions corrupt the expected token list. However, the
|
||||
list is correct for canonical LR with one exception: it
|
||||
will still contain any token that will not be accepted due
|
||||
to an error action in a later state.
|
||||
*/
|
||||
if (tok != yyempty_)
|
||||
{
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization.
|
||||
StringBuffer res =
|
||||
new StringBuffer ("syntax error, unexpected ");
|
||||
res.append (yytnamerr_ (yytname_[tok]));
|
||||
int yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative
|
||||
indexes in YYCHECK. In other words, skip the first
|
||||
-YYN actions for this state because they are default
|
||||
actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
++count;
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
{
|
||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||
res.append (yytnamerr_ (yytname_[x]));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res.toString ();
|
||||
}
|
||||
}
|
||||
|
||||
return "syntax error";
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the given <code>yypact_</code> value indicates a defaulted state.
|
||||
* @@param yyvalue the value to check
|
||||
*/
|
||||
private static boolean yy_pact_value_is_default_ (int yyvalue)
|
||||
{
|
||||
return yyvalue == yypact_ninf_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the given <code>yytable_</code> value indicates a syntax error.
|
||||
* @@param yyvalue the value to check
|
||||
*/
|
||||
private static boolean yy_table_value_is_error_ (int yyvalue)
|
||||
{
|
||||
return yyvalue == yytable_ninf_;
|
||||
}
|
||||
|
||||
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
||||
STATE-NUM. */
|
||||
private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[;
|
||||
private static final ]b4_int_type_for([b4_pact])[ yypact_[] =
|
||||
{
|
||||
]b4_pact[
|
||||
};
|
||||
|
||||
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||
YYTABLE doesn't specify something else to do. Zero means the
|
||||
default is an error. */
|
||||
private static final ]b4_int_type_for([b4_defact])[ yydefact_[] =
|
||||
{
|
||||
]b4_defact[
|
||||
};
|
||||
|
||||
/* YYPGOTO[NTERM-NUM]. */
|
||||
private static final ]b4_int_type_for([b4_pgoto])[ yypgoto_[] =
|
||||
{
|
||||
]b4_pgoto[
|
||||
};
|
||||
|
||||
/* YYDEFGOTO[NTERM-NUM]. */
|
||||
private static final ]b4_int_type_for([b4_defgoto])[
|
||||
yydefgoto_[] =
|
||||
{
|
||||
]b4_defgoto[
|
||||
};
|
||||
|
||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||
positive, shift that token. If negative, reduce the rule which
|
||||
number is the opposite. If YYTABLE_NINF_, syntax error. */
|
||||
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
|
||||
private static final ]b4_int_type_for([b4_table])[
|
||||
yytable_[] =
|
||||
{
|
||||
]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
|
||||
+28
-33
@@ -1,34 +1,30 @@
|
||||
m4_divert(-1)
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
m4_divert(0)dnl
|
||||
@output b4_dir_prefix[]position.hh
|
||||
m4_divert_push(0)dnl
|
||||
@output(b4_dir_prefix[]position.hh@)@
|
||||
b4_copyright([Positions for Bison parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])[
|
||||
[2002-2007, 2009-2011])[
|
||||
|
||||
/**
|
||||
** \file position.hh
|
||||
** Define the ]b4_namespace[::position class.
|
||||
** Define the ]b4_namespace_ref[::position class.
|
||||
*/
|
||||
|
||||
#ifndef BISON_POSITION_HH
|
||||
@@ -38,8 +34,7 @@ b4_copyright([Positions for Bison parsers in C++],
|
||||
# include <string>
|
||||
# include <algorithm>
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
/// Abstract a position.
|
||||
class position
|
||||
{
|
||||
@@ -53,7 +48,7 @@ namespace ]b4_namespace[
|
||||
|
||||
])[
|
||||
/// Initialization.
|
||||
inline void initialize (]b4_filename_type[* fn)
|
||||
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||
{
|
||||
filename = fn;
|
||||
line = ]b4_location_initial_line[;
|
||||
@@ -79,7 +74,7 @@ namespace ]b4_namespace[
|
||||
|
||||
public:
|
||||
/// File name to which this position refers.
|
||||
]b4_filename_type[* filename;
|
||||
]b4_percent_define_get([[filename_type]])[* filename;
|
||||
/// Current line number.
|
||||
unsigned int line;
|
||||
/// Current column number.
|
||||
@@ -115,15 +110,16 @@ namespace ]b4_namespace[
|
||||
{
|
||||
return begin + -width;
|
||||
}
|
||||
]m4_if(b4_define_location_comparison, [1], [[
|
||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||
/// Compare two position objects.
|
||||
inline bool
|
||||
operator== (const position& pos1, const position& pos2)
|
||||
{
|
||||
return
|
||||
(pos1.filename == pos2.filename
|
||||
|| pos1.filename && pos2.filename && *pos1.filename == *pos2.filename)
|
||||
&& pos1.line == pos2.line && pos1.column == pos2.column;
|
||||
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.
|
||||
@@ -145,15 +141,15 @@ namespace ]b4_namespace[
|
||||
return ostr << pos.line << '.' << pos.column;
|
||||
}
|
||||
|
||||
}
|
||||
]b4_namespace_close[
|
||||
#endif // not BISON_POSITION_HH]
|
||||
@output b4_dir_prefix[]location.hh
|
||||
@output(b4_dir_prefix[]location.hh@)@
|
||||
b4_copyright([Locations for Bison parsers in C++],
|
||||
[2002, 2003, 2004, 2005, 2006])[
|
||||
[2002-2007, 2009-2011])[
|
||||
|
||||
/**
|
||||
** \file location.hh
|
||||
** Define the ]b4_namespace[::location class.
|
||||
** Define the ]b4_namespace_ref[::location class.
|
||||
*/
|
||||
|
||||
#ifndef BISON_LOCATION_HH
|
||||
@@ -163,8 +159,7 @@ b4_copyright([Locations for Bison parsers in C++],
|
||||
# include <string>
|
||||
# include "position.hh"
|
||||
|
||||
namespace ]b4_namespace[
|
||||
{
|
||||
]b4_namespace_open[
|
||||
|
||||
/// Abstract a location.
|
||||
class location
|
||||
@@ -179,7 +174,7 @@ namespace ]b4_namespace[
|
||||
|
||||
])[
|
||||
/// Initialization.
|
||||
inline void initialize (]b4_filename_type[* fn)
|
||||
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||
{
|
||||
begin.initialize (fn);
|
||||
end = begin;
|
||||
@@ -237,7 +232,7 @@ namespace ]b4_namespace[
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
]m4_if(b4_define_location_comparison, [1], [[
|
||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||
/// Compare two location objects.
|
||||
inline bool
|
||||
operator== (const location& loc1, const location& loc2)
|
||||
@@ -273,8 +268,8 @@ namespace ]b4_namespace[
|
||||
return ostr;
|
||||
}
|
||||
|
||||
}
|
||||
]b4_namespace_close[
|
||||
|
||||
#endif // not BISON_LOCATION_HH]
|
||||
m4_divert(-1)
|
||||
m4_divert_pop(0)
|
||||
m4_changecom([#])
|
||||
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../submodules/autoconf/lib/m4sugar/foreach.m4
|
||||
File diff suppressed because it is too large
Load Diff
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../submodules/autoconf/lib/m4sugar/m4sugar.m4
|
||||
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
bison.xsl - common templates for Bison XSLT.
|
||||
|
||||
Copyright (C) 2007-2011 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,222 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||
|
||||
Copyright (C) 2007-2011 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:text>// Generated by GNU Bison </xsl:text>
|
||||
<xsl:value-of select="@version"/>
|
||||
<xsl:text>. </xsl:text>
|
||||
<xsl:text>// Report bugs to <</xsl:text>
|
||||
<xsl:value-of select="@bug-report"/>
|
||||
<xsl:text>>. </xsl:text>
|
||||
<xsl:text>// Home page: <</xsl:text>
|
||||
<xsl:value-of select="@url"/>
|
||||
<xsl:text>>. </xsl:text>
|
||||
<xsl:apply-templates select="automaton">
|
||||
<xsl:with-param name="filename" select="filename"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton">
|
||||
<xsl:param name="filename"/>
|
||||
<xsl:text>digraph "</xsl:text>
|
||||
<xsl:call-template name="escape">
|
||||
<xsl:with-param name="subject" select="$filename"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>" { </xsl:text>
|
||||
<xsl: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-2011 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-2011 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>
|
||||
+945
-347
File diff suppressed because it is too large
Load Diff
+13
-14
@@ -1,21 +1,20 @@
|
||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||
# Requires GNU sed
|
||||
|
||||
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2, or (at your option)
|
||||
## any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software Foundation,
|
||||
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
top_srcdir = ..
|
||||
srcdir = .
|
||||
|
||||
+19
-18
@@ -1,11 +1,11 @@
|
||||
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -13,8 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
1.: DJGPP specific changes.
|
||||
@@ -46,8 +45,13 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
This is done by forking and using pipes for the IPC. MSDOS does not
|
||||
support this functionality so this has been reproduced in the usual
|
||||
way by redirecting stdin and stdout of bison and m4 to temporary files
|
||||
and processing these files in sequence. All the changes to the sources
|
||||
are documented in the djgpp/diffs file.
|
||||
and processing these files in sequence.
|
||||
It should be noticed that due to the great amount of file names that do
|
||||
not cleanly map to 8.3 file names, you will need an OS with LFN support
|
||||
to configure and compile the sources. On Win98 this implies that the
|
||||
generation of numeric tails for 8.3 file name aliases must be enabled
|
||||
or the compilation will fail.
|
||||
|
||||
|
||||
Please **read** the docs.
|
||||
|
||||
@@ -113,22 +117,19 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
3.3.: To build the binaries you will need the following binary packages:
|
||||
djdev203.zip (or a later but NOT a prior version)
|
||||
bsh204b.zip (or a later but NOT a prior version)
|
||||
gcc410b.zip, gpp410b.zip, bnu2161b.zip, mak3791b.zip,
|
||||
fil40b.zip, shl20jb.zip, txt20b.zip,
|
||||
txi48b.zip, grep24b.zip, sed415b.zip,
|
||||
m4-144b.zip.
|
||||
gccNNNb.zip, gppNNN.zip, bnuNNNb.zip, makNNNb.zip, filNNNb.zip,
|
||||
perlNNNb.zip, shlNNNb.zip, txtNNNb.zip, txiNNNb.zip, grepNNNb.zip,
|
||||
sedNNNb.zip and m4NNN.zip
|
||||
|
||||
If you want to run the check you will need also:
|
||||
dif287b.zip
|
||||
difNNNb.zip
|
||||
|
||||
All this packages can be found in the v2gnu directory of any
|
||||
NNN represents the latest version number of the binary packages. All
|
||||
this packages can be found in the /v2gnu directory of any
|
||||
ftp.delorie.com mirror.
|
||||
You will need bsh204b.zip or later and *NOT* a prior version or
|
||||
the build will fail. The same applies to djdev203.zip. Please note
|
||||
that Bison requires m4-144b.zip or later to work properly. All the
|
||||
other packages are the ones I have used to build the binaries
|
||||
from this source. Previuos versions of this packages may do the
|
||||
job as well but I have not tested this.
|
||||
that Bison requires m4-144b.zip or later to work properly.
|
||||
|
||||
3.4.: If for some reason you want to reconfigure the package cd into the top
|
||||
srcdir (bison-@TREE_VERSION@) and run the following commands:
|
||||
|
||||
+101
-34
@@ -4,21 +4,20 @@ Rem Configure Bison for DJGPP.
|
||||
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||
|
||||
Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
|
||||
Rem This program is free software; you can redistribute it and/or modify
|
||||
Rem This program is free software: you can redistribute it and/or modify
|
||||
Rem it under the terms of the GNU General Public License as published by
|
||||
Rem the Free Software Foundation; either version 2, or (at your option)
|
||||
Rem any later version.
|
||||
|
||||
Rem the Free Software Foundation, either version 3 of the License, or
|
||||
Rem (at your option) any later version.
|
||||
Rem
|
||||
Rem This program is distributed in the hope that it will be useful,
|
||||
Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
Rem GNU General Public License for more details.
|
||||
|
||||
Rem
|
||||
Rem You should have received a copy of the GNU General Public License
|
||||
Rem along with this program; if not, write to the Free Software Foundation,
|
||||
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
Rem along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
echo Configuring Bison for DJGPP v2.x...
|
||||
|
||||
@@ -143,17 +142,17 @@ shift
|
||||
if not "%1" == "" goto ArgLoop
|
||||
|
||||
Rem Create an arguments file for the configure script.
|
||||
echo --srcdir=%XSRC% > arguments
|
||||
if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> arguments
|
||||
if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> arguments
|
||||
if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments
|
||||
if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> arguments
|
||||
if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> arguments
|
||||
if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> arguments
|
||||
if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> arguments
|
||||
if "%HTML%" == "enabled" echo --enable-html >> arguments
|
||||
if "%HTML%" == "disabled" echo --disable-html >> arguments
|
||||
if not "%ARGS%" == "" echo %ARGS% >> arguments
|
||||
echo --srcdir=%XSRC% > args
|
||||
if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> args
|
||||
if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> args
|
||||
if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> args
|
||||
if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> args
|
||||
if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> args
|
||||
if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> args
|
||||
if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> args
|
||||
if "%HTML%" == "enabled" echo --enable-html >> args
|
||||
if "%HTML%" == "disabled" echo --disable-html >> args
|
||||
if not "%ARGS%" == "" echo %ARGS% >> args
|
||||
set ARGS=
|
||||
set CACHING=
|
||||
set DEPENDENCY_TRACKING=
|
||||
@@ -164,22 +163,26 @@ set HTML=
|
||||
if "%XSRC%" == "." goto InPlace
|
||||
|
||||
:NotInPlace
|
||||
redir -e /dev/null update %XSRC%/configure.orig ./configure
|
||||
redir -e /dev/null update %XSRC%/configure.org ./configure
|
||||
test -f ./configure
|
||||
if errorlevel 1 update %XSRC%/configure ./configure
|
||||
|
||||
:InPlace
|
||||
Rem Update configuration files
|
||||
echo Updating configuration scripts...
|
||||
test -f ./configure.orig
|
||||
if errorlevel 1 update configure configure.orig
|
||||
sed -f %XSRC%/djgpp/config.sed configure.orig > configure
|
||||
test -f ./configure.org
|
||||
if errorlevel 1 update configure configure.org
|
||||
sed -f %XSRC%/djgpp/config.sed configure.org > configure
|
||||
if errorlevel 1 goto SedError
|
||||
|
||||
Rem Make sure they have a config.site file
|
||||
set CONFIG_SITE=%XSRC%/djgpp/config.site
|
||||
if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
|
||||
|
||||
Rem inttypes_.h and inttypes.h map to the same 8.3 alias.
|
||||
test -f %XSRC%/lib/inttypes_.h
|
||||
if not errorlevel 1 mv -f %XSRC%/lib/inttypes_.h %XSRC%/lib/_inttypes.h
|
||||
|
||||
Rem Make sure crucial file names are not munged by unpacking
|
||||
test -f %XSRC%/po/Makefile.in.in
|
||||
if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in
|
||||
@@ -205,6 +208,51 @@ test -f %XSRC%/data/c++.m4
|
||||
if not errorlevel 1 mv -f %XSRC%/data/c++.m4 %XSRC%/data/cxx.m4
|
||||
test -f %XSRC%/data/cxx.m4
|
||||
if errorlevel 1 mv -f %XSRC%/data/cpp.m4 %XSRC%/data/cxx.m4
|
||||
test -f %XSRC%/data/c++-skel.m4
|
||||
if not errorlevel 1 mv -f %XSRC%/data/c++-skel.m4 %XSRC%/data/cxx-skel.m4
|
||||
test -f %XSRC%/data/cxx-skel.m4
|
||||
if errorlevel 1 mv -f %XSRC%/data/cpp-skel.m4 %XSRC%/data/cxx-skel.m4
|
||||
test -f %XSRC%/build-aux/javacomp.sh.in
|
||||
if not errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh.in %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javacomp.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javacomp.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.shin %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javacomp.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh_in %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javacomp.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javacomp.sh.in %XSRC%/build-aux/javacomp.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh.in
|
||||
if not errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh.in %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.shin %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javaexec.sh_in %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/build-aux/javaexec.sh-in
|
||||
if errorlevel 1 mv -f %XSRC%/build-aux/javaexec_sh.in %XSRC%/build-aux/javaexec.sh-in
|
||||
test -f %XSRC%/doc/yacc.1.in
|
||||
if not errorlevel 1 mv -f %XSRC%/doc/yacc.1.in %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/doc/yacc.1-in
|
||||
if errorlevel 1 mv -f %XSRC%/doc/yacc.1 %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/doc/yacc.1-in
|
||||
if errorlevel 1 mv -f %XSRC%/doc/yacc.1in %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/doc/yacc.1-in
|
||||
if errorlevel 1 mv -f %XSRC%/doc/yacc.1_in %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/doc/yacc.1-in
|
||||
if errorlevel 1 mv -f %XSRC%/doc/yacc_1.in %XSRC%/doc/yacc.1-in
|
||||
test -f %XSRC%/etc/bench.pl.in
|
||||
if not errorlevel 1 mv -f %XSRC%/etc/bench.pl.in %XSRC%/etc/bench.pl-in
|
||||
test -f %XSRC%/etc/bench.pl-in
|
||||
if errorlevel 1 mv -f %XSRC%/etc/bench.pl %XSRC%/etc/bench.pl-in
|
||||
test -f %XSRC%/etc/bench.pl-in
|
||||
if errorlevel 1 mv -f %XSRC%/etc/bench.plin %XSRC%/etc/bench.pl-in
|
||||
test -f %XSRC%/etc/bench.pl-in
|
||||
if errorlevel 1 mv -f %XSRC%/etc/bench.pl_in %XSRC%/etc/bench.pl-in
|
||||
test -f %XSRC%/etc/bench.pl-in
|
||||
if errorlevel 1 mv -f %XSRC%/etc/bench_pl.in %XSRC%/etc/bench.pl-in
|
||||
|
||||
:scan_gram_c_Test
|
||||
test -f %XSRC%/src/c-scan-gram.c
|
||||
if not errorlevel 1 goto scan_skel_c_Test
|
||||
@@ -222,25 +270,36 @@ sed "s/c++\.m4/cxx.m4/" %XSRC%/data/lalr1.cc > lalr1.cc
|
||||
if errorlevel 1 goto lalr1_ccFileError
|
||||
mv ./lalr1.cc %XSRC%/data/lalr1.cc
|
||||
sed "s/c++\.m4/cxx.m4/" %XSRC%/data/location.cc > location.cc
|
||||
if errorlevel 1 goto location.ccFileError
|
||||
if errorlevel 1 goto location_ccFileError
|
||||
mv ./location.cc %XSRC%/data/location.cc
|
||||
sed "s/c++\.m4/cxx.m4/" %XSRC%/data/glr.cc > glr.cc
|
||||
if errorlevel 1 goto glr.ccFileError
|
||||
if errorlevel 1 goto glr_ccFileError
|
||||
mv ./glr.cc %XSRC%/data/glr.cc
|
||||
|
||||
Rem Fix src/getargs.c to reflect the renaming of c++-skel.m4
|
||||
sed "s/c++-skel\.m4/cxx-skel.m4/" %XSRC%/src/getargs.c > getargs.c
|
||||
if errorlevel 1 goto getargs_cFileError
|
||||
mv ./getargs.c %XSRC%/src/getargs.c
|
||||
|
||||
Rem Define DJGPP specific defs in config.hin
|
||||
echo Editing config.hin...
|
||||
test -f %XSRC%/config_h.orig
|
||||
if errorlevel 1 update %XSRC%/config.hin %XSRC%/config_h.orig
|
||||
sed -f %XSRC%/djgpp/config_h.sed %XSRC%/config_h.orig > config.hin
|
||||
test -f %XSRC%/lib/config_h.org
|
||||
if errorlevel 1 update %XSRC%/lib/config.hin %XSRC%/lib/config_h.org
|
||||
sed -f %XSRC%/djgpp/config_h.sed %XSRC%/lib/config_h.org > config.hin
|
||||
if errorlevel 1 goto SedError2
|
||||
mv -f config.hin %XSRC%/config.hin
|
||||
mv -f config.hin %XSRC%/lib/config.hin
|
||||
|
||||
|
||||
Rem Fixing ilicit testsuite file name.
|
||||
test -f %XSRC%/tests/c++.at
|
||||
if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at
|
||||
|
||||
test -f %XSRC%/tests/testsuite.org
|
||||
if errorlevel 1 update %XSRC%/tests/testsuite %XSRC%/tests/testsuite.org
|
||||
sed -f %XSRC%/djgpp/testsuite.sed %XSRC%/tests/testsuite.org > testsuite.tmp
|
||||
if errorlevel 1 goto SedError3
|
||||
mv -f ./testsuite.tmp %XSRC%/tests/testsuite
|
||||
|
||||
Rem Fixing ilicit calc++ file names in the calc++ directory.
|
||||
test -d %XSRC%/examples/calc++
|
||||
if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx
|
||||
@@ -413,20 +472,20 @@ redir -e /dev/null rm %XSRC%/po/stamp-cat-id
|
||||
Rem Update the arguments file for the configure script.
|
||||
Rem We prefer without-included-gettext because libintl.a from gettext package
|
||||
Rem is the only one that is garanteed to have been ported to DJGPP.
|
||||
echo --enable-nls --without-included-gettext >> arguments
|
||||
echo --enable-nls --without-included-gettext >> args
|
||||
goto ConfigurePackage
|
||||
|
||||
:MissingNLSTools
|
||||
echo Needed libs/tools for NLS not found. Configuring without NLS.
|
||||
:WithoutNLS
|
||||
Rem Update the arguments file for the configure script.
|
||||
echo --disable-nls >> arguments
|
||||
echo --disable-nls >> args
|
||||
|
||||
:ConfigurePackage
|
||||
echo Running the ./configure script...
|
||||
sh ./configure @arguments
|
||||
sh ./configure @args
|
||||
if errorlevel 1 goto CfgError
|
||||
rm arguments
|
||||
rm args
|
||||
echo Done.
|
||||
goto End
|
||||
|
||||
@@ -438,6 +497,10 @@ goto End
|
||||
echo ./data/glr.cc file editing failed!
|
||||
goto End
|
||||
|
||||
:getargs_cFileError
|
||||
echo ./src/getargs.c file editing failed!
|
||||
goto End
|
||||
|
||||
:location_ccFileError
|
||||
echo ./data/location.cc file editing failed!
|
||||
goto End
|
||||
@@ -455,7 +518,11 @@ echo ./configure script editing failed!
|
||||
goto End
|
||||
|
||||
:SedError2
|
||||
echo ./config.hin editing failed!
|
||||
echo ./lib/config.hin editing failed!
|
||||
goto End
|
||||
|
||||
:SedError3
|
||||
echo ./tests/testsuite editing failed!
|
||||
goto End
|
||||
|
||||
:CfgError
|
||||
|
||||
+102
-76
@@ -1,77 +1,96 @@
|
||||
# DJGPP specific configuration file.
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the configure script generated by autoconf 2.57.
|
||||
# of the configure script generated by autoconf 2.62.
|
||||
|
||||
# Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# Additional editing of Makefiles
|
||||
/(echo[ ]*':t/ a\
|
||||
/^eval sed.*ac_file_inputs.*tmp\/out \\$/ {
|
||||
:loop
|
||||
n
|
||||
/^$/!b loop
|
||||
a\
|
||||
cat > "$tmp/subs-djgpp.sed" << eof_djgpp\
|
||||
# DJGPP specific Makefile changes.\
|
||||
/^aliaspath * *=/s,:,";",g;t t\
|
||||
/TEXINPUTS=/s,:,";",g;t t\
|
||||
/PATH=/s,:,";",g;t t\
|
||||
s,\\.deps,_deps,g;t t\
|
||||
s,\\.new\\.,_new.,g;t t\
|
||||
s,\\.old\\.,_old.,g;t t\
|
||||
s,c++\\.at,cxx.at,g;t t\
|
||||
s,c++\\.m4,cxx.m4,g;t t\
|
||||
s,calc++,calcxx,g;t t\
|
||||
s,scan-gram-c,c-scan-gram,g;t t\
|
||||
s,scan-skel-c,c-scan-skel,g;t t\
|
||||
s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
|
||||
s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
|
||||
s,(MAKEINFOFLAGS),& --no-split,\
|
||||
/^install-info-am:/,/^$/ {\
|
||||
/@list=/ s,\\\$(INFO_DEPS),& bison.i,\
|
||||
/@for *file/ s,\\\$(INFO_DEPS),& bison.i,\
|
||||
s,file-\\[0-9\\]\\[0-9\\],& \\$\\$file[0-9] \\$\\$file[0-9][0-9],\
|
||||
}\
|
||||
/^\\.y\\.c:/,/^$/ {\
|
||||
/\\\$(YACCCOMPILE)/ {\
|
||||
a\\\
|
||||
-@test -f y.tab.c && mv -f y.tab.c y_tab.c\\\
|
||||
s,\\.deps,_deps,g\
|
||||
s,\\.libs,_libs,g\
|
||||
s,\\.new\\.,_new.,g\
|
||||
s,\\.old\\.,_old.,g\
|
||||
s,\\.tab\\.,_tab.,g\
|
||||
s,c++\\.at,cxx.at,g\
|
||||
s,c++\\.m4,cxx.m4,g\
|
||||
s,c++-skel\\.m4,cxx-skel.m4,g\
|
||||
s,calc++,calcxx,g\
|
||||
s,scan-gram-c,c-scan-gram,g\
|
||||
s,scan-skel-c,c-scan-skel,g\
|
||||
s,inttypes_,_inttypes,g\
|
||||
s,javacomp\\.sh\\.in,javacomp.sh-in,g\
|
||||
s,javaexec\\.sh\\.in,javaexec.sh-in,g\
|
||||
s,yacc\\.1\\.in,yacc.1-in,g\
|
||||
s,bench\\.pl\\.in,bench.pl-in,g\
|
||||
s,Makefile\\.am\\.in,Makefile.am-in,g\
|
||||
s,Makefile\\.in\\.in,Makefile.in-in,g\
|
||||
/^\\.y\\.c:/,/^$/ {\
|
||||
/\\\$(YACCCOMPILE)/ {\
|
||||
a\\\\\
|
||||
-@test -f y.tab.c && mv -f y.tab.c y_tab.c\\\\\
|
||||
-@test -f y.tab.h && mv -f y.tab.h y_tab.h\
|
||||
}\
|
||||
}\
|
||||
/^libbison.a:/ i\\\
|
||||
\\$(top_srcdir)/djgpp/subpipe.c: \\$(top_srcdir)/djgpp/subpipe.h\\\
|
||||
subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\
|
||||
}\
|
||||
/^libbison.a:/ i\\\\\
|
||||
\\$(top_srcdir)/djgpp/subpipe.c: \\$(top_srcdir)/djgpp/subpipe.h\\\\\
|
||||
subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\\\
|
||||
\\$(COMPILE) -c \\$<\
|
||||
/^yacc:/ i\\\
|
||||
yacc.bat:\\\
|
||||
/^yacc:/ i\\\\\
|
||||
yacc.bat:\\\\\
|
||||
echo "bison\\$(EXEEXT) -y %1 %2 %3 %4 %5 %6 %7 %8 %9" >\\$@\
|
||||
/^bin_SCRIPTS =/s/$/ yacc.bat/\
|
||||
/^MOSTLYCLEANFILES = yacc/s/$/ yacc.bat/
|
||||
|
||||
/^MOSTLYCLEANFILES = yacc/s/$/ yacc.bat/\
|
||||
/cross-options.texi:/,/^$/ s|bison|&.exe|g\
|
||||
/^\\.x\\.1:/,/^$/ s|\\$program|&.exe|g\
|
||||
eof_djgpp\
|
||||
sed -f "\$tmp/subs-djgpp.sed" \$tmp/out > \$tmp/out.djgpp\
|
||||
mv -f \$tmp/out.djgpp \$tmp/out
|
||||
}
|
||||
|
||||
# Makefile.in.in is renamed to Makefile.in-in.
|
||||
/ac_config_files=/,/_ACEOF/ {
|
||||
s|po/Makefile\.in|&:po/Makefile.in-in|
|
||||
/ac_config_files=/ {
|
||||
/runtime-po/!s|po/Makefile\.in|&:po/Makefile.in-in|
|
||||
s|runtime-po/Makefile\.in|&:runtime-po/Makefile.in-in|
|
||||
s|javacomp\.sh\.in|javacomp.sh-in|
|
||||
s|javaexec\.sh\.in|javaexec.sh-in|
|
||||
s|doc/yacc\.1|&:doc/yacc.1-in|
|
||||
s|etc/bench.pl|&:etc/bench.pl-in|
|
||||
}
|
||||
|
||||
/CONFIG_FILES=/ {
|
||||
/runtime-po/!s|po/Makefile\.in|&:po/Makefile.in-in|2
|
||||
s|runtime-po/Makefile\.in|&:runtime-po/Makefile.in-in|2
|
||||
s|javacomp\.sh\.in|javacomp.sh-in|
|
||||
s|javaexec\.sh\.in|javaexec.sh-in|
|
||||
s|doc/yacc\.1|&:doc/yacc.1-in|2
|
||||
s|etc/bench\.pl|&:etc/bench.pl-in|2
|
||||
}
|
||||
/CONFIG_FILES=/ s|po/Makefile\.in|&:po/Makefile.in-in|2
|
||||
|
||||
# We always use _deps and _libs instead of .deps and .libs, because
|
||||
# the latter is an invalid name on 8+3 MS-DOS file system. This makes
|
||||
# the generated Makefiles good for every DJGPP installation, not only
|
||||
# the one where the package was configured (which could happen to be
|
||||
# a Windows box, where leading dots in file names are allowed).
|
||||
s,\.deps,_deps,g
|
||||
s,\.libs,_libs,g
|
||||
/^rmdir[ ]*\.tst/ i\
|
||||
am__leading_dot=_
|
||||
|
||||
@@ -91,18 +110,6 @@ am__leading_dot=_
|
||||
# DOS-style absolute file names should be supported as well
|
||||
/\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*,
|
||||
|
||||
# Prevent the spliting of subs.sed.
|
||||
# The sed script: subs.sed is split into 48 lines long files.
|
||||
# This will produce sed scripts called subs-$ac_sed_frag.sed, where
|
||||
# $ac_sed_frag is some unique number. This will not work if the splited
|
||||
# sed script contains a multiple line sed command at line #48. In this
|
||||
# case the first part of the multiple line sed command will be written
|
||||
# at the end of one particular subs-$ac_sed_frag.sed and the rest of the
|
||||
# sed command will be written at the begining of the next subs-$ac_sed_frag.sed
|
||||
# making both sed script useless.
|
||||
# This matches the configure script produced by Autoconf 2.57
|
||||
/ac_max_sed_lines=[0-9]/ s,=.*$,=`sed -n "$=" $tmp/subs.sed`,
|
||||
|
||||
# The following two items are changes needed for configuring
|
||||
# and compiling across partitions.
|
||||
# 1) The given srcdir value is always translated from the
|
||||
@@ -120,32 +127,30 @@ am__leading_dot=_
|
||||
# which the package has not been configured for.
|
||||
/MISSING=/,/^$/ {
|
||||
/^fi$/ a\
|
||||
am_missing_run=`echo "$am_missing_run" | sed 's%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%'`
|
||||
am_missing_run=`echo "$am_missing_run" | sed 's%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%'`
|
||||
}
|
||||
/^install_sh=/a\
|
||||
install_sh=`echo "$install_sh" | sed 's%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%'`
|
||||
install_sh=`echo "$install_sh" | sed 's%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%'`
|
||||
|
||||
# This will only work if the assumption that the
|
||||
# testsuite is ran from the following path:
|
||||
# ${top_srcdir}/tests/testsuite.dir
|
||||
# holds. The explicit names are of no importance.
|
||||
# ../../. == ${top_srcdir}
|
||||
/\.)[ ]*ac_abs_builddir=/,/^esac$/ {
|
||||
/^esac$/ a\
|
||||
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
|
||||
}
|
||||
/\.)[ ]*ac_abs_top_builddir=/,/^esac$/ {
|
||||
/^esac$/ a\
|
||||
ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
|
||||
}
|
||||
/\.)[ ]*ac_abs_srcdir=/,/^esac$/ {
|
||||
/^esac$/ a\
|
||||
ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
|
||||
}
|
||||
/\.)[ ]*ac_abs_top_srcdir=/,/^esac$/ {
|
||||
/^esac$/ a\
|
||||
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
|
||||
}
|
||||
#/^esac$/,/^ac_abs_srcdir=/ {
|
||||
/^ac_abs_srcdir=/ i\
|
||||
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"`\
|
||||
ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"`\
|
||||
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"`
|
||||
#ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"`
|
||||
/^ac_abs_srcdir=/ a\
|
||||
for dj_dir in $ac_abs_builddir $ac_abs_top_builddir $ac_abs_top_srcdir $ac_abs_srcdir\
|
||||
do\
|
||||
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%//%/%g"`\
|
||||
ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%//%/%g"`\
|
||||
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%//%/%g"`\
|
||||
ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%//%/%g"`\
|
||||
done
|
||||
|
||||
# Add DJGPP version information.
|
||||
/^#define VERSION/ s/\$VERSION/& (DJGPP port (r1))/
|
||||
@@ -160,5 +165,26 @@ ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\
|
||||
ac_djgpp_path=`echo "$DJDIR" | sed 's%\\\\\\%/%g' | tr $as_cr_LETTERS $as_cr_letters`\
|
||||
ac_cv_flibs=`echo "$ac_cv_flibs" | sed "s%-L$ac_djgpp_path%-L/dev/env/DJDIR%g"`
|
||||
|
||||
# Autoconf generated configure scripts write absolute
|
||||
# paths of certain header files into Makefiles making
|
||||
# them useless for DJGPP installations for which the
|
||||
# package has not been configured for.
|
||||
/^.*echo "\$as_me:\$LINENO: result: \$gl_cv_absolute_.*$/ {
|
||||
h
|
||||
s,^.*\(gl_cv_absolute_\)\([a-z0-9_]*\)\(_h\).*$,\1\2\3=`echo $\1\2\3 | sed "s%[^:]:.*/include/%/dev/env/DJDIR/include/%"`,
|
||||
G
|
||||
}
|
||||
/^.*echo "\$as_me:\$LINENO: result: \$gl_cv_full_.*$/ {
|
||||
h
|
||||
s,^.*\(gl_cv_full_\)\([a-z0-9_]*\)\(_h\).*$,\1\2\3=`echo $\1\2\3 | sed "s%[^:]:.*/include/%/dev/env/DJDIR/include/%"`,
|
||||
G
|
||||
}
|
||||
|
||||
# The following is not a valid DOS file name
|
||||
s/calc++/calcxx/g
|
||||
|
||||
# The CR test for awk does not work for DJGPP.
|
||||
/^ac_cs_awk_cr=/,/^$/ {
|
||||
/^fi$/ a\
|
||||
ac_cs_awk_cr=$ac_cr
|
||||
}
|
||||
|
||||
+10
-8
@@ -3,21 +3,20 @@
|
||||
# This is the config.site file for configuring GNU packages
|
||||
# which are to be built with DJGPP tools.
|
||||
|
||||
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# Include the djgpp subdirectory in PATH, so that getconf is found
|
||||
@@ -68,6 +67,9 @@ ac_cv_path_FGREP=${FGREP='/dev/env/DJDIR/bin/fgrep'}
|
||||
# A sane default for sed.
|
||||
ac_cv_path_SED=${SED='/dev/env/DJDIR/bin/sed'}
|
||||
|
||||
# A sane default for mkdir.
|
||||
ac_cv_path_mkdir=${MKDIR_P='/dev/env/DJDIR/bin/mkdir -p'}
|
||||
|
||||
# These are set here so the generated libtool will be good
|
||||
# for every DJGPP installation, not only the one where the
|
||||
# package was configured.
|
||||
|
||||
+7
-8
@@ -1,20 +1,19 @@
|
||||
# sed script for DJGPP specific editing of config.hin
|
||||
|
||||
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
$ a\
|
||||
|
||||
+5
-6
@@ -7,12 +7,12 @@ Rem This batch file unpacks the Bison distribution while simultaneously
|
||||
Rem renaming some of the files whose names are invalid on DOS or conflict
|
||||
Rem with other file names after truncation to DOS 8+3 namespace.
|
||||
Rem
|
||||
Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
Rem
|
||||
Rem This program is free software; you can redistribute it and/or modify
|
||||
Rem This program is free software: you can redistribute it and/or modify
|
||||
Rem it under the terms of the GNU General Public License as published by
|
||||
Rem the Free Software Foundation; either version 2, or (at your option)
|
||||
Rem any later version.
|
||||
Rem the Free Software Foundation, either version 3 of the License, or
|
||||
Rem (at your option) any later version.
|
||||
Rem
|
||||
Rem This program is distributed in the hope that it will be useful,
|
||||
Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -20,8 +20,7 @@ Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
Rem GNU General Public License for more details.
|
||||
Rem
|
||||
Rem You should have received a copy of the GNU General Public License
|
||||
Rem along with this program; if not, write to the Free Software Foundation,
|
||||
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
Rem along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
Rem
|
||||
Rem
|
||||
Rem Invoke like this:
|
||||
|
||||
+27
-2
@@ -1,2 +1,27 @@
|
||||
@V@/src/scan-gram-c.c @V@/src/c-scan-gram.c
|
||||
@V@/src/scan-skel-c.c @V@/src/c-scan-skel.c
|
||||
@V@/build-aux/javacomp.sh.in @V@/build-aux/javacomp.sh-in
|
||||
@V@/build-aux/javaexec.sh.in @V@/build-aux/javaexec.sh-in
|
||||
@V@/data/c++-skel.m4 @V@/data/cxx-skel.m4
|
||||
@V@/data/c++.m4 @V@/data/cxx.m4
|
||||
@V@/doc/yacc.1.in @V@/doc/yacc.1-in
|
||||
@V@/etc/bench.pl.in @V@/etc/bench.pl-in
|
||||
@V@/examples/calc++/ @V@/examples/calcxx/
|
||||
@V@/examples/calc++/Makefile.am @V@/examples/calcxx/Makefile.am
|
||||
@V@/examples/calc++/Makefile.in @V@/examples/calcxx/Makefile.in
|
||||
@V@/examples/calc++/calc++-scanner.cc @V@/examples/calcxx/calcxx-scanner.cc
|
||||
@V@/examples/calc++/calc++-scanner.ll @V@/examples/calcxx/calcxx-scanner.ll
|
||||
@V@/examples/calc++/calc++.cc @V@/examples/calcxx/calcxx.cc
|
||||
@V@/examples/calc++/calc++-driver.hh @V@/examples/calcxx/calcxx-driver.hh
|
||||
@V@/examples/calc++/calc++-driver.cc @V@/examples/calcxx/calcxx-driver.cc
|
||||
@V@/examples/calc++/stack.hh @V@/examples/calcxx/stack.hh
|
||||
@V@/examples/calc++/position.hh @V@/examples/calcxx/position.hh
|
||||
@V@/examples/calc++/location.hh @V@/examples/calcxx/location.hh
|
||||
@V@/examples/calc++/calc++-parser.hh @V@/examples/calcxx/calcxx-parser.hh
|
||||
@V@/examples/calc++/calc++-parser.cc @V@/examples/calcxx/calcxx-parser.cc
|
||||
@V@/examples/calc++/calc++-parser.stamp @V@/examples/calcxx/calcxx-parser.stamp
|
||||
@V@/examples/calc++/calc++-parser.yy @V@/examples/calcxx/calcxx-parser.yy
|
||||
@V@/examples/calc++/test @V@/examples/calcxx/test
|
||||
@V@/po/Makefile.in.in @V@/po/Makefile.in-in
|
||||
@V@/runtime-po/Makefile.in.in @V@/runtime-po/Makefile.in-in
|
||||
@V@/src/scan-gram-c.c @V@/src/c-scan-gram.c
|
||||
@V@/src/scan-skel-c.c @V@/src/c-scan-skel.c
|
||||
@V@/tests/c++.at @V@/tests/cxx.at
|
||||
|
||||
+19
-11
@@ -1,11 +1,11 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -13,15 +13,12 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Juan Manuel Guerrero <[email protected]>. */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "subpipe.h"
|
||||
|
||||
@@ -70,15 +67,26 @@ static char tmp_file_name[2][L_tmpnam];
|
||||
void
|
||||
init_subpipe(void)
|
||||
{
|
||||
char *tmpdir;
|
||||
int fd;
|
||||
|
||||
strcpy(tmp_file_name[0], "/dev/env/TMPDIR/bnXXXXXX");
|
||||
tmpdir = getenv("TMPDIR");
|
||||
if (tmpdir == NULL)
|
||||
tmpdir = getenv("TMP");
|
||||
if (tmpdir == NULL)
|
||||
tmpdir = getenv("TEMP");
|
||||
if (access(tmpdir, D_OK))
|
||||
tmpdir = ".";
|
||||
|
||||
strcpy(tmp_file_name[0], tmpdir);
|
||||
strcat(tmp_file_name[0], "/bnXXXXXX");
|
||||
fd = mkstemp(tmp_file_name[0]);
|
||||
if (fd < 0)
|
||||
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
||||
close (fd);
|
||||
|
||||
strcpy(tmp_file_name[1], "/dev/env/TMPDIR/bnXXXXXX");
|
||||
strcpy(tmp_file_name[1], tmpdir);
|
||||
strcat(tmp_file_name[1], "/bnXXXXXX");
|
||||
fd = mkstemp(tmp_file_name[1]);
|
||||
if (fd < 0)
|
||||
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
||||
|
||||
+5
-5
@@ -1,9 +1,10 @@
|
||||
/* Subprocesses with pipes.
|
||||
Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
Copyright (C) 2005-2011 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
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -12,8 +13,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Juan Manuel Guerrero <[email protected]>. */
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# DJGPP specific configuration file.
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the testsuite script generated by autoconf 2.61.
|
||||
|
||||
# Copyright (C) 2007-2011 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
|
||||
@@ -1,22 +0,0 @@
|
||||
Makefile
|
||||
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
|
||||
refcard.dvi
|
||||
refcard.log
|
||||
refcard.ps
|
||||
Makefile.in
|
||||
*.info*
|
||||
stamp-vti
|
||||
version.texi
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
/*.info*
|
||||
/*~
|
||||
/.dirstamp
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/bison.1
|
||||
/bison.aux
|
||||
/bison.cp
|
||||
/bison.cps
|
||||
/bison.dvi
|
||||
/bison.fn
|
||||
/bison.html
|
||||
/bison.ky
|
||||
/bison.log
|
||||
/bison.pdf
|
||||
/bison.pg
|
||||
/bison.ps
|
||||
/bison.toc
|
||||
/bison.tp
|
||||
/bison.vr
|
||||
/cross-options.texi
|
||||
/gendocs_template
|
||||
/refcard.dvi
|
||||
/refcard.log
|
||||
/refcard.ps
|
||||
/stamp-vti
|
||||
/version.texi
|
||||
/yacc.1
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ PROJECT_NAME = "@PACKAGE_NAME@"
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = "@PACKAGE_VERSION@ @ID@"
|
||||
PROJECT_NUMBER = "@PACKAGE_VERSION@"
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
+83
-25
@@ -1,39 +1,101 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
## Copyright (C) 2001-2003, 2005-2011 Free Software Foundation, Inc.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
AM_MAKEINFOFLAGS = --no-split
|
||||
info_TEXINFOS = bison.texinfo
|
||||
man_MANS = bison.1
|
||||
bison_TEXINFOS = gpl.texi fdl.texi
|
||||
bison_TEXINFOS = $(srcdir)/cross-options.texi gpl-3.0.texi fdl.texi
|
||||
|
||||
EXTRA_DIST = bison.1 refcard.tex
|
||||
|
||||
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
|
||||
CLEANFILES = bison.fns
|
||||
CLEANDIRS = *.t2d
|
||||
clean-local:
|
||||
rm -rf $(CLEANDIRS)
|
||||
|
||||
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
||||
$(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
|
||||
mv -f $@ $@~ || : >$@~
|
||||
-rm -f $@.tmp
|
||||
cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||
$(top_builddir)/src/bison --help \
|
||||
| perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
||||
diff -u $@~ $@.tmp || true
|
||||
mv $@.tmp $@
|
||||
MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
|
||||
|
||||
## ---------- ##
|
||||
## Ref card. ##
|
||||
## ---------- ##
|
||||
|
||||
EXTRA_DIST = refcard.tex
|
||||
CLEANFILES += refcard.dvi refcard.log refcard.ps
|
||||
|
||||
refcard.dvi: refcard.tex
|
||||
tex refcard.tex
|
||||
|
||||
refcard.ps: refcard.dvi
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Man Pages. ##
|
||||
## ----------- ##
|
||||
|
||||
dist_man_MANS = $(srcdir)/bison.1
|
||||
|
||||
EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
|
||||
MAINTAINERCLEANFILES += $(dist_man_MANS)
|
||||
|
||||
# Depend on configure 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. ##
|
||||
@@ -48,8 +110,7 @@ doc: html
|
||||
html-local: Doxyfile
|
||||
$(DOXYGEN)
|
||||
|
||||
edit = sed -e "s|@ID@|$$Id|" \
|
||||
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
||||
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'
|
||||
@@ -58,10 +119,7 @@ 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.
|
||||
# Moreover, this file is updated whenever ChangeLog is touched: using
|
||||
# sed instead of configure saves us a lot of time.
|
||||
Doxyfile: $(top_srcdir)/ChangeLog $(srcdir)/Doxyfile.in
|
||||
Id=`grep '^\$$Id' $(top_srcdir)/ChangeLog`; \
|
||||
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 lookahead token in
|
||||
that state.
|
||||
.sp
|
||||
This file also describes all the conflicts, both those resolved by
|
||||
operator precedence and the unresolved ones.
|
||||
.sp
|
||||
The file's name is made by removing
|
||||
.B .tab.c
|
||||
or
|
||||
.B .c
|
||||
from the parser output file name, and adding
|
||||
.B .output
|
||||
instead.
|
||||
.sp
|
||||
Therefore, if the input file is
|
||||
.BR foo.y ,
|
||||
then the parser file is called
|
||||
.B foo.tab.c
|
||||
by default. As a consequence, the verbose
|
||||
output file is called
|
||||
.BR foo.output .
|
||||
.TP
|
||||
.B \-V
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-version
|
||||
Print the version number of
|
||||
.I bison
|
||||
and exit.
|
||||
.TP
|
||||
.B \-h
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-help
|
||||
Print a summary of the options to
|
||||
.I bison
|
||||
and exit.
|
||||
.TP
|
||||
.B \-y
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-yacc
|
||||
.br
|
||||
.ns
|
||||
.TP
|
||||
.B \-\-fixed-output-files
|
||||
Equivalent to
|
||||
.BR "\-o y.tab.c" ;
|
||||
the parser output file is called
|
||||
.BR y.tab.c ,
|
||||
and the other outputs are called
|
||||
.B y.output
|
||||
and
|
||||
.BR y.tab.h .
|
||||
The purpose of this switch is to imitate
|
||||
.IR yacc 's
|
||||
output file name conventions.
|
||||
Thus, the following shell script can substitute for
|
||||
.I yacc
|
||||
and is often installed as
|
||||
.IR yacc :
|
||||
.sp
|
||||
.RS
|
||||
.ft B
|
||||
bison \-y "$@"
|
||||
.ft R
|
||||
.sp
|
||||
.RE
|
||||
.SH SEE ALSO
|
||||
.IR yacc (1)
|
||||
.br
|
||||
The
|
||||
.IR "Bison Reference Manual" ,
|
||||
included as the file
|
||||
.B bison.texinfo
|
||||
in the
|
||||
.I bison
|
||||
source distribution.
|
||||
.SH DIAGNOSTICS
|
||||
Self explanatory.
|
||||
+3127
-887
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).
|
||||
+72
-18
@@ -1,13 +1,12 @@
|
||||
@c The GNU Free Documentation License.
|
||||
@center Version 1.3, 3 November 2008
|
||||
|
||||
@node GNU Free Documentation License
|
||||
@appendixsec GNU Free Documentation License
|
||||
|
||||
@cindex FDL, GNU Free Documentation License
|
||||
@center Version 1.2, November 2002
|
||||
@c This file is intended to be included within another document,
|
||||
@c hence no sectioning command or @node.
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
|
||||
@uref{http://fsf.org/}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@@ -112,6 +111,9 @@ formats which do not have any title page as such, ``Title Page'' means
|
||||
the text near the most prominent appearance of the work's title,
|
||||
preceding the beginning of the body of the text.
|
||||
|
||||
The ``publisher'' means any person or entity that distributes copies
|
||||
of the Document to the public.
|
||||
|
||||
A section ``Entitled XYZ'' means a named subunit of the Document whose
|
||||
title either is precisely XYZ or contains XYZ in parentheses following
|
||||
text that translates XYZ in another language. (Here XYZ stands for a
|
||||
@@ -380,13 +382,30 @@ title.
|
||||
@item
|
||||
TERMINATION
|
||||
|
||||
You may not copy, modify, sublicense, or distribute the Document except
|
||||
as expressly provided for under this License. Any other attempt to
|
||||
copy, modify, sublicense or distribute the Document is void, and will
|
||||
automatically terminate your rights under this License. However,
|
||||
parties who have received copies, or rights, from you under this
|
||||
License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
You may not copy, modify, sublicense, or distribute the Document
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense, or distribute it is void, and
|
||||
will automatically terminate your rights under this License.
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, receipt of a copy of some or all of the same material does
|
||||
not give you any rights to use it.
|
||||
|
||||
@item
|
||||
FUTURE REVISIONS OF THIS LICENSE
|
||||
@@ -404,11 +423,46 @@ following the terms and conditions either of that specified version or
|
||||
of any later version that has been published (not as a draft) by the
|
||||
Free Software Foundation. If the Document does not specify a version
|
||||
number of this License, you may choose any version ever published (not
|
||||
as a draft) by the Free Software Foundation.
|
||||
as a draft) by the Free Software Foundation. If the Document
|
||||
specifies that a proxy can decide which future versions of this
|
||||
License can be used, that proxy's public statement of acceptance of a
|
||||
version permanently authorizes you to choose that version for the
|
||||
Document.
|
||||
|
||||
@item
|
||||
RELICENSING
|
||||
|
||||
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
|
||||
World Wide Web server that publishes copyrightable works and also
|
||||
provides prominent facilities for anybody to edit those works. A
|
||||
public wiki that anybody can edit is an example of such a server. A
|
||||
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
|
||||
site means any set of copyrightable works thus published on the MMC
|
||||
site.
|
||||
|
||||
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
|
||||
license published by Creative Commons Corporation, a not-for-profit
|
||||
corporation with a principal place of business in San Francisco,
|
||||
California, as well as future copyleft versions of that license
|
||||
published by that same organization.
|
||||
|
||||
``Incorporate'' means to publish or republish a Document, in whole or
|
||||
in part, as part of another Document.
|
||||
|
||||
An MMC is ``eligible for relicensing'' if it is licensed under this
|
||||
License, and if all works that were first published under this License
|
||||
somewhere other than this MMC, and subsequently incorporated in whole
|
||||
or in part into the MMC, (1) had no cover texts or invariant sections,
|
||||
and (2) were thus incorporated prior to November 1, 2008.
|
||||
|
||||
The operator of an MMC Site may republish an MMC contained in the site
|
||||
under CC-BY-SA on the same site at any time before August 1, 2009,
|
||||
provided the MMC is eligible for relicensing.
|
||||
|
||||
@end enumerate
|
||||
|
||||
@page
|
||||
@appendixsubsec ADDENDUM: How to use this License for your documents
|
||||
@heading ADDENDUM: How to use this License for your documents
|
||||
|
||||
To use this License in a document you have written, include a copy of
|
||||
the License in the document and put the following copyright and
|
||||
@@ -418,7 +472,7 @@ license notices just after the title page:
|
||||
@group
|
||||
Copyright (C) @var{year} @var{your name}.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2
|
||||
under the terms of the GNU Free Documentation License, Version 1.3
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||
Texts. A copy of the license is included in the section entitled ``GNU
|
||||
@@ -427,7 +481,7 @@ license notices just after the title page:
|
||||
@end smallexample
|
||||
|
||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
||||
replace the ``with...Texts.'' line with this:
|
||||
replace the ``with@dots{}Texts.'' line with this:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
|
||||
@@ -0,0 +1,717 @@
|
||||
@c The GNU General Public License.
|
||||
@center Version 3, 29 June 2007
|
||||
|
||||
@c This file is intended to be included within another document,
|
||||
@c hence no sectioning command or @node.
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
@end display
|
||||
|
||||
@heading Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom
|
||||
to share and change all versions of a program---to make sure it remains
|
||||
free software for all its users. We, the Free Software Foundation,
|
||||
use the GNU General Public License for most of our software; it
|
||||
applies also to any other work released this way by its authors. You
|
||||
can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you
|
||||
have certain responsibilities if you distribute copies of the
|
||||
software, or if you modify it: responsibilities to respect the freedom
|
||||
of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too,
|
||||
receive or can get the source code. And you must show them these
|
||||
terms so they know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the
|
||||
manufacturer can do so. This is fundamentally incompatible with the
|
||||
aim of protecting users' freedom to change the software. The
|
||||
systematic pattern of such abuse occurs in the area of products for
|
||||
individuals to use, which is precisely where it is most unacceptable.
|
||||
Therefore, we have designed this version of the GPL to prohibit the
|
||||
practice for those products. If such problems arise substantially in
|
||||
other domains, we stand ready to extend this provision to those
|
||||
domains in future versions of the GPL, as needed to protect the
|
||||
freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish
|
||||
to avoid the special danger that patents applied to a free program
|
||||
could make it effectively proprietary. To prevent this, the GPL
|
||||
assures that patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
@heading TERMS AND CONDITIONS
|
||||
|
||||
@enumerate 0
|
||||
@item Definitions.
|
||||
|
||||
``This License'' refers to version 3 of the GNU General Public License.
|
||||
|
||||
``Copyright'' also means copyright-like laws that apply to other kinds
|
||||
of works, such as semiconductor masks.
|
||||
|
||||
``The Program'' refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as ``you''. ``Licensees'' and
|
||||
``recipients'' may be individuals or organizations.
|
||||
|
||||
To ``modify'' a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of
|
||||
an exact copy. The resulting work is called a ``modified version'' of
|
||||
the earlier work or a work ``based on'' the earlier work.
|
||||
|
||||
A ``covered work'' means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To ``propagate'' a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To ``convey'' a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user
|
||||
through a computer network, with no transfer of a copy, is not
|
||||
conveying.
|
||||
|
||||
An interactive user interface displays ``Appropriate Legal Notices'' to
|
||||
the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
@item Source Code.
|
||||
|
||||
The ``source code'' for a work means the preferred form of the work for
|
||||
making modifications to it. ``Object code'' means any non-source form
|
||||
of a work.
|
||||
|
||||
A ``Standard Interface'' means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The ``System Libraries'' of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
``Major Component'', in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The ``Corresponding Source'' for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can
|
||||
regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same
|
||||
work.
|
||||
|
||||
@item Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey,
|
||||
without conditions so long as your license otherwise remains in force.
|
||||
You may convey covered works to others for the sole purpose of having
|
||||
them make modifications exclusively for you, or provide you with
|
||||
facilities for running those works, provided that you comply with the
|
||||
terms of this License in conveying all material for which you do not
|
||||
control copyright. Those thus making or running the covered works for
|
||||
you must do so exclusively on your behalf, under your direction and
|
||||
control, on terms that prohibit them from making any copies of your
|
||||
copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the
|
||||
conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
@item Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such
|
||||
circumvention is effected by exercising rights under this License with
|
||||
respect to the covered work, and you disclaim any intention to limit
|
||||
operation or modification of the work as a means of enforcing, against
|
||||
the work's users, your or third parties' legal rights to forbid
|
||||
circumvention of technological measures.
|
||||
|
||||
@item Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
@item Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these
|
||||
conditions:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
The work must carry prominent notices stating that you modified it,
|
||||
and giving a relevant date.
|
||||
|
||||
@item
|
||||
The work must carry prominent notices stating that it is released
|
||||
under this License and any conditions added under section 7. This
|
||||
requirement modifies the requirement in section 4 to ``keep intact all
|
||||
notices''.
|
||||
|
||||
@item
|
||||
You must license the entire work, as a whole, under this License to
|
||||
anyone who comes into possession of a copy. This License will
|
||||
therefore apply, along with any applicable section 7 additional terms,
|
||||
to the whole of the work, and all its parts, regardless of how they
|
||||
are packaged. This License gives no permission to license the work in
|
||||
any other way, but it does not invalidate such permission if you have
|
||||
separately received it.
|
||||
|
||||
@item
|
||||
If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your work
|
||||
need not make them do so.
|
||||
@end enumerate
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
``aggregate'' if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
@item Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms of
|
||||
sections 4 and 5, provided that you also convey the machine-readable
|
||||
Corresponding Source under the terms of this License, in one of these
|
||||
ways:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium customarily
|
||||
used for software interchange.
|
||||
|
||||
@item
|
||||
Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a written
|
||||
offer, valid for at least three years and valid for as long as you
|
||||
offer spare parts or customer support for that product model, to give
|
||||
anyone who possesses the object code either (1) a copy of the
|
||||
Corresponding Source for all the software in the product that is
|
||||
covered by this License, on a durable physical medium customarily used
|
||||
for software interchange, for a price no more than your reasonable
|
||||
cost of physically performing this conveying of source, or (2) access
|
||||
to copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
@item
|
||||
Convey individual copies of the object code with a copy of the written
|
||||
offer to provide the Corresponding Source. This alternative is
|
||||
allowed only occasionally and noncommercially, and only if you
|
||||
received the object code with such an offer, in accord with subsection
|
||||
6b.
|
||||
|
||||
@item
|
||||
Convey the object code by offering access from a designated place
|
||||
(gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to copy
|
||||
the object code is a network server, the Corresponding Source may be
|
||||
on a different server (operated by you or a third party) that supports
|
||||
equivalent copying facilities, provided you maintain clear directions
|
||||
next to the object code saying where to find the Corresponding Source.
|
||||
Regardless of what server hosts the Corresponding Source, you remain
|
||||
obligated to ensure that it is available for as long as needed to
|
||||
satisfy these requirements.
|
||||
|
||||
@item
|
||||
Convey the object code using peer-to-peer transmission, provided you
|
||||
inform other peers where the object code and Corresponding Source of
|
||||
the work are being offered to the general public at no charge under
|
||||
subsection 6d.
|
||||
|
||||
@end enumerate
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A ``User Product'' is either (1) a ``consumer product'', which means any
|
||||
tangible personal property which is normally used for personal,
|
||||
family, or household purposes, or (2) anything designed or sold for
|
||||
incorporation into a dwelling. In determining whether a product is a
|
||||
consumer product, doubtful cases shall be resolved in favor of
|
||||
coverage. For a particular product received by a particular user,
|
||||
``normally used'' refers to a typical or common use of that class of
|
||||
product, regardless of the status of the particular user or of the way
|
||||
in which the particular user actually uses, or expects or is expected
|
||||
to use, the product. A product is a consumer product regardless of
|
||||
whether the product has substantial commercial, industrial or
|
||||
non-consumer uses, unless such uses represent the only significant
|
||||
mode of use of the product.
|
||||
|
||||
``Installation Information'' for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to
|
||||
install and execute modified versions of a covered work in that User
|
||||
Product from a modified version of its Corresponding Source. The
|
||||
information must suffice to ensure that the continued functioning of
|
||||
the modified object code is in no case prevented or interfered with
|
||||
solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or
|
||||
updates for a work that has been modified or installed by the
|
||||
recipient, or for the User Product in which it has been modified or
|
||||
installed. Access to a network may be denied when the modification
|
||||
itself materially and adversely affects the operation of the network
|
||||
or violates the rules and protocols for communication across the
|
||||
network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
@item Additional Terms.
|
||||
|
||||
``Additional permissions'' are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders
|
||||
of that material) supplement the terms of this License with terms:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
Disclaiming warranty or limiting liability differently from the terms
|
||||
of sections 15 and 16 of this License; or
|
||||
|
||||
@item
|
||||
Requiring preservation of specified reasonable legal notices or author
|
||||
attributions in that material or in the Appropriate Legal Notices
|
||||
displayed by works containing it; or
|
||||
|
||||
@item
|
||||
Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
@item
|
||||
Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
@item
|
||||
Declining to grant rights under trademark law for use of some trade
|
||||
names, trademarks, or service marks; or
|
||||
|
||||
@item
|
||||
Requiring indemnification of licensors and authors of that material by
|
||||
anyone who conveys the material (or modified versions of it) with
|
||||
contractual assumptions of liability to the recipient, for any
|
||||
liability that these contractual assumptions directly impose on those
|
||||
licensors and authors.
|
||||
@end enumerate
|
||||
|
||||
All other non-permissive additional terms are considered ``further
|
||||
restrictions'' within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions; the
|
||||
above requirements apply either way.
|
||||
|
||||
@item Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
@item Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or run
|
||||
a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
@item Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An ``entity transaction'' is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
@item Patents.
|
||||
|
||||
A ``contributor'' is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's ``contributor version''.
|
||||
|
||||
A contributor's ``essential patent claims'' are all patent claims owned
|
||||
or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, ``control'' includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a ``patent license'' is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To ``grant'' such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. ``Knowingly relying'' means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is ``discriminatory'' if it does not include within the
|
||||
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||
the non-exercise of one or more of the rights that are specifically
|
||||
granted under this License. You may not convey a covered work if you
|
||||
are a party to an arrangement with a third party that is in the
|
||||
business of distributing software, under which you make payment to the
|
||||
third party based on the extent of your activity of conveying the
|
||||
work, and under which the third party grants, to any of the parties
|
||||
who would receive the covered work from you, a discriminatory patent
|
||||
license (a) in connection with copies of the covered work conveyed by
|
||||
you (or copies made from those copies), or (b) primarily for and in
|
||||
connection with specific products or compilations that contain the
|
||||
covered work, unless you entered into that arrangement, or that patent
|
||||
license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
@item No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey
|
||||
a covered work so as to satisfy simultaneously your obligations under
|
||||
this License and any other pertinent obligations, then as a
|
||||
consequence you may not convey it at all. For example, if you agree
|
||||
to terms that obligate you to collect a royalty for further conveying
|
||||
from those to whom you convey the Program, the only way you could
|
||||
satisfy both those terms and this License would be to refrain entirely
|
||||
from conveying the Program.
|
||||
|
||||
@item Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
@item Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies that a certain numbered version of the GNU General Public
|
||||
License ``or any later version'' applies to it, you have the option of
|
||||
following the terms and conditions either of that numbered version or
|
||||
of any later version published by the Free Software Foundation. If
|
||||
the Program does not specify a version number of the GNU General
|
||||
Public License, you may choose any version ever published by the Free
|
||||
Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions
|
||||
of the GNU General Public License can be used, that proxy's public
|
||||
statement of acceptance of a version permanently authorizes you to
|
||||
choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
@item Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
@item Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
@item Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
@end enumerate
|
||||
|
||||
@heading END OF TERMS AND CONDITIONS
|
||||
|
||||
@heading How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these
|
||||
terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the ``copyright'' line and a pointer to where the full notice is found.
|
||||
|
||||
@smallexample
|
||||
@var{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) @var{year} @var{name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or (at
|
||||
your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see @url{http://www.gnu.org/licenses/}.
|
||||
@end smallexample
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
@smallexample
|
||||
@var{program} Copyright (C) @var{year} @var{name of author}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type @samp{show c} for details.
|
||||
@end smallexample
|
||||
|
||||
The hypothetical commands @samp{show w} and @samp{show c} should show
|
||||
the appropriate parts of the General Public License. Of course, your
|
||||
program's commands might be different; for a GUI interface, you would
|
||||
use an ``about box''.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a ``copyright disclaimer'' for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
@url{http://www.gnu.org/licenses/}.
|
||||
|
||||
The GNU General Public License does not permit incorporating your
|
||||
program into proprietary programs. If your program is a subroutine
|
||||
library, you may consider it more useful to permit linking proprietary
|
||||
applications with the library. If this is what you want to do, use
|
||||
the GNU Lesser General Public License instead of this License. But
|
||||
first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
|
||||
-392
@@ -1,392 +0,0 @@
|
||||
@node Copying
|
||||
@unnumbered GNU GENERAL PUBLIC LICENSE
|
||||
@center Version 2, June 1991
|
||||
|
||||
@c This file is intended to be included in another file.
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@end display
|
||||
|
||||
@unnumberedsec Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software---to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
@iftex
|
||||
@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
@end ifinfo
|
||||
|
||||
@enumerate 0
|
||||
@item
|
||||
This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The ``Program'', below,
|
||||
refers to any such program or work, and a ``work based on the Program''
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term ``modification''.) Each licensee is addressed as ``you''.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
@item
|
||||
You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
@item
|
||||
You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
@item
|
||||
You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
@item
|
||||
If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
@end enumerate
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
@item
|
||||
You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
@item
|
||||
Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
@item
|
||||
Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
@end enumerate
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
@item
|
||||
You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
@item
|
||||
You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
@item
|
||||
Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
@item
|
||||
If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
@item
|
||||
If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
@item
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and ``any
|
||||
later version'', you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
@item
|
||||
If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
@iftex
|
||||
@heading NO WARRANTY
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center NO WARRANTY
|
||||
@end ifinfo
|
||||
|
||||
@item
|
||||
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
@item
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
@end enumerate
|
||||
|
||||
@iftex
|
||||
@heading END OF TERMS AND CONDITIONS
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center END OF TERMS AND CONDITIONS
|
||||
@end ifinfo
|
||||
|
||||
@page
|
||||
@unnumberedsec Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the ``copyright'' line and a pointer to where the full notice is found.
|
||||
|
||||
@smallexample
|
||||
@var{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) @var{yyyy} @var{name of author}
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
@end smallexample
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
@smallexample
|
||||
Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
@end smallexample
|
||||
|
||||
The hypothetical commands @samp{show w} and @samp{show c} should show
|
||||
the appropriate parts of the General Public License. Of course, the
|
||||
commands you use may be called something other than @samp{show w} and
|
||||
@samp{show c}; they could even be mouse-clicks or menu items---whatever
|
||||
suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a ``copyright disclaimer'' for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
@example
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
@var{signature of Ty Coon}, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
@end example
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
+10
-12
@@ -19,24 +19,22 @@
|
||||
\def\finalout{\overfullrule=0pt}
|
||||
%\finalout
|
||||
|
||||
% Copyright (c) 1998, 2001 Free Software Foundation, Inc.
|
||||
% Copyright (c) 1998, 2001, 2009-2011 Free Software Foundation, Inc.
|
||||
%
|
||||
% This file is part of Bison.
|
||||
%
|
||||
% Bison is free software; you can redistribute them and/or modify them
|
||||
% under the terms of the GNU General Public License as published by the
|
||||
% Free Software Foundation; either version 2, or (at your option) any
|
||||
% later version.
|
||||
% This program is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Bison is distributed in the hope that it will be useful, but WITHOUT
|
||||
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
% for more details.
|
||||
% This program is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with either Flex or Bison; see the file COPYING. If not, write
|
||||
% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
% Boston, MA 02110-1301, USA.
|
||||
% along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
%
|
||||
% This file is intended to be processed by plain TeX (TeX82).
|
||||
%
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
.TH YACC "1" "November 2007" "@PACKAGE_STRING@" "User Commands"
|
||||
.SH NAME
|
||||
yacc \- GNU Project parser generator
|
||||
.SH SYNOPSIS
|
||||
.B yacc
|
||||
[\fIOPTION\fR]... \fIFILE\fR
|
||||
.SH DESCRIPTION
|
||||
.I Yacc
|
||||
(Yet Another Compiler Compiler) is a parser generator. This
|
||||
version is a simple wrapper around
|
||||
.IR bison (1).
|
||||
It passes option
|
||||
\fB\-y\fR, \fB\-\-yacc\fR
|
||||
to activate the upward compatibility mode. See
|
||||
.IR bison (1)
|
||||
for more information.
|
||||
.SH AUTHOR
|
||||
Written by Paul Eggert.
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to <@PACKAGE_BUGREPORT@>.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co @PACKAGE_COPYRIGHT_YEAR@ Free Software Foundation, Inc.
|
||||
.br
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
.SH "SEE ALSO"
|
||||
.BR lex (1),
|
||||
.BR flex (1),
|
||||
.BR bison (1).
|
||||
.PP
|
||||
The full documentation for
|
||||
.B bison
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B bison
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info bison
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
@@ -0,0 +1,3 @@
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/bench.pl
|
||||
@@ -0,0 +1,16 @@
|
||||
## Copyright (C) 2006, 2009-2011 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
|
||||
+6
-8
@@ -19,24 +19,22 @@ straightforward use of _build/src/bison would.)
|
||||
|
||||
--
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Bison is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bison is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with autoconf; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Local Variables:
|
||||
mode: outline
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of Bison, the GNU Compiler Compiler.
|
||||
#
|
||||
# Bison is free software; you can redistribute it and/or modify
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Bison is distributed in the hope that it will be useful,
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with autoconf; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use IO::File;
|
||||
use Benchmark qw (:all);
|
||||
|
||||
my $bison = $ENV{'BISON'} || 'bison';
|
||||
my $bison = $ENV{'BISON'} || '@abs_top_builddir@/tests/bison';
|
||||
my $cc = $ENV{'CC'} || 'gcc';
|
||||
|
||||
##################################################################
|
||||
@@ -260,12 +258,6 @@ read_signed_integer (void)
|
||||
return sign * n;
|
||||
}
|
||||
|
||||
#if YYPUSH
|
||||
#ifndef HAVE_YYSTYPE
|
||||
static YYSTYPE yylval;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static int
|
||||
#if YYPURE
|
||||
# define yylval (*yylvalp)
|
||||
@@ -278,9 +270,7 @@ yylex (void)
|
||||
|
||||
/* Skip white space. */
|
||||
while ((c = get_char ()) == ' ' || c == '\t')
|
||||
{
|
||||
|
||||
}
|
||||
continue;
|
||||
|
||||
/* process numbers */
|
||||
if (c == '.' || isdigit (c))
|
||||
@@ -310,21 +300,6 @@ power (int base, int exponent)
|
||||
}
|
||||
|
||||
|
||||
#if YYPUSH
|
||||
static int
|
||||
yyparse_wrapper ()
|
||||
{
|
||||
struct yypvars *ctx = yypvarsinit ();
|
||||
do {
|
||||
set_yychar (ctx, yylex ());
|
||||
ctx->yylval = yylval;
|
||||
yyparse (ctx);
|
||||
} while (get_yyresult (ctx) != 0);
|
||||
free (ctx);
|
||||
}
|
||||
#define yyparse yyparse_wrapper
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, const char **argv)
|
||||
{
|
||||
@@ -366,16 +341,12 @@ sub bench_grammar ($)
|
||||
my ($gram) = @_;
|
||||
my %test =
|
||||
(
|
||||
"yacc-yacc" => '',
|
||||
"yacc-pure" => '%pure-parser',
|
||||
"push-yacc" => '%skeleton "push.c"',
|
||||
"push-pure" => '%skeleton "push.c" %pure-parser',
|
||||
"push-push" => '%skeleton "push.c" %push-parser',
|
||||
"popt-yacc" => '%skeleton "push_opt.c"',
|
||||
"popt-pure" => '%skeleton "push_opt.c" %pure-parser',
|
||||
"popt-push" => '%skeleton "push_opt.c" %push-parser',
|
||||
"pull-impure" => '',
|
||||
"pull-pure" => '%define api.pure',
|
||||
"push-impure" => '%define api.push-pull "both"',
|
||||
"push-pure" => '%define api.push-pull "both" %define api.pure',
|
||||
);
|
||||
|
||||
|
||||
my %bench;
|
||||
while (my ($name, $directives) = each %test)
|
||||
{
|
||||
@@ -0,0 +1,2 @@
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
+13
-15
@@ -1,20 +1,18 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if BISON_CXX_WORKS
|
||||
SUBDIRS = calc++
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
*.cc
|
||||
*.hh
|
||||
*.ll
|
||||
*.output
|
||||
*.stamp
|
||||
*.tmp
|
||||
*.yy
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
calc++
|
||||
@@ -0,0 +1,13 @@
|
||||
/*.cc
|
||||
/*.hh
|
||||
/*.ll
|
||||
/*.o
|
||||
/*.output
|
||||
/*.stamp
|
||||
/*.tmp
|
||||
/*.yy
|
||||
/.deps
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/calc++
|
||||
/calc++.exe
|
||||
+25
-19
@@ -1,20 +1,18 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
## ------------------------------------- ##
|
||||
## Running the bison from this tarball. ##
|
||||
@@ -33,17 +31,22 @@ $(BISON): $(BISON_IN)
|
||||
doc = $(top_srcdir)/doc/bison.texinfo
|
||||
extexi = $(top_srcdir)/examples/extexi
|
||||
# Extract in src.
|
||||
$(calc_extracted): $(doc) $(extexi)
|
||||
$(srcdir)/calc.stamp: $(doc) $(extexi)
|
||||
rm -f $@ $@.tmp
|
||||
touch $@.tmp
|
||||
cd $(srcdir) && \
|
||||
$(AWK) -f ../extexi ../../doc/bison.texinfo -- \
|
||||
calc++-parser.yy \
|
||||
$(AWK) -f ../extexi -v VERSION="$(VERSION)" \
|
||||
../../doc/bison.texinfo -- calc++-parser.yy \
|
||||
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
||||
mv $@.tmp $@
|
||||
|
||||
$(calc_extracted): $(srcdir)/calc.stamp
|
||||
|
||||
## ------------------- ##
|
||||
## Parser generation. ##
|
||||
## ------------------- ##
|
||||
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir)
|
||||
BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
|
||||
CLEANFILES = $(srcdir)/*.output *.tmp
|
||||
MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
||||
@@ -51,7 +54,10 @@ MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
||||
# Compile the parser and save cycles.
|
||||
# This code comes from "Handling Tools that Produce Many Outputs",
|
||||
# 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
|
||||
# in srcdir, including during distcheck, which is forbidden.
|
||||
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
||||
|
||||
+7
-6
@@ -1,11 +1,13 @@
|
||||
# Extract all examples from the manual source. -*- AWK -*-
|
||||
|
||||
# This file is part of GNU Bison
|
||||
# Copyright 1992, 2000, 2001, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2011 Free Software
|
||||
# Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -14,9 +16,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This script is for use with any Awk that conforms to POSIX.
|
||||
# It was derived from a similar script tests/generate.awk in GNU m4.
|
||||
@@ -111,6 +111,7 @@ function normalize(contents, i, lines, n, line, res) {
|
||||
else
|
||||
line = "";
|
||||
|
||||
gsub (/"@value\{VERSION\}"/, "\"" VERSION "\"", line)
|
||||
gsub (/^@result\{\}/, "", line);
|
||||
gsub (/^@error\{\}/, "", line);
|
||||
gsub ("@[{]", "{", line);
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
external: gnulib
|
||||
Submodule
+1
Submodule gnulib added at eff4c0360a
@@ -1,63 +0,0 @@
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
argmatch.c
|
||||
argmatch.h
|
||||
basename.c
|
||||
dirname.c
|
||||
dirname.h
|
||||
dup-safer.c
|
||||
error.c
|
||||
error.h
|
||||
exit.h
|
||||
exitfail.c
|
||||
exitfail.h
|
||||
fd-safer.c
|
||||
fopen-safer.c
|
||||
getopt.c
|
||||
getopt.h
|
||||
getopt1.c
|
||||
getopt_.h
|
||||
getopt_int.h
|
||||
gettext.h
|
||||
gnulib.mk
|
||||
hash.c
|
||||
hash.h
|
||||
malloc.c
|
||||
mbswidth.c
|
||||
mbswidth.h
|
||||
obstack.c
|
||||
obstack.h
|
||||
pipe-safer.c
|
||||
quote.c
|
||||
quote.h
|
||||
quotearg.c
|
||||
quotearg.h
|
||||
stdbool.h
|
||||
stdbool_.h
|
||||
stdint.h
|
||||
stdint_.h
|
||||
stdio--.h
|
||||
stdio-safer.h
|
||||
stpcpy.c
|
||||
stpcpy.h
|
||||
strerror.c
|
||||
stripslash.c
|
||||
strndup.c
|
||||
strndup.h
|
||||
strnlen.c
|
||||
strnlen.h
|
||||
strtol.c
|
||||
strtoul.c
|
||||
strverscmp.c
|
||||
strverscmp.h
|
||||
unistd--.h
|
||||
unistd-safer.h
|
||||
unlocked-io.h
|
||||
verify.h
|
||||
wcwidth.h
|
||||
xalloc-die.c
|
||||
xalloc.h
|
||||
xmalloc.c
|
||||
xstrndup.c
|
||||
xstrndup.h
|
||||
+245
@@ -0,0 +1,245 @@
|
||||
|
||||
/*.a
|
||||
/*.bak
|
||||
/*.o
|
||||
/*~
|
||||
/.deps
|
||||
/.dirstamp
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/alignof.h
|
||||
/alloca.h
|
||||
/alloca.in.h
|
||||
/arg-nonnull.h
|
||||
/argmatch.c
|
||||
/argmatch.h
|
||||
/asnprintf.c
|
||||
/basename-lgpl.c
|
||||
/basename.c
|
||||
/binary-io.h
|
||||
/bitrotate.h
|
||||
/c++defs.h
|
||||
/c-ctype.c
|
||||
/c-ctype.h
|
||||
/c-strcase.h
|
||||
/c-strcasecmp.c
|
||||
/c-strncasecmp.c
|
||||
/calloc.c
|
||||
/charset.alias
|
||||
/cloexec.c
|
||||
/cloexec.h
|
||||
/close-hook.c
|
||||
/close-hook.h
|
||||
/close.c
|
||||
/config.charset
|
||||
/config.h
|
||||
/config.hin
|
||||
/configmake.h
|
||||
/dirname-lgpl.c
|
||||
/dirname.c
|
||||
/dirname.h
|
||||
/dosname.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
|
||||
/fclose.c
|
||||
/fcntl.c
|
||||
/fcntl.h
|
||||
/fcntl.in.h
|
||||
/fd-safer-flag.c
|
||||
/fd-safer.c
|
||||
/float+.h
|
||||
/float.h
|
||||
/float.in.h
|
||||
/fopen-safer.c
|
||||
/fopen.c
|
||||
/fprintf.c
|
||||
/fpucw.h
|
||||
/frexp.c
|
||||
/frexpl.c
|
||||
/fseterr.c
|
||||
/fseterr.h
|
||||
/getdtablesize.c
|
||||
/getopt.c
|
||||
/getopt.h
|
||||
/getopt.in.h
|
||||
/getopt1.c
|
||||
/getopt_int.h
|
||||
/gettext.h
|
||||
/gnulib.mk
|
||||
/hash.c
|
||||
/hash.h
|
||||
/intprops.h
|
||||
/inttypes.h
|
||||
/inttypes.in.h
|
||||
/ioctl.c
|
||||
/isnan.c
|
||||
/isnand-nolibm.h
|
||||
/isnand.c
|
||||
/isnanf-nolibm.h
|
||||
/isnanf.c
|
||||
/isnanl-nolibm.h
|
||||
/isnanl.c
|
||||
/iswblank.c
|
||||
/ldexpl.c
|
||||
/localcharset.c
|
||||
/localcharset.h
|
||||
/malloc.c
|
||||
/math.h
|
||||
/math.in.h
|
||||
/mbchar.c
|
||||
/mbchar.h
|
||||
/mbrtowc.c
|
||||
/mbschr.c
|
||||
/mbsinit.c
|
||||
/mbsrchr.c
|
||||
/mbswidth.c
|
||||
/mbswidth.h
|
||||
/mbuiter.h
|
||||
/memchr.c
|
||||
/memchr.valgrind
|
||||
/nonblocking.c
|
||||
/nonblocking.h
|
||||
/obstack.c
|
||||
/obstack.h
|
||||
/open.c
|
||||
/perror.c
|
||||
/pipe-safer.c
|
||||
/pipe.c
|
||||
/pipe2-safer.c
|
||||
/pipe2.c
|
||||
/printf-args.c
|
||||
/printf-args.h
|
||||
/printf-frexp.c
|
||||
/printf-frexp.h
|
||||
/printf-frexpl.c
|
||||
/printf-frexpl.h
|
||||
/printf-parse.c
|
||||
/printf-parse.h
|
||||
/printf.c
|
||||
/quote.c
|
||||
/quote.h
|
||||
/quotearg.c
|
||||
/quotearg.h
|
||||
/rawmemchr.c
|
||||
/rawmemchr.valgrind
|
||||
/realloc.c
|
||||
/ref-add.sed
|
||||
/ref-add.sin
|
||||
/ref-del.sed
|
||||
/ref-del.sin
|
||||
/sched.h
|
||||
/sched.in.h
|
||||
/sig-handler.h
|
||||
/sigaction.c
|
||||
/signal.h
|
||||
/signal.in.h
|
||||
/signbitd.c
|
||||
/signbitf.c
|
||||
/signbitl.c
|
||||
/sigprocmask.c
|
||||
/size_max.h
|
||||
/snprintf.c
|
||||
/spawn-pipe.c
|
||||
/spawn-pipe.h
|
||||
/spawn.h
|
||||
/spawn.in.h
|
||||
/spawn_faction_addclose.c
|
||||
/spawn_faction_adddup2.c
|
||||
/spawn_faction_addopen.c
|
||||
/spawn_faction_destroy.c
|
||||
/spawn_faction_init.c
|
||||
/spawn_int.h
|
||||
/spawnattr_destroy.c
|
||||
/spawnattr_init.c
|
||||
/spawnattr_setflags.c
|
||||
/spawnattr_setsigmask.c
|
||||
/spawni.c
|
||||
/spawnp.c
|
||||
/sprintf.c
|
||||
/stamp-h1
|
||||
/stat.c
|
||||
/stdbool.h
|
||||
/stdbool.in.h
|
||||
/stddef.h
|
||||
/stddef.in.h
|
||||
/stdint.h
|
||||
/stdint.in.h
|
||||
/stdio--.h
|
||||
/stdio-impl.h
|
||||
/stdio-safer.h
|
||||
/stdio-write.c
|
||||
/stdio.h
|
||||
/stdio.in.h
|
||||
/stdlib.h
|
||||
/stdlib.in.h
|
||||
/stpcpy.c
|
||||
/strchrnul.c
|
||||
/strchrnul.valgrind
|
||||
/strdup.c
|
||||
/streq.h
|
||||
/strerror.c
|
||||
/string.h
|
||||
/string.in.h
|
||||
/stripslash.c
|
||||
/strndup.c
|
||||
/strnlen.c
|
||||
/strnlen1.c
|
||||
/strnlen1.h
|
||||
/strtol.c
|
||||
/strtoul.c
|
||||
/strverscmp.c
|
||||
/sys
|
||||
/sys_ioctl.h
|
||||
/sys_ioctl.in.h
|
||||
/sys_socket.h
|
||||
/sys_socket.in.h
|
||||
/sys_stat.h
|
||||
/sys_stat.in.h
|
||||
/sys_wait.h
|
||||
/sys_wait.in.h
|
||||
/time.h
|
||||
/time.in.h
|
||||
/unistd--.h
|
||||
/unistd-safer.h
|
||||
/unistd.h
|
||||
/unistd.in.h
|
||||
/unitypes.h
|
||||
/unitypes.in.h
|
||||
/uniwidth
|
||||
/uniwidth.h
|
||||
/uniwidth.in.h
|
||||
/unlocked-io.h
|
||||
/unsetenv.c
|
||||
/vasnprintf.c
|
||||
/vasnprintf.h
|
||||
/verify.h
|
||||
/vfprintf.c
|
||||
/vsnprintf.c
|
||||
/vsprintf.c
|
||||
/w32sock.h
|
||||
/w32spawn.h
|
||||
/wait-process.c
|
||||
/wait-process.h
|
||||
/waitpid.c
|
||||
/warn-on-use.h
|
||||
/wchar.h
|
||||
/wchar.in.h
|
||||
/wctype.h
|
||||
/wctype.in.h
|
||||
/wcwidth.c
|
||||
/xalloc-die.c
|
||||
/xalloc.h
|
||||
/xmalloc.c
|
||||
/xsize.h
|
||||
/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
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
# Copyright (C) 2001-2004, 2006, 2008-2011 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301 USA
|
||||
include gnulib.mk
|
||||
|
||||
AM_CFLAGS = $(WARNING_CFLAGS)
|
||||
AM_CFLAGS += $(WARN_CFLAGS)
|
||||
|
||||
BUILT_SOURCES =
|
||||
EXTRA_DIST =
|
||||
MOSTLYCLEANFILES =
|
||||
|
||||
lib_LIBRARIES = $(YACC_LIBRARY)
|
||||
EXTRA_LIBRARIES = liby.a
|
||||
noinst_LIBRARIES = libbison.a
|
||||
|
||||
liby_a_SOURCES = main.c yyerror.c
|
||||
|
||||
libbison_a_SOURCES = $(lib_SOURCES)
|
||||
lib_SOURCES = \
|
||||
get-errno.h get-errno.c \
|
||||
subpipe.h subpipe.c \
|
||||
$(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
|
||||
|
||||
# Implementation of bitsets
|
||||
# Implementation of bitsets.
|
||||
bitsets_sources = \
|
||||
abitset.c abitset.h bbitset.h bitset.c bitset.h bitset_stats.c \
|
||||
bitset_stats.h bitsetv.c bitsetv.h ebitset.c ebitset.h lbitset.c \
|
||||
@@ -41,13 +28,18 @@ bitsets_sources = \
|
||||
|
||||
# Additional bitset operations.
|
||||
additional_bitsets_sources = \
|
||||
bitsetv-print.h bitsetv-print.c
|
||||
bitsetv-print.h bitsetv-print.c
|
||||
|
||||
# timevars, stolen from GCC.
|
||||
timevars_sources = \
|
||||
timevar.h timevar.c timevar.def
|
||||
timevar.h timevar.c timevar.def
|
||||
|
||||
libbison_a_LIBADD = $(LIBOBJS) $(ALLOCA)
|
||||
libbison_a_DEPENDENCIES = $(libbison_a_LIBADD)
|
||||
# Non-gnulib sources in Bison's internal library.
|
||||
libbison_a_SOURCES += \
|
||||
get-errno.h get-errno.c \
|
||||
$(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
|
||||
|
||||
+8
-8
@@ -1,10 +1,13 @@
|
||||
/* Array bitsets.
|
||||
Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2003, 2006, 2009-2011 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes ([email protected]).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -13,12 +16,9 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "abitset.h"
|
||||
#include <stddef.h>
|
||||
|
||||
+13
-12
@@ -1,20 +1,21 @@
|
||||
/* Functions to support abitsets.
|
||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes ([email protected]).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ABITSET_H
|
||||
#define _ABITSET_H
|
||||
|
||||
+14
-12
@@ -1,20 +1,22 @@
|
||||
/* Base bitset stuff.
|
||||
Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes ([email protected]).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BBITSET_H
|
||||
#define _BBITSET_H
|
||||
|
||||
+9
-9
@@ -1,10 +1,12 @@
|
||||
/* General bitsets.
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes ([email protected]).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -13,16 +15,14 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "bitset.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "bitset.h"
|
||||
#include "abitset.h"
|
||||
#include "lbitset.h"
|
||||
#include "ebitset.h"
|
||||
|
||||
+13
-12
@@ -1,20 +1,21 @@
|
||||
/* Generic bitsets.
|
||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BITSET_H
|
||||
#define _BITSET_H
|
||||
|
||||
+9
-9
@@ -1,10 +1,12 @@
|
||||
/* Bitset statistics.
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -13,8 +15,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file is a wrapper bitset implementation for the other bitset
|
||||
implementations. It provides bitset compatibility checking and
|
||||
@@ -23,16 +24,15 @@
|
||||
operations get vectored through here and we then call the appropriate
|
||||
routines. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <config.h>
|
||||
|
||||
#include "bitset_stats.h"
|
||||
|
||||
#include "bbitset.h"
|
||||
#include "abitset.h"
|
||||
#include "ebitset.h"
|
||||
#include "lbitset.h"
|
||||
#include "vbitset.h"
|
||||
#include "bitset_stats.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user