mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-12 12:15:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21fe08cadc | ||
|
|
e8ec4d9b33 | ||
|
|
1ef30650b8 | ||
|
|
a36b333cc2 | ||
|
|
fa7b79c063 | ||
|
|
4ec13d6058 | ||
|
|
8e1687aef6 | ||
|
|
aef3da8689 | ||
|
|
84567a1b1c | ||
|
|
afac5ba023 | ||
|
|
3dc5e96b85 | ||
|
|
b2a0b7ca70 | ||
|
|
3be03b13e5 | ||
|
|
3508ce361b | ||
|
|
9350499cfc | ||
|
|
4d7370cb4f | ||
|
|
6d0ef4ec20 | ||
|
|
965537bc54 | ||
|
|
5362ed19b6 | ||
|
|
2d2c1a2dec | ||
|
|
47aee066cc | ||
|
|
1f6b3679b2 | ||
|
|
219741d873 | ||
|
|
11daa4e73b | ||
|
|
b4c2a79743 | ||
|
|
34ec357927 | ||
|
|
f9bfc42aa7 | ||
|
|
06e8700a00 | ||
|
|
9c4371263f | ||
|
|
284d8a13e8 | ||
|
|
ec5479ce35 | ||
|
|
868d2d9638 | ||
|
|
62a9592d3d | ||
|
|
10d6970fb1 | ||
|
|
50a339934c | ||
|
|
2ce4ed68c9 | ||
|
|
db7e5eb5ef | ||
|
|
a5d80ba505 | ||
|
|
23eb2a692f | ||
|
|
b321737f20 | ||
|
|
1f4cc0f4ae | ||
|
|
ddc8ede1ab | ||
|
|
b37acfe18c | ||
|
|
08bc001306 | ||
|
|
80ac75bcb6 | ||
|
|
f2e690d8c3 | ||
|
|
7b42569e12 | ||
|
|
3b452f4ea6 | ||
|
|
b8a4155924 | ||
|
|
cd9e1ba28d | ||
|
|
b8445a158c | ||
|
|
b3d9b5ba18 | ||
|
|
cb48f1919c | ||
|
|
cd48d21d94 | ||
|
|
8ec0a172bc | ||
|
|
4a678af8c6 | ||
|
|
dd60572a8b | ||
|
|
fab044e6da | ||
|
|
2073e1b602 | ||
|
|
8ee5b53874 | ||
|
|
ad6b1efa2f | ||
|
|
ffa4ba3aef | ||
|
|
300a193064 | ||
|
|
e256e17f57 | ||
|
|
381ecb0687 | ||
|
|
4210cd0bfc | ||
|
|
34f98f46ee | ||
|
|
31b2b07ef7 | ||
|
|
9bc0dd679f | ||
|
|
203b927414 | ||
|
|
1b818f33ad | ||
|
|
a7ee59cfb4 | ||
|
|
d2a1a60ab6 | ||
|
|
33ad1a9c2d | ||
|
|
5a2baae7b3 | ||
|
|
58d7a1a1c7 | ||
|
|
40637e8169 | ||
|
|
b931235eb9 | ||
|
|
9e6e7ed2b2 | ||
|
|
742e4900c8 | ||
|
|
3c40d0b52d | ||
|
|
5d27808262 | ||
|
|
9e6688995e | ||
|
|
a898d2780f | ||
|
|
0c8e079fa6 | ||
|
|
9f936c5e9c | ||
|
|
2346344a08 | ||
|
|
4862bdfd61 | ||
|
|
e9071366c3 | ||
|
|
184e42f065 | ||
|
|
7891a7c449 | ||
|
|
4ad3ed84f6 | ||
|
|
0210398466 | ||
|
|
2c08afa5dd | ||
|
|
6077da5824 | ||
|
|
c211f84be6 | ||
|
|
2a26b6c28b | ||
|
|
e4f0316ae0 | ||
|
|
aefef0d6cf | ||
|
|
fcd8e2011d | ||
|
|
7b5cdcbd17 | ||
|
|
566ac1b4a7 | ||
|
|
5ad0a449d6 | ||
|
|
50cce58e9a | ||
|
|
95c0638353 | ||
|
|
aca1717341 | ||
|
|
0d2c8934a5 | ||
|
|
ab8d9dc52f | ||
|
|
9138c575d8 | ||
|
|
d664514801 | ||
|
|
276f48df88 | ||
|
|
cd8b579166 | ||
|
|
34376418e2 | ||
|
|
327afc7c84 | ||
|
|
ba9ecd1910 | ||
|
|
4e83ea15f7 | ||
|
|
0a9f1c7d45 | ||
|
|
b15296ff31 | ||
|
|
04c12cb83d | ||
|
|
6e93d810ca | ||
|
|
eaea13f59f | ||
|
|
3cf084ecae | ||
|
|
f94705b204 | ||
|
|
32c96bd755 | ||
|
|
193d7c7054 | ||
|
|
f5d5ecdfaf | ||
|
|
7c7993487d | ||
|
|
f21ce5a3f7 | ||
|
|
ebe8ee4235 | ||
|
|
6e2d1146f2 | ||
|
|
4767105543 | ||
|
|
ed2e6384ed | ||
|
|
3cedc2dc0d | ||
|
|
b2ddc3f337 | ||
|
|
91e3ac9ab0 | ||
|
|
1bddda4d85 | ||
|
|
8c5b881de5 | ||
|
|
5cf61e933d | ||
|
|
aa08666d72 | ||
|
|
455671735e | ||
|
|
e9d8f881ce | ||
|
|
55ba27be34 | ||
|
|
c095d689c3 | ||
|
|
6e0f828781 | ||
|
|
d6b771c345 | ||
|
|
1e137b710b | ||
|
|
6d05403db4 | ||
|
|
73f2e47e51 | ||
|
|
8710fc41aa | ||
|
|
ae952af227 | ||
|
|
35ee866a32 | ||
|
|
520181ab91 | ||
|
|
18d9185cae | ||
|
|
841a773708 | ||
|
|
5f4236a0c2 | ||
|
|
765f22f0f4 | ||
|
|
fc3f467ff1 | ||
|
|
4d7bc38cdc | ||
|
|
a3af26dd7e | ||
|
|
4e26c69eb6 | ||
|
|
498e897c67 | ||
|
|
57bb17ca85 | ||
|
|
0be105dc42 | ||
|
|
c28adce59b | ||
|
|
7870f699e4 | ||
|
|
6fc0c02473 | ||
|
|
1a1a58269d | ||
|
|
fe6c2fdef2 | ||
|
|
927b425baa | ||
|
|
f6a6af9575 | ||
|
|
127bcae693 | ||
|
|
b947188419 | ||
|
|
b01df0368a | ||
|
|
d9735e9e3e | ||
|
|
8c86f0ef98 | ||
|
|
de35dd590c | ||
|
|
67a0dc4fa9 | ||
|
|
5a6755afcb | ||
|
|
3f0014152b | ||
|
|
e2a8c0f591 | ||
|
|
a7086c4f27 | ||
|
|
27622431dc | ||
|
|
6b7022680e | ||
|
|
d40ba6c272 | ||
|
|
bf8b3d9821 | ||
|
|
401aace63c | ||
|
|
d42cf84421 | ||
|
|
02d12d0de2 | ||
|
|
06f01bc496 | ||
|
|
f0064700f8 | ||
|
|
b66dfcd26f | ||
|
|
02650b7f0e | ||
|
|
68cae94e0b | ||
|
|
287c78f6ab | ||
|
|
c21493b89f | ||
|
|
b6e3facf99 | ||
|
|
b4068c7cf3 | ||
|
|
c66dfaddf4 | ||
|
|
ed94ef2ae4 | ||
|
|
51cbef6f63 | ||
|
|
d6ca7905ab | ||
|
|
2073ce56f5 | ||
|
|
ef1b70e009 | ||
|
|
cc14efa5bc | ||
|
|
db0dcbf315 | ||
|
|
e9ad4aeca5 | ||
|
|
02d7cce6e2 | ||
|
|
b7691f15bd | ||
|
|
ddee1b0666 | ||
|
|
12f4614d07 | ||
|
|
32c292920e | ||
|
|
de366a2f6b | ||
|
|
2781dbd121 | ||
|
|
bf70fa8729 | ||
|
|
05449a2c1b | ||
|
|
fd2493f7c4 | ||
|
|
4158e0a143 | ||
|
|
d659304d0a | ||
|
|
6ec2c0f295 | ||
|
|
7a0db73e6f | ||
|
|
2e4c30fa07 | ||
|
|
dd9010375b | ||
|
|
a2a3e98977 | ||
|
|
1b9c21fb18 | ||
|
|
8486615972 | ||
|
|
378f4bd846 | ||
|
|
f52b276c55 | ||
|
|
5466269793 | ||
|
|
9ae1f0c6a9 | ||
|
|
4d56beff96 | ||
|
|
073f92889f | ||
|
|
1221b78adb | ||
|
|
ff5150d9a4 | ||
|
|
e2a21b6f0c | ||
|
|
8f7e3cf9d0 | ||
|
|
0a96ba819f | ||
|
|
3953ed882a | ||
|
|
9ecafbbfe7 | ||
|
|
c4d497a010 | ||
|
|
a51d426a63 | ||
|
|
4517da3757 | ||
|
|
668c5d1927 | ||
|
|
e3233bf6b6 | ||
|
|
8f3596a633 | ||
|
|
f8e1c9e55b | ||
|
|
3b0ffc7ec1 | ||
|
|
721be13c5b | ||
|
|
a0af42fce6 | ||
|
|
affac6132a | ||
|
|
8bb4c753e2 | ||
|
|
9d9b8b7006 | ||
|
|
2c3b392a9a | ||
|
|
d6cff4dc6f | ||
|
|
a85284cfbd | ||
|
|
e14d0ab687 | ||
|
|
d508c2816f | ||
|
|
375234d9ff | ||
|
|
bf60087f69 | ||
|
|
90ddbd5eed | ||
|
|
69474954ac | ||
|
|
b09a18c50d | ||
|
|
3e7a2cd95f | ||
|
|
26546b4258 | ||
|
|
0eca5a39a7 | ||
|
|
72c4d3365a | ||
|
|
6c65b1525f | ||
|
|
2cec9080f6 | ||
|
|
7029f8927f | ||
|
|
877519f839 | ||
|
|
12ce2df60d | ||
|
|
f5228370c5 | ||
|
|
6ff9971122 | ||
|
|
69ce078b8c | ||
|
|
32b5b719e4 | ||
|
|
66809587a7 | ||
|
|
af3412cdea | ||
|
|
d9963c8597 | ||
|
|
035aa4a0bb | ||
|
|
d1ff7a7cc6 | ||
|
|
6de5398de3 | ||
|
|
a1373f559a | ||
|
|
3dc4aa8c36 | ||
|
|
613d8952e3 | ||
|
|
b2741627b1 | ||
|
|
422494834c | ||
|
|
5059b5c887 | ||
|
|
4626a15dd1 | ||
|
|
98ae96438e | ||
|
|
1989d9476c | ||
|
|
62b08cfcd7 | ||
|
|
0299809431 | ||
|
|
5210672f6b | ||
|
|
a8991a1da4 | ||
|
|
36b5e963e6 | ||
|
|
317fce927c | ||
|
|
44e7ead165 | ||
|
|
e10a80eeac | ||
|
|
067b32eef4 | ||
|
|
4b3673159e | ||
|
|
24cc23d96d | ||
|
|
d4476375cf | ||
|
|
302c0aeeba | ||
|
|
7625ec2c83 | ||
|
|
2ed284440f | ||
|
|
ba0fe3c710 | ||
|
|
9b8a5ce03b | ||
|
|
52d9d4112f | ||
|
|
4d7aa45e75 | ||
|
|
4f6e011e2e | ||
|
|
a1b3bf8c21 | ||
|
|
e764d4df76 | ||
|
|
2a4647a32f | ||
|
|
74e543d21f | ||
|
|
412e44aa0e | ||
|
|
2888e8b946 | ||
|
|
2f4f028d8b | ||
|
|
88c6637fa9 | ||
|
|
f8333ce5fd | ||
|
|
c59929c351 | ||
|
|
fb32e3730e | ||
|
|
2aee5b7e1e | ||
|
|
fb9c0b3360 | ||
|
|
edb8f44f06 | ||
|
|
b50d2359d7 | ||
|
|
21667f64cd | ||
|
|
2b81e969ea | ||
|
|
ad6a9b97e2 | ||
|
|
ec4d88f496 | ||
|
|
3d86656c1d | ||
|
|
3768a1ae18 | ||
|
|
fc695704a1 | ||
|
|
24dfa6ec84 | ||
|
|
6bebb37320 | ||
|
|
cd72b08b23 | ||
|
|
5215c87f14 | ||
|
|
fb9712a962 | ||
|
|
55f0c7b1f2 | ||
|
|
d4fb5e3cb9 | ||
|
|
8a6f72f3d7 | ||
|
|
ebc3737ebf | ||
|
|
58b90cc2d8 | ||
|
|
62c4328e00 | ||
|
|
2fc90989b7 | ||
|
|
0d50976f3c | ||
|
|
ac2434287d | ||
|
|
9069e5de23 | ||
|
|
552893661b | ||
|
|
a05b79dff9 | ||
|
|
ddc65ffdd1 | ||
|
|
3ab2ca2206 | ||
|
|
2abdfeefce | ||
|
|
a702593e05 | ||
|
|
b4c1f9d2b6 | ||
|
|
8a2800e787 | ||
|
|
a9739e7c4c | ||
|
|
c7e8607f6b | ||
|
|
f479c6c61e | ||
|
|
e2586f82b0 | ||
|
|
2e8cf949a5 | ||
|
|
c7fb0b9079 | ||
|
|
f5109f5af0 | ||
|
|
1bd0dedaaa | ||
|
|
c1432f6538 | ||
|
|
cf147260d2 | ||
|
|
3a73c9ae44 | ||
|
|
dbcdae2d04 | ||
|
|
70d8f2910e | ||
|
|
d110145422 | ||
|
|
ae199bf10f | ||
|
|
b47dbebee5 | ||
|
|
94306d5282 | ||
|
|
00292f6611 | ||
|
|
c89b4c032c | ||
|
|
d83a9c402c | ||
|
|
55f64b82cd | ||
|
|
127287e9c4 | ||
|
|
48b16bbc04 | ||
|
|
a420f9620e | ||
|
|
fa4d969f11 | ||
|
|
326eb46f40 | ||
|
|
7812f29985 | ||
|
|
7e7b77c138 | ||
|
|
9d5b26c682 | ||
|
|
42a6501d1a | ||
|
|
5b4aaf787b | ||
|
|
b5240ba555 | ||
|
|
ef9a1fafaf | ||
|
|
a4cf101a98 | ||
|
|
e6efa9dacc | ||
|
|
adc90f13ab | ||
|
|
15d29c1ffe | ||
|
|
6250acbdb1 | ||
|
|
ec5d1a8a24 | ||
|
|
dd5f2af2bd | ||
|
|
eab522e49a | ||
|
|
fe3816515c | ||
|
|
19e251af0f | ||
|
|
f9315de5a4 | ||
|
|
1fb38e78c2 | ||
|
|
ca5d201376 | ||
|
|
3d54b57635 | ||
|
|
d53ae497dc | ||
|
|
3bc00d6c4b | ||
|
|
e0045d49b6 | ||
|
|
fc01665ea5 | ||
|
|
57beea5776 | ||
|
|
5f3df3960e | ||
|
|
040984073a | ||
|
|
135bc829bd | ||
|
|
f938a7e7b8 | ||
|
|
f38b17c9bf | ||
|
|
aacbb77a75 | ||
|
|
89519adfbe | ||
|
|
26a69b31fa | ||
|
|
a9401edbf5 | ||
|
|
b3d0c7a208 | ||
|
|
1d0737fa58 | ||
|
|
1eeda0abd5 | ||
|
|
4ff8b7f7c9 | ||
|
|
6d07bacfc0 | ||
|
|
141f57937b | ||
|
|
0ffda36340 | ||
|
|
3922956abd | ||
|
|
9cbfdc9e01 | ||
|
|
9e0876fb0c | ||
|
|
49b1cf794d | ||
|
|
6fdb09caac | ||
|
|
dc9701e848 | ||
|
|
802b9687d0 | ||
|
|
ab703f2c9b | ||
|
|
0fab8d7b36 | ||
|
|
df9a1ba4de | ||
|
|
d11e0cfa89 | ||
|
|
258b75caaa | ||
|
|
6088a2a04d | ||
|
|
4cf31ef8e7 | ||
|
|
1a05945136 | ||
|
|
a778f668a1 | ||
|
|
8c27717915 | ||
|
|
97460c7864 | ||
|
|
9662b51284 | ||
|
|
30757c8c93 | ||
|
|
ac8c5689f8 | ||
|
|
6100a9aa2e | ||
|
|
67fd79c427 | ||
|
|
15f40952f7 | ||
|
|
c70fdfcd20 | ||
|
|
e2688cd96e | ||
|
|
1beb0b24f3 | ||
|
|
a22ff96f32 | ||
|
|
31d7addbf5 | ||
|
|
f32c66b5f4 | ||
|
|
71206cce8e | ||
|
|
d741bd1bfd | ||
|
|
0410a6e0cc | ||
|
|
a7db4add01 | ||
|
|
d2aaf69e73 | ||
|
|
eb520e4cc0 | ||
|
|
baf785db2e | ||
|
|
f7ab6a5010 | ||
|
|
22dda0f004 | ||
|
|
82b248ada6 | ||
|
|
2cbd078f51 | ||
|
|
1c02d4bfbf | ||
|
|
716f248dcd | ||
|
|
867a3e0085 | ||
|
|
fa0e93148c | ||
|
|
e054b19038 | ||
|
|
5f6da1c0f8 | ||
|
|
407d4a75bb | ||
|
|
34160ec4ec | ||
|
|
6770ae09d3 | ||
|
|
b34d96c1c3 | ||
|
|
c3d5a4a783 | ||
|
|
828c373b6d | ||
|
|
fd2df2ede4 | ||
|
|
63cb01d656 | ||
|
|
1c59e0a121 | ||
|
|
8a0adb0183 | ||
|
|
12545799f9 | ||
|
|
99be023555 | ||
|
|
0ffd4fd1a2 | ||
|
|
0925ebb4fa | ||
|
|
43d3b66471 | ||
|
|
73e561d51a | ||
|
|
3062864d2c | ||
|
|
681c331d2c | ||
|
|
989b5b8e3d | ||
|
|
4b43d40257 | ||
|
|
bedf57f515 | ||
|
|
4d1801f1a8 | ||
|
|
85ac3861e7 | ||
|
|
b94a9e1ed1 | ||
|
|
009ce67dbe | ||
|
|
f2a97c6294 | ||
|
|
c8775f9398 | ||
|
|
3ea5f0ec81 | ||
|
|
51c30d2144 | ||
|
|
ad7458633d | ||
|
|
010f91c341 | ||
|
|
bd134904da | ||
|
|
cea1469d47 | ||
|
|
5e6f62f2f1 | ||
|
|
0fb669f9d6 | ||
|
|
51f4735e22 | ||
|
|
7768896a25 | ||
|
|
80ce3401e9 | ||
|
|
b9c9f76197 | ||
|
|
9f666b5106 | ||
|
|
c19683bb19 | ||
|
|
ba20a26459 | ||
|
|
72f000b088 | ||
|
|
1094323fe4 | ||
|
|
f79b4f5ce1 | ||
|
|
2ce37586de | ||
|
|
ca407bdf9d | ||
|
|
506ffb1f74 | ||
|
|
ffc9da3a52 | ||
|
|
1ce590705a | ||
|
|
a749a69501 | ||
|
|
e8fd72d5bb | ||
|
|
e59adf8f04 | ||
|
|
8fb1053bfe | ||
|
|
4f136612d9 | ||
|
|
ff498c4aed | ||
|
|
65211d70bc | ||
|
|
72d848c21d | ||
|
|
9577fb1f47 | ||
|
|
f508a6a0d6 | ||
|
|
a2599d0fc2 | ||
|
|
727e8b0bde | ||
|
|
4b3017faf2 | ||
|
|
78b178f716 | ||
|
|
baf073c6c5 | ||
|
|
7296e729ce | ||
|
|
7cf96b1a9e | ||
|
|
05ac60f348 | ||
|
|
080e734812 | ||
|
|
7eb453acd5 | ||
|
|
3a4f411faa | ||
|
|
4c04c52a9d | ||
|
|
a730d142be | ||
|
|
a61e1620e7 | ||
|
|
e4f85c39b2 | ||
|
|
9ec93868c1 | ||
|
|
d46c3fc694 | ||
|
|
d6d67dbdcb | ||
|
|
73ce7e7e63 | ||
|
|
f8b30d02ec | ||
|
|
2e72b98ed8 | ||
|
|
a8999f947d | ||
|
|
ccf830a458 | ||
|
|
9b9642fca4 | ||
|
|
e0d634e5c3 | ||
|
|
e62f1a8991 | ||
|
|
7bbc8cb035 | ||
|
|
38989c080e | ||
|
|
b4fb989f02 | ||
|
|
08b770bc1b | ||
|
|
cb530ce9e2 | ||
|
|
e105489549 | ||
|
|
95f22ad2a7 | ||
|
|
d229d15c76 | ||
|
|
deb63d8117 | ||
|
|
ecadd90f94 | ||
|
|
419ab1055e | ||
|
|
213744b51e | ||
|
|
b47217154a | ||
|
|
c7a65b99a6 | ||
|
|
249d3236d0 | ||
|
|
d521d95a3d | ||
|
|
987cc1fb28 | ||
|
|
7ec5ab2e48 | ||
|
|
08fe02d9fc | ||
|
|
6201a1a70f | ||
|
|
f1bbfccee2 | ||
|
|
1821246647 | ||
|
|
010c0266ef | ||
|
|
592fde9564 | ||
|
|
508a43be8c |
@@ -7,9 +7,14 @@ INSTALL
|
|||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
_*
|
_*
|
||||||
|
a.exe
|
||||||
|
a.out
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
autom4te.cache
|
autom4te.cache
|
||||||
|
b.out
|
||||||
bison-*
|
bison-*
|
||||||
|
conf[0-9]*
|
||||||
|
confdefs*
|
||||||
config.cache
|
config.cache
|
||||||
config.h
|
config.h
|
||||||
config.hin
|
config.hin
|
||||||
@@ -17,6 +22,7 @@ config.log
|
|||||||
config.status
|
config.status
|
||||||
configure
|
configure
|
||||||
configure.lineno
|
configure.lineno
|
||||||
|
conftest*
|
||||||
intl
|
intl
|
||||||
patches
|
patches
|
||||||
releases
|
releases
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
data/glr.c
|
||||||
|
data/yacc.c
|
||||||
|
lib/yyerror.c
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
doc/bison.texinfo
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
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.
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
|
|
||||||
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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
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.
|
||||||
@@ -313,7 +313,7 @@ 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 is interactive, make it output a short notice like this
|
||||||
when it starts in an interactive mode:
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) year name of author
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
Gnomovision 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.
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along
|
# 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.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
# Systems where /bin/sh is not the default shell need this. The $(shell)
|
# 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.
|
# command below won't work with e.g. stock DOS/Windows shells.
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ release:
|
|||||||
|
|
||||||
* Release Procedure
|
* Release Procedure
|
||||||
|
|
||||||
|
** Try to get the *.pot files to the Translation Project at least one week
|
||||||
|
before a stable release, to give them time to translate them.
|
||||||
|
|
||||||
** Tests
|
** Tests
|
||||||
See above.
|
See above.
|
||||||
|
|
||||||
@@ -115,7 +118,7 @@ separate message.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
@@ -131,5 +134,5 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with GNU Bison; see the file COPYING. If not, write to the Free
|
along with GNU Bison; see the file COPYING. If not, write to the Free
|
||||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
02111-1307, USA.
|
02110-1301, USA.
|
||||||
|
|||||||
+15
-5
@@ -1,5 +1,5 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
## This program is free software; you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
## it under the terms of the GNU General Public License as published by
|
||||||
@@ -13,14 +13,24 @@
|
|||||||
|
|
||||||
## 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, write to the Free Software
|
||||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
## 02111-1307 USA
|
## 02110-1301 USA
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
SUBDIRS = config po lib data src doc tests
|
SUBDIRS = build-aux po runtime-po lib data src doc examples tests
|
||||||
|
|
||||||
|
# Files installed for use by Automake.
|
||||||
|
aclocaldir = @aclocaldir@
|
||||||
|
aclocal_DATA = m4/bison-i18n.m4
|
||||||
|
|
||||||
|
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
|
||||||
|
OChangeLog PACKAGING \
|
||||||
|
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
||||||
|
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
||||||
|
djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \
|
||||||
|
djgpp/fnchange.lst
|
||||||
|
|
||||||
EXTRA_DIST = REFERENCES OChangeLog Makefile.maint GNUmakefile Makefile.cfg
|
|
||||||
|
|
||||||
.PHONY: maintainer-check
|
.PHONY: maintainer-check
|
||||||
maintainer-check:
|
maintainer-check:
|
||||||
|
|||||||
+15
-17
@@ -1,5 +1,5 @@
|
|||||||
# Customize Makefile.maint for Bison. -*- makefile -*-
|
# Customize Makefile.maint for Bison. -*- makefile -*-
|
||||||
# Copyright (C) 2003 Free Software Foundation, Inc.
|
# Copyright (C) 2003, 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
|
||||||
@@ -13,12 +13,12 @@
|
|||||||
|
|
||||||
# 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, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
# 02111-1307, USA.
|
# 02110-1301, USA.
|
||||||
|
|
||||||
prev_version_file = $(srcdir)/config/prev-version.txt
|
build_aux_dir = $(srcdir)/build-aux
|
||||||
move_if_change = $(srcdir)/config/move-if-change
|
prev_version_file = $(build_aux_dir)/prev-version.txt
|
||||||
announce_gen = $(srcdir)/config/announce-gen
|
announce_gen = $(build_aux_dir)/announce-gen
|
||||||
release_archive_dir = releases
|
release_archive_dir = releases
|
||||||
|
|
||||||
# Use alpha.gnu.org for alpha and beta releases.
|
# Use alpha.gnu.org for alpha and beta releases.
|
||||||
@@ -33,18 +33,16 @@ url_dir_list = \
|
|||||||
|
|
||||||
# Files to update automatically.
|
# Files to update automatically.
|
||||||
wget_files = \
|
wget_files = \
|
||||||
$(srcdir)/config/config.guess \
|
$(build_aux_dir)/config.guess \
|
||||||
$(srcdir)/config/config.sub \
|
$(build_aux_dir)/config.sub \
|
||||||
$(srcdir)/config/texinfo.tex \
|
$(build_aux_dir)/texinfo.tex \
|
||||||
|
|
||||||
cvs_files = \
|
cvs_files = \
|
||||||
$(srcdir)/config/install-sh \
|
$(build_aux_dir)/install-sh \
|
||||||
$(srcdir)/config/mdate-sh \
|
$(build_aux_dir)/mdate-sh \
|
||||||
$(srcdir)/config/missing \
|
$(build_aux_dir)/missing \
|
||||||
$(srcdir)/config/mkinstalldirs
|
$(build_aux_dir)/mkinstalldirs
|
||||||
|
|
||||||
# Tests not to run.
|
# Tests not to run.
|
||||||
# local-checks-to-skip ?= \
|
local-checks-to-skip = \
|
||||||
# author_mark_check \
|
changelog-check
|
||||||
# strftime-check syntax-check makefile_path_separator_check \
|
|
||||||
# makefile-check
|
|
||||||
|
|||||||
+266
-143
@@ -2,7 +2,7 @@
|
|||||||
# This Makefile fragment is shared between the coreutils,
|
# This Makefile fragment is shared between the coreutils,
|
||||||
# CPPI, Bison, and Autoconf.
|
# CPPI, Bison, and Autoconf.
|
||||||
|
|
||||||
## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
## Copyright (C) 2001-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
|
||||||
@@ -16,28 +16,45 @@
|
|||||||
##
|
##
|
||||||
## 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, write to the Free Software
|
||||||
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
## 02111-1307, USA.
|
## 02110-1301, USA.
|
||||||
|
|
||||||
# This is reported not to work with make-3.79.1
|
# This is reported not to work with make-3.79.1
|
||||||
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||||
ME := Makefile.maint
|
ME := Makefile.maint
|
||||||
|
|
||||||
# Do not save the original name or timestamp in the .tar.gz file.
|
# Do not save the original name or timestamp in the .tar.gz file.
|
||||||
GZIP_ENV = \
|
# Use --rsyncable if available.
|
||||||
"--no-name --best$$( \
|
gzip_rsyncable = \
|
||||||
case $$(gzip --help) in \
|
(gzip --help|grep rsyncable) >/dev/null 2>&1 && echo --rsyncable
|
||||||
(*--rsyncable*) echo ' --rsyncable';; \
|
GZIP_ENV = "--no-name --best `$(gzip_rsyncable)`"
|
||||||
esac \
|
|
||||||
)"
|
|
||||||
|
|
||||||
CVS = cvs
|
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)
|
ifeq ($(origin prev_version_file), undefined)
|
||||||
prev_version_file = .prev-version
|
prev_version_file = .prev-version
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PREV_VERSION := $(shell cat $(prev_version_file))
|
PREV_VERSION := $(shell cat $(prev_version_file))
|
||||||
|
VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||||
|
|
||||||
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
||||||
tag-this-version = $(subst .,_,$(VERSION))
|
tag-this-version = $(subst .,_,$(VERSION))
|
||||||
@@ -58,137 +75,237 @@ export LC_ALL = C
|
|||||||
## Sanity checks. ##
|
## 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.
|
# Checks that don't require cvs.
|
||||||
# Run `changelog-check' last, as previous test may reveal problems requiring
|
# Run `changelog-check' last, as previous test may reveal problems requiring
|
||||||
# new ChangeLog entries.
|
# new ChangeLog entries.
|
||||||
local-checks-available = \
|
local-checks-available = \
|
||||||
po-check copyright-check writable-files m4-check author_mark_check \
|
po-check copyright-check writable-files m4-check author_mark_check \
|
||||||
changelog-check strftime-check syntax-check makefile_path_separator_check \
|
changelog-check strftime-check $(syntax-check-rules) \
|
||||||
|
makefile_path_separator_check \
|
||||||
makefile-check
|
makefile-check
|
||||||
.PHONY: $(local-checks-available)
|
.PHONY: $(local-checks-available)
|
||||||
|
|
||||||
local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
||||||
|
|
||||||
# Make sure C source files in src/ don't include xalloc.h directly,
|
|
||||||
# since they all already include it via sys2.h.
|
|
||||||
# It's not a big deal -- just aesthetics.
|
|
||||||
.PHONY: $(syntax-check-rules)
|
.PHONY: $(syntax-check-rules)
|
||||||
syntax-check-rules = \
|
syntax-check-rules = \
|
||||||
sc_cast_of_argument_to_free \
|
sc_cast_of_argument_to_free \
|
||||||
sc_cast_of_x_alloc_return_value \
|
sc_cast_of_x_alloc_return_value \
|
||||||
|
sc_cast_of_alloca_return_value \
|
||||||
sc_changelog \
|
sc_changelog \
|
||||||
|
sc_dd_max_sym_length \
|
||||||
sc_error_exit_success \
|
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_space_tab \
|
||||||
sc_sun_os_names \
|
sc_sun_os_names \
|
||||||
sc_system_h_headers \
|
sc_system_h_headers \
|
||||||
|
sc_tight_scope \
|
||||||
|
sc_trailing_blank \
|
||||||
|
sc_two_space_separator_in_usage \
|
||||||
sc_unmarked_diagnostics \
|
sc_unmarked_diagnostics \
|
||||||
sc_xalloc_h_in_src
|
sc_useless_cpp_parens
|
||||||
|
|
||||||
syntax-check: $(syntax-check-rules)
|
syntax-check: $(syntax-check-rules)
|
||||||
# @grep -E '# *include <(limits|std(def|arg|bool))\.h>' \
|
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
|
||||||
# $$(find -type f -name '*.[chly]') && \
|
# $$(find -type f -name '*.[chly]') && \
|
||||||
# { echo '$(ME): found conditional include' 1>&2; \
|
# { echo '$(ME): found conditional include' 1>&2; \
|
||||||
# exit 1; } || :
|
# exit 1; } || :
|
||||||
|
|
||||||
# grep -E '^# *include <(string|stdlib)\.h>' \
|
# grep -nE '^# *include <(string|stdlib)\.h>' \
|
||||||
# $(srcdir)/{lib,src}/*.[chy] && \
|
# $(srcdir)/{lib,src}/*.[chy] && \
|
||||||
# { echo '$(ME): FIXME' 1>&2; \
|
# { echo '$(ME): FIXME' 1>&2; \
|
||||||
# exit 1; } || :
|
# exit 1; } || :
|
||||||
# FIXME: don't allow `#include .strings\.h' anywhere
|
# FIXME: don't allow `#include .strings\.h' anywhere
|
||||||
|
|
||||||
# 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 --exclude=$(srcdir)/src/shred.c -E \
|
|
||||||
'\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c \
|
|
||||||
| grep -v '_(' && \
|
|
||||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
|
||||||
exit 1; } || :
|
|
||||||
|
|
||||||
sc_cast_of_argument_to_free:
|
sc_cast_of_argument_to_free:
|
||||||
@grep -E '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
|
@grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
|
||||||
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
|
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
|
||||||
exit 1; } || :
|
exit 1; } || :
|
||||||
|
|
||||||
sc_cast_of_x_alloc_return_value:
|
sc_cast_of_x_alloc_return_value:
|
||||||
@grep -E --exclude=$(srcdir)/lib/regex.c \
|
@grep -nE --exclude=$(srcdir)/lib/regex.c \
|
||||||
'\*\) *x(m|c|re)alloc\>' $(srcdir)/{lib,src}/*.[chy] && \
|
'\*\) *x(m|c|re)alloc\>' \
|
||||||
|
$(srcdir)/{lib,src}/*.[chy] && \
|
||||||
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
|
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
|
||||||
exit 1; } || :
|
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:
|
sc_space_tab:
|
||||||
@( cvsu --list ) > /dev/null 2>&1 || : && \
|
@grep -n '[ ] ' $$($(CVS_LIST_EXCEPT)) && \
|
||||||
grep '[ ] ' \
|
|
||||||
$$(cvsu --list | grep -vEf .x-$@ ) && \
|
|
||||||
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
||||||
1>&2; exit 1; } || :
|
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,
|
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
||||||
# since when that parameter is 0, error does not exit. Use `0' instead.
|
# since when that parameter is 0, error does not exit. Use `0' instead.
|
||||||
sc_error_exit_success:
|
sc_error_exit_success:
|
||||||
@grep -F 'error (EXIT_SUCCESS,' \
|
@grep -nF 'error (EXIT_SUCCESS,' \
|
||||||
$$(find -type f -name '*.[chly]') && \
|
$$(find -type f -name '*.[chly]') && \
|
||||||
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
||||||
exit 1; } || :
|
exit 1; } || :
|
||||||
|
|
||||||
# FIXME: merge this with sc_system_h_headers below.
|
sc_file_system:
|
||||||
# xalloc.h is included via system.h, so should not be included
|
@grep -ni 'file''system' $$($(CVS_LIST_EXCEPT)) && \
|
||||||
# directly by any file in src/.
|
{ echo '$(ME): found use of "file''system";' \
|
||||||
sc_xalloc_h_in_src:
|
'rewrite to use "file system"' 1>&2; \
|
||||||
@if test -f $(srcdir)/src/sys2.h; then \
|
exit 1; } || :
|
||||||
if grep 'xalloc\.h' $(srcdir)/src/*.c; then \
|
|
||||||
exit 1; \
|
sc_no_if_have_config_h:
|
||||||
fi; \
|
@grep -n '^# *if HAVE_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \
|
||||||
fi
|
{ 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
|
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
||||||
|
|
||||||
# Each nonempty line must start with a year number, or a TAB.
|
# Each nonempty line must start with a year number, or a TAB.
|
||||||
sc_changelog:
|
sc_changelog:
|
||||||
@grep '^[^12 ]' $$(find . -name ChangeLog -maxdepth 2) && \
|
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
|
||||||
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
||||||
exit 1; } || :
|
exit 1; } || :
|
||||||
|
|
||||||
header_regexp = \
|
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
||||||
alloca\
|
# with the strings from the two affected variables.
|
||||||
|closeout\
|
dd_c = $(srcdir)/src/dd.c
|
||||||
|ctype\
|
sc_dd_max_sym_length:
|
||||||
|dirent\
|
ifneq ($(wildcard $(dd_c)),)
|
||||||
|errno\
|
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
||||||
|fcntl\
|
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
||||||
|inttypes\
|
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
||||||
|limits\
|
| wc --max-line-length); \
|
||||||
|locale\
|
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
||||||
|pathmax\
|
|tr -d '"' | wc --max-line-length); \
|
||||||
|std(lib|bool)\
|
if test "$$len" = "$$max"; then :; else \
|
||||||
|string\
|
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
||||||
|sys/(stat|dir|time)\
|
exit 1; \
|
||||||
|time\
|
fi
|
||||||
|unistd\
|
endif
|
||||||
|utime\
|
|
||||||
|version-etc\
|
# Many m4 macros names once began with `jm_'.
|
||||||
|xalloc
|
# On 2004-04-13, they were all changed to start with gl_ instead.
|
||||||
h_re := $(shell echo '$(header_regexp)'|tr -d ' ')
|
# 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
|
# Files in src/ should not include directly any of
|
||||||
# the headers already included via system.h.
|
# the headers already included via system.h.
|
||||||
# Get list of candidates with this:
|
sc_system_h_headers: .re-list
|
||||||
# grep -h include src/sys*.h|sed 's/.*include //'|sort -
|
@if test -f $(srcdir)/src/system.h; then \
|
||||||
sc_system_h_headers:
|
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
|
||||||
@( cvsu --list ) > /dev/null 2>&1 || : && \
|
grep -nE -f .re-list \
|
||||||
grep -E '^# *include ["<]($(h_re))\.h[">]' \
|
$$($(CVS_LIST) src | \
|
||||||
$$(cvsu --list src | grep -Ev 'sys(2|tem)\.h$$') \
|
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
|
||||||
&& { echo '$(ME): the above are already included via system.h'\
|
&& { echo '$(ME): the above are already included via system.h'\
|
||||||
1>&2; exit 1; } || :
|
1>&2; exit 1; } || :; \
|
||||||
|
fi
|
||||||
|
|
||||||
sc_sun_os_names:
|
sc_sun_os_names:
|
||||||
@( cvsu --list ) > /dev/null 2>&1 || : && \
|
@grep -nEi \
|
||||||
grep -Ei \
|
|
||||||
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
||||||
$$(cvsu --list | grep -vEf .x-$@ ) && \
|
$$($(CVS_LIST_EXCEPT)) && \
|
||||||
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
||||||
exit 1; } || :
|
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
|
# Ensure that date's --help output stays in sync with the info
|
||||||
# documentation for GNU strftime. The only exception is %N,
|
# documentation for GNU strftime. The only exception is %N,
|
||||||
# which date accepts but GNU strftime does not.
|
# which date accepts but GNU strftime does not.
|
||||||
@@ -208,11 +325,22 @@ strftime-check:
|
|||||||
# not @...@ in Makefile.am, now that we can rely on automake
|
# not @...@ in Makefile.am, now that we can rely on automake
|
||||||
# to emit a definition for each substituted variable.
|
# to emit a definition for each substituted variable.
|
||||||
makefile-check:
|
makefile-check:
|
||||||
grep -E '@[A-Z_0-9]+@' `find . -name Makefile.am` \
|
grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
|
||||||
&& { echo 'Makefile.maint: use $(...), not @...@' 1>&2; exit 1; } || :
|
&& { 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:
|
changelog-check:
|
||||||
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
|
||||||
|
>/dev/null; then \
|
||||||
:; \
|
:; \
|
||||||
else \
|
else \
|
||||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||||
@@ -220,33 +348,38 @@ changelog-check:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
m4-check:
|
m4-check:
|
||||||
@grep 'AC_DEFUN([^[]' m4/*.m4 \
|
@grep -n 'AC_DEFUN([^[]' m4/*.m4 \
|
||||||
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
|
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
|
||||||
exit 1; } || :
|
exit 1; } || :
|
||||||
|
|
||||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
# 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:
|
po-check:
|
||||||
if test -f po/POTFILES.in; then \
|
if test -f po/POTFILES.in; then \
|
||||||
grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
|
grep -E -v '^(#|$$)' po/POTFILES.in \
|
||||||
files=; \
|
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
||||||
for file in lib/*.[chly] src/*.[chly]; do \
|
files=; \
|
||||||
case $$file in \
|
for file in $$($(CVS_LIST_EXCEPT)) lib/*.[ch]; do \
|
||||||
*.[ch]) \
|
case $$file in \
|
||||||
base=`expr " $$file" : ' \(.*\)\..'`; \
|
djgpp/* | man/*) continue;; \
|
||||||
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
esac; \
|
||||||
esac; \
|
case $$file in \
|
||||||
files="$$files $$file"; \
|
*.[ch]) \
|
||||||
done; \
|
base=`expr " $$file" : ' \(.*\)\..'`; \
|
||||||
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort > $@-2; \
|
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
||||||
diff -u $@-1 $@-2 || exit 1; \
|
esac; \
|
||||||
rm -f $@-1 $@-2; \
|
files="$$files $$file"; \
|
||||||
|
done; \
|
||||||
|
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort -u > $@-2; \
|
||||||
|
diff -u $@-1 $@-2 || exit 1; \
|
||||||
|
rm -f $@-1 $@-2; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# In a definition of #define AUTHORS "... and ..." where the RHS contains
|
# In a definition of #define AUTHORS "... and ..." where the RHS contains
|
||||||
# the English word `and', the string must be marked with `N_ (...)' so that
|
# the English word `and', the string must be marked with `N_ (...)' so that
|
||||||
# gettext recognizes it as a string requiring translation.
|
# gettext recognizes it as a string requiring translation.
|
||||||
author_mark_check:
|
author_mark_check:
|
||||||
@grep '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
|
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
|
||||||
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
|
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
|
||||||
exit 1; } || :
|
exit 1; } || :
|
||||||
|
|
||||||
@@ -258,7 +391,7 @@ author_mark_check:
|
|||||||
# that we'd have to worry about limits on command line length.
|
# that we'd have to worry about limits on command line length.
|
||||||
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
||||||
makefile_path_separator_check:
|
makefile_path_separator_check:
|
||||||
@grep 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
||||||
&& { echo $(msg) 1>&2; exit 1; } || :
|
&& { echo $(msg) 1>&2; exit 1; } || :
|
||||||
|
|
||||||
# Check that `make alpha' will not fail at the end of the process.
|
# Check that `make alpha' will not fail at the end of the process.
|
||||||
@@ -279,7 +412,7 @@ v_etc_file = lib/version-etc.c
|
|||||||
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
||||||
copyright-check:
|
copyright-check:
|
||||||
@if test -f $(v_etc_file); then \
|
@if test -f $(v_etc_file); then \
|
||||||
grep '"Copyright (C) $(shell date +%Y) Free' $(v_etc_file) \
|
grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
|
||||||
>/dev/null \
|
>/dev/null \
|
||||||
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
||||||
exit 1; }; \
|
exit 1; }; \
|
||||||
@@ -330,21 +463,23 @@ null_AM_MAKEFLAGS = \
|
|||||||
# Detect format-string/arg-list mismatches that would normally be obscured
|
# Detect format-string/arg-list mismatches that would normally be obscured
|
||||||
# by the use of _(). The --disable-nls effectively defines away that macro,
|
# by the use of _(). The --disable-nls effectively defines away that macro,
|
||||||
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
|
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
|
||||||
# treated as a failure.
|
# 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
|
TMPDIR ?= /tmp
|
||||||
t=$(TMPDIR)/$(PACKAGE)/test
|
t=$(TMPDIR)/$(PACKAGE)/test
|
||||||
my-distcheck: $(local-check)
|
my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
|
||||||
-rm -rf $(t)
|
-rm -rf $(t)
|
||||||
mkdir -p $(t)
|
mkdir -p $(t)
|
||||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||||
cd $(t)/$(distdir) \
|
cd $(t)/$(distdir) \
|
||||||
&& ./configure --disable-nls \
|
&& ./configure --disable-nls \
|
||||||
&& $(MAKE) CFLAGS='-Wformat -Werror' \
|
&& $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow' \
|
||||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||||
&& $(MAKE) dvi \
|
&& $(MAKE) dvi \
|
||||||
&& $(MAKE) check \
|
&& $(MAKE) check \
|
||||||
&& $(MAKE) distclean
|
&& $(MAKE) distclean
|
||||||
(cd $(t) && mv $(distdir) $(distdir).old \
|
(cd $(t) && mv $(distdir) $(distdir).old \
|
||||||
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
||||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||||
-rm -rf $(t)
|
-rm -rf $(t)
|
||||||
@@ -355,16 +490,6 @@ my-distcheck: $(local-check)
|
|||||||
WGET = wget
|
WGET = wget
|
||||||
WGETFLAGS = -C off
|
WGETFLAGS = -C off
|
||||||
|
|
||||||
tgz-md5 = $(shell md5sum < $(my_distdir).tar.gz|sed 's/ -//')
|
|
||||||
tgz-sha1 = $(shell sha1sum < $(my_distdir).tar.gz|sed 's/ -//')
|
|
||||||
bz2-md5 = $(shell md5sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
|
||||||
bz2-sha1 = $(shell sha1sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
|
||||||
xdelta-md5 = $(shell md5sum < $(xd-delta)|sed 's/ -//')
|
|
||||||
xdelta-sha1 = $(shell sha1sum < $(xd-delta)|sed 's/ -//')
|
|
||||||
tgz-size = $(shell du --human $(my_distdir).tar.gz|sed 's/\([MkK]\).*/ \1B/')
|
|
||||||
bz2-size = $(shell du --human $(my_distdir).tar.bz2|sed 's/\([MkK]\).*/ \1B/')
|
|
||||||
xd-size = $(shell du --human $(xd-delta)|sed 's/\([MkK]\).*/ \1B/')
|
|
||||||
|
|
||||||
rel-check:
|
rel-check:
|
||||||
tarz=/tmp/rel-check-tarz-$$$$; \
|
tarz=/tmp/rel-check-tarz-$$$$; \
|
||||||
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
||||||
@@ -377,20 +502,15 @@ rel-check:
|
|||||||
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
||||||
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
||||||
|
|
||||||
signatures ?= $(distdir).tar.bz2.asc $(distdir).tar.gz.asc
|
rel-files = $(xd-delta) $(DIST_ARCHIVES)
|
||||||
%.asc: %
|
announcement: NEWS ChangeLog $(rel-files)
|
||||||
rm -f $@
|
@./announce-gen \
|
||||||
gpg --armor --detach-sign -o $@ $<
|
|
||||||
|
|
||||||
rel-files = $(xd-delta) $(distdir).tar.bz2 $(distdir).tar.gz $(signatures)
|
|
||||||
announce_gen ?= ./announce-gen
|
|
||||||
announcement: NEWS ChangeLog $(rel-files) $(signatures)
|
|
||||||
@$(announce_gen) \
|
|
||||||
--release-type=$(RELEASE_TYPE) \
|
--release-type=$(RELEASE_TYPE) \
|
||||||
--package=$(PACKAGE) \
|
--package=$(PACKAGE) \
|
||||||
--prev=$(PREV_VERSION) \
|
--prev=$(PREV_VERSION) \
|
||||||
--curr=$(VERSION) \
|
--curr=$(VERSION) \
|
||||||
--release-archive-directory=$(release_archive_dir) \
|
--release-archive-directory=$(release_archive_dir) \
|
||||||
|
--gpg-key-id=$(gpg_key_ID) \
|
||||||
--news=NEWS \
|
--news=NEWS \
|
||||||
$(addprefix --url-dir=, $(url_dir_list)) \
|
$(addprefix --url-dir=, $(url_dir_list)) \
|
||||||
|
|
||||||
@@ -443,14 +563,16 @@ po-update:
|
|||||||
# The following pseudo table associates a local directory and a URL
|
# The following pseudo table associates a local directory and a URL
|
||||||
# with each of the files that belongs to some other package and is
|
# with each of the files that belongs to some other package and is
|
||||||
# regularly updated from the specified URL.
|
# regularly updated from the specified URL.
|
||||||
wget_files ?= $(srcdir)/config/config.guess \
|
wget_files ?= \
|
||||||
$(srcdir)/config/config.sub \
|
$(srcdir)/build-aux/config.guess \
|
||||||
$(srcdir)/src/ansi2knr.c \
|
$(srcdir)/build-aux/config.sub \
|
||||||
$(srcdir)/config/texinfo.tex
|
$(srcdir)/build-aux/texinfo.tex \
|
||||||
|
$(srcdir)/src/ansi2knr.c
|
||||||
|
|
||||||
get-targets = $(patsubst %, get-%, $(wget_files))
|
get-targets = $(patsubst %, get-%, $(wget_files))
|
||||||
|
|
||||||
config.guess-url_prefix = $(ftp-gnu)/config/
|
config.guess-url_prefix = $(ftp-gnu)/build-aux/
|
||||||
config.sub-url_prefix = $(ftp-gnu)/config/
|
config.sub-url_prefix = $(ftp-gnu)/build-aux/
|
||||||
|
|
||||||
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
|
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
|
||||||
|
|
||||||
@@ -468,11 +590,11 @@ $(get-targets):
|
|||||||
&& $(move_if_change) $(target).t $(target)
|
&& $(move_if_change) $(target).t $(target)
|
||||||
|
|
||||||
cvs_files ?= \
|
cvs_files ?= \
|
||||||
$(srcdir)/src/ansi2knr.c \
|
$(srcdir)/build-aux/depcomp \
|
||||||
$(srcdir)/config/depcomp \
|
$(srcdir)/build-aux/install-sh \
|
||||||
$(srcdir)/config/install-sh \
|
$(srcdir)/build-aux/missing \
|
||||||
$(srcdir)/config/missing \
|
$(srcdir)/build-aux/mkinstalldirs \
|
||||||
$(srcdir)/config/mkinstalldirs
|
$(srcdir)/src/ansi2knr.c
|
||||||
automake_repo=:pserver:anoncvs:[email protected]:/cvs/automake
|
automake_repo=:pserver:anoncvs:[email protected]:/cvs/automake
|
||||||
.PHONY: wget-update
|
.PHONY: wget-update
|
||||||
wget-update: $(get-targets)
|
wget-update: $(get-targets)
|
||||||
@@ -492,25 +614,26 @@ cvs-update:
|
|||||||
done; \
|
done; \
|
||||||
test "$$fail" && exit 1
|
test "$$fail" && exit 1
|
||||||
|
|
||||||
define emit-upload-commands
|
emit_upload_commands:
|
||||||
echo =====================================
|
@echo =====================================
|
||||||
echo =====================================
|
@echo =====================================
|
||||||
echo upload $(PACKAGE) $(PREV_VERSION) $(VERSION)
|
@echo "$(srcdir)/gnupload $(GNUPLOADFLAGS) \\"
|
||||||
echo '# send the /tmp/announcement e-mail'
|
@echo " --to $(gnu_rel_host):coreutils \\"
|
||||||
echo =====================================
|
@echo " $(rel-files)"
|
||||||
echo =====================================
|
@echo '# send the /tmp/announcement e-mail'
|
||||||
endef
|
@echo =====================================
|
||||||
|
@echo =====================================
|
||||||
|
|
||||||
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
||||||
xdelta delta -9 $^ $@ || :
|
xdelta delta -9 $^ $@ || :
|
||||||
|
|
||||||
.PHONY: alpha beta major
|
.PHONY: alpha beta major
|
||||||
alpha beta major: $(local-check)
|
alpha beta major: news-date-check $(local-check)
|
||||||
$(MAKE) cvs-dist
|
$(MAKE) cvs-dist
|
||||||
$(MAKE) $(xd-delta)
|
$(MAKE) $(xd-delta)
|
||||||
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
|
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
|
||||||
ln $(rel-files) $(release_archive_dir)
|
ln $(rel-files) $(release_archive_dir)
|
||||||
chmod a-w $(rel-files)
|
chmod a-w $(rel-files)
|
||||||
|
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
|
||||||
echo $(VERSION) > $(prev_version_file)
|
echo $(VERSION) > $(prev_version_file)
|
||||||
$(CVS) ci -m. $(prev_version_file)
|
$(CVS) ci -m. $(prev_version_file)
|
||||||
@$(emit-upload-commands)
|
|
||||||
|
|||||||
@@ -1,6 +1,229 @@
|
|||||||
Bison News
|
Bison News
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
Changes in version 2.3a, 2006-09-13:
|
||||||
|
|
||||||
|
* Instead of %union, you can define and use your own union type
|
||||||
|
YYSTYPE if your grammar contains at least one <type> tag.
|
||||||
|
Your YYSTYPE need not be a macro; it can be a typedef.
|
||||||
|
This change is for compatibility with other Yacc implementations,
|
||||||
|
and is required by POSIX.
|
||||||
|
|
||||||
|
* Locations columns and lines start at 1.
|
||||||
|
In accordance with the GNU Coding Standards and Emacs.
|
||||||
|
|
||||||
|
* You may now declare per-type and default %destructor's and %printer's:
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
%union { char *string; }
|
||||||
|
%token <string> STRING1
|
||||||
|
%token <string> STRING2
|
||||||
|
%type <string> string1
|
||||||
|
%type <string> string2
|
||||||
|
%union { char character; }
|
||||||
|
%token <character> CHR
|
||||||
|
%type <character> chr
|
||||||
|
%destructor { free ($$); } %symbol-default
|
||||||
|
%destructor { free ($$); printf ("%d", @$.first_line); } STRING1 string1
|
||||||
|
%destructor { } <character>
|
||||||
|
|
||||||
|
guarantees that, when the parser discards any user-defined symbol that has a
|
||||||
|
semantic type tag other than `<character>', it passes its semantic value to
|
||||||
|
`free'. However, when the parser discards a `STRING1' or a `string1', it
|
||||||
|
also prints its line number to `stdout'. It performs only the second
|
||||||
|
`%destructor' in this case, so it invokes `free' only once.
|
||||||
|
|
||||||
|
* Except for LALR(1) parsers in C with POSIX Yacc emulation enabled (with `-y',
|
||||||
|
`--yacc', or `%yacc'), Bison no longer generates #define statements for
|
||||||
|
associating token numbers with token names. Removing the #define statements
|
||||||
|
helps to sanitize the global namespace during preprocessing, but POSIX Yacc
|
||||||
|
requires them. Bison still generates an enum for token names in all cases.
|
||||||
|
|
||||||
|
* Handling of traditional Yacc prologue blocks is now more consistent but
|
||||||
|
potentially incompatible with previous releases of Bison.
|
||||||
|
|
||||||
|
As before, you declare prologue blocks in your grammar file with the
|
||||||
|
`%{ ... %}' syntax. To generate the pre-prologue, Bison concatenates all
|
||||||
|
prologue blocks that you've declared before the first %union. To generate
|
||||||
|
the post-prologue, Bison concatenates all prologue blocks that you've
|
||||||
|
declared after the first %union.
|
||||||
|
|
||||||
|
Previous releases of Bison inserted the pre-prologue into both the header
|
||||||
|
file and the code file in all cases except for LALR(1) parsers in C. In the
|
||||||
|
latter case, Bison inserted it only into the code file. For parsers in C++,
|
||||||
|
the point of insertion was before any token definitions (which associate
|
||||||
|
token numbers with names). For parsers in C, the point of insertion was
|
||||||
|
after the token definitions.
|
||||||
|
|
||||||
|
Now, Bison never inserts the pre-prologue into the header file. In the code
|
||||||
|
file, it always inserts it before the token definitions.
|
||||||
|
|
||||||
|
* Bison now provides a more flexible alternative to the traditional Yacc
|
||||||
|
prologue blocks: %before-header, %start-header, %end-header, and
|
||||||
|
%after-header.
|
||||||
|
|
||||||
|
For example, the following declaration order in the grammar file reflects the
|
||||||
|
order in which Bison will output these code blocks. However, you are free to
|
||||||
|
declare these code blocks in your grammar file in whatever order is most
|
||||||
|
convenient for you:
|
||||||
|
|
||||||
|
%before-header {
|
||||||
|
/* Bison treats this block like a pre-prologue block: it inserts it into
|
||||||
|
* the code file before the contents of the header file. It does *not*
|
||||||
|
* insert it into the header file. This is a good place to put
|
||||||
|
* #include's that you want at the top of your code file. A common
|
||||||
|
* example is `#include "system.h"'. */
|
||||||
|
}
|
||||||
|
%start-header {
|
||||||
|
/* Bison inserts this block into both the header file and the code file.
|
||||||
|
* In both files, the point of insertion is before any Bison-generated
|
||||||
|
* token, semantic type, location type, and class definitions. This is a
|
||||||
|
* good place to define %union dependencies, for example. */
|
||||||
|
}
|
||||||
|
%union {
|
||||||
|
/* Unlike the traditional Yacc prologue blocks, the output order for the
|
||||||
|
* new %*-header blocks is not affected by their declaration position
|
||||||
|
* relative to any %union in the grammar file. */
|
||||||
|
}
|
||||||
|
%end-header {
|
||||||
|
/* Bison inserts this block into both the header file and the code file.
|
||||||
|
* In both files, the point of insertion is after the Bison-generated
|
||||||
|
* definitions. This is a good place to declare or define public
|
||||||
|
* functions or data structures that depend on the Bison-generated
|
||||||
|
* definitions. */
|
||||||
|
}
|
||||||
|
%after-header {
|
||||||
|
/* Bison treats this block like a post-prologue block: it inserts it into
|
||||||
|
* the code file after the contents of the header file. It does *not*
|
||||||
|
* insert it into the header file. This is a good place to declare or
|
||||||
|
* define internal functions or data structures that depend on the
|
||||||
|
* Bison-generated definitions. */
|
||||||
|
}
|
||||||
|
|
||||||
|
If you have multiple occurrences of any one of the above declarations, Bison
|
||||||
|
will concatenate the contents in declaration order.
|
||||||
|
|
||||||
|
* The option `--report=look-ahead' has been changed to `--report=lookahead'.
|
||||||
|
The old spelling still works, but is not documented and may be removed
|
||||||
|
in a future release.
|
||||||
|
|
||||||
|
Changes in version 2.3, 2006-06-05:
|
||||||
|
|
||||||
|
* GLR grammars should now use `YYRECOVERING ()' instead of `YYRECOVERING',
|
||||||
|
for compatibility with LALR(1) grammars.
|
||||||
|
|
||||||
|
* It is now documented that any definition of YYSTYPE or YYLTYPE should
|
||||||
|
be to a type name that does not contain parentheses or brackets.
|
||||||
|
|
||||||
|
Changes in version 2.2, 2006-05-19:
|
||||||
|
|
||||||
|
* The distribution terms for all Bison-generated parsers now permit
|
||||||
|
using the parsers in nonfree programs. Previously, this permission
|
||||||
|
was granted only for Bison-generated LALR(1) parsers in C.
|
||||||
|
|
||||||
|
* %name-prefix changes the namespace name in C++ outputs.
|
||||||
|
|
||||||
|
* The C++ parsers export their token_type.
|
||||||
|
|
||||||
|
* Bison now allows multiple %union declarations, and concatenates
|
||||||
|
their contents together.
|
||||||
|
|
||||||
|
* New warning: unused values
|
||||||
|
Right-hand side symbols whose values are not used are reported,
|
||||||
|
if the symbols have destructors. For instance:
|
||||||
|
|
||||||
|
exp: exp "?" exp ":" exp { $1 ? $1 : $3; }
|
||||||
|
| exp "+" exp
|
||||||
|
;
|
||||||
|
|
||||||
|
will trigger a warning about $$ and $5 in the first rule, and $3 in
|
||||||
|
the second ($1 is copied to $$ by the default rule). This example
|
||||||
|
most likely contains three errors, and could be rewritten as:
|
||||||
|
|
||||||
|
exp: exp "?" exp ":" exp
|
||||||
|
{ $$ = $1 ? $3 : $5; free ($1 ? $5 : $3); free ($1); }
|
||||||
|
| exp "+" exp
|
||||||
|
{ $$ = $1 ? $1 : $3; if ($1) free ($3); }
|
||||||
|
;
|
||||||
|
|
||||||
|
However, if the original actions were really intended, memory leaks
|
||||||
|
and all, the warnings can be suppressed by letting Bison believe the
|
||||||
|
values are used, e.g.:
|
||||||
|
|
||||||
|
exp: exp "?" exp ":" exp { $1 ? $1 : $3; (void) ($$, $5); }
|
||||||
|
| exp "+" exp { $$ = $1; (void) $3; }
|
||||||
|
;
|
||||||
|
|
||||||
|
If there are mid-rule actions, the warning is issued if no action
|
||||||
|
uses it. The following triggers no warning: $1 and $3 are used.
|
||||||
|
|
||||||
|
exp: exp { push ($1); } '+' exp { push ($3); sum (); };
|
||||||
|
|
||||||
|
The warning is intended to help catching lost values and memory leaks.
|
||||||
|
If a value is ignored, its associated memory typically is not reclaimed.
|
||||||
|
|
||||||
|
* %destructor vs. YYABORT, YYACCEPT, and YYERROR.
|
||||||
|
Destructors are now called when user code invokes YYABORT, YYACCEPT,
|
||||||
|
and YYERROR, for all objects on the stack, other than objects
|
||||||
|
corresponding to the right-hand side of the current rule.
|
||||||
|
|
||||||
|
* %expect, %expect-rr
|
||||||
|
Incorrect numbers of expected conflicts are now actual errors,
|
||||||
|
instead of warnings.
|
||||||
|
|
||||||
|
* GLR, YACC parsers.
|
||||||
|
The %parse-params are available in the destructors (and the
|
||||||
|
experimental printers) as per the documentation.
|
||||||
|
|
||||||
|
* Bison now warns if it finds a stray `$' or `@' in an action.
|
||||||
|
|
||||||
|
* %require "VERSION"
|
||||||
|
This specifies that the grammar file depends on features implemented
|
||||||
|
in Bison version VERSION or higher.
|
||||||
|
|
||||||
|
* lalr1.cc: The token and value types are now class members.
|
||||||
|
The tokens were defined as free form enums and cpp macros. YYSTYPE
|
||||||
|
was defined as a free form union. They are now class members:
|
||||||
|
tokens are enumerations of the `yy::parser::token' struct, and the
|
||||||
|
semantic values have the `yy::parser::semantic_type' type.
|
||||||
|
|
||||||
|
If you do not want or can update to this scheme, the directive
|
||||||
|
`%define "global_tokens_and_yystype" "1"' triggers the global
|
||||||
|
definition of tokens and YYSTYPE. This change is suitable both
|
||||||
|
for previous releases of Bison, and this one.
|
||||||
|
|
||||||
|
If you wish to update, then make sure older version of Bison will
|
||||||
|
fail using `%require "2.2"'.
|
||||||
|
|
||||||
|
* DJGPP support added.
|
||||||
|
|
||||||
|
Changes in version 2.1, 2005-09-16:
|
||||||
|
|
||||||
|
* The C++ lalr1.cc skeleton supports %lex-param.
|
||||||
|
|
||||||
|
* Bison-generated parsers now support the translation of diagnostics like
|
||||||
|
"syntax error" into languages other than English. The default
|
||||||
|
language is still English. For details, please see the new
|
||||||
|
Internationalization section of the Bison manual. Software
|
||||||
|
distributors should also see the new PACKAGING file. Thanks to
|
||||||
|
Bruno Haible for this new feature.
|
||||||
|
|
||||||
|
* Wording in the Bison-generated parsers has been changed slightly to
|
||||||
|
simplify translation. In particular, the message "memory exhausted"
|
||||||
|
has replaced "parser stack overflow", as the old message was not
|
||||||
|
always accurate for modern Bison-generated parsers.
|
||||||
|
|
||||||
|
* Destructors are now called when the parser aborts, for all symbols left
|
||||||
|
behind on the stack. Also, the start symbol is now destroyed after a
|
||||||
|
successful parse. In both cases, the behavior was formerly inconsistent.
|
||||||
|
|
||||||
|
* When generating verbose diagnostics, Bison-generated parsers no longer
|
||||||
|
quote the literal strings associated with tokens. For example, for
|
||||||
|
a syntax error associated with '%token NUM "number"' they might
|
||||||
|
print 'syntax error, unexpected number' instead of 'syntax error,
|
||||||
|
unexpected "number"'.
|
||||||
|
|
||||||
Changes in version 2.0, 2004-12-25:
|
Changes in version 2.0, 2004-12-25:
|
||||||
|
|
||||||
* Possibly-incompatible changes
|
* Possibly-incompatible changes
|
||||||
@@ -43,8 +266,7 @@ Changes in version 2.0, 2004-12-25:
|
|||||||
This is a GNU extension.
|
This is a GNU extension.
|
||||||
|
|
||||||
- The option `--report=lookahead' was changed to `--report=look-ahead'.
|
- The option `--report=lookahead' was changed to `--report=look-ahead'.
|
||||||
The old spelling still works, but is not documented and will be
|
[However, this was changed back after 2.3.]
|
||||||
removed.
|
|
||||||
|
|
||||||
- Experimental %destructor support has been added to lalr1.cc.
|
- Experimental %destructor support has been added to lalr1.cc.
|
||||||
|
|
||||||
@@ -311,8 +533,8 @@ Changes in version 1.50, 2002-10-04:
|
|||||||
produces additional information:
|
produces additional information:
|
||||||
- itemset
|
- itemset
|
||||||
complete the core item sets with their closure
|
complete the core item sets with their closure
|
||||||
- lookahead [changed to `look-ahead' in 1.875e and later]
|
- lookahead [changed to `look-ahead' in 1.875e through 2.3, but changed back]
|
||||||
explicitly associate look-ahead tokens to items
|
explicitly associate lookahead tokens to items
|
||||||
- solved
|
- solved
|
||||||
describe shift/reduce conflicts solving.
|
describe shift/reduce conflicts solving.
|
||||||
Bison used to systematically output this information on top of
|
Bison used to systematically output this information on top of
|
||||||
@@ -399,6 +621,8 @@ Changes in version 1.31, 2002-01-14:
|
|||||||
alloca is used only when compiled with GCC, to avoid portability
|
alloca is used only when compiled with GCC, to avoid portability
|
||||||
problems as on AIX.
|
problems as on AIX.
|
||||||
|
|
||||||
|
* yyparse now returns 2 if memory is exhausted; formerly it dumped core.
|
||||||
|
|
||||||
* When the generated parser lacks debugging code, YYDEBUG is now 0
|
* When the generated parser lacks debugging code, YYDEBUG is now 0
|
||||||
(as POSIX requires) instead of being undefined.
|
(as POSIX requires) instead of being undefined.
|
||||||
|
|
||||||
@@ -593,8 +817,8 @@ End:
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
||||||
Free Software Foundation, Inc.
|
2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -610,5 +834,5 @@ 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 autoconf; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA.
|
Boston, MA 02110-1301, USA.
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
Packaging hints for binary package distributors
|
||||||
|
===============================================
|
||||||
|
|
||||||
|
Although the source of the bison package comes as a single package,
|
||||||
|
in distributions of binary packages the installed files should
|
||||||
|
be split into two packages:
|
||||||
|
|
||||||
|
bison-runtime
|
||||||
|
Contents: Runtime libraries and programs.
|
||||||
|
Audience: Anyone who wants to run internationalized programs
|
||||||
|
that contain Bison-generated parsers.
|
||||||
|
|
||||||
|
bison
|
||||||
|
Contents: Tools and documentation for developers that use Bison.
|
||||||
|
Audience: Anyone who wants to develop programs that use parsers.
|
||||||
|
Dependencies: requires bison-runtime.
|
||||||
|
|
||||||
|
The 'bison-runtime' binary package is much smaller than the 'bison'
|
||||||
|
binary package. It should be included in any distribution that
|
||||||
|
contains localized programs that use the diagnostics contained in
|
||||||
|
Bison-generated parsers.
|
||||||
|
|
||||||
|
If you want to install both packages at the same time, you simply do
|
||||||
|
at the toplevel directory:
|
||||||
|
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
After installation, the file
|
||||||
|
|
||||||
|
$prefix/share/locale/*/LC_MESSAGES/bison-runtime.mo
|
||||||
|
|
||||||
|
belongs to the bison-runtime package; all other installed files belong
|
||||||
|
to the bison package.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
Bison is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
Bison is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with autoconf; see the file COPYING. If not, write to
|
||||||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02110-1301, USA.
|
||||||
@@ -3,34 +3,25 @@ This directory contains the Bison parser generator.
|
|||||||
See the file INSTALL for generic compilation and installation instructions.
|
See the file INSTALL for generic compilation and installation instructions.
|
||||||
See the file doc/FAQ for frequently asked questions.
|
See the file doc/FAQ for frequently asked questions.
|
||||||
|
|
||||||
Bison requires GNU m4 1.4 or later. Vanilla GNU m4 1.4 has some
|
Bison requires GNU m4 1.4.3 or later. See:
|
||||||
serious bugs, so we recommend using m4 1.4 as patched by the standard
|
|
||||||
GNU/Linux distributions. If you're building GNU m4 1.4 from scratch
|
|
||||||
we suggest using this version:
|
|
||||||
|
|
||||||
ftp://ftp.gnu.org/gnu/m4/m4-1.4.2.tar.gz
|
ftp://ftp.gnu.org/gnu/m4/m4-1.4.3.tar.gz
|
||||||
|
|
||||||
Older versions of Sun Forte Developer 6 update 2 have a compiler bug
|
Bison can work with pre-1.4.3 distributions of GNU m4 if they are
|
||||||
that cause "make check" to fail with a "Encounter BINCL entry"
|
sufficiently patched, but if you encounter a bug with an older
|
||||||
diagnostic. To fix the bug, update to the latest set of Solaris and
|
distribution and report a bug we will probably suggest that you
|
||||||
Forte patches recommended by Sun.
|
upgrade to 1.4.3 as the first step in trying to fix it.
|
||||||
|
|
||||||
VMS and MS-DOS builds are probably broken right now. If you are able
|
Please send bug reports to <[email protected]>. Please include the
|
||||||
to build Bison on either platform and you need to make changes to do
|
version number from `bison --version', and a complete, self-contained
|
||||||
so, please submit those changes as a bug report. On VMS, you will
|
test case in each bug report.
|
||||||
probably have to create Makefile from Makefile.in by hand. Remember
|
|
||||||
to do `SET COMMAND BISON' to install the data in `BISON.CLD'.
|
|
||||||
|
|
||||||
Send bug reports to <[email protected]>. Please include the version
|
If you have questions about using Bison and the documentation does
|
||||||
number from `bison --version', and a complete, self-contained test
|
not answer them, please send mail to <[email protected]>.
|
||||||
case in each bug report.
|
|
||||||
|
|
||||||
If you have questions about using Bison which the documentation does
|
|
||||||
not answer, send mail to <[email protected]>.
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1992, 1998, 1999, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -46,5 +37,5 @@ 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 autoconf; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA.
|
Boston, MA 02110-1301, USA.
|
||||||
|
|||||||
+2
-2
@@ -28,5 +28,5 @@ 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 Bison; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA.
|
Boston, MA 02110-1301, USA.
|
||||||
|
|||||||
+24
-30
@@ -9,14 +9,28 @@ Only the sources are installed in the CVS repository (to ease the
|
|||||||
maintenance, merges etc.), therefore you will have to get the latest
|
maintenance, merges etc.), therefore you will have to get the latest
|
||||||
stable versions of the maintainer tools we depend upon, including:
|
stable versions of the maintainer tools we depend upon, including:
|
||||||
|
|
||||||
- Automake
|
- Automake <http://www.gnu.org/software/automake/>
|
||||||
- Autoconf
|
- Autoconf <http://www.gnu.org/software/autoconf/>
|
||||||
- Flex
|
- Flex <http://www.gnu.org/software/flex/>
|
||||||
- Gettext
|
- Gettext <http://www.gnu.org/software/gettext/>
|
||||||
- CVS Bison itself
|
- 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,
|
Only building the initial full source tree will be a bit painful,
|
||||||
later, a plain `cvs update -P & make' should be sufficient.
|
later, a plain `cvs update -P && make' should be sufficient.
|
||||||
|
|
||||||
* First CVS checkout
|
* First CVS checkout
|
||||||
|
|
||||||
@@ -39,33 +53,13 @@ and the CVS master copy:
|
|||||||
|
|
||||||
$ cvs diff
|
$ cvs diff
|
||||||
|
|
||||||
should output no difference, except maybe the date in po/*.po files.
|
should output no difference.
|
||||||
|
|
||||||
Enjoy!
|
Enjoy!
|
||||||
|
|
||||||
* Troubleshooting
|
|
||||||
|
|
||||||
Unfortunately the current Gettext still does not include all the
|
|
||||||
needed tools so that the bootstrapping always perform successfully.
|
|
||||||
|
|
||||||
If you experience problems, I suggest the following:
|
|
||||||
|
|
||||||
1. Do a regular CVS checkout
|
|
||||||
|
|
||||||
2. Fetch a recent tarball in:
|
|
||||||
ftp://alpha.gnu.org/gnu/bison/
|
|
||||||
|
|
||||||
3. Extract it
|
|
||||||
|
|
||||||
4. Override the content of your checkout with the content of this
|
|
||||||
tarball, i.e.:
|
|
||||||
cp -r bison-1.875c/* bison-cvs
|
|
||||||
|
|
||||||
5. Proceed on ./configure && make etc.
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
@@ -81,5 +75,5 @@ 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 Bison; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA.
|
Boston, MA 02110-1301, USA.
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ kludges that Johnson had to perpetrate to make Yacc fit in a PDP-11.
|
|||||||
Also, Bison uses a faster but less space-efficient encoding for the
|
Also, Bison uses a faster but less space-efficient encoding for the
|
||||||
parse tables (see Corbett's PhD thesis from Berkeley, "Static
|
parse tables (see Corbett's PhD thesis from Berkeley, "Static
|
||||||
Semantics in Compiler Error Recovery", June 1985, Report No. UCB/CSD
|
Semantics in Compiler Error Recovery", June 1985, Report No. UCB/CSD
|
||||||
85/251), and more modern technique for generating the look-ahead sets.
|
85/251), and more modern technique for generating the lookahead sets.
|
||||||
(See Frank DeRemer and Thomas Pennello, "Efficient Computation of
|
(See Frank DeRemer and Thomas Pennello, "Efficient Computation of
|
||||||
LALR(1) Look-Ahead Sets", ACM Transactions on Programming Languages
|
LALR(1) Look-Ahead Sets", ACM Transactions on Programming Languages
|
||||||
and Systems (TOPLAS) 4, 4 (October 1982), 615-649. Their
|
and Systems (TOPLAS) 4, 4 (October 1982), 615-649. Their
|
||||||
|
|||||||
@@ -12,24 +12,31 @@ They should not: it is not documented. But if they need to, let's
|
|||||||
find something clean (not like YYLSP_NEEDED...).
|
find something clean (not like YYLSP_NEEDED...).
|
||||||
|
|
||||||
|
|
||||||
* URGENT: Documenting C++ output
|
* Installation
|
||||||
Write a first documentation for C++ output.
|
|
||||||
|
|
||||||
|
** Disable installation of yacc.
|
||||||
|
|
||||||
|
Add an option to 'configure' that allows people to install Bison
|
||||||
|
without installing the yacc wrapper script or the rarely-used little
|
||||||
|
yacc library required by Posix. This is for people who prefer some
|
||||||
|
other implementation of yacc.
|
||||||
|
|
||||||
* Documentation
|
* Documentation
|
||||||
Before releasing, make sure the documentation ("Understanding your
|
Before releasing, make sure the documentation ("Understanding your
|
||||||
parser") refers to the current `output' format.
|
parser") refers to the current `output' format.
|
||||||
|
|
||||||
|
* lalr1.cc
|
||||||
|
** vector
|
||||||
|
Move to using vector, drop stack.hh.
|
||||||
|
|
||||||
* GLR & C++
|
** I18n
|
||||||
Currently, the GLR parser cannot compile with a C++ compiler.
|
Catch up with yacc.c.
|
||||||
|
|
||||||
|
|
||||||
* Report
|
* Report
|
||||||
|
|
||||||
** GLR
|
** GLR
|
||||||
How would Paul like to display the conflicted actions? In particular,
|
How would Paul like to display the conflicted actions? In particular,
|
||||||
what when two reductions are possible on a given look-ahead token, but one is
|
what when two reductions are possible on a given lookahead token, but one is
|
||||||
part of $default. Should we make the two reductions explicit, or just
|
part of $default. Should we make the two reductions explicit, or just
|
||||||
keep $default? See the following point.
|
keep $default? See the following point.
|
||||||
|
|
||||||
@@ -52,14 +59,7 @@ DeRemer and Penello: they already provide the algorithm.
|
|||||||
|
|
||||||
* Extensions
|
* Extensions
|
||||||
|
|
||||||
** %destructor
|
** Labeling the symbols
|
||||||
I think we should document it as experimental, and allow its use in
|
|
||||||
the next releases. But we also need to port it to GLR. What about
|
|
||||||
lalr1.cc? Well, read what Hans reported, maybe we don't want
|
|
||||||
%detructor. On the other hand, there is no reason not to provide it:
|
|
||||||
users can avoid its use.
|
|
||||||
|
|
||||||
** $foo
|
|
||||||
Have a look at the Lemon parser generator: instead of $1, $2 etc. they
|
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:
|
can name the values. This is much more pleasant. For instance:
|
||||||
|
|
||||||
@@ -69,6 +69,21 @@ 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
|
symbol, and forgetting to shift all the $n to $n-1. If you are
|
||||||
unlucky, it compiles...
|
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
|
||||||
@@ -81,32 +96,6 @@ we should be able to have:
|
|||||||
|
|
||||||
Or something like this.
|
Or something like this.
|
||||||
|
|
||||||
** yysymprint interface
|
|
||||||
It should be improved, in particular when using Bison features such as
|
|
||||||
locations, and YYPARSE_PARAMS. For the time being, it is almost
|
|
||||||
recommended to yyprint to steal internal variables...
|
|
||||||
|
|
||||||
** Several %unions
|
|
||||||
I think this is a pleasant (but useless currently) feature, but in the
|
|
||||||
future, I want a means to %include other bits of grammars, and _then_
|
|
||||||
it will be important for the various bits to define their needs in
|
|
||||||
%union.
|
|
||||||
|
|
||||||
When implementing multiple-%union support, bare the following in mind:
|
|
||||||
|
|
||||||
- when --yacc, this must be flagged as an error. Don't make it fatal
|
|
||||||
though.
|
|
||||||
|
|
||||||
- The #line must now appear *inside* the definition of yystype.
|
|
||||||
Something like
|
|
||||||
|
|
||||||
{
|
|
||||||
#line 12 "foo.y"
|
|
||||||
int ival;
|
|
||||||
#line 23 "foo.y"
|
|
||||||
char *sval;
|
|
||||||
}
|
|
||||||
|
|
||||||
** %if and the like
|
** %if and the like
|
||||||
It should be possible to have %if/%else/%endif. The implementation is
|
It should be possible to have %if/%else/%endif. The implementation is
|
||||||
not clear: should it be lexical or syntactic. Vadim Maslow thinks it
|
not clear: should it be lexical or syntactic. Vadim Maslow thinks it
|
||||||
@@ -192,31 +181,21 @@ Paul notes:
|
|||||||
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
|
||||||
|
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
||||||
|
the source code. This should get fixed.
|
||||||
|
|
||||||
* --graph
|
* --graph
|
||||||
Show reductions. []
|
Show reductions.
|
||||||
|
|
||||||
* Broken options ?
|
* Broken options ?
|
||||||
** %no-parser []
|
** %no-parser
|
||||||
** %token-table []
|
** %token-table
|
||||||
** Skeleton strategy. []
|
** Skeleton strategy
|
||||||
Must we keep %no-parser?
|
Must we keep %no-parser? %token-table?
|
||||||
%token-table?
|
|
||||||
|
|
||||||
* src/print_graph.c
|
* src/print_graph.c
|
||||||
Find the best graph parameters. []
|
Find the best graph parameters.
|
||||||
|
|
||||||
* doc/bison.texinfo
|
|
||||||
** Update
|
|
||||||
informations about ERROR_VERBOSE. []
|
|
||||||
** Add explanations about
|
|
||||||
skeleton muscles. []
|
|
||||||
%skeleton. []
|
|
||||||
|
|
||||||
* testsuite
|
|
||||||
** tests/pure-parser.at []
|
|
||||||
New tests.
|
|
||||||
|
|
||||||
* BTYacc
|
* BTYacc
|
||||||
See if we can integrate backtracking in Bison. Charles-Henri de
|
See if we can integrate backtracking in Bison. Charles-Henri de
|
||||||
@@ -337,21 +316,22 @@ the parser with a means to create the (visual) parse tree.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
GNU Bison is free software; you can redistribute it and/or modify
|
Bison 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 2, or (at your option)
|
||||||
any later version.
|
any later version.
|
||||||
|
|
||||||
GNU Bison is distributed in the hope that it will be useful,
|
Bison 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 Bison; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA.
|
Boston, MA 02110-1301, USA.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Bootstrap this package from CVS.
|
# Bootstrap this package from CVS.
|
||||||
|
|
||||||
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,15 +16,18 @@
|
|||||||
|
|
||||||
# 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, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
# 02111-1307, USA.
|
# 02110-1301, USA.
|
||||||
|
|
||||||
# Written by Paul Eggert.
|
# Written by Paul Eggert.
|
||||||
|
|
||||||
package=bison
|
package=bison
|
||||||
|
|
||||||
# Ensure file names are sorted consistently across platforms;
|
# Translation Project URL, for the registry of all projects.
|
||||||
# e.g., m4/ulonglong_gl.m4 should follow m4/ulonglong.m4.
|
TP_URL='http://www.iro.umontreal.ca/translation/registry.cgi?domain='
|
||||||
|
|
||||||
|
# Ensure file names are sorted consistently across platforms.
|
||||||
|
# Also, ensure diagnostics are in English, e.g., "wget --help" below.
|
||||||
LC_ALL=C
|
LC_ALL=C
|
||||||
export LC_ALL
|
export LC_ALL
|
||||||
|
|
||||||
@@ -50,11 +53,10 @@ done
|
|||||||
|
|
||||||
echo "$0: Bootstrapping CVS $package..."
|
echo "$0: Bootstrapping CVS $package..."
|
||||||
|
|
||||||
build_cvs_prefix() {
|
cleanup_gnulib() {
|
||||||
CVS_PREFIX=:${1}:
|
status=$?
|
||||||
if [ "${2}" != - ]; then
|
rm -fr gnulib
|
||||||
CVS_PREFIX=${CVS_PREFIX}${2}@
|
exit $status
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get gnulib files.
|
# Get gnulib files.
|
||||||
@@ -64,12 +66,9 @@ case ${GNULIB_SRCDIR--} in
|
|||||||
if [ ! -d gnulib ]; then
|
if [ ! -d gnulib ]; then
|
||||||
echo "$0: getting gnulib files..."
|
echo "$0: getting gnulib files..."
|
||||||
|
|
||||||
trap exit 1 2 13 15
|
case ${CVS_AUTH-pserver} in
|
||||||
trap 'rm -fr gnulib; exit 1' 0
|
pserver)
|
||||||
|
CVS_PREFIX=':pserver:anonymous@';;
|
||||||
case ${CVS_AUTH-anoncvs} in
|
|
||||||
anoncvs)
|
|
||||||
CVS_PREFIX='anoncvs@';;
|
|
||||||
ssh)
|
ssh)
|
||||||
CVS_PREFIX="$CVS_USER${CVS_USER+@}";;
|
CVS_PREFIX="$CVS_USER${CVS_USER+@}";;
|
||||||
*)
|
*)
|
||||||
@@ -81,23 +80,27 @@ case ${GNULIB_SRCDIR--} in
|
|||||||
'') export CVS_RSH=ssh;;
|
'') export CVS_RSH=ssh;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cvs -z3 -q -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib co gnulib || exit
|
trap cleanup_gnulib 1 2 13 15
|
||||||
|
|
||||||
trap 0
|
cvs -z3 -q -d ${CVS_PREFIX}cvs.savannah.gnu.org:/cvsroot/gnulib co gnulib ||
|
||||||
|
cleanup_gnulib
|
||||||
|
|
||||||
|
trap - 1 2 13 15
|
||||||
fi
|
fi
|
||||||
GNULIB_SRCDIR=gnulib
|
GNULIB_SRCDIR=gnulib
|
||||||
esac
|
esac
|
||||||
|
|
||||||
<$GNULIB_SRCDIR/gnulib-tool || exit
|
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||||
|
<$gnulib_tool || exit
|
||||||
|
|
||||||
gnulib_modules='
|
gnulib_modules='
|
||||||
alloca
|
|
||||||
argmatch
|
argmatch
|
||||||
dirname
|
dirname
|
||||||
error
|
error
|
||||||
extensions
|
extensions
|
||||||
|
fopen-safer
|
||||||
getopt
|
getopt
|
||||||
hard-locale
|
gettext
|
||||||
hash
|
hash
|
||||||
malloc
|
malloc
|
||||||
mbswidth
|
mbswidth
|
||||||
@@ -105,7 +108,14 @@ obstack
|
|||||||
quote
|
quote
|
||||||
quotearg
|
quotearg
|
||||||
stdbool
|
stdbool
|
||||||
|
stdint
|
||||||
stpcpy
|
stpcpy
|
||||||
|
strerror
|
||||||
|
strtoul
|
||||||
|
strverscmp
|
||||||
|
unistd-safer
|
||||||
|
unlocked-io
|
||||||
|
verify
|
||||||
xalloc
|
xalloc
|
||||||
xalloc-die
|
xalloc-die
|
||||||
xstrndup
|
xstrndup
|
||||||
@@ -117,14 +127,15 @@ while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
|
|||||||
gnulib_modules=`
|
gnulib_modules=`
|
||||||
(echo "$gnulib_modules"
|
(echo "$gnulib_modules"
|
||||||
for gnulib_module in $gnulib_modules; do
|
for gnulib_module in $gnulib_modules; do
|
||||||
$GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
|
$gnulib_tool --extract-dependencies $gnulib_module
|
||||||
done) | sort -u
|
done) | sort -u
|
||||||
`
|
`
|
||||||
done
|
done
|
||||||
|
|
||||||
gnulib_files=`
|
gnulib_files=`
|
||||||
(for gnulib_module in $gnulib_modules; do
|
(echo m4/warning.m4
|
||||||
$GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
|
for gnulib_module in $gnulib_modules; do
|
||||||
|
$gnulib_tool --extract-filelist $gnulib_module
|
||||||
done) | sort -u
|
done) | sort -u
|
||||||
`
|
`
|
||||||
|
|
||||||
@@ -133,41 +144,77 @@ mkdir -p $gnulib_dirs || exit
|
|||||||
|
|
||||||
for gnulib_file in $gnulib_files; do
|
for gnulib_file in $gnulib_files; do
|
||||||
dest=$gnulib_file
|
dest=$gnulib_file
|
||||||
|
|
||||||
case $gnulib_file in
|
|
||||||
m4/onceonly_2_57.m4) dest=m4/onceonly.m4;;
|
|
||||||
# These will be overwritten by autopoint, which still uses
|
|
||||||
# old jm_.* macro names, so we have to keep both copies.
|
|
||||||
# m4/gettext.m4 isn't mentioned here, since it's patched below.
|
|
||||||
m4/glibc21.m4 | m4/inttypes_h.m4 | m4/lib-ld.m4 | \
|
|
||||||
m4/lib-prefix.m4 | m4/po.m4 | m4/stdint_h.m4 | m4/uintmax_t.m4 | \
|
|
||||||
m4/ulonglong.m4)
|
|
||||||
dest=`expr $gnulib_file : '\(.*\).m4'`_gl.m4;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
rm -f $dest &&
|
rm -f $dest &&
|
||||||
echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
|
echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
|
||||||
cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
|
cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
|
# This suppresses a bogus diagnostic
|
||||||
|
# "warning: macro `AM_LANGINFO_CODESET' not found in library".
|
||||||
|
echo "$0: patching m4/gettext.m4 to remove need for intl/* ..."
|
||||||
sed '
|
sed '
|
||||||
/^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
|
/^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
|
||||||
AC_DEFUN([AM_INTL_SUBDIR], [])
|
AC_DEFUN([AM_INTL_SUBDIR], [])
|
||||||
|
/^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\
|
||||||
|
AC_DEFUN([gt_INTL_SUBDIR_CORE], [])
|
||||||
' m4/gettext.m4 >m4/gettext_gl.m4 || exit
|
' m4/gettext.m4 >m4/gettext_gl.m4 || exit
|
||||||
|
|
||||||
|
|
||||||
# Get translations.
|
# Get translations.
|
||||||
|
|
||||||
|
get_translations() {
|
||||||
|
subdir=$1
|
||||||
|
domain=$2
|
||||||
|
|
||||||
|
echo "$0: getting translations into $subdir for $domain..."
|
||||||
|
(cd $subdir && rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'`) &&
|
||||||
|
|
||||||
|
$WGET_COMMAND -O "$subdir/$domain.html" "$TP_URL$domain" &&
|
||||||
|
|
||||||
|
sed -n 's|.*"http://[^"]*/translation/teams/PO/\([^/"]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\1.\2|p' <"$subdir/$domain.html" |
|
||||||
|
sort -k 1,1 -k 2,2n -k2,2 -k3,3n -k3,3 -k4,4n -k4,4 -k5,5n -k5.5 |
|
||||||
|
awk -F. '
|
||||||
|
{ if (lang && $1 != lang) print lang, ver }
|
||||||
|
{ lang = $1; ver = substr($0, index($0, ".") + 1) }
|
||||||
|
END { if (lang) print lang, ver }
|
||||||
|
' | awk -v domain="$domain" -v subdir="$subdir" '
|
||||||
|
{
|
||||||
|
lang = $1
|
||||||
|
|
||||||
|
# Work around bugs in Bison 2.3 translations uncovered by gettext 0.15.
|
||||||
|
# This workaround can be removed once the translations are fixed.
|
||||||
|
if (lang == "id" || lang == "tr") next
|
||||||
|
|
||||||
|
ver = $2
|
||||||
|
urlfmt = ""
|
||||||
|
printf "$WGET_COMMAND -O %s/%s.po 'http://www.iro.umontreal.ca/translation/teams/PO/%s/%s-%s.%s.po' &&\n", subdir, lang, lang, domain, ver, lang
|
||||||
|
}
|
||||||
|
END { print ":" }
|
||||||
|
' | sh &&
|
||||||
|
ls "$subdir"/*.po | sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" &&
|
||||||
|
rm "$subdir/$domain.html"
|
||||||
|
}
|
||||||
|
|
||||||
case $SKIP_PO in
|
case $SKIP_PO in
|
||||||
'')
|
'')
|
||||||
echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
|
case `wget --help` in
|
||||||
(cd po &&
|
*'--no-cache'*)
|
||||||
rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'` &&
|
no_cache='--no-cache';;
|
||||||
wget -nv -nd -r -l 1 -A .po -C off \
|
*'--cache=on/off'*)
|
||||||
http://www2.iro.umontreal.ca/~gnutra/po/maint/$package/ &&
|
no_cache='--cache=off';;
|
||||||
ls *.po | sed 's/\.po$//' >LINGUAS
|
*)
|
||||||
) || exit;;
|
no_cache='';;
|
||||||
|
esac
|
||||||
|
|
||||||
|
WGET_COMMAND="wget -nv $no_cache"
|
||||||
|
export WGET_COMMAND
|
||||||
|
|
||||||
|
get_translations po $package || exit
|
||||||
|
|
||||||
|
case $package in
|
||||||
|
bison)
|
||||||
|
get_translations runtime-po $package-runtime || exit
|
||||||
|
esac;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
@@ -175,69 +222,95 @@ esac
|
|||||||
|
|
||||||
(echo '# This file is generated automatically by "bootstrap".' &&
|
(echo '# This file is generated automatically by "bootstrap".' &&
|
||||||
echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
|
echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
|
||||||
$GNULIB_SRCDIR/gnulib-tool --extract-autoconf-snippet $gnulib_modules &&
|
$gnulib_tool --extract-autoconf-snippet $gnulib_modules |
|
||||||
|
sed 's/AM_GNU_GETTEXT(\[external]/&, [need-ngettext]/' &&
|
||||||
echo '])'
|
echo '])'
|
||||||
) >m4/gnulib.m4 || exit
|
) >m4/gnulib.m4 || exit
|
||||||
|
|
||||||
(echo '# This file is generated automatically by "bootstrap".' &&
|
(echo '# This file is generated automatically by "bootstrap".' &&
|
||||||
$GNULIB_SRCDIR/gnulib-tool --extract-automake-snippet $gnulib_modules
|
$gnulib_tool --extract-automake-snippet $gnulib_modules |
|
||||||
|
sed 's/^[ ]*AM_CPPFLAGS[ ]*+=/# (commented out by bootstrap) &/'
|
||||||
) >lib/gnulib.mk || exit
|
) >lib/gnulib.mk || exit
|
||||||
|
|
||||||
|
|
||||||
# Reconfigure, getting other files.
|
# Reconfigure, getting other files.
|
||||||
|
|
||||||
echo "$0: autoreconf --verbose --install --force ..."
|
echo "$0: autopoint --force ..."
|
||||||
autoreconf --verbose --install --force || exit
|
autopoint --force || exit
|
||||||
|
|
||||||
|
|
||||||
# We don't need intl, so remove it.
|
# We don't need intl, so remove it.
|
||||||
# Remove aclocal.m4 too, so that it gets rebuilt.
|
|
||||||
intl_files_to_remove='
|
intl_files_to_remove='
|
||||||
aclocal.m4
|
|
||||||
intl
|
intl
|
||||||
m4/codeset.m4
|
m4/codeset.m4
|
||||||
m4/gettext.m4
|
m4/gettext.m4
|
||||||
|
m4/glibc2.m4
|
||||||
m4/glibc21.m4
|
m4/glibc21.m4
|
||||||
m4/intdiv0.m4
|
m4/intdiv0.m4
|
||||||
m4/intmax.m4
|
m4/intmax.m4
|
||||||
m4/inttypes_h.m4
|
m4/inttypes-h.m4
|
||||||
m4/inttypes.m4
|
|
||||||
m4/inttypes-pri.m4
|
m4/inttypes-pri.m4
|
||||||
m4/isc-posix.m4
|
|
||||||
m4/lcmessage.m4
|
m4/lcmessage.m4
|
||||||
m4/lib-ld.m4
|
m4/lock.m4
|
||||||
m4/lib-prefix.m4
|
|
||||||
m4/longdouble.m4
|
m4/longdouble.m4
|
||||||
m4/longlong.m4
|
|
||||||
m4/po.m4
|
|
||||||
m4/printf-posix.m4
|
m4/printf-posix.m4
|
||||||
m4/signed.m4
|
m4/signed.m4
|
||||||
m4/size_max.m4
|
m4/size_max.m4
|
||||||
m4/stdint_h.m4
|
m4/visibility.m4
|
||||||
m4/uintmax_t.m4
|
|
||||||
m4/ulonglong.m4
|
|
||||||
m4/wchar_t.m4
|
|
||||||
m4/wint_t.m4
|
m4/wint_t.m4
|
||||||
m4/xsize.m4
|
m4/xsize.m4
|
||||||
'
|
'
|
||||||
echo $0: rm -fr $intl_files_to_remove ...
|
echo $0: rm -fr $intl_files_to_remove ...
|
||||||
rm -fr $intl_files_to_remove || exit
|
rm -fr $intl_files_to_remove || exit
|
||||||
|
|
||||||
# Patch what appears to be a bug in gettext 0.14.1;
|
|
||||||
# remove this once the bug is fixed.
|
# Undo changes to gnulib files that autoreconf made.
|
||||||
grep @top_builddir@ po/Makefile.in.in >/dev/null || {
|
for gnulib_file in $gnulib_files; do
|
||||||
echo "$0: prepending 'top_builddir=@top_builddir@' to po/Makefile.in.in ... "
|
test ! -f $gnulib_file || cmp -s $gnulib_file $GNULIB_SRCDIR/$gnulib_file || {
|
||||||
old_contents=`cat po/Makefile.in.in` || exit
|
rm -f $gnulib_file &&
|
||||||
cat >po/Makefile.in.in <<EOF
|
echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file again" &&
|
||||||
top_builddir=@top_builddir@
|
cp -p $GNULIB_SRCDIR/$gnulib_file $gnulib_file || exit
|
||||||
$old_contents
|
}
|
||||||
EOF
|
done
|
||||||
}
|
|
||||||
|
# Make sure aclocal.m4 is not older than input files.
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
for command in \
|
||||||
|
'aclocal --force -I m4' \
|
||||||
|
'autoconf --force' \
|
||||||
|
'autoheader --force' \
|
||||||
|
'automake --add-missing --copy --force-missing';
|
||||||
|
do
|
||||||
|
echo "$0: $command ..."
|
||||||
|
$command || exit
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Put bug-reporting address into po/Makevars.
|
# Put bug-reporting address into po/Makevars.
|
||||||
echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= [email protected]/' po/Makevars.template >po/Makevars ..."
|
echo "$0: Creating po/Makevars from po/Makevars.template ..."
|
||||||
sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= [email protected]/' po/Makevars.template >po/Makevars
|
sed '
|
||||||
|
/^MSGID_BUGS_ADDRESS *=/s/=.*/= [email protected]/
|
||||||
|
/^XGETTEXT_OPTIONS *=/{
|
||||||
|
s/$/ \\/
|
||||||
|
a\
|
||||||
|
--flag=_:1:pass-c-format \\\
|
||||||
|
--flag=N_:1:pass-c-format \\\
|
||||||
|
--flag=error:3:c-format --flag=error_at_line:5:c-format \\\
|
||||||
|
--flag=warn:1:c-format --flag=warn_at:2:c-format \\\
|
||||||
|
--flag=complain:1:c-format --flag=complain_at:2:c-format \\\
|
||||||
|
--flag=fatal:1:c-format --flag=fatal_at:2:c-format
|
||||||
|
}
|
||||||
|
' po/Makevars.template >po/Makevars
|
||||||
|
|
||||||
|
# Likewise for runtime-po/Makevars, except also change a few other parameters.
|
||||||
|
sed '
|
||||||
|
s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
|
||||||
|
s/^\(subdir\) *=.*/\1 = runtime-po/
|
||||||
|
s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
|
||||||
|
' <po/Makevars >runtime-po/Makevars
|
||||||
|
|
||||||
|
# Copy identical files from po to runtime-po.
|
||||||
|
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||||
|
|
||||||
# if src/parse-gram.[ch] are out of date, rebuild them.
|
# if src/parse-gram.[ch] are out of date, rebuild them.
|
||||||
parse_gram_y=`find src/parse-gram.y \
|
parse_gram_y=`find src/parse-gram.y \
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
EXTRA_DIST = move-if-change prev-version.txt config.rpath
|
EXTRA_DIST = prev-version.txt
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
2.0
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Like mv $1 $2, but if the files are the same, just delete $1.
|
|
||||||
# Status is 0 if $2 is changed, 1 otherwise.
|
|
||||||
if
|
|
||||||
test -r $2
|
|
||||||
then
|
|
||||||
if
|
|
||||||
cmp -s $1 $2
|
|
||||||
then
|
|
||||||
echo $2 is unchanged
|
|
||||||
rm -f $1
|
|
||||||
else
|
|
||||||
mv -f $1 $2
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
mv -f $1 $2
|
|
||||||
fi
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
1.75
|
|
||||||
+37
-31
@@ -1,6 +1,7 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -14,17 +15,14 @@
|
|||||||
#
|
#
|
||||||
# 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, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
# 02111-1307 USA
|
# 02110-1301 USA
|
||||||
|
|
||||||
# This file uses AC_CONFIG_MACRO_DIR, so we need Autoconf 2.58 or better.
|
# We use macros like AC_CHECK_HEADERS_ONCE, so we need Autoconf 2.60 or better.
|
||||||
# But Autoconf 2.58 has a bug in the way that it generates tests: it
|
AC_PREREQ(2.60)
|
||||||
# puts the wrong absolute path names in the tests. So we need at
|
|
||||||
# least Autoconf 2.59.
|
|
||||||
AC_PREREQ(2.59)
|
|
||||||
|
|
||||||
AC_INIT([GNU Bison], [2.0], [[email protected]])
|
AC_INIT([GNU Bison], [2.3a], [[email protected]])
|
||||||
AC_CONFIG_AUX_DIR([config])
|
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.
|
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
||||||
@@ -44,26 +42,28 @@ AC_ARG_ENABLE(gcc-warnings,
|
|||||||
esac],
|
esac],
|
||||||
[enableval=no])
|
[enableval=no])
|
||||||
if test "${enableval}" = yes; then
|
if test "${enableval}" = yes; then
|
||||||
BISON_WARNING(-Werror)
|
gl_WARNING_CFLAGS([-Werror])
|
||||||
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
||||||
WARNING_CFLAGS=
|
WARNING_CFLAGS=
|
||||||
BISON_WARNING(-W)
|
gl_WARNING_CFLAGS([-Wextra -Wno-sign-compare])
|
||||||
BISON_WARNING(-Wall)
|
gl_WARNING_CFLAGS([-Wall])
|
||||||
BISON_WARNING(-Wcast-align)
|
gl_WARNING_CFLAGS([-Wcast-align])
|
||||||
BISON_WARNING(-Wcast-qual)
|
gl_WARNING_CFLAGS([-Wcast-qual])
|
||||||
BISON_WARNING(-Wformat)
|
gl_WARNING_CFLAGS([-Wformat])
|
||||||
BISON_WARNING(-Wwrite-strings)
|
gl_WARNING_CFLAGS([-Wpointer-arith])
|
||||||
|
gl_WARNING_CFLAGS([-Wwrite-strings])
|
||||||
AC_SUBST([WARNING_CXXFLAGS], [$WARNING_CFLAGS])
|
AC_SUBST([WARNING_CXXFLAGS], [$WARNING_CFLAGS])
|
||||||
# The following warnings are not suitable for C++.
|
# The following warnings are not suitable for C++.
|
||||||
BISON_WARNING(-Wbad-function-cast)
|
gl_WARNING_CFLAGS([-Wbad-function-cast])
|
||||||
BISON_WARNING(-Wmissing-declarations)
|
gl_WARNING_CFLAGS([-Wmissing-declarations])
|
||||||
BISON_WARNING(-Wmissing-prototypes)
|
gl_WARNING_CFLAGS([-Wmissing-prototypes])
|
||||||
BISON_WARNING(-Wnested-externs)
|
gl_WARNING_CFLAGS([-Wshadow])
|
||||||
BISON_WARNING(-Wshadow)
|
gl_WARNING_CFLAGS([-Wstrict-prototypes])
|
||||||
BISON_WARNING(-Wstrict-prototypes)
|
|
||||||
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
BISON_TEST_FOR_WORKING_C_COMPILER
|
||||||
|
|
||||||
AC_ARG_ENABLE([yacc],
|
AC_ARG_ENABLE([yacc],
|
||||||
[AC_HELP_STRING([--disable-yacc],
|
[AC_HELP_STRING([--disable-yacc],
|
||||||
[do not build a yacc command or an -ly library])],
|
[do not build a yacc command or an -ly library])],
|
||||||
@@ -96,9 +96,6 @@ AM_STDBOOL_H
|
|||||||
# Checks for compiler characteristics.
|
# Checks for compiler characteristics.
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
|
|
||||||
# Checks for types.
|
|
||||||
AC_CHECK_TYPES([uintptr_t])
|
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||||
AM_WITH_DMALLOC
|
AM_WITH_DMALLOC
|
||||||
@@ -107,8 +104,15 @@ BISON_PREREQ_TIMEVAR
|
|||||||
|
|
||||||
# gnulib and gettext.
|
# gnulib and gettext.
|
||||||
GNULIB_AUTOCONF_SNIPPET
|
GNULIB_AUTOCONF_SNIPPET
|
||||||
# We use po/Makevars.template, so we need at least gettext 0.12.
|
# We've never tested with gettext versions before 0.15, so play it safe.
|
||||||
AM_GNU_GETTEXT_VERSION([0.12])
|
AM_GNU_GETTEXT_VERSION([0.15])
|
||||||
|
BISON_I18N
|
||||||
|
|
||||||
|
# Internationalized parsers.
|
||||||
|
AC_CONFIG_FILES([runtime-po/Makefile.in])
|
||||||
|
# Autoconf macros for packages using internationalized parsers.
|
||||||
|
aclocaldir='${datadir}/aclocal'
|
||||||
|
AC_SUBST([aclocaldir])
|
||||||
|
|
||||||
# Initialize the test suite.
|
# Initialize the test suite.
|
||||||
AC_CONFIG_TESTDIR(tests)
|
AC_CONFIG_TESTDIR(tests)
|
||||||
@@ -120,14 +124,16 @@ BISON_TEST_FOR_WORKING_CXX_COMPILER
|
|||||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||||
# Needed by tests/atlocal.in.
|
# Needed by tests/atlocal.in.
|
||||||
AC_SUBST([GCC])
|
AC_SUBST([GCC])
|
||||||
O0CFLAGS=`echo $CFLAGS | sed 's/-O[0-9] *//'`
|
O0CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]] *//'`
|
||||||
AC_SUBST([O0CFLAGS])
|
AC_SUBST([O0CFLAGS])
|
||||||
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[0-9] *//'`
|
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`
|
||||||
AC_SUBST([O0CXXFLAGS])
|
AC_SUBST([O0CXXFLAGS])
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
config/Makefile
|
build-aux/Makefile
|
||||||
po/Makefile.in
|
po/Makefile.in
|
||||||
data/Makefile
|
data/Makefile
|
||||||
|
examples/Makefile
|
||||||
|
examples/calc++/Makefile
|
||||||
lib/Makefile src/Makefile doc/Makefile])
|
lib/Makefile src/Makefile doc/Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
+6
-4
@@ -1,4 +1,4 @@
|
|||||||
## Copyright (C) 2002 Free Software Foundation, Inc.
|
## Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
## This program is free software; you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
## it under the terms of the GNU General Public License as published by
|
||||||
@@ -12,10 +12,12 @@
|
|||||||
|
|
||||||
## 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, write to the Free Software
|
||||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
## 02111-1307 USA
|
## 02110-1301 USA
|
||||||
|
|
||||||
dist_pkgdata_DATA = README c.m4 yacc.c lalr1.cc glr.c
|
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
|
||||||
|
|||||||
+2
-2
@@ -41,5 +41,5 @@ 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 Bison; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA.
|
Boston, MA 02110-1301, USA.
|
||||||
|
|||||||
+124
@@ -0,0 +1,124 @@
|
|||||||
|
m4_divert(-1) -*- Autoconf -*-
|
||||||
|
|
||||||
|
# C++ 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
|
||||||
|
# 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
|
||||||
|
|
||||||
|
m4_include(b4_pkgdatadir/[c.m4])
|
||||||
|
|
||||||
|
## ---------------- ##
|
||||||
|
## Default values. ##
|
||||||
|
## ---------------- ##
|
||||||
|
|
||||||
|
# Default parser class name.
|
||||||
|
m4_define_default([b4_parser_class_name], [parser])
|
||||||
|
m4_define_default([b4_location_type], [location])
|
||||||
|
m4_define_default([b4_filename_type], [std::string])
|
||||||
|
m4_define_default([b4_namespace], m4_defn([b4_prefix]))
|
||||||
|
m4_define_default([b4_define_location_comparison],
|
||||||
|
m4_if(b4_filename_type, [std::string], [1], [0]))
|
||||||
|
|
||||||
|
|
||||||
|
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
|
# -----------------------------------------------------
|
||||||
|
# Output the definition of the tokens as enums.
|
||||||
|
m4_define([b4_token_enums],
|
||||||
|
[/* Tokens. */
|
||||||
|
enum yytokentype {
|
||||||
|
m4_map_sep([ b4_token_enum], [,
|
||||||
|
],
|
||||||
|
[$@])
|
||||||
|
};
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
## ----------------- ##
|
||||||
|
## Semantic Values. ##
|
||||||
|
## ----------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
# b4_lhs_value([TYPE])
|
||||||
|
# --------------------
|
||||||
|
# Expansion of $<TYPE>$.
|
||||||
|
m4_define([b4_lhs_value],
|
||||||
|
[(yyval[]m4_ifval([$1], [.$1]))])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
||||||
|
# --------------------------------------
|
||||||
|
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||||
|
# symbols on RHS.
|
||||||
|
m4_define([b4_rhs_value],
|
||||||
|
[(yysemantic_stack_@{($1) - ($2)@}m4_ifval([$3], [.$3]))])
|
||||||
|
|
||||||
|
# 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],
|
||||||
|
[(yylocation_stack_@{($1) - ($2)@})])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_parse_param_decl
|
||||||
|
# -------------------
|
||||||
|
# Extra formal arguments of the constructor.
|
||||||
|
# Change the parameter names from "foo" into "foo_yyarg", so that
|
||||||
|
# there is no collision bw the user chosen attribute name, and the
|
||||||
|
# argument name in the constructor.
|
||||||
|
m4_define([b4_parse_param_decl],
|
||||||
|
[m4_ifset([b4_parse_param],
|
||||||
|
[m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
|
||||||
|
|
||||||
|
m4_define([b4_parse_param_decl_1],
|
||||||
|
[$1_yyarg])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# b4_parse_param_cons
|
||||||
|
# -------------------
|
||||||
|
# Extra initialisations of the constructor.
|
||||||
|
m4_define([b4_parse_param_cons],
|
||||||
|
[m4_ifset([b4_parse_param],
|
||||||
|
[
|
||||||
|
b4_cc_constructor_calls(b4_parse_param)])])
|
||||||
|
m4_define([b4_cc_constructor_calls],
|
||||||
|
[m4_map_sep([b4_cc_constructor_call], [,
|
||||||
|
], [$@])])
|
||||||
|
m4_define([b4_cc_constructor_call],
|
||||||
|
[$2 ($2_yyarg)])
|
||||||
|
|
||||||
|
# b4_parse_param_vars
|
||||||
|
# -------------------
|
||||||
|
# Extra instance variables.
|
||||||
|
m4_define([b4_parse_param_vars],
|
||||||
|
[m4_ifset([b4_parse_param],
|
||||||
|
[
|
||||||
|
/* User arguments. */
|
||||||
|
b4_cc_var_decls(b4_parse_param)])])
|
||||||
|
m4_define([b4_cc_var_decls],
|
||||||
|
[m4_map_sep([b4_cc_var_decl], [
|
||||||
|
], [$@])])
|
||||||
|
m4_define([b4_cc_var_decl],
|
||||||
|
[ $1;])
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
m4_divert(-1) -*- Autoconf -*-
|
m4_divert(-1) -*- Autoconf -*-
|
||||||
|
|
||||||
# C M4 Macros for Bison.
|
# C M4 Macros for Bison.
|
||||||
# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,8 +15,8 @@ m4_divert(-1) -*- Autoconf -*-
|
|||||||
|
|
||||||
# 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, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
# 02111-1307 USA
|
# 02110-1301 USA
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
@@ -28,8 +28,9 @@ m4_divert(-1) -*- Autoconf -*-
|
|||||||
m4_define([b4_copyright],
|
m4_define([b4_copyright],
|
||||||
[/* A Bison parser, made by GNU Bison b4_version. */
|
[/* A Bison parser, made by GNU Bison b4_version. */
|
||||||
|
|
||||||
/* $1,
|
/* $1
|
||||||
Copyright (C) $2 Free Software Foundation, Inc.
|
|
||||||
|
m4_text_wrap([Copyright (C) $2 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
|
||||||
@@ -43,8 +44,21 @@ m4_define([b4_copyright],
|
|||||||
|
|
||||||
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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA. */])
|
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
|
||||||
@@ -53,31 +67,38 @@ m4_define([b4_identification],
|
|||||||
[/* Identify Bison output. */
|
[/* Identify Bison output. */
|
||||||
[#]define YYBISON 1
|
[#]define YYBISON 1
|
||||||
|
|
||||||
|
/* Bison version. */
|
||||||
|
[#]define YYBISON_VERSION "b4_version"
|
||||||
|
|
||||||
/* Skeleton name. */
|
/* Skeleton name. */
|
||||||
[#]define YYSKELETON_NAME b4_skeleton
|
[#]define YYSKELETON_NAME b4_skeleton
|
||||||
|
|
||||||
/* Pure parsers. */
|
/* Pure parsers. */
|
||||||
[#]define YYPURE b4_pure
|
[#]define YYPURE b4_pure_flag
|
||||||
|
|
||||||
/* Using locations. */
|
/* Using locations. */
|
||||||
[#]define YYLSP_NEEDED b4_locations_flag
|
[#]define YYLSP_NEEDED b4_locations_flag
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Default values. ##
|
## Default values. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
m4_define_default([b4_epilogue], [])
|
m4_define_default([b4_epilogue], [])
|
||||||
|
|
||||||
|
# If the %union is not named, its name is YYSTYPE.
|
||||||
|
m4_define_default([b4_union_name], [YYSTYPE])
|
||||||
|
|
||||||
|
# The initial column and line.
|
||||||
|
m4_define_default([b4_location_initial_column], [1])
|
||||||
|
m4_define_default([b4_location_initial_line], [1])
|
||||||
|
|
||||||
|
|
||||||
## ------------------------ ##
|
## ------------------------ ##
|
||||||
## Pure/impure interfaces. ##
|
## Pure/impure interfaces. ##
|
||||||
## ------------------------ ##
|
## ------------------------ ##
|
||||||
|
|
||||||
|
|
||||||
# b4_user_args
|
# b4_user_args
|
||||||
# ------------
|
# ------------
|
||||||
m4_define([b4_user_args],
|
m4_define([b4_user_args],
|
||||||
@@ -93,12 +114,32 @@ m4_define([b4_parse_param],
|
|||||||
b4_parse_param))
|
b4_parse_param))
|
||||||
|
|
||||||
|
|
||||||
|
# b4_parse_param_for(DECL, FORMAL, BODY)
|
||||||
|
# ---------------------------------------
|
||||||
|
# Iterate over the user parameters, binding the declaration to DECL,
|
||||||
|
# the formal name to FORMAL, and evaluating the BODY.
|
||||||
|
m4_define([b4_parse_param_for],
|
||||||
|
[m4_foreach([$1_$2], m4_defn([b4_parse_param]),
|
||||||
|
[m4_pushdef([$1], m4_fst($1_$2))dnl
|
||||||
|
m4_pushdef([$2], m4_shift($1_$2))dnl
|
||||||
|
$3[]dnl
|
||||||
|
m4_popdef([$2])dnl
|
||||||
|
m4_popdef([$1])dnl
|
||||||
|
])])
|
||||||
|
|
||||||
|
# b4_parse_param_use
|
||||||
|
# ------------------
|
||||||
|
# `YYUSE' all the parse-params.
|
||||||
|
m4_define([b4_parse_param_use],
|
||||||
|
[b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal);
|
||||||
|
])dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
## Data Types. ##
|
## Data Types. ##
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
|
|
||||||
|
|
||||||
# b4_ints_in(INT1, INT2, LOW, HIGH)
|
# b4_ints_in(INT1, INT2, LOW, HIGH)
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
|
# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
|
||||||
@@ -119,7 +160,7 @@ m4_define([b4_int_type],
|
|||||||
|
|
||||||
m4_eval([0 <= $1]), [1], [unsigned int],
|
m4_eval([0 <= $1]), [1], [unsigned int],
|
||||||
|
|
||||||
[int])])
|
[int])])
|
||||||
|
|
||||||
|
|
||||||
# b4_int_type_for(NAME)
|
# b4_int_type_for(NAME)
|
||||||
@@ -130,27 +171,58 @@ m4_define([b4_int_type_for],
|
|||||||
[b4_int_type($1_min, $1_max)])
|
[b4_int_type($1_min, $1_max)])
|
||||||
|
|
||||||
|
|
||||||
|
## ---------##
|
||||||
|
## Values. ##
|
||||||
|
## ---------##
|
||||||
|
|
||||||
|
# b4_null
|
||||||
|
---------
|
||||||
|
# Return a null pointer constant. NULL infringes on the user name
|
||||||
|
# space in C, so use 0 rather than NULL.
|
||||||
|
m4_define([b4_null], [0])
|
||||||
|
|
||||||
|
|
||||||
## ------------------ ##
|
## ------------------ ##
|
||||||
## Decoding options. ##
|
## Decoding options. ##
|
||||||
## ------------------ ##
|
## ------------------ ##
|
||||||
|
|
||||||
|
# b4_flag_if(FLAG, IF-TRUE, IF-FALSE)
|
||||||
# b4_location_if(IF-TRUE, IF-FALSE)
|
# -----------------------------------
|
||||||
# ---------------------------------
|
# Run IF-TRUE if b4_FLAG_flag is 1, IF-FALSE if FLAG is 0, otherwise fail.
|
||||||
# Expand IF-TRUE, if locations are used, IF-FALSE otherwise.
|
m4_define([b4_flag_if],
|
||||||
m4_define([b4_location_if],
|
[m4_case(b4_$1_flag,
|
||||||
[m4_if(b4_locations_flag, [1],
|
[0], [$3],
|
||||||
[$1],
|
[1], [$2],
|
||||||
[$2])])
|
[m4_fatal([invalid $1 value: ]$1)])])
|
||||||
|
|
||||||
|
|
||||||
# b4_pure_if(IF-TRUE, IF-FALSE)
|
# 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 %pure-parser, IF-FALSE otherwise.
|
# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise.
|
||||||
m4_define([b4_pure_if],
|
b4_define_flag_if([defines]) # Whether headers are requested.
|
||||||
[m4_if(b4_pure, [1],
|
b4_define_flag_if([error_verbose]) # Whether error are verbose.
|
||||||
[$1],
|
b4_define_flag_if([locations]) # Whether locations are tracked.
|
||||||
[$2])])
|
b4_define_flag_if([pure]) # Whether the interface is pure.
|
||||||
|
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -166,6 +238,16 @@ m4_define([b4_token_define],
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
|
# -------------------------------------------------------
|
||||||
|
# Output the definition of the tokens (if there are) as #defines.
|
||||||
|
m4_define([b4_token_defines],
|
||||||
|
[m4_if([$@], [[]], [],
|
||||||
|
[/* Tokens. */
|
||||||
|
m4_map([b4_token_define], [$@])])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
|
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
# Output the definition of this token as an enum.
|
# Output the definition of this token as an enum.
|
||||||
@@ -173,10 +255,10 @@ m4_define([b4_token_enum],
|
|||||||
[$1 = $2])
|
[$1 = $2])
|
||||||
|
|
||||||
|
|
||||||
# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
# -------------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as enums and #define.
|
# Output the definition of the tokens (if there are) as enums.
|
||||||
m4_define([b4_token_defines],
|
m4_define([b4_token_enums],
|
||||||
[m4_if([$@], [[]], [],
|
[m4_if([$@], [[]], [],
|
||||||
[/* Tokens. */
|
[/* Tokens. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
@@ -186,11 +268,18 @@ m4_define([b4_token_defines],
|
|||||||
enum yytokentype {
|
enum yytokentype {
|
||||||
m4_map_sep([ b4_token_enum], [,
|
m4_map_sep([ b4_token_enum], [,
|
||||||
],
|
],
|
||||||
[$@])
|
[$@])
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
m4_map([b4_token_define], [$@])
|
])])
|
||||||
])
|
|
||||||
|
|
||||||
|
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
# Output the definition of the tokens (if there are any) as enums and, if POSIX
|
||||||
|
# Yacc is enabled, as #defines.
|
||||||
|
m4_define([b4_token_enums_defines],
|
||||||
|
[b4_token_enums($@)b4_yacc_if([b4_token_defines($@)], [])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -200,11 +289,25 @@ m4_map([b4_token_define], [$@])
|
|||||||
## --------------------------------------------- ##
|
## --------------------------------------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
# b4_modern_c
|
||||||
|
# -----------
|
||||||
|
# A predicate useful in #if to determine whether C is ancient or modern.
|
||||||
|
#
|
||||||
|
# If __STDC__ is defined, the compiler is modern. IBM xlc 7.0 when run
|
||||||
|
# as 'cc' doesn't define __STDC__ (or __STDC_VERSION__) for pedantic
|
||||||
|
# reasons, but it defines __C99__FUNC__ so check that as well.
|
||||||
|
# Microsoft C normally doesn't define these macros, but it defines _MSC_VER.
|
||||||
|
# Consider a C++ compiler to be modern if it defines __cplusplus.
|
||||||
|
#
|
||||||
|
m4_define([b4_c_modern],
|
||||||
|
[[(defined __STDC__ || defined __C99__FUNC__ \
|
||||||
|
|| defined __cplusplus || defined _MSC_VER)]])
|
||||||
|
|
||||||
# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# Declare the function NAME.
|
# Declare the function NAME.
|
||||||
m4_define([b4_c_function_def],
|
m4_define([b4_c_function_def],
|
||||||
[#if defined (__STDC__) || defined (__cplusplus)
|
[#if b4_c_modern
|
||||||
b4_c_ansi_function_def($@)
|
b4_c_ansi_function_def($@)
|
||||||
#else
|
#else
|
||||||
$2
|
$2
|
||||||
@@ -228,9 +331,9 @@ $1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
|
|||||||
# Output the arguments ANSI-C definition.
|
# Output the arguments ANSI-C definition.
|
||||||
m4_define([b4_c_ansi_formals],
|
m4_define([b4_c_ansi_formals],
|
||||||
[m4_case([$@],
|
[m4_case([$@],
|
||||||
[], [void],
|
[], [void],
|
||||||
[[]], [void],
|
[[]], [void],
|
||||||
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
|
||||||
|
|
||||||
m4_define([b4_c_ansi_formal],
|
m4_define([b4_c_ansi_formal],
|
||||||
[$1])
|
[$1])
|
||||||
@@ -251,9 +354,9 @@ m4_define([b4_c_knr_formal_name],
|
|||||||
# Output the K&R argument declarations.
|
# Output the K&R argument declarations.
|
||||||
m4_define([b4_c_knr_formal_decls],
|
m4_define([b4_c_knr_formal_decls],
|
||||||
[m4_map_sep([b4_c_knr_formal_decl],
|
[m4_map_sep([b4_c_knr_formal_decl],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
[$@])])
|
[$@])])
|
||||||
|
|
||||||
m4_define([b4_c_knr_formal_decl],
|
m4_define([b4_c_knr_formal_decl],
|
||||||
[ $1;])
|
[ $1;])
|
||||||
@@ -269,7 +372,7 @@ m4_define([b4_c_knr_formal_decl],
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Declare the function NAME.
|
# Declare the function NAME.
|
||||||
m4_define([b4_c_function_decl],
|
m4_define([b4_c_function_decl],
|
||||||
[#if defined (__STDC__) || defined (__cplusplus)
|
[#if defined __STDC__ || defined __cplusplus
|
||||||
b4_c_ansi_function_decl($@)
|
b4_c_ansi_function_decl($@)
|
||||||
#else
|
#else
|
||||||
$2 $1 ();
|
$2 $1 ();
|
||||||
@@ -314,14 +417,63 @@ m4_define([b4_c_arg],
|
|||||||
## Synclines. ##
|
## Synclines. ##
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
|
|
||||||
|
# b4_basename(NAME)
|
||||||
|
# -----------------
|
||||||
|
# Similar to POSIX basename; the differences don't matter here.
|
||||||
|
# Beware that NAME is not evaluated.
|
||||||
|
m4_define([b4_basename],
|
||||||
|
[m4_bpatsubst([$1], [^.*/\([^/]+\)/*$], [\1])])
|
||||||
|
|
||||||
|
|
||||||
# b4_syncline(LINE, FILE)
|
# b4_syncline(LINE, FILE)
|
||||||
# -----------------------
|
# -----------------------
|
||||||
m4_define([b4_syncline],
|
m4_define([b4_syncline],
|
||||||
[m4_if(b4_synclines_flag, 1,
|
[b4_flag_if([synclines],
|
||||||
[[#]line $1 $2])])
|
[/* 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])
|
||||||
|
|
||||||
|
|
||||||
|
## -------------- ##
|
||||||
|
## User actions. ##
|
||||||
|
## -------------- ##
|
||||||
|
|
||||||
|
# b4_case(LABEL, STATEMENTS)
|
||||||
|
# --------------------------
|
||||||
|
m4_define([b4_case],
|
||||||
|
[ case $1:
|
||||||
|
$2
|
||||||
|
break;])
|
||||||
|
|
||||||
# b4_symbol_actions(FILENAME, LINENO,
|
# b4_symbol_actions(FILENAME, LINENO,
|
||||||
# SYMBOL-TAG, SYMBOL-NUM,
|
# SYMBOL-TAG, SYMBOL-NUM,
|
||||||
# SYMBOL-ACTION, SYMBOL-TYPENAME)
|
# SYMBOL-ACTION, SYMBOL-TYPENAME)
|
||||||
@@ -332,9 +484,9 @@ m4_define([b4_symbol_actions],
|
|||||||
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
|
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
|
||||||
case $4: /* $3 */
|
case $4: /* $3 */
|
||||||
b4_syncline([$2], [$1])
|
b4_syncline([$2], [$1])
|
||||||
$5;
|
$5;
|
||||||
b4_syncline([@oline@], [@ofile@])
|
b4_syncline([@oline@], [@ofile@])
|
||||||
break;
|
break;
|
||||||
m4_popdef([b4_at_dollar])dnl
|
m4_popdef([b4_at_dollar])dnl
|
||||||
m4_popdef([b4_dollar_dollar])dnl
|
m4_popdef([b4_dollar_dollar])dnl
|
||||||
])
|
])
|
||||||
@@ -345,22 +497,25 @@ m4_popdef([b4_dollar_dollar])dnl
|
|||||||
# Generate the "yydestruct" function, which declaration is issued using
|
# Generate the "yydestruct" function, which declaration is issued using
|
||||||
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
||||||
# or "b4_c_function_def" for K&R.
|
# or "b4_c_function_def" for K&R.
|
||||||
m4_define([b4_yydestruct_generate],
|
m4_define_default([b4_yydestruct_generate],
|
||||||
[[/*-----------------------------------------------.
|
[[/*-----------------------------------------------.
|
||||||
| Release the memory associated to this symbol. |
|
| Release the memory associated to this symbol. |
|
||||||
`-----------------------------------------------*/
|
`-----------------------------------------------*/
|
||||||
|
|
||||||
|
/*ARGSUSED*/
|
||||||
]$1([yydestruct],
|
]$1([yydestruct],
|
||||||
[static void],
|
[static void],
|
||||||
[[const char *yymsg], [yymsg]],
|
[[const char *yymsg], [yymsg]],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[YYSTYPE *yyvaluep], [yyvaluep]]b4_location_if([,
|
[[YYSTYPE *yyvaluep], [yyvaluep]][]dnl
|
||||||
[[YYLTYPE *yylocationp], [yylocationp]]]))[
|
b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl
|
||||||
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
/* Pacify ``unused variable'' warnings. */
|
YYUSE (yyvaluep);
|
||||||
(void) yyvaluep;
|
]b4_locations_if([ YYUSE (yylocationp);
|
||||||
]b4_location_if([ (void) yylocationp;
|
])dnl
|
||||||
])[
|
b4_parse_param_use[]dnl
|
||||||
|
[
|
||||||
if (!yymsg)
|
if (!yymsg)
|
||||||
yymsg = "Deleting";
|
yymsg = "Deleting";
|
||||||
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
||||||
@@ -369,53 +524,74 @@ m4_define([b4_yydestruct_generate],
|
|||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}]dnl
|
}]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_yysymprint_generate(FUNCTION-DECLARATOR)
|
# b4_yy_symbol_print_generate(FUNCTION-DECLARATOR)
|
||||||
# -------------------------------------------
|
# ------------------------------------------------
|
||||||
# Generate the "yysymprint" function, which declaration is issued using
|
# Generate the "yy_symbol_print" function, which declaration is issued using
|
||||||
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
|
||||||
# or "b4_c_function_def" for K&R.
|
# or "b4_c_function_def" for K&R.
|
||||||
m4_define([b4_yysymprint_generate],
|
m4_define_default([b4_yy_symbol_print_generate],
|
||||||
[[/*--------------------------------.
|
[[
|
||||||
|
/*--------------------------------.
|
||||||
| Print this symbol on YYOUTPUT. |
|
| Print this symbol on YYOUTPUT. |
|
||||||
`--------------------------------*/
|
`--------------------------------*/
|
||||||
|
|
||||||
]$1([yysymprint],
|
/*ARGSUSED*/
|
||||||
|
]$1([yy_symbol_value_print],
|
||||||
[static void],
|
[static void],
|
||||||
[[FILE *yyoutput], [yyoutput]],
|
[[FILE *yyoutput], [yyoutput]],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[YYSTYPE *yyvaluep], [yyvaluep]]b4_location_if([,
|
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
||||||
[[YYLTYPE *yylocationp], [yylocationp]]]))
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
/* Pacify ``unused variable'' warnings. */
|
if (!yyvaluep)
|
||||||
(void) yyvaluep;
|
return;
|
||||||
b4_location_if([ (void) yylocationp;
|
]b4_locations_if([ YYUSE (yylocationp);
|
||||||
])dnl
|
])dnl
|
||||||
[
|
b4_parse_param_use[]dnl
|
||||||
if (yytype < YYNTOKENS)
|
[# ifdef YYPRINT
|
||||||
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
|
|
||||||
else
|
|
||||||
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
|
||||||
|
|
||||||
]b4_location_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
|
|
||||||
fprintf (yyoutput, ": ");
|
|
||||||
])dnl
|
|
||||||
[
|
|
||||||
# ifdef YYPRINT
|
|
||||||
if (yytype < YYNTOKENS)
|
if (yytype < YYNTOKENS)
|
||||||
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
||||||
|
# else
|
||||||
|
YYUSE (yyoutput);
|
||||||
# endif
|
# endif
|
||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
||||||
[ default:
|
[ default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
YYFPRINTF (yyoutput, ")");
|
|
||||||
}
|
}
|
||||||
]])
|
|
||||||
|
|
||||||
|
/*--------------------------------.
|
||||||
|
| Print this symbol on YYOUTPUT. |
|
||||||
|
`--------------------------------*/
|
||||||
|
|
||||||
|
]$1([yy_symbol_print],
|
||||||
|
[static void],
|
||||||
|
[[FILE *yyoutput], [yyoutput]],
|
||||||
|
[[int yytype], [yytype]],
|
||||||
|
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
||||||
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
|
{
|
||||||
|
if (yytype < YYNTOKENS)
|
||||||
|
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
|
||||||
|
else
|
||||||
|
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
||||||
|
|
||||||
|
]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
|
||||||
|
YYFPRINTF (yyoutput, ": ");
|
||||||
|
])dnl
|
||||||
|
[ yy_symbol_value_print (yyoutput, yytype, yyvaluep]dnl
|
||||||
|
b4_locations_if([, yylocationp])[]b4_user_args[);
|
||||||
|
YYFPRINTF (yyoutput, ")");
|
||||||
|
}]dnl
|
||||||
|
])
|
||||||
|
|||||||
+1249
-721
File diff suppressed because it is too large
Load Diff
+380
@@ -0,0 +1,380 @@
|
|||||||
|
m4_divert(-1) -*- C -*-
|
||||||
|
|
||||||
|
# C++ GLR skeleton for Bison
|
||||||
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301 USA
|
||||||
|
|
||||||
|
|
||||||
|
# This skeleton produces a C++ class that encapsulates a C glr parser.
|
||||||
|
# This is in order to reduce the maintenance burden. The glr.c
|
||||||
|
# skeleton is clean and pure enough so that there are no real
|
||||||
|
# problems. The C++ interface is the same as that of lalr1.cc. In
|
||||||
|
# fact, glr.c can replace yacc.c without the user noticing any
|
||||||
|
# difference, and similarly for glr.cc replacing lalr1.cc.
|
||||||
|
#
|
||||||
|
# The passing of parse-params
|
||||||
|
#
|
||||||
|
# The additional arguments are stored as members of the parser
|
||||||
|
# object, yyparser. The C routines need to carry yyparser
|
||||||
|
# throughout the C parser; that easy: just let yyparser become an
|
||||||
|
# additional parse-param. But because the C++ skeleton needs to
|
||||||
|
# know the "real" original parse-param, we save them
|
||||||
|
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
|
||||||
|
# (and c.m4 strips one level of quotes). This is a PITA, and
|
||||||
|
# explains why there are so many levels of quotes.
|
||||||
|
#
|
||||||
|
# The locations
|
||||||
|
#
|
||||||
|
# We use location.cc just like lalr1.cc, but because glr.c stores
|
||||||
|
# the locations in a (C++) union, the position and location classes
|
||||||
|
# must not have a constructor. Therefore, contrary to lalr1.cc, we
|
||||||
|
# must not define "b4_location_constructors". As a consequence the
|
||||||
|
# user must initialize the first positions (in particular the
|
||||||
|
# filename member).
|
||||||
|
|
||||||
|
# We require a pure interface using locations.
|
||||||
|
m4_define([b4_locations_flag], [1])
|
||||||
|
m4_define([b4_pure_flag], [1])
|
||||||
|
|
||||||
|
# The header is mandatory.
|
||||||
|
b4_defines_if([],
|
||||||
|
[m4_fatal(b4_skeleton[: using %defines is mandatory])])
|
||||||
|
|
||||||
|
m4_include(b4_pkgdatadir/[c++.m4])
|
||||||
|
m4_include(b4_pkgdatadir/[location.cc])
|
||||||
|
|
||||||
|
|
||||||
|
# Save the parse parameters.
|
||||||
|
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
|
||||||
|
|
||||||
|
|
||||||
|
# b4_yy_symbol_print_generate
|
||||||
|
# ---------------------------
|
||||||
|
# Bypass the default implementation to generate the "yy_symbol_print"
|
||||||
|
# and "yy_symbol_value_print" functions.
|
||||||
|
m4_define([b4_yy_symbol_print_generate],
|
||||||
|
[[
|
||||||
|
/*--------------------.
|
||||||
|
| Print this symbol. |
|
||||||
|
`--------------------*/
|
||||||
|
|
||||||
|
]b4_c_ansi_function_def([yy_symbol_print],
|
||||||
|
[static void],
|
||||||
|
[[FILE *], []],
|
||||||
|
[[int yytype], [yytype]],
|
||||||
|
[[const b4_namespace::b4_parser_class_name::semantic_type *yyvaluep],
|
||||||
|
[yyvaluep]],
|
||||||
|
[[const b4_namespace::b4_parser_class_name::location_type *yylocationp],
|
||||||
|
[yylocationp]],
|
||||||
|
b4_parse_param)[
|
||||||
|
{
|
||||||
|
]b4_parse_param_use[]dnl
|
||||||
|
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[);
|
||||||
|
}
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
# Declare yyerror.
|
||||||
|
m4_append([b4_post_prologue],
|
||||||
|
[b4_syncline([@oline@], [@ofile@])
|
||||||
|
|
||||||
|
b4_c_ansi_function_decl([yyerror],
|
||||||
|
[static void],
|
||||||
|
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||||
|
b4_parse_param,
|
||||||
|
[[const char* msg], [msg]])])
|
||||||
|
|
||||||
|
|
||||||
|
# Define yyerror.
|
||||||
|
m4_append([b4_epilogue],
|
||||||
|
[b4_syncline([@oline@], [@ofile@])[
|
||||||
|
/*------------------.
|
||||||
|
| Report an error. |
|
||||||
|
`------------------*/
|
||||||
|
|
||||||
|
]b4_c_ansi_function_def([yyerror],
|
||||||
|
[static void],
|
||||||
|
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||||
|
b4_parse_param,
|
||||||
|
[[const char* msg], [msg]])[
|
||||||
|
{
|
||||||
|
]b4_parse_param_use[]dnl
|
||||||
|
[ yyparser.error (*yylocationp, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace ]b4_namespace[
|
||||||
|
{
|
||||||
|
]dnl In this section, the parse param are the original parse_params.
|
||||||
|
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||||
|
[ /// Build a parser object.
|
||||||
|
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||||
|
:])[
|
||||||
|
#if YYDEBUG
|
||||||
|
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
|
||||||
|
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
||||||
|
#endif]b4_parse_param_cons[
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
]b4_parser_class_name::~b4_parser_class_name[ ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
]b4_parser_class_name[::parse ()
|
||||||
|
{
|
||||||
|
return ::yyparse (*this]b4_user_args[);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if YYDEBUG
|
||||||
|
/*--------------------.
|
||||||
|
| Print this symbol. |
|
||||||
|
`--------------------*/
|
||||||
|
|
||||||
|
inline void
|
||||||
|
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
||||||
|
const semantic_type* yyvaluep, const location_type* yylocationp)
|
||||||
|
{
|
||||||
|
/* Pacify ``unused variable'' warnings. */
|
||||||
|
YYUSE (yyvaluep);
|
||||||
|
YYUSE (yylocationp);
|
||||||
|
switch (yytype)
|
||||||
|
{
|
||||||
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
||||||
|
[ default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
|
||||||
|
const semantic_type* yyvaluep, const location_type* yylocationp)
|
||||||
|
{
|
||||||
|
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
|
||||||
|
<< ' ' << yytname[yytype] << " ("
|
||||||
|
<< *yylocationp << ": ";
|
||||||
|
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
|
||||||
|
*yycdebug_ << ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ostream&
|
||||||
|
]b4_parser_class_name[::debug_stream () const
|
||||||
|
{
|
||||||
|
return *yycdebug_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::set_debug_stream (std::ostream& o)
|
||||||
|
{
|
||||||
|
yycdebug_ = &o;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
]b4_parser_class_name[::debug_level_type
|
||||||
|
]b4_parser_class_name[::debug_level () const
|
||||||
|
{
|
||||||
|
return yydebug_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
||||||
|
{
|
||||||
|
yydebug_ = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
]m4_popdef([b4_parse_param])dnl
|
||||||
|
[} // namespace ]b4_namespace[
|
||||||
|
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
# Let glr.c believe that the user arguments include the parser itself.
|
||||||
|
m4_ifset([b4_parse_param],
|
||||||
|
[m4_pushdef([b4_parse_param],
|
||||||
|
m4_dquote([[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]],]
|
||||||
|
m4_defn([b4_parse_param])))],
|
||||||
|
[m4_pushdef([b4_parse_param],
|
||||||
|
[[[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]]]])
|
||||||
|
])
|
||||||
|
m4_include(b4_pkgdatadir/[glr.c])
|
||||||
|
m4_popdef([b4_parse_param])
|
||||||
|
|
||||||
|
@output @output_header_name@
|
||||||
|
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||||
|
[2002, 2003, 2004, 2005, 2006])[
|
||||||
|
|
||||||
|
/* C++ GLR parser skeleton written by Akim Demaille. */
|
||||||
|
|
||||||
|
#ifndef PARSER_HEADER_H
|
||||||
|
# define PARSER_HEADER_H
|
||||||
|
|
||||||
|
]m4_ifdef([b4_start_header],
|
||||||
|
[[/* Copy the %start-header blocks. */
|
||||||
|
]b4_user_start_header])[
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
/* Using locations. */
|
||||||
|
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||||
|
|
||||||
|
namespace ]b4_namespace[
|
||||||
|
{
|
||||||
|
class position;
|
||||||
|
class location;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "location.hh"
|
||||||
|
|
||||||
|
/* Enabling traces. */
|
||||||
|
#ifndef YYDEBUG
|
||||||
|
# define YYDEBUG ]b4_debug_flag[
|
||||||
|
#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.
|
||||||
|
class ]b4_parser_class_name[
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/// Symbol semantic values.
|
||||||
|
#ifndef YYSTYPE
|
||||||
|
]m4_ifdef([b4_stype],
|
||||||
|
[ union semantic_type
|
||||||
|
b4_user_stype
|
||||||
|
;],
|
||||||
|
[m4_if(b4_tag_seen_flag, 0,
|
||||||
|
[[ typedef int semantic_type;]],
|
||||||
|
[[ typedef YYSTYPE semantic_type;]])])[
|
||||||
|
#else
|
||||||
|
typedef YYSTYPE semantic_type;
|
||||||
|
#endif
|
||||||
|
/// Symbol locations.
|
||||||
|
typedef ]b4_location_type[ location_type;
|
||||||
|
/// Tokens.
|
||||||
|
struct token
|
||||||
|
{
|
||||||
|
]b4_token_enums(b4_tokens)[
|
||||||
|
};
|
||||||
|
/// Token type.
|
||||||
|
typedef token::yytokentype token_type;
|
||||||
|
|
||||||
|
/// Build a parser object.
|
||||||
|
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
||||||
|
virtual ~]b4_parser_class_name[ ();
|
||||||
|
|
||||||
|
/// Parse.
|
||||||
|
/// \returns 0 iff parsing succeeded.
|
||||||
|
virtual int parse ();
|
||||||
|
|
||||||
|
/// The current debugging stream.
|
||||||
|
std::ostream& debug_stream () const;
|
||||||
|
/// Set the current debugging stream.
|
||||||
|
void set_debug_stream (std::ostream &);
|
||||||
|
|
||||||
|
/// Type for debugging levels.
|
||||||
|
typedef int debug_level_type;
|
||||||
|
/// The current debugging level.
|
||||||
|
debug_level_type debug_level () const;
|
||||||
|
/// Set the current debugging level.
|
||||||
|
void set_debug_level (debug_level_type l);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// Report a syntax error.
|
||||||
|
/// \param loc where the syntax error is found.
|
||||||
|
/// \param msg a description of the syntax error.
|
||||||
|
virtual void error (const location_type& loc, const std::string& msg);
|
||||||
|
private:
|
||||||
|
|
||||||
|
#if YYDEBUG
|
||||||
|
public:
|
||||||
|
/// \brief Report a symbol value on the debug stream.
|
||||||
|
/// \param yytype The token type.
|
||||||
|
/// \param yyvaluep Its semantic value.
|
||||||
|
/// \param yylocationp Its location.
|
||||||
|
virtual void yy_symbol_value_print_ (int yytype,
|
||||||
|
const semantic_type* yyvaluep,
|
||||||
|
const location_type* yylocationp);
|
||||||
|
/// \brief Report a symbol on the debug stream.
|
||||||
|
/// \param yytype The token type.
|
||||||
|
/// \param yyvaluep Its semantic value.
|
||||||
|
/// \param yylocationp Its location.
|
||||||
|
virtual void yy_symbol_print_ (int yytype,
|
||||||
|
const semantic_type* yyvaluep,
|
||||||
|
const location_type* yylocationp);
|
||||||
|
private:
|
||||||
|
/* Debugging. */
|
||||||
|
int yydebug_;
|
||||||
|
std::ostream* yycdebug_;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/// \brief Reclaim the memory associated to a symbol.
|
||||||
|
/// \param yymsg Why this token is reclaimed.
|
||||||
|
/// \param yytype The symbol type.
|
||||||
|
/// \param yyvaluep Its semantic value.
|
||||||
|
/// \param yylocationp Its location.
|
||||||
|
inline void yydestruct_ (const char* yymsg,
|
||||||
|
int yytype,
|
||||||
|
semantic_type* yyvaluep,
|
||||||
|
location_type* yylocationp);
|
||||||
|
|
||||||
|
]b4_parse_param_vars[
|
||||||
|
};
|
||||||
|
|
||||||
|
]dnl Redirections for glr.c.
|
||||||
|
m4_ifset([b4_global_tokens_and_yystype],
|
||||||
|
[b4_token_defines(b4_tokens)])
|
||||||
|
[
|
||||||
|
#ifndef YYSTYPE
|
||||||
|
# define YYSTYPE ]b4_namespace[::]b4_parser_class_name[::semantic_type
|
||||||
|
#endif
|
||||||
|
#ifndef YYLTYPE
|
||||||
|
# define YYLTYPE ]b4_namespace[::]b4_parser_class_name[::location_type
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
]m4_ifdef([b4_end_header],
|
||||||
|
[[/* Copy the %end-header blocks. */
|
||||||
|
]b4_end_header])[]dnl
|
||||||
|
|
||||||
|
[#endif /* ! defined PARSER_HEADER_H */]
|
||||||
+729
-947
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,280 @@
|
|||||||
|
m4_divert(-1)
|
||||||
|
|
||||||
|
# C++ 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
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# We do want M4 expansion after # for CPP macros.
|
||||||
|
m4_changecom()
|
||||||
|
m4_divert(0)dnl
|
||||||
|
@output b4_dir_prefix[]position.hh
|
||||||
|
b4_copyright([Positions for Bison parsers in C++],
|
||||||
|
[2002, 2003, 2004, 2005, 2006])[
|
||||||
|
|
||||||
|
/**
|
||||||
|
** \file position.hh
|
||||||
|
** Define the ]b4_namespace[::position class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BISON_POSITION_HH
|
||||||
|
# define BISON_POSITION_HH
|
||||||
|
|
||||||
|
# include <iostream>
|
||||||
|
# include <string>
|
||||||
|
# include <algorithm>
|
||||||
|
|
||||||
|
namespace ]b4_namespace[
|
||||||
|
{
|
||||||
|
/// Abstract a position.
|
||||||
|
class position
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
]m4_ifdef([b4_location_constructors], [
|
||||||
|
/// Construct a position.
|
||||||
|
position ()
|
||||||
|
: filename (0), line (]b4_location_initial_line[), column (]b4_location_initial_column[)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
])[
|
||||||
|
/// Initialization.
|
||||||
|
inline void initialize (]b4_filename_type[* fn)
|
||||||
|
{
|
||||||
|
filename = fn;
|
||||||
|
line = ]b4_location_initial_line[;
|
||||||
|
column = ]b4_location_initial_column[;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \name Line and Column related manipulators
|
||||||
|
** \{ */
|
||||||
|
public:
|
||||||
|
/// (line related) Advance to the COUNT next lines.
|
||||||
|
inline void lines (int count = 1)
|
||||||
|
{
|
||||||
|
column = ]b4_location_initial_column[;
|
||||||
|
line += count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// (column related) Advance to the COUNT next columns.
|
||||||
|
inline void columns (int count = 1)
|
||||||
|
{
|
||||||
|
column = std::max (]b4_location_initial_column[u, column + count);
|
||||||
|
}
|
||||||
|
/** \} */
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// File name to which this position refers.
|
||||||
|
]b4_filename_type[* filename;
|
||||||
|
/// Current line number.
|
||||||
|
unsigned int line;
|
||||||
|
/// Current column number.
|
||||||
|
unsigned int column;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Add and assign a position.
|
||||||
|
inline const position&
|
||||||
|
operator+= (position& res, const int width)
|
||||||
|
{
|
||||||
|
res.columns (width);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add two position objects.
|
||||||
|
inline const position
|
||||||
|
operator+ (const position& begin, const int width)
|
||||||
|
{
|
||||||
|
position res = begin;
|
||||||
|
return res += width;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add and assign a position.
|
||||||
|
inline const position&
|
||||||
|
operator-= (position& res, const int width)
|
||||||
|
{
|
||||||
|
return res += -width;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add two position objects.
|
||||||
|
inline const position
|
||||||
|
operator- (const position& begin, const int width)
|
||||||
|
{
|
||||||
|
return begin + -width;
|
||||||
|
}
|
||||||
|
]m4_if(b4_define_location_comparison, [1], [[
|
||||||
|
/// Compare two position objects.
|
||||||
|
inline bool
|
||||||
|
operator== (const position& pos1, const position& pos2)
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(pos1.filename == pos2.filename
|
||||||
|
|| pos1.filename && pos2.filename && *pos1.filename == *pos2.filename)
|
||||||
|
&& pos1.line == pos2.line && pos1.column == pos2.column;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Compare two position objects.
|
||||||
|
inline bool
|
||||||
|
operator!= (const position& pos1, const position& pos2)
|
||||||
|
{
|
||||||
|
return !(pos1 == pos2);
|
||||||
|
}
|
||||||
|
]])[
|
||||||
|
/** \brief Intercept output stream redirection.
|
||||||
|
** \param ostr the destination output stream
|
||||||
|
** \param pos a reference to the position to redirect
|
||||||
|
*/
|
||||||
|
inline std::ostream&
|
||||||
|
operator<< (std::ostream& ostr, const position& pos)
|
||||||
|
{
|
||||||
|
if (pos.filename)
|
||||||
|
ostr << *pos.filename << ':';
|
||||||
|
return ostr << pos.line << '.' << pos.column;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif // not BISON_POSITION_HH]
|
||||||
|
@output b4_dir_prefix[]location.hh
|
||||||
|
b4_copyright([Locations for Bison parsers in C++],
|
||||||
|
[2002, 2003, 2004, 2005, 2006])[
|
||||||
|
|
||||||
|
/**
|
||||||
|
** \file location.hh
|
||||||
|
** Define the ]b4_namespace[::location class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BISON_LOCATION_HH
|
||||||
|
# define BISON_LOCATION_HH
|
||||||
|
|
||||||
|
# include <iostream>
|
||||||
|
# include <string>
|
||||||
|
# include "position.hh"
|
||||||
|
|
||||||
|
namespace ]b4_namespace[
|
||||||
|
{
|
||||||
|
|
||||||
|
/// Abstract a location.
|
||||||
|
class location
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
]m4_ifdef([b4_location_constructors], [
|
||||||
|
/// Construct a location.
|
||||||
|
location ()
|
||||||
|
: begin (), end ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
])[
|
||||||
|
/// Initialization.
|
||||||
|
inline void initialize (]b4_filename_type[* fn)
|
||||||
|
{
|
||||||
|
begin.initialize (fn);
|
||||||
|
end = begin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \name Line and Column related manipulators
|
||||||
|
** \{ */
|
||||||
|
public:
|
||||||
|
/// Reset initial location to final location.
|
||||||
|
inline void step ()
|
||||||
|
{
|
||||||
|
begin = end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Extend the current location to the COUNT next columns.
|
||||||
|
inline void columns (unsigned int count = 1)
|
||||||
|
{
|
||||||
|
end += count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Extend the current location to the COUNT next lines.
|
||||||
|
inline void lines (unsigned int count = 1)
|
||||||
|
{
|
||||||
|
end.lines (count);
|
||||||
|
}
|
||||||
|
/** \} */
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// Beginning of the located region.
|
||||||
|
position begin;
|
||||||
|
/// End of the located region.
|
||||||
|
position end;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Join two location objects to create a location.
|
||||||
|
inline const location operator+ (const location& begin, const location& end)
|
||||||
|
{
|
||||||
|
location res = begin;
|
||||||
|
res.end = end.end;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add two location objects.
|
||||||
|
inline const location operator+ (const location& begin, unsigned int width)
|
||||||
|
{
|
||||||
|
location res = begin;
|
||||||
|
res.columns (width);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add and assign a location.
|
||||||
|
inline location& operator+= (location& res, unsigned int width)
|
||||||
|
{
|
||||||
|
res.columns (width);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
]m4_if(b4_define_location_comparison, [1], [[
|
||||||
|
/// Compare two location objects.
|
||||||
|
inline bool
|
||||||
|
operator== (const location& loc1, const location& loc2)
|
||||||
|
{
|
||||||
|
return loc1.begin == loc2.begin && loc1.end == loc2.end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Compare two location objects.
|
||||||
|
inline bool
|
||||||
|
operator!= (const location& loc1, const location& loc2)
|
||||||
|
{
|
||||||
|
return !(loc1 == loc2);
|
||||||
|
}
|
||||||
|
]])[
|
||||||
|
/** \brief Intercept output stream redirection.
|
||||||
|
** \param ostr the destination output stream
|
||||||
|
** \param loc a reference to the location to redirect
|
||||||
|
**
|
||||||
|
** Avoid duplicate information.
|
||||||
|
*/
|
||||||
|
inline std::ostream& operator<< (std::ostream& ostr, const location& loc)
|
||||||
|
{
|
||||||
|
position last = loc.end - 1;
|
||||||
|
ostr << loc.begin;
|
||||||
|
if (last.filename
|
||||||
|
&& (!loc.begin.filename
|
||||||
|
|| *loc.begin.filename != *last.filename))
|
||||||
|
ostr << '-' << last;
|
||||||
|
else if (loc.begin.line != last.line)
|
||||||
|
ostr << '-' << last.line << '.' << last.column;
|
||||||
|
else if (loc.begin.column != last.column)
|
||||||
|
ostr << '-' << last.column;
|
||||||
|
return ostr;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // not BISON_LOCATION_HH]
|
||||||
|
m4_divert(-1)
|
||||||
|
m4_changecom([#])
|
||||||
+347
-374
File diff suppressed because it is too large
Load Diff
+609
-392
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
|||||||
|
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||||
|
# Requires GNU sed
|
||||||
|
|
||||||
|
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
## This program is free software; you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation; either version 2, 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.
|
||||||
|
|
||||||
|
top_srcdir = ..
|
||||||
|
srcdir = .
|
||||||
|
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
all: README
|
||||||
|
|
||||||
|
README: README.in $(top_srcdir)/configure
|
||||||
|
PACKAGE=`grep "^[ ]*PACKAGE=" $(top_srcdir)/configure | sed -e 's/^[ ]*PACKAGE=//' -e s/[\"\']//g`; \
|
||||||
|
VERSION=`grep "^[ ]*VERSION=" $(top_srcdir)/configure | sed -e 's/^[ ]*VERSION=//' -e s/[\"\']//g`; \
|
||||||
|
package_version=`echo "$${VERSION}" | sed 's/\.//g'`; \
|
||||||
|
tree_version=`echo "$${VERSION}" | sed 's/\.//2g'`; \
|
||||||
|
sed \
|
||||||
|
-e "s/@V@/$${PACKAGE}-$${VERSION}/g" \
|
||||||
|
-e "s/@VERSION@/$${VERSION}/g" \
|
||||||
|
-e "s/@PACKAGE_VERSION@/$$package_version/g" \
|
||||||
|
-e "s/@TREE_VERSION@/$$tree_version/g" \
|
||||||
|
$(srcdir)/README.in > t-$@
|
||||||
|
mv t-$@ $@
|
||||||
+194
@@ -0,0 +1,194 @@
|
|||||||
|
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||||
|
|
||||||
|
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2, 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.
|
||||||
|
|
||||||
|
|
||||||
|
1.: DJGPP specific changes.
|
||||||
|
=======================
|
||||||
|
|
||||||
|
The DJGPP port of Bison offers LFN and SFN support depending on which
|
||||||
|
OS it is running. If LFN support is available or not is determinated at
|
||||||
|
run time. If LFN support is available (DOS session under Win9X, Win2K,
|
||||||
|
WinXP, etc.) the standard posix file name extensions will be used.
|
||||||
|
These are: y.tab.c, y.tab.c++, y.tab.h, y.output, etc. If only SFN
|
||||||
|
support is available (plain DOS), then the standard MSDOS short file
|
||||||
|
names will be used. These are: y_tab.c, y_tab.h, y.out, etc.
|
||||||
|
It should be noticed that this bison version needs the m4 program as
|
||||||
|
back end to generate the parser file (y.tab.c etc.) from the skeleton
|
||||||
|
files. This implies that m4 must always be installed to get bison
|
||||||
|
working. m4 will use a couple of m4 scripts that will be installed in
|
||||||
|
/dev/env/DJDIR/share/bison and shall not be removed.
|
||||||
|
It should also be noticed that the skeleton files bison.simple and
|
||||||
|
bison.hairy are no longer supported. This applies also to the environ-
|
||||||
|
ment variables BISON_HAIRY and BISON_SIMPLE. Those variables are *no*
|
||||||
|
longer honored at all.
|
||||||
|
The kind of skeleton file bison.hairy is no longer supported at all.
|
||||||
|
The skeleton file bison.simple is now called yacc.c and is an m4 script.
|
||||||
|
The other two skeleton files supported by this bison version are glr.c
|
||||||
|
and lalr1.cc. The first one is a generalized LR C parser based on
|
||||||
|
Bison's LALR(1) tables and the second one is a experimental C++ parser
|
||||||
|
class.
|
||||||
|
As has been told before, bison uses m4 to generate the parser file.
|
||||||
|
This is done by forking and using pipes for the IPC. MSDOS does not
|
||||||
|
support this functionality so this has been reproduced in the usual
|
||||||
|
way by redirecting stdin and stdout of bison and m4 to temporary files
|
||||||
|
and processing these files in sequence. All the changes to the sources
|
||||||
|
are documented in the djgpp/diffs file.
|
||||||
|
|
||||||
|
Please **read** the docs.
|
||||||
|
|
||||||
|
|
||||||
|
2.: Installing the binary package.
|
||||||
|
==============================
|
||||||
|
|
||||||
|
2.1.: Copy the binary distribution into the top DJGPP installation directory,
|
||||||
|
just unzip it preserving the directory structure running *ONE* of the
|
||||||
|
following commands:
|
||||||
|
unzip32 bsn@[email protected] or
|
||||||
|
djtarx bsn@[email protected] or
|
||||||
|
pkunzip -d bsn@[email protected]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3.: Building the binaries from sources.
|
||||||
|
===================================
|
||||||
|
|
||||||
|
3.1.: Create a temporary directory and copy the source package into the
|
||||||
|
directory. If you download the source distribution from one of the
|
||||||
|
DJGPP sites, just unzip it preserving the directory structure
|
||||||
|
running *ONE* of the following commands:
|
||||||
|
unzip32 bsn@[email protected] or
|
||||||
|
djtarx bsn@[email protected] or
|
||||||
|
pkunzip -d bsn@[email protected]
|
||||||
|
and proceed to the paragraph 3.3, below.
|
||||||
|
|
||||||
|
3.2.: Source distributions downloaded from one of the GNU FTP sites need
|
||||||
|
some more work to unpack, if LFN support is not available. If LFN is
|
||||||
|
available then you can extract the source files from the archive with
|
||||||
|
any unzip program and proceed to the paragraph 3.3, below. Any file
|
||||||
|
name issue will be handled by the the DJGPP configuration files.
|
||||||
|
To unpack the source distribution on SFN systems, first, you MUST use
|
||||||
|
the `djunpack' batch file to unzip the package. That is because some
|
||||||
|
file names in the official distributions need to be changed to avoid
|
||||||
|
problems on the various platforms supported by DJGPP.
|
||||||
|
`djunpack' invokes the `djtar' program (that is part of the basic DJGPP
|
||||||
|
development kit) to rename these files on the fly given a file with
|
||||||
|
name mappings; the distribution includes a file `djgpp/fnchange.lst'
|
||||||
|
with the necessary mappings. So you need first to retrieve that batch
|
||||||
|
file, and then invoke it to unpack the distribution. Here's how:
|
||||||
|
|
||||||
|
djtar -x -p -o bison-@VERSION@/djgpp/djunpack.bat bison-@[email protected] > djunpack.bat
|
||||||
|
djunpack bison-@[email protected]
|
||||||
|
|
||||||
|
(The name of the distribution archive and the leading directory of the
|
||||||
|
path to `djunpack.bat' in the distribution will be different for
|
||||||
|
versions of Bison other than @VERSION@.)
|
||||||
|
|
||||||
|
If the argument to `djunpack.bat' include leading directories, it MUST
|
||||||
|
be given with the DOS-style backslashes; Unix-style forward slashes
|
||||||
|
will NOT work.
|
||||||
|
|
||||||
|
If the distribution comes as a .tar.bz2 archive, and your version of
|
||||||
|
`djtar' doesn't support bzip2 decompression, you need to unpack it as
|
||||||
|
follows:
|
||||||
|
|
||||||
|
bnzip2 bison-@[email protected]
|
||||||
|
djtar -x -p -o bison-@VERSION@/djgpp/djunpack.bat bison-@[email protected] > djunpack.bat
|
||||||
|
djunpack bison-@[email protected]
|
||||||
|
|
||||||
|
3.3.: To build the binaries you will need the following binary packages:
|
||||||
|
djdev203.zip (or a later but NOT a prior version)
|
||||||
|
bsh204b.zip (or a later but NOT a prior version)
|
||||||
|
gcc410b.zip, gpp410b.zip, bnu2161b.zip, mak3791b.zip,
|
||||||
|
fil40b.zip, shl20jb.zip, txt20b.zip,
|
||||||
|
txi48b.zip, grep24b.zip, sed415b.zip,
|
||||||
|
m4-144b.zip.
|
||||||
|
|
||||||
|
If you want to run the check you will need also:
|
||||||
|
dif287b.zip
|
||||||
|
|
||||||
|
All this packages can be found in the v2gnu directory of any
|
||||||
|
ftp.delorie.com mirror.
|
||||||
|
You will need bsh204b.zip or later and *NOT* a prior version or
|
||||||
|
the build will fail. The same applies to djdev203.zip. Please note
|
||||||
|
that Bison requires m4-144b.zip or later to work properly. All the
|
||||||
|
other packages are the ones I have used to build the binaries
|
||||||
|
from this source. Previuos versions of this packages may do the
|
||||||
|
job as well but I have not tested this.
|
||||||
|
|
||||||
|
3.4.: If for some reason you want to reconfigure the package cd into the top
|
||||||
|
srcdir (bison-@TREE_VERSION@) and run the following commands:
|
||||||
|
del djgpp\config.cache
|
||||||
|
make clean
|
||||||
|
djgpp\config
|
||||||
|
|
||||||
|
Please note that you *MUST* delete the config.cache file in the djgpp
|
||||||
|
subdir or you will not really reconfigure the sources because the
|
||||||
|
configuration informations will be read from the cache file instead
|
||||||
|
of being newly computed.
|
||||||
|
To build the programs in a directory other than where the sources are,
|
||||||
|
you must add the parameter that specifies the source directory,
|
||||||
|
e.g:
|
||||||
|
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
|
||||||
|
|
||||||
|
Lets assume you want to build the binaries in a directory placed on a
|
||||||
|
different drive (z:\build in this case) from where the sources are,
|
||||||
|
then you will run the following commands:
|
||||||
|
z:
|
||||||
|
md \build
|
||||||
|
cd \build
|
||||||
|
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
|
||||||
|
|
||||||
|
The order of the options and the srcdir option does not matter. You
|
||||||
|
*MUST* use forward slashes to specify the source directory.
|
||||||
|
|
||||||
|
The batch file will set same environment variables, make MSDOS specific
|
||||||
|
modifications to the Makefile.in's and supply all other needed options
|
||||||
|
to the configure script.
|
||||||
|
|
||||||
|
3.5.: To compile the package run from the top srcdir the command:
|
||||||
|
make
|
||||||
|
|
||||||
|
3.6.: Now you can run the tests if you like. From the top srcdir run the
|
||||||
|
command:
|
||||||
|
make check
|
||||||
|
|
||||||
|
No test should fail but the tests #131 (Doxygen Public Documentation)
|
||||||
|
and #132 (Doxygen Private Documentation) will be skipped. Please note
|
||||||
|
that the testsuite only works with LFN available. On plain DOS, most
|
||||||
|
of the tests will fail due to invalid DOS names.
|
||||||
|
|
||||||
|
3.7.: To install the binaries, header, library, catalogs, and info docs
|
||||||
|
run the following command from the top srcdir:
|
||||||
|
make install
|
||||||
|
|
||||||
|
This will install the products into your DJGPP installation tree given
|
||||||
|
by the default prefix "/dev/env/DJDIR". If you prefer to install them
|
||||||
|
into some other directory you will have to set prefix to the appropiate
|
||||||
|
value:
|
||||||
|
make install prefix=z:/some/other/place
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Send GNU bison specific bug reports to <[email protected]>.
|
||||||
|
Send suggestions and bug reports concerning the DJGPP port to
|
||||||
|
comp.os.msdos.djgpp or <[email protected]>.
|
||||||
|
|
||||||
|
|
||||||
|
Enjoy.
|
||||||
|
|
||||||
|
Guerrero, Juan Manuel <[email protected]>
|
||||||
@@ -0,0 +1,480 @@
|
|||||||
|
@echo off
|
||||||
|
Rem Configure Bison for DJGPP.
|
||||||
|
|
||||||
|
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||||
|
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||||
|
|
||||||
|
Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Rem This program is free software; you can redistribute it and/or modify
|
||||||
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
|
Rem the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
Rem any later version.
|
||||||
|
|
||||||
|
Rem This program is distributed in the hope that it will be useful,
|
||||||
|
Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
Rem GNU General Public License for more details.
|
||||||
|
|
||||||
|
Rem You should have received a copy of the GNU General Public License
|
||||||
|
Rem along with this program; if not, write to the Free Software Foundation,
|
||||||
|
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
echo Configuring Bison for DJGPP v2.x...
|
||||||
|
|
||||||
|
Rem The SmallEnv tests protect against fixed and too small size
|
||||||
|
Rem of the environment in stock DOS shell.
|
||||||
|
|
||||||
|
Rem Find out if NLS is wanted or not,
|
||||||
|
Rem if dependency-tracking is wanted or not,
|
||||||
|
Rem if caching is wanted or not
|
||||||
|
Rem and where the sources are.
|
||||||
|
Rem We always default to NLS support,
|
||||||
|
Rem no dependency tracking
|
||||||
|
Rem and to in place configuration.
|
||||||
|
set ARGS=
|
||||||
|
set NLS=enabled
|
||||||
|
if not "%NLS%" == "enabled" goto SmallEnv
|
||||||
|
set CACHING=enabled
|
||||||
|
if not "%CACHING%" == "enabled" goto SmallEnv
|
||||||
|
set DEPENDENCY_TRACKING=disabled
|
||||||
|
if not "%DEPENDENCY_TRACKING%" == "disabled" goto SmallEnv
|
||||||
|
set LIBICONV_PREFIX=disabled
|
||||||
|
if not "%LIBICONV_PREFIX%" == "disabled" goto SmallEnv
|
||||||
|
set LIBINTL_PREFIX=disabled
|
||||||
|
if not "%LIBINTL_PREFIX%" == "disabled" goto SmallEnv
|
||||||
|
set HTML=enabled
|
||||||
|
if not "%HTML%" == "enabled" goto SmallEnv
|
||||||
|
set XSRC=.
|
||||||
|
if not "%XSRC%" == "." goto SmallEnv
|
||||||
|
|
||||||
|
Rem Loop over all arguments.
|
||||||
|
Rem Special arguments are: NLS, XSRC, CACHE, STATIC_LIBS, LIBICONV_PREFIX, LIBINTL_PREFIX and DEPS.
|
||||||
|
Rem All other arguments are stored into ARGS.
|
||||||
|
:ArgLoop
|
||||||
|
if "%1" == "nls" goto NextArgument
|
||||||
|
if "%1" == "NLS" goto NextArgument
|
||||||
|
if "%1" == "no-nls" goto NoNLS
|
||||||
|
if "%1" == "no-NLS" goto NoNLS
|
||||||
|
if "%1" == "NO-NLS" goto NoNLS
|
||||||
|
goto CachingOption
|
||||||
|
:NoNLS
|
||||||
|
if "%1" == "no-nls" set NLS=disabled
|
||||||
|
if "%1" == "no-NLS" set NLS=disabled
|
||||||
|
if "%1" == "NO-NLS" set NLS=disabled
|
||||||
|
if not "%NLS%" == "disabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:CachingOption
|
||||||
|
if "%1" == "cache" goto NextArgument
|
||||||
|
if "%1" == "CACHE" goto NextArgument
|
||||||
|
if "%1" == "no-cache" goto NoCaching
|
||||||
|
if "%1" == "no-CACHE" goto NoCaching
|
||||||
|
if "%1" == "NO-CACHE" goto NoCaching
|
||||||
|
goto DependencyOption
|
||||||
|
:NoCaching
|
||||||
|
if "%1" == "no-cache" set CACHING=disabled
|
||||||
|
if "%1" == "no-CACHE" set CACHING=disabled
|
||||||
|
if "%1" == "NO-CACHE" set CACHING=disabled
|
||||||
|
if not "%CACHING%" == "disabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:DependencyOption
|
||||||
|
if "%1" == "no-dep" goto NextArgument
|
||||||
|
if "%1" == "no-DEP" goto NextArgument
|
||||||
|
if "%1" == "NO-DEP" goto NextArgument
|
||||||
|
if "%1" == "dep" goto DependecyTraking
|
||||||
|
if "%1" == "DEP" goto DependecyTraking
|
||||||
|
goto LibiconvPrefixOption
|
||||||
|
:DependecyTraking
|
||||||
|
if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
|
||||||
|
if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
|
||||||
|
if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:LibiconvPrefixOption
|
||||||
|
if "%1" == "no-libiconvprefix" goto NextArgument
|
||||||
|
if "%1" == "no-LIBICONVPREFIX" goto NextArgument
|
||||||
|
if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
|
||||||
|
if "%1" == "libiconvprefix" goto WithLibiconvPrefix
|
||||||
|
if "%1" == "LIBICONVPREFIX" goto WithLibiconvPrefix
|
||||||
|
goto LibintlPrefixOption
|
||||||
|
:WithLibiconvPrefix
|
||||||
|
if "%1" == "libiconvprefix" set LIBICONV_PREFIX=enabled
|
||||||
|
if "%1" == "LIBICONVPREFIX" set LIBICONV_PREFIX=enabled
|
||||||
|
if not "%LIBICONV_PREFIX%" == "enabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:LibintlPrefixOption
|
||||||
|
if "%1" == "no-libiconvprefix" goto NextArgument
|
||||||
|
if "%1" == "no-LIBICONVPREFIX" goto NextArgument
|
||||||
|
if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
|
||||||
|
if "%1" == "libintlprefix" goto _WithLibintlPrefix
|
||||||
|
if "%1" == "LIBINTLPREFIX" goto _WithLibintlPrefix
|
||||||
|
goto HTMLOption
|
||||||
|
:_WithLibintlPrefix
|
||||||
|
if "%1" == "libintlprefix" set LIBINTL_PREFIX=enabled
|
||||||
|
if "%1" == "LIBINTLPREFIX" set LIBINTL_PREFIX=enabled
|
||||||
|
if not "%LIBINTL_PREFIX%" == "enabled" goto SmallEnv
|
||||||
|
:HTMLOption
|
||||||
|
if "%1" == "withhtml" goto NextArgument
|
||||||
|
if "%1" == "withHTML" goto NextArgument
|
||||||
|
if "%1" == "WITHHTML" goto NextArgument
|
||||||
|
if "%1" == "withouthtml" goto _WithoutHTML
|
||||||
|
if "%1" == "withoutHTML" goto _WithoutHTML
|
||||||
|
if "%1" == "WITHOUTHTML" goto _WithoutHTML
|
||||||
|
goto SrcDirOption
|
||||||
|
:_WithoutHTML
|
||||||
|
if "%1" == "withouthtml" set HTML=disabled
|
||||||
|
if "%1" == "withoutHTML" set HTML=disabled
|
||||||
|
if "%1" == "WITHOUTHTML" set HTML=disabled
|
||||||
|
if not "%HTML%" == "disabled" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:SrcDirOption
|
||||||
|
echo %1 | grep -q "/"
|
||||||
|
if errorlevel 1 goto CollectArgument
|
||||||
|
set XSRC=%1
|
||||||
|
if not "%XSRC%" == "%1" goto SmallEnv
|
||||||
|
goto NextArgument
|
||||||
|
:CollectArgument
|
||||||
|
set _ARGS=%ARGS% %1
|
||||||
|
if not "%_ARGS%" == "%ARGS% %1" if not "%_ARGS%" == "%ARGS%%1" goto SmallEnv
|
||||||
|
echo %_ARGS% | grep -q "[^ ]"
|
||||||
|
if not errorlevel 0 set ARGS=%_ARGS%
|
||||||
|
set _ARGS=
|
||||||
|
:NextArgument
|
||||||
|
shift
|
||||||
|
if not "%1" == "" goto ArgLoop
|
||||||
|
|
||||||
|
Rem Create an arguments file for the configure script.
|
||||||
|
echo --srcdir=%XSRC% > arguments
|
||||||
|
if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> arguments
|
||||||
|
if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> arguments
|
||||||
|
if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments
|
||||||
|
if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> arguments
|
||||||
|
if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> arguments
|
||||||
|
if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> arguments
|
||||||
|
if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> arguments
|
||||||
|
if "%HTML%" == "enabled" echo --enable-html >> arguments
|
||||||
|
if "%HTML%" == "disabled" echo --disable-html >> arguments
|
||||||
|
if not "%ARGS%" == "" echo %ARGS% >> arguments
|
||||||
|
set ARGS=
|
||||||
|
set CACHING=
|
||||||
|
set DEPENDENCY_TRACKING=
|
||||||
|
set LIBICONV_PREFIX=
|
||||||
|
set LIBINTL_PREFIX=
|
||||||
|
set HTML=
|
||||||
|
|
||||||
|
if "%XSRC%" == "." goto InPlace
|
||||||
|
|
||||||
|
:NotInPlace
|
||||||
|
redir -e /dev/null update %XSRC%/configure.orig ./configure
|
||||||
|
test -f ./configure
|
||||||
|
if errorlevel 1 update %XSRC%/configure ./configure
|
||||||
|
|
||||||
|
:InPlace
|
||||||
|
Rem Update configuration files
|
||||||
|
echo Updating configuration scripts...
|
||||||
|
test -f ./configure.orig
|
||||||
|
if errorlevel 1 update configure configure.orig
|
||||||
|
sed -f %XSRC%/djgpp/config.sed configure.orig > configure
|
||||||
|
if errorlevel 1 goto SedError
|
||||||
|
|
||||||
|
Rem Make sure they have a config.site file
|
||||||
|
set CONFIG_SITE=%XSRC%/djgpp/config.site
|
||||||
|
if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
|
||||||
|
|
||||||
|
Rem Make sure crucial file names are not munged by unpacking
|
||||||
|
test -f %XSRC%/po/Makefile.in.in
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in
|
||||||
|
test -f %XSRC%/po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/po/Makefile.in %XSRC%/po/Makefile.in-in
|
||||||
|
test -f %XSRC%/po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/po/Makefile.inin %XSRC%/po/Makefile.in-in
|
||||||
|
test -f %XSRC%/po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/po/Makefile.in_in %XSRC%/po/Makefile.in-in
|
||||||
|
test -f %XSRC%/po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/po/Makefile_in.in %XSRC%/po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in.in
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in.in %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.inin %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile.in_in %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
test -f %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
if errorlevel 1 mv -f %XSRC%/runtime-po/Makefile_in.in %XSRC%/runtime-po/Makefile.in-in
|
||||||
|
test -f %XSRC%/data/c++.m4
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/data/c++.m4 %XSRC%/data/cxx.m4
|
||||||
|
test -f %XSRC%/data/cxx.m4
|
||||||
|
if errorlevel 1 mv -f %XSRC%/data/cpp.m4 %XSRC%/data/cxx.m4
|
||||||
|
:scan_gram_c_Test
|
||||||
|
test -f %XSRC%/src/c-scan-gram.c
|
||||||
|
if not errorlevel 1 goto scan_skel_c_Test
|
||||||
|
test -f %XSRC%/src/scan-gram-c.c
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/src/scan-gram-c.c %XSRC%/src/c-scan-gram.c
|
||||||
|
:scan_skel_c_Test
|
||||||
|
test -f %XSRC%/src/c-scan-skel.c
|
||||||
|
if not errorlevel 1 goto FixFiles
|
||||||
|
test -f %XSRC%/src/scan-skel-c.c
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/src/scan-skel-c.c %XSRC%/src/c-scan-skel.c
|
||||||
|
|
||||||
|
:FixFiles
|
||||||
|
Rem Fix data/lalr1.cc and data/location.cc to reflect the renaming of c++.m4
|
||||||
|
sed "s/c++\.m4/cxx.m4/" %XSRC%/data/lalr1.cc > lalr1.cc
|
||||||
|
if errorlevel 1 goto lalr1_ccFileError
|
||||||
|
mv ./lalr1.cc %XSRC%/data/lalr1.cc
|
||||||
|
sed "s/c++\.m4/cxx.m4/" %XSRC%/data/location.cc > location.cc
|
||||||
|
if errorlevel 1 goto location.ccFileError
|
||||||
|
mv ./location.cc %XSRC%/data/location.cc
|
||||||
|
sed "s/c++\.m4/cxx.m4/" %XSRC%/data/glr.cc > glr.cc
|
||||||
|
if errorlevel 1 goto glr.ccFileError
|
||||||
|
mv ./glr.cc %XSRC%/data/glr.cc
|
||||||
|
|
||||||
|
Rem Define DJGPP specific defs in config.hin
|
||||||
|
echo Editing config.hin...
|
||||||
|
test -f %XSRC%/config_h.orig
|
||||||
|
if errorlevel 1 update %XSRC%/config.hin %XSRC%/config_h.orig
|
||||||
|
sed -f %XSRC%/djgpp/config_h.sed %XSRC%/config_h.orig > config.hin
|
||||||
|
if errorlevel 1 goto SedError2
|
||||||
|
mv -f config.hin %XSRC%/config.hin
|
||||||
|
|
||||||
|
|
||||||
|
Rem Fixing ilicit testsuite file name.
|
||||||
|
test -f %XSRC%/tests/c++.at
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at
|
||||||
|
|
||||||
|
Rem Fixing ilicit calc++ file names in the calc++ directory.
|
||||||
|
test -d %XSRC%/examples/calc++
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx
|
||||||
|
test -d %XSRC%/examples/calcxx
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcpp %XSRC%/examples/calcxx
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-scanner.cc
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-scanner.cc
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-scanner.ll
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-scanner.ll
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-driver.cc
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-driver.cc
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-driver.hh
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-driver.hh
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-parser.cc
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-parser.cc
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-parser.hh
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-parser.hh
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-parser.stamp
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-parser.stamp
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.stamp %XSRC%/examples/calcxx/calcxx-parser.stamp
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++-parser.yy
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx-parser.yy
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy
|
||||||
|
test -f %XSRC%/examples/calcxx/calc++.cc
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/examples/calcxx/calc++.cc %XSRC%/examples/calcxx/calcxx.cc
|
||||||
|
test -f %XSRC%/examples/calcxx/calcxx.cc
|
||||||
|
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp.cc %XSRC%/examples/calcxx/calcxx.cc
|
||||||
|
|
||||||
|
Rem Fixing #include lines in calcxx files.
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx.cc %XSRC%/examples/calcxx/calcxx.cc
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh
|
||||||
|
:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy
|
||||||
|
:if errorlevel 1 goto calcxxFileError
|
||||||
|
:mv ./calcxx-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy
|
||||||
|
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./calcxx-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc
|
||||||
|
:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll
|
||||||
|
:if errorlevel 1 goto calcxxFileError
|
||||||
|
:mv ./calcxx-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll
|
||||||
|
sed "s/calc++/calcxx/" %XSRC%/examples/calcxx/test > test
|
||||||
|
if errorlevel 1 goto calcxxFileError
|
||||||
|
mv ./test %XSRC%/examples/calcxx/test
|
||||||
|
|
||||||
|
|
||||||
|
Rem Fixing the scanner files to make file names 8.3 valid.
|
||||||
|
Rem Use only if you want to change the scan-gram.l and scan-skel.l files.
|
||||||
|
: sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-gram.l > scan-gram.l
|
||||||
|
: if errorlevel 1 goto ScannerFileError
|
||||||
|
: mv ./scan-gram.l %XSRC%/src/scan-gram.l
|
||||||
|
: sed "/outfile=/s/\.yy/yy/" %XSRC%/src/scan-skel.l > scan-skel.l
|
||||||
|
: if errorlevel 1 goto ScannerFileError
|
||||||
|
: mv ./scan-skel.l %XSRC%/src/scan-skel.l
|
||||||
|
|
||||||
|
|
||||||
|
Rem This is required because DOS/Windows are case-insensitive
|
||||||
|
Rem to file names, and "make install" will do nothing if Make
|
||||||
|
Rem finds a file called `install'.
|
||||||
|
if exist INSTALL ren INSTALL INSTALL.txt
|
||||||
|
|
||||||
|
Rem Set SHELL to a sane default or some configure tests stop working
|
||||||
|
Rem if the package is configured across partitions.
|
||||||
|
if not "%SHELL%" == "" goto HomeName
|
||||||
|
set SHELL=/bin/sh
|
||||||
|
if not "%SHELL%" == "/bin/sh" goto SmallEnv
|
||||||
|
echo No SHELL found in the environment, using default value
|
||||||
|
|
||||||
|
:HomeName
|
||||||
|
Rem Set HOME to a sane default so configure stops complaining.
|
||||||
|
if not "%HOME%" == "" goto HostName
|
||||||
|
set HOME=%XSRC%/djgpp
|
||||||
|
if not "%HOME%" == "%XSRC%/djgpp" goto SmallEnv
|
||||||
|
echo No HOME found in the environment, using default value
|
||||||
|
|
||||||
|
:HostName
|
||||||
|
Rem Set HOSTNAME so it shows in config.status
|
||||||
|
if not "%HOSTNAME%" == "" goto hostdone
|
||||||
|
if "%windir%" == "" goto msdos
|
||||||
|
set OS=MS-Windows
|
||||||
|
if not "%OS%" == "MS-Windows" goto SmallEnv
|
||||||
|
goto haveos
|
||||||
|
:msdos
|
||||||
|
set OS=MS-DOS
|
||||||
|
if not "%OS%" == "MS-DOS" goto SmallEnv
|
||||||
|
:haveos
|
||||||
|
if not "%USERNAME%" == "" goto haveuname
|
||||||
|
if not "%USER%" == "" goto haveuser
|
||||||
|
echo No USERNAME and no USER found in the environment, using default values
|
||||||
|
set HOSTNAME=Unknown PC
|
||||||
|
if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
|
||||||
|
goto userdone
|
||||||
|
:haveuser
|
||||||
|
set HOSTNAME=%USER%'s PC
|
||||||
|
if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
|
||||||
|
goto userdone
|
||||||
|
:haveuname
|
||||||
|
set HOSTNAME=%USERNAME%'s PC
|
||||||
|
if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
|
||||||
|
:userdone
|
||||||
|
set _HOSTNAME=%HOSTNAME%, %OS%
|
||||||
|
if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
|
||||||
|
set HOSTNAME=%_HOSTNAME%
|
||||||
|
:hostdone
|
||||||
|
set _HOSTNAME=
|
||||||
|
set OS=
|
||||||
|
|
||||||
|
Rem install-sh is required by the configure script but clashes with the
|
||||||
|
Rem various Makefile install-foo targets, so we MUST have it before the
|
||||||
|
Rem script runs and rename it afterwards
|
||||||
|
test -f %XSRC%/install-sh
|
||||||
|
if not errorlevel 1 goto NoRen0
|
||||||
|
test -f %XSRC%/install-sh.sh
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
|
||||||
|
:NoRen0
|
||||||
|
|
||||||
|
if "%NLS%" == "disabled" goto WithoutNLS
|
||||||
|
|
||||||
|
:WithNLS
|
||||||
|
Rem Check for the needed libraries and binaries.
|
||||||
|
test -x /dev/env/DJDIR/bin/msgfmt.exe
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -x /dev/env/DJDIR/bin/xgettext.exe
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/include/libcharset.h
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/lib/libcharset.a
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/include/iconv.h
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/lib/libiconv.a
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/include/libintl.h
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
test -f /dev/env/DJDIR/lib/libintl.a
|
||||||
|
if errorlevel 1 goto MissingNLSTools
|
||||||
|
|
||||||
|
Rem Recreate the files in the %XSRC%/po subdir with our ported tools.
|
||||||
|
redir -e /dev/null rm %XSRC%/po/*.gmo
|
||||||
|
redir -e /dev/null rm %XSRC%/po/bison.pot
|
||||||
|
redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c
|
||||||
|
redir -e /dev/null rm %XSRC%/po/stamp-cat-id
|
||||||
|
|
||||||
|
Rem Update the arguments file for the configure script.
|
||||||
|
Rem We prefer without-included-gettext because libintl.a from gettext package
|
||||||
|
Rem is the only one that is garanteed to have been ported to DJGPP.
|
||||||
|
echo --enable-nls --without-included-gettext >> arguments
|
||||||
|
goto ConfigurePackage
|
||||||
|
|
||||||
|
:MissingNLSTools
|
||||||
|
echo Needed libs/tools for NLS not found. Configuring without NLS.
|
||||||
|
:WithoutNLS
|
||||||
|
Rem Update the arguments file for the configure script.
|
||||||
|
echo --disable-nls >> arguments
|
||||||
|
|
||||||
|
:ConfigurePackage
|
||||||
|
echo Running the ./configure script...
|
||||||
|
sh ./configure @arguments
|
||||||
|
if errorlevel 1 goto CfgError
|
||||||
|
rm arguments
|
||||||
|
echo Done.
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:lalr1_ccFileError
|
||||||
|
echo ./data/lalr1.cc file editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:glr_ccFileError
|
||||||
|
echo ./data/glr.cc file editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:location_ccFileError
|
||||||
|
echo ./data/location.cc file editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:calcxxFileError
|
||||||
|
echo ./examples/calcxx file editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:ScannerFileError
|
||||||
|
echo ./scanner file editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:SedError
|
||||||
|
echo ./configure script editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:SedError2
|
||||||
|
echo ./config.hin editing failed!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:CfgError
|
||||||
|
echo ./configure script exited abnormally!
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:SmallEnv
|
||||||
|
echo Your environment size is too small. Enlarge it and run me again.
|
||||||
|
echo Configuration NOT done!
|
||||||
|
|
||||||
|
:End
|
||||||
|
test -f %XSRC%/install-sh.sh
|
||||||
|
if not errorlevel 1 goto NoRen1
|
||||||
|
test -f %XSRC%/install-sh
|
||||||
|
if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh
|
||||||
|
:NoRen1
|
||||||
|
if "%SHELL%" == "/bin/sh" set SHELL=
|
||||||
|
if "%HOME%" == "%XSRC%/djgpp" set HOME=
|
||||||
|
set CONFIG_SITE=
|
||||||
|
set HOSTNAME=
|
||||||
|
set NLS=
|
||||||
|
set XSRC=
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
# DJGPP specific configuration file.
|
||||||
|
# Sed script for additional DJGPP specific editing
|
||||||
|
# of the configure script generated by autoconf 2.57.
|
||||||
|
|
||||||
|
|
||||||
|
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
# Additional editing of Makefiles
|
||||||
|
/(echo[ ]*':t/ a\
|
||||||
|
# DJGPP specific Makefile changes.\
|
||||||
|
/^aliaspath * *=/s,:,";",g;t t\
|
||||||
|
/TEXINPUTS=/s,:,";",g;t t\
|
||||||
|
/PATH=/s,:,";",g;t t\
|
||||||
|
s,\\.deps,_deps,g;t t\
|
||||||
|
s,\\.new\\.,_new.,g;t t\
|
||||||
|
s,\\.old\\.,_old.,g;t t\
|
||||||
|
s,c++\\.at,cxx.at,g;t t\
|
||||||
|
s,c++\\.m4,cxx.m4,g;t t\
|
||||||
|
s,calc++,calcxx,g;t t\
|
||||||
|
s,scan-gram-c,c-scan-gram,g;t t\
|
||||||
|
s,scan-skel-c,c-scan-skel,g;t t\
|
||||||
|
s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
|
||||||
|
s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
|
||||||
|
s,(MAKEINFOFLAGS),& --no-split,\
|
||||||
|
/^install-info-am:/,/^$/ {\
|
||||||
|
/@list=/ s,\\\$(INFO_DEPS),& bison.i,\
|
||||||
|
/@for *file/ s,\\\$(INFO_DEPS),& bison.i,\
|
||||||
|
s,file-\\[0-9\\]\\[0-9\\],& \\$\\$file[0-9] \\$\\$file[0-9][0-9],\
|
||||||
|
}\
|
||||||
|
/^\\.y\\.c:/,/^$/ {\
|
||||||
|
/\\\$(YACCCOMPILE)/ {\
|
||||||
|
a\\\\
|
||||||
|
-@test -f y.tab.c && mv -f y.tab.c y_tab.c\\\
|
||||||
|
-@test -f y.tab.h && mv -f y.tab.h y_tab.h\
|
||||||
|
}\
|
||||||
|
}\
|
||||||
|
/^libbison.a:/ i\\\\
|
||||||
|
\\\$(top_srcdir)/djgpp/subpipe.c: \\$(top_srcdir)/djgpp/subpipe.h\\\
|
||||||
|
subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\
|
||||||
|
\\\$(COMPILE) -c \\$<\
|
||||||
|
/^yacc:/ i\\\\
|
||||||
|
yacc.bat:\\\
|
||||||
|
echo "bison\\$(EXEEXT) -y %1 %2 %3 %4 %5 %6 %7 %8 %9" >\\$@\
|
||||||
|
/^bin_SCRIPTS =/s/$/ yacc.bat/\
|
||||||
|
/^MOSTLYCLEANFILES = yacc/s/$/ yacc.bat/
|
||||||
|
|
||||||
|
|
||||||
|
# Makefile.in.in is renamed to Makefile.in-in.
|
||||||
|
/ac_config_files=/,/_ACEOF/ {
|
||||||
|
s|po/Makefile\.in|&:po/Makefile.in-in|
|
||||||
|
}
|
||||||
|
/CONFIG_FILES=/ s|po/Makefile\.in|&:po/Makefile.in-in|2
|
||||||
|
|
||||||
|
# We always use _deps and _libs instead of .deps and .libs, because
|
||||||
|
# the latter is an invalid name on 8+3 MS-DOS file system. This makes
|
||||||
|
# the generated Makefiles good for every DJGPP installation, not only
|
||||||
|
# the one where the package was configured (which could happen to be
|
||||||
|
# a Windows box, where leading dots in file names are allowed).
|
||||||
|
s,\.deps,_deps,g
|
||||||
|
s,\.libs,_libs,g
|
||||||
|
/^rmdir[ ]*\.tst/ i\
|
||||||
|
am__leading_dot=_
|
||||||
|
|
||||||
|
# Replace (command) > /dev/null with `command > /dev/null`, since
|
||||||
|
# parenthesized commands always return zero status in the ported Bash,
|
||||||
|
# even if the named command doesn't exist
|
||||||
|
/if ([^|;`]*null/{
|
||||||
|
s,(,`,
|
||||||
|
s,),,
|
||||||
|
/null[ ]*2>&1/ s,2>&1,&`,
|
||||||
|
/null.*null/ s,null.*null,&`,
|
||||||
|
/null.*null/ !{
|
||||||
|
/null[ ]*2>&1/ !s,null,&`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# DOS-style absolute file names should be supported as well
|
||||||
|
/\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*,
|
||||||
|
|
||||||
|
# Prevent the spliting of subs.sed.
|
||||||
|
# The sed script: subs.sed is split into 48 lines long files.
|
||||||
|
# This will produce sed scripts called subs-$ac_sed_frag.sed, where
|
||||||
|
# $ac_sed_frag is some unique number. This will not work if the splited
|
||||||
|
# sed script contains a multiple line sed command at line #48. In this
|
||||||
|
# case the first part of the multiple line sed command will be written
|
||||||
|
# at the end of one particular subs-$ac_sed_frag.sed and the rest of the
|
||||||
|
# sed command will be written at the begining of the next subs-$ac_sed_frag.sed
|
||||||
|
# making both sed script useless.
|
||||||
|
# This matches the configure script produced by Autoconf 2.57
|
||||||
|
/ac_max_sed_lines=[0-9]/ s,=.*$,=`sed -n "$=" $tmp/subs.sed`,
|
||||||
|
|
||||||
|
# The following two items are changes needed for configuring
|
||||||
|
# and compiling across partitions.
|
||||||
|
# 1) The given srcdir value is always translated from the
|
||||||
|
# "x:" syntax into "/dev/x" syntax while we run configure.
|
||||||
|
/^[ ]*-srcdir=\*.*$/ a\
|
||||||
|
ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
|
||||||
|
/set X `ls -Lt \$srcdir/ i\
|
||||||
|
if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
|
||||||
|
srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Autoconf 2.52e generated configure scripts
|
||||||
|
# write absolute paths into Makefiles and bison.in
|
||||||
|
# making them useless for DJGPP installations for
|
||||||
|
# which the package has not been configured for.
|
||||||
|
/MISSING=/,/^$/ {
|
||||||
|
/^fi$/ a\
|
||||||
|
am_missing_run=`echo "$am_missing_run" | sed 's%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%'`
|
||||||
|
}
|
||||||
|
/^install_sh=/a\
|
||||||
|
install_sh=`echo "$install_sh" | sed 's%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*%${top_srcdir}%'`
|
||||||
|
|
||||||
|
# This will only work if the assumption that the
|
||||||
|
# testsuite is ran from the following path:
|
||||||
|
# ${top_srcdir}/tests/testsuite.dir
|
||||||
|
# holds. The explicit names are of no importance.
|
||||||
|
# ../../. == ${top_srcdir}
|
||||||
|
/\.)[ ]*ac_abs_builddir=/,/^esac$/ {
|
||||||
|
/^esac$/ a\
|
||||||
|
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
|
||||||
|
}
|
||||||
|
/\.)[ ]*ac_abs_top_builddir=/,/^esac$/ {
|
||||||
|
/^esac$/ a\
|
||||||
|
ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
|
||||||
|
}
|
||||||
|
/\.)[ ]*ac_abs_srcdir=/,/^esac$/ {
|
||||||
|
/^esac$/ a\
|
||||||
|
ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
|
||||||
|
}
|
||||||
|
/\.)[ ]*ac_abs_top_srcdir=/,/^esac$/ {
|
||||||
|
/^esac$/ a\
|
||||||
|
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add DJGPP version information.
|
||||||
|
/^#define VERSION/ s/\$VERSION/& (DJGPP port (r1))/
|
||||||
|
|
||||||
|
# We need makeinfo to make the html formated docs.
|
||||||
|
/\$am_missing_run[ ]*makeinfo/ s,\$am_missing_run,,
|
||||||
|
|
||||||
|
# The path to the FORTRAN compiler and libraries
|
||||||
|
# shall contain no absolute path reference so it
|
||||||
|
# will be good for all djgpp installations.
|
||||||
|
/^FLIBS="\$ac_cv_flibs"/ i\
|
||||||
|
ac_djgpp_path=`echo "$DJDIR" | sed 's%\\\\\\%/%g' | tr $as_cr_LETTERS $as_cr_letters`\
|
||||||
|
ac_cv_flibs=`echo "$ac_cv_flibs" | sed "s%-L$ac_djgpp_path%-L/dev/env/DJDIR%g"`
|
||||||
|
|
||||||
|
# The following is not a valid DOS file name
|
||||||
|
s/calc++/calcxx/g
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# This is the config.site file for configuring GNU packages
|
||||||
|
# which are to be built with DJGPP tools.
|
||||||
|
|
||||||
|
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This 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.
|
||||||
|
|
||||||
|
|
||||||
|
# Include the djgpp subdirectory in PATH, so that getconf is found
|
||||||
|
PATH="$srcdir/djgpp:$PATH"
|
||||||
|
|
||||||
|
# These two variables are required, otherwise looking for
|
||||||
|
# programs along the PATH will not work.
|
||||||
|
PATH_SEPARATOR=:
|
||||||
|
PATH_EXPAND=y
|
||||||
|
|
||||||
|
# This is required in for "test -f foo" to find foo.exe
|
||||||
|
export TEST_FINDS_EXE=y
|
||||||
|
|
||||||
|
# The root of the DJGPP tree serves as the default prefix
|
||||||
|
test "x$prefix" = xNONE && prefix='/dev/env/DJDIR'
|
||||||
|
|
||||||
|
# This is required for config.status script to be run, since
|
||||||
|
# ./configure runs it by invoking ${CONFIG_SHELL-/bin/sh}
|
||||||
|
CONFIG_SHELL=${CONFIG_SHELL='sh'}
|
||||||
|
|
||||||
|
# These are set here so the generated Makefile's will be good
|
||||||
|
# for every DJGPP installation, not only the one where the
|
||||||
|
# package was configured.
|
||||||
|
# $INSTALL must be an absolute path name, otherwise config.status
|
||||||
|
# will try to prepend ./ and ../ to it when it goes into subdirs.
|
||||||
|
INSTALL=${INSTALL='/dev/env/DJDIR/bin/ginstall -c'}
|
||||||
|
RANLIB=${RANLIB='ranlib'}
|
||||||
|
GMSGFMT=${GMSGFMT='/dev/env/DJDIR/bin/msgfmt'}
|
||||||
|
MSGFMT=${MSGFMT='/dev/env/DJDIR/bin/msgfmt'}
|
||||||
|
XGETTEXT=${XGETTEXT='/dev/env/DJDIR/bin/xgettext'}
|
||||||
|
AWK=${AWK='gawk'}
|
||||||
|
|
||||||
|
# A sane default for emacs.
|
||||||
|
ac_cv_path_EMACS=${EMACS='/dev/env/DJDIR/gnu/emacs/bin/emacs'}
|
||||||
|
|
||||||
|
# A sane default for m4.
|
||||||
|
ac_cv_path_M4=${M4='/dev/env/DJDIR/bin/m4'}
|
||||||
|
|
||||||
|
# A sane default for grep.
|
||||||
|
ac_cv_path_GREP=${GREP='/dev/env/DJDIR/bin/grep'}
|
||||||
|
|
||||||
|
# A sane default for egrep.
|
||||||
|
ac_cv_path_EGREP=${EGREP='/dev/env/DJDIR/bin/egrep'}
|
||||||
|
|
||||||
|
# A sane default for fgrep.
|
||||||
|
ac_cv_path_FGREP=${FGREP='/dev/env/DJDIR/bin/fgrep'}
|
||||||
|
|
||||||
|
# A sane default for sed.
|
||||||
|
ac_cv_path_SED=${SED='/dev/env/DJDIR/bin/sed'}
|
||||||
|
|
||||||
|
# These are set here so the generated libtool will be good
|
||||||
|
# for every DJGPP installation, not only the one where the
|
||||||
|
# package was configured.
|
||||||
|
NM=${NM='nm'}
|
||||||
|
LD=${LD='ld'}
|
||||||
|
|
||||||
|
# Force the test for 'ln -s' to report 'cp -pf'.
|
||||||
|
ac_cv_prog_LN_S='cp -pf'
|
||||||
|
|
||||||
|
# There is no fork and vfork functionality.
|
||||||
|
ac_cv_func_fork=no
|
||||||
|
ac_cv_func_vfork=no
|
||||||
|
ac_cv_func_pipe=no
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# sed script for DJGPP specific editing of config.hin
|
||||||
|
|
||||||
|
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, 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.
|
||||||
|
|
||||||
|
|
||||||
|
$ a\
|
||||||
|
\
|
||||||
|
\
|
||||||
|
/* DJGPP specific defines. */\
|
||||||
|
\
|
||||||
|
#include <unistd.h>\
|
||||||
|
#define TAB_EXT ((pathconf(NULL, _PC_NAME_MAX) > 12) ? ".tab" : "_tab")\
|
||||||
|
#define OUTPUT_EXT ((pathconf(NULL, _PC_NAME_MAX) > 12) ? ".output" : ".out")\
|
||||||
|
\
|
||||||
|
#define DEFAULT_TMPDIR "/dev/env/DJDIR/tmp"
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
@echo off
|
||||||
|
Rem
|
||||||
|
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||||
|
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||||
|
Rem
|
||||||
|
Rem This batch file unpacks the Bison distribution while simultaneously
|
||||||
|
Rem renaming some of the files whose names are invalid on DOS or conflict
|
||||||
|
Rem with other file names after truncation to DOS 8+3 namespace.
|
||||||
|
Rem
|
||||||
|
Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
Rem
|
||||||
|
Rem This program is free software; you can redistribute it and/or modify
|
||||||
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
|
Rem the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
Rem any later version.
|
||||||
|
Rem
|
||||||
|
Rem This program is distributed in the hope that it will be useful,
|
||||||
|
Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
Rem GNU General Public License for more details.
|
||||||
|
Rem
|
||||||
|
Rem You should have received a copy of the GNU General Public License
|
||||||
|
Rem along with this program; if not, write to the Free Software Foundation,
|
||||||
|
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
Rem
|
||||||
|
Rem
|
||||||
|
Rem Invoke like this:
|
||||||
|
Rem
|
||||||
|
Rem djunpack bison-XYZ.tar.gz
|
||||||
|
Rem or
|
||||||
|
Rem djunpack bison-XYZ.tar.bz2
|
||||||
|
Rem
|
||||||
|
Rem where XYZ is the version number. If the argument includes leading
|
||||||
|
Rem directories, it MUST use backslashes, not forward slashes.
|
||||||
|
Rem
|
||||||
|
|
||||||
|
set ENVIRONMENT_SIZE_TEST_STRING=ENVIRONMENT_SIZE_TEST_STRING
|
||||||
|
if "%ENVIRONMENT_SIZE_TEST_STRING%"=="ENVIRONMENT_SIZE_TEST_STRING" GoTo EnvOk
|
||||||
|
Rem If their environment space is too small, re-exec with a larger one
|
||||||
|
command.com /e:4096 /c %0 %1
|
||||||
|
GoTo End
|
||||||
|
|
||||||
|
:EnvOk
|
||||||
|
set ENVIRONMENT_SIZE_TEST_STRING=
|
||||||
|
if "%1" == "" GoTo NoArgument
|
||||||
|
if not exist %1 GoTo NoArchive
|
||||||
|
Rem Extract top src dir from archive file.
|
||||||
|
djtar -t %1 > top_src.dir
|
||||||
|
Rem The following uses a feature of COPY whereby it does not copy
|
||||||
|
Rem empty files. We need that because the previous line will create
|
||||||
|
Rem an empty fnchange.tmp even if the command failed for some reason.
|
||||||
|
copy top_src.dir junk.tmp > nul
|
||||||
|
if not exist junk.tmp GoTo NoDjTar
|
||||||
|
del junk.tmp
|
||||||
|
sed "1{s/^.*bison-/djtar -x -p -o bison-/;s|$|djgpp/fnchange.lst %%1 > fnchange.tmp|};2,$d" top_src.dir > ext_list.bat
|
||||||
|
Rem See the comment above about the reason for using COPY.
|
||||||
|
copy ext_list.bat junk.tmp > nul
|
||||||
|
if not exist junk.tmp GoTo NoSed
|
||||||
|
del junk.tmp
|
||||||
|
Rem Extract fnchange.lst from archive.
|
||||||
|
call ext_list.bat %1
|
||||||
|
del ext_list.bat
|
||||||
|
sed "1{s|^.*bison-|s/@V@/bison-|;s|$|g|};2,$d" top_src.dir > version.sed
|
||||||
|
sed -f version.sed < fnchange.tmp > fnchange.lst
|
||||||
|
del version.sed
|
||||||
|
del fnchange.tmp
|
||||||
|
del top_src.dir
|
||||||
|
Rem unpack the source distribution
|
||||||
|
djtar -x -n fnchange.lst %1
|
||||||
|
del fnchange.lst
|
||||||
|
GoTo End
|
||||||
|
|
||||||
|
:NoSed
|
||||||
|
del junk.tmp
|
||||||
|
echo FAIL: Sed is not available.
|
||||||
|
GoTo End
|
||||||
|
:NoDjTar
|
||||||
|
del junk.tmp
|
||||||
|
echo FAIL: DJTAR is not available or no fnchange.lst file in %1.
|
||||||
|
GoTo End
|
||||||
|
:NoArchive
|
||||||
|
echo FAIL: the file %1 does not seem to exist.
|
||||||
|
echo Remember that %1 cannot use forward slashes, only backslashes.
|
||||||
|
GoTo End
|
||||||
|
:NoArgument
|
||||||
|
echo FAIL: no archive file has been specified.
|
||||||
|
echo Remember that the file name cannot use forward slashes, only backslashes.
|
||||||
|
:End
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
@V@/src/scan-gram-c.c @V@/src/c-scan-gram.c
|
||||||
|
@V@/src/scan-skel-c.c @V@/src/c-scan-skel.c
|
||||||
+285
@@ -0,0 +1,285 @@
|
|||||||
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
|
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
/* Written by Juan Manuel Guerrero <[email protected]>. */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "subpipe.h"
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <process.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include "xalloc.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef STDIN_FILENO
|
||||||
|
# define STDIN_FILENO 0
|
||||||
|
#endif
|
||||||
|
#ifndef STDOUT_FILENO
|
||||||
|
# define STDOUT_FILENO 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include "error.h"
|
||||||
|
|
||||||
|
#include "gettext.h"
|
||||||
|
#define _(Msgid) gettext (Msgid)
|
||||||
|
|
||||||
|
|
||||||
|
/* Initialize this module. */
|
||||||
|
|
||||||
|
|
||||||
|
static int old_stdin;
|
||||||
|
static int old_stdout;
|
||||||
|
static char **arguments;
|
||||||
|
static char tmp_file_name[2][L_tmpnam];
|
||||||
|
|
||||||
|
#define remove_tmp_file(fd, name) \
|
||||||
|
do { \
|
||||||
|
close ((fd)); \
|
||||||
|
if (unlink ((name))) \
|
||||||
|
error (EXIT_FAILURE, 0, _("removing of `%s' failed"), (name)); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
init_subpipe(void)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
strcpy(tmp_file_name[0], "/dev/env/TMPDIR/bnXXXXXX");
|
||||||
|
fd = mkstemp(tmp_file_name[0]);
|
||||||
|
if (fd < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
||||||
|
close (fd);
|
||||||
|
|
||||||
|
strcpy(tmp_file_name[1], "/dev/env/TMPDIR/bnXXXXXX");
|
||||||
|
fd = mkstemp(tmp_file_name[1]);
|
||||||
|
if (fd < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
|
||||||
|
close (fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Create a subprocess that is run as a filter. ARGV is the
|
||||||
|
NULL-terminated argument vector for the subprocess. Store read and
|
||||||
|
write file descriptors for communication with the subprocess into
|
||||||
|
FD[0] and FD[1]: input meant for the process can be written into
|
||||||
|
FD[0], and output from the process can be read from FD[1]. Return
|
||||||
|
the subprocess id.
|
||||||
|
|
||||||
|
Because DOS has neither fork nor pipe functionality to run the subprocess
|
||||||
|
as a filter, the filter is reproduced using temporary files. First bison's
|
||||||
|
stdout is redirected to a temporary file. After bison has produced all of
|
||||||
|
is output, this file is closed and connected to m4's stdin. All m4's output
|
||||||
|
is redirected from m4's stdout to a second temporary file and reopened as
|
||||||
|
bison's stdin. */
|
||||||
|
|
||||||
|
pid_t
|
||||||
|
create_subpipe(char const *const *argv, int fd[2])
|
||||||
|
{
|
||||||
|
int argc;
|
||||||
|
int from_in_fd; /* pipe from bison to m4. */
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
|
|
||||||
|
pid = getpid();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Save original stdin and stdout
|
||||||
|
* for later restauration.
|
||||||
|
*/
|
||||||
|
old_stdin = dup(STDIN_FILENO);
|
||||||
|
if (old_stdin < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("saving stdin failed"));
|
||||||
|
|
||||||
|
old_stdout = dup(STDOUT_FILENO);
|
||||||
|
if (old_stdout < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("saving stdout failed"));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Save argv for later use.
|
||||||
|
*/
|
||||||
|
for (argc = 0; argv[argc]; argc++)
|
||||||
|
;
|
||||||
|
argc++;
|
||||||
|
arguments = xmalloc(argc * sizeof(arguments[0]));
|
||||||
|
for (argc = 0; argv[argc]; argc++)
|
||||||
|
{
|
||||||
|
arguments[argc] = xmalloc((strlen(argv[argc]) + 1) * sizeof(arguments[0][0]));
|
||||||
|
strcpy(arguments[argc], argv[argc]);
|
||||||
|
}
|
||||||
|
arguments[argc] = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* All bison's output will be gathered in this temporary file
|
||||||
|
* and will be redirected to m4's stdin.
|
||||||
|
*/
|
||||||
|
from_in_fd = open(tmp_file_name[0], O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR);
|
||||||
|
if (from_in_fd < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("opening of tmpfile failed"));
|
||||||
|
if (dup2(from_in_fd, STDOUT_FILENO) < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(from_in_fd, tmp_file_name[0]);
|
||||||
|
error(EXIT_FAILURE, 0, _("redirecting bison's stdout to the temporary file failed"));
|
||||||
|
}
|
||||||
|
close(from_in_fd);
|
||||||
|
|
||||||
|
|
||||||
|
fd[0] = STDOUT_FILENO;
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* A signal handler that just records that a signal has happened. */
|
||||||
|
static int child_interrupted;
|
||||||
|
|
||||||
|
static void
|
||||||
|
signal_catcher(int signo)
|
||||||
|
{
|
||||||
|
child_interrupted++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
end_of_output_subpipe(pid_t pid, int fd[2])
|
||||||
|
{
|
||||||
|
char *program;
|
||||||
|
int from_out_fd = open(tmp_file_name[0], O_RDONLY, S_IRUSR); /* pipe from bison to m4. */
|
||||||
|
int to_in_fd = open(tmp_file_name[1], O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR); /* pipe from m4 to bison. */
|
||||||
|
int status;
|
||||||
|
void (*previous_handler)(int);
|
||||||
|
|
||||||
|
|
||||||
|
program = strrchr(arguments[0], '/');
|
||||||
|
if (program)
|
||||||
|
program++;
|
||||||
|
else
|
||||||
|
program = arguments[0];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Redirect bison's output to m4's stdin.
|
||||||
|
*/
|
||||||
|
if (from_out_fd < 0)
|
||||||
|
error(EXIT_FAILURE, 0, _("opening of tmpfile failed"));
|
||||||
|
if (dup2(from_out_fd, STDIN_FILENO) < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(from_out_fd, tmp_file_name[0]);
|
||||||
|
error(EXIT_FAILURE, 0, _("redirecting m4's stdin from the temporary file failed"));
|
||||||
|
}
|
||||||
|
close(from_out_fd);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* All m4's output will be gathered in this temporary file
|
||||||
|
* and will be redirected to bison's stdin.
|
||||||
|
*/
|
||||||
|
if (to_in_fd < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
error(EXIT_FAILURE, 0, _("opening of a temporary file failed"));
|
||||||
|
}
|
||||||
|
if (dup2(to_in_fd, STDOUT_FILENO) < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
remove_tmp_file(to_in_fd, tmp_file_name[1]);
|
||||||
|
error(EXIT_FAILURE, 0, _("redirecting m4's stdout to a temporary file failed"));
|
||||||
|
}
|
||||||
|
close(to_in_fd);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Run m4.
|
||||||
|
*/
|
||||||
|
child_interrupted = 0;
|
||||||
|
errno = 0;
|
||||||
|
previous_handler = signal(SIGINT, signal_catcher);
|
||||||
|
status = spawnvp(P_WAIT, program, arguments);
|
||||||
|
signal(SIGINT, previous_handler);
|
||||||
|
if (child_interrupted)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
|
error(EXIT_FAILURE, 0, _("subsidiary program `%s' interrupted"), program);
|
||||||
|
}
|
||||||
|
if (status)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
|
error(EXIT_FAILURE, 0, _(errno == ENOENT
|
||||||
|
? "subsidiary program `%s' not found"
|
||||||
|
: status < 1
|
||||||
|
? "subsidiary program `%s' failed"
|
||||||
|
: "subsidiary program `%s' failed (status=%i, errno=%i)"), program, status, errno);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Redirect m4's output to bison's stdin.
|
||||||
|
*/
|
||||||
|
if (dup2(old_stdout, STDOUT_FILENO) < 0)
|
||||||
|
error(EXIT_FAILURE, 0, "restore of bison's stdout failed");
|
||||||
|
close(old_stdout);
|
||||||
|
to_in_fd = open(tmp_file_name[1], O_RDONLY, S_IRUSR); /* pipe from m4 to bison. */
|
||||||
|
if (to_in_fd < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
error(EXIT_FAILURE, 0, _("opening of tmpfile failed"));
|
||||||
|
}
|
||||||
|
if (dup2(to_in_fd, STDIN_FILENO) < 0)
|
||||||
|
{
|
||||||
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
|
remove_tmp_file(to_in_fd, tmp_file_name[1]);
|
||||||
|
error(EXIT_FAILURE, -1, "dup2");
|
||||||
|
error(EXIT_FAILURE, 0, _("redirecting bison's stdin from the temporary file failed"));
|
||||||
|
}
|
||||||
|
close(to_in_fd);
|
||||||
|
|
||||||
|
|
||||||
|
fd[1] = STDIN_FILENO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Free resources, unlink temporary files and restore stdin and stdout. */
|
||||||
|
|
||||||
|
void
|
||||||
|
reap_subpipe(pid_t pid, char const *program)
|
||||||
|
{
|
||||||
|
int argc;
|
||||||
|
|
||||||
|
for (argc = 0; arguments[argc]; argc++)
|
||||||
|
free(arguments[argc]);
|
||||||
|
free(arguments);
|
||||||
|
|
||||||
|
if (unlink(tmp_file_name[0]))
|
||||||
|
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[0]);
|
||||||
|
if (unlink(tmp_file_name[1]))
|
||||||
|
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[1]);
|
||||||
|
|
||||||
|
if (dup2(old_stdin, STDIN_FILENO) < 0)
|
||||||
|
error(EXIT_FAILURE, 0, "restore of bison's stdin failed");
|
||||||
|
close(old_stdin);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/* Subprocesses with pipes.
|
||||||
|
Copyright (C) 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
|
/* Written by Juan Manuel Guerrero <[email protected]>. */
|
||||||
|
|
||||||
|
#if HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void init_subpipe(void);
|
||||||
|
pid_t create_subpipe(char const * const *, int[2]);
|
||||||
|
void end_of_output_subpipe(pid_t, int[2]);
|
||||||
|
void reap_subpipe(pid_t, char const *);
|
||||||
@@ -4,6 +4,7 @@ bison.cp
|
|||||||
bison.cps
|
bison.cps
|
||||||
bison.dvi
|
bison.dvi
|
||||||
bison.fn
|
bison.fn
|
||||||
|
bison.html
|
||||||
bison.ky
|
bison.ky
|
||||||
bison.log
|
bison.log
|
||||||
bison.pdf
|
bison.pdf
|
||||||
|
|||||||
+1087
File diff suppressed because it is too large
Load Diff
@@ -1,109 +0,0 @@
|
|||||||
Frequently Asked Questions about Bison:
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q1. Is Bison Y2K compliant?
|
|
||||||
|
|
||||||
A1. If you're looking for a guarantee or certification, I can't
|
|
||||||
provide it. With a little thought you can answer this one for
|
|
||||||
yourself, though. (Hint: does a parser generator rely on the
|
|
||||||
date or time for anything?) If you're still confused, see
|
|
||||||
http://www.gnu.org/software/year2000.html for more information.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q2. I can't build Bison because "make" complains that "msgfmt" is not
|
|
||||||
found. What should I do?
|
|
||||||
|
|
||||||
A2. Like most GNU packages with internationalization support, that
|
|
||||||
feature is turned on by default. If you have problems building
|
|
||||||
in the "po" subdirectory, it indicates that your system's
|
|
||||||
internationalization support is lacking. You can re-configure
|
|
||||||
Bison with "--disable-nls" to turn off this support, or you can
|
|
||||||
install GNU gettext from ftp://ftp.gnu.org/gnu/gettext/ and
|
|
||||||
re-configure Bison. See the file "ABOUT-NLS" for more
|
|
||||||
information.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q3. I'm having trouble using Bison. Where can I find help?
|
|
||||||
|
|
||||||
A3. First, read the fine manual which comes with bison. Beyond that,
|
|
||||||
you can send mail to <[email protected]>. This mailing list is
|
|
||||||
intended to be populated with people who are willing to answer
|
|
||||||
questions about using and installing Bison. Please keep in mind
|
|
||||||
that (most of) the people on the list have aspects of their lives
|
|
||||||
which are not related to Bison (!), so you may not receive an
|
|
||||||
answer to your question right away. This can be frustrating, but
|
|
||||||
please try not to honk them off; remember that any help they
|
|
||||||
provide is purely voluntary and out of the kindness of their
|
|
||||||
hearts.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q4. I found a bug. What should I include in the bug report?
|
|
||||||
|
|
||||||
A4. Before you send a bug report, make sure you are using the latest
|
|
||||||
version. Check ftp://ftp.gnu.org/pub/gnu/bison/ or one of its
|
|
||||||
mirrors. Be sure to include the version number in your bug
|
|
||||||
report. If the bug is present in the latest version but not in a
|
|
||||||
previous version, try to determine the most recent version which
|
|
||||||
did not contain the bug.
|
|
||||||
|
|
||||||
If the bug is parser-related, you should include the smallest
|
|
||||||
grammar you can which demonstrates the bug. The grammar file
|
|
||||||
should also be complete (i.e., I should be able to run it through
|
|
||||||
Bison without having to edit or add anything). The smaller and
|
|
||||||
simpler the grammar, the easier it will be to fix the bug.
|
|
||||||
|
|
||||||
Include information about your compilation environment, including
|
|
||||||
your operating system's name and version and your compiler's name
|
|
||||||
and version. If you have trouble compiling, you should also
|
|
||||||
include a transcript of the build session, starting with the
|
|
||||||
invocation of `configure'. Depending on the nature of the bug,
|
|
||||||
you may be asked to send additional files as well (such as
|
|
||||||
`config.h' or `config.cache').
|
|
||||||
|
|
||||||
Patches are most welcome, but not required. That is, do not
|
|
||||||
hesitate to send a bug report just because you can not provide a
|
|
||||||
fix.
|
|
||||||
|
|
||||||
Send bug reports to <[email protected]>.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q5. Will Bison ever have C++ support?
|
|
||||||
|
|
||||||
A5. Yes, it's in the works. Things are very chaotic right now, but
|
|
||||||
what little information floats around is posted to the bug-bison
|
|
||||||
mailing list. If you're interested in testing C++ support when
|
|
||||||
it becomes available, please consider subscribing to the list,
|
|
||||||
especially if you are willing to beta test other releases as
|
|
||||||
well.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q6. What is involved in being a beta tester?
|
|
||||||
|
|
||||||
A6. It's not terribly involved. Basically, you would download a test
|
|
||||||
release, compile it, and use it to build and run a parser or two.
|
|
||||||
After that, you would submit either a bug report or a message
|
|
||||||
saying that everything is okay. It is important to report
|
|
||||||
successes as well as failures because test releases eventually
|
|
||||||
become mainstream releases, but only if they are adequately
|
|
||||||
tested. If no one tests, development is essentially halted.
|
|
||||||
|
|
||||||
Beta testers are particularly needed for operating systems to
|
|
||||||
which I do not have access. I currently have easy access to
|
|
||||||
Linux (x86 glibc 2.1), Solaris (SPARC) 2.6 and 2.7, and HP-UX
|
|
||||||
10.20. Reports about other operating systems are especially
|
|
||||||
welcome.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
Q7. How do I join the help-bison and bug-bison mailing lists?
|
|
||||||
|
|
||||||
A7. See http://www.gnu.org/ (the section about "GNU mailing lists")
|
|
||||||
for more information.
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
+40
-4
@@ -1,5 +1,5 @@
|
|||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
## Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
## Copyright (C) 2001, 2002, 2003, 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
|
||||||
@@ -13,19 +13,55 @@
|
|||||||
|
|
||||||
## 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, write to the Free Software
|
||||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
## 02111-1307 USA
|
## 02110-1301 USA
|
||||||
|
|
||||||
AM_MAKEINFOFLAGS = --no-split
|
AM_MAKEINFOFLAGS = --no-split
|
||||||
info_TEXINFOS = bison.texinfo
|
info_TEXINFOS = bison.texinfo
|
||||||
man_MANS = bison.1
|
man_MANS = bison.1
|
||||||
bison_TEXINFOS = gpl.texi fdl.texi
|
bison_TEXINFOS = gpl.texi fdl.texi
|
||||||
|
|
||||||
EXTRA_DIST = FAQ bison.1 refcard.tex
|
EXTRA_DIST = bison.1 refcard.tex
|
||||||
|
|
||||||
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
|
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
|
||||||
|
CLEANDIRS = *.t2d
|
||||||
|
clean-local:
|
||||||
|
rm -rf $(CLEANDIRS)
|
||||||
|
|
||||||
refcard.dvi: refcard.tex
|
refcard.dvi: refcard.tex
|
||||||
tex refcard.tex
|
tex refcard.tex
|
||||||
|
|
||||||
refcard.ps: refcard.dvi
|
refcard.ps: refcard.dvi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## -------------- ##
|
||||||
|
## Doxygenation. ##
|
||||||
|
## -------------- ##
|
||||||
|
|
||||||
|
DOXYGEN = doxygen
|
||||||
|
|
||||||
|
.PHONY: doc html
|
||||||
|
|
||||||
|
doc: html
|
||||||
|
|
||||||
|
html-local: Doxyfile
|
||||||
|
$(DOXYGEN)
|
||||||
|
|
||||||
|
edit = sed -e "s|@ID@|$$Id|" \
|
||||||
|
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
||||||
|
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
||||||
|
-e 's,@top_builddir\@,$(top_builddir),g' \
|
||||||
|
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
||||||
|
|
||||||
|
EXTRA_DIST += Doxyfile.in
|
||||||
|
CLEANFILES += Doxyfile
|
||||||
|
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
||||||
|
# configure, because the former is way faster than the latter.
|
||||||
|
# Moreover, this file is updated whenever ChangeLog is touched: using
|
||||||
|
# sed instead of configure saves us a lot of time.
|
||||||
|
Doxyfile: $(top_srcdir)/ChangeLog $(srcdir)/Doxyfile.in
|
||||||
|
Id=`grep '^\$$Id' $(top_srcdir)/ChangeLog`; \
|
||||||
|
$(edit) $(srcdir)/Doxyfile.in >Doxyfile
|
||||||
|
|
||||||
|
CLEANDIRS += html latex
|
||||||
|
|||||||
+1
-1
@@ -284,7 +284,7 @@ so that the debugging facilities are compiled.
|
|||||||
.TP
|
.TP
|
||||||
.B \-\-verbose
|
.B \-\-verbose
|
||||||
Write an extra output file containing verbose descriptions of the
|
Write an extra output file containing verbose descriptions of the
|
||||||
parser states and what is done for each type of look-ahead token in
|
parser states and what is done for each type of lookahead token in
|
||||||
that state.
|
that state.
|
||||||
.sp
|
.sp
|
||||||
This file also describes all the conflicts, both those resolved by
|
This file also describes all the conflicts, both those resolved by
|
||||||
|
|||||||
+1861
-481
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
@display
|
@display
|
||||||
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
|
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.
|
||||||
@@ -420,8 +420,8 @@ license notices just after the title page:
|
|||||||
Permission is granted to copy, distribute and/or modify this document
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
under the terms of the GNU Free Documentation License, Version 1.2
|
under the terms of the GNU Free Documentation License, Version 1.2
|
||||||
or any later version published by the Free Software Foundation;
|
or any later version published by the Free Software Foundation;
|
||||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||||
A copy of the license is included in the section entitled ``GNU
|
Texts. A copy of the license is included in the section entitled ``GNU
|
||||||
Free Documentation License''.
|
Free Documentation License''.
|
||||||
@end group
|
@end group
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
@display
|
@display
|
||||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
51 Franklin Street, 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.
|
||||||
@@ -352,7 +352,7 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
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.
|
||||||
|
|||||||
+9
-9
@@ -35,8 +35,8 @@
|
|||||||
%
|
%
|
||||||
% 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 either Flex or Bison; see the file COPYING. If not, write
|
||||||
% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
% Boston, MA 02111-1307, USA.
|
% 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).
|
||||||
%
|
%
|
||||||
@@ -96,9 +96,9 @@ For information, write to the:
|
|||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{Free Software Foundation, Inc.}
|
\centerline{Free Software Foundation, Inc.}
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{59 Temple Place - Suite 330}
|
\centerline{51 Franklin Street, Fifth Floor}
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{Boston, MA 02111-1307 USA}
|
\centerline{Boston, MA 02110-1301 USA}
|
||||||
\endgroup}
|
\endgroup}
|
||||||
|
|
||||||
%%%% smallcopyrightnotice for two column printing on one page.
|
%%%% smallcopyrightnotice for two column printing on one page.
|
||||||
@@ -121,9 +121,9 @@ For information, write to the:
|
|||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{Free Software Foundation, Inc.}
|
\centerline{Free Software Foundation, Inc.}
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{59 Temple Place - Suite 330}
|
\centerline{51 Franklin Street, Fifth Floor}
|
||||||
\vskip .2\baselineskip
|
\vskip .2\baselineskip
|
||||||
\centerline{Boston, MA 02111-1307 USA}
|
\centerline{Boston, MA 02110-1301 USA}
|
||||||
\endgroup}
|
\endgroup}
|
||||||
|
|
||||||
% make \bye not \outer so that the \def\bye in the \else clause below
|
% make \bye not \outer so that the \def\bye in the \else clause below
|
||||||
@@ -458,7 +458,7 @@ as either {\tt first_column} or {\tt last_column}.
|
|||||||
\section {Variables and Types}
|
\section {Variables and Types}
|
||||||
%*****************************
|
%*****************************
|
||||||
|
|
||||||
\key{Current look ahead token.} {yychar}
|
\key{Current lookahead token.} {yychar}
|
||||||
\key{Debug mode flag.} {yydebug}
|
\key{Debug mode flag.} {yydebug}
|
||||||
\key{Data associated with the current token.} {yylval}
|
\key{Data associated with the current token.} {yylval}
|
||||||
\key{Source position of current token.} {yylloc}
|
\key{Source position of current token.} {yylloc}
|
||||||
@@ -489,8 +489,8 @@ as either {\tt first_column} or {\tt last_column}.
|
|||||||
\key{Quit parsing immediately. Return 1.} {YYABORT}
|
\key{Quit parsing immediately. Return 1.} {YYABORT}
|
||||||
\key{Quit parsing immediately. Return 0.} {YYACCEPT}
|
\key{Quit parsing immediately. Return 0.} {YYACCEPT}
|
||||||
\key{Pretend a syntax error occurred.} {YYERROR}
|
\key{Pretend a syntax error occurred.} {YYERROR}
|
||||||
\key{Value in {\tt yychar} if no look-ahead token.} {YYEMPTY}
|
\key{Value in {\tt yychar} if no lookahead token.} {YYEMPTY}
|
||||||
\key{Clear previous look ahead token.} {yyclearin}
|
\key{Clear previous lookahead token.} {yyclearin}
|
||||||
\key{Recover normally from an error.} {yyerrok}
|
\key{Recover normally from an error.} {yyerrok}
|
||||||
|
|
||||||
% **************
|
% **************
|
||||||
|
|||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
A directory of tools provided to people using CVS Bison. None of
|
||||||
|
these is distributed.
|
||||||
|
|
||||||
|
* bench.pl
|
||||||
|
A primitive Perl script to run benches. Currently its only bench is
|
||||||
|
the usual calculator: it has a lightweight processing part (but not
|
||||||
|
null), so it is really emphasizing the cost of the whole parsing
|
||||||
|
(including scanning and I/O).
|
||||||
|
|
||||||
|
Set the envvars BISON and CC to the programs and flags you want to
|
||||||
|
use. They default to bison and gcc. To run a non-installed bison
|
||||||
|
from a tarball built in _build, I suggest the following.
|
||||||
|
|
||||||
|
BISON=_build/tests/bison CC='gcc -O2' ./bench.pl
|
||||||
|
|
||||||
|
(The _build/tests/bison wrapper makes sure that _build/src/bison will
|
||||||
|
use the tarballs' skeletons, not those already installed as a
|
||||||
|
straightforward use of _build/src/bison would.)
|
||||||
|
|
||||||
|
--
|
||||||
|
|
||||||
|
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
Bison is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
Bison is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with autoconf; see the file COPYING. If not, write to
|
||||||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
End:
|
||||||
Executable
+413
File diff suppressed because one or more lines are too long
-300
@@ -1,300 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
# clcommit version 0.9.5
|
|
||||||
|
|
||||||
# Copyright (C) 1999, 2000, Free Software Foundation
|
|
||||||
|
|
||||||
# This script is Free Software, and it can be copied, distributed and
|
|
||||||
# modified as defined in the GNU General Public License. A copy of
|
|
||||||
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
|
|
||||||
|
|
||||||
# Originally by Gary V. Vaughan <[email protected]>
|
|
||||||
# Pretty much rewritten by Alexandre Oliva <[email protected]>
|
|
||||||
|
|
||||||
# This scripts eases checking in changes to CVS-maintained projects
|
|
||||||
# with ChangeLog files. It will check that there have been no
|
|
||||||
# conflicting commits in the CVS repository and print which files it
|
|
||||||
# is going to commit to stderr. A list of files to compare and to
|
|
||||||
# check in can be given in the command line. If it is not given, all
|
|
||||||
# files in the current directory (and below, unless `-l' is given) are
|
|
||||||
# considered for check in.
|
|
||||||
|
|
||||||
# The commit message will be extracted from the differences between a
|
|
||||||
# file named ChangeLog* in the commit list, or named after -C, and the
|
|
||||||
# one in the repository (unless a message was specified with `-m' or
|
|
||||||
# `-F'). An empty message is not accepted (but a blank line is). If
|
|
||||||
# the message is acceptable, it will be presented for verification
|
|
||||||
# (and possible edition) using the $PAGER environment variable (or
|
|
||||||
# `more', if it is not set, or `cat', if the `-f' switch is given).
|
|
||||||
# If $PAGER exits successfully, the modified files (at that moment)
|
|
||||||
# are checked in, unless `-n' was specified, in which case nothing is
|
|
||||||
# checked in.
|
|
||||||
|
|
||||||
# usage: clcommit [-v] [-h] [-f] [-l] [-n] [-q] [-z N] [-C ChangeLog_file]
|
|
||||||
# [-m msg|-F msg_file|-1] [--] [file|dir ...]
|
|
||||||
|
|
||||||
# -f --force don't check (unless *followed* by -n), and just
|
|
||||||
# display commit message instead of running $PAGER
|
|
||||||
# -l --local don't descend into subdirectories
|
|
||||||
# -m msg --message=msg set commit message
|
|
||||||
# --msg=msg same as -m
|
|
||||||
# -F file --file=file read commit message from file
|
|
||||||
# -1 --first extract first entry from ChangeLog, no cvs diff
|
|
||||||
# -C file --changelog=file extract commit message from specified ChangeLog
|
|
||||||
# --fast same as --force --first
|
|
||||||
# -n --dry-run don't commit anything
|
|
||||||
# -q --quiet run cvs in quiet mode
|
|
||||||
# -zN --compress=N set compression level (0-9, 0=none, 9=max)
|
|
||||||
# -v --version print version information
|
|
||||||
# -h,-? --help print short or long help message
|
|
||||||
|
|
||||||
name=clcommit
|
|
||||||
: ${CVS=cvs}
|
|
||||||
cvsopt=
|
|
||||||
updateopt=
|
|
||||||
commitopt=
|
|
||||||
dry_run=false
|
|
||||||
commit=:
|
|
||||||
update=:
|
|
||||||
log_file="${TMPDIR-/tmp}/commitlog.$$"
|
|
||||||
first=false
|
|
||||||
|
|
||||||
rm -f "$log_file"
|
|
||||||
trap 'rm -f "$log_file"; exit 1' 1 2 15
|
|
||||||
|
|
||||||
# this just eases exit handling
|
|
||||||
main_repeat=":"
|
|
||||||
while $main_repeat; do
|
|
||||||
|
|
||||||
repeat="test $# -gt 0"
|
|
||||||
while $repeat; do
|
|
||||||
case "$1" in
|
|
||||||
--fast)
|
|
||||||
shift
|
|
||||||
set fnord --force --first ${1+"$@"}
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-f|--force)
|
|
||||||
update=false
|
|
||||||
PAGER=cat
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-l|--local)
|
|
||||||
updateopt="$updateopt -l"
|
|
||||||
commitopt="$commitopt -l"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-m|--message|--msg)
|
|
||||||
if test $# = 1; then
|
|
||||||
echo "$name: missing argument for $1" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
if $first || test -f "$log_file"; then
|
|
||||||
echo "$name: you can have at most one of -m, -F and -1" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
echo "$1" > "$log_file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-F|--file)
|
|
||||||
if $first || test -f "$log_file"; then
|
|
||||||
echo "$name: you can have at most one of -m, -F and -1" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
if test $# = 1; then
|
|
||||||
echo "$name: missing argument for $1" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
if cat < "$1" > "$log_file"; then :; else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-1|--first)
|
|
||||||
if test -f "$log_File"; then
|
|
||||||
echo "$name: you can have at most one of -m, -F and -1" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
first=:
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-C|--[cC]hange[lL]og)
|
|
||||||
if test $# = 1; then
|
|
||||||
echo "$name: missing argument for $1" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
if test ! -f "$1"; then
|
|
||||||
echo "$name: ChangeLog file \`$1' does not exist" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
ChangeLog="$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-n|--dry-run)
|
|
||||||
commit=false
|
|
||||||
update=true
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-q|--quiet)
|
|
||||||
cvsopt="$cvsopt -q"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-v|--verbose)
|
|
||||||
cvsopt="$cvsopt -t"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-z|--compress)
|
|
||||||
if test $# = 1; then
|
|
||||||
echo "$name: missing argument for $1" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
case "$2" in
|
|
||||||
[0-9]) :;;
|
|
||||||
*) echo "$name: invalid argument for $1" >&2
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
cvsopt="$cvsopt -z$2"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
|
|
||||||
-m*|-F*|-C*|-z*)
|
|
||||||
opt=`echo "$1" | sed '1s/^\(..\).*$/\1/;q'`
|
|
||||||
arg=`echo "$1" | sed '1s/^-[a-zA-Z0-9]//'`
|
|
||||||
shift
|
|
||||||
set -- "$opt" "$arg" ${1+"$@"}
|
|
||||||
;;
|
|
||||||
--message=*|--msg=*|--file=*|--[Cc]hange[Ll]og=*|--compress=*)
|
|
||||||
opt=`echo "$1" | sed '1s/^\(--[^=]*\)=.*/\1/;q'`
|
|
||||||
arg=`echo "$1" | sed '1s/^--[^=]*=//'`
|
|
||||||
shift
|
|
||||||
set -- "$opt" "$arg" ${1+"$@"}
|
|
||||||
;;
|
|
||||||
|
|
||||||
-v|--version)
|
|
||||||
sed '/^# '$name' version /,/^# Heavily modified by/ { s/^# //; p; }; d' < $0
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
-\?|-h)
|
|
||||||
sed '/^# usage:/,/# -h/ { s/^# //; p; }; d' < $0 &&
|
|
||||||
echo
|
|
||||||
echo "run \`$name --help | more' for full usage"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
--help)
|
|
||||||
sed '/^# '$name' version /,/^[^#]/ { /^[^#]/ d; s/^# //; p; }; d' < $0
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
--)
|
|
||||||
shift
|
|
||||||
repeat=false
|
|
||||||
;;
|
|
||||||
-*)
|
|
||||||
echo "$name: invalid flag $1" >&2
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
repeat=false
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
# might have used break 2 within the previous loop, but so what
|
|
||||||
$repeat && break
|
|
||||||
|
|
||||||
$update && \
|
|
||||||
if echo "$name: checking for conflicts..." >&2
|
|
||||||
($CVS $cvsopt -q -n update $updateopt ${1+"$@"} 2>/dev/null \
|
|
||||||
| while read line; do
|
|
||||||
echo "$line"
|
|
||||||
echo "$line" >&3
|
|
||||||
done | grep '^C') 3>&1 >/dev/null; then
|
|
||||||
echo "$name: some conflicts were found, aborting..." >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test ! -f "$log_file"; then
|
|
||||||
if test -z "$ChangeLog"; then
|
|
||||||
for f in ${1+"$@"}; do
|
|
||||||
case "$f" in
|
|
||||||
ChangeLog* | */ChangeLog*)
|
|
||||||
if test -z "$ChangeLog"; then
|
|
||||||
ChangeLog="$f"
|
|
||||||
else
|
|
||||||
echo "$name: multiple ChangeLog files: $ChangeLog and $f" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$name: checking commit message..." >&2
|
|
||||||
if $first; then
|
|
||||||
skipping=:
|
|
||||||
sed 's,^,+,' < ${ChangeLog-ChangeLog} |
|
|
||||||
while read line; do
|
|
||||||
case "$line" in
|
|
||||||
"+2"*) if $skipping; then skipping=false; else break; fi;;
|
|
||||||
"+ "*)
|
|
||||||
echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
|
|
||||||
echo "$line" | sed 's/^.//' >&2;;
|
|
||||||
"+ "*)
|
|
||||||
$skipping || echo "$line" ;;
|
|
||||||
esac
|
|
||||||
done |
|
|
||||||
sed 's,^\+ ,,' > "$log_file" || break
|
|
||||||
else
|
|
||||||
$CVS $cvsopt diff -u ${ChangeLog-ChangeLog} |
|
|
||||||
while read line; do
|
|
||||||
case $line in
|
|
||||||
"--- "*) :;;
|
|
||||||
"-"*)
|
|
||||||
echo "$name: *** Warning: the following line in ChangeLog diff is suspicious:" >&2
|
|
||||||
echo "$line" | sed 's/^.//' >&2;;
|
|
||||||
"+ "*)
|
|
||||||
echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
|
|
||||||
echo "$line" | sed 's/^.//' >&2;;
|
|
||||||
"+") echo;;
|
|
||||||
"+ "*) echo "$line";;
|
|
||||||
esac
|
|
||||||
done |
|
|
||||||
sed -e 's,\+ ,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \
|
|
||||||
|| break
|
|
||||||
fi
|
|
||||||
# The sed script above removes "+TAB" from the beginning of a line, then
|
|
||||||
# deletes the first and/or the last line, when they happen to be empty
|
|
||||||
fi
|
|
||||||
|
|
||||||
if grep '[^ ]' < "$log_file" > /dev/null; then :; else
|
|
||||||
echo "$name: empty commit message, aborting" >&2
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
if grep '^$' < "$log_file" > /dev/null; then
|
|
||||||
echo "$name: *** Warning: blank lines should not appear within commit messages." >&2
|
|
||||||
echo "$name: *** They should be used to separate distinct commits." >&2
|
|
||||||
fi
|
|
||||||
|
|
||||||
${PAGER-more} "$log_file" || break
|
|
||||||
|
|
||||||
sleep 1 # give the user some time for a ^C
|
|
||||||
|
|
||||||
# Do not check for empty $log_file again, even though the user might have
|
|
||||||
# zeroed it out. If s/he did, it was probably intentional.
|
|
||||||
|
|
||||||
if $commit; then
|
|
||||||
$CVS $cvsopt commit $commitopt -F $log_file ${1+"$@"} || break
|
|
||||||
fi
|
|
||||||
|
|
||||||
main_repeat=false
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -f "$log_file"
|
|
||||||
|
|
||||||
# if main_repeat was not set to `false', we failed
|
|
||||||
$main_repeat && exit 1
|
|
||||||
exit 0
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
|
## Copyright (C) 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
## This program is free software; you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation; either version 2 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program; if not, write to the Free Software
|
||||||
|
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
## 02110-1301 USA
|
||||||
|
|
||||||
|
if BISON_CXX_WORKS
|
||||||
|
SUBDIRS = calc++
|
||||||
|
endif
|
||||||
|
|
||||||
|
dist_noinst_SCRIPTS = extexi
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
*.cc
|
||||||
|
*.hh
|
||||||
|
*.ll
|
||||||
|
*.output
|
||||||
|
*.stamp
|
||||||
|
*.tmp
|
||||||
|
*.yy
|
||||||
|
.deps
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
calc++
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
|
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
## This program is free software; you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation; either version 2 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program; if not, write to the Free Software
|
||||||
|
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
## 02110-1301 USA
|
||||||
|
|
||||||
|
## ------------------------------------- ##
|
||||||
|
## Running the bison from this tarball. ##
|
||||||
|
## ------------------------------------- ##
|
||||||
|
|
||||||
|
BISON = $(top_builddir)/tests/bison
|
||||||
|
BISON_IN = $(top_srcdir)/tests/bison.in
|
||||||
|
|
||||||
|
$(BISON): $(BISON_IN)
|
||||||
|
cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||||
|
|
||||||
|
## ------------ ##
|
||||||
|
## Extracting. ##
|
||||||
|
## ------------ ##
|
||||||
|
|
||||||
|
doc = $(top_srcdir)/doc/bison.texinfo
|
||||||
|
extexi = $(top_srcdir)/examples/extexi
|
||||||
|
# Extract in src.
|
||||||
|
$(calc_extracted): $(doc) $(extexi)
|
||||||
|
cd $(srcdir) && \
|
||||||
|
$(AWK) -f ../extexi ../../doc/bison.texinfo -- \
|
||||||
|
calc++-parser.yy \
|
||||||
|
calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
|
||||||
|
|
||||||
|
|
||||||
|
## ------------------- ##
|
||||||
|
## Parser generation. ##
|
||||||
|
## ------------------- ##
|
||||||
|
|
||||||
|
BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
|
||||||
|
CLEANFILES = $(srcdir)/*.output *.tmp
|
||||||
|
MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
|
||||||
|
|
||||||
|
# Compile the parser and save cycles.
|
||||||
|
# This code comes from "Handling Tools that Produce Many Outputs",
|
||||||
|
# from the Automake documentation.
|
||||||
|
EXTRA_DIST = $(srcdir)/calc++-parser.stamp $(srcdir)/calc++-parser.yy
|
||||||
|
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||||
|
# in srcdir, including during distcheck, which is forbidden.
|
||||||
|
$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
|
||||||
|
@rm -f calc++-parser.tmp
|
||||||
|
@touch calc++-parser.tmp
|
||||||
|
$(BISON) -d -ra -S lalr1.cc -o $(srcdir)/calc++-parser.cc \
|
||||||
|
$(srcdir)/calc++-parser.yy
|
||||||
|
@mv -f calc++-parser.tmp $@
|
||||||
|
|
||||||
|
$(calc_sources_generated): $(srcdir)/calc++-parser.stamp
|
||||||
|
@if test -f $@; then :; else \
|
||||||
|
rm -f $(srcdir)/calc++-parser.stamp && \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
## --------------------------- ##
|
||||||
|
## Building & testing calc++. ##
|
||||||
|
## --------------------------- ##
|
||||||
|
|
||||||
|
check_PROGRAMS = calc++
|
||||||
|
|
||||||
|
calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
|
||||||
|
$(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
|
||||||
|
calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
|
||||||
|
calc_sources_generated = \
|
||||||
|
$(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
|
||||||
|
$(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
|
||||||
|
|
||||||
|
calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
|
||||||
|
|
||||||
|
TESTS = test
|
||||||
|
EXTRA_DIST += $(TESTS)
|
||||||
Executable
+31
@@ -0,0 +1,31 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
test -z "$VERBOSE" && {
|
||||||
|
exec > /dev/null 2>&1
|
||||||
|
set -x
|
||||||
|
}
|
||||||
|
|
||||||
|
cat >input <<EOF
|
||||||
|
a := 1
|
||||||
|
b := 2
|
||||||
|
c := 3
|
||||||
|
d := a + b * c
|
||||||
|
d
|
||||||
|
EOF
|
||||||
|
|
||||||
|
./calc++ input
|
||||||
|
./calc++ -p input
|
||||||
|
|
||||||
|
cat >input <<EOF
|
||||||
|
a := 1
|
||||||
|
d := a + b * c
|
||||||
|
EOF
|
||||||
|
./calc++ input
|
||||||
|
|
||||||
|
cat >input <<EOF
|
||||||
|
toto := 1
|
||||||
|
toto
|
||||||
|
EOF
|
||||||
|
./calc++ -s input
|
||||||
|
|
||||||
|
rm input
|
||||||
+138
@@ -0,0 +1,138 @@
|
|||||||
|
# Extract all examples from the manual source. -*- AWK -*-
|
||||||
|
|
||||||
|
# This file is part of GNU Bison
|
||||||
|
# Copyright 1992, 2000, 2001, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This 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., 59 Temple Place, Suite 330, Boston, MA
|
||||||
|
# 02111-1307 USA
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# Usage: extexi input-file.texi ... -- [FILES to extract]
|
||||||
|
BEGIN {
|
||||||
|
if (!output_dir)
|
||||||
|
output_dir = ".";
|
||||||
|
for (argc = 1; argc < ARGC; ++argc)
|
||||||
|
if (ARGV[argc] == "--")
|
||||||
|
break;
|
||||||
|
for (i = argc + 1; i < ARGC; ++i)
|
||||||
|
file_wanted[ARGV[i]] = 1;
|
||||||
|
ARGC = argc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/^@node / {
|
||||||
|
if (seq > 0)
|
||||||
|
print "AT_CLEANUP";
|
||||||
|
|
||||||
|
split ($0, tmp, ",");
|
||||||
|
node = substr(tmp[1], 7);
|
||||||
|
seq = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/^@comment file: / {
|
||||||
|
if (!file_wanted[$3])
|
||||||
|
message("ignoring " $3);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message("extracting " $3);
|
||||||
|
file = $3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/^@example$/, /^@end example$/ {
|
||||||
|
if (!file)
|
||||||
|
next;
|
||||||
|
|
||||||
|
if ($0 ~ /^@example$/)
|
||||||
|
{
|
||||||
|
input = files_output[file] ? "\n" : "";
|
||||||
|
|
||||||
|
# FNR is starting at 0 instead of 1, and
|
||||||
|
# #line report the line number of the *next* line.
|
||||||
|
# => + 2.
|
||||||
|
# Note that recent Bison support it, but not Flex.
|
||||||
|
if (file ~ /\.[chy]*$/)
|
||||||
|
input = "#line " (FNR + 1) " \"" FILENAME "\"\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($0 ~ /^@end example$/)
|
||||||
|
{
|
||||||
|
if (input == "")
|
||||||
|
fatal("no contents: " file);
|
||||||
|
|
||||||
|
input = normalize(input);
|
||||||
|
# No spurious end of line: use printf.
|
||||||
|
if (files_output[file])
|
||||||
|
# The parens around the output file seem to be required
|
||||||
|
# by awk on Mac OS X Tiger (darwin 8.4.6).
|
||||||
|
printf ("%s", input) >> (output_dir "/" file);
|
||||||
|
else
|
||||||
|
printf ("%s", input) > (output_dir "/" file);
|
||||||
|
close (output_dir "/" file);
|
||||||
|
files_output[file] = 1;
|
||||||
|
|
||||||
|
file = input = "";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
input = input $0 "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# We have to handle CONTENTS line per line, since anchors in AWK are
|
||||||
|
# referring to the whole string, not the lines.
|
||||||
|
function normalize(contents, i, lines, n, line, res) {
|
||||||
|
# Remove the Texinfo tags.
|
||||||
|
n = split (contents, lines, "\n");
|
||||||
|
# We don't want the last field which empty: it's behind the last \n.
|
||||||
|
for (i = 1; i < n; ++i)
|
||||||
|
{
|
||||||
|
line = lines[i];
|
||||||
|
|
||||||
|
# Whole line commands.
|
||||||
|
if (line ~ /^@(c |comment|dots|end (ignore|group)|ignore|group)/)
|
||||||
|
# Gperf accepts empty lines as valid input!!!
|
||||||
|
if (file ~ /\.gperf$/)
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
line = "";
|
||||||
|
|
||||||
|
gsub (/^@result\{\}/, "", line);
|
||||||
|
gsub (/^@error\{\}/, "", line);
|
||||||
|
gsub ("@[{]", "{", line);
|
||||||
|
gsub ("@}", "}", line);
|
||||||
|
gsub ("@@", "@", line);
|
||||||
|
gsub ("@comment.*", "", line);
|
||||||
|
|
||||||
|
res = res line "\n";
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function message(msg) {
|
||||||
|
if (! message_printed[msg])
|
||||||
|
{
|
||||||
|
print "extexi: " msg > "/dev/stderr";
|
||||||
|
message_printed[msg] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function fatal(msg) {
|
||||||
|
message(msg);
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
+18
-10
@@ -1,19 +1,19 @@
|
|||||||
.deps
|
.deps
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
alloca.c
|
|
||||||
alloca.h
|
|
||||||
alloca_.h
|
|
||||||
argmatch.c
|
argmatch.c
|
||||||
argmatch.h
|
argmatch.h
|
||||||
basename.c
|
basename.c
|
||||||
dirname.c
|
dirname.c
|
||||||
dirname.h
|
dirname.h
|
||||||
|
dup-safer.c
|
||||||
error.c
|
error.c
|
||||||
error.h
|
error.h
|
||||||
exit.h
|
exit.h
|
||||||
exitfail.c
|
exitfail.c
|
||||||
exitfail.h
|
exitfail.h
|
||||||
|
fd-safer.c
|
||||||
|
fopen-safer.c
|
||||||
getopt.c
|
getopt.c
|
||||||
getopt.h
|
getopt.h
|
||||||
getopt1.c
|
getopt1.c
|
||||||
@@ -21,8 +21,6 @@ getopt_.h
|
|||||||
getopt_int.h
|
getopt_int.h
|
||||||
gettext.h
|
gettext.h
|
||||||
gnulib.mk
|
gnulib.mk
|
||||||
hard-locale.c
|
|
||||||
hard-locale.h
|
|
||||||
hash.c
|
hash.c
|
||||||
hash.h
|
hash.h
|
||||||
malloc.c
|
malloc.c
|
||||||
@@ -30,26 +28,36 @@ mbswidth.c
|
|||||||
mbswidth.h
|
mbswidth.h
|
||||||
obstack.c
|
obstack.c
|
||||||
obstack.h
|
obstack.h
|
||||||
|
pipe-safer.c
|
||||||
quote.c
|
quote.c
|
||||||
quote.h
|
quote.h
|
||||||
quotearg.c
|
quotearg.c
|
||||||
quotearg.h
|
quotearg.h
|
||||||
realloc.c
|
|
||||||
stdbool.h
|
stdbool.h
|
||||||
stdbool_.h
|
stdbool_.h
|
||||||
|
stdint.h
|
||||||
|
stdint_.h
|
||||||
|
stdio--.h
|
||||||
|
stdio-safer.h
|
||||||
stpcpy.c
|
stpcpy.c
|
||||||
stpcpy.h
|
stpcpy.h
|
||||||
strdup.c
|
strerror.c
|
||||||
strdup.h
|
|
||||||
stripslash.c
|
stripslash.c
|
||||||
strncasecmp.c
|
|
||||||
strndup.c
|
strndup.c
|
||||||
strndup.h
|
strndup.h
|
||||||
strnlen.c
|
strnlen.c
|
||||||
|
strnlen.h
|
||||||
|
strtol.c
|
||||||
|
strtoul.c
|
||||||
|
strverscmp.c
|
||||||
|
strverscmp.h
|
||||||
|
unistd--.h
|
||||||
|
unistd-safer.h
|
||||||
unlocked-io.h
|
unlocked-io.h
|
||||||
|
verify.h
|
||||||
|
wcwidth.h
|
||||||
xalloc-die.c
|
xalloc-die.c
|
||||||
xalloc.h
|
xalloc.h
|
||||||
xmalloc.c
|
xmalloc.c
|
||||||
xstrdup.c
|
|
||||||
xstrndup.c
|
xstrndup.c
|
||||||
xstrndup.h
|
xstrndup.h
|
||||||
|
|||||||
+2
-2
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
## 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, write to the Free Software
|
||||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
## 02111-1307 USA
|
## 02110-1301 USA
|
||||||
|
|
||||||
AM_CFLAGS = $(WARNING_CFLAGS)
|
AM_CFLAGS = $(WARNING_CFLAGS)
|
||||||
|
|
||||||
|
|||||||
+9
-11
@@ -1,5 +1,5 @@
|
|||||||
/* Array bitsets.
|
/* Array bitsets.
|
||||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -13,12 +13,11 @@
|
|||||||
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, write to the Free Software Foundation,
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "abitset.h"
|
#include "abitset.h"
|
||||||
@@ -34,14 +33,13 @@
|
|||||||
|
|
||||||
|
|
||||||
static bitset_bindex
|
static bitset_bindex
|
||||||
abitset_resize (bitset src ATTRIBUTE_UNUSED,
|
abitset_resize (bitset src, bitset_bindex size)
|
||||||
bitset_bindex size ATTRIBUTE_UNUSED)
|
|
||||||
{
|
{
|
||||||
if (BITSET_SIZE_ (src) == size)
|
|
||||||
return size;
|
|
||||||
|
|
||||||
/* These bitsets have a fixed size. */
|
/* These bitsets have a fixed size. */
|
||||||
abort ();
|
if (BITSET_SIZE_ (src) != size)
|
||||||
|
abort ();
|
||||||
|
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find list of up to NUM bits set in BSET starting from and including
|
/* Find list of up to NUM bits set in BSET starting from and including
|
||||||
|
|||||||
+2
-2
@@ -14,10 +14,10 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _ABITSET_H
|
#ifndef _ABITSET_H
|
||||||
#define _ABITSET_H
|
#define _ABITSET_H
|
||||||
|
|
||||||
#include "bitset.h"
|
#include "bitset.h"
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -1,5 +1,5 @@
|
|||||||
/* Base bitset stuff.
|
/* Base bitset stuff.
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -14,7 +14,7 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _BBITSET_H
|
#ifndef _BBITSET_H
|
||||||
#define _BBITSET_H
|
#define _BBITSET_H
|
||||||
@@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
BITSET_TABLE: Expandable table of pointers to arrays of bits
|
BITSET_TABLE: Expandable table of pointers to arrays of bits
|
||||||
(variable size, less storage for large sparse sets).
|
(variable size, less storage for large sparse sets).
|
||||||
Faster than BITSET_LIST for random access.
|
Faster than BITSET_LIST for random access.
|
||||||
BITSET_VARRAY: Variable array of bits (variable size, fast for
|
BITSET_VARRAY: Variable array of bits (variable size, fast for
|
||||||
dense bitsets).
|
dense bitsets).
|
||||||
BITSET_STATS: Wrapper bitset for internal use only. Used for gathering
|
BITSET_STATS: Wrapper bitset for internal use only. Used for gathering
|
||||||
statistics and/or better run-time checking.
|
statistics and/or better run-time checking.
|
||||||
@@ -126,16 +126,16 @@ struct bitset_vtable
|
|||||||
void (*copy) (bitset, bitset);
|
void (*copy) (bitset, bitset);
|
||||||
bool (*disjoint_p) (bitset, bitset);
|
bool (*disjoint_p) (bitset, bitset);
|
||||||
bool (*equal_p) (bitset, bitset);
|
bool (*equal_p) (bitset, bitset);
|
||||||
void (*not) (bitset, bitset);
|
void (*not_) (bitset, bitset);
|
||||||
bool (*subset_p) (bitset, bitset);
|
bool (*subset_p) (bitset, bitset);
|
||||||
|
|
||||||
void (*and) (bitset, bitset, bitset);
|
void (*and_) (bitset, bitset, bitset);
|
||||||
bool (*and_cmp) (bitset, bitset, bitset);
|
bool (*and_cmp) (bitset, bitset, bitset);
|
||||||
void (*andn) (bitset, bitset, bitset);
|
void (*andn) (bitset, bitset, bitset);
|
||||||
bool (*andn_cmp) (bitset, bitset, bitset);
|
bool (*andn_cmp) (bitset, bitset, bitset);
|
||||||
void (*or) (bitset, bitset, bitset);
|
void (*or_) (bitset, bitset, bitset);
|
||||||
bool (*or_cmp) (bitset, bitset, bitset);
|
bool (*or_cmp) (bitset, bitset, bitset);
|
||||||
void (*xor) (bitset, bitset, bitset);
|
void (*xor_) (bitset, bitset, bitset);
|
||||||
bool (*xor_cmp) (bitset, bitset, bitset);
|
bool (*xor_cmp) (bitset, bitset, bitset);
|
||||||
|
|
||||||
void (*and_or) (bitset, bitset, bitset, bitset);
|
void (*and_or) (bitset, bitset, bitset, bitset);
|
||||||
@@ -218,14 +218,14 @@ if (!BITSET_COMPATIBLE_ (DST, SRC1) || !BITSET_COMPATIBLE_ (DST, SRC2) \
|
|||||||
#define BITSET_EQUAL_P_(DST, SRC) (SRC)->b.vtable->equal_p (DST, SRC)
|
#define BITSET_EQUAL_P_(DST, SRC) (SRC)->b.vtable->equal_p (DST, SRC)
|
||||||
|
|
||||||
/* DST = ~SRC. */
|
/* DST = ~SRC. */
|
||||||
#define BITSET_NOT_(DST, SRC) (SRC)->b.vtable->not (DST, SRC)
|
#define BITSET_NOT_(DST, SRC) (SRC)->b.vtable->not_ (DST, SRC)
|
||||||
|
|
||||||
/* Return DST == DST | SRC. */
|
/* Return DST == DST | SRC. */
|
||||||
#define BITSET_SUBSET_P_(DST, SRC) (SRC)->b.vtable->subset_p (DST, SRC)
|
#define BITSET_SUBSET_P_(DST, SRC) (SRC)->b.vtable->subset_p (DST, SRC)
|
||||||
|
|
||||||
|
|
||||||
/* DST = SRC1 & SRC2. */
|
/* DST = SRC1 & SRC2. */
|
||||||
#define BITSET_AND_(DST, SRC1, SRC2) (SRC1)->b.vtable->and (DST, SRC1, SRC2)
|
#define BITSET_AND_(DST, SRC1, SRC2) (SRC1)->b.vtable->and_ (DST, SRC1, SRC2)
|
||||||
#define BITSET_AND_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->and_cmp (DST, SRC1, SRC2)
|
#define BITSET_AND_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->and_cmp (DST, SRC1, SRC2)
|
||||||
|
|
||||||
/* DST = SRC1 & ~SRC2. */
|
/* DST = SRC1 & ~SRC2. */
|
||||||
@@ -233,11 +233,11 @@ if (!BITSET_COMPATIBLE_ (DST, SRC1) || !BITSET_COMPATIBLE_ (DST, SRC2) \
|
|||||||
#define BITSET_ANDN_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->andn_cmp (DST, SRC1, SRC2)
|
#define BITSET_ANDN_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->andn_cmp (DST, SRC1, SRC2)
|
||||||
|
|
||||||
/* DST = SRC1 | SRC2. */
|
/* DST = SRC1 | SRC2. */
|
||||||
#define BITSET_OR_(DST, SRC1, SRC2) (SRC1)->b.vtable->or (DST, SRC1, SRC2)
|
#define BITSET_OR_(DST, SRC1, SRC2) (SRC1)->b.vtable->or_ (DST, SRC1, SRC2)
|
||||||
#define BITSET_OR_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->or_cmp (DST, SRC1, SRC2)
|
#define BITSET_OR_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->or_cmp (DST, SRC1, SRC2)
|
||||||
|
|
||||||
/* DST = SRC1 ^ SRC2. */
|
/* DST = SRC1 ^ SRC2. */
|
||||||
#define BITSET_XOR_(DST, SRC1, SRC2) (SRC1)->b.vtable->xor (DST, SRC1, SRC2)
|
#define BITSET_XOR_(DST, SRC1, SRC2) (SRC1)->b.vtable->xor_ (DST, SRC1, SRC2)
|
||||||
#define BITSET_XOR_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->xor_cmp (DST, SRC1, SRC2)
|
#define BITSET_XOR_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->xor_cmp (DST, SRC1, SRC2)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+16
-16
@@ -1,5 +1,5 @@
|
|||||||
/* General bitsets.
|
/* General bitsets.
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -13,11 +13,11 @@
|
|||||||
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, write to the Free Software Foundation,
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -45,6 +45,9 @@ bitset_bytes (enum bitset_type type, bitset_bindex n_bits)
|
|||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
|
||||||
case BITSET_ARRAY:
|
case BITSET_ARRAY:
|
||||||
bytes = abitset_bytes (n_bits);
|
bytes = abitset_bytes (n_bits);
|
||||||
break;
|
break;
|
||||||
@@ -60,9 +63,6 @@ bitset_bytes (enum bitset_type type, bitset_bindex n_bits)
|
|||||||
case BITSET_VARRAY:
|
case BITSET_VARRAY:
|
||||||
bytes = vbitset_bytes (n_bits);
|
bytes = vbitset_bytes (n_bits);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
abort ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
@@ -78,6 +78,9 @@ bitset_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
|
|||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
|
||||||
case BITSET_ARRAY:
|
case BITSET_ARRAY:
|
||||||
return abitset_init (bset, n_bits);
|
return abitset_init (bset, n_bits);
|
||||||
|
|
||||||
@@ -89,9 +92,6 @@ bitset_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
|
|||||||
|
|
||||||
case BITSET_VARRAY:
|
case BITSET_VARRAY:
|
||||||
return vbitset_init (bset, n_bits);
|
return vbitset_init (bset, n_bits);
|
||||||
|
|
||||||
default:
|
|
||||||
abort ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ bitset_type_choose (bitset_bindex n_bits ATTRIBUTE_UNUSED, unsigned int attr)
|
|||||||
/* Choose the type of bitset. Note that sometimes we will be asked
|
/* Choose the type of bitset. Note that sometimes we will be asked
|
||||||
for a zero length fixed size bitset. */
|
for a zero length fixed size bitset. */
|
||||||
|
|
||||||
|
|
||||||
/* If no attributes selected, choose a good compromise. */
|
/* If no attributes selected, choose a good compromise. */
|
||||||
if (!attr)
|
if (!attr)
|
||||||
return BITSET_VARRAY;
|
return BITSET_VARRAY;
|
||||||
@@ -138,7 +138,7 @@ bitset_alloc (bitset_bindex n_bits, enum bitset_type type)
|
|||||||
|
|
||||||
bytes = bitset_bytes (type, n_bits);
|
bytes = bitset_bytes (type, n_bits);
|
||||||
|
|
||||||
bset = (bitset) xcalloc (1, bytes);
|
bset = xcalloc (1, bytes);
|
||||||
|
|
||||||
/* The cache is disabled until some elements are allocated. If we
|
/* The cache is disabled until some elements are allocated. If we
|
||||||
have variable length arrays, then we may need to allocate a dummy
|
have variable length arrays, then we may need to allocate a dummy
|
||||||
@@ -307,7 +307,7 @@ bitset_print (FILE *file, bitset bset, bool verbose)
|
|||||||
pos = 0;
|
pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (file, "%d ", i);
|
fprintf (file, "%lu ", (unsigned long int) i);
|
||||||
pos += 1 + (i >= 10) + (i >= 100);
|
pos += 1 + (i >= 10) + (i >= 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -421,6 +421,9 @@ bitset_op4_cmp (bitset dst, bitset src1, bitset src2, bitset src3,
|
|||||||
|
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
|
||||||
case BITSET_OP_OR_AND:
|
case BITSET_OP_OR_AND:
|
||||||
bitset_or (tmp, src1, src2);
|
bitset_or (tmp, src1, src2);
|
||||||
changed = bitset_and_cmp (dst, src3, tmp);
|
changed = bitset_and_cmp (dst, src3, tmp);
|
||||||
@@ -435,9 +438,6 @@ bitset_op4_cmp (bitset dst, bitset src1, bitset src2, bitset src3,
|
|||||||
bitset_andn (tmp, src1, src2);
|
bitset_andn (tmp, src1, src2);
|
||||||
changed = bitset_or_cmp (dst, src3, tmp);
|
changed = bitset_or_cmp (dst, src3, tmp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
abort ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bitset_free (tmp);
|
bitset_free (tmp);
|
||||||
|
|||||||
+10
-7
@@ -14,7 +14,7 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _BITSET_H
|
#ifndef _BITSET_H
|
||||||
#define _BITSET_H
|
#define _BITSET_H
|
||||||
@@ -26,6 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
#include "obstack.h"
|
#include "obstack.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#if USE_UNLOCKED_IO
|
||||||
|
# include "unlocked-io.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Attributes used to select a bitset implementation. */
|
/* Attributes used to select a bitset implementation. */
|
||||||
enum bitset_attr {BITSET_FIXED = 1, /* Bitset size fixed. */
|
enum bitset_attr {BITSET_FIXED = 1, /* Bitset size fixed. */
|
||||||
BITSET_VARIABLE = 2, /* Bitset size variable. */
|
BITSET_VARIABLE = 2, /* Bitset size variable. */
|
||||||
@@ -309,8 +313,8 @@ extern void bitset_dump (FILE *, bitset);
|
|||||||
*/
|
*/
|
||||||
#define BITSET_FOR_EACH(ITER, BSET, INDEX, MIN) \
|
#define BITSET_FOR_EACH(ITER, BSET, INDEX, MIN) \
|
||||||
for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
|
for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
|
||||||
(ITER.num == BITSET_LIST_SIZE) \
|
(ITER.num == BITSET_LIST_SIZE) \
|
||||||
&& (ITER.num = bitset_list (BSET, ITER.list, \
|
&& (ITER.num = bitset_list (BSET, ITER.list, \
|
||||||
BITSET_LIST_SIZE, &ITER.next));) \
|
BITSET_LIST_SIZE, &ITER.next));) \
|
||||||
for (ITER.i = 0; \
|
for (ITER.i = 0; \
|
||||||
ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1); \
|
ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1); \
|
||||||
@@ -331,7 +335,7 @@ extern void bitset_dump (FILE *, bitset);
|
|||||||
*/
|
*/
|
||||||
#define BITSET_FOR_EACH_REVERSE(ITER, BSET, INDEX, MIN) \
|
#define BITSET_FOR_EACH_REVERSE(ITER, BSET, INDEX, MIN) \
|
||||||
for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
|
for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
|
||||||
(ITER.num == BITSET_LIST_SIZE) \
|
(ITER.num == BITSET_LIST_SIZE) \
|
||||||
&& (ITER.num = bitset_list_reverse (BSET, ITER.list, \
|
&& (ITER.num = bitset_list_reverse (BSET, ITER.list, \
|
||||||
BITSET_LIST_SIZE, &ITER.next));) \
|
BITSET_LIST_SIZE, &ITER.next));) \
|
||||||
for (ITER.i = 0; \
|
for (ITER.i = 0; \
|
||||||
@@ -371,10 +375,10 @@ extern void bitset_stats_enable (void);
|
|||||||
extern void bitset_stats_disable (void);
|
extern void bitset_stats_disable (void);
|
||||||
|
|
||||||
/* Read bitset stats file of accummulated stats. */
|
/* Read bitset stats file of accummulated stats. */
|
||||||
void bitset_stats_read (const char *filename);
|
void bitset_stats_read (const char *file_name);
|
||||||
|
|
||||||
/* Write bitset stats file of accummulated stats. */
|
/* Write bitset stats file of accummulated stats. */
|
||||||
void bitset_stats_write (const char *filename);
|
void bitset_stats_write (const char *file_name);
|
||||||
|
|
||||||
/* Dump bitset stats. */
|
/* Dump bitset stats. */
|
||||||
extern void bitset_stats_dump (FILE *);
|
extern void bitset_stats_dump (FILE *);
|
||||||
@@ -386,4 +390,3 @@ extern void debug_bitset (bitset);
|
|||||||
extern void debug_bitset_stats (void);
|
extern void debug_bitset_stats (void);
|
||||||
|
|
||||||
#endif /* _BITSET_H */
|
#endif /* _BITSET_H */
|
||||||
|
|
||||||
|
|||||||
+32
-34
@@ -1,5 +1,5 @@
|
|||||||
/* Bitset statistics.
|
/* Bitset statistics.
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -13,20 +13,18 @@
|
|||||||
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, write to the Free Software Foundation,
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
*/
|
|
||||||
|
|
||||||
/* This file is a wrapper bitset implementation for the other bitset
|
/* This file is a wrapper bitset implementation for the other bitset
|
||||||
implementations. It provides bitset compatibility checking and
|
implementations. It provides bitset compatibility checking and
|
||||||
statistics gathering without having to instrument the bitset
|
statistics gathering without having to instrument the bitset
|
||||||
implementations. When statistics gathering is enabled, the bitset
|
implementations. When statistics gathering is enabled, the bitset
|
||||||
operations get vectored through here and we then call the appropriate
|
operations get vectored through here and we then call the appropriate
|
||||||
routines.
|
routines. */
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "bbitset.h"
|
#include "bbitset.h"
|
||||||
@@ -50,29 +48,29 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Accessor macros. */
|
/* Accessor macros. */
|
||||||
#define BITSET_STATS_ALLOCS_INC(TYPE) \
|
#define BITSET_STATS_ALLOCS_INC(TYPE) \
|
||||||
bitset_stats_info->types[(TYPE)].allocs++
|
bitset_stats_info->types[(TYPE)].allocs++
|
||||||
#define BITSET_STATS_FREES_INC(BSET) \
|
#define BITSET_STATS_FREES_INC(BSET) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].frees++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].frees++
|
||||||
#define BITSET_STATS_SETS_INC(BSET) \
|
#define BITSET_STATS_SETS_INC(BSET) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].sets++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].sets++
|
||||||
#define BITSET_STATS_CACHE_SETS_INC(BSET) \
|
#define BITSET_STATS_CACHE_SETS_INC(BSET) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_sets++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_sets++
|
||||||
#define BITSET_STATS_RESETS_INC(BSET) \
|
#define BITSET_STATS_RESETS_INC(BSET) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].resets++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].resets++
|
||||||
#define BITSET_STATS_CACHE_RESETS_INC(BSET) \
|
#define BITSET_STATS_CACHE_RESETS_INC(BSET) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_resets++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_resets++
|
||||||
#define BITSET_STATS_TESTS_INC(BSET) \
|
#define BITSET_STATS_TESTS_INC(BSET) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].tests++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].tests++
|
||||||
#define BITSET_STATS_CACHE_TESTS_INC(BSET) \
|
#define BITSET_STATS_CACHE_TESTS_INC(BSET) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_tests++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_tests++
|
||||||
#define BITSET_STATS_LISTS_INC(BSET) \
|
#define BITSET_STATS_LISTS_INC(BSET) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].lists++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].lists++
|
||||||
#define BITSET_STATS_LIST_COUNTS_INC(BSET, I) \
|
#define BITSET_STATS_LIST_COUNTS_INC(BSET, I) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_counts[(I)]++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_counts[(I)]++
|
||||||
#define BITSET_STATS_LIST_SIZES_INC(BSET, I) \
|
#define BITSET_STATS_LIST_SIZES_INC(BSET, I) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_sizes[(I)]++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_sizes[(I)]++
|
||||||
#define BITSET_STATS_LIST_DENSITY_INC(BSET, I) \
|
#define BITSET_STATS_LIST_DENSITY_INC(BSET, I) \
|
||||||
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_density[(I)]++
|
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_density[(I)]++
|
||||||
|
|
||||||
|
|
||||||
@@ -241,17 +239,17 @@ bitset_stats_disable (void)
|
|||||||
|
|
||||||
/* Read bitset statistics file. */
|
/* Read bitset statistics file. */
|
||||||
void
|
void
|
||||||
bitset_stats_read (const char *filename)
|
bitset_stats_read (const char *file_name)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
|
|
||||||
if (!bitset_stats_info)
|
if (!bitset_stats_info)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!filename)
|
if (!file_name)
|
||||||
filename = BITSET_STATS_FILE;
|
file_name = BITSET_STATS_FILE;
|
||||||
|
|
||||||
file = fopen (filename, "r");
|
file = fopen (file_name, "r");
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
if (fread (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
|
if (fread (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
|
||||||
@@ -271,17 +269,17 @@ bitset_stats_read (const char *filename)
|
|||||||
|
|
||||||
/* Write bitset statistics file. */
|
/* Write bitset statistics file. */
|
||||||
void
|
void
|
||||||
bitset_stats_write (const char *filename)
|
bitset_stats_write (const char *file_name)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
|
|
||||||
if (!bitset_stats_info)
|
if (!bitset_stats_info)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!filename)
|
if (!file_name)
|
||||||
filename = BITSET_STATS_FILE;
|
file_name = BITSET_STATS_FILE;
|
||||||
|
|
||||||
file = fopen (filename, "w");
|
file = fopen (file_name, "w");
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
|
if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
|
||||||
@@ -696,32 +694,32 @@ bitset_stats_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
|
|||||||
we are a wrapper over. */
|
we are a wrapper over. */
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
|
||||||
case BITSET_ARRAY:
|
case BITSET_ARRAY:
|
||||||
bytes = abitset_bytes (n_bits);
|
bytes = abitset_bytes (n_bits);
|
||||||
sbset = (bitset) xcalloc (1, bytes);
|
sbset = xcalloc (1, bytes);
|
||||||
abitset_init (sbset, n_bits);
|
abitset_init (sbset, n_bits);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BITSET_LIST:
|
case BITSET_LIST:
|
||||||
bytes = lbitset_bytes (n_bits);
|
bytes = lbitset_bytes (n_bits);
|
||||||
sbset = (bitset) xcalloc (1, bytes);
|
sbset = xcalloc (1, bytes);
|
||||||
lbitset_init (sbset, n_bits);
|
lbitset_init (sbset, n_bits);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BITSET_TABLE:
|
case BITSET_TABLE:
|
||||||
bytes = ebitset_bytes (n_bits);
|
bytes = ebitset_bytes (n_bits);
|
||||||
sbset = (bitset) xcalloc (1, bytes);
|
sbset = xcalloc (1, bytes);
|
||||||
ebitset_init (sbset, n_bits);
|
ebitset_init (sbset, n_bits);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BITSET_VARRAY:
|
case BITSET_VARRAY:
|
||||||
bytes = vbitset_bytes (n_bits);
|
bytes = vbitset_bytes (n_bits);
|
||||||
sbset = (bitset) xcalloc (1, bytes);
|
sbset = xcalloc (1, bytes);
|
||||||
vbitset_init (sbset, n_bits);
|
vbitset_init (sbset, n_bits);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
abort ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bset->s.bset = sbset;
|
bset->s.bset = sbset;
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _BITSET_STATS_H
|
#ifndef _BITSET_STATS_H
|
||||||
#define _BITSET_STATS_H
|
#define _BITSET_STATS_H
|
||||||
|
|||||||
+13
-16
@@ -1,25 +1,22 @@
|
|||||||
/* Bitset vectors.
|
/* Bitset vectors.
|
||||||
Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of 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 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
Bison is free software; you can redistribute it and/or modify it under
|
This program is distributed in the hope that it will be useful,
|
||||||
the terms of the GNU General Public License as published by the Free
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
Software Foundation; either version 2, or (at your option) any later
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
version.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
Bison is distributed in the hope that it will be useful, but WITHOUT ANY
|
You should have received a copy of the GNU General Public License
|
||||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
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, 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
02111-1307, USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _BITSETV_PRINT_H
|
#ifndef _BITSETV_PRINT_H
|
||||||
#define _BITSETV_PRINT_H
|
#define _BITSETV_PRINT_H
|
||||||
|
|||||||
+14
-17
@@ -1,25 +1,22 @@
|
|||||||
/* Bitset vectors.
|
/* Bitset vectors.
|
||||||
Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GCC.
|
This 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.
|
||||||
|
|
||||||
GCC is free software; you can redistribute it and/or modify it under
|
This program is distributed in the hope that it will be useful,
|
||||||
the terms of the GNU General Public License as published by the Free
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
Software Foundation; either version 2, or (at your option) any later
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
version.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
You should have received a copy of the GNU General Public License
|
||||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with GCC; see the file COPYING. If not, write to the Free
|
|
||||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
02111-1307, USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -47,7 +44,7 @@ bitsetv_alloc (bitset_bindex n_vecs, bitset_bindex n_bits,
|
|||||||
/* Allocate vector table at head of bitset array. */
|
/* Allocate vector table at head of bitset array. */
|
||||||
vector_bytes = (n_vecs + 1) * sizeof (bitset) + bytes - 1;
|
vector_bytes = (n_vecs + 1) * sizeof (bitset) + bytes - 1;
|
||||||
vector_bytes -= vector_bytes % bytes;
|
vector_bytes -= vector_bytes % bytes;
|
||||||
bsetv = (bitset *) xcalloc (1, vector_bytes + bytes * n_vecs);
|
bsetv = xcalloc (1, vector_bytes + bytes * n_vecs);
|
||||||
|
|
||||||
for (i = 0; i < n_vecs; i++)
|
for (i = 0; i < n_vecs; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _BITSETV_H
|
#ifndef _BITSETV_H
|
||||||
#define _BITSETV_H
|
#define _BITSETV_H
|
||||||
|
|||||||
+23
-24
@@ -1,5 +1,5 @@
|
|||||||
/* Functions to support expandable bitsets.
|
/* Functions to support expandable bitsets.
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -13,12 +13,11 @@
|
|||||||
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, write to the Free Software Foundation,
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ebitset.h"
|
#include "ebitset.h"
|
||||||
@@ -115,11 +114,11 @@ static ebitset_elt *ebitset_free_list; /* Free list of bitset elements. */
|
|||||||
((BSET)->b.cindex = (EINDEX) * EBITSET_ELT_WORDS, \
|
((BSET)->b.cindex = (EINDEX) * EBITSET_ELT_WORDS, \
|
||||||
(BSET)->b.cdata = EBITSET_WORDS (EBITSET_ELTS (BSET) [EINDEX]))
|
(BSET)->b.cdata = EBITSET_WORDS (EBITSET_ELTS (BSET) [EINDEX]))
|
||||||
|
|
||||||
|
#undef min
|
||||||
|
#undef max
|
||||||
#define min(a, b) ((a) > (b) ? (b) : (a))
|
#define min(a, b) ((a) > (b) ? (b) : (a))
|
||||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||||
|
|
||||||
|
|
||||||
static bitset_bindex
|
static bitset_bindex
|
||||||
ebitset_resize (bitset src, bitset_bindex n_bits)
|
ebitset_resize (bitset src, bitset_bindex n_bits)
|
||||||
{
|
{
|
||||||
@@ -136,7 +135,7 @@ ebitset_resize (bitset src, bitset_bindex n_bits)
|
|||||||
{
|
{
|
||||||
bitset_windex size;
|
bitset_windex size;
|
||||||
|
|
||||||
/* The bitset needs to grow. If we already have enough memory
|
/* The bitset needs to grow. If we already have enough memory
|
||||||
allocated, then just zero what we need. */
|
allocated, then just zero what we need. */
|
||||||
if (newsize > EBITSET_ASIZE (src))
|
if (newsize > EBITSET_ASIZE (src))
|
||||||
{
|
{
|
||||||
@@ -149,13 +148,13 @@ ebitset_resize (bitset src, bitset_bindex n_bits)
|
|||||||
size = newsize;
|
size = newsize;
|
||||||
else
|
else
|
||||||
size = newsize + newsize / 4;
|
size = newsize + newsize / 4;
|
||||||
|
|
||||||
EBITSET_ELTS (src)
|
EBITSET_ELTS (src)
|
||||||
= realloc (EBITSET_ELTS (src), size * sizeof (ebitset_elt *));
|
= realloc (EBITSET_ELTS (src), size * sizeof (ebitset_elt *));
|
||||||
EBITSET_ASIZE (src) = size;
|
EBITSET_ASIZE (src) = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset (EBITSET_ELTS (src) + oldsize, 0,
|
memset (EBITSET_ELTS (src) + oldsize, 0,
|
||||||
(newsize - oldsize) * sizeof (ebitset_elt *));
|
(newsize - oldsize) * sizeof (ebitset_elt *));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -210,7 +209,7 @@ ebitset_elt_alloc (void)
|
|||||||
#define OBSTACK_CHUNK_FREE free
|
#define OBSTACK_CHUNK_FREE free
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__GNUC__) || (__GNUC__ < 2)
|
#if ! defined __GNUC__ || __GNUC__ < 2
|
||||||
#define __alignof__(type) 0
|
#define __alignof__(type) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -322,6 +321,9 @@ ebitset_elt_find (bitset bset, bitset_bindex bindex,
|
|||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
|
||||||
case EBITSET_FIND:
|
case EBITSET_FIND:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -337,9 +339,6 @@ ebitset_elt_find (bitset bset, bitset_bindex bindex,
|
|||||||
|
|
||||||
case EBITSET_SUBST:
|
case EBITSET_SUBST:
|
||||||
return &ebitset_zero_elts[0];
|
return &ebitset_zero_elts[0];
|
||||||
|
|
||||||
default:
|
|
||||||
abort ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -838,10 +837,10 @@ ebitset_unused_clear (bitset dst)
|
|||||||
{
|
{
|
||||||
unsigned int last_bit;
|
unsigned int last_bit;
|
||||||
bitset_bindex n_bits;
|
bitset_bindex n_bits;
|
||||||
|
|
||||||
n_bits = BITSET_NBITS_ (dst);
|
n_bits = BITSET_NBITS_ (dst);
|
||||||
last_bit = n_bits % EBITSET_ELT_BITS;
|
last_bit = n_bits % EBITSET_ELT_BITS;
|
||||||
|
|
||||||
if (last_bit)
|
if (last_bit)
|
||||||
{
|
{
|
||||||
bitset_windex eindex;
|
bitset_windex eindex;
|
||||||
@@ -849,20 +848,20 @@ ebitset_unused_clear (bitset dst)
|
|||||||
ebitset_elt *elt;
|
ebitset_elt *elt;
|
||||||
|
|
||||||
elts = EBITSET_ELTS (dst);
|
elts = EBITSET_ELTS (dst);
|
||||||
|
|
||||||
eindex = n_bits / EBITSET_ELT_BITS;
|
eindex = n_bits / EBITSET_ELT_BITS;
|
||||||
|
|
||||||
elt = elts[eindex];
|
elt = elts[eindex];
|
||||||
if (elt)
|
if (elt)
|
||||||
{
|
{
|
||||||
bitset_windex windex;
|
bitset_windex windex;
|
||||||
bitset_windex woffset;
|
bitset_windex woffset;
|
||||||
bitset_word *srcp = EBITSET_WORDS (elt);
|
bitset_word *srcp = EBITSET_WORDS (elt);
|
||||||
|
|
||||||
windex = n_bits / BITSET_WORD_BITS;
|
windex = n_bits / BITSET_WORD_BITS;
|
||||||
woffset = eindex * EBITSET_ELT_WORDS;
|
woffset = eindex * EBITSET_ELT_WORDS;
|
||||||
|
|
||||||
srcp[windex - woffset] &= ((bitset_word) 1 << last_bit) - 1;
|
srcp[windex - woffset] &= ((bitset_word) 1 << last_bit) - 1;
|
||||||
windex++;
|
windex++;
|
||||||
for (; (windex - woffset) < EBITSET_ELT_WORDS; windex++)
|
for (; (windex - woffset) < EBITSET_ELT_WORDS; windex++)
|
||||||
srcp[windex - woffset] = 0;
|
srcp[windex - woffset] = 0;
|
||||||
@@ -1090,6 +1089,9 @@ ebitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
|
|||||||
dstp = EBITSET_WORDS (delt);
|
dstp = EBITSET_WORDS (delt);
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
|
||||||
case BITSET_OP_OR:
|
case BITSET_OP_OR:
|
||||||
for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
|
for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
|
||||||
{
|
{
|
||||||
@@ -1141,9 +1143,6 @@ ebitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
abort ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ebitset_elt_zero_p (delt))
|
if (!ebitset_elt_zero_p (delt))
|
||||||
|
|||||||
+2
-2
@@ -14,10 +14,10 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _EBITSET_H
|
#ifndef _EBITSET_H
|
||||||
#define _EBITSET_H
|
#define _EBITSET_H
|
||||||
|
|
||||||
#include "bitset.h"
|
#include "bitset.h"
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
/* get-errno.h - get and set errno.
|
/* get-errno.c - get and set errno.
|
||||||
|
|
||||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -14,11 +14,11 @@
|
|||||||
|
|
||||||
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, write to the Free Software Foundation,
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
/* Written by Paul Eggert. */
|
/* Written by Paul Eggert. */
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
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, write to the Free Software Foundation,
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
extern int get_errno (void);
|
extern int get_errno (void);
|
||||||
extern void set_errno (int);
|
extern void set_errno (int);
|
||||||
|
|||||||
+16
-17
@@ -1,5 +1,5 @@
|
|||||||
/* Functions to support link list bitsets.
|
/* Functions to support link list bitsets.
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -13,12 +13,11 @@
|
|||||||
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, write to the Free Software Foundation,
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "lbitset.h"
|
#include "lbitset.h"
|
||||||
@@ -41,7 +40,7 @@
|
|||||||
/* Number of words to use for each element. The larger the value the
|
/* Number of words to use for each element. The larger the value the
|
||||||
greater the size of the cache and the shorter the time to find a given bit
|
greater the size of the cache and the shorter the time to find a given bit
|
||||||
but the more memory wasted for sparse bitsets and the longer the time
|
but the more memory wasted for sparse bitsets and the longer the time
|
||||||
to search for set bits.
|
to search for set bits.
|
||||||
|
|
||||||
The routines that dominate timing profiles are lbitset_elt_find
|
The routines that dominate timing profiles are lbitset_elt_find
|
||||||
and lbitset_elt_link, especially when accessing the bits randomly. */
|
and lbitset_elt_link, especially when accessing the bits randomly. */
|
||||||
@@ -121,7 +120,7 @@ lbitset_elt_alloc (void)
|
|||||||
#define OBSTACK_CHUNK_FREE free
|
#define OBSTACK_CHUNK_FREE free
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__GNUC__) || (__GNUC__ < 2)
|
#if ! defined __GNUC__ || __GNUC__ < 2
|
||||||
#define __alignof__(type) 0
|
#define __alignof__(type) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -363,6 +362,9 @@ lbitset_elt_find (bitset bset, bitset_windex windex,
|
|||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
|
||||||
case LBITSET_FIND:
|
case LBITSET_FIND:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -376,9 +378,6 @@ lbitset_elt_find (bitset bset, bitset_windex windex,
|
|||||||
|
|
||||||
case LBITSET_SUBST:
|
case LBITSET_SUBST:
|
||||||
return &lbitset_zero_elts[0];
|
return &lbitset_zero_elts[0];
|
||||||
|
|
||||||
default:
|
|
||||||
abort ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -888,18 +887,18 @@ lbitset_unused_clear (bitset dst)
|
|||||||
|
|
||||||
n_bits = BITSET_SIZE_ (dst);
|
n_bits = BITSET_SIZE_ (dst);
|
||||||
last_bit = n_bits % LBITSET_ELT_BITS;
|
last_bit = n_bits % LBITSET_ELT_BITS;
|
||||||
|
|
||||||
if (last_bit)
|
if (last_bit)
|
||||||
{
|
{
|
||||||
lbitset_elt *elt;
|
lbitset_elt *elt;
|
||||||
bitset_windex windex;
|
bitset_windex windex;
|
||||||
bitset_word *srcp;
|
bitset_word *srcp;
|
||||||
|
|
||||||
elt = LBITSET_TAIL (dst);
|
elt = LBITSET_TAIL (dst);
|
||||||
srcp = elt->words;
|
srcp = elt->words;
|
||||||
windex = n_bits / BITSET_WORD_BITS;
|
windex = n_bits / BITSET_WORD_BITS;
|
||||||
|
|
||||||
srcp[windex - elt->index] &= ((bitset_word) 1 << last_bit) - 1;
|
srcp[windex - elt->index] &= ((bitset_word) 1 << last_bit) - 1;
|
||||||
windex++;
|
windex++;
|
||||||
|
|
||||||
for (; (windex - elt->index) < LBITSET_ELT_WORDS; windex++)
|
for (; (windex - elt->index) < LBITSET_ELT_WORDS; windex++)
|
||||||
@@ -1117,6 +1116,9 @@ lbitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
|
|||||||
dstp = dtmp->words;
|
dstp = dtmp->words;
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
|
||||||
case BITSET_OP_OR:
|
case BITSET_OP_OR:
|
||||||
for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
|
for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
|
||||||
{
|
{
|
||||||
@@ -1168,9 +1170,6 @@ lbitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
abort ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!lbitset_elt_zero_p (dtmp))
|
if (!lbitset_elt_zero_p (dtmp))
|
||||||
|
|||||||
+2
-2
@@ -14,10 +14,10 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _LBITSET_H
|
#ifndef _LBITSET_H
|
||||||
#define _LBITSET_H
|
#define _LBITSET_H
|
||||||
|
|
||||||
#include "bitset.h"
|
#include "bitset.h"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
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, write to the Free Software Foundation,
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
|
|
||||||
/* Bison depends on libiberty's implementation of bitsets, which
|
/* Bison depends on libiberty's implementation of bitsets, which
|
||||||
|
|||||||
+2
-2
@@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
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 Bison; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
|||||||
+37
-36
@@ -1,6 +1,6 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -14,12 +14,12 @@
|
|||||||
|
|
||||||
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, write to the Free Software Foundation,
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
/* Written by Paul Eggert <[email protected]>
|
/* Written by Paul Eggert <[email protected]>
|
||||||
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -44,9 +44,7 @@
|
|||||||
# define STDOUT_FILENO 1
|
# define STDOUT_FILENO 1
|
||||||
#endif
|
#endif
|
||||||
#if ! HAVE_DUP2 && ! defined dup2
|
#if ! HAVE_DUP2 && ! defined dup2
|
||||||
# if HAVE_FCNTL_H
|
# include <fcntl.h>
|
||||||
# include <fcntl.h>
|
|
||||||
# endif
|
|
||||||
# define dup2(f, t) (close (t), fcntl (f, F_DUPFD, t))
|
# define dup2(f, t) (close (t), fcntl (f, F_DUPFD, t))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -68,10 +66,23 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "unistd-safer.h"
|
||||||
|
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
#define _(Msgid) gettext (Msgid)
|
#define _(Msgid) gettext (Msgid)
|
||||||
|
|
||||||
|
#ifndef __attribute__
|
||||||
|
/* This feature is available in gcc versions 2.5 and later. */
|
||||||
|
# if ! defined __GNUC__ || __GNUC__ < 2 || \
|
||||||
|
(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||||
|
# define __attribute__(Spec) /* empty */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ATTRIBUTE_UNUSED
|
||||||
|
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Initialize this module. */
|
/* Initialize this module. */
|
||||||
|
|
||||||
@@ -99,21 +110,14 @@ pid_t
|
|||||||
create_subpipe (char const * const *argv, int fd[2])
|
create_subpipe (char const * const *argv, int fd[2])
|
||||||
{
|
{
|
||||||
int pipe_fd[2];
|
int pipe_fd[2];
|
||||||
int from_in_fd;
|
int child_fd[2];
|
||||||
int from_out_fd;
|
|
||||||
int to_in_fd;
|
|
||||||
int to_out_fd;
|
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
if (pipe (pipe_fd) != 0)
|
if (pipe_safer (child_fd) != 0 || pipe_safer (pipe_fd) != 0)
|
||||||
error (EXIT_FAILURE, errno, "pipe");
|
error (EXIT_FAILURE, errno, "pipe");
|
||||||
to_in_fd = pipe_fd[0];
|
fd[0] = child_fd[1];
|
||||||
to_out_fd = pipe_fd[1];
|
fd[1] = pipe_fd[0];
|
||||||
|
child_fd[1] = pipe_fd[1];
|
||||||
if (pipe (pipe_fd) != 0)
|
|
||||||
error (EXIT_FAILURE, errno, "pipe");
|
|
||||||
from_in_fd = pipe_fd[0];
|
|
||||||
from_out_fd = pipe_fd[1];
|
|
||||||
|
|
||||||
pid = vfork ();
|
pid = vfork ();
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
@@ -122,33 +126,24 @@ create_subpipe (char const * const *argv, int fd[2])
|
|||||||
if (! pid)
|
if (! pid)
|
||||||
{
|
{
|
||||||
/* Child. */
|
/* Child. */
|
||||||
close (to_out_fd);
|
close (fd[0]);
|
||||||
close (from_in_fd);
|
close (fd[1]);
|
||||||
|
dup2 (child_fd[0], STDIN_FILENO);
|
||||||
if (to_in_fd != STDIN_FILENO)
|
close (child_fd[0]);
|
||||||
{
|
dup2 (child_fd[1], STDOUT_FILENO);
|
||||||
dup2 (to_in_fd, STDIN_FILENO);
|
close (child_fd[1]);
|
||||||
close (to_in_fd);
|
|
||||||
}
|
|
||||||
if (from_out_fd != STDOUT_FILENO)
|
|
||||||
{
|
|
||||||
dup2 (from_out_fd, STDOUT_FILENO);
|
|
||||||
close (from_out_fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The cast to (char **) rather than (char * const *) is needed
|
/* The cast to (char **) rather than (char * const *) is needed
|
||||||
for portability to older hosts with a nonstandard prototype
|
for portability to older hosts with a nonstandard prototype
|
||||||
for execvp. */
|
for execvp. */
|
||||||
execvp (argv[0], (char **) argv);
|
execvp (argv[0], (char **) argv);
|
||||||
|
|
||||||
_exit (errno == ENOENT ? 127 : 126);
|
_exit (errno == ENOENT ? 127 : 126);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parent. */
|
/* Parent. */
|
||||||
close (to_in_fd);
|
close (child_fd[0]);
|
||||||
close (from_out_fd);
|
close (child_fd[1]);
|
||||||
fd[0] = to_out_fd;
|
|
||||||
fd[1] = from_in_fd;
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,3 +173,9 @@ reap_subpipe (pid_t pid, char const *program)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
end_of_output_subpipe (pid_t pid ATTRIBUTE_UNUSED,
|
||||||
|
int fd[2] ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|||||||
+12
-14
@@ -1,22 +1,19 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2005 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 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
Bison is free software; you can redistribute it and/or modify it
|
This program is distributed in the hope that it will be useful,
|
||||||
under the terms of the GNU General Public License as published by
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
any later version.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
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
|
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
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
02111-1307, USA. */
|
|
||||||
|
|
||||||
/* Written by Paul Eggert <[email protected]>
|
/* Written by Paul Eggert <[email protected]>
|
||||||
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
|
||||||
@@ -27,4 +24,5 @@
|
|||||||
|
|
||||||
void init_subpipe (void);
|
void init_subpipe (void);
|
||||||
pid_t create_subpipe (char const * const *, int[2]);
|
pid_t create_subpipe (char const * const *, int[2]);
|
||||||
|
void end_of_output_subpipe (pid_t, int[2]);
|
||||||
void reap_subpipe (pid_t, char const *);
|
void reap_subpipe (pid_t, char const *);
|
||||||
|
|||||||
+18
-18
@@ -1,27 +1,27 @@
|
|||||||
/* Timing variables for measuring compiler performance.
|
/* Timing variables for measuring compiler performance.
|
||||||
Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2000, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||||
|
|
||||||
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 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
Bison is free software; you can redistribute it and/or modify it under
|
This program is distributed in the hope that it will be useful,
|
||||||
the terms of the GNU General Public License as published by the Free
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
Software Foundation; either version 2, or (at your option) any later
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
version.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
Bison is distributed in the hope that it will be useful, but WITHOUT ANY
|
You should have received a copy of the GNU General Public License
|
||||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
#ifdef HAVE_CONFIG_H
|
||||||
along with Bison; see the file COPYING. If not, write to the Free
|
# include <config.h>
|
||||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
#endif
|
||||||
02111-1307, USA. */
|
|
||||||
|
|
||||||
#if IN_GCC
|
#if IN_GCC
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "intl.h"
|
#include "intl.h"
|
||||||
#include "rtl.h"
|
#include "rtl.h"
|
||||||
@@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||||||
/* This source file is taken from the GCC source code, with slight
|
/* This source file is taken from the GCC source code, with slight
|
||||||
modifications that are under control of the IN_GCC preprocessor
|
modifications that are under control of the IN_GCC preprocessor
|
||||||
variable. The !IN_GCC part of this file is specific to Bison. */
|
variable. The !IN_GCC part of this file is specific to Bison. */
|
||||||
|
|
||||||
# include "../src/system.h"
|
# include "../src/system.h"
|
||||||
# if HAVE_SYS_TIME_H
|
# if HAVE_SYS_TIME_H
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
@@ -447,7 +447,7 @@ timevar_print (fp)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
{
|
{
|
||||||
/* Only print stuff if we have some sort of time information. */
|
/* Only print stuff if we have some sort of time information. */
|
||||||
#if defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME) || defined (HAVE_WALL_TIME)
|
#if defined HAVE_USER_TIME || defined HAVE_SYS_TIME || defined HAVE_WALL_TIME
|
||||||
unsigned int /* timevar_id_t */ id;
|
unsigned int /* timevar_id_t */ id;
|
||||||
struct timevar_time_def *total = &timevars[TV_TOTAL].elapsed;
|
struct timevar_time_def *total = &timevars[TV_TOTAL].elapsed;
|
||||||
struct timevar_time_def now;
|
struct timevar_time_def now;
|
||||||
@@ -488,7 +488,7 @@ timevar_print (fp)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Don't print timing variables if we're going to get a row of
|
/* Don't print timing variables if we're going to get a row of
|
||||||
zeroes. */
|
zeroes. */
|
||||||
if (tv->elapsed.user < tiny
|
if (tv->elapsed.user < tiny
|
||||||
&& tv->elapsed.sys < tiny
|
&& tv->elapsed.sys < tiny
|
||||||
&& tv->elapsed.wall < tiny)
|
&& tv->elapsed.wall < tiny)
|
||||||
|
|||||||
+2
-2
@@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
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 Bison; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
/* This file contains timing variable definitions, used by timevar.h
|
/* This file contains timing variable definitions, used by timevar.h
|
||||||
and timevar.c.
|
and timevar.c.
|
||||||
|
|||||||
+10
-13
@@ -2,22 +2,19 @@
|
|||||||
Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
|
||||||
Contributed by Alex Samuel <samuel@codesourcery.com>
|
Contributed by Alex Samuel <samuel@codesourcery.com>
|
||||||
|
|
||||||
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 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
Bison is free software; you can redistribute it and/or modify it
|
This program is distributed in the hope that it will be useful,
|
||||||
under the terms of the GNU General Public License as published by
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
any later version.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
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
|
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
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
02111-1307, USA. */
|
|
||||||
|
|
||||||
#ifndef GCC_TIMEVAR_H
|
#ifndef GCC_TIMEVAR_H
|
||||||
#define GCC_TIMEVAR_H
|
#define GCC_TIMEVAR_H
|
||||||
|
|||||||
+41
-41
@@ -1,5 +1,5 @@
|
|||||||
/* Variable array bitsets.
|
/* Variable array bitsets.
|
||||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -13,12 +13,11 @@
|
|||||||
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, write to the Free Software Foundation,
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "vbitset.h"
|
#include "vbitset.h"
|
||||||
@@ -27,7 +26,7 @@
|
|||||||
|
|
||||||
/* This file implements variable size bitsets stored as a variable
|
/* This file implements variable size bitsets stored as a variable
|
||||||
length array of words. Any unused bits in the last word must be
|
length array of words. Any unused bits in the last word must be
|
||||||
zero.
|
zero.
|
||||||
|
|
||||||
Note that binary or ternary operations assume that each bitset operand
|
Note that binary or ternary operations assume that each bitset operand
|
||||||
has the same size.
|
has the same size.
|
||||||
@@ -38,7 +37,7 @@ static void vbitset_unused_clear (bitset);
|
|||||||
static void vbitset_set (bitset, bitset_bindex);
|
static void vbitset_set (bitset, bitset_bindex);
|
||||||
static void vbitset_reset (bitset, bitset_bindex);
|
static void vbitset_reset (bitset, bitset_bindex);
|
||||||
static bool vbitset_test (bitset, bitset_bindex);
|
static bool vbitset_test (bitset, bitset_bindex);
|
||||||
static bitset_bindex vbitset_list (bitset, bitset_bindex *,
|
static bitset_bindex vbitset_list (bitset, bitset_bindex *,
|
||||||
bitset_bindex, bitset_bindex *);
|
bitset_bindex, bitset_bindex *);
|
||||||
static bitset_bindex vbitset_list_reverse (bitset, bitset_bindex *,
|
static bitset_bindex vbitset_list_reverse (bitset, bitset_bindex *,
|
||||||
bitset_bindex, bitset_bindex *);
|
bitset_bindex, bitset_bindex *);
|
||||||
@@ -48,7 +47,8 @@ static bitset_bindex vbitset_list_reverse (bitset, bitset_bindex *,
|
|||||||
#define VBITSET_SIZE(X) ((X)->b.csize)
|
#define VBITSET_SIZE(X) ((X)->b.csize)
|
||||||
#define VBITSET_ASIZE(X) ((X)->v.size)
|
#define VBITSET_ASIZE(X) ((X)->v.size)
|
||||||
|
|
||||||
|
#undef min
|
||||||
|
#undef max
|
||||||
#define min(a, b) ((a) > (b) ? (b) : (a))
|
#define min(a, b) ((a) > (b) ? (b) : (a))
|
||||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ vbitset_resize (bitset src, bitset_bindex n_bits)
|
|||||||
{
|
{
|
||||||
bitset_windex size;
|
bitset_windex size;
|
||||||
|
|
||||||
/* The bitset needs to grow. If we already have enough memory
|
/* The bitset needs to grow. If we already have enough memory
|
||||||
allocated, then just zero what we need. */
|
allocated, then just zero what we need. */
|
||||||
if (newsize > VBITSET_ASIZE (src))
|
if (newsize > VBITSET_ASIZE (src))
|
||||||
{
|
{
|
||||||
@@ -81,13 +81,13 @@ vbitset_resize (bitset src, bitset_bindex n_bits)
|
|||||||
size = newsize;
|
size = newsize;
|
||||||
else
|
else
|
||||||
size = newsize + newsize / 4;
|
size = newsize + newsize / 4;
|
||||||
|
|
||||||
VBITSET_WORDS (src)
|
VBITSET_WORDS (src)
|
||||||
= realloc (VBITSET_WORDS (src), size * sizeof (bitset_word));
|
= realloc (VBITSET_WORDS (src), size * sizeof (bitset_word));
|
||||||
VBITSET_ASIZE (src) = size;
|
VBITSET_ASIZE (src) = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset (VBITSET_WORDS (src) + oldsize, 0,
|
memset (VBITSET_WORDS (src) + oldsize, 0,
|
||||||
(newsize - oldsize) * sizeof (bitset_word));
|
(newsize - oldsize) * sizeof (bitset_word));
|
||||||
VBITSET_SIZE (src) = newsize;
|
VBITSET_SIZE (src) = newsize;
|
||||||
}
|
}
|
||||||
@@ -426,7 +426,7 @@ vbitset_not (bitset dst, bitset src)
|
|||||||
sizeof (bitset_word) * (dsize - ssize));
|
sizeof (bitset_word) * (dsize - ssize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
vbitset_equal_p (bitset dst, bitset src)
|
vbitset_equal_p (bitset dst, bitset src)
|
||||||
{
|
{
|
||||||
@@ -465,7 +465,7 @@ vbitset_subset_p (bitset dst, bitset src)
|
|||||||
bitset_word *dstp = VBITSET_WORDS (dst);
|
bitset_word *dstp = VBITSET_WORDS (dst);
|
||||||
bitset_windex ssize = VBITSET_SIZE (src);
|
bitset_windex ssize = VBITSET_SIZE (src);
|
||||||
bitset_windex dsize = VBITSET_SIZE (dst);
|
bitset_windex dsize = VBITSET_SIZE (dst);
|
||||||
|
|
||||||
for (i = 0; i < min (ssize, dsize); i++, dstp++, srcp++)
|
for (i = 0; i < min (ssize, dsize); i++, dstp++, srcp++)
|
||||||
if (*dstp != (*srcp | *dstp))
|
if (*dstp != (*srcp | *dstp))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -520,7 +520,7 @@ vbitset_and (bitset dst, bitset src1, bitset src2)
|
|||||||
|
|
||||||
for (i = 0; i < min (ssize1, ssize2); i++)
|
for (i = 0; i < min (ssize1, ssize2); i++)
|
||||||
*dstp++ = *src1p++ & *src2p++;
|
*dstp++ = *src1p++ & *src2p++;
|
||||||
|
|
||||||
memset (dstp, 0, sizeof (bitset_word) * (dsize - min (ssize1, ssize2)));
|
memset (dstp, 0, sizeof (bitset_word) * (dsize - min (ssize1, ssize2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -549,14 +549,14 @@ vbitset_and_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++ & *src2p++;
|
bitset_word tmp = *src1p++ & *src2p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
*dstp = tmp;
|
*dstp = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ssize2 > ssize1)
|
if (ssize2 > ssize1)
|
||||||
{
|
{
|
||||||
src1p = src2p;
|
src1p = src2p;
|
||||||
@@ -600,7 +600,7 @@ vbitset_andn (bitset dst, bitset src1, bitset src2)
|
|||||||
|
|
||||||
for (i = 0; i < min (ssize1, ssize2); i++)
|
for (i = 0; i < min (ssize1, ssize2); i++)
|
||||||
*dstp++ = *src1p++ & ~(*src2p++);
|
*dstp++ = *src1p++ & ~(*src2p++);
|
||||||
|
|
||||||
if (ssize2 > ssize1)
|
if (ssize2 > ssize1)
|
||||||
{
|
{
|
||||||
for (; i < ssize2; i++)
|
for (; i < ssize2; i++)
|
||||||
@@ -642,14 +642,14 @@ vbitset_andn_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++ & ~(*src2p++);
|
bitset_word tmp = *src1p++ & ~(*src2p++);
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
*dstp = tmp;
|
*dstp = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ssize2 > ssize1)
|
if (ssize2 > ssize1)
|
||||||
{
|
{
|
||||||
for (; i < ssize2; i++, dstp++)
|
for (; i < ssize2; i++, dstp++)
|
||||||
@@ -668,7 +668,7 @@ vbitset_andn_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
for (; i < ssize1; i++, dstp++)
|
for (; i < ssize1; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++;
|
bitset_word tmp = *src1p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
@@ -705,7 +705,7 @@ vbitset_or (bitset dst, bitset src1, bitset src2)
|
|||||||
|
|
||||||
for (i = 0; i < min (ssize1, ssize2); i++)
|
for (i = 0; i < min (ssize1, ssize2); i++)
|
||||||
*dstp++ = *src1p++ | *src2p++;
|
*dstp++ = *src1p++ | *src2p++;
|
||||||
|
|
||||||
if (ssize2 > ssize1)
|
if (ssize2 > ssize1)
|
||||||
{
|
{
|
||||||
src1p = src2p;
|
src1p = src2p;
|
||||||
@@ -743,14 +743,14 @@ vbitset_or_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++ | *src2p++;
|
bitset_word tmp = *src1p++ | *src2p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
*dstp = tmp;
|
*dstp = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ssize2 > ssize1)
|
if (ssize2 > ssize1)
|
||||||
{
|
{
|
||||||
src1p = src2p;
|
src1p = src2p;
|
||||||
@@ -760,7 +760,7 @@ vbitset_or_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
for (; i < ssize1; i++, dstp++)
|
for (; i < ssize1; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++;
|
bitset_word tmp = *src1p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
@@ -796,7 +796,7 @@ vbitset_xor (bitset dst, bitset src1, bitset src2)
|
|||||||
|
|
||||||
for (i = 0; i < min (ssize1, ssize2); i++)
|
for (i = 0; i < min (ssize1, ssize2); i++)
|
||||||
*dstp++ = *src1p++ ^ *src2p++;
|
*dstp++ = *src1p++ ^ *src2p++;
|
||||||
|
|
||||||
if (ssize2 > ssize1)
|
if (ssize2 > ssize1)
|
||||||
{
|
{
|
||||||
src1p = src2p;
|
src1p = src2p;
|
||||||
@@ -834,14 +834,14 @@ vbitset_xor_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
for (i = 0; i < min (ssize1, ssize2); i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++ ^ *src2p++;
|
bitset_word tmp = *src1p++ ^ *src2p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
*dstp = tmp;
|
*dstp = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ssize2 > ssize1)
|
if (ssize2 > ssize1)
|
||||||
{
|
{
|
||||||
src1p = src2p;
|
src1p = src2p;
|
||||||
@@ -851,7 +851,7 @@ vbitset_xor_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
for (; i < ssize1; i++, dstp++)
|
for (; i < ssize1; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++;
|
bitset_word tmp = *src1p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
@@ -877,7 +877,7 @@ vbitset_and_or (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
bitset_word *src3p;
|
bitset_word *src3p;
|
||||||
bitset_word *dstp;
|
bitset_word *dstp;
|
||||||
bitset_windex size;
|
bitset_windex size;
|
||||||
|
|
||||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||||
{
|
{
|
||||||
@@ -908,7 +908,7 @@ vbitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
bitset_word *src3p;
|
bitset_word *src3p;
|
||||||
bitset_word *dstp;
|
bitset_word *dstp;
|
||||||
bitset_windex size;
|
bitset_windex size;
|
||||||
|
|
||||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||||
return bitset_and_or_cmp_ (dst, src1, src2, src3);
|
return bitset_and_or_cmp_ (dst, src1, src2, src3);
|
||||||
@@ -920,11 +920,11 @@ vbitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
src3p = VBITSET_WORDS (src3);
|
src3p = VBITSET_WORDS (src3);
|
||||||
dstp = VBITSET_WORDS (dst);
|
dstp = VBITSET_WORDS (dst);
|
||||||
size = VBITSET_SIZE (dst);
|
size = VBITSET_SIZE (dst);
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (i = 0; i < size; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = (*src1p++ & *src2p++) | *src3p++;
|
bitset_word tmp = (*src1p++ & *src2p++) | *src3p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
@@ -944,7 +944,7 @@ vbitset_andn_or (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
bitset_word *src3p;
|
bitset_word *src3p;
|
||||||
bitset_word *dstp;
|
bitset_word *dstp;
|
||||||
bitset_windex size;
|
bitset_windex size;
|
||||||
|
|
||||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||||
{
|
{
|
||||||
@@ -975,7 +975,7 @@ vbitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
bitset_word *src3p;
|
bitset_word *src3p;
|
||||||
bitset_word *dstp;
|
bitset_word *dstp;
|
||||||
bitset_windex size;
|
bitset_windex size;
|
||||||
|
|
||||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||||
return bitset_andn_or_cmp_ (dst, src1, src2, src3);
|
return bitset_andn_or_cmp_ (dst, src1, src2, src3);
|
||||||
@@ -987,11 +987,11 @@ vbitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
src3p = VBITSET_WORDS (src3);
|
src3p = VBITSET_WORDS (src3);
|
||||||
dstp = VBITSET_WORDS (dst);
|
dstp = VBITSET_WORDS (dst);
|
||||||
size = VBITSET_SIZE (dst);
|
size = VBITSET_SIZE (dst);
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (i = 0; i < size; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = (*src1p++ & ~(*src2p++)) | *src3p++;
|
bitset_word tmp = (*src1p++ & ~(*src2p++)) | *src3p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
@@ -1011,7 +1011,7 @@ vbitset_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
bitset_word *src3p;
|
bitset_word *src3p;
|
||||||
bitset_word *dstp;
|
bitset_word *dstp;
|
||||||
bitset_windex size;
|
bitset_windex size;
|
||||||
|
|
||||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||||
{
|
{
|
||||||
@@ -1026,7 +1026,7 @@ vbitset_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
src3p = VBITSET_WORDS (src3);
|
src3p = VBITSET_WORDS (src3);
|
||||||
dstp = VBITSET_WORDS (dst);
|
dstp = VBITSET_WORDS (dst);
|
||||||
size = VBITSET_SIZE (dst);
|
size = VBITSET_SIZE (dst);
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
*dstp++ = (*src1p++ | *src2p++) & *src3p++;
|
*dstp++ = (*src1p++ | *src2p++) & *src3p++;
|
||||||
}
|
}
|
||||||
@@ -1042,7 +1042,7 @@ vbitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
bitset_word *src3p;
|
bitset_word *src3p;
|
||||||
bitset_word *dstp;
|
bitset_word *dstp;
|
||||||
bitset_windex size;
|
bitset_windex size;
|
||||||
|
|
||||||
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
if (BITSET_NBITS_ (src1) != BITSET_NBITS_ (src2)
|
||||||
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
|| BITSET_NBITS_ (src1) != BITSET_NBITS_ (src3))
|
||||||
return bitset_or_and_cmp_ (dst, src1, src2, src3);
|
return bitset_or_and_cmp_ (dst, src1, src2, src3);
|
||||||
@@ -1054,11 +1054,11 @@ vbitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
src3p = VBITSET_WORDS (src3);
|
src3p = VBITSET_WORDS (src3);
|
||||||
dstp = VBITSET_WORDS (dst);
|
dstp = VBITSET_WORDS (dst);
|
||||||
size = VBITSET_SIZE (dst);
|
size = VBITSET_SIZE (dst);
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (i = 0; i < size; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = (*src1p++ | *src2p++) & *src3p++;
|
bitset_word tmp = (*src1p++ | *src2p++) & *src3p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
|
|||||||
+2
-2
@@ -14,10 +14,10 @@ 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, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#ifndef _VBITSET_H
|
#ifndef _VBITSET_H
|
||||||
#define _VBITSET_H
|
#define _VBITSET_H
|
||||||
|
|
||||||
#include "bitset.h"
|
#include "bitset.h"
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
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 Bison; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|||||||
+19
-8
@@ -1,36 +1,47 @@
|
|||||||
*_gl.m4
|
*_gl.m4
|
||||||
alloca.m4
|
absolute-header.m4
|
||||||
codeset.m4
|
argmatch.m4
|
||||||
dirname.m4
|
dirname.m4
|
||||||
dos.m4
|
dos.m4
|
||||||
|
double-slash-root.m4
|
||||||
error.m4
|
error.m4
|
||||||
exitfail.m4
|
exitfail.m4
|
||||||
extensions.m4
|
extensions.m4
|
||||||
getopt.m4
|
getopt.m4
|
||||||
gettext.m4
|
|
||||||
gnulib.m4
|
gnulib.m4
|
||||||
hard-locale.m4
|
|
||||||
hash.m4
|
hash.m4
|
||||||
iconv.m4
|
iconv.m4
|
||||||
|
inttypes_h.m4
|
||||||
lib-ld.m4
|
lib-ld.m4
|
||||||
lib-link.m4
|
lib-link.m4
|
||||||
lib-prefix.m4
|
lib-prefix.m4
|
||||||
|
longlong.m4
|
||||||
mbrtowc.m4
|
mbrtowc.m4
|
||||||
mbstate_t.m4
|
mbstate_t.m4
|
||||||
mbswidth.m4
|
mbswidth.m4
|
||||||
nls.m4
|
nls.m4
|
||||||
obstack.m4
|
|
||||||
onceonly.m4
|
|
||||||
po.m4
|
po.m4
|
||||||
progtest.m4
|
progtest.m4
|
||||||
quote.m4
|
quote.m4
|
||||||
quotearg.m4
|
quotearg.m4
|
||||||
stdbool.m4
|
stdbool.m4
|
||||||
|
stdint.m4
|
||||||
|
stdint_h.m4
|
||||||
|
stdio-safer.m4
|
||||||
stpcpy.m4
|
stpcpy.m4
|
||||||
strdup.m4
|
strerror.m4
|
||||||
strerror_r.m4
|
|
||||||
strndup.m4
|
strndup.m4
|
||||||
strnlen.m4
|
strnlen.m4
|
||||||
|
strtol.m4
|
||||||
|
strtoul.m4
|
||||||
|
strverscmp.m4
|
||||||
|
uintmax_t.m4
|
||||||
|
ulonglong.m4
|
||||||
|
unistd-safer.m4
|
||||||
|
unistd_h.m4
|
||||||
unlocked-io.m4
|
unlocked-io.m4
|
||||||
|
warning.m4
|
||||||
|
wchar_t.m4
|
||||||
|
wcwidth.m4
|
||||||
xalloc.m4
|
xalloc.m4
|
||||||
xstrndup.m4
|
xstrndup.m4
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
# bison-i18n.m4 serial 1 (bison-2.1)
|
||||||
|
dnl Copyright (C) 2005 Free Software Foundation, Inc.
|
||||||
|
dnl This file is free software; the Free Software Foundation
|
||||||
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
|
dnl with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
dnl From Bruno Haible.
|
||||||
|
|
||||||
|
dnl Support for internationalization of bison-generated parsers.
|
||||||
|
|
||||||
|
dnl BISON_I18N
|
||||||
|
dnl should be used in configure.ac, after AM_GNU_GETTEXT. If USE_NLS is yes, it
|
||||||
|
dnl sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files
|
||||||
|
dnl and defines YYENABLE_NLS if there are bison-runtime.mo files at all.
|
||||||
|
AC_DEFUN([BISON_I18N],
|
||||||
|
[
|
||||||
|
if test -z "$USE_NLS"; then
|
||||||
|
echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
BISON_LOCALEDIR=
|
||||||
|
if test "$USE_NLS" = yes; then
|
||||||
|
dnl AC_PROG_YACC sets the YACC variable; other macros set the BISON variable.
|
||||||
|
if test -n "$YACC"; then
|
||||||
|
case "$YACC" in
|
||||||
|
*bison*)
|
||||||
|
if ($YACC --print-localedir) >/dev/null 2>&1; then
|
||||||
|
BISON_LOCALEDIR=`$YACC --print-localedir`
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
if test -n "$BISON"; then
|
||||||
|
if test "$BISON" != ":"; then
|
||||||
|
if ($BISON --print-localedir) >/dev/null 2>&1; then
|
||||||
|
BISON_LOCALEDIR=`$BISON --print-localedir`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
AC_SUBST([BISON_LOCALEDIR])
|
||||||
|
if test -n "$BISON_LOCALEDIR"; then
|
||||||
|
USER_LINGUAS="${LINGUAS-%UNSET%}"
|
||||||
|
if test -n "$USER_LINGUAS"; then
|
||||||
|
BISON_USE_NLS=yes
|
||||||
|
else
|
||||||
|
BISON_USE_NLS=no
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
BISON_USE_NLS=no
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
BISON_USE_NLS=no
|
||||||
|
fi
|
||||||
|
if test $BISON_USE_NLS = yes; then
|
||||||
|
AC_DEFINE([YYENABLE_NLS], 1,
|
||||||
|
[Define to 1 to internationalize bison runtime messages.])
|
||||||
|
fi
|
||||||
|
])
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Finding valid warning flags for the C Compiler. -*-Autoconf-*-
|
# Sanity test a C compiler.
|
||||||
#
|
|
||||||
# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
# Copyright (C) 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
|
||||||
@@ -14,19 +14,16 @@
|
|||||||
#
|
#
|
||||||
# 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, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
# 02111-1307 USA
|
# 02110-1301 USA
|
||||||
|
|
||||||
# serial 1
|
# Written by Paul Eggert.
|
||||||
|
|
||||||
AC_DEFUN([BISON_WARNING],
|
AC_DEFUN([BISON_TEST_FOR_WORKING_C_COMPILER], [
|
||||||
[AC_MSG_CHECKING(whether compiler accepts $1)
|
AC_COMPILE_IFELSE(
|
||||||
AC_SUBST(WARNING_CFLAGS)
|
[AC_LANG_PROGRAM(
|
||||||
ac_save_CFLAGS="$CFLAGS"
|
[[#include <limits.h>
|
||||||
CFLAGS="$CFLAGS $1"
|
int test_array[CHAR_BIT];]])],
|
||||||
AC_TRY_COMPILE(,
|
[],
|
||||||
[int x;],
|
[AC_MSG_FAILURE([cannot compile a simple C program])])
|
||||||
WARNING_CFLAGS="$WARNING_CFLAGS $1"
|
])
|
||||||
AC_MSG_RESULT(yes),
|
|
||||||
AC_MSG_RESULT(no))
|
|
||||||
CFLAGS="$ac_save_CFLAGS"])
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- Autoconf -*-
|
# -*- Autoconf -*-
|
||||||
# Sanity-test a C++ compiler.
|
# Sanity-test a C++ compiler.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
# Copyright (C) 2004, 2006 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,25 +15,39 @@
|
|||||||
#
|
#
|
||||||
# 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, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
# 02111-1307 USA
|
# 02110-1301 USA
|
||||||
|
|
||||||
# Written by Paul Eggert <[email protected]>.
|
# Written by Paul Eggert.
|
||||||
|
|
||||||
AC_DEFUN([BISON_TEST_FOR_WORKING_CXX_COMPILER],
|
AC_DEFUN([BISON_TEST_FOR_WORKING_CXX_COMPILER],
|
||||||
[
|
[
|
||||||
AC_CACHE_CHECK([whether $CXX builds executables that work],
|
AC_CACHE_CHECK([whether $CXX builds executables that work],
|
||||||
bison_cv_cxx_works,
|
bison_cv_cxx_works,
|
||||||
[AC_LANG_PUSH([C++])
|
[AC_LANG_PUSH([C++])
|
||||||
AC_RUN_IFELSE(
|
bison_cv_cxx_works=no
|
||||||
|
AC_COMPILE_IFELSE(
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[#include <iostream>
|
[#include <cstdlib>
|
||||||
|
#include <iostream>
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
using namespace std;],
|
using namespace std;],
|
||||||
[std::cerr << "";
|
[std::cerr << "";
|
||||||
cout << "";])],
|
cout << "";
|
||||||
[bison_cv_cxx_works=yes],
|
typedef std::pair<unsigned int, int> uipair;
|
||||||
[bison_cv_cxx_works=no],
|
std::map<unsigned int, int> m;
|
||||||
[bison_cv_cxx_works=cross])
|
std::map<unsigned int, int>::iterator i;
|
||||||
|
m.insert (uipair (4, -4));
|
||||||
|
for (i = m.begin (); i != m.end (); ++i)
|
||||||
|
if (i->first != 4)
|
||||||
|
return 1;])],
|
||||||
|
[AS_IF([AC_TRY_COMMAND([$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD])],
|
||||||
|
[AS_IF([test "$cross_compiling" = yes],
|
||||||
|
[bison_cv_cxx_works=cross],
|
||||||
|
[AS_IF([AC_TRY_COMMAND(./conftest$ac_exeext)],
|
||||||
|
[bison_cv_cxx_works=yes])])])
|
||||||
|
rm -f conftest$ac_exeext])
|
||||||
AC_LANG_POP([C++])])
|
AC_LANG_POP([C++])])
|
||||||
|
|
||||||
case $bison_cv_cxx_works in
|
case $bison_cv_cxx_works in
|
||||||
@@ -44,4 +58,5 @@ AC_DEFUN([BISON_TEST_FOR_WORKING_CXX_COMPILER],
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
AC_SUBST([BISON_CXX_WORKS])
|
AC_SUBST([BISON_CXX_WORKS])
|
||||||
|
AM_CONDITIONAL(BISON_CXX_WORKS, test $bison_cv_cxx_works = yes)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
#
|
#
|
||||||
# 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, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
# 02111-1307, USA.
|
# 02110-1301, USA.
|
||||||
|
|
||||||
# BISON_PROG_GNU_M4
|
# BISON_PROG_GNU_M4
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
+3
-4
@@ -1,7 +1,7 @@
|
|||||||
# -*- Autoconf -*-
|
# -*- Autoconf -*-
|
||||||
# Checks required to run `subpipe'.
|
# Checks required to run `subpipe'.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,15 +15,14 @@
|
|||||||
#
|
#
|
||||||
# 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, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
# 02111-1307 USA
|
# 02110-1301 USA
|
||||||
|
|
||||||
# Written by Paul Eggert <[email protected]>.
|
# Written by Paul Eggert <[email protected]>.
|
||||||
|
|
||||||
AC_DEFUN([BISON_PREREQ_SUBPIPE],
|
AC_DEFUN([BISON_PREREQ_SUBPIPE],
|
||||||
[
|
[
|
||||||
AC_TYPE_PID_T
|
AC_TYPE_PID_T
|
||||||
AC_CHECK_HEADERS([fcntl.h])
|
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_CHECK_FUNCS(dup2 waitpid)
|
AC_CHECK_FUNCS(dup2 waitpid)
|
||||||
AC_FUNC_FORK
|
AC_FUNC_FORK
|
||||||
|
|||||||
+2
-2
@@ -15,8 +15,8 @@
|
|||||||
#
|
#
|
||||||
# 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, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
# 02111-1307 USA
|
# 02110-1301 USA
|
||||||
|
|
||||||
# serial 2
|
# serial 2
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user