mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-12 04:05:14 +00:00
Compare commits
731
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b590ad0292 | ||
|
|
05e70adf22 | ||
|
|
7efe0b5da3 | ||
|
|
351e3630bb | ||
|
|
4fd1fc70e0 | ||
|
|
e02ce4c7f0 | ||
|
|
7cab285eda | ||
|
|
86efe28222 | ||
|
|
cf1446dc9e | ||
|
|
e93c40b33d | ||
|
|
eff6739124 | ||
|
|
5a0d7802f4 | ||
|
|
f1e0839c9e | ||
|
|
3bf429aed8 | ||
|
|
f8cadc731b | ||
|
|
bd7aebb8b0 | ||
|
|
ca8039e612 | ||
|
|
5d07f4f726 | ||
|
|
e605ad9679 | ||
|
|
50fac71d46 | ||
|
|
a8455b072a | ||
|
|
a9d6e16e0a | ||
|
|
bd0cf11e00 | ||
|
|
c8512e09e7 | ||
|
|
96f503e197 | ||
|
|
9912dd28ca | ||
|
|
22aaad0c45 | ||
|
|
a45ed4ecc1 | ||
|
|
fef272bdf3 | ||
|
|
d1f57a4ae5 | ||
|
|
5d5f12fb0d | ||
|
|
9f6013a0fd | ||
|
|
fad0f9231b | ||
|
|
81df326649 | ||
|
|
01c5b6ab0f | ||
|
|
c45f86d286 | ||
|
|
1664d1c5ed | ||
|
|
71758d854a | ||
|
|
3751d50e70 | ||
|
|
3f5e6905da | ||
|
|
719782e6ba | ||
|
|
ee175dfd00 | ||
|
|
f3110c9b9a | ||
|
|
18743948b5 | ||
|
|
849d91bc02 | ||
|
|
73a822e636 | ||
|
|
5b879c8980 | ||
|
|
8fd5f0d5a5 | ||
|
|
a4dce889a4 | ||
|
|
7c4b40de61 | ||
|
|
f9bba892bd | ||
|
|
facfd9c406 | ||
|
|
0308dfb039 | ||
|
|
9d8fc7fd3e | ||
|
|
b5515215c1 | ||
|
|
ab3dc5415c | ||
|
|
06f3245fa4 | ||
|
|
05d702422a | ||
|
|
121da2cbdb | ||
|
|
7a45fc35bf | ||
|
|
ae1e65a285 | ||
|
|
ba9db64745 | ||
|
|
b4b8666e4a | ||
|
|
0021bc3e28 | ||
|
|
4b0efdeb28 | ||
|
|
73917e9e6f | ||
|
|
ba29791773 | ||
|
|
a7842d1bc0 | ||
|
|
81a9580622 | ||
|
|
85f7c08036 | ||
|
|
098f5084a0 | ||
|
|
07a4b32f4d | ||
|
|
3ead69b1c1 | ||
|
|
42f0b949ec | ||
|
|
e7b709ab0b | ||
|
|
35068fbe66 | ||
|
|
16d34d8036 | ||
|
|
bfbd73f3e0 | ||
|
|
602f8e2a77 | ||
|
|
ace93397c1 | ||
|
|
d2192653db | ||
|
|
83a832618d | ||
|
|
0e0d7d2975 | ||
|
|
5abbc66fe4 | ||
|
|
bf338b7cd2 | ||
|
|
3967e46a2d | ||
|
|
b994c3bf78 | ||
|
|
03a13ce793 | ||
|
|
f5fc21240f | ||
|
|
ebddc0a0d2 | ||
|
|
8359341013 | ||
|
|
c7fe52e514 | ||
|
|
5cdbc97c9d | ||
|
|
9017924783 | ||
|
|
e3fdc37049 | ||
|
|
a99b4f45bb | ||
|
|
ea31f21fd8 | ||
|
|
2b0a9c69df | ||
|
|
c69944ff8b | ||
|
|
01898726e2 | ||
|
|
20a6c3175f | ||
|
|
45ef3d92a1 | ||
|
|
fa386893aa | ||
|
|
dc73dc4fb2 | ||
|
|
677a91aef2 | ||
|
|
dab2ee0f74 | ||
|
|
7f49dc7d1d | ||
|
|
5f26baa748 | ||
|
|
80752c0dc1 | ||
|
|
f8c9c7acae | ||
|
|
7d324cf00c | ||
|
|
98364385a6 | ||
|
|
b5197d5770 | ||
|
|
e9b69f8655 | ||
|
|
099339df0a | ||
|
|
8e4ca87228 | ||
|
|
72e2a94d5f | ||
|
|
059cb26ca2 | ||
|
|
c3d32f4a9a | ||
|
|
74484f42f3 | ||
|
|
6565b9a566 | ||
|
|
b8351d06f1 | ||
|
|
67521bc0e8 | ||
|
|
4fb70e4dd3 | ||
|
|
3ac6af879d | ||
|
|
f3d09f3108 | ||
|
|
1cb6c26b4f | ||
|
|
c164fc0822 | ||
|
|
25347d885c | ||
|
|
fa264a0687 | ||
|
|
5fe636c7ee | ||
|
|
50b8d4ba5a | ||
|
|
57d69b04b2 | ||
|
|
3e6a075f7f | ||
|
|
29b1da4e18 | ||
|
|
667588ee8a | ||
|
|
b122a71c83 | ||
|
|
1a0b3bf83b | ||
|
|
53bde230c6 | ||
|
|
fd3c17995e | ||
|
|
d13a7fdb0a | ||
|
|
a61a84ec6a | ||
|
|
394c1aa6f2 | ||
|
|
5281d09af7 | ||
|
|
0299b699bb | ||
|
|
cff8d06e51 | ||
|
|
45372aed4e | ||
|
|
b89b6517f2 | ||
|
|
cd45c269e2 | ||
|
|
44cad07704 | ||
|
|
f612071298 | ||
|
|
a7694cedf9 | ||
|
|
2fead9abdb | ||
|
|
d573ef0d69 | ||
|
|
6cdd3287dd | ||
|
|
2d60a624c9 | ||
|
|
5d4bd04588 | ||
|
|
47f92cb354 | ||
|
|
715fdcffbf | ||
|
|
153df66692 | ||
|
|
ce9d542a78 | ||
|
|
c66e591fa5 | ||
|
|
2495c49077 | ||
|
|
6c3b482891 | ||
|
|
5ec892c480 | ||
|
|
9188385b55 | ||
|
|
1bf3e2860b | ||
|
|
7d8d1c3f92 | ||
|
|
694c6234f9 | ||
|
|
13b70e2218 | ||
|
|
fa55bfa71f | ||
|
|
93d2986bba | ||
|
|
75964cf0df | ||
|
|
3c2b71cde6 | ||
|
|
37c6dbb8ad | ||
|
|
0883e6591f | ||
|
|
a538d0d8aa | ||
|
|
2645ee3519 | ||
|
|
ad15cd977a | ||
|
|
4e97614f5a | ||
|
|
82c36f0f0b | ||
|
|
ee1bcce627 | ||
|
|
8347aabe14 | ||
|
|
25bdc41ee0 | ||
|
|
57e3f5a80c | ||
|
|
8c3eae0d44 | ||
|
|
6fe281271c | ||
|
|
23a37cc1c5 | ||
|
|
eb1b04fa00 | ||
|
|
cdc252ace9 | ||
|
|
95b55cc5c4 | ||
|
|
e96d567a27 | ||
|
|
b62b690ccf | ||
|
|
7d687eaee3 | ||
|
|
a2ab59fa18 | ||
|
|
777226dd9f | ||
|
|
95e1b48e20 | ||
|
|
bb077f38f7 | ||
|
|
a6316700e8 | ||
|
|
795f7e32cc | ||
|
|
c721eb9e28 | ||
|
|
3aed6a21f5 | ||
|
|
b6d3f107fe | ||
|
|
704a04512c | ||
|
|
2586398fcc | ||
|
|
d9b37a62ff | ||
|
|
3d2bf2a8e3 | ||
|
|
a3ced22c06 | ||
|
|
a2b6281b39 | ||
|
|
cf4600ca45 | ||
|
|
8d64416e8c | ||
|
|
26859f6d61 | ||
|
|
f84a8e96d1 | ||
|
|
4247df921b | ||
|
|
9bdff3d271 | ||
|
|
d03b1a7e8c | ||
|
|
973c456f63 | ||
|
|
2d07940325 | ||
|
|
13cdb2d397 | ||
|
|
b2a3a302e6 | ||
|
|
8c4a1163ee | ||
|
|
cf4e3eecef | ||
|
|
2eaa7ed946 | ||
|
|
e198269f40 | ||
|
|
6181f05630 | ||
|
|
a4ba0d21a1 | ||
|
|
5d0764d23b | ||
|
|
41ded58286 | ||
|
|
5649888686 | ||
|
|
e40a3eed34 | ||
|
|
6537a59c98 | ||
|
|
154bc7ddac | ||
|
|
a990213582 | ||
|
|
9dfd46a5d5 | ||
|
|
984d8cc72c | ||
|
|
896b2f75c5 | ||
|
|
3ce67fa673 | ||
|
|
889dea0275 | ||
|
|
ab3ec56ffe | ||
|
|
c8da23c372 | ||
|
|
69720f1231 | ||
|
|
100f8696c7 | ||
|
|
8c6b06df1f | ||
|
|
6d9aafc5ad | ||
|
|
878dc0a172 | ||
|
|
a874011e37 | ||
|
|
3eb9042a30 | ||
|
|
aa5de5728c | ||
|
|
21eeee46e9 | ||
|
|
db025a6fb7 | ||
|
|
ca822faeec | ||
|
|
ae915ab8e7 | ||
|
|
27630864e7 | ||
|
|
857be0e10f | ||
|
|
bbfa419b89 | ||
|
|
b7613423ce | ||
|
|
49dc1b5bf1 | ||
|
|
f475105c2f | ||
|
|
a60a9e3071 | ||
|
|
c53d599df4 | ||
|
|
9458250968 | ||
|
|
8cbc235723 | ||
|
|
9a377eb0a8 | ||
|
|
09aa05d89c | ||
|
|
2b7dca1c86 | ||
|
|
3367d8dd5c | ||
|
|
8da0cef821 | ||
|
|
fb1e27cf47 | ||
|
|
65fa634cdc | ||
|
|
7c64b1f4ff | ||
|
|
9611baf855 | ||
|
|
2559f4cec5 | ||
|
|
d4fbda2a94 | ||
|
|
84dcd7991b | ||
|
|
50910389c9 | ||
|
|
6cc69f4d14 | ||
|
|
46532a9d3b | ||
|
|
5603f0bdf2 | ||
|
|
ce99bc67b8 | ||
|
|
9ff76cdda8 | ||
|
|
84744e5f63 | ||
|
|
09bc1b99c9 | ||
|
|
f19ecae3b2 | ||
|
|
e3257f88e2 | ||
|
|
b4ea71a8b2 | ||
|
|
c85418ba07 | ||
|
|
0e38617ad7 | ||
|
|
493182f70e | ||
|
|
ed2c9a69d3 | ||
|
|
333bcd2ee3 | ||
|
|
04705b9370 | ||
|
|
79331541ae | ||
|
|
d6fb1813ee | ||
|
|
7194099027 | ||
|
|
171b6bacb9 | ||
|
|
e1c33f04d1 | ||
|
|
3c22b260b1 | ||
|
|
e5000890a4 | ||
|
|
ea0db44fed | ||
|
|
ec99c418a7 | ||
|
|
a807cfa6eb | ||
|
|
41c43ef3d7 | ||
|
|
1dac131ec4 | ||
|
|
9268d9aceb | ||
|
|
bb5603c2f0 | ||
|
|
2c29a70819 | ||
|
|
cf31256f9a | ||
|
|
7132650bba | ||
|
|
d908fb3f18 | ||
|
|
d023679818 | ||
|
|
d87c8ac79a | ||
|
|
a7e46f6e41 | ||
|
|
2d7e743802 | ||
|
|
50fb434689 | ||
|
|
b5d4eb8913 | ||
|
|
2116ad3a28 | ||
|
|
15233a3728 | ||
|
|
b476c143c0 | ||
|
|
2caaeba496 | ||
|
|
95a65a3215 | ||
|
|
33e523878b | ||
|
|
2360e39906 | ||
|
|
10082ac068 | ||
|
|
de64159e7f | ||
|
|
280c40a350 | ||
|
|
c1cf82f9c8 | ||
|
|
55947367c6 | ||
|
|
b4e9eaefd5 | ||
|
|
1a968edcb8 | ||
|
|
82fa282a1b | ||
|
|
e504c843c1 | ||
|
|
3fda8335bf | ||
|
|
9645a2b20e | ||
|
|
7ff6b7bbca | ||
|
|
44e76d801f | ||
|
|
32e0fd1a99 | ||
|
|
b610f43f25 | ||
|
|
f348522005 | ||
|
|
e866c476fd | ||
|
|
72252aaa97 | ||
|
|
a1513c265b | ||
|
|
425044a936 | ||
|
|
5010af94d0 | ||
|
|
005ea24cbb | ||
|
|
adf0425d11 | ||
|
|
cb4e7ecefa | ||
|
|
2e9ad04cdb | ||
|
|
28cde9c128 | ||
|
|
d288047e9b | ||
|
|
d135a16792 | ||
|
|
75417c1c1c | ||
|
|
8bc4348cc7 | ||
|
|
1113522acb | ||
|
|
45b9d97b54 | ||
|
|
b01b80836d | ||
|
|
bd07c76b0a | ||
|
|
45ca5043ce | ||
|
|
ef98967ada | ||
|
|
7783ba2d4f | ||
|
|
bbd17b68fb | ||
|
|
30c179fee8 | ||
|
|
7ab25ad020 | ||
|
|
e555fb5e55 | ||
|
|
0931d14728 | ||
|
|
e76245fcd9 | ||
|
|
c2de9dafd1 | ||
|
|
f7de571ff1 | ||
|
|
c226d4ed48 | ||
|
|
9df53e7288 | ||
|
|
9a5c688ae4 | ||
|
|
e3b7c01820 | ||
|
|
5cc5703239 | ||
|
|
c8dc9a8f51 | ||
|
|
f9a6b34147 | ||
|
|
48828e779f | ||
|
|
4ad0ed3425 | ||
|
|
ad42f96053 | ||
|
|
4410084223 | ||
|
|
ccc759e81a | ||
|
|
e19e088e66 | ||
|
|
9c80fa286e | ||
|
|
da8f4a2f5f | ||
|
|
f18f71cfb0 | ||
|
|
11548b8e68 | ||
|
|
b79b889de5 | ||
|
|
7b24c424b5 | ||
|
|
0d06a966f8 | ||
|
|
3df32101e7 | ||
|
|
c699078246 | ||
|
|
4c7377f499 | ||
|
|
9502b2ab48 | ||
|
|
a0f33a28e9 | ||
|
|
0def17c3d1 | ||
|
|
d2e7bc1613 | ||
|
|
70875b4873 | ||
|
|
34d1773990 | ||
|
|
27767290da | ||
|
|
2efaa8e96a | ||
|
|
4cdcb6f243 | ||
|
|
7f42eb0a5e | ||
|
|
d03ad8b686 | ||
|
|
f462a08572 | ||
|
|
0ac08d2d6c | ||
|
|
6053dcae59 | ||
|
|
5952fe5abf | ||
|
|
d0447d949b | ||
|
|
f3bd6a25bf | ||
|
|
38d91ccd96 | ||
|
|
0dfa650f59 | ||
|
|
1e7a8315f6 | ||
|
|
4eeec4e41f | ||
|
|
6fd3372db4 | ||
|
|
f24afe4435 | ||
|
|
1047f3c095 | ||
|
|
928a817418 | ||
|
|
ae8d777ad6 | ||
|
|
d17dc9a8b5 | ||
|
|
7bb478bd19 | ||
|
|
9c29c52fce | ||
|
|
2a11380460 | ||
|
|
77a0e35143 | ||
|
|
2e9e591889 | ||
|
|
a6ec9ca2f1 | ||
|
|
370a302f34 | ||
|
|
2b5a27ba3d | ||
|
|
d132c2d545 | ||
|
|
bb45005671 | ||
|
|
0afeaa2ab7 | ||
|
|
dbd1609311 | ||
|
|
ad9500f3fd | ||
|
|
76bd8a6b4a | ||
|
|
7e6bd4bb33 | ||
|
|
e1dd2807e6 | ||
|
|
96748b2bf8 | ||
|
|
4b314bdb6d | ||
|
|
d855f6c806 | ||
|
|
1ee41a50d9 | ||
|
|
8bf276d820 | ||
|
|
476c1cca59 | ||
|
|
55fb68aabf | ||
|
|
0d40b36417 | ||
|
|
b809770efb | ||
|
|
009285d20a | ||
|
|
3e8d1bd053 | ||
|
|
32ea6125e3 | ||
|
|
baa423bd59 | ||
|
|
75fbe357c8 | ||
|
|
a668f48631 | ||
|
|
3d75e7de1e | ||
|
|
9524161147 | ||
|
|
d6445ec10b | ||
|
|
7ca7a3abf3 | ||
|
|
c4e686a1ab | ||
|
|
2646fd012d | ||
|
|
a2c525b34c | ||
|
|
658b189348 | ||
|
|
a06344172a | ||
|
|
573654ca9e | ||
|
|
0b0370ff42 | ||
|
|
eaa476a7e9 | ||
|
|
16832bf546 | ||
|
|
eabb3df7aa | ||
|
|
0ab29b7c20 | ||
|
|
559b30881d | ||
|
|
88ffc4b907 | ||
|
|
3e82dfaa0d | ||
|
|
11d820174f | ||
|
|
da6f07468a | ||
|
|
93ee7a47e7 | ||
|
|
875ef1b90c | ||
|
|
650af77812 | ||
|
|
c03a8db0cc | ||
|
|
8b06c6b871 | ||
|
|
c5da1a2adc | ||
|
|
dfd5b89d01 | ||
|
|
ca5a716303 | ||
|
|
d72642d691 | ||
|
|
9a91e7f246 | ||
|
|
671850a1c3 | ||
|
|
ee028dceff | ||
|
|
e1d06b5235 | ||
|
|
821394a3c8 | ||
|
|
00cebd11d4 | ||
|
|
ee2f433512 | ||
|
|
5422471cbb | ||
|
|
8a4ec3595b | ||
|
|
7cf84b13a0 | ||
|
|
56351d4c7b | ||
|
|
478c4a8f49 | ||
|
|
13e294ee55 | ||
|
|
a16074bb09 | ||
|
|
8386f6ef28 | ||
|
|
827bc59ca1 | ||
|
|
3209eb1c4c | ||
|
|
975bb56431 | ||
|
|
8d4dc896cb | ||
|
|
a3c3c6f242 | ||
|
|
179b2419ba | ||
|
|
b702ec61ab | ||
|
|
ab96bb2457 | ||
|
|
fc51acddb4 | ||
|
|
957255b82c | ||
|
|
8044fda634 | ||
|
|
b7d4c48e55 | ||
|
|
b167e7ba0d | ||
|
|
85d57e27d2 | ||
|
|
461f1516f8 | ||
|
|
26eb4f0bdc | ||
|
|
fc6c85664a | ||
|
|
0bd5ee5f89 | ||
|
|
a3efd13e44 | ||
|
|
a4122000c6 | ||
|
|
461983270c | ||
|
|
ea99d6e6a0 | ||
|
|
184b42c85b | ||
|
|
be29c71dd8 | ||
|
|
d439985436 | ||
|
|
f3d2a1b2ac | ||
|
|
21cf80399f | ||
|
|
7b0ca050f7 | ||
|
|
a339aef48a | ||
|
|
44186fc4ec | ||
|
|
5c77412162 | ||
|
|
5cf6e669af | ||
|
|
16bb9f1647 | ||
|
|
edb2e90531 | ||
|
|
6d94eebba7 | ||
|
|
c2ecada32b | ||
|
|
458171e6df | ||
|
|
8d0b7cef7d | ||
|
|
afc4457605 | ||
|
|
60dcc936ce | ||
|
|
ad9d4f9f2e | ||
|
|
3cc83855d9 | ||
|
|
5407fc7d76 | ||
|
|
516652b474 | ||
|
|
026816664f | ||
|
|
265640d56e | ||
|
|
ee9cdb8595 | ||
|
|
a810712331 | ||
|
|
1a9646fc91 | ||
|
|
67411a88a0 | ||
|
|
0bfe22b6d5 | ||
|
|
3a684d611e | ||
|
|
a9733794bb | ||
|
|
19fe1aa332 | ||
|
|
39bace5da8 | ||
|
|
071863b3d8 | ||
|
|
e4678430c2 | ||
|
|
2b7fe38c36 | ||
|
|
4c4191cec2 | ||
|
|
ae7cd18c98 | ||
|
|
4f3cc9c21b | ||
|
|
55a2063005 | ||
|
|
77482f2783 | ||
|
|
5a6e85fb8d | ||
|
|
9e87ff5472 | ||
|
|
3afe18fd1f | ||
|
|
b51cf830a6 | ||
|
|
66b03e134f | ||
|
|
3dc50b3bc2 | ||
|
|
0a244a2269 | ||
|
|
b5e27aa262 | ||
|
|
0149d39e6e | ||
|
|
1d91bfdf1c | ||
|
|
db40c3f869 | ||
|
|
b663fd5322 | ||
|
|
a728075710 | ||
|
|
c4aa4ff541 | ||
|
|
b97bbbaed7 | ||
|
|
e386b50f26 | ||
|
|
534497f54b | ||
|
|
a62a7b014c | ||
|
|
de1a2f20dd | ||
|
|
afcc58c63e | ||
|
|
d3ae5af6ec | ||
|
|
41dfa1cbf0 | ||
|
|
b7171c45f4 | ||
|
|
ac953ff80a | ||
|
|
facb910cbd | ||
|
|
8faace8d1d | ||
|
|
9cdcbdf2cf | ||
|
|
45c64fa627 | ||
|
|
58b465ae5f | ||
|
|
d116722c54 | ||
|
|
1d678854a4 | ||
|
|
28c4075b58 | ||
|
|
aa94def12d | ||
|
|
0fcc2e9a74 | ||
|
|
94a6225578 | ||
|
|
02798ba13d | ||
|
|
8e13c5c03b | ||
|
|
266cdc3025 | ||
|
|
fea2516636 | ||
|
|
c0ef22ab0b | ||
|
|
971ef18e30 | ||
|
|
ec991d74e1 | ||
|
|
c0efa83c0b | ||
|
|
e37054cf27 | ||
|
|
89ff1b5e71 | ||
|
|
f122444873 | ||
|
|
30465cb778 | ||
|
|
f9340b27b2 | ||
|
|
f249e803f0 | ||
|
|
dfb12d6845 | ||
|
|
d8ce703102 | ||
|
|
8782fe26cb | ||
|
|
7ba01e111c | ||
|
|
6ce4b4ff1b | ||
|
|
332019e19a | ||
|
|
9402b62353 | ||
|
|
985d7177e8 | ||
|
|
7dbadca2d0 | ||
|
|
3f21a394f4 | ||
|
|
827aca04eb | ||
|
|
ff2e3d397a | ||
|
|
aba47f5624 | ||
|
|
abcfd805b8 | ||
|
|
1f5542fe2d | ||
|
|
d065cb3853 | ||
|
|
c53b684889 | ||
|
|
5fad4d4f09 | ||
|
|
7956485cd6 | ||
|
|
bb4b189b9c | ||
|
|
d9cfa2bee2 | ||
|
|
0f9583b69b | ||
|
|
c98b5143b0 | ||
|
|
07e65a77aa | ||
|
|
ee616bdc62 | ||
|
|
630a021850 | ||
|
|
75ae829984 | ||
|
|
08cc1a3b18 | ||
|
|
edaa22ec15 | ||
|
|
cc8962bdde | ||
|
|
435575cb5e | ||
|
|
1fa19a7697 | ||
|
|
d1a07886ee | ||
|
|
71846502ae | ||
|
|
90b89dadb2 | ||
|
|
e4d49586b6 | ||
|
|
21e3a2b56c | ||
|
|
cb8d8bb9b6 | ||
|
|
e52ddf820b | ||
|
|
6574576cfb | ||
|
|
dde95ca432 | ||
|
|
6155db81aa | ||
|
|
11872a8372 | ||
|
|
49964a4fe0 | ||
|
|
68f91d58f1 | ||
|
|
42bcf1ce44 | ||
|
|
de7331a075 | ||
|
|
b0db817ff2 | ||
|
|
a565f73276 | ||
|
|
3cf3393bd4 | ||
|
|
e83be476a5 | ||
|
|
80a2826e69 | ||
|
|
eb0e86ac80 | ||
|
|
57597927ef | ||
|
|
de5fb744c9 | ||
|
|
14bfd2e9d9 | ||
|
|
36a17b50b5 | ||
|
|
8a9283494b | ||
|
|
dac72a91d9 | ||
|
|
a17c70f876 | ||
|
|
c56d0037d2 | ||
|
|
9fb61ca8d8 | ||
|
|
3f6e5dd6ac | ||
|
|
2dc8862bab | ||
|
|
5202b6ac1d | ||
|
|
02879b4e81 | ||
|
|
f24695eff9 | ||
|
|
05e25f2384 | ||
|
|
f1526426cd | ||
|
|
7601a471f5 | ||
|
|
6c7022f7d3 | ||
|
|
edd3280b69 | ||
|
|
fe65b14424 | ||
|
|
e39fcdda38 | ||
|
|
5ae8eb3202 | ||
|
|
bbed3fdef6 | ||
|
|
42fef01256 | ||
|
|
29248b4c13 | ||
|
|
361444e419 | ||
|
|
85bc7f5466 | ||
|
|
1282c12476 | ||
|
|
0fe5a72a26 | ||
|
|
4c9b8f1318 | ||
|
|
45eebca42d | ||
|
|
d49751602c | ||
|
|
6240346aa0 | ||
|
|
09add9c24f | ||
|
|
8b807f1177 | ||
|
|
42d101da8d | ||
|
|
f68a49ed49 | ||
|
|
684083f065 | ||
|
|
8ecac08f2d | ||
|
|
fd003416d5 | ||
|
|
ae2b48f5c0 | ||
|
|
9e4917b2a1 | ||
|
|
12bc1c9e47 | ||
|
|
808e523db4 | ||
|
|
4a3c55cf1a | ||
|
|
c017f88fde | ||
|
|
219458e22f | ||
|
|
fec5f3c0cc | ||
|
|
9a9130f26d | ||
|
|
312d0d654f | ||
|
|
848bcc288d | ||
|
|
ec6dc4375e | ||
|
|
c21e515e05 | ||
|
|
1dce289a00 | ||
|
|
66c209cf43 | ||
|
|
efbc95a7e4 | ||
|
|
c5dbd909d0 | ||
|
|
6112cb1802 | ||
|
|
246ff8c1d3 | ||
|
|
f50fa14529 | ||
|
|
2c056d696d | ||
|
|
06505b0c69 | ||
|
|
e96415a54b | ||
|
|
f038e56cdc | ||
|
|
f2e1d4090d | ||
|
|
be6fa942ac | ||
|
|
f29f8af3ed | ||
|
|
74ce3cfbf6 | ||
|
|
b805eca764 | ||
|
|
e6c25014bb | ||
|
|
97ad789d10 | ||
|
|
d2f9ae18be | ||
|
|
cc2235ace2 | ||
|
|
657ed6d3be |
+10
-1
@@ -1,7 +1,16 @@
|
|||||||
|
*.eps
|
||||||
|
*.log
|
||||||
|
*.o
|
||||||
|
*.pdf
|
||||||
|
*.png
|
||||||
|
*.stamp
|
||||||
|
*.trs
|
||||||
|
*~
|
||||||
|
.deps
|
||||||
|
.dirstamp
|
||||||
/*.cache
|
/*.cache
|
||||||
/*.flc
|
/*.flc
|
||||||
/*.prj
|
/*.prj
|
||||||
/*~
|
|
||||||
/.tarball-version
|
/.tarball-version
|
||||||
/.version
|
/.version
|
||||||
/ABOUT-NLS
|
/ABOUT-NLS
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
2.7
|
3.2
|
||||||
|
|||||||
+300
@@ -0,0 +1,300 @@
|
|||||||
|
# Travis defines and exports CC and CXX *after* we have defined our
|
||||||
|
# environment variables via 'env'. So, do not use 'env' to define
|
||||||
|
# them. Instead, put their definitions in MATRIX_EVAL, which we eval
|
||||||
|
# after the definitions from Travis.
|
||||||
|
|
||||||
|
language: cpp
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
# ICC serial number.
|
||||||
|
secure: ED3w6rzxuE6tVu3oyxha2MoGMRzRQCtinvr9uor1gw9TGKB80esTLx4KyX0xHemUdyQVarFDDQfVS5rf7jSDY8XiWIR6O+2Af9/30gb+8eyngyvACu7E28n+1XHmYWIEHsbvB9mic6C60FBj5sPcDnFWZeyttGL0WooSjYHiw1Egafwqbeu1mD3Aet9OI9VaLQvy0KcWAdVrYWSI9UWLvLM+xPVUjPFko4oS+dTlETzVnmn6JFbZX1OKONtfcvdoDRFBzs3iHm5dQUt/Fz+y/DtKSuvF3zvePHSgF6c8URbEPPjBdh87gkovSLyy+83fVeh4WMkF8b+dGZmikQv6kRsjKJdbQrS8tiMhZlORC5Gfmn4HXNgmapL+paUweakH7UZQHm6d5SZoBgCHNazfqMrywbZsZkGvZTDQIVG1Be7Lhh2BDFbPhPZNDvI9XYiqZP0QSb0BVfeO+AUSRcUPM7TvarxB74jYdfpTBu7sqJP6dSwhcDTEUhHmuLGjzsNm3uTZe8SUw/TGGx5uPTXNsCjJq6ClIOAIYXZTXLbBmIL/NBWCy0MUpD+9zsiknU7vzzq1RfgCCExhvYgosTjBLcX1kKI+eRSU5M44e+xCg4xx0m9WfafbKbhA20FfnWxCFIkZeVpkOOsexJ9zfe0SflVLxkd7vmci5SCBixLVbN0=
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
## ------- ##
|
||||||
|
## First. ##
|
||||||
|
## ------- ##
|
||||||
|
|
||||||
|
# Start with three completely different environments, to get
|
||||||
|
# errors asap.
|
||||||
|
|
||||||
|
- name: "GCC 7 -O3"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-7
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
||||||
|
|
||||||
|
- name: "Clang 7 libc++ and ASAN"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-trusty-7
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- clang-7
|
||||||
|
- libc++-7-dev
|
||||||
|
- libc++abi-7-dev
|
||||||
|
env:
|
||||||
|
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||||
|
- MATRIX_EVAL="CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
||||||
|
|
||||||
|
- name: "ICC"
|
||||||
|
os: linux
|
||||||
|
env:
|
||||||
|
# ICC's warnings are often very wrong (e.g., it thinks foo ?
|
||||||
|
# "bar" : "baz" is char* instead of const char*), so don't try
|
||||||
|
# to work around the, and obviously, don't die on them.
|
||||||
|
- MATRIX_EVAL="CC=icc && CXX=icpc"
|
||||||
|
- MAKE_ARGS='WERROR_CFLAGS= WERROR_CXXFLAGS='
|
||||||
|
|
||||||
|
|
||||||
|
## ----- ##
|
||||||
|
## GCC. ##
|
||||||
|
## ----- ##
|
||||||
|
|
||||||
|
#- name: "GCC 8 with sanitizers"
|
||||||
|
# os: linux
|
||||||
|
# addons:
|
||||||
|
# apt:
|
||||||
|
# sources:
|
||||||
|
# - ubuntu-toolchain-r-test
|
||||||
|
# packages:
|
||||||
|
# - g++-8
|
||||||
|
# env:
|
||||||
|
# # Can't use UBSAN: I get:
|
||||||
|
# # configure:4951: gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer conftest.c
|
||||||
|
# # /usr/bin/ld: unrecognized option '--push-state'
|
||||||
|
# - MATRIX_EVAL="CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer' CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'"
|
||||||
|
|
||||||
|
- name: "GCC 6"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-6
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
|
||||||
|
|
||||||
|
- name: "GCC 5"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-5
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
|
||||||
|
|
||||||
|
- name: "GCC 4.9"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.9
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
|
||||||
|
|
||||||
|
- name: "GCC 4.8"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.8
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8"
|
||||||
|
|
||||||
|
- name: "GCC 4.7"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.7
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=gcc-4.7 && CXX=g++-4.7"
|
||||||
|
|
||||||
|
- name: "GCC 4.6"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.6
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=gcc-4.6 && CXX=g++-4.6"
|
||||||
|
|
||||||
|
## ------- ##
|
||||||
|
## Clang. ##
|
||||||
|
## ------- ##
|
||||||
|
|
||||||
|
- name: "Clang 6 -O3 and libc++"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-trusty-6.0
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- clang-6.0
|
||||||
|
- libc++-dev
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=clang-6.0 && CXX='clang++-6.0 -stdlib=libc++'"
|
||||||
|
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||||
|
|
||||||
|
- name: "Clang 5"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-trusty-5.0
|
||||||
|
packages:
|
||||||
|
- clang-5.0
|
||||||
|
- libc++-dev
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC='clang-5.0' CXX='clang++-5.0'"
|
||||||
|
|
||||||
|
- name: "Clang 4"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-trusty-4.0
|
||||||
|
packages:
|
||||||
|
- clang-4.0
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
|
||||||
|
|
||||||
|
- name: "Clang 3.9"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-trusty-3.9
|
||||||
|
packages:
|
||||||
|
- clang-3.9
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
|
||||||
|
|
||||||
|
- name: "Clang 3.8"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-precise-3.8
|
||||||
|
packages:
|
||||||
|
- clang-3.8
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
|
||||||
|
|
||||||
|
- name: "CLang 3.7"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-precise-3.7
|
||||||
|
packages:
|
||||||
|
- clang-3.7
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7"
|
||||||
|
|
||||||
|
- name: "Clang 3.6"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-precise-3.6
|
||||||
|
packages:
|
||||||
|
- clang-3.6
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"
|
||||||
|
|
||||||
|
- name: "Clang 3.5"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-precise-3.5
|
||||||
|
packages:
|
||||||
|
- clang-3.5
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=clang-3.5 && CXX=clang++-3.5"
|
||||||
|
|
||||||
|
- name: "Clang 3.4"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.4
|
||||||
|
env:
|
||||||
|
# No versioned name installed, but beware that Travis installs
|
||||||
|
# a more modern clang earlier in the default PATH.
|
||||||
|
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++'
|
||||||
|
|
||||||
|
- name: "Clang 3.3"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.3
|
||||||
|
env:
|
||||||
|
# See comment for 3.4.
|
||||||
|
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++'
|
||||||
|
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- eval "$MATRIX_EVAL"
|
||||||
|
- env
|
||||||
|
- sudo apt-get update -qq
|
||||||
|
- sudo apt-get install -qq autoconf automake autopoint doxygen flex gettext graphviz help2man m4 texinfo
|
||||||
|
- if [[ $CC == "icc" ]]; then build-aux/install-icc.sh; fi
|
||||||
|
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
||||||
|
- autoconf --version
|
||||||
|
- automake --version
|
||||||
|
- autopoint --version
|
||||||
|
- $CC --version
|
||||||
|
- $CXX --version
|
||||||
|
- doxygen --version
|
||||||
|
- flex --version
|
||||||
|
- gettext --version
|
||||||
|
- dot -V
|
||||||
|
- help2man --version
|
||||||
|
- m4 --version
|
||||||
|
- makeinfo --version
|
||||||
|
|
||||||
|
script:
|
||||||
|
- git show
|
||||||
|
- git tag -l
|
||||||
|
# For some reasons, sometimes the checkout does not have any tags,
|
||||||
|
# so `git describe` fails, so bootstrap fails.
|
||||||
|
- git describe || git tag v3.0 -m "Fake version 3.0."
|
||||||
|
- git describe
|
||||||
|
- ./bootstrap
|
||||||
|
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
||||||
|
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
||||||
|
- make -j2 $MAKE_ARGS
|
||||||
|
- make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
||||||
|
- make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
||||||
|
- make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
||||||
|
|
||||||
|
after_script:
|
||||||
|
- if [[ $CC == "icc" ]]; then uninstall_intel_software; fi
|
||||||
@@ -24,7 +24,7 @@ and nasty bugs.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
Copyright (C) 1998-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+45
-45
@@ -3671,12 +3671,12 @@
|
|||||||
2009-02-25 Akim Demaille <[email protected]>
|
2009-02-25 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
Copyright years.
|
Copyright years.
|
||||||
* data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
|
* data/glr.c: Add 2007 and 2008 here, consistently with the comments.
|
||||||
|
|
||||||
2009-02-25 Akim Demaille <[email protected]>
|
2009-02-25 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
Style changes.
|
Style changes.
|
||||||
* etc/bench.pl.in (generate_grammar_list): Consitently use
|
* etc/bench.pl.in (generate_grammar_list): Consistently use
|
||||||
location_type, not yy::location.
|
location_type, not yy::location.
|
||||||
|
|
||||||
2009-02-25 Akim Demaille <[email protected]>
|
2009-02-25 Akim Demaille <[email protected]>
|
||||||
@@ -3702,7 +3702,7 @@
|
|||||||
Remove trailing blanks.
|
Remove trailing blanks.
|
||||||
The epilogue has its own ending \n, no need to add another.
|
The epilogue has its own ending \n, no need to add another.
|
||||||
|
|
||||||
* data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
|
* data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputting the
|
||||||
epilogue.
|
epilogue.
|
||||||
* data/glr.cc: dnl when extending the epilogue.
|
* data/glr.cc: dnl when extending the epilogue.
|
||||||
Remove stray "private:".
|
Remove stray "private:".
|
||||||
@@ -3764,7 +3764,7 @@
|
|||||||
2008-12-11 Akim Demaille <[email protected]>
|
2008-12-11 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
Pass the token type to yysyntax_error.
|
Pass the token type to yysyntax_error.
|
||||||
* data/yacc.c (yysyntax_error): Take the transated token instead
|
* data/yacc.c (yysyntax_error): Take the translated token instead
|
||||||
of the raw number.
|
of the raw number.
|
||||||
Adjust callers.
|
Adjust callers.
|
||||||
* TODO: Update.
|
* TODO: Update.
|
||||||
@@ -5019,7 +5019,7 @@
|
|||||||
|
|
||||||
Now instead of monolithic tables, we define one macro per cell. For
|
Now instead of monolithic tables, we define one macro per cell. For
|
||||||
instance "b4_symbol(0, tag)" is a macro name which contents is
|
instance "b4_symbol(0, tag)" is a macro name which contents is
|
||||||
self-decriptive. The macro "b4_symbol" provides easier access to
|
self-descriptive. The macro "b4_symbol" provides easier access to
|
||||||
these cells.
|
these cells.
|
||||||
|
|
||||||
* src/output.c (type_names_output): Remove.
|
* src/output.c (type_names_output): Remove.
|
||||||
@@ -5200,7 +5200,7 @@
|
|||||||
|
|
||||||
2008-11-09 Akim Demaille <[email protected]>
|
2008-11-09 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
Agregate yylval and yylloc.
|
Aggregate yylval and yylloc.
|
||||||
* data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
|
* data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
|
||||||
(parser::yyla): this.
|
(parser::yyla): this.
|
||||||
|
|
||||||
@@ -5815,7 +5815,7 @@
|
|||||||
of members. Document that token names are added as fields.
|
of members. Document that token names are added as fields.
|
||||||
Document constructors accurately. Remove error method.
|
Document constructors accurately. Remove error method.
|
||||||
(Java Scanner Interface): Move note on %pure-parser to Java Bison
|
(Java Scanner Interface): Move note on %pure-parser to Java Bison
|
||||||
Interface. Describe %code lexer and yylex accutately.
|
Interface. Describe %code lexer and yylex accurately.
|
||||||
Remove documentation that does not match the code.
|
Remove documentation that does not match the code.
|
||||||
(Java Action Features): New.
|
(Java Action Features): New.
|
||||||
(Java Differences): Add reference. Add item on semantic values.
|
(Java Differences): Add reference. Add item on semantic values.
|
||||||
@@ -6432,7 +6432,7 @@
|
|||||||
* djgpp/config.site: Copyright timestamp adjusted.
|
* djgpp/config.site: Copyright timestamp adjusted.
|
||||||
* djgpp/config_h.sed: Copyright timestamp adjusted.
|
* djgpp/config_h.sed: Copyright timestamp adjusted.
|
||||||
* djgpp/djunpack.bat: Copyright timestamp adjusted.
|
* djgpp/djunpack.bat: Copyright timestamp adjusted.
|
||||||
* djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
|
* djgpp/fnchange.lst: Add filenames that are not 8.3 clean to the
|
||||||
filename translation list.
|
filename translation list.
|
||||||
* djgpp/subpipe.c (init_subpipe): Check the environment variables
|
* djgpp/subpipe.c (init_subpipe): Check the environment variables
|
||||||
TMPDIR, TMP and TEMP, in that order, to determinate where the temp
|
TMPDIR, TMP and TEMP, in that order, to determinate where the temp
|
||||||
@@ -7588,7 +7588,7 @@
|
|||||||
2007-03-07 Juan Manuel Guerrero <[email protected]>
|
2007-03-07 Juan Manuel Guerrero <[email protected]>
|
||||||
|
|
||||||
DJGPP spefic issue. Inhibit the use of disallowed characters for
|
DJGPP spefic issue. Inhibit the use of disallowed characters for
|
||||||
file name genertion on Win98, WinXP, etc. These are |<>":?*\
|
file name generation on Win98, WinXP, etc. These are |<>":?*\
|
||||||
and concern testsuite case 46.
|
and concern testsuite case 46.
|
||||||
* Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
|
* Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
|
||||||
* djgpp/testsuite.sed: Inhibit the use of disallowed characters.
|
* djgpp/testsuite.sed: Inhibit the use of disallowed characters.
|
||||||
@@ -8796,7 +8796,7 @@
|
|||||||
2006-12-13 Paul Eggert <[email protected]>
|
2006-12-13 Paul Eggert <[email protected]>
|
||||||
|
|
||||||
* TODO: Add pointer to Sylvain Schmitz's work on static detection
|
* TODO: Add pointer to Sylvain Schmitz's work on static detection
|
||||||
of potential ambiguities in GLR grammers.
|
of potential ambiguities in GLR grammars.
|
||||||
|
|
||||||
2006-12-12 Joel E. Denny <[email protected]>
|
2006-12-12 Joel E. Denny <[email protected]>
|
||||||
|
|
||||||
@@ -9059,7 +9059,7 @@
|
|||||||
* src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
|
* src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
|
||||||
which is "{...}" in the parser.
|
which is "{...}" in the parser.
|
||||||
* tests/Makefile.am (maintainer-check-valgrind): Set
|
* tests/Makefile.am (maintainer-check-valgrind): Set
|
||||||
VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
|
VALGRIND_OPTS='--leak-check=full --show-reachable=yes' before invoking
|
||||||
Valgrind.
|
Valgrind.
|
||||||
* tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
|
* tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
|
||||||
complain.
|
complain.
|
||||||
@@ -12349,7 +12349,7 @@
|
|||||||
* data/lalr1.cc: here.
|
* data/lalr1.cc: here.
|
||||||
(location.hh): Include it after the user prologue, in case the
|
(location.hh): Include it after the user prologue, in case the
|
||||||
filename type is defined by the user.
|
filename type is defined by the user.
|
||||||
Forward declation location and position before the pre-prologue.
|
Forward declaration location and position before the pre-prologue.
|
||||||
(yyresult_): Rename as...
|
(yyresult_): Rename as...
|
||||||
(yyresult): this, it's a local variable, not an attribute.
|
(yyresult): this, it's a local variable, not an attribute.
|
||||||
* data/Makefile.am (dist_pkgdata_DATA): Adjust.
|
* data/Makefile.am (dist_pkgdata_DATA): Adjust.
|
||||||
@@ -12439,8 +12439,8 @@
|
|||||||
(Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
|
(Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
|
||||||
user must declare alloca.
|
user must declare alloca.
|
||||||
|
|
||||||
* HACKING (release): Forwarn the Translation Project about
|
* HACKING (release): Forewarn the Translation Project about
|
||||||
stable releses.
|
stable releases.
|
||||||
|
|
||||||
2005-09-20 Akim Demaille <[email protected]>
|
2005-09-20 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
@@ -13165,7 +13165,7 @@
|
|||||||
not GNU M4, and that it works with any POSIX-compatible Awk.
|
not GNU M4, and that it works with any POSIX-compatible Awk.
|
||||||
* examples/calc++/Makefile.am (run_extexi): Remove; not used.
|
* examples/calc++/Makefile.am (run_extexi): Remove; not used.
|
||||||
($(calc_extracted)): Renamed from $(calc_sources_extracted),
|
($(calc_extracted)): Renamed from $(calc_sources_extracted),
|
||||||
so that we also get calc++-parser.yy. Geneate it.
|
so that we also get calc++-parser.yy. Generate it.
|
||||||
Use $(AWK), not gawk, since any conforming Awk will do.
|
Use $(AWK), not gawk, since any conforming Awk will do.
|
||||||
Put comment before action, since older 'make' can't handle comment
|
Put comment before action, since older 'make' can't handle comment
|
||||||
in action.
|
in action.
|
||||||
@@ -13993,7 +13993,7 @@
|
|||||||
* src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
|
* src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
|
||||||
to allocate kernel_base, kernel_items, kernel_size, since
|
to allocate kernel_base, kernel_items, kernel_size, since
|
||||||
they needn't be initialized to 0.
|
they needn't be initialized to 0.
|
||||||
(allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
|
(allocate_storage): Likewise, for shiftset, redset, shift_symbol.
|
||||||
* src/closure.c (new_closure): Likewise, for itemset.
|
* src/closure.c (new_closure): Likewise, for itemset.
|
||||||
* src/derives.c (derives_compute): Likewise, for delts, derives, q.
|
* src/derives.c (derives_compute): Likewise, for delts, derives, q.
|
||||||
* src/lalr.c (set_goto_map): Likewise, for temp_map.
|
* src/lalr.c (set_goto_map): Likewise, for temp_map.
|
||||||
@@ -14181,7 +14181,7 @@
|
|||||||
2004-10-05 Akim Demaille <[email protected]>
|
2004-10-05 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
|
In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
|
||||||
whether the reducion was empty or not. This leaves room to
|
whether the reduction was empty or not. This leaves room to
|
||||||
improve the use of YYLLOC_DEFAULT in such a case.
|
improve the use of YYLLOC_DEFAULT in such a case.
|
||||||
lalr1.cc is still experimental, so changing this is acceptable.
|
lalr1.cc is still experimental, so changing this is acceptable.
|
||||||
And finally, there are probably not many users who changed the
|
And finally, there are probably not many users who changed the
|
||||||
@@ -16524,7 +16524,7 @@
|
|||||||
(struct state): Renamed from struct state_s.
|
(struct state): Renamed from struct state_s.
|
||||||
(state): Renamed from state_t.
|
(state): Renamed from state_t.
|
||||||
(transitions): Renamed from transitions_t. Unused (and
|
(transitions): Renamed from transitions_t. Unused (and
|
||||||
misspelled) transtion_s tag removed.
|
misspelled) transition_s tag removed.
|
||||||
(errs): Renamed from errs_t. Unused errs_s tag removed.
|
(errs): Renamed from errs_t. Unused errs_s tag removed.
|
||||||
(reductions): Renamed from reductions_t. Unused tag
|
(reductions): Renamed from reductions_t. Unused tag
|
||||||
reductions_s removed.
|
reductions_s removed.
|
||||||
@@ -16612,9 +16612,9 @@
|
|||||||
|
|
||||||
|
|
||||||
Fix misspelling in names.
|
Fix misspelling in names.
|
||||||
* src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
|
* src/vcg.h (enum_alignment_e): Renamed from enum_alignment_e.
|
||||||
* src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
|
* src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
|
||||||
G_NODE_ALIGNEMENT.
|
G_NODE_ALIGNMENT.
|
||||||
|
|
||||||
|
|
||||||
* lib/timevar.c (timevar_report): Renamed from time_report,
|
* lib/timevar.c (timevar_report): Renamed from time_report,
|
||||||
@@ -16866,7 +16866,7 @@
|
|||||||
* src/tables.c (conflict_row, pack_vector): Likewise.
|
* src/tables.c (conflict_row, pack_vector): Likewise.
|
||||||
* src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
|
* src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
|
||||||
get_layoutalgorithm_str, get_decision_str, get_orientation_str,
|
get_layoutalgorithm_str, get_decision_str, get_orientation_str,
|
||||||
get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
|
get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
|
||||||
get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
|
get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
|
||||||
|
|
||||||
* lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
|
* lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
|
||||||
@@ -17365,7 +17365,7 @@
|
|||||||
(scanner_last_string_free): Remove; not used.
|
(scanner_last_string_free): Remove; not used.
|
||||||
(percent_percent_count): Move decl to just before use.
|
(percent_percent_count): Move decl to just before use.
|
||||||
(SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
|
(SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
|
||||||
not the (never otherwised-used) CHARACTER.
|
not the (never otherwise-used) CHARACTER.
|
||||||
|
|
||||||
2002-11-07 Akim Demaille <[email protected]>
|
2002-11-07 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
@@ -18052,7 +18052,7 @@
|
|||||||
suite using a GLR parser driven by LALR tables. It fails with -O2
|
suite using a GLR parser driven by LALR tables. It fails with -O2
|
||||||
because `struct stat' gives two different answers on my machine:
|
because `struct stat' gives two different answers on my machine:
|
||||||
88 (definition of an auto var) and later 96 (memset on this var).
|
88 (definition of an auto var) and later 96 (memset on this var).
|
||||||
Hence the stack is badly corrumpted. The headers inclusion is to
|
Hence the stack is badly corrupted. The headers inclusion is to
|
||||||
blame: if I move the awk.h inclusion before GLR's system header
|
blame: if I move the awk.h inclusion before GLR's system header
|
||||||
inclusion, the two struct stat have the same size.
|
inclusion, the two struct stat have the same size.
|
||||||
|
|
||||||
@@ -18962,7 +18962,7 @@
|
|||||||
|
|
||||||
2002-07-16 Akim Demaille <[email protected]>
|
2002-07-16 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
* src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
|
* src/assoc.c, src/assoc.h (assoc_t, assoc_to_string): New.
|
||||||
Adjust all former `associativity' dependencies.
|
Adjust all former `associativity' dependencies.
|
||||||
* src/symtab.c (symbol_new): Default associativity is `undef', not
|
* src/symtab.c (symbol_new): Default associativity is `undef', not
|
||||||
`right'.
|
`right'.
|
||||||
@@ -20105,7 +20105,7 @@
|
|||||||
|
|
||||||
* data/bison.c++: Catch up with bison.simple:
|
* data/bison.c++: Catch up with bison.simple:
|
||||||
2002-05-24 Paul Hilfinger <[email protected]>
|
2002-05-24 Paul Hilfinger <[email protected]>
|
||||||
and Paul Eggert <[email protected]>: `error' handing.
|
and Paul Eggert <[email protected]>: `error' handling.
|
||||||
2002-05-26 Akim Demaille <[email protected]>: stos_, token_number_,
|
2002-05-26 Akim Demaille <[email protected]>: stos_, token_number_,
|
||||||
and popping traces.
|
and popping traces.
|
||||||
|
|
||||||
@@ -20455,7 +20455,7 @@
|
|||||||
single characters while replacing `[' and `]' with quadrigraphs, to
|
single characters while replacing `[' and `]' with quadrigraphs, to
|
||||||
avoid troubles with M4 quotes.
|
avoid troubles with M4 quotes.
|
||||||
(copy_comment): Output characters with copy_character.
|
(copy_comment): Output characters with copy_character.
|
||||||
(read_additionnal_code): Likewise.
|
(read_additional_code): Likewise.
|
||||||
(copy_string2): Likewise.
|
(copy_string2): Likewise.
|
||||||
(copy_definition): Likewise.
|
(copy_definition): Likewise.
|
||||||
|
|
||||||
@@ -20638,7 +20638,7 @@
|
|||||||
* data/bison.simple, data/bison.c++: Adjust.
|
* data/bison.simple, data/bison.c++: Adjust.
|
||||||
* tests/torture.at (Big triangle): Move the limit from 254 to
|
* tests/torture.at (Big triangle): Move the limit from 254 to
|
||||||
500.
|
500.
|
||||||
* tests/regression.at (Web2c Actions): Ajust.
|
* tests/regression.at (Web2c Actions): Adjust.
|
||||||
|
|
||||||
Trying with bigger grammars shows various phenomena: at 3000 (28Mb
|
Trying with bigger grammars shows various phenomena: at 3000 (28Mb
|
||||||
of grammar file) bison is killed by my system, at 2000 (12Mb) bison
|
of grammar file) bison is killed by my system, at 2000 (12Mb) bison
|
||||||
@@ -20949,7 +20949,7 @@
|
|||||||
|
|
||||||
2002-03-05 Robert Anisko <[email protected]>
|
2002-03-05 Robert Anisko <[email protected]>
|
||||||
|
|
||||||
* src/reader.c (read_additionnal_code): `c' should be an integer, not
|
* src/reader.c (read_additional_code): `c' should be an integer, not
|
||||||
a character.
|
a character.
|
||||||
Reported by Nicolas Tisserand and Nicolas Burrus.
|
Reported by Nicolas Tisserand and Nicolas Burrus.
|
||||||
|
|
||||||
@@ -21070,7 +21070,7 @@
|
|||||||
|
|
||||||
* src/L0.c, src/LR0.h (nstates): Be size_t.
|
* src/L0.c, src/LR0.h (nstates): Be size_t.
|
||||||
Adjust comparisons (signed vs unsigned).
|
Adjust comparisons (signed vs unsigned).
|
||||||
* src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
|
* src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
|
||||||
bitset*.
|
bitset*.
|
||||||
Adjust all dependencies.
|
Adjust all dependencies.
|
||||||
|
|
||||||
@@ -22337,7 +22337,7 @@
|
|||||||
|
|
||||||
* src/bison.simple: Remove #line just before %%epilogue. It
|
* src/bison.simple: Remove #line just before %%epilogue. It
|
||||||
is now handled in ...
|
is now handled in ...
|
||||||
* src/reader.c (read_additionnal_code): Add the output of a
|
* src/reader.c (read_additional_code): Add the output of a
|
||||||
#line for the epilogue.
|
#line for the epilogue.
|
||||||
|
|
||||||
2001-12-10 Marc Autret <[email protected]>
|
2001-12-10 Marc Autret <[email protected]>
|
||||||
@@ -22797,7 +22797,7 @@
|
|||||||
on user names when possible.
|
on user names when possible.
|
||||||
|
|
||||||
(YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
|
(YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
|
||||||
Simplify test for whather <alloca.h> exists.
|
Simplify test for whether <alloca.h> exists.
|
||||||
|
|
||||||
(<stdlib.h>): Include if we will use malloc, and if standard C or C++.
|
(<stdlib.h>): Include if we will use malloc, and if standard C or C++.
|
||||||
|
|
||||||
@@ -23563,7 +23563,7 @@
|
|||||||
|
|
||||||
2001-10-04 Akim Demaille <[email protected]>
|
2001-10-04 Akim Demaille <[email protected]>
|
||||||
|
|
||||||
* src/reader.c (parse_union_decl): Push the caracters in
|
* src/reader.c (parse_union_decl): Push the characters in
|
||||||
union_obstack, not attrs_obstack.
|
union_obstack, not attrs_obstack.
|
||||||
|
|
||||||
2001-10-04 Akim Demaille <[email protected]>
|
2001-10-04 Akim Demaille <[email protected]>
|
||||||
@@ -23844,7 +23844,7 @@
|
|||||||
|
|
||||||
* src/vcg.h (graph_s): color, textcolor, bordercolor are now
|
* src/vcg.h (graph_s): color, textcolor, bordercolor are now
|
||||||
enum color_e.
|
enum color_e.
|
||||||
* src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
|
* src/print_graph.c (print_graph): Initialize graph.layoutalgorithm
|
||||||
to `normal'.
|
to `normal'.
|
||||||
* src/reader.c (parse_token_decl): Initialize token with tok_eof.
|
* src/reader.c (parse_token_decl): Initialize token with tok_eof.
|
||||||
* src/lex.h: Adjust prototype.
|
* src/lex.h: Adjust prototype.
|
||||||
@@ -23999,7 +23999,7 @@
|
|||||||
|
|
||||||
* src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
|
* src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
|
||||||
(get_xxxx_str): Use assert () instead of complain ().
|
(get_xxxx_str): Use assert () instead of complain ().
|
||||||
Remove return invokations in default cases.
|
Remove return invocations in default cases.
|
||||||
(get_decision_str): Modify default behaviour. Remove second argument.
|
(get_decision_str): Modify default behaviour. Remove second argument.
|
||||||
Echo modifications on calls.
|
Echo modifications on calls.
|
||||||
(output_graph): Fix.
|
(output_graph): Fix.
|
||||||
@@ -24030,7 +24030,7 @@
|
|||||||
informations about %union.
|
informations about %union.
|
||||||
(parse_union_decl): Copy the union_obstack in the muscle stype.
|
(parse_union_decl): Copy the union_obstack in the muscle stype.
|
||||||
* src/bison.simple: Add new #line directive.
|
* src/bison.simple: Add new #line directive.
|
||||||
Add typdef %%stype YYSTYPE.
|
Add typedef %%stype YYSTYPE.
|
||||||
|
|
||||||
2001-09-23 Pascal Bart <[email protected]>
|
2001-09-23 Pascal Bart <[email protected]>
|
||||||
|
|
||||||
@@ -24115,7 +24115,7 @@
|
|||||||
(parse_union_decl): Update.
|
(parse_union_decl): Update.
|
||||||
(parse_macro_decl): Rename parse_muscle_decl.
|
(parse_macro_decl): Rename parse_muscle_decl.
|
||||||
Update to use renamed functions and variable.
|
Update to use renamed functions and variable.
|
||||||
(read_declarations, copy_action, read_additionnal_code, : Updated
|
(read_declarations, copy_action, read_additional_code, : Updated
|
||||||
with correct variables and functions names.
|
with correct variables and functions names.
|
||||||
(packsymbols, reader): Likewise.
|
(packsymbols, reader): Likewise.
|
||||||
|
|
||||||
@@ -24196,7 +24196,7 @@
|
|||||||
|
|
||||||
2001-08-31 Pascal Bart <[email protected]>, Marc Autret <[email protected]>
|
2001-08-31 Pascal Bart <[email protected]>, Marc Autret <[email protected]>
|
||||||
|
|
||||||
* src/reader.c (read_additionnal_code): Rename %%user_code to
|
* src/reader.c (read_additional_code): Rename %%user_code to
|
||||||
%%epilogue.
|
%%epilogue.
|
||||||
* src/output.c (output): Rename %%declarations to %%prologue.
|
* src/output.c (output): Rename %%declarations to %%prologue.
|
||||||
* src/bison.simple: Echo modifications.
|
* src/bison.simple: Echo modifications.
|
||||||
@@ -24240,7 +24240,7 @@
|
|||||||
2001-08-29 Marc Autret <[email protected]>
|
2001-08-29 Marc Autret <[email protected]>
|
||||||
|
|
||||||
* src/bison.simple: Add %%user_code directive at the end.
|
* src/bison.simple: Add %%user_code directive at the end.
|
||||||
* src/reader.c (read_additionnal_code): New.
|
* src/reader.c (read_additional_code): New.
|
||||||
(reader): Use it.
|
(reader): Use it.
|
||||||
* src/output.c (output_program): Remove.
|
* src/output.c (output_program): Remove.
|
||||||
(output): Update.
|
(output): Update.
|
||||||
@@ -24303,7 +24303,7 @@
|
|||||||
(readgram): Disable a piece of code that was writing a default
|
(readgram): Disable a piece of code that was writing a default
|
||||||
definition for 'YYSTYPE'.
|
definition for 'YYSTYPE'.
|
||||||
(reader_output_yylsp): Remove.
|
(reader_output_yylsp): Remove.
|
||||||
(packsymbols): Output token defintions to a macro.
|
(packsymbols): Output token definitions to a macro.
|
||||||
(copy_definition): Disable C output.
|
(copy_definition): Disable C output.
|
||||||
|
|
||||||
* src/reader.c (parse_macro_decl): New function used to parse macro
|
* src/reader.c (parse_macro_decl): New function used to parse macro
|
||||||
@@ -24641,7 +24641,7 @@
|
|||||||
|
|
||||||
2001-07-08 Pascal Bart <[email protected]>
|
2001-07-08 Pascal Bart <[email protected]>
|
||||||
|
|
||||||
* src/bison.simple (yyparse): Suppress warning `comparaison
|
* src/bison.simple (yyparse): Suppress warning `comparison
|
||||||
between signed and unsigned'.
|
between signed and unsigned'.
|
||||||
|
|
||||||
2001-07-05 Pascal Bart <[email protected]>
|
2001-07-05 Pascal Bart <[email protected]>
|
||||||
@@ -25128,7 +25128,7 @@
|
|||||||
* tests/calc.m4: Test it.
|
* tests/calc.m4: Test it.
|
||||||
|
|
||||||
For regularity of the names, replace each
|
For regularity of the names, replace each
|
||||||
(nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
|
(nolineflag, toknumflag, rawtoknumflag, noparserflag): with...
|
||||||
(no_lineflag, token_tableflag, rawflag, no_parserflag): this.
|
(no_lineflag, token_tableflag, rawflag, no_parserflag): this.
|
||||||
In addition replace each `flag' with `_flag'.
|
In addition replace each `flag' with `_flag'.
|
||||||
|
|
||||||
@@ -25731,7 +25731,7 @@
|
|||||||
|
|
||||||
* src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
|
* src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
|
||||||
Have configure build version string instead of relying on ANSI string
|
Have configure build version string instead of relying on ANSI string
|
||||||
concatentation.
|
concatenation.
|
||||||
|
|
||||||
1999-06-14 Jesse Thilo <[email protected]>
|
1999-06-14 Jesse Thilo <[email protected]>
|
||||||
|
|
||||||
@@ -25741,7 +25741,7 @@
|
|||||||
|
|
||||||
* acconfig.h, configure.in:
|
* acconfig.h, configure.in:
|
||||||
Have configure build version string instead of relying on ANSI string
|
Have configure build version string instead of relying on ANSI string
|
||||||
concatentation.
|
concatenation.
|
||||||
|
|
||||||
1999-06-08 Jesse Thilo <[email protected]>
|
1999-06-08 Jesse Thilo <[email protected]>
|
||||||
|
|
||||||
@@ -26733,8 +26733,8 @@
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 1987-1988, 1991-2013 Free Software Foundation,
|
Copyright (C) 1987-1988, 1991-2015, 2018 Free Software
|
||||||
Inc.
|
Foundation, Inc.
|
||||||
|
|
||||||
Copying and distribution of this file, with or without
|
Copying and distribution of this file, with or without
|
||||||
modification, are permitted provided the copyright notice and this
|
modification, are permitted provided the copyright notice and this
|
||||||
|
|||||||
+16
-9
@@ -1,6 +1,6 @@
|
|||||||
## Process this file with automake to produce Makefile.in.
|
## Process this file with automake to produce Makefile.in.
|
||||||
|
|
||||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2015, 2018 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
|
||||||
@@ -24,22 +24,26 @@ SUBDIRS = po runtime-po .
|
|||||||
aclocaldir = @aclocaldir@
|
aclocaldir = @aclocaldir@
|
||||||
aclocal_DATA = m4/bison-i18n.m4
|
aclocal_DATA = m4/bison-i18n.m4
|
||||||
|
|
||||||
EXTRA_DIST = .prev-version .version \
|
EXTRA_DIST = .prev-version .version cfg.mk PACKAGING \
|
||||||
cfg.mk ChangeLog-1998 ChangeLog-2012 PACKAGING
|
ChangeLog-1998 ChangeLog-2012 ChangeLog
|
||||||
|
|
||||||
|
dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO
|
||||||
|
|
||||||
## Running the bison from this tarball. To generate our own parser,
|
## Running the bison from this tarball. To generate our own parser,
|
||||||
## but also to run the tests. Of course, you ought to keep a sane
|
## but also to run the tests. Of course, you ought to keep a sane
|
||||||
## version of Bison nearby...
|
## version of Bison nearby...
|
||||||
BISON = $(top_builddir)/tests/bison
|
BISON = $(top_builddir)/tests/bison
|
||||||
BISON_IN = $(top_srcdir)/tests/bison.in
|
BISON_IN = $(top_srcdir)/tests/bison.in
|
||||||
YACC = $(BISON) -y
|
YACC = $(BISON) -o y.tab.c
|
||||||
AM_YFLAGS = -d -v --warnings=all,error --report=all
|
AM_YFLAGS = -d -v -Werror -Wall -Wno-yacc --report=all
|
||||||
|
|
||||||
# Initialization before completion by local.mk's.
|
# Initialization before completion by local.mk's.
|
||||||
AM_CFLAGS = $(WARN_CFLAGS)
|
AM_CFLAGS = $(WARN_CFLAGS)
|
||||||
# Find builddir/src/scan-code.c etc.
|
# Find builddir/src/scan-code.c etc. For some reason "-I./lib"
|
||||||
AM_CPPFLAGS = -I. -Ilib -I$(top_srcdir) -I$(top_srcdir)/lib
|
# instead of "-Ilib" avoids infinite recursions on #include_next.
|
||||||
|
AM_CPPFLAGS = -I. -I./lib -I$(top_srcdir) -I$(top_srcdir)/lib
|
||||||
BUILT_SOURCES =
|
BUILT_SOURCES =
|
||||||
|
CLEANDIRS =
|
||||||
CLEANFILES =
|
CLEANFILES =
|
||||||
DISTCLEANFILES =
|
DISTCLEANFILES =
|
||||||
EXTRA_DIST += $(dist_TESTS)
|
EXTRA_DIST += $(dist_TESTS)
|
||||||
@@ -61,6 +65,9 @@ include lib/local.mk
|
|||||||
include src/local.mk
|
include src/local.mk
|
||||||
include tests/local.mk
|
include tests/local.mk
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
rm -rf $(CLEANDIRS)
|
||||||
|
|
||||||
# See comments in build-aux/git-version-gen. However, we make .version depend
|
# See comments in build-aux/git-version-gen. However, we make .version depend
|
||||||
# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the
|
# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the
|
||||||
# working copy (for example, when you run autoreconf && make). Allowing these
|
# working copy (for example, when you run autoreconf && make). Allowing these
|
||||||
@@ -78,11 +85,11 @@ dist-hook: gen-ChangeLog
|
|||||||
|
|
||||||
.PHONY: update-b4-copyright update-package-copyright-year
|
.PHONY: update-b4-copyright update-package-copyright-year
|
||||||
update-b4-copyright:
|
update-b4-copyright:
|
||||||
find $(srcdir)/data -type f \
|
$(AM_V_GEN)find $(srcdir)/data -type f \
|
||||||
| xargs $(srcdir)/build-aux/$@
|
| xargs $(srcdir)/build-aux/$@
|
||||||
@echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
|
@echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
|
||||||
update-package-copyright-year:
|
update-package-copyright-year:
|
||||||
$(srcdir)/build-aux/$@ $(srcdir)/configure.ac
|
$(AM_V_GEN)$(srcdir)/build-aux/$@ $(srcdir)/configure.ac
|
||||||
|
|
||||||
gen_start_date = 2012-01-16
|
gen_start_date = 2012-01-16
|
||||||
.PHONY: gen-ChangeLog
|
.PHONY: gen-ChangeLog
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ to the bison package.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2005, 2009-2013 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2005, 2009-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ instructions.
|
|||||||
|
|
||||||
Bison requires GNU m4 1.4.6 or later. See:
|
Bison requires GNU m4 1.4.6 or later. See:
|
||||||
|
|
||||||
ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
|
https://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
|
||||||
|
|
||||||
** Internationalization
|
** Internationalization
|
||||||
Bison supports two catalogues: one for Bison itself (i.e., for the
|
Bison supports two catalogs: one for Bison itself (i.e., for the
|
||||||
maintainer-side parser generation), and one for the generated parsers
|
maintainer-side parser generation), and one for the generated parsers
|
||||||
(i.e., for the user-side parser execution). The requirements between
|
(i.e., for the user-side parser execution). The requirements between
|
||||||
both differ: bison needs ngettext, the generated parsers do not. To
|
both differ: bison needs ngettext, the generated parsers do not. To
|
||||||
@@ -29,25 +29,26 @@ If you have questions about using Bison and the documentation does
|
|||||||
not answer them, please send mail to <[email protected]>.
|
not answer them, please send mail to <[email protected]>.
|
||||||
|
|
||||||
* Bug reports
|
* Bug reports
|
||||||
Please send bug reports to <[email protected]>. Please include the
|
Please send bug reports to <[email protected]>. Be sure to include the
|
||||||
version number from `bison --version', and a complete, self-contained
|
version number from 'bison --version', and a complete, self-contained test
|
||||||
test case in each bug report.
|
case in each bug report.
|
||||||
|
|
||||||
* Copyright statements
|
* Copyright statements
|
||||||
For any copyright year range specified as YYYY-ZZZZ in this package,
|
For any copyright year range specified as YYYY-ZZZZ in this package,
|
||||||
note that the range specifies every single year in that closed interval.
|
note that the range specifies every single year in that closed interval.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
Local Variables:
|
Local Variables:
|
||||||
mode: outline
|
mode: outline
|
||||||
|
fill-column: 76
|
||||||
|
ispell-dictionary: "american"
|
||||||
End:
|
End:
|
||||||
|
|
||||||
-----
|
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018 Free Software
|
||||||
|
|
||||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2013 Free Software
|
|
||||||
Foundation, Inc.
|
Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of GNU bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
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
|
||||||
@@ -61,3 +62,6 @@ 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, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# LocalWords: parsers ngettext Texinfo pdf html YYYY ZZZZ ispell american
|
||||||
|
# LocalWords: MERCHANTABILITY
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ the problems you encounter.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2009-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
+113
-105
@@ -9,19 +9,19 @@ Everything related to the development of Bison is on Savannah:
|
|||||||
* Administrivia
|
* Administrivia
|
||||||
|
|
||||||
** If you incorporate a change from somebody on the net:
|
** If you incorporate a change from somebody on the net:
|
||||||
First, if it is a large change, you must make sure they have signed
|
First, if it is a large change, you must make sure they have signed the
|
||||||
the appropriate paperwork. Second, be sure to add their name and
|
appropriate paperwork. Second, be sure to add their name and email address
|
||||||
email address to THANKS.
|
to THANKS.
|
||||||
|
|
||||||
** If a change fixes a test, mention the test in the commit message.
|
** If a change fixes a test, mention the test in the commit message.
|
||||||
|
|
||||||
** Bug reports
|
** Bug reports
|
||||||
If somebody reports a new bug, mention his name in the commit message
|
If somebody reports a new bug, mention his name in the commit message and in
|
||||||
and in the test case you write. Put him into THANKS.
|
the test case you write. Put him into THANKS.
|
||||||
|
|
||||||
The correct response to most actual bugs is to write a new test case
|
The correct response to most actual bugs is to write a new test case which
|
||||||
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
demonstrates the bug. Then fix the bug, re-run the test suite, and check
|
||||||
and check everything in.
|
everything in.
|
||||||
|
|
||||||
|
|
||||||
* Hacking
|
* Hacking
|
||||||
@@ -30,17 +30,17 @@ and check everything in.
|
|||||||
Which include serious bug fixes, must be mentioned in NEWS.
|
Which include serious bug fixes, must be mentioned in NEWS.
|
||||||
|
|
||||||
** Translations
|
** Translations
|
||||||
Only user visible strings are to be translated: error messages, bits
|
Only user visible strings are to be translated: error messages, bits of the
|
||||||
of the .output file etc. This excludes impossible error messages
|
.output file etc. This excludes impossible error messages (comparable to
|
||||||
(comparable to assert/abort), and all the --trace output which is
|
assert/abort), and all the --trace output which is meant for the maintainers
|
||||||
meant for the maintainers only.
|
only.
|
||||||
|
|
||||||
** Horizontal tabs
|
** Horizontal tabs
|
||||||
Do not add horizontal tab characters to any file in Bison's repository
|
Do not add horizontal tab characters to any file in Bison's repository
|
||||||
except where required. For example, do not use tabs to format C code.
|
except where required. For example, do not use tabs to format C code.
|
||||||
However, make files, ChangeLog, and some regular expressions require
|
However, make files, ChangeLog, and some regular expressions require tabs.
|
||||||
tabs. Also, test cases might need to contain tabs to check that Bison
|
Also, test cases might need to contain tabs to check that Bison properly
|
||||||
properly processes tabs in its input.
|
processes tabs in its input.
|
||||||
|
|
||||||
|
|
||||||
* Working from the repository
|
* Working from the repository
|
||||||
@@ -62,13 +62,22 @@ tools we depend upon, including:
|
|||||||
- Gettext <http://www.gnu.org/software/gettext/>
|
- Gettext <http://www.gnu.org/software/gettext/>
|
||||||
- Graphviz <http://www.graphviz.org>
|
- Graphviz <http://www.graphviz.org>
|
||||||
- Gzip <http://www.gnu.org/software/gzip/>
|
- Gzip <http://www.gnu.org/software/gzip/>
|
||||||
|
- Help2man <http://www.gnu.org/software/help2man/>
|
||||||
- Perl <http://www.cpan.org/>
|
- Perl <http://www.cpan.org/>
|
||||||
- Rsync <http://samba.anu.edu.au/rsync/>
|
- Rsync <http://samba.anu.edu.au/rsync/>
|
||||||
- Tar <http://www.gnu.org/software/tar/>
|
- Tar <http://www.gnu.org/software/tar/>
|
||||||
|
- Texinfo <http://www.gnu.org/software/texinfo/>
|
||||||
|
|
||||||
Valgrind <http://valgrind.org/> is also highly recommended, if it supports
|
Valgrind <http://valgrind.org/> is also highly recommended, if it supports
|
||||||
your architecture.
|
your architecture.
|
||||||
|
|
||||||
|
If you're using a GNU/Linux distribution, the easiest way to install the
|
||||||
|
above packages depends on your system. The following shell command should
|
||||||
|
work for Debian-based systems such as Ubuntu:
|
||||||
|
|
||||||
|
sudo apt-get install \
|
||||||
|
autoconf automake autopoint flex graphviz help2man texinfo valgrind
|
||||||
|
|
||||||
Bison is written using Bison grammars, so there are bootstrapping issues.
|
Bison is written using Bison grammars, so there are bootstrapping issues.
|
||||||
The bootstrap script attempts to discover when the C code generated from the
|
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
|
grammars is out of date, and to bootstrap with an out-of-date version of the
|
||||||
@@ -94,15 +103,19 @@ to perform the first checkout of the submodules, run
|
|||||||
|
|
||||||
$ git submodule update --init
|
$ git submodule update --init
|
||||||
|
|
||||||
Git submodule support is weak before versions 1.6 and later, you
|
|
||||||
should probably upgrade Git if your version is older.
|
|
||||||
|
|
||||||
The next step is to get other files needed to build, which are
|
The next step is to get other files needed to build, which are
|
||||||
extracted from other source packages:
|
extracted from other source packages:
|
||||||
|
|
||||||
$ ./bootstrap
|
$ ./bootstrap
|
||||||
|
|
||||||
And there you are! Just
|
Bootstrapping updates the submodules to the versions registered in the
|
||||||
|
top-level directory. To change gnulib, first check out the version you want
|
||||||
|
in `gnulib`, then commit this change in Bison's repository, and finally run
|
||||||
|
bootstrap.
|
||||||
|
|
||||||
|
If it fails with missing symbols (e.g., "error: possibly undefined macro:
|
||||||
|
AC_PROG_GNU_M4"), you are likely to have forgotten the submodule
|
||||||
|
initialization part. Otherwise, there you are! Just
|
||||||
|
|
||||||
$ ./configure
|
$ ./configure
|
||||||
$ make
|
$ make
|
||||||
@@ -126,13 +139,12 @@ explicitly by the user.
|
|||||||
*** Updating Bison
|
*** Updating Bison
|
||||||
|
|
||||||
If you pull a newer version of a branch, say via "git pull", you might
|
If you pull a newer version of a branch, say via "git pull", you might
|
||||||
import requests for updated submodules. A simple "git diff" will
|
import requests for updated submodules. A simple "git diff" will reveal if
|
||||||
reveal if the current version of the submodule (i.e., the actual
|
the current version of the submodule (i.e., the actual contents of the
|
||||||
contents of the gnulib directory) and the current request from the
|
gnulib directory) and the current request from the subscriber (i.e., the
|
||||||
subscriber (i.e., the reference of the version of gnulib that the
|
reference of the version of gnulib that the Bison repository requests)
|
||||||
Bison repository requests) differ. To upgrade the submodules (i.e.,
|
differ. To upgrade the submodules (i.e., to check out the version that is
|
||||||
to check out the version that is actually requested by the subscriber,
|
actually requested by the subscriber, run "git submodule update".
|
||||||
run "git submodule update".
|
|
||||||
|
|
||||||
$ git pull
|
$ git pull
|
||||||
$ git submodule update
|
$ git submodule update
|
||||||
@@ -156,8 +168,8 @@ Register your changes.
|
|||||||
|
|
||||||
$ git checkin ...
|
$ git checkin ...
|
||||||
|
|
||||||
For a suggestion of what gnulib commit might be stable enough for a
|
For a suggestion of what gnulib commit might be stable enough for a formal
|
||||||
formal release, see the ChangeLog in the latest gnulib snapshot at:
|
release, see the ChangeLog in the latest gnulib snapshot at:
|
||||||
|
|
||||||
http://erislabs.net/ianb/projects/gnulib/
|
http://erislabs.net/ianb/projects/gnulib/
|
||||||
|
|
||||||
@@ -167,9 +179,9 @@ The Autoconf files we use are currently:
|
|||||||
lib/m4sugar/m4sugar.m4
|
lib/m4sugar/m4sugar.m4
|
||||||
lib/m4sugar/foreach.m4
|
lib/m4sugar/foreach.m4
|
||||||
|
|
||||||
These files don't change very often in Autoconf, so it should be
|
These files don't change very often in Autoconf, so it should be relatively
|
||||||
relatively straight-forward to examine the differences in order to
|
straight-forward to examine the differences in order to decide whether to
|
||||||
decide whether to update.
|
update.
|
||||||
|
|
||||||
* Test suite
|
* Test suite
|
||||||
|
|
||||||
@@ -178,12 +190,15 @@ Use liberally.
|
|||||||
|
|
||||||
** TESTSUITEFLAGS
|
** TESTSUITEFLAGS
|
||||||
|
|
||||||
The default is for make check to run all tests sequentially. This can be
|
To run just the testsuite (not the tests related to the examples), run `make
|
||||||
very time consumming when checking repeatedly or on slower setups. This can
|
check-local`.
|
||||||
be sped up in two ways:
|
|
||||||
|
The default is for make check-local to run all tests sequentially. This can
|
||||||
|
be very time consuming when checking repeatedly or on slower setups. This
|
||||||
|
can be sped up in two ways:
|
||||||
|
|
||||||
Using -j, in a make-like fashion, for example:
|
Using -j, in a make-like fashion, for example:
|
||||||
$ make check TESTSUITEFLAGS='-j8'
|
$ make check-local TESTSUITEFLAGS='-j8'
|
||||||
|
|
||||||
Running only the tests of a certain category, as specified in the AT files
|
Running only the tests of a certain category, as specified in the AT files
|
||||||
with AT_KEYWORDS([[category]]). Categories include:
|
with AT_KEYWORDS([[category]]). Categories include:
|
||||||
@@ -194,7 +209,7 @@ with AT_KEYWORDS([[category]]). Categories include:
|
|||||||
- report, for automaton dumps
|
- report, for automaton dumps
|
||||||
|
|
||||||
To run a specific set of tests, use -k (for "keyword"). For example:
|
To run a specific set of tests, use -k (for "keyword"). For example:
|
||||||
$ make check TESTSUITEFLAGS='-k c++'
|
$ make check-local TESTSUITEFLAGS='-k c++'
|
||||||
|
|
||||||
Both can be combined.
|
Both can be combined.
|
||||||
|
|
||||||
@@ -232,102 +247,96 @@ suite. So currently, do not try to run valgrind on Mac OS X.
|
|||||||
Try to run the test suite with more severe conditions before a
|
Try to run the test suite with more severe conditions before a
|
||||||
release:
|
release:
|
||||||
|
|
||||||
- Configure the package with --enable-gcc-warnings, so that one checks
|
- Configure the package with --enable-gcc-warnings, so that one checks that
|
||||||
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
1. Bison compiles cleanly, 2. the parsers it produces compile cleanly too.
|
||||||
cleanly too.
|
|
||||||
|
|
||||||
- Maybe build with -DGNULIB_POSIXCHECK, which suggests gnulib modules
|
- Maybe build with -DGNULIB_POSIXCHECK, which suggests gnulib modules that
|
||||||
that can fix portability issues. See if you really want to pay
|
can fix portability issues. See if you really want to pay attention to
|
||||||
attention to its warnings; there's no need to obey blindly to it
|
its warnings; there's no need to obey blindly to it
|
||||||
(<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00057.html>).
|
(<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00057.html>).
|
||||||
|
|
||||||
- Check with "make syntax-check" if there are issues diagnosed by
|
- Check with "make syntax-check" if there are issues diagnosed by gnulib.
|
||||||
gnulib.
|
|
||||||
|
|
||||||
- run "make maintainer-check" which:
|
- run "make maintainer-check" which:
|
||||||
- runs "valgrind -q bison" to run Bison under Valgrind.
|
- runs "valgrind -q bison" to run Bison under Valgrind.
|
||||||
- runs the parsers under Valgrind.
|
- runs the parsers under Valgrind.
|
||||||
- runs the test suite with G++ as C compiler...
|
- runs the test suite with G++ as C compiler...
|
||||||
|
|
||||||
- run "make maintainer-push-check", which runs "make maintainer-check"
|
- run "make maintainer-check-push", which runs "make maintainer-check" while
|
||||||
while activating the push implementation and its pull interface wrappers
|
activating the push implementation and its pull interface wrappers in many
|
||||||
in many test cases that were originally written to exercise only the
|
test cases that were originally written to exercise only the pull
|
||||||
pull implementation. This makes certain the push implementation can
|
implementation. This makes certain the push implementation can perform
|
||||||
perform every task the pull implementation can.
|
every task the pull implementation can.
|
||||||
|
|
||||||
- run "make maintainer-xml-check", which runs "make maintainer-check"
|
- run "make maintainer-check-xml", which runs "make maintainer-check" while
|
||||||
while checking Bison's XML automaton report for every working grammar
|
checking Bison's XML automaton report for every working grammar passed to
|
||||||
passed to Bison in the test suite. The check just diffs the output of
|
Bison in the test suite. The check just diffs the output of Bison's
|
||||||
Bison's included XSLT style sheets with the output of --report=all and
|
included XSLT style sheets with the output of --report=all and --graph.
|
||||||
--graph.
|
|
||||||
|
|
||||||
- running "make maintainer-release-check" takes care of running
|
- running "make maintainer-check-release" takes care of running
|
||||||
maintainer-check, maintainer-push-check and maintainer-xml-check.
|
maintainer-check, maintainer-check-push and maintainer-check-xml.
|
||||||
|
|
||||||
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
- Change tests/atlocal/CFLAGS to add your preferred options.
|
||||||
instance, "-traditional" to check that the parsers are K&R. Note
|
|
||||||
that it does not make sense for glr.c, which should be ANSI, but
|
|
||||||
currently is actually GNU C, nor for lalr1.cc.
|
|
||||||
|
|
||||||
- Test with a very recent version of GCC for both C and C++. Testing
|
- Test with a very recent version of GCC for both C and C++. Testing with
|
||||||
with older versions that are still in use is nice too.
|
older versions that are still in use is nice too.
|
||||||
|
|
||||||
|
|
||||||
* Release Procedure
|
* Release Procedure
|
||||||
This section needs to be updated to take into account features from
|
This section needs to be updated to take into account features from gnulib.
|
||||||
gnulib. In particular, be sure to read README-release.
|
In particular, be sure to read README-release.
|
||||||
|
|
||||||
** Update the submodules. See above.
|
** Update the submodules. See above.
|
||||||
|
|
||||||
** Update maintainer tools, such as Autoconf. See above.
|
** Update maintainer tools, such as Autoconf. See above.
|
||||||
|
|
||||||
** Try to get the *.pot files to the Translation Project at least one
|
** 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.
|
week before a stable release, to give them time to translate them. Before
|
||||||
Before generating the *.pot files, make sure that po/POTFILES.in and
|
generating the *.pot files, make sure that po/POTFILES.in and
|
||||||
runtime-po/POTFILES.in list all files with translatable strings.
|
runtime-po/POTFILES.in list all files with translatable strings. This
|
||||||
This helps: grep -l '\<_(' *
|
helps: grep -l '\<_(' *.
|
||||||
|
|
||||||
** Tests
|
** Tests
|
||||||
See above.
|
See above.
|
||||||
|
|
||||||
** Update the foreign files
|
** Update the foreign files
|
||||||
Running "./bootstrap" in the top level should update them all for you.
|
Running "./bootstrap" in the top level should update them all for you. This
|
||||||
This covers PO files too. Sometimes a PO file contains problems that
|
covers PO files too. Sometimes a PO file contains problems that causes it
|
||||||
causes it to be rejected by recent Gettext releases; please report
|
to be rejected by recent Gettext releases; please report these to the
|
||||||
these to the Translation Project.
|
Translation Project.
|
||||||
|
|
||||||
** Update README
|
** Update README
|
||||||
Make sure the information in README is current. Most notably, make sure
|
Make sure the information in README is current. Most notably, make sure it
|
||||||
it recommends a version of GNU M4 that is compatible with the latest
|
recommends a version of GNU M4 that is compatible with the latest Bison
|
||||||
Bison sources.
|
sources.
|
||||||
|
|
||||||
** Check copyright years.
|
** Check copyright years.
|
||||||
We update years in copyright statements throughout Bison once at the
|
We update years in copyright statements throughout Bison once at the start
|
||||||
start of every year by running "make update-copyright". However, before
|
of every year by running "make update-copyright". However, before a
|
||||||
a release, it's good to verify that it's actually been run. Besides the
|
release, it's good to verify that it's actually been run. Besides the
|
||||||
copyright statement for each Bison file, check the copyright statements
|
copyright statement for each Bison file, check the copyright statements that
|
||||||
that the skeletons insert into generated parsers, and check all
|
the skeletons insert into generated parsers, and check all occurrences of
|
||||||
occurrences of PACKAGE_COPYRIGHT_YEAR in configure.ac.
|
PACKAGE_COPYRIGHT_YEAR in configure.ac.
|
||||||
|
|
||||||
** Update NEWS, commit and tag.
|
** Update NEWS, commit and tag.
|
||||||
See do-release-commit-and-tag in README-release. For a while, we used
|
See do-release-commit-and-tag in README-release. For a while, we used beta
|
||||||
beta names such as "2.6_rc1". Now that we use gnulib in the release
|
names such as "2.6_rc1". Now that we use gnulib in the release procedure,
|
||||||
procedure, we must use "2.5.90", which has the additional benefit of
|
we must use "2.5.90", which has the additional benefit of being properly
|
||||||
being properly sorted in "git tag -l".
|
sorted in "git tag -l".
|
||||||
|
|
||||||
** make alpha, beta, or stable
|
** make alpha, beta, or stable
|
||||||
See README-release.
|
See README-release.
|
||||||
|
|
||||||
** Upload
|
** Upload
|
||||||
There are two ways to upload the tarballs to the GNU servers: using
|
There are two ways to upload the tarballs to the GNU servers: using gnupload
|
||||||
gnupload (from gnulib), or by hand. Obviously prefer the former. But
|
(from gnulib), or by hand. Obviously prefer the former. But in either
|
||||||
in either case, be sure to read the following paragraph.
|
case, be sure to read the following paragraph.
|
||||||
|
|
||||||
*** Setup
|
*** Setup
|
||||||
You need "gnupg".
|
You need "gnupg".
|
||||||
|
|
||||||
Make sure your public key has been uploaded at least to
|
Make sure your public key has been uploaded at least to keys.gnupg.net. You
|
||||||
keys.gnupg.net. You can upload it with:
|
can upload it with:
|
||||||
|
|
||||||
gpg --keyserver keys.gnupg.net --send-keys F125BDF3
|
gpg --keyserver keys.gnupg.net --send-keys F125BDF3
|
||||||
|
|
||||||
@@ -336,8 +345,8 @@ where F125BDF3 should be replaced with your key ID.
|
|||||||
*** Using gnupload
|
*** Using gnupload
|
||||||
You need "ncftp".
|
You need "ncftp".
|
||||||
|
|
||||||
At the end "make stable" (or alpha/beta) will display the procedure to
|
At the end "make stable" (or alpha/beta) will display the procedure to run.
|
||||||
run. Just copy and paste it in your shell.
|
Just copy and paste it in your shell.
|
||||||
|
|
||||||
*** By hand
|
*** By hand
|
||||||
|
|
||||||
@@ -399,9 +408,9 @@ sections that have been removed or renamed):
|
|||||||
$ ls -lt
|
$ ls -lt
|
||||||
|
|
||||||
Remove these files and commit their removal to CVS. For each of these
|
Remove these files and commit their removal to CVS. For each of these
|
||||||
files, add a line to the file .symlinks. This will ensure that
|
files, add a line to the file .symlinks. This will ensure that hyperlinks
|
||||||
hyperlinks to the removed files will redirect to the entire manual; this
|
to the removed files will redirect to the entire manual; this is better than
|
||||||
is better than a 404 error.
|
a 404 error.
|
||||||
|
|
||||||
There is a problem with 'index.html' being written twice (once for POSIX
|
There is a problem with 'index.html' being written twice (once for POSIX
|
||||||
function 'index', once for the table of contents); you can ignore this
|
function 'index', once for the table of contents); you can ignore this
|
||||||
@@ -420,19 +429,18 @@ Complete/fix the announcement file. The generated list of recipients
|
|||||||
([email protected], [email protected], [email protected],
|
([email protected], [email protected], [email protected],
|
||||||
[email protected], and [email protected]) is
|
[email protected], and [email protected]) is
|
||||||
appropriate for a stable release or a "serious beta". For any other
|
appropriate for a stable release or a "serious beta". For any other
|
||||||
release, drop at least [email protected]. For an example of how to
|
release, drop at least [email protected]. For an example of how to fill out
|
||||||
fill out the rest of the template, search the mailing list archives
|
the rest of the template, search the mailing list archives for the most
|
||||||
for the most recent release announcement.
|
recent release announcement.
|
||||||
|
|
||||||
For a stable release, send the same announcement on the comp.compilers
|
For a stable release, send the same announcement on the comp.compilers
|
||||||
newsgroup by sending email to [email protected]. Do not make any Cc as
|
newsgroup by sending email to [email protected]. Do not make any Cc as the
|
||||||
the moderator will throw away anything cross-posted or Cc'ed. It really
|
moderator will throw away anything cross-posted or Cc'ed. It really needs
|
||||||
needs to be a separate message.
|
to be a separate message.
|
||||||
|
|
||||||
** Prepare NEWS
|
** Prepare NEWS
|
||||||
So that developers don't accidentally add new items to the old NEWS
|
So that developers don't accidentally add new items to the old NEWS entry,
|
||||||
entry, create a new empty entry in line 3 (without the two leading
|
create a new empty entry in line 3 (without the two leading spaces):
|
||||||
spaces):
|
|
||||||
|
|
||||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||||
|
|
||||||
@@ -440,7 +448,7 @@ Push these changes.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002-2005, 2007-2013 Free Software Foundation, Inc.
|
Copyright (C) 2002-2005, 2007-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ Bison supports the @N construction, which gives you access to
|
|||||||
the starting and ending line number and character number associated
|
the starting and ending line number and character number associated
|
||||||
with any of the symbols in the current rule.
|
with any of the symbols in the current rule.
|
||||||
|
|
||||||
Also, Bison supports the command `%expect N' which says not to mention
|
Also, Bison supports the command '%expect N' which says not to mention
|
||||||
the conflicts if there are N shift/reduce conflicts and no reduce/reduce
|
the conflicts if there are N shift/reduce conflicts and no reduce/reduce
|
||||||
conflicts.
|
conflicts.
|
||||||
|
|
||||||
|
|||||||
@@ -1,68 +1,93 @@
|
|||||||
Bison was originally written by Robert Corbett. It would not be what
|
Bison was originally written by Robert Corbett. It would not be what
|
||||||
it is today without the invaluable help of these people:
|
it is today without the invaluable help of these people:
|
||||||
|
|
||||||
Аскар Сафин [email protected]
|
Aaro Koskinen [email protected]
|
||||||
|
Аскар Сафин [email protected]
|
||||||
|
Adam Sampson [email protected]
|
||||||
Airy Andre [email protected]
|
Airy Andre [email protected]
|
||||||
Akim Demaille [email protected]
|
Akim Demaille [email protected]
|
||||||
Albert Chin-A-Young [email protected]
|
Albert Chin-A-Young [email protected]
|
||||||
Alexander Belopolsky [email protected]
|
Alexander Belopolsky [email protected]
|
||||||
Alexandre Duret-Lutz [email protected]
|
Alexandre Duret-Lutz [email protected]
|
||||||
|
Andre da Costa Barros [email protected]
|
||||||
Andreas Schwab [email protected]
|
Andreas Schwab [email protected]
|
||||||
Andrew Suffield [email protected]
|
Andrew Suffield [email protected]
|
||||||
Angelo Borsotti [email protected]
|
Angelo Borsotti [email protected]
|
||||||
Anthony Heading [email protected]
|
Anthony Heading [email protected]
|
||||||
|
Antonio Silva Correia [email protected]
|
||||||
Arnold Robbins [email protected]
|
Arnold Robbins [email protected]
|
||||||
Art Haas [email protected]
|
Art Haas [email protected]
|
||||||
|
Askar Safin [email protected]
|
||||||
Baron Schwartz [email protected]
|
Baron Schwartz [email protected]
|
||||||
Ben Pfaff [email protected]
|
Ben Pfaff [email protected]
|
||||||
Benoit Perrot [email protected]
|
Benoit Perrot [email protected]
|
||||||
|
Bernd Edlinger [email protected]
|
||||||
Bernd Kiefer [email protected]
|
Bernd Kiefer [email protected]
|
||||||
Bert Deknuydt [email protected]
|
Bert Deknuydt [email protected]
|
||||||
Bill Allombert [email protected]
|
Bill Allombert [email protected]
|
||||||
Bob Rossi [email protected]
|
Bob Rossi [email protected]
|
||||||
Brandon Lucia [email protected]
|
Brandon Lucia [email protected]
|
||||||
|
Brooks Moses [email protected]
|
||||||
Bruce Lilly [email protected]
|
Bruce Lilly [email protected]
|
||||||
Bruno Haible [email protected]
|
Bruno Haible [email protected]
|
||||||
Charles-Henri de Boysson [email protected]
|
Charles-Henri de Boysson [email protected]
|
||||||
Christian Burger [email protected]
|
Christian Burger [email protected]
|
||||||
|
Colin Daley [email protected]
|
||||||
Cris Bailiff [email protected]
|
Cris Bailiff [email protected]
|
||||||
Cris van Pelt [email protected]
|
Cris van Pelt [email protected]
|
||||||
Csaba Raduly [email protected]
|
Csaba Raduly [email protected]
|
||||||
Dagobert Michelsen [email protected]
|
Dagobert Michelsen [email protected]
|
||||||
|
Daniel Frużyński [email protected]
|
||||||
|
Daniel Galloway [email protected]
|
||||||
Daniel Hagerty [email protected]
|
Daniel Hagerty [email protected]
|
||||||
David J. MacKenzie [email protected]
|
David J. MacKenzie [email protected]
|
||||||
David Kastrup [email protected]
|
David Kastrup [email protected]
|
||||||
|
David Michael [email protected]
|
||||||
|
Dengke Du [email protected]
|
||||||
|
Denis Excoffier [email protected]
|
||||||
Dennis Clarke [email protected]
|
Dennis Clarke [email protected]
|
||||||
|
Derek Clegg [email protected]
|
||||||
Derek M. Jones [email protected]
|
Derek M. Jones [email protected]
|
||||||
Di-an Jan [email protected]
|
Di-an Jan [email protected]
|
||||||
Dick Streefland [email protected]
|
Dick Streefland [email protected]
|
||||||
Didier Godefroy [email protected]
|
Didier Godefroy [email protected]
|
||||||
|
Efi Fogel [email protected]
|
||||||
Enrico Scholz [email protected]
|
Enrico Scholz [email protected]
|
||||||
Eric Blake [email protected]
|
Eric Blake [email protected]
|
||||||
|
Étienne Renault [email protected]
|
||||||
Evgeny Stambulchik [email protected]
|
Evgeny Stambulchik [email protected]
|
||||||
Fabrice Bauzac [email protected]
|
Fabrice Bauzac [email protected]
|
||||||
|
Ferdinand Thiessen [email protected]
|
||||||
Florian Krohm [email protected]
|
Florian Krohm [email protected]
|
||||||
Frank Heckenbach [email protected]
|
Frank Heckenbach [email protected]
|
||||||
Frans Englich [email protected]
|
Frans Englich [email protected]
|
||||||
|
Gabriel Rassoul [email protected]
|
||||||
|
Gary L Peskin [email protected]
|
||||||
Georg Sauthoff [email protected]
|
Georg Sauthoff [email protected]
|
||||||
George Neuner [email protected]
|
George Neuner [email protected]
|
||||||
Gilles Espinasse [email protected]
|
Gilles Espinasse [email protected]
|
||||||
Goran Uddeborg [email protected]
|
Goran Uddeborg [email protected]
|
||||||
Guido Trentalancia [email protected]
|
Guido Trentalancia [email protected]
|
||||||
H. Merijn Brand [email protected]
|
H. Merijn Brand [email protected]
|
||||||
Hans Aberg haberg@matematik.su.se
|
Hans Åberg haberg[email protected]
|
||||||
|
Horst Von Brand [email protected]
|
||||||
Jan Nieuwenhuizen [email protected]
|
Jan Nieuwenhuizen [email protected]
|
||||||
|
Jannick [email protected]
|
||||||
Jerry Quinn [email protected]
|
Jerry Quinn [email protected]
|
||||||
Jesse Thilo [email protected]
|
Jesse Thilo [email protected]
|
||||||
Jim Kent [email protected]
|
Jim Kent [email protected]
|
||||||
Jim Meyering [email protected]
|
Jim Meyering [email protected]
|
||||||
Joel E. Denny [email protected]
|
Joel E. Denny [email protected]
|
||||||
Johan van Selst [email protected]
|
Johan van Selst [email protected]
|
||||||
|
John Horigan [email protected]
|
||||||
Jonathan Fabrizio [email protected]
|
Jonathan Fabrizio [email protected]
|
||||||
Jonathan Nieder [email protected]
|
Jonathan Nieder [email protected]
|
||||||
|
Josh Soref [email protected]
|
||||||
Juan Manuel Guerrero [email protected]
|
Juan Manuel Guerrero [email protected]
|
||||||
Kees Zeelenberg [email protected]
|
Kees Zeelenberg [email protected]
|
||||||
Keith Browne [email protected]
|
Keith Browne [email protected]
|
||||||
|
Ken Moffat [email protected]
|
||||||
|
Kiyoshi Kanazawa [email protected]
|
||||||
Laurent Mascherpa [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
Lie Yan [email protected]
|
Lie Yan [email protected]
|
||||||
Magnus Fromreide [email protected]
|
Magnus Fromreide [email protected]
|
||||||
@@ -74,14 +99,22 @@ Martin Mokrejs [email protected]
|
|||||||
Martin Nylin [email protected]
|
Martin Nylin [email protected]
|
||||||
Matt Kraai [email protected]
|
Matt Kraai [email protected]
|
||||||
Matt Rosing [email protected]
|
Matt Rosing [email protected]
|
||||||
|
Maxim Prohorenko [email protected]
|
||||||
|
Michael Catanzaro [email protected]
|
||||||
|
Michael Felt [email protected]
|
||||||
Michael Hayes [email protected]
|
Michael Hayes [email protected]
|
||||||
Michael Raskin [email protected]
|
Michael Raskin [email protected]
|
||||||
|
Michel d'Hooge [email protected]
|
||||||
Michiel De Wilde [email protected]
|
Michiel De Wilde [email protected]
|
||||||
Mickael Labau [email protected]
|
Mickael Labau [email protected]
|
||||||
Mike Castle [email protected]
|
Mike Castle [email protected]
|
||||||
|
Mike Frysinger [email protected]
|
||||||
|
Mike Sullivan [email protected]
|
||||||
|
Nate Guerin [email protected]
|
||||||
Neil Booth [email protected]
|
Neil Booth [email protected]
|
||||||
Nelson H. F. Beebe [email protected]
|
Nelson H. F. Beebe [email protected]
|
||||||
Nick Bowler [email protected]
|
Nick Bowler [email protected]
|
||||||
|
Nicolas Bedon [email protected]
|
||||||
Nicolas Burrus [email protected]
|
Nicolas Burrus [email protected]
|
||||||
Nicolas Tisserand [email protected]
|
Nicolas Tisserand [email protected]
|
||||||
Noah Friedman [email protected]
|
Noah Friedman [email protected]
|
||||||
@@ -89,6 +122,7 @@ Odd Arild Olsen [email protected]
|
|||||||
Oleg Smolsky [email protected]
|
Oleg Smolsky [email protected]
|
||||||
Oleksii Taran [email protected]
|
Oleksii Taran [email protected]
|
||||||
Paolo Bonzini [email protected]
|
Paolo Bonzini [email protected]
|
||||||
|
Paolo Simone Gasparello [email protected]
|
||||||
Pascal Bart [email protected]
|
Pascal Bart [email protected]
|
||||||
Paul Eggert [email protected]
|
Paul Eggert [email protected]
|
||||||
Paul Hilfinger [email protected]
|
Paul Hilfinger [email protected]
|
||||||
@@ -97,35 +131,47 @@ Peter Eisentraut [email protected]
|
|||||||
Peter Fales [email protected]
|
Peter Fales [email protected]
|
||||||
Peter Hamorsky [email protected]
|
Peter Hamorsky [email protected]
|
||||||
Peter Simons [email protected]
|
Peter Simons [email protected]
|
||||||
|
Petr Machata [email protected]
|
||||||
|
Pho [email protected]
|
||||||
Piotr Gackiewicz [email protected]
|
Piotr Gackiewicz [email protected]
|
||||||
|
Piotr Marcińczyk [email protected]
|
||||||
Quentin Hocquet [email protected]
|
Quentin Hocquet [email protected]
|
||||||
Quoc Peyrot [email protected]
|
Quoc Peyrot [email protected]
|
||||||
R Blake [email protected]
|
R Blake [email protected]
|
||||||
Raja R Harinath [email protected]
|
Raja R Harinath [email protected]
|
||||||
Ralf Wildenhues [email protected]
|
Ralf Wildenhues [email protected]
|
||||||
|
Rich Wilson [email protected]
|
||||||
Richard Stallman [email protected]
|
Richard Stallman [email protected]
|
||||||
|
Rici Lake [email protected]
|
||||||
|
Rob Conde [email protected]
|
||||||
Rob Vermaas [email protected]
|
Rob Vermaas [email protected]
|
||||||
Robert Anisko [email protected]
|
Robert Anisko [email protected]
|
||||||
|
Robert Yang [email protected]
|
||||||
Roland Levillain [email protected]
|
Roland Levillain [email protected]
|
||||||
Satya Kiran Popuri [email protected]
|
Satya Kiran Popuri [email protected]
|
||||||
Sebastian Setzer [email protected]
|
Sebastian Setzer [email protected]
|
||||||
Sebastien Fricker [email protected]
|
Sebastien Fricker [email protected]
|
||||||
Sergei Steshenko [email protected]
|
Sergei Steshenko [email protected]
|
||||||
Shura [email protected]
|
Shura [email protected]
|
||||||
|
Simon Sobisch [email protected]
|
||||||
Stefano Lattarini [email protected]
|
Stefano Lattarini [email protected]
|
||||||
|
Stephen Cameron [email protected]
|
||||||
Steve Murphy [email protected]
|
Steve Murphy [email protected]
|
||||||
Sum Wu [email protected]
|
Sum Wu [email protected]
|
||||||
Théophile Ranquet [email protected]
|
Théophile Ranquet [email protected]
|
||||||
Thiru Ramakrishnan [email protected]
|
Thiru Ramakrishnan [email protected]
|
||||||
|
Thomas Jahns [email protected]
|
||||||
Tim Josling [email protected]
|
Tim Josling [email protected]
|
||||||
Tim Landscheidt [email protected]
|
Tim Landscheidt [email protected]
|
||||||
Tim Van Holder [email protected]
|
Tim Van Holder [email protected]
|
||||||
|
Tobias Frost [email protected]
|
||||||
Tom Lane [email protected]
|
Tom Lane [email protected]
|
||||||
Tom Tromey [email protected]
|
Tom Tromey [email protected]
|
||||||
Tommy Nordgren [email protected]
|
Tommy Nordgren [email protected]
|
||||||
Troy A. Johnson [email protected]
|
Troy A. Johnson [email protected]
|
||||||
Tys Lefering [email protected]
|
Tys Lefering [email protected]
|
||||||
Valentin Tolmer [email protected]
|
Valentin Tolmer [email protected]
|
||||||
|
Victor Khomenko [email protected]
|
||||||
Vin Shelton [email protected]
|
Vin Shelton [email protected]
|
||||||
W.C.A. Wijngaards [email protected]
|
W.C.A. Wijngaards [email protected]
|
||||||
Wayne Green [email protected]
|
Wayne Green [email protected]
|
||||||
@@ -134,7 +180,9 @@ Wojciech Polak [email protected]
|
|||||||
Wolfgang S. Kechel [email protected]
|
Wolfgang S. Kechel [email protected]
|
||||||
Wolfram Wagner [email protected]
|
Wolfram Wagner [email protected]
|
||||||
Wwp [email protected]
|
Wwp [email protected]
|
||||||
|
xolodho [email protected]
|
||||||
Zack Weinberg [email protected]
|
Zack Weinberg [email protected]
|
||||||
|
長田偉伸 [email protected]
|
||||||
|
|
||||||
Many people are not named here because we lost track of them. We
|
Many people are not named here because we lost track of them. We
|
||||||
thank them! Please, help us keeping this list up to date.
|
thank them! Please, help us keeping this list up to date.
|
||||||
@@ -146,7 +194,7 @@ End:
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
Copyright (C) 2000-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Parser Generator.
|
This file is part of Bison, the GNU Parser Generator.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,43 @@
|
|||||||
* Short term
|
* Short term
|
||||||
|
** yacc.c
|
||||||
|
Now that ylwrap is fixed, we should include foo.tab.h from foo.tab.c rather
|
||||||
|
than duplicating it.
|
||||||
|
|
||||||
|
** C++
|
||||||
|
Move to int everywhere instead of unsigned? stack_size, etc. The parser
|
||||||
|
itself uses int (for yylen for instance), yet stack is based on size_t.
|
||||||
|
|
||||||
|
Maybe locations should also move to ints.
|
||||||
|
|
||||||
|
** C
|
||||||
|
Introduce state_type rather than spreading yytype_int16 everywhere?
|
||||||
|
|
||||||
|
** glr.c
|
||||||
|
yyspaceLeft should probably be a pointer diff.
|
||||||
|
|
||||||
** Graphviz display code thoughts
|
** Graphviz display code thoughts
|
||||||
The code for the --graph option is over two files: print_graph, and
|
The code for the --graph option is over two files: print_graph, and
|
||||||
graphviz. I believe this is because Bison used to also produce VCG graphs,
|
graphviz. This is because Bison used to also produce VCG graphs, but since
|
||||||
but since this is no longer true, maybe we could consider these files for
|
this is no longer true, maybe we could consider these files for fusion.
|
||||||
fusion.
|
|
||||||
|
|
||||||
Little effort factoring seems to have been given to factoring in these files,
|
An other consideration worth noting is that print_graph.c (correct me if I
|
||||||
and their print-xml and print counterpart. We would very much like to re-use
|
am wrong) should contain generic functions, whereas graphviz.c and other
|
||||||
the pretty format of states from .output in the .dot
|
potential files should contain just the specific code for that output
|
||||||
|
format. It will probably prove difficult to tell if the implementation is
|
||||||
|
actually generic whilst only having support for a single format, but it
|
||||||
|
would be nice to keep stuff a bit tidier: right now, the construction of the
|
||||||
|
bitset used to show reductions is in the graphviz-specific code, and on the
|
||||||
|
opposite side we have some use of \l, which is graphviz-specific, in what
|
||||||
|
should be generic code.
|
||||||
|
|
||||||
Also, the underscore in print_graph.[ch] isn't very fitting considering
|
Little effort seems to have been given to factoring these files and their
|
||||||
the dashes in the other filenames.
|
rint{,-xml} counterpart. We would very much like to re-use the pretty format
|
||||||
|
of states from .output for the graphs, etc.
|
||||||
|
|
||||||
|
Also, the underscore in print_graph.[ch] isn't very fitting considering the
|
||||||
|
dashes in the other filenames.
|
||||||
|
|
||||||
|
Since graphviz dies on medium-to-big grammars, maybe consider an other tool?
|
||||||
|
|
||||||
** push-parser
|
** push-parser
|
||||||
Check it too when checking the different kinds of parsers. And be
|
Check it too when checking the different kinds of parsers. And be
|
||||||
@@ -101,7 +128,7 @@ We could (should?) also treat the case of the undef_token, which is
|
|||||||
numbered 257 for yylex, and 2 internal. Both appear for instance in
|
numbered 257 for yylex, and 2 internal. Both appear for instance in
|
||||||
toknum:
|
toknum:
|
||||||
|
|
||||||
const unsigned short int
|
const unsigned short
|
||||||
parser::yytoken_number_[] =
|
parser::yytoken_number_[] =
|
||||||
{
|
{
|
||||||
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
||||||
@@ -165,13 +192,13 @@ part of $default. Should we make the two reductions explicit, or just
|
|||||||
keep $default? See the following point.
|
keep $default? See the following point.
|
||||||
|
|
||||||
** Disabled Reductions
|
** Disabled Reductions
|
||||||
See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
|
See 'tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
|
||||||
what we want to do.
|
what we want to do.
|
||||||
|
|
||||||
** Documentation
|
** Documentation
|
||||||
Extend with error productions. The hard part will probably be finding
|
Extend with error productions. The hard part will probably be finding
|
||||||
the right rule so that a single state does not exhibit too many yet
|
the right rule so that a single state does not exhibit too many yet
|
||||||
undocumented ``features''. Maybe an empty action ought to be
|
undocumented ''features''. Maybe an empty action ought to be
|
||||||
presented too. Shall we try to make a single grammar with all these
|
presented too. Shall we try to make a single grammar with all these
|
||||||
features, or should we have several very small grammars?
|
features, or should we have several very small grammars?
|
||||||
|
|
||||||
@@ -185,6 +212,31 @@ DeRemer and Penello: they already provide the algorithm.
|
|||||||
|
|
||||||
|
|
||||||
* Extensions
|
* Extensions
|
||||||
|
** Multiple start symbols
|
||||||
|
Would be very useful when parsing closely related languages.
|
||||||
|
|
||||||
|
** Better error messages
|
||||||
|
The users are not provided with enough tools to forge their error messages.
|
||||||
|
See for instance "Is there an option to change the message produced by
|
||||||
|
YYERROR_VERBOSE?" by Simon Sobisch, on bison-help.
|
||||||
|
|
||||||
|
See also
|
||||||
|
https://www.cs.tufts.edu/~nr/cs257/archive/clinton-jefferey/lr-error-messages.pdf
|
||||||
|
and https://research.swtch.com/yyerror.
|
||||||
|
|
||||||
|
** %include
|
||||||
|
This is a popular demand. We already made many changes in the parser that
|
||||||
|
should make this reasonably easy to implement.
|
||||||
|
|
||||||
|
Bruce Mardle <[email protected]>
|
||||||
|
https://lists.gnu.org/archive/html/bison-patches/2015-09/msg00000.html
|
||||||
|
|
||||||
|
** Push parsers
|
||||||
|
There is demand for push parsers in Java and C++. And GLR I guess.
|
||||||
|
|
||||||
|
** Generate code instead of tables
|
||||||
|
This is certainly quite a lot of work. See
|
||||||
|
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.4539.
|
||||||
|
|
||||||
** $-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
|
||||||
@@ -220,6 +272,10 @@ XML output for GNU Bison and gcc
|
|||||||
XML output for GNU Bison
|
XML output for GNU Bison
|
||||||
http://yaxx.sourceforge.net/
|
http://yaxx.sourceforge.net/
|
||||||
|
|
||||||
|
** Counterexample generation
|
||||||
|
https://lists.gnu.org/archive/html/bug-bison/2016-06/msg00000.html
|
||||||
|
http://www.cs.cornell.edu/andru/papers/cupex/
|
||||||
|
|
||||||
* Unit rules
|
* Unit rules
|
||||||
Maybe we could expand unit rules, i.e., transform
|
Maybe we could expand unit rules, i.e., transform
|
||||||
|
|
||||||
@@ -232,9 +288,9 @@ into
|
|||||||
exp: exp '+' exp | exp '&' exp;
|
exp: exp '+' exp | exp '&' exp;
|
||||||
|
|
||||||
when there are no actions. This can significantly speed up some
|
when there are no actions. This can significantly speed up some
|
||||||
grammars. I can't find the papers. In particular the book `LR
|
grammars. I can't find the papers. In particular the book 'LR
|
||||||
parsing: Theory and Practice' is impossible to find, but according to
|
parsing: Theory and Practice' is impossible to find, but according to
|
||||||
`Parsing Techniques: a Practical Guide', it includes information about
|
'Parsing Techniques: a Practical Guide', it includes information about
|
||||||
this issue. Does anybody have it?
|
this issue. Does anybody have it?
|
||||||
|
|
||||||
|
|
||||||
@@ -354,11 +410,13 @@ Here's a proposal for how a new implementation might look:
|
|||||||
Local Variables:
|
Local Variables:
|
||||||
mode: outline
|
mode: outline
|
||||||
coding: utf-8
|
coding: utf-8
|
||||||
|
fill-column: 76
|
||||||
End:
|
End:
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2001-2004, 2006, 2008-2013 Free Software Foundation, Inc.
|
Copyright (C) 2001-2004, 2006, 2008-2015, 2018 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Print a version string.
|
# Print a version string.
|
||||||
scriptversion=2012-12-28.10; # UTC
|
scriptversion=2018-10-13.05; # UTC
|
||||||
|
|
||||||
# Bootstrap this package from checked-out sources.
|
# Bootstrap this package from checked-out sources.
|
||||||
|
|
||||||
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2003-2018 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
|
||||||
@@ -17,7 +17,7 @@ scriptversion=2012-12-28.10; # UTC
|
|||||||
# 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, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Originally written by Paul Eggert. The canonical version of this
|
# Originally written by Paul Eggert. The canonical version of this
|
||||||
# script is maintained as build-aux/bootstrap in gnulib, however, to
|
# script is maintained as build-aux/bootstrap in gnulib, however, to
|
||||||
@@ -42,8 +42,13 @@ export LC_ALL
|
|||||||
|
|
||||||
local_gl_dir=gl
|
local_gl_dir=gl
|
||||||
|
|
||||||
|
# Honor $PERL, but work even if there is none.
|
||||||
|
PERL="${PERL-perl}"
|
||||||
|
|
||||||
me=$0
|
me=$0
|
||||||
|
|
||||||
|
default_gnulib_url=git://git.sv.gnu.org/gnulib
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: $me [OPTION]...
|
Usage: $me [OPTION]...
|
||||||
@@ -73,6 +78,37 @@ contents are read as shell variables to configure the bootstrap.
|
|||||||
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||||
are honored.
|
are honored.
|
||||||
|
|
||||||
|
Gnulib sources can be fetched in various ways:
|
||||||
|
|
||||||
|
* If this package is in a git repository with a 'gnulib' submodule
|
||||||
|
configured, then that submodule is initialized and updated and sources
|
||||||
|
are fetched from there. If \$GNULIB_SRCDIR is set (directly or via
|
||||||
|
--gnulib-srcdir) and is a git repository, then it is used as a reference.
|
||||||
|
|
||||||
|
* Otherwise, if \$GNULIB_SRCDIR is set (directly or via --gnulib-srcdir),
|
||||||
|
then sources are fetched from that local directory. If it is a git
|
||||||
|
repository and \$GNULIB_REVISION is set, then that revision is checked
|
||||||
|
out.
|
||||||
|
|
||||||
|
* Otherwise, if this package is in a git repository with a 'gnulib'
|
||||||
|
submodule configured, then that submodule is initialized and updated and
|
||||||
|
sources are fetched from there.
|
||||||
|
|
||||||
|
* Otherwise, if the 'gnulib' directory does not exist, Gnulib sources are
|
||||||
|
cloned into that directory using git from \$GNULIB_URL, defaulting to
|
||||||
|
$default_gnulib_url.
|
||||||
|
If \$GNULIB_REVISION is set, then that revision is checked out.
|
||||||
|
|
||||||
|
* Otherwise, the existing Gnulib sources in the 'gnulib' directory are
|
||||||
|
used. If it is a git repository and \$GNULIB_REVISION is set, then that
|
||||||
|
revision is checked out.
|
||||||
|
|
||||||
|
If you maintain a package and want to pin a particular revision of the
|
||||||
|
Gnulib sources that has been tested with your package, then there are two
|
||||||
|
possible approaches: either configure a 'gnulib' submodule with the
|
||||||
|
appropriate revision, or set \$GNULIB_REVISION (and if necessary
|
||||||
|
\$GNULIB_URL) in $me.conf.
|
||||||
|
|
||||||
Running without arguments will suffice in most cases.
|
Running without arguments will suffice in most cases.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@@ -126,34 +162,28 @@ bootstrap_post_import_hook() { :; }
|
|||||||
# Override it via your own definition in bootstrap.conf.
|
# Override it via your own definition in bootstrap.conf.
|
||||||
bootstrap_epilogue() { :; }
|
bootstrap_epilogue() { :; }
|
||||||
|
|
||||||
# The command to download all .po files for a specified domain into
|
# The command to download all .po files for a specified domain into a
|
||||||
# a specified directory. Fill in the first %s is the domain name, and
|
# specified directory. Fill in the first %s with the destination
|
||||||
# the second with the destination directory. Use rsync's -L and -r
|
# directory and the second with the domain name.
|
||||||
# options because the latest/%s directory and the .po files within are
|
|
||||||
# all symlinks.
|
|
||||||
po_download_command_format=\
|
po_download_command_format=\
|
||||||
"rsync --delete --exclude '*.s1' -Lrtvz \
|
"wget --mirror --level=1 -nd -q -A.po -P '%s' \
|
||||||
'translationproject.org::tp/latest/%s/' '%s'"
|
https://translationproject.org/latest/%s/"
|
||||||
|
|
||||||
# Fallback for downloading .po files (if rsync fails).
|
|
||||||
po_download_command_format2=\
|
|
||||||
"wget --mirror -nd -q -np -A.po -P '%s' \
|
|
||||||
http://translationproject.org/latest/%s/"
|
|
||||||
|
|
||||||
|
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
|
||||||
|
# fall back to the package name (1st argument with munging)
|
||||||
extract_package_name='
|
extract_package_name='
|
||||||
/^AC_INIT(/{
|
/^AC_INIT(\[*/{
|
||||||
/.*,.*,.*, */{
|
s///
|
||||||
s///
|
/^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{
|
||||||
s/[][]//g
|
s//\1/
|
||||||
s/)$//
|
s/[],)].*//
|
||||||
p
|
p
|
||||||
q
|
q
|
||||||
}
|
}
|
||||||
s/AC_INIT(\[*//
|
s/[],)].*//
|
||||||
s/]*,.*//
|
|
||||||
s/^GNU //
|
s/^GNU //
|
||||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||||
s/[^A-Za-z0-9_]/-/g
|
s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
|
||||||
p
|
p
|
||||||
}
|
}
|
||||||
'
|
'
|
||||||
@@ -166,7 +196,15 @@ source_base=lib
|
|||||||
m4_base=m4
|
m4_base=m4
|
||||||
doc_base=doc
|
doc_base=doc
|
||||||
tests_base=tests
|
tests_base=tests
|
||||||
gnulib_extra_files=''
|
gnulib_extra_files="
|
||||||
|
build-aux/install-sh
|
||||||
|
build-aux/mdate-sh
|
||||||
|
build-aux/texinfo.tex
|
||||||
|
build-aux/depcomp
|
||||||
|
build-aux/config.guess
|
||||||
|
build-aux/config.sub
|
||||||
|
doc/INSTALL
|
||||||
|
"
|
||||||
|
|
||||||
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
||||||
gnulib_tool_option_extras=
|
gnulib_tool_option_extras=
|
||||||
@@ -208,12 +246,26 @@ bootstrap_sync=false
|
|||||||
# Use git to update gnulib sources
|
# Use git to update gnulib sources
|
||||||
use_git=true
|
use_git=true
|
||||||
|
|
||||||
|
check_exists() {
|
||||||
|
if test "$1" = "--verbose"; then
|
||||||
|
($2 --version </dev/null) >/dev/null 2>&1
|
||||||
|
if test $? -ge 126; then
|
||||||
|
# If not found, run with diagnostics as one may be
|
||||||
|
# presented with env variables to set to find the right version
|
||||||
|
($2 --version </dev/null)
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
($1 --version </dev/null) >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
test $? -lt 126
|
||||||
|
}
|
||||||
|
|
||||||
# find_tool ENVVAR NAMES...
|
# find_tool ENVVAR NAMES...
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Search for a required program. Use the value of ENVVAR, if set,
|
# Search for a required program. Use the value of ENVVAR, if set,
|
||||||
# otherwise find the first of the NAMES that can be run (i.e.,
|
# otherwise find the first of the NAMES that can be run.
|
||||||
# supports --version). If found, set ENVVAR to the program name,
|
# If found, set ENVVAR to the program name, die otherwise.
|
||||||
# die otherwise.
|
|
||||||
#
|
#
|
||||||
# FIXME: code duplication, see also gnu-web-doc-update.
|
# FIXME: code duplication, see also gnu-web-doc-update.
|
||||||
find_tool ()
|
find_tool ()
|
||||||
@@ -223,27 +275,21 @@ find_tool ()
|
|||||||
find_tool_names=$@
|
find_tool_names=$@
|
||||||
eval "find_tool_res=\$$find_tool_envvar"
|
eval "find_tool_res=\$$find_tool_envvar"
|
||||||
if test x"$find_tool_res" = x; then
|
if test x"$find_tool_res" = x; then
|
||||||
for i
|
for i; do
|
||||||
do
|
if check_exists $i; then
|
||||||
if ($i --version </dev/null) >/dev/null 2>&1; then
|
find_tool_res=$i
|
||||||
find_tool_res=$i
|
break
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
|
||||||
find_tool_error_prefix="\$$find_tool_envvar: "
|
|
||||||
fi
|
fi
|
||||||
test x"$find_tool_res" != x \
|
if test x"$find_tool_res" = x; then
|
||||||
|| die "one of these is required: $find_tool_names"
|
warn_ "one of these is required: $find_tool_names;"
|
||||||
($find_tool_res --version </dev/null) >/dev/null 2>&1 \
|
die "alternatively set $find_tool_envvar to a compatible tool"
|
||||||
|| die "${find_tool_error_prefix}cannot run $find_tool_res --version"
|
fi
|
||||||
eval "$find_tool_envvar=\$find_tool_res"
|
eval "$find_tool_envvar=\$find_tool_res"
|
||||||
eval "export $find_tool_envvar"
|
eval "export $find_tool_envvar"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6.
|
|
||||||
find_tool SHA1SUM sha1sum gsha1sum shasum
|
|
||||||
|
|
||||||
# Override the default configuration, if necessary.
|
# Override the default configuration, if necessary.
|
||||||
# Make sure that bootstrap.conf is sourced from the current directory
|
# Make sure that bootstrap.conf is sourced from the current directory
|
||||||
# if we were invoked as "sh bootstrap".
|
# if we were invoked as "sh bootstrap".
|
||||||
@@ -252,24 +298,18 @@ case "$0" in
|
|||||||
*) test -r "$0.conf" && . ./"$0.conf" ;;
|
*) test -r "$0.conf" && . ./"$0.conf" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Extra files from gnulib, which override files from other sources.
|
|
||||||
test -z "${gnulib_extra_files}" && \
|
|
||||||
gnulib_extra_files="
|
|
||||||
$build_aux/install-sh
|
|
||||||
$build_aux/mdate-sh
|
|
||||||
$build_aux/texinfo.tex
|
|
||||||
$build_aux/depcomp
|
|
||||||
$build_aux/config.guess
|
|
||||||
$build_aux/config.sub
|
|
||||||
doc/INSTALL
|
|
||||||
"
|
|
||||||
|
|
||||||
if test "$vc_ignore" = auto; then
|
if test "$vc_ignore" = auto; then
|
||||||
vc_ignore=
|
vc_ignore=
|
||||||
test -d .git && vc_ignore=.gitignore
|
test -d .git && vc_ignore=.gitignore
|
||||||
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
|
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test x"$gnulib_modules$gnulib_files$gnulib_extra_files" = x; then
|
||||||
|
use_gnulib=false
|
||||||
|
else
|
||||||
|
use_gnulib=true
|
||||||
|
fi
|
||||||
|
|
||||||
# Translate configuration into internal form.
|
# Translate configuration into internal form.
|
||||||
|
|
||||||
# Parse options.
|
# Parse options.
|
||||||
@@ -306,34 +346,34 @@ if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
|||||||
die "Bootstrapping from a non-checked-out distribution is risky."
|
die "Bootstrapping from a non-checked-out distribution is risky."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure that lines starting with ! sort last, per gitignore conventions
|
# Strip blank and comment lines to leave significant entries.
|
||||||
# for whitelisting exceptions after a more generic blacklist pattern.
|
gitignore_entries() {
|
||||||
sort_patterns() {
|
sed '/^#/d; /^$/d' "$@"
|
||||||
sort -u "$@" | sed '/^!/ {
|
|
||||||
H
|
|
||||||
d
|
|
||||||
}
|
|
||||||
$ {
|
|
||||||
P
|
|
||||||
x
|
|
||||||
s/^\n//
|
|
||||||
}' | sed '/^$/d'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# If $STR is not already on a line by itself in $FILE, insert it,
|
# If $STR is not already on a line by itself in $FILE, insert it at the start.
|
||||||
# sorting the new contents of the file and replacing $FILE with the result.
|
# Entries are inserted at the start of the ignore list to ensure existing
|
||||||
insert_sorted_if_absent() {
|
# entries starting with ! are not overridden. Such entries support
|
||||||
|
# whitelisting exceptions after a more generic blacklist pattern.
|
||||||
|
insert_if_absent() {
|
||||||
file=$1
|
file=$1
|
||||||
str=$2
|
str=$2
|
||||||
test -f $file || touch $file
|
test -f $file || touch $file
|
||||||
echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \
|
test -r $file || die "Error: failed to read ignore file: $file"
|
||||||
|| { echo "$str" | sort_patterns - $file > $file.bak \
|
duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
|
||||||
&& mv $file.bak $file; } \
|
if [ "$duplicate_entries" ] ; then
|
||||||
|| die "insert_sorted_if_absent $file $str: failed"
|
die "Error: Duplicate entries in $file: " $duplicate_entries
|
||||||
|
fi
|
||||||
|
linesold=$(gitignore_entries $file | wc -l)
|
||||||
|
linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
|
||||||
|
if [ $linesold != $linesnew ] ; then
|
||||||
|
{ echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|
||||||
|
|| die "insert_if_absent $file $str: failed"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
|
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
|
||||||
# insert_sorted_if_absent.
|
# insert_if_absent.
|
||||||
insert_vc_ignore() {
|
insert_vc_ignore() {
|
||||||
vc_ignore_file="$1"
|
vc_ignore_file="$1"
|
||||||
pattern="$2"
|
pattern="$2"
|
||||||
@@ -344,7 +384,7 @@ insert_vc_ignore() {
|
|||||||
# .gitignore entry.
|
# .gitignore entry.
|
||||||
pattern=$(echo "$pattern" | sed s,^,/,);;
|
pattern=$(echo "$pattern" | sed s,^,/,);;
|
||||||
esac
|
esac
|
||||||
insert_sorted_if_absent "$vc_ignore_file" "$pattern"
|
insert_if_absent "$vc_ignore_file" "$pattern"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
||||||
@@ -406,28 +446,30 @@ sort_ver() { # sort -V is not generally available
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_version_sed='
|
||||||
|
# Move version to start of line.
|
||||||
|
s/.*[v ]\([0-9]\)/\1/
|
||||||
|
|
||||||
|
# Skip lines that do not start with version.
|
||||||
|
/^[0-9]/!d
|
||||||
|
|
||||||
|
# Remove characters after the version.
|
||||||
|
s/[^.a-z0-9-].*//
|
||||||
|
|
||||||
|
# The first component must be digits only.
|
||||||
|
s/^\([0-9]*\)[a-z-].*/\1/
|
||||||
|
|
||||||
|
#the following essentially does s/5.005/5.5/
|
||||||
|
s/\.0*\([1-9]\)/.\1/g
|
||||||
|
p
|
||||||
|
q'
|
||||||
|
|
||||||
get_version() {
|
get_version() {
|
||||||
app=$1
|
app=$1
|
||||||
|
|
||||||
$app --version >/dev/null 2>&1 || return 1
|
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
|
||||||
|
|
||||||
$app --version 2>&1 |
|
$app --version 2>&1 | sed -n "$get_version_sed"
|
||||||
sed -n '# Move version to start of line.
|
|
||||||
s/.*[v ]\([0-9]\)/\1/
|
|
||||||
|
|
||||||
# Skip lines that do not start with version.
|
|
||||||
/^[0-9]/!d
|
|
||||||
|
|
||||||
# Remove characters after the version.
|
|
||||||
s/[^.a-z0-9-].*//
|
|
||||||
|
|
||||||
# The first component must be digits only.
|
|
||||||
s/^\([0-9]*\)[a-z-].*/\1/
|
|
||||||
|
|
||||||
#the following essentially does s/5.005/5.5/
|
|
||||||
s/\.0*\([1-9]\)/.\1/g
|
|
||||||
p
|
|
||||||
q'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_versions() {
|
check_versions() {
|
||||||
@@ -447,6 +489,7 @@ check_versions() {
|
|||||||
test "$appvar" = TAR && appvar=AMTAR
|
test "$appvar" = TAR && appvar=AMTAR
|
||||||
case $appvar in
|
case $appvar in
|
||||||
GZIP) ;; # Do not use $GZIP: it contains gzip options.
|
GZIP) ;; # Do not use $GZIP: it contains gzip options.
|
||||||
|
PERL::*) ;; # Keep perl modules as-is
|
||||||
*) eval "app=\${$appvar-$app}" ;;
|
*) eval "app=\${$appvar-$app}" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -464,12 +507,22 @@ check_versions() {
|
|||||||
ret=1
|
ret=1
|
||||||
continue
|
continue
|
||||||
} ;;
|
} ;;
|
||||||
|
# Another check is for perl modules. These can be written as
|
||||||
|
# e.g. perl::XML::XPath in case of XML::XPath module, etc.
|
||||||
|
perl::*)
|
||||||
|
# Extract module name
|
||||||
|
app="${app#perl::}"
|
||||||
|
if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
|
||||||
|
warn_ "Error: perl module '$app' not found"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
if [ "$req_ver" = "-" ]; then
|
if [ "$req_ver" = "-" ]; then
|
||||||
# Merely require app to exist; not all prereq apps are well-behaved
|
# Merely require app to exist; not all prereq apps are well-behaved
|
||||||
# so we have to rely on $? rather than get_version.
|
# so we have to rely on $? rather than get_version.
|
||||||
$app --version >/dev/null 2>&1
|
if ! check_exists --verbose $app; then
|
||||||
if [ 126 -le $? ]; then
|
|
||||||
warn_ "Error: '$app' not found"
|
warn_ "Error: '$app' not found"
|
||||||
ret=1
|
ret=1
|
||||||
fi
|
fi
|
||||||
@@ -502,6 +555,12 @@ print_versions() {
|
|||||||
# can't depend on column -t
|
# can't depend on column -t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
|
||||||
|
# Also find the compatible sha1 utility on the BSDs
|
||||||
|
if test x"$SKIP_PO" = x; then
|
||||||
|
find_tool SHA1SUM sha1sum gsha1sum shasum sha1
|
||||||
|
fi
|
||||||
|
|
||||||
use_libtool=0
|
use_libtool=0
|
||||||
# We'd like to use grep -E, to see if any of LT_INIT,
|
# We'd like to use grep -E, to see if any of LT_INIT,
|
||||||
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
|
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
|
||||||
@@ -547,13 +606,21 @@ if ! printf "$buildreq" | check_versions; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Warn the user if autom4te appears to be broken; this causes known
|
||||||
|
# issues with at least gettext 0.18.3.
|
||||||
|
probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -)
|
||||||
|
if test "x$probe" != xhi; then
|
||||||
|
warn_ "WARNING: your autom4te wrapper eats stdin;"
|
||||||
|
warn_ "if bootstrap fails, consider upgrading your autotools"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$0: Bootstrapping from checked-out $package sources..."
|
echo "$0: Bootstrapping from checked-out $package sources..."
|
||||||
|
|
||||||
# See if we can use gnulib's git-merge-changelog merge driver.
|
# See if we can use gnulib's git-merge-changelog merge driver.
|
||||||
if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
|
if $use_git && test -d .git && check_exists git; then
|
||||||
if git config merge.merge-changelog.driver >/dev/null ; then
|
if git config merge.merge-changelog.driver >/dev/null ; then
|
||||||
:
|
:
|
||||||
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
|
elif check_exists git-merge-changelog; then
|
||||||
echo "$0: initializing git-merge-changelog driver"
|
echo "$0: initializing git-merge-changelog driver"
|
||||||
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
|
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
|
||||||
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
|
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
|
||||||
@@ -573,83 +640,101 @@ git_modules_config () {
|
|||||||
test -f .gitmodules && git config --file .gitmodules "$@"
|
test -f .gitmodules && git config --file .gitmodules "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
if $use_gnulib; then
|
||||||
test -z "$gnulib_path" && gnulib_path=gnulib
|
if $use_git; then
|
||||||
|
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
||||||
# Get gnulib files.
|
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||||
|
|
||||||
case ${GNULIB_SRCDIR--} in
|
|
||||||
-)
|
|
||||||
if git_modules_config submodule.gnulib.url >/dev/null; then
|
|
||||||
echo "$0: getting gnulib files..."
|
|
||||||
git submodule init || exit $?
|
|
||||||
git submodule update || exit $?
|
|
||||||
|
|
||||||
elif [ ! -d "$gnulib_path" ]; then
|
|
||||||
echo "$0: getting gnulib files..."
|
|
||||||
|
|
||||||
trap cleanup_gnulib 1 2 13 15
|
|
||||||
|
|
||||||
shallow=
|
|
||||||
git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
|
|
||||||
git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
|
|
||||||
cleanup_gnulib
|
|
||||||
|
|
||||||
trap - 1 2 13 15
|
|
||||||
fi
|
fi
|
||||||
GNULIB_SRCDIR=$gnulib_path
|
|
||||||
;;
|
# Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
|
||||||
*)
|
# submodule, for use in the rest of the script.
|
||||||
# Use GNULIB_SRCDIR as a reference.
|
|
||||||
if test -d "$GNULIB_SRCDIR"/.git && \
|
case ${GNULIB_SRCDIR--} in
|
||||||
git_modules_config submodule.gnulib.url >/dev/null; then
|
-)
|
||||||
echo "$0: getting gnulib files..."
|
# Note that $use_git is necessarily true in this case.
|
||||||
if git submodule -h|grep -- --reference > /dev/null; then
|
if git_modules_config submodule.gnulib.url >/dev/null; then
|
||||||
# Prefer the one-liner available in git 1.6.4 or newer.
|
echo "$0: getting gnulib files..."
|
||||||
git submodule update --init --reference "$GNULIB_SRCDIR" \
|
git submodule init -- "$gnulib_path" || exit $?
|
||||||
"$gnulib_path" || exit $?
|
git submodule update -- "$gnulib_path" || exit $?
|
||||||
else
|
|
||||||
# This fallback allows at least git 1.5.5.
|
elif [ ! -d "$gnulib_path" ]; then
|
||||||
if test -f "$gnulib_path"/gnulib-tool; then
|
echo "$0: getting gnulib files..."
|
||||||
# Since file already exists, assume submodule init already complete.
|
|
||||||
git submodule update || exit $?
|
trap cleanup_gnulib 1 2 13 15
|
||||||
else
|
|
||||||
# Older git can't clone into an empty directory.
|
shallow=
|
||||||
rmdir "$gnulib_path" 2>/dev/null
|
if test -z "$GNULIB_REVISION"; then
|
||||||
git clone --reference "$GNULIB_SRCDIR" \
|
git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
|
||||||
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
|
||||||
&& git submodule init && git submodule update \
|
|
||||||
|| exit $?
|
|
||||||
fi
|
fi
|
||||||
|
git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
|
||||||
|
|| cleanup_gnulib
|
||||||
|
|
||||||
|
trap - 1 2 13 15
|
||||||
fi
|
fi
|
||||||
GNULIB_SRCDIR=$gnulib_path
|
GNULIB_SRCDIR=$gnulib_path
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# Use GNULIB_SRCDIR directly or as a reference.
|
||||||
|
if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
|
||||||
|
git_modules_config submodule.gnulib.url >/dev/null; then
|
||||||
|
echo "$0: getting gnulib files..."
|
||||||
|
if git submodule -h|grep -- --reference > /dev/null; then
|
||||||
|
# Prefer the one-liner available in git 1.6.4 or newer.
|
||||||
|
git submodule update --init --reference "$GNULIB_SRCDIR" \
|
||||||
|
"$gnulib_path" || exit $?
|
||||||
|
else
|
||||||
|
# This fallback allows at least git 1.5.5.
|
||||||
|
if test -f "$gnulib_path"/gnulib-tool; then
|
||||||
|
# Since file already exists, assume submodule init already complete.
|
||||||
|
git submodule update -- "$gnulib_path" || exit $?
|
||||||
|
else
|
||||||
|
# Older git can't clone into an empty directory.
|
||||||
|
rmdir "$gnulib_path" 2>/dev/null
|
||||||
|
git clone --reference "$GNULIB_SRCDIR" \
|
||||||
|
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
||||||
|
&& git submodule init -- "$gnulib_path" \
|
||||||
|
&& git submodule update -- "$gnulib_path" \
|
||||||
|
|| exit $?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
GNULIB_SRCDIR=$gnulib_path
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
|
||||||
|
&& ! git_modules_config submodule.gnulib.url >/dev/null; then
|
||||||
|
(cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
|
||||||
fi
|
fi
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if $bootstrap_sync; then
|
# $GNULIB_SRCDIR now points to the version of gnulib to use, and
|
||||||
cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
|
# we no longer need to use git or $gnulib_path below here.
|
||||||
echo "$0: updating bootstrap and restarting..."
|
|
||||||
exec sh -c \
|
if $bootstrap_sync; then
|
||||||
'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
|
||||||
-- "$GNULIB_SRCDIR/build-aux/bootstrap" \
|
echo "$0: updating bootstrap and restarting..."
|
||||||
"$0" "$@" --no-bootstrap-sync
|
case $(sh -c 'echo "$1"' -- a) in
|
||||||
}
|
a) ignored=--;;
|
||||||
|
*) ignored=ignored;;
|
||||||
|
esac
|
||||||
|
exec sh -c \
|
||||||
|
'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
||||||
|
$ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
|
||||||
|
"$0" "$@" --no-bootstrap-sync
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||||
|
<$gnulib_tool || exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
|
||||||
<$gnulib_tool || exit $?
|
|
||||||
|
|
||||||
# Get translations.
|
# Get translations.
|
||||||
|
|
||||||
download_po_files() {
|
download_po_files() {
|
||||||
subdir=$1
|
subdir=$1
|
||||||
domain=$2
|
domain=$2
|
||||||
echo "$me: getting translations into $subdir for $domain..."
|
echo "$me: getting translations into $subdir for $domain..."
|
||||||
cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
|
cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
|
||||||
eval "$cmd" && return
|
|
||||||
# Fallback to HTTP.
|
|
||||||
cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
|
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -680,11 +765,10 @@ update_po_files() {
|
|||||||
cksum_file="$ref_po_dir/$po.s1"
|
cksum_file="$ref_po_dir/$po.s1"
|
||||||
if ! test -f "$cksum_file" ||
|
if ! test -f "$cksum_file" ||
|
||||||
! test -f "$po_dir/$po.po" ||
|
! test -f "$po_dir/$po.po" ||
|
||||||
! $SHA1SUM -c --status "$cksum_file" \
|
! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
|
||||||
< "$new_po" > /dev/null; then
|
|
||||||
echo "$me: updated $po_dir/$po.po..."
|
echo "$me: updated $po_dir/$po.po..."
|
||||||
cp "$new_po" "$po_dir/$po.po" \
|
cp "$new_po" "$po_dir/$po.po" \
|
||||||
&& $SHA1SUM < "$new_po" > "$cksum_file"
|
&& $SHA1SUM < "$new_po" > "$cksum_file" || return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -740,9 +824,9 @@ symlink_to_dir()
|
|||||||
# Leave any existing symlink alone, if it already points to the source,
|
# Leave any existing symlink alone, if it already points to the source,
|
||||||
# so that broken build tools that care about symlink times
|
# so that broken build tools that care about symlink times
|
||||||
# aren't confused into doing unnecessary builds. Conversely, if the
|
# aren't confused into doing unnecessary builds. Conversely, if the
|
||||||
# existing symlink's time stamp is older than the source, make it afresh,
|
# existing symlink's timestamp is older than the source, make it afresh,
|
||||||
# so that broken tools aren't confused into skipping needed builds. See
|
# so that broken tools aren't confused into skipping needed builds. See
|
||||||
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
|
# <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00326.html>.
|
||||||
test -h "$dst" &&
|
test -h "$dst" &&
|
||||||
src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
|
src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
|
||||||
dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
|
dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
|
||||||
@@ -848,31 +932,33 @@ fi
|
|||||||
|
|
||||||
# Import from gnulib.
|
# Import from gnulib.
|
||||||
|
|
||||||
gnulib_tool_options="\
|
if $use_gnulib; then
|
||||||
--import\
|
gnulib_tool_options="\
|
||||||
--no-changelog\
|
--no-changelog\
|
||||||
--aux-dir $build_aux\
|
--aux-dir=$build_aux\
|
||||||
--doc-base $doc_base\
|
--doc-base=$doc_base\
|
||||||
--lib $gnulib_name\
|
--lib=$gnulib_name\
|
||||||
--m4-base $m4_base/\
|
--m4-base=$m4_base/\
|
||||||
--source-base $source_base/\
|
--source-base=$source_base/\
|
||||||
--tests-base $tests_base\
|
--tests-base=$tests_base\
|
||||||
--local-dir $local_gl_dir\
|
--local-dir=$local_gl_dir\
|
||||||
$gnulib_tool_option_extras\
|
$gnulib_tool_option_extras\
|
||||||
"
|
"
|
||||||
if test $use_libtool = 1; then
|
if test $use_libtool = 1; then
|
||||||
case "$gnulib_tool_options " in
|
case "$gnulib_tool_options " in
|
||||||
*' --libtool '*) ;;
|
*' --libtool '*) ;;
|
||||||
*) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
|
*) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
||||||
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
|
$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
|
||||||
|
|| die "gnulib-tool failed"
|
||||||
|
|
||||||
for file in $gnulib_files; do
|
for file in $gnulib_files; do
|
||||||
symlink_to_dir "$GNULIB_SRCDIR" $file \
|
symlink_to_dir "$GNULIB_SRCDIR" $file \
|
||||||
|| die "failed to symlink $file"
|
|| die "failed to symlink $file"
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
bootstrap_post_import_hook \
|
bootstrap_post_import_hook \
|
||||||
|| die "bootstrap_post_import_hook failed"
|
|| die "bootstrap_post_import_hook failed"
|
||||||
@@ -969,9 +1055,9 @@ bootstrap_epilogue
|
|||||||
echo "$0: done. Now you can run './configure'."
|
echo "$0: done. Now you can run './configure'."
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||||
# time-stamp-start: "scriptversion="
|
# time-stamp-start: "scriptversion="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-time-zone: "UTC"
|
# time-stamp-time-zone: "UTC0"
|
||||||
# time-stamp-end: "; # UTC"
|
# time-stamp-end: "; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|||||||
+8
-5
@@ -1,6 +1,6 @@
|
|||||||
# Bootstrap configuration.
|
# Bootstrap configuration.
|
||||||
|
|
||||||
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2006-2015, 2018 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
|
||||||
@@ -17,7 +17,8 @@
|
|||||||
|
|
||||||
# gnulib modules used by this package.
|
# gnulib modules used by this package.
|
||||||
gnulib_modules='
|
gnulib_modules='
|
||||||
argmatch assert calloc-posix close closeout config-h c-strcase
|
argmatch assert
|
||||||
|
calloc-posix close closeout config-h c-strcase
|
||||||
configmake
|
configmake
|
||||||
dirname
|
dirname
|
||||||
error extensions fdl fopen-safer
|
error extensions fdl fopen-safer
|
||||||
@@ -33,8 +34,10 @@ gnulib_modules='
|
|||||||
quote quotearg
|
quote quotearg
|
||||||
readme-release
|
readme-release
|
||||||
realloc-posix
|
realloc-posix
|
||||||
spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
|
spawn-pipe stdbool stpcpy strdup-posix strerror strverscmp
|
||||||
unistd unistd-safer unlocked-io update-copyright unsetenv verify
|
timevar
|
||||||
|
unistd unistd-safer unlink unlocked-io
|
||||||
|
update-copyright unsetenv verify
|
||||||
warnings
|
warnings
|
||||||
xalloc
|
xalloc
|
||||||
xalloc-die
|
xalloc-die
|
||||||
@@ -80,7 +83,7 @@ gnulib_tool_option_extras='--symlink --makefile-name=gnulib.mk'
|
|||||||
bootstrap_post_import_hook()
|
bootstrap_post_import_hook()
|
||||||
{
|
{
|
||||||
# Massage lib/gnulib.mk before using it later in the bootstrapping process.
|
# Massage lib/gnulib.mk before using it later in the bootstrapping process.
|
||||||
build-aux/prefix-gnulib-mk --lib-name=$gnulib_name lib/$gnulib_mk
|
build-aux/prefix-gnulib-mk --lib-name="$gnulib_name" "lib/$gnulib_mk"
|
||||||
|
|
||||||
# Ensure that ChangeLog exists, for automake.
|
# Ensure that ChangeLog exists, for automake.
|
||||||
test -f ChangeLog || touch ChangeLog
|
test -f ChangeLog || touch ChangeLog
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
/announce-gen
|
/announce-gen
|
||||||
/arg-nonnull.h
|
|
||||||
/c++defs.h
|
|
||||||
/compile
|
/compile
|
||||||
/config.guess
|
/config.guess
|
||||||
/config.rpath
|
/config.rpath
|
||||||
@@ -16,14 +14,12 @@
|
|||||||
/install-sh
|
/install-sh
|
||||||
/javacomp.sh.in
|
/javacomp.sh.in
|
||||||
/javaexec.sh.in
|
/javaexec.sh.in
|
||||||
/link-warning.h
|
|
||||||
/mdate-sh
|
/mdate-sh
|
||||||
/missing
|
/missing
|
||||||
|
/prefix-gnulib-mk
|
||||||
/test-driver
|
/test-driver
|
||||||
/texinfo.tex
|
/texinfo.tex
|
||||||
/update-copyright
|
/update-copyright
|
||||||
/useless-if-before-free
|
/useless-if-before-free
|
||||||
/vc-list-files
|
/vc-list-files
|
||||||
/warn-on-use.h
|
|
||||||
/ylwrap
|
/ylwrap
|
||||||
/prefix-gnulib-mk
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2012-2015, 2018 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
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
# Copyright (C) 2012-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Valgrind suppression file for Bison.
|
||||||
|
|
||||||
|
# Travis Trusty, 2018-09-07.
|
||||||
|
{
|
||||||
|
libstdcxx_init
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: reachable
|
||||||
|
fun:malloc
|
||||||
|
obj:/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
|
||||||
|
fun:call_init.part.0
|
||||||
|
fun:call_init
|
||||||
|
fun:_dl_init
|
||||||
|
obj:/lib/x86_64-linux-gnu/ld-2.19.so
|
||||||
|
}
|
||||||
|
|
||||||
|
# Linux prague 4.1.2-2-ARCH #1 SMP PREEMPT Wed Jul 15 08:30:32 UTC 2015
|
||||||
|
# x86_64 GNU/Linux
|
||||||
|
{
|
||||||
|
Probably exception handling from G++ 5.1.
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: reachable
|
||||||
|
fun:malloc
|
||||||
|
fun:pool
|
||||||
|
fun:__static_initialization_and_destruction_0
|
||||||
|
fun:_GLOBAL__sub_I_eh_alloc.cc
|
||||||
|
fun:call_init.part.0
|
||||||
|
fun:_dl_init
|
||||||
|
obj:/usr/lib/ld-2.21.so
|
||||||
|
}
|
||||||
|
|
||||||
|
# Linux seattle 2.6.32-5-amd64 #1 SMP Thu Mar 22 17:26:33 UTC 2012
|
||||||
|
# x86_64 GNU/Linux
|
||||||
|
{
|
||||||
|
index
|
||||||
|
Memcheck:Cond
|
||||||
|
fun:index
|
||||||
|
fun:expand_dynamic_string_token
|
||||||
|
fun:_dl_map_object
|
||||||
|
fun:map_doit
|
||||||
|
fun:_dl_catch_error
|
||||||
|
fun:do_preload
|
||||||
|
fun:dl_main
|
||||||
|
fun:_dl_sysdep_start
|
||||||
|
fun:_dl_start
|
||||||
|
obj:/lib/ld-2.11.3.so
|
||||||
|
}
|
||||||
@@ -35,7 +35,7 @@ while (<STDIN>)
|
|||||||
$arg =~ s/^=//;
|
$arg =~ s/^=//;
|
||||||
$arg = lc ($arg);
|
$arg = lc ($arg);
|
||||||
my $dir_arg = $arg;
|
my $dir_arg = $arg;
|
||||||
# If the argument is compite (e.g., for --define[=NAME[=VALUE]]),
|
# If the argument is complete (e.g., for --define[=NAME[=VALUE]]),
|
||||||
# put each word in @var, to build @var{name}[=@var{value}], not
|
# put each word in @var, to build @var{name}[=@var{value}], not
|
||||||
# @var{name[=value]}].
|
# @var{name[=value]}].
|
||||||
$arg =~ s/(\w+)/\@var{$1}/g;
|
$arg =~ s/(\w+)/\@var{$1}/g;
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
# option. It specifies what changes to make to each given SHA1's commit
|
# option. It specifies what changes to make to each given SHA1's commit
|
||||||
# log and metadata, using Perl-eval'able expressions.
|
# log and metadata, using Perl-eval'able expressions.
|
||||||
|
|
||||||
|
975bb564319aa4f4204c48aba265757ba207a80f
|
||||||
|
s/Edligner/Edlinger/;
|
||||||
|
|
||||||
0db2648930e3b6c376a539aabe368aade83ee29a
|
0db2648930e3b6c376a539aabe368aade83ee29a
|
||||||
s/--flags/--feature/;
|
s/--flags/--feature/;
|
||||||
s/flag_flag/feature_flag/;
|
s/flag_flag/feature_flag/;
|
||||||
|
|||||||
Executable
+234
@@ -0,0 +1,234 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Install Intel Parallel Studio on Travis CI
|
||||||
|
# https://github.com/nemequ/icc-travis
|
||||||
|
#
|
||||||
|
# Originally written for Squash <https://github.com/quixdb/squash> by
|
||||||
|
# Evan Nemerson. For documentation, bug reports, support requests,
|
||||||
|
# etc. please use <https://github.com/nemequ/icc-travis>.
|
||||||
|
#
|
||||||
|
# To the extent possible under law, the author(s) of this script have
|
||||||
|
# waived all copyright and related or neighboring rights to this work.
|
||||||
|
# See <https://creativecommons.org/publicdomain/zero/1.0/> for
|
||||||
|
# details.
|
||||||
|
|
||||||
|
# Tools - Not very useful in non-interactive mode.
|
||||||
|
COMPONENTS_VTUNE="intel-vtune-amplifier-xe-2016-cli__x86_64;intel-vtune-amplifier-xe-2016-common__noarch;intel-vtune-amplifier-xe-2016-cli-common__noarch;intel-vtune-amplifier-xe-2016-collector-64linux__x86_64;intel-vtune-amplifier-xe-2016-sep__noarch;intel-vtune-amplifier-xe-2016-gui-common__noarch;intel-vtune-amplifier-xe-2016-gui__x86_64;intel-vtune-amplifier-xe-2016-common-pset__noarch"
|
||||||
|
COMPONENTS_INSPECTOR="intel-inspector-xe-2016-cli__x86_64;intel-inspector-xe-2016-cli-common__noarch;intel-inspector-xe-2016-gui-common__noarch;intel-inspector-xe-2016-gui__x86_64;intel-inspector-xe-2016-cli-pset__noarch"
|
||||||
|
COMPONENTS_ADVISOR="intel-advisor-xe-2016-cli__x86_64;intel-advisor-xe-2016-cli-common__noarch;intel-advisor-xe-2016-gui-common__noarch;intel-advisor-xe-2016-gui__x86_64;intel-advisor-xe-2016-cli-pset__noarch"
|
||||||
|
COMPONENTS_GDB="intel-gdb-gt__x86_64;intel-gdb-gt-src__noarch;intel-gdb-gt-libelfdwarf__x86_64;intel-gdb-gt-devel__x86_64;intel-gdb-gt-common__noarch;intel-gdb-ps-cdt__x86_64;intel-gdb-ps-cdt-source__x86_64;intel-gdb-ps-mic__x86_64;intel-gdb-ps-mpm__x86_64;intel-gdb__x86_64;intel-gdb-source__noarch;intel-gdb-python-source__noarch;intel-gdb-common__noarch;intel-gdb-ps-common__noarch"
|
||||||
|
|
||||||
|
# Parallel libraries
|
||||||
|
COMPONENTS_MPI="intel-mpi-rt-core__x86_64;intel-mpi-rt-mic__x86_64;intel-mpi-sdk-core__x86_64;intel-mpi-sdk-mic__x86_64;intel-mpi-psxe__x86_64;intel-mpi-rt-psxe__x86_64"
|
||||||
|
COMPONENTS_TBB="intel-tbb-libs__noarch;intel-mkl-ps-tbb__x86_64;intel-mkl-ps-tbb-devel__x86_64;intel-mkl-ps-tbb-mic__x86_64;intel-mkl-ps-tbb-mic-devel__x86_64;intel-tbb-source__noarch;intel-tbb-devel__noarch;intel-tbb-common__noarch;intel-tbb-ps-common__noarch;intel-tbb-psxe__noarch"
|
||||||
|
COMPONENTS_MKL="intel-mkl__x86_64;intel-mkl-ps__x86_64;intel-mkl-common__noarch;intel-mkl-ps-common__noarch;intel-mkl-devel__x86_64;intel-mkl-ps-mic-devel__x86_64;intel-mkl-ps-f95-devel__x86_64;intel-mkl-gnu-devel__x86_64;intel-mkl-ps-gnu-devel__x86_64;intel-mkl-ps-pgi-devel__x86_64;intel-mkl-sp2dp-devel__x86_64;intel-mkl-ps-cluster-devel__x86_64;intel-mkl-ps-cluster-common__noarch;intel-mkl-ps-f95-common__noarch;intel-mkl-ps-cluster__x86_64;intel-mkl-gnu__x86_64;intel-mkl-ps-gnu__x86_64;intel-mkl-ps-pgi__x86_64;intel-mkl-sp2dp__x86_64;intel-mkl-ps-mic__x86_64;intel-mkl-ps-tbb__x86_64;intel-mkl-ps-tbb-devel__x86_64;intel-mkl-ps-tbb-mic__x86_64;intel-mkl-ps-tbb-mic-devel__x86_64;intel-mkl-psxe__noarch"
|
||||||
|
COMPONENTS_IPP="intel-ipp-l-common__noarch;intel-ipp-l-ps-common__noarch;intel-ipp-l-st__x86_64;intel-ipp-l-mt__x86_64;intel-ipp-l-st-devel__x86_64;intel-ipp-l-ps-st-devel__x86_64;intel-ipp-l-mt-devel__x86_64;intel-ipp-psxe__noarch"
|
||||||
|
COMPONENTS_IPP_CRYPTO="intel-crypto-ipp-st-devel__x86_64;intel-crypto-ipp-ps-st-devel__x86_64;intel-crypto-ipp-st__x86_64;intel-crypto-ipp-mt-devel__x86_64;intel-crypto-ipp-mt__x86_64;intel-crypto-ipp-ss-st-devel__x86_64;intel-crypto-ipp-common__noarch"
|
||||||
|
COMPONENTS_DAAL="intel-daal__x86_64;intel-daal-common__noarch"
|
||||||
|
|
||||||
|
# Compilers
|
||||||
|
COMPONENTS_OPENMP="intel-openmp-l-all__x86_64;intel-openmp-l-ps-mic__x86_64;intel-openmp-l-ps__x86_64;intel-openmp-l-ps-ss__x86_64;intel-openmp-l-all-devel__x86_64;intel-openmp-l-ps-mic-devel__x86_64;intel-openmp-l-ps-devel__x86_64;intel-openmp-l-ps-ss-devel__x86_64"
|
||||||
|
COMPONENTS_COMPILER_COMMON="intel-comp-l-all-vars__noarch;intel-comp-l-all-common;intel-comp-l-ps-common;intel-comp-l-all-devel;intel-comp-l-ps-ss-devel;intel-comp-l-ps-ss-wrapper;intel-comp-l-all-devel;intel-comp-l-ps-devel__x86_64;intel-comp-l-ps-ss-devel__x86_64;intel-psf-intel__x86_64;intel-icsxe-pset;intel-ipsf__noarch;intel-ccompxe__noarch;${COMPONENTS_OPENMP}"
|
||||||
|
COMPONENTS_IFORT="intel-ifort-l-ps__x86_64;intel-ifort-l-ps-vars__noarch;intel-ifort-l-ps-common__noarch;intel-ifort-l-ps-devel__x86_64;${COMPONENTS_COMPILER_COMMON}"
|
||||||
|
COMPONENTS_ICC="intel-icc-l-all__x86_64;intel-icc-l-ps-ss__x86_64;intel-icc-l-all-vars__noarch;intel-icc-l-all-common__noarch;intel-icc-l-ps-common__noarch;intel-icc-l-all-devel__x86_64;intel-icc-l-ps-devel__x86_64;intel-icc-l-ps-ss-devel__x86_64;${COMPONENTS_COMPILER_COMMON}"
|
||||||
|
|
||||||
|
DESTINATION="${HOME}/intel"
|
||||||
|
TEMPORARY_FILES="/tmp"
|
||||||
|
PHONE_INTEL="no"
|
||||||
|
COMPONENTS=""
|
||||||
|
|
||||||
|
add_components() {
|
||||||
|
if [ ! -z "${COMPONENTS}" ]; then
|
||||||
|
COMPONENTS="${COMPONENTS};$1"
|
||||||
|
else
|
||||||
|
COMPONENTS="$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
while [ $# != 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
"--dest")
|
||||||
|
DESTINATION="$(realpath "$2")"; shift
|
||||||
|
;;
|
||||||
|
"--tmpdir")
|
||||||
|
TEMPORARY_FILES="$2"; shift
|
||||||
|
;;
|
||||||
|
"--components")
|
||||||
|
shift
|
||||||
|
OLD_IFS="${IFS}"
|
||||||
|
IFS=","
|
||||||
|
for component in $1; do
|
||||||
|
case "$component" in
|
||||||
|
"icc")
|
||||||
|
add_components "${COMPONENTS_ICC}"
|
||||||
|
;;
|
||||||
|
"mpi")
|
||||||
|
add_components "${COMPONENTS_MPI}"
|
||||||
|
;;
|
||||||
|
"vtune")
|
||||||
|
add_components "${COMPONENTS_VTUNE}"
|
||||||
|
;;
|
||||||
|
"inspector")
|
||||||
|
add_components "${COMPONENTS_INSPECTOR}"
|
||||||
|
;;
|
||||||
|
"advisor")
|
||||||
|
add_components "${COMPONENTS_ADVISOR}"
|
||||||
|
;;
|
||||||
|
"tbb")
|
||||||
|
add_components "${COMPONENTS_TBB}"
|
||||||
|
;;
|
||||||
|
"ifort")
|
||||||
|
add_components "${COMPONENTS_IFORT}"
|
||||||
|
;;
|
||||||
|
"mkl")
|
||||||
|
add_components "${COMPONENTS_MKL}"
|
||||||
|
;;
|
||||||
|
"openmp")
|
||||||
|
# Noop, here for compatability. OpenMP is installed with icc and ifort now.
|
||||||
|
;;
|
||||||
|
"ipp")
|
||||||
|
add_components "${COMPONENTS_IPP}"
|
||||||
|
;;
|
||||||
|
"ipp-crypto")
|
||||||
|
add_components "${COMPONENTS_IPP_CRYPTO}"
|
||||||
|
;;
|
||||||
|
"gdb")
|
||||||
|
add_components "${COMPONENTS_GDB}"
|
||||||
|
;;
|
||||||
|
"daal")
|
||||||
|
add_components "${COMPONENTS_DAAL}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown component '$component'"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
IFS="${OLD_IFS}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unrecognized argument '$1'"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "${COMPONENTS}" ]; then
|
||||||
|
COMPONENTS="${COMPONENTS_ICC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
INSTALLER_SCRIPT="parallel_studio_xe_2016_update3_online.sh"
|
||||||
|
INSTALLER="${TEMPORARY_FILES}/${INSTALLER_SCRIPT}"
|
||||||
|
INSTALLER_URL="http://registrationcenter-download.intel.com/akdlm/irc_nas/9061/${INSTALLER_SCRIPT}"
|
||||||
|
SILENT_CFG="${TEMPORARY_FILES}/silent.cfg"
|
||||||
|
SUCCESS_INDICATOR="${TEMPORARY_FILES}/icc-travis-success"
|
||||||
|
|
||||||
|
if [ ! -e "${TEMPORARY_FILES}" ]; then
|
||||||
|
echo "${TEMPORARY_FILES} does not exist, creating..."
|
||||||
|
mkdir -p "${TEMPORARY_FILES}" || (sudo mkdir -p "${TEMPORARY_FILES}" && sudo chown -R "${USER}:${USER}" "${TEMPORARY_FILES}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "${DESTINATION}" ]; then
|
||||||
|
echo "${DESTINATION} does not exist, creating..."
|
||||||
|
mkdir -p "${DESTINATION}" || (sudo mkdir -p "${DESTINATION}" && sudo chown -R "${USER}:${USER}" "${DESTINATION}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "${INSTALLER}" ]; then
|
||||||
|
wget -O "${INSTALLER}" "${INSTALLER_URL}" || exit 1
|
||||||
|
fi
|
||||||
|
chmod u+x "${INSTALLER}"
|
||||||
|
|
||||||
|
# See https://software.intel.com/en-us/articles/intel-composer-xe-2015-silent-installation-guide
|
||||||
|
echo "# Generated silent configuration file" > "${SILENT_CFG}"
|
||||||
|
echo "ACCEPT_EULA=accept" >> "${SILENT_CFG}"
|
||||||
|
echo "INSTALL_MODE=NONRPM" >> "${SILENT_CFG}"
|
||||||
|
echo "CONTINUE_WITH_OPTIONAL_ERROR=yes" >> "${SILENT_CFG}"
|
||||||
|
echo "PSET_INSTALL_DIR=${DESTINATION}" >> "${SILENT_CFG}"
|
||||||
|
echo "CONTINUE_WITH_INSTALLDIR_OVERWRITE=yes" >> "${SILENT_CFG}"
|
||||||
|
echo "COMPONENTS=${COMPONENTS}" >> "${SILENT_CFG}"
|
||||||
|
echo "PSET_MODE=install" >> "${SILENT_CFG}"
|
||||||
|
echo "PHONEHOME_SEND_USAGE_DATA=${PHONE_INTEL}" >> "${SILENT_CFG}"
|
||||||
|
if [ "x" != "x${INTEL_SERIAL_NUMBER}" ]; then
|
||||||
|
echo "ACTIVATION_SERIAL_NUMBER=${INTEL_SERIAL_NUMBER}" >> "${SILENT_CFG}"
|
||||||
|
echo "ACTIVATION_TYPE=serial_number" >> "${SILENT_CFG}"
|
||||||
|
else
|
||||||
|
echo "ACTIVATION_TYPE=trial_lic" >> "${SILENT_CFG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
attempt=1;
|
||||||
|
while [ $attempt -le 3 ]; do
|
||||||
|
if [ ! -e "${TEMPORARY_FILES}/parallel-studio-install-data" ]; then
|
||||||
|
mkdir -p "${TEMPORARY_FILES}/parallel-studio-install-data" || (sudo mkdir -p "${TEMPORARY_FILES}/parallel-studio-install-data" && sudo chown -R "${USER}:${USER}" "${TEMPORARY_FILES}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
("${INSTALLER}" \
|
||||||
|
-t "${TEMPORARY_FILES}/parallel-studio-install-data" \
|
||||||
|
-s "${SILENT_CFG}" \
|
||||||
|
--cli-mode \
|
||||||
|
--user-mode && \
|
||||||
|
touch "${SUCCESS_INDICATOR}") &
|
||||||
|
|
||||||
|
# So Travis doesn't die in case of a long download/installation.
|
||||||
|
#
|
||||||
|
# NOTE: a watched script never terminates.
|
||||||
|
elapsed=0;
|
||||||
|
while kill -0 $! 2>/dev/null; do
|
||||||
|
sleep 1
|
||||||
|
elapsed=$(expr $elapsed + 1)
|
||||||
|
if [ $(expr $elapsed % 60) -eq 0 ]; then
|
||||||
|
mins_elapsed=$(expr $elapsed / 60)
|
||||||
|
if [ $mins_elapsed = 1 ]; then
|
||||||
|
minute_string="minute"
|
||||||
|
else
|
||||||
|
minute_string="minutes"
|
||||||
|
fi
|
||||||
|
echo "Still running... (about $(expr $elapsed / 60) ${minute_string} so far)."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -e "${SUCCESS_INDICATOR}" ]; then
|
||||||
|
echo "Installation failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "${DESTINATION}/bin/compilervars.sh" ]; then
|
||||||
|
# Sometimes the installer returns successfully without actually
|
||||||
|
# installing anything. Let's try again…
|
||||||
|
echo "Installation attempt #${attempt} completed, but unable to find compilervars.sh."
|
||||||
|
find "${DESTINATION}"
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -vrf "${TEMPORARY_FILES}/parallel-studio-install-data"
|
||||||
|
echo "Trying again..."
|
||||||
|
|
||||||
|
attempt=$(expr $attempt + 1)
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -e "${DESTINATION}/bin/compilervars.sh" ]; then
|
||||||
|
echo "Installation failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Apparently the installer drops the license file in a location it
|
||||||
|
# doesn't know to check.
|
||||||
|
ln -s "${DESTINATION}"/licenses ~/Licenses
|
||||||
|
|
||||||
|
# Add configuration information to ~/.bashrc. Unfortunately this will
|
||||||
|
# not be picked up automatically by Travis, so you'll still need to
|
||||||
|
# source ~/.bashrc in your .travis.yml
|
||||||
|
#
|
||||||
|
# Container-based builds include a `[ -z "$PS1" ] && return` near the
|
||||||
|
# beginning of the file, so appending won't work, we'll need to
|
||||||
|
# prepend.
|
||||||
|
echo "export INTEL_INSTALL_PATH=\"${DESTINATION}\"" >> ~/.bashrc-intel
|
||||||
|
echo ". \"\${INTEL_INSTALL_PATH}/bin/compilervars.sh\" intel64" >> ~/.bashrc-intel
|
||||||
|
echo "export LD_LIBRARY_PATH=\"\${INTEL_INSTALL_PATH}/ism/bin/intel64:\${INTEL_INSTALL_PATH}/lib/intel64_lin:\$LD_LIBRARY_PATH\"" >> ~/.bashrc-intel
|
||||||
|
echo "export PATH=\"\${INTEL_INSTALL_PATH}/bin:\$PATH\"" >> ~/.bashrc-intel
|
||||||
|
echo "function uninstall_intel_software {" >> ~/.bashrc-intel
|
||||||
|
echo " find \"\${INTEL_INSTALL_PATH}\" -name 'uninstall.sh' -not -path '*/ism/uninstall.sh' -exec {} -s \;" >> ~/.bashrc-intel
|
||||||
|
echo "}" >> ~/.bashrc-intel
|
||||||
|
cat ~/.bashrc >> ~/.bashrc-intel
|
||||||
|
mv ~/.bashrc-intel ~/.bashrc
|
||||||
+20
-21
@@ -1,23 +1,22 @@
|
|||||||
## Makefile for Bison testsuite.
|
## Copyright (C) 2000-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
##
|
||||||
|
## This program is free software: you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
EXTRA_DIST += \
|
||||||
#
|
build-aux/Darwin.valgrind \
|
||||||
# This program is free software: you can redistribute it and/or modify
|
build-aux/Linux.valgrind \
|
||||||
# it under the terms of the GNU General Public License as published by
|
build-aux/cross-options.pl \
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
build-aux/move-if-change \
|
||||||
# (at your option) any later version.
|
build-aux/prev-version.txt \
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
EXTRA_DIST += \
|
|
||||||
build-aux/cross-options.pl \
|
|
||||||
build-aux/darwin11.4.0.valgrind \
|
|
||||||
build-aux/move-if-change \
|
|
||||||
build-aux/prev-version.txt \
|
|
||||||
build-aux/update-b4-copyright
|
build-aux/update-b4-copyright
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
/_Noreturn.h
|
|
||||||
/arg-nonnull.h
|
|
||||||
/c++defs.h
|
|
||||||
/warn-on-use.h
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
# Update b4_copyright invocations or b4_copyright_years definitions to
|
# Update b4_copyright invocations or b4_copyright_years definitions to
|
||||||
# include the current year.
|
# include the current year.
|
||||||
|
|
||||||
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2009-2015, 2018 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
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
||||||
|
|
||||||
# Copyright (C) 2010-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2010-2015, 2018 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
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# Customize maint.mk -*- makefile -*-
|
## Customize maint.mk -*- makefile -*-
|
||||||
# Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2008-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
## This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
## it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
## (at your option) any later version.
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
## This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
## GNU General Public License for more details.
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
## You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Update version, then recompile so that tests/bison --version be
|
# Update version, then recompile so that tests/bison --version be
|
||||||
# up-to-date, then compile our parser again with our up-to-date bison.
|
# up-to-date, then compile our parser again with our up-to-date bison.
|
||||||
@@ -26,15 +26,15 @@ regen: _version
|
|||||||
manual_title = The Yacc-compatible Parser Generator
|
manual_title = The Yacc-compatible Parser Generator
|
||||||
gendocs_options_ = -I $(abs_top_srcdir)/doc -I $(abs_top_builddir)/doc
|
gendocs_options_ = -I $(abs_top_srcdir)/doc -I $(abs_top_builddir)/doc
|
||||||
|
|
||||||
# It's useful to run maintainer-*check* targets during development, but we
|
# It's useful to run maintainer-check* targets during development, but we
|
||||||
# don't want to wait on a recompile because of an update to $(VERSION). Thus,
|
# don't want to wait on a recompile because of an update to $(VERSION). Thus,
|
||||||
# override the _is-dist-target from GNUmakefile so that maintainer-*check*
|
# override the _is-dist-target from GNUmakefile so that maintainer-check*
|
||||||
# targets are filtered out.
|
# targets are filtered out.
|
||||||
_is-dist-target = $(filter-out %clean maintainer-check% maintainer-%-check, \
|
_is-dist-target = $(filter-out %clean maintainer-check%, \
|
||||||
$(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS)))
|
$(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS)))
|
||||||
|
|
||||||
url_dir_list = \
|
url_dir_list = \
|
||||||
ftp://$(gnu_rel_host)/gnu/bison
|
https://$(gnu_rel_host)/gnu/bison
|
||||||
|
|
||||||
# Tests not to run as part of "make distcheck".
|
# Tests not to run as part of "make distcheck".
|
||||||
local-checks-to-skip = \
|
local-checks-to-skip = \
|
||||||
@@ -135,7 +135,7 @@ _sed_rm_comments_q = $(subst ','\'',$(_sed_remove_comments))
|
|||||||
|
|
||||||
_space_before_paren_exempt =? \\n\\$$
|
_space_before_paren_exempt =? \\n\\$$
|
||||||
_space_before_paren_exempt = \
|
_space_before_paren_exempt = \
|
||||||
(^ *\#|\\n\\$$|%s\(to %s|(date|group|character)\(s\))
|
(^ *\#|(LA)?LR\([01]\)|percent_(code|define)|b4_syncline|m4_(define|init)|symbol)
|
||||||
# Ensure that there is a space before each open parenthesis in C code.
|
# Ensure that there is a space before each open parenthesis in C code.
|
||||||
sc_space_before_open_paren:
|
sc_space_before_open_paren:
|
||||||
@if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \
|
@if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \
|
||||||
@@ -158,22 +158,21 @@ sc_space_before_open_paren:
|
|||||||
|
|
||||||
exclude = \
|
exclude = \
|
||||||
$(foreach a,$(1),$(eval $(subst $$,$$$$,exclude_file_name_regexp--sc_$(a))))
|
$(foreach a,$(1),$(eval $(subst $$,$$$$,exclude_file_name_regexp--sc_$(a))))
|
||||||
$(call exclude, \
|
$(call exclude, \
|
||||||
bindtextdomain=^lib/main.c$$ \
|
bindtextdomain=^lib/main.c$$ \
|
||||||
preprocessor_indentation=^data/|^lib/|^src/parse-gram.[ch]$$ \
|
preprocessor_indentation=^data/|^lib/|^src/parse-gram.[ch]$$ \
|
||||||
program_name=^lib/main.c$$ \
|
program_name=^lib/main.c$$ \
|
||||||
prohibit_always-defined_macros=^data/yacc.c$$|^djgpp/ \
|
prohibit_always-defined_macros=^data/yacc.c$$|^djgpp/ \
|
||||||
prohibit_always-defined_macros+=?|^lib/timevar.c$$ \
|
prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \
|
||||||
prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \
|
prohibit_always-defined_macros+=?|^tests/regression.at$$ \
|
||||||
prohibit_always-defined_macros+=?|^tests/regression.at$$ \
|
prohibit_always_true_header_tests=^djgpp/subpipe.h$$ \
|
||||||
prohibit_always_true_header_tests=^djgpp/subpipe.h$$|^lib/timevar.c$$ \
|
prohibit_doubled_word=^tests/named-refs.at$$ \
|
||||||
prohibit_always_true_header_tests+=?|^m4/timevar.m4$$ \
|
prohibit_magic_number_exit=^doc/bison.texi$$ \
|
||||||
prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \
|
prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
|
||||||
prohibit_doubled_word=^tests/named-refs.at$$ \
|
prohibit_strcmp=^doc/bison\.texi|tests/local\.at$$ \
|
||||||
prohibit_magic_number_exit=^doc/bison.texi$$ \
|
prohibit_tab_based_indentation=install-icc.sh|\.(am|mk)$$|^djgpp/|^\.git|Makefile$$ \
|
||||||
prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
|
require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \
|
||||||
prohibit_strcmp=^doc/bison\.texi|tests/local\.at$$ \
|
space_before_open_paren=^(data/|djgpp/) \
|
||||||
prohibit_tab_based_indentation=\.(am|mk)$$|^djgpp/|^\.git \
|
two_space_separator_in_usage=^(bootstrap|build-aux/install-icc.sh) \
|
||||||
require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \
|
unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \
|
||||||
unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \
|
|
||||||
)
|
)
|
||||||
|
|||||||
+63
-35
@@ -1,6 +1,6 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2001-2015, 2018 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
|
||||||
@@ -18,26 +18,23 @@
|
|||||||
# In order for some versions of Sun Studio to compile our C++ test cases
|
# In order for some versions of Sun Studio to compile our C++ test cases
|
||||||
# correctly, we need Autoconf 2.64 or better to handle the restrict
|
# correctly, we need Autoconf 2.64 or better to handle the restrict
|
||||||
# keyword in at least string.h from gnulib. We need Autoconf 2.68 or
|
# keyword in at least string.h from gnulib. We need Autoconf 2.68 or
|
||||||
# better to avoid a typo in the `configure --help' entry for the YACC
|
# better to avoid a typo in the 'configure --help' entry for the YACC
|
||||||
# environment variable.
|
# environment variable.
|
||||||
AC_PREREQ([2.68])
|
AC_PREREQ([2.68])
|
||||||
m4_pattern_forbid([^gl_[A-Z]])
|
m4_pattern_forbid([^_?(gl_[A-Z]|AX_|BISON_)])
|
||||||
|
m4_pattern_allow([^BISON_USE_NLS$])
|
||||||
|
|
||||||
AC_INIT([GNU Bison],
|
AC_INIT([GNU Bison],
|
||||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||||
[[email protected]])
|
[[email protected]])
|
||||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2013])
|
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2018])
|
||||||
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
||||||
[The copyright year for this package])
|
[The copyright year for this package])
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here:
|
# We use Automake 1.14's %D% and %C%.
|
||||||
#
|
|
||||||
# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131
|
|
||||||
#
|
|
||||||
# To avoid 1.11, we make 1.11.1 the minimum version.
|
|
||||||
#
|
#
|
||||||
# We want gnits strictness only when rolling a stable release. For
|
# We want gnits strictness only when rolling a stable release. For
|
||||||
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
||||||
@@ -45,7 +42,7 @@ AC_CONFIG_MACRO_DIR([m4])
|
|||||||
# releases, we want to be able run make dist without being required to
|
# releases, we want to be able run make dist without being required to
|
||||||
# add a bogus NEWS entry. In that case, the version string
|
# add a bogus NEWS entry. In that case, the version string
|
||||||
# automatically contains a dash, which we also let disable gnits.
|
# automatically contains a dash, which we also let disable gnits.
|
||||||
AM_INIT_AUTOMAKE([1.11.1 dist-xz nostdinc
|
AM_INIT_AUTOMAKE([1.14 dist-xz nostdinc
|
||||||
color-tests parallel-tests
|
color-tests parallel-tests
|
||||||
silent-rules]
|
silent-rules]
|
||||||
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
||||||
@@ -74,16 +71,32 @@ AC_CACHE_CHECK([whether pragma GCC diagnostic push works],
|
|||||||
[lv_cv_gcc_pragma_push_works=no])
|
[lv_cv_gcc_pragma_push_works=no])
|
||||||
CFLAGS=$save_CFLAGS])
|
CFLAGS=$save_CFLAGS])
|
||||||
|
|
||||||
|
AC_LANG_PUSH([C++])
|
||||||
|
gl_WARN_ADD([-fno-exceptions], [NO_EXCEPTIONS_CXXFLAGS])
|
||||||
|
BISON_CXXSTD([98])
|
||||||
|
BISON_CXXSTD([03])
|
||||||
|
BISON_CXXSTD([11])
|
||||||
|
BISON_CXXSTD([14])
|
||||||
|
BISON_CXXSTD([17])
|
||||||
|
BISON_CXXSTD([2a])
|
||||||
|
AM_CONDITIONAL([ENABLE_CXX11], [test x"$CXX11_CXXFLAGS" != x])
|
||||||
|
AM_CONDITIONAL([ENABLE_CXX14], [test x"$CXX14_CXXFLAGS" != x])
|
||||||
|
AC_LANG_POP([C++])
|
||||||
|
|
||||||
AC_ARG_ENABLE([gcc-warnings],
|
AC_ARG_ENABLE([gcc-warnings],
|
||||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended).
|
||||||
|
Also, issue synclines from the examples/ to
|
||||||
|
the corresponding source in the Texinfo doc.],
|
||||||
[case $enable_gcc_warnings in
|
[case $enable_gcc_warnings in
|
||||||
yes|no) ;;
|
yes|no) ;;
|
||||||
*) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);;
|
*) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);;
|
||||||
esac],
|
esac],
|
||||||
[enable_gcc_warnings=no])
|
[enable_gcc_warnings=no])
|
||||||
|
AM_CONDITIONAL([ENABLE_GCC_WARNINGS], [test "$enable_gcc_warnings" = yes])
|
||||||
if test "$enable_gcc_warnings" = yes; then
|
if test "$enable_gcc_warnings" = yes; then
|
||||||
warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align
|
warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align
|
||||||
-Wformat -Wpointer-arith -Wwrite-strings'
|
-fparse-all-comments -Wdocumentation
|
||||||
|
-Wformat -Wnull-dereference -Wpointer-arith -Wwrite-strings'
|
||||||
warn_c='-Wbad-function-cast -Wshadow -Wstrict-prototypes'
|
warn_c='-Wbad-function-cast -Wshadow -Wstrict-prototypes'
|
||||||
warn_cxx='-Wnoexcept'
|
warn_cxx='-Wnoexcept'
|
||||||
# Warnings for the test suite only.
|
# Warnings for the test suite only.
|
||||||
@@ -91,7 +104,14 @@ if test "$enable_gcc_warnings" = yes; then
|
|||||||
# -fno-color-diagnostics: Clang's use of colors in the error
|
# -fno-color-diagnostics: Clang's use of colors in the error
|
||||||
# messages is confusing the tests looking at the compiler's output
|
# messages is confusing the tests looking at the compiler's output
|
||||||
# (e.g., synclines.at).
|
# (e.g., synclines.at).
|
||||||
warn_tests='-Wundef -pedantic -fno-color-diagnostics'
|
#
|
||||||
|
# -Wno-keyword-macro: We use the "#define private public" dirty
|
||||||
|
# trick in the test suite to check some private implementation
|
||||||
|
# details for lalr1.cc.
|
||||||
|
warn_tests='-Wundef -pedantic -Wconversion
|
||||||
|
-Wdeprecated -Wsign-compare -Wsign-conversion
|
||||||
|
-fno-color-diagnostics
|
||||||
|
-Wno-keyword-macro'
|
||||||
|
|
||||||
AC_LANG_PUSH([C])
|
AC_LANG_PUSH([C])
|
||||||
# Clang supports many of GCC's -W options, but only issues warnings
|
# Clang supports many of GCC's -W options, but only issues warnings
|
||||||
@@ -120,7 +140,7 @@ if test "$enable_gcc_warnings" = yes; then
|
|||||||
AS_VAR_APPEND([WARN_CFLAGS], [" $WARN_CFLAGS_TEST"])
|
AS_VAR_APPEND([WARN_CFLAGS], [" $WARN_CFLAGS_TEST"])
|
||||||
|
|
||||||
# Warnings for the test suite only.
|
# Warnings for the test suite only.
|
||||||
for i in $warn_tests;
|
for i in $warn_tests -Wincompatible-pointer-types;
|
||||||
do
|
do
|
||||||
gl_WARN_ADD([$i], [WARN_CFLAGS_TEST])
|
gl_WARN_ADD([$i], [WARN_CFLAGS_TEST])
|
||||||
done
|
done
|
||||||
@@ -142,14 +162,15 @@ if test "$enable_gcc_warnings" = yes; then
|
|||||||
do
|
do
|
||||||
gl_WARN_ADD([$i], [WARN_CXXFLAGS_TEST])
|
gl_WARN_ADD([$i], [WARN_CXXFLAGS_TEST])
|
||||||
done
|
done
|
||||||
# Clang++ 3.2+ reject C code generated by Flex.
|
# Too many compilers complain about Flex generated code.
|
||||||
gl_WARN_ADD([-Wno-null-conversion], [WARN_NO_NULL_CONVERSION_CXXFLAGS])
|
gl_WARN_ADD([-Wno-error], [FLEX_SCANNER_CXXFLAGS])
|
||||||
# Variants break strict aliasing analysis.
|
# Clang++ deprecates compiling C.
|
||||||
gl_WARN_ADD([-fno-strict-aliasing], [NO_STRICT_ALIAS_CXXFLAGS])
|
gl_WARN_ADD([-Wno-deprecated], [WNO_DEPRECATED_CXXFLAGS])
|
||||||
CXXFLAGS=$save_CXXFLAGS
|
CXXFLAGS=$save_CXXFLAGS
|
||||||
AC_LANG_POP([C++])
|
AC_LANG_POP([C++])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
BISON_TEST_FOR_WORKING_C_COMPILER
|
BISON_TEST_FOR_WORKING_C_COMPILER
|
||||||
BISON_C_COMPILER_POSIXLY_CORRECT
|
BISON_C_COMPILER_POSIXLY_CORRECT
|
||||||
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
||||||
@@ -159,21 +180,17 @@ 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])],
|
||||||
, [enable_yacc=yes])
|
, [enable_yacc=yes])
|
||||||
case $enable_yacc in
|
AM_CONDITIONAL([ENABLE_YACC], [test "$enable_yacc" = yes])
|
||||||
yes)
|
|
||||||
YACC_SCRIPT=src/yacc
|
|
||||||
YACC_LIBRARY=lib/liby.a;;
|
|
||||||
*)
|
|
||||||
YACC_SCRIPT=
|
|
||||||
YACC_LIBRARY=;;
|
|
||||||
esac
|
|
||||||
AC_SUBST([YACC_SCRIPT])
|
|
||||||
AC_SUBST([YACC_LIBRARY])
|
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AM_MISSING_PROG([DOT], [dot])
|
AM_MISSING_PROG([DOT], [dot])
|
||||||
AC_PROG_LEX
|
AC_PROG_LEX
|
||||||
$LEX_IS_FLEX || AC_MSG_ERROR([Flex is required])
|
$LEX_IS_FLEX || test "X$LEX" = X: || {
|
||||||
|
AC_MSG_WARN([bypassing lex because flex is required])
|
||||||
|
LEX=:
|
||||||
|
}
|
||||||
|
AM_CONDITIONAL([FLEX_CXX_WORKS],
|
||||||
|
[$LEX_IS_FLEX && test $bison_cv_cxx_works = yes])
|
||||||
AC_PROG_YACC
|
AC_PROG_YACC
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
AC_PROG_GNU_M4
|
AC_PROG_GNU_M4
|
||||||
@@ -201,7 +218,6 @@ gl_INIT
|
|||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||||
AM_WITH_DMALLOC
|
AM_WITH_DMALLOC
|
||||||
BISON_PREREQ_TIMEVAR
|
|
||||||
|
|
||||||
# Gettext.
|
# Gettext.
|
||||||
# We use gnulib, which is only guaranteed to work properly with the
|
# We use gnulib, which is only guaranteed to work properly with the
|
||||||
@@ -223,22 +239,34 @@ AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
|
|||||||
AC_CONFIG_TESTDIR(tests)
|
AC_CONFIG_TESTDIR(tests)
|
||||||
AC_CONFIG_FILES([tests/atlocal])
|
AC_CONFIG_FILES([tests/atlocal])
|
||||||
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
||||||
|
|
||||||
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
||||||
case $VALGRIND:$host_os in
|
# Use something simpler that $host_os to select our suppression file.
|
||||||
|
uname=`uname`
|
||||||
|
case $VALGRIND:$uname in
|
||||||
'':*) ;;
|
'':*) ;;
|
||||||
*:darwin*)
|
*:Darwin)
|
||||||
# See README-hacking.
|
# See README-hacking.
|
||||||
# VALGRIND+=' --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind'
|
|
||||||
VALGRIND=;;
|
VALGRIND=;;
|
||||||
*:*)
|
*:*)
|
||||||
AC_SUBST([VALGRIND_PREBISON], ["$VALGRIND -q"]);;
|
suppfile=build-aux/$uname.valgrind
|
||||||
|
if test -f "$srcdir/$suppfile"; then
|
||||||
|
AC_SUBST([VALGRIND_OPTS_SUPPRESSION],
|
||||||
|
["--suppressions=\$(abs_top_srcdir)/$suppfile"])
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
AC_MSG_CHECKING([Valgrind suppression file])
|
||||||
|
AC_MSG_RESULT([$suppfile])
|
||||||
|
|
||||||
|
# Whether we cannot run the compiled bison.
|
||||||
|
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
|
||||||
|
|
||||||
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])
|
||||||
|
|
||||||
gt_JAVACOMP([1.3], [1.4])
|
gt_JAVACOMP([1.7], [1.7])
|
||||||
gt_JAVAEXEC
|
gt_JAVAEXEC
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
|
|||||||
+6
-4
@@ -1,5 +1,3 @@
|
|||||||
-*- outline -*-
|
|
||||||
|
|
||||||
This directory contains data needed by Bison.
|
This directory contains data needed by Bison.
|
||||||
|
|
||||||
* Skeletons
|
* Skeletons
|
||||||
@@ -27,7 +25,7 @@ Currently, the supported skeletons are:
|
|||||||
These skeletons are the only ones supported by the Bison team.
|
These skeletons are the only ones supported by the Bison team.
|
||||||
Because the interface between skeletons and the bison program is not
|
Because the interface between skeletons and the bison program is not
|
||||||
finished, *we are not bound to it*. In particular, Bison is not
|
finished, *we are not bound to it*. In particular, Bison is not
|
||||||
mature enough for us to consider that ``foreign skeletons'' are
|
mature enough for us to consider that "foreign skeletons" are
|
||||||
supported.
|
supported.
|
||||||
|
|
||||||
* m4sugar
|
* m4sugar
|
||||||
@@ -52,7 +50,11 @@ into various formats.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2008-2013 Free Software Foundation, Inc.
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
End:
|
||||||
|
|
||||||
|
Copyright (C) 2002, 2008-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
+239
-63
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Language-independent M4 Macros for Bison.
|
# Language-independent M4 Macros for Bison.
|
||||||
|
|
||||||
# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2004-2015, 2018 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
|
||||||
@@ -22,12 +22,17 @@
|
|||||||
## Identification. ##
|
## Identification. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
|
# b4_generated_by
|
||||||
|
# ---------------
|
||||||
|
m4_define([b4_generated_by],
|
||||||
|
[b4_comment([A Bison parser, made by GNU Bison b4_version.])
|
||||||
|
])
|
||||||
|
|
||||||
# b4_copyright(TITLE, [YEARS])
|
# b4_copyright(TITLE, [YEARS])
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# If YEARS are not defined, use b4_copyright_years.
|
# If YEARS are not defined, use b4_copyright_years.
|
||||||
m4_define([b4_copyright],
|
m4_define([b4_copyright],
|
||||||
[b4_comment([A Bison parser, made by GNU Bison b4_version.])
|
[b4_generated_by
|
||||||
|
|
||||||
b4_comment([$1
|
b4_comment([$1
|
||||||
|
|
||||||
]m4_dquote(m4_text_wrap([Copyright (C)
|
]m4_dquote(m4_text_wrap([Copyright (C)
|
||||||
@@ -58,26 +63,49 @@ Bison output files to be licensed under the GNU General Public
|
|||||||
License without this special exception.
|
License without this special exception.
|
||||||
|
|
||||||
This special exception was added by the Free Software Foundation in
|
This special exception was added by the Free Software Foundation in
|
||||||
version 2.2 of Bison.])])
|
version 2.2 of Bison.])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_disclaimer
|
||||||
|
# -------------
|
||||||
|
# Issue a warning about private implementation details.
|
||||||
|
m4_define([b4_disclaimer],
|
||||||
|
[b4_comment([Undocumented macros, especially those whose name start with YY_,
|
||||||
|
are private implementation details. Do not rely on them.])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# b4_required_version_if(VERSION, IF_NEWER, IF_OLDER)
|
||||||
|
# ---------------------------------------------------
|
||||||
|
# If the version %require'd by the user is VERSION (or newer) expand
|
||||||
|
# IF_NEWER, otherwise IF_OLDER. VERSION should be an integer, e.g.,
|
||||||
|
# 302 for 3.2.
|
||||||
|
m4_define([b4_required_version_if],
|
||||||
|
[m4_if(m4_eval($1 <= b4_required_version),
|
||||||
|
[1], [$2], [$3])])
|
||||||
|
|
||||||
|
|
||||||
## -------- ##
|
## -------- ##
|
||||||
## Output. ##
|
## Output. ##
|
||||||
## -------- ##
|
## -------- ##
|
||||||
|
|
||||||
# b4_output_begin(FILE)
|
# b4_output_begin(FILE1, FILE2)
|
||||||
# ---------------------
|
# -----------------------------
|
||||||
# Enable output, i.e., send to diversion 0, expand after "#", and
|
# Enable output, i.e., send to diversion 0, expand after "#", and
|
||||||
# generate the tag to output into FILE. Must be followed by EOL.
|
# generate the tag to output into FILE. Must be followed by EOL.
|
||||||
|
# FILE is FILE1 concatenated to FILE2. FILE2 can be empty, or be
|
||||||
|
# absolute: do the right thing.
|
||||||
m4_define([b4_output_begin],
|
m4_define([b4_output_begin],
|
||||||
[m4_changecom()
|
[m4_changecom()
|
||||||
m4_divert_push(0)dnl
|
m4_divert_push(0)dnl
|
||||||
@output(m4_unquote([$1])@)@dnl
|
@output(m4_unquote([$1])@,m4_unquote([$2])@)@dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_output_end()
|
# b4_output_end
|
||||||
# ---------------
|
# -------------
|
||||||
# Output nothing, restore # as comment character (no expansions after #).
|
# Output nothing, restore # as comment character (no expansions after #).
|
||||||
m4_define([b4_output_end],
|
m4_define([b4_output_end],
|
||||||
[m4_divert_pop(0)
|
[m4_divert_pop(0)
|
||||||
@@ -85,6 +113,20 @@ m4_changecom([#])
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_divert_kill(CODE)
|
||||||
|
# --------------------
|
||||||
|
# Expand CODE for its side effects, discard its output.
|
||||||
|
m4_define([b4_divert_kill],
|
||||||
|
[m4_divert_text([KILL], [$1])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_define_silent(MACRO, CODE)
|
||||||
|
# -----------------------------
|
||||||
|
# Same as m4_define, but throw away the expansion of CODE.
|
||||||
|
m4_define([b4_define_silent],
|
||||||
|
[m4_define([$1], [b4_divert_kill([$2])])])
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Error handling. ##
|
## Error handling. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
@@ -313,7 +355,7 @@ m4_define([b4_define_flag_if],
|
|||||||
# _b4_define_flag_if($1, $2, FLAG)
|
# _b4_define_flag_if($1, $2, FLAG)
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
# Work around the impossibility to define macros inside macros,
|
# Work around the impossibility to define macros inside macros,
|
||||||
# because issuing `[$1]' is not possible in M4. GNU M4 should provide
|
# because issuing '[$1]' is not possible in M4. GNU M4 should provide
|
||||||
# $$1 a la M5/TeX.
|
# $$1 a la M5/TeX.
|
||||||
m4_define([_b4_define_flag_if],
|
m4_define([_b4_define_flag_if],
|
||||||
[m4_if([$1$2], $[1]$[2], [],
|
[m4_if([$1$2], $[1]$[2], [],
|
||||||
@@ -347,6 +389,7 @@ b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
|||||||
# Whether the symbol has an id.
|
# Whether the symbol has an id.
|
||||||
# - id: string
|
# - id: string
|
||||||
# If has_id, the id. Guaranteed to be usable as a C identifier.
|
# If has_id, the id. Guaranteed to be usable as a C identifier.
|
||||||
|
# Prefixed by api.token.prefix if defined.
|
||||||
# - tag: string.
|
# - tag: string.
|
||||||
# A representat of the symbol. Can be 'foo', 'foo.id', '"foo"' etc.
|
# A representat of the symbol. Can be 'foo', 'foo.id', '"foo"' etc.
|
||||||
# - user_number: integer
|
# - user_number: integer
|
||||||
@@ -357,9 +400,13 @@ b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
|||||||
# The internalized number (used after yytranslate).
|
# The internalized number (used after yytranslate).
|
||||||
# - has_type: 0, 1
|
# - has_type: 0, 1
|
||||||
# Whether has a semantic value.
|
# Whether has a semantic value.
|
||||||
|
# - type_tag: string
|
||||||
|
# When api.value.type=union, the generated name for the union member.
|
||||||
|
# yytype_INT etc. for symbols that has_id, otherwise yytype_1 etc.
|
||||||
# - type
|
# - type
|
||||||
# If it has a semantic value, its type tag, or, if variant are used,
|
# If it has a semantic value, its type tag, or, if variant are used,
|
||||||
# its type.
|
# its type.
|
||||||
|
# In the case of api.value.type=union, type is the real type (e.g. int).
|
||||||
# - has_printer: 0, 1
|
# - has_printer: 0, 1
|
||||||
# - printer: string
|
# - printer: string
|
||||||
# - printer_file: string
|
# - printer_file: string
|
||||||
@@ -370,11 +417,11 @@ b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
|||||||
#
|
#
|
||||||
# The following macros provide access to these values.
|
# The following macros provide access to these values.
|
||||||
|
|
||||||
# b4_symbol_(NUM, FIELD)
|
# _b4_symbol(NUM, FIELD)
|
||||||
# ----------------------
|
# ----------------------
|
||||||
# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if
|
# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if
|
||||||
# undefined.
|
# undefined.
|
||||||
m4_define([b4_symbol_],
|
m4_define([_b4_symbol],
|
||||||
[m4_indir([b4_symbol($1, $2)])])
|
[m4_indir([b4_symbol($1, $2)])])
|
||||||
|
|
||||||
|
|
||||||
@@ -385,8 +432,8 @@ m4_define([b4_symbol_],
|
|||||||
m4_define([b4_symbol],
|
m4_define([b4_symbol],
|
||||||
[m4_case([$2],
|
[m4_case([$2],
|
||||||
[id], [m4_do([b4_percent_define_get([api.token.prefix])],
|
[id], [m4_do([b4_percent_define_get([api.token.prefix])],
|
||||||
[b4_symbol_([$1], [id])])],
|
[_b4_symbol([$1], [id])])],
|
||||||
[b4_symbol_($@)])])
|
[_b4_symbol($@)])])
|
||||||
|
|
||||||
|
|
||||||
# b4_symbol_if(NUM, FIELD, IF-TRUE, IF-FALSE)
|
# b4_symbol_if(NUM, FIELD, IF-TRUE, IF-FALSE)
|
||||||
@@ -418,15 +465,14 @@ m4_define([b4_symbol_action_location],
|
|||||||
# b4_symbol_action(SYMBOL-NUM, KIND)
|
# b4_symbol_action(SYMBOL-NUM, KIND)
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
# Run the action KIND (destructor or printer) for SYMBOL-NUM.
|
# Run the action KIND (destructor or printer) for SYMBOL-NUM.
|
||||||
# Same as in C, but using references instead of pointers.
|
|
||||||
m4_define([b4_symbol_action],
|
m4_define([b4_symbol_action],
|
||||||
[b4_symbol_if([$1], [has_$2],
|
[b4_symbol_if([$1], [has_$2],
|
||||||
[b4_dollar_pushdef([(*yyvaluep)],
|
[b4_dollar_pushdef([(*yyvaluep)],
|
||||||
b4_symbol_if([$1], [has_type],
|
b4_symbol_if([$1], [has_type],
|
||||||
[m4_dquote(b4_symbol([$1], [type]))]),
|
[m4_dquote(b4_symbol([$1], [type]))]),
|
||||||
[(*yylocationp)])dnl
|
[(*yylocationp)])dnl
|
||||||
b4_symbol_case_([$1])[]dnl
|
_b4_symbol_case([$1])[]dnl
|
||||||
b4_syncline([b4_symbol([$1], [$2_line])], ["b4_symbol([$1], [$2_file])"])
|
b4_syncline([b4_symbol([$1], [$2_line])], [b4_symbol([$1], [$2_file])])
|
||||||
b4_symbol([$1], [$2])
|
b4_symbol([$1], [$2])
|
||||||
b4_syncline([@oline@], [@ofile@])
|
b4_syncline([@oline@], [@ofile@])
|
||||||
break;
|
break;
|
||||||
@@ -442,10 +488,28 @@ m4_define([b4_symbol_destructor], [b4_symbol_action([$1], [destructor])])
|
|||||||
m4_define([b4_symbol_printer], [b4_symbol_action([$1], [printer])])
|
m4_define([b4_symbol_printer], [b4_symbol_action([$1], [printer])])
|
||||||
|
|
||||||
|
|
||||||
# b4_symbol_case_(SYMBOL-NUM)
|
# b4_symbol_actions(KIND, [TYPE = yytype])
|
||||||
|
# ----------------------------------------
|
||||||
|
# Emit the symbol actions for KIND ("printer" or "destructor").
|
||||||
|
# Dispatch on TYPE.
|
||||||
|
m4_define([b4_symbol_actions],
|
||||||
|
[m4_pushdef([b4_actions_], m4_expand([b4_symbol_foreach([b4_symbol_$1])]))dnl
|
||||||
|
m4_ifval(m4_defn([b4_actions_]),
|
||||||
|
[switch (m4_default([$2], [yytype]))
|
||||||
|
{
|
||||||
|
m4_defn([b4_actions_])
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}dnl
|
||||||
|
],
|
||||||
|
[YYUSE (m4_default([$2], [yytype]));])dnl
|
||||||
|
m4_popdef([b4_actions_])dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
# _b4_symbol_case(SYMBOL-NUM)
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
# Issue a "case NUM" for SYMBOL-NUM.
|
# Issue a "case NUM" for SYMBOL-NUM.
|
||||||
m4_define([b4_symbol_case_],
|
m4_define([_b4_symbol_case],
|
||||||
[case b4_symbol([$1], [number]): b4_symbol_tag_comment([$1])])
|
[case b4_symbol([$1], [number]): b4_symbol_tag_comment([$1])])
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -500,16 +564,16 @@ m4_define([b4_token_format],
|
|||||||
## Types. ##
|
## Types. ##
|
||||||
## ------- ##
|
## ------- ##
|
||||||
|
|
||||||
# b4_type_action_(NUMS)
|
# _b4_type_action(NUMS)
|
||||||
# ---------------------
|
# ---------------------
|
||||||
# Run actions for the symbol NUMS that all have the same type-name.
|
# Run actions for the symbol NUMS that all have the same type-name.
|
||||||
# Skip NUMS that have no type-name.
|
# Skip NUMS that have no type-name.
|
||||||
#
|
#
|
||||||
# To specify the action to run, define b4_dollar_dollar(NUMBER,
|
# To specify the action to run, define b4_dollar_dollar(NUMBER,
|
||||||
# TAG, TYPE).
|
# TAG, TYPE).
|
||||||
m4_define([b4_type_action_],
|
m4_define([_b4_type_action],
|
||||||
[b4_symbol_if([$1], [has_type],
|
[b4_symbol_if([$1], [has_type],
|
||||||
[m4_map([ b4_symbol_case_], [$@])[]dnl
|
[m4_map([ _b4_symbol_case], [$@])[]dnl
|
||||||
b4_dollar_dollar([b4_symbol([$1], [number])],
|
b4_dollar_dollar([b4_symbol([$1], [number])],
|
||||||
[b4_symbol([$1], [tag])],
|
[b4_symbol([$1], [tag])],
|
||||||
[b4_symbol([$1], [type])]);
|
[b4_symbol([$1], [type])]);
|
||||||
@@ -565,26 +629,28 @@ m4_define([b4_user_code],
|
|||||||
b4_syncline([@oline@], [@ofile@])])
|
b4_syncline([@oline@], [@ofile@])])
|
||||||
|
|
||||||
|
|
||||||
# b4_define_user_code(MACRO)
|
# b4_define_user_code(MACRO, COMMENT)
|
||||||
# --------------------------
|
# -----------------------------------
|
||||||
# From b4_MACRO, build b4_user_MACRO that includes the synclines.
|
# From b4_MACRO, if defined, build b4_user_MACRO that includes the synclines.
|
||||||
m4_define([b4_define_user_code],
|
m4_define([b4_define_user_code],
|
||||||
[m4_define([b4_user_$1],
|
[m4_define([b4_user_$1],
|
||||||
[b4_user_code([b4_$1])])])
|
[m4_ifdef([b4_$1],
|
||||||
|
[m4_ifval([$2],
|
||||||
|
[b4_comment([$2])
|
||||||
|
])b4_user_code([b4_$1])])])])
|
||||||
|
|
||||||
# b4_user_actions
|
# b4_user_actions
|
||||||
# b4_user_initial_action
|
# b4_user_initial_action
|
||||||
# b4_user_post_prologue
|
# b4_user_post_prologue
|
||||||
# b4_user_pre_prologue
|
# b4_user_pre_prologue
|
||||||
# b4_user_stype
|
# b4_user_union_members
|
||||||
# ----------------------
|
# ----------------------
|
||||||
# Macros that issue user code, ending with synclines.
|
# Macros that issue user code, ending with synclines.
|
||||||
b4_define_user_code([actions])
|
b4_define_user_code([actions])
|
||||||
b4_define_user_code([initial_action])
|
b4_define_user_code([initial_action], [User initialization code.])
|
||||||
b4_define_user_code([post_prologue])
|
b4_define_user_code([post_prologue], [Second part of user prologue.])
|
||||||
b4_define_user_code([pre_prologue])
|
b4_define_user_code([pre_prologue], [First part of user prologue.])
|
||||||
b4_define_user_code([stype])
|
b4_define_user_code([union_members])
|
||||||
|
|
||||||
|
|
||||||
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
|
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
|
||||||
@@ -665,16 +731,16 @@ m4_define([b4_percent_define_use],
|
|||||||
# b4_percent_define_get([[foo]])
|
# b4_percent_define_get([[foo]])
|
||||||
m4_define([b4_percent_define_get],
|
m4_define([b4_percent_define_get],
|
||||||
[b4_percent_define_use([$1])dnl
|
[b4_percent_define_use([$1])dnl
|
||||||
m4_ifdef([b4_percent_define(]$1[)],
|
_b4_percent_define_ifdef([$1],
|
||||||
[m4_indir([b4_percent_define(]$1[)])],
|
[m4_indir([b4_percent_define(]$1[)])],
|
||||||
[$2])])
|
[$2])])
|
||||||
|
|
||||||
# b4_percent_define_get_loc(VARIABLE)
|
# b4_percent_define_get_loc(VARIABLE)
|
||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
# Mimic muscle_percent_define_get_loc in ../src/muscle-tab.h exactly. That is,
|
# Mimic muscle_percent_define_get_loc in ../src/muscle-tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is undefined, complain fatally since that's
|
# if the %define variable VARIABLE is undefined, complain fatally since that's
|
||||||
# a Bison or skeleton error. Otherwise, return its definition location in a
|
# a Bison or skeleton error. Otherwise, return its definition location in a
|
||||||
# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or
|
# form appropriate for the first two arguments of b4_warn_at, b4_complain_at, or
|
||||||
# b4_fatal_at. Don't record this as a Bison usage of VARIABLE as there's no
|
# b4_fatal_at. Don't record this as a Bison usage of VARIABLE as there's no
|
||||||
# reason to suspect that the user-supplied value has yet influenced the output.
|
# reason to suspect that the user-supplied value has yet influenced the output.
|
||||||
#
|
#
|
||||||
@@ -686,7 +752,21 @@ m4_define([b4_percent_define_get_loc],
|
|||||||
[m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl
|
[m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl
|
||||||
b4_loc[]dnl
|
b4_loc[]dnl
|
||||||
m4_popdef([b4_loc])],
|
m4_popdef([b4_loc])],
|
||||||
[b4_fatal([[b4_percent_define_get_loc: undefined %%define variable '%s']], [$1])])])
|
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||||
|
|
||||||
|
# b4_percent_define_get_kind(VARIABLE)
|
||||||
|
# ------------------------------------
|
||||||
|
# Get the kind (code, keyword, string) of VARIABLE, i.e., how its
|
||||||
|
# value was defined (braces, not delimiters, quotes).
|
||||||
|
#
|
||||||
|
# If the %define variable VARIABLE is undefined, complain fatally
|
||||||
|
# since that's a Bison or skeleton error. Don't record this as a
|
||||||
|
# Bison usage of VARIABLE as there's no reason to suspect that the
|
||||||
|
# user-supplied value has yet influenced the output.
|
||||||
|
m4_define([b4_percent_define_get_kind],
|
||||||
|
[m4_ifdef([b4_percent_define_kind(]$1[)],
|
||||||
|
[m4_indir([b4_percent_define_kind(]$1[)])],
|
||||||
|
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||||
|
|
||||||
# b4_percent_define_get_syncline(VARIABLE)
|
# b4_percent_define_get_syncline(VARIABLE)
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
@@ -703,7 +783,20 @@ m4_popdef([b4_loc])],
|
|||||||
m4_define([b4_percent_define_get_syncline],
|
m4_define([b4_percent_define_get_syncline],
|
||||||
[m4_ifdef([b4_percent_define_syncline(]$1[)],
|
[m4_ifdef([b4_percent_define_syncline(]$1[)],
|
||||||
[m4_indir([b4_percent_define_syncline(]$1[)])],
|
[m4_indir([b4_percent_define_syncline(]$1[)])],
|
||||||
[b4_fatal([[b4_percent_define_get_syncline: undefined %%define variable '%s']], [$1])])])
|
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||||
|
|
||||||
|
# _b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||||
|
# ------------------------------------------------------
|
||||||
|
# If the %define variable VARIABLE is defined, expand IF-TRUE, else expand
|
||||||
|
# IF-FALSE. Don't record usage of VARIABLE.
|
||||||
|
#
|
||||||
|
# For example:
|
||||||
|
#
|
||||||
|
# _b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
|
||||||
|
m4_define([_b4_percent_define_ifdef],
|
||||||
|
[m4_ifdef([b4_percent_define(]$1[)],
|
||||||
|
[$2],
|
||||||
|
[$3])])
|
||||||
|
|
||||||
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
|
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
@@ -716,9 +809,42 @@ m4_define([b4_percent_define_get_syncline],
|
|||||||
#
|
#
|
||||||
# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
|
# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
|
||||||
m4_define([b4_percent_define_ifdef],
|
m4_define([b4_percent_define_ifdef],
|
||||||
[m4_ifdef([b4_percent_define(]$1[)],
|
[_b4_percent_define_ifdef([$1],
|
||||||
[b4_percent_define_use([$1])$2],
|
[b4_percent_define_use([$1])$2],
|
||||||
[$3])])
|
[$3])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_percent_define_check_file_complain(VARIABLE)
|
||||||
|
# -----------------------------------------------
|
||||||
|
# Warn about %define variable VARIABLE having an incorrect
|
||||||
|
# value.
|
||||||
|
m4_define([b4_percent_define_check_file_complain],
|
||||||
|
[b4_complain_at(b4_percent_define_get_loc([$1]),
|
||||||
|
[[%%define variable '%s' requires 'none' or '"..."' values]],
|
||||||
|
[$1])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_percent_define_check_file(MACRO, VARIABLE, DEFAULT)
|
||||||
|
# ------------------------------------------------------
|
||||||
|
# If the %define variable VARIABLE:
|
||||||
|
# - is undefined, then if DEFAULT is non-empty, define MACRO to DEFAULT
|
||||||
|
# - is a string, define MACRO to its value
|
||||||
|
# - is the keyword 'none', do nothing
|
||||||
|
# - otherwise, warn about the incorrect value.
|
||||||
|
m4_define([b4_percent_define_check_file],
|
||||||
|
[b4_percent_define_ifdef([$2],
|
||||||
|
[m4_case(b4_percent_define_get_kind([$2]),
|
||||||
|
[string],
|
||||||
|
[m4_define([$1], b4_percent_define_get([$2]))],
|
||||||
|
[keyword],
|
||||||
|
[m4_if(b4_percent_define_get([$2]), [none], [],
|
||||||
|
[b4_percent_define_check_file_complain([$2])])],
|
||||||
|
[b4_percent_define_check_file_complain([$2])])
|
||||||
|
],
|
||||||
|
[m4_ifval([$3],
|
||||||
|
[m4_define([$1], [$3])])])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## --------- ##
|
## --------- ##
|
||||||
@@ -747,11 +873,11 @@ m4_define([b4_percent_define_flag_if],
|
|||||||
[[invalid value for %%define Boolean variable '%s']],
|
[[invalid value for %%define Boolean variable '%s']],
|
||||||
[$1])],
|
[$1])],
|
||||||
[[b4_percent_define_flag_if($1)]])])],
|
[[b4_percent_define_flag_if($1)]])])],
|
||||||
[b4_fatal([[b4_percent_define_flag_if: undefined %%define variable '%s']], [$1])])])
|
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_default(VARIABLE, DEFAULT)
|
# b4_percent_define_default(VARIABLE, DEFAULT, [KIND = keyword])
|
||||||
# --------------------------------------------
|
# --------------------------------------------------------------
|
||||||
# Mimic muscle_percent_define_default in ../src/muscle-tab.h exactly. That is,
|
# Mimic muscle_percent_define_default in ../src/muscle-tab.h exactly. That is,
|
||||||
# if the %define variable VARIABLE is undefined, set its value to DEFAULT.
|
# if the %define variable VARIABLE is undefined, set its value to DEFAULT.
|
||||||
# Don't record this as a Bison usage of VARIABLE as there's no reason to
|
# Don't record this as a Bison usage of VARIABLE as there's no reason to
|
||||||
@@ -761,8 +887,10 @@ m4_define([b4_percent_define_flag_if],
|
|||||||
#
|
#
|
||||||
# b4_percent_define_default([[foo]], [[default value]])
|
# b4_percent_define_default([[foo]], [[default value]])
|
||||||
m4_define([b4_percent_define_default],
|
m4_define([b4_percent_define_default],
|
||||||
[m4_ifndef([b4_percent_define(]$1[)],
|
[_b4_percent_define_ifdef([$1], [],
|
||||||
[m4_define([b4_percent_define(]$1[)], [$2])dnl
|
[m4_define([b4_percent_define(]$1[)], [$2])dnl
|
||||||
|
m4_define([b4_percent_define_kind(]$1[)],
|
||||||
|
[m4_default([$3], [keyword])])dnl
|
||||||
m4_define([b4_percent_define_loc(]$1[)],
|
m4_define([b4_percent_define_loc(]$1[)],
|
||||||
[[[[<skeleton default value>:-1.-1]],
|
[[[[<skeleton default value>:-1.-1]],
|
||||||
[[<skeleton default value>:-1.-1]]]])dnl
|
[[<skeleton default value>:-1.-1]]]])dnl
|
||||||
@@ -772,15 +900,30 @@ m4_define([b4_percent_define_default],
|
|||||||
# b4_percent_define_if_define(NAME, [VARIABLE = NAME])
|
# b4_percent_define_if_define(NAME, [VARIABLE = NAME])
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# Define b4_NAME_if that executes its $1 or $2 depending whether
|
# Define b4_NAME_if that executes its $1 or $2 depending whether
|
||||||
# VARIABLE was %defined. The characters `.' and `-' in VARIABLE are mapped
|
# VARIABLE was %defined. The characters '.' and `-' in VARIABLE are mapped
|
||||||
# to `_'.
|
# to '_'.
|
||||||
m4_define([b4_percent_define_if_define_],
|
m4_define([_b4_percent_define_if_define],
|
||||||
[m4_define(m4_bpatsubst([b4_$1_if], [[-.]], [_]),
|
[m4_define(m4_bpatsubst([b4_$1_if], [[-.]], [_]),
|
||||||
[b4_percent_define_flag_if(m4_default([$2], [$1]),
|
[b4_percent_define_flag_if(m4_default([$2], [$1]),
|
||||||
[$3], [$4])])])
|
[$3], [$4])])])
|
||||||
m4_define([b4_percent_define_if_define],
|
m4_define([b4_percent_define_if_define],
|
||||||
[b4_percent_define_default([m4_default([$2], [$1])], [[false]])
|
[b4_percent_define_default([m4_default([$2], [$1])], [[false]])
|
||||||
b4_percent_define_if_define_([$1], [$2], $[1], $[2])])
|
_b4_percent_define_if_define([$1], [$2], $[1], $[2])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_percent_define_check_kind(VARIABLE, KIND, [DIAGNOSTIC = complain])
|
||||||
|
# ---------------------------------------------------------------------
|
||||||
|
m4_define([b4_percent_define_check_kind],
|
||||||
|
[_b4_percent_define_ifdef([$1],
|
||||||
|
[m4_if(b4_percent_define_get_kind([$1]), [$2], [],
|
||||||
|
[b4_error([m4_default([$3], [complain])],
|
||||||
|
b4_percent_define_get_loc([$1]),
|
||||||
|
[m4_case([$2],
|
||||||
|
[code], [[%%define variable '%s' requires '{...}' values]],
|
||||||
|
[keyword], [[%%define variable '%s' requires keyword values]],
|
||||||
|
[string], [[%%define variable '%s' requires '"..."' values]])],
|
||||||
|
[$1])])])dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_check_values(VALUES)
|
# b4_percent_define_check_values(VALUES)
|
||||||
@@ -804,8 +947,9 @@ m4_define([b4_percent_define_check_values],
|
|||||||
[_b4_percent_define_check_values(b4_sublist)])])
|
[_b4_percent_define_check_values(b4_sublist)])])
|
||||||
|
|
||||||
m4_define([_b4_percent_define_check_values],
|
m4_define([_b4_percent_define_check_values],
|
||||||
[m4_ifdef([b4_percent_define(]$1[)],
|
[_b4_percent_define_ifdef([$1],
|
||||||
[m4_pushdef([b4_good_value], [0])dnl
|
[b4_percent_define_check_kind(]$1[, [keyword], [deprecated])dnl
|
||||||
|
m4_pushdef([b4_good_value], [0])dnl
|
||||||
m4_if($#, 1, [],
|
m4_if($#, 1, [],
|
||||||
[m4_foreach([b4_value], m4_dquote(m4_shift($@)),
|
[m4_foreach([b4_value], m4_dquote(m4_shift($@)),
|
||||||
[m4_if(m4_indir([b4_percent_define(]$1[)]), b4_value,
|
[m4_if(m4_indir([b4_percent_define(]$1[)]), b4_value,
|
||||||
@@ -820,7 +964,7 @@ m4_define([_b4_percent_define_check_values],
|
|||||||
[[accepted value: '%s']],
|
[[accepted value: '%s']],
|
||||||
m4_dquote(b4_value))])])dnl
|
m4_dquote(b4_value))])])dnl
|
||||||
m4_popdef([b4_good_value])],
|
m4_popdef([b4_good_value])],
|
||||||
[b4_fatal([[b4_percent_define_check_values: undefined %%define variable '%s']], [$1])])])
|
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||||
|
|
||||||
# b4_percent_code_get([QUALIFIER])
|
# b4_percent_code_get([QUALIFIER])
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
@@ -861,15 +1005,11 @@ m4_define([b4_percent_code_ifdef],
|
|||||||
## Common variables. ##
|
## Common variables. ##
|
||||||
## ------------------ ##
|
## ------------------ ##
|
||||||
|
|
||||||
# Default values for %define.
|
|
||||||
# ---------------------------
|
|
||||||
# If the api.token.prefix, it is empty.
|
|
||||||
m4_percent_define_default([[api.token.prefix]], [[]])
|
|
||||||
|
|
||||||
# b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
|
# b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
|
||||||
# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
|
# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
|
||||||
# b4_token_ctor_if([IF-YYLEX-RETURNS-A-TOKEN], [IF-NOT])
|
# b4_token_ctor_if([IF-YYLEX-RETURNS-A-TOKEN], [IF-NOT])
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------------------
|
||||||
b4_percent_define_if_define([token_ctor], [api.token.constructor])
|
b4_percent_define_if_define([token_ctor], [api.token.constructor])
|
||||||
b4_percent_define_if_define([locations]) # Whether locations are tracked.
|
b4_percent_define_if_define([locations]) # Whether locations are tracked.
|
||||||
b4_percent_define_if_define([parse.assert])
|
b4_percent_define_if_define([parse.assert])
|
||||||
@@ -904,9 +1044,11 @@ b4_error_verbose_if([m4_define([b4_token_table_flag], [1])])
|
|||||||
# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
|
# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
b4_percent_define_if_define([variant])
|
b4_percent_define_if_define([variant])
|
||||||
m4_case(b4_percent_define_get([[api.value.type]]),
|
m4_define([b4_variant_flag], [[0]])
|
||||||
[variant], [m4_define([b4_variant_flag], [[1]])],
|
b4_percent_define_ifdef([[api.value.type]],
|
||||||
[m4_define([b4_variant_flag], [[0]])])
|
[m4_case(b4_percent_define_get_kind([[api.value.type]]), [keyword],
|
||||||
|
[m4_case(b4_percent_define_get([[api.value.type]]), [variant],
|
||||||
|
[m4_define([b4_variant_flag], [[1]])])])])
|
||||||
b4_define_flag_if([variant])
|
b4_define_flag_if([variant])
|
||||||
|
|
||||||
|
|
||||||
@@ -932,8 +1074,6 @@ b4_check_user_names_wrap([[code]], [[qualifier]])
|
|||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# m4_define_default([b4_lex_param], []) dnl breaks other skeletons
|
# m4_define_default([b4_lex_param], []) dnl breaks other skeletons
|
||||||
m4_define_default([b4_pre_prologue], [])
|
|
||||||
m4_define_default([b4_post_prologue], [])
|
|
||||||
m4_define_default([b4_epilogue], [])
|
m4_define_default([b4_epilogue], [])
|
||||||
m4_define_default([b4_parse_param], [])
|
m4_define_default([b4_parse_param], [])
|
||||||
|
|
||||||
@@ -941,10 +1081,46 @@ m4_define_default([b4_parse_param], [])
|
|||||||
m4_define_default([b4_location_initial_column], [1])
|
m4_define_default([b4_location_initial_column], [1])
|
||||||
m4_define_default([b4_location_initial_line], [1])
|
m4_define_default([b4_location_initial_line], [1])
|
||||||
|
|
||||||
# Sanity checks.
|
|
||||||
|
## --------------- ##
|
||||||
|
## Sanity checks. ##
|
||||||
|
## --------------- ##
|
||||||
|
|
||||||
|
# api.location.prefix={...} (Java and C++).
|
||||||
|
b4_percent_define_check_kind([api.location.type], [code], [deprecated])
|
||||||
|
|
||||||
|
# api.position.prefix={...} (Java).
|
||||||
|
b4_percent_define_check_kind([api.position.type], [code], [deprecated])
|
||||||
|
|
||||||
|
# api.prefix >< %name-prefix.
|
||||||
|
b4_percent_define_check_kind([api.prefix], [code], [deprecated])
|
||||||
b4_percent_define_ifdef([api.prefix],
|
b4_percent_define_ifdef([api.prefix],
|
||||||
[m4_ifdef([b4_prefix],
|
[m4_ifdef([b4_prefix],
|
||||||
[b4_complain_at(b4_percent_define_get_loc([api.prefix]),
|
[b4_complain_at(b4_percent_define_get_loc([api.prefix]),
|
||||||
[['%s' and '%s' cannot be used together]],
|
[['%s' and '%s' cannot be used together]],
|
||||||
[%name-prefix],
|
[%name-prefix],
|
||||||
[%define api.prefix])])])
|
[%define api.prefix])])])
|
||||||
|
|
||||||
|
# api.token.prefix={...}
|
||||||
|
# Make it a warning for those who used betas of Bison 3.0.
|
||||||
|
b4_percent_define_check_kind([api.token.prefix], [code], [deprecated])
|
||||||
|
|
||||||
|
# api.value.type >< %union.
|
||||||
|
b4_percent_define_ifdef([api.value.type],
|
||||||
|
[m4_ifdef([b4_union_members],
|
||||||
|
[b4_complain_at(b4_percent_define_get_loc([api.value.type]),
|
||||||
|
[['%s' and '%s' cannot be used together]],
|
||||||
|
[%union],
|
||||||
|
[%define api.value.type])])])
|
||||||
|
|
||||||
|
# api.value.type=union >< %yacc.
|
||||||
|
b4_percent_define_ifdef([api.value.type],
|
||||||
|
[m4_if(b4_percent_define_get([api.value.type]), [union],
|
||||||
|
[b4_yacc_if(dnl
|
||||||
|
[b4_complain_at(b4_percent_define_get_loc([api.value.type]),
|
||||||
|
[['%s' and '%s' cannot be used together]],
|
||||||
|
[%yacc],
|
||||||
|
[%define api.value.type "union"])])])])
|
||||||
|
|
||||||
|
# api.value.union.name.
|
||||||
|
b4_percent_define_check_kind([api.value.union.name], [keyword])
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
# C++ skeleton dispatching for Bison.
|
# C++ skeleton dispatching for Bison.
|
||||||
|
|
||||||
# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2006-2007, 2009-2015, 2018 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
|
||||||
|
|||||||
+181
-91
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2018 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
|
||||||
@@ -17,13 +17,57 @@
|
|||||||
# 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, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Sanity checks, before defaults installed by c.m4.
|
||||||
|
b4_percent_define_ifdef([[api.value.union.name]],
|
||||||
|
[b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]),
|
||||||
|
[named %union is invalid in C++])])
|
||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c.m4])
|
m4_include(b4_pkgdatadir/[c.m4])
|
||||||
|
|
||||||
|
b4_percent_define_check_kind([api.namespace], [code], [deprecated])
|
||||||
|
b4_percent_define_check_kind([parser_class_name], [code], [deprecated])
|
||||||
|
|
||||||
|
|
||||||
|
## ----- ##
|
||||||
|
## C++. ##
|
||||||
|
## ----- ##
|
||||||
|
|
||||||
# b4_comment(TEXT, [PREFIX])
|
# b4_comment(TEXT, [PREFIX])
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Put TEXT in comment. Prefix all the output lines with PREFIX.
|
# Put TEXT in comment. Prefix all the output lines with PREFIX.
|
||||||
m4_define([b4_comment],
|
m4_define([b4_comment],
|
||||||
[b4_comment_([$1], [$2// ], [$2// ])])
|
[_b4_comment([$1], [$2// ], [$2// ])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_inline(hh|cc)
|
||||||
|
# ----------------
|
||||||
|
# Expand to `inline\n ` if $1 is hh.
|
||||||
|
m4_define([b4_inline],
|
||||||
|
[m4_case([$1],
|
||||||
|
[cc], [],
|
||||||
|
[hh], [[inline
|
||||||
|
]],
|
||||||
|
[m4_fatal([$0: invalid argument: $1])])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_cxx_portability
|
||||||
|
# ------------------
|
||||||
|
m4_define([b4_cxx_portability],
|
||||||
|
[// Support move semantics when possible.
|
||||||
|
#if defined __cplusplus && 201103L <= __cplusplus
|
||||||
|
# define YY_MOVE std::move
|
||||||
|
# define YY_MOVE_OR_COPY move
|
||||||
|
# define YY_MOVE_REF(Type) Type&&
|
||||||
|
# define YY_RVREF(Type) Type&&
|
||||||
|
# define YY_COPY(Type) Type
|
||||||
|
#else
|
||||||
|
# define YY_MOVE
|
||||||
|
# define YY_MOVE_OR_COPY copy
|
||||||
|
# define YY_MOVE_REF(Type) Type&
|
||||||
|
# define YY_RVREF(Type) const Type&
|
||||||
|
# define YY_COPY(Type) const Type&
|
||||||
|
#endif[]dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
@@ -38,6 +82,7 @@ b4_percent_define_default([[parser_class_name]], [[parser]])
|
|||||||
# b4_percent_define_default([[api.location.type]], [[location]])
|
# b4_percent_define_default([[api.location.type]], [[location]])
|
||||||
|
|
||||||
b4_percent_define_default([[filename_type]], [[std::string]])
|
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||||
|
# Make it a warning for those who used betas of Bison 3.0.
|
||||||
b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix]))
|
b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix]))
|
||||||
|
|
||||||
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
||||||
@@ -54,8 +99,8 @@ b4_percent_define_default([[define_location_comparison]],
|
|||||||
m4_define([b4_namespace_ref], [b4_percent_define_get([[api.namespace]])])
|
m4_define([b4_namespace_ref], [b4_percent_define_get([[api.namespace]])])
|
||||||
|
|
||||||
|
|
||||||
# Don't permit an empty b4_namespace_ref. Any `::parser::foo' appended to it
|
# Don't permit an empty b4_namespace_ref. Any '::parser::foo' appended to it
|
||||||
# would compile as an absolute reference with `parser' in the global namespace.
|
# would compile as an absolute reference with 'parser' in the global namespace.
|
||||||
# b4_namespace_open would open an anonymous namespace and thus establish
|
# b4_namespace_open would open an anonymous namespace and thus establish
|
||||||
# internal linkage. This would compile. However, it's cryptic, and internal
|
# internal linkage. This would compile. However, it's cryptic, and internal
|
||||||
# linkage for the parser would be specified in all translation units that
|
# linkage for the parser would be specified in all translation units that
|
||||||
@@ -66,7 +111,7 @@ m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
|
|||||||
[[namespace reference is empty]])])
|
[[namespace reference is empty]])])
|
||||||
|
|
||||||
# Instead of assuming the C++ compiler will do it, Bison should reject any
|
# Instead of assuming the C++ compiler will do it, Bison should reject any
|
||||||
# invalid b4_namepsace_ref that would be converted to a valid
|
# invalid b4_namespace_ref that would be converted to a valid
|
||||||
# b4_namespace_open. The problem is that Bison doesn't always output
|
# b4_namespace_open. The problem is that Bison doesn't always output
|
||||||
# b4_namespace_ref to uncommented code but should reserve the ability to do so
|
# b4_namespace_ref to uncommented code but should reserve the ability to do so
|
||||||
# in future releases without risking breaking any existing user grammars.
|
# in future releases without risking breaking any existing user grammars.
|
||||||
@@ -112,19 +157,24 @@ m4_define([b4_token_enums],
|
|||||||
## Semantic Values. ##
|
## Semantic Values. ##
|
||||||
## ----------------- ##
|
## ----------------- ##
|
||||||
|
|
||||||
# b4_semantic_type_declare
|
|
||||||
# ------------------------
|
|
||||||
|
# b4_value_type_declare
|
||||||
|
# ---------------------
|
||||||
# Declare semantic_type.
|
# Declare semantic_type.
|
||||||
m4_define([b4_semantic_type_declare],
|
m4_define([b4_value_type_declare],
|
||||||
|
[b4_value_type_setup[]dnl
|
||||||
[ /// Symbol semantic values.
|
[ /// Symbol semantic values.
|
||||||
m4_ifdef([b4_stype],
|
]m4_bmatch(b4_percent_define_get_kind([[api.value.type]]),
|
||||||
[ union semantic_type
|
[code],
|
||||||
|
[[ typedef ]b4_percent_define_get([[api.value.type]])[ semantic_type;]],
|
||||||
|
[m4_bmatch(b4_percent_define_get([[api.value.type]]),
|
||||||
|
[union\|union-directive],
|
||||||
|
[[ union semantic_type
|
||||||
{
|
{
|
||||||
b4_user_stype
|
]b4_user_union_members[
|
||||||
};],
|
};]])])dnl
|
||||||
[m4_if(b4_tag_seen_flag, 0,
|
])
|
||||||
[[ typedef int semantic_type;]],
|
|
||||||
[[ typedef ]b4_api_PREFIX[STYPE semantic_type;]])])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_public_types_declare
|
# b4_public_types_declare
|
||||||
@@ -133,7 +183,7 @@ b4_user_stype
|
|||||||
# Depending on %define token_lex, may be output in the header or source file.
|
# Depending on %define token_lex, may be output in the header or source file.
|
||||||
m4_define([b4_public_types_declare],
|
m4_define([b4_public_types_declare],
|
||||||
[[#ifndef ]b4_api_PREFIX[STYPE
|
[[#ifndef ]b4_api_PREFIX[STYPE
|
||||||
]b4_semantic_type_declare[
|
]b4_value_type_declare[
|
||||||
#else
|
#else
|
||||||
typedef ]b4_api_PREFIX[STYPE semantic_type;
|
typedef ]b4_api_PREFIX[STYPE semantic_type;
|
||||||
#endif]b4_locations_if([
|
#endif]b4_locations_if([
|
||||||
@@ -157,16 +207,26 @@ m4_define([b4_public_types_declare],
|
|||||||
/// (External) token type, as returned by yylex.
|
/// (External) token type, as returned by yylex.
|
||||||
typedef token::yytokentype token_type;
|
typedef token::yytokentype token_type;
|
||||||
|
|
||||||
/// Internal symbol number.
|
/// Symbol type: an internal symbol number.
|
||||||
typedef int symbol_number_type;
|
typedef int symbol_number_type;
|
||||||
|
|
||||||
|
/// The symbol type number to denote an empty symbol.
|
||||||
|
enum { empty_symbol = -2 };
|
||||||
|
|
||||||
/// Internal symbol number for tokens (subsumed by symbol_number_type).
|
/// Internal symbol number for tokens (subsumed by symbol_number_type).
|
||||||
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
||||||
|
]])
|
||||||
|
|
||||||
/// A complete symbol.
|
|
||||||
|
# b4_symbol_type_declare
|
||||||
|
# ----------------------
|
||||||
|
# Define symbol_type, the external type for symbols used for symbol
|
||||||
|
# constructors.
|
||||||
|
m4_define([b4_symbol_type_declare],
|
||||||
|
[[ /// A complete symbol.
|
||||||
///
|
///
|
||||||
/// Expects its Base type to provide access to the symbol type
|
/// Expects its Base type to provide access to the symbol type
|
||||||
/// via type_get().
|
/// via type_get ().
|
||||||
///
|
///
|
||||||
/// Provide access to semantic value]b4_locations_if([ and location])[.
|
/// Provide access to semantic value]b4_locations_if([ and location])[.
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
@@ -178,22 +238,30 @@ m4_define([b4_public_types_declare],
|
|||||||
/// Default constructor.
|
/// Default constructor.
|
||||||
basic_symbol ();
|
basic_symbol ();
|
||||||
|
|
||||||
/// Copy constructor.
|
/// Move or copy constructor.
|
||||||
basic_symbol (const basic_symbol& other);
|
basic_symbol (YY_RVREF (basic_symbol) other);
|
||||||
|
|
||||||
]b4_variant_if([[
|
]b4_variant_if([[
|
||||||
/// Constructor for valueless symbols, and symbols from each type.
|
/// Constructor for valueless symbols, and symbols from each type.
|
||||||
]b4_type_foreach([b4_basic_symbol_constructor_declare])], [[
|
]b4_type_foreach([b4_basic_symbol_constructor_declare])], [[
|
||||||
/// Constructor for valueless symbols.
|
/// Constructor for valueless symbols.
|
||||||
basic_symbol (typename Base::kind_type t]b4_locations_if([,
|
basic_symbol (typename Base::kind_type t]b4_locations_if([,
|
||||||
const location_type& l])[);]])[
|
YY_MOVE_REF (location_type) l])[);
|
||||||
|
|
||||||
/// Constructor for symbols with semantic value.
|
/// Constructor for symbols with semantic value.
|
||||||
basic_symbol (typename Base::kind_type t,
|
basic_symbol (typename Base::kind_type t,
|
||||||
const semantic_type& v]b4_locations_if([,
|
YY_RVREF (semantic_type) v]b4_locations_if([,
|
||||||
const location_type& l])[);
|
YY_RVREF (location_type) l])[);]])[
|
||||||
|
|
||||||
|
/// Destroy the symbol.
|
||||||
~basic_symbol ();
|
~basic_symbol ();
|
||||||
|
|
||||||
|
/// Destroy contents, and record that is empty.
|
||||||
|
void clear ();
|
||||||
|
|
||||||
|
/// Whether empty.
|
||||||
|
bool empty () const;
|
||||||
|
|
||||||
/// Destructive move, \a s is emptied into this.
|
/// Destructive move, \a s is emptied into this.
|
||||||
void move (basic_symbol& s);
|
void move (basic_symbol& s);
|
||||||
|
|
||||||
@@ -204,8 +272,10 @@ m4_define([b4_public_types_declare],
|
|||||||
location_type location;])[
|
location_type location;])[
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#if !defined __cplusplus || __cplusplus < 201103L
|
||||||
/// Assignment operator.
|
/// Assignment operator.
|
||||||
basic_symbol& operator= (const basic_symbol& other);
|
basic_symbol& operator= (const basic_symbol& other);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Type access provider for token (enum) based symbols.
|
/// Type access provider for token (enum) based symbols.
|
||||||
@@ -223,92 +293,95 @@ m4_define([b4_public_types_declare],
|
|||||||
/// Constructor from (external) token numbers.
|
/// Constructor from (external) token numbers.
|
||||||
by_type (kind_type t);
|
by_type (kind_type t);
|
||||||
|
|
||||||
|
/// Record that this symbol is empty.
|
||||||
|
void clear ();
|
||||||
|
|
||||||
/// Steal the symbol type from \a that.
|
/// Steal the symbol type from \a that.
|
||||||
void move (by_type& that);
|
void move (by_type& that);
|
||||||
|
|
||||||
/// The (internal) type number (corresponding to \a type).
|
/// The (internal) type number (corresponding to \a type).
|
||||||
/// -1 when this symbol is empty.
|
/// \a empty when empty.
|
||||||
symbol_number_type type_get () const;
|
symbol_number_type type_get () const;
|
||||||
|
|
||||||
/// The token.
|
/// The token.
|
||||||
token_type token () const;
|
token_type token () const;
|
||||||
|
|
||||||
enum { empty = 0 };
|
|
||||||
|
|
||||||
/// The symbol type.
|
/// The symbol type.
|
||||||
/// -1 when this symbol is empty.
|
/// \a empty_symbol when empty.
|
||||||
token_number_type type;
|
/// An int, not token_number_type, to be able to store empty_symbol.
|
||||||
|
int type;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// "External" symbols: returned by the scanner.
|
/// "External" symbols: returned by the scanner.
|
||||||
typedef basic_symbol<by_type> symbol_type;
|
typedef basic_symbol<by_type> symbol_type;
|
||||||
|
]])
|
||||||
]b4_symbol_constructor_declare])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_public_types_define
|
# b4_public_types_define(hh|cc)
|
||||||
# ----------------------
|
# -----------------------------
|
||||||
# Provide the implementation needed by the public types.
|
# Provide the implementation needed by the public types.
|
||||||
m4_define([b4_public_types_define],
|
m4_define([b4_public_types_define],
|
||||||
[[ inline
|
[ b4_inline([$1])b4_parser_class_name[::syntax_error::syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m)
|
||||||
]b4_parser_class_name[::syntax_error::syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m)
|
|
||||||
: std::runtime_error (m)]b4_locations_if([
|
: std::runtime_error (m)]b4_locations_if([
|
||||||
, location (l)])[
|
, location (l)])[
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// basic_symbol.
|
// basic_symbol.
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
inline
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
|
||||||
: value ()
|
: value ()]b4_locations_if([
|
||||||
|
, location ()])[
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
inline
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (YY_RVREF (basic_symbol) other)
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const basic_symbol& other)
|
: Base (YY_MOVE (other))
|
||||||
: Base (other)
|
, value (]b4_variant_if([], [YY_MOVE (other.value)]))b4_locations_if([
|
||||||
, value ()]b4_locations_if([
|
, location (YY_MOVE (other.location))])[
|
||||||
, location (other.location)])[
|
{]b4_variant_if([
|
||||||
{
|
b4_symbol_variant([other.type_get ()], [value], [YY_MOVE_OR_COPY],
|
||||||
]b4_variant_if([b4_symbol_variant([other.type_get ()], [value], [copy],
|
[YY_MOVE (other.value)])])[
|
||||||
[other.value])],
|
|
||||||
[value = other.value;])[
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename Base>
|
|
||||||
inline
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
|
||||||
[typename Base::kind_type t],
|
|
||||||
[const semantic_type& v],
|
|
||||||
b4_locations_if([const location_type& l]))[)
|
|
||||||
: Base (t)
|
|
||||||
, value (]b4_variant_if([], [v])[)]b4_locations_if([
|
|
||||||
, location (l)])[
|
|
||||||
{]b4_variant_if([[
|
|
||||||
(void) v;
|
|
||||||
]b4_symbol_variant([this->type_get ()], [value], [copy], [v])])[}
|
|
||||||
|
|
||||||
]b4_variant_if([[
|
]b4_variant_if([[
|
||||||
// Implementation of basic_symbol constructor for each type.
|
// Implementation of basic_symbol constructor for each type.
|
||||||
]b4_type_foreach([b4_basic_symbol_constructor_define])], [[
|
]b4_type_foreach([b4_basic_symbol_constructor_define])], [[
|
||||||
/// Constructor for valueless symbols.
|
/// Constructor for valueless symbols.
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
inline
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
||||||
[typename Base::kind_type t],
|
[typename Base::kind_type t],
|
||||||
b4_locations_if([const location_type& l]))[)
|
b4_locations_if([YY_MOVE_REF (location_type) l]))[)
|
||||||
: Base (t)
|
: Base (t)
|
||||||
, value ()]b4_locations_if([
|
, value ()]b4_locations_if([
|
||||||
, location (l)])[
|
, location (l)])[
|
||||||
{}]])[
|
{}
|
||||||
|
|
||||||
|
template <typename Base>
|
||||||
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
||||||
|
[typename Base::kind_type t],
|
||||||
|
[YY_RVREF (semantic_type) v],
|
||||||
|
b4_locations_if([YY_RVREF (location_type) l]))[)
|
||||||
|
: Base (t)
|
||||||
|
, value (]b4_variant_if([], [YY_MOVE (v)])[)]b4_locations_if([
|
||||||
|
, location (YY_MOVE (l))])[
|
||||||
|
{]b4_variant_if([[
|
||||||
|
(void) v;
|
||||||
|
]b4_symbol_variant([this->type_get ()], [value], [YY_MOVE_OR_COPY], [YY_MOVE (v)])])[}]])[
|
||||||
|
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
inline
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol ()
|
]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol ()
|
||||||
|
{
|
||||||
|
clear ();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Base>
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::basic_symbol<Base>::clear ()
|
||||||
{]b4_variant_if([[
|
{]b4_variant_if([[
|
||||||
// User destructor.
|
// User destructor.
|
||||||
symbol_number_type yytype = this->type_get ();
|
symbol_number_type yytype = this->type_get ();
|
||||||
|
basic_symbol<Base>& yysym = *this;
|
||||||
|
(void) yysym;
|
||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||||
@@ -318,53 +391,60 @@ m4_define([b4_public_types_define],
|
|||||||
|
|
||||||
// Type destructor.
|
// Type destructor.
|
||||||
]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[
|
]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[
|
||||||
|
Base::clear ();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Base>
|
||||||
|
bool
|
||||||
|
]b4_parser_class_name[::basic_symbol<Base>::empty () const
|
||||||
|
{
|
||||||
|
return Base::type_get () == empty_symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::move (basic_symbol& s)
|
]b4_parser_class_name[::basic_symbol<Base>::move (basic_symbol& s)
|
||||||
{
|
{
|
||||||
super_type::move(s);
|
super_type::move (s);
|
||||||
]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [move],
|
]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [move],
|
||||||
[s.value])],
|
[YY_MOVE (s.value)])],
|
||||||
[value = s.value;])[]b4_locations_if([
|
[value = YY_MOVE (s.value);])[]b4_locations_if([
|
||||||
location = s.location;])[
|
location = YY_MOVE (s.location);])[
|
||||||
}
|
}
|
||||||
|
|
||||||
// by_type.
|
// by_type.
|
||||||
inline
|
]b4_inline([$1])b4_parser_class_name[::by_type::by_type ()
|
||||||
]b4_parser_class_name[::by_type::by_type ()
|
: type (empty_symbol)
|
||||||
: type (empty)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
inline
|
]b4_inline([$1])b4_parser_class_name[::by_type::by_type (const by_type& other)
|
||||||
]b4_parser_class_name[::by_type::by_type (const by_type& other)
|
|
||||||
: type (other.type)
|
: type (other.type)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
inline
|
]b4_inline([$1])b4_parser_class_name[::by_type::by_type (token_type t)
|
||||||
]b4_parser_class_name[::by_type::by_type (token_type t)
|
|
||||||
: type (yytranslate_ (t))
|
: type (yytranslate_ (t))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
inline
|
]b4_inline([$1])[void
|
||||||
void
|
]b4_parser_class_name[::by_type::clear ()
|
||||||
|
{
|
||||||
|
type = empty_symbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
]b4_inline([$1])[void
|
||||||
]b4_parser_class_name[::by_type::move (by_type& that)
|
]b4_parser_class_name[::by_type::move (by_type& that)
|
||||||
{
|
{
|
||||||
type = that.type;
|
type = that.type;
|
||||||
that.type = empty;
|
that.clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
]b4_inline([$1])[int
|
||||||
int
|
|
||||||
]b4_parser_class_name[::by_type::type_get () const
|
]b4_parser_class_name[::by_type::type_get () const
|
||||||
{
|
{
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
]b4_token_ctor_if([[
|
]b4_token_ctor_if([[
|
||||||
inline
|
]b4_inline([$1])b4_parser_class_name[::token_type
|
||||||
]b4_parser_class_name[::token_type
|
|
||||||
]b4_parser_class_name[::by_type::token () const
|
]b4_parser_class_name[::by_type::token () const
|
||||||
{
|
{
|
||||||
// YYTOKNUM[NUM] -- (External) token number corresponding to the
|
// YYTOKNUM[NUM] -- (External) token number corresponding to the
|
||||||
@@ -378,6 +458,7 @@ m4_define([b4_public_types_define],
|
|||||||
return static_cast<token_type> (yytoken_number_[type]);
|
return static_cast<token_type> (yytoken_number_[type]);
|
||||||
}
|
}
|
||||||
]])[]dnl
|
]])[]dnl
|
||||||
|
|
||||||
b4_symbol_constructor_define])
|
b4_symbol_constructor_define])
|
||||||
|
|
||||||
|
|
||||||
@@ -390,14 +471,13 @@ m4_define([b4_symbol_constructor_declare], [])
|
|||||||
m4_define([b4_symbol_constructor_define], [])
|
m4_define([b4_symbol_constructor_define], [])
|
||||||
|
|
||||||
|
|
||||||
# b4_yytranslate_define
|
# b4_yytranslate_define(cc|hh)
|
||||||
# ---------------------
|
# ----------------------------
|
||||||
# Define yytranslate_. Sometimes used in the header file,
|
# Define yytranslate_. Sometimes used in the header file ($1=hh),
|
||||||
# sometimes in the cc file.
|
# sometimes in the cc file.
|
||||||
m4_define([b4_yytranslate_define],
|
m4_define([b4_yytranslate_define],
|
||||||
[[ // Symbol number corresponding to token number t.
|
[[ // Symbol number corresponding to token number t.
|
||||||
inline
|
]b4_inline([$1])b4_parser_class_name[::token_number_type
|
||||||
]b4_parser_class_name[::token_number_type
|
|
||||||
]b4_parser_class_name[::yytranslate_ (]b4_token_ctor_if([token_type],
|
]b4_parser_class_name[::yytranslate_ (]b4_token_ctor_if([token_type],
|
||||||
[int])[ t)
|
[int])[ t)
|
||||||
{
|
{
|
||||||
@@ -407,12 +487,12 @@ m4_define([b4_yytranslate_define],
|
|||||||
{
|
{
|
||||||
]b4_translate[
|
]b4_translate[
|
||||||
};
|
};
|
||||||
const unsigned int user_token_number_max_ = ]b4_user_token_number_max[;
|
const unsigned user_token_number_max_ = ]b4_user_token_number_max[;
|
||||||
const token_number_type undef_token_ = ]b4_undef_token_number[;
|
const token_number_type undef_token_ = ]b4_undef_token_number[;
|
||||||
|
|
||||||
if (static_cast<int>(t) <= yyeof_)
|
if (static_cast<int> (t) <= yyeof_)
|
||||||
return yyeof_;
|
return yyeof_;
|
||||||
else if (static_cast<unsigned int> (t) <= user_token_number_max_)
|
else if (static_cast<unsigned> (t) <= user_token_number_max_)
|
||||||
return translate_table[t];
|
return translate_table[t];
|
||||||
else
|
else
|
||||||
return undef_token_;
|
return undef_token_;
|
||||||
@@ -520,3 +600,13 @@ m4_define([b4_yylloc_default_define],
|
|||||||
while (/*CONSTCOND*/ false)
|
while (/*CONSTCOND*/ false)
|
||||||
# endif
|
# endif
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
## -------- ##
|
||||||
|
## Checks. ##
|
||||||
|
## -------- ##
|
||||||
|
|
||||||
|
b4_token_ctor_if([b4_variant_if([],
|
||||||
|
[b4_fatal_at(b4_percent_define_get_loc(api.token.constructor),
|
||||||
|
[cannot use '%s' without '%s'],
|
||||||
|
[%define api.token.constructor],
|
||||||
|
[%define api.value.type variant]))])])
|
||||||
|
|||||||
+7
-7
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Common code for C-like languages (C, C++, Java, etc.)
|
# Common code for C-like languages (C, C++, Java, etc.)
|
||||||
|
|
||||||
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2012-2015, 2018 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
|
||||||
@@ -17,14 +17,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, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# b4_comment_(TEXT, OPEN, CONTINUE, END)
|
# _b4_comment(TEXT, OPEN, CONTINUE, END)
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
||||||
# Avoid adding indentation to the first line, as the indentation comes
|
# Avoid adding indentation to the first line, as the indentation comes
|
||||||
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
||||||
#
|
#
|
||||||
# Prefix all the output lines with PREFIX.
|
# Prefix all the output lines with PREFIX.
|
||||||
m4_define([b4_comment_],
|
m4_define([_b4_comment],
|
||||||
[$2[]m4_bpatsubst(m4_expand([[$1]]), [
|
[$2[]m4_bpatsubst(m4_expand([[$1]]), [
|
||||||
\(.\)], [
|
\(.\)], [
|
||||||
$3\1])$4])
|
$3\1])$4])
|
||||||
@@ -34,17 +34,17 @@ $3\1])$4])
|
|||||||
# --------------------------
|
# --------------------------
|
||||||
# Put TEXT in comment. Prefix all the output lines with PREFIX.
|
# Put TEXT in comment. Prefix all the output lines with PREFIX.
|
||||||
m4_define([b4_comment],
|
m4_define([b4_comment],
|
||||||
[b4_comment_([$1], [$2/* ], [$2 ], [ */])])
|
[_b4_comment([$1], [$2/* ], [$2 ], [ */])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_dollar_dollar_(VALUE, FIELD, DEFAULT-FIELD)
|
# _b4_dollar_dollar(VALUE, FIELD, DEFAULT-FIELD)
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# If FIELD (or DEFAULT-FIELD) is non-null, return "VALUE.FIELD",
|
# If FIELD (or DEFAULT-FIELD) is non-null, return "VALUE.FIELD",
|
||||||
# otherwise just VALUE. Be sure to pass "(VALUE)" is VALUE is a
|
# otherwise just VALUE. Be sure to pass "(VALUE)" is VALUE is a
|
||||||
# pointer.
|
# pointer.
|
||||||
m4_define([b4_dollar_dollar_],
|
m4_define([_b4_dollar_dollar],
|
||||||
[b4_symbol_value([$1],
|
[b4_symbol_value([$1],
|
||||||
m4_if([$2], [[]],
|
m4_if([$2], [[]],
|
||||||
[[$3]], [[$2]]))])
|
[[$3]], [[$2]]))])
|
||||||
@@ -56,7 +56,7 @@ m4_define([b4_dollar_dollar_],
|
|||||||
# and b4_at_dollar for LOCATION.
|
# and b4_at_dollar for LOCATION.
|
||||||
m4_define([b4_dollar_pushdef],
|
m4_define([b4_dollar_pushdef],
|
||||||
[m4_pushdef([b4_dollar_dollar],
|
[m4_pushdef([b4_dollar_dollar],
|
||||||
[b4_dollar_dollar_([$1], m4_dquote($][1), [$2])])dnl
|
[_b4_dollar_dollar([$1], m4_dquote($][1), [$2])])dnl
|
||||||
m4_pushdef([b4_at_dollar], [$3])dnl
|
m4_pushdef([b4_at_dollar], [$3])dnl
|
||||||
])
|
])
|
||||||
m4_define([b4_dollar_popdef],
|
m4_define([b4_dollar_popdef],
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
# C skeleton dispatching for Bison.
|
# C skeleton dispatching for Bison.
|
||||||
|
|
||||||
# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2006-2007, 2009-2015, 2018 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
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# C M4 Macros for Bison.
|
# C M4 Macros for Bison.
|
||||||
|
|
||||||
# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2004-2015, 2018 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
|
||||||
@@ -97,7 +97,8 @@ m4_define([b4_api_PREFIX],
|
|||||||
m4_define_default([b4_prefix], [b4_api_prefix])
|
m4_define_default([b4_prefix], [b4_api_prefix])
|
||||||
|
|
||||||
# If the %union is not named, its name is YYSTYPE.
|
# If the %union is not named, its name is YYSTYPE.
|
||||||
m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE])
|
b4_percent_define_default([[api.value.union.name]],
|
||||||
|
[b4_api_PREFIX[][STYPE]])
|
||||||
|
|
||||||
|
|
||||||
## ------------------------ ##
|
## ------------------------ ##
|
||||||
@@ -150,7 +151,7 @@ m4_popdef([$1])dnl
|
|||||||
|
|
||||||
# b4_parse_param_use([VAL], [LOC])
|
# b4_parse_param_use([VAL], [LOC])
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
# `YYUSE' VAL, LOC if locations are enabled, and all the parse-params.
|
# 'YYUSE' VAL, LOC if locations are enabled, and all the parse-params.
|
||||||
m4_define([b4_parse_param_use],
|
m4_define([b4_parse_param_use],
|
||||||
[m4_ifvaln([$1], [ YYUSE ([$1]);])dnl
|
[m4_ifvaln([$1], [ YYUSE ([$1]);])dnl
|
||||||
b4_locations_if([m4_ifvaln([$2], [ YYUSE ([$2]);])])dnl
|
b4_locations_if([m4_ifvaln([$2], [ YYUSE ([$2]);])])dnl
|
||||||
@@ -171,10 +172,10 @@ m4_define([b4_int_type],
|
|||||||
[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
|
[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
|
||||||
b4_ints_in($@, [-128], [127]), [1], [signed char],
|
b4_ints_in($@, [-128], [127]), [1], [signed char],
|
||||||
|
|
||||||
b4_ints_in($@, [0], [65535]), [1], [unsigned short int],
|
b4_ints_in($@, [0], [65535]), [1], [unsigned short],
|
||||||
b4_ints_in($@, [-32768], [32767]), [1], [short int],
|
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
||||||
|
|
||||||
m4_eval([0 <= $1]), [1], [unsigned int],
|
m4_eval([0 <= $1]), [1], [unsigned],
|
||||||
|
|
||||||
[int])])
|
[int])])
|
||||||
|
|
||||||
@@ -182,7 +183,7 @@ m4_define([b4_int_type],
|
|||||||
# b4_int_type_for(NAME)
|
# b4_int_type_for(NAME)
|
||||||
# ---------------------
|
# ---------------------
|
||||||
# Return the smallest int type able to handle numbers ranging from
|
# Return the smallest int type able to handle numbers ranging from
|
||||||
# `NAME_min' to `NAME_max' (included).
|
# 'NAME_min' to 'NAME_max' (included).
|
||||||
m4_define([b4_int_type_for],
|
m4_define([b4_int_type_for],
|
||||||
[b4_int_type($1_min, $1_max)])
|
[b4_int_type($1_min, $1_max)])
|
||||||
|
|
||||||
@@ -199,21 +200,94 @@ m4_define([b4_table_value_equals],
|
|||||||
[(!!(($2) == ($3)))])])
|
[(!!(($2) == ($3)))])])
|
||||||
|
|
||||||
|
|
||||||
## ---------##
|
## ----------------- ##
|
||||||
## Values. ##
|
## Compiler issues. ##
|
||||||
## ---------##
|
## ----------------- ##
|
||||||
|
|
||||||
|
# b4_attribute_define([noreturn])
|
||||||
|
# -------------------------------
|
||||||
|
# Provide portable compiler "attributes". If "noreturn" is passed, define
|
||||||
|
# _Noreturn.
|
||||||
|
m4_define([b4_attribute_define],
|
||||||
|
[[#ifndef YY_ATTRIBUTE
|
||||||
|
# if (defined __GNUC__ \
|
||||||
|
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
|
||||||
|
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
|
||||||
|
# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
|
||||||
|
# else
|
||||||
|
# define YY_ATTRIBUTE(Spec) /* empty */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YY_ATTRIBUTE_PURE
|
||||||
|
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YY_ATTRIBUTE_UNUSED
|
||||||
|
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
]m4_bmatch([$1], [\bnoreturn\b], [[/* The _Noreturn keyword of C11. */
|
||||||
|
#if ! defined _Noreturn
|
||||||
|
# if defined __cplusplus && 201103L <= __cplusplus
|
||||||
|
# define _Noreturn [[noreturn]]
|
||||||
|
# elif !(defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)
|
||||||
|
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
||||||
|
|| 0x5110 <= __SUNPRO_C)
|
||||||
|
# define _Noreturn __attribute__ ((__noreturn__))
|
||||||
|
# elif defined _MSC_VER && 1200 <= _MSC_VER
|
||||||
|
# define _Noreturn __declspec (noreturn)
|
||||||
|
# else
|
||||||
|
# define _Noreturn
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
]])[/* Suppress unused-variable warnings by "using" E. */
|
||||||
|
#if ! defined lint || defined __GNUC__
|
||||||
|
# define YYUSE(E) ((void) (E))
|
||||||
|
#else
|
||||||
|
# define YYUSE(E) /* empty */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
|
||||||
|
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
||||||
|
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
||||||
|
_Pragma ("GCC diagnostic push") \
|
||||||
|
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
|
||||||
|
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
||||||
|
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
||||||
|
_Pragma ("GCC diagnostic pop")
|
||||||
|
#else
|
||||||
|
# define YY_INITIAL_VALUE(Value) Value
|
||||||
|
#endif
|
||||||
|
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||||
|
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||||
|
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||||
|
#endif
|
||||||
|
#ifndef YY_INITIAL_VALUE
|
||||||
|
# define YY_INITIAL_VALUE(Value) /* Nothing. */
|
||||||
|
#endif
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
# b4_null_define
|
# b4_null_define
|
||||||
# --------------
|
# --------------
|
||||||
# Portability issues: define a YY_NULL appropriate for the current
|
# Portability issues: define a YY_NULLPTR appropriate for the current
|
||||||
# language (C, C++98, or C++11).
|
# language (C, C++98, or C++11).
|
||||||
|
#
|
||||||
|
# In C++ pre C++11 it is standard practice to use 0 (not NULL) for the
|
||||||
|
# null pointer. In C, prefer ((void*)0) to avoid having to include stdlib.h.
|
||||||
m4_define([b4_null_define],
|
m4_define([b4_null_define],
|
||||||
[# ifndef YY_NULL
|
[# ifndef YY_NULLPTR
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
# if defined __cplusplus
|
||||||
# define YY_NULL nullptr
|
# if 201103L <= __cplusplus
|
||||||
|
# define YY_NULLPTR nullptr
|
||||||
|
# else
|
||||||
|
# define YY_NULLPTR 0
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
# define YY_NULL 0
|
# define YY_NULLPTR ((void*)0)
|
||||||
# endif
|
# endif
|
||||||
# endif[]dnl
|
# endif[]dnl
|
||||||
])
|
])
|
||||||
@@ -222,7 +296,13 @@ m4_define([b4_null_define],
|
|||||||
# b4_null
|
# b4_null
|
||||||
# -------
|
# -------
|
||||||
# Return a null pointer constant.
|
# Return a null pointer constant.
|
||||||
m4_define([b4_null], [YY_NULL])
|
m4_define([b4_null], [YY_NULLPTR])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## ---------##
|
||||||
|
## Values. ##
|
||||||
|
## ---------##
|
||||||
|
|
||||||
# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
|
# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
@@ -297,7 +377,7 @@ m4_define([b4_token_enums_defines],
|
|||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Given a semantic value VAL ($$, $1 etc.), extract its value of type
|
# Given a semantic value VAL ($$, $1 etc.), extract its value of type
|
||||||
# TYPE if TYPE is given, otherwise just return VAL. The result can be
|
# TYPE if TYPE is given, otherwise just return VAL. The result can be
|
||||||
# used safetly, it is put in parens to avoid nasty precedence issues.
|
# used safely, it is put in parens to avoid nasty precedence issues.
|
||||||
# TYPE is *not* put in braces, provide some if needed.
|
# TYPE is *not* put in braces, provide some if needed.
|
||||||
m4_define([b4_symbol_value],
|
m4_define([b4_symbol_value],
|
||||||
[($1[]m4_ifval([$2], [.$2]))])
|
[($1[]m4_ifval([$2], [.$2]))])
|
||||||
@@ -395,7 +475,8 @@ b4_syncline([@oline@], [@ofile@])
|
|||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
m4_define([b4_predicate_case],
|
m4_define([b4_predicate_case],
|
||||||
[ case $1:
|
[ case $1:
|
||||||
if (! ($2)) YYERROR;
|
if (! (
|
||||||
|
$2)) YYERROR;
|
||||||
b4_syncline([@oline@], [@ofile@])
|
b4_syncline([@oline@], [@ofile@])
|
||||||
break;])
|
break;])
|
||||||
|
|
||||||
@@ -421,12 +502,9 @@ m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
|||||||
yymsg = "Deleting";
|
yymsg = "Deleting";
|
||||||
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
||||||
|
|
||||||
switch (yytype)
|
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||||
{
|
]b4_symbol_actions([destructor])[
|
||||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||||
[ default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}]dnl
|
}]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -436,84 +514,206 @@ m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
|||||||
# Define the "yy_symbol_print" function.
|
# Define the "yy_symbol_print" function.
|
||||||
m4_define_default([b4_yy_symbol_print_define],
|
m4_define_default([b4_yy_symbol_print_define],
|
||||||
[[
|
[[
|
||||||
/*--------------------------------.
|
/*-----------------------------------.
|
||||||
| Print this symbol on YYOUTPUT. |
|
| Print this symbol's value on YYO. |
|
||||||
`--------------------------------*/
|
`-----------------------------------*/
|
||||||
|
|
||||||
]b4_function_define([yy_symbol_value_print],
|
]b4_function_define([yy_symbol_value_print],
|
||||||
[static void],
|
[static void],
|
||||||
[[FILE *yyoutput], [yyoutput]],
|
[[FILE *yyo], [yyo]],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
||||||
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
FILE *yyo = yyoutput;
|
FILE *yyoutput = yyo;
|
||||||
]b4_parse_param_use([yyo], [yylocationp])dnl
|
]b4_parse_param_use([yyoutput], [yylocationp])dnl
|
||||||
[ if (!yyvaluep)
|
[ if (!yyvaluep)
|
||||||
return;]
|
return;]
|
||||||
dnl glr.c does not feature yytoknum.
|
dnl glr.c does not feature yytoknum.
|
||||||
m4_if(b4_skeleton, ["yacc.c"],
|
m4_if(b4_skeleton, ["yacc.c"],
|
||||||
[[# ifdef YYPRINT
|
[[# ifdef YYPRINT
|
||||||
if (yytype < YYNTOKENS)
|
if (yytype < YYNTOKENS)
|
||||||
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
|
||||||
# endif
|
# endif
|
||||||
]])dnl
|
]])dnl
|
||||||
[ switch (yytype)
|
b4_symbol_actions([printer])[
|
||||||
{
|
|
||||||
]b4_symbol_foreach([b4_symbol_printer])dnl
|
|
||||||
[ default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------.
|
/*---------------------------.
|
||||||
| Print this symbol on YYOUTPUT. |
|
| Print this symbol on YYO. |
|
||||||
`--------------------------------*/
|
`---------------------------*/
|
||||||
|
|
||||||
]b4_function_define([yy_symbol_print],
|
]b4_function_define([yy_symbol_print],
|
||||||
[static void],
|
[static void],
|
||||||
[[FILE *yyoutput], [yyoutput]],
|
[[FILE *yyo], [yyo]],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
|
||||||
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
|
||||||
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||||
{
|
{
|
||||||
YYFPRINTF (yyoutput, "%s %s (",
|
YYFPRINTF (yyo, "%s %s (",
|
||||||
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
|
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
|
||||||
|
|
||||||
]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
|
]b4_locations_if([ YY_LOCATION_PRINT (yyo, *yylocationp);
|
||||||
YYFPRINTF (yyoutput, ": ");
|
YYFPRINTF (yyo, ": ");
|
||||||
])dnl
|
])dnl
|
||||||
[ yy_symbol_value_print (yyoutput, yytype, yyvaluep]dnl
|
[ yy_symbol_value_print (yyo, yytype, yyvaluep]dnl
|
||||||
b4_locations_if([, yylocationp])[]b4_user_args[);
|
b4_locations_if([, yylocationp])[]b4_user_args[);
|
||||||
YYFPRINTF (yyoutput, ")");
|
YYFPRINTF (yyo, ")");
|
||||||
}]dnl
|
}]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
## ---------------- ##
|
||||||
|
## api.value.type. ##
|
||||||
|
## ---------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------- #
|
||||||
|
# api.value.type=union. #
|
||||||
|
# ---------------------- #
|
||||||
|
|
||||||
|
# b4_symbol_type_register(SYMBOL-NUM)
|
||||||
|
# -----------------------------------
|
||||||
|
# Symbol SYMBOL-NUM has a type (for variant) instead of a type-tag.
|
||||||
|
# Extend the definition of %union's body (b4_union_members) with a
|
||||||
|
# field of that type, and extend the symbol's "type" field to point to
|
||||||
|
# the field name, instead of the type name.
|
||||||
|
m4_define([b4_symbol_type_register],
|
||||||
|
[m4_define([b4_symbol($1, type_tag)],
|
||||||
|
[b4_symbol_if([$1], [has_id],
|
||||||
|
[b4_symbol([$1], [id])],
|
||||||
|
[yytype_[]b4_symbol([$1], [number])])])dnl
|
||||||
|
m4_append([b4_union_members],
|
||||||
|
m4_expand([
|
||||||
|
b4_symbol_tag_comment([$1])dnl
|
||||||
|
b4_symbol([$1], [type]) b4_symbol([$1], [type_tag]);]))
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_type_define_tag(SYMBOL1-NUM, ...)
|
||||||
|
# ------------------------------------
|
||||||
|
# For the batch of symbols SYMBOL1-NUM... (which all have the same
|
||||||
|
# type), enhance the %union definition for each of them, and set
|
||||||
|
# there "type" field to the field tag name, instead of the type name.
|
||||||
|
m4_define([b4_type_define_tag],
|
||||||
|
[b4_symbol_if([$1], [has_type],
|
||||||
|
[m4_map([b4_symbol_type_register], [$@])])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_symbol_value_union(VAL, [TYPE])
|
||||||
|
# ----------------------------------
|
||||||
|
# Same of b4_symbol_value, but when api.value.type=union.
|
||||||
|
m4_define([b4_symbol_value_union],
|
||||||
|
[m4_ifval([$2],
|
||||||
|
[(*($2*)(&$1))],
|
||||||
|
[$1])])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_value_type_setup_union
|
||||||
|
# -------------------------
|
||||||
|
# Setup support for api.value.type=union. Symbols are defined with a
|
||||||
|
# type instead of a union member name: build the corresponding union,
|
||||||
|
# and give the symbols their tag.
|
||||||
|
m4_define([b4_value_type_setup_union],
|
||||||
|
[m4_define([b4_union_members])
|
||||||
|
b4_type_foreach([b4_type_define_tag])
|
||||||
|
m4_copy_force([b4_symbol_value_union], [b4_symbol_value])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------- #
|
||||||
|
# api.value.type = variant. #
|
||||||
|
# -------------------------- #
|
||||||
|
|
||||||
|
# b4_value_type_setup_variant
|
||||||
|
# ---------------------------
|
||||||
|
# Setup support for api.value.type=variant. By default, fail, specialized
|
||||||
|
# by other skeletons.
|
||||||
|
m4_define([b4_value_type_setup_variant],
|
||||||
|
[b4_complain_at(b4_percent_define_get_loc([[api.value.type]]),
|
||||||
|
[['%s' does not support '%s']],
|
||||||
|
[b4_skeleton],
|
||||||
|
[%define api.value.type variant])])
|
||||||
|
|
||||||
|
|
||||||
|
# _b4_value_type_setup_keyword
|
||||||
|
# ----------------------------
|
||||||
|
# api.value.type is defined with a keyword/string syntax. Check if
|
||||||
|
# that is properly defined, and prepare its use.
|
||||||
|
m4_define([_b4_value_type_setup_keyword],
|
||||||
|
[b4_percent_define_check_values([[[[api.value.type]],
|
||||||
|
[[none]],
|
||||||
|
[[union]],
|
||||||
|
[[union-directive]],
|
||||||
|
[[variant]],
|
||||||
|
[[yystype]]]])dnl
|
||||||
|
m4_case(b4_percent_define_get([[api.value.type]]),
|
||||||
|
[union], [b4_value_type_setup_union],
|
||||||
|
[variant], [b4_value_type_setup_variant])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_value_type_setup
|
||||||
|
# -------------------
|
||||||
|
# Check if api.value.type is properly defined, and possibly prepare
|
||||||
|
# its use.
|
||||||
|
b4_define_silent([b4_value_type_setup],
|
||||||
|
[# Define default value.
|
||||||
|
b4_percent_define_ifdef([[api.value.type]], [],
|
||||||
|
[# %union => api.value.type=union-directive
|
||||||
|
m4_ifdef([b4_union_members],
|
||||||
|
[m4_define([b4_percent_define_kind(api.value.type)], [keyword])
|
||||||
|
m4_define([b4_percent_define(api.value.type)], [union-directive])],
|
||||||
|
[# no tag seen => api.value.type={int}
|
||||||
|
m4_if(b4_tag_seen_flag, 0,
|
||||||
|
[m4_define([b4_percent_define_kind(api.value.type)], [code])
|
||||||
|
m4_define([b4_percent_define(api.value.type)], [int])],
|
||||||
|
[# otherwise api.value.type=yystype
|
||||||
|
m4_define([b4_percent_define_kind(api.value.type)], [keyword])
|
||||||
|
m4_define([b4_percent_define(api.value.type)], [yystype])])])])
|
||||||
|
|
||||||
|
# Set up.
|
||||||
|
m4_bmatch(b4_percent_define_get_kind([[api.value.type]]),
|
||||||
|
[keyword\|string], [_b4_value_type_setup_keyword])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
## -------------- ##
|
## -------------- ##
|
||||||
## Declarations. ##
|
## Declarations. ##
|
||||||
## -------------- ##
|
## -------------- ##
|
||||||
|
|
||||||
|
|
||||||
# b4_value_type_define
|
# b4_value_type_define
|
||||||
# --------------------
|
# --------------------
|
||||||
m4_define([b4_value_type_define],
|
m4_define([b4_value_type_define],
|
||||||
[[/* Value type. */
|
[b4_value_type_setup[]dnl
|
||||||
#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
|
/* Value type. */
|
||||||
]m4_ifdef([b4_stype],
|
m4_bmatch(b4_percent_define_get_kind([[api.value.type]]),
|
||||||
[[typedef union ]b4_union_name[ ]b4_api_PREFIX[STYPE;
|
[code],
|
||||||
union ]b4_union_name[
|
[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
|
||||||
{
|
typedef ]b4_percent_define_get([[api.value.type]])[ ]b4_api_PREFIX[STYPE;
|
||||||
]b4_user_stype[
|
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1
|
||||||
};
|
|
||||||
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]],
|
|
||||||
[m4_if(b4_tag_seen_flag, 0,
|
|
||||||
[[typedef int ]b4_api_PREFIX[STYPE;
|
|
||||||
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]])])[
|
|
||||||
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
|
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
|
||||||
#endif
|
#endif
|
||||||
]])
|
]],
|
||||||
|
[m4_bmatch(b4_percent_define_get([[api.value.type]]),
|
||||||
|
[union\|union-directive],
|
||||||
|
[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
|
||||||
|
]b4_percent_define_get_syncline([[api.value.union.name]])[
|
||||||
|
union ]b4_percent_define_get([[api.value.union.name]])[
|
||||||
|
{
|
||||||
|
]b4_user_union_members[
|
||||||
|
};
|
||||||
|
]b4_percent_define_get_syncline([[api.value.union.name]])[
|
||||||
|
typedef union ]b4_percent_define_get([[api.value.union.name]])[ ]b4_api_PREFIX[STYPE;
|
||||||
|
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1
|
||||||
|
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
|
||||||
|
#endif
|
||||||
|
]])])])
|
||||||
|
|
||||||
|
|
||||||
# b4_location_type_define
|
# b4_location_type_define
|
||||||
@@ -549,7 +749,7 @@ b4_pure_if([], [[extern ]b4_api_PREFIX[STYPE ]b4_prefix[lval;
|
|||||||
|
|
||||||
|
|
||||||
# b4_YYDEBUG_define
|
# b4_YYDEBUG_define
|
||||||
# ------------------
|
# -----------------
|
||||||
m4_define([b4_YYDEBUG_define],
|
m4_define([b4_YYDEBUG_define],
|
||||||
[[/* Debug traces. */
|
[[/* Debug traces. */
|
||||||
]m4_if(b4_api_prefix, [yy],
|
]m4_if(b4_api_prefix, [yy],
|
||||||
@@ -621,13 +821,13 @@ m4_define([b4_yy_location_print_define],
|
|||||||
|
|
||||||
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
|
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
|
||||||
|
|
||||||
__attribute__((__unused__))
|
YY_ATTRIBUTE_UNUSED
|
||||||
]b4_function_define([yy_location_print_],
|
]b4_function_define([yy_location_print_],
|
||||||
[static unsigned],
|
[static int],
|
||||||
[[FILE *yyo], [yyo]],
|
[[FILE *yyo], [yyo]],
|
||||||
[[YYLTYPE const * const yylocp], [yylocp]])[
|
[[YYLTYPE const * const yylocp], [yylocp]])[
|
||||||
{
|
{
|
||||||
unsigned res = 0;
|
int res = 0;
|
||||||
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
|
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
|
||||||
if (0 <= yylocp->first_line)
|
if (0 <= yylocp->first_line)
|
||||||
{
|
{
|
||||||
|
|||||||
+208
-209
File diff suppressed because it is too large
Load Diff
+33
-31
@@ -1,6 +1,6 @@
|
|||||||
# C++ GLR skeleton for Bison
|
# C++ GLR skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2015, 2018 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,14 +43,8 @@
|
|||||||
# user must initialize the first positions (in particular the
|
# user must initialize the first positions (in particular the
|
||||||
# filename member).
|
# filename member).
|
||||||
|
|
||||||
b4_token_ctor_if([b4_variant_if([],
|
|
||||||
[b4_fatal_at(b4_percent_define_get_loc(api.token.constructor),
|
|
||||||
[cannot use '%s' without '%s'],
|
|
||||||
[%define api.token.constructor],
|
|
||||||
[%define api.value.type variant]))])])
|
|
||||||
|
|
||||||
# We require a pure interface.
|
# We require a pure interface.
|
||||||
m4_define([b4_pure_flag], [1])
|
m4_define([b4_pure_flag], [1])
|
||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c++.m4])
|
m4_include(b4_pkgdatadir/[c++.m4])
|
||||||
b4_bison_locations_if([m4_include(b4_pkgdatadir/[location.cc])])
|
b4_bison_locations_if([m4_include(b4_pkgdatadir/[location.cc])])
|
||||||
@@ -172,6 +166,12 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
]b4_parser_class_name[::operator() ()
|
||||||
|
{
|
||||||
|
return parse ();
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
]b4_parser_class_name[::parse ()
|
]b4_parser_class_name[::parse ()
|
||||||
{
|
{
|
||||||
@@ -183,22 +183,17 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
| Print this symbol. |
|
| Print this symbol. |
|
||||||
`--------------------*/
|
`--------------------*/
|
||||||
|
|
||||||
inline void
|
void
|
||||||
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep]b4_locations_if([[,
|
const semantic_type* yyvaluep]b4_locations_if([[,
|
||||||
const location_type* yylocationp]])[)
|
const location_type* yylocationp]])[)
|
||||||
{]b4_locations_if([[
|
{]b4_locations_if([[
|
||||||
YYUSE (yylocationp);]])[
|
YYUSE (yylocationp);]])[
|
||||||
YYUSE (yyvaluep);
|
YYUSE (yyvaluep);
|
||||||
std::ostream& yyoutput = debug_stream ();
|
std::ostream& yyo = debug_stream ();
|
||||||
std::ostream& yyo = yyoutput;
|
std::ostream& yyoutput = yyo;
|
||||||
YYUSE (yyo);
|
YYUSE (yyoutput);
|
||||||
switch (yytype)
|
]b4_symbol_actions([printer])[
|
||||||
{
|
|
||||||
]b4_symbol_foreach([b4_symbol_printer])dnl
|
|
||||||
[ default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -245,25 +240,28 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
b4_namespace_close
|
b4_namespace_close
|
||||||
])
|
])
|
||||||
|
|
||||||
# b4_shared_declarations
|
|
||||||
# ----------------------
|
# b4_shared_declarations(hh|cc)
|
||||||
# Declaration that might either go into the header (if --defines)
|
# -----------------------------
|
||||||
# or open coded in the parser body.
|
# Declaration that might either go into the header (if --defines, $1 = hh)
|
||||||
|
# or in the implementation file.
|
||||||
m4_define([b4_shared_declarations],
|
m4_define([b4_shared_declarations],
|
||||||
[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||||
b4_percent_code_get([[requires]])[
|
b4_percent_code_get([[requires]])[
|
||||||
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>]b4_defines_if([
|
|
||||||
b4_bison_locations_if([[#include "location.hh"]])])[
|
]m4_ifdef([b4_location_file],
|
||||||
|
[[# include ]b4_location_include])[
|
||||||
|
|
||||||
|
]b4_null_define[
|
||||||
|
|
||||||
]b4_YYDEBUG_define[
|
]b4_YYDEBUG_define[
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
]b4_defines_if([],
|
]b4_bison_locations_if([m4_ifndef([b4_location_file],
|
||||||
[b4_bison_locations_if([b4_position_define
|
[b4_location_define])])[
|
||||||
b4_location_define])])[
|
|
||||||
|
|
||||||
/// A Bison parser.
|
/// A Bison parser.
|
||||||
class ]b4_parser_class_name[
|
class ]b4_parser_class_name[
|
||||||
@@ -275,6 +273,10 @@ b4_location_define])])[
|
|||||||
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
||||||
virtual ~]b4_parser_class_name[ ();
|
virtual ~]b4_parser_class_name[ ();
|
||||||
|
|
||||||
|
/// Parse. An alias for parse ().
|
||||||
|
/// \returns 0 iff parsing succeeded.
|
||||||
|
int operator() ();
|
||||||
|
|
||||||
/// Parse.
|
/// Parse.
|
||||||
/// \returns 0 iff parsing succeeded.
|
/// \returns 0 iff parsing succeeded.
|
||||||
virtual int parse ();
|
virtual int parse ();
|
||||||
@@ -340,14 +342,14 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
|||||||
b4_defines_if(
|
b4_defines_if(
|
||||||
[b4_output_begin([b4_spec_defines_file])
|
[b4_output_begin([b4_spec_defines_file])
|
||||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||||
[2002-2013])[
|
[2002-2015, 2018])[
|
||||||
|
|
||||||
// C++ GLR parser skeleton written by Akim Demaille.
|
// C++ GLR parser skeleton written by Akim Demaille.
|
||||||
|
|
||||||
|
]b4_disclaimer[
|
||||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||||
]b4_shared_declarations[
|
]b4_shared_declarations[
|
||||||
]b4_cpp_guard_close([b4_spec_defines_file])[
|
]b4_cpp_guard_close([b4_spec_defines_file])[
|
||||||
]b4_output_end()])
|
]b4_output_end])
|
||||||
|
|
||||||
# Let glr.c (and b4_shared_declarations) believe that the user
|
# Let glr.c (and b4_shared_declarations) believe that the user
|
||||||
# arguments include the parser itself.
|
# arguments include the parser itself.
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Java skeleton dispatching for Bison.
|
# Java skeleton dispatching for Bison.
|
||||||
|
|
||||||
# Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2007, 2009-2015, 2018 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
|
||||||
|
|||||||
+18
-2
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Java language support for Bison
|
# Java language support for Bison
|
||||||
|
|
||||||
# Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2007-2015, 2018 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
|
||||||
@@ -103,7 +103,7 @@ m4_define([b4_int_type],
|
|||||||
# b4_int_type_for(NAME)
|
# b4_int_type_for(NAME)
|
||||||
# ---------------------
|
# ---------------------
|
||||||
# Return the smallest int type able to handle numbers ranging from
|
# Return the smallest int type able to handle numbers ranging from
|
||||||
# `NAME_min' to `NAME_max' (included).
|
# 'NAME_min' to 'NAME_max' (included).
|
||||||
m4_define([b4_int_type_for],
|
m4_define([b4_int_type_for],
|
||||||
[b4_int_type($1_min, $1_max)])
|
[b4_int_type($1_min, $1_max)])
|
||||||
|
|
||||||
@@ -169,6 +169,22 @@ m4_define([b4_predicate_case], [ case $1:
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
## -------- ##
|
||||||
|
## Checks. ##
|
||||||
|
## -------- ##
|
||||||
|
|
||||||
|
b4_percent_define_check_kind([[api.value.type]], [code], [deprecated])
|
||||||
|
|
||||||
|
b4_percent_define_check_kind([[annotations]], [code], [deprecated])
|
||||||
|
b4_percent_define_check_kind([[extends]], [code], [deprecated])
|
||||||
|
b4_percent_define_check_kind([[implements]], [code], [deprecated])
|
||||||
|
b4_percent_define_check_kind([[init_throws]], [code], [deprecated])
|
||||||
|
b4_percent_define_check_kind([[lex_throws]], [code], [deprecated])
|
||||||
|
b4_percent_define_check_kind([[parser_class_name]], [code], [deprecated])
|
||||||
|
b4_percent_define_check_kind([[throws]], [code], [deprecated])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Default values. ##
|
## Default values. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|||||||
+273
-215
@@ -1,6 +1,6 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2015, 2018 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
|
||||||
@@ -17,6 +17,9 @@
|
|||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c++.m4])
|
m4_include(b4_pkgdatadir/[c++.m4])
|
||||||
|
|
||||||
|
# api.value.type=variant is valid.
|
||||||
|
m4_define([b4_value_type_setup_variant])
|
||||||
|
|
||||||
|
|
||||||
# b4_integral_parser_table_declare(TABLE-NAME, CONTENT, COMMENT)
|
# b4_integral_parser_table_declare(TABLE-NAME, CONTENT, COMMENT)
|
||||||
# --------------------------------------------------------------
|
# --------------------------------------------------------------
|
||||||
@@ -38,13 +41,14 @@ m4_define([b4_integral_parser_table_define],
|
|||||||
};dnl
|
};dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_symbol_value_template(VAL, [TYPE])
|
# b4_symbol_value_template(VAL, [TYPE])
|
||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
# Same as b4_symbol_value, but used in a template method. It makes
|
# Same as b4_symbol_value, but used in a template method. It makes
|
||||||
# a difference when using variants.
|
# a difference when using variants. Note that b4_value_type_setup_union
|
||||||
|
# overrides b4_symbol_value, so we must override it again.
|
||||||
m4_copy([b4_symbol_value], [b4_symbol_value_template])
|
m4_copy([b4_symbol_value], [b4_symbol_value_template])
|
||||||
|
m4_append([b4_value_type_setup_union],
|
||||||
|
[m4_copy_force([b4_symbol_value_union], [b4_symbol_value_template])])
|
||||||
|
|
||||||
# b4_lhs_value([TYPE])
|
# b4_lhs_value([TYPE])
|
||||||
# --------------------
|
# --------------------
|
||||||
@@ -80,9 +84,14 @@ m4_define([b4_rhs_state],
|
|||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||||
# symbols on RHS.
|
# symbols on RHS.
|
||||||
m4_define([b4_rhs_value],
|
m4_define([_b4_rhs_value],
|
||||||
[b4_symbol_value([b4_rhs_data([$1], [$2]).value], [$3])])
|
[b4_symbol_value([b4_rhs_data([$1], [$2]).value], [$3])])
|
||||||
|
|
||||||
|
m4_define([b4_rhs_value],
|
||||||
|
[b4_percent_define_ifdef([api.value.automove],
|
||||||
|
[YY_MOVE (_b4_rhs_value($@))],
|
||||||
|
[_b4_rhs_value($@)])])
|
||||||
|
|
||||||
|
|
||||||
# b4_rhs_location(RULE-LENGTH, NUM)
|
# b4_rhs_location(RULE-LENGTH, NUM)
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -103,8 +112,8 @@ b4_dollar_pushdef([yysym.value],
|
|||||||
b4_symbol_if([$1], [has_type],
|
b4_symbol_if([$1], [has_type],
|
||||||
[m4_dquote(b4_symbol([$1], [type]))]),
|
[m4_dquote(b4_symbol([$1], [type]))]),
|
||||||
[yysym.location])dnl
|
[yysym.location])dnl
|
||||||
b4_symbol_case_([$1])
|
_b4_symbol_case([$1])
|
||||||
b4_syncline([b4_symbol([$1], [$2_line])], ["b4_symbol([$1], [$2_file])"])
|
b4_syncline([b4_symbol([$1], [$2_line])], [b4_symbol([$1], [$2_file])])
|
||||||
b4_symbol([$1], [$2])
|
b4_symbol([$1], [$2])
|
||||||
b4_syncline([@oline@], [@ofile@])
|
b4_syncline([@oline@], [@ofile@])
|
||||||
break;
|
break;
|
||||||
@@ -128,7 +137,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
|
|||||||
|
|
||||||
|
|
||||||
m4_pushdef([b4_copyright_years],
|
m4_pushdef([b4_copyright_years],
|
||||||
[2002-2013])
|
[2002-2015, 2018])
|
||||||
|
|
||||||
m4_define([b4_parser_class_name],
|
m4_define([b4_parser_class_name],
|
||||||
[b4_percent_define_get([[parser_class_name]])])
|
[b4_percent_define_get([[parser_class_name]])])
|
||||||
@@ -139,29 +148,35 @@ b4_bison_locations_if([# Backward compatibility.
|
|||||||
m4_include(b4_pkgdatadir/[stack.hh])
|
m4_include(b4_pkgdatadir/[stack.hh])
|
||||||
b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])])
|
b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])])
|
||||||
|
|
||||||
# b4_shared_declarations
|
|
||||||
# ----------------------
|
# b4_shared_declarations(hh|cc)
|
||||||
# Declaration that might either go into the header (if --defines)
|
# -----------------------------
|
||||||
# or open coded in the parser body.
|
# Declaration that might either go into the header (if --defines, $1 = hh)
|
||||||
|
# or in the implementation file.
|
||||||
m4_define([b4_shared_declarations],
|
m4_define([b4_shared_declarations],
|
||||||
[b4_percent_code_get([[requires]])[
|
[b4_percent_code_get([[requires]])[
|
||||||
]b4_parse_assert_if([# include <cassert>])[
|
]b4_parse_assert_if([# include <cassert>])[
|
||||||
# include <vector>
|
# include <cstdlib> // std::abort
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
# include <stdexcept>
|
# include <stdexcept>
|
||||||
# include <string>]b4_defines_if([[
|
# include <string>
|
||||||
# include "stack.hh"
|
# include <vector>
|
||||||
]b4_bison_locations_if([[# include "location.hh"]])])[
|
|
||||||
|
]b4_cxx_portability[
|
||||||
|
]m4_ifdef([b4_location_include],
|
||||||
|
[[# include ]b4_location_include])[
|
||||||
]b4_variant_if([b4_variant_includes])[
|
]b4_variant_if([b4_variant_includes])[
|
||||||
|
|
||||||
|
]b4_attribute_define[
|
||||||
|
]b4_null_define[
|
||||||
|
|
||||||
]b4_YYDEBUG_define[
|
]b4_YYDEBUG_define[
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
|
|
||||||
]b4_defines_if([],
|
]b4_stack_define[
|
||||||
[b4_stack_define
|
]b4_bison_locations_if([m4_ifndef([b4_location_file],
|
||||||
b4_bison_locations_if([b4_position_define
|
[b4_location_define])])[
|
||||||
b4_location_define])])[
|
|
||||||
|
|
||||||
]b4_variant_if([b4_variant_define])[
|
]b4_variant_if([b4_variant_define])[
|
||||||
|
|
||||||
@@ -170,24 +185,29 @@ b4_location_define])])[
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
]b4_public_types_declare[
|
]b4_public_types_declare[
|
||||||
|
]b4_symbol_type_declare[
|
||||||
/// Build a parser object.
|
/// Build a parser object.
|
||||||
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
||||||
virtual ~]b4_parser_class_name[ ();
|
virtual ~]b4_parser_class_name[ ();
|
||||||
|
|
||||||
|
/// Parse. An alias for parse ().
|
||||||
|
/// \returns 0 iff parsing succeeded.
|
||||||
|
int operator() ();
|
||||||
|
|
||||||
/// Parse.
|
/// Parse.
|
||||||
/// \returns 0 iff parsing succeeded.
|
/// \returns 0 iff parsing succeeded.
|
||||||
virtual int parse ();
|
virtual int parse ();
|
||||||
|
|
||||||
#if ]b4_api_PREFIX[DEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
/// The current debugging stream.
|
/// The current debugging stream.
|
||||||
std::ostream& debug_stream () const;
|
std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
|
||||||
/// Set the current debugging stream.
|
/// Set the current debugging stream.
|
||||||
void set_debug_stream (std::ostream &);
|
void set_debug_stream (std::ostream &);
|
||||||
|
|
||||||
/// Type for debugging levels.
|
/// Type for debugging levels.
|
||||||
typedef int debug_level_type;
|
typedef int debug_level_type;
|
||||||
/// The current debugging level.
|
/// The current debugging level.
|
||||||
debug_level_type debug_level () const;
|
debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
|
||||||
/// Set the current debugging level.
|
/// Set the current debugging level.
|
||||||
void set_debug_level (debug_level_type l);
|
void set_debug_level (debug_level_type l);
|
||||||
#endif
|
#endif
|
||||||
@@ -200,20 +220,26 @@ b4_location_define])])[
|
|||||||
/// Report a syntax error.
|
/// Report a syntax error.
|
||||||
void error (const syntax_error& err);
|
void error (const syntax_error& err);
|
||||||
|
|
||||||
|
]b4_symbol_constructor_declare[
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// This class is not copyable.
|
||||||
|
]b4_parser_class_name[ (const ]b4_parser_class_name[&);
|
||||||
|
]b4_parser_class_name[& operator= (const ]b4_parser_class_name[&);
|
||||||
|
|
||||||
/// State numbers.
|
/// State numbers.
|
||||||
typedef int state_type;
|
typedef int state_type;
|
||||||
|
|
||||||
/// Generate an error message.
|
/// Generate an error message.
|
||||||
/// \param yystate the state where the error occurred.
|
/// \param yystate the state where the error occurred.
|
||||||
/// \param yytoken the lookahead token type, or yyempty_.
|
/// \param yyla the lookahead token.
|
||||||
virtual std::string yysyntax_error_ (state_type yystate,
|
virtual std::string yysyntax_error_ (state_type yystate,
|
||||||
symbol_number_type yytoken) const;
|
const symbol_type& yyla) const;
|
||||||
|
|
||||||
/// Compute post-reduction state.
|
/// Compute post-reduction state.
|
||||||
/// \param yystate the current state
|
/// \param yystate the current state
|
||||||
/// \param yylhs the nonterminal to push on the stack
|
/// \param yysym the nonterminal to push on the stack
|
||||||
state_type yy_lr_goto_state_ (state_type yystate, int yylhs);
|
state_type yy_lr_goto_state_ (state_type yystate, int yysym);
|
||||||
|
|
||||||
/// Whether the given \c yypact_ value indicates a defaulted state.
|
/// Whether the given \c yypact_ value indicates a defaulted state.
|
||||||
/// \param yyvalue the value to check
|
/// \param yyvalue the value to check
|
||||||
@@ -246,8 +272,9 @@ b4_location_define])])[
|
|||||||
/// Print the state stack on the debug stream.
|
/// Print the state stack on the debug stream.
|
||||||
virtual void yystack_print_ ();
|
virtual void yystack_print_ ();
|
||||||
|
|
||||||
// Debugging.
|
/// Debugging level.
|
||||||
int yydebug_;
|
int yydebug_;
|
||||||
|
/// Debug stream.
|
||||||
std::ostream* yycdebug_;
|
std::ostream* yycdebug_;
|
||||||
|
|
||||||
/// \brief Display a symbol type, value and location.
|
/// \brief Display a symbol type, value and location.
|
||||||
@@ -260,7 +287,7 @@ b4_location_define])])[
|
|||||||
/// \brief Reclaim the memory associated to a symbol.
|
/// \brief Reclaim the memory associated to a symbol.
|
||||||
/// \param yymsg Why this token is reclaimed.
|
/// \param yymsg Why this token is reclaimed.
|
||||||
/// If null, print nothing.
|
/// If null, print nothing.
|
||||||
/// \param s The symbol.
|
/// \param yysym The symbol.
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
|
void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
|
||||||
|
|
||||||
@@ -280,16 +307,21 @@ b4_location_define])])[
|
|||||||
/// Copy constructor.
|
/// Copy constructor.
|
||||||
by_state (const by_state& other);
|
by_state (const by_state& other);
|
||||||
|
|
||||||
|
/// Record that this symbol is empty.
|
||||||
|
void clear ();
|
||||||
|
|
||||||
/// Steal the symbol type from \a that.
|
/// Steal the symbol type from \a that.
|
||||||
void move (by_state& that);
|
void move (by_state& that);
|
||||||
|
|
||||||
/// The (internal) type number (corresponding to \a state).
|
/// The (internal) type number (corresponding to \a state).
|
||||||
/// "empty" when empty.
|
/// \a empty_symbol when empty.
|
||||||
symbol_number_type type_get () const;
|
symbol_number_type type_get () const;
|
||||||
|
|
||||||
enum { empty = 0 };
|
/// The state number used to denote an empty symbol.
|
||||||
|
enum { empty_state = -1 };
|
||||||
|
|
||||||
/// The state.
|
/// The state.
|
||||||
|
/// \a empty when empty.
|
||||||
state_type state;
|
state_type state;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -300,10 +332,15 @@ b4_location_define])])[
|
|||||||
typedef basic_symbol<by_state> super_type;
|
typedef basic_symbol<by_state> super_type;
|
||||||
/// Construct an empty symbol.
|
/// Construct an empty symbol.
|
||||||
stack_symbol_type ();
|
stack_symbol_type ();
|
||||||
|
/// Move or copy construction.
|
||||||
|
stack_symbol_type (YY_RVREF (stack_symbol_type) that);
|
||||||
/// Steal the contents from \a sym to build this.
|
/// Steal the contents from \a sym to build this.
|
||||||
stack_symbol_type (state_type s, symbol_type& sym);
|
stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
|
||||||
/// Assignment, needed by push_back.
|
#if !defined __cplusplus || __cplusplus < 201103L
|
||||||
stack_symbol_type& operator= (const stack_symbol_type& that);
|
/// Assignment, needed by push_back by some old implementations.
|
||||||
|
/// Moves the contents of that.
|
||||||
|
stack_symbol_type& operator= (stack_symbol_type& that);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Stack type.
|
/// Stack type.
|
||||||
@@ -315,39 +352,38 @@ b4_location_define])])[
|
|||||||
/// Push a new state on the stack.
|
/// Push a new state on the stack.
|
||||||
/// \param m a debug message to display
|
/// \param m a debug message to display
|
||||||
/// if null, no trace is output.
|
/// if null, no trace is output.
|
||||||
/// \param s the symbol
|
/// \param sym the symbol
|
||||||
/// \warning the contents of \a s.value is stolen.
|
/// \warning the contents of \a s.value is stolen.
|
||||||
void yypush_ (const char* m, stack_symbol_type& s);
|
void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
|
||||||
|
|
||||||
/// Push a new look ahead token on the state on the stack.
|
/// Push a new look ahead token on the state on the stack.
|
||||||
/// \param m a debug message to display
|
/// \param m a debug message to display
|
||||||
/// if null, no trace is output.
|
/// if null, no trace is output.
|
||||||
/// \param s the state
|
/// \param s the state
|
||||||
/// \param sym the symbol (for its value and location).
|
/// \param sym the symbol (for its value and location).
|
||||||
/// \warning the contents of \a s.value is stolen.
|
/// \warning the contents of \a sym.value is stolen.
|
||||||
void yypush_ (const char* m, state_type s, symbol_type& sym);
|
void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
|
||||||
|
|
||||||
/// Pop \a n symbols the three stacks.
|
/// Pop \a n symbols from the stack.
|
||||||
void yypop_ (unsigned int n = 1);
|
void yypop_ (int n = 1);
|
||||||
|
|
||||||
// Constants.
|
/// Constants.
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
yyeof_ = 0,
|
yyeof_ = 0,
|
||||||
yylast_ = ]b4_last[, //< Last index in yytable_.
|
yylast_ = ]b4_last[, ///< Last index in yytable_.
|
||||||
yynnts_ = ]b4_nterms_number[, //< Number of nonterminal symbols.
|
yynnts_ = ]b4_nterms_number[, ///< Number of nonterminal symbols.
|
||||||
yyempty_ = -2,
|
yyfinal_ = ]b4_final_state_number[, ///< Termination state number.
|
||||||
yyfinal_ = ]b4_final_state_number[, //< Termination state number.
|
|
||||||
yyterror_ = 1,
|
yyterror_ = 1,
|
||||||
yyerrcode_ = 256,
|
yyerrcode_ = 256,
|
||||||
yyntokens_ = ]b4_tokens_number[ //< Number of tokens.
|
yyntokens_ = ]b4_tokens_number[ ///< Number of tokens.
|
||||||
};
|
};
|
||||||
|
|
||||||
]b4_parse_param_vars[
|
]b4_parse_param_vars[
|
||||||
};
|
};
|
||||||
|
|
||||||
]b4_token_ctor_if([b4_yytranslate_define
|
]b4_token_ctor_if([b4_yytranslate_define([$1])[
|
||||||
b4_public_types_define])[
|
]b4_public_types_define([$1])])[
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
|
|
||||||
]b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
]b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||||
@@ -361,6 +397,10 @@ b4_public_types_define])[
|
|||||||
]b4_percent_code_get([[provides]])[
|
]b4_percent_code_get([[provides]])[
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
## -------------- ##
|
||||||
|
## Output files. ##
|
||||||
|
## -------------- ##
|
||||||
|
|
||||||
b4_defines_if(
|
b4_defines_if(
|
||||||
[b4_output_begin([b4_spec_defines_file])
|
[b4_output_begin([b4_spec_defines_file])
|
||||||
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
|
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
|
||||||
@@ -372,30 +412,28 @@ b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
|
|||||||
|
|
||||||
// C++ LALR(1) parser skeleton written by Akim Demaille.
|
// C++ LALR(1) parser skeleton written by Akim Demaille.
|
||||||
|
|
||||||
|
]b4_disclaimer[
|
||||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||||
]b4_shared_declarations[
|
]b4_shared_declarations(hh)[
|
||||||
]b4_cpp_guard_close([b4_spec_defines_file])
|
]b4_cpp_guard_close([b4_spec_defines_file])
|
||||||
b4_output_end()
|
b4_output_end
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
b4_output_begin([b4_parser_file_name])
|
b4_output_begin([b4_parser_file_name])[
|
||||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++])
|
]b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++])[
|
||||||
b4_percent_code_get([[top]])[]dnl
|
]b4_disclaimer[
|
||||||
|
]b4_percent_code_get([[top]])[]dnl
|
||||||
m4_if(b4_prefix, [yy], [],
|
m4_if(b4_prefix, [yy], [],
|
||||||
[
|
[
|
||||||
// Take the name prefix into account.
|
// Take the name prefix into account.
|
||||||
#define yylex b4_prefix[]lex])[
|
[#]define yylex b4_prefix[]lex])[
|
||||||
|
|
||||||
// First part of user declarations.
|
|
||||||
]b4_user_pre_prologue[
|
]b4_user_pre_prologue[
|
||||||
|
|
||||||
]b4_null_define[
|
|
||||||
|
|
||||||
]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
|
]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
|
||||||
[b4_shared_declarations])[
|
[b4_shared_declarations([cc])])[
|
||||||
|
|
||||||
// User implementation prologue.
|
|
||||||
]b4_user_post_prologue[
|
]b4_user_post_prologue[
|
||||||
]b4_percent_code_get[
|
]b4_percent_code_get[
|
||||||
|
|
||||||
@@ -411,6 +449,15 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Whether we are compiled with exception support.
|
||||||
|
#ifndef YY_EXCEPTIONS
|
||||||
|
# if defined __GNUC__ && !defined __EXCEPTIONS
|
||||||
|
# define YY_EXCEPTIONS 0
|
||||||
|
# else
|
||||||
|
# define YY_EXCEPTIONS 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
]b4_locations_if([dnl
|
]b4_locations_if([dnl
|
||||||
[#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
|
[#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
|
||||||
]b4_yylloc_default_define])[
|
]b4_yylloc_default_define])[
|
||||||
@@ -430,7 +477,7 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
{ \
|
{ \
|
||||||
*yycdebug_ << Title << ' '; \
|
*yycdebug_ << Title << ' '; \
|
||||||
yy_print_ (*yycdebug_, Symbol); \
|
yy_print_ (*yycdebug_, Symbol); \
|
||||||
*yycdebug_ << std::endl; \
|
*yycdebug_ << '\n'; \
|
||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
@@ -449,14 +496,14 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
#else // !]b4_api_PREFIX[DEBUG
|
#else // !]b4_api_PREFIX[DEBUG
|
||||||
|
|
||||||
# define YYCDEBUG if (false) std::cerr
|
# define YYCDEBUG if (false) std::cerr
|
||||||
# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol)
|
# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol)
|
||||||
# define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
|
# define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
|
||||||
# define YY_STACK_PRINT() static_cast<void>(0)
|
# define YY_STACK_PRINT() static_cast<void> (0)
|
||||||
|
|
||||||
#endif // !]b4_api_PREFIX[DEBUG
|
#endif // !]b4_api_PREFIX[DEBUG
|
||||||
|
|
||||||
#define yyerrok (yyerrstatus_ = 0)
|
#define yyerrok (yyerrstatus_ = 0)
|
||||||
#define yyclearin (yyempty = true)
|
#define yyclearin (yyla.clear ())
|
||||||
|
|
||||||
#define YYACCEPT goto yyacceptlab
|
#define YYACCEPT goto yyacceptlab
|
||||||
#define YYABORT goto yyabortlab
|
#define YYABORT goto yyabortlab
|
||||||
@@ -520,70 +567,82 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
| Symbol types. |
|
| Symbol types. |
|
||||||
`---------------*/
|
`---------------*/
|
||||||
|
|
||||||
]b4_token_ctor_if([], [b4_public_types_define])[
|
]b4_token_ctor_if([], [b4_public_types_define([cc])])[
|
||||||
|
|
||||||
// by_state.
|
// by_state.
|
||||||
inline
|
|
||||||
]b4_parser_class_name[::by_state::by_state ()
|
]b4_parser_class_name[::by_state::by_state ()
|
||||||
: state (empty)
|
: state (empty_state)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
inline
|
|
||||||
]b4_parser_class_name[::by_state::by_state (const by_state& other)
|
]b4_parser_class_name[::by_state::by_state (const by_state& other)
|
||||||
: state (other.state)
|
: state (other.state)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
inline
|
void
|
||||||
|
]b4_parser_class_name[::by_state::clear ()
|
||||||
|
{
|
||||||
|
state = empty_state;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::by_state::move (by_state& that)
|
]b4_parser_class_name[::by_state::move (by_state& that)
|
||||||
{
|
{
|
||||||
state = that.state;
|
state = that.state;
|
||||||
that.state = empty;
|
that.clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
]b4_parser_class_name[::by_state::by_state (state_type s)
|
]b4_parser_class_name[::by_state::by_state (state_type s)
|
||||||
: state (s)
|
: state (s)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
inline
|
|
||||||
]b4_parser_class_name[::symbol_number_type
|
]b4_parser_class_name[::symbol_number_type
|
||||||
]b4_parser_class_name[::by_state::type_get () const
|
]b4_parser_class_name[::by_state::type_get () const
|
||||||
{
|
{
|
||||||
return state == empty ? 0 : yystos_[state];
|
if (state == empty_state)
|
||||||
|
return empty_symbol;
|
||||||
|
else
|
||||||
|
return yystos_[state];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type ()
|
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type ()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
|
||||||
inline
|
: super_type (YY_MOVE (that.state)]b4_variant_if([], [, YY_MOVE (that.value)])b4_locations_if([, YY_MOVE (that.location)])[)
|
||||||
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that)
|
{]b4_variant_if([
|
||||||
: super_type (s]b4_locations_if([, that.location])[)
|
b4_symbol_variant([that.type_get ()],
|
||||||
{
|
[value], [YY_MOVE_OR_COPY], [YY_MOVE (that.value)])])[
|
||||||
]b4_variant_if([b4_symbol_variant([that.type_get ()],
|
#if defined __cplusplus && 201103L <= __cplusplus
|
||||||
[value], [move], [that.value])],
|
|
||||||
[[value = that.value;]])[
|
|
||||||
// that is emptied.
|
// that is emptied.
|
||||||
that.type = empty;
|
that.state = empty_state;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
|
||||||
|
: super_type (s]b4_variant_if([], [, YY_MOVE (that.value)])[]b4_locations_if([, YY_MOVE (that.location)])[)
|
||||||
|
{]b4_variant_if([
|
||||||
|
b4_symbol_variant([that.type_get ()],
|
||||||
|
[value], [move], [YY_MOVE (that.value)])])[
|
||||||
|
// that is emptied.
|
||||||
|
that.type = empty_symbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !defined __cplusplus || __cplusplus < 201103L
|
||||||
]b4_parser_class_name[::stack_symbol_type&
|
]b4_parser_class_name[::stack_symbol_type&
|
||||||
]b4_parser_class_name[::stack_symbol_type::operator= (const stack_symbol_type& that)
|
]b4_parser_class_name[::stack_symbol_type::operator= (stack_symbol_type& that)
|
||||||
{
|
{
|
||||||
state = that.state;
|
state = that.state;
|
||||||
]b4_variant_if([b4_symbol_variant([that.type_get ()],
|
]b4_variant_if([b4_symbol_variant([that.type_get ()],
|
||||||
[value], [copy], [that.value])],
|
[value], [move], [that.value])],
|
||||||
[[value = that.value;]])[]b4_locations_if([
|
[[value = that.value;]])[]b4_locations_if([
|
||||||
location = that.location;])[
|
location = that.location;])[
|
||||||
|
// that is emptied.
|
||||||
|
that.state = empty_state;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
|
]b4_parser_class_name[::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
|
||||||
{
|
{
|
||||||
@@ -591,13 +650,7 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
YY_SYMBOL_PRINT (yymsg, yysym);]b4_variant_if([], [
|
YY_SYMBOL_PRINT (yymsg, yysym);]b4_variant_if([], [
|
||||||
|
|
||||||
// User destructor.
|
// User destructor.
|
||||||
symbol_number_type yytype = yysym.type_get ();
|
b4_symbol_actions([destructor], [yysym.type_get ()])])[
|
||||||
switch (yytype)
|
|
||||||
{
|
|
||||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
|
||||||
[ default:
|
|
||||||
break;
|
|
||||||
}])[
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ]b4_api_PREFIX[DEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
@@ -609,39 +662,39 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
std::ostream& yyoutput = yyo;
|
std::ostream& yyoutput = yyo;
|
||||||
YYUSE (yyoutput);
|
YYUSE (yyoutput);
|
||||||
symbol_number_type yytype = yysym.type_get ();
|
symbol_number_type yytype = yysym.type_get ();
|
||||||
|
// Avoid a (spurious) G++ 4.8 warning about "array subscript is
|
||||||
|
// below array bounds".
|
||||||
|
if (yysym.empty ())
|
||||||
|
std::abort ();
|
||||||
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
||||||
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
||||||
<< yysym.location << ": "])[;
|
<< yysym.location << ": "])[;
|
||||||
switch (yytype)
|
]b4_symbol_actions([printer])[
|
||||||
{
|
|
||||||
]b4_symbol_foreach([b4_symbol_printer])dnl
|
|
||||||
[ default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
yyo << ')';
|
yyo << ')';
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::yypush_ (const char* m, state_type s, symbol_type& sym)
|
]b4_parser_class_name[::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
|
||||||
{
|
|
||||||
stack_symbol_type t (s, sym);
|
|
||||||
yypush_ (m, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
|
||||||
]b4_parser_class_name[::yypush_ (const char* m, stack_symbol_type& s)
|
|
||||||
{
|
{
|
||||||
if (m)
|
if (m)
|
||||||
YY_SYMBOL_PRINT (m, s);
|
YY_SYMBOL_PRINT (m, sym);
|
||||||
yystack_.push (s);
|
yystack_.push (YY_MOVE (sym));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::yypop_ (unsigned int n)
|
]b4_parser_class_name[::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
|
||||||
|
{
|
||||||
|
#if defined __cplusplus && 201103L <= __cplusplus
|
||||||
|
yypush_ (m, stack_symbol_type (s, std::move (sym)));
|
||||||
|
#else
|
||||||
|
stack_symbol_type ss (s, sym);
|
||||||
|
yypush_ (m, ss);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::yypop_ (int n)
|
||||||
{
|
{
|
||||||
yystack_.pop (n);
|
yystack_.pop (n);
|
||||||
}
|
}
|
||||||
@@ -673,36 +726,40 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
}
|
}
|
||||||
#endif // ]b4_api_PREFIX[DEBUG
|
#endif // ]b4_api_PREFIX[DEBUG
|
||||||
|
|
||||||
inline ]b4_parser_class_name[::state_type
|
]b4_parser_class_name[::state_type
|
||||||
]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yylhs)
|
]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yysym)
|
||||||
{
|
{
|
||||||
int yyr = yypgoto_[yylhs - yyntokens_] + yystate;
|
int yyr = yypgoto_[yysym - yyntokens_] + yystate;
|
||||||
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
|
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
|
||||||
return yytable_[yyr];
|
return yytable_[yyr];
|
||||||
else
|
else
|
||||||
return yydefgoto_[yylhs - yyntokens_];
|
return yydefgoto_[yysym - yyntokens_];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
bool
|
||||||
]b4_parser_class_name[::yy_pact_value_is_default_ (int yyvalue)
|
]b4_parser_class_name[::yy_pact_value_is_default_ (int yyvalue)
|
||||||
{
|
{
|
||||||
return yyvalue == yypact_ninf_;
|
return yyvalue == yypact_ninf_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
bool
|
||||||
]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue)
|
]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue)
|
||||||
{
|
{
|
||||||
return yyvalue == yytable_ninf_;
|
return yyvalue == yytable_ninf_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
]b4_parser_class_name[::operator() ()
|
||||||
|
{
|
||||||
|
return parse ();
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
]b4_parser_class_name[::parse ()
|
]b4_parser_class_name[::parse ()
|
||||||
{
|
{
|
||||||
/// Whether yyla contains a lookahead.
|
|
||||||
bool yyempty = true;
|
|
||||||
|
|
||||||
// State.
|
// State.
|
||||||
int yyn;
|
int yyn;
|
||||||
|
/// Length of the RHS of the rule being reduced.
|
||||||
int yylen = 0;
|
int yylen = 0;
|
||||||
|
|
||||||
// Error handling.
|
// Error handling.
|
||||||
@@ -715,21 +772,17 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
/// The locations where the error started and ended.
|
/// The locations where the error started and ended.
|
||||||
stack_symbol_type yyerror_range[3];]])[
|
stack_symbol_type yyerror_range[3];]])[
|
||||||
|
|
||||||
/// $$ and @@$.
|
|
||||||
stack_symbol_type yylhs;
|
|
||||||
|
|
||||||
/// The return value of parse ().
|
/// The return value of parse ().
|
||||||
int yyresult;
|
int yyresult;
|
||||||
|
|
||||||
// FIXME: This shoud be completely indented. It is not yet to
|
#if YY_EXCEPTIONS
|
||||||
// avoid gratuitous conflicts when merging into the master branch.
|
|
||||||
try
|
try
|
||||||
|
#endif // YY_EXCEPTIONS
|
||||||
{
|
{
|
||||||
YYCDEBUG << "Starting parse" << std::endl;
|
YYCDEBUG << "Starting parse\n";
|
||||||
|
|
||||||
]m4_ifdef([b4_initial_action], [
|
]m4_ifdef([b4_initial_action], [
|
||||||
b4_dollar_pushdef([yyla.value], [], [yyla.location])dnl
|
b4_dollar_pushdef([yyla.value], [], [yyla.location])dnl
|
||||||
// User initialization code.
|
|
||||||
b4_user_initial_action
|
b4_user_initial_action
|
||||||
b4_dollar_popdef])[]dnl
|
b4_dollar_popdef])[]dnl
|
||||||
|
|
||||||
@@ -737,12 +790,12 @@ b4_dollar_popdef])[]dnl
|
|||||||
yynewstate, since the latter expects the semantical and the
|
yynewstate, since the latter expects the semantical and the
|
||||||
location values to have been already stored, initialize these
|
location values to have been already stored, initialize these
|
||||||
stacks with a primary value. */
|
stacks with a primary value. */
|
||||||
yystack_ = stack_type (0);
|
yystack_.clear ();
|
||||||
yypush_ (YY_NULL, 0, yyla);
|
yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
|
||||||
|
|
||||||
// A new symbol was pushed on the stack.
|
// A new symbol was pushed on the stack.
|
||||||
yynewstate:
|
yynewstate:
|
||||||
YYCDEBUG << "Entering state " << yystack_[0].state << std::endl;
|
YYCDEBUG << "Entering state " << yystack_[0].state << '\n';
|
||||||
|
|
||||||
// Accept?
|
// Accept?
|
||||||
if (yystack_[0].state == yyfinal_)
|
if (yystack_[0].state == yyfinal_)
|
||||||
@@ -752,28 +805,30 @@ b4_dollar_popdef])[]dnl
|
|||||||
|
|
||||||
// Backup.
|
// Backup.
|
||||||
yybackup:
|
yybackup:
|
||||||
|
|
||||||
// Try to take a decision without lookahead.
|
// Try to take a decision without lookahead.
|
||||||
yyn = yypact_[yystack_[0].state];
|
yyn = yypact_[yystack_[0].state];
|
||||||
if (yy_pact_value_is_default_ (yyn))
|
if (yy_pact_value_is_default_ (yyn))
|
||||||
goto yydefault;
|
goto yydefault;
|
||||||
|
|
||||||
// Read a lookahead token.
|
// Read a lookahead token.
|
||||||
if (yyempty)
|
if (yyla.empty ())
|
||||||
{
|
{
|
||||||
YYCDEBUG << "Reading a token: ";
|
YYCDEBUG << "Reading a token: ";
|
||||||
|
#if YY_EXCEPTIONS
|
||||||
try
|
try
|
||||||
|
#endif // YY_EXCEPTIONS
|
||||||
{]b4_token_ctor_if([[
|
{]b4_token_ctor_if([[
|
||||||
symbol_type yylookahead (]b4_lex[);
|
symbol_type yylookahead (]b4_lex[);
|
||||||
yyla.move (yylookahead);]], [[
|
yyla.move (yylookahead);]], [[
|
||||||
yyla.type = yytranslate_ (]b4_lex[);]])[
|
yyla.type = yytranslate_ (]b4_lex[);]])[
|
||||||
}
|
}
|
||||||
|
#if YY_EXCEPTIONS
|
||||||
catch (const syntax_error& yyexc)
|
catch (const syntax_error& yyexc)
|
||||||
{
|
{
|
||||||
error (yyexc);
|
error (yyexc);
|
||||||
goto yyerrlab1;
|
goto yyerrlab1;
|
||||||
}
|
}
|
||||||
yyempty = false;
|
#endif // YY_EXCEPTIONS
|
||||||
}
|
}
|
||||||
YY_SYMBOL_PRINT ("Next token is", yyla);
|
YY_SYMBOL_PRINT ("Next token is", yyla);
|
||||||
|
|
||||||
@@ -793,15 +848,12 @@ b4_dollar_popdef])[]dnl
|
|||||||
goto yyreduce;
|
goto yyreduce;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discard the token being shifted.
|
|
||||||
yyempty = true;
|
|
||||||
|
|
||||||
// Count tokens shifted since error; after three, turn off error status.
|
// Count tokens shifted since error; after three, turn off error status.
|
||||||
if (yyerrstatus_)
|
if (yyerrstatus_)
|
||||||
--yyerrstatus_;
|
--yyerrstatus_;
|
||||||
|
|
||||||
// Shift the lookahead token.
|
// Shift the lookahead token.
|
||||||
yypush_ ("Shifting", yyn, yyla);
|
yypush_ ("Shifting", yyn, YY_MOVE (yyla));
|
||||||
goto yynewstate;
|
goto yynewstate;
|
||||||
|
|
||||||
/*-----------------------------------------------------------.
|
/*-----------------------------------------------------------.
|
||||||
@@ -818,52 +870,60 @@ b4_dollar_popdef])[]dnl
|
|||||||
`-----------------------------*/
|
`-----------------------------*/
|
||||||
yyreduce:
|
yyreduce:
|
||||||
yylen = yyr2_[yyn];
|
yylen = yyr2_[yyn];
|
||||||
yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([
|
{
|
||||||
/* Variants are always initialized to an empty instance of the
|
stack_symbol_type yylhs;
|
||||||
correct type. The default $$=$1 action is NOT applied when using
|
yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([
|
||||||
variants. */
|
/* Variants are always initialized to an empty instance of the
|
||||||
b4_symbol_variant([[yyr1_@{yyn@}]], [yylhs.value], [build])],[
|
correct type. The default '$$ = $1' action is NOT applied
|
||||||
/* If YYLEN is nonzero, implement the default value of the action:
|
when using variants. */
|
||||||
`$$ = $1'. Otherwise, use the top of the stack.
|
b4_symbol_variant([[yyr1_@{yyn@}]], [yylhs.value], [emplace])], [
|
||||||
|
/* If YYLEN is nonzero, implement the default value of the
|
||||||
|
action: '$$ = $1'. Otherwise, use the top of the stack.
|
||||||
|
|
||||||
Otherwise, the following line sets YYLHS.VALUE to garbage.
|
Otherwise, the following line sets YYLHS.VALUE to garbage.
|
||||||
This behavior is undocumented and Bison
|
This behavior is undocumented and Bison users should not rely
|
||||||
users should not rely upon it. */
|
upon it. */
|
||||||
if (yylen)
|
if (yylen)
|
||||||
yylhs.value = yystack_@{yylen - 1@}.value;
|
yylhs.value = yystack_@{yylen - 1@}.value;
|
||||||
else
|
else
|
||||||
yylhs.value = yystack_@{0@}.value;])[
|
yylhs.value = yystack_@{0@}.value;])[
|
||||||
]b4_locations_if([dnl
|
]b4_locations_if([dnl
|
||||||
[
|
[
|
||||||
// Compute the default @@$.
|
// Default location.
|
||||||
{
|
|
||||||
slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
|
|
||||||
YYLLOC_DEFAULT (yylhs.location, slice, yylen);
|
|
||||||
}]])[
|
|
||||||
|
|
||||||
// Perform the reduction.
|
|
||||||
YY_REDUCE_PRINT (yyn);
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
switch (yyn)
|
slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
|
||||||
{
|
YYLLOC_DEFAULT (yylhs.location, slice, yylen);
|
||||||
|
yyerror_range[1].location = yylhs.location;
|
||||||
|
}]])[
|
||||||
|
|
||||||
|
// Perform the reduction.
|
||||||
|
YY_REDUCE_PRINT (yyn);
|
||||||
|
#if YY_EXCEPTIONS
|
||||||
|
try
|
||||||
|
#endif // YY_EXCEPTIONS
|
||||||
|
{
|
||||||
|
switch (yyn)
|
||||||
|
{
|
||||||
]b4_user_actions[
|
]b4_user_actions[
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const syntax_error& yyexc)
|
#if YY_EXCEPTIONS
|
||||||
{
|
catch (const syntax_error& yyexc)
|
||||||
error (yyexc);
|
{
|
||||||
YYERROR;
|
error (yyexc);
|
||||||
}
|
YYERROR;
|
||||||
YY_SYMBOL_PRINT ("-> $$ =", yylhs);
|
}
|
||||||
yypop_ (yylen);
|
#endif // YY_EXCEPTIONS
|
||||||
yylen = 0;
|
YY_SYMBOL_PRINT ("-> $$ =", yylhs);
|
||||||
YY_STACK_PRINT ();
|
yypop_ (yylen);
|
||||||
|
yylen = 0;
|
||||||
|
YY_STACK_PRINT ();
|
||||||
|
|
||||||
// Shift the result of the reduction.
|
// Shift the result of the reduction.
|
||||||
yypush_ (YY_NULL, yylhs);
|
yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
|
||||||
|
}
|
||||||
goto yynewstate;
|
goto yynewstate;
|
||||||
|
|
||||||
/*--------------------------------------.
|
/*--------------------------------------.
|
||||||
@@ -875,8 +935,7 @@ b4_dollar_popdef])[]dnl
|
|||||||
{
|
{
|
||||||
++yynerrs_;
|
++yynerrs_;
|
||||||
error (]b4_join(b4_locations_if([yyla.location]),
|
error (]b4_join(b4_locations_if([yyla.location]),
|
||||||
[[yysyntax_error_ (yystack_[0].state,
|
[[yysyntax_error_ (yystack_[0].state, yyla)]])[);
|
||||||
yyempty ? yyempty_ : yyla.type_get ())]])[);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_locations_if([[
|
]b4_locations_if([[
|
||||||
@@ -889,10 +948,10 @@ b4_dollar_popdef])[]dnl
|
|||||||
// Return failure if at end of input.
|
// Return failure if at end of input.
|
||||||
if (yyla.type_get () == yyeof_)
|
if (yyla.type_get () == yyeof_)
|
||||||
YYABORT;
|
YYABORT;
|
||||||
else if (!yyempty)
|
else if (!yyla.empty ())
|
||||||
{
|
{
|
||||||
yy_destroy_ ("Error: discarding", yyla);
|
yy_destroy_ ("Error: discarding", yyla);
|
||||||
yyempty = true;
|
yyla.clear ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -909,11 +968,7 @@ b4_dollar_popdef])[]dnl
|
|||||||
YYERROR and the label yyerrorlab therefore never appears in user
|
YYERROR and the label yyerrorlab therefore never appears in user
|
||||||
code. */
|
code. */
|
||||||
if (false)
|
if (false)
|
||||||
goto yyerrorlab;]b4_locations_if([[
|
goto yyerrorlab;
|
||||||
yyerror_range[1].location = yystack_[yylen - 1].location;]])b4_variant_if([[
|
|
||||||
/* $$ was initialized before running the user action. */
|
|
||||||
YY_SYMBOL_PRINT ("Error: discarding", yylhs);
|
|
||||||
yylhs.~stack_symbol_type();]])[
|
|
||||||
/* Do not reclaim the symbols of the rule whose action triggered
|
/* Do not reclaim the symbols of the rule whose action triggered
|
||||||
this YYERROR. */
|
this YYERROR. */
|
||||||
yypop_ (yylen);
|
yypop_ (yylen);
|
||||||
@@ -956,7 +1011,7 @@ b4_dollar_popdef])[]dnl
|
|||||||
|
|
||||||
// Shift the error token.
|
// Shift the error token.
|
||||||
error_token.state = yyn;
|
error_token.state = yyn;
|
||||||
yypush_ ("Shifting", error_token);
|
yypush_ ("Shifting", YY_MOVE (error_token));
|
||||||
}
|
}
|
||||||
goto yynewstate;
|
goto yynewstate;
|
||||||
|
|
||||||
@@ -971,7 +1026,7 @@ b4_dollar_popdef])[]dnl
|
|||||||
goto yyreturn;
|
goto yyreturn;
|
||||||
|
|
||||||
yyreturn:
|
yyreturn:
|
||||||
if (!yyempty)
|
if (!yyla.empty ())
|
||||||
yy_destroy_ ("Cleanup: discarding lookahead", yyla);
|
yy_destroy_ ("Cleanup: discarding lookahead", yyla);
|
||||||
|
|
||||||
/* Do not reclaim the symbols of the rule whose action triggered
|
/* Do not reclaim the symbols of the rule whose action triggered
|
||||||
@@ -985,38 +1040,38 @@ b4_dollar_popdef])[]dnl
|
|||||||
|
|
||||||
return yyresult;
|
return yyresult;
|
||||||
}
|
}
|
||||||
|
#if YY_EXCEPTIONS
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
YYCDEBUG << "Exception caught: cleaning lookahead and stack"
|
YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
|
||||||
<< std::endl;
|
|
||||||
// Do not try to display the values of the reclaimed symbols,
|
// Do not try to display the values of the reclaimed symbols,
|
||||||
// as their printer might throw an exception.
|
// as their printers might throw an exception.
|
||||||
if (!yyempty)
|
if (!yyla.empty ())
|
||||||
yy_destroy_ (YY_NULL, yyla);
|
yy_destroy_ (YY_NULLPTR, yyla);
|
||||||
|
|
||||||
while (1 < yystack_.size ())
|
while (1 < yystack_.size ())
|
||||||
{
|
{
|
||||||
yy_destroy_ (YY_NULL, yystack_[0]);
|
yy_destroy_ (YY_NULLPTR, yystack_[0]);
|
||||||
yypop_ ();
|
yypop_ ();
|
||||||
}
|
}
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
#endif // YY_EXCEPTIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::error (const syntax_error& yyexc)
|
]b4_parser_class_name[::error (const syntax_error& yyexc)
|
||||||
{
|
{
|
||||||
error (]b4_join(b4_locations_if([yyexc.location]),
|
error (]b4_join(b4_locations_if([yyexc.location]),
|
||||||
[[yyexc.what()]])[);
|
[[yyexc.what ()]])[);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate an error message.
|
// Generate an error message.
|
||||||
std::string
|
std::string
|
||||||
]b4_parser_class_name[::yysyntax_error_ (]dnl
|
]b4_parser_class_name[::yysyntax_error_ (]dnl
|
||||||
b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
|
||||||
[state_type, symbol_number_type])[) const
|
[state_type, const symbol_type&])[) const
|
||||||
{]b4_error_verbose_if([[
|
{]b4_error_verbose_if([[
|
||||||
std::string yyres;
|
|
||||||
// Number of reported tokens (one for the "unexpected", one per
|
// Number of reported tokens (one for the "unexpected", one per
|
||||||
// "expected").
|
// "expected").
|
||||||
size_t yycount = 0;
|
size_t yycount = 0;
|
||||||
@@ -1030,7 +1085,7 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
|||||||
the only way this function was invoked is if the default action
|
the only way this function was invoked is if the default action
|
||||||
is an error action. In that case, don't check for expected
|
is an error action. In that case, don't check for expected
|
||||||
tokens because there are none.
|
tokens because there are none.
|
||||||
- The only way there can be no lookahead present (in yytoken) is
|
- The only way there can be no lookahead present (in yyla) is
|
||||||
if this state is a consistent state with a default action.
|
if this state is a consistent state with a default action.
|
||||||
Thus, detecting the absence of a lookahead is sufficient to
|
Thus, detecting the absence of a lookahead is sufficient to
|
||||||
determine that there is no unexpected or expected token to
|
determine that there is no unexpected or expected token to
|
||||||
@@ -1050,8 +1105,9 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
|||||||
token that will not be accepted due to an error action in a
|
token that will not be accepted due to an error action in a
|
||||||
later state.
|
later state.
|
||||||
*/
|
*/
|
||||||
if (yytoken != yyempty_)
|
if (!yyla.empty ())
|
||||||
{
|
{
|
||||||
|
int yytoken = yyla.type_get ();
|
||||||
yyarg[yycount++] = yytname_[yytoken];
|
yyarg[yycount++] = yytname_[yytoken];
|
||||||
int yyn = yypact_[yystate];
|
int yyn = yypact_[yystate];
|
||||||
if (!yy_pact_value_is_default_ (yyn))
|
if (!yy_pact_value_is_default_ (yyn))
|
||||||
@@ -1078,22 +1134,24 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char const* yyformat = YY_NULL;
|
char const* yyformat = YY_NULLPTR;
|
||||||
switch (yycount)
|
switch (yycount)
|
||||||
{
|
{
|
||||||
#define YYCASE_(N, S) \
|
#define YYCASE_(N, S) \
|
||||||
case N: \
|
case N: \
|
||||||
yyformat = S; \
|
yyformat = S; \
|
||||||
break
|
break
|
||||||
YYCASE_(0, YY_("syntax error"));
|
default: // Avoid compiler warnings.
|
||||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
YYCASE_ (0, YY_("syntax error"));
|
||||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
YYCASE_ (1, YY_("syntax error, unexpected %s"));
|
||||||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||||
|
YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||||
#undef YYCASE_
|
#undef YYCASE_
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string yyres;
|
||||||
// Argument number.
|
// Argument number.
|
||||||
size_t yyi = 0;
|
size_t yyi = 0;
|
||||||
for (char const* yyp = yyformat; *yyp; ++yyp)
|
for (char const* yyp = yyformat; *yyp; ++yyp)
|
||||||
@@ -1137,18 +1195,18 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
|||||||
i_end = yystack_.end ();
|
i_end = yystack_.end ();
|
||||||
i != i_end; ++i)
|
i != i_end; ++i)
|
||||||
*yycdebug_ << ' ' << i->state;
|
*yycdebug_ << ' ' << i->state;
|
||||||
*yycdebug_ << std::endl;
|
*yycdebug_ << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Report on the debug stream that the rule \a yyrule is going to be reduced.
|
// Report on the debug stream that the rule \a yyrule is going to be reduced.
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::yy_reduce_print_ (int yyrule)
|
]b4_parser_class_name[::yy_reduce_print_ (int yyrule)
|
||||||
{
|
{
|
||||||
unsigned int yylno = yyrline_[yyrule];
|
unsigned yylno = yyrline_[yyrule];
|
||||||
int yynrhs = yyr2_[yyrule];
|
int yynrhs = yyr2_[yyrule];
|
||||||
// Print the symbols being reduced, and their result.
|
// Print the symbols being reduced, and their result.
|
||||||
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
|
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
|
||||||
<< " (line " << yylno << "):" << std::endl;
|
<< " (line " << yylno << "):\n";
|
||||||
// The symbols being reduced.
|
// The symbols being reduced.
|
||||||
for (int yyi = 0; yyi < yynrhs; yyi++)
|
for (int yyi = 0; yyi < yynrhs; yyi++)
|
||||||
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
|
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
|
||||||
@@ -1156,10 +1214,10 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
|||||||
}
|
}
|
||||||
#endif // ]b4_api_PREFIX[DEBUG
|
#endif // ]b4_api_PREFIX[DEBUG
|
||||||
|
|
||||||
]b4_token_ctor_if([], [b4_yytranslate_define])[
|
]b4_token_ctor_if([], [b4_yytranslate_define([cc])])[
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
]b4_epilogue[]dnl
|
]b4_epilogue[]dnl
|
||||||
b4_output_end()
|
b4_output_end
|
||||||
|
|
||||||
|
|
||||||
m4_popdef([b4_copyright_years])dnl
|
m4_popdef([b4_copyright_years])dnl
|
||||||
|
|||||||
+282
-90
@@ -1,6 +1,6 @@
|
|||||||
# Java skeleton for Bison -*- autoconf -*-
|
# Java skeleton for Bison -*- autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2007-2015, 2018 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
|
||||||
@@ -20,7 +20,8 @@ m4_include(b4_pkgdatadir/[java.m4])
|
|||||||
b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java],
|
b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java],
|
||||||
[b4_skeleton])])
|
[b4_skeleton])])
|
||||||
|
|
||||||
# We don't depend on %debug in Java, but pacify warnings about non-used flags.
|
# We do not depend on %debug in Java, but pacify warnings about
|
||||||
|
# non-used flags.
|
||||||
b4_parse_trace_if([0], [0])
|
b4_parse_trace_if([0], [0])
|
||||||
|
|
||||||
m4_define([b4_symbol_no_destructor_assert],
|
m4_define([b4_symbol_no_destructor_assert],
|
||||||
@@ -30,15 +31,65 @@ m4_define([b4_symbol_no_destructor_assert],
|
|||||||
[b4_symbol_action_location([$1], [destructor])])])])
|
[b4_symbol_action_location([$1], [destructor])])])])
|
||||||
b4_symbol_foreach([b4_symbol_no_destructor_assert])
|
b4_symbol_foreach([b4_symbol_no_destructor_assert])
|
||||||
|
|
||||||
b4_output_begin([b4_parser_file_name])
|
# Setup some macros for api.push-pull.
|
||||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
b4_percent_define_default([[api.push-pull]], [[pull]])
|
||||||
[2007-2013])
|
b4_percent_define_check_values([[[[api.push-pull]],
|
||||||
|
[[pull]], [[push]], [[both]]]])
|
||||||
|
|
||||||
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
# Define m4 conditional macros that encode the value
|
||||||
])[/* First part of user declarations. */
|
# of the api.push-pull flag.
|
||||||
]b4_user_pre_prologue
|
b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]])
|
||||||
b4_user_post_prologue
|
b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]])
|
||||||
b4_percent_code_get([[imports]])
|
m4_case(b4_percent_define_get([[api.push-pull]]),
|
||||||
|
[pull], [m4_define([b4_push_flag], [[0]])],
|
||||||
|
[push], [m4_define([b4_pull_flag], [[0]])])
|
||||||
|
|
||||||
|
# Define a macro to be true when api.push-pull has the value "both".
|
||||||
|
m4_define([b4_both_if],[b4_push_if([b4_pull_if([$1],[$2])],[$2])])
|
||||||
|
|
||||||
|
# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing
|
||||||
|
# tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the
|
||||||
|
# behavior of Bison at all when push parsing is already requested.
|
||||||
|
b4_define_flag_if([use_push_for_pull])
|
||||||
|
b4_use_push_for_pull_if([
|
||||||
|
b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])],
|
||||||
|
[m4_define([b4_push_flag], [[1]])])])
|
||||||
|
|
||||||
|
# Define a macro to encapsulate the parse state variables.
|
||||||
|
# This allows them to be defined either in parse() when doing
|
||||||
|
# pull parsing, or as class instance variable when doing push parsing.
|
||||||
|
m4_define([b4_define_state],[[
|
||||||
|
/* Lookahead and lookahead in internal form. */
|
||||||
|
int yychar = yyempty_;
|
||||||
|
int yytoken = 0;
|
||||||
|
|
||||||
|
/* State. */
|
||||||
|
int yyn = 0;
|
||||||
|
int yylen = 0;
|
||||||
|
int yystate = 0;
|
||||||
|
YYStack yystack = new YYStack ();
|
||||||
|
int label = YYNEWSTATE;
|
||||||
|
|
||||||
|
/* Error handling. */
|
||||||
|
int yynerrs_ = 0;
|
||||||
|
]b4_locations_if([/* The location where the error started. */
|
||||||
|
b4_location_type yyerrloc = null;
|
||||||
|
|
||||||
|
/* Location. */
|
||||||
|
b4_location_type yylloc = new b4_location_type (null, null);])[
|
||||||
|
|
||||||
|
/* Semantic value of the lookahead. */
|
||||||
|
]b4_yystype[ yylval = null;
|
||||||
|
]])
|
||||||
|
|
||||||
|
b4_output_begin([b4_parser_file_name])[
|
||||||
|
]b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
||||||
|
[2007-2015, 2018])[
|
||||||
|
]b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);[
|
||||||
|
]])[
|
||||||
|
]b4_user_pre_prologue[
|
||||||
|
]b4_user_post_prologue[
|
||||||
|
]b4_percent_code_get([[imports]])
|
||||||
[/**
|
[/**
|
||||||
* A Bison parser, automatically generated from <tt>]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[</tt>.
|
* A Bison parser, automatically generated from <tt>]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[</tt>.
|
||||||
*
|
*
|
||||||
@@ -55,7 +106,9 @@ b4_percent_define_get3([implements], [ implements ])[
|
|||||||
{
|
{
|
||||||
]b4_identification[
|
]b4_identification[
|
||||||
]b4_error_verbose_if([[
|
]b4_error_verbose_if([[
|
||||||
/** True if verbose error messages are enabled. */
|
/**
|
||||||
|
* True if verbose error messages are enabled.
|
||||||
|
*/
|
||||||
private boolean yyErrorVerbose = true;
|
private boolean yyErrorVerbose = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,18 +129,24 @@ b4_locations_if([[
|
|||||||
* A class defining a pair of positions. Positions, defined by the
|
* A class defining a pair of positions. Positions, defined by the
|
||||||
* <code>]b4_position_type[</code> class, denote a point in the input.
|
* <code>]b4_position_type[</code> class, denote a point in the input.
|
||||||
* Locations represent a part of the input through the beginning
|
* Locations represent a part of the input through the beginning
|
||||||
* and ending positions. */
|
* and ending positions.
|
||||||
|
*/
|
||||||
public class ]b4_location_type[ {
|
public class ]b4_location_type[ {
|
||||||
/** The first, inclusive, position in the range. */
|
/**
|
||||||
|
* The first, inclusive, position in the range.
|
||||||
|
*/
|
||||||
public ]b4_position_type[ begin;
|
public ]b4_position_type[ begin;
|
||||||
|
|
||||||
/** The first position beyond the range. */
|
/**
|
||||||
|
* The first position beyond the range.
|
||||||
|
*/
|
||||||
public ]b4_position_type[ end;
|
public ]b4_position_type[ end;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a <code>]b4_location_type[</code> denoting an empty range located at
|
* Create a <code>]b4_location_type[</code> denoting an empty range located at
|
||||||
* a given point.
|
* a given point.
|
||||||
* @@param loc The position at which the range is anchored. */
|
* @@param loc The position at which the range is anchored.
|
||||||
|
*/
|
||||||
public ]b4_location_type[ (]b4_position_type[ loc) {
|
public ]b4_location_type[ (]b4_position_type[ loc) {
|
||||||
this.begin = this.end = loc;
|
this.begin = this.end = loc;
|
||||||
}
|
}
|
||||||
@@ -95,7 +154,8 @@ b4_locations_if([[
|
|||||||
/**
|
/**
|
||||||
* Create a <code>]b4_location_type[</code> from the endpoints of the range.
|
* Create a <code>]b4_location_type[</code> from the endpoints of the range.
|
||||||
* @@param begin The first position included in the range.
|
* @@param begin The first position included in the range.
|
||||||
* @@param end The first position beyond the range. */
|
* @@param end The first position beyond the range.
|
||||||
|
*/
|
||||||
public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) {
|
public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) {
|
||||||
this.begin = begin;
|
this.begin = begin;
|
||||||
this.end = end;
|
this.end = end;
|
||||||
@@ -104,7 +164,8 @@ b4_locations_if([[
|
|||||||
/**
|
/**
|
||||||
* Print a representation of the location. For this to be correct,
|
* Print a representation of the location. For this to be correct,
|
||||||
* <code>]b4_position_type[</code> should override the <code>equals</code>
|
* <code>]b4_position_type[</code> should override the <code>equals</code>
|
||||||
* method. */
|
* method.
|
||||||
|
*/
|
||||||
public String toString () {
|
public String toString () {
|
||||||
if (begin.equals (end))
|
if (begin.equals (end))
|
||||||
return begin.toString ();
|
return begin.toString ();
|
||||||
@@ -136,24 +197,28 @@ b4_locations_if([[
|
|||||||
|
|
||||||
]b4_locations_if([[/**
|
]b4_locations_if([[/**
|
||||||
* Method to retrieve the beginning position of the last scanned token.
|
* Method to retrieve the beginning position of the last scanned token.
|
||||||
* @@return the position at which the last scanned token starts. */
|
* @@return the position at which the last scanned token starts.
|
||||||
|
*/
|
||||||
]b4_position_type[ getStartPos ();
|
]b4_position_type[ getStartPos ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to retrieve the ending position of the last scanned token.
|
* Method to retrieve the ending position of the last scanned token.
|
||||||
* @@return the first position beyond the last scanned token. */
|
* @@return the first position beyond the last scanned token.
|
||||||
|
*/
|
||||||
]b4_position_type[ getEndPos ();]])[
|
]b4_position_type[ getEndPos ();]])[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to retrieve the semantic value of the last scanned token.
|
* Method to retrieve the semantic value of the last scanned token.
|
||||||
* @@return the semantic value of the last scanned token. */
|
* @@return the semantic value of the last scanned token.
|
||||||
|
*/
|
||||||
]b4_yystype[ getLVal ();
|
]b4_yystype[ getLVal ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point for the scanner. Returns the token identifier corresponding
|
* Entry point for the scanner. Returns the token identifier corresponding
|
||||||
* to the next token and prepares to return the semantic value
|
* to the next token and prepares to return the semantic value
|
||||||
* ]b4_locations_if([and beginning/ending positions ])[of the token.
|
* ]b4_locations_if([and beginning/ending positions ])[of the token.
|
||||||
* @@return the token identifier corresponding to the next token. */
|
* @@return the token identifier corresponding to the next token.
|
||||||
|
*/
|
||||||
int yylex () ]b4_maybe_throws([b4_lex_throws])[;
|
int yylex () ]b4_maybe_throws([b4_lex_throws])[;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -162,7 +227,8 @@ b4_locations_if([[
|
|||||||
*
|
*
|
||||||
* ]b4_locations_if([[@@param loc The location of the element to which the
|
* ]b4_locations_if([[@@param loc The location of the element to which the
|
||||||
* error message is related]])[
|
* error message is related]])[
|
||||||
* @@param msg The string for the error message. */
|
* @@param msg The string for the error message.
|
||||||
|
*/
|
||||||
void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String msg);]
|
void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String msg);]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +236,9 @@ b4_locations_if([[
|
|||||||
]b4_percent_code_get([[lexer]])[
|
]b4_percent_code_get([[lexer]])[
|
||||||
}
|
}
|
||||||
|
|
||||||
]])[/** The object doing lexical analysis for us. */
|
]])[/**
|
||||||
|
* The object doing lexical analysis for us.
|
||||||
|
*/
|
||||||
private Lexer yylexer;
|
private Lexer yylexer;
|
||||||
]
|
]
|
||||||
b4_parse_param_vars
|
b4_parse_param_vars
|
||||||
@@ -336,46 +404,74 @@ b4_lexer_if([[
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returned by a Bison action in order to stop the parsing process and
|
* Returned by a Bison action in order to stop the parsing process and
|
||||||
* return success (<tt>true</tt>). */
|
* return success (<tt>true</tt>).
|
||||||
|
*/
|
||||||
public static final int YYACCEPT = 0;
|
public static final int YYACCEPT = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returned by a Bison action in order to stop the parsing process and
|
* Returned by a Bison action in order to stop the parsing process and
|
||||||
* return failure (<tt>false</tt>). */
|
* return failure (<tt>false</tt>).
|
||||||
|
*/
|
||||||
public static final int YYABORT = 1;
|
public static final int YYABORT = 1;
|
||||||
|
|
||||||
|
]b4_push_if([
|
||||||
|
/**
|
||||||
|
* Returned by a Bison action in order to request a new token.
|
||||||
|
*/
|
||||||
|
public static final int YYPUSH_MORE = 4;])[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returned by a Bison action in order to start error recovery without
|
* Returned by a Bison action in order to start error recovery without
|
||||||
* printing an error message. */
|
* printing an error message.
|
||||||
|
*/
|
||||||
public static final int YYERROR = 2;
|
public static final int YYERROR = 2;
|
||||||
|
|
||||||
// Internal return codes that are not supported for user semantic
|
/**
|
||||||
// actions.
|
* Internal return codes that are not supported for user semantic
|
||||||
|
* actions.
|
||||||
|
*/
|
||||||
private static final int YYERRLAB = 3;
|
private static final int YYERRLAB = 3;
|
||||||
private static final int YYNEWSTATE = 4;
|
private static final int YYNEWSTATE = 4;
|
||||||
private static final int YYDEFAULT = 5;
|
private static final int YYDEFAULT = 5;
|
||||||
private static final int YYREDUCE = 6;
|
private static final int YYREDUCE = 6;
|
||||||
private static final int YYERRLAB1 = 7;
|
private static final int YYERRLAB1 = 7;
|
||||||
private static final int YYRETURN = 8;
|
private static final int YYRETURN = 8;
|
||||||
|
]b4_push_if([[ private static final int YYGETTOKEN = 9; /* Signify that a new token is expected when doing push-parsing. */]])[
|
||||||
|
|
||||||
private int yyerrstatus_ = 0;
|
private int yyerrstatus_ = 0;
|
||||||
|
|
||||||
|
]b4_push_if([dnl
|
||||||
|
b4_define_state])[
|
||||||
/**
|
/**
|
||||||
* Return whether error recovery is being done. In this state, the parser
|
* Return whether error recovery is being done. In this state, the parser
|
||||||
* reads token until it reaches a known state, and then restarts normal
|
* reads token until it reaches a known state, and then restarts normal
|
||||||
* operation. */
|
* operation.
|
||||||
|
*/
|
||||||
public final boolean recovering ()
|
public final boolean recovering ()
|
||||||
{
|
{
|
||||||
return yyerrstatus_ == 0;
|
return yyerrstatus_ == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Compute post-reduction state.
|
||||||
|
* @@param yystate the current state
|
||||||
|
* @@param yysym the nonterminal to push on the stack
|
||||||
|
*/
|
||||||
|
private int yy_lr_goto_state_ (int yystate, int yysym)
|
||||||
|
{
|
||||||
|
int yyr = yypgoto_[yysym - yyntokens_] + yystate;
|
||||||
|
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
|
||||||
|
return yytable_[yyr];
|
||||||
|
else
|
||||||
|
return yydefgoto_[yysym - yyntokens_];
|
||||||
|
}
|
||||||
|
|
||||||
private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[
|
private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[
|
||||||
{
|
{
|
||||||
]b4_yystype[ yyval;
|
]b4_yystype[ yyval;
|
||||||
]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[
|
]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[
|
||||||
|
|
||||||
/* If YYLEN is nonzero, implement the default value of the action:
|
/* If YYLEN is nonzero, implement the default value of the action:
|
||||||
`$$ = $1'. Otherwise, use the top of the stack.
|
'$$ = $1'. Otherwise, use the top of the stack.
|
||||||
|
|
||||||
Otherwise, the following line sets YYVAL to garbage.
|
Otherwise, the following line sets YYVAL to garbage.
|
||||||
This behavior is undocumented and Bison
|
This behavior is undocumented and Bison
|
||||||
@@ -399,14 +495,7 @@ b4_lexer_if([[
|
|||||||
yylen = 0;
|
yylen = 0;
|
||||||
|
|
||||||
/* Shift the result of the reduction. */
|
/* Shift the result of the reduction. */
|
||||||
yyn = yyr1_[yyn];
|
int yystate = yy_lr_goto_state_ (yystack.stateAt (0), yyr1_[yyn]);
|
||||||
int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
|
|
||||||
if (0 <= yystate && yystate <= yylast_
|
|
||||||
&& yycheck_[yystate] == yystack.stateAt (0))
|
|
||||||
yystate = yytable_[yystate];
|
|
||||||
else
|
|
||||||
yystate = yydefgoto_[yyn - yyntokens_];
|
|
||||||
|
|
||||||
yystack.push (yystate, yyval]b4_locations_if([, yyloc])[);
|
yystack.push (yystate, yyval]b4_locations_if([, yyloc])[);
|
||||||
return YYNEWSTATE;
|
return YYNEWSTATE;
|
||||||
}
|
}
|
||||||
@@ -463,6 +552,7 @@ b4_lexer_if([[
|
|||||||
+ (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
|
+ (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
]b4_push_if([],[[
|
||||||
/**
|
/**
|
||||||
* Parse input from the scanner that was specified at object construction
|
* Parse input from the scanner that was specified at object construction
|
||||||
* time. Return whether the end of the input was reached successfully.
|
* time. Return whether the end of the input was reached successfully.
|
||||||
@@ -470,46 +560,51 @@ b4_lexer_if([[
|
|||||||
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
||||||
* imply that there were no syntax errors.
|
* imply that there were no syntax errors.
|
||||||
*/
|
*/
|
||||||
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
|
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[]])[
|
||||||
|
]b4_push_if([
|
||||||
|
/**
|
||||||
|
* Push Parse input from external lexer
|
||||||
|
*
|
||||||
|
* @@param yylextoken current token
|
||||||
|
* @@param yylexval current lval
|
||||||
|
]b4_locations_if([ * @@param yylexloc current position])[
|
||||||
|
*
|
||||||
|
* @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt>
|
||||||
|
*/
|
||||||
|
public int push_parse (int yylextoken, b4_yystype yylexval[]b4_locations_if([, b4_location_type yylexloc]))
|
||||||
|
b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])])[
|
||||||
{
|
{
|
||||||
/// Lookahead and lookahead in internal form.
|
]b4_locations_if([/* @@$. */
|
||||||
int yychar = yyempty_;
|
b4_location_type yyloc;])[
|
||||||
int yytoken = 0;
|
]b4_push_if([],[[
|
||||||
|
]b4_define_state[
|
||||||
/* State. */
|
|
||||||
int yyn = 0;
|
|
||||||
int yylen = 0;
|
|
||||||
int yystate = 0;
|
|
||||||
|
|
||||||
YYStack yystack = new YYStack ();
|
|
||||||
|
|
||||||
/* Error handling. */
|
|
||||||
int yynerrs_ = 0;
|
|
||||||
]b4_locations_if([/// The location where the error started.
|
|
||||||
]b4_location_type[ yyerrloc = null;
|
|
||||||
|
|
||||||
/// ]b4_location_type[ of the lookahead.
|
|
||||||
]b4_location_type[ yylloc = new ]b4_location_type[ (null, null);
|
|
||||||
|
|
||||||
/// @@$.
|
|
||||||
]b4_location_type[ yyloc;])
|
|
||||||
|
|
||||||
/// Semantic value of the lookahead.
|
|
||||||
b4_yystype[ yylval = null;
|
|
||||||
|
|
||||||
yycdebug ("Starting parse\n");
|
yycdebug ("Starting parse\n");
|
||||||
yyerrstatus_ = 0;
|
yyerrstatus_ = 0;
|
||||||
|
|
||||||
|
/* Initialize the stack. */
|
||||||
|
yystack.push (yystate, yylval ]b4_locations_if([, yylloc])[);
|
||||||
]m4_ifdef([b4_initial_action], [
|
]m4_ifdef([b4_initial_action], [
|
||||||
b4_dollar_pushdef([yylval], [], [yylloc])dnl
|
b4_dollar_pushdef([yylval], [], [yylloc])dnl
|
||||||
/* User initialization code. */
|
|
||||||
b4_user_initial_action
|
b4_user_initial_action
|
||||||
b4_dollar_popdef])[]dnl
|
b4_dollar_popdef[]dnl
|
||||||
|
])[
|
||||||
|
]])[
|
||||||
|
]b4_push_if([[
|
||||||
|
if (!this.push_parse_initialized)
|
||||||
|
{
|
||||||
|
push_parse_initialize ();
|
||||||
|
]m4_ifdef([b4_initial_action], [
|
||||||
|
b4_dollar_pushdef([yylval], [], [yylloc])dnl
|
||||||
|
b4_user_initial_action
|
||||||
|
b4_dollar_popdef[]dnl
|
||||||
|
])[
|
||||||
|
yycdebug ("Starting parse\n");
|
||||||
|
yyerrstatus_ = 0;
|
||||||
|
} else
|
||||||
|
label = YYGETTOKEN;
|
||||||
|
|
||||||
[ /* Initialize the stack. */
|
boolean push_token_consumed = true;
|
||||||
yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
|
]])[
|
||||||
|
|
||||||
int label = YYNEWSTATE;
|
|
||||||
for (;;)
|
for (;;)
|
||||||
switch (label)
|
switch (label)
|
||||||
{
|
{
|
||||||
@@ -522,7 +617,8 @@ b4_dollar_popdef])[]dnl
|
|||||||
|
|
||||||
/* Accept? */
|
/* Accept? */
|
||||||
if (yystate == yyfinal_)
|
if (yystate == yyfinal_)
|
||||||
return true;
|
]b4_push_if([{label = YYACCEPT; break;}],
|
||||||
|
[return true;])[
|
||||||
|
|
||||||
/* Take a decision. First try without lookahead. */
|
/* Take a decision. First try without lookahead. */
|
||||||
yyn = yypact_[yystate];
|
yyn = yypact_[yystate];
|
||||||
@@ -531,16 +627,27 @@ b4_dollar_popdef])[]dnl
|
|||||||
label = YYDEFAULT;
|
label = YYDEFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
]b4_push_if([ /* Fall Through */
|
||||||
|
|
||||||
|
case YYGETTOKEN:])[
|
||||||
/* Read a lookahead token. */
|
/* Read a lookahead token. */
|
||||||
if (yychar == yyempty_)
|
if (yychar == yyempty_)
|
||||||
{
|
{
|
||||||
|
]b4_push_if([[
|
||||||
|
if (!push_token_consumed)
|
||||||
|
return YYPUSH_MORE;
|
||||||
yycdebug ("Reading a token: ");
|
yycdebug ("Reading a token: ");
|
||||||
yychar = yylexer.yylex ();]
|
yychar = yylextoken;
|
||||||
b4_locations_if([[
|
yylval = yylexval;]b4_locations_if([
|
||||||
yylloc = new ]b4_location_type[(yylexer.getStartPos (),
|
yylloc = yylexloc;])[
|
||||||
yylexer.getEndPos ());]])
|
push_token_consumed = false;]])[
|
||||||
yylval = yylexer.getLVal ();[
|
]b4_push_if([],[[
|
||||||
|
yycdebug ("Reading a token: ");
|
||||||
|
yychar = yylexer.yylex ();
|
||||||
|
yylval = yylexer.getLVal ();]b4_locations_if([
|
||||||
|
yylloc = new b4_location_type (yylexer.getStartPos (),
|
||||||
|
yylexer.getEndPos ());])[
|
||||||
|
]])[
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert token to internal form. */
|
/* Convert token to internal form. */
|
||||||
@@ -637,10 +744,10 @@ b4_dollar_popdef])[]dnl
|
|||||||
{
|
{
|
||||||
/* Return failure if at end of input. */
|
/* Return failure if at end of input. */
|
||||||
if (yychar == Lexer.EOF)
|
if (yychar == Lexer.EOF)
|
||||||
return false;
|
]b4_push_if([{label = YYABORT; break;}],[return false;])[
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
yychar = yyempty_;
|
yychar = yyempty_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Else will try to reuse lookahead token after shifting the error
|
/* Else will try to reuse lookahead token after shifting the error
|
||||||
@@ -648,9 +755,9 @@ b4_dollar_popdef])[]dnl
|
|||||||
label = YYERRLAB1;
|
label = YYERRLAB1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*---------------------------------------------------.
|
/*-------------------------------------------------.
|
||||||
| errorlab -- error raised explicitly by YYERROR. |
|
| errorlab -- error raised explicitly by YYERROR. |
|
||||||
`---------------------------------------------------*/
|
`-------------------------------------------------*/
|
||||||
case YYERROR:
|
case YYERROR:
|
||||||
|
|
||||||
]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[
|
]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[
|
||||||
@@ -682,9 +789,10 @@ b4_dollar_popdef])[]dnl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pop the current state because it cannot handle the error token. */
|
/* Pop the current state because it cannot handle the
|
||||||
|
* error token. */
|
||||||
if (yystack.height == 0)
|
if (yystack.height == 0)
|
||||||
return false;
|
]b4_push_if([{label = YYABORT; break;}],[return false;])[
|
||||||
|
|
||||||
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
|
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
|
||||||
yystack.pop ();
|
yystack.pop ();
|
||||||
@@ -693,7 +801,11 @@ b4_dollar_popdef])[]dnl
|
|||||||
yystack.print (yyDebugStream);
|
yystack.print (yyDebugStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_locations_if([
|
if (label == YYABORT)
|
||||||
|
/* Leave the switch. */
|
||||||
|
break;
|
||||||
|
|
||||||
|
]b4_locations_if([
|
||||||
/* Muck with the stack to setup for yylloc. */
|
/* Muck with the stack to setup for yylloc. */
|
||||||
yystack.push (0, null, yylloc);
|
yystack.push (0, null, yylloc);
|
||||||
yystack.push (0, null, yyerrloc);
|
yystack.push (0, null, yyerrloc);
|
||||||
@@ -711,13 +823,91 @@ b4_dollar_popdef])[]dnl
|
|||||||
|
|
||||||
/* Accept. */
|
/* Accept. */
|
||||||
case YYACCEPT:
|
case YYACCEPT:
|
||||||
return true;
|
]b4_push_if([this.push_parse_initialized = false; return YYACCEPT;],
|
||||||
|
[return true;])[
|
||||||
|
|
||||||
/* Abort. */
|
/* Abort. */
|
||||||
case YYABORT:
|
case YYABORT:
|
||||||
return false;
|
]b4_push_if([this.push_parse_initialized = false; return YYABORT;],
|
||||||
|
[return false;])[
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
]b4_push_if([[
|
||||||
|
boolean push_parse_initialized = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (Re-)Initialize the state of the push parser.
|
||||||
|
*/
|
||||||
|
public void push_parse_initialize()
|
||||||
|
{
|
||||||
|
/* Lookahead and lookahead in internal form. */
|
||||||
|
this.yychar = yyempty_;
|
||||||
|
this.yytoken = 0;
|
||||||
|
|
||||||
|
/* State. */
|
||||||
|
this.yyn = 0;
|
||||||
|
this.yylen = 0;
|
||||||
|
this.yystate = 0;
|
||||||
|
this.yystack = new YYStack ();
|
||||||
|
this.label = YYNEWSTATE;
|
||||||
|
|
||||||
|
/* Error handling. */
|
||||||
|
this.yynerrs_ = 0;
|
||||||
|
]b4_locations_if([/* The location where the error started. */
|
||||||
|
this.yyerrloc = null;
|
||||||
|
this.yylloc = new b4_location_type (null, null);])[
|
||||||
|
|
||||||
|
/* Semantic value of the lookahead. */
|
||||||
|
this.yylval = null;
|
||||||
|
|
||||||
|
yystack.push (this.yystate, this.yylval]b4_locations_if([, this.yylloc])[);
|
||||||
|
|
||||||
|
this.push_parse_initialized = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
]b4_locations_if([
|
||||||
|
/**
|
||||||
|
* Push parse given input from an external lexer.
|
||||||
|
*
|
||||||
|
* @@param yylextoken current token
|
||||||
|
* @@param yylexval current lval
|
||||||
|
* @@param yyylexpos current position
|
||||||
|
*
|
||||||
|
* @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt>
|
||||||
|
*/
|
||||||
|
public int push_parse (int yylextoken, b4_yystype yylexval, b4_position_type yylexpos)
|
||||||
|
b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])
|
||||||
|
{
|
||||||
|
return push_parse (yylextoken, yylexval, new b4_location_type (yylexpos));
|
||||||
|
}
|
||||||
|
])[]])
|
||||||
|
|
||||||
|
b4_both_if([[
|
||||||
|
/**
|
||||||
|
* Parse input from the scanner that was specified at object construction
|
||||||
|
* time. Return whether the end of the input was reached successfully.
|
||||||
|
* This version of parse () is defined only when api.push-push=both.
|
||||||
|
*
|
||||||
|
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
||||||
|
* imply that there were no syntax errors.
|
||||||
|
*/
|
||||||
|
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
|
||||||
|
{
|
||||||
|
if (yylexer == null)
|
||||||
|
throw new NullPointerException("Null Lexer");
|
||||||
|
int status;
|
||||||
|
do {
|
||||||
|
int token = yylexer.yylex();
|
||||||
|
]b4_yystype[ lval = yylexer.getLVal();
|
||||||
|
]b4_locations_if([dnl
|
||||||
|
b4_location_type yyloc = new b4_location_type (yylexer.getStartPos (),
|
||||||
|
yylexer.getEndPos ());])[
|
||||||
|
]b4_locations_if([status = push_parse(token,lval,yyloc);],[
|
||||||
|
status = push_parse(token,lval);])[
|
||||||
|
} while (status == YYPUSH_MORE);
|
||||||
|
return (status == YYACCEPT);
|
||||||
|
}
|
||||||
|
]])[
|
||||||
|
|
||||||
// Generate an error message.
|
// Generate an error message.
|
||||||
private String yysyntax_error (int yystate, int tok)
|
private String yysyntax_error (int yystate, int tok)
|
||||||
@@ -752,8 +942,8 @@ b4_dollar_popdef])[]dnl
|
|||||||
*/
|
*/
|
||||||
if (tok != yyempty_)
|
if (tok != yyempty_)
|
||||||
{
|
{
|
||||||
// FIXME: This method of building the message is not compatible
|
/* FIXME: This method of building the message is not compatible
|
||||||
// with internationalization.
|
with internationalization. */
|
||||||
StringBuffer res =
|
StringBuffer res =
|
||||||
new StringBuffer ("syntax error, unexpected ");
|
new StringBuffer ("syntax error, unexpected ");
|
||||||
res.append (yytnamerr_ (yytname_[tok]));
|
res.append (yytnamerr_ (yytname_[tok]));
|
||||||
@@ -802,8 +992,9 @@ b4_dollar_popdef])[]dnl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the given <code>yytable_</code> value indicates a syntax error.
|
* Whether the given <code>yytable_</code>
|
||||||
* @@param yyvalue the value to check
|
* value indicates a syntax error.
|
||||||
|
* @@param yyvalue the value to check
|
||||||
*/
|
*/
|
||||||
private static boolean yy_table_value_is_error_ (int yyvalue)
|
private static boolean yy_table_value_is_error_ (int yyvalue)
|
||||||
{
|
{
|
||||||
@@ -825,6 +1016,7 @@ b4_dollar_popdef])[]dnl
|
|||||||
]b4_integral_parser_table_define([rline], [b4_rline],
|
]b4_integral_parser_table_define([rline], [b4_rline],
|
||||||
[[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[
|
[[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[
|
||||||
|
|
||||||
|
|
||||||
// Report on the debug stream that the rule yyrule is going to be reduced.
|
// Report on the debug stream that the rule yyrule is going to be reduced.
|
||||||
private void yy_reduce_print (int yyrule, YYStack yystack)
|
private void yy_reduce_print (int yyrule, YYStack yystack)
|
||||||
{
|
{
|
||||||
@@ -873,4 +1065,4 @@ b4_percent_code_get[]dnl
|
|||||||
}
|
}
|
||||||
|
|
||||||
b4_epilogue[]dnl
|
b4_epilogue[]dnl
|
||||||
b4_output_end()
|
b4_output_end
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
## Copyright (C) 2002, 2005-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2002, 2005-2015, 2018 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
|
||||||
|
|||||||
+142
-95
@@ -1,6 +1,6 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2015, 2018 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,32 +16,67 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
m4_pushdef([b4_copyright_years],
|
m4_pushdef([b4_copyright_years],
|
||||||
[2002-2013])
|
[2002-2015, 2018])
|
||||||
|
|
||||||
# b4_position_define
|
|
||||||
|
# b4_position_file
|
||||||
|
# ----------------
|
||||||
|
# Name of the file containing the position class, if we want this file.
|
||||||
|
b4_defines_if([b4_required_version_if([302], [],
|
||||||
|
[m4_define([b4_position_file], [position.hh])])])])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_location_file
|
||||||
|
# ----------------
|
||||||
|
# Name of the file containing the position/location class,
|
||||||
|
# if we want this file.
|
||||||
|
b4_percent_define_check_file([b4_location_file],
|
||||||
|
[[api.location.file]],
|
||||||
|
b4_defines_if([[location.hh]]))
|
||||||
|
|
||||||
|
# b4_location_include
|
||||||
|
# -------------------
|
||||||
|
# If location.hh is to be generated, the name under which should it be
|
||||||
|
# included.
|
||||||
|
#
|
||||||
|
# b4_location_path
|
||||||
|
# ----------------
|
||||||
|
# The path to use for the CPP guard.
|
||||||
|
m4_ifdef([b4_location_file],
|
||||||
|
[m4_define([b4_location_include],
|
||||||
|
[b4_percent_define_get([[api.location.include]],
|
||||||
|
["b4_location_file"])])
|
||||||
|
m4_define([b4_location_path],
|
||||||
|
b4_percent_define_get([[api.location.include]],
|
||||||
|
["b4_dir_prefix[]b4_location_file"]))
|
||||||
|
m4_define([b4_location_path],
|
||||||
|
m4_substr(m4_defn([b4_location_path]), 1, m4_eval(m4_len(m4_defn([b4_location_path])) - 2)))
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# b4_location_define
|
||||||
# ------------------
|
# ------------------
|
||||||
# Define class position.
|
# Define the position and location classes.
|
||||||
m4_define([b4_position_define],
|
m4_define([b4_location_define],
|
||||||
[[ /// Abstract a position.
|
[[ /// A point in a source file.
|
||||||
class position
|
class position
|
||||||
{
|
{
|
||||||
public:
|
public:]m4_ifdef([b4_location_constructors], [[
|
||||||
]m4_ifdef([b4_location_constructors], [[
|
|
||||||
/// Construct a position.
|
/// Construct a position.
|
||||||
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
|
||||||
unsigned int l = ]b4_location_initial_line[u,
|
unsigned l = ]b4_location_initial_line[u,
|
||||||
unsigned int c = ]b4_location_initial_column[u)
|
unsigned c = ]b4_location_initial_column[u)
|
||||||
: filename (f)
|
: filename (f)
|
||||||
, line (l)
|
, line (l)
|
||||||
, column (c)
|
, column (c)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
]])[
|
]])[
|
||||||
/// Initialization.
|
/// Initialization.
|
||||||
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL,
|
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULLPTR,
|
||||||
unsigned int l = ]b4_location_initial_line[u,
|
unsigned l = ]b4_location_initial_line[u,
|
||||||
unsigned int c = ]b4_location_initial_column[u)
|
unsigned c = ]b4_location_initial_column[u)
|
||||||
{
|
{
|
||||||
filename = fn;
|
filename = fn;
|
||||||
line = l;
|
line = l;
|
||||||
@@ -53,53 +88,63 @@ m4_define([b4_position_define],
|
|||||||
/// (line related) Advance to the COUNT next lines.
|
/// (line related) Advance to the COUNT next lines.
|
||||||
void lines (int count = 1)
|
void lines (int count = 1)
|
||||||
{
|
{
|
||||||
column = ]b4_location_initial_column[u;
|
if (count)
|
||||||
line += count;
|
{
|
||||||
|
column = ]b4_location_initial_column[u;
|
||||||
|
line = add_ (line, count, ]b4_location_initial_line[);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// (column related) Advance to the COUNT next columns.
|
/// (column related) Advance to the COUNT next columns.
|
||||||
void columns (int count = 1)
|
void columns (int count = 1)
|
||||||
{
|
{
|
||||||
column = std::max (]b4_location_initial_column[u, column + count);
|
column = add_ (column, count, ]b4_location_initial_column[);
|
||||||
}
|
}
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
/// File name to which this position refers.
|
/// File name to which this position refers.
|
||||||
]b4_percent_define_get([[filename_type]])[* filename;
|
]b4_percent_define_get([[filename_type]])[* filename;
|
||||||
/// Current line number.
|
/// Current line number.
|
||||||
unsigned int line;
|
unsigned line;
|
||||||
/// Current column number.
|
/// Current column number.
|
||||||
unsigned int column;
|
unsigned column;
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Compute max (min, lhs+rhs).
|
||||||
|
static unsigned add_ (unsigned lhs, int rhs, int min)
|
||||||
|
{
|
||||||
|
return static_cast<unsigned> (std::max (min,
|
||||||
|
static_cast<int> (lhs) + rhs));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Add and assign a position.
|
/// Add \a width columns, in place.
|
||||||
inline position&
|
inline position&
|
||||||
operator+= (position& res, const int width)
|
operator+= (position& res, int width)
|
||||||
{
|
{
|
||||||
res.columns (width);
|
res.columns (width);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add two position objects.
|
/// Add \a width columns.
|
||||||
inline const position
|
inline position
|
||||||
operator+ (const position& begin, const int width)
|
operator+ (position res, int width)
|
||||||
{
|
{
|
||||||
position res = begin;
|
|
||||||
return res += width;
|
return res += width;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add and assign a position.
|
/// Subtract \a width columns, in place.
|
||||||
inline position&
|
inline position&
|
||||||
operator-= (position& res, const int width)
|
operator-= (position& res, int width)
|
||||||
{
|
{
|
||||||
return res += -width;
|
return res += -width;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add two position objects.
|
/// Subtract \a width columns.
|
||||||
inline const position
|
inline position
|
||||||
operator- (const position& begin, const int width)
|
operator- (position res, int width)
|
||||||
{
|
{
|
||||||
return begin + -width;
|
return res -= width;
|
||||||
}
|
}
|
||||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||||
/// Compare two position objects.
|
/// Compare two position objects.
|
||||||
@@ -125,20 +170,15 @@ m4_define([b4_position_define],
|
|||||||
** \param pos a reference to the position to redirect
|
** \param pos a reference to the position to redirect
|
||||||
*/
|
*/
|
||||||
template <typename YYChar>
|
template <typename YYChar>
|
||||||
inline std::basic_ostream<YYChar>&
|
std::basic_ostream<YYChar>&
|
||||||
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
|
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
|
||||||
{
|
{
|
||||||
if (pos.filename)
|
if (pos.filename)
|
||||||
ostr << *pos.filename << ':';
|
ostr << *pos.filename << ':';
|
||||||
return ostr << pos.line << '.' << pos.column;
|
return ostr << pos.line << '.' << pos.column;
|
||||||
}
|
}
|
||||||
]])
|
|
||||||
|
|
||||||
|
/// Two points in a source file.
|
||||||
# b4_location_define
|
|
||||||
# ------------------
|
|
||||||
m4_define([b4_location_define],
|
|
||||||
[[ /// Abstract a location.
|
|
||||||
class location
|
class location
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -147,30 +187,27 @@ m4_define([b4_location_define],
|
|||||||
location (const position& b, const position& e)
|
location (const position& b, const position& e)
|
||||||
: begin (b)
|
: begin (b)
|
||||||
, end (e)
|
, end (e)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
/// Construct a 0-width location in \a p.
|
/// Construct a 0-width location in \a p.
|
||||||
explicit location (const position& p = position ())
|
explicit location (const position& p = position ())
|
||||||
: begin (p)
|
: begin (p)
|
||||||
, end (p)
|
, end (p)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
/// Construct a 0-width location in \a f, \a l, \a c.
|
/// Construct a 0-width location in \a f, \a l, \a c.
|
||||||
explicit location (]b4_percent_define_get([[filename_type]])[* f,
|
explicit location (]b4_percent_define_get([[filename_type]])[* f,
|
||||||
unsigned int l = ]b4_location_initial_line[u,
|
unsigned l = ]b4_location_initial_line[u,
|
||||||
unsigned int c = ]b4_location_initial_column[u)
|
unsigned c = ]b4_location_initial_column[u)
|
||||||
: begin (f, l, c)
|
: begin (f, l, c)
|
||||||
, end (f, l, c)
|
, end (f, l, c)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
])[
|
])[
|
||||||
/// Initialization.
|
/// Initialization.
|
||||||
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
|
||||||
unsigned int l = ]b4_location_initial_line[u,
|
unsigned l = ]b4_location_initial_line[u,
|
||||||
unsigned int c = ]b4_location_initial_column[u)
|
unsigned c = ]b4_location_initial_column[u)
|
||||||
{
|
{
|
||||||
begin.initialize (f, l, c);
|
begin.initialize (f, l, c);
|
||||||
end = begin;
|
end = begin;
|
||||||
@@ -186,13 +223,13 @@ m4_define([b4_location_define],
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Extend the current location to the COUNT next columns.
|
/// Extend the current location to the COUNT next columns.
|
||||||
void columns (unsigned int count = 1)
|
void columns (int count = 1)
|
||||||
{
|
{
|
||||||
end += count;
|
end += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extend the current location to the COUNT next lines.
|
/// Extend the current location to the COUNT next lines.
|
||||||
void lines (unsigned int count = 1)
|
void lines (int count = 1)
|
||||||
{
|
{
|
||||||
end.lines (count);
|
end.lines (count);
|
||||||
}
|
}
|
||||||
@@ -206,27 +243,42 @@ m4_define([b4_location_define],
|
|||||||
position end;
|
position end;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Join two location objects to create a location.
|
/// Join two locations, in place.
|
||||||
inline const location operator+ (const location& begin, const location& end)
|
inline location& operator+= (location& res, const location& end)
|
||||||
{
|
{
|
||||||
location res = begin;
|
|
||||||
res.end = end.end;
|
res.end = end.end;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add two location objects.
|
/// Join two locations.
|
||||||
inline const location operator+ (const location& begin, unsigned int width)
|
inline location operator+ (location res, const location& end)
|
||||||
|
{
|
||||||
|
return res += end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add \a width columns to the end position, in place.
|
||||||
|
inline location& operator+= (location& res, int width)
|
||||||
{
|
{
|
||||||
location res = begin;
|
|
||||||
res.columns (width);
|
res.columns (width);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add and assign a location.
|
/// Add \a width columns to the end position.
|
||||||
inline location& operator+= (location& res, unsigned int width)
|
inline location operator+ (location res, int width)
|
||||||
{
|
{
|
||||||
res.columns (width);
|
return res += width;
|
||||||
return res;
|
}
|
||||||
|
|
||||||
|
/// Subtract \a width columns to the end position, in place.
|
||||||
|
inline location& operator-= (location& res, int width)
|
||||||
|
{
|
||||||
|
return res += -width;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Subtract \a width columns to the end position.
|
||||||
|
inline location operator- (location res, int width)
|
||||||
|
{
|
||||||
|
return res -= width;
|
||||||
}
|
}
|
||||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||||
/// Compare two location objects.
|
/// Compare two location objects.
|
||||||
@@ -250,12 +302,11 @@ m4_define([b4_location_define],
|
|||||||
** Avoid duplicate information.
|
** Avoid duplicate information.
|
||||||
*/
|
*/
|
||||||
template <typename YYChar>
|
template <typename YYChar>
|
||||||
inline std::basic_ostream<YYChar>&
|
std::basic_ostream<YYChar>&
|
||||||
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
|
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
|
||||||
{
|
{
|
||||||
unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
|
unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
|
||||||
ostr << loc.begin// << "(" << loc.end << ") "
|
ostr << loc.begin;
|
||||||
;
|
|
||||||
if (loc.end.filename
|
if (loc.end.filename
|
||||||
&& (!loc.begin.filename
|
&& (!loc.begin.filename
|
||||||
|| *loc.begin.filename != *loc.end.filename))
|
|| *loc.begin.filename != *loc.end.filename))
|
||||||
@@ -269,16 +320,31 @@ m4_define([b4_location_define],
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
b4_defines_if([
|
m4_ifdef([b4_position_file], [[
|
||||||
b4_output_begin([b4_dir_prefix[]position.hh])
|
]b4_output_begin([b4_dir_prefix], [b4_position_file])[
|
||||||
b4_copyright([Positions for Bison parsers in C++])[
|
]b4_generated_by[
|
||||||
|
// Starting with Bison 3.2, this file is useless: the structure it
|
||||||
|
// used to define is now defined in "]b4_location_file[".
|
||||||
|
//
|
||||||
|
// To get rid of this file:
|
||||||
|
// 1. add 'require "3.2"' (or newer) to your grammar file
|
||||||
|
// 2. remove references to this file from your build system
|
||||||
|
// 3. if you used to include it, include "]b4_location_file[" instead.
|
||||||
|
|
||||||
|
#include ]b4_location_include[
|
||||||
|
]b4_output_end[
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
m4_ifdef([b4_location_file], [[
|
||||||
|
]b4_output_begin([b4_dir_prefix], [b4_location_file])[
|
||||||
|
]b4_copyright([Locations for Bison parsers in C++])[
|
||||||
/**
|
/**
|
||||||
** \file ]b4_dir_prefix[position.hh
|
** \file ]b4_location_path[
|
||||||
** Define the ]b4_namespace_ref[::position class.
|
** Define the ]b4_namespace_ref[::location class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[
|
]b4_cpp_guard_open([b4_location_path])[
|
||||||
|
|
||||||
# include <algorithm> // std::max
|
# include <algorithm> // std::max
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
@@ -286,31 +352,12 @@ b4_copyright([Positions for Bison parsers in C++])[
|
|||||||
|
|
||||||
]b4_null_define[
|
]b4_null_define[
|
||||||
|
|
||||||
]b4_namespace_open[
|
|
||||||
]b4_position_define[
|
|
||||||
]b4_namespace_close[
|
|
||||||
]b4_cpp_guard_close([b4_dir_prefix[]position.hh])
|
|
||||||
b4_output_end()
|
|
||||||
|
|
||||||
|
|
||||||
b4_output_begin([b4_dir_prefix[]location.hh])
|
|
||||||
b4_copyright([Locations for Bison parsers in C++])[
|
|
||||||
|
|
||||||
/**
|
|
||||||
** \file ]b4_dir_prefix[location.hh
|
|
||||||
** Define the ]b4_namespace_ref[::location class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[
|
|
||||||
|
|
||||||
# include "position.hh"
|
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
]b4_location_define[
|
]b4_location_define[
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
]b4_cpp_guard_close([b4_dir_prefix[]location.hh])
|
]b4_cpp_guard_close([b4_location_path])[
|
||||||
b4_output_end()
|
]b4_output_end[
|
||||||
])
|
]])
|
||||||
|
|
||||||
|
|
||||||
m4_popdef([b4_copyright_years])
|
m4_popdef([b4_copyright_years])
|
||||||
|
|||||||
+71
-58
@@ -1,6 +1,6 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2015, 2018 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,78 +15,102 @@
|
|||||||
# 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, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
m4_pushdef([b4_copyright_years],
|
|
||||||
[2002-2013])
|
# b4_stack_file
|
||||||
|
# -------------
|
||||||
|
# Name of the file containing the stack class, if we want this file.
|
||||||
|
b4_defines_if([b4_required_version_if([302], [],
|
||||||
|
[m4_define([b4_stack_file], [stack.hh])])])
|
||||||
|
|
||||||
|
|
||||||
# b4_stack_define
|
# b4_stack_define
|
||||||
# ---------------
|
# ---------------
|
||||||
m4_define([b4_stack_define],
|
m4_define([b4_stack_define],
|
||||||
[[ template <class T, class S = std::vector<T> >
|
[[ /// A stack with random access from its top.
|
||||||
|
template <typename T, typename S = std::vector<T> >
|
||||||
class stack
|
class stack
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Hide our reversed order.
|
// Hide our reversed order.
|
||||||
typedef typename S::reverse_iterator iterator;
|
typedef typename S::reverse_iterator iterator;
|
||||||
typedef typename S::const_reverse_iterator const_iterator;
|
typedef typename S::const_reverse_iterator const_iterator;
|
||||||
|
typedef typename S::size_type size_type;
|
||||||
|
|
||||||
stack ()
|
stack (size_type n = 200)
|
||||||
: seq_ ()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
stack (unsigned int n)
|
|
||||||
: seq_ (n)
|
: seq_ (n)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
/// Random access.
|
||||||
|
///
|
||||||
|
/// Index 0 returns the topmost element.
|
||||||
T&
|
T&
|
||||||
operator[] (unsigned int i)
|
operator[] (size_type i)
|
||||||
{
|
{
|
||||||
return seq_[seq_.size () - 1 - i];
|
return seq_[size () - 1 - i];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
/// Random access.
|
||||||
const T&
|
///
|
||||||
operator[] (unsigned int i) const
|
/// Index 0 returns the topmost element.
|
||||||
|
T&
|
||||||
|
operator[] (int i)
|
||||||
{
|
{
|
||||||
return seq_[seq_.size () - 1 - i];
|
return operator[] (size_type (i));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Random access.
|
||||||
|
///
|
||||||
|
/// Index 0 returns the topmost element.
|
||||||
|
const T&
|
||||||
|
operator[] (size_type i) const
|
||||||
|
{
|
||||||
|
return seq_[size () - 1 - i];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Random access.
|
||||||
|
///
|
||||||
|
/// Index 0 returns the topmost element.
|
||||||
|
const T&
|
||||||
|
operator[] (int i) const
|
||||||
|
{
|
||||||
|
return operator[] (size_type (i));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Steal the contents of \a t.
|
/// Steal the contents of \a t.
|
||||||
///
|
///
|
||||||
/// Close to move-semantics.
|
/// Close to move-semantics.
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
push (T& t)
|
push (YY_MOVE_REF (T) t)
|
||||||
{
|
{
|
||||||
seq_.push_back (T());
|
seq_.push_back (T ());
|
||||||
operator[](0).move (t);
|
operator[](0).move (t);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
pop (unsigned int n = 1)
|
pop (int n = 1)
|
||||||
{
|
{
|
||||||
for (; n; --n)
|
for (; 0 < n; --n)
|
||||||
seq_.pop_back ();
|
seq_.pop_back ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
void
|
||||||
typename S::size_type
|
clear ()
|
||||||
|
{
|
||||||
|
seq_.clear ();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_type
|
||||||
size () const
|
size () const
|
||||||
{
|
{
|
||||||
return seq_.size ();
|
return seq_.size ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
const_iterator
|
const_iterator
|
||||||
begin () const
|
begin () const
|
||||||
{
|
{
|
||||||
return seq_.rbegin ();
|
return seq_.rbegin ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
const_iterator
|
const_iterator
|
||||||
end () const
|
end () const
|
||||||
{
|
{
|
||||||
@@ -94,53 +118,42 @@ m4_define([b4_stack_define],
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
stack (const stack&);
|
||||||
|
stack& operator= (const stack&);
|
||||||
/// The wrapped container.
|
/// The wrapped container.
|
||||||
S seq_;
|
S seq_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Present a slice of the top of a stack.
|
/// Present a slice of the top of a stack.
|
||||||
template <class T, class S = stack<T> >
|
template <typename T, typename S = stack<T> >
|
||||||
class slice
|
class slice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
slice (const S& stack, unsigned int range)
|
slice (const S& stack, int range)
|
||||||
: stack_ (stack)
|
: stack_ (stack)
|
||||||
, range_ (range)
|
, range_ (range)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
|
||||||
const T&
|
const T&
|
||||||
operator [] (unsigned int i) const
|
operator[] (int i) const
|
||||||
{
|
{
|
||||||
return stack_[range_ - i];
|
return stack_[range_ - i];
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const S& stack_;
|
const S& stack_;
|
||||||
unsigned int range_;
|
int range_;
|
||||||
};
|
};
|
||||||
]])
|
]])
|
||||||
|
|
||||||
b4_defines_if(
|
m4_ifdef([b4_stack_file],
|
||||||
[b4_output_begin([b4_dir_prefix[]stack.hh])
|
[b4_output_begin([b4_dir_prefix], [b4_stack_file])[
|
||||||
b4_copyright([Stack handling for Bison parsers in C++])[
|
]b4_generated_by[
|
||||||
|
// Starting with Bison 3.2, this file is useless: the structure it
|
||||||
/**
|
// used to define is now defined with the parser itself.
|
||||||
** \file ]b4_dir_prefix[stack.hh
|
//
|
||||||
** Define the ]b4_namespace_ref[::stack class.
|
// To get rid of this file:
|
||||||
*/
|
// 1. add 'require "3.2"' (or newer) to your grammar file
|
||||||
|
// 2. remove references to this file from your build system.
|
||||||
]b4_cpp_guard_open([b4_dir_prefix[]stack.hh])[
|
]b4_output_end[
|
||||||
|
]])
|
||||||
# include <vector>
|
|
||||||
|
|
||||||
]b4_namespace_open[
|
|
||||||
]b4_stack_define[
|
|
||||||
]b4_namespace_close[
|
|
||||||
|
|
||||||
]b4_cpp_guard_close([b4_dir_prefix[]stack.hh])
|
|
||||||
b4_output_end()
|
|
||||||
])
|
|
||||||
|
|
||||||
m4_popdef([b4_copyright_years])
|
|
||||||
|
|||||||
+144
-80
@@ -1,6 +1,6 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2015, 2018 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
|
||||||
@@ -26,10 +26,10 @@
|
|||||||
# YYTYPE.
|
# YYTYPE.
|
||||||
m4_define([b4_symbol_variant],
|
m4_define([b4_symbol_variant],
|
||||||
[m4_pushdef([b4_dollar_dollar],
|
[m4_pushdef([b4_dollar_dollar],
|
||||||
[$2.$3< $][3 >(m4_shift3($@))])dnl
|
[$2.$3< $][3 > (m4_shift3($@))])dnl
|
||||||
switch ($1)
|
switch ($1)
|
||||||
{
|
{
|
||||||
b4_type_foreach([b4_type_action_])[]dnl
|
b4_type_foreach([_b4_type_action])[]dnl
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -55,15 +55,15 @@ dummy[]_b4_char_sizeof_counter])
|
|||||||
# ---------------------------
|
# ---------------------------
|
||||||
# To be mapped on the list of type names to produce:
|
# To be mapped on the list of type names to produce:
|
||||||
#
|
#
|
||||||
# char dummy1[sizeof(type_name_1)];
|
# char dummy1[sizeof (type_name_1)];
|
||||||
# char dummy2[sizeof(type_name_2)];
|
# char dummy2[sizeof (type_name_2)];
|
||||||
#
|
#
|
||||||
# for defined type names.
|
# for defined type names.
|
||||||
m4_define([b4_char_sizeof],
|
m4_define([b4_char_sizeof],
|
||||||
[b4_symbol_if([$1], [has_type],
|
[b4_symbol_if([$1], [has_type],
|
||||||
[
|
[
|
||||||
m4_map([ b4_symbol_tag_comment], [$@])dnl
|
m4_map([ b4_symbol_tag_comment], [$@])dnl
|
||||||
char _b4_char_sizeof_dummy@{sizeof([b4_symbol([$1], [type])])@};
|
char _b4_char_sizeof_dummy@{sizeof (b4_symbol([$1], [type]))@};
|
||||||
])])
|
])])
|
||||||
|
|
||||||
|
|
||||||
@@ -94,45 +94,77 @@ m4_define([b4_variant_define],
|
|||||||
typedef variant<S> self_type;
|
typedef variant<S> self_type;
|
||||||
|
|
||||||
/// Empty construction.
|
/// Empty construction.
|
||||||
variant ()]b4_parse_assert_if([
|
variant ()
|
||||||
: tname (YY_NULL)])[
|
: yybuffer_ ()]b4_parse_assert_if([
|
||||||
|
, yytypeid_ (YY_NULLPTR)])[
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/// Construct and fill.
|
/// Construct and fill.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
variant (const T& t)]b4_parse_assert_if([
|
variant (YY_RVREF (T) t)]b4_parse_assert_if([
|
||||||
: tname (typeid (T).name ())])[
|
: yytypeid_ (&typeid (T))])[
|
||||||
{
|
{
|
||||||
YYASSERT (sizeof (T) <= S);
|
YYASSERT (sizeof (T) <= S);
|
||||||
new (buffer.raw) T (t);
|
new (yyas_<T> ()) T (YY_MOVE (t));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destruction, allowed only if empty.
|
/// Destruction, allowed only if empty.
|
||||||
~variant ()
|
~variant ()
|
||||||
{]b4_parse_assert_if([
|
{]b4_parse_assert_if([
|
||||||
YYASSERT (!tname);
|
YYASSERT (!yytypeid_);
|
||||||
])[}
|
])[}
|
||||||
|
|
||||||
/// Instantiate an empty \a T in here.
|
/// Instantiate an empty \a T in here.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T&
|
T&
|
||||||
build ()
|
emplace ()
|
||||||
{]b4_parse_assert_if([
|
{]b4_parse_assert_if([
|
||||||
YYASSERT (!tname);
|
YYASSERT (!yytypeid_);
|
||||||
YYASSERT (sizeof (T) <= S);
|
YYASSERT (sizeof (T) <= S);
|
||||||
tname = typeid (T).name ();])[
|
yytypeid_ = & typeid (T);])[
|
||||||
return *new (buffer.raw) T;
|
return *new (yyas_<T> ()) T ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if defined __cplusplus && 201103L <= __cplusplus
|
||||||
|
/// Instantiate a \a T in here from \a t.
|
||||||
|
template <typename T, typename U>
|
||||||
|
T&
|
||||||
|
emplace (U&& u)
|
||||||
|
{]b4_parse_assert_if([
|
||||||
|
YYASSERT (!yytypeid_);
|
||||||
|
YYASSERT (sizeof (T) <= S);
|
||||||
|
yytypeid_ = & typeid (T);])[
|
||||||
|
return *new (yyas_<T> ()) T (std::forward <U>(u));
|
||||||
|
}
|
||||||
|
# else
|
||||||
/// Instantiate a \a T in here from \a t.
|
/// Instantiate a \a T in here from \a t.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T&
|
T&
|
||||||
build (const T& t)
|
emplace (const T& t)
|
||||||
{]b4_parse_assert_if([
|
{]b4_parse_assert_if([
|
||||||
YYASSERT (!tname);
|
YYASSERT (!yytypeid_);
|
||||||
YYASSERT (sizeof (T) <= S);
|
YYASSERT (sizeof (T) <= S);
|
||||||
tname = typeid (T).name ();])[
|
yytypeid_ = & typeid (T);])[
|
||||||
return *new (buffer.raw) T (t);
|
return *new (yyas_<T> ()) T (t);
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/// Instantiate an empty \a T in here.
|
||||||
|
/// Obsolete, use emplace.
|
||||||
|
template <typename T>
|
||||||
|
T&
|
||||||
|
build ()
|
||||||
|
{
|
||||||
|
return emplace<T> ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Instantiate a \a T in here from \a t.
|
||||||
|
/// Obsolete, use emplace.
|
||||||
|
template <typename T>
|
||||||
|
T&
|
||||||
|
build (const T& t)
|
||||||
|
{
|
||||||
|
return emplace<T> (t);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Accessor to a built \a T.
|
/// Accessor to a built \a T.
|
||||||
@@ -140,9 +172,10 @@ m4_define([b4_variant_define],
|
|||||||
T&
|
T&
|
||||||
as ()
|
as ()
|
||||||
{]b4_parse_assert_if([
|
{]b4_parse_assert_if([
|
||||||
YYASSERT (tname == typeid (T).name ());
|
YYASSERT (yytypeid_);
|
||||||
|
YYASSERT (*yytypeid_ == typeid (T));
|
||||||
YYASSERT (sizeof (T) <= S);])[
|
YYASSERT (sizeof (T) <= S);])[
|
||||||
return reinterpret_cast<T&> (buffer.raw);
|
return *yyas_<T> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Const accessor to a built \a T (for %printer).
|
/// Const accessor to a built \a T (for %printer).
|
||||||
@@ -150,9 +183,10 @@ m4_define([b4_variant_define],
|
|||||||
const T&
|
const T&
|
||||||
as () const
|
as () const
|
||||||
{]b4_parse_assert_if([
|
{]b4_parse_assert_if([
|
||||||
YYASSERT (tname == typeid (T).name ());
|
YYASSERT (yytypeid_);
|
||||||
|
YYASSERT (*yytypeid_ == typeid (T));
|
||||||
YYASSERT (sizeof (T) <= S);])[
|
YYASSERT (sizeof (T) <= S);])[
|
||||||
return reinterpret_cast<const T&> (buffer.raw);
|
return *yyas_<T> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Swap the content with \a other, of same type.
|
/// Swap the content with \a other, of same type.
|
||||||
@@ -160,16 +194,16 @@ m4_define([b4_variant_define],
|
|||||||
/// Both variants must be built beforehand, because swapping the actual
|
/// Both variants must be built beforehand, because swapping the actual
|
||||||
/// data requires reading it (with as()), and this is not possible on
|
/// data requires reading it (with as()), and this is not possible on
|
||||||
/// unconstructed variants: it would require some dynamic testing, which
|
/// unconstructed variants: it would require some dynamic testing, which
|
||||||
/// should not be the variant's responsability.
|
/// should not be the variant's responsibility.
|
||||||
/// Swapping between built and (possibly) non-built is done with
|
/// Swapping between built and (possibly) non-built is done with
|
||||||
/// variant::move ().
|
/// variant::move ().
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void
|
void
|
||||||
swap (self_type& other)
|
swap (self_type& other)
|
||||||
{]b4_parse_assert_if([
|
{]b4_parse_assert_if([
|
||||||
YYASSERT (tname);
|
YYASSERT (yytypeid_);
|
||||||
YYASSERT (tname == other.tname);])[
|
YYASSERT (*yytypeid_ == *other.yytypeid_);])[
|
||||||
std::swap (as<T>(), other.as<T>());
|
std::swap (as<T> (), other.as<T> ());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Move the content of \a other to this.
|
/// Move the content of \a other to this.
|
||||||
@@ -178,19 +212,33 @@ m4_define([b4_variant_define],
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void
|
void
|
||||||
move (self_type& other)
|
move (self_type& other)
|
||||||
{]b4_parse_assert_if([
|
{
|
||||||
YYASSERT (!tname);])[
|
# if defined __cplusplus && 201103L <= __cplusplus
|
||||||
build<T>();
|
emplace<T> (std::move (other.as<T> ()));
|
||||||
swap<T>(other);
|
# else
|
||||||
other.destroy<T>();
|
emplace<T> ();
|
||||||
|
swap<T> (other);
|
||||||
|
# endif
|
||||||
|
other.destroy<T> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if defined __cplusplus && 201103L <= __cplusplus
|
||||||
|
/// Move the content of \a other to this.
|
||||||
|
template <typename T>
|
||||||
|
void
|
||||||
|
move (self_type&& other)
|
||||||
|
{
|
||||||
|
emplace<T> (std::move (other.as<T> ()));
|
||||||
|
other.destroy<T> ();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Copy the content of \a other to this.
|
/// Copy the content of \a other to this.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void
|
void
|
||||||
copy (const self_type& other)
|
copy (const self_type& other)
|
||||||
{
|
{
|
||||||
build<T> (other.as<T> ());
|
emplace<T> (other.as<T> ());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destroy the stored \a T.
|
/// Destroy the stored \a T.
|
||||||
@@ -199,25 +247,42 @@ m4_define([b4_variant_define],
|
|||||||
destroy ()
|
destroy ()
|
||||||
{
|
{
|
||||||
as<T> ().~T ();]b4_parse_assert_if([
|
as<T> ().~T ();]b4_parse_assert_if([
|
||||||
tname = YY_NULL;])[
|
yytypeid_ = YY_NULLPTR;])[
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Prohibit blind copies.
|
/// Prohibit blind copies.
|
||||||
self_type& operator=(const self_type&);
|
self_type& operator= (const self_type&);
|
||||||
variant (const self_type&);
|
variant (const self_type&);
|
||||||
|
|
||||||
/// A buffer large enough to store any of the semantic values.
|
/// Accessor to raw memory as \a T.
|
||||||
/// Long double is chosen as it has the strongest alignment
|
template <typename T>
|
||||||
/// constraints.
|
T*
|
||||||
|
yyas_ ()
|
||||||
|
{
|
||||||
|
void *yyp = yybuffer_.yyraw;
|
||||||
|
return static_cast<T*> (yyp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Const accessor to raw memory as \a T.
|
||||||
|
template <typename T>
|
||||||
|
const T*
|
||||||
|
yyas_ () const
|
||||||
|
{
|
||||||
|
const void *yyp = yybuffer_.yyraw;
|
||||||
|
return static_cast<const T*> (yyp);
|
||||||
|
}
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
long double align_me;
|
/// Strongest alignment constraints.
|
||||||
char raw[S];
|
long double yyalign_me;
|
||||||
} buffer;]b4_parse_assert_if([
|
/// A buffer large enough to store any of the semantic values.
|
||||||
|
char yyraw[S];
|
||||||
|
} yybuffer_;]b4_parse_assert_if([
|
||||||
|
|
||||||
/// Whether the content is built: if defined, the name of the stored type.
|
/// Whether the content is built: if defined, the name of the stored type.
|
||||||
const char* tname;])[
|
const std::type_info *yytypeid_;])[
|
||||||
};
|
};
|
||||||
]])
|
]])
|
||||||
|
|
||||||
@@ -227,16 +292,16 @@ m4_define([b4_variant_define],
|
|||||||
## -------------------------- ##
|
## -------------------------- ##
|
||||||
|
|
||||||
|
|
||||||
# b4_semantic_type_declare
|
# b4_value_type_declare
|
||||||
# ------------------------
|
# ---------------------
|
||||||
# Declare semantic_type.
|
# Declare semantic_type.
|
||||||
m4_define([b4_semantic_type_declare],
|
m4_define([b4_value_type_declare],
|
||||||
[ /// An auxiliary type to compute the largest semantic type.
|
[[ /// An auxiliary type to compute the largest semantic type.
|
||||||
union union_type
|
union union_type
|
||||||
{]b4_type_foreach([b4_char_sizeof])[};
|
{]b4_type_foreach([b4_char_sizeof])[};
|
||||||
|
|
||||||
/// Symbol semantic values.
|
/// Symbol semantic values.
|
||||||
typedef variant<sizeof(union_type)> semantic_type;dnl
|
typedef variant<sizeof (union_type)> semantic_type;][]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -246,7 +311,7 @@ m4_define([b4_semantic_type_declare],
|
|||||||
# ----------------------------
|
# ----------------------------
|
||||||
m4_define([b4_symbol_value],
|
m4_define([b4_symbol_value],
|
||||||
[m4_ifval([$2],
|
[m4_ifval([$2],
|
||||||
[$1.as< $2 >()],
|
[$1.as< $2 > ()],
|
||||||
[$1])])
|
[$1])])
|
||||||
|
|
||||||
# b4_symbol_value_template(VAL, [TYPE])
|
# b4_symbol_value_template(VAL, [TYPE])
|
||||||
@@ -254,7 +319,7 @@ m4_define([b4_symbol_value],
|
|||||||
# Same as b4_symbol_value, but used in a template method.
|
# Same as b4_symbol_value, but used in a template method.
|
||||||
m4_define([b4_symbol_value_template],
|
m4_define([b4_symbol_value_template],
|
||||||
[m4_ifval([$2],
|
[m4_ifval([$2],
|
||||||
[$1.template as< $2 >()],
|
[$1.template as< $2 > ()],
|
||||||
[$1])])
|
[$1])])
|
||||||
|
|
||||||
|
|
||||||
@@ -264,18 +329,18 @@ m4_define([b4_symbol_value_template],
|
|||||||
## ------------- ##
|
## ------------- ##
|
||||||
|
|
||||||
|
|
||||||
# b4_symbol_constructor_declare_(SYMBOL-NUMBER)
|
# _b4_symbol_constructor_declare(SYMBOL-NUMBER)
|
||||||
# ---------------------------------------------
|
# ---------------------------------------------
|
||||||
# Declare the overloaded version of make_symbol for the (common) type of
|
# Declare the overloaded version of make_symbol for the (common) type of
|
||||||
# these SYMBOL-NUMBERS. Use at class-level.
|
# these SYMBOL-NUMBERS. Use at class-level.
|
||||||
m4_define([b4_symbol_constructor_declare_],
|
m4_define([_b4_symbol_constructor_declare],
|
||||||
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
|
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
|
||||||
[ static inline
|
[ static
|
||||||
symbol_type
|
symbol_type
|
||||||
make_[]b4_symbol_([$1], [id]) (dnl
|
make_[]_b4_symbol([$1], [id]) (dnl
|
||||||
b4_join(b4_symbol_if([$1], [has_type],
|
b4_join(b4_symbol_if([$1], [has_type],
|
||||||
[const b4_symbol([$1], [type])& v]),
|
[YY_COPY (b4_symbol([$1], [type])) v]),
|
||||||
b4_locations_if([const location_type& l])));
|
b4_locations_if([YY_COPY (location_type) l])));
|
||||||
|
|
||||||
])])])
|
])])])
|
||||||
|
|
||||||
@@ -286,55 +351,54 @@ b4_join(b4_symbol_if([$1], [has_type],
|
|||||||
# Use at class-level.
|
# Use at class-level.
|
||||||
m4_define([b4_symbol_constructor_declare],
|
m4_define([b4_symbol_constructor_declare],
|
||||||
[ // Symbol constructors declarations.
|
[ // Symbol constructors declarations.
|
||||||
b4_symbol_foreach([b4_symbol_constructor_declare_])])
|
b4_symbol_foreach([_b4_symbol_constructor_declare])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_symbol_constructor_define_(SYMBOL-NUMBER)
|
# _b4_symbol_constructor_define(SYMBOL-NUMBER)
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
# Define symbol constructor for this SYMBOL-NUMBER.
|
# Define symbol constructor for this SYMBOL-NUMBER.
|
||||||
m4_define([b4_symbol_constructor_define_],
|
m4_define([_b4_symbol_constructor_define],
|
||||||
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
|
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
|
||||||
[ b4_parser_class_name::symbol_type
|
[ inline
|
||||||
b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl
|
b4_parser_class_name::symbol_type
|
||||||
|
b4_parser_class_name::make_[]_b4_symbol([$1], [id]) (dnl
|
||||||
b4_join(b4_symbol_if([$1], [has_type],
|
b4_join(b4_symbol_if([$1], [has_type],
|
||||||
[const b4_symbol([$1], [type])& v]),
|
[YY_COPY (b4_symbol([$1], [type])) v]),
|
||||||
b4_locations_if([const location_type& l])))
|
b4_locations_if([YY_COPY (location_type) l])))
|
||||||
{
|
{
|
||||||
return symbol_type (b4_join([token::b4_symbol([$1], [id])],
|
return symbol_type (b4_join([token::b4_symbol([$1], [id])],
|
||||||
b4_symbol_if([$1], [has_type], [v]),
|
b4_symbol_if([$1], [has_type], [YY_MOVE (v)]),
|
||||||
b4_locations_if([l])));
|
b4_locations_if([YY_MOVE (l)])));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
])])])
|
])])])
|
||||||
|
|
||||||
|
|
||||||
# b4_basic_symbol_constructor_declare
|
# b4_basic_symbol_constructor_declare
|
||||||
# ----------------------------------
|
# -----------------------------------
|
||||||
# Generate a constructor declaration for basic_symbol from given type.
|
# Generate a constructor declaration for basic_symbol from given type.
|
||||||
m4_define([b4_basic_symbol_constructor_declare],
|
m4_define([b4_basic_symbol_constructor_declare],
|
||||||
[[
|
[[ basic_symbol (]b4_join(
|
||||||
basic_symbol (]b4_join(
|
|
||||||
[typename Base::kind_type t],
|
[typename Base::kind_type t],
|
||||||
b4_symbol_if([$1], [has_type], const b4_symbol([$1], [type])[ v]),
|
b4_symbol_if([$1], [has_type], [YY_RVREF (b4_symbol([$1], [type])) v]),
|
||||||
b4_locations_if([const location_type& l]))[);
|
b4_locations_if([YY_RVREF (location_type) l]))[);
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# b4_basic_symbol_constructor_define
|
# b4_basic_symbol_constructor_define
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
# Generate a constructor implementation for basic_symbol from given type.
|
# Generate a constructor implementation for basic_symbol from given type.
|
||||||
m4_define([b4_basic_symbol_constructor_define],
|
m4_define([b4_basic_symbol_constructor_define],
|
||||||
[[
|
[[ template <typename Base>
|
||||||
template <typename Base>
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
||||||
[typename Base::kind_type t],
|
[typename Base::kind_type t],
|
||||||
b4_symbol_if([$1], [has_type], const b4_symbol([$1], [type])[ v]),
|
b4_symbol_if([$1], [has_type], [YY_RVREF (b4_symbol([$1], [type])) v]),
|
||||||
b4_locations_if([const location_type& l]))[)
|
b4_locations_if([YY_RVREF (location_type) l]))[)
|
||||||
: Base (t)
|
: Base (t)]b4_symbol_if([$1], [has_type], [
|
||||||
, value (]b4_symbol_if([$1], [has_type], [v])[)]b4_locations_if([
|
, value (YY_MOVE (v))])[]b4_locations_if([
|
||||||
, location (l)])[
|
, location (YY_MOVE (l))])[
|
||||||
{}
|
{}
|
||||||
|
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# b4_symbol_constructor_define
|
# b4_symbol_constructor_define
|
||||||
@@ -342,4 +406,4 @@ m4_define([b4_basic_symbol_constructor_define],
|
|||||||
# Define the overloaded versions of make_symbol for all the value types.
|
# Define the overloaded versions of make_symbol for all the value types.
|
||||||
m4_define([b4_symbol_constructor_define],
|
m4_define([b4_symbol_constructor_define],
|
||||||
[ // Implementation of make_symbol for each symbol type.
|
[ // Implementation of make_symbol for each symbol type.
|
||||||
b4_symbol_foreach([b4_symbol_constructor_define_])])
|
b4_symbol_foreach([_b4_symbol_constructor_define])])
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
bison.xsl - common templates for Bison XSLT.
|
bison.xsl - common templates for Bison XSLT.
|
||||||
|
|
||||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||||
|
|
||||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<xsl:param name="staten"/>
|
<xsl:param name="staten"/>
|
||||||
<xsl:for-each select='reduction'>
|
<xsl:for-each select='reduction'>
|
||||||
<!-- These variables are needed because the current context can't be
|
<!-- These variables are needed because the current context can't be
|
||||||
refered to directly in XPath expressions. -->
|
referred to directly in XPath expressions. -->
|
||||||
<xsl:variable name="rul">
|
<xsl:variable name="rul">
|
||||||
<xsl:value-of select="@rule"/>
|
<xsl:value-of select="@rule"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<xsl:if test='not(preceding-sibling::*[@rule=$rul and @enabled=$ena])'>
|
<xsl:if test='not(preceding-sibling::*[@rule=$rul and @enabled=$ena])'>
|
||||||
<xsl:variable name="rule">
|
<xsl:variable name="rule">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<!-- The acceptation state is refered to as 'accept' in the XML, but
|
<!-- The acceptation state is referred to as 'accept' in the XML, but
|
||||||
just as '0' in the DOT. -->
|
just as '0' in the DOT. -->
|
||||||
<xsl:when test="@rule='accept'">
|
<xsl:when test="@rule='accept'">
|
||||||
<xsl:text>0</xsl:text>
|
<xsl:text>0</xsl:text>
|
||||||
@@ -201,6 +201,8 @@
|
|||||||
<xsl:if test="$point = 0">
|
<xsl:if test="$point = 0">
|
||||||
<xsl:text> .</xsl:text>
|
<xsl:text> .</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|
||||||
|
<!-- RHS -->
|
||||||
<xsl:for-each select="rhs/symbol|rhs/empty">
|
<xsl:for-each select="rhs/symbol|rhs/empty">
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:if test="$point = position()">
|
<xsl:if test="$point = position()">
|
||||||
@@ -214,7 +216,9 @@
|
|||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="empty"/>
|
<xsl:template match="empty">
|
||||||
|
<xsl:text> %empty</xsl:text>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="lookaheads">
|
<xsl:template match="lookaheads">
|
||||||
<xsl:text> [</xsl:text>
|
<xsl:text> [</xsl:text>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
xml2text.xsl - transform Bison XML Report into plain text.
|
xml2text.xsl - transform Bison XML Report into plain text.
|
||||||
|
|
||||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -350,12 +350,7 @@
|
|||||||
<xsl:if test="position() = $point + 1">
|
<xsl:if test="position() = $point + 1">
|
||||||
<xsl:text> .</xsl:text>
|
<xsl:text> .</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:apply-templates select="."/>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="$itemset != 'true'">
|
|
||||||
<xsl:apply-templates select="."/>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="position() = last() and position() = $point">
|
<xsl:if test="position() = last() and position() = $point">
|
||||||
<xsl:text> .</xsl:text>
|
<xsl:text> .</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
@@ -373,7 +368,7 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="empty">
|
<xsl:template match="empty">
|
||||||
<xsl:text> /* empty */</xsl:text>
|
<xsl:text> %empty</xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="lookaheads">
|
<xsl:template match="lookaheads">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!--
|
<!--
|
||||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||||
|
|
||||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
<xsl:template match="/">
|
<xsl:template match="/">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||||
<title>
|
<title>
|
||||||
<xsl:value-of select="bison-xml-report/filename"/>
|
<xsl:value-of select="bison-xml-report/filename"/>
|
||||||
<xsl:text> - GNU Bison XML Automaton Report</xsl:text>
|
<xsl:text> - GNU Bison XML Automaton Report</xsl:text>
|
||||||
@@ -532,12 +533,7 @@
|
|||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<span class="point">.</span>
|
<span class="point">.</span>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:apply-templates select="."/>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="$itemset != 'true'">
|
|
||||||
<xsl:apply-templates select="."/>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="position() = last() and position() = $point">
|
<xsl:if test="position() = last() and position() = $point">
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<span class="point">.</span>
|
<span class="point">.</span>
|
||||||
@@ -563,7 +559,7 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="empty">
|
<xsl:template match="empty">
|
||||||
<xsl:text> ε</xsl:text>
|
<xsl:text> %empty</xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="lookaheads">
|
<xsl:template match="lookaheads">
|
||||||
|
|||||||
+91
-117
@@ -1,11 +1,11 @@
|
|||||||
-*- C -*-
|
-*- C -*-
|
||||||
# Yacc compatible skeleton for Bison
|
# Yacc compatible skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation,
|
# Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software
|
||||||
# Inc.
|
# Foundation, Inc.
|
||||||
|
|
||||||
m4_pushdef([b4_copyright_years],
|
m4_pushdef([b4_copyright_years],
|
||||||
[1984, 1989-1990, 2000-2013])
|
[1984, 1989-1990, 2000-2015, 2018])
|
||||||
|
|
||||||
# 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
|
||||||
@@ -118,7 +118,7 @@ m4_define([b4_int_type],
|
|||||||
b4_ints_in($@, [0], [65535]), [1], [yytype_uint16],
|
b4_ints_in($@, [0], [65535]), [1], [yytype_uint16],
|
||||||
b4_ints_in($@, [-32768], [32767]), [1], [yytype_int16],
|
b4_ints_in($@, [-32768], [32767]), [1], [yytype_int16],
|
||||||
|
|
||||||
m4_eval([0 <= $1]), [1], [unsigned int],
|
m4_eval([0 <= $1]), [1], [unsigned],
|
||||||
|
|
||||||
[int])])
|
[int])])
|
||||||
|
|
||||||
@@ -143,7 +143,6 @@ m4_define([b4_rhs_value],
|
|||||||
[b4_symbol_value([yyvsp@{b4_subtract([$2], [$1])@}], [$3])])
|
[b4_symbol_value([yyvsp@{b4_subtract([$2], [$1])@}], [$3])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
## Locations. ##
|
## Locations. ##
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
@@ -176,36 +175,19 @@ m4_define([b4_declare_scanner_communication_variables], [[
|
|||||||
int yychar;
|
int yychar;
|
||||||
|
|
||||||
]b4_pure_if([[
|
]b4_pure_if([[
|
||||||
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
|
/* The semantic value of the lookahead symbol. */
|
||||||
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
|
||||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
|
||||||
_Pragma ("GCC diagnostic push") \
|
|
||||||
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
|
|
||||||
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
|
||||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
|
||||||
_Pragma ("GCC diagnostic pop")
|
|
||||||
#else
|
|
||||||
/* Default value used for initialization, for pacifying older GCCs
|
/* Default value used for initialization, for pacifying older GCCs
|
||||||
or non-GCC compilers. */
|
or non-GCC compilers. */
|
||||||
static YYSTYPE yyval_default;
|
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
|
||||||
# define YY_INITIAL_VALUE(Value) = Value
|
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);]b4_locations_if([[
|
||||||
#endif]b4_locations_if([[
|
|
||||||
static YYLTYPE yyloc_default][]b4_yyloc_default[;]])])[
|
|
||||||
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
|
||||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
|
||||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
|
|
||||||
#endif
|
|
||||||
#ifndef YY_INITIAL_VALUE
|
|
||||||
# define YY_INITIAL_VALUE(Value) /* Nothing. */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The semantic value of the lookahead symbol. */
|
|
||||||
YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);]b4_locations_if([[
|
|
||||||
|
|
||||||
/* Location data for the lookahead symbol. */
|
/* Location data for the lookahead symbol. */
|
||||||
YYLTYPE yylloc]b4_pure_if([ = yyloc_default], [b4_yyloc_default])[;
|
static YYLTYPE yyloc_default]b4_yyloc_default[;
|
||||||
]])b4_pure_if([], [[
|
YYLTYPE yylloc = yyloc_default;]])],
|
||||||
|
[[/* The semantic value of the lookahead symbol. */
|
||||||
|
YYSTYPE yylval;]b4_locations_if([[
|
||||||
|
/* Location data for the lookahead symbol. */
|
||||||
|
YYLTYPE yylloc]b4_yyloc_default[;]])[
|
||||||
/* Number of syntax errors so far. */
|
/* Number of syntax errors so far. */
|
||||||
int yynerrs;]])])
|
int yynerrs;]])])
|
||||||
|
|
||||||
@@ -223,9 +205,9 @@ m4_define([b4_declare_parser_state_variables], [b4_pure_if([[
|
|||||||
int yyerrstatus;
|
int yyerrstatus;
|
||||||
|
|
||||||
/* The stacks and their tools:
|
/* The stacks and their tools:
|
||||||
`yyss': related to states.
|
'yyss': related to states.
|
||||||
`yyvs': related to semantic values.]b4_locations_if([[
|
'yyvs': related to semantic values.]b4_locations_if([[
|
||||||
`yyls': related to locations.]])[
|
'yyls': related to locations.]])[
|
||||||
|
|
||||||
Refer to the stacks through separate pointers, to allow yyoverflow
|
Refer to the stacks through separate pointers, to allow yyoverflow
|
||||||
to reallocate them elsewhere. */
|
to reallocate them elsewhere. */
|
||||||
@@ -255,11 +237,11 @@ m4_define([b4_declare_parser_state_variables], [b4_pure_if([[
|
|||||||
YYSIZE_T yyes_capacity;]])])
|
YYSIZE_T yyes_capacity;]])])
|
||||||
|
|
||||||
|
|
||||||
# b4_declare_yyparse_push_
|
# _b4_declare_yyparse_push
|
||||||
# ------------------------
|
# ------------------------
|
||||||
# Declaration of yyparse (and dependencies) when using the push parser
|
# Declaration of yyparse (and dependencies) when using the push parser
|
||||||
# (including in pull mode).
|
# (including in pull mode).
|
||||||
m4_define([b4_declare_yyparse_push_],
|
m4_define([_b4_declare_yyparse_push],
|
||||||
[[#ifndef YYPUSH_MORE_DEFINED
|
[[#ifndef YYPUSH_MORE_DEFINED
|
||||||
# define YYPUSH_MORE_DEFINED
|
# define YYPUSH_MORE_DEFINED
|
||||||
enum { YYPUSH_MORE = 4 };
|
enum { YYPUSH_MORE = 4 };
|
||||||
@@ -283,18 +265,18 @@ b4_function_declare([b4_prefix[pstate_delete]], [[void]],
|
|||||||
[[b4_prefix[pstate *ps]], [[ps]]])dnl
|
[[b4_prefix[pstate *ps]], [[ps]]])dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
# b4_declare_yyparse_
|
# _b4_declare_yyparse
|
||||||
# -------------------
|
# -------------------
|
||||||
# When not the push parser.
|
# When not the push parser.
|
||||||
m4_define([b4_declare_yyparse_],
|
m4_define([_b4_declare_yyparse],
|
||||||
[b4_function_declare(b4_prefix[parse], [int], b4_parse_param)])
|
[b4_function_declare(b4_prefix[parse], [int], b4_parse_param)])
|
||||||
|
|
||||||
|
|
||||||
# b4_declare_yyparse
|
# b4_declare_yyparse
|
||||||
# ------------------
|
# ------------------
|
||||||
m4_define([b4_declare_yyparse],
|
m4_define([b4_declare_yyparse],
|
||||||
[b4_push_if([b4_declare_yyparse_push_],
|
[b4_push_if([_b4_declare_yyparse_push],
|
||||||
[b4_declare_yyparse_])[]dnl
|
[_b4_declare_yyparse])[]dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -317,9 +299,8 @@ m4_define([b4_shared_declarations],
|
|||||||
## Output files. ##
|
## Output files. ##
|
||||||
## -------------- ##
|
## -------------- ##
|
||||||
|
|
||||||
b4_output_begin([b4_parser_file_name])
|
b4_output_begin([b4_parser_file_name])[
|
||||||
b4_copyright([Bison implementation for Yacc-like parsers in C])[
|
]b4_copyright([Bison implementation for Yacc-like parsers in C])[
|
||||||
|
|
||||||
/* C LALR(1) parser skeleton written by Richard Stallman, by
|
/* C LALR(1) parser skeleton written by Richard Stallman, by
|
||||||
simplifying the original so-called "semantic" parser. */
|
simplifying the original so-called "semantic" parser. */
|
||||||
|
|
||||||
@@ -330,8 +311,9 @@ b4_copyright([Bison implementation for Yacc-like parsers in C])[
|
|||||||
define necessary library symbols; they are noted "INFRINGES ON
|
define necessary library symbols; they are noted "INFRINGES ON
|
||||||
USER NAME SPACE" below. */
|
USER NAME SPACE" below. */
|
||||||
|
|
||||||
]b4_identification
|
]b4_disclaimer[
|
||||||
b4_percent_code_get([[top]])[]dnl
|
]b4_identification[
|
||||||
|
]b4_percent_code_get([[top]])[]dnl
|
||||||
m4_if(b4_api_prefix, [yy], [],
|
m4_if(b4_api_prefix, [yy], [],
|
||||||
[[/* Substitute the type names. */
|
[[/* Substitute the type names. */
|
||||||
#define YYSTYPE ]b4_api_PREFIX[STYPE]b4_locations_if([[
|
#define YYSTYPE ]b4_api_PREFIX[STYPE]b4_locations_if([[
|
||||||
@@ -353,9 +335,7 @@ m4_if(b4_api_prefix, [yy], [],
|
|||||||
#define yychar ]b4_prefix[char]b4_locations_if([[
|
#define yychar ]b4_prefix[char]b4_locations_if([[
|
||||||
#define yylloc ]b4_prefix[lloc]])]))[
|
#define yylloc ]b4_prefix[lloc]])]))[
|
||||||
|
|
||||||
/* Copy the first part of user declarations. */
|
|
||||||
]b4_user_pre_prologue[
|
]b4_user_pre_prologue[
|
||||||
|
|
||||||
]b4_null_define[
|
]b4_null_define[
|
||||||
|
|
||||||
/* Enabling verbose error messages. */
|
/* Enabling verbose error messages. */
|
||||||
@@ -372,9 +352,8 @@ m4_if(b4_api_prefix, [yy], [],
|
|||||||
]])dnl
|
]])dnl
|
||||||
b4_shared_declarations[
|
b4_shared_declarations[
|
||||||
|
|
||||||
/* Copy the second part of user declarations. */
|
]b4_user_post_prologue[
|
||||||
]b4_user_post_prologue
|
]b4_percent_code_get[]dnl
|
||||||
b4_percent_code_get[]dnl
|
|
||||||
|
|
||||||
[#ifdef short
|
[#ifdef short
|
||||||
# undef short
|
# undef short
|
||||||
@@ -395,13 +374,13 @@ typedef signed char yytype_int8;
|
|||||||
#ifdef YYTYPE_UINT16
|
#ifdef YYTYPE_UINT16
|
||||||
typedef YYTYPE_UINT16 yytype_uint16;
|
typedef YYTYPE_UINT16 yytype_uint16;
|
||||||
#else
|
#else
|
||||||
typedef unsigned short int yytype_uint16;
|
typedef unsigned short yytype_uint16;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef YYTYPE_INT16
|
#ifdef YYTYPE_INT16
|
||||||
typedef YYTYPE_INT16 yytype_int16;
|
typedef YYTYPE_INT16 yytype_int16;
|
||||||
#else
|
#else
|
||||||
typedef short int yytype_int16;
|
typedef short yytype_int16;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef YYSIZE_T
|
#ifndef YYSIZE_T
|
||||||
@@ -413,7 +392,7 @@ typedef short int yytype_int16;
|
|||||||
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
|
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
|
||||||
# define YYSIZE_T size_t
|
# define YYSIZE_T size_t
|
||||||
# else
|
# else
|
||||||
# define YYSIZE_T unsigned int
|
# define YYSIZE_T unsigned
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -431,12 +410,7 @@ typedef short int yytype_int16;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Suppress unused-variable warnings by "using" E. */
|
]b4_attribute_define[
|
||||||
#ifdef __GNUC__
|
|
||||||
# define YYUSE(E) ((void) (E))
|
|
||||||
#else
|
|
||||||
# define YYUSE(E) /* empty */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[
|
#if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[
|
||||||
|
|
||||||
@@ -468,7 +442,7 @@ b4_push_if([], [b4_lac_if([], [[
|
|||||||
# endif]])])[
|
# endif]])])[
|
||||||
|
|
||||||
# ifdef YYSTACK_ALLOC
|
# ifdef YYSTACK_ALLOC
|
||||||
/* Pacify GCC's `empty if-body' warning. */
|
/* Pacify GCC's 'empty if-body' warning. */
|
||||||
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
|
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
|
||||||
# ifndef YYSTACK_ALLOC_MAXIMUM
|
# ifndef YYSTACK_ALLOC_MAXIMUM
|
||||||
/* The OS might guarantee only one guard page at the bottom of the stack,
|
/* The OS might guarantee only one guard page at the bottom of the stack,
|
||||||
@@ -594,7 +568,7 @@ union yyalloc
|
|||||||
#define YYMAXUTOK ]b4_user_token_number_max[
|
#define YYMAXUTOK ]b4_user_token_number_max[
|
||||||
|
|
||||||
#define YYTRANSLATE(YYX) \
|
#define YYTRANSLATE(YYX) \
|
||||||
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||||||
|
|
||||||
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
|
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
|
||||||
as returned by yylex, without out-of-bounds checking. */
|
as returned by yylex, without out-of-bounds checking. */
|
||||||
@@ -742,7 +716,7 @@ do { \
|
|||||||
])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,
|
])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,
|
||||||
b4_parse_param]))[
|
b4_parse_param]))[
|
||||||
{
|
{
|
||||||
unsigned long int yylno = yyrline[yyrule];
|
unsigned long yylno = yyrline[yyrule];
|
||||||
int yynrhs = yyr2[yyrule];
|
int yynrhs = yyr2[yyrule];
|
||||||
int yyi;
|
int yyi;
|
||||||
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
|
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
|
||||||
@@ -814,7 +788,7 @@ yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd,
|
|||||||
yytype_int16 **yytop, yytype_int16 *yytop_empty)
|
yytype_int16 **yytop, yytype_int16 *yytop_empty)
|
||||||
{
|
{
|
||||||
YYSIZE_T yysize_old =
|
YYSIZE_T yysize_old =
|
||||||
*yytop == yytop_empty ? 0 : *yytop - *yybottom + 1;
|
(YYSIZE_T) (*yytop == yytop_empty ? 0 : *yytop - *yybottom + 1);
|
||||||
YYSIZE_T yysize_new = yysize_old + yyadd;
|
YYSIZE_T yysize_new = yysize_old + yyadd;
|
||||||
if (*yycapacity < yysize_new)
|
if (*yycapacity < yysize_new)
|
||||||
{
|
{
|
||||||
@@ -850,7 +824,7 @@ yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd,
|
|||||||
*yycapacity = yyalloc;]m4_if(b4_percent_define_get([[parse.lac.memory-trace]]),
|
*yycapacity = yyalloc;]m4_if(b4_percent_define_get([[parse.lac.memory-trace]]),
|
||||||
[full], [[
|
[full], [[
|
||||||
YYDPRINTF ((stderr, "%srealloc to %lu%s", yydebug_prefix,
|
YYDPRINTF ((stderr, "%srealloc to %lu%s", yydebug_prefix,
|
||||||
(unsigned long int) yyalloc, yydebug_suffix));]])[
|
(unsigned long) yyalloc, yydebug_suffix));]])[
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -980,7 +954,7 @@ yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes,
|
|||||||
YYDPRINTF ((stderr, " R%d", yyrule - 1));
|
YYDPRINTF ((stderr, " R%d", yyrule - 1));
|
||||||
if (yyesp != yyes_prev)
|
if (yyesp != yyes_prev)
|
||||||
{
|
{
|
||||||
YYSIZE_T yysize = yyesp - *yyes + 1;
|
YYSIZE_T yysize = (YYSIZE_T) (yyesp - *yyes + 1);
|
||||||
if (yylen < yysize)
|
if (yylen < yysize)
|
||||||
{
|
{
|
||||||
yyesp -= yylen;
|
yyesp -= yylen;
|
||||||
@@ -996,15 +970,14 @@ yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes,
|
|||||||
yyesp = yyes_prev -= yylen;
|
yyesp = yyes_prev -= yylen;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
int yystate;
|
yytype_int16 yystate;
|
||||||
{
|
{
|
||||||
int yylhs = yyr1[yyrule] - YYNTOKENS;
|
const int yylhs = yyr1[yyrule] - YYNTOKENS;
|
||||||
yystate = yypgoto[yylhs] + *yyesp;
|
const int yyi = yypgoto[yylhs] + *yyesp;
|
||||||
if (yystate < 0 || YYLAST < yystate
|
yystate = ((yytype_int16)
|
||||||
|| yycheck[yystate] != *yyesp)
|
(0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyesp
|
||||||
yystate = yydefgoto[yylhs];
|
? yytable[yyi]
|
||||||
else
|
: yydefgoto[yylhs]));
|
||||||
yystate = yytable[yystate];
|
|
||||||
}
|
}
|
||||||
if (yyesp == yyes_prev)
|
if (yyesp == yyes_prev)
|
||||||
{
|
{
|
||||||
@@ -1024,7 +997,7 @@ yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes,
|
|||||||
}
|
}
|
||||||
*++yyesp = yystate;
|
*++yyesp = yystate;
|
||||||
}
|
}
|
||||||
YYDPRINTF ((stderr, " G%d", yystate));
|
YYDPRINTF ((stderr, " G%d", (int) yystate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}]])[
|
}]])[
|
||||||
@@ -1112,7 +1085,7 @@ yytnamerr (char *yyres, const char *yystr)
|
|||||||
if (! yyres)
|
if (! yyres)
|
||||||
return yystrlen (yystr);
|
return yystrlen (yystr);
|
||||||
|
|
||||||
return yystpcpy (yyres, yystr) - yyres;
|
return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -1131,11 +1104,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
|||||||
]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes,
|
]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes,
|
||||||
YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken)
|
YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken)
|
||||||
{
|
{
|
||||||
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
|
YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
|
||||||
YYSIZE_T yysize = yysize0;
|
YYSIZE_T yysize = yysize0;
|
||||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||||
/* Internationalized format string. */
|
/* Internationalized format string. */
|
||||||
const char *yyformat = YY_NULL;
|
const char *yyformat = YY_NULLPTR;
|
||||||
/* Arguments of yyformat. */
|
/* Arguments of yyformat. */
|
||||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||||
/* Number of reported tokens (one for the "unexpected", one per
|
/* Number of reported tokens (one for the "unexpected", one per
|
||||||
@@ -1210,7 +1183,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
|||||||
}
|
}
|
||||||
yyarg[yycount++] = yytname[yyx];
|
yyarg[yycount++] = yytname[yyx];
|
||||||
{
|
{
|
||||||
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
|
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
|
||||||
if (! (yysize <= yysize1
|
if (! (yysize <= yysize1
|
||||||
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||||
return 2;
|
return 2;
|
||||||
@@ -1230,6 +1203,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
|||||||
case N: \
|
case N: \
|
||||||
yyformat = S; \
|
yyformat = S; \
|
||||||
break
|
break
|
||||||
|
default: /* Avoid compiler warnings. */
|
||||||
YYCASE_(0, YY_("syntax error"));
|
YYCASE_(0, YY_("syntax error"));
|
||||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||||
@@ -1294,7 +1268,7 @@ static char yypstate_allocated = 0;]])b4_pull_if([
|
|||||||
|
|
||||||
b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
||||||
{
|
{
|
||||||
return yypull_parse (YY_NULL]m4_ifset([b4_parse_param],
|
return yypull_parse (YY_NULLPTR]m4_ifset([b4_parse_param],
|
||||||
[[, ]b4_args(b4_parse_param)])[);
|
[[, ]b4_args(b4_parse_param)])[);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1336,10 +1310,10 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
|||||||
{
|
{
|
||||||
yypstate *yyps;]b4_pure_if([], [[
|
yypstate *yyps;]b4_pure_if([], [[
|
||||||
if (yypstate_allocated)
|
if (yypstate_allocated)
|
||||||
return YY_NULL;]])[
|
return YY_NULLPTR;]])[
|
||||||
yyps = (yypstate *) malloc (sizeof *yyps);
|
yyps = (yypstate *) malloc (sizeof *yyps);
|
||||||
if (!yyps)
|
if (!yyps)
|
||||||
return YY_NULL;
|
return YY_NULLPTR;
|
||||||
yyps->yynew = 1;]b4_pure_if([], [[
|
yyps->yynew = 1;]b4_pure_if([], [[
|
||||||
yypstate_allocated = 1;]])[
|
yypstate_allocated = 1;]])[
|
||||||
return yyps;
|
return yyps;
|
||||||
@@ -1348,16 +1322,19 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
|||||||
]b4_function_define([[yypstate_delete]], [[void]],
|
]b4_function_define([[yypstate_delete]], [[void]],
|
||||||
[[[yypstate *yyps]], [[yyps]]])[
|
[[[yypstate *yyps]], [[yyps]]])[
|
||||||
{
|
{
|
||||||
|
if (yyps)
|
||||||
|
{
|
||||||
#ifndef yyoverflow
|
#ifndef yyoverflow
|
||||||
/* If the stack was reallocated but the parse did not complete, then the
|
/* If the stack was reallocated but the parse did not complete, then the
|
||||||
stack still needs to be freed. */
|
stack still needs to be freed. */
|
||||||
if (!yyps->yynew && yyps->yyss != yyps->yyssa)
|
if (!yyps->yynew && yyps->yyss != yyps->yyssa)
|
||||||
YYSTACK_FREE (yyps->yyss);
|
YYSTACK_FREE (yyps->yyss);
|
||||||
#endif]b4_lac_if([[
|
#endif]b4_lac_if([[
|
||||||
if (!yyps->yynew && yyps->yyes != yyps->yyesa)
|
if (!yyps->yynew && yyps->yyes != yyps->yyesa)
|
||||||
YYSTACK_FREE (yyps->yyes);]])[
|
YYSTACK_FREE (yyps->yyes);]])[
|
||||||
free (yyps);]b4_pure_if([], [[
|
free (yyps);]b4_pure_if([], [[
|
||||||
yypstate_allocated = 0;]])[
|
yypstate_allocated = 0;]])[
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]b4_pure_if([[
|
]b4_pure_if([[
|
||||||
#define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs]])[
|
#define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs]])[
|
||||||
@@ -1452,7 +1429,6 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
|||||||
]m4_ifdef([b4_initial_action], [
|
]m4_ifdef([b4_initial_action], [
|
||||||
b4_dollar_pushdef([m4_define([b4_dollar_dollar_used])yylval], [],
|
b4_dollar_pushdef([m4_define([b4_dollar_dollar_used])yylval], [],
|
||||||
[b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])])dnl
|
[b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])])dnl
|
||||||
/* User initialization code. */
|
|
||||||
b4_user_initial_action
|
b4_user_initial_action
|
||||||
b4_dollar_popdef[]dnl
|
b4_dollar_popdef[]dnl
|
||||||
m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
|
m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
|
||||||
@@ -1470,12 +1446,12 @@ b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yyllo
|
|||||||
yyssp++;
|
yyssp++;
|
||||||
|
|
||||||
yysetstate:
|
yysetstate:
|
||||||
*yyssp = yystate;
|
*yyssp = (yytype_int16) yystate;
|
||||||
|
|
||||||
if (yyss + yystacksize - 1 <= yyssp)
|
if (yyss + yystacksize - 1 <= yyssp)
|
||||||
{
|
{
|
||||||
/* Get the current used size of the three stacks, in elements. */
|
/* Get the current used size of the three stacks, in elements. */
|
||||||
YYSIZE_T yysize = yyssp - yyss + 1;
|
YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
|
||||||
|
|
||||||
#ifdef yyoverflow
|
#ifdef yyoverflow
|
||||||
{
|
{
|
||||||
@@ -1495,10 +1471,9 @@ b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yyllo
|
|||||||
&yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([
|
&yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([
|
||||||
&yyls1, yysize * sizeof (*yylsp),])[
|
&yyls1, yysize * sizeof (*yylsp),])[
|
||||||
&yystacksize);
|
&yystacksize);
|
||||||
]b4_locations_if([
|
|
||||||
yyls = yyls1;])[
|
|
||||||
yyss = yyss1;
|
yyss = yyss1;
|
||||||
yyvs = yyvs1;
|
yyvs = yyvs1;]b4_locations_if([
|
||||||
|
yyls = yyls1;])[
|
||||||
}
|
}
|
||||||
#else /* no yyoverflow */
|
#else /* no yyoverflow */
|
||||||
# ifndef YYSTACK_RELOCATE
|
# ifndef YYSTACK_RELOCATE
|
||||||
@@ -1532,7 +1507,7 @@ b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yyllo
|
|||||||
yylsp = yyls + yysize - 1;])[
|
yylsp = yyls + yysize - 1;])[
|
||||||
|
|
||||||
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
||||||
(unsigned long int) yystacksize));
|
(unsigned long) yystacksize));
|
||||||
|
|
||||||
if (yyss + yystacksize - 1 <= yyssp)
|
if (yyss + yystacksize - 1 <= yyssp)
|
||||||
YYABORT;
|
YYABORT;
|
||||||
@@ -1654,7 +1629,7 @@ yyreduce:
|
|||||||
yylen = yyr2[yyn];
|
yylen = yyr2[yyn];
|
||||||
|
|
||||||
/* If YYLEN is nonzero, implement the default value of the action:
|
/* If YYLEN is nonzero, implement the default value of the action:
|
||||||
`$$ = $1'.
|
'$$ = $1'.
|
||||||
|
|
||||||
Otherwise, the following line sets YYVAL to garbage.
|
Otherwise, the following line sets YYVAL to garbage.
|
||||||
This behavior is undocumented and Bison
|
This behavior is undocumented and Bison
|
||||||
@@ -1664,14 +1639,15 @@ yyreduce:
|
|||||||
yyval = yyvsp[1-yylen];
|
yyval = yyvsp[1-yylen];
|
||||||
|
|
||||||
]b4_locations_if(
|
]b4_locations_if(
|
||||||
[[ /* Default location. */
|
[[ /* Default location. */
|
||||||
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);]])[
|
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
|
||||||
|
yyerror_range[1] = yyloc;]])[
|
||||||
YY_REDUCE_PRINT (yyn);]b4_lac_if([[
|
YY_REDUCE_PRINT (yyn);]b4_lac_if([[
|
||||||
{
|
{
|
||||||
int yychar_backup = yychar;
|
int yychar_backup = yychar;
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
]b4_user_actions[
|
]b4_user_actions[
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
if (yychar_backup != yychar)
|
if (yychar_backup != yychar)
|
||||||
@@ -1702,17 +1678,16 @@ yyreduce:
|
|||||||
*++yyvsp = yyval;]b4_locations_if([
|
*++yyvsp = yyval;]b4_locations_if([
|
||||||
*++yylsp = yyloc;])[
|
*++yylsp = yyloc;])[
|
||||||
|
|
||||||
/* Now `shift' the result of the reduction. Determine what state
|
/* Now 'shift' the result of the reduction. Determine what state
|
||||||
that goes to, based on the state we popped back to and the rule
|
that goes to, based on the state we popped back to and the rule
|
||||||
number reduced by. */
|
number reduced by. */
|
||||||
|
{
|
||||||
yyn = yyr1[yyn];
|
const int yylhs = yyr1[yyn] - YYNTOKENS;
|
||||||
|
const int yyi = yypgoto[yylhs] + *yyssp;
|
||||||
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
|
yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
|
||||||
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
|
? yytable[yyi]
|
||||||
yystate = yytable[yystate];
|
: yydefgoto[yylhs]);
|
||||||
else
|
}
|
||||||
yystate = yydefgoto[yyn - YYNTOKENS];
|
|
||||||
|
|
||||||
goto yynewstate;
|
goto yynewstate;
|
||||||
|
|
||||||
@@ -1805,8 +1780,7 @@ yyerrorlab:
|
|||||||
if (/*CONSTCOND*/ 0)
|
if (/*CONSTCOND*/ 0)
|
||||||
goto yyerrorlab;
|
goto yyerrorlab;
|
||||||
|
|
||||||
]b4_locations_if([[ yyerror_range[1] = yylsp[1-yylen];
|
/* Do not reclaim the symbols of the rule whose action triggered
|
||||||
]])[ /* Do not reclaim the symbols of the rule whose action triggered
|
|
||||||
this YYERROR. */
|
this YYERROR. */
|
||||||
YYPOPSTACK (yylen);
|
YYPOPSTACK (yylen);
|
||||||
yylen = 0;
|
yylen = 0;
|
||||||
@@ -1927,12 +1901,12 @@ yypushreturn:]])[
|
|||||||
return yyresult;
|
return yyresult;
|
||||||
}
|
}
|
||||||
]b4_epilogue[]dnl
|
]b4_epilogue[]dnl
|
||||||
b4_output_end()
|
b4_output_end
|
||||||
|
|
||||||
b4_defines_if(
|
b4_defines_if([[
|
||||||
[b4_output_begin([b4_spec_defines_file])[
|
]b4_output_begin([b4_spec_defines_file])[
|
||||||
]b4_copyright([Bison interface for Yacc-like parsers in C])[
|
]b4_copyright([Bison interface for Yacc-like parsers in C])[
|
||||||
|
]b4_disclaimer[
|
||||||
]b4_shared_declarations[
|
]b4_shared_declarations[
|
||||||
]b4_output_end()
|
]b4_output_end[
|
||||||
])# b4_defines_if
|
]])# b4_defines_if
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||||
# Requires GNU sed
|
# Requires GNU sed
|
||||||
|
|
||||||
## Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2005-2015, 2018 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
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||||
|
|
||||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
Copyright (C) 2005-2015, 2018 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
|
||||||
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
=======================
|
=======================
|
||||||
|
|
||||||
The DJGPP port of Bison offers LFN and SFN support depending on which
|
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
|
OS it is running. If LFN support is available or not is determined at
|
||||||
run time. If LFN support is available (DOS session under Win9X, Win2K,
|
run time. If LFN support is available (DOS session under Win9X, Win2K,
|
||||||
WinXP, etc.) the standard posix file name extensions will be used.
|
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
|
These are: y.tab.c, y.tab.c++, y.tab.h, y.output, etc. If only SFN
|
||||||
|
|||||||
+6
-6
@@ -4,7 +4,7 @@ Rem Configure Bison for DJGPP.
|
|||||||
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||||
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||||
|
|
||||||
Rem Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Rem This program is free software: you can redistribute it and/or modify
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
Rem it under the terms of the GNU General Public License as published by
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
@@ -80,10 +80,10 @@ goto NextArgument
|
|||||||
if "%1" == "no-dep" goto NextArgument
|
if "%1" == "no-dep" goto NextArgument
|
||||||
if "%1" == "no-DEP" goto NextArgument
|
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 DependecyTracking
|
||||||
if "%1" == "DEP" goto DependecyTraking
|
if "%1" == "DEP" goto DependecyTracking
|
||||||
goto LibiconvPrefixOption
|
goto LibiconvPrefixOption
|
||||||
:DependecyTraking
|
:DependecyTracking
|
||||||
if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
|
if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
|
||||||
if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
|
if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
|
||||||
if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
|
if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
|
||||||
@@ -290,7 +290,7 @@ if errorlevel 1 goto SedError2
|
|||||||
mv -f config.hin %XSRC%/lib/config.hin
|
mv -f config.hin %XSRC%/lib/config.hin
|
||||||
|
|
||||||
|
|
||||||
Rem Fixing ilicit testsuite file name.
|
Rem Fixing illicit testsuite file name.
|
||||||
test -f %XSRC%/tests/c++.at
|
test -f %XSRC%/tests/c++.at
|
||||||
if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at
|
if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ sed -f %XSRC%/djgpp/testsuite.sed %XSRC%/tests/testsuite.org > testsuite.tmp
|
|||||||
if errorlevel 1 goto SedError3
|
if errorlevel 1 goto SedError3
|
||||||
mv -f ./testsuite.tmp %XSRC%/tests/testsuite
|
mv -f ./testsuite.tmp %XSRC%/tests/testsuite
|
||||||
|
|
||||||
Rem Fixing ilicit calc++ file names in the calc++ directory.
|
Rem Fixing illicit calc++ file names in the calc++ directory.
|
||||||
test -d %XSRC%/examples/calc++
|
test -d %XSRC%/examples/calc++
|
||||||
if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx
|
if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx
|
||||||
test -d %XSRC%/examples/calcxx
|
test -d %XSRC%/examples/calcxx
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
# Sed script for additional DJGPP specific editing
|
# Sed script for additional DJGPP specific editing
|
||||||
# of the configure script generated by autoconf 2.62.
|
# of the configure script generated by autoconf 2.62.
|
||||||
|
|
||||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2015, 2018 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
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
# This is the config.site file for configuring GNU packages
|
# This is the config.site file for configuring GNU packages
|
||||||
# which are to be built with DJGPP tools.
|
# which are to be built with DJGPP tools.
|
||||||
|
|
||||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2015, 2018 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
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# sed script for DJGPP specific editing of config.hin
|
# sed script for DJGPP specific editing of config.hin
|
||||||
|
|
||||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2015, 2018 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
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ Rem This batch file unpacks the Bison distribution while simultaneously
|
|||||||
Rem renaming some of the files whose names are invalid on DOS or conflict
|
Rem renaming some of the files whose names are invalid on DOS or conflict
|
||||||
Rem with other file names after truncation to DOS 8+3 namespace.
|
Rem with other file names after truncation to DOS 8+3 namespace.
|
||||||
Rem
|
Rem
|
||||||
Rem Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
||||||
Rem
|
Rem
|
||||||
Rem This program is free software: you can redistribute it and/or modify
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
Rem it under the terms of the GNU General Public License as published by
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
## Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2008-2015, 2018 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
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
Copyright (C) 2005-2015, 2018 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
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
Copyright (C) 2005-2015, 2018 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
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
# Sed script for additional DJGPP specific editing
|
# Sed script for additional DJGPP specific editing
|
||||||
# of the testsuite script generated by autoconf 2.61.
|
# of the testsuite script generated by autoconf 2.61.
|
||||||
|
|
||||||
# Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2007-2015, 2018 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
-9
@@ -1,25 +1,28 @@
|
|||||||
|
# Do not ignore these. The release procedure (web-manual-update)
|
||||||
|
# works in the src tree (even when run from the build tree) and leaves
|
||||||
|
# these files around. Since they take precedence over the files in
|
||||||
|
# the build tree, locally built manuals use obsolete auxiliary files.
|
||||||
|
#
|
||||||
|
# So don't hide them, give the maintainer a chance to clean them.
|
||||||
|
#/bison.aux
|
||||||
|
#/bison.cp
|
||||||
|
#/bison.cps
|
||||||
|
#/bison.toc
|
||||||
|
|
||||||
/*~
|
/*~
|
||||||
/.dirstamp
|
/.dirstamp
|
||||||
/bison.1
|
/bison.1
|
||||||
/bison.aux
|
|
||||||
/bison.cp
|
|
||||||
/bison.cps
|
|
||||||
/bison.dvi
|
/bison.dvi
|
||||||
/bison.fn
|
|
||||||
/bison.help
|
/bison.help
|
||||||
/bison.html
|
/bison.html
|
||||||
/bison.info
|
/bison.info
|
||||||
/bison.ky
|
|
||||||
/bison.log
|
/bison.log
|
||||||
/bison.pdf
|
/bison.pdf
|
||||||
/bison.pg
|
|
||||||
/bison.ps
|
/bison.ps
|
||||||
/bison.toc
|
|
||||||
/bison.tp
|
|
||||||
/bison.vr
|
|
||||||
/cross-options.texi
|
/cross-options.texi
|
||||||
/fdl.texi
|
/fdl.texi
|
||||||
/gendocs_template
|
/gendocs_template
|
||||||
|
/gendocs_template_min
|
||||||
/gpl-3.0.texi
|
/gpl-3.0.texi
|
||||||
/refcard.dvi
|
/refcard.dvi
|
||||||
/refcard.log
|
/refcard.log
|
||||||
|
|||||||
+1406
-961
File diff suppressed because it is too large
Load Diff
+1907
-960
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
|||||||
|
This file is a stub, not used by the documentation. If you feel like
|
||||||
|
contributing ASCII art for example.gv, please step forward!
|
||||||
+46
-35
@@ -1,4 +1,5 @@
|
|||||||
## Copyright (C) 2001-2003, 2005-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2001-2003, 2005-2015, 2018 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
|
||||||
@@ -23,27 +24,26 @@ doc_bison_TEXINFOS = \
|
|||||||
# Cannot express dependencies directly on file names because of Automake.
|
# Cannot express dependencies directly on file names because of Automake.
|
||||||
# Obfuscate with a variable.
|
# Obfuscate with a variable.
|
||||||
doc_bison = doc/bison
|
doc_bison = doc/bison
|
||||||
$(doc_bison).dvi: $(FIGS_DOT:.dot=.eps)
|
$(doc_bison).dvi: $(FIGS_GV:.gv=.eps)
|
||||||
$(doc_bison).pdf: $(FIGS_DOT:.dot=.pdf)
|
$(doc_bison).info: $(FIGS_GV:.gv=.txt)
|
||||||
$(doc_bison).html: $(FIGS_DOT:.dot=.png)
|
$(doc_bison).pdf: $(FIGS_GV:.gv=.pdf)
|
||||||
|
$(doc_bison).html: $(FIGS_GV:.gv=.png)
|
||||||
|
|
||||||
TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc
|
TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc
|
||||||
CLEANDIRS = doc/bison.t2d
|
CLEANDIRS += doc/bison.t2d
|
||||||
clean-local:
|
|
||||||
rm -rf $(CLEANDIRS)
|
|
||||||
|
|
||||||
MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t
|
MOSTLYCLEANFILES += $(top_srcdir)/doc/*.tmp
|
||||||
|
|
||||||
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
||||||
CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi
|
CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi
|
||||||
$(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL)
|
$(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL)
|
||||||
# Create $@~ which is the previous contents. Don't use `mv' here so
|
# Create $@~ which is the previous contents. Don't use 'mv' here so
|
||||||
# that even if we are interrupted, the file is still available for
|
# that even if we are interrupted, the file is still available for
|
||||||
# diff in the next run. Note that $@ might not exist yet.
|
# diff in the next run. Note that $@ might not exist yet.
|
||||||
$(AM_V_GEN){ test ! -f $@ || cat $@; } >$@~
|
$(AM_V_GEN){ test ! -f $@ || cat $@; } >$@~
|
||||||
$(AM_V_at)test ! -f $@.tmp || rm -f $@.tmp
|
$(AM_V_at)test ! -f $@.tmp || rm -f $@.tmp
|
||||||
$(AM_V_at)src/bison$(EXEEXT) --help | \
|
$(AM_V_at)$(PERL) $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l \
|
||||||
$(PERL) $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
<$(top_srcdir)/doc/bison.help >$@.tmp
|
||||||
$(AM_V_at)diff -u $@~ $@.tmp || true
|
$(AM_V_at)diff -u $@~ $@.tmp || true
|
||||||
$(AM_V_at)mv $@.tmp $@
|
$(AM_V_at)mv $@.tmp $@
|
||||||
MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI)
|
MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI)
|
||||||
@@ -64,9 +64,9 @@ doc/refcard.pdf: doc/refcard.tex
|
|||||||
## doc/bison.help. ##
|
## doc/bison.help. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# Some of our targets (cross-option.texi, bison.1) use "bison --help".
|
# Some of our targets (cross-options.texi, bison.1) use "bison --help".
|
||||||
# Since we want to ship the generated file to avoid additional
|
# Since we want to ship the generated file to avoid additional
|
||||||
# requirements over the user environment, we used not depend on
|
# requirements over the user environment, we used to not depend on
|
||||||
# src/bison itself, but on src/getargs.c and other files. Yet, we
|
# src/bison itself, but on src/getargs.c and other files. Yet, we
|
||||||
# need "bison --help" to work to make help2man happy, so we used to
|
# need "bison --help" to work to make help2man happy, so we used to
|
||||||
# include "make src/bison" in the commands. Then we may have a
|
# include "make src/bison" in the commands. Then we may have a
|
||||||
@@ -80,15 +80,20 @@ doc/refcard.pdf: doc/refcard.tex
|
|||||||
# bison.help, which contains --version then --help. This file can
|
# bison.help, which contains --version then --help. This file can
|
||||||
# depend on bison, which ensures its correctness. But update it
|
# depend on bison, which ensures its correctness. But update it
|
||||||
# *only* if needed (content changes). This way, we avoid useless
|
# *only* if needed (content changes). This way, we avoid useless
|
||||||
# compilations of cross-option.texi and bison.1. At the cost of
|
# compilations of cross-options.texi and bison.1. At the cost of
|
||||||
# repeated builds of bison.help.
|
# repeated builds of bison.help.
|
||||||
|
|
||||||
EXTRA_DIST += $(top_srcdir)/doc/bison.help
|
EXTRA_DIST += $(top_srcdir)/doc/bison.help
|
||||||
|
if ! CROSS_COMPILING
|
||||||
MAINTAINERCLEANFILES += $(top_srcdir)/doc/bison.help
|
MAINTAINERCLEANFILES += $(top_srcdir)/doc/bison.help
|
||||||
$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT)
|
$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT)
|
||||||
$(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp
|
$(AM_V_GEN)LC_ALL=C src/bison$(EXEEXT) --version >doc/bison.help.tmp
|
||||||
$(AM_V_at) src/bison$(EXEEXT) --help >>doc/bison.help.tmp
|
$(AM_V_at) LC_ALL=C src/bison$(EXEEXT) --help | \
|
||||||
|
## Avoid variations in the output depending on whether we are
|
||||||
|
## on a glibc system.
|
||||||
|
sed '/translation bugs/d' >>doc/bison.help.tmp
|
||||||
$(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@
|
$(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@
|
||||||
|
endif ! CROSS_COMPILING
|
||||||
|
|
||||||
|
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
@@ -105,44 +110,50 @@ remove_time_stamp = \
|
|||||||
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
||||||
|
|
||||||
# Depend on configure to get version number changes.
|
# Depend on configure to get version number changes.
|
||||||
$(top_srcdir)/doc/bison.1: doc/bison.help doc/bison.x $(top_srcdir)/configure
|
if ! CROSS_COMPILING
|
||||||
|
MAN_DEPS = doc/bison.help doc/bison.x $(top_srcdir)/configure
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(top_srcdir)/doc/bison.1: $(MAN_DEPS)
|
||||||
$(AM_V_GEN)$(HELP2MAN) \
|
$(AM_V_GEN)$(HELP2MAN) \
|
||||||
--include=$(top_srcdir)/doc/bison.x \
|
--include=$(top_srcdir)/doc/bison.x \
|
||||||
--output=$@.t src/bison$(EXEEXT)
|
--output=$@.tmp src/bison$(EXEEXT)
|
||||||
$(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
|
$(AM_V_at)if $(remove_time_stamp) $@ >$@a.tmp 2>/dev/null && \
|
||||||
$(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
|
$(remove_time_stamp) $@.tmp | cmp $@a.tmp - >/dev/null 2>&1; then \
|
||||||
touch $@; \
|
touch $@; \
|
||||||
else \
|
else \
|
||||||
mv $@.t $@; \
|
mv $@.tmp $@; \
|
||||||
fi
|
fi
|
||||||
$(AM_V_at)rm -f $@*.t
|
$(AM_V_at)rm -f $@*.tmp
|
||||||
|
|
||||||
|
if ENABLE_YACC
|
||||||
nodist_man_MANS = doc/yacc.1
|
nodist_man_MANS = doc/yacc.1
|
||||||
|
endif
|
||||||
|
|
||||||
## ----------------------------- ##
|
## ----------------------------- ##
|
||||||
## Graphviz examples generation. ##
|
## Graphviz examples generation. ##
|
||||||
## ----------------------------- ##
|
## ----------------------------- ##
|
||||||
|
|
||||||
CLEANDIRS += doc/figs
|
CLEANFILES += $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) $(FIGS_GV:.gv=.png)
|
||||||
FIGS_DOT = \
|
FIGS_GV = \
|
||||||
doc/figs/example.dot \
|
doc/figs/example.gv \
|
||||||
doc/figs/example-reduce.dot doc/figs/example-shift.dot
|
doc/figs/example-reduce.gv doc/figs/example-shift.gv
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
$(FIGS_DOT) \
|
$(FIGS_GV) $(FIGS_GV:.gv=.txt) \
|
||||||
$(FIGS_DOT:.dot=.eps) $(FIGS_DOT:.dot=.pdf) $(FIGS_DOT:.dot=.png)
|
$(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) $(FIGS_GV:.gv=.png)
|
||||||
SUFFIXES += .dot .eps .pdf .png
|
SUFFIXES += .gv .eps .pdf .png
|
||||||
|
|
||||||
.dot.eps:
|
.gv.eps:
|
||||||
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
||||||
$(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp
|
$(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp
|
||||||
$(AM_V_at) mv $@.tmp $@
|
$(AM_V_at) mv $@.tmp $@
|
||||||
|
|
||||||
.dot.pdf:
|
.gv.pdf:
|
||||||
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
||||||
$(AM_V_at) $(DOT) -Gmargin=0 -Tpdf $< >$@.tmp
|
$(AM_V_at) $(DOT) -Gmargin=0 -Tpdf $< >$@.tmp
|
||||||
$(AM_V_at) mv $@.tmp $@
|
$(AM_V_at) mv $@.tmp $@
|
||||||
|
|
||||||
.dot.png:
|
.gv.png:
|
||||||
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
||||||
$(AM_V_at) $(DOT) -Gmargin=0 -Tpng $< >$@.tmp
|
$(AM_V_at) $(DOT) -Gmargin=0 -Tpng $< >$@.tmp
|
||||||
$(AM_V_at) mv $@.tmp $@
|
$(AM_V_at) mv $@.tmp $@
|
||||||
|
|||||||
+2
-1
@@ -19,7 +19,8 @@
|
|||||||
\def\finalout{\overfullrule=0pt}
|
\def\finalout{\overfullrule=0pt}
|
||||||
%\finalout
|
%\finalout
|
||||||
|
|
||||||
% Copyright (c) 1998, 2001, 2009-2013 Free Software Foundation, Inc.
|
% Copyright (c) 1998, 2001, 2009-2015, 2018 Free Software Foundation,
|
||||||
|
% Inc.
|
||||||
%
|
%
|
||||||
% This file is part of Bison.
|
% This file is part of Bison.
|
||||||
%
|
%
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ straightforward use of _build/src/bison would.)
|
|||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
|
Copyright (C) 2006, 2009-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/perl -w
|
#! /usr/bin/perl -w
|
||||||
|
|
||||||
# Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2006, 2008-2015, 2018 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is part of Bison, the GNU Compiler Compiler.
|
# This file is part of Bison, the GNU Compiler Compiler.
|
||||||
#
|
#
|
||||||
@@ -53,7 +53,7 @@ will generate eight different cases.
|
|||||||
|
|
||||||
=item B<-b>, B<--bench>
|
=item B<-b>, B<--bench>
|
||||||
|
|
||||||
Predefined benches, that is, combimation between a grammar and a I<directives>
|
Predefined benches, that is, combination between a grammar and a I<directives>
|
||||||
request.
|
request.
|
||||||
|
|
||||||
=over 4
|
=over 4
|
||||||
@@ -204,9 +204,9 @@ Format the list of directives for Bison for bench named C<$bench>.
|
|||||||
sub directives($@)
|
sub directives($@)
|
||||||
{
|
{
|
||||||
my ($bench, @directive) = @_;
|
my ($bench, @directive) = @_;
|
||||||
my $res = "/* Directives for bench `$bench'. */\n";
|
my $res = "/* Directives for bench '$bench'. */\n";
|
||||||
$res .= join ("\n", @directive) . "\n";
|
$res .= join ("\n", @directive) . "\n";
|
||||||
$res .= "/* End of directives for bench `$bench'. */\n";
|
$res .= "/* End of directives for bench '$bench'. */\n";
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -738,7 +738,7 @@ yy::parser::token_type yylex(yy::parser::semantic_type* yylvalp,
|
|||||||
void
|
void
|
||||||
yy::parser::error(const yy::parser::location_type& loc, const std::string& msg)
|
yy::parser::error(const yy::parser::location_type& loc, const std::string& msg)
|
||||||
{
|
{
|
||||||
std::cerr << loc << ": " << msg << std::endl;
|
std::cerr << loc << ": " << msg << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
## Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2006, 2008-2015, 2018 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
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
This directory contains examples of Bison grammar files.
|
||||||
|
|
||||||
|
Most of them come from the documentation, which should be installed together
|
||||||
|
with Bison. The URLs are provided for convenience.
|
||||||
|
|
||||||
|
|
||||||
|
* Examples in C
|
||||||
|
|
||||||
|
** rpcalc - Reverse Polish Notation Calculator
|
||||||
|
The first example is that of a simple double-precision Reverse Polish
|
||||||
|
Notation calculator (a calculator using postfix operators). This example
|
||||||
|
provides a good starting point, since operator precedence is not an issue.
|
||||||
|
|
||||||
|
Extracted from the documentation: "Reverse Polish Notation Calculator"
|
||||||
|
https://www.gnu.org/software/bison/manual/html_node/RPN-Calc.html
|
||||||
|
|
||||||
|
** mfcalc - Multi-Function Calculator
|
||||||
|
A more complete C example: a multi-function calculator.
|
||||||
|
|
||||||
|
Extracted from the documentation: "Multi-Function Calculator: mfcalc".
|
||||||
|
https://www.gnu.org/software/bison/manual/html_node/Multi_002dfunction-Calc.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* Examples in C++
|
||||||
|
|
||||||
|
** c++ - A directory of simple C++ examples
|
||||||
|
|
||||||
|
** calc++ - A Complete C++ Example
|
||||||
|
A fully featured C++ version of the canonical example for parsers: a
|
||||||
|
calculator. Also uses Flex for the scanner.
|
||||||
|
|
||||||
|
Extracted from the documentation: "A Complete C++ Example".
|
||||||
|
https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html
|
||||||
|
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
fill-column: 76
|
||||||
|
ispell-dictionary: "american"
|
||||||
|
End:
|
||||||
|
|
||||||
|
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||||
|
any later version published by the Free Software Foundation; with no
|
||||||
|
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||||
|
Texts. A copy of the license is included in the "GNU Free
|
||||||
|
Documentation License" file as part of this distribution.
|
||||||
|
|
||||||
|
# LocalWords: mfcalc calc parsers yy
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# This Makefile is designed to be simple and readable. It does not
|
||||||
|
# aim at portability. It requires GNU Make.
|
||||||
|
|
||||||
|
BISON = bison
|
||||||
|
CXX = g++
|
||||||
|
CXXFLAGS =
|
||||||
|
PROGS = simple variant variant-11
|
||||||
|
|
||||||
|
simple: CXXFLAGS = -std=c++14
|
||||||
|
variant-11: CXXFLAGS = -std=c++11
|
||||||
|
|
||||||
|
all: $(PROGS)
|
||||||
|
|
||||||
|
%.cc %.hh: %.yy
|
||||||
|
$(BISON) $(BISONFLAGS) -o $*.cc $<
|
||||||
|
|
||||||
|
%: %.cc
|
||||||
|
$(CXX) $(CXXFLAGS) -o$@ $<
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(PROGS:=.cc) $(PROGS)
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
This directory contains examples of Bison grammar files in C++.
|
||||||
|
|
||||||
|
* Examples in C++
|
||||||
|
|
||||||
|
You can run `make` to compile these examples. And `make clean` to tidy
|
||||||
|
afterwards.
|
||||||
|
|
||||||
|
** simple.yy - Simple example in C++14
|
||||||
|
A very simple example in C++, based on variants and symbol constructors.
|
||||||
|
Variants allow to use any C++ type as semantic value type, and symbol
|
||||||
|
constructors ensure consistency between declared token type and effective
|
||||||
|
semantic value.
|
||||||
|
|
||||||
|
Run as `./simple`.
|
||||||
|
|
||||||
|
Extracted from the documentation: "A Simple C++ Example".
|
||||||
|
https://www.gnu.org/software/bison/manual/html_node/A-Simple-C_002b_002b-Example.html
|
||||||
|
|
||||||
|
** variant.yy - Self-contained example in C++98
|
||||||
|
A variation of simple.yy, in C++98.
|
||||||
|
|
||||||
|
Run as `./variant`.
|
||||||
|
|
||||||
|
** variant-11.yy - Self-contained example in modern C++
|
||||||
|
Another variation of simple.yy, closely related to the previous one, but
|
||||||
|
exhibiting support for C++11's move semantics.
|
||||||
|
|
||||||
|
Run as `./variant` or `./variant NUMBER`.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
fill-column: 76
|
||||||
|
ispell-dictionary: "american"
|
||||||
|
End:
|
||||||
|
|
||||||
|
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||||
|
any later version published by the Free Software Foundation; with no
|
||||||
|
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||||
|
Texts. A copy of the license is included in the "GNU Free
|
||||||
|
Documentation License" file as part of this distribution.
|
||||||
|
|
||||||
|
# LocalWords: mfcalc calc parsers yy ispell american
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
## Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
##
|
||||||
|
## This program is free software: you can redistribute it and/or modify
|
||||||
|
## it under the terms of the GNU General Public License as published by
|
||||||
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
|
## (at your option) any later version.
|
||||||
|
##
|
||||||
|
## This program is distributed in the hope that it will be useful,
|
||||||
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
## GNU General Public License for more details.
|
||||||
|
##
|
||||||
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
cxxdir = $(examplesdir)/c++
|
||||||
|
|
||||||
|
## -------- ##
|
||||||
|
## Simple. ##
|
||||||
|
## -------- ##
|
||||||
|
|
||||||
|
BUILT_SOURCES += $(simple_sources)
|
||||||
|
CLEANFILES += %D%/simple.[ch] %D%/simple.output
|
||||||
|
CLEANDIRS += %D%/*.dSYM
|
||||||
|
cxx_DATA = $(simple_extracted)
|
||||||
|
|
||||||
|
simple_extracted = %D%/simple.yy
|
||||||
|
simple_sources = $(simple_extracted)
|
||||||
|
extracted += $(simple_extracted)
|
||||||
|
|
||||||
|
if ENABLE_CXX14
|
||||||
|
check_PROGRAMS += %D%/simple
|
||||||
|
nodist_%C%_simple_SOURCES = $(simple_sources)
|
||||||
|
|
||||||
|
%C%_simple_CXXFLAGS = $(CXX11_CXXFLAGS)
|
||||||
|
# Don't use gnulib's system headers.
|
||||||
|
%C%_simple_CPPFLAGS = -I$(top_builddir)
|
||||||
|
TESTS += %D%/simple.test
|
||||||
|
%D%/simple.cc: $(BISON_IN) $(dist_pkgdata_DATA)
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += %D%/simple.test
|
||||||
|
|
||||||
|
|
||||||
|
## ---------- ##
|
||||||
|
## Variants. ##
|
||||||
|
## ---------- ##
|
||||||
|
|
||||||
|
if ENABLE_CXX
|
||||||
|
check_PROGRAMS += %D%/variant
|
||||||
|
nodist_%C%_variant_SOURCES = %D%/variant.yy
|
||||||
|
# Don't use gnulib's system headers.
|
||||||
|
%C%_variant_CPPFLAGS = -I$(top_builddir)
|
||||||
|
TESTS += %D%/variant.test
|
||||||
|
%D%/variant.cc: $(BISON_IN) $(dist_pkgdata_DATA)
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += %D%/variant.test
|
||||||
|
|
||||||
|
if ENABLE_CXX11
|
||||||
|
check_PROGRAMS += %D%/variant-11
|
||||||
|
nodist_%C%_variant_11_SOURCES = %D%/variant-11.yy
|
||||||
|
%C%_variant_11_CXXFLAGS = $(CXX11_CXXFLAGS)
|
||||||
|
# Don't use gnulib's system headers.
|
||||||
|
%C%_variant_11_CPPFLAGS = -I$(top_builddir)
|
||||||
|
TESTS += %D%/variant-11.test
|
||||||
|
%D%/variant-11.cc: $(BISON_IN) $(dist_pkgdata_DATA)
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += %D%/variant-11.test
|
||||||
|
|
||||||
|
dist_cxx_DATA = %D%/README %D%/Makefile %D%/variant.yy %D%/variant-11.yy
|
||||||
|
CLEANFILES += %D%/simple.output %D%/variant.output %D%/variant-11.output
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
: >input
|
||||||
|
run 0 "{I have three numbers for you., 1, 2, 3, And that's all!}"
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
: >input
|
||||||
|
run 0 "{I have numbers for you., 1, 2, 3, And that's all!}" 4
|
||||||
|
|
||||||
|
run 0 "{I have numbers for you., 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, And that's all!}" 1000
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 2008-2015, 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
%require "3.2"
|
||||||
|
%debug
|
||||||
|
%language "c++"
|
||||||
|
%define api.token.constructor
|
||||||
|
%define api.value.type variant
|
||||||
|
%define api.value.automove
|
||||||
|
%define api.location.file none
|
||||||
|
%define parse.assert
|
||||||
|
%locations
|
||||||
|
|
||||||
|
%code requires // *.hh
|
||||||
|
{
|
||||||
|
#include <memory> // std::unique_ptr
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using string_uptr = std::unique_ptr<std::string>;
|
||||||
|
using string_uptrs = std::vector<string_uptr>;
|
||||||
|
}
|
||||||
|
|
||||||
|
%code // *.cc
|
||||||
|
{
|
||||||
|
#include <algorithm>
|
||||||
|
#include <iostream>
|
||||||
|
#include <iterator>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
namespace yy
|
||||||
|
{
|
||||||
|
// Prototype of the yylex function providing subsequent tokens.
|
||||||
|
static parser::symbol_type yylex ();
|
||||||
|
|
||||||
|
// Print a vector of strings.
|
||||||
|
std::ostream&
|
||||||
|
operator<< (std::ostream& o, const string_uptrs& ss)
|
||||||
|
{
|
||||||
|
o << '{';
|
||||||
|
const char *sep = "";
|
||||||
|
for (const auto& s: ss)
|
||||||
|
{
|
||||||
|
o << sep << *s;
|
||||||
|
sep = ", ";
|
||||||
|
}
|
||||||
|
return o << '}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename... Args>
|
||||||
|
string_uptr
|
||||||
|
make_string_uptr (Args&&... args)
|
||||||
|
{
|
||||||
|
// std::make_unique is C++14.
|
||||||
|
return string_uptr (new std::string{std::forward<Args> (args)...});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%token <string_uptr> TEXT;
|
||||||
|
%token <int> NUMBER;
|
||||||
|
%printer { yyo << '(' << &$$ << ") " << $$; } <*>;
|
||||||
|
%printer { yyo << *$$; } <string_uptr>;
|
||||||
|
%token END_OF_FILE 0;
|
||||||
|
|
||||||
|
%type <string_uptr> item;
|
||||||
|
%type <string_uptrs> list;
|
||||||
|
|
||||||
|
%%
|
||||||
|
|
||||||
|
result:
|
||||||
|
list { std::cout << $1 << '\n'; }
|
||||||
|
;
|
||||||
|
|
||||||
|
list:
|
||||||
|
%empty { /* Generates an empty string list */ }
|
||||||
|
| list item { $$ = $1; $$.emplace_back ($2); }
|
||||||
|
;
|
||||||
|
|
||||||
|
item:
|
||||||
|
TEXT
|
||||||
|
| NUMBER { $$ = make_string_uptr (std::to_string ($1)); }
|
||||||
|
;
|
||||||
|
%%
|
||||||
|
|
||||||
|
// The last number return by the scanner is max - 1.
|
||||||
|
int max = 4;
|
||||||
|
|
||||||
|
namespace yy
|
||||||
|
{
|
||||||
|
// The yylex function providing subsequent tokens:
|
||||||
|
// TEXT "I have three numbers for you."
|
||||||
|
// NUMBER 1
|
||||||
|
// NUMBER 2
|
||||||
|
// NUMBER ...
|
||||||
|
// NUMBER max - 1
|
||||||
|
// TEXT "And that's all!"
|
||||||
|
// END_OF_FILE
|
||||||
|
|
||||||
|
static
|
||||||
|
parser::symbol_type
|
||||||
|
yylex ()
|
||||||
|
{
|
||||||
|
static int count = 0;
|
||||||
|
const int stage = count;
|
||||||
|
++count;
|
||||||
|
auto loc = parser::location_type{nullptr, unsigned (stage + 1), unsigned (stage + 1)};
|
||||||
|
if (stage == 0)
|
||||||
|
return parser::make_TEXT (make_string_uptr ("I have numbers for you."), std::move (loc));
|
||||||
|
else if (stage < max)
|
||||||
|
return parser::make_NUMBER (stage, std::move (loc));
|
||||||
|
else if (stage == max)
|
||||||
|
return parser::make_TEXT (make_string_uptr ("And that's all!"), std::move (loc));
|
||||||
|
else
|
||||||
|
return parser::make_END_OF_FILE (std::move (loc));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mandatory error function
|
||||||
|
void
|
||||||
|
parser::error (const parser::location_type& loc, const std::string& msg)
|
||||||
|
{
|
||||||
|
std::cerr << loc << ": " << msg << '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, const char *argv[])
|
||||||
|
{
|
||||||
|
if (2 <= argc && isdigit (*argv[1]))
|
||||||
|
max = strtol (argv[1], nullptr, 10);
|
||||||
|
auto&& p = yy::parser{};
|
||||||
|
p.set_debug_level (!!getenv ("YYDEBUG"));
|
||||||
|
return p.parse ();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: C++
|
||||||
|
// End:
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
: >input
|
||||||
|
run 0 "{I have three numbers for you., 1, 2, 3, And that's all!}"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
Copyright (C) 2008-2015, 2018 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,19 +15,20 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
%require "3.2"
|
||||||
%debug
|
%debug
|
||||||
%skeleton "lalr1.cc"
|
%language "c++"
|
||||||
%defines
|
|
||||||
%define api.token.constructor
|
%define api.token.constructor
|
||||||
%define api.value.type variant
|
%define api.value.type variant
|
||||||
|
%define api.location.file none
|
||||||
%define parse.assert
|
%define parse.assert
|
||||||
%locations
|
%locations
|
||||||
|
|
||||||
%code requires // *.hh
|
%code requires // *.hh
|
||||||
{
|
{
|
||||||
#include <list>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
typedef std::list<std::string> strings_type;
|
#include <vector>
|
||||||
|
typedef std::vector<std::string> strings_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
%code // *.cc
|
%code // *.cc
|
||||||
@@ -37,30 +38,31 @@ typedef std::list<std::string> strings_type;
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
// Prototype of the yylex function providing subsequent tokens.
|
|
||||||
namespace yy
|
namespace yy
|
||||||
{
|
{
|
||||||
|
// Prototype of the yylex function providing subsequent tokens.
|
||||||
static parser::symbol_type yylex ();
|
static parser::symbol_type yylex ();
|
||||||
}
|
|
||||||
|
|
||||||
// Printing a list of strings.
|
// Print a vector of strings.
|
||||||
// Koening look up will look into std, since that's an std::list.
|
|
||||||
namespace std
|
|
||||||
{
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
operator<< (std::ostream& o, const strings_type& s)
|
operator<< (std::ostream& o, const strings_type& ss)
|
||||||
{
|
{
|
||||||
std::copy (s.begin (), s.end (),
|
o << '{';
|
||||||
std::ostream_iterator<strings_type::value_type> (o, "\n"));
|
const char *sep = "";
|
||||||
return o;
|
for (strings_type::const_iterator i = ss.begin (), end = ss.end ();
|
||||||
|
i != end; ++i)
|
||||||
|
{
|
||||||
|
o << sep << *i;
|
||||||
|
sep = ", ";
|
||||||
|
}
|
||||||
|
return o << '}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Conversion to string.
|
// Convert to string.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline
|
|
||||||
std::string
|
std::string
|
||||||
string_cast (const T& t)
|
to_string (const T& t)
|
||||||
{
|
{
|
||||||
std::ostringstream o;
|
std::ostringstream o;
|
||||||
o << t;
|
o << t;
|
||||||
@@ -70,31 +72,38 @@ typedef std::list<std::string> strings_type;
|
|||||||
|
|
||||||
%token <::std::string> TEXT;
|
%token <::std::string> TEXT;
|
||||||
%token <int> NUMBER;
|
%token <int> NUMBER;
|
||||||
%printer { yyoutput << $$; } <*>;
|
%printer { yyo << '(' << &$$ << ") " << $$; } <*>;
|
||||||
%token END_OF_FILE 0;
|
%token END_OF_FILE 0;
|
||||||
|
|
||||||
%type <::std::string> item;
|
%type <::std::string> item;
|
||||||
%type <::std::list<std::string>> list;
|
%type <::std::vector<std::string>> list;
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
result:
|
result:
|
||||||
list { std::cout << $1 << std::endl; }
|
list { std::cout << $1 << '\n'; }
|
||||||
;
|
;
|
||||||
|
|
||||||
list:
|
list:
|
||||||
/* nothing */ { /* Generates an empty string list */ }
|
%empty { /* Generates an empty string list */ }
|
||||||
| list item { std::swap ($$, $1); $$.push_back ($2); }
|
| list item { std::swap ($$, $1); $$.push_back ($2); }
|
||||||
;
|
;
|
||||||
|
|
||||||
item:
|
item:
|
||||||
TEXT { std::swap ($$, $1); }
|
TEXT
|
||||||
| NUMBER { $$ = string_cast ($1); }
|
| NUMBER { $$ = to_string ($1); }
|
||||||
;
|
;
|
||||||
%%
|
%%
|
||||||
|
|
||||||
namespace yy
|
namespace yy
|
||||||
{
|
{
|
||||||
|
// Use nullptr with pre-C++11.
|
||||||
|
#if !defined __cplusplus || __cplusplus < 201103L
|
||||||
|
# define NULLPTR 0
|
||||||
|
#else
|
||||||
|
# define NULLPTR nullptr
|
||||||
|
#endif
|
||||||
|
|
||||||
// The yylex function providing subsequent tokens:
|
// The yylex function providing subsequent tokens:
|
||||||
// TEXT "I have three numbers for you."
|
// TEXT "I have three numbers for you."
|
||||||
// NUMBER 1
|
// NUMBER 1
|
||||||
@@ -107,9 +116,10 @@ namespace yy
|
|||||||
parser::symbol_type
|
parser::symbol_type
|
||||||
yylex ()
|
yylex ()
|
||||||
{
|
{
|
||||||
static int stage = -1;
|
static int count = 0;
|
||||||
++stage;
|
const int stage = count;
|
||||||
parser::location_type loc(0, stage + 1, stage + 1);
|
++count;
|
||||||
|
parser::location_type loc (NULLPTR, unsigned (stage + 1), unsigned (stage + 1));
|
||||||
switch (stage)
|
switch (stage)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@@ -129,7 +139,7 @@ namespace yy
|
|||||||
void
|
void
|
||||||
parser::error (const parser::location_type& loc, const std::string& msg)
|
parser::error (const parser::location_type& loc, const std::string& msg)
|
||||||
{
|
{
|
||||||
std::cerr << loc << ": " << msg << std::endl;
|
std::cerr << loc << ": " << msg << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,18 +2,18 @@
|
|||||||
/*.tmp
|
/*.tmp
|
||||||
/.deps
|
/.deps
|
||||||
/calc++
|
/calc++
|
||||||
/calc++-driver.cc
|
|
||||||
/calc++-driver.hh
|
|
||||||
/calc++-parser.cc
|
|
||||||
/calc++-parser.hh
|
|
||||||
/calc++-parser.output
|
|
||||||
/calc++-parser.stamp
|
|
||||||
/calc++-parser.yy
|
|
||||||
/calc++-scanner.cc
|
|
||||||
/calc++-scanner.ll
|
|
||||||
/calc++.cc
|
/calc++.cc
|
||||||
/calc++.exe
|
/calc++.exe
|
||||||
/calc.stamp
|
/calc.stamp
|
||||||
|
/driver.cc
|
||||||
|
/driver.hh
|
||||||
/location.hh
|
/location.hh
|
||||||
|
/parser.cc
|
||||||
|
/parser.hh
|
||||||
|
/parser.output
|
||||||
|
/parser.stamp
|
||||||
|
/parser.yy
|
||||||
/position.hh
|
/position.hh
|
||||||
|
/scanner.cc
|
||||||
|
/scanner.ll
|
||||||
/stack.hh
|
/stack.hh
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# This Makefile is designed to be simple and readable. It does not
|
||||||
|
# aim at portability. It requires GNU Make.
|
||||||
|
|
||||||
|
BISON = bison
|
||||||
|
CXX = g++
|
||||||
|
FLEX = flex
|
||||||
|
|
||||||
|
all: calc++
|
||||||
|
|
||||||
|
%.cc %.hh: %.yy
|
||||||
|
$(BISON) $(BISONFLAGS) -o $*.cc $<
|
||||||
|
|
||||||
|
%.cc: %.ll
|
||||||
|
$(FLEX) $(FLEXFLAGS) -o$@ $<
|
||||||
|
|
||||||
|
%.o: %.cc
|
||||||
|
$(CXX) $(CXXFLAGS) -c -o$@ $<
|
||||||
|
|
||||||
|
calc++: calc++.o driver.o parser.o scanner.o
|
||||||
|
$(CXX) -o $@ $^
|
||||||
|
|
||||||
|
calc++.o: parser.hh
|
||||||
|
parser.o: parser.hh
|
||||||
|
scanner.o: parser.hh
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f calc++ *.o parser.hh parser.cc scanner.cc
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
This directory contains calc++, a simple Bison grammar file in C++.
|
||||||
|
|
||||||
|
Please, read the corresponding chapter in the documentation: "A Complete C++
|
||||||
|
Example". It is also available on line (maybe with a different version of
|
||||||
|
Bison):
|
||||||
|
https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html
|
||||||
|
|
||||||
|
To use it, copy this directory into some work directory, and run `make` to
|
||||||
|
compile the executable, and try it. It is a simple calculator which accepts
|
||||||
|
several variable definitions, one per line, and then a single expression to
|
||||||
|
evaluate.
|
||||||
|
|
||||||
|
The program calc++ expects the file to parse as argument; pass `-` to read
|
||||||
|
the standard input (and then hit <Ctrl-d>, control-d, to end your input).
|
||||||
|
|
||||||
|
$ ./calc++ -
|
||||||
|
one := 1
|
||||||
|
two := 2
|
||||||
|
three := 3
|
||||||
|
(one + two * three) * two * three
|
||||||
|
<Ctrl-d>
|
||||||
|
42
|
||||||
|
|
||||||
|
You may pass `-p` to activate the parser debug traces, and `-s` to activate
|
||||||
|
the scanner's.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
Local Variables:
|
||||||
|
mode: outline
|
||||||
|
fill-column: 76
|
||||||
|
ispell-dictionary: "american"
|
||||||
|
End:
|
||||||
|
|
||||||
|
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# LocalWords: mfcalc calc parsers yy MERCHANTABILITY Ctrl ispell american
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2015, 2018 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
|
||||||
@@ -19,7 +19,8 @@ cat >input <<EOF
|
|||||||
toto := 1
|
toto := 1
|
||||||
toto
|
toto
|
||||||
EOF
|
EOF
|
||||||
run 0 1 -s
|
run 0 1
|
||||||
|
run -noerr 0 1 -s
|
||||||
|
|
||||||
|
|
||||||
cat >input <<EOF
|
cat >input <<EOF
|
||||||
@@ -30,7 +31,7 @@ d := a + b * c
|
|||||||
d
|
d
|
||||||
EOF
|
EOF
|
||||||
run 0 7
|
run 0 7
|
||||||
run 0 7 -p
|
run -noerr 0 7 -p
|
||||||
|
|
||||||
|
|
||||||
cat >input <<EOF
|
cat >input <<EOF
|
||||||
@@ -47,4 +48,11 @@ cat >input <<EOF
|
|||||||
a := 1
|
a := 1
|
||||||
d := a + b * c
|
d := a + b * c
|
||||||
EOF
|
EOF
|
||||||
run 1 ''
|
run 1 'err: -:3.1: syntax error, unexpected end of file, expecting ( or identifier or number'
|
||||||
|
|
||||||
|
|
||||||
|
cat >input <<EOF
|
||||||
|
a := 072101108108111044032119111114108100033
|
||||||
|
a
|
||||||
|
EOF
|
||||||
|
run 1 'err: -:1.6-44: integer is out of range: 072101108108111044032119111114108100033'
|
||||||
|
|||||||
+61
-52
@@ -1,17 +1,18 @@
|
|||||||
# Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2005-2006, 2008-2015, 2018 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
|
## This program is free software: you can redistribute it and/or modify
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
## it under the terms of the GNU General Public License as published by
|
||||||
# (at your option) any later version.
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
#
|
## (at your option) any later version.
|
||||||
# This program is distributed in the hope that it will be useful,
|
##
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
## This program is distributed in the hope that it will be useful,
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# GNU General Public License for more details.
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
#
|
## GNU General Public License for more details.
|
||||||
# You should have received a copy of the GNU General Public License
|
##
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
## ------------------- ##
|
## ------------------- ##
|
||||||
## Parser generation. ##
|
## Parser generation. ##
|
||||||
@@ -19,7 +20,7 @@
|
|||||||
|
|
||||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||||
# in srcdir, including during distcheck, which is forbidden.
|
# in srcdir, including during distcheck, which is forbidden.
|
||||||
examples/calc++/calc++-parser.stamp: $(BISON_IN)
|
%D%/parser.stamp: $(BISON_IN)
|
||||||
SUFFIXES += .yy .stamp
|
SUFFIXES += .yy .stamp
|
||||||
.yy.stamp:
|
.yy.stamp:
|
||||||
$(AM_V_YACC)rm -f $@
|
$(AM_V_YACC)rm -f $@
|
||||||
@@ -27,49 +28,57 @@ SUFFIXES += .yy .stamp
|
|||||||
$(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
|
$(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
|
||||||
$(AM_V_at)mv -f $@.tmp $@
|
$(AM_V_at)mv -f $@.tmp $@
|
||||||
|
|
||||||
$(calc_sources_generated): examples/calc++/calc++-parser.stamp
|
$(calcxx_sources_generated): %D%/parser.stamp
|
||||||
@test -f $@ || rm -f examples/calc++/calc++-parser.stamp
|
@test -f $@ || rm -f %D%/parser.stamp
|
||||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp
|
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/parser.stamp
|
||||||
CLEANFILES += \
|
CLEANFILES += \
|
||||||
$(calc_sources_generated) \
|
$(calcxx_sources_generated) \
|
||||||
examples/calc++/calc++-parser.output \
|
%D%/parser.output \
|
||||||
examples/calc++/calc++-parser.stamp \
|
%D%/parser.stamp \
|
||||||
examples/calc++/calc++-scanner.cc
|
%D%/scanner.cc
|
||||||
|
CLEANDIRS += %D%/*.dSYM
|
||||||
|
|
||||||
## -------------------- ##
|
## -------------------- ##
|
||||||
## Building & testing. ##
|
## Building & testing. ##
|
||||||
## -------------------- ##
|
## -------------------- ##
|
||||||
|
|
||||||
# Avoid using BUILT_SOURCES which is too global.
|
# Avoid using BUILT_SOURCES which is too global.
|
||||||
$(examples_calc___calc___OBJECTS): $(calc_sources_generated)
|
$(%C%_calc___OBJECTS): $(calcxx_sources_generated)
|
||||||
|
|
||||||
calc_sources_extracted = \
|
calcxx_sources_extracted = \
|
||||||
examples/calc++/calc++-driver.cc \
|
%D%/driver.cc \
|
||||||
examples/calc++/calc++-driver.hh \
|
%D%/driver.hh \
|
||||||
examples/calc++/calc++-scanner.ll \
|
%D%/scanner.ll \
|
||||||
examples/calc++/calc++.cc
|
%D%/calc++.cc
|
||||||
calc_extracted = \
|
calcxx_extracted = \
|
||||||
$(calc_sources_extracted) \
|
$(calcxx_sources_extracted) \
|
||||||
examples/calc++/calc++-parser.yy
|
%D%/parser.yy
|
||||||
extracted += $(calc_extracted)
|
extracted += $(calcxx_extracted)
|
||||||
calc_sources_generated = \
|
calcxx_sources_generated = \
|
||||||
examples/calc++/calc++-parser.cc \
|
%D%/parser.cc \
|
||||||
examples/calc++/calc++-parser.hh \
|
%D%/parser.hh \
|
||||||
examples/calc++/location.hh \
|
%D%/location.hh
|
||||||
examples/calc++/position.hh \
|
calcxx_sources = \
|
||||||
examples/calc++/stack.hh
|
$(calcxx_sources_extracted) \
|
||||||
calc_sources = \
|
$(calcxx_sources_generated)
|
||||||
$(calc_sources_extracted) \
|
|
||||||
$(calc_sources_generated)
|
|
||||||
|
|
||||||
if BISON_CXX_WORKS
|
if FLEX_CXX_WORKS
|
||||||
check_PROGRAMS += examples/calc++/calc++
|
if ENABLE_CXX
|
||||||
nodist_examples_calc___calc___SOURCES = \
|
check_PROGRAMS += %D%/calc++
|
||||||
$(calc_sources)
|
nodist_%C%_calc___SOURCES = $(calcxx_sources)
|
||||||
|
# Don't use gnulib's system headers.
|
||||||
|
%C%_calc___CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||||
|
%C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
|
||||||
|
TESTS += %D%/calc++.test
|
||||||
|
endif ENABLE_CXX
|
||||||
|
endif FLEX_CXX_WORKS
|
||||||
|
EXTRA_DIST += %D%/calc++.test
|
||||||
|
|
||||||
examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
|
|
||||||
examples_calc___calc___CXXFLAGS = \
|
## ------------ ##
|
||||||
$(AM_CXXFLAGS) $(WARN_NO_NULL_CONVERSION_CXXFLAGS)
|
## Installing. ##
|
||||||
dist_TESTS += examples/calc++/calc++.test
|
## ------------ ##
|
||||||
endif
|
|
||||||
|
calcxxdir = $(docdir)/examples/calc++
|
||||||
|
calcxx_DATA = $(calcxx_extracted)
|
||||||
|
dist_calcxx_DATA = %D%/README %D%/Makefile
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
// Work around an Automake 1.11.2 bug: it asks for the creation of
|
|
||||||
// y.tab.c and y.tab.h and then renames them as calc++-parser.cc and
|
|
||||||
// calc++-parser.h, but in the former it does not convert the
|
|
||||||
// #include "y.tab.h". We don't want this to show in the
|
|
||||||
// documentation.
|
|
||||||
#include "calc++-parser.hh"
|
|
||||||
+51
-15
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
# This file is part of GNU Bison
|
# This file is part of GNU Bison
|
||||||
|
|
||||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2013 Free Software
|
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2015, 2018 Free
|
||||||
# Foundation, Inc.
|
# 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
|
||||||
@@ -19,7 +19,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, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Usage: extexi input-file.texi ... -- [FILES to extract]
|
# Usage: extexi [OPTION...] input-file.texi ... -- [FILES to extract]
|
||||||
|
|
||||||
# Look for @example environments preceded with lines such as:
|
# Look for @example environments preceded with lines such as:
|
||||||
#
|
#
|
||||||
@@ -32,9 +32,27 @@
|
|||||||
# output before block 2, even if the latter appears before). The same
|
# output before block 2, even if the latter appears before). The same
|
||||||
# number may be used several time, in which case the order of
|
# number may be used several time, in which case the order of
|
||||||
# appearance is used.
|
# appearance is used.
|
||||||
|
#
|
||||||
|
# Use @ignore for code to extract that must not be part of the
|
||||||
|
# documentation. For instance:
|
||||||
|
#
|
||||||
|
# @ignore
|
||||||
|
# @comment file: calc++/scanner.ll
|
||||||
|
# @example
|
||||||
|
# // Work around an incompatibility in Flex.
|
||||||
|
# # undef yywrap
|
||||||
|
# # define yywrap() 1
|
||||||
|
# @end example
|
||||||
|
# @end ignore
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
|
use File::Basename qw(dirname);
|
||||||
|
use File::Path qw(make_path);
|
||||||
|
|
||||||
|
# Whether we generate synclines.
|
||||||
|
my $synclines = 0;
|
||||||
|
|
||||||
# normalize($block)
|
# normalize($block)
|
||||||
# -----------------
|
# -----------------
|
||||||
# Remove Texinfo mark up.
|
# Remove Texinfo mark up.
|
||||||
@@ -42,7 +60,7 @@ sub normalize($)
|
|||||||
{
|
{
|
||||||
local ($_) = @_;
|
local ($_) = @_;
|
||||||
|
|
||||||
s/^\@(c |comment|dots|end (ignore|group)|ignore|group).*//mg;
|
s/^\@(c |comment|dots|end (ignore|group)|ignore|group).*\n//mg;
|
||||||
s/\@value\{VERSION\}/$ENV{VERSION}/g;
|
s/\@value\{VERSION\}/$ENV{VERSION}/g;
|
||||||
s/^\@(error|result)\{\}//mg;
|
s/^\@(error|result)\{\}//mg;
|
||||||
s/\@([{}@])/$1/g;
|
s/\@([{}@])/$1/g;
|
||||||
@@ -62,9 +80,24 @@ sub message($)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# basename => full file name for files we should extract.
|
# The list of files we should extract.
|
||||||
my %file_wanted;
|
my @file_wanted;
|
||||||
|
|
||||||
|
# Whether we should extract that file, and then under which path.
|
||||||
|
sub file_wanted ($)
|
||||||
|
{
|
||||||
|
my ($f) = @_;
|
||||||
|
for my $file (@file_wanted)
|
||||||
|
{
|
||||||
|
# No endswith in Perl 5...
|
||||||
|
return $file if $f eq substr($file, -length($f));
|
||||||
|
}
|
||||||
|
undef
|
||||||
|
}
|
||||||
|
|
||||||
|
# process ($in)
|
||||||
|
# -------------
|
||||||
|
# Read input file $in, and generate the outputs.
|
||||||
sub process ($)
|
sub process ($)
|
||||||
{
|
{
|
||||||
my ($in) = @_;
|
my ($in) = @_;
|
||||||
@@ -86,9 +119,9 @@ sub process ($)
|
|||||||
{
|
{
|
||||||
my $f = $1;
|
my $f = $1;
|
||||||
$block = $2 || 1;
|
$block = $2 || 1;
|
||||||
if ($file_wanted{$f})
|
if (file_wanted($f))
|
||||||
{
|
{
|
||||||
$file = $file_wanted{$f};
|
$file = file_wanted($f);
|
||||||
message(" GEN $file");
|
message(" GEN $file");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -102,14 +135,14 @@ sub process ($)
|
|||||||
{
|
{
|
||||||
# Bison supports synclines, but not Flex.
|
# Bison supports synclines, but not Flex.
|
||||||
$input .= sprintf ("#line %s \"$in\"\n", $. + 1)
|
$input .= sprintf ("#line %s \"$in\"\n", $. + 1)
|
||||||
if $file =~ /\.[chy]*$/;
|
if $synclines && $file =~ /\.[chy]*$/;
|
||||||
next;
|
|
||||||
}
|
}
|
||||||
elsif (/^\@end (small)?example$/)
|
elsif (/^\@end (small)?example$/)
|
||||||
{
|
{
|
||||||
die "no contents: $file"
|
die "no contents: $file"
|
||||||
if $input eq "";
|
if $input eq "";
|
||||||
|
|
||||||
|
$file{$file}{$block} .= "\n" if defined $file{$file}{$block};
|
||||||
$file{$file}{$block} .= normalize($input);
|
$file{$file}{$block} .= normalize($input);
|
||||||
$file = $input = undef;
|
$file = $input = undef;
|
||||||
++$block;
|
++$block;
|
||||||
@@ -124,7 +157,7 @@ sub process ($)
|
|||||||
# Output the files.
|
# Output the files.
|
||||||
for my $file (keys %file)
|
for my $file (keys %file)
|
||||||
{
|
{
|
||||||
# No spurious end of line: use printf.
|
make_path (dirname ($file));
|
||||||
my $o = new IO::File(">$file")
|
my $o = new IO::File(">$file")
|
||||||
or die "$file: cannot create: $?";
|
or die "$file: cannot create: $?";
|
||||||
print $o $file{$file}{$_}
|
print $o $file{$file}{$_}
|
||||||
@@ -136,14 +169,17 @@ my @input;
|
|||||||
my $seen_dash = 0;
|
my $seen_dash = 0;
|
||||||
for my $arg (@ARGV)
|
for my $arg (@ARGV)
|
||||||
{
|
{
|
||||||
if ($arg eq '--')
|
if ($seen_dash)
|
||||||
|
{
|
||||||
|
push @file_wanted, $arg;
|
||||||
|
}
|
||||||
|
elsif ($arg eq '--')
|
||||||
{
|
{
|
||||||
$seen_dash = 1;
|
$seen_dash = 1;
|
||||||
}
|
}
|
||||||
elsif ($seen_dash)
|
elsif ($arg eq '--synclines')
|
||||||
{
|
{
|
||||||
use File::Basename;
|
$synclines = 1;
|
||||||
$file_wanted{basename($arg)} = $arg;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
+64
-27
@@ -1,23 +1,22 @@
|
|||||||
# Copyright (C) 2005, 2008-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2005, 2008-2015, 2018 Free Software Foundation, Inc.
|
||||||
#
|
##
|
||||||
# This program is free software: you can redistribute it and/or modify
|
## This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
## it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
## (at your option) any later version.
|
||||||
#
|
##
|
||||||
# This program is distributed in the hope that it will be useful,
|
## This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
## GNU General Public License for more details.
|
||||||
#
|
##
|
||||||
# You should have received a copy of the GNU General Public License
|
## You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
dist_noinst_SCRIPTS = examples/extexi examples/test
|
dist_noinst_SCRIPTS = %D%/extexi %D%/test
|
||||||
TEST_LOG_COMPILER = $(top_srcdir)/examples/test
|
TEST_LOG_COMPILER = $(top_srcdir)/%D%/test
|
||||||
|
|
||||||
AM_CXXFLAGS = \
|
AM_CXXFLAGS = \
|
||||||
$(NO_STRICT_ALIAS_CXXFLAGS) \
|
|
||||||
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
||||||
|
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
@@ -25,20 +24,58 @@ AM_CXXFLAGS = \
|
|||||||
## ------------ ##
|
## ------------ ##
|
||||||
|
|
||||||
doc = $(top_srcdir)/doc/bison.texi
|
doc = $(top_srcdir)/doc/bison.texi
|
||||||
extexi = $(top_srcdir)/examples/extexi
|
extexi = $(top_srcdir)/%D%/extexi
|
||||||
extract = VERSION="$(VERSION)" $(PERL) -f $(extexi) $(doc) --
|
if ENABLE_GCC_WARNINGS
|
||||||
|
EXTEXIFLAGS = --synclines
|
||||||
|
endif
|
||||||
|
extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(EXTEXIFLAGS) $(doc) --
|
||||||
extracted =
|
extracted =
|
||||||
CLEANFILES += $(extracted) examples/extracted.stamp
|
EXTRA_DIST += $(extracted)
|
||||||
examples/extracted.stamp: $(doc) $(extexi)
|
MAINTAINERCLEANFILES += $(extracted) %D%/extracted.stamp
|
||||||
|
%D%/extracted.stamp: $(doc) $(extexi)
|
||||||
$(AM_V_GEN)rm -f $@ $@.tmp
|
$(AM_V_GEN)rm -f $@ $@.tmp
|
||||||
|
$(AM_V_at)$(MKDIR_P) %D%
|
||||||
$(AM_V_at)touch $@.tmp
|
$(AM_V_at)touch $@.tmp
|
||||||
$(AM_V_at)$(extract) $(extracted)
|
$(AM_V_at)$(extract) $(extracted)
|
||||||
$(AM_V_at)mv $@.tmp $@
|
$(AM_V_at)mv $@.tmp $@
|
||||||
|
|
||||||
$(extracted): examples/extracted.stamp
|
$(extracted): %D%/extracted.stamp
|
||||||
@test -f $@ || rm -f examples/extracted.stamp
|
@test -f $@ || rm -f %D%/extracted.stamp
|
||||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/extracted.stamp
|
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/extracted.stamp
|
||||||
|
|
||||||
include examples/calc++/local.mk
|
|
||||||
include examples/mfcalc/local.mk
|
## ------ ##
|
||||||
include examples/rpcalc/local.mk
|
## Dist. ##
|
||||||
|
## ------ ##
|
||||||
|
|
||||||
|
# Ship the stamp file, otherwise it will be recreated, which is what
|
||||||
|
# we want to avoid.
|
||||||
|
EXTRA_DIST += %D%/extracted.stamp
|
||||||
|
|
||||||
|
# Suppress the #lines from the examples when rolling the tarball, so
|
||||||
|
# that regular users have readable examples even before installing
|
||||||
|
# Bison.
|
||||||
|
dist-hook: examples-unline
|
||||||
|
.PHONY: examples-unline
|
||||||
|
examples-unline:
|
||||||
|
for e in $(extracted); \
|
||||||
|
do \
|
||||||
|
e=$(distdir)/$$e; \
|
||||||
|
sed -e '/#line/d' $$e >$$e.tmp; \
|
||||||
|
mv -f $$e.tmp $$e; \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
## ---------- ##
|
||||||
|
## Examples. ##
|
||||||
|
## ---------- ##
|
||||||
|
|
||||||
|
examplesdir = $(docdir)/examples
|
||||||
|
dist_examples_DATA = %D%/README
|
||||||
|
|
||||||
|
CLEANDIRS += %D%/*.dSYM
|
||||||
|
|
||||||
|
include %D%/calc++/local.mk
|
||||||
|
include %D%/c++/local.mk
|
||||||
|
include %D%/mfcalc/local.mk
|
||||||
|
include %D%/rpcalc/local.mk
|
||||||
|
|||||||
+32
-26
@@ -1,36 +1,42 @@
|
|||||||
# Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2005-2006, 2008-2015, 2018 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
|
## This program is free software: you can redistribute it and/or modify
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
## it under the terms of the GNU General Public License as published by
|
||||||
# (at your option) any later version.
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
#
|
## (at your option) any later version.
|
||||||
# This program is distributed in the hope that it will be useful,
|
##
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
## This program is distributed in the hope that it will be useful,
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# GNU General Public License for more details.
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
#
|
## GNU General Public License for more details.
|
||||||
# You should have received a copy of the GNU General Public License
|
##
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
## -------------------- ##
|
## -------------------- ##
|
||||||
## Building & testing. ##
|
## Building & testing. ##
|
||||||
## -------------------- ##
|
## -------------------- ##
|
||||||
|
|
||||||
BUILT_SOURCES += $(mfcalc_sources)
|
BUILT_SOURCES += $(mfcalc_sources)
|
||||||
CLEANFILES += examples/mfcalc/mfcalc.[ch] examples/mfcalc/mfcalc.output
|
CLEANFILES += %D%/mfcalc.[ch] %D%/mfcalc.output
|
||||||
|
CLEANDIRS += %D%/*.dSYM
|
||||||
|
|
||||||
mfcalc_extracted = \
|
mfcalc_extracted = %D%/calc.h %D%/mfcalc.y
|
||||||
examples/mfcalc/calc.h \
|
mfcalc_sources = $(mfcalc_extracted)
|
||||||
examples/mfcalc/mfcalc.y
|
|
||||||
mfcalc_sources = \
|
|
||||||
$(mfcalc_extracted)
|
|
||||||
extracted += $(mfcalc_extracted)
|
extracted += $(mfcalc_extracted)
|
||||||
|
|
||||||
check_PROGRAMS += examples/mfcalc/mfcalc
|
check_PROGRAMS += %D%/mfcalc
|
||||||
examples_mfcalc_mfcalc_LDADD = -lm
|
nodist_%C%_mfcalc_SOURCES = $(mfcalc_sources)
|
||||||
nodist_examples_mfcalc_mfcalc_SOURCES = \
|
# Don't use gnulib's system headers.
|
||||||
$(mfcalc_sources)
|
%C%_mfcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||||
|
%C%_mfcalc_LDADD = -lm
|
||||||
|
|
||||||
examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_builddir)/examples/mfcalc
|
dist_TESTS += %D%/mfcalc.test
|
||||||
dist_TESTS += examples/mfcalc/mfcalc.test
|
|
||||||
|
## ------------ ##
|
||||||
|
## Installing. ##
|
||||||
|
## ------------ ##
|
||||||
|
|
||||||
|
mfcalcdir = $(docdir)/examples/mfcalc
|
||||||
|
mfcalc_DATA = $(mfcalc_extracted)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2015, 2018 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
|
||||||
@@ -24,4 +24,4 @@ cat >input <<EOF
|
|||||||
(1+2) * 3
|
(1+2) * 3
|
||||||
EOF
|
EOF
|
||||||
run 0 9
|
run 0 9
|
||||||
run 0 9 -p
|
run -noerr 0 9 -p
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/calc.h
|
/calc.h
|
||||||
|
/rpcalc
|
||||||
/rpcalc.c
|
/rpcalc.c
|
||||||
/rpcalc.h
|
/rpcalc.h
|
||||||
/rpcalc.output
|
/rpcalc.output
|
||||||
|
|||||||
+32
-25
@@ -1,35 +1,42 @@
|
|||||||
# Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
|
## Copyright (C) 2005-2006, 2008-2015, 2018 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
|
## This program is free software: you can redistribute it and/or modify
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
## it under the terms of the GNU General Public License as published by
|
||||||
# (at your option) any later version.
|
## the Free Software Foundation, either version 3 of the License, or
|
||||||
#
|
## (at your option) any later version.
|
||||||
# This program is distributed in the hope that it will be useful,
|
##
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
## This program is distributed in the hope that it will be useful,
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# GNU General Public License for more details.
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
#
|
## GNU General Public License for more details.
|
||||||
# You should have received a copy of the GNU General Public License
|
##
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
## You should have received a copy of the GNU General Public License
|
||||||
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
## -------------------- ##
|
## -------------------- ##
|
||||||
## Building & testing. ##
|
## Building & testing. ##
|
||||||
## -------------------- ##
|
## -------------------- ##
|
||||||
|
|
||||||
BUILT_SOURCES += $(rpcalc_sources)
|
BUILT_SOURCES += $(rpcalc_sources)
|
||||||
CLEANFILES += examples/rpcalc/rpcalc.[ch] examples/rpcalc/rpcalc.output
|
CLEANFILES += %D%/rpcalc.[ch] %D%/rpcalc.output
|
||||||
|
CLEANDIRS += %D%/*.dSYM
|
||||||
|
|
||||||
rpcalc_extracted = \
|
rpcalc_extracted = %D%/rpcalc.y
|
||||||
examples/rpcalc/rpcalc.y
|
rpcalc_sources = $(rpcalc_extracted)
|
||||||
rpcalc_sources = \
|
|
||||||
$(rpcalc_extracted)
|
|
||||||
extracted += $(rpcalc_extracted)
|
extracted += $(rpcalc_extracted)
|
||||||
|
|
||||||
check_PROGRAMS += examples/rpcalc/rpcalc
|
check_PROGRAMS += %D%/rpcalc
|
||||||
examples_rpcalc_rpcalc_LDADD = -lm
|
nodist_%C%_rpcalc_SOURCES = $(rpcalc_sources)
|
||||||
nodist_examples_rpcalc_rpcalc_SOURCES = \
|
# Don't use gnulib's system headers.
|
||||||
$(rpcalc_sources)
|
%C%_rpcalc_CPPFLAGS = -I$(top_builddir)/%D%
|
||||||
|
%C%_rpcalc_LDADD = -lm
|
||||||
|
|
||||||
examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_builddir)/examples/rpcalc
|
dist_TESTS += %D%/rpcalc.test
|
||||||
dist_TESTS += examples/rpcalc/rpcalc.test
|
|
||||||
|
## ------------ ##
|
||||||
|
## Installing. ##
|
||||||
|
## ------------ ##
|
||||||
|
|
||||||
|
rpcalcdir = $(docdir)/examples/rpcalc
|
||||||
|
rpcalc_DATA = $(rpcalc_extracted)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2015, 2018 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
|
||||||
|
|||||||
+33
-15
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
# Copyright (C) 2005-2015, 2018 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,7 +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, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
me=`basename $1 .test`
|
me=$(basename "$1" .test)
|
||||||
|
medir=$(basename "$(dirname "$1")")
|
||||||
|
|
||||||
# Number of the current test.
|
# Number of the current test.
|
||||||
number=1
|
number=1
|
||||||
@@ -23,17 +24,28 @@ number=1
|
|||||||
# Exit status of this script.
|
# Exit status of this script.
|
||||||
exit=true
|
exit=true
|
||||||
|
|
||||||
# top_buiddir.
|
# top_builddir.
|
||||||
cwd=`pwd`
|
cwd=$(pwd)
|
||||||
|
|
||||||
# The exercised program.
|
# The exercised program.
|
||||||
prog=$cwd/examples/$me/$me
|
for p in "$cwd/examples/$medir/$me" "$cwd/examples/$me"
|
||||||
|
do
|
||||||
|
if test -x "$p"; then
|
||||||
|
prog=$p
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if test x"$prog" = x; then
|
||||||
|
echo "$me: ERROR: cannot find program to exercise"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
# -------
|
# -------
|
||||||
cleanup ()
|
cleanup ()
|
||||||
{
|
{
|
||||||
local status=$?
|
status=$?
|
||||||
if test -z "$DEBUG"; then
|
if test -z "$DEBUG"; then
|
||||||
cd $cwd
|
cd $cwd
|
||||||
rm -rf $$.dir
|
rm -rf $$.dir
|
||||||
@@ -44,21 +56,27 @@ trap cleanup 0 1 2 13 15
|
|||||||
mkdir $$.dir
|
mkdir $$.dir
|
||||||
cd $$.dir
|
cd $$.dir
|
||||||
|
|
||||||
# run EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
|
# run [-noerr] EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
|
||||||
# ---------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
|
# -noerr: ignore stderr, otherwise merge it into effective output.
|
||||||
run ()
|
run ()
|
||||||
{
|
{
|
||||||
|
noerr=false
|
||||||
|
case $1 in
|
||||||
|
(-noerr) noerr=true; shift;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Expected exit status.
|
# Expected exit status.
|
||||||
local sta_exp=$1
|
sta_exp=$1
|
||||||
shift
|
shift
|
||||||
# Expected output.
|
# Expected output.
|
||||||
local out_exp=$1
|
out_exp=$1
|
||||||
shift
|
shift
|
||||||
# Effective exit status.
|
# Effective exit status.
|
||||||
local sta_eff=0
|
sta_eff=0
|
||||||
$prog "$@" - <input >out_eff || sta_eff=$?
|
$prog "$@" - <input >out_eff 2>err_eff || sta_eff=$?
|
||||||
# Effective output.
|
# Combine effective output and error streams.
|
||||||
local out_eff=`cat out_eff`
|
out_eff=$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff)
|
||||||
if test $sta_eff -eq $sta_exp; then
|
if test $sta_eff -eq $sta_exp; then
|
||||||
if test "$out_eff" = "$out_exp"; then
|
if test "$out_eff" = "$out_exp"; then
|
||||||
echo "$me: PASS: $number"
|
echo "$me: PASS: $number"
|
||||||
@@ -70,7 +88,7 @@ run ()
|
|||||||
echo "$me: FAIL: $number (expected status: $sta_exp, effective: $sta_eff)"
|
echo "$me: FAIL: $number (expected status: $sta_exp, effective: $sta_eff)"
|
||||||
exit=false
|
exit=false
|
||||||
fi
|
fi
|
||||||
number=`expr $number + 1`
|
number=$(expr $number + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
# We have cd'd one level deeper.
|
# We have cd'd one level deeper.
|
||||||
|
|||||||
+1
-1
Submodule gnulib updated: c67e3c0414...a79f2a2871
+44
-27
@@ -4,8 +4,7 @@
|
|||||||
/*~
|
/*~
|
||||||
/.deps
|
/.deps
|
||||||
/.dirstamp
|
/.dirstamp
|
||||||
/Makefile
|
/_Noreturn.h
|
||||||
/Makefile.in
|
|
||||||
/alignof.h
|
/alignof.h
|
||||||
/alloca.h
|
/alloca.h
|
||||||
/alloca.in.h
|
/alloca.in.h
|
||||||
@@ -15,7 +14,9 @@
|
|||||||
/asnprintf.c
|
/asnprintf.c
|
||||||
/basename-lgpl.c
|
/basename-lgpl.c
|
||||||
/basename.c
|
/basename.c
|
||||||
|
/binary-io.c
|
||||||
/binary-io.h
|
/binary-io.h
|
||||||
|
/bitrotate.c
|
||||||
/bitrotate.h
|
/bitrotate.h
|
||||||
/c++defs.h
|
/c++defs.h
|
||||||
/c-ctype.c
|
/c-ctype.c
|
||||||
@@ -28,8 +29,6 @@
|
|||||||
/charset.alias
|
/charset.alias
|
||||||
/cloexec.c
|
/cloexec.c
|
||||||
/cloexec.h
|
/cloexec.h
|
||||||
/close-hook.c
|
|
||||||
/close-hook.h
|
|
||||||
/close-stream.c
|
/close-stream.c
|
||||||
/close-stream.h
|
/close-stream.h
|
||||||
/close.c
|
/close.c
|
||||||
@@ -37,7 +36,6 @@
|
|||||||
/closeout.h
|
/closeout.h
|
||||||
/concat-filename.c
|
/concat-filename.c
|
||||||
/concat-filename.h
|
/concat-filename.h
|
||||||
/config.charset
|
|
||||||
/config.h
|
/config.h
|
||||||
/config.in.h
|
/config.in.h
|
||||||
/configmake.h
|
/configmake.h
|
||||||
@@ -56,7 +54,6 @@
|
|||||||
/exitfail.h
|
/exitfail.h
|
||||||
/fatal-signal.c
|
/fatal-signal.c
|
||||||
/fatal-signal.h
|
/fatal-signal.h
|
||||||
/fclose.c
|
|
||||||
/fcntl.c
|
/fcntl.c
|
||||||
/fcntl.h
|
/fcntl.h
|
||||||
/fcntl.in.h
|
/fcntl.in.h
|
||||||
@@ -81,19 +78,27 @@
|
|||||||
/fseterr.h
|
/fseterr.h
|
||||||
/fstat.c
|
/fstat.c
|
||||||
/getdtablesize.c
|
/getdtablesize.c
|
||||||
|
/getopt-cdefs.in.h
|
||||||
|
/getopt-core.h
|
||||||
|
/getopt-ext.h
|
||||||
|
/getopt-pfx-core.h
|
||||||
|
/getopt-pfx-ext.h
|
||||||
/getopt.c
|
/getopt.c
|
||||||
/getopt.h
|
/getopt.h
|
||||||
/getopt.in.h
|
/getopt.in.h
|
||||||
/getopt1.c
|
/getopt1.c
|
||||||
/getopt_int.h
|
/getopt_int.h
|
||||||
|
/getprogname.c
|
||||||
|
/getprogname.h
|
||||||
/gettext.h
|
/gettext.h
|
||||||
/gnulib.mk
|
/gnulib.mk
|
||||||
|
/hard-locale.c
|
||||||
|
/hard-locale.h
|
||||||
/hash.c
|
/hash.c
|
||||||
/hash.h
|
/hash.h
|
||||||
/intprops.h
|
/intprops.h
|
||||||
/inttypes.h
|
/inttypes.h
|
||||||
/inttypes.in.h
|
/inttypes.in.h
|
||||||
/ioctl.c
|
|
||||||
/isnan.c
|
/isnan.c
|
||||||
/isnand-nolibm.h
|
/isnand-nolibm.h
|
||||||
/isnand.c
|
/isnand.c
|
||||||
@@ -103,9 +108,15 @@
|
|||||||
/isnanl.c
|
/isnanl.c
|
||||||
/itold.c
|
/itold.c
|
||||||
/ldexpl.c
|
/ldexpl.c
|
||||||
|
/limits.h
|
||||||
|
/limits.in.h
|
||||||
/localcharset.c
|
/localcharset.c
|
||||||
/localcharset.h
|
/localcharset.h
|
||||||
|
/lstat.c
|
||||||
/malloc.c
|
/malloc.c
|
||||||
|
/malloca.c
|
||||||
|
/malloca.h
|
||||||
|
/math.c
|
||||||
/math.h
|
/math.h
|
||||||
/math.in.h
|
/math.in.h
|
||||||
/mbrtowc.c
|
/mbrtowc.c
|
||||||
@@ -114,12 +125,11 @@
|
|||||||
/mbswidth.h
|
/mbswidth.h
|
||||||
/memchr.c
|
/memchr.c
|
||||||
/memchr.valgrind
|
/memchr.valgrind
|
||||||
|
/minmax.h
|
||||||
/msvc-inval.c
|
/msvc-inval.c
|
||||||
/msvc-inval.h
|
/msvc-inval.h
|
||||||
/msvc-nothrow.c
|
/msvc-nothrow.c
|
||||||
/msvc-nothrow.h
|
/msvc-nothrow.h
|
||||||
/nonblocking.c
|
|
||||||
/nonblocking.h
|
|
||||||
/obstack.c
|
/obstack.c
|
||||||
/obstack.h
|
/obstack.h
|
||||||
/obstack_printf.c
|
/obstack_printf.c
|
||||||
@@ -140,7 +150,6 @@
|
|||||||
/printf.c
|
/printf.c
|
||||||
/progname.c
|
/progname.c
|
||||||
/progname.h
|
/progname.h
|
||||||
/quote.c
|
|
||||||
/quote.h
|
/quote.h
|
||||||
/quotearg.c
|
/quotearg.c
|
||||||
/quotearg.h
|
/quotearg.h
|
||||||
@@ -149,11 +158,10 @@
|
|||||||
/rawmemchr.valgrind
|
/rawmemchr.valgrind
|
||||||
/realloc.c
|
/realloc.c
|
||||||
/ref-add.sed
|
/ref-add.sed
|
||||||
/ref-add.sin
|
|
||||||
/ref-del.sed
|
/ref-del.sed
|
||||||
/ref-del.sin
|
|
||||||
/sched.h
|
/sched.h
|
||||||
/sched.in.h
|
/sched.in.h
|
||||||
|
/sig-handler.c
|
||||||
/sig-handler.h
|
/sig-handler.h
|
||||||
/sigaction.c
|
/sigaction.c
|
||||||
/signal.h
|
/signal.h
|
||||||
@@ -182,6 +190,8 @@
|
|||||||
/spawnp.c
|
/spawnp.c
|
||||||
/sprintf.c
|
/sprintf.c
|
||||||
/stamp-h1
|
/stamp-h1
|
||||||
|
/stat-w32.c
|
||||||
|
/stat-w32.h
|
||||||
/stat.c
|
/stat.c
|
||||||
/stdbool.h
|
/stdbool.h
|
||||||
/stdbool.in.h
|
/stdbool.in.h
|
||||||
@@ -192,7 +202,6 @@
|
|||||||
/stdio--.h
|
/stdio--.h
|
||||||
/stdio-impl.h
|
/stdio-impl.h
|
||||||
/stdio-safer.h
|
/stdio-safer.h
|
||||||
/stdio-write.c
|
|
||||||
/stdio.h
|
/stdio.h
|
||||||
/stdio.in.h
|
/stdio.in.h
|
||||||
/stdlib.h
|
/stdlib.h
|
||||||
@@ -211,24 +220,19 @@
|
|||||||
/stripslash.c
|
/stripslash.c
|
||||||
/strndup.c
|
/strndup.c
|
||||||
/strnlen.c
|
/strnlen.c
|
||||||
/strtol.c
|
|
||||||
/strtoul.c
|
|
||||||
/strverscmp.c
|
/strverscmp.c
|
||||||
/sys
|
/sys
|
||||||
/sys_ioctl.h
|
|
||||||
/sys_ioctl.in.h
|
/sys_ioctl.in.h
|
||||||
/sys_socket.h
|
|
||||||
/sys_socket.in.h
|
/sys_socket.in.h
|
||||||
/sys_stat.h
|
|
||||||
/sys_stat.in.h
|
/sys_stat.in.h
|
||||||
/sys_types.in.h
|
/sys_types.in.h
|
||||||
/sys_wait.h
|
|
||||||
/sys_wait.in.h
|
/sys_wait.in.h
|
||||||
/sysexits.in.h
|
/sysexits.in.h
|
||||||
/time.h
|
/time.h
|
||||||
/time.in.h
|
/time.in.h
|
||||||
/unistd--.h
|
/unistd--.h
|
||||||
/unistd-safer.h
|
/unistd-safer.h
|
||||||
|
/unistd.c
|
||||||
/unistd.h
|
/unistd.h
|
||||||
/unistd.in.h
|
/unistd.in.h
|
||||||
/unitypes.h
|
/unitypes.h
|
||||||
@@ -236,6 +240,7 @@
|
|||||||
/uniwidth
|
/uniwidth
|
||||||
/uniwidth.h
|
/uniwidth.h
|
||||||
/uniwidth.in.h
|
/uniwidth.in.h
|
||||||
|
/unlink.c
|
||||||
/unlocked-io.h
|
/unlocked-io.h
|
||||||
/unsetenv.c
|
/unsetenv.c
|
||||||
/vasnprintf.c
|
/vasnprintf.c
|
||||||
@@ -244,7 +249,6 @@
|
|||||||
/vfprintf.c
|
/vfprintf.c
|
||||||
/vsnprintf.c
|
/vsnprintf.c
|
||||||
/vsprintf.c
|
/vsprintf.c
|
||||||
/w32sock.h
|
|
||||||
/w32spawn.h
|
/w32spawn.h
|
||||||
/wait-process.c
|
/wait-process.c
|
||||||
/wait-process.h
|
/wait-process.h
|
||||||
@@ -252,6 +256,7 @@
|
|||||||
/warn-on-use.h
|
/warn-on-use.h
|
||||||
/wchar.h
|
/wchar.h
|
||||||
/wchar.in.h
|
/wchar.in.h
|
||||||
|
/wctype-h.c
|
||||||
/wctype.h
|
/wctype.h
|
||||||
/wctype.in.h
|
/wctype.in.h
|
||||||
/wcwidth.c
|
/wcwidth.c
|
||||||
@@ -262,13 +267,25 @@
|
|||||||
/xmalloc.c
|
/xmalloc.c
|
||||||
/xmemdup0.c
|
/xmemdup0.c
|
||||||
/xmemdup0.h
|
/xmemdup0.h
|
||||||
|
/xsize.c
|
||||||
/xsize.h
|
/xsize.h
|
||||||
/xstrndup.c
|
/xstrndup.c
|
||||||
/xstrndup.h
|
/xstrndup.h
|
||||||
/binary-io.c
|
/stat-time.c
|
||||||
/xsize.c
|
/stat-time.h
|
||||||
/bitrotate.c
|
/timevar.c
|
||||||
/math.c
|
/timevar.h
|
||||||
/sig-handler.c
|
/sys_time.in.h
|
||||||
/unistd.c
|
/sys_times.in.h
|
||||||
/wctype-h.c
|
/gethrxtime.c
|
||||||
|
/gethrxtime.h
|
||||||
|
/getrusage.c
|
||||||
|
/gettime.c
|
||||||
|
/gettimeofday.c
|
||||||
|
/localtime-buffer.c
|
||||||
|
/localtime-buffer.h
|
||||||
|
/sys_resource.in.h
|
||||||
|
/timespec.c
|
||||||
|
/timespec.h
|
||||||
|
/xtime.c
|
||||||
|
/xtime.h
|
||||||
|
|||||||
+70
-126
@@ -1,7 +1,7 @@
|
|||||||
/* Array bitsets.
|
/* Array bitsets.
|
||||||
|
|
||||||
Copyright (C) 2002-2003, 2006, 2009-2013 Free Software Foundation,
|
Copyright (C) 2002-2003, 2006, 2009-2015, 2018 Free Software
|
||||||
Inc.
|
Foundation, Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
@@ -35,33 +35,28 @@
|
|||||||
static bitset_bindex
|
static bitset_bindex
|
||||||
abitset_resize (bitset src, bitset_bindex size)
|
abitset_resize (bitset src, bitset_bindex size)
|
||||||
{
|
{
|
||||||
/* These bitsets have a fixed size. */
|
/* These bitsets have a fixed size. */
|
||||||
if (BITSET_SIZE_ (src) != size)
|
if (BITSET_SIZE_ (src) != size)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
return size;
|
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
|
||||||
*NEXT and store in array LIST. Return with actual number of bits
|
*NEXT and store in array LIST. Return with actual number of bits
|
||||||
found and with *NEXT indicating where search stopped. */
|
found and with *NEXT indicating where search stopped. */
|
||||||
static bitset_bindex
|
static bitset_bindex
|
||||||
abitset_small_list (bitset src, bitset_bindex *list,
|
abitset_small_list (bitset src, bitset_bindex *list,
|
||||||
bitset_bindex num, bitset_bindex *next)
|
bitset_bindex num, bitset_bindex *next)
|
||||||
{
|
{
|
||||||
bitset_bindex bitno;
|
bitset_word word = ABITSET_WORDS (src)[0];
|
||||||
bitset_bindex count;
|
|
||||||
bitset_windex size;
|
|
||||||
bitset_word word;
|
|
||||||
|
|
||||||
word = ABITSET_WORDS (src)[0];
|
|
||||||
|
|
||||||
/* Short circuit common case. */
|
/* Short circuit common case. */
|
||||||
if (!word)
|
if (!word)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
size = BITSET_SIZE_ (src);
|
bitset_windex size = BITSET_SIZE_ (src);
|
||||||
bitno = *next;
|
bitset_bindex bitno = *next;
|
||||||
if (bitno >= size)
|
if (bitno >= size)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -70,6 +65,7 @@ abitset_small_list (bitset src, bitset_bindex *list,
|
|||||||
/* If num is 1, we could speed things up with a binary search
|
/* If num is 1, we could speed things up with a binary search
|
||||||
of the word of interest. */
|
of the word of interest. */
|
||||||
|
|
||||||
|
bitset_bindex count;
|
||||||
if (num >= BITSET_WORD_BITS)
|
if (num >= BITSET_WORD_BITS)
|
||||||
{
|
{
|
||||||
for (count = 0; word; bitno++)
|
for (count = 0; word; bitno++)
|
||||||
@@ -142,36 +138,27 @@ static bitset_bindex
|
|||||||
abitset_list_reverse (bitset src, bitset_bindex *list,
|
abitset_list_reverse (bitset src, bitset_bindex *list,
|
||||||
bitset_bindex num, bitset_bindex *next)
|
bitset_bindex num, bitset_bindex *next)
|
||||||
{
|
{
|
||||||
bitset_bindex bitno;
|
bitset_bindex rbitno = *next;
|
||||||
bitset_bindex rbitno;
|
|
||||||
bitset_bindex count;
|
|
||||||
bitset_windex windex;
|
|
||||||
unsigned int bitcnt;
|
|
||||||
bitset_bindex bitoff;
|
|
||||||
bitset_word *srcp = ABITSET_WORDS (src);
|
bitset_word *srcp = ABITSET_WORDS (src);
|
||||||
bitset_bindex n_bits = BITSET_SIZE_ (src);
|
bitset_bindex n_bits = BITSET_SIZE_ (src);
|
||||||
|
|
||||||
rbitno = *next;
|
|
||||||
|
|
||||||
/* If num is 1, we could speed things up with a binary search
|
/* If num is 1, we could speed things up with a binary search
|
||||||
of the word of interest. */
|
of the word of interest. */
|
||||||
|
|
||||||
if (rbitno >= n_bits)
|
if (rbitno >= n_bits)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
count = 0;
|
bitset_bindex count = 0;
|
||||||
|
|
||||||
bitno = n_bits - (rbitno + 1);
|
bitset_bindex bitno = n_bits - (rbitno + 1);
|
||||||
|
|
||||||
windex = bitno / BITSET_WORD_BITS;
|
bitset_windex windex = bitno / BITSET_WORD_BITS;
|
||||||
bitcnt = bitno % BITSET_WORD_BITS;
|
unsigned bitcnt = bitno % BITSET_WORD_BITS;
|
||||||
bitoff = windex * BITSET_WORD_BITS;
|
bitset_bindex bitoff = windex * BITSET_WORD_BITS;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
bitset_word word;
|
bitset_word word = srcp[windex] << (BITSET_WORD_BITS - 1 - bitcnt);
|
||||||
|
|
||||||
word = srcp[windex] << (BITSET_WORD_BITS - 1 - bitcnt);
|
|
||||||
for (; word; bitcnt--)
|
for (; word; bitcnt--)
|
||||||
{
|
{
|
||||||
if (word & BITSET_MSB)
|
if (word & BITSET_MSB)
|
||||||
@@ -196,23 +183,20 @@ abitset_list_reverse (bitset src, bitset_bindex *list,
|
|||||||
|
|
||||||
|
|
||||||
/* 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
|
||||||
*NEXT and store in array LIST. Return with actual number of bits
|
*NEXT and store in array LIST. Return with actual number of bits
|
||||||
found and with *NEXT indicating where search stopped. */
|
found and with *NEXT indicating where search stopped. */
|
||||||
static bitset_bindex
|
static bitset_bindex
|
||||||
abitset_list (bitset src, bitset_bindex *list,
|
abitset_list (bitset src, bitset_bindex *list,
|
||||||
bitset_bindex num, bitset_bindex *next)
|
bitset_bindex num, bitset_bindex *next)
|
||||||
{
|
{
|
||||||
bitset_bindex bitno;
|
|
||||||
bitset_bindex count;
|
|
||||||
bitset_windex windex;
|
bitset_windex windex;
|
||||||
bitset_bindex bitoff;
|
bitset_bindex bitoff;
|
||||||
bitset_windex size = src->b.csize;
|
bitset_windex size = src->b.csize;
|
||||||
bitset_word *srcp = ABITSET_WORDS (src);
|
bitset_word *srcp = ABITSET_WORDS (src);
|
||||||
bitset_word word;
|
|
||||||
|
|
||||||
bitno = *next;
|
bitset_bindex bitno = *next;
|
||||||
|
|
||||||
count = 0;
|
bitset_bindex count = 0;
|
||||||
if (!bitno)
|
if (!bitno)
|
||||||
{
|
{
|
||||||
/* Many bitsets are zero, so make this common case fast. */
|
/* Many bitsets are zero, so make this common case fast. */
|
||||||
@@ -242,7 +226,7 @@ abitset_list (bitset src, bitset_bindex *list,
|
|||||||
on the previous call to this function. */
|
on the previous call to this function. */
|
||||||
|
|
||||||
bitoff = windex * BITSET_WORD_BITS;
|
bitoff = windex * BITSET_WORD_BITS;
|
||||||
word = srcp[windex] >> bitno;
|
bitset_word word = srcp[windex] >> bitno;
|
||||||
for (bitno = bitoff + bitno; word; bitno++)
|
for (bitno = bitoff + bitno; word; bitno++)
|
||||||
{
|
{
|
||||||
if (word & 1)
|
if (word & 1)
|
||||||
@@ -263,7 +247,8 @@ abitset_list (bitset src, bitset_bindex *list,
|
|||||||
|
|
||||||
for (; windex < size; windex++, bitoff += BITSET_WORD_BITS)
|
for (; windex < size; windex++, bitoff += BITSET_WORD_BITS)
|
||||||
{
|
{
|
||||||
if (!(word = srcp[windex]))
|
bitset_word word = srcp[windex];
|
||||||
|
if (!word)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((count + BITSET_WORD_BITS) < num)
|
if ((count + BITSET_WORD_BITS) < num)
|
||||||
@@ -302,9 +287,7 @@ abitset_list (bitset src, bitset_bindex *list,
|
|||||||
static inline void
|
static inline void
|
||||||
abitset_unused_clear (bitset dst)
|
abitset_unused_clear (bitset dst)
|
||||||
{
|
{
|
||||||
unsigned int last_bit;
|
unsigned last_bit = BITSET_SIZE_ (dst) % BITSET_WORD_BITS;
|
||||||
|
|
||||||
last_bit = BITSET_SIZE_ (dst) % BITSET_WORD_BITS;
|
|
||||||
if (last_bit)
|
if (last_bit)
|
||||||
ABITSET_WORDS (dst)[dst->b.csize - 1] &=
|
ABITSET_WORDS (dst)[dst->b.csize - 1] &=
|
||||||
((bitset_word) 1 << last_bit) - 1;
|
((bitset_word) 1 << last_bit) - 1;
|
||||||
@@ -315,9 +298,7 @@ static void
|
|||||||
abitset_ones (bitset dst)
|
abitset_ones (bitset dst)
|
||||||
{
|
{
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
size_t bytes;
|
size_t bytes = sizeof (bitset_word) * dst->b.csize;
|
||||||
|
|
||||||
bytes = sizeof (bitset_word) * dst->b.csize;
|
|
||||||
|
|
||||||
memset (dstp, -1, bytes);
|
memset (dstp, -1, bytes);
|
||||||
abitset_unused_clear (dst);
|
abitset_unused_clear (dst);
|
||||||
@@ -328,9 +309,7 @@ static void
|
|||||||
abitset_zero (bitset dst)
|
abitset_zero (bitset dst)
|
||||||
{
|
{
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
size_t bytes;
|
size_t bytes = sizeof (bitset_word) * dst->b.csize;
|
||||||
|
|
||||||
bytes = sizeof (bitset_word) * dst->b.csize;
|
|
||||||
|
|
||||||
memset (dstp, 0, bytes);
|
memset (dstp, 0, bytes);
|
||||||
}
|
}
|
||||||
@@ -339,13 +318,11 @@ abitset_zero (bitset dst)
|
|||||||
static bool
|
static bool
|
||||||
abitset_empty_p (bitset dst)
|
abitset_empty_p (bitset dst)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
|
|
||||||
for (i = 0; i < dst->b.csize; i++)
|
for (bitset_windex i = 0; i < dst->b.csize; i++)
|
||||||
if (dstp[i])
|
if (dstp[i])
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,10 +332,9 @@ abitset_copy1 (bitset dst, bitset src)
|
|||||||
{
|
{
|
||||||
bitset_word *srcp = ABITSET_WORDS (src);
|
bitset_word *srcp = ABITSET_WORDS (src);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
|
||||||
|
|
||||||
if (srcp == dstp)
|
if (srcp == dstp)
|
||||||
return;
|
return;
|
||||||
|
bitset_windex size = dst->b.csize;
|
||||||
memcpy (dstp, srcp, sizeof (bitset_word) * size);
|
memcpy (dstp, srcp, sizeof (bitset_word) * size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,13 +342,12 @@ abitset_copy1 (bitset dst, bitset src)
|
|||||||
static void
|
static void
|
||||||
abitset_not (bitset dst, bitset src)
|
abitset_not (bitset dst, bitset src)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *srcp = ABITSET_WORDS (src);
|
bitset_word *srcp = ABITSET_WORDS (src);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
*dstp++ = ~(*srcp++);
|
*dstp++ = ~(*srcp++);
|
||||||
abitset_unused_clear (dst);
|
abitset_unused_clear (dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,14 +355,13 @@ abitset_not (bitset dst, bitset src)
|
|||||||
static bool
|
static bool
|
||||||
abitset_equal_p (bitset dst, bitset src)
|
abitset_equal_p (bitset dst, bitset src)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *srcp = ABITSET_WORDS (src);
|
bitset_word *srcp = ABITSET_WORDS (src);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
if (*srcp++ != *dstp++)
|
if (*srcp++ != *dstp++)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,14 +369,13 @@ abitset_equal_p (bitset dst, bitset src)
|
|||||||
static bool
|
static bool
|
||||||
abitset_subset_p (bitset dst, bitset src)
|
abitset_subset_p (bitset dst, bitset src)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *srcp = ABITSET_WORDS (src);
|
bitset_word *srcp = ABITSET_WORDS (src);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++, srcp++)
|
for (bitset_windex i = 0; i < size; i++, dstp++, srcp++)
|
||||||
if (*dstp != (*srcp | *dstp))
|
if (*dstp != (*srcp | *dstp))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,15 +383,13 @@ abitset_subset_p (bitset dst, bitset src)
|
|||||||
static bool
|
static bool
|
||||||
abitset_disjoint_p (bitset dst, bitset src)
|
abitset_disjoint_p (bitset dst, bitset src)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *srcp = ABITSET_WORDS (src);
|
bitset_word *srcp = ABITSET_WORDS (src);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
if (*srcp++ & *dstp++)
|
if (*srcp++ & *dstp++)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,31 +397,28 @@ abitset_disjoint_p (bitset dst, bitset src)
|
|||||||
static void
|
static void
|
||||||
abitset_and (bitset dst, bitset src1, bitset src2)
|
abitset_and (bitset dst, bitset src1, bitset src2)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
*dstp++ = *src1p++ & *src2p++;
|
*dstp++ = *src1p++ & *src2p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
abitset_and_cmp (bitset dst, bitset src1, bitset src2)
|
abitset_and_cmp (bitset dst, bitset src1, bitset src2)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (bitset_windex i = 0; i < size; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++ & *src2p++;
|
bitset_word tmp = *src1p++ & *src2p++;
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = true;
|
changed = true;
|
||||||
@@ -464,31 +432,28 @@ abitset_and_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
static void
|
static void
|
||||||
abitset_andn (bitset dst, bitset src1, bitset src2)
|
abitset_andn (bitset dst, bitset src1, bitset src2)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
*dstp++ = *src1p++ & ~(*src2p++);
|
*dstp++ = *src1p++ & ~(*src2p++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
abitset_andn_cmp (bitset dst, bitset src1, bitset src2)
|
abitset_andn_cmp (bitset dst, bitset src1, bitset src2)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (bitset_windex i = 0; i < size; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++ & ~(*src2p++);
|
bitset_word tmp = *src1p++ & ~(*src2p++);
|
||||||
|
|
||||||
if (*dstp != tmp)
|
if (*dstp != tmp)
|
||||||
{
|
{
|
||||||
changed = true;
|
changed = true;
|
||||||
@@ -502,28 +467,26 @@ abitset_andn_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
static void
|
static void
|
||||||
abitset_or (bitset dst, bitset src1, bitset src2)
|
abitset_or (bitset dst, bitset src1, bitset src2)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
*dstp++ = *src1p++ | *src2p++;
|
*dstp++ = *src1p++ | *src2p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
abitset_or_cmp (bitset dst, bitset src1, bitset src2)
|
abitset_or_cmp (bitset dst, bitset src1, bitset src2)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (bitset_windex i = 0; i < size; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++ | *src2p++;
|
bitset_word tmp = *src1p++ | *src2p++;
|
||||||
|
|
||||||
@@ -540,28 +503,26 @@ abitset_or_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
static void
|
static void
|
||||||
abitset_xor (bitset dst, bitset src1, bitset src2)
|
abitset_xor (bitset dst, bitset src1, bitset src2)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
*dstp++ = *src1p++ ^ *src2p++;
|
*dstp++ = *src1p++ ^ *src2p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
abitset_xor_cmp (bitset dst, bitset src1, bitset src2)
|
abitset_xor_cmp (bitset dst, bitset src1, bitset src2)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (bitset_windex i = 0; i < size; i++, dstp++)
|
||||||
{
|
{
|
||||||
bitset_word tmp = *src1p++ ^ *src2p++;
|
bitset_word tmp = *src1p++ ^ *src2p++;
|
||||||
|
|
||||||
@@ -578,22 +539,20 @@ abitset_xor_cmp (bitset dst, bitset src1, bitset src2)
|
|||||||
static void
|
static void
|
||||||
abitset_and_or (bitset dst, bitset src1, bitset src2, bitset src3)
|
abitset_and_or (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *src3p = ABITSET_WORDS (src3);
|
bitset_word *src3p = ABITSET_WORDS (src3);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
*dstp++ = (*src1p++ & *src2p++) | *src3p++;
|
*dstp++ = (*src1p++ & *src2p++) | *src3p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
abitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
abitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
@@ -601,10 +560,9 @@ abitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (bitset_windex 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 = true;
|
changed = true;
|
||||||
@@ -618,22 +576,20 @@ abitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
static void
|
static void
|
||||||
abitset_andn_or (bitset dst, bitset src1, bitset src2, bitset src3)
|
abitset_andn_or (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *src3p = ABITSET_WORDS (src3);
|
bitset_word *src3p = ABITSET_WORDS (src3);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
*dstp++ = (*src1p++ & ~(*src2p++)) | *src3p++;
|
*dstp++ = (*src1p++ & ~(*src2p++)) | *src3p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
abitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
abitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
@@ -641,10 +597,9 @@ abitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (bitset_windex 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 = true;
|
changed = true;
|
||||||
@@ -658,22 +613,20 @@ abitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
static void
|
static void
|
||||||
abitset_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
|
abitset_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
bitset_word *src3p = ABITSET_WORDS (src3);
|
bitset_word *src3p = ABITSET_WORDS (src3);
|
||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (bitset_windex i = 0; i < size; i++)
|
||||||
*dstp++ = (*src1p++ | *src2p++) & *src3p++;
|
*dstp++ = (*src1p++ | *src2p++) & *src3p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
abitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
abitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
||||||
{
|
{
|
||||||
bitset_windex i;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
bitset_word *src1p = ABITSET_WORDS (src1);
|
bitset_word *src1p = ABITSET_WORDS (src1);
|
||||||
bitset_word *src2p = ABITSET_WORDS (src2);
|
bitset_word *src2p = ABITSET_WORDS (src2);
|
||||||
@@ -681,10 +634,9 @@ abitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
|
|||||||
bitset_word *dstp = ABITSET_WORDS (dst);
|
bitset_word *dstp = ABITSET_WORDS (dst);
|
||||||
bitset_windex size = dst->b.csize;
|
bitset_windex size = dst->b.csize;
|
||||||
|
|
||||||
for (i = 0; i < size; i++, dstp++)
|
for (bitset_windex 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 = true;
|
changed = true;
|
||||||
@@ -699,9 +651,9 @@ static void
|
|||||||
abitset_copy (bitset dst, bitset src)
|
abitset_copy (bitset dst, bitset src)
|
||||||
{
|
{
|
||||||
if (BITSET_COMPATIBLE_ (dst, src))
|
if (BITSET_COMPATIBLE_ (dst, src))
|
||||||
abitset_copy1 (dst, src);
|
abitset_copy1 (dst, src);
|
||||||
else
|
else
|
||||||
bitset_copy_ (dst, src);
|
bitset_copy_ (dst, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -784,14 +736,12 @@ struct bitset_vtable abitset_vtable = {
|
|||||||
size_t
|
size_t
|
||||||
abitset_bytes (bitset_bindex n_bits)
|
abitset_bytes (bitset_bindex n_bits)
|
||||||
{
|
{
|
||||||
bitset_windex size;
|
|
||||||
size_t bytes;
|
|
||||||
size_t header_size = offsetof (union bitset_union, a.words);
|
size_t header_size = offsetof (union bitset_union, a.words);
|
||||||
struct bitset_align_struct { char a; union bitset_union b; };
|
struct bitset_align_struct { char a; union bitset_union b; };
|
||||||
size_t bitset_alignment = offsetof (struct bitset_align_struct, b);
|
size_t bitset_alignment = offsetof (struct bitset_align_struct, b);
|
||||||
|
|
||||||
size = ABITSET_N_WORDS (n_bits);
|
bitset_windex size = ABITSET_N_WORDS (n_bits);
|
||||||
bytes = header_size + size * sizeof (bitset_word);
|
size_t bytes = header_size + size * sizeof (bitset_word);
|
||||||
|
|
||||||
/* Align the size properly for a vector of abitset objects. */
|
/* Align the size properly for a vector of abitset objects. */
|
||||||
if (header_size % bitset_alignment != 0
|
if (header_size % bitset_alignment != 0
|
||||||
@@ -808,19 +758,13 @@ abitset_bytes (bitset_bindex n_bits)
|
|||||||
bitset
|
bitset
|
||||||
abitset_init (bitset bset, bitset_bindex n_bits)
|
abitset_init (bitset bset, bitset_bindex n_bits)
|
||||||
{
|
{
|
||||||
bitset_windex size;
|
bitset_windex size = ABITSET_N_WORDS (n_bits);
|
||||||
|
|
||||||
size = ABITSET_N_WORDS (n_bits);
|
|
||||||
BITSET_NBITS_ (bset) = n_bits;
|
BITSET_NBITS_ (bset) = n_bits;
|
||||||
|
|
||||||
/* Use optimized routines if bitset fits within a single word.
|
/* Use optimized routines if bitset fits within a single word.
|
||||||
There is probably little merit if using caching since
|
There is probably little merit if using caching since
|
||||||
the small bitset will always fit in the cache. */
|
the small bitset will always fit in the cache. */
|
||||||
if (size == 1)
|
bset->b.vtable = size == 1 ? &abitset_small_vtable : &abitset_vtable;
|
||||||
bset->b.vtable = &abitset_small_vtable;
|
|
||||||
else
|
|
||||||
bset->b.vtable = &abitset_vtable;
|
|
||||||
|
|
||||||
bset->b.cindex = 0;
|
bset->b.cindex = 0;
|
||||||
bset->b.csize = size;
|
bset->b.csize = size;
|
||||||
bset->b.cdata = ABITSET_WORDS (bset);
|
bset->b.cdata = ABITSET_WORDS (bset);
|
||||||
|
|||||||
+4
-3
@@ -1,6 +1,7 @@
|
|||||||
/* Functions to support abitsets.
|
/* Functions to support abitsets.
|
||||||
|
|
||||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2009-2015, 2018 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||||
|
|
||||||
@@ -22,8 +23,8 @@
|
|||||||
|
|
||||||
#include "bitset.h"
|
#include "bitset.h"
|
||||||
|
|
||||||
extern size_t abitset_bytes (bitset_bindex);
|
size_t abitset_bytes (bitset_bindex);
|
||||||
|
|
||||||
extern bitset abitset_init (bitset, bitset_bindex);
|
bitset abitset_init (bitset, bitset_bindex);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user