mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-13 12:45:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1eeecd384 | ||
|
|
43ca804096 | ||
|
|
dcd5344dcd | ||
|
|
62a58c14bd | ||
|
|
e39eff37e2 | ||
|
|
06f2ac78d7 | ||
|
|
1914a78115 | ||
|
|
d6e2a57964 | ||
|
|
a0c45dd5d2 | ||
|
|
c9d546b2a8 | ||
|
|
d61e59ea0e | ||
|
|
aaf63e45b6 | ||
|
|
dbfcf7a89f | ||
|
|
8c707b10e7 | ||
|
|
9c26b8fc03 | ||
|
|
77b214ef48 | ||
|
|
d35d6dd2cd | ||
|
|
466a2de317 | ||
|
|
4acc22e5cf | ||
|
|
7b18c11231 | ||
|
|
e6cab382c5 | ||
|
|
cd735a8c6c | ||
|
|
d6a44ffd00 | ||
|
|
93e3dbab95 | ||
|
|
1c292035e1 | ||
|
|
263137264f | ||
|
|
e20e6a50d5 | ||
|
|
4d24ffb75e | ||
|
|
a74a3158d4 | ||
|
|
4982f078bf | ||
|
|
65a99eca25 | ||
|
|
9a86ee6058 | ||
|
|
0e164d43d1 | ||
|
|
d511fbd576 | ||
|
|
9c46ba16e3 | ||
|
|
55e075f229 | ||
|
|
0bb672d87c | ||
|
|
8617d87e24 | ||
|
|
0601c3bf0f | ||
|
|
eea7239a23 | ||
|
|
e58782294d | ||
|
|
c1cc91bdcd | ||
|
|
13b712d7d4 | ||
|
|
dba9149595 | ||
|
|
9b8585410a | ||
|
|
f9b8635172 | ||
|
|
733d4546ce | ||
|
|
aaf6103699 | ||
|
|
d0d3313d10 | ||
|
|
a4107f24bc | ||
|
|
1505e8bb78 | ||
|
|
58c7e5ee2c | ||
|
|
ad6b775fc5 | ||
|
|
5d614dfa8c | ||
|
|
858c700fc0 | ||
|
|
c30717cafa | ||
|
|
0e98a81e00 | ||
|
|
d5c20d1a36 | ||
|
|
e6ae99fe75 | ||
|
|
bcbbf65486 | ||
|
|
1aa9fa823b | ||
|
|
321b8117a6 | ||
|
|
e4828e2384 | ||
|
|
a122efad8a | ||
|
|
15ffba51b0 | ||
|
|
ea6a2d96db | ||
|
|
ae63f0e8e2 | ||
|
|
41c11ce484 | ||
|
|
a59a6ddef4 | ||
|
|
aca4ddc75d | ||
|
|
47977a7e74 | ||
|
|
813f7d3482 | ||
|
|
7a9e6d65ea | ||
|
|
916f26b65a | ||
|
|
32ae07efde | ||
|
|
ad60e80f3d | ||
|
|
2a824fae30 | ||
|
|
c242519127 | ||
|
|
e358222ba8 | ||
|
|
9dcb193aeb | ||
|
|
faff3bef5b | ||
|
|
53ab797db7 | ||
|
|
426903aa75 | ||
|
|
9104636b03 | ||
|
|
1168b32295 | ||
|
|
771dc64324 | ||
|
|
a7385a21ce | ||
|
|
b142cfd128 | ||
|
|
5f108727a1 | ||
|
|
242cc08e8d | ||
|
|
4b3847c3c0 | ||
|
|
087dcd7868 | ||
|
|
95361618de | ||
|
|
694af10cb7 | ||
|
|
258cddbc36 | ||
|
|
9bcffa0c13 | ||
|
|
a32a2d57a5 | ||
|
|
8d6c1b5e85 | ||
|
|
77519a7d18 | ||
|
|
0e16927b48 | ||
|
|
91ce0b3a66 | ||
|
|
837b769659 | ||
|
|
5e01579ec0 | ||
|
|
55d1006fce | ||
|
|
230a3db428 | ||
|
|
6d55954743 | ||
|
|
7490994123 | ||
|
|
eb46d61f4d | ||
|
|
05a7b6ec80 | ||
|
|
290a8ff2c0 | ||
|
|
6e2d7b0974 | ||
|
|
2d40532bf5 | ||
|
|
756257ee86 | ||
|
|
18ad57b384 | ||
|
|
da402d1cae | ||
|
|
e29f0771d7 | ||
|
|
71c7e24f2e | ||
|
|
5f7f1e210b | ||
|
|
eb83259dc1 | ||
|
|
55f48c4831 | ||
|
|
34d867d7d2 | ||
|
|
363bf73276 | ||
|
|
c8c220d19a | ||
|
|
56ca3d8fce | ||
|
|
c3e9f08f93 | ||
|
|
6aef2e01a4 | ||
|
|
3d8082ad27 | ||
|
|
9d67a52ad6 | ||
|
|
0f11eec272 | ||
|
|
ae6bdabbf6 | ||
|
|
c0828abf9d | ||
|
|
e9807a7934 | ||
|
|
02287ec650 | ||
|
|
6537c71fcc | ||
|
|
6733d02476 | ||
|
|
cc9fb4f6b6 | ||
|
|
f763e6ef67 | ||
|
|
c4576b484a | ||
|
|
91aadcc7a9 | ||
|
|
dfaac27242 | ||
|
|
ed7658fe17 | ||
|
|
4d4777c786 | ||
|
|
cbdb6d9145 | ||
|
|
6a4f5c6ea0 | ||
|
|
3cd7c0bfce | ||
|
|
188867ac65 | ||
|
|
3f32a0d287 | ||
|
|
22172d4731 | ||
|
|
a19728cbb5 | ||
|
|
03f1b545b9 | ||
|
|
a9b67b5b1e | ||
|
|
e4ab12542b | ||
|
|
08f6341c01 | ||
|
|
86b08b49b3 | ||
|
|
7fb72c6e53 | ||
|
|
1ef57c947d | ||
|
|
035810ed2e | ||
|
|
5192fd5d50 | ||
|
|
7f7fdba418 | ||
|
|
7e3510e6dd | ||
|
|
b2c4c25d4a | ||
|
|
91fd2b60b6 | ||
|
|
08ab0101bd | ||
|
|
aebb55eb92 | ||
|
|
a0cd287e64 | ||
|
|
dc584206f9 | ||
|
|
7de42e52bf | ||
|
|
0b7fba1335 | ||
|
|
e2eb03d4e9 | ||
|
|
db0054f7e6 | ||
|
|
45aab21d77 | ||
|
|
e54ec80c0c | ||
|
|
85557aa1cb | ||
|
|
47dcfd5a5c | ||
|
|
355e5a7255 | ||
|
|
9c883a6bb0 | ||
|
|
60457f308d | ||
|
|
bb3b912b0a | ||
|
|
7020e5f050 | ||
|
|
dd8d335174 | ||
|
|
021a7cfb3e | ||
|
|
30bc96ceca | ||
|
|
78ab351c4f | ||
|
|
15cd62c2c1 | ||
|
|
95e343fea3 | ||
|
|
2ba031129a | ||
|
|
fbca8023ed | ||
|
|
8ef26c2aa7 | ||
|
|
7e508a2b2d | ||
|
|
68fff38a09 | ||
|
|
56d60c1947 | ||
|
|
a703b669b4 | ||
|
|
10232af808 | ||
|
|
0d49053a75 | ||
|
|
a4e4295ad2 | ||
|
|
22cd137bc9 | ||
|
|
3d05bae83a | ||
|
|
d834eca014 | ||
|
|
debe2c03c4 | ||
|
|
7beac80814 | ||
|
|
ff1b7a1333 | ||
|
|
163bb3698f | ||
|
|
466b4cf201 | ||
|
|
34a41a93c7 | ||
|
|
4a11b85249 | ||
|
|
6557bcce8b | ||
|
|
681dda24ba | ||
|
|
059736b7b5 | ||
|
|
936c88d178 | ||
|
|
2091988f7e | ||
|
|
2a1bd0d7fe | ||
|
|
769a8ef9bc | ||
|
|
ef51bfa744 | ||
|
|
e85056ef5f | ||
|
|
62e5fc6ac9 | ||
|
|
37e884cd9a | ||
|
|
041308d0c0 | ||
|
|
e34e97bcd7 | ||
|
|
bbaf618c3e | ||
|
|
c84134b644 | ||
|
|
84c1cdc71d | ||
|
|
56da1e5288 | ||
|
|
0765d39396 | ||
|
|
6528a99151 | ||
|
|
de6be119ca | ||
|
|
ea118b7262 | ||
|
|
2c0f97066e | ||
|
|
d13d14ccb2 | ||
|
|
05061eca7c | ||
|
|
06e0e52ca4 | ||
|
|
f0f62c8c4d | ||
|
|
c14ceb55b9 | ||
|
|
ab8932bfd9 | ||
|
|
6c6f6f4b23 | ||
|
|
da209f943b | ||
|
|
71cbc1ac1a | ||
|
|
98842516e1 | ||
|
|
14f4455e43 | ||
|
|
43e9e2a113 | ||
|
|
a055b2f07d | ||
|
|
95f14eb228 | ||
|
|
e0e2b93355 | ||
|
|
f95faa25ae | ||
|
|
bd65f25570 | ||
|
|
7880130e3e | ||
|
|
fe40b679d7 | ||
|
|
dd5611579b | ||
|
|
24bb5f8fb7 | ||
|
|
6487c0b370 | ||
|
|
1cd5bad9b8 | ||
|
|
3f3e78dc89 | ||
|
|
4e8ec90f24 | ||
|
|
a34e8b242e | ||
|
|
b2577f024b | ||
|
|
4c787a31df | ||
|
|
270ff8be14 | ||
|
|
6e40b8d825 | ||
|
|
0802356481 | ||
|
|
e187b40d31 | ||
|
|
ec94982bec | ||
|
|
94556574b5 | ||
|
|
7aadf26359 | ||
|
|
48c4bf30fd | ||
|
|
ed2e77eae6 | ||
|
|
8ed97fd2b2 | ||
|
|
e6070f227e | ||
|
|
7a709ad88d | ||
|
|
c373ab641b | ||
|
|
b359704747 | ||
|
|
abf3f74b21 | ||
|
|
9874f80b2e | ||
|
|
14594e38ad | ||
|
|
ee7e9e3b66 | ||
|
|
81c5003f91 | ||
|
|
792aeb0017 | ||
|
|
b6d4f2a27d | ||
|
|
b5e7f274a5 | ||
|
|
d6864e191b | ||
|
|
10c4beb7ea | ||
|
|
2d48e62447 | ||
|
|
8cc3c80e8a | ||
|
|
77315a51c1 | ||
|
|
e6062fb6da | ||
|
|
3bce8ffc3d | ||
|
|
eba83258a3 | ||
|
|
c932d6135c | ||
|
|
e4caef0ead | ||
|
|
33a1fa4e81 | ||
|
|
847480ae0f | ||
|
|
5422d56a71 | ||
|
|
7451638148 | ||
|
|
845346b3bb | ||
|
|
abd189e8dc | ||
|
|
8348436580 | ||
|
|
7404cdf3a1 | ||
|
|
ce24f7f59b | ||
|
|
7d31f09289 | ||
|
|
908c8647de | ||
|
|
90dcd4156c | ||
|
|
b2bc8a1ba0 | ||
|
|
77bb73e7af | ||
|
|
9d6af15318 | ||
|
|
441735026b | ||
|
|
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 @@
|
|||||||
|
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
/*.cache
|
||||||
|
/*.flc
|
||||||
|
/*.prj
|
||||||
|
/*~
|
||||||
|
/.tarball-version
|
||||||
|
/.version
|
||||||
|
/ABOUT-NLS
|
||||||
|
/COPYING
|
||||||
|
/ChangeLog
|
||||||
|
/GNUmakefile
|
||||||
|
/INSTALL
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/README-release
|
||||||
|
/_*
|
||||||
|
/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.6.1
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
COPYING
|
||||||
|
^bootstrap$
|
||||||
|
^doc/fdl\.texi$
|
||||||
|
^doc/gpl-3\.0\.texi$
|
||||||
|
^doc/yacc\.1\.in$
|
||||||
|
^src/parse-gram\.h$
|
||||||
@@ -5,4 +5,38 @@ Bison was written primarily by Robert Corbett.
|
|||||||
Richard Stallman made it Yacc-compatible.
|
Richard Stallman made it Yacc-compatible.
|
||||||
|
|
||||||
Wilfred Hansen of Carnegie Mellon University added multicharacter
|
Wilfred Hansen of Carnegie Mellon University added multicharacter
|
||||||
string literals and other features.
|
string literals and other features (Bison 1.25, 1995).
|
||||||
|
|
||||||
|
Akim Demaille rewrote the parser in Bison, and changed the back end to
|
||||||
|
use M4 (1.50, 2002).
|
||||||
|
|
||||||
|
Paul Hilfinger added GLR support (Bison 1.50, 2002).
|
||||||
|
|
||||||
|
Joel E. Denny contributed canonical-LR support, and invented and added
|
||||||
|
IELR and LAC (Lookahead Correction) support (Bison 2.5, 2011).
|
||||||
|
|
||||||
|
Paolo Bonzini contributed Java support (Bison 2.4, 2008).
|
||||||
|
|
||||||
|
Alex Rozenman added named reference support (Bison 2.5, 2011).
|
||||||
|
|
||||||
|
Paul Eggert fixed a million portability issues, arbitrary limitations,
|
||||||
|
and nasty bugs.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
Copyright (C) 1998-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -1,285 +1,626 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
The GNU General Public License is a free, copyleft license for
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
software and other kinds of works.
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
software--to make sure the software is free for all its users. This
|
The licenses for most software and other practical works are designed
|
||||||
General Public License applies to most of the Free Software
|
to take away your freedom to share and change the works. By contrast,
|
||||||
Foundation's software and to any other program whose authors commit to
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
share and change all versions of a program--to make sure it remains free
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
your programs, too.
|
your programs, too.
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
When we speak of free software, we are referring to freedom, not
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
have the freedom to distribute copies of free software (and charge for
|
have the freedom to distribute copies of free software (and charge for
|
||||||
this service if you wish), that you receive source code or can get it
|
them if you wish), that you receive source code or can get it if you
|
||||||
if you want it, that you can change the software or use pieces of it
|
want it, that you can change the software or use pieces of it in new
|
||||||
in new free programs; and that you know you can do these things.
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
To protect your rights, we need to prevent others from denying you
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
These restrictions translate to certain responsibilities for you if you
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
distribute copies of the software, or if you modify it.
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
For example, if you distribute copies of such a program, whether
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
you have. You must make sure that they, too, receive or can get the
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
source code. And you must show them these terms so they know their
|
or can get the source code. And you must show them these terms so they
|
||||||
rights.
|
know their rights.
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
distribute and/or modify the software.
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
that everyone understands that there is no warranty for this free
|
that there is no warranty for this free software. For both users' and
|
||||||
software. If the software is modified by someone else and passed on, we
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
want its recipients to know that what they have is not the original, so
|
changed, so that their problems will not be attributed erroneously to
|
||||||
that any problems introduced by others will not reflect on the original
|
authors of previous versions.
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
Some devices are designed to deny users access to install or run
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
modified versions of the software inside them, although the manufacturer
|
||||||
program will individually obtain patent licenses, in effect making the
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
protecting users' freedom to change the software. The systematic
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
TERMS AND CONDITIONS
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
0. Definitions.
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
source code as you receive it, in any medium, provided that you
|
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy, and
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
of it, thus forming a work based on the Program, and copy and
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
distribute such modifications or work under the terms of Section 1
|
"recipients" may be individuals or organizations.
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
stating that you changed the files and the date of any change.
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
A "covered work" means either the unmodified Program or a work based
|
||||||
whole or in part contains or is derived from the Program or any
|
on the Program.
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
To "propagate" a work means to do anything with it that, without
|
||||||
when run, you must cause it, when started running for such
|
permission, would make you directly or secondarily liable for
|
||||||
interactive use in the most ordinary way, to print or display an
|
infringement under applicable copyright law, except executing it on a
|
||||||
announcement including an appropriate copyright notice and a
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
notice that there is no warranty (or else, saying that you provide
|
distribution (with or without modification), making available to the
|
||||||
a warranty) and that users may redistribute the program under
|
public, and in some countries other activities as well.
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
License. (Exception: if the Program itself is interactive but
|
|
||||||
does not normally print such an announcement, your work based on
|
|
||||||
the Program is not required to print an announcement.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Program,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Program, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
To "convey" a work means any kind of propagation that enables other
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
exercise the right to control the distribution of derivative or
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
collective works based on the Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
to the extent that it includes a convenient and prominently visible
|
||||||
a storage or distribution medium does not bring the other work under
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
the scope of this License.
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
1. Source Code.
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
The "source code" for a work means the preferred form of the work
|
||||||
source code, which must be distributed under the terms of Sections
|
for making modifications to it. "Object code" means any non-source
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
form of a work.
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
A "Standard Interface" means an interface that either is an official
|
||||||
years, to give any third party, for a charge no more than your
|
standard defined by a recognized standards body, or, in the case of
|
||||||
cost of physically performing source distribution, a complete
|
interfaces specified for a particular programming language, one that
|
||||||
machine-readable copy of the corresponding source code, to be
|
is widely used among developers working in that language.
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
The "System Libraries" of an executable work include anything, other
|
||||||
to distribute corresponding source code. (This alternative is
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
allowed only for noncommercial distribution and only if you
|
packaging a Major Component, but which is not part of that Major
|
||||||
received the program in object code or executable form with such
|
Component, and (b) serves only to enable use of the work with that
|
||||||
an offer, in accord with Subsection b above.)
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
The "Corresponding Source" for a work in object code form means all
|
||||||
making modifications to it. For an executable work, complete source
|
the source code needed to generate, install, and (for an executable
|
||||||
code means all the source code for all modules it contains, plus any
|
work) run the object code and to modify the work, including scripts to
|
||||||
associated interface definition files, plus the scripts used to
|
control those activities. However, it does not include the work's
|
||||||
control compilation and installation of the executable. However, as a
|
System Libraries, or general-purpose tools or generally available free
|
||||||
special exception, the source code distributed need not include
|
programs which are used unmodified in performing those activities but
|
||||||
anything that is normally distributed (in either source or binary
|
which are not part of the work. For example, Corresponding Source
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
includes interface definition files associated with source files for
|
||||||
operating system on which the executable runs, unless that component
|
the work, and the source code for shared libraries and dynamically
|
||||||
itself accompanies the executable.
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
If distribution of executable or object code is made by offering
|
The Corresponding Source need not include anything that users
|
||||||
access to copy from a designated place, then offering equivalent
|
can regenerate automatically from other parts of the Corresponding
|
||||||
access to copy the source code from the same place counts as
|
Source.
|
||||||
distribution of the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
|
||||||
except as expressly provided under this License. Any attempt
|
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
|
||||||
void, and will automatically terminate your rights under this License.
|
|
||||||
However, parties who have received copies, or rights, from you under
|
|
||||||
this License will not have their licenses terminated so long as such
|
|
||||||
parties remain in full compliance.
|
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
The Corresponding Source for a work in source code form is that
|
||||||
signed it. However, nothing else grants you permission to modify or
|
same work.
|
||||||
distribute the Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
2. Basic Permissions.
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
All rights granted under this License are granted for the term of
|
||||||
these terms and conditions. You may not impose any further
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
You are not responsible for enforcing compliance by third parties to
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
this License.
|
this License.
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
infringement or for any other reason (not limited to patent issues),
|
patent license under the contributor's essential patent claims, to
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
excuse you from the conditions of this License. If you cannot
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
License and any other pertinent obligations, then as a consequence you
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
may not distribute the Program at all. For example, if a patent
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
license would not permit royalty-free redistribution of the Program by
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
all those who receive copies directly or indirectly through you, then
|
the Program, the only way you could satisfy both those terms and this
|
||||||
the only way you could satisfy both it and this License would be to
|
License would be to refrain entirely from conveying the Program.
|
||||||
refrain entirely from distribution of the Program.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
13. Use with the GNU Affero General Public License.
|
||||||
any particular circumstance, the balance of the section is intended to
|
|
||||||
apply and the section as a whole is intended to apply in other
|
|
||||||
circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
Notwithstanding any other provision of this License, you have
|
||||||
patents or other property right claims or to contest validity of any
|
permission to link or combine any covered work with a work licensed
|
||||||
such claims; this section has the sole purpose of protecting the
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
integrity of the free software distribution system, which is
|
combined work, and to convey the resulting work. The terms of this
|
||||||
implemented by public license practices. Many people have made
|
License will continue to apply to the part which is the covered work,
|
||||||
generous contributions to the wide range of software distributed
|
but the special requirements of the GNU Affero General Public License,
|
||||||
through that system in reliance on consistent application of that
|
section 13, concerning interaction through a network will apply to the
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
combination as such.
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
14. Revised Versions of this License.
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Program under this License
|
|
||||||
may add an explicit geographical distribution limitation excluding
|
|
||||||
those countries, so that distribution is permitted only in or among
|
|
||||||
countries not thus excluded. In such case, this License incorporates
|
|
||||||
the limitation as if written in the body of this License.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
of the General Public License from time to time. Such new versions will
|
the GNU General Public License from time to time. Such new versions will
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
address new problems or concerns.
|
address new problems or concerns.
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
Each version is given a distinguishing version number. If the
|
||||||
specifies a version number of this License which applies to it and "any
|
Program specifies that a certain numbered version of the GNU General
|
||||||
later version", you have the option of following the terms and conditions
|
Public License "or any later version" applies to it, you have the
|
||||||
either of that version or of any later version published by the Free
|
option of following the terms and conditions either of that numbered
|
||||||
Software Foundation. If the Program does not specify a version number of
|
version or of any later version published by the Free Software
|
||||||
this License, you may choose any version ever published by the Free Software
|
Foundation. If the Program does not specify a version number of the
|
||||||
Foundation.
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
If the Program specifies that a proxy can decide which future
|
||||||
programs whose distribution conditions are different, write to the author
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
public statement of acceptance of a version permanently authorizes you
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
to choose that version for the Program.
|
||||||
make exceptions for this. Our decision will be guided by the two goals
|
|
||||||
of preserving the free status of all derivatives of our free software and
|
|
||||||
of promoting the sharing and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
15. Disclaimer of Warranty.
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
||||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
||||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
||||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
||||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
||||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
||||||
REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
16. Limitation of Liability.
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
If you develop a new program, and you want it to be of the greatest
|
||||||
possible use to the public, the best way to achieve this is to make it
|
possible use to the public, the best way to achieve this is to make it
|
||||||
@@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
|
|||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
To do so, attach the following notices to the program. It is safest
|
||||||
to attach them to the start of each source file to most effectively
|
to attach them to the start of each source file to most effectively
|
||||||
convey the exclusion of warranty; and each file should have at least
|
state the exclusion of warranty; and each file should have at least
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
Copyright (C) <year> <name of author>
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
@@ -304,37 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
If the program does terminal interaction, make it output a short
|
||||||
when it starts in an interactive mode:
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) year name of author
|
<program> Copyright (C) <year> <name of author>
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
parts of the General Public License. Of course, the commands you use may
|
parts of the General Public License. Of course, your program's commands
|
||||||
be called something other than `show w' and `show c'; they could even be
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
necessary. Here is a sample; alter the names:
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
The GNU General Public License does not permit incorporating your program
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
<signature of Ty Coon>, 1 April 1989
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
Ty Coon, President of Vice
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
This General Public License does not permit incorporating your program into
|
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
|
||||||
consider it more useful to permit linking proprietary applications with the
|
|
||||||
library. If this is what you want to do, use the GNU Library General
|
|
||||||
Public License instead of this License.
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
1996-05-12 Jim Meyering <[email protected]>
|
1996-05-12 Jim Meyering <[email protected]>
|
||||||
|
|
||||||
* src/bison.simple (__yy_memcpy) [__cplusplus]: Reorder declarations
|
* src/bison.simple (__yy_memcpy) [__cplusplus]: Reorder declarations
|
||||||
of variables f and t.
|
of variables f and t.
|
||||||
|
|
||||||
1996-05-11 Richard Stallman <[email protected]>
|
1996-05-11 Richard Stallman <[email protected]>
|
||||||
|
|
||||||
+7142
-20
File diff suppressed because it is too large
Load Diff
-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.
|
|
||||||
+64
-21
@@ -1,37 +1,80 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
## Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||||
## 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,
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# it under the terms of the GNU General Public License as published by
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## GNU General Public License for more details.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
## You should have received a copy of the GNU General Public License
|
# This program is distributed in the hope that it will be useful,
|
||||||
## along with this program; if not, write to the Free Software
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## 02110-1301 USA
|
# 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
|
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.
|
# Files installed for use by Automake.
|
||||||
aclocaldir = @aclocaldir@
|
aclocaldir = @aclocaldir@
|
||||||
aclocal_DATA = m4/bison-i18n.m4
|
aclocal_DATA = m4/bison-i18n.m4
|
||||||
|
|
||||||
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
|
EXTRA_DIST = .prev-version .version \
|
||||||
OChangeLog PACKAGING \
|
cfg.mk ChangeLog-1998 ChangeLog-2012 PACKAGING \
|
||||||
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
||||||
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
||||||
djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \
|
djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \
|
||||||
djgpp/fnchange.lst
|
djgpp/fnchange.lst djgpp/testsuite.sed
|
||||||
|
|
||||||
|
MAINTAINER_CHECKS = \
|
||||||
|
maintainer-check \
|
||||||
|
maintainer-push-check \
|
||||||
|
maintainer-xml-check \
|
||||||
|
maintainer-release-check
|
||||||
|
.PHONY: $(MAINTAINER_CHECKS)
|
||||||
|
$(MAINTAINER_CHECKS):
|
||||||
|
$(AM_V_GEN)cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||||
|
|
||||||
.PHONY: maintainer-check
|
# See comments in build-aux/git-version-gen. However, we make .version depend
|
||||||
maintainer-check:
|
# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the
|
||||||
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
# 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
|
||||||
|
$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
|
||||||
|
dist-hook: gen-ChangeLog
|
||||||
|
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
|
||||||
|
|
||||||
|
.PHONY: update-b4-copyright update-package-copyright-year
|
||||||
|
update-b4-copyright:
|
||||||
|
$(AM_V_GEN) 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:
|
||||||
|
$(AM_V_GEN)$(build_aux)/$@ configure.ac
|
||||||
|
|
||||||
|
gen_start_date = 2012-01-16
|
||||||
|
.PHONY: gen-ChangeLog
|
||||||
|
gen-ChangeLog:
|
||||||
|
$(AM_V_GEN)if test -d $(srcdir)/.git; then \
|
||||||
|
cl=$(distdir)/ChangeLog && \
|
||||||
|
rm -f $$cl.tmp && \
|
||||||
|
$(top_srcdir)/build-aux/gitlog-to-changelog \
|
||||||
|
--strip-tab \
|
||||||
|
--strip-cherry-pick \
|
||||||
|
--no-cluster \
|
||||||
|
--amend=$(srcdir)/build-aux/git-log-fix \
|
||||||
|
--srcdir=$(srcdir) \
|
||||||
|
--since=$(gen_start_date) > $$cl.tmp && \
|
||||||
|
mv -f $$cl.tmp $$cl; \
|
||||||
|
fi
|
||||||
|
|||||||
@@ -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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
Bison is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
Bison is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with autoconf; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
@@ -1,41 +1,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.
|
* Installation
|
||||||
See the file doc/FAQ for frequently asked questions.
|
** Build
|
||||||
|
See the file INSTALL for generic compilation and installation
|
||||||
|
instructions.
|
||||||
|
|
||||||
Bison requires GNU m4 1.4.3 or later. See:
|
Bison requires GNU m4 1.4.6 or later. See:
|
||||||
|
|
||||||
ftp://ftp.gnu.org/gnu/m4/m4-1.4.3.tar.gz
|
ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
|
||||||
|
|
||||||
Bison can work with pre-1.4.3 distributions of GNU m4 if they are
|
** Internationalization
|
||||||
sufficiently patched, but if you encounter a bug with an older
|
Bison supports two catalogues: one for Bison itself (i.e., for the
|
||||||
distribution and report a bug we will probably suggest that you
|
maintainer-side parser generation), and one for the generated parsers
|
||||||
upgrade to 1.4.3 as the first step in trying to fix it.
|
(i.e., for the user-side parser execution). The requirements between
|
||||||
|
both differ: bison needs ngettext, the generated parsers do not. To
|
||||||
|
simplify the build system, neither are installed if ngettext is not
|
||||||
|
supported, even if generated parsers could have been localized. See
|
||||||
|
http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html for
|
||||||
|
more details.
|
||||||
|
|
||||||
Please send bug reports to <[email protected]>. Please include the
|
* Questions
|
||||||
version number from `bison --version', and a complete, self-contained
|
See the section FAQ in the documentation (doc/bison.info) for
|
||||||
test case in each bug report.
|
frequently asked questions. The documentation is also available in
|
||||||
|
PDF and HTML, provided you have a recent version of Texinfo installed:
|
||||||
|
run "make pdf" or "make html".
|
||||||
|
|
||||||
If you have questions about using Bison and the documentation does
|
If you have questions about using Bison and the documentation does
|
||||||
not answer them, please send mail to <[email protected]>.
|
not answer them, please send mail to <[email protected]>.
|
||||||
|
|
||||||
|
* Bug reports
|
||||||
|
Please send bug reports to <[email protected]>. Please include the
|
||||||
|
version number from `bison --version', and a complete, self-contained
|
||||||
|
test case in each bug report.
|
||||||
|
|
||||||
|
* 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-2012 Free Software
|
||||||
|
Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
Bison is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
Bison is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with autoconf; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
+6
-8
@@ -12,21 +12,19 @@ the problems you encounter.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2009-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
GNU Bison is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
GNU Bison is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Bison; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
-79
@@ -1,79 +0,0 @@
|
|||||||
-*- outline -*-
|
|
||||||
|
|
||||||
These notes intend to help people working on the CVS versions of
|
|
||||||
Bison.
|
|
||||||
|
|
||||||
* Requirements
|
|
||||||
|
|
||||||
Only the sources are installed in the CVS repository (to ease the
|
|
||||||
maintenance, merges etc.), therefore you will have to get the latest
|
|
||||||
stable versions of the maintainer tools we depend upon, including:
|
|
||||||
|
|
||||||
- Automake <http://www.gnu.org/software/automake/>
|
|
||||||
- Autoconf <http://www.gnu.org/software/autoconf/>
|
|
||||||
- Flex <http://www.gnu.org/software/flex/>
|
|
||||||
- Gettext <http://www.gnu.org/software/gettext/>
|
|
||||||
- Gzip <http://www.gnu.org/software/gzip/>
|
|
||||||
- Tar <http://www.gnu.org/software/tar/>
|
|
||||||
- Wget <http://www.gnu.org/software/wget/>
|
|
||||||
|
|
||||||
As of this writing, the latest stable version of Gzip is 1.2.4 but we
|
|
||||||
suggest using test version 1.3.5 (or later, if one becomes available).
|
|
||||||
|
|
||||||
Valgrind <http://valgrind.org/> is also highly recommended, if
|
|
||||||
Valgrind supports your architecture.
|
|
||||||
|
|
||||||
Bison is written using Bison grammars, so there are bootstrapping
|
|
||||||
issues. The bootstrap script attempts to discover when the C code
|
|
||||||
generated from the grammars is out of date, and to bootstrap with an
|
|
||||||
out-of-date version of the C code, but the process is not foolproof.
|
|
||||||
Also, you may run into similar problems yourself if you modify Bison.
|
|
||||||
|
|
||||||
Only building the initial full source tree will be a bit painful,
|
|
||||||
later, a plain `cvs update -P && make' should be sufficient.
|
|
||||||
|
|
||||||
* First CVS checkout
|
|
||||||
|
|
||||||
Obviously, if you are reading these notes, you did manage to check out
|
|
||||||
Bison from CVS. For the records, you will find all the relevant
|
|
||||||
information on:
|
|
||||||
|
|
||||||
http://savannah.gnu.org/cvs/?group_id=56
|
|
||||||
|
|
||||||
The next step is asking the installation of all the missing files:
|
|
||||||
|
|
||||||
$ ./bootstrap
|
|
||||||
|
|
||||||
And there you are! Just
|
|
||||||
|
|
||||||
$ ./configure && make && make check
|
|
||||||
|
|
||||||
At this point, there should be no difference between your local copy,
|
|
||||||
and the CVS master copy:
|
|
||||||
|
|
||||||
$ cvs diff
|
|
||||||
|
|
||||||
should output no difference.
|
|
||||||
|
|
||||||
Enjoy!
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004, 2005, 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.
|
|
||||||
+423
@@ -0,0 +1,423 @@
|
|||||||
|
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 commit message.
|
||||||
|
|
||||||
|
** Bug reports
|
||||||
|
If somebody reports a new bug, mention his name in the commit message
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
* 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 it 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. Note, however, that when gnulib is updated, running
|
||||||
|
'./bootstrap' again might be needed.
|
||||||
|
|
||||||
|
** 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 repository 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.
|
||||||
|
|
||||||
|
** make maintainer-check-valgrind
|
||||||
|
This target uses valgrind both to check bison, and the generated parsers.
|
||||||
|
|
||||||
|
This is not mature on Mac OS X. First, Valgrind does support the way bison
|
||||||
|
calls m4, so Valgrind cannot be used to check bison on Mac OS X.
|
||||||
|
|
||||||
|
Second, there are many errors that come from the platform itself, not from
|
||||||
|
bison. build-aux/darwin11.4.0.valgrind addresses some of them.
|
||||||
|
|
||||||
|
Third, valgrind issues warnings such as:
|
||||||
|
|
||||||
|
--99312:0:syswrap- WARNING: Ignoring sigreturn( ..., UC_RESET_ALT_STACK );
|
||||||
|
|
||||||
|
which cause the test to fail uselessly. It is hard to ignore these errors
|
||||||
|
with a major overhaul of the way instrumentation is performed in the test
|
||||||
|
suite. So currently, do not try to run valgrind on Mac OS X.
|
||||||
|
|
||||||
|
** Release checks
|
||||||
|
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.
|
||||||
|
|
||||||
|
- Maybe build with -DGNULIB_POSIXCHECK, which suggests gnulib modules
|
||||||
|
that can fix portability issues. See if you really want to pay
|
||||||
|
attention to its warnings; there's no need to obey blindly to it
|
||||||
|
(<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00057.html>).
|
||||||
|
|
||||||
|
- Check with "make syntax-check" if there are issues diagnosed by
|
||||||
|
gnulib.
|
||||||
|
|
||||||
|
- run "make maintainer-check" which:
|
||||||
|
- runs "valgrind -q bison" to run Bison under Valgrind.
|
||||||
|
- runs the parsers under Valgrind.
|
||||||
|
- runs the 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.
|
||||||
|
|
||||||
|
- running "make maintainer-release-check" takes care of running
|
||||||
|
maintainer-check, maintainer-push-check and maintainer-xml-check.
|
||||||
|
|
||||||
|
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
||||||
|
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
|
||||||
|
This section needs to be updated to take into account features from
|
||||||
|
gnulib. In particular, be sure to read README-release.
|
||||||
|
|
||||||
|
** Update the submodules. See above.
|
||||||
|
|
||||||
|
** Update maintainer tools, such as Autoconf. See above.
|
||||||
|
|
||||||
|
** Try to get the *.pot files to the Translation Project at least one
|
||||||
|
week before a stable release, to give them time to translate them.
|
||||||
|
Before generating the *.pot files, make sure that po/POTFILES.in and
|
||||||
|
runtime-po/POTFILES.in list all files with translatable strings.
|
||||||
|
This helps: grep -l '\<_(' *
|
||||||
|
|
||||||
|
** Tests
|
||||||
|
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, commit and tag.
|
||||||
|
See do-release-commit-and-tag in README-release. For a while, we used
|
||||||
|
beta names such as "2.6_rc1". Now that we use gnulib in the release
|
||||||
|
procedure, we must use "2.5.90", which has the additional benefit of
|
||||||
|
being properly sorted in "git tag -l".
|
||||||
|
|
||||||
|
** make alpha, beta, or stable
|
||||||
|
See README-release.
|
||||||
|
|
||||||
|
** Upload
|
||||||
|
There are two ways to upload the tarballs to the GNU servers: using
|
||||||
|
gnupload (from gnulib), or by hand. Obviously prefer the former. But
|
||||||
|
in either case, be sure to read the following paragraph.
|
||||||
|
|
||||||
|
*** Setup
|
||||||
|
You need "gnupg".
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
*** Using gnupload
|
||||||
|
You need "ncftp".
|
||||||
|
|
||||||
|
At the end "make stable" (or alpha/beta) will display the procedure to
|
||||||
|
run. Just copy and paste it in your shell.
|
||||||
|
|
||||||
|
*** By hand
|
||||||
|
|
||||||
|
The generic GNU upload procedure is at:
|
||||||
|
|
||||||
|
http://www.gnu.org/prep/maintain/maintain.html#Automated-FTP-Uploads
|
||||||
|
|
||||||
|
Follow the instructions there to register your information so you're permitted
|
||||||
|
to upload.
|
||||||
|
|
||||||
|
Here's a brief reminder of how to roll the tarballs and upload them:
|
||||||
|
|
||||||
|
*** 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.xz.
|
||||||
|
|
||||||
|
** 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
|
||||||
|
The "make stable" (or alpha/beta) command just created a template,
|
||||||
|
$HOME/announce-bison-X.Y. Otherwise, to generate it, run:
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
** Prepare NEWS
|
||||||
|
So that developers don't accidentally add new items to the old NEWS
|
||||||
|
entry, create a new empty entry in line 3 (without the two leading
|
||||||
|
spaces):
|
||||||
|
|
||||||
|
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||||
|
|
||||||
|
Push these changes.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
Copyright (C) 2002-2005, 2007-2012 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/>.
|
||||||
|
|
||||||
|
LocalWords: Automake Autoconf Gettext Gzip Rsync Valgrind gnulib submodules
|
||||||
|
LocalWords: submodule init cd distcheck checkin ChangeLog valgrind sigreturn
|
||||||
|
LocalWords: UC gcc DGNULIB POSIXCHECK xml XSLT glr lalr README po runtime rc
|
||||||
|
LocalWords: gnupload gnupg gpg keyserver BDF ncftp filename clearsign cvs dir
|
||||||
|
LocalWords: symlinks vti html lt POSIX Cc'ed
|
||||||
|
|
||||||
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
fill-column: 76
|
||||||
|
End:
|
||||||
@@ -8,45 +8,69 @@ Alexander Belopolsky [email protected]
|
|||||||
Alexandre Duret-Lutz [email protected]
|
Alexandre Duret-Lutz [email protected]
|
||||||
Andreas Schwab [email protected]
|
Andreas Schwab [email protected]
|
||||||
Andrew Suffield [email protected]
|
Andrew Suffield [email protected]
|
||||||
|
Angelo Borsotti [email protected]
|
||||||
Anthony Heading [email protected]
|
Anthony Heading [email protected]
|
||||||
Arnold Robbins [email protected]
|
Arnold Robbins [email protected]
|
||||||
Art Haas [email protected]
|
Art Haas [email protected]
|
||||||
Baron Schwartz [email protected]
|
Baron Schwartz [email protected]
|
||||||
|
Ben Pfaff [email protected]
|
||||||
Benoit Perrot [email protected]
|
Benoit Perrot [email protected]
|
||||||
|
Bernd Kiefer [email protected]
|
||||||
Bert Deknuydt [email protected]
|
Bert Deknuydt [email protected]
|
||||||
|
Bill Allombert [email protected]
|
||||||
|
Bob Rossi [email protected]
|
||||||
|
Brandon Lucia [email protected]
|
||||||
Bruce Lilly [email protected]
|
Bruce Lilly [email protected]
|
||||||
Bruno Haible [email protected]
|
Bruno Haible [email protected]
|
||||||
Charles-Henri de Boysson [email protected]
|
Charles-Henri de Boysson [email protected]
|
||||||
|
Christian Burger [email protected]
|
||||||
Cris Bailiff [email protected]
|
Cris Bailiff [email protected]
|
||||||
Cris van Pelt [email protected]
|
Cris van Pelt [email protected]
|
||||||
|
Csaba Raduly [email protected]
|
||||||
|
Dagobert Michelsen [email protected]
|
||||||
Daniel Hagerty [email protected]
|
Daniel Hagerty [email protected]
|
||||||
David J. MacKenzie [email protected]
|
David J. MacKenzie [email protected]
|
||||||
Derek M. Jones [email protected]
|
David Kastrup [email protected]
|
||||||
|
Derek M. Jones [email protected]
|
||||||
|
Di-an Jan [email protected]
|
||||||
Dick Streefland [email protected]
|
Dick Streefland [email protected]
|
||||||
|
Didier Godefroy [email protected]
|
||||||
Enrico Scholz [email protected]
|
Enrico Scholz [email protected]
|
||||||
|
Eric Blake [email protected]
|
||||||
Evgeny Stambulchik [email protected]
|
Evgeny Stambulchik [email protected]
|
||||||
Fabrice Bauzac [email protected]
|
Fabrice Bauzac [email protected]
|
||||||
Florian Krohm [email protected]
|
Florian Krohm [email protected]
|
||||||
Frank Heckenbach [email protected]
|
Frank Heckenbach [email protected]
|
||||||
|
Frans Englich [email protected]
|
||||||
|
Georg Sauthoff [email protected]
|
||||||
|
George Neuner [email protected]
|
||||||
|
Gilles Espinasse [email protected]
|
||||||
|
Goran Uddeborg [email protected]
|
||||||
Guido Trentalancia [email protected]
|
Guido Trentalancia [email protected]
|
||||||
H. Merijn Brand [email protected]
|
H. Merijn Brand [email protected]
|
||||||
Hans Aberg [email protected]
|
Hans Aberg [email protected]
|
||||||
Jan Nieuwenhuizen [email protected]
|
Jan Nieuwenhuizen [email protected]
|
||||||
|
Jerry Quinn [email protected]
|
||||||
Jesse Thilo [email protected]
|
Jesse Thilo [email protected]
|
||||||
Jim Kent [email protected]
|
Jim Kent [email protected]
|
||||||
Jim Meyering [email protected]
|
Jim Meyering [email protected]
|
||||||
Joel E. Denny jdenny@ces.clemson.edu
|
Joel E. Denny joeldenny@joeldenny.org
|
||||||
Juan Manuel Guerrero [email protected]
|
Johan van Selst [email protected]
|
||||||
|
Jonathan Nieder [email protected]
|
||||||
|
Juan Manuel Guerrero [email protected]
|
||||||
Kees Zeelenberg [email protected]
|
Kees Zeelenberg [email protected]
|
||||||
Keith Browne [email protected]
|
Keith Browne [email protected]
|
||||||
Laurent Mascherpa [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
|
Lie Yan [email protected]
|
||||||
Magnus Fromreide [email protected]
|
Magnus Fromreide [email protected]
|
||||||
Marc Autret [email protected]
|
Marc Autret [email protected]
|
||||||
|
Martin Jacobs [email protected]
|
||||||
Martin Mokrejs [email protected]
|
Martin Mokrejs [email protected]
|
||||||
Martin Nylin [email protected]
|
Martin Nylin [email protected]
|
||||||
Matt Kraai [email protected]
|
Matt Kraai [email protected]
|
||||||
Matt Rosing [email protected]
|
Matt Rosing [email protected]
|
||||||
Michael Hayes [email protected]
|
Michael Hayes [email protected]
|
||||||
|
Michael Raskin [email protected]
|
||||||
Mickael Labau [email protected]
|
Mickael Labau [email protected]
|
||||||
Mike Castle [email protected]
|
Mike Castle [email protected]
|
||||||
Neil Booth [email protected]
|
Neil Booth [email protected]
|
||||||
@@ -54,7 +78,9 @@ Nelson H. F. Beebe [email protected]
|
|||||||
Nicolas Burrus [email protected]
|
Nicolas Burrus [email protected]
|
||||||
Nicolas Tisserand [email protected]
|
Nicolas Tisserand [email protected]
|
||||||
Noah Friedman [email protected]
|
Noah Friedman [email protected]
|
||||||
|
Odd Arild Olsen [email protected]
|
||||||
Oleg Smolsky [email protected]
|
Oleg Smolsky [email protected]
|
||||||
|
Paolo Bonzini [email protected]
|
||||||
Pascal Bart [email protected]
|
Pascal Bart [email protected]
|
||||||
Paul Eggert [email protected]
|
Paul Eggert [email protected]
|
||||||
Paul Hilfinger [email protected]
|
Paul Hilfinger [email protected]
|
||||||
@@ -65,19 +91,31 @@ Piotr Gackiewicz [email protected]
|
|||||||
Quoc Peyrot [email protected]
|
Quoc Peyrot [email protected]
|
||||||
R Blake [email protected]
|
R Blake [email protected]
|
||||||
Raja R Harinath [email protected]
|
Raja R Harinath [email protected]
|
||||||
|
Ralf Wildenhues [email protected]
|
||||||
Richard Stallman [email protected]
|
Richard Stallman [email protected]
|
||||||
Robert Anisko [email protected]
|
Robert Anisko [email protected]
|
||||||
|
Satya Kiran Popuri [email protected]
|
||||||
|
Sebastian Setzer [email protected]
|
||||||
|
Sebastien Fricker [email protected]
|
||||||
|
Sergei Steshenko [email protected]
|
||||||
Shura [email protected]
|
Shura [email protected]
|
||||||
Steve Murphy murf@parsetree.com
|
Stefano Lattarini stefano.lattarini@gmail.com
|
||||||
|
Steve Murphy [email protected]
|
||||||
|
Sum Wu [email protected]
|
||||||
|
Thiru Ramakrishnan [email protected]
|
||||||
Tim Josling [email protected]
|
Tim Josling [email protected]
|
||||||
|
Tim Landscheidt [email protected]
|
||||||
Tim Van Holder [email protected]
|
Tim Van Holder [email protected]
|
||||||
Tom Lane [email protected]
|
Tom Lane [email protected]
|
||||||
Tom Tromey [email protected]
|
Tom Tromey [email protected]
|
||||||
Tommy Nordgren [email protected]
|
Tommy Nordgren [email protected]
|
||||||
Troy A. Johnson [email protected]
|
Troy A. Johnson [email protected]
|
||||||
Tys Lefering [email protected]
|
Tys Lefering [email protected]
|
||||||
Vin Shelton [email protected]
|
Vin Shelton [email protected]
|
||||||
|
W.C.A. Wijngaards [email protected]
|
||||||
Wayne Green [email protected]
|
Wayne Green [email protected]
|
||||||
|
Wei Song [email protected]
|
||||||
|
Wolfgang S. Kechel [email protected]
|
||||||
Wolfram Wagner [email protected]
|
Wolfram Wagner [email protected]
|
||||||
Wwp [email protected]
|
Wwp [email protected]
|
||||||
Zack Weinberg [email protected]
|
Zack Weinberg [email protected]
|
||||||
@@ -88,3 +126,22 @@ thank them! Please, help us keeping this list up to date.
|
|||||||
Local Variables:
|
Local Variables:
|
||||||
mode: text
|
mode: text
|
||||||
End:
|
End:
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
Copyright (C) 2000-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Bison, the GNU Parser Generator.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -1,39 +1,140 @@
|
|||||||
-*- outline -*-
|
* Short term
|
||||||
|
** Variable names.
|
||||||
|
What should we name `variant' and `lex_symbol'?
|
||||||
|
|
||||||
* Header guards
|
** Use b4_symbol in all the skeleton
|
||||||
|
Move its definition in the more standard places and deploy it in other
|
||||||
|
skeletons. Then remove the older system, including the tables
|
||||||
|
generated by output.c
|
||||||
|
|
||||||
From Franc,ois: should we keep the directory part in the CPP guard?
|
** Update the documentation on gnu.org
|
||||||
|
|
||||||
|
** Get rid of fake #lines [Bison: ...]
|
||||||
|
Possibly as simple as checking whether the column number is nonnegative.
|
||||||
|
|
||||||
|
I have seen messages like the following from GCC.
|
||||||
|
|
||||||
|
<built-in>:0: fatal error: opening dependency file .deps/libltdl/argz.Tpo: No such file or directory
|
||||||
|
|
||||||
|
|
||||||
* Yacc.c: CPP Macros
|
** Discuss about %printer/%destroy in the case of C++.
|
||||||
|
It would be very nice to provide the symbol classes with an operator<<
|
||||||
|
and a destructor. Unfortunately the syntax we have chosen for
|
||||||
|
%destroy and %printer make them hard to reuse. For instance, the user
|
||||||
|
is invited to write something like
|
||||||
|
|
||||||
Do some people use YYPURE, YYLSP_NEEDED like we do in the test suite?
|
%printer { debug_stream() << $$; } <my_type>;
|
||||||
They should not: it is not documented. But if they need to, let's
|
|
||||||
find something clean (not like YYLSP_NEEDED...).
|
which is hard to reuse elsewhere since it wants to use
|
||||||
|
"debug_stream()" to find the stream to use. The same applies to
|
||||||
|
%destroy: we told the user she could use the members of the Parser
|
||||||
|
class in the printers/destructors, which is not good for an operator<<
|
||||||
|
since it is no longer bound to a particular parser, it's just a
|
||||||
|
(standalone symbol).
|
||||||
|
|
||||||
|
** Rename LR0.cc
|
||||||
|
as lr0.cc, why upper case?
|
||||||
|
|
||||||
|
** bench several bisons.
|
||||||
|
Enhance bench.pl with %b to run different bisons.
|
||||||
|
|
||||||
|
* Various
|
||||||
|
** Warnings
|
||||||
|
Warnings about type tags that are used in printer and dtors, but not
|
||||||
|
for symbols?
|
||||||
|
|
||||||
|
** YYERRCODE
|
||||||
|
Defined to 256, but not used, not documented. Probably the token
|
||||||
|
number for the error token, which POSIX wants to be 256, but which
|
||||||
|
Bison might renumber if the user used number 256. Keep fix and doc?
|
||||||
|
Throw away?
|
||||||
|
|
||||||
|
Also, why don't we output the token name of the error token in the
|
||||||
|
output? It is explicitly skipped:
|
||||||
|
|
||||||
|
/* Skip error token and tokens without identifier. */
|
||||||
|
if (sym != errtoken && id)
|
||||||
|
|
||||||
|
Of course there are issues with name spaces, but if we disable we have
|
||||||
|
something which seems to be more simpler and more consistent instead
|
||||||
|
of the special case YYERRCODE.
|
||||||
|
|
||||||
|
enum yytokentype {
|
||||||
|
error = 256,
|
||||||
|
// ...
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
* Installation
|
We could (should?) also treat the case of the undef_token, which is
|
||||||
|
numbered 257 for yylex, and 2 internal. Both appear for instance in
|
||||||
|
toknum:
|
||||||
|
|
||||||
** Disable installation of yacc.
|
const unsigned short int
|
||||||
|
parser::yytoken_number_[] =
|
||||||
|
{
|
||||||
|
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
||||||
|
|
||||||
Add an option to 'configure' that allows people to install Bison
|
while here
|
||||||
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
|
enum yytokentype {
|
||||||
Before releasing, make sure the documentation ("Understanding your
|
TOK_EOF = 0,
|
||||||
parser") refers to the current `output' format.
|
TOK_EQ = 258,
|
||||||
|
|
||||||
* lalr1.cc
|
so both 256 and 257 are "mysterious".
|
||||||
** vector
|
|
||||||
Move to using vector, drop stack.hh.
|
const char*
|
||||||
|
const parser::yytname_[] =
|
||||||
|
{
|
||||||
|
"\"end of command\"", "error", "$undefined", "\"=\"", "\"break\"",
|
||||||
|
|
||||||
|
|
||||||
|
** YYFAIL
|
||||||
|
It is seems to be *really* obsolete now, shall we remove it?
|
||||||
|
|
||||||
|
** yychar == yyempty_
|
||||||
|
The code in yyerrlab reads:
|
||||||
|
|
||||||
|
if (yychar <= YYEOF)
|
||||||
|
{
|
||||||
|
/* Return failure if at end of input. */
|
||||||
|
if (yychar == YYEOF)
|
||||||
|
YYABORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
There are only two yychar that can be <= YYEOF: YYEMPTY and YYEOF.
|
||||||
|
But I can't produce the situation where yychar is YYEMPTY here, is it
|
||||||
|
really possible? The test suite does not exercise this case.
|
||||||
|
|
||||||
|
This shows that it would be interesting to manage to install skeleton
|
||||||
|
coverage analysis to the test suite.
|
||||||
|
|
||||||
|
** Table definitions
|
||||||
|
It should be very easy to factor the definition of the various tables,
|
||||||
|
including the separation bw declaration and definition. See for
|
||||||
|
instance b4_table_define in lalr1.cc. This way, we could even factor
|
||||||
|
C vs. C++ definitions.
|
||||||
|
|
||||||
|
* From lalr1.cc to yacc.c
|
||||||
|
** Single stack
|
||||||
|
Merging the three stacks in lalr1.cc simplified the code, prompted for
|
||||||
|
other improvements and also made it faster (probably because memory
|
||||||
|
management is performed once instead of three times). I suggest that
|
||||||
|
we do the same in yacc.c.
|
||||||
|
|
||||||
|
** yysyntax_error
|
||||||
|
The code bw glr.c and yacc.c is really alike, we can certainly factor
|
||||||
|
some parts.
|
||||||
|
|
||||||
** I18n
|
|
||||||
Catch up with yacc.c.
|
|
||||||
|
|
||||||
* Report
|
* Report
|
||||||
|
|
||||||
|
** Figures
|
||||||
|
Some statistics about the grammar and the parser would be useful,
|
||||||
|
especially when asking the user to send some information about the
|
||||||
|
grammars she is working on. We should probably also include some
|
||||||
|
information about the variables (I'm not sure for instance we even
|
||||||
|
specify what LR variant was used).
|
||||||
|
|
||||||
** GLR
|
** GLR
|
||||||
How would Paul like to display the conflicted actions? In particular,
|
How would Paul like to display the conflicted actions? In particular,
|
||||||
what when two reductions are possible on a given lookahead token, but one is
|
what when two reductions are possible on a given lookahead token, but one is
|
||||||
@@ -56,39 +157,17 @@ Provide better assistance for understanding the conflicts by providing
|
|||||||
a sample text exhibiting the (LALR) ambiguity. See the paper from
|
a sample text exhibiting the (LALR) ambiguity. See the paper from
|
||||||
DeRemer and Penello: they already provide the algorithm.
|
DeRemer and Penello: they already provide the algorithm.
|
||||||
|
|
||||||
|
** Statically check for potential ambiguities in GLR grammars. See
|
||||||
|
<http://www.i3s.unice.fr/~schmitz/papers.html#expamb> for an approach.
|
||||||
|
|
||||||
|
|
||||||
* Extensions
|
* Extensions
|
||||||
|
|
||||||
** Labeling the symbols
|
|
||||||
Have a look at the Lemon parser generator: instead of $1, $2 etc. they
|
|
||||||
can name the values. This is much more pleasant. For instance:
|
|
||||||
|
|
||||||
exp (res): exp (a) '+' exp (b) { $res = $a + $b; };
|
|
||||||
|
|
||||||
I love this. I have been bitten too often by the removal of the
|
|
||||||
symbol, and forgetting to shift all the $n to $n-1. If you are
|
|
||||||
unlucky, it compiles...
|
|
||||||
|
|
||||||
But instead of using $a etc., we can use regular variables. And
|
|
||||||
instead of using (), I propose to use `:' (again). Paul suggests
|
|
||||||
supporting `->' in addition to `:' to separate LHS and RHS. In other
|
|
||||||
words:
|
|
||||||
|
|
||||||
r:exp -> a:exp '+' b:exp { r = a + b; };
|
|
||||||
|
|
||||||
That requires an significant improvement of the grammar parser. Using
|
|
||||||
GLR would be nice. It also requires that Bison know the type of the
|
|
||||||
symbols (which will be useful for %include anyway). So we have some
|
|
||||||
time before...
|
|
||||||
|
|
||||||
Note that there remains the problem of locations: `@r'?
|
|
||||||
|
|
||||||
|
|
||||||
** $-1
|
** $-1
|
||||||
We should find a means to provide an access to values deep in the
|
We should find a means to provide an access to values deep in the
|
||||||
stack. For instance, instead of
|
stack. For instance, instead of
|
||||||
|
|
||||||
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
|
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
|
||||||
|
|
||||||
we should be able to have:
|
we should be able to have:
|
||||||
|
|
||||||
@@ -103,9 +182,6 @@ must be in the scanner: we must not parse what is in a switched off
|
|||||||
part of %if. Akim Demaille thinks it should be in the parser, so as
|
part of %if. Akim Demaille thinks it should be in the parser, so as
|
||||||
to avoid falling into another CPP mistake.
|
to avoid falling into another CPP mistake.
|
||||||
|
|
||||||
** -D, --define-muscle NAME=VALUE
|
|
||||||
To define muscles via cli. Or maybe support directly NAME=VALUE?
|
|
||||||
|
|
||||||
** XML Output
|
** XML Output
|
||||||
There are couple of available extensions of Bison targeting some XML
|
There are couple of available extensions of Bison targeting some XML
|
||||||
output. Some day we should consider including them. One issue is
|
output. Some day we should consider including them. One issue is
|
||||||
@@ -124,13 +200,13 @@ XML output for GNU Bison
|
|||||||
* Unit rules
|
* Unit rules
|
||||||
Maybe we could expand unit rules, i.e., transform
|
Maybe we could expand unit rules, i.e., transform
|
||||||
|
|
||||||
exp: arith | bool;
|
exp: arith | bool;
|
||||||
arith: exp '+' exp;
|
arith: exp '+' exp;
|
||||||
bool: exp '&' exp;
|
bool: exp '&' exp;
|
||||||
|
|
||||||
into
|
into
|
||||||
|
|
||||||
exp: exp '+' exp | exp '&' exp;
|
exp: exp '+' exp | exp '&' exp;
|
||||||
|
|
||||||
when there are no actions. This can significantly speed up some
|
when there are no actions. This can significantly speed up some
|
||||||
grammars. I can't find the papers. In particular the book `LR
|
grammars. I can't find the papers. In particular the book `LR
|
||||||
@@ -146,80 +222,30 @@ this issue. Does anybody have it?
|
|||||||
Some history of Bison and some bibliography would be most welcome.
|
Some history of Bison and some bibliography would be most welcome.
|
||||||
Are there any Texinfo standards for bibliography?
|
Are there any Texinfo standards for bibliography?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Java, Fortran, etc.
|
|
||||||
|
|
||||||
|
|
||||||
** Java
|
|
||||||
|
|
||||||
There are a couple of proposed outputs:
|
|
||||||
|
|
||||||
- BYACC/J
|
|
||||||
which is based on Byacc.
|
|
||||||
<http://troi.lincom-asg.com/~rjamison/byacc/>
|
|
||||||
|
|
||||||
- Bison Java
|
|
||||||
which is based on Bison.
|
|
||||||
<http://www.goice.co.jp/member/mo/hack-progs/bison-java.html>
|
|
||||||
|
|
||||||
Sebastien Serrurier ([email protected]) is working on this: he is
|
|
||||||
expected to contact the authors, design the output, and implement it
|
|
||||||
into Bison.
|
|
||||||
|
|
||||||
|
|
||||||
* Coding system independence
|
* Coding system independence
|
||||||
Paul notes:
|
Paul notes:
|
||||||
|
|
||||||
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
|
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
|
||||||
255). It also assumes that the 8-bit character encoding is
|
255). It also assumes that the 8-bit character encoding is
|
||||||
the same for the invocation of 'bison' as it is for the
|
the same for the invocation of 'bison' as it is for the
|
||||||
invocation of 'cc', but this is not necessarily true when
|
invocation of 'cc', but this is not necessarily true when
|
||||||
people run bison on an ASCII host and then use cc on an EBCDIC
|
people run bison on an ASCII host and then use cc on an EBCDIC
|
||||||
host. I don't think these topics are worth our time
|
host. I don't think these topics are worth our time
|
||||||
addressing (unless we find a gung-ho volunteer for EBCDIC or
|
addressing (unless we find a gung-ho volunteer for EBCDIC or
|
||||||
PDP-10 ports :-) but they should probably be documented
|
PDP-10 ports :-) but they should probably be documented
|
||||||
somewhere.
|
somewhere.
|
||||||
|
|
||||||
More importantly, Bison does not currently allow NUL bytes in
|
More importantly, Bison does not currently allow NUL bytes in
|
||||||
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
||||||
the source code. This should get fixed.
|
the source code. This should get fixed.
|
||||||
|
|
||||||
* --graph
|
* --graph
|
||||||
Show reductions.
|
Show reductions.
|
||||||
|
|
||||||
* Broken options ?
|
* Broken options ?
|
||||||
** %no-parser
|
|
||||||
** %token-table
|
** %token-table
|
||||||
** Skeleton strategy
|
** Skeleton strategy
|
||||||
Must we keep %no-parser? %token-table?
|
Must we keep %token-table?
|
||||||
|
|
||||||
* src/print_graph.c
|
|
||||||
Find the best graph parameters.
|
|
||||||
|
|
||||||
* BTYacc
|
|
||||||
See if we can integrate backtracking in Bison. Charles-Henri de
|
|
||||||
Boysson <[email protected]> is working on this, and already has some
|
|
||||||
results. Vadim Maslow, the maintainer of BTYacc was contacted, and we
|
|
||||||
stay in touch with him. Adjusting the Bison grammar parser will be
|
|
||||||
needed to support some extra BTYacc features. This is less urgent.
|
|
||||||
|
|
||||||
** Keeping the conflicted actions
|
|
||||||
First, analyze the differences between byacc and btyacc (I'm referring
|
|
||||||
to the executables). Find where the conflicts are preserved.
|
|
||||||
|
|
||||||
** Compare with the GLR tables
|
|
||||||
See how isomorphic the way BTYacc and the way the GLR adjustments in
|
|
||||||
Bison are compatible. *As much as possible* one should try to use the
|
|
||||||
same implementation in the Bison executables. I insist: it should be
|
|
||||||
very feasible to use the very same conflict tables.
|
|
||||||
|
|
||||||
** Adjust the skeletons
|
|
||||||
Import the skeletons for C and C++.
|
|
||||||
|
|
||||||
** Improve the skeletons
|
|
||||||
Have them support yysymprint, yydestruct and so forth.
|
|
||||||
|
|
||||||
|
|
||||||
* Precedence
|
* Precedence
|
||||||
|
|
||||||
@@ -228,18 +254,6 @@ It is unfortunate that there is a total order for precedence. It
|
|||||||
makes it impossible to have modular precedence information. We should
|
makes it impossible to have modular precedence information. We should
|
||||||
move to partial orders (sounds like series/parallel orders to me).
|
move to partial orders (sounds like series/parallel orders to me).
|
||||||
|
|
||||||
This will be possible with a Bison parser for the grammar, as it will
|
|
||||||
make it much easier to extend the grammar.
|
|
||||||
|
|
||||||
** Correlation b/w precedence and associativity
|
|
||||||
Also, I fail to understand why we have to assign the same
|
|
||||||
associativity to operators with the same precedence. For instance,
|
|
||||||
why can't I decide that the precedence of * and / is the same, but the
|
|
||||||
latter is nonassoc?
|
|
||||||
|
|
||||||
If there is really no profound motivation, we should find a new syntax
|
|
||||||
to allow specifying this.
|
|
||||||
|
|
||||||
** RR conflicts
|
** RR conflicts
|
||||||
See if we can use precedence between rules to solve RR conflicts. See
|
See if we can use precedence between rules to solve RR conflicts. See
|
||||||
what POSIX says.
|
what POSIX says.
|
||||||
@@ -268,20 +282,6 @@ $<type_name>$ = $<type_name>1. I therefore think that one should implement
|
|||||||
a Bison option where every typed default rule is explicitly written out
|
a Bison option where every typed default rule is explicitly written out
|
||||||
(same typed ruled can of course be grouped together).
|
(same typed ruled can of course be grouped together).
|
||||||
|
|
||||||
Note: Robert Anisko handles this. He knows how to do it.
|
|
||||||
|
|
||||||
|
|
||||||
* Warnings
|
|
||||||
It would be nice to have warning support. See how Autoconf handles
|
|
||||||
them, it is fairly well described there. It would be very nice to
|
|
||||||
implement this in such a way that other programs could use
|
|
||||||
lib/warnings.[ch].
|
|
||||||
|
|
||||||
Don't work on this without first announcing you do, as I already have
|
|
||||||
thought about it, and know many of the components that can be used to
|
|
||||||
implement it.
|
|
||||||
|
|
||||||
|
|
||||||
* Pre and post actions.
|
* Pre and post actions.
|
||||||
From: Florian Krohm <[email protected]>
|
From: Florian Krohm <[email protected]>
|
||||||
Subject: YYACT_EPILOGUE
|
Subject: YYACT_EPILOGUE
|
||||||
@@ -310,28 +310,47 @@ at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
|
|||||||
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
|
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
|
||||||
to bison. If you're interested, I'll work on a patch.
|
to bison. If you're interested, I'll work on a patch.
|
||||||
|
|
||||||
* Move to Graphviz
|
* Better graphics
|
||||||
Well, VCG seems really dead. Move to Graphviz instead. Also, equip
|
Equip the parser with a means to create the (visual) parse tree.
|
||||||
the parser with a means to create the (visual) parse tree.
|
|
||||||
|
* Complaint submessage indentation.
|
||||||
|
We already have an implementation that works fairly well for named
|
||||||
|
reference messages, but it would be nice to use it consistently for all
|
||||||
|
submessages from Bison. For example, the "previous definition"
|
||||||
|
submessage or the list of correct values for a %define variable might
|
||||||
|
look better with indentation.
|
||||||
|
|
||||||
|
However, the current implementation makes the assumption that the
|
||||||
|
location printed on the first line is not usually much shorter than the
|
||||||
|
locations printed on the submessage lines that follow. That assumption
|
||||||
|
may not hold true as often for some kinds of submessages especially if
|
||||||
|
we ever support multiple grammar files.
|
||||||
|
|
||||||
|
Here's a proposal for how a new implementation might look:
|
||||||
|
|
||||||
|
http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00086.html
|
||||||
|
|
||||||
|
|
||||||
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
coding: utf-8
|
||||||
|
End:
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
|
Copyright (C) 2001-2004, 2006, 2008-2012 Free Software Foundation, Inc.
|
||||||
Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
Bison is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
Bison is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Bison; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
@@ -0,0 +1,95 @@
|
|||||||
|
# Bootstrap configuration.
|
||||||
|
|
||||||
|
# Copyright (C) 2006-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# gnulib modules used by this package.
|
||||||
|
gnulib_modules='
|
||||||
|
argmatch assert calloc-posix close closeout config-h c-strcase
|
||||||
|
configmake
|
||||||
|
dirname
|
||||||
|
error extensions fdl fopen-safer getopt-gnu
|
||||||
|
gettext git-version-gen gitlog-to-changelog
|
||||||
|
gpl-3.0 hash inttypes isnan javacomp-script
|
||||||
|
javaexec-script ldexpl malloc-gnu mbschr mbsrchr
|
||||||
|
mbswidth
|
||||||
|
obstack
|
||||||
|
obstack-printf
|
||||||
|
perror progname
|
||||||
|
quote quotearg
|
||||||
|
readme-release
|
||||||
|
realloc-posix
|
||||||
|
spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
|
||||||
|
unistd unistd-safer unlocked-io update-copyright unsetenv verify
|
||||||
|
warnings
|
||||||
|
xalloc xalloc-die xmemdup0 xstrndup
|
||||||
|
|
||||||
|
fprintf-posix printf-posix snprintf-posix sprintf-posix
|
||||||
|
vsnprintf-posix vsprintf-posix
|
||||||
|
'
|
||||||
|
|
||||||
|
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||||
|
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
|
||||||
|
'
|
||||||
|
|
||||||
|
gnulib_tool_option_extras='--symlink --makefile-name=gnulib.mk'
|
||||||
|
|
||||||
|
bootstrap_post_import_hook()
|
||||||
|
{
|
||||||
|
# Ensure that ChangeLog exists, for automake.
|
||||||
|
test -f ChangeLog || touch ChangeLog
|
||||||
|
}
|
||||||
|
|
||||||
|
bootstrap_epilogue()
|
||||||
|
{
|
||||||
|
# Make sure we don't need src/bison, which usually doesn't exist at
|
||||||
|
# the time of a bootstrap.
|
||||||
|
touch src/parse-gram.[ch]
|
||||||
|
|
||||||
|
perl -pi -e "s/\@PACKAGE\@/$package/g" README-release
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keep our bootstrap script in sync with gnulib's. If we ever need to
|
||||||
|
# maintain our own bootstrap script again, set this to false, remove
|
||||||
|
# the bootstrap entry from the file .x-update-copyright, and add any
|
||||||
|
# needed copyright years to the copyright statement in the bootstrap
|
||||||
|
# script.
|
||||||
|
bootstrap_sync=true
|
||||||
@@ -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,28 @@
|
|||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
|
/announce-gen
|
||||||
|
/arg-nonnull.h
|
||||||
|
/c++defs.h
|
||||||
|
/compile
|
||||||
|
/config.guess
|
||||||
|
/config.rpath
|
||||||
|
/config.sub
|
||||||
|
/depcomp
|
||||||
|
/do-release-commit-and-tag
|
||||||
|
/gendocs.sh
|
||||||
|
/git-version-gen
|
||||||
|
/gitlog-to-changelog
|
||||||
|
/gnu-web-doc-update
|
||||||
|
/gnupload
|
||||||
|
/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
|
||||||
+20
-2
@@ -1,2 +1,20 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
|
||||||
EXTRA_DIST = prev-version.txt
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
cross-options.pl \
|
||||||
|
darwin11.4.0.valgrind \
|
||||||
|
prev-version.txt \
|
||||||
|
update-b4-copyright
|
||||||
|
|||||||
@@ -1,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";
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Valgrind suppression file for Bison.
|
||||||
|
|
||||||
|
{
|
||||||
|
Mac OS X initialization
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:?alloc*
|
||||||
|
...
|
||||||
|
fun:*ImageLoader*
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Mac OS X initialization
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:?alloc*
|
||||||
|
...
|
||||||
|
fun:*dyld*
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Mac OS X initialization
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:?alloc*
|
||||||
|
...
|
||||||
|
fun:__CFInitialize
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Mac OS X I/O buffer
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:malloc
|
||||||
|
fun:__smakebuf
|
||||||
|
fun:__swsetup
|
||||||
|
fun:__sfvwrite
|
||||||
|
fun:fwrite
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Mac OS X I/O buffer
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:malloc
|
||||||
|
fun:__smakebuf
|
||||||
|
fun:__swsetup
|
||||||
|
fun:__swbuf
|
||||||
|
fun:putchar
|
||||||
|
}
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# End:
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# This file is expected to be used via gitlog-to-changelog's --amend=FILE
|
||||||
|
# option. It specifies what changes to make to each given SHA1's commit
|
||||||
|
# log and metadata, using Perl-eval'able expressions.
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/_Noreturn.h
|
||||||
|
/arg-nonnull.h
|
||||||
|
/c++defs.h
|
||||||
|
/warn-on-use.h
|
||||||
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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 3, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my $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-2012 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 3, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
|
||||||
|
if (!$this_year || $this_year !~ m/^\d{4}$/)
|
||||||
|
{
|
||||||
|
my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
|
||||||
|
$this_year = $year + 1900;
|
||||||
|
}
|
||||||
|
my $old_re = <<'EOF'
|
||||||
|
(
|
||||||
|
MACRO\(
|
||||||
|
\[PACKAGE_COPYRIGHT_YEAR],
|
||||||
|
\s*\[
|
||||||
|
)
|
||||||
|
(\d{4})
|
||||||
|
(?=])
|
||||||
|
EOF
|
||||||
|
;
|
||||||
|
foreach my $macro ("AC_DEFINE", "AC_SUBST")
|
||||||
|
{
|
||||||
|
my $this_old_re = $old_re;
|
||||||
|
$this_old_re =~ s/MACRO/$macro/;
|
||||||
|
if (!s/$this_old_re/$1$this_year/x)
|
||||||
|
{
|
||||||
|
print STDERR
|
||||||
|
"$ARGV: warning: failed to update PACKAGE_COPYRIGHT_YEAR in"
|
||||||
|
. " $macro.\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
# Customize maint.mk -*- makefile -*-
|
||||||
|
# Copyright (C) 2008-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Update version, then recompile so that tests/bison --version be
|
||||||
|
# up-to-date, then compile our parser again with our up-to-date bison.
|
||||||
|
.PHONY: regen
|
||||||
|
regen: _version
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS)
|
||||||
|
touch $(srcdir)/src/parse-gram.y
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS)
|
||||||
|
|
||||||
|
# Used in maint.mk's web-manual rule
|
||||||
|
manual_title = The Yacc-compatible Parser Generator
|
||||||
|
|
||||||
|
# It's useful to run maintainer-*check* targets during development, but we
|
||||||
|
# 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)))
|
||||||
|
|
||||||
|
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 \
|
||||||
|
sc_immutable_NEWS \
|
||||||
|
sc_prohibit_always_true_header_tests \
|
||||||
|
sc_prohibit_atoi_atof \
|
||||||
|
sc_prohibit_strcmp
|
||||||
|
|
||||||
|
# The local directory containing the checked-out copy of gnulib used in
|
||||||
|
# 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
|
||||||
|
|
||||||
|
exclude = \
|
||||||
|
$(foreach a,$(1),$(eval $(subst $$,$$$$,exclude_file_name_regexp--sc_$(a))))
|
||||||
|
$(call exclude, \
|
||||||
|
bindtextdomain=^lib/main.c$$ \
|
||||||
|
program_name=^lib/main.c$$ \
|
||||||
|
prohibit_always-defined_macros=^data/yacc.c$$|^djgpp/ \
|
||||||
|
prohibit_always-defined_macros+=?|^lib/timevar.c$$ \
|
||||||
|
prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \
|
||||||
|
prohibit_always-defined_macros+=?|^tests/regression.at$$ \
|
||||||
|
prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \
|
||||||
|
prohibit_magic_number_exit=^doc/bison.texi$$ \
|
||||||
|
prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
|
||||||
|
require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \
|
||||||
|
space_tab=^tests/(input|c\+\+)\.at$$ \
|
||||||
|
trailing_blank=^src/parse-gram.[ch]$$ \
|
||||||
|
unmarked_diagnostics=^(djgpp/|doc/bison.texi$$) \
|
||||||
|
)
|
||||||
-292
@@ -1,292 +0,0 @@
|
|||||||
/* config.hin. Generated from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
|
||||||
systems. This function is required for `alloca.c' support on those systems.
|
|
||||||
*/
|
|
||||||
#undef CRAY_STACKSEG_END
|
|
||||||
|
|
||||||
/* Define if using `alloca.c'. */
|
|
||||||
#undef C_ALLOCA
|
|
||||||
|
|
||||||
/* Define to 1 if translation of program messages to the user's native
|
|
||||||
language is requested. */
|
|
||||||
#undef ENABLE_NLS
|
|
||||||
|
|
||||||
/* Define if you have `alloca', as a function or macro. */
|
|
||||||
#undef HAVE_ALLOCA
|
|
||||||
|
|
||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
|
||||||
#undef HAVE_ALLOCA_H
|
|
||||||
|
|
||||||
/* Define if you have the <argz.h> header file. */
|
|
||||||
#undef HAVE_ARGZ_H
|
|
||||||
|
|
||||||
/* Define if you have the <ctype.h> header file. */
|
|
||||||
#undef HAVE_CTYPE_H
|
|
||||||
|
|
||||||
/* Define if backslash-a works in C strings. */
|
|
||||||
#undef HAVE_C_BACKSLASH_A
|
|
||||||
|
|
||||||
/* Define if you have the `dcgettext' function. */
|
|
||||||
#undef HAVE_DCGETTEXT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `memchr', and to 0 if you don't.
|
|
||||||
*/
|
|
||||||
#undef HAVE_DECL_MEMCHR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
|
|
||||||
*/
|
|
||||||
#undef HAVE_DECL_STPCPY
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
|
|
||||||
don't. */
|
|
||||||
#undef HAVE_DECL_STRERROR_R
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strndup', and to 0 if you
|
|
||||||
don't. */
|
|
||||||
#undef HAVE_DECL_STRNDUP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
|
|
||||||
don't. */
|
|
||||||
#undef HAVE_DECL_STRNLEN
|
|
||||||
|
|
||||||
/* Define if the malloc check has been performed. */
|
|
||||||
#undef HAVE_DONE_WORKING_MALLOC_CHECK
|
|
||||||
|
|
||||||
/* Define if the realloc check has been performed. */
|
|
||||||
#undef HAVE_DONE_WORKING_REALLOC_CHECK
|
|
||||||
|
|
||||||
/* Define if you have the `doprnt' function. */
|
|
||||||
#undef HAVE_DOPRNT
|
|
||||||
|
|
||||||
/* Define if you have the `feof_unlocked' function. */
|
|
||||||
#undef HAVE_FEOF_UNLOCKED
|
|
||||||
|
|
||||||
/* Define if you have the `fgets_unlocked' function. */
|
|
||||||
#undef HAVE_FGETS_UNLOCKED
|
|
||||||
|
|
||||||
/* Define if you have the `getcwd' function. */
|
|
||||||
#undef HAVE_GETCWD
|
|
||||||
|
|
||||||
/* Define if you have the `getegid' function. */
|
|
||||||
#undef HAVE_GETEGID
|
|
||||||
|
|
||||||
/* Define if you have the `geteuid' function. */
|
|
||||||
#undef HAVE_GETEUID
|
|
||||||
|
|
||||||
/* Define if you have the `getgid' function. */
|
|
||||||
#undef HAVE_GETGID
|
|
||||||
|
|
||||||
/* Define if you have the `getpagesize' function. */
|
|
||||||
#undef HAVE_GETPAGESIZE
|
|
||||||
|
|
||||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
|
||||||
#undef HAVE_GETTEXT
|
|
||||||
|
|
||||||
/* Define if you have the `getuid' function. */
|
|
||||||
#undef HAVE_GETUID
|
|
||||||
|
|
||||||
/* Define if you have the iconv() function. */
|
|
||||||
#undef HAVE_ICONV
|
|
||||||
|
|
||||||
/* Define if you have the <inttypes.h> header file. */
|
|
||||||
#undef HAVE_INTTYPES_H
|
|
||||||
|
|
||||||
/* Define if you have the `isascii' function. */
|
|
||||||
#undef HAVE_ISASCII
|
|
||||||
|
|
||||||
/* Define if you have the `iswprint' function. */
|
|
||||||
#undef HAVE_ISWPRINT
|
|
||||||
|
|
||||||
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
|
|
||||||
#undef HAVE_LANGINFO_CODESET
|
|
||||||
|
|
||||||
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
|
||||||
#undef HAVE_LC_MESSAGES
|
|
||||||
|
|
||||||
/* Define if you have the <limits.h> header file. */
|
|
||||||
#undef HAVE_LIMITS_H
|
|
||||||
|
|
||||||
/* Define if you have the <locale.h> header file. */
|
|
||||||
#undef HAVE_LOCALE_H
|
|
||||||
|
|
||||||
/* Define if you have the <malloc.h> header file. */
|
|
||||||
#undef HAVE_MALLOC_H
|
|
||||||
|
|
||||||
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
|
|
||||||
#undef HAVE_MBRTOWC
|
|
||||||
|
|
||||||
/* Define if you have the `mbsinit' function. */
|
|
||||||
#undef HAVE_MBSINIT
|
|
||||||
|
|
||||||
/* Define if you have the `memchr' function. */
|
|
||||||
#undef HAVE_MEMCHR
|
|
||||||
|
|
||||||
/* Define if you have the <memory.h> header file. */
|
|
||||||
#undef HAVE_MEMORY_H
|
|
||||||
|
|
||||||
/* Define if you have the `mempcpy' function. */
|
|
||||||
#undef HAVE_MEMPCPY
|
|
||||||
|
|
||||||
/* Define if you have the `mkstemp' function. */
|
|
||||||
#undef HAVE_MKSTEMP
|
|
||||||
|
|
||||||
/* Define if you have a working `mmap' system call. */
|
|
||||||
#undef HAVE_MMAP
|
|
||||||
|
|
||||||
/* Define if you have the `munmap' function. */
|
|
||||||
#undef HAVE_MUNMAP
|
|
||||||
|
|
||||||
/* Define if you have the <nl_types.h> header file. */
|
|
||||||
#undef HAVE_NL_TYPES_H
|
|
||||||
|
|
||||||
/* Define if you have the `putenv' function. */
|
|
||||||
#undef HAVE_PUTENV
|
|
||||||
|
|
||||||
/* Define if you have the `setenv' function. */
|
|
||||||
#undef HAVE_SETENV
|
|
||||||
|
|
||||||
/* Define if you have the `setlocale' function. */
|
|
||||||
#undef HAVE_SETLOCALE
|
|
||||||
|
|
||||||
/* Define if you have the <stddef.h> header file. */
|
|
||||||
#undef HAVE_STDDEF_H
|
|
||||||
|
|
||||||
/* Define if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define if you have the `stpcpy' function. */
|
|
||||||
#undef HAVE_STPCPY
|
|
||||||
|
|
||||||
/* Define if you have the `strcasecmp' function. */
|
|
||||||
#undef HAVE_STRCASECMP
|
|
||||||
|
|
||||||
/* Define if you have the `strchr' function. */
|
|
||||||
#undef HAVE_STRCHR
|
|
||||||
|
|
||||||
/* Define if you have the `strdup' function. */
|
|
||||||
#undef HAVE_STRDUP
|
|
||||||
|
|
||||||
/* Define if you have the `strerror' function. */
|
|
||||||
#undef HAVE_STRERROR
|
|
||||||
|
|
||||||
/* Define if you have the `strerror_r' function. */
|
|
||||||
#undef HAVE_STRERROR_R
|
|
||||||
|
|
||||||
/* Define if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define if you have the `strndup' function. */
|
|
||||||
#undef HAVE_STRNDUP
|
|
||||||
|
|
||||||
/* Define if you have the `strnlen' function. */
|
|
||||||
#undef HAVE_STRNLEN
|
|
||||||
|
|
||||||
/* Define if you have the `strspn' function. */
|
|
||||||
#undef HAVE_STRSPN
|
|
||||||
|
|
||||||
/* Define if you have the `strtoul' function. */
|
|
||||||
#undef HAVE_STRTOUL
|
|
||||||
|
|
||||||
/* Define if you have the <sys/param.h> header file. */
|
|
||||||
#undef HAVE_SYS_PARAM_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/stat.h> header file. */
|
|
||||||
#undef HAVE_SYS_STAT_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define if you have the `tsearch' function. */
|
|
||||||
#undef HAVE_TSEARCH
|
|
||||||
|
|
||||||
/* Define if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define if you have the `vprintf' function. */
|
|
||||||
#undef HAVE_VPRINTF
|
|
||||||
|
|
||||||
/* Define if you have the <wchar.h> header file. */
|
|
||||||
#undef HAVE_WCHAR_H
|
|
||||||
|
|
||||||
/* Define if you have the <wctype.h> header file. */
|
|
||||||
#undef HAVE_WCTYPE_H
|
|
||||||
|
|
||||||
/* Define to 1 if `strerror_r' returns a string. */
|
|
||||||
#undef HAVE_WORKING_STRERROR_R
|
|
||||||
|
|
||||||
/* Define if you have the `__argz_count' function. */
|
|
||||||
#undef HAVE___ARGZ_COUNT
|
|
||||||
|
|
||||||
/* Define if you have the `__argz_next' function. */
|
|
||||||
#undef HAVE___ARGZ_NEXT
|
|
||||||
|
|
||||||
/* Define if you have the `__argz_stringify' function. */
|
|
||||||
#undef HAVE___ARGZ_STRINGIFY
|
|
||||||
|
|
||||||
/* Define as const if the declaration of iconv() needs const. */
|
|
||||||
#undef ICONV_CONST
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/* Define if compiler has function prototypes */
|
|
||||||
#undef PROTOTYPES
|
|
||||||
|
|
||||||
/* If using the C implementation of alloca, define if you know the
|
|
||||||
direction of stack growth for your system; otherwise it will be
|
|
||||||
automatically deduced at run-time.
|
|
||||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
|
||||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
|
||||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
|
||||||
#undef STACK_DIRECTION
|
|
||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
||||||
|
|
||||||
/* Define if using the dmalloc debugging malloc package */
|
|
||||||
#undef WITH_DMALLOC
|
|
||||||
|
|
||||||
/* Define to 1 for GNU C library extensions. */
|
|
||||||
#undef _GNU_SOURCE
|
|
||||||
|
|
||||||
/* Define if on MINIX. */
|
|
||||||
#undef _MINIX
|
|
||||||
|
|
||||||
/* Define if the system does not provide POSIX.1 features except with this
|
|
||||||
defined. */
|
|
||||||
#undef _POSIX_1_SOURCE
|
|
||||||
|
|
||||||
/* Define if you need to in order for `stat' and other things to work. */
|
|
||||||
#undef _POSIX_SOURCE
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
|
||||||
#undef const
|
|
||||||
|
|
||||||
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
|
||||||
if it is not supported. */
|
|
||||||
#undef inline
|
|
||||||
|
|
||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
|
||||||
#undef malloc
|
|
||||||
|
|
||||||
/* Define to a type if <wchar.h> does not define. */
|
|
||||||
#undef mbstate_t
|
|
||||||
|
|
||||||
/* Define to `long' if <sys/types.h> does not define. */
|
|
||||||
#undef off_t
|
|
||||||
|
|
||||||
/* Define to rpl_realloc if the replacement function should be used. */
|
|
||||||
#undef realloc
|
|
||||||
|
|
||||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
|
||||||
#undef size_t
|
|
||||||
+114
-60
@@ -1,11 +1,10 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
|
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||||
# Foundation, Inc.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -14,55 +13,91 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
# We use macros like AC_CHECK_HEADERS_ONCE, so we need Autoconf 2.60 or better.
|
# In order for some versions of Sun Studio to compile our C++ test cases
|
||||||
AC_PREREQ(2.60)
|
# correctly, we need Autoconf 2.64 or better to handle the restrict
|
||||||
|
# keyword in at least string.h from gnulib. We need Autoconf 2.68 or
|
||||||
|
# better to avoid a typo in the `configure --help' entry for the YACC
|
||||||
|
# environment variable.
|
||||||
|
AC_PREREQ([2.68])
|
||||||
|
m4_pattern_forbid([^gl_[A-Z]])
|
||||||
|
|
||||||
|
AC_INIT([GNU Bison],
|
||||||
|
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||||
|
[[email protected]])
|
||||||
|
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2012])
|
||||||
|
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
||||||
|
[The copyright year for this package])
|
||||||
|
|
||||||
AC_INIT([GNU Bison], [2.3a], [[email protected]])
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here:
|
||||||
AM_INIT_AUTOMAKE([1.8 check-news readme-alpha dist-bzip2])
|
#
|
||||||
AC_CONFIG_HEADERS([config.h:config.hin])
|
# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131
|
||||||
|
#
|
||||||
gl_USE_SYSTEM_EXTENSIONS
|
# To avoid 1.11, we make 1.11.1 the minimum version.
|
||||||
|
#
|
||||||
|
# We want gnits strictness only when rolling a 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-xz silent-rules]
|
||||||
|
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
||||||
|
[gnu], [gnits]))
|
||||||
|
AM_SILENT_RULES([yes])
|
||||||
|
AC_CONFIG_HEADERS([lib/config.h:lib/config.in.h])
|
||||||
|
|
||||||
# Checks for the compiler.
|
# Checks for the compiler.
|
||||||
AC_PROG_CC
|
AC_PROG_CC_STDC
|
||||||
AM_PROG_CC_STDC
|
AC_PROG_CXX
|
||||||
AC_ARG_ENABLE(gcc-warnings,
|
|
||||||
|
# Gnulib (early checks).
|
||||||
|
gl_EARLY
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([gcc-warnings],
|
||||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||||
[case "${enableval}" in
|
[case $enable_gcc_warnings in
|
||||||
yes|no) ;;
|
yes|no) ;;
|
||||||
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
*) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);;
|
||||||
esac],
|
esac],
|
||||||
[enableval=no])
|
[enable_gcc_warnings=no])
|
||||||
if test "${enableval}" = yes; then
|
if test "$enable_gcc_warnings" = yes; then
|
||||||
gl_WARNING_CFLAGS([-Werror])
|
warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align
|
||||||
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
-Wcast-qual -Wformat -Wpointer-arith -Wwrite-strings'
|
||||||
WARNING_CFLAGS=
|
warn_c='-Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes
|
||||||
gl_WARNING_CFLAGS([-Wextra -Wno-sign-compare])
|
-Wshadow -Wstrict-prototypes'
|
||||||
gl_WARNING_CFLAGS([-Wall])
|
warn_cxx='-Wnoexcept'
|
||||||
gl_WARNING_CFLAGS([-Wcast-align])
|
AC_LANG_PUSH([C])
|
||||||
gl_WARNING_CFLAGS([-Wcast-qual])
|
for i in $warn_common $warn_c;
|
||||||
gl_WARNING_CFLAGS([-Wformat])
|
do
|
||||||
gl_WARNING_CFLAGS([-Wpointer-arith])
|
gl_WARN_ADD([$i], [WARN_CFLAGS])
|
||||||
gl_WARNING_CFLAGS([-Wwrite-strings])
|
done
|
||||||
AC_SUBST([WARNING_CXXFLAGS], [$WARNING_CFLAGS])
|
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
||||||
# The following warnings are not suitable for C++.
|
# Warnings for the test suite only.
|
||||||
gl_WARNING_CFLAGS([-Wbad-function-cast])
|
gl_WARN_ADD([-Wundef], [WARN_CFLAGS_TEST])
|
||||||
gl_WARNING_CFLAGS([-Wmissing-declarations])
|
gl_WARN_ADD([-pedantic], [WARN_CFLAGS_TEST])
|
||||||
gl_WARNING_CFLAGS([-Wmissing-prototypes])
|
AC_LANG_POP([C])
|
||||||
gl_WARNING_CFLAGS([-Wshadow])
|
|
||||||
gl_WARNING_CFLAGS([-Wstrict-prototypes])
|
AC_LANG_PUSH([C++])
|
||||||
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
for i in $warn_common $warn_cxx;
|
||||||
|
do
|
||||||
|
gl_WARN_ADD([$i], [WARN_CXXFLAGS])
|
||||||
|
done
|
||||||
|
gl_WARN_ADD([ -Wzero-as-null-pointer-constant], [WARN_CXXFLAGS],
|
||||||
|
[AC_LANG_PROGRAM([], [nullptr])])
|
||||||
|
gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS])
|
||||||
|
# Warnings for the test suite only.
|
||||||
|
gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST])
|
||||||
|
gl_WARN_ADD([-pedantic], [WARN_CXXFLAGS_TEST])
|
||||||
|
AC_LANG_POP([C++])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BISON_TEST_FOR_WORKING_C_COMPILER
|
BISON_TEST_FOR_WORKING_C_COMPILER
|
||||||
|
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
||||||
|
|
||||||
AC_ARG_ENABLE([yacc],
|
AC_ARG_ENABLE([yacc],
|
||||||
[AC_HELP_STRING([--disable-yacc],
|
[AC_HELP_STRING([--disable-yacc],
|
||||||
@@ -81,31 +116,37 @@ AC_SUBST([YACC_LIBRARY])
|
|||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AC_PROG_LEX
|
AC_PROG_LEX
|
||||||
|
$LEX_IS_FLEX || AC_MSG_ERROR([Flex is required])
|
||||||
AC_PROG_YACC
|
AC_PROG_YACC
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
BISON_PROG_GNU_M4
|
AC_PROG_GNU_M4
|
||||||
if test x"$ac_cv_prog_gnu_m4" != xyes; then
|
|
||||||
AC_MSG_ERROR([GNU M4 1.4 is required])
|
|
||||||
fi
|
|
||||||
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
||||||
|
AC_DEFINE_UNQUOTED([M4_GNU_OPTION], ["$M4_GNU"], [Define to "-g" if GNU M4
|
||||||
|
supports -g, otherwise to "".])
|
||||||
|
AM_MISSING_PROG([HELP2MAN], [help2man])
|
||||||
|
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||||
|
AC_SUBST([XSLTPROC])
|
||||||
|
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_CHECK_HEADERS_ONCE([locale.h])
|
AC_CHECK_HEADERS_ONCE([locale.h])
|
||||||
AM_STDBOOL_H
|
|
||||||
|
|
||||||
# Checks for compiler characteristics.
|
# Checks for compiler characteristics.
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
|
|
||||||
|
# Gnulib (later checks). Putting them here rather than right after
|
||||||
|
# gl_EARLY avoids some redundant checks.
|
||||||
|
gl_INIT
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||||
AM_WITH_DMALLOC
|
AM_WITH_DMALLOC
|
||||||
BISON_PREREQ_SUBPIPE
|
|
||||||
BISON_PREREQ_TIMEVAR
|
BISON_PREREQ_TIMEVAR
|
||||||
|
|
||||||
# gnulib and gettext.
|
# Gettext.
|
||||||
GNULIB_AUTOCONF_SNIPPET
|
# We use gnulib, which is only guaranteed to work properly with the
|
||||||
# We've never tested with gettext versions before 0.15, so play it safe.
|
# latest Gettext.
|
||||||
AM_GNU_GETTEXT_VERSION([0.15])
|
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||||
|
AM_GNU_GETTEXT_VERSION([0.18])
|
||||||
BISON_I18N
|
BISON_I18N
|
||||||
|
|
||||||
# Internationalized parsers.
|
# Internationalized parsers.
|
||||||
@@ -114,26 +155,39 @@ AC_CONFIG_FILES([runtime-po/Makefile.in])
|
|||||||
aclocaldir='${datadir}/aclocal'
|
aclocaldir='${datadir}/aclocal'
|
||||||
AC_SUBST([aclocaldir])
|
AC_SUBST([aclocaldir])
|
||||||
|
|
||||||
|
# Create the benchmark script.
|
||||||
|
AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
|
||||||
|
|
||||||
# Initialize the test suite.
|
# Initialize the test suite.
|
||||||
AC_CONFIG_TESTDIR(tests)
|
AC_CONFIG_TESTDIR(tests)
|
||||||
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
||||||
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
||||||
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
||||||
AC_PROG_CXX
|
case $VALGRIND:$host_os in
|
||||||
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
'':*) ;;
|
||||||
|
*:darwin*)
|
||||||
|
# See README-hacking.
|
||||||
|
# VALGRIND+=' --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind'
|
||||||
|
VALGRIND=;;
|
||||||
|
*:*)
|
||||||
|
AC_SUBST([VALGRIND_PREBISON], ["$VALGRIND -q"]);;
|
||||||
|
esac
|
||||||
|
|
||||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||||
# Needed by tests/atlocal.in.
|
# Needed by tests/atlocal.in.
|
||||||
AC_SUBST([GCC])
|
AC_SUBST([GCC])
|
||||||
O0CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]] *//'`
|
|
||||||
AC_SUBST([O0CFLAGS])
|
gt_JAVACOMP([1.3])
|
||||||
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`
|
gt_JAVAEXEC
|
||||||
AC_SUBST([O0CXXFLAGS])
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
build-aux/Makefile
|
build-aux/Makefile
|
||||||
po/Makefile.in
|
po/Makefile.in
|
||||||
data/Makefile
|
data/Makefile
|
||||||
|
etc/Makefile
|
||||||
examples/Makefile
|
examples/Makefile
|
||||||
examples/calc++/Makefile
|
examples/calc++/Makefile
|
||||||
lib/Makefile src/Makefile doc/Makefile])
|
lib/Makefile src/Makefile
|
||||||
|
doc/Makefile
|
||||||
|
doc/yacc.1])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/Makefile.in
|
||||||
|
/Makefile
|
||||||
+26
-19
@@ -1,23 +1,30 @@
|
|||||||
## Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
## Copyright (C) 2002, 2005-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
dist_pkgdata_DATA = README bison.m4 \
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
c-like.m4 \
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
c-skel.m4 c.m4 yacc.c glr.c \
|
||||||
## GNU General Public License for more details.
|
c++-skel.m4 c++.m4 location.cc lalr1.cc glr.cc stack.hh \
|
||||||
|
java-skel.m4 java.m4 lalr1.java
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
dist_pkgdata_DATA = README \
|
|
||||||
c.m4 yacc.c glr.c \
|
|
||||||
c++.m4 location.cc lalr1.cc glr.cc
|
|
||||||
|
|
||||||
m4sugardir = $(pkgdatadir)/m4sugar
|
m4sugardir = $(pkgdatadir)/m4sugar
|
||||||
dist_m4sugar_DATA = m4sugar/m4sugar.m4
|
dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/foreach.m4
|
||||||
|
|
||||||
|
xsltdir = $(pkgdatadir)/xslt
|
||||||
|
dist_xslt_DATA = \
|
||||||
|
xslt/bison.xsl \
|
||||||
|
xslt/xml2dot.xsl \
|
||||||
|
xslt/xml2text.xsl \
|
||||||
|
xslt/xml2xhtml.xsl
|
||||||
|
|||||||
+39
-14
@@ -1,45 +1,70 @@
|
|||||||
-*- outline -*-
|
-*- outline -*-
|
||||||
|
|
||||||
This directory contains Bison skeletons: the general shapes of the
|
This directory contains data needed by Bison.
|
||||||
different parser kinds, that are specialized for specific grammars by
|
|
||||||
the bison program.
|
|
||||||
|
|
||||||
Currently, there are only three supported skeletons:
|
* Skeletons
|
||||||
|
Bison skeletons: the general shapes of the different parser kinds,
|
||||||
|
that are specialized for specific grammars by the bison program.
|
||||||
|
|
||||||
|
Currently, the supported skeletons are:
|
||||||
|
|
||||||
- yacc.c
|
- yacc.c
|
||||||
It used to be named bison.simple: it corresponds to C Yacc
|
It used to be named bison.simple: it corresponds to C Yacc
|
||||||
compatible LALR(1) parsers.
|
compatible LALR(1) parsers.
|
||||||
|
|
||||||
- lalr1.cc
|
- lalr1.cc
|
||||||
Produces a C++ parser class. It is still very experimental, and not
|
Produces a C++ parser class.
|
||||||
yet supported. Please, subscribe to [email protected].
|
|
||||||
|
- lalr1.java
|
||||||
|
Produces a Java parser class.
|
||||||
|
|
||||||
- glr.c
|
- glr.c
|
||||||
A Generalized LR C parser based on Bison's LALR(1) tables.
|
A Generalized LR C parser based on Bison's LALR(1) tables.
|
||||||
|
|
||||||
|
- glr.cc
|
||||||
|
A Generalized LR C++ parser. Actually a C++ wrapper around glr.c.
|
||||||
|
|
||||||
These skeletons are the only ones supported by the Bison team.
|
These skeletons are the only ones supported by the Bison team.
|
||||||
Because the interface between skeletons and the bison program is not
|
Because the interface between skeletons and the bison program is not
|
||||||
finished, *we are not bound to it*. In particular, Bison is not
|
finished, *we are not bound to it*. In particular, Bison is not
|
||||||
mature enough for us to consider that ``foreign skeletons'' are
|
mature enough for us to consider that ``foreign skeletons'' are
|
||||||
supported.
|
supported.
|
||||||
|
|
||||||
|
* m4sugar
|
||||||
|
This directory contains M4sugar, sort of an extended library for M4,
|
||||||
|
which is used by Bison to instantiate the skeletons.
|
||||||
|
|
||||||
|
* xslt
|
||||||
|
This directory contains XSLT programs that transform Bison's XML output
|
||||||
|
into various formats.
|
||||||
|
|
||||||
|
- bison.xsl
|
||||||
|
A library of routines used by the other XSLT programs.
|
||||||
|
|
||||||
|
- xml2dot.xsl
|
||||||
|
Conversion into GraphViz's dot format.
|
||||||
|
|
||||||
|
- xml2text.xsl
|
||||||
|
Conversion into text.
|
||||||
|
|
||||||
|
- xml2xhtml.xsl
|
||||||
|
Conversion into XHTML.
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2008-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
GNU Bison is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
GNU Bison is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Bison; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|||||||
+586
@@ -0,0 +1,586 @@
|
|||||||
|
-*- Autoconf -*-
|
||||||
|
|
||||||
|
# Language-independent M4 Macros for Bison.
|
||||||
|
|
||||||
|
# Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
## ---------------- ##
|
||||||
|
## 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)])
|
||||||
|
|
||||||
|
|
||||||
|
## ------------ ##
|
||||||
|
## 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)
|
||||||
|
# --------------------------------
|
||||||
|
# Work around the impossibility to define macros inside macros,
|
||||||
|
# because issuing `[$1]' is not possible in M4. GNU M4 should provide
|
||||||
|
# $$1 a la M5/TeX.
|
||||||
|
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([token_table]) # Whether yytoken_table is demanded.
|
||||||
|
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||||
|
|
||||||
|
# yytoken_table is needed to support verbose errors.
|
||||||
|
b4_error_verbose_if([m4_define([b4_token_table_flag], [1])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## ----------- ##
|
||||||
|
## 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([[b4_percent_define_get_loc: undefined %%define variable '%s']], [$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([[b4_percent_define_get_syncline: undefined %%define variable '%s']], [$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([[b4_percent_define_flag_if: undefined %%define variable '%s']], [$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([[b4_percent_define_check_values: undefined %%define variable '%s']], [$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]])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
## ---------------- ##
|
||||||
|
## Default values. ##
|
||||||
|
## ---------------- ##
|
||||||
|
|
||||||
|
# m4_define_default([b4_lex_param], []) dnl breaks other skeletons
|
||||||
|
m4_define_default([b4_pre_prologue], [])
|
||||||
|
m4_define_default([b4_post_prologue], [])
|
||||||
|
m4_define_default([b4_epilogue], [])
|
||||||
|
m4_define_default([b4_parse_param], [])
|
||||||
|
|
||||||
|
# The initial column and line.
|
||||||
|
m4_define_default([b4_location_initial_column], [1])
|
||||||
|
m4_define_default([b4_location_initial_line], [1])
|
||||||
|
|
||||||
|
# Sanity checks.
|
||||||
|
b4_percent_define_ifdef([api.prefix],
|
||||||
|
[m4_ifdef([b4_prefix],
|
||||||
|
[b4_complain_at(b4_percent_define_get_loc([api.prefix]),
|
||||||
|
[['%s' and '%s' cannot be used together]],
|
||||||
|
[%name-prefix],
|
||||||
|
[%define api.prefix])])])
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
-*- Autoconf -*-
|
||||||
|
|
||||||
|
# C++ skeleton dispatching for Bison.
|
||||||
|
|
||||||
|
# Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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)
|
||||||
+96
-15
@@ -1,23 +1,21 @@
|
|||||||
m4_divert(-1) -*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c.m4])
|
m4_include(b4_pkgdatadir/[c.m4])
|
||||||
|
|
||||||
@@ -26,12 +24,64 @@ m4_include(b4_pkgdatadir/[c.m4])
|
|||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# Default parser class name.
|
# Default parser class name.
|
||||||
m4_define_default([b4_parser_class_name], [parser])
|
b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||||
m4_define_default([b4_location_type], [location])
|
|
||||||
m4_define_default([b4_filename_type], [std::string])
|
# Don't do that so that we remember whether we're using a user
|
||||||
m4_define_default([b4_namespace], m4_defn([b4_prefix]))
|
# request, or the default value.
|
||||||
m4_define_default([b4_define_location_comparison],
|
#
|
||||||
m4_if(b4_filename_type, [std::string], [1], [0]))
|
# 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)
|
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
@@ -47,6 +97,8 @@ m4_map_sep([ b4_token_enum], [,
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ----------------- ##
|
## ----------------- ##
|
||||||
## Semantic Values. ##
|
## Semantic Values. ##
|
||||||
## ----------------- ##
|
## ----------------- ##
|
||||||
@@ -122,3 +174,32 @@ m4_define([b4_cc_var_decls],
|
|||||||
], [$@])])
|
], [$@])])
|
||||||
m4_define([b4_cc_var_decl],
|
m4_define([b4_cc_var_decl],
|
||||||
[ $1;])
|
[ $1;])
|
||||||
|
|
||||||
|
|
||||||
|
## ---------##
|
||||||
|
## Values. ##
|
||||||
|
## ---------##
|
||||||
|
|
||||||
|
# b4_yylloc_default_define
|
||||||
|
# ------------------------
|
||||||
|
# Define YYLLOC_DEFAULT.
|
||||||
|
m4_define([b4_yylloc_default_define],
|
||||||
|
[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||||
|
If N is 0, then set CURRENT to the empty location which ends
|
||||||
|
the previous symbol: RHS[0] (always defined). */
|
||||||
|
|
||||||
|
# ifndef YYLLOC_DEFAULT
|
||||||
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
|
do \
|
||||||
|
if (N) \
|
||||||
|
{ \
|
||||||
|
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
||||||
|
(Current).end = YYRHSLOC (Rhs, N).end; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
||||||
|
} \
|
||||||
|
while (/*CONSTCOND*/ false)
|
||||||
|
# endif
|
||||||
|
]])
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
-*- Autoconf -*-
|
||||||
|
|
||||||
|
# Common code for C-like languages (C, C++, Java, etc.)
|
||||||
|
|
||||||
|
# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# b4_dollar_dollar_(VALUE, FIELD, DEFAULT-FIELD)
|
||||||
|
# ----------------------------------------------
|
||||||
|
# If FIELD (or DEFAULT-FIELD) is non-null, return "VALUE.FIELD",
|
||||||
|
# otherwise just VALUE. Be sure to pass "(VALUE)" is VALUE is a
|
||||||
|
# pointer.
|
||||||
|
m4_define([b4_dollar_dollar_],
|
||||||
|
[m4_if([$2], [[]],
|
||||||
|
[m4_ifval([$3], [($1.$3)],
|
||||||
|
[$1])],
|
||||||
|
[($1.$2)])])
|
||||||
|
|
||||||
|
# b4_dollar_pushdef(VALUE-POINTER, DEFAULT-FIELD, LOCATION)
|
||||||
|
# b4_dollar_popdef
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
# Define b4_dollar_dollar for VALUE and DEFAULT-FIELD,
|
||||||
|
# and b4_at_dollar for LOCATION.
|
||||||
|
m4_define([b4_dollar_pushdef],
|
||||||
|
[m4_pushdef([b4_dollar_dollar],
|
||||||
|
[b4_dollar_dollar_([$1], m4_dquote($][1), [$2])])dnl
|
||||||
|
m4_pushdef([b4_at_dollar], [$3])dnl
|
||||||
|
])
|
||||||
|
m4_define([b4_dollar_popdef],
|
||||||
|
[m4_popdef([b4_at_dollar])dnl
|
||||||
|
m4_popdef([b4_dollar_dollar])dnl
|
||||||
|
])
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
-*- Autoconf -*-
|
||||||
|
|
||||||
|
# C skeleton dispatching for Bison.
|
||||||
|
|
||||||
|
# Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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,98 +1,107 @@
|
|||||||
m4_divert(-1) -*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C M4 Macros for Bison.
|
# 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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
m4_include(b4_pkgdatadir/[c-like.m4])
|
||||||
|
|
||||||
|
# b4_tocpp(STRING)
|
||||||
|
# ----------------
|
||||||
|
# Convert STRING into a valid C macro name.
|
||||||
|
m4_define([b4_tocpp],
|
||||||
|
[m4_toupper(m4_bpatsubst(m4_quote($1), [[^a-zA-Z0-9]+], [_]))])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_cpp_guard(FILE)
|
||||||
|
# ------------------
|
||||||
|
# A valid C macro name to use as a CPP header guard for FILE.
|
||||||
|
m4_define([b4_cpp_guard],
|
||||||
|
[b4_tocpp(m4_defn([b4_prefix])/[$1])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_cpp_guard_open(FILE)
|
||||||
|
# b4_cpp_guard_close(FILE)
|
||||||
|
# ------------------------
|
||||||
|
# Open/close CPP inclusion guards for FILE.
|
||||||
|
m4_define([b4_cpp_guard_open],
|
||||||
|
[#ifndef b4_cpp_guard([$1])
|
||||||
|
# define b4_cpp_guard([$1])])
|
||||||
|
|
||||||
|
m4_define([b4_cpp_guard_close],
|
||||||
|
[#endif b4_comment([!b4_cpp_guard([$1])])])
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Identification. ##
|
## Identification. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# b4_copyright(TITLE, YEARS)
|
# b4_comment(TEXT)
|
||||||
# --------------------------
|
# ----------------
|
||||||
m4_define([b4_copyright],
|
m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
||||||
[/* A Bison parser, made by GNU Bison b4_version. */
|
], [
|
||||||
|
]) */])
|
||||||
/* $1
|
|
||||||
|
|
||||||
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_identification
|
# b4_identification
|
||||||
# -----------------
|
# -----------------
|
||||||
|
# Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or
|
||||||
|
# b4_pull_flag if they use the values of the %define variables api.pure or
|
||||||
|
# api.push-pull.
|
||||||
m4_define([b4_identification],
|
m4_define([b4_identification],
|
||||||
[/* Identify Bison output. */
|
[[/* Identify Bison output. */
|
||||||
[#]define YYBISON 1
|
#define YYBISON 1
|
||||||
|
|
||||||
/* Bison version. */
|
/* Bison version. */
|
||||||
[#]define YYBISON_VERSION "b4_version"
|
#define YYBISON_VERSION "]b4_version["
|
||||||
|
|
||||||
/* Skeleton name. */
|
/* Skeleton name. */
|
||||||
[#]define YYSKELETON_NAME b4_skeleton
|
#define YYSKELETON_NAME ]b4_skeleton[]m4_ifdef([b4_pure_flag], [[
|
||||||
|
|
||||||
/* Pure parsers. */
|
/* Pure parsers. */
|
||||||
[#]define YYPURE b4_pure_flag
|
#define YYPURE ]b4_pure_flag])[]m4_ifdef([b4_push_flag], [[
|
||||||
|
|
||||||
/* Using locations. */
|
/* Push parsers. */
|
||||||
[#]define YYLSP_NEEDED b4_locations_flag
|
#define YYPUSH ]b4_push_flag])[]m4_ifdef([b4_pull_flag], [[
|
||||||
])
|
|
||||||
|
/* Pull parsers. */
|
||||||
|
#define YYPULL ]b4_pull_flag])[
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Default values. ##
|
## Default values. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
m4_define_default([b4_epilogue], [])
|
# b4_api_prefix, b4_api_PREFIX
|
||||||
|
# ----------------------------
|
||||||
|
# Corresponds to %define api.prefix
|
||||||
|
b4_percent_define_default([[api.prefix]], [[yy]])
|
||||||
|
m4_define([b4_api_prefix],
|
||||||
|
[b4_percent_define_get([[api.prefix]])])
|
||||||
|
m4_define([b4_api_PREFIX],
|
||||||
|
[m4_toupper(b4_api_prefix)])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_prefix
|
||||||
|
# ---------
|
||||||
|
# If the %name-prefix is not given, it is api.prefix.
|
||||||
|
m4_define_default([b4_prefix], [b4_api_prefix])
|
||||||
|
|
||||||
# If the %union is not named, its name is YYSTYPE.
|
# If the %union is not named, its name is YYSTYPE.
|
||||||
m4_define_default([b4_union_name], [YYSTYPE])
|
m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE])
|
||||||
|
|
||||||
# The initial column and line.
|
|
||||||
m4_define_default([b4_location_initial_column], [1])
|
|
||||||
m4_define_default([b4_location_initial_line], [1])
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------------ ##
|
## ------------------------ ##
|
||||||
@@ -109,9 +118,8 @@ m4_define([b4_user_args],
|
|||||||
# --------------
|
# --------------
|
||||||
# If defined, b4_parse_param arrives double quoted, but below we prefer
|
# If defined, b4_parse_param arrives double quoted, but below we prefer
|
||||||
# it to be single quoted.
|
# it to be single quoted.
|
||||||
m4_define_default([b4_parse_param])
|
|
||||||
m4_define([b4_parse_param],
|
m4_define([b4_parse_param],
|
||||||
b4_parse_param))
|
b4_parse_param)
|
||||||
|
|
||||||
|
|
||||||
# b4_parse_param_for(DECL, FORMAL, BODY)
|
# b4_parse_param_for(DECL, FORMAL, BODY)
|
||||||
@@ -120,7 +128,7 @@ b4_parse_param))
|
|||||||
# the formal name to FORMAL, and evaluating the BODY.
|
# the formal name to FORMAL, and evaluating the BODY.
|
||||||
m4_define([b4_parse_param_for],
|
m4_define([b4_parse_param_for],
|
||||||
[m4_foreach([$1_$2], m4_defn([b4_parse_param]),
|
[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
|
m4_pushdef([$2], m4_shift($1_$2))dnl
|
||||||
$3[]dnl
|
$3[]dnl
|
||||||
m4_popdef([$2])dnl
|
m4_popdef([$2])dnl
|
||||||
@@ -140,13 +148,6 @@ m4_define([b4_parse_param_use],
|
|||||||
## Data Types. ##
|
## Data Types. ##
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
|
|
||||||
# b4_ints_in(INT1, INT2, LOW, HIGH)
|
|
||||||
# ---------------------------------
|
|
||||||
# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
|
|
||||||
m4_define([b4_ints_in],
|
|
||||||
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_int_type(MIN, MAX)
|
# b4_int_type(MIN, MAX)
|
||||||
# ---------------------
|
# ---------------------
|
||||||
# Return the smallest int type able to handle numbers ranging from
|
# Return the smallest int type able to handle numbers ranging from
|
||||||
@@ -171,58 +172,43 @@ m4_define([b4_int_type_for],
|
|||||||
[b4_int_type($1_min, $1_max)])
|
[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. ##
|
## Values. ##
|
||||||
## ---------##
|
## ---------##
|
||||||
|
|
||||||
|
|
||||||
|
# b4_null_define
|
||||||
|
# --------------
|
||||||
|
# Portability issues: define a YY_NULL appropriate for the current
|
||||||
|
# language (C, C++98, or C++11).
|
||||||
|
m4_define([b4_null_define],
|
||||||
|
[# ifndef YY_NULL
|
||||||
|
# if defined __cplusplus && 201103L <= __cplusplus
|
||||||
|
# define YY_NULL nullptr
|
||||||
|
# else
|
||||||
|
# define YY_NULL 0
|
||||||
|
# endif
|
||||||
|
# endif[]dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_null
|
# b4_null
|
||||||
---------
|
# -------
|
||||||
# Return a null pointer constant. NULL infringes on the user name
|
# Return a null pointer constant.
|
||||||
# space in C, so use 0 rather than NULL.
|
m4_define([b4_null], [YY_NULL])
|
||||||
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 +228,7 @@ m4_define([b4_token_define],
|
|||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as #defines.
|
# Output the definition of the tokens (if there are) as #defines.
|
||||||
m4_define([b4_token_defines],
|
m4_define([b4_token_defines],
|
||||||
[m4_if([$@], [[]], [],
|
[m4_if([$#$1], [1], [],
|
||||||
[/* Tokens. */
|
[/* Tokens. */
|
||||||
m4_map([b4_token_define], [$@])])
|
m4_map([b4_token_define], [$@])])
|
||||||
])
|
])
|
||||||
@@ -259,19 +245,19 @@ m4_define([b4_token_enum],
|
|||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as enums.
|
# Output the definition of the tokens (if there are) as enums.
|
||||||
m4_define([b4_token_enums],
|
m4_define([b4_token_enums],
|
||||||
[m4_if([$@], [[]], [],
|
[m4_if([$#$1], [1], [],
|
||||||
[/* Tokens. */
|
[[/* Tokens. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef ]b4_api_PREFIX[TOKENTYPE
|
||||||
# define YYTOKENTYPE
|
# define ]b4_api_PREFIX[TOKENTYPE
|
||||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||||
know about them. */
|
know about them. */
|
||||||
enum yytokentype {
|
enum ]b4_api_prefix[tokentype {
|
||||||
m4_map_sep([ b4_token_enum], [,
|
]m4_map_sep([ b4_token_enum], [,
|
||||||
],
|
],
|
||||||
[$@])
|
[$@])[
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
])])
|
]])])
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
@@ -311,8 +297,8 @@ m4_define([b4_c_function_def],
|
|||||||
b4_c_ansi_function_def($@)
|
b4_c_ansi_function_def($@)
|
||||||
#else
|
#else
|
||||||
$2
|
$2
|
||||||
$1 (b4_c_knr_formal_names(m4_shiftn(2, $@)))
|
$1 (b4_c_knr_formal_names(m4_shift2($@)))
|
||||||
b4_c_knr_formal_decls(m4_shiftn(2, $@))
|
b4_c_knr_formal_decls(m4_shift2($@))
|
||||||
#endif[]dnl
|
#endif[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -322,7 +308,7 @@ b4_c_knr_formal_decls(m4_shiftn(2, $@))
|
|||||||
# Declare the function NAME in ANSI.
|
# Declare the function NAME in ANSI.
|
||||||
m4_define([b4_c_ansi_function_def],
|
m4_define([b4_c_ansi_function_def],
|
||||||
[$2
|
[$2
|
||||||
$1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
$1 (b4_c_ansi_formals(m4_shift2($@)))[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -330,9 +316,8 @@ $1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
|||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
# Output the arguments ANSI-C definition.
|
# Output the arguments ANSI-C definition.
|
||||||
m4_define([b4_c_ansi_formals],
|
m4_define([b4_c_ansi_formals],
|
||||||
[m4_case([$@],
|
[m4_if([$#], [0], [void],
|
||||||
[], [void],
|
[$#$1], [1], [void],
|
||||||
[[]], [void],
|
|
||||||
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
||||||
|
|
||||||
m4_define([b4_c_ansi_formal],
|
m4_define([b4_c_ansi_formal],
|
||||||
@@ -384,7 +369,7 @@ $2 $1 ();
|
|||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# Declare the function NAME.
|
# Declare the function NAME.
|
||||||
m4_define([b4_c_ansi_function_decl],
|
m4_define([b4_c_ansi_function_decl],
|
||||||
[$2 $1 (b4_c_ansi_formals(m4_shiftn(2, $@)));[]dnl
|
[$2 $1 (b4_c_ansi_formals(m4_shift2($@)));[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -399,7 +384,7 @@ m4_define([b4_c_ansi_function_decl],
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Call the function NAME with arguments NAME1, NAME2 etc.
|
# Call the function NAME with arguments NAME1, NAME2 etc.
|
||||||
m4_define([b4_c_function_call],
|
m4_define([b4_c_function_call],
|
||||||
[$1 (b4_c_args(m4_shiftn(2, $@)))[]dnl
|
[$1 (b4_c_args(m4_shift2($@)))[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -417,50 +402,9 @@ m4_define([b4_c_arg],
|
|||||||
## Synclines. ##
|
## Synclines. ##
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
|
|
||||||
# b4_basename(NAME)
|
# b4_sync_start(LINE, FILE)
|
||||||
# -----------------
|
|
||||||
# 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],
|
m4_define([b4_sync_start], [[#]line $1 $2])
|
||||||
[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])
|
|
||||||
|
|
||||||
|
|
||||||
## -------------- ##
|
## -------------- ##
|
||||||
@@ -478,17 +422,18 @@ $2
|
|||||||
# SYMBOL-TAG, SYMBOL-NUM,
|
# SYMBOL-TAG, SYMBOL-NUM,
|
||||||
# SYMBOL-ACTION, SYMBOL-TYPENAME)
|
# SYMBOL-ACTION, SYMBOL-TYPENAME)
|
||||||
# -------------------------------------------------
|
# -------------------------------------------------
|
||||||
|
# Issue the code for a symbol action (e.g., %printer).
|
||||||
|
#
|
||||||
|
# Define b4_dollar_dollar([TYPE-NAME]), and b4_at_dollar, which are
|
||||||
|
# invoked where $<TYPE-NAME>$ and @$ were specified by the user.
|
||||||
m4_define([b4_symbol_actions],
|
m4_define([b4_symbol_actions],
|
||||||
[m4_pushdef([b4_dollar_dollar],
|
[b4_dollar_pushdef([(*yyvaluep)], [$6], [(*yylocationp)])dnl
|
||||||
[m4_ifval([$6], [(yyvaluep->$6)], [(*yyvaluep)])])dnl
|
|
||||||
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
|
|
||||||
case $4: /* $3 */
|
case $4: /* $3 */
|
||||||
b4_syncline([$2], [$1])
|
b4_syncline([$2], [$1])
|
||||||
$5;
|
$5;
|
||||||
b4_syncline([@oline@], [@ofile@])
|
b4_syncline([@oline@], [@ofile@])
|
||||||
break;
|
break;
|
||||||
m4_popdef([b4_at_dollar])dnl
|
b4_dollar_popdef[]dnl
|
||||||
m4_popdef([b4_dollar_dollar])dnl
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -550,6 +495,8 @@ m4_define_default([b4_yy_symbol_print_generate],
|
|||||||
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
|
FILE *yyo = yyoutput;
|
||||||
|
YYUSE (yyo);
|
||||||
if (!yyvaluep)
|
if (!yyvaluep)
|
||||||
return;
|
return;
|
||||||
]b4_locations_if([ YYUSE (yylocationp);
|
]b4_locations_if([ YYUSE (yylocationp);
|
||||||
@@ -595,3 +542,102 @@ b4_locations_if([, yylocationp])[]b4_user_args[);
|
|||||||
YYFPRINTF (yyoutput, ")");
|
YYFPRINTF (yyoutput, ")");
|
||||||
}]dnl
|
}]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
## -------------- ##
|
||||||
|
## Declarations. ##
|
||||||
|
## -------------- ##
|
||||||
|
|
||||||
|
# b4_declare_yylstype
|
||||||
|
# -------------------
|
||||||
|
# Declarations that might either go into the header (if --defines) or
|
||||||
|
# in the parser body. Declare YYSTYPE/YYLTYPE, and yylval/yylloc.
|
||||||
|
m4_define([b4_declare_yylstype],
|
||||||
|
[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
|
||||||
|
]m4_ifdef([b4_stype],
|
||||||
|
[[typedef union ]b4_union_name[
|
||||||
|
{
|
||||||
|
]b4_user_stype[
|
||||||
|
} ]b4_api_PREFIX[STYPE;
|
||||||
|
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]],
|
||||||
|
[m4_if(b4_tag_seen_flag, 0,
|
||||||
|
[[typedef int ]b4_api_PREFIX[STYPE;
|
||||||
|
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]])])[
|
||||||
|
# define ]b4_api_prefix[stype ]b4_api_PREFIX[STYPE /* obsolescent; will be withdrawn */
|
||||||
|
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
|
||||||
|
#endif]b4_locations_if([[
|
||||||
|
|
||||||
|
#if ! defined ]b4_api_PREFIX[LTYPE && ! defined ]b4_api_PREFIX[LTYPE_IS_DECLARED
|
||||||
|
typedef struct ]b4_api_PREFIX[LTYPE
|
||||||
|
{
|
||||||
|
int first_line;
|
||||||
|
int first_column;
|
||||||
|
int last_line;
|
||||||
|
int last_column;
|
||||||
|
} ]b4_api_PREFIX[LTYPE;
|
||||||
|
# define ]b4_api_prefix[ltype ]b4_api_PREFIX[LTYPE /* obsolescent; will be withdrawn */
|
||||||
|
# define ]b4_api_PREFIX[LTYPE_IS_DECLARED 1
|
||||||
|
# define ]b4_api_PREFIX[LTYPE_IS_TRIVIAL 1
|
||||||
|
#endif]])
|
||||||
|
|
||||||
|
b4_pure_if([], [[extern ]b4_api_PREFIX[STYPE ]b4_prefix[lval;
|
||||||
|
]b4_locations_if([[extern ]b4_api_PREFIX[LTYPE ]b4_prefix[lloc;]])])[]dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
# b4_YYDEBUG_define
|
||||||
|
# ------------------
|
||||||
|
m4_define([b4_YYDEBUG_define],
|
||||||
|
[[/* Enabling traces. */
|
||||||
|
]m4_if(b4_api_prefix, [yy],
|
||||||
|
[[#ifndef YYDEBUG
|
||||||
|
# define YYDEBUG ]b4_debug_flag[
|
||||||
|
#endif]],
|
||||||
|
[[#ifndef ]b4_api_PREFIX[DEBUG
|
||||||
|
# if defined YYDEBUG
|
||||||
|
# if YYDEBUG
|
||||||
|
# define ]b4_api_PREFIX[DEBUG 1
|
||||||
|
# else
|
||||||
|
# define ]b4_api_PREFIX[DEBUG 0
|
||||||
|
# endif
|
||||||
|
# else /* ! defined YYDEBUG */
|
||||||
|
# define ]b4_api_PREFIX[DEBUG ]b4_debug_flag[
|
||||||
|
# endif /* ! defined ]b4_api_PREFIX[DEBUG */
|
||||||
|
#endif /* ! defined ]b4_api_PREFIX[DEBUG */]])[]dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
# b4_declare_yydebug
|
||||||
|
# ------------------
|
||||||
|
m4_define([b4_declare_yydebug],
|
||||||
|
[b4_YYDEBUG_define[
|
||||||
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
|
extern int ]b4_prefix[debug;
|
||||||
|
#endif][]dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
# b4_yylloc_default_define
|
||||||
|
# ------------------------
|
||||||
|
# Define YYLLOC_DEFAULT.
|
||||||
|
m4_define([b4_yylloc_default_define],
|
||||||
|
[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||||
|
If N is 0, then set CURRENT to the empty location which ends
|
||||||
|
the previous symbol: RHS[0] (always defined). */
|
||||||
|
|
||||||
|
#ifndef YYLLOC_DEFAULT
|
||||||
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
|
do \
|
||||||
|
if (YYID (N)) \
|
||||||
|
{ \
|
||||||
|
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||||||
|
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||||||
|
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||||||
|
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(Current).first_line = (Current).last_line = \
|
||||||
|
YYRHSLOC (Rhs, 0).last_line; \
|
||||||
|
(Current).first_column = (Current).last_column = \
|
||||||
|
YYRHSLOC (Rhs, 0).last_column; \
|
||||||
|
} \
|
||||||
|
while (YYID (0))
|
||||||
|
#endif
|
||||||
|
]])
|
||||||
|
|||||||
+983
-984
File diff suppressed because it is too large
Load Diff
+86
-124
@@ -1,22 +1,21 @@
|
|||||||
m4_divert(-1) -*- C -*-
|
-*- C -*-
|
||||||
|
|
||||||
# C++ GLR skeleton for Bison
|
# 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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
|
|
||||||
# This skeleton produces a C++ class that encapsulates a C glr parser.
|
# 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.
|
# The header is mandatory.
|
||||||
b4_defines_if([],
|
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/[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.
|
# Save the parse parameters.
|
||||||
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
|
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
|
||||||
@@ -76,10 +78,10 @@ m4_define([b4_yy_symbol_print_generate],
|
|||||||
[static void],
|
[static void],
|
||||||
[[FILE *], []],
|
[[FILE *], []],
|
||||||
[[int yytype], [yytype]],
|
[[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]],
|
[yyvaluep]],
|
||||||
[[const b4_namespace::b4_parser_class_name::location_type *yylocationp],
|
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
|
||||||
[yylocationp]],
|
[yylocationp]],
|
||||||
b4_parse_param)[
|
b4_parse_param)[
|
||||||
{
|
{
|
||||||
]b4_parse_param_use[]dnl
|
]b4_parse_param_use[]dnl
|
||||||
@@ -88,18 +90,22 @@ m4_define([b4_yy_symbol_print_generate],
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
# Declare yyerror.
|
# Hijack the post prologue to insert early definition of YYLLOC_DEFAULT
|
||||||
|
# and declaration of yyerror.
|
||||||
m4_append([b4_post_prologue],
|
m4_append([b4_post_prologue],
|
||||||
[b4_syncline([@oline@], [@ofile@])
|
[b4_syncline([@oline@], [@ofile@])[
|
||||||
|
]b4_yylloc_default_define[
|
||||||
b4_c_ansi_function_decl([yyerror],
|
#define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
|
||||||
|
]b4_c_ansi_function_decl([yyerror],
|
||||||
[static void],
|
[static void],
|
||||||
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
|
||||||
|
[yylocationp]],
|
||||||
b4_parse_param,
|
b4_parse_param,
|
||||||
[[const char* msg], [msg]])])
|
[[const char* msg], [msg]])])
|
||||||
|
|
||||||
|
|
||||||
# Define yyerror.
|
# Hijack the epilogue to define implementations (yyerror, parser member
|
||||||
|
# functions etc.).
|
||||||
m4_append([b4_epilogue],
|
m4_append([b4_epilogue],
|
||||||
[b4_syncline([@oline@], [@ofile@])[
|
[b4_syncline([@oline@], [@ofile@])[
|
||||||
/*------------------.
|
/*------------------.
|
||||||
@@ -108,7 +114,8 @@ m4_append([b4_epilogue],
|
|||||||
|
|
||||||
]b4_c_ansi_function_def([yyerror],
|
]b4_c_ansi_function_def([yyerror],
|
||||||
[static void],
|
[static void],
|
||||||
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
|
||||||
|
[yylocationp]],
|
||||||
b4_parse_param,
|
b4_parse_param,
|
||||||
[[const char* msg], [msg]])[
|
[[const char* msg], [msg]])[
|
||||||
{
|
{
|
||||||
@@ -117,15 +124,14 @@ m4_append([b4_epilogue],
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace ]b4_namespace[
|
]b4_namespace_open[
|
||||||
{
|
|
||||||
]dnl In this section, the parse param are the original parse_params.
|
]dnl In this section, the parse param are the original parse_params.
|
||||||
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||||
[ /// Build a parser object.
|
[ /// Build a parser object.
|
||||||
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||||
:])[
|
:])[
|
||||||
#if YYDEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
|
]m4_ifset([b4_parse_param], [ ], [ :])[
|
||||||
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
||||||
#endif]b4_parse_param_cons[
|
#endif]b4_parse_param_cons[
|
||||||
{
|
{
|
||||||
@@ -141,34 +147,38 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
return ::yyparse (*this]b4_user_args[);
|
return ::yyparse (*this]b4_user_args[);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if YYDEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
/*--------------------.
|
/*--------------------.
|
||||||
| Print this symbol. |
|
| Print this symbol. |
|
||||||
`--------------------*/
|
`--------------------*/
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep, const location_type* yylocationp)
|
const semantic_type* yyvaluep,
|
||||||
|
const location_type* yylocationp)
|
||||||
{
|
{
|
||||||
/* Pacify ``unused variable'' warnings. */
|
|
||||||
YYUSE (yyvaluep);
|
|
||||||
YYUSE (yylocationp);
|
YYUSE (yylocationp);
|
||||||
|
YYUSE (yyvaluep);
|
||||||
|
std::ostream& yyoutput = debug_stream ();
|
||||||
|
std::ostream& yyo = yyoutput;
|
||||||
|
YYUSE (yyo);
|
||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
||||||
[ default:
|
[ default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
|
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep, const location_type* yylocationp)
|
const semantic_type* yyvaluep,
|
||||||
|
const location_type* yylocationp)
|
||||||
{
|
{
|
||||||
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
|
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
|
||||||
<< ' ' << yytname[yytype] << " ("
|
<< ' ' << yytname[yytype] << " ("
|
||||||
<< *yylocationp << ": ";
|
<< *yylocationp << ": ";
|
||||||
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
|
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
|
||||||
*yycdebug_ << ')';
|
*yycdebug_ << ')';
|
||||||
}
|
}
|
||||||
@@ -189,104 +199,71 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
]b4_parser_class_name[::debug_level_type
|
]b4_parser_class_name[::debug_level_type
|
||||||
]b4_parser_class_name[::debug_level () const
|
]b4_parser_class_name[::debug_level () const
|
||||||
{
|
{
|
||||||
return yydebug_;
|
return yydebug;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
||||||
{
|
{
|
||||||
yydebug_ = l;
|
// Actually, it is yydebug which is really used.
|
||||||
|
yydebug = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
]m4_popdef([b4_parse_param])dnl
|
]m4_popdef([b4_parse_param])dnl
|
||||||
[} // namespace ]b4_namespace[
|
b4_namespace_close])
|
||||||
|
|
||||||
]])
|
|
||||||
|
|
||||||
|
|
||||||
# Let glr.c believe that the user arguments include the parser itself.
|
# Let glr.c believe that the user arguments include the parser itself.
|
||||||
m4_ifset([b4_parse_param],
|
m4_ifset([b4_parse_param],
|
||||||
[m4_pushdef([b4_parse_param],
|
[m4_pushdef([b4_parse_param],
|
||||||
m4_dquote([[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]],]
|
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]],]
|
||||||
m4_defn([b4_parse_param])))],
|
m4_defn([b4_parse_param]))],
|
||||||
[m4_pushdef([b4_parse_param],
|
[m4_pushdef([b4_parse_param],
|
||||||
[[[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]]]])
|
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]]])
|
||||||
])
|
])
|
||||||
m4_include(b4_pkgdatadir/[glr.c])
|
m4_include(b4_pkgdatadir/[glr.c])
|
||||||
m4_popdef([b4_parse_param])
|
m4_popdef([b4_parse_param])
|
||||||
|
|
||||||
@output @output_header_name@
|
m4_divert_push(0)
|
||||||
|
@output(b4_spec_defines_file@)@
|
||||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006])[
|
[2002-2006, 2009-2012])[
|
||||||
|
|
||||||
/* C++ GLR parser skeleton written by Akim Demaille. */
|
/* C++ GLR parser skeleton written by Akim Demaille. */
|
||||||
|
|
||||||
#ifndef PARSER_HEADER_H
|
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||||
# define PARSER_HEADER_H
|
|
||||||
|
|
||||||
]m4_ifdef([b4_start_header],
|
]b4_percent_code_get([[requires]])[
|
||||||
[[/* Copy the %start-header blocks. */
|
|
||||||
]b4_user_start_header])[
|
|
||||||
|
|
||||||
#include <string>
|
# include <string>
|
||||||
#include <iostream>
|
# include <iostream>
|
||||||
|
]b4_percent_define_ifdef([[location_type]], [],
|
||||||
|
[[# include "location.hh"]])[
|
||||||
|
|
||||||
/* Using locations. */
|
]b4_YYDEBUG_define[
|
||||||
#define YYLSP_NEEDED ]b4_locations_flag[
|
|
||||||
|
|
||||||
namespace ]b4_namespace[
|
]b4_namespace_open[
|
||||||
{
|
|
||||||
class position;
|
|
||||||
class location;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "location.hh"
|
|
||||||
|
|
||||||
/* Enabling traces. */
|
|
||||||
#ifndef YYDEBUG
|
|
||||||
# define YYDEBUG ]b4_debug_flag[
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
|
||||||
If N is 0, then set CURRENT to the empty location which ends
|
|
||||||
the previous symbol: RHS[0] (always defined). */
|
|
||||||
|
|
||||||
#ifndef YYLLOC_DEFAULT
|
|
||||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
|
||||||
do \
|
|
||||||
if (N) \
|
|
||||||
{ \
|
|
||||||
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
|
||||||
(Current).end = YYRHSLOC (Rhs, N).end; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
|
||||||
} \
|
|
||||||
while (/*CONSTCOND*/ 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace ]b4_namespace[
|
|
||||||
{
|
|
||||||
/// A Bison parser.
|
/// A Bison parser.
|
||||||
class ]b4_parser_class_name[
|
class ]b4_parser_class_name[
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Symbol semantic values.
|
/// Symbol semantic values.
|
||||||
#ifndef YYSTYPE
|
# ifndef ]b4_api_PREFIX[STYPE
|
||||||
]m4_ifdef([b4_stype],
|
]m4_ifdef([b4_stype],
|
||||||
[ union semantic_type
|
[ union semantic_type
|
||||||
|
{
|
||||||
b4_user_stype
|
b4_user_stype
|
||||||
;],
|
};],
|
||||||
[m4_if(b4_tag_seen_flag, 0,
|
[m4_if(b4_tag_seen_flag, 0,
|
||||||
[[ typedef int semantic_type;]],
|
[[ typedef int semantic_type;]],
|
||||||
[[ typedef YYSTYPE semantic_type;]])])[
|
[[ typedef ]b4_api_PREFIX[STYPE semantic_type;]])])[
|
||||||
#else
|
# else
|
||||||
typedef YYSTYPE semantic_type;
|
typedef ]b4_api_PREFIX[STYPE semantic_type;
|
||||||
#endif
|
# endif
|
||||||
/// Symbol locations.
|
/// Symbol locations.
|
||||||
typedef ]b4_location_type[ location_type;
|
typedef ]b4_percent_define_get([[location_type]],
|
||||||
|
[[location]])[ location_type;
|
||||||
/// Tokens.
|
/// Tokens.
|
||||||
struct token
|
struct token
|
||||||
{
|
{
|
||||||
@@ -324,57 +301,42 @@ b4_user_stype
|
|||||||
virtual void error (const location_type& loc, const std::string& msg);
|
virtual void error (const location_type& loc, const std::string& msg);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
#if YYDEBUG
|
# if ]b4_api_PREFIX[DEBUG
|
||||||
public:
|
public:
|
||||||
/// \brief Report a symbol value on the debug stream.
|
/// \brief Report a symbol value on the debug stream.
|
||||||
/// \param yytype The token type.
|
/// \param yytype The token type.
|
||||||
/// \param yyvaluep Its semantic value.
|
/// \param yyvaluep Its semantic value.
|
||||||
/// \param yylocationp Its location.
|
/// \param yylocationp Its location.
|
||||||
virtual void yy_symbol_value_print_ (int yytype,
|
virtual void yy_symbol_value_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep,
|
const semantic_type* yyvaluep,
|
||||||
const location_type* yylocationp);
|
const location_type* yylocationp);
|
||||||
/// \brief Report a symbol on the debug stream.
|
/// \brief Report a symbol on the debug stream.
|
||||||
/// \param yytype The token type.
|
/// \param yytype The token type.
|
||||||
/// \param yyvaluep Its semantic value.
|
/// \param yyvaluep Its semantic value.
|
||||||
/// \param yylocationp Its location.
|
/// \param yylocationp Its location.
|
||||||
virtual void yy_symbol_print_ (int yytype,
|
virtual void yy_symbol_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep,
|
const semantic_type* yyvaluep,
|
||||||
const location_type* yylocationp);
|
const location_type* yylocationp);
|
||||||
private:
|
private:
|
||||||
/* Debugging. */
|
/* Debugging. */
|
||||||
int yydebug_;
|
|
||||||
std::ostream* yycdebug_;
|
std::ostream* yycdebug_;
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
|
|
||||||
/// \brief Reclaim the memory associated to a symbol.
|
|
||||||
/// \param yymsg Why this token is reclaimed.
|
|
||||||
/// \param yytype The symbol type.
|
|
||||||
/// \param yyvaluep Its semantic value.
|
|
||||||
/// \param yylocationp Its location.
|
|
||||||
inline void yydestruct_ (const char* yymsg,
|
|
||||||
int yytype,
|
|
||||||
semantic_type* yyvaluep,
|
|
||||||
location_type* yylocationp);
|
|
||||||
|
|
||||||
]b4_parse_param_vars[
|
]b4_parse_param_vars[
|
||||||
};
|
};
|
||||||
|
|
||||||
]dnl Redirections for glr.c.
|
]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)])
|
[b4_token_defines(b4_tokens)])
|
||||||
[
|
[
|
||||||
#ifndef YYSTYPE
|
#ifndef ]b4_api_PREFIX[STYPE
|
||||||
# define YYSTYPE ]b4_namespace[::]b4_parser_class_name[::semantic_type
|
# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
|
||||||
#endif
|
#endif
|
||||||
#ifndef YYLTYPE
|
#ifndef ]b4_api_PREFIX[LTYPE
|
||||||
# define YYLTYPE ]b4_namespace[::]b4_parser_class_name[::location_type
|
# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
]b4_namespace_close[
|
||||||
|
]b4_percent_code_get([[provides]])[
|
||||||
]m4_ifdef([b4_end_header],
|
]b4_cpp_guard_close([b4_spec_defines_file])[
|
||||||
[[/* Copy the %end-header blocks. */
|
]m4_divert_pop(0)
|
||||||
]b4_end_header])[]dnl
|
|
||||||
|
|
||||||
[#endif /* ! defined PARSER_HEADER_H */]
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
-*- Autoconf -*-
|
||||||
|
|
||||||
|
# Java skeleton dispatching for Bison.
|
||||||
|
|
||||||
|
# Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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)
|
||||||
+304
@@ -0,0 +1,304 @@
|
|||||||
|
-*- Autoconf -*-
|
||||||
|
|
||||||
|
# Java language support for Bison
|
||||||
|
|
||||||
|
# Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
m4_include(b4_pkgdatadir/[c-like.m4])
|
||||||
|
|
||||||
|
# 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])])
|
||||||
+249
-295
@@ -1,122 +1,84 @@
|
|||||||
m4_divert(-1)
|
|
||||||
|
|
||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c++.m4])
|
m4_include(b4_pkgdatadir/[c++.m4])
|
||||||
|
|
||||||
|
m4_define([b4_parser_class_name],
|
||||||
|
[b4_percent_define_get([[parser_class_name]])])
|
||||||
|
|
||||||
# The header is mandatory.
|
# The header is mandatory.
|
||||||
b4_defines_if([],
|
b4_defines_if([],
|
||||||
[m4_fatal(b4_skeleton[: using %defines is mandatory])])
|
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||||
|
|
||||||
# Backward compatibility.
|
b4_percent_define_ifdef([[location_type]], [],
|
||||||
m4_define([b4_location_constructors])
|
[# Backward compatibility.
|
||||||
m4_include(b4_pkgdatadir/[location.cc])
|
m4_define([b4_location_constructors])
|
||||||
|
m4_include(b4_pkgdatadir/[location.cc])])
|
||||||
|
m4_include(b4_pkgdatadir/[stack.hh])
|
||||||
|
|
||||||
# We do want M4 expansion after # for CPP macros.
|
# We do want M4 expansion after # for CPP macros.
|
||||||
m4_changecom()
|
m4_changecom()
|
||||||
m4_divert(0)dnl
|
m4_divert_push(0)dnl
|
||||||
b4_defines_if(
|
b4_defines_if(
|
||||||
[@output @output_header_name@
|
[@output(b4_spec_defines_file@)@
|
||||||
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
|
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006])
|
[2002-2012])
|
||||||
dnl FIXME: This is wrong, we want computed header guards.
|
|
||||||
[
|
[
|
||||||
|
/**
|
||||||
|
** \file ]b4_spec_defines_file[
|
||||||
|
** Define the ]b4_namespace_ref[::parser class.
|
||||||
|
*/
|
||||||
|
|
||||||
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
||||||
|
|
||||||
#ifndef PARSER_HEADER_H
|
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||||
# define PARSER_HEADER_H
|
|
||||||
|
|
||||||
]m4_ifdef([b4_start_header],
|
]b4_percent_code_get([[requires]])[
|
||||||
[[/* Copy the %start-header blocks. */
|
|
||||||
]b4_user_start_header])[
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "stack.hh"
|
#include "stack.hh"
|
||||||
|
]b4_percent_define_ifdef([[location_type]], [],
|
||||||
|
[[#include "location.hh"]])[
|
||||||
|
|
||||||
namespace ]b4_namespace[
|
]b4_YYDEBUG_define[
|
||||||
{
|
|
||||||
class position;
|
|
||||||
class location;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "location.hh"
|
]b4_namespace_open[
|
||||||
|
|
||||||
/* Enabling traces. */
|
|
||||||
#ifndef YYDEBUG
|
|
||||||
# define YYDEBUG ]b4_debug_flag[
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enabling verbose error messages. */
|
|
||||||
#ifdef YYERROR_VERBOSE
|
|
||||||
# undef YYERROR_VERBOSE
|
|
||||||
# define YYERROR_VERBOSE 1
|
|
||||||
#else
|
|
||||||
# define YYERROR_VERBOSE ]b4_error_verbose_flag[
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enabling the token table. */
|
|
||||||
#ifndef YYTOKEN_TABLE
|
|
||||||
# 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[
|
|
||||||
{
|
|
||||||
|
|
||||||
/// A Bison parser.
|
/// A Bison parser.
|
||||||
class ]b4_parser_class_name[
|
class ]b4_parser_class_name[
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Symbol semantic values.
|
/// Symbol semantic values.
|
||||||
#ifndef YYSTYPE
|
#ifndef ]b4_api_PREFIX[STYPE
|
||||||
]m4_ifdef([b4_stype],
|
]m4_ifdef([b4_stype],
|
||||||
[ union semantic_type
|
[ union semantic_type
|
||||||
|
{
|
||||||
b4_user_stype
|
b4_user_stype
|
||||||
;],
|
};],
|
||||||
[m4_if(b4_tag_seen_flag, 0,
|
[m4_if(b4_tag_seen_flag, 0,
|
||||||
[[ typedef int semantic_type;]],
|
[[ typedef int semantic_type;]],
|
||||||
[[ typedef YYSTYPE semantic_type;]])])[
|
[[ typedef ]b4_api_PREFIX[STYPE semantic_type;]])])[
|
||||||
#else
|
#else
|
||||||
typedef YYSTYPE semantic_type;
|
typedef ]b4_api_PREFIX[STYPE semantic_type;
|
||||||
#endif
|
#endif
|
||||||
/// Symbol locations.
|
/// Symbol locations.
|
||||||
typedef ]b4_location_type[ location_type;
|
typedef ]b4_percent_define_get([[location_type]],
|
||||||
|
[[location]])[ location_type;
|
||||||
/// Tokens.
|
/// Tokens.
|
||||||
struct token
|
struct token
|
||||||
{
|
{
|
||||||
@@ -133,6 +95,7 @@ b4_user_stype
|
|||||||
/// \returns 0 iff parsing succeeded.
|
/// \returns 0 iff parsing succeeded.
|
||||||
virtual int parse ();
|
virtual int parse ();
|
||||||
|
|
||||||
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
/// The current debugging stream.
|
/// The current debugging stream.
|
||||||
std::ostream& debug_stream () const;
|
std::ostream& debug_stream () const;
|
||||||
/// Set the current debugging stream.
|
/// Set the current debugging stream.
|
||||||
@@ -144,6 +107,7 @@ b4_user_stype
|
|||||||
debug_level_type debug_level () const;
|
debug_level_type debug_level () const;
|
||||||
/// Set the current debugging level.
|
/// Set the current debugging level.
|
||||||
void set_debug_level (debug_level_type l);
|
void set_debug_level (debug_level_type l);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Report a syntax error.
|
/// Report a syntax error.
|
||||||
@@ -154,10 +118,9 @@ b4_user_stype
|
|||||||
/// Generate an error message.
|
/// Generate an error message.
|
||||||
/// \param state the state where the error occurred.
|
/// \param state the state where the error occurred.
|
||||||
/// \param tok the lookahead token.
|
/// \param tok the lookahead token.
|
||||||
virtual std::string yysyntax_error_ (int yystate]dnl
|
virtual std::string yysyntax_error_ (int yystate, int tok);
|
||||||
b4_error_verbose_if([, int tok])[);
|
|
||||||
|
|
||||||
#if YYDEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
/// \brief Report a symbol value on the debug stream.
|
/// \brief Report a symbol value on the debug stream.
|
||||||
/// \param yytype The token type.
|
/// \param yytype The token type.
|
||||||
/// \param yyvaluep Its semantic value.
|
/// \param yyvaluep Its semantic value.
|
||||||
@@ -191,6 +154,14 @@ b4_error_verbose_if([, int tok])[);
|
|||||||
/// The location stack.
|
/// The location stack.
|
||||||
location_stack_type yylocation_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.
|
/// Internal symbol numbers.
|
||||||
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
||||||
/* Tables. */
|
/* Tables. */
|
||||||
@@ -198,7 +169,7 @@ b4_error_verbose_if([, int tok])[);
|
|||||||
static const ]b4_int_type_for([b4_pact])[ yypact_[];
|
static const ]b4_int_type_for([b4_pact])[ yypact_[];
|
||||||
static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_;
|
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.
|
/// Unless\a yytable_ specifies something else to do.
|
||||||
/// Zero means the default is an error.
|
/// Zero means the default is an error.
|
||||||
static const ]b4_int_type_for([b4_defact])[ yydefact_[];
|
static const ]b4_int_type_for([b4_defact])[ yydefact_[];
|
||||||
@@ -222,19 +193,15 @@ b4_error_verbose_if([, int tok])[);
|
|||||||
/// For a rule, its LHS.
|
/// For a rule, its LHS.
|
||||||
static const ]b4_int_type_for([b4_r1])[ yyr1_[];
|
static const ]b4_int_type_for([b4_r1])[ yyr1_[];
|
||||||
/// For a rule, its RHS length.
|
/// For a rule, its RHS length.
|
||||||
static const ]b4_int_type_for([b4_r2])[ yyr2_[];
|
static const ]b4_int_type_for([b4_r2])[ yyr2_[]; ]b4_error_verbose_if([
|
||||||
|
|
||||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
/// Convert the symbol name \a n to a form suitable for a diagnostic.
|
||||||
|
static std::string yytnamerr_ (const char *n);])[
|
||||||
|
|
||||||
|
]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[
|
||||||
/// For a symbol, its name in clear.
|
/// For a symbol, its name in clear.
|
||||||
static const char* const yytname_[];
|
static const char* const yytname_[];
|
||||||
#endif
|
]b4_token_table_if([[#if ]b4_api_PREFIX[DEBUG]])[
|
||||||
|
|
||||||
#if YYERROR_VERBOSE
|
|
||||||
/// Convert the symbol name \a n to a form suitable for a diagnostic.
|
|
||||||
virtual std::string yytnamerr_ (const char *n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if YYDEBUG
|
|
||||||
/// A type to store symbol numbers and -1.
|
/// A type to store symbol numbers and -1.
|
||||||
typedef ]b4_int_type_for([b4_rhs])[ rhs_number_type;
|
typedef ]b4_int_type_for([b4_rhs])[ rhs_number_type;
|
||||||
/// A `-1'-separated list of the rules' RHS.
|
/// A `-1'-separated list of the rules' RHS.
|
||||||
@@ -285,41 +252,42 @@ b4_error_verbose_if([, int tok])[);
|
|||||||
static const token_number_type yyundef_token_;
|
static const token_number_type yyundef_token_;
|
||||||
]b4_parse_param_vars[
|
]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)
|
[b4_token_defines(b4_tokens)
|
||||||
|
|
||||||
#ifndef YYSTYPE
|
#ifndef ]b4_api_PREFIX[STYPE
|
||||||
/* Redirection for backward compatibility. */
|
/* Redirection for backward compatibility. */
|
||||||
# define YYSTYPE b4_namespace::b4_parser_class_name::semantic_type
|
# define ]b4_api_PREFIX[STYPE b4_namespace_ref::b4_parser_class_name::semantic_type
|
||||||
#endif
|
#endif
|
||||||
])
|
])[
|
||||||
m4_ifdef([b4_end_header],
|
]b4_percent_code_get([[provides]])[
|
||||||
[[/* Copy the %end-header blocks. */
|
]b4_cpp_guard_close([b4_spec_defines_file])
|
||||||
]b4_end_header])[]dnl
|
|
||||||
|
|
||||||
[#endif /* ! defined PARSER_HEADER_H */]
|
|
||||||
])dnl
|
])dnl
|
||||||
@output @output_parser_name@
|
@output(b4_parser_file_name@)@
|
||||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
|
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006])
|
[2002-2012])
|
||||||
|
b4_percent_code_get([[top]])[]dnl
|
||||||
m4_if(b4_prefix, [yy], [],
|
m4_if(b4_prefix, [yy], [],
|
||||||
[
|
[
|
||||||
// Take the name prefix into account.
|
// Take the name prefix into account.
|
||||||
#define yylex b4_prefix[]lex])[
|
#define yylex b4_prefix[]lex])[
|
||||||
|
|
||||||
/* First part of user declarations. */
|
/* First part of user declarations. */
|
||||||
]b4_pre_prologue
|
]b4_user_pre_prologue[
|
||||||
|
|
||||||
b4_defines_if([
|
]b4_defines_if([[
|
||||||
#include @output_header_name@])[
|
#include "@basename(]b4_spec_defines_file[@)"]])[
|
||||||
|
|
||||||
/* User implementation prologue. */
|
/* User implementation prologue. */
|
||||||
]b4_user_post_prologue[
|
]b4_user_post_prologue[
|
||||||
|
]b4_percent_code_get[
|
||||||
|
|
||||||
|
]b4_null_define[
|
||||||
|
|
||||||
#ifndef YY_
|
#ifndef YY_
|
||||||
# if YYENABLE_NLS
|
# if defined YYENABLE_NLS && YYENABLE_NLS
|
||||||
# if ENABLE_NLS
|
# if ENABLE_NLS
|
||||||
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
|
# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
|
||||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||||
@@ -330,11 +298,14 @@ b4_defines_if([
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||||
|
]b4_yylloc_default_define[
|
||||||
|
|
||||||
/* Suppress unused-variable warnings by "using" E. */
|
/* Suppress unused-variable warnings by "using" E. */
|
||||||
#define YYUSE(e) ((void) (e))
|
#define YYUSE(e) ((void) (e))
|
||||||
|
|
||||||
/* Enable debugging if requested. */
|
/* Enable debugging if requested. */
|
||||||
#if YYDEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
|
|
||||||
/* A pseudo ostream that takes yydebug_ into account. */
|
/* A pseudo ostream that takes yydebug_ into account. */
|
||||||
# define YYCDEBUG if (yydebug_) (*yycdebug_)
|
# define YYCDEBUG if (yydebug_) (*yycdebug_)
|
||||||
@@ -361,22 +332,24 @@ do { \
|
|||||||
yystack_print_ (); \
|
yystack_print_ (); \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
#else /* !YYDEBUG */
|
#else /* !]b4_api_PREFIX[DEBUG */
|
||||||
|
|
||||||
# define YYCDEBUG if (false) std::cerr
|
# define YYCDEBUG if (false) std::cerr
|
||||||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
|
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
|
||||||
# define YY_REDUCE_PRINT(Rule)
|
# define YY_REDUCE_PRINT(Rule)
|
||||||
# define YY_STACK_PRINT()
|
# define YY_STACK_PRINT()
|
||||||
|
|
||||||
#endif /* !YYDEBUG */
|
#endif /* !]b4_api_PREFIX[DEBUG */
|
||||||
|
|
||||||
|
#define yyerrok (yyerrstatus_ = 0)
|
||||||
|
#define yyclearin (yychar = yyempty_)
|
||||||
|
|
||||||
#define YYACCEPT goto yyacceptlab
|
#define YYACCEPT goto yyacceptlab
|
||||||
#define YYABORT goto yyabortlab
|
#define YYABORT goto yyabortlab
|
||||||
#define YYERROR goto yyerrorlab
|
#define YYERROR goto yyerrorlab
|
||||||
|
#define YYRECOVERING() (!!yyerrstatus_)
|
||||||
|
|
||||||
namespace ]b4_namespace[
|
]b4_namespace_open[]b4_error_verbose_if([[
|
||||||
{
|
|
||||||
#if YYERROR_VERBOSE
|
|
||||||
|
|
||||||
/* Return YYSTR after stripping away unnecessary quotes and
|
/* Return YYSTR after stripping away unnecessary quotes and
|
||||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||||
@@ -414,13 +387,12 @@ namespace ]b4_namespace[
|
|||||||
|
|
||||||
return yystr;
|
return yystr;
|
||||||
}
|
}
|
||||||
|
]])[
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Build a parser object.
|
/// Build a parser object.
|
||||||
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||||
:])[
|
:])[
|
||||||
#if YYDEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
|
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
|
||||||
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
||||||
#endif]b4_parse_param_cons[
|
#endif]b4_parse_param_cons[
|
||||||
@@ -431,7 +403,7 @@ namespace ]b4_namespace[
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#if YYDEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
/*--------------------------------.
|
/*--------------------------------.
|
||||||
| Print this symbol on YYOUTPUT. |
|
| Print this symbol on YYOUTPUT. |
|
||||||
`--------------------------------*/
|
`--------------------------------*/
|
||||||
@@ -442,6 +414,9 @@ namespace ]b4_namespace[
|
|||||||
{
|
{
|
||||||
YYUSE (yylocationp);
|
YYUSE (yylocationp);
|
||||||
YYUSE (yyvaluep);
|
YYUSE (yyvaluep);
|
||||||
|
std::ostream& yyo = debug_stream ();
|
||||||
|
std::ostream& yyoutput = yyo;
|
||||||
|
YYUSE (yyoutput);
|
||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
||||||
@@ -489,7 +464,7 @@ namespace ]b4_namespace[
|
|||||||
yylocation_stack_.pop (n);
|
yylocation_stack_.pop (n);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if YYDEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
std::ostream&
|
std::ostream&
|
||||||
]b4_parser_class_name[::debug_stream () const
|
]b4_parser_class_name[::debug_stream () const
|
||||||
{
|
{
|
||||||
@@ -516,6 +491,18 @@ namespace ]b4_namespace[
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
int
|
||||||
]b4_parser_class_name[::parse ()
|
]b4_parser_class_name[::parse ()
|
||||||
{
|
{
|
||||||
@@ -537,7 +524,7 @@ namespace ]b4_namespace[
|
|||||||
/// Location of the lookahead.
|
/// Location of the lookahead.
|
||||||
location_type yylloc;
|
location_type yylloc;
|
||||||
/// The locations where the error started and ended.
|
/// The locations where the error started and ended.
|
||||||
location yyerror_range[2];
|
location_type yyerror_range[3];
|
||||||
|
|
||||||
/// $$.
|
/// $$.
|
||||||
semantic_type yyval;
|
semantic_type yyval;
|
||||||
@@ -549,12 +536,10 @@ namespace ]b4_namespace[
|
|||||||
YYCDEBUG << "Starting parse" << std::endl;
|
YYCDEBUG << "Starting parse" << std::endl;
|
||||||
|
|
||||||
]m4_ifdef([b4_initial_action], [
|
]m4_ifdef([b4_initial_action], [
|
||||||
m4_pushdef([b4_at_dollar], [yylloc])dnl
|
b4_dollar_pushdef([yylval], [], [yylloc])dnl
|
||||||
m4_pushdef([b4_dollar_dollar], [yylval])dnl
|
/* User initialization code. */
|
||||||
/* User initialization code. */
|
b4_user_initial_action
|
||||||
b4_user_initial_action
|
b4_dollar_popdef])[]dnl
|
||||||
m4_popdef([b4_dollar_dollar])dnl
|
|
||||||
m4_popdef([b4_at_dollar])])dnl
|
|
||||||
|
|
||||||
[ /* Initialize the stacks. The initial state will be pushed in
|
[ /* Initialize the stacks. The initial state will be pushed in
|
||||||
yynewstate, since the latter expects the semantical and the
|
yynewstate, since the latter expects the semantical and the
|
||||||
@@ -582,7 +567,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
|
|
||||||
/* Try to take a decision without lookahead. */
|
/* Try to take a decision without lookahead. */
|
||||||
yyn = yypact_[yystate];
|
yyn = yypact_[yystate];
|
||||||
if (yyn == yypact_ninf_)
|
if (yy_pact_value_is_default_ (yyn))
|
||||||
goto yydefault;
|
goto yydefault;
|
||||||
|
|
||||||
/* Read a lookahead token. */
|
/* Read a lookahead token. */
|
||||||
@@ -590,7 +575,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
{
|
{
|
||||||
YYCDEBUG << "Reading a token: ";
|
YYCDEBUG << "Reading a token: ";
|
||||||
yychar = ]b4_c_function_call([yylex], [int],
|
yychar = ]b4_c_function_call([yylex], [int],
|
||||||
[[YYSTYPE*], [&yylval]][]dnl
|
[b4_api_PREFIX[STYPE*], [&yylval]][]dnl
|
||||||
b4_locations_if([, [[location*], [&yylloc]]])dnl
|
b4_locations_if([, [[location*], [&yylloc]]])dnl
|
||||||
m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
||||||
}
|
}
|
||||||
@@ -618,8 +603,8 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
|||||||
yyn = yytable_[yyn];
|
yyn = yytable_[yyn];
|
||||||
if (yyn <= 0)
|
if (yyn <= 0)
|
||||||
{
|
{
|
||||||
if (yyn == 0 || yyn == yytable_ninf_)
|
if (yy_table_value_is_error_ (yyn))
|
||||||
goto yyerrlab;
|
goto yyerrlab;
|
||||||
yyn = -yyn;
|
yyn = -yyn;
|
||||||
goto yyreduce;
|
goto yyreduce;
|
||||||
}
|
}
|
||||||
@@ -674,8 +659,20 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
|||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
]b4_user_actions[
|
]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);
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
|
||||||
|
|
||||||
yypop_ (yylen);
|
yypop_ (yylen);
|
||||||
@@ -699,15 +696,20 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
|||||||
| yyerrlab -- here on detecting error |
|
| yyerrlab -- here on detecting error |
|
||||||
`------------------------------------*/
|
`------------------------------------*/
|
||||||
yyerrlab:
|
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 not already recovering from an error, report this error. */
|
||||||
if (!yyerrstatus_)
|
if (!yyerrstatus_)
|
||||||
{
|
{
|
||||||
++yynerrs_;
|
++yynerrs_;
|
||||||
error (yylloc, yysyntax_error_ (yystate]dnl
|
if (yychar == yyempty_)
|
||||||
b4_error_verbose_if([, yytoken])[));
|
yytoken = yyempty_;
|
||||||
|
error (yylloc, yysyntax_error_ (yystate, yytoken));
|
||||||
}
|
}
|
||||||
|
|
||||||
yyerror_range[0] = yylloc;
|
yyerror_range[1] = yylloc;
|
||||||
if (yyerrstatus_ == 3)
|
if (yyerrstatus_ == 3)
|
||||||
{
|
{
|
||||||
/* If just tried and failed to reuse lookahead token after an
|
/* If just tried and failed to reuse lookahead token after an
|
||||||
@@ -742,7 +744,7 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
if (false)
|
if (false)
|
||||||
goto yyerrorlab;
|
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
|
/* Do not reclaim the symbols of the rule which action triggered
|
||||||
this YYERROR. */
|
this YYERROR. */
|
||||||
yypop_ (yylen);
|
yypop_ (yylen);
|
||||||
@@ -759,7 +761,7 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
yyn = yypact_[yystate];
|
yyn = yypact_[yystate];
|
||||||
if (yyn != yypact_ninf_)
|
if (!yy_pact_value_is_default_ (yyn))
|
||||||
{
|
{
|
||||||
yyn += yyterror_;
|
yyn += yyterror_;
|
||||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||||
@@ -774,7 +776,7 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
if (yystate_stack_.height () == 1)
|
if (yystate_stack_.height () == 1)
|
||||||
YYABORT;
|
YYABORT;
|
||||||
|
|
||||||
yyerror_range[0] = yylocation_stack_[0];
|
yyerror_range[1] = yylocation_stack_[0];
|
||||||
yydestruct_ ("Error: popping",
|
yydestruct_ ("Error: popping",
|
||||||
yystos_[yystate],
|
yystos_[yystate],
|
||||||
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
||||||
@@ -783,16 +785,16 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
YY_STACK_PRINT ();
|
YY_STACK_PRINT ();
|
||||||
}
|
}
|
||||||
|
|
||||||
yyerror_range[1] = yylloc;
|
yyerror_range[2] = yylloc;
|
||||||
// Using YYLLOC is tempting, but would change the location of
|
// Using YYLLOC is tempting, but would change the location of
|
||||||
// the lookahead. YYLOC is available though.
|
// the lookahead. YYLOC is available though.
|
||||||
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
|
YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
|
||||||
yysemantic_stack_.push (yylval);
|
yysemantic_stack_.push (yylval);
|
||||||
yylocation_stack_.push (yyloc);
|
yylocation_stack_.push (yyloc);
|
||||||
|
|
||||||
/* Shift the error token. */
|
/* Shift the error token. */
|
||||||
YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
|
YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
|
||||||
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
&yysemantic_stack_[0], &yylocation_stack_[0]);
|
||||||
|
|
||||||
yystate = yyn;
|
yystate = yyn;
|
||||||
goto yynewstate;
|
goto yynewstate;
|
||||||
@@ -809,7 +811,13 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
|
|
||||||
yyreturn:
|
yyreturn:
|
||||||
if (yychar != yyempty_)
|
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
|
/* Do not reclaim the symbols of the rule which action triggered
|
||||||
this YYABORT or YYACCEPT. */
|
this YYABORT or YYACCEPT. */
|
||||||
@@ -828,52 +836,100 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
|
|
||||||
// Generate an error message.
|
// Generate an error message.
|
||||||
std::string
|
std::string
|
||||||
]b4_parser_class_name[::yysyntax_error_ (int yystate]dnl
|
]b4_parser_class_name[::yysyntax_error_ (]dnl
|
||||||
b4_error_verbose_if([, int tok])[)
|
b4_error_verbose_if([int yystate, int yytoken],
|
||||||
{
|
[int, int])[)
|
||||||
std::string res;
|
{]b4_error_verbose_if([[
|
||||||
YYUSE (yystate);
|
std::string yyres;
|
||||||
#if YYERROR_VERBOSE
|
// Number of reported tokens (one for the "unexpected", one per
|
||||||
int yyn = yypact_[yystate];
|
// "expected").
|
||||||
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
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
|
yyarg[yycount++] = yytname_[yytoken];
|
||||||
YYCHECK. */
|
int yyn = yypact_[yystate];
|
||||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
if (!yy_pact_value_is_default_ (yyn))
|
||||||
|
{
|
||||||
/* Stay within bounds of both yycheck and yytname. */
|
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||||
int yychecklim = yylast_ - yyn + 1;
|
YYCHECK. In other words, skip the first -YYN actions for
|
||||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
this state because they are default actions. */
|
||||||
int count = 0;
|
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||||
for (int x = yyxbegin; x < yyxend; ++x)
|
/* Stay within bounds of both yycheck and yytname. */
|
||||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
int yychecklim = yylast_ - yyn + 1;
|
||||||
++count;
|
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||||
|
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||||
// FIXME: This method of building the message is not compatible
|
if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
|
||||||
// with internationalization. It should work like yacc.c does it.
|
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
|
||||||
// That is, first build a string that looks like this:
|
{
|
||||||
// "syntax error, unexpected %s or %s or %s"
|
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||||
// Then, invoke YY_ on this string.
|
{
|
||||||
// Finally, use the string as a format to output
|
yycount = 1;
|
||||||
// yytname_[tok], etc.
|
break;
|
||||||
// Until this gets fixed, this message appears in English only.
|
}
|
||||||
res = "syntax error, unexpected ";
|
else
|
||||||
res += yytnamerr_ (yytname_[tok]);
|
yyarg[yycount++] = yytname_[yyx];
|
||||||
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]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
#endif
|
char const* yyformat = YY_NULL;
|
||||||
res = YY_("syntax error");
|
switch (yycount)
|
||||||
return res;
|
{
|
||||||
|
#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 +942,9 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
]b4_pact[
|
]b4_pact[
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
|
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||||
doesn't specify something else to do. Zero means the default is an
|
YYTABLE doesn't specify something else to do. Zero means the
|
||||||
error. */
|
default is an error. */
|
||||||
const ]b4_int_type_for([b4_defact])[
|
const ]b4_int_type_for([b4_defact])[
|
||||||
]b4_parser_class_name[::yydefact_[] =
|
]b4_parser_class_name[::yydefact_[] =
|
||||||
{
|
{
|
||||||
@@ -911,7 +967,7 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
|
|
||||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||||
positive, shift that token. If negative, reduce the rule which
|
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(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[;
|
||||||
const ]b4_int_type_for([b4_table])[
|
const ]b4_int_type_for([b4_table])[
|
||||||
]b4_parser_class_name[::yytable_[] =
|
]b4_parser_class_name[::yytable_[] =
|
||||||
@@ -934,7 +990,7 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
]b4_stos[
|
]b4_stos[
|
||||||
};
|
};
|
||||||
|
|
||||||
#if YYDEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
/* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
|
/* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
|
||||||
to YYLEX-NUM. */
|
to YYLEX-NUM. */
|
||||||
const ]b4_int_type_for([b4_toknum])[
|
const ]b4_int_type_for([b4_toknum])[
|
||||||
@@ -958,7 +1014,7 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
]b4_r2[
|
]b4_r2[
|
||||||
};
|
};
|
||||||
|
|
||||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[
|
||||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||||
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
|
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
|
||||||
const char*
|
const char*
|
||||||
@@ -966,9 +1022,8 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
{
|
{
|
||||||
]b4_tname[
|
]b4_tname[
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
#if YYDEBUG
|
]b4_token_table_if([[#if ]b4_api_PREFIX[DEBUG]])[
|
||||||
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
||||||
const ]b4_parser_class_name[::rhs_number_type
|
const ]b4_parser_class_name[::rhs_number_type
|
||||||
]b4_parser_class_name[::yyrhs_[] =
|
]b4_parser_class_name[::yyrhs_[] =
|
||||||
@@ -1010,7 +1065,7 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
int yynrhs = yyr2_[yyrule];
|
int yynrhs = yyr2_[yyrule];
|
||||||
/* Print the symbols being reduced, and their result. */
|
/* Print the symbols being reduced, and their result. */
|
||||||
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
|
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
|
||||||
<< " (line " << yylno << "), ";
|
<< " (line " << yylno << "):" << std::endl;
|
||||||
/* The symbols being reduced. */
|
/* The symbols being reduced. */
|
||||||
for (int yyi = 0; yyi < yynrhs; yyi++)
|
for (int yyi = 0; yyi < yynrhs; yyi++)
|
||||||
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
|
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
|
||||||
@@ -1018,7 +1073,7 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
&]b4_rhs_value(yynrhs, yyi + 1)[,
|
&]b4_rhs_value(yynrhs, yyi + 1)[,
|
||||||
&]b4_rhs_location(yynrhs, yyi + 1)[);
|
&]b4_rhs_location(yynrhs, yyi + 1)[);
|
||||||
}
|
}
|
||||||
#endif // YYDEBUG
|
#endif // ]b4_api_PREFIX[DEBUG
|
||||||
|
|
||||||
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
||||||
]b4_parser_class_name[::token_number_type
|
]b4_parser_class_name[::token_number_type
|
||||||
@@ -1048,107 +1103,6 @@ b4_error_verbose_if([, int tok])[)
|
|||||||
const unsigned int ]b4_parser_class_name[::yyuser_token_number_max_ = ]b4_user_token_number_max[;
|
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[;
|
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
|
||||||
]b4_epilogue
|
m4_divert_pop(0)
|
||||||
dnl
|
|
||||||
@output b4_dir_prefix[]stack.hh
|
|
||||||
b4_copyright([Stack handling for Bison parsers in C++],
|
|
||||||
[2002, 2003, 2004, 2005, 2006])[
|
|
||||||
|
|
||||||
#ifndef BISON_STACK_HH
|
|
||||||
# define BISON_STACK_HH
|
|
||||||
|
|
||||||
#include <deque>
|
|
||||||
|
|
||||||
namespace ]b4_namespace[
|
|
||||||
{
|
|
||||||
template <class T, class S = std::deque<T> >
|
|
||||||
class stack
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Hide our reversed order.
|
|
||||||
typedef typename S::reverse_iterator iterator;
|
|
||||||
typedef typename S::const_reverse_iterator const_iterator;
|
|
||||||
|
|
||||||
stack () : seq_ ()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
stack (unsigned int n) : seq_ (n)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
|
||||||
T&
|
|
||||||
operator [] (unsigned int i)
|
|
||||||
{
|
|
||||||
return seq_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
|
||||||
const T&
|
|
||||||
operator [] (unsigned int i) const
|
|
||||||
{
|
|
||||||
return seq_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
|
||||||
push (const T& t)
|
|
||||||
{
|
|
||||||
seq_.push_front (t);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
|
||||||
pop (unsigned int n = 1)
|
|
||||||
{
|
|
||||||
for (; n; --n)
|
|
||||||
seq_.pop_front ();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
|
||||||
unsigned int
|
|
||||||
height () const
|
|
||||||
{
|
|
||||||
return seq_.size ();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const_iterator begin () const { return seq_.rbegin (); }
|
|
||||||
inline const_iterator end () const { return seq_.rend (); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
S seq_;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Present a slice of the top of a stack.
|
|
||||||
template <class T, class S = stack<T> >
|
|
||||||
class slice
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
slice (const S& stack,
|
|
||||||
unsigned int range) : stack_ (stack),
|
|
||||||
range_ (range)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
|
||||||
const T&
|
|
||||||
operator [] (unsigned int i) const
|
|
||||||
{
|
|
||||||
return stack_[range_ - i];
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
const S& stack_;
|
|
||||||
unsigned int range_;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // not BISON_STACK_HH]
|
|
||||||
m4_divert(-1)
|
|
||||||
|
|||||||
+928
@@ -0,0 +1,928 @@
|
|||||||
|
# Java skeleton for Bison -*- autoconf -*-
|
||||||
|
|
||||||
|
# Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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-2012])
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
yycdebug ("Starting parse\n");
|
||||||
|
yyerrstatus_ = 0;
|
||||||
|
|
||||||
|
]m4_ifdef([b4_initial_action], [
|
||||||
|
b4_dollar_pushdef([yylval], [], [yylloc])dnl
|
||||||
|
/* User initialization code. */
|
||||||
|
b4_user_initial_action
|
||||||
|
b4_dollar_popdef])[]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 == 0)
|
||||||
|
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
|
||||||
+79
-61
@@ -1,85 +1,85 @@
|
|||||||
m4_divert(-1)
|
|
||||||
|
|
||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301 USA
|
|
||||||
|
|
||||||
# We do want M4 expansion after # for CPP macros.
|
# We do want M4 expansion after # for CPP macros.
|
||||||
m4_changecom()
|
m4_changecom()
|
||||||
m4_divert(0)dnl
|
m4_divert_push(0)dnl
|
||||||
@output b4_dir_prefix[]position.hh
|
@output(b4_dir_prefix[]position.hh@)@
|
||||||
b4_copyright([Positions for Bison parsers in C++],
|
b4_copyright([Positions for Bison parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006])[
|
[2002-2007, 2009-2012])[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** \file position.hh
|
** \file ]b4_dir_prefix[position.hh
|
||||||
** Define the ]b4_namespace[::position class.
|
** Define the ]b4_namespace_ref[::position class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BISON_POSITION_HH
|
]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[
|
||||||
# define BISON_POSITION_HH
|
|
||||||
|
|
||||||
# include <iostream>
|
# include <algorithm> // std::max
|
||||||
|
# include <iosfwd>
|
||||||
# include <string>
|
# include <string>
|
||||||
# include <algorithm>
|
|
||||||
|
|
||||||
namespace ]b4_namespace[
|
]b4_null_define[
|
||||||
{
|
|
||||||
|
]b4_namespace_open[
|
||||||
/// Abstract a position.
|
/// Abstract a position.
|
||||||
class position
|
class position
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
]m4_ifdef([b4_location_constructors], [
|
]m4_ifdef([b4_location_constructors], [[
|
||||||
/// Construct a position.
|
/// Construct a position.
|
||||||
position ()
|
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
||||||
: filename (0), line (]b4_location_initial_line[), column (]b4_location_initial_column[)
|
unsigned int l = ]b4_location_initial_line[u,
|
||||||
|
unsigned int c = ]b4_location_initial_column[u)
|
||||||
|
: filename (f)
|
||||||
|
, line (l)
|
||||||
|
, column (c)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
])[
|
]])[
|
||||||
/// Initialization.
|
/// Initialization.
|
||||||
inline void initialize (]b4_filename_type[* fn)
|
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL,
|
||||||
|
unsigned int l = ]b4_location_initial_line[u,
|
||||||
|
unsigned int c = ]b4_location_initial_column[u)
|
||||||
{
|
{
|
||||||
filename = fn;
|
filename = fn;
|
||||||
line = ]b4_location_initial_line[;
|
line = l;
|
||||||
column = ]b4_location_initial_column[;
|
column = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \name Line and Column related manipulators
|
/** \name Line and Column related manipulators
|
||||||
** \{ */
|
** \{ */
|
||||||
public:
|
|
||||||
/// (line related) Advance to the COUNT next lines.
|
/// (line related) Advance to the COUNT next lines.
|
||||||
inline void lines (int count = 1)
|
void lines (int count = 1)
|
||||||
{
|
{
|
||||||
column = ]b4_location_initial_column[;
|
column = ]b4_location_initial_column[u;
|
||||||
line += count;
|
line += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// (column related) Advance to the COUNT next columns.
|
/// (column related) Advance to the COUNT next columns.
|
||||||
inline void columns (int count = 1)
|
void columns (int count = 1)
|
||||||
{
|
{
|
||||||
column = std::max (]b4_location_initial_column[u, column + count);
|
column = std::max (]b4_location_initial_column[u, column + count);
|
||||||
}
|
}
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
public:
|
|
||||||
/// File name to which this position refers.
|
/// File name to which this position refers.
|
||||||
]b4_filename_type[* filename;
|
]b4_percent_define_get([[filename_type]])[* filename;
|
||||||
/// Current line number.
|
/// Current line number.
|
||||||
unsigned int line;
|
unsigned int line;
|
||||||
/// Current column number.
|
/// Current column number.
|
||||||
@@ -115,15 +115,16 @@ namespace ]b4_namespace[
|
|||||||
{
|
{
|
||||||
return begin + -width;
|
return begin + -width;
|
||||||
}
|
}
|
||||||
]m4_if(b4_define_location_comparison, [1], [[
|
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||||
/// Compare two position objects.
|
/// Compare two position objects.
|
||||||
inline bool
|
inline bool
|
||||||
operator== (const position& pos1, const position& pos2)
|
operator== (const position& pos1, const position& pos2)
|
||||||
{
|
{
|
||||||
return
|
return (pos1.line == pos2.line
|
||||||
(pos1.filename == pos2.filename
|
&& pos1.column == pos2.column
|
||||||
|| pos1.filename && pos2.filename && *pos1.filename == *pos2.filename)
|
&& (pos1.filename == pos2.filename
|
||||||
&& pos1.line == pos2.line && pos1.column == pos2.column;
|
|| (pos1.filename && pos2.filename
|
||||||
|
&& *pos1.filename == *pos2.filename)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compare two position objects.
|
/// Compare two position objects.
|
||||||
@@ -145,43 +146,60 @@ namespace ]b4_namespace[
|
|||||||
return ostr << pos.line << '.' << pos.column;
|
return ostr << pos.line << '.' << pos.column;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
]b4_namespace_close[
|
||||||
#endif // not BISON_POSITION_HH]
|
]b4_cpp_guard_close([b4_dir_prefix[]position.hh])
|
||||||
@output b4_dir_prefix[]location.hh
|
@output(b4_dir_prefix[]location.hh@)@
|
||||||
b4_copyright([Locations for Bison parsers in C++],
|
b4_copyright([Locations for Bison parsers in C++],
|
||||||
[2002, 2003, 2004, 2005, 2006])[
|
[2002-2007, 2009-2012])[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** \file location.hh
|
** \file ]b4_dir_prefix[location.hh
|
||||||
** Define the ]b4_namespace[::location class.
|
** Define the ]b4_namespace_ref[::location class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BISON_LOCATION_HH
|
]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[
|
||||||
# define BISON_LOCATION_HH
|
|
||||||
|
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
# include <string>
|
# include <string>
|
||||||
# include "position.hh"
|
# include "position.hh"
|
||||||
|
|
||||||
namespace ]b4_namespace[
|
]b4_namespace_open[
|
||||||
{
|
|
||||||
|
|
||||||
/// Abstract a location.
|
/// Abstract a location.
|
||||||
class location
|
class location
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
]m4_ifdef([b4_location_constructors], [
|
]m4_ifdef([b4_location_constructors], [
|
||||||
/// Construct a location.
|
/// Construct a location from \a b to \a e.
|
||||||
location ()
|
location (const position& b, const position& e)
|
||||||
: begin (), end ()
|
: begin (b)
|
||||||
|
, end (e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Construct a 0-width location in \a p.
|
||||||
|
explicit location (const position& p = position ())
|
||||||
|
: begin (p)
|
||||||
|
, end (p)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Construct a 0-width location in \a f, \a l, \a c.
|
||||||
|
explicit location (]b4_percent_define_get([[filename_type]])[* f,
|
||||||
|
unsigned int l = ]b4_location_initial_line[u,
|
||||||
|
unsigned int c = ]b4_location_initial_column[u)
|
||||||
|
: begin (f, l, c)
|
||||||
|
, end (f, l, c)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
])[
|
])[
|
||||||
/// Initialization.
|
/// Initialization.
|
||||||
inline void initialize (]b4_filename_type[* fn)
|
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
||||||
|
unsigned int l = ]b4_location_initial_line[u,
|
||||||
|
unsigned int c = ]b4_location_initial_column[u)
|
||||||
{
|
{
|
||||||
begin.initialize (fn);
|
begin.initialize (f, l, c);
|
||||||
end = begin;
|
end = begin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,19 +207,19 @@ namespace ]b4_namespace[
|
|||||||
** \{ */
|
** \{ */
|
||||||
public:
|
public:
|
||||||
/// Reset initial location to final location.
|
/// Reset initial location to final location.
|
||||||
inline void step ()
|
void step ()
|
||||||
{
|
{
|
||||||
begin = end;
|
begin = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extend the current location to the COUNT next columns.
|
/// Extend the current location to the COUNT next columns.
|
||||||
inline void columns (unsigned int count = 1)
|
void columns (unsigned int count = 1)
|
||||||
{
|
{
|
||||||
end += count;
|
end += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extend the current location to the COUNT next lines.
|
/// Extend the current location to the COUNT next lines.
|
||||||
inline void lines (unsigned int count = 1)
|
void lines (unsigned int count = 1)
|
||||||
{
|
{
|
||||||
end.lines (count);
|
end.lines (count);
|
||||||
}
|
}
|
||||||
@@ -237,7 +255,7 @@ namespace ]b4_namespace[
|
|||||||
res.columns (width);
|
res.columns (width);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
]m4_if(b4_define_location_comparison, [1], [[
|
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||||
/// Compare two location objects.
|
/// Compare two location objects.
|
||||||
inline bool
|
inline bool
|
||||||
operator== (const location& loc1, const location& loc2)
|
operator== (const location& loc1, const location& loc2)
|
||||||
@@ -273,8 +291,8 @@ namespace ]b4_namespace[
|
|||||||
return ostr;
|
return ostr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
]b4_namespace_close[
|
||||||
|
|
||||||
#endif // not BISON_LOCATION_HH]
|
]b4_cpp_guard_close([b4_dir_prefix[]location.hh])
|
||||||
m4_divert(-1)
|
m4_divert_pop(0)
|
||||||
m4_changecom([#])
|
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
|
||||||
+124
@@ -0,0 +1,124 @@
|
|||||||
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
|
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
m4_pushdef([b4_copyright_years],
|
||||||
|
[2002-2012])
|
||||||
|
|
||||||
|
# We do want M4 expansion after # for CPP macros.
|
||||||
|
m4_changecom()
|
||||||
|
m4_divert_push(0)dnl
|
||||||
|
@output(b4_dir_prefix[]stack.hh@)@
|
||||||
|
b4_copyright([Stack handling for Bison parsers in C++],
|
||||||
|
[2002-2012])[
|
||||||
|
|
||||||
|
/**
|
||||||
|
** \file ]b4_dir_prefix[stack.hh
|
||||||
|
** Define the ]b4_namespace_ref[::stack class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
]b4_cpp_guard_open([b4_dir_prefix[]stack.hh])[
|
||||||
|
|
||||||
|
# include <deque>
|
||||||
|
|
||||||
|
]b4_namespace_open[
|
||||||
|
template <class T, class S = std::deque<T> >
|
||||||
|
class stack
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// Hide our reversed order.
|
||||||
|
typedef typename S::reverse_iterator iterator;
|
||||||
|
typedef typename S::const_reverse_iterator const_iterator;
|
||||||
|
|
||||||
|
stack () : seq_ ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
stack (unsigned int n) : seq_ (n)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
T&
|
||||||
|
operator [] (unsigned int i)
|
||||||
|
{
|
||||||
|
return seq_[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
const T&
|
||||||
|
operator [] (unsigned int i) const
|
||||||
|
{
|
||||||
|
return seq_[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
void
|
||||||
|
push (const T& t)
|
||||||
|
{
|
||||||
|
seq_.push_front (t);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
void
|
||||||
|
pop (unsigned int n = 1)
|
||||||
|
{
|
||||||
|
for (; n; --n)
|
||||||
|
seq_.pop_front ();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
unsigned int
|
||||||
|
height () const
|
||||||
|
{
|
||||||
|
return seq_.size ();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const_iterator begin () const { return seq_.rbegin (); }
|
||||||
|
inline const_iterator end () const { return seq_.rend (); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
S seq_;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Present a slice of the top of a stack.
|
||||||
|
template <class T, class S = stack<T> >
|
||||||
|
class slice
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
slice (const S& stack, unsigned int range)
|
||||||
|
: stack_ (stack)
|
||||||
|
, range_ (range)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
const T&
|
||||||
|
operator [] (unsigned int i) const
|
||||||
|
{
|
||||||
|
return stack_[range_ - i];
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const S& stack_;
|
||||||
|
unsigned int range_;
|
||||||
|
};
|
||||||
|
]b4_namespace_close[
|
||||||
|
|
||||||
|
]b4_cpp_guard_close([b4_dir_prefix[]stack.hh])
|
||||||
|
m4_divert_pop(0)
|
||||||
|
m4_popdef([b4_copyright_years])dnl
|
||||||
|
m4_changecom([#])
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
bison.xsl - common templates for Bison XSLT.
|
||||||
|
|
||||||
|
Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Written by Wojciech Polak <polak@gnu.org>.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Written by Wojciech Polak <polak@gnu.org>.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Written by Wojciech Polak <polak@gnu.org>.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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>
|
||||||
+989
-468
File diff suppressed because it is too large
Load Diff
+13
-14
@@ -1,21 +1,20 @@
|
|||||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||||
# Requires GNU sed
|
# Requires GNU sed
|
||||||
|
|
||||||
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
## Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2, or (at your option)
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
## This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
## You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
## along with this program; if not, write to the Free Software Foundation,
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
top_srcdir = ..
|
top_srcdir = ..
|
||||||
srcdir = .
|
srcdir = .
|
||||||
|
|||||||
+21
-20
@@ -1,11 +1,11 @@
|
|||||||
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||||
|
|
||||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -13,8 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software Foundation,
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
|
|
||||||
1.: DJGPP specific changes.
|
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
|
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
|
support this functionality so this has been reproduced in the usual
|
||||||
way by redirecting stdin and stdout of bison and m4 to temporary files
|
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
|
and processing these files in sequence.
|
||||||
are documented in the djgpp/diffs file.
|
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.
|
Please **read** the docs.
|
||||||
|
|
||||||
@@ -80,7 +84,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||||||
some more work to unpack, if LFN support is not available. If LFN is
|
some more work to unpack, if LFN support is not available. If LFN is
|
||||||
available then you can extract the source files from the archive with
|
available then you can extract the source files from the archive with
|
||||||
any unzip program and proceed to the paragraph 3.3, below. Any file
|
any unzip program and proceed to the paragraph 3.3, below. Any file
|
||||||
name issue will be handled by the the DJGPP configuration files.
|
name issue will be handled by the DJGPP configuration files.
|
||||||
To unpack the source distribution on SFN systems, first, you MUST use
|
To unpack the source distribution on SFN systems, first, you MUST use
|
||||||
the `djunpack' batch file to unzip the package. That is because some
|
the `djunpack' batch file to unzip the package. That is because some
|
||||||
file names in the official distributions need to be changed to avoid
|
file names in the official distributions need to be changed to avoid
|
||||||
@@ -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:
|
3.3.: To build the binaries you will need the following binary packages:
|
||||||
djdev203.zip (or a later but NOT a prior version)
|
djdev203.zip (or a later but NOT a prior version)
|
||||||
bsh204b.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,
|
gccNNNb.zip, gppNNN.zip, bnuNNNb.zip, makNNNb.zip, filNNNb.zip,
|
||||||
fil40b.zip, shl20jb.zip, txt20b.zip,
|
perlNNNb.zip, shlNNNb.zip, txtNNNb.zip, txiNNNb.zip, grepNNNb.zip,
|
||||||
txi48b.zip, grep24b.zip, sed415b.zip,
|
sedNNNb.zip and m4NNN.zip
|
||||||
m4-144b.zip.
|
|
||||||
|
|
||||||
If you want to run the check you will need also:
|
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.
|
ftp.delorie.com mirror.
|
||||||
You will need bsh204b.zip or later and *NOT* a prior version or
|
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
|
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
|
that Bison requires m4-144b.zip or later to work properly.
|
||||||
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.
|
|
||||||
|
|
||||||
3.4.: If for some reason you want to reconfigure the package cd into the top
|
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:
|
srcdir (bison-@TREE_VERSION@) and run the following commands:
|
||||||
@@ -178,7 +179,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||||||
|
|
||||||
This will install the products into your DJGPP installation tree given
|
This will install the products into your DJGPP installation tree given
|
||||||
by the default prefix "/dev/env/DJDIR". If you prefer to install them
|
by the default prefix "/dev/env/DJDIR". If you prefer to install them
|
||||||
into some other directory you will have to set prefix to the appropiate
|
into some other directory you will have to set prefix to the appropriate
|
||||||
value:
|
value:
|
||||||
make install prefix=z:/some/other/place
|
make install prefix=z:/some/other/place
|
||||||
|
|
||||||
|
|||||||
+102
-35
@@ -4,21 +4,20 @@ Rem Configure Bison for DJGPP.
|
|||||||
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||||
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||||
|
|
||||||
Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005-2012 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 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 the Free Software Foundation, either version 3 of the License, or
|
||||||
Rem any later version.
|
Rem (at your option) any later version.
|
||||||
|
Rem
|
||||||
Rem This program is distributed in the hope that it will be useful,
|
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 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
Rem GNU General Public License for more details.
|
Rem GNU General Public License for more details.
|
||||||
|
Rem
|
||||||
Rem You should have received a copy of the GNU General Public License
|
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 along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
echo Configuring Bison for DJGPP v2.x...
|
echo Configuring Bison for DJGPP v2.x...
|
||||||
|
|
||||||
@@ -143,17 +142,17 @@ shift
|
|||||||
if not "%1" == "" goto ArgLoop
|
if not "%1" == "" goto ArgLoop
|
||||||
|
|
||||||
Rem Create an arguments file for the configure script.
|
Rem Create an arguments file for the configure script.
|
||||||
echo --srcdir=%XSRC% > arguments
|
echo --srcdir=%XSRC% > args
|
||||||
if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> arguments
|
if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> args
|
||||||
if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> arguments
|
if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> args
|
||||||
if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments
|
if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> args
|
||||||
if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> arguments
|
if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> args
|
||||||
if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> arguments
|
if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> args
|
||||||
if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> arguments
|
if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> args
|
||||||
if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> arguments
|
if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> args
|
||||||
if "%HTML%" == "enabled" echo --enable-html >> arguments
|
if "%HTML%" == "enabled" echo --enable-html >> args
|
||||||
if "%HTML%" == "disabled" echo --disable-html >> arguments
|
if "%HTML%" == "disabled" echo --disable-html >> args
|
||||||
if not "%ARGS%" == "" echo %ARGS% >> arguments
|
if not "%ARGS%" == "" echo %ARGS% >> args
|
||||||
set ARGS=
|
set ARGS=
|
||||||
set CACHING=
|
set CACHING=
|
||||||
set DEPENDENCY_TRACKING=
|
set DEPENDENCY_TRACKING=
|
||||||
@@ -164,22 +163,26 @@ set HTML=
|
|||||||
if "%XSRC%" == "." goto InPlace
|
if "%XSRC%" == "." goto InPlace
|
||||||
|
|
||||||
:NotInPlace
|
:NotInPlace
|
||||||
redir -e /dev/null update %XSRC%/configure.orig ./configure
|
redir -e /dev/null update %XSRC%/configure.org ./configure
|
||||||
test -f ./configure
|
test -f ./configure
|
||||||
if errorlevel 1 update %XSRC%/configure ./configure
|
if errorlevel 1 update %XSRC%/configure ./configure
|
||||||
|
|
||||||
:InPlace
|
:InPlace
|
||||||
Rem Update configuration files
|
Rem Update configuration files
|
||||||
echo Updating configuration scripts...
|
echo Updating configuration scripts...
|
||||||
test -f ./configure.orig
|
test -f ./configure.org
|
||||||
if errorlevel 1 update configure configure.orig
|
if errorlevel 1 update configure configure.org
|
||||||
sed -f %XSRC%/djgpp/config.sed configure.orig > configure
|
sed -f %XSRC%/djgpp/config.sed configure.org > configure
|
||||||
if errorlevel 1 goto SedError
|
if errorlevel 1 goto SedError
|
||||||
|
|
||||||
Rem Make sure they have a config.site file
|
Rem Make sure they have a config.site file
|
||||||
set CONFIG_SITE=%XSRC%/djgpp/config.site
|
set CONFIG_SITE=%XSRC%/djgpp/config.site
|
||||||
if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
|
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
|
Rem Make sure crucial file names are not munged by unpacking
|
||||||
test -f %XSRC%/po/Makefile.in.in
|
test -f %XSRC%/po/Makefile.in.in
|
||||||
if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %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
|
if not errorlevel 1 mv -f %XSRC%/data/c++.m4 %XSRC%/data/cxx.m4
|
||||||
test -f %XSRC%/data/cxx.m4
|
test -f %XSRC%/data/cxx.m4
|
||||||
if errorlevel 1 mv -f %XSRC%/data/cpp.m4 %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
|
:scan_gram_c_Test
|
||||||
test -f %XSRC%/src/c-scan-gram.c
|
test -f %XSRC%/src/c-scan-gram.c
|
||||||
if not errorlevel 1 goto scan_skel_c_Test
|
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
|
if errorlevel 1 goto lalr1_ccFileError
|
||||||
mv ./lalr1.cc %XSRC%/data/lalr1.cc
|
mv ./lalr1.cc %XSRC%/data/lalr1.cc
|
||||||
sed "s/c++\.m4/cxx.m4/" %XSRC%/data/location.cc > location.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
|
mv ./location.cc %XSRC%/data/location.cc
|
||||||
sed "s/c++\.m4/cxx.m4/" %XSRC%/data/glr.cc > glr.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
|
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
|
Rem Define DJGPP specific defs in config.hin
|
||||||
echo Editing config.hin...
|
echo Editing config.hin...
|
||||||
test -f %XSRC%/config_h.orig
|
test -f %XSRC%/lib/config_h.org
|
||||||
if errorlevel 1 update %XSRC%/config.hin %XSRC%/config_h.orig
|
if errorlevel 1 update %XSRC%/lib/config.hin %XSRC%/lib/config_h.org
|
||||||
sed -f %XSRC%/djgpp/config_h.sed %XSRC%/config_h.orig > config.hin
|
sed -f %XSRC%/djgpp/config_h.sed %XSRC%/lib/config_h.org > config.hin
|
||||||
if errorlevel 1 goto SedError2
|
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.
|
Rem Fixing ilicit testsuite file name.
|
||||||
test -f %XSRC%/tests/c++.at
|
test -f %XSRC%/tests/c++.at
|
||||||
if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.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.
|
Rem Fixing ilicit calc++ file names in the calc++ directory.
|
||||||
test -d %XSRC%/examples/calc++
|
test -d %XSRC%/examples/calc++
|
||||||
if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx
|
if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx
|
||||||
@@ -412,21 +471,21 @@ redir -e /dev/null rm %XSRC%/po/stamp-cat-id
|
|||||||
|
|
||||||
Rem Update the arguments file for the configure script.
|
Rem Update the arguments file for the configure script.
|
||||||
Rem We prefer without-included-gettext because libintl.a from gettext package
|
Rem We prefer without-included-gettext because libintl.a from gettext package
|
||||||
Rem is the only one that is garanteed to have been ported to DJGPP.
|
Rem is the only one that is guaranteed to have been ported to DJGPP.
|
||||||
echo --enable-nls --without-included-gettext >> arguments
|
echo --enable-nls --without-included-gettext >> args
|
||||||
goto ConfigurePackage
|
goto ConfigurePackage
|
||||||
|
|
||||||
:MissingNLSTools
|
:MissingNLSTools
|
||||||
echo Needed libs/tools for NLS not found. Configuring without NLS.
|
echo Needed libs/tools for NLS not found. Configuring without NLS.
|
||||||
:WithoutNLS
|
:WithoutNLS
|
||||||
Rem Update the arguments file for the configure script.
|
Rem Update the arguments file for the configure script.
|
||||||
echo --disable-nls >> arguments
|
echo --disable-nls >> args
|
||||||
|
|
||||||
:ConfigurePackage
|
:ConfigurePackage
|
||||||
echo Running the ./configure script...
|
echo Running the ./configure script...
|
||||||
sh ./configure @arguments
|
sh ./configure @args
|
||||||
if errorlevel 1 goto CfgError
|
if errorlevel 1 goto CfgError
|
||||||
rm arguments
|
rm args
|
||||||
echo Done.
|
echo Done.
|
||||||
goto End
|
goto End
|
||||||
|
|
||||||
@@ -438,6 +497,10 @@ goto End
|
|||||||
echo ./data/glr.cc file editing failed!
|
echo ./data/glr.cc file editing failed!
|
||||||
goto End
|
goto End
|
||||||
|
|
||||||
|
:getargs_cFileError
|
||||||
|
echo ./src/getargs.c file editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
:location_ccFileError
|
:location_ccFileError
|
||||||
echo ./data/location.cc file editing failed!
|
echo ./data/location.cc file editing failed!
|
||||||
goto End
|
goto End
|
||||||
@@ -455,7 +518,11 @@ echo ./configure script editing failed!
|
|||||||
goto End
|
goto End
|
||||||
|
|
||||||
:SedError2
|
:SedError2
|
||||||
echo ./config.hin editing failed!
|
echo ./lib/config.hin editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:SedError3
|
||||||
|
echo ./tests/testsuite editing failed!
|
||||||
goto End
|
goto End
|
||||||
|
|
||||||
:CfgError
|
:CfgError
|
||||||
|
|||||||
+102
-76
@@ -1,77 +1,96 @@
|
|||||||
# DJGPP specific configuration file.
|
# DJGPP specific configuration file.
|
||||||
# Sed script for additional DJGPP specific editing
|
# 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-2012 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
# Additional editing of Makefiles
|
# 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.\
|
# DJGPP specific Makefile changes.\
|
||||||
/^aliaspath * *=/s,:,";",g;t t\
|
s,\\.deps,_deps,g\
|
||||||
/TEXINPUTS=/s,:,";",g;t t\
|
s,\\.libs,_libs,g\
|
||||||
/PATH=/s,:,";",g;t t\
|
s,\\.new\\.,_new.,g\
|
||||||
s,\\.deps,_deps,g;t t\
|
s,\\.old\\.,_old.,g\
|
||||||
s,\\.new\\.,_new.,g;t t\
|
s,\\.tab\\.,_tab.,g\
|
||||||
s,\\.old\\.,_old.,g;t t\
|
s,c++\\.at,cxx.at,g\
|
||||||
s,c++\\.at,cxx.at,g;t t\
|
s,c++\\.m4,cxx.m4,g\
|
||||||
s,c++\\.m4,cxx.m4,g;t t\
|
s,c++-skel\\.m4,cxx-skel.m4,g\
|
||||||
s,calc++,calcxx,g;t t\
|
s,calc++,calcxx,g\
|
||||||
s,scan-gram-c,c-scan-gram,g;t t\
|
s,scan-gram-c,c-scan-gram,g\
|
||||||
s,scan-skel-c,c-scan-skel,g;t t\
|
s,scan-skel-c,c-scan-skel,g\
|
||||||
s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
|
s,inttypes_,_inttypes,g\
|
||||||
s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
|
s,javacomp\\.sh\\.in,javacomp.sh-in,g\
|
||||||
s,(MAKEINFOFLAGS),& --no-split,\
|
s,javaexec\\.sh\\.in,javaexec.sh-in,g\
|
||||||
/^install-info-am:/,/^$/ {\
|
s,yacc\\.1\\.in,yacc.1-in,g\
|
||||||
/@list=/ s,\\\$(INFO_DEPS),& bison.i,\
|
s,bench\\.pl\\.in,bench.pl-in,g\
|
||||||
/@for *file/ s,\\\$(INFO_DEPS),& bison.i,\
|
s,Makefile\\.am\\.in,Makefile.am-in,g\
|
||||||
s,file-\\[0-9\\]\\[0-9\\],& \\$\\$file[0-9] \\$\\$file[0-9][0-9],\
|
s,Makefile\\.in\\.in,Makefile.in-in,g\
|
||||||
}\
|
/^\\.y\\.c:/,/^$/ {\
|
||||||
/^\\.y\\.c:/,/^$/ {\
|
/\\\$(YACCCOMPILE)/ {\
|
||||||
/\\\$(YACCCOMPILE)/ {\
|
a\\\\\\
|
||||||
a\\\\
|
-@test -f y.tab.c && mv -f y.tab.c y_tab.c\\\\\
|
||||||
-@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\
|
-@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\\\
|
/^libbison.a:/ i\\\\\\
|
||||||
subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\
|
\\\$(top_srcdir)/djgpp/subpipe.c: \\$(top_srcdir)/djgpp/subpipe.h\\\\\
|
||||||
|
subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\\\
|
||||||
\\\$(COMPILE) -c \\$<\
|
\\\$(COMPILE) -c \\$<\
|
||||||
/^yacc:/ i\\\\
|
/^yacc:/ i\\\\\\
|
||||||
yacc.bat:\\\
|
yacc.bat:\\\\\
|
||||||
echo "bison\\$(EXEEXT) -y %1 %2 %3 %4 %5 %6 %7 %8 %9" >\\$@\
|
echo "bison\\$(EXEEXT) -y %1 %2 %3 %4 %5 %6 %7 %8 %9" >\\$@\
|
||||||
/^bin_SCRIPTS =/s/$/ yacc.bat/\
|
/^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.
|
# Makefile.in.in is renamed to Makefile.in-in.
|
||||||
/ac_config_files=/,/_ACEOF/ {
|
/ac_config_files=/ {
|
||||||
s|po/Makefile\.in|&:po/Makefile.in-in|
|
/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
|
# 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 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 generated Makefiles good for every DJGPP installation, not only
|
||||||
# the one where the package was configured (which could happen to be
|
# the one where the package was configured (which could happen to be
|
||||||
# a Windows box, where leading dots in file names are allowed).
|
# a Windows box, where leading dots in file names are allowed).
|
||||||
s,\.deps,_deps,g
|
|
||||||
s,\.libs,_libs,g
|
|
||||||
/^rmdir[ ]*\.tst/ i\
|
/^rmdir[ ]*\.tst/ i\
|
||||||
am__leading_dot=_
|
am__leading_dot=_
|
||||||
|
|
||||||
@@ -91,18 +110,6 @@ am__leading_dot=_
|
|||||||
# DOS-style absolute file names should be supported as well
|
# DOS-style absolute file names should be supported as well
|
||||||
/\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*,
|
/\*) 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
|
# The following two items are changes needed for configuring
|
||||||
# and compiling across partitions.
|
# and compiling across partitions.
|
||||||
# 1) The given srcdir value is always translated from the
|
# 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.
|
# which the package has not been configured for.
|
||||||
/MISSING=/,/^$/ {
|
/MISSING=/,/^$/ {
|
||||||
/^fi$/ a\
|
/^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=/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
|
# This will only work if the assumption that the
|
||||||
# testsuite is ran from the following path:
|
# testsuite is ran from the following path:
|
||||||
# ${top_srcdir}/tests/testsuite.dir
|
# ${top_srcdir}/tests/testsuite.dir
|
||||||
# holds. The explicit names are of no importance.
|
# holds. The explicit names are of no importance.
|
||||||
# ../../. == ${top_srcdir}
|
# ../../. == ${top_srcdir}
|
||||||
/\.)[ ]*ac_abs_builddir=/,/^esac$/ {
|
#/^esac$/,/^ac_abs_srcdir=/ {
|
||||||
/^esac$/ a\
|
/^ac_abs_srcdir=/ i\
|
||||||
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_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_builddir=/,/^esac$/ {
|
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+]*%../../..%"`
|
||||||
/^esac$/ a\
|
#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_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=/ a\
|
||||||
}
|
for dj_dir in $ac_abs_builddir $ac_abs_top_builddir $ac_abs_top_srcdir $ac_abs_srcdir\
|
||||||
/\.)[ ]*ac_abs_srcdir=/,/^esac$/ {
|
do\
|
||||||
/^esac$/ a\
|
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%//%/%g"`\
|
||||||
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_builddir=`echo "$ac_abs_top_builddir" | sed "s%//%/%g"`\
|
||||||
}
|
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%//%/%g"`\
|
||||||
/\.)[ ]*ac_abs_top_srcdir=/,/^esac$/ {
|
ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%//%/%g"`\
|
||||||
/^esac$/ a\
|
done
|
||||||
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]*/[^/]*%../../../%"`
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add DJGPP version information.
|
# Add DJGPP version information.
|
||||||
/^#define VERSION/ s/\$VERSION/& (DJGPP port (r1))/
|
/^#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_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"`
|
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
|
# The following is not a valid DOS file name
|
||||||
s/calc++/calcxx/g
|
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
|
# This is the config.site file for configuring GNU packages
|
||||||
# which are to be built with DJGPP tools.
|
# which are to be built with DJGPP tools.
|
||||||
|
|
||||||
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
|
|
||||||
# Include the djgpp subdirectory in PATH, so that getconf is found
|
# 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.
|
# A sane default for sed.
|
||||||
ac_cv_path_SED=${SED='/dev/env/DJDIR/bin/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
|
# These are set here so the generated libtool will be good
|
||||||
# for every DJGPP installation, not only the one where the
|
# for every DJGPP installation, not only the one where the
|
||||||
# package was configured.
|
# package was configured.
|
||||||
|
|||||||
+7
-8
@@ -1,20 +1,19 @@
|
|||||||
# sed script for DJGPP specific editing of config.hin
|
# sed script for DJGPP specific editing of config.hin
|
||||||
|
|
||||||
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
|
|
||||||
$ a\
|
$ 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 renaming some of the files whose names are invalid on DOS or conflict
|
||||||
Rem with other file names after truncation to DOS 8+3 namespace.
|
Rem with other file names after truncation to DOS 8+3 namespace.
|
||||||
Rem
|
Rem
|
||||||
Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
||||||
Rem
|
Rem
|
||||||
Rem This program is free software; you can redistribute it and/or modify
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
Rem it under the terms of the GNU General Public License as published by
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
Rem the Free Software Foundation; either version 2, or (at your option)
|
Rem the Free Software Foundation, either version 3 of the License, or
|
||||||
Rem any later version.
|
Rem (at your option) any later version.
|
||||||
Rem
|
Rem
|
||||||
Rem This program is distributed in the hope that it will be useful,
|
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 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 GNU General Public License for more details.
|
||||||
Rem
|
Rem
|
||||||
Rem You should have received a copy of the GNU General Public License
|
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 along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
Rem
|
Rem
|
||||||
Rem
|
Rem
|
||||||
Rem Invoke like this:
|
Rem Invoke like this:
|
||||||
|
|||||||
+27
-2
@@ -1,2 +1,27 @@
|
|||||||
@V@/src/scan-gram-c.c @V@/src/c-scan-gram.c
|
@V@/build-aux/javacomp.sh.in @V@/build-aux/javacomp.sh-in
|
||||||
@V@/src/scan-skel-c.c @V@/src/c-scan-skel.c
|
@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
|
||||||
|
|||||||
+26
-18
@@ -1,11 +1,11 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -13,15 +13,12 @@
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software Foundation,
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
/* Written by Juan Manuel Guerrero <[email protected]>. */
|
/* Written by Juan Manuel Guerrero <[email protected]>. */
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#include <config.h>
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "subpipe.h"
|
#include "subpipe.h"
|
||||||
|
|
||||||
@@ -63,22 +60,33 @@ static char tmp_file_name[2][L_tmpnam];
|
|||||||
do { \
|
do { \
|
||||||
close ((fd)); \
|
close ((fd)); \
|
||||||
if (unlink ((name))) \
|
if (unlink ((name))) \
|
||||||
error (EXIT_FAILURE, 0, _("removing of `%s' failed"), (name)); \
|
error (EXIT_FAILURE, 0, _("removing of '%s' failed"), (name)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
init_subpipe(void)
|
init_subpipe(void)
|
||||||
{
|
{
|
||||||
|
char *tmpdir;
|
||||||
int fd;
|
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]);
|
fd = mkstemp(tmp_file_name[0]);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
||||||
close (fd);
|
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]);
|
fd = mkstemp(tmp_file_name[1]);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
||||||
@@ -223,17 +231,17 @@ end_of_output_subpipe(pid_t pid, int fd[2])
|
|||||||
{
|
{
|
||||||
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
error(EXIT_FAILURE, 0, _("subsidiary program `%s' interrupted"), program);
|
error(EXIT_FAILURE, 0, _("subsidiary program '%s' interrupted"), program);
|
||||||
}
|
}
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
error(EXIT_FAILURE, 0, _(errno == ENOENT
|
error(EXIT_FAILURE, 0, _(errno == ENOENT
|
||||||
? "subsidiary program `%s' not found"
|
? "subsidiary program '%s' not found"
|
||||||
: status < 1
|
: status < 1
|
||||||
? "subsidiary program `%s' failed"
|
? "subsidiary program '%s' failed"
|
||||||
: "subsidiary program `%s' failed (status=%i, errno=%i)"), program, status, errno);
|
: "subsidiary program '%s' failed (status=%i, errno=%i)"), program, status, errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -275,9 +283,9 @@ reap_subpipe(pid_t pid, char const *program)
|
|||||||
free(arguments);
|
free(arguments);
|
||||||
|
|
||||||
if (unlink(tmp_file_name[0]))
|
if (unlink(tmp_file_name[0]))
|
||||||
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[0]);
|
error(EXIT_FAILURE, 0, _("removing of '%s' failed"), tmp_file_name[0]);
|
||||||
if (unlink(tmp_file_name[1]))
|
if (unlink(tmp_file_name[1]))
|
||||||
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[1]);
|
error(EXIT_FAILURE, 0, _("removing of '%s' failed"), tmp_file_name[1]);
|
||||||
|
|
||||||
if (dup2(old_stdin, STDIN_FILENO) < 0)
|
if (dup2(old_stdin, STDIN_FILENO) < 0)
|
||||||
error(EXIT_FAILURE, 0, "restore of bison's stdin failed");
|
error(EXIT_FAILURE, 0, "restore of bison's stdin failed");
|
||||||
|
|||||||
+5
-5
@@ -1,9 +1,10 @@
|
|||||||
/* Subprocesses with pipes.
|
/* 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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
@@ -12,8 +13,7 @@
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software Foundation,
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
|
||||||
|
|
||||||
/* Written by Juan Manuel Guerrero <[email protected]>. */
|
/* 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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
# 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
|
||||||
|
/fdl.texi
|
||||||
|
/gendocs_template
|
||||||
|
/gpl-3.0.texi
|
||||||
|
/refcard.dvi
|
||||||
|
/refcard.log
|
||||||
|
/refcard.ps
|
||||||
|
/stamp-vti
|
||||||
|
/version.texi
|
||||||
|
/yacc.1
|
||||||
+3
-3
@@ -23,7 +23,7 @@ PROJECT_NAME = "@PACKAGE_NAME@"
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# 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)
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||||
# base path where the generated documentation will be put.
|
# base path where the generated documentation will be put.
|
||||||
@@ -391,7 +391,7 @@ EXCLUDE = @top_srcdir@/src/scan-gram.c \
|
|||||||
@top_builddir@/src/parse-*.[ch]
|
@top_builddir@/src/parse-*.[ch]
|
||||||
|
|
||||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||||
# directories that are symbolic links (a Unix filesystem feature) are
|
# directories that are symbolic links (a Unix file system feature) are
|
||||||
# excluded from the input.
|
# excluded from the input.
|
||||||
|
|
||||||
EXCLUDE_SYMLINKS = YES
|
EXCLUDE_SYMLINKS = YES
|
||||||
@@ -982,7 +982,7 @@ CLASS_GRAPH = YES
|
|||||||
COLLABORATION_GRAPH = YES
|
COLLABORATION_GRAPH = YES
|
||||||
|
|
||||||
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
|
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
|
||||||
# collaboration diagrams in a style similiar to the OMG's Unified Modeling
|
# collaboration diagrams in a style similar to the OMG's Unified Modeling
|
||||||
# Language.
|
# Language.
|
||||||
|
|
||||||
UML_LOOK = NO
|
UML_LOOK = NO
|
||||||
|
|||||||
+85
-28
@@ -1,39 +1,100 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
## Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.
|
||||||
## 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,
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# it under the terms of the GNU General Public License as published by
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## GNU General Public License for more details.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
## You should have received a copy of the GNU General Public License
|
# This program is distributed in the hope that it will be useful,
|
||||||
## along with this program; if not, write to the Free Software
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## 02110-1301 USA
|
# 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
|
AM_MAKEINFOFLAGS = --no-split
|
||||||
info_TEXINFOS = bison.texinfo
|
info_TEXINFOS = bison.texi
|
||||||
man_MANS = bison.1
|
bison_TEXINFOS = $(srcdir)/cross-options.texi gpl-3.0.texi fdl.texi
|
||||||
bison_TEXINFOS = gpl.texi fdl.texi
|
|
||||||
|
|
||||||
EXTRA_DIST = bison.1 refcard.tex
|
CLEANFILES = bison.fns
|
||||||
|
|
||||||
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
|
|
||||||
CLEANDIRS = *.t2d
|
CLEANDIRS = *.t2d
|
||||||
clean-local:
|
clean-local:
|
||||||
rm -rf $(CLEANDIRS)
|
rm -rf $(CLEANDIRS)
|
||||||
|
|
||||||
|
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
||||||
|
$(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
|
||||||
|
$(AM_V_GEN)mv -f $@ $@~ || : >$@~
|
||||||
|
$(AM_V_at)rm -f $@.tmp
|
||||||
|
$(AM_V_at)cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||||
|
$(AM_V_at)$(top_builddir)/src/bison --help \
|
||||||
|
| perl $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
||||||
|
$(AM_V_at)diff -u $@~ $@.tmp || true
|
||||||
|
$(AM_V_at)mv $@.tmp $@
|
||||||
|
MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
|
||||||
|
|
||||||
|
## ---------- ##
|
||||||
|
## Ref card. ##
|
||||||
|
## ---------- ##
|
||||||
|
|
||||||
|
EXTRA_DIST = refcard.tex
|
||||||
|
CLEANFILES += refcard.dvi refcard.log refcard.ps
|
||||||
|
|
||||||
refcard.dvi: refcard.tex
|
refcard.dvi: refcard.tex
|
||||||
tex refcard.tex
|
$(AM_V_GEN)tex refcard.tex
|
||||||
|
|
||||||
refcard.ps: refcard.dvi
|
refcard.ps: refcard.dvi
|
||||||
|
|
||||||
|
|
||||||
|
## ----------- ##
|
||||||
|
## Man Pages. ##
|
||||||
|
## ----------- ##
|
||||||
|
|
||||||
|
dist_man_MANS = $(srcdir)/bison.1
|
||||||
|
|
||||||
|
EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
|
||||||
|
MAINTAINERCLEANFILES += $(dist_man_MANS)
|
||||||
|
|
||||||
|
# Depend on configure to get version number changes.
|
||||||
|
common_dep = $(top_srcdir)/configure $(srcdir)/common.x
|
||||||
|
srcsrcdir = $(top_srcdir)/bin
|
||||||
|
$(srcdir)/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
|
||||||
|
|
||||||
|
# Differences to ignore when comparing the man page (the date).
|
||||||
|
remove_time_stamp = \
|
||||||
|
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
||||||
|
|
||||||
|
MOSTLYCLEANFILES = $(srcdir)/*.t
|
||||||
|
|
||||||
|
SUFFIXES = .x .1
|
||||||
|
|
||||||
|
PREPATH = $(top_builddir)/src
|
||||||
|
.x.1:
|
||||||
|
$(AM_V_GEN)program=`expr "/$*" : '.*/\(.*\)'` && \
|
||||||
|
save_IFS=$IFS; \
|
||||||
|
IFS=$(PATH_SEPARATOR); \
|
||||||
|
for dir in $(PREPATH); do \
|
||||||
|
IFS=$save_IFS; \
|
||||||
|
echo cd $$dir '&&' $(MAKE) $(AM_MAKEFLAGS) $$program && \
|
||||||
|
(cd $$dir && $(MAKE) $(AM_MAKEFLAGS) $$program) || exit; \
|
||||||
|
done
|
||||||
|
$(AM_V_at)PATH="$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \
|
||||||
|
export PATH; \
|
||||||
|
$(HELP2MAN) \
|
||||||
|
--include=$*.x \
|
||||||
|
--include=$(srcdir)/common.x \
|
||||||
|
--output=$@.t `echo '$*' | sed 's,.*/,,'`
|
||||||
|
$(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
|
||||||
|
$(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
|
||||||
|
touch $@; \
|
||||||
|
else \
|
||||||
|
mv $@.t $@; \
|
||||||
|
fi
|
||||||
|
$(AM_V_at)rm -f $@*.t
|
||||||
|
|
||||||
|
nodist_man_MANS = yacc.1
|
||||||
|
|
||||||
## -------------- ##
|
## -------------- ##
|
||||||
## Doxygenation. ##
|
## Doxygenation. ##
|
||||||
@@ -48,8 +109,7 @@ doc: html
|
|||||||
html-local: Doxyfile
|
html-local: Doxyfile
|
||||||
$(DOXYGEN)
|
$(DOXYGEN)
|
||||||
|
|
||||||
edit = sed -e "s|@ID@|$$Id|" \
|
edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
||||||
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
|
||||||
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
||||||
-e 's,@top_builddir\@,$(top_builddir),g' \
|
-e 's,@top_builddir\@,$(top_builddir),g' \
|
||||||
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
||||||
@@ -58,10 +118,7 @@ EXTRA_DIST += Doxyfile.in
|
|||||||
CLEANFILES += Doxyfile
|
CLEANFILES += Doxyfile
|
||||||
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
||||||
# configure, because the former is way faster than the latter.
|
# configure, because the former is way faster than the latter.
|
||||||
# Moreover, this file is updated whenever ChangeLog is touched: using
|
Doxyfile: $(srcdir)/Doxyfile.in
|
||||||
# sed instead of configure saves us a lot of time.
|
$(AM_V_GEN)$(edit) $(srcdir)/Doxyfile.in >Doxyfile
|
||||||
Doxyfile: $(top_srcdir)/ChangeLog $(srcdir)/Doxyfile.in
|
|
||||||
Id=`grep '^\$$Id' $(top_srcdir)/ChangeLog`; \
|
|
||||||
$(edit) $(srcdir)/Doxyfile.in >Doxyfile
|
|
||||||
|
|
||||||
CLEANDIRS += html latex
|
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.
|
|
||||||
+4513
-1680
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).
|
||||||
-452
@@ -1,452 +0,0 @@
|
|||||||
|
|
||||||
@node GNU Free Documentation License
|
|
||||||
@appendixsec GNU Free Documentation License
|
|
||||||
|
|
||||||
@cindex FDL, GNU Free Documentation License
|
|
||||||
@center Version 1.2, November 2002
|
|
||||||
|
|
||||||
@display
|
|
||||||
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
@end display
|
|
||||||
|
|
||||||
@enumerate 0
|
|
||||||
@item
|
|
||||||
PREAMBLE
|
|
||||||
|
|
||||||
The purpose of this License is to make a manual, textbook, or other
|
|
||||||
functional and useful document @dfn{free} in the sense of freedom: to
|
|
||||||
assure everyone the effective freedom to copy and redistribute it,
|
|
||||||
with or without modifying it, either commercially or noncommercially.
|
|
||||||
Secondarily, this License preserves for the author and publisher a way
|
|
||||||
to get credit for their work, while not being considered responsible
|
|
||||||
for modifications made by others.
|
|
||||||
|
|
||||||
This License is a kind of ``copyleft'', which means that derivative
|
|
||||||
works of the document must themselves be free in the same sense. It
|
|
||||||
complements the GNU General Public License, which is a copyleft
|
|
||||||
license designed for free software.
|
|
||||||
|
|
||||||
We have designed this License in order to use it for manuals for free
|
|
||||||
software, because free software needs free documentation: a free
|
|
||||||
program should come with manuals providing the same freedoms that the
|
|
||||||
software does. But this License is not limited to software manuals;
|
|
||||||
it can be used for any textual work, regardless of subject matter or
|
|
||||||
whether it is published as a printed book. We recommend this License
|
|
||||||
principally for works whose purpose is instruction or reference.
|
|
||||||
|
|
||||||
@item
|
|
||||||
APPLICABILITY AND DEFINITIONS
|
|
||||||
|
|
||||||
This License applies to any manual or other work, in any medium, that
|
|
||||||
contains a notice placed by the copyright holder saying it can be
|
|
||||||
distributed under the terms of this License. Such a notice grants a
|
|
||||||
world-wide, royalty-free license, unlimited in duration, to use that
|
|
||||||
work under the conditions stated herein. The ``Document'', below,
|
|
||||||
refers to any such manual or work. Any member of the public is a
|
|
||||||
licensee, and is addressed as ``you''. You accept the license if you
|
|
||||||
copy, modify or distribute the work in a way requiring permission
|
|
||||||
under copyright law.
|
|
||||||
|
|
||||||
A ``Modified Version'' of the Document means any work containing the
|
|
||||||
Document or a portion of it, either copied verbatim, or with
|
|
||||||
modifications and/or translated into another language.
|
|
||||||
|
|
||||||
A ``Secondary Section'' is a named appendix or a front-matter section
|
|
||||||
of the Document that deals exclusively with the relationship of the
|
|
||||||
publishers or authors of the Document to the Document's overall
|
|
||||||
subject (or to related matters) and contains nothing that could fall
|
|
||||||
directly within that overall subject. (Thus, if the Document is in
|
|
||||||
part a textbook of mathematics, a Secondary Section may not explain
|
|
||||||
any mathematics.) The relationship could be a matter of historical
|
|
||||||
connection with the subject or with related matters, or of legal,
|
|
||||||
commercial, philosophical, ethical or political position regarding
|
|
||||||
them.
|
|
||||||
|
|
||||||
The ``Invariant Sections'' are certain Secondary Sections whose titles
|
|
||||||
are designated, as being those of Invariant Sections, in the notice
|
|
||||||
that says that the Document is released under this License. If a
|
|
||||||
section does not fit the above definition of Secondary then it is not
|
|
||||||
allowed to be designated as Invariant. The Document may contain zero
|
|
||||||
Invariant Sections. If the Document does not identify any Invariant
|
|
||||||
Sections then there are none.
|
|
||||||
|
|
||||||
The ``Cover Texts'' are certain short passages of text that are listed,
|
|
||||||
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
|
|
||||||
the Document is released under this License. A Front-Cover Text may
|
|
||||||
be at most 5 words, and a Back-Cover Text may be at most 25 words.
|
|
||||||
|
|
||||||
A ``Transparent'' copy of the Document means a machine-readable copy,
|
|
||||||
represented in a format whose specification is available to the
|
|
||||||
general public, that is suitable for revising the document
|
|
||||||
straightforwardly with generic text editors or (for images composed of
|
|
||||||
pixels) generic paint programs or (for drawings) some widely available
|
|
||||||
drawing editor, and that is suitable for input to text formatters or
|
|
||||||
for automatic translation to a variety of formats suitable for input
|
|
||||||
to text formatters. A copy made in an otherwise Transparent file
|
|
||||||
format whose markup, or absence of markup, has been arranged to thwart
|
|
||||||
or discourage subsequent modification by readers is not Transparent.
|
|
||||||
An image format is not Transparent if used for any substantial amount
|
|
||||||
of text. A copy that is not ``Transparent'' is called ``Opaque''.
|
|
||||||
|
|
||||||
Examples of suitable formats for Transparent copies include plain
|
|
||||||
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
|
|
||||||
format, @acronym{SGML} or @acronym{XML} using a publicly available
|
|
||||||
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
|
|
||||||
PostScript or @acronym{PDF} designed for human modification. Examples
|
|
||||||
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
|
|
||||||
@acronym{JPG}. Opaque formats include proprietary formats that can be
|
|
||||||
read and edited only by proprietary word processors, @acronym{SGML} or
|
|
||||||
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
|
|
||||||
not generally available, and the machine-generated @acronym{HTML},
|
|
||||||
PostScript or @acronym{PDF} produced by some word processors for
|
|
||||||
output purposes only.
|
|
||||||
|
|
||||||
The ``Title Page'' means, for a printed book, the title page itself,
|
|
||||||
plus such following pages as are needed to hold, legibly, the material
|
|
||||||
this License requires to appear in the title page. For works in
|
|
||||||
formats which do not have any title page as such, ``Title Page'' means
|
|
||||||
the text near the most prominent appearance of the work's title,
|
|
||||||
preceding the beginning of the body of the text.
|
|
||||||
|
|
||||||
A section ``Entitled XYZ'' means a named subunit of the Document whose
|
|
||||||
title either is precisely XYZ or contains XYZ in parentheses following
|
|
||||||
text that translates XYZ in another language. (Here XYZ stands for a
|
|
||||||
specific section name mentioned below, such as ``Acknowledgements'',
|
|
||||||
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
|
|
||||||
of such a section when you modify the Document means that it remains a
|
|
||||||
section ``Entitled XYZ'' according to this definition.
|
|
||||||
|
|
||||||
The Document may include Warranty Disclaimers next to the notice which
|
|
||||||
states that this License applies to the Document. These Warranty
|
|
||||||
Disclaimers are considered to be included by reference in this
|
|
||||||
License, but only as regards disclaiming warranties: any other
|
|
||||||
implication that these Warranty Disclaimers may have is void and has
|
|
||||||
no effect on the meaning of this License.
|
|
||||||
|
|
||||||
@item
|
|
||||||
VERBATIM COPYING
|
|
||||||
|
|
||||||
You may copy and distribute the Document in any medium, either
|
|
||||||
commercially or noncommercially, provided that this License, the
|
|
||||||
copyright notices, and the license notice saying this License applies
|
|
||||||
to the Document are reproduced in all copies, and that you add no other
|
|
||||||
conditions whatsoever to those of this License. You may not use
|
|
||||||
technical measures to obstruct or control the reading or further
|
|
||||||
copying of the copies you make or distribute. However, you may accept
|
|
||||||
compensation in exchange for copies. If you distribute a large enough
|
|
||||||
number of copies you must also follow the conditions in section 3.
|
|
||||||
|
|
||||||
You may also lend copies, under the same conditions stated above, and
|
|
||||||
you may publicly display copies.
|
|
||||||
|
|
||||||
@item
|
|
||||||
COPYING IN QUANTITY
|
|
||||||
|
|
||||||
If you publish printed copies (or copies in media that commonly have
|
|
||||||
printed covers) of the Document, numbering more than 100, and the
|
|
||||||
Document's license notice requires Cover Texts, you must enclose the
|
|
||||||
copies in covers that carry, clearly and legibly, all these Cover
|
|
||||||
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
|
||||||
the back cover. Both covers must also clearly and legibly identify
|
|
||||||
you as the publisher of these copies. The front cover must present
|
|
||||||
the full title with all words of the title equally prominent and
|
|
||||||
visible. You may add other material on the covers in addition.
|
|
||||||
Copying with changes limited to the covers, as long as they preserve
|
|
||||||
the title of the Document and satisfy these conditions, can be treated
|
|
||||||
as verbatim copying in other respects.
|
|
||||||
|
|
||||||
If the required texts for either cover are too voluminous to fit
|
|
||||||
legibly, you should put the first ones listed (as many as fit
|
|
||||||
reasonably) on the actual cover, and continue the rest onto adjacent
|
|
||||||
pages.
|
|
||||||
|
|
||||||
If you publish or distribute Opaque copies of the Document numbering
|
|
||||||
more than 100, you must either include a machine-readable Transparent
|
|
||||||
copy along with each Opaque copy, or state in or with each Opaque copy
|
|
||||||
a computer-network location from which the general network-using
|
|
||||||
public has access to download using public-standard network protocols
|
|
||||||
a complete Transparent copy of the Document, free of added material.
|
|
||||||
If you use the latter option, you must take reasonably prudent steps,
|
|
||||||
when you begin distribution of Opaque copies in quantity, to ensure
|
|
||||||
that this Transparent copy will remain thus accessible at the stated
|
|
||||||
location until at least one year after the last time you distribute an
|
|
||||||
Opaque copy (directly or through your agents or retailers) of that
|
|
||||||
edition to the public.
|
|
||||||
|
|
||||||
It is requested, but not required, that you contact the authors of the
|
|
||||||
Document well before redistributing any large number of copies, to give
|
|
||||||
them a chance to provide you with an updated version of the Document.
|
|
||||||
|
|
||||||
@item
|
|
||||||
MODIFICATIONS
|
|
||||||
|
|
||||||
You may copy and distribute a Modified Version of the Document under
|
|
||||||
the conditions of sections 2 and 3 above, provided that you release
|
|
||||||
the Modified Version under precisely this License, with the Modified
|
|
||||||
Version filling the role of the Document, thus licensing distribution
|
|
||||||
and modification of the Modified Version to whoever possesses a copy
|
|
||||||
of it. In addition, you must do these things in the Modified Version:
|
|
||||||
|
|
||||||
@enumerate A
|
|
||||||
@item
|
|
||||||
Use in the Title Page (and on the covers, if any) a title distinct
|
|
||||||
from that of the Document, and from those of previous versions
|
|
||||||
(which should, if there were any, be listed in the History section
|
|
||||||
of the Document). You may use the same title as a previous version
|
|
||||||
if the original publisher of that version gives permission.
|
|
||||||
|
|
||||||
@item
|
|
||||||
List on the Title Page, as authors, one or more persons or entities
|
|
||||||
responsible for authorship of the modifications in the Modified
|
|
||||||
Version, together with at least five of the principal authors of the
|
|
||||||
Document (all of its principal authors, if it has fewer than five),
|
|
||||||
unless they release you from this requirement.
|
|
||||||
|
|
||||||
@item
|
|
||||||
State on the Title page the name of the publisher of the
|
|
||||||
Modified Version, as the publisher.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Preserve all the copyright notices of the Document.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Add an appropriate copyright notice for your modifications
|
|
||||||
adjacent to the other copyright notices.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Include, immediately after the copyright notices, a license notice
|
|
||||||
giving the public permission to use the Modified Version under the
|
|
||||||
terms of this License, in the form shown in the Addendum below.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Preserve in that license notice the full lists of Invariant Sections
|
|
||||||
and required Cover Texts given in the Document's license notice.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Include an unaltered copy of this License.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Preserve the section Entitled ``History'', Preserve its Title, and add
|
|
||||||
to it an item stating at least the title, year, new authors, and
|
|
||||||
publisher of the Modified Version as given on the Title Page. If
|
|
||||||
there is no section Entitled ``History'' in the Document, create one
|
|
||||||
stating the title, year, authors, and publisher of the Document as
|
|
||||||
given on its Title Page, then add an item describing the Modified
|
|
||||||
Version as stated in the previous sentence.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Preserve the network location, if any, given in the Document for
|
|
||||||
public access to a Transparent copy of the Document, and likewise
|
|
||||||
the network locations given in the Document for previous versions
|
|
||||||
it was based on. These may be placed in the ``History'' section.
|
|
||||||
You may omit a network location for a work that was published at
|
|
||||||
least four years before the Document itself, or if the original
|
|
||||||
publisher of the version it refers to gives permission.
|
|
||||||
|
|
||||||
@item
|
|
||||||
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
|
|
||||||
the Title of the section, and preserve in the section all the
|
|
||||||
substance and tone of each of the contributor acknowledgements and/or
|
|
||||||
dedications given therein.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Preserve all the Invariant Sections of the Document,
|
|
||||||
unaltered in their text and in their titles. Section numbers
|
|
||||||
or the equivalent are not considered part of the section titles.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Delete any section Entitled ``Endorsements''. Such a section
|
|
||||||
may not be included in the Modified Version.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Do not retitle any existing section to be Entitled ``Endorsements'' or
|
|
||||||
to conflict in title with any Invariant Section.
|
|
||||||
|
|
||||||
@item
|
|
||||||
Preserve any Warranty Disclaimers.
|
|
||||||
@end enumerate
|
|
||||||
|
|
||||||
If the Modified Version includes new front-matter sections or
|
|
||||||
appendices that qualify as Secondary Sections and contain no material
|
|
||||||
copied from the Document, you may at your option designate some or all
|
|
||||||
of these sections as invariant. To do this, add their titles to the
|
|
||||||
list of Invariant Sections in the Modified Version's license notice.
|
|
||||||
These titles must be distinct from any other section titles.
|
|
||||||
|
|
||||||
You may add a section Entitled ``Endorsements'', provided it contains
|
|
||||||
nothing but endorsements of your Modified Version by various
|
|
||||||
parties---for example, statements of peer review or that the text has
|
|
||||||
been approved by an organization as the authoritative definition of a
|
|
||||||
standard.
|
|
||||||
|
|
||||||
You may add a passage of up to five words as a Front-Cover Text, and a
|
|
||||||
passage of up to 25 words as a Back-Cover Text, to the end of the list
|
|
||||||
of Cover Texts in the Modified Version. Only one passage of
|
|
||||||
Front-Cover Text and one of Back-Cover Text may be added by (or
|
|
||||||
through arrangements made by) any one entity. If the Document already
|
|
||||||
includes a cover text for the same cover, previously added by you or
|
|
||||||
by arrangement made by the same entity you are acting on behalf of,
|
|
||||||
you may not add another; but you may replace the old one, on explicit
|
|
||||||
permission from the previous publisher that added the old one.
|
|
||||||
|
|
||||||
The author(s) and publisher(s) of the Document do not by this License
|
|
||||||
give permission to use their names for publicity for or to assert or
|
|
||||||
imply endorsement of any Modified Version.
|
|
||||||
|
|
||||||
@item
|
|
||||||
COMBINING DOCUMENTS
|
|
||||||
|
|
||||||
You may combine the Document with other documents released under this
|
|
||||||
License, under the terms defined in section 4 above for modified
|
|
||||||
versions, provided that you include in the combination all of the
|
|
||||||
Invariant Sections of all of the original documents, unmodified, and
|
|
||||||
list them all as Invariant Sections of your combined work in its
|
|
||||||
license notice, and that you preserve all their Warranty Disclaimers.
|
|
||||||
|
|
||||||
The combined work need only contain one copy of this License, and
|
|
||||||
multiple identical Invariant Sections may be replaced with a single
|
|
||||||
copy. If there are multiple Invariant Sections with the same name but
|
|
||||||
different contents, make the title of each such section unique by
|
|
||||||
adding at the end of it, in parentheses, the name of the original
|
|
||||||
author or publisher of that section if known, or else a unique number.
|
|
||||||
Make the same adjustment to the section titles in the list of
|
|
||||||
Invariant Sections in the license notice of the combined work.
|
|
||||||
|
|
||||||
In the combination, you must combine any sections Entitled ``History''
|
|
||||||
in the various original documents, forming one section Entitled
|
|
||||||
``History''; likewise combine any sections Entitled ``Acknowledgements'',
|
|
||||||
and any sections Entitled ``Dedications''. You must delete all
|
|
||||||
sections Entitled ``Endorsements.''
|
|
||||||
|
|
||||||
@item
|
|
||||||
COLLECTIONS OF DOCUMENTS
|
|
||||||
|
|
||||||
You may make a collection consisting of the Document and other documents
|
|
||||||
released under this License, and replace the individual copies of this
|
|
||||||
License in the various documents with a single copy that is included in
|
|
||||||
the collection, provided that you follow the rules of this License for
|
|
||||||
verbatim copying of each of the documents in all other respects.
|
|
||||||
|
|
||||||
You may extract a single document from such a collection, and distribute
|
|
||||||
it individually under this License, provided you insert a copy of this
|
|
||||||
License into the extracted document, and follow this License in all
|
|
||||||
other respects regarding verbatim copying of that document.
|
|
||||||
|
|
||||||
@item
|
|
||||||
AGGREGATION WITH INDEPENDENT WORKS
|
|
||||||
|
|
||||||
A compilation of the Document or its derivatives with other separate
|
|
||||||
and independent documents or works, in or on a volume of a storage or
|
|
||||||
distribution medium, is called an ``aggregate'' if the copyright
|
|
||||||
resulting from the compilation is not used to limit the legal rights
|
|
||||||
of the compilation's users beyond what the individual works permit.
|
|
||||||
When the Document is included in an aggregate, this License does not
|
|
||||||
apply to the other works in the aggregate which are not themselves
|
|
||||||
derivative works of the Document.
|
|
||||||
|
|
||||||
If the Cover Text requirement of section 3 is applicable to these
|
|
||||||
copies of the Document, then if the Document is less than one half of
|
|
||||||
the entire aggregate, the Document's Cover Texts may be placed on
|
|
||||||
covers that bracket the Document within the aggregate, or the
|
|
||||||
electronic equivalent of covers if the Document is in electronic form.
|
|
||||||
Otherwise they must appear on printed covers that bracket the whole
|
|
||||||
aggregate.
|
|
||||||
|
|
||||||
@item
|
|
||||||
TRANSLATION
|
|
||||||
|
|
||||||
Translation is considered a kind of modification, so you may
|
|
||||||
distribute translations of the Document under the terms of section 4.
|
|
||||||
Replacing Invariant Sections with translations requires special
|
|
||||||
permission from their copyright holders, but you may include
|
|
||||||
translations of some or all Invariant Sections in addition to the
|
|
||||||
original versions of these Invariant Sections. You may include a
|
|
||||||
translation of this License, and all the license notices in the
|
|
||||||
Document, and any Warranty Disclaimers, provided that you also include
|
|
||||||
the original English version of this License and the original versions
|
|
||||||
of those notices and disclaimers. In case of a disagreement between
|
|
||||||
the translation and the original version of this License or a notice
|
|
||||||
or disclaimer, the original version will prevail.
|
|
||||||
|
|
||||||
If a section in the Document is Entitled ``Acknowledgements'',
|
|
||||||
``Dedications'', or ``History'', the requirement (section 4) to Preserve
|
|
||||||
its Title (section 1) will typically require changing the actual
|
|
||||||
title.
|
|
||||||
|
|
||||||
@item
|
|
||||||
TERMINATION
|
|
||||||
|
|
||||||
You may not copy, modify, sublicense, or distribute the Document except
|
|
||||||
as expressly provided for under this License. Any other attempt to
|
|
||||||
copy, modify, sublicense or distribute the Document is void, and will
|
|
||||||
automatically terminate your rights under this License. However,
|
|
||||||
parties who have received copies, or rights, from you under this
|
|
||||||
License will not have their licenses terminated so long as such
|
|
||||||
parties remain in full compliance.
|
|
||||||
|
|
||||||
@item
|
|
||||||
FUTURE REVISIONS OF THIS LICENSE
|
|
||||||
|
|
||||||
The Free Software Foundation may publish new, revised versions
|
|
||||||
of the GNU Free Documentation License from time to time. Such new
|
|
||||||
versions will be similar in spirit to the present version, but may
|
|
||||||
differ in detail to address new problems or concerns. See
|
|
||||||
@uref{http://www.gnu.org/copyleft/}.
|
|
||||||
|
|
||||||
Each version of the License is given a distinguishing version number.
|
|
||||||
If the Document specifies that a particular numbered version of this
|
|
||||||
License ``or any later version'' applies to it, you have the option of
|
|
||||||
following the terms and conditions either of that specified version or
|
|
||||||
of any later version that has been published (not as a draft) by the
|
|
||||||
Free Software Foundation. If the Document does not specify a version
|
|
||||||
number of this License, you may choose any version ever published (not
|
|
||||||
as a draft) by the Free Software Foundation.
|
|
||||||
@end enumerate
|
|
||||||
|
|
||||||
@page
|
|
||||||
@appendixsubsec ADDENDUM: How to use this License for your documents
|
|
||||||
|
|
||||||
To use this License in a document you have written, include a copy of
|
|
||||||
the License in the document and put the following copyright and
|
|
||||||
license notices just after the title page:
|
|
||||||
|
|
||||||
@smallexample
|
|
||||||
@group
|
|
||||||
Copyright (C) @var{year} @var{your name}.
|
|
||||||
Permission is granted to copy, distribute and/or modify this document
|
|
||||||
under the terms of the GNU Free Documentation License, Version 1.2
|
|
||||||
or any later version published by the Free Software Foundation;
|
|
||||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
|
||||||
Texts. A copy of the license is included in the section entitled ``GNU
|
|
||||||
Free Documentation License''.
|
|
||||||
@end group
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
|
||||||
replace the ``with...Texts.'' line with this:
|
|
||||||
|
|
||||||
@smallexample
|
|
||||||
@group
|
|
||||||
with the Invariant Sections being @var{list their titles}, with
|
|
||||||
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
|
|
||||||
being @var{list}.
|
|
||||||
@end group
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
If you have Invariant Sections without Cover Texts, or some other
|
|
||||||
combination of the three, merge those two alternatives to suit the
|
|
||||||
situation.
|
|
||||||
|
|
||||||
If your document contains nontrivial examples of program code, we
|
|
||||||
recommend releasing these examples in parallel under your choice of
|
|
||||||
free software license, such as the GNU General Public License,
|
|
||||||
to permit their use in free software.
|
|
||||||
|
|
||||||
@c Local Variables:
|
|
||||||
@c ispell-local-pdict: "ispell-dict"
|
|
||||||
@c End:
|
|
||||||
|
|
||||||
-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}
|
\def\finalout{\overfullrule=0pt}
|
||||||
%\finalout
|
%\finalout
|
||||||
|
|
||||||
% Copyright (c) 1998, 2001 Free Software Foundation, Inc.
|
% Copyright (c) 1998, 2001, 2009-2012 Free Software Foundation, Inc.
|
||||||
%
|
%
|
||||||
% This file is part of Bison.
|
% This file is part of Bison.
|
||||||
%
|
%
|
||||||
% Bison is free software; you can redistribute them and/or modify them
|
% This program is free software: you can redistribute it and/or modify
|
||||||
% under the terms of the GNU General Public License as published by the
|
% it under the terms of the GNU General Public License as published by
|
||||||
% Free Software Foundation; either version 2, or (at your option) any
|
% the Free Software Foundation, either version 3 of the License, or
|
||||||
% later version.
|
% (at your option) any later version.
|
||||||
%
|
%
|
||||||
% Bison is distributed in the hope that it will be useful, but WITHOUT
|
% This program is distributed in the hope that it will be useful,
|
||||||
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
% for more details.
|
% GNU General Public License for more details.
|
||||||
%
|
%
|
||||||
% You should have received a copy of the GNU General Public License
|
% You should have received a copy of the GNU General Public License
|
||||||
% along with either Flex or Bison; see the file COPYING. If not, write
|
% along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
% Boston, MA 02110-1301, USA.
|
|
||||||
%
|
%
|
||||||
% This file is intended to be processed by plain TeX (TeX82).
|
% This file is intended to be processed by plain TeX (TeX82).
|
||||||
%
|
%
|
||||||
|
|||||||
@@ -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-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
nodist_noinst_SCRIPTS = bench.pl
|
||||||
+6
-11
@@ -1,6 +1,3 @@
|
|||||||
A directory of tools provided to people using CVS Bison. None of
|
|
||||||
these is distributed.
|
|
||||||
|
|
||||||
* bench.pl
|
* bench.pl
|
||||||
A primitive Perl script to run benches. Currently its only bench is
|
A primitive Perl script to run benches. Currently its only bench is
|
||||||
the usual calculator: it has a lightweight processing part (but not
|
the usual calculator: it has a lightweight processing part (but not
|
||||||
@@ -19,24 +16,22 @@ straightforward use of _build/src/bison would.)
|
|||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
Bison is free software; you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
Bison is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with autoconf; see the file COPYING. If not, write to
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
Local Variables:
|
Local Variables:
|
||||||
mode: outline
|
mode: outline
|
||||||
|
|||||||
@@ -1,28 +1,26 @@
|
|||||||
#! /usr/bin/perl -w
|
#! /usr/bin/perl -w
|
||||||
|
|
||||||
# Copyright (C) 2006 Free Software Foundation, Inc.
|
# Copyright (C) 2006, 2008-2012 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is part of Bison, the GNU Compiler Compiler.
|
# This file is part of Bison, the GNU Compiler Compiler.
|
||||||
#
|
#
|
||||||
# Bison is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# Bison is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with autoconf; see the file COPYING. If not, write to
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
# Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
use IO::File;
|
use IO::File;
|
||||||
use Benchmark qw (:all);
|
use Benchmark qw (:all);
|
||||||
|
|
||||||
my $bison = $ENV{'BISON'} || 'bison';
|
my $bison = $ENV{'BISON'} || '@abs_top_builddir@/tests/bison';
|
||||||
my $cc = $ENV{'CC'} || 'gcc';
|
my $cc = $ENV{'CC'} || 'gcc';
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
@@ -136,8 +134,8 @@ sub calc_grammar ($$$)
|
|||||||
or die;
|
or die;
|
||||||
print $out <<EOF;
|
print $out <<EOF;
|
||||||
%{
|
%{
|
||||||
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -260,12 +258,6 @@ read_signed_integer (void)
|
|||||||
return sign * n;
|
return sign * n;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if YYPUSH
|
|
||||||
#ifndef HAVE_YYSTYPE
|
|
||||||
static YYSTYPE yylval;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
#if YYPURE
|
#if YYPURE
|
||||||
# define yylval (*yylvalp)
|
# define yylval (*yylvalp)
|
||||||
@@ -278,9 +270,7 @@ yylex (void)
|
|||||||
|
|
||||||
/* Skip white space. */
|
/* Skip white space. */
|
||||||
while ((c = get_char ()) == ' ' || c == '\t')
|
while ((c = get_char ()) == ' ' || c == '\t')
|
||||||
{
|
continue;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* process numbers */
|
/* process numbers */
|
||||||
if (c == '.' || isdigit (c))
|
if (c == '.' || isdigit (c))
|
||||||
@@ -301,30 +291,14 @@ yylex (void)
|
|||||||
static int
|
static int
|
||||||
power (int base, int exponent)
|
power (int base, int exponent)
|
||||||
{
|
{
|
||||||
|
assert (0 <= exponent);
|
||||||
int res = 1;
|
int res = 1;
|
||||||
if (exponent < 0)
|
|
||||||
exit (3);
|
|
||||||
for (/* Niente */; exponent; --exponent)
|
for (/* Niente */; exponent; --exponent)
|
||||||
res *= base;
|
res *= base;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#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
|
int
|
||||||
main (int argc, const char **argv)
|
main (int argc, const char **argv)
|
||||||
{
|
{
|
||||||
@@ -366,16 +340,12 @@ sub bench_grammar ($)
|
|||||||
my ($gram) = @_;
|
my ($gram) = @_;
|
||||||
my %test =
|
my %test =
|
||||||
(
|
(
|
||||||
"yacc-yacc" => '',
|
"pull-impure" => '',
|
||||||
"yacc-pure" => '%pure-parser',
|
"pull-pure" => '%define api.pure',
|
||||||
"push-yacc" => '%skeleton "push.c"',
|
"push-impure" => '%define api.push-pull "both"',
|
||||||
"push-pure" => '%skeleton "push.c" %pure-parser',
|
"push-pure" => '%define api.push-pull "both" %define api.pure',
|
||||||
"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',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
my %bench;
|
my %bench;
|
||||||
while (my ($name, $directives) = each %test)
|
while (my ($name, $directives) = each %test)
|
||||||
{
|
{
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
for dir in . po src doc; do
|
|
||||||
(
|
|
||||||
cd $dir && rcs2log -r -l \
|
|
||||||
-u 'akim Akim Demaille [email protected]' \
|
|
||||||
-u 'djm David J. MacKenzie [email protected]' \
|
|
||||||
-u 'eggert Paul Eggert [email protected]' \
|
|
||||||
-u 'friedman Noah Friedman [email protected]' \
|
|
||||||
-u 'hag Daniel Hagerty [email protected]' \
|
|
||||||
-u 'jthilo Jesse Thilo [email protected]' \
|
|
||||||
-u 'meyering Jim Meyering [email protected]' \
|
|
||||||
-u 'rms Richard Stallman [email protected]' \
|
|
||||||
| sed -e 's,/opt/cvs/bison/bison/,,g' > ChangeLog
|
|
||||||
)
|
|
||||||
done
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
+13
-15
@@ -1,20 +1,18 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2005 Free Software Foundation, Inc.
|
## Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
## This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
## You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
## along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
if BISON_CXX_WORKS
|
if BISON_CXX_WORKS
|
||||||
SUBDIRS = calc++
|
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
|
||||||
+36
-30
@@ -1,20 +1,18 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
## Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
## (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
## This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
## You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
## along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
## 02110-1301 USA
|
|
||||||
|
|
||||||
## ------------------------------------- ##
|
## ------------------------------------- ##
|
||||||
## Running the bison from this tarball. ##
|
## Running the bison from this tarball. ##
|
||||||
@@ -24,26 +22,31 @@ BISON = $(top_builddir)/tests/bison
|
|||||||
BISON_IN = $(top_srcdir)/tests/bison.in
|
BISON_IN = $(top_srcdir)/tests/bison.in
|
||||||
|
|
||||||
$(BISON): $(BISON_IN)
|
$(BISON): $(BISON_IN)
|
||||||
cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) bison
|
$(AM_V_GEN)cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||||
|
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
## Extracting. ##
|
## Extracting. ##
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
|
|
||||||
doc = $(top_srcdir)/doc/bison.texinfo
|
doc = $(top_srcdir)/doc/bison.texi
|
||||||
extexi = $(top_srcdir)/examples/extexi
|
extexi = $(top_srcdir)/examples/extexi
|
||||||
# Extract in src.
|
# Extract in src.
|
||||||
$(calc_extracted): $(doc) $(extexi)
|
$(srcdir)/calc.stamp: $(doc) $(extexi)
|
||||||
cd $(srcdir) && \
|
$(AM_V_GEN)rm -f $@ $@.tmp
|
||||||
$(AWK) -f ../extexi ../../doc/bison.texinfo -- \
|
$(AM_V_at)touch $@.tmp
|
||||||
calc++-parser.yy \
|
$(AM_V_at)cd $(srcdir) && \
|
||||||
|
$(AWK) -f ../extexi -v VERSION="$(VERSION)" \
|
||||||
|
../../doc/bison.texi -- calc++-parser.yy \
|
||||||
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
||||||
|
$(AM_V_at)mv $@.tmp $@
|
||||||
|
|
||||||
|
$(calc_extracted): $(srcdir)/calc.stamp
|
||||||
|
|
||||||
## ------------------- ##
|
## ------------------- ##
|
||||||
## Parser generation. ##
|
## Parser generation. ##
|
||||||
## ------------------- ##
|
## ------------------- ##
|
||||||
|
|
||||||
|
DEFAULT_INCLUDES = -I. -I$(srcdir)
|
||||||
BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
|
BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
|
||||||
CLEANFILES = $(srcdir)/*.output *.tmp
|
CLEANFILES = $(srcdir)/*.output *.tmp
|
||||||
MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
||||||
@@ -51,18 +54,21 @@ MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
|||||||
# Compile the parser and save cycles.
|
# Compile the parser and save cycles.
|
||||||
# This code comes from "Handling Tools that Produce Many Outputs",
|
# This code comes from "Handling Tools that Produce Many Outputs",
|
||||||
# from the Automake documentation.
|
# from the Automake documentation.
|
||||||
EXTRA_DIST = $(srcdir)/calc++-parser.stamp $(srcdir)/calc++-parser.yy
|
EXTRA_DIST = \
|
||||||
|
$(srcdir)/calc++-parser.stamp \
|
||||||
|
$(srcdir)/calc++-parser.yy \
|
||||||
|
$(srcdir)/calc.stamp
|
||||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||||
# in srcdir, including during distcheck, which is forbidden.
|
# in srcdir, including during distcheck, which is forbidden.
|
||||||
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
||||||
@rm -f calc++-parser.tmp
|
$(AM_V_GEN)rm -f calc++-parser.tmp
|
||||||
@touch calc++-parser.tmp
|
$(AM_V_at)touch calc++-parser.tmp
|
||||||
$(BISON) -d -ra -S lalr1.cc -o $(srcdir)/calc++-parser.cc \
|
$(AM_V_at)$(BISON) -d -ra -S lalr1.cc -o $(srcdir)/calc++-parser.cc \
|
||||||
$(srcdir)/calc++-parser.yy
|
$(srcdir)/calc++-parser.yy
|
||||||
@mv -f calc++-parser.tmp $@
|
$(AM_V_at)mv -f calc++-parser.tmp $@
|
||||||
|
|
||||||
$(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
$(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
||||||
@if test -f $@; then :; else \
|
$(AM_V_GEN)if test -f $@; then :; else \
|
||||||
rm -f $(srcdir)/calc++-parser.stamp && \
|
rm -f $(srcdir)/calc++-parser.stamp && \
|
||||||
$(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
|
$(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
|
||||||
fi
|
fi
|
||||||
@@ -75,11 +81,11 @@ $(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
|||||||
check_PROGRAMS = calc++
|
check_PROGRAMS = calc++
|
||||||
|
|
||||||
calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
|
calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
|
||||||
$(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
|
$(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
|
||||||
calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
|
calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
|
||||||
calc_sources_generated = \
|
calc_sources_generated = \
|
||||||
$(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
|
$(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
|
||||||
$(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
|
$(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
|
||||||
|
|
||||||
calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
|
calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,20 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
|
# Copyright (C) 2005-2012 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
test -z "$VERBOSE" && {
|
test -z "$VERBOSE" && {
|
||||||
exec > /dev/null 2>&1
|
exec > /dev/null 2>&1
|
||||||
set -x
|
set -x
|
||||||
|
|||||||
+7
-6
@@ -1,11 +1,13 @@
|
|||||||
# Extract all examples from the manual source. -*- AWK -*-
|
# Extract all examples from the manual source. -*- AWK -*-
|
||||||
|
|
||||||
# This file is part of GNU Bison
|
# This file is part of GNU Bison
|
||||||
# Copyright 1992, 2000, 2001, 2005, 2006 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2012 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -14,9 +16,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
||||||
# 02111-1307 USA
|
|
||||||
|
|
||||||
# This script is for use with any Awk that conforms to POSIX.
|
# This script is for use with any Awk that conforms to POSIX.
|
||||||
# It was derived from a similar script tests/generate.awk in GNU m4.
|
# It was derived from a similar script tests/generate.awk in GNU m4.
|
||||||
@@ -111,6 +111,7 @@ function normalize(contents, i, lines, n, line, res) {
|
|||||||
else
|
else
|
||||||
line = "";
|
line = "";
|
||||||
|
|
||||||
|
gsub (/"@value\{VERSION\}"/, "\"" VERSION "\"", line)
|
||||||
gsub (/^@result\{\}/, "", line);
|
gsub (/^@result\{\}/, "", line);
|
||||||
gsub (/^@error\{\}/, "", line);
|
gsub (/^@error\{\}/, "", line);
|
||||||
gsub ("@[{]", "{", line);
|
gsub ("@[{]", "{", line);
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
external: gnulib
|
||||||
Submodule
+1
Submodule gnulib added at bd54a45e6e
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user