Compare commits

..

201 Commits
v5.3.2 ... 5.5

Author SHA1 Message Date
Qt Submodule Update Bot
9a70b8f6aa Updated submodules.
Change-Id: I99354fcabe423403aee030714db2076833a6d207
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2016-01-15 20:46:14 +00:00
Qt Submodule Update Bot
99354fcabe Updated submodules.
Change-Id: If3294147a53dc85a4d7531ab504a68e2b06e6d7d
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-12-30 05:58:54 +00:00
Qt Submodule Update Bot
f3294147a5 Updated submodules.
Change-Id: I3812f549d47db6651ddd1ef73cbaea557f261a12
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-12-18 12:31:36 +00:00
Qt Submodule Update Bot
3812f549d4 Updated submodules.
Change-Id: I831a599d2b76a6a75a82cb4d8819fbfa2218ec76
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-11-23 04:53:03 +00:00
Qt Submodule Update Bot
831a599d2b Updated submodules.
Change-Id: Ic3959f2160f68c4b4742ae504d338161cfc570cc
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-11-09 05:28:29 +00:00
Qt Submodule Update Bot
c3959f2160 Updated submodules.
Change-Id: I3f9369be2d7a24babf3c4c336394afe1338bce19
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-11-05 06:50:02 +00:00
Qt Submodule Update Bot
3f9369be2d Updated submodules.
Change-Id: I675309da41afdcc3dff8b9e402bd4a51631c95d9
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-10-22 19:36:10 +00:00
Qt Submodule Update Bot
675309da41 Updated submodules.
Change-Id: I71774174c8acb5118b9ded14a3baab2cc18cf4d0
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-10-21 17:45:42 +00:00
Liang Qi
bd64171c0a Merge remote-tracking branch 'origin/5.5.1' into 5.5
Change-Id: I3013caa0d43447b9686f212cea8d1821ce551d59
2015-10-14 09:25:13 +02:00
Qt Submodule Update Bot
57d4fc9ceb Updated submodules.
Change-Id: I2579c442085495cd179d00e09285797bbb08b3eb
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-10-12 06:20:26 +00:00
Qt Submodule Update Bot
71774174c8 Updated submodules.
Change-Id: Ib02a6596cea197bdd3d4437ee784aab9200bf1d9
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-10-08 06:26:33 +00:00
Qt Submodule Update Bot
2579c44208 Updated submodules.
Change-Id: Ic1fbc6dfde579eaba980664444feaf9083dd4d39
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-10-06 18:56:13 +00:00
Qt Submodule Update Bot
c1fbc6dfde Updated submodules.
Change-Id: I063e5f899e0d33d5afe15dfb00221bd5d93aab3b
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-09-29 19:15:45 +00:00
Qt Submodule Update Bot
063e5f899e Updated submodules.
Change-Id: If835537d9fe8076aaf7a8b6311dbdf30b01d1900
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-09-27 11:17:00 +00:00
Qt Submodule Update Bot
b02a6596ce Updated submodules.
Change-Id: Idd1aeea722ee72249c7e1c5a85c0932b61300b7b
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-09-25 05:40:45 +00:00
Qt Submodule Update Bot
f835537d9f Updated submodules.
Change-Id: Ie4b9dc169153021a9204b6fdf3af9f58228fdf3e
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-09-24 04:32:16 +00:00
Qt Submodule Update Bot
e4b9dc1691 Updated submodules.
Change-Id: Iad31b8c5743bd4d9ff00b06466530193dd26853f
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-09-17 10:53:17 +00:00
Qt Submodule Update Bot
ad31b8c574 Updated submodules.
Change-Id: I0ba6e6ce435be779865b0ace08d74dd29800be9c
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-09-10 11:46:31 +00:00
Qt Submodule Update Bot
dd1aeea722 Updated submodules.
Change-Id: I0ba6e6ce435be779865b0ace08d74dd29800be9c
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-09-04 04:24:15 +00:00
Frederik Gladhorn
b68c8b9729 Adjust submodule branches
Change-Id: I6e3c7677499747fc10ff1a4e3eaa6e66a409c03e
2015-09-03 16:59:46 +02:00
Andrew Knight
7bbe464617 gnuwin32: remove win_bison/win_flex
These tools are copies of bison/flex and are no longer needed.

Change-Id: Ia543926ee8126358beee2aed03752d9cfe803f07
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-09-01 05:56:07 +00:00
Qt Submodule Update Bot
0ba6e6ce43 Updated submodules.
Change-Id: I1497a398e34e18abb18f705b2294464840629ca1
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-09-01 05:56:00 +00:00
Qt Submodule Update Bot
1497a398e3 Updated submodules.
Change-Id: I56e7af096e889d56ef67baabf38529c0ccb8d8b5
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-08-25 04:33:00 +00:00
Qt Submodule Update Bot
56e7af096e Updated submodules.
Change-Id: Icf1e00c471aea0ce5228165735195a9f0f76fe36
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-08-21 09:43:42 +00:00
Qt Submodule Update Bot
cf1e00c471 Updated submodules.
Change-Id: Id60882b0bc98875361477cb5aaf7d12c2693f900
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-08-18 04:24:52 +00:00
Thiago Macieira
d7b8b62cb3 Add the GPLv3 license text
LGPLv3 refers to it but does not include it in its body.

Change-Id: Ib056b47dde3341ef9a52ffff13eed18cf3504738
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-08-14 13:39:09 +02:00
Oswald Buddenhagen
bf5c38f136 Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I5b894e7f72ad81e62a6ea0777e6713dfa36c8a68
2015-08-14 13:38:53 +02:00
Oswald Buddenhagen
3f2ff8b460 Merge remote-tracking branch 'origin/5.4.2' into 5.4
Change-Id: Id8fa6d30810f8bfe46d5aa7e279c69ea560edd19
2015-08-14 13:34:32 +02:00
Mitch Curtis
30e19df5bf Add qtgraphicaleffects as an optional dependency for qtquickcontrols.
This is a prerequisite to making qtgraphicaleffects a dependency in
qtquickcontrols' sync.profile.

Task-number: QTBUG-46393
Change-Id: I3679392a7feb48ecefa4a01a7ecb42b2e6287ecb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-08-13 11:52:55 +00:00
Andrew Knight
3d7fe3b822 gnuwin32: Remove old versions of bison/flex from the distribution
The win_flex/win_bison tools are already in the repository and working
with all projects, so the GnuWin32 versions can be removed and the
winflexbison versions can take their place.

Task-number: QTBUG-46852
Change-Id: I41bc541adab834ff83912d7a4f076a87fc174601
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-08-13 04:45:21 +00:00
Qt Submodule Update Bot
d60882b0bc Updated submodules.
Change-Id: Idbdb4ce40f9456898ac9148dc08473f636f34f1d
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-08-13 04:45:15 +00:00
Qt Submodule Update Bot
dbdb4ce40f Updated submodules.
Change-Id: I20beccb62815f3c6948d888ccfad0b69c42b55e0
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-08-07 06:55:47 +00:00
Qt Submodule Update Bot
20beccb628 Updated submodules.
Change-Id: Ie77fe47fcec71a13d3640059d1e0ce66a47fc0b2
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-07-14 03:17:43 +00:00
Qt Submodule Update Bot
e77fe47fce Updated submodules.
Change-Id: I22c7d89fd93a256c4051f49b9a9b89789e697df6
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-07-11 09:46:26 +00:00
Qt Submodule Update Bot
22c7d89fd9 Updated submodules.
Change-Id: Ideafacc193da59a1db25e006b16630b74535cbee
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-30 18:19:55 +00:00
Kai Koehne
345e4356b7 README: Replace qt-project.org with qt.io
Change-Id: Iacc4dc8f28ce2c0bb1d761834d0f90b444f47327
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-30 18:19:33 +00:00
Qt Submodule Update Bot
deafacc193 Updated submodules.
Change-Id: Ibc862a8b12e46042819341229b31883bc9a1462e
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-29 19:59:42 +00:00
Aaron McCarthy
fb5e3cc2d3 Add qtquickcontrols as an optional dependency to qtlocation module
With the correct modules checked out 'make module-qtlocation' will build
everything necessary to run the examples.

Change-Id: I0c63221b5704c2b13495f3dc3221e888d8e9547c
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-06-26 06:46:09 +00:00
Qt Submodule Update Bot
bc862a8b12 Updated submodules.
Change-Id: Ie231e8be72006172dd80ec9f1df8f57e7fc54891
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-26 05:37:28 +00:00
Qt Submodule Update Bot
e231e8be72 Updated submodules.
Change-Id: Icc425a6784ea3ae379716ddb1e79a8a07ccd8d74
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-25 19:31:02 +00:00
Qt Submodule Update Bot
cc425a6784 Updated submodules.
Change-Id: I88f32b10ee95f967686bf9c3295887b4ebb62eba
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-24 07:00:47 +00:00
Qt Submodule Update Bot
88f32b10ee Updated submodules.
Change-Id: Ibc644efc00d00f43c1d202106bae6facf015c7fb
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-20 06:59:07 +00:00
Qt Submodule Update Bot
0d60d720f8 Updated submodules.
Change-Id: I00defc7101f1cabc0cc540a84846ec9b7933f599
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-19 18:49:53 +00:00
Qt Submodule Update Bot
bc644efc00 Updated submodules.
Change-Id: Ia820c1611af25853deb8161041adf39b7bfa61db
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-17 12:04:07 +00:00
Qt Submodule Update Bot
a820c1611a Updated submodules.
Change-Id: I5384ff79efab1a68cfb665f1e764d7f5ee73fcba
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-07 05:40:06 +00:00
Michael Olbrich
935ffc2e5f qtdeclarative is an optional dependency for qtwebkit
This way qtwebkit can be built when qtdeclarative is disabled. This is
especially useful for targets without OpenGL.

Also add qtxmlpatterns to the optional dependencies. It was an indirect
dependency before via qtdeclarative.

Change-Id: Ib4c29b958bd63d528fba8ec326e2dbc1ea8bce08
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-06-05 19:05:46 +00:00
Qt Submodule Update Bot
5384ff79ef Updated submodules.
Change-Id: I4fc367abe95ee78166067047d0f229bba9991956
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-06-04 20:03:11 +00:00
Qt Submodule Update Bot
4fc367abe9 Updated submodules.
Change-Id: I88af8ac70704e63a2154b3fe22b51483a69d84c3
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-05-31 06:59:17 +00:00
Qt Submodule Update Bot
00defc7101 Updated submodules.
Change-Id: Ib62714f88c3cd381cbbf8758c7b1029c2fa254ed
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-05-31 06:58:29 +00:00
Qt Submodule Update Bot
88af8ac707 Updated submodules.
Change-Id: I57641bf25f49f0f8eb55ccb08a4ede2d6a7af499
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-29 19:19:51 +00:00
Oswald Buddenhagen
4a5968ce75 Merge branch '5.4' into 5.4.2
Change-Id: I33d967b5f668c672a55ad93ac314340453850521
2015-05-29 20:12:13 +02:00
Oswald Buddenhagen
843a3407f2 Merge tag 'v5.4.1' into 5.4
Qt 5.4.1 Release
2015-05-29 15:53:05 +02:00
Oswald Buddenhagen
5400507252 Merge tag 'v5.4.0' into 5.4
Qt 5.4.0 Release
2015-05-29 15:52:28 +02:00
Qt Submodule Update Bot
210493d641 Updated submodules.
Change-Id: I670466b6a3ff58edb40c91ff86c443cd6dd20126
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-29 09:18:21 +00:00
Qt Submodule Update Bot
670466b6a3 Updated submodules.
Change-Id: I07856d73e19b60fbc01ff650cddb1d557db35617
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-05-28 11:33:18 +00:00
Andrew Knight
ea14bacdc8 Set win_bison/win_flex executable
This fixes failed execution when the Qt sources are exported to
Windows over a network share or attempted to be executed on a Linux
system using binfmt.

Change-Id: I00b1073e516d2441498a39cc13e4295484e1ef9d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-27 16:13:29 +00:00
Qt Submodule Update Bot
57641bf25f Updated submodules.
Change-Id: I31ee12ede4defe80e20dd49b9ca7b425b6758965
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-27 16:13:26 +00:00
Qt Submodule Update Bot
07856d73e1 Updated submodules.
Change-Id: Idfffbfdc266be3f52f716b152bbcb70810127cc9
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-23 06:51:36 +00:00
Qt Submodule Update Bot
31ee12ede4 Updated submodules.
Change-Id: I833cf03a1efe7ef6fa8f11020826063804ebddaa
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-19 09:48:15 +00:00
Qt Submodule Update Bot
dfffbfdc26 Updated submodules.
Change-Id: I24f1b3219d1db41acc3f0781fa38f253bcb04da3
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-16 04:57:35 +00:00
Qt Submodule Update Bot
833cf03a1e Updated submodules.
Change-Id: I619984c9c8d142c465bb86a571d101ac564676d2
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-15 10:34:29 +00:00
Qt Submodule Update Bot
b62714f88c Updated submodules.
Change-Id: I68b5c48282234a27f7c96595c8d84a4dc0bb3871
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-05-14 14:37:56 +00:00
Qt Submodule Update Bot
24f1b3219d Updated submodules.
Change-Id: If7cb995d04fdc05b35df8b6c5215bf530006b984
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-05-13 15:55:59 +00:00
Qt Submodule Update Bot
619984c9c8 Updated submodules.
Change-Id: I56a80384b1c5fef07b53d41bcc8567177f6f43db
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-09 16:06:13 +00:00
Qt Submodule Update Bot
f7cb995d04 Updated submodules.
Change-Id: I11963ba9f0141fc72dadedffe2c36fba5be16186
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-09 12:22:09 +00:00
Qt Submodule Update Bot
56a80384b1 Updated submodules.
Change-Id: I359f9925da5f735a654ab18efbc68305f5dadfd2
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-07 05:58:41 +00:00
Qt Submodule Update Bot
359f9925da Updated submodules.
Change-Id: Ic38d3b26e9a53fb6b0671ebfdbd05f6a925fe668
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-03 07:57:46 +00:00
Qt Submodule Update Bot
11963ba9f0 Updated submodules.
Change-Id: I39ce0228dad0d141df17ea5f911046130f823467
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-05-03 07:57:31 +00:00
Qt Submodule Update Bot
c38d3b26e9 Updated submodules.
Change-Id: I0d362ee5568abc3943a83b10ae8b6444103ff8c3
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-29 17:37:59 +00:00
Qt Submodule Update Bot
39ce0228da Updated submodules.
Change-Id: I59e3021a529806b8b2ae7676b8f687099384f7e4
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-28 10:58:28 +00:00
Qt Submodule Update Bot
0d362ee556 Updated submodules.
Change-Id: I976ffd988e7ec7b595ed610d86bf58307c5e5434
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-28 04:35:07 +00:00
Sergio Ahumada
95bb29e243 Replace old qt-project.org wiki with wiki.qt.io
Change-Id: I9a1114a8b5da649d3da718248fe5df5781810c20
Reviewed-by: Tero Kojo <tero.kojo@theqtcompany.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-16 09:42:01 +00:00
Qt Submodule Update Bot
68b5c48282 Updated submodules.
Change-Id: I59e3021a529806b8b2ae7676b8f687099384f7e4
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-15 09:16:10 +00:00
Qt Submodule Update Bot
976ffd988e Updated submodules.
Change-Id: I1d66817cbc1f67e7fd8e2d3f92ec39af344a2f43
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-14 04:20:21 +00:00
Oswald Buddenhagen
451f0a193b Adjust submodule branches
Change-Id: Ib30d8a8c4691787c460fe6540b64e2d593422c68
2015-04-10 12:10:34 +02:00
Qt Submodule Update Bot
59e3021a52 Updated submodules.
Change-Id: Ibe35b9f9af23a2b84ccab7e24b10e70d9324e42b
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-09 09:28:44 +00:00
Qt Submodule Update Bot
1d66817cbc Updated submodules.
Change-Id: I95930e98758f357598c5aaa8fce39ca7f3f549a4
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-09 04:45:52 +00:00
Qt Submodule Update Bot
95930e9875 Updated submodules.
Change-Id: I8ad3df2f5d5e93ea8b6e9b823a83e9738f3bf489
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-07 10:28:48 +00:00
Caroline Chao
697291ef10 Remove specific rules for QtWayland
Let the module handle the platforms by itself.
See QtWayland change: 0448026b4ee75

Change-Id: I622d17d6219e71fb0ad014442763b515e58079af
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-01 04:27:17 +00:00
Andrew Knight
98c4f1bbeb Upgrade win_flex/win_bison to 2.5.5 (bison 3.0)
This version is required by upstream ANGLE. win_bison conveniently uses a
different executable name as the existing bison copy, avoiding conflicts.

Change-Id: I2897ce97aef6795933d3ab8b5570a8494a55523e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-01 04:27:00 +00:00
Qt Submodule Update Bot
8ad3df2f5d Updated submodules.
Change-Id: Ie0b703ccb7081240278fd803d18d3da11bc3b1b7
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-04-01 04:26:47 +00:00
Qt Submodule Update Bot
e0b703ccb7 Updated submodules.
Change-Id: Icdc3bf5bd941362d1291566b94a67e6d6456a1ad
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-03-26 05:26:21 +00:00
Qt Submodule Update Bot
cdc3bf5bd9 Updated submodules.
Change-Id: I43a2c55cdea1098a23221915571445c1d5f23c2b
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-03-20 20:52:06 +00:00
Qt Submodule Update Bot
43a2c55cde Updated submodules.
Change-Id: I1b9965bf167e4a510bb8662ea11e6ee71a566772
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-03-18 12:41:19 +00:00
Qt Submodule Update Bot
1b9965bf16 Updated submodules.
Change-Id: I9a9865ce282d870f755e08438ba187061a41ed9d
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-03-13 18:29:44 +00:00
Jani Heikkinen
cb28f324e5 Added Qt3D as a part of qt5.git default repositories
Change-Id: I0e74e6c6ab6c347396c449859b1cf24752a42fb8
Reviewed-by: Johanna Äijälä <johanna.aijala@digia.com>
2015-03-13 18:29:34 +00:00
Oswald Buddenhagen
a5edc40176 Merge remote-tracking branch 'origin/5.4' into 5.5 2015-03-09 12:28:37 +01:00
Oswald Buddenhagen
ac6168c0cb use git clone --branch instead of --no-checkout
git submodule update does not cause an actual checkout if HEAD matches
the recorded submodule sha1 even if it was not actually checked out.

it would be possible to work around this by calling git checkout HEAD in
each submodule if no files are checked out, but that seems hacky.

instead, just make the module cloning already check out the desired
branch. this produces checkouts that are within a few commits of the
final sha1, so isn't too bad.

Change-Id: I435c1a2e24f39fd8c0d65f0d90df0216715668b7
2015-03-04 12:23:13 +01:00
Oswald Buddenhagen
4b962aee82 Merge remote-tracking branch 'origin/dev' into 5.5
Conflicts:
	.gitmodules

Change-Id: I45e015a2c4eb3778d2346569de9b7f09e72a58bf
2015-03-03 11:21:03 +01:00
Jani Heikkinen
c2d151522b Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: Ieb3be34b0d4061fb8dc886991528951f59dbd67e
Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-25 03:23:07 +00:00
Qt Submodule Update Bot
9a9865ce28 Updated submodules.
Change-Id: Ibe35b9f9af23a2b84ccab7e24b10e70d9324e42b
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-25 03:22:48 +00:00
Alex Blasche
811a77a53c Add qtdeclarative as optional dependency for qtlocation
Change-Id: Id6d406cd98b64ba111d1eb9cb0b03360a05fbca7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-17 06:42:55 +00:00
Qt Submodule Update Bot
e3cd5bb368 Updated submodules.
Change-Id: I0badf6179237bb89ffc57c7387cbf21ebc3b6665
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-16 19:57:25 +00:00
Oswald Buddenhagen
f46b8dc760 Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: Ie7b1685080b978cc1d8790823f79e98e930ca147
2015-02-16 16:24:40 +01:00
Oswald Buddenhagen
f900f38f71 Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	qtandroidextras
	qtbase
	qtconnectivity
	qtdeclarative
	qtdoc
	qtenginio
	qtmacextras
	qtmultimedia
	qtquick1
	qtscript
	qtsensors
	qtserialport
	qtsvg
	qttools
	qtwayland
	qtwebchannel
	qtwebengine
	qtwebkit
	qtwebsockets
	qtwinextras
	qtx11extras
	qtxmlpatterns

Change-Id: I98b5e8165cd8575888d18198d8d8e8412e7bfaf0
2015-02-16 16:19:22 +01:00
Oswald Buddenhagen
122d4551b5 Adjust submodule branches
Change-Id: I952bb9255a393baec2d9ede1cabfca7a47e2dc93
2015-02-16 15:50:02 +01:00
Qt Submodule Update Bot
be35b9f9af Updated submodules.
Change-Id: Idc93c0d4d7c8e30258fb3ad9f4735e4c9d07457c
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-14 11:18:41 +00:00
Qt Submodule Update Bot
0badf61792 Updated submodules.
Change-Id: I98737b388b9898507bebcd8d05a86e7d916b6d25
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-14 08:54:49 +00:00
Qt Submodule Update Bot
2c39898934 Updated submodules.
Change-Id: I9347499e78f03710eaf24af3c1e7ac650d0ef81d
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-13 15:11:39 +00:00
Pasi Keranen
682766b9fa Add qtcanvas3d as submodule
[ChangeLog][General] Added QtCanvas3D module, a JavaScript 3D rendering API for QtQuick.

Change-Id: I9448f87ba8c8ccfb2dd6cf790d29bb561b9e9740
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-13 15:11:19 +00:00
Qt Submodule Update Bot
98737b388b Updated submodules.
Change-Id: I9fb1a2e12fb6562c22dbac5fbca06d33046a5030
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-13 04:29:58 +00:00
Pierre Rossi
3e40bbd114 QtWebEngine: add dependency on QtWebChannel
To allow using the integration that makes use of a custom transport over
Chromium IPC.
Also add QtLocation as an optional dependency for correctness, and
update the pinned sha1

Change-Id: I71d88be0859a74ad82f539d00f02b51d1c3e5218
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
2015-02-11 21:59:19 +00:00
Qt Submodule Update Bot
9fb1a2e12f Updated submodules.
Change-Id: Ib71478c424ed0a6fd8d058513aa9a68dda71336f
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-10 09:18:23 +00:00
Qt Submodule Update Bot
b71478c424 Updated submodules.
Change-Id: I81efb6de3c49e6779556b1d1dfe06f1e1bc574f6
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-06 17:00:48 +00:00
Qt Submodule Update Bot
dc93c0d4d7 Updated submodules.
Change-Id: I0163cb617aa19a26423a716bef23bfc6308aadc6
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-02-06 06:24:23 +00:00
Oswald Buddenhagen
34c7caab3f don't fetch again when updating submodules
we already did it a moment ago.

this should affect only the --remote case, but there is no harm in
always specifying it.

Change-Id: I3ef0854c790726772fb63ab7829b59ef85ac4f18
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-02-06 06:24:10 +00:00
Oswald Buddenhagen
9ebad7830d don't checkout when cloning
we will subsequently do a submodule update with a possibly different
sha1 anyway.

Change-Id: I4950f3727e4263a73c32eff8460962d5796bc5f3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-02-06 06:24:06 +00:00
Oswald Buddenhagen
1ad0a17fa0 make manual fetching sane
it is in no way said that the remote's HEAD will contain the commit to
be checked out - in fact, it's pretty much guaranteed that it won't for
anything but the default branch. fetching the whole remote avoids
additional roundtrips and makes the --branch feature actually work
reasonably.

Change-Id: I20de2da848b12aea8c5b2784307fe9860252009b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-02-06 06:24:03 +00:00
Oswald Buddenhagen
d553fc4fa9 always check out the target branch when using --branch
a submodule update with --remote will use the tip of the remote's
branch, but it won't actually switch to the branch if HEAD doesn't point
to it yet.

Change-Id: If13e31da2646683dfb9e832eaab929190acb0167
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
2015-02-06 06:23:59 +00:00
Oswald Buddenhagen
b236ef6aef fix --branch without --no-update
clearly, i botched the syntax, but i can't even tell how. that's perl.
the new version is more readable anyway.

Change-Id: Ic3e93c2cf30ee92f368808070899af4b9f7809a3
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
2015-02-06 06:23:54 +00:00
Alex Blasche
f36d7e5d9b QtLocation doesn't depend on QtMultimedia anymore.
Change-Id: Id75a7fc591064639a38694149517924dd33b56fb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-04 06:15:03 +00:00
Qt Submodule Update Bot
81efb6de3c Updated submodules.
Change-Id: Ief1f126ddc66293b041fe5658d57056761eefe05
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-02-03 11:14:37 +00:00
Qt Submodule Update Bot
9347499e78 Updated submodules.
Change-Id: I25db2aa87f437c03d7929959c3e6d94d9fc0d541
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-01-29 09:13:14 +00:00
Qt Submodule Update Bot
ef1f126ddc Updated submodules.
Change-Id: I0163cb617aa19a26423a716bef23bfc6308aadc6
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-01-29 04:28:53 +00:00
Oswald Buddenhagen
c3a6185b7e Adjust submodule branches
Change-Id: I6f2358370d81238f462d26388d85aa5f74a8b455
2015-01-08 12:53:09 +01:00
Sean Harmer
6fd8d9ffd5 Qt3D depends upon qtimageformats module
Qt3D makes use of the webp image format in its examples to minimize
the size of assets. Support for webp is provided by qtimageformats.

Change-Id: Id70b584123dc6174848947029ee034593ccc42e0
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2014-12-30 13:24:35 +01:00
Qt Submodule Update Bot
0163cb617a Updated submodules.
Change-Id: I9ca0c5251312fbb7b83264eff28ef98287c7f70d
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-12-23 11:41:25 +01:00
Qt Submodule Update Bot
25db2aa87f Updated submodules.
Change-Id: Ia68a6b964f770fef3ea3d52f29d0c7a86186e80c
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-12-18 08:14:43 +01:00
Qt Submodule Update Bot
9ca0c52513 Updated submodules.
Change-Id: Ia68a6b964f770fef3ea3d52f29d0c7a86186e80c
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-12-15 08:29:57 +01:00
Oswald Buddenhagen
7943697cdd adjust submodule branch names for dev branch
Change-Id: I65ea644943aa345b8f0fd1d5fcdfccf8f86ed914
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2014-12-05 14:53:15 +01:00
Oswald Buddenhagen
028bfeeee3 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Ia8938b7bb2c0393c1799b64309c3cadc7293ad8e
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2014-12-05 14:51:59 +01:00
Alex Blasche
a22e673995 Revert "Skip not supported modules on wince."
The decision to exclude wince builds from Qt is one the modules
have to do and not the "build system". While there might be
justification to do this for some modules the decision is a module
decision and as such the individual modules should make it.

This reverts commit d870bd65b0.

Change-Id: I60fd9944a71968c819a27da91fdc58923bbbb776
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-12-05 14:50:34 +01:00
Qt Submodule Update Bot
3439140073 Updated submodules.
Change-Id: I1998742ceac59b50864ccec46a6c2f255871ab30
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-12-05 10:51:00 +01:00
Qt Submodule Update Bot
1998742cea Updated submodules.
Change-Id: Ib1885ea72539f3bd2df4d4131f0b164b02d4b59f
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-12-04 13:50:13 +01:00
Qt Submodule Update Bot
a68a6b964f Updated submodules.
Change-Id: I968f8a2a5ef20c47184d15b8f9e92a795176fcb2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-12-02 12:15:22 +01:00
Oswald Buddenhagen
663f814c24 adjust submodule branch names for 5.4 branch
Change-Id: I1621fee44becf1940d7d50a604fa8c91f3be78d9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-12-02 12:15:15 +01:00
Qt Submodule Update Bot
b1885ea725 Updated submodules.
Change-Id: I338ee26271c05b612fc58381270ca471db12aaef
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-27 06:41:45 +01:00
Oswald Buddenhagen
6040cb2ff5 Merge remote-tracking branch 'origin/5.4.0' into 5.4
Change-Id: I5b2910fc4e8fece8fad42eb200ed6dffdd24f751
2014-11-25 18:00:25 +01:00
Qt Submodule Update Bot
338ee26271 Updated submodules.
Change-Id: I77f387bc89c06d870b7d41516734ee3f1c68e71a
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-25 05:39:27 +01:00
Qt Submodule Update Bot
77f387bc89 Updated submodules.
Change-Id: I7c0bc2305680fac216bbaa72ac83f65b04feffff
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-21 09:26:31 +01:00
Qt Submodule Update Bot
968f8a2a5e Updated submodules.
Change-Id: Icafd720586cfe92d6e5773d553f6e70594f6c7dc
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-20 09:02:53 +01:00
Qt Submodule Update Bot
7c0bc23056 Updated submodules.
Change-Id: I4b199501287c5a5961405ae0667c04dc1188af44
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-20 07:00:26 +01:00
Qt Submodule Update Bot
4b19950128 Updated submodules.
Change-Id: I96d903eec0ee9d2fd76e1e3f1ebfd868ad937dbe
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-19 05:46:17 +01:00
Qt Submodule Update Bot
96d903eec0 Updated submodules.
Change-Id: Ie8053418e43127327f6df892ae774a1707a9ae97
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-12 22:35:27 +01:00
Oswald Buddenhagen
38cfc8ec95 don't fetch unless we are updating
it's just wasting time.

Change-Id: I541cc535c5c95b0140cfa14d7cb042dbe029525e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-11-12 10:49:16 +01:00
Kai Koehne
402bf7aec2 Fix cloning with mirrors
Commit 486f5f37761 broke the cloning with one of the mirror options:

git ls-remote git://mirror/qt/qtactiveqt.git.git test/if/mirror/exists
fatal: The remote end hung up unexpectedly

Change-Id: Ia154ee34dd10e35b24676777d8dde98ef0790ee1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-11-12 10:49:07 +01:00
Kai Koehne
8f35cb2886 Fix description of --mirror argument
The argument actually requires a trailing slash.

Change-Id: Idc2567746d2b3f4ebf31c2bce5ec683d2a1f425b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-11-12 10:48:54 +01:00
Oswald Buddenhagen
d5946d420f teach init-repository about branches
specifically, add the --branch option and the necessary keys to
.gitmodules.

Change-Id: I09e2df6bd012629f76a35238d66697637bdffe44
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-12 10:48:37 +01:00
Qt Submodule Update Bot
e8053418e4 Updated submodules.
Change-Id: I201b4c135a571bdf2621cbac03a9ab46a352b60f
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-10 06:41:19 +01:00
Qt Submodule Update Bot
cafd720586 Updated submodules.
Change-Id: I201b4c135a571bdf2621cbac03a9ab46a352b60f
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-07 12:28:28 +01:00
Qt Submodule Update Bot
201b4c135a Updated submodules.
Change-Id: Ica7018cd4f892d0b6938ab276305f6ae02dcc07b
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-04 08:00:22 +01:00
Jan Arve Saether
00a3c36bc1 Ignore alternate if its not a git repo
Don't just check if the submodule folder exist, since that doesn't
qualify it for being a valid git repo.

Change-Id: Ia3902714a0554908c0b8fd3228ed6fc2cfddd344
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-11-03 12:50:42 +01:00
Qt Submodule Update Bot
ca7018cd4f Updated submodules.
Change-Id: I00e3f00b799e15d95895f70887cf5b1b6d3bc372
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-11-03 07:59:03 +01:00
Qt Submodule Update Bot
00e3f00b79 Updated submodules.
Change-Id: Ia87766e218ab82cd1da216ea2cd023790fea6e8c
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-10-31 06:50:24 +01:00
Qt Submodule Update Bot
a87766e218 Updated submodules.
Change-Id: Ib54838f4a5c3ad05843c680252c45458a4572fb5
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-10-30 06:39:30 +01:00
Qt Submodule Update Bot
b54838f4a5 Updated submodules.
Change-Id: I18cc387deb811a2870842837353d6322511e1872
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-10-29 06:46:07 +01:00
Qt Submodule Update Bot
18cc387deb Updated submodules.
Change-Id: I86f7d9ce9873b5c6897e99763aba5765640ceba3
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-10-28 06:54:29 +01:00
Qt Submodule Update Bot
86f7d9ce98 Updated submodules.
Change-Id: I3f0739b279123e0a049d52da455f40ad1a20b4ab
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-10-23 17:46:28 +02:00
Bruno Coudoin
cd12d1f202 fix to let init-repository work on non english locale
This patch forces the C locale before calling 'git submodule'
in order to get the non localized string 'Entering' that we filter out.

Change-Id: I46d3770956a6b07e574ad15549bbb8942285b800
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-10-17 13:26:43 +02:00
Qt Submodule Update Bot
3f0739b279 Updated submodules.
Change-Id: Id8a40d65705b36a269accb68f7d82d7ee5fa925f
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-10-17 13:26:35 +02:00
Qt Submodule Update Bot
a17124e831 Updated submodules.
Change-Id: I869fce8a6bd6db20b58facdd2a476dacdf3b7d69
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-10-16 11:27:42 +02:00
Qt Submodule Update Bot
d8a40d6570 Updated submodules.
Change-Id: I2f80b640ab55f99b2379a41e6ce8c7df30f138a4
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-10-13 09:08:32 +02:00
Qt Submodule Update Bot
2f80b640ab Updated submodules.
Change-Id: Ib927255703d49def6c732f196a6265f6ed08a691
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-10-01 12:35:05 +02:00
Qt Submodule Update Bot
b927255703 Updated submodules.
Change-Id: I361f771ae66d1128f407992c228c1c76b0e69e4c
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-30 17:52:01 +02:00
Qt Submodule Update Bot
361f771ae6 Updated submodules.
Change-Id: Ie6af514f7185fc618f5093accedfb4f0937e5039
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-25 06:59:10 +02:00
Matti Paaso
d063e757b1 Adding qtquick1 and qtwayland also into submodule initialization
Without these components, src package creation fails in packaging.

Change-Id: I402c9c49642bccf821c3719206d1dea9415760c6
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Reviewed-by: Antti Kokko <antti.kokko@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-25 06:58:45 +02:00
Qt Submodule Update Bot
e6af514f71 Updated submodules.
Change-Id: Ib2e577904b850ea2ba3a8223688b05a21b4921f7
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-24 06:49:56 +02:00
Joerg Bornemann
597bb62d2b remove qtjsondb
It's dead, Jim.

Change-Id: Id8e1ddb266018bfd582af27bb7eb860287e4567c
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-23 20:29:32 +02:00
Oswald Buddenhagen
0af9ceef91 properly recurse submodule initialization
Change-Id: Icd438b9da9af0275dd508186a265bc211d9d01ce
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-23 20:29:12 +02:00
Oswald Buddenhagen
934651b766 don't unnecessarily initialize unwanted submodules
it wastes time and causes output noise.

Change-Id: Ifee01150293431b3c528f30a46280bd142e30b22
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-23 20:29:06 +02:00
Oswald Buddenhagen
836f00a76e don't uninit submodules before re-initing
git-submodule init will simply not touch the already initialized
submodules. this is just fine, as we'll overwrite the config entries
with our own urls (and remove the obsolete ones) afterwards anyway.

Change-Id: I6372bd48be9792e456899dc829226921990140c4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-23 20:29:04 +02:00
Oswald Buddenhagen
6ab23f16f5 keep information about default repos in .gitmodules
it's backwards to keep this in the script itself.

Change-Id: I4248ba3fef984bdff5d034cb2e6db6cae3209d68
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-23 20:29:02 +02:00
Oswald Buddenhagen
485f5f3776 don't pass around url unnecessarily
we now have everything we need to construct it on the fly.

Change-Id: I129e49bbcf46428d0fcef31ab8188df9d6a4026c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-23 20:29:01 +02:00
Oswald Buddenhagen
4553d9ec11 get submodule urls from .gitmodules
keeping a redundant copy in the script is plain backwards.

Change-Id: Ibdd1bab9d2cb5af7d7747d5caa2afc7d6e7571ad
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-23 20:28:59 +02:00
Oswald Buddenhagen
3ade7c4567 rewrite submodule exclusion logic
instead of doing multiple passes over the submodules, do everything in
one go.

as a bonus, as the internal structure uses exclusion entries in the
module list, we can make that feature user-accessible just as well.

Change-Id: I8bfb30c8051a9150f92e2e124ff52f64e3efe03c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-23 20:28:58 +02:00
Oswald Buddenhagen
93f173b3c5 nuke the --http option
it was a vestige from the times when the submodules had absolute urls
pointing at git://gitorious.org. as we now use relative urls, things
work just fine without that option.

Change-Id: I5e93ff8cd2497a27cfbdd53dbcf9db3cd0c4cd1d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-23 20:28:56 +02:00
Qt Submodule Update Bot
b2e577904b Updated submodules.
Change-Id: I919c0332ff9f5ad1979de3105721c2ba5aacf634
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-23 15:10:43 +02:00
Qt Submodule Update Bot
919c0332ff Updated submodules.
Change-Id: I1e275c54ea722d4f882cf329b65b749aa4d45fb2
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-15 17:09:26 +02:00
Qt Submodule Update Bot
869fce8a6b Updated submodules.
Change-Id: Ie3a3e5d05bb46e1f80d1c83d4d3c564040a6ae14
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-12 20:16:37 +02:00
Qt Submodule Update Bot
1e275c54ea Updated submodules.
Change-Id: I5fdb4490cb85b3470bdbd81de9dccbe6bcb96460
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-11 16:30:52 +02:00
Jocelyn Turcotte
1ae0689829 init-repository: Support cases where $submodule/.git is a file
Since git 1.7.8 the $GIT_DIR of the submodule can be a reference to the
super-module's $GIT_DIR/modules/<name>/

Test for existence instead of testing for a directory before attempting
a git clone there.

Change-Id: Ic539e770067da1417a2ad374c21253212473abe6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-10 18:24:13 +02:00
Qt Submodule Update Bot
5fdb4490cb Updated submodules.
Change-Id: I74d7cf7e426ba4e1aa640ac986fbbe52d1e82897
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-07 16:17:49 +02:00
Qt Submodule Update Bot
74d7cf7e42 Updated submodules.
Change-Id: If16e291eea490110a9749b65fa4d21988376755a
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-04 11:16:45 +02:00
Qt Submodule Update Bot
e3a3e5d05b Updated submodules.
Change-Id: Ie073b25926d4c538cb9f41d4c59d171857a60ede
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-02 20:36:04 +02:00
Qt Submodule Update Bot
f16e291eea Updated submodules.
Change-Id: Iaa47c338f81e080e1fde4501e72ee48c9330e1be
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-02 20:34:14 +02:00
Qt Submodule Update Bot
aa47c338f8 Updated submodules.
Change-Id: I2159de889d951926d780041338d948f4a1281aa3
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-01 17:06:23 +02:00
Qt Submodule Update Bot
2159de889d Updated submodules.
Change-Id: Ifefebb996cc9dcb2cc2b06f57315a4a679f96420
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-08-31 14:59:32 +02:00
Qt Submodule Update Bot
fefebb996c Updated submodules.
Change-Id: I2c3556629bab77b013eabcf6535512e902837e40
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-30 05:11:09 +02:00
Jani Heikkinen
59c32b2db8 Updated license files in Qt5
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I49f5a4bf3481d6cd712301092f5f20a5dac470cf
Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-08-30 05:10:46 +02:00
Frederik Gladhorn
22e5c8ce25 Add qtwebengine as submodule
qtwebkit is listed as an optional dependency for
qtwebengine to ensure that qtwebkit and qtwebengine
are not linked in parallel on the CI system.
Otherwise we could run out of memory.

Change-Id: Ib80d72407df03037c928d99f55c8e04e98e506d9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
2014-08-29 14:28:35 +02:00
Bjoern Breitmeyer
d870bd65b0 Skip not supported modules on wince.
Change-Id: I6ac73c759453813718c6d96c7d6cb27bcbf9815b
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-08-28 08:34:39 +02:00
Qt Submodule Update Bot
2c3556629b Updated submodules.
Change-Id: Ie073b25926d4c538cb9f41d4c59d171857a60ede
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-27 20:33:00 +02:00
Frederik Gladhorn
64b0e38032 Add QtWayland to default checkout
QtWayland is going to be released with Qt 5.4.

Change-Id: I9a9bead92c6c34324510007ad844c9fdf633690d
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-08-20 12:56:30 +02:00
Milian Wolff
be6de20889 Add QtWebChannel as optional dependency of QtWebKit.
This is required to prepare the merge of the integration patch.
The QtWebChannel and QtWebSockets lines in qt.pro are moved such
that they occur before their first use in QtWebKit.

Change-Id: Ie8137da57827776fe7b1434538df6b08108b0349
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-08-15 09:03:39 +02:00
Jocelyn Turcotte
633051d095 init-repository: Support submodules more than one dir deep
Change-Id: I8783ded72032dda42bc24a855e190e0a2e699b01
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-08-15 09:03:24 +02:00
Jocelyn Turcotte
ce45f45dfb init-repository: Make sure that we update a submodule before we recurse
Unless we do so, doing git submodule init in a submodule would use the
currently checked out version of its .gitmodule instead of the one of
its pinned SHA1.

Change-Id: I88de421c8d24748dcaa5334c82da2aac4b12b2ad
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
2014-08-15 09:03:16 +02:00
Jocelyn Turcotte
8801fd0258 Let init-repository build the mirror URL from the original URL
This allows repositories that have a different submodule name than their
URL file part to be using the mirror.

i.e. qtwebengine's src/3rdparty mapped to .../qt/qtwebengine-chromium.git

Change-Id: Ibea9cb9db701c95fc6f8b0e2457de74823aeeba5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-08-15 09:02:58 +02:00
Frederik Gladhorn
48cd6bb500 Build Wayland on Linux (except Android)
Change-Id: Ief1276f88837885637d0e60c90c4713bd12f6c85
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-08-14 14:25:13 +02:00
Andras Becsi
ed9a5c8a62 initialize qtwebengine's chromium submodule after cloning it
Change-Id: I7e3ef09eb437f700c6fe010ce44a711118e8bd75
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-08-12 16:03:32 +02:00
Frederik Gladhorn
9677483cdc Add qtwebchannel as submodule
This also updates the qtwebsockets revision since
that's needed to compile.

Change-Id: I9f3564c78d08abdca73ce395f31b3031a829e502
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2014-08-08 19:50:01 +02:00
Qt Submodule Update Bot
e073b25926 Updated submodules.
Change-Id: I6ccb1f47aa3f394d6e2e80ffcd0dada345d1fea1
Reviewed-by: Antti Kokko <antti.kokko@digia.com>
2014-08-08 07:48:56 +02:00
Qt Submodule Update Bot
6ccb1f47aa Updated submodules.
Change-Id: I091f46c34c950237bdd5054367b5c26e4c291fad
Reviewed-by: Antti Kokko <antti.kokko@digia.com>
2014-08-01 07:44:21 +02:00
Qt Submodule Update Bot
091f46c34c Updated submodules.
Change-Id: Iffab81d96aa4e91c14fe3ff888dd4323092a261e
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-07-30 08:04:43 +02:00
Alex Blasche
f81391639e Remove jsondb from qtpim dependency list
Change-Id: Icf05e7857b02db74c7309d796be7ef259cf83e37
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-06-18 16:23:26 +02:00
Qt Submodule Update Bot
ffab81d96a Updated submodules.
Change-Id: If4479c349b595d28e0dd4985259d7d1ed00bb966
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-06-17 22:54:51 +02:00
Sergio Ahumada
892e391cb0 Updated submodules.
Change-Id: I000a16c22c4c3dc7d0e02aeb370454f386bb09f1
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-06-04 09:56:56 +02:00
Sergio Ahumada
7368b4b1e3 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ib1694808847f26576cc3c7780bd1c6d3689a8a26
2014-05-26 15:44:48 +02:00
Qt Submodule Update Bot
afd8acb9dc Updated submodules.
Change-Id: I9b93bd0fa9b5011b27ab351ed143e6ada2ee643b
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-04-09 07:07:13 +02:00
Qt Submodule Update Bot
9b93bd0fa9 Updated submodules.
Change-Id: I2c06e806a22480919b27133b080281cad06ebf26
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-04 10:53:08 +02:00
Alex Blasche
60f5070d97 Remove qt3d from qtlocation's dependency list
QtLocation no longer depends on Qt3D.

Change-Id: I0418dcc93a97722948bddcdd4f754914d7eaa019
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-04-02 12:12:44 +02:00
Qt Submodule Update Bot
2c06e806a2 Updated submodules.
Change-Id: Ib2385231c40547a3d6de2acaad978a2f5700ed36
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-04-02 06:54:36 +02:00
126 changed files with 12935 additions and 51911 deletions

View File

@@ -14,7 +14,7 @@
#
# ==[ Please wrap at 72 characters ]===================================|
#
# Remember to read http://wiki.qt-project.org/Commit_Policy
# Remember to read http://wiki.qt.io/Commit_Policy
#
# Change log entry: If this commit adds a significant feature, fixes an
# issue or contains a behavior change that is relevant to others,

82
.gitmodules vendored
View File

@@ -1,105 +1,181 @@
[submodule "qtbase"]
path = qtbase
url = ../qtbase.git
branch = 5.5
initrepo = true
[submodule "qtsvg"]
path = qtsvg
url = ../qtsvg.git
branch = 5.5
initrepo = true
[submodule "qtdeclarative"]
path = qtdeclarative
url = ../qtdeclarative.git
branch = 5.5
initrepo = true
[submodule "qtactiveqt"]
path = qtactiveqt
url = ../qtactiveqt.git
branch = 5.5
initrepo = true
[submodule "qtscript"]
path = qtscript
url = ../qtscript.git
branch = 5.5
initrepo = true
[submodule "qtmultimedia"]
path = qtmultimedia
url = ../qtmultimedia.git
branch = 5.5
initrepo = true
[submodule "qttools"]
path = qttools
url = ../qttools.git
branch = 5.5
initrepo = true
[submodule "qtxmlpatterns"]
path = qtxmlpatterns
url = ../qtxmlpatterns.git
branch = 5.5
initrepo = true
[submodule "qttranslations"]
path = qttranslations
url = ../qttranslations.git
branch = 5.5
initrepo = true
[submodule "qtdoc"]
path = qtdoc
url = ../qtdoc.git
branch = 5.5
initrepo = true
[submodule "qtrepotools"]
path = qtrepotools
url = ../qtrepotools.git
branch = master
initrepo = true
[submodule "qtwebkit"]
path = qtwebkit
url = ../qtwebkit.git
branch = 5.5
initrepo = true
[submodule "qtwebkit-examples"]
path = qtwebkit-examples
url = ../qtwebkit-examples.git
branch = 5.5
initrepo = true
[submodule "qtqa"]
path = qtqa
url = ../qtqa.git
branch = master
initrepo = true
[submodule "qtlocation"]
path = qtlocation
url = ../qtlocation.git
branch = 5.5
initrepo = true
[submodule "qtsensors"]
path = qtsensors
url = ../qtsensors.git
branch = 5.5
initrepo = true
[submodule "qtsystems"]
path = qtsystems
url = ../qtsystems.git
branch = dev
[submodule "qtfeedback"]
path = qtfeedback
url = ../qtfeedback.git
branch = master
[submodule "qtdocgallery"]
path = qtdocgallery
url = ../qtdocgallery.git
branch = master
[submodule "qtpim"]
path = qtpim
url = ../qtpim.git
branch = dev
[submodule "qtconnectivity"]
path = qtconnectivity
url = ../qtconnectivity.git
branch = 5.5
initrepo = true
[submodule "qtwayland"]
path = qtwayland
url = ../qtwayland.git
[submodule "qtjsondb"]
path = qtjsondb
url = ../qtjsondb.git
branch = 5.5
initrepo = true
[submodule "qt3d"]
path = qt3d
url = ../qt3d.git
branch = 5.5
initrepo = true
[submodule "qtimageformats"]
path = qtimageformats
url = ../qtimageformats.git
branch = 5.5
initrepo = true
[submodule "qtquick1"]
path = qtquick1
url = ../qtquick1.git
branch = 5.5
initrepo = true
[submodule "qtgraphicaleffects"]
path = qtgraphicaleffects
url = ../qtgraphicaleffects.git
branch = 5.5
initrepo = true
[submodule "qtquickcontrols"]
path = qtquickcontrols
url = ../qtquickcontrols.git
branch = 5.5
initrepo = true
[submodule "qtserialport"]
path = qtserialport
url = ../qtserialport.git
branch = 5.5
initrepo = true
[submodule "qtx11extras"]
path = qtx11extras
url = ../qtx11extras.git
branch = 5.5
initrepo = true
[submodule "qtmacextras"]
path = qtmacextras
url = ../qtmacextras.git
branch = 5.5
initrepo = true
[submodule "qtwinextras"]
path = qtwinextras
url = ../qtwinextras.git
branch = 5.5
initrepo = true
[submodule "qtandroidextras"]
path = qtandroidextras
url = ../qtandroidextras.git
branch = 5.5
initrepo = true
[submodule "qtenginio"]
path = qtenginio
url = ../qtenginio.git
branch = 1.2
initrepo = true
[submodule "qtwebsockets"]
path = qtwebsockets
url = ../qtwebsockets.git
branch = 5.5
initrepo = true
[submodule "qtwebchannel"]
path = qtwebchannel
url = ../qtwebchannel.git
branch = 5.5
initrepo = true
[submodule "qtwebengine"]
path = qtwebengine
url = ../qtwebengine.git
branch = 5.5
initrepo = true
[submodule "qtcanvas3d"]
path = qtcanvas3d
url = ../qtcanvas3d.git
branch = 5.5
initrepo = true

View File

@@ -1,4 +1,4 @@
Digia Qt LGPL Exception version 1.1
The Qt Company Qt LGPL Exception version 1.1
As an additional permission to the GNU Lesser General Public License version
2.1, the object code form of a "work that uses the Library" may incorporate

292
LICENSE.GPLv2 Normal file
View File

@@ -0,0 +1,292 @@
GNU GENERAL PUBLIC LICENSE
The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
You may use, distribute and copy the Qt GUI Toolkit under the terms of
GNU General Public License version 2, which is displayed below.
-------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom
to share and change it. By contrast, the GNU General Public License is
intended to guarantee your freedom to share and change free software
--to make sure the software is free for all its users. This General
Public License applies to most of the Free Software Foundation's
software and to any other program whose authors commit to using it.
(Some other Free Software Foundation software is covered by the GNU
Lesser General Public License instead.) You can apply it to your
programs, too.
When we speak of free software, we are referring to freedom, not price.
Our General Public Licenses are designed to make sure that you have the
freedom to distribute copies of free software (and charge for this
service if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone
to deny you these rights or to ask you to surrender the rights. These
restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis
or for a fee, you must give the recipients all the rights that you
have. You must make sure that they, too, receive or can get the source
code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software patents.
We wish to avoid the danger that redistributors of a free program will
individually obtain patent licenses, in effect making the program
proprietary. To prevent this, we have made it clear that any patent
must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a
notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of running
the Program is not restricted, and the output from the Program is
covered only if its contents constitute a work based on the Program
(independent of having been made by running the Program). Whether that
is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously
and appropriately publish on each copy an appropriate copyright notice
and disclaimer of warranty; keep intact all the notices that refer to
this License and to the absence of any warranty; and give any other
recipients of the Program a copy of this License along with the
Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of
it, thus forming a work based on the Program, and copy and distribute
such modifications or work under the terms of Section 1 above, provided
that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but does
not normally print such an announcement, your work based on the
Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of a
storage or distribution medium does not bring the other work under the
scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software
interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your cost
of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to control
compilation and installation of the executable. However, as a special
exception, the source code distributed need not include anything that
is normally distributed (in either source or binary form) with the
major components (compiler, kernel, and so on) of the operating system
on which the executable runs, unless that component itself accompanies
the executable.
If distribution of executable or object code is made by offering access
to copy from a designated place, then offering equivalent access to
copy the source code from the same place counts as distribution of the
source code, even though third parties are not compelled to copy the
source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt otherwise
to copy, modify, sublicense or distribute the Program is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this License
will not have their licenses terminated so long as such parties remain
in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further restrictions
on the recipients' exercise of the rights granted herein. You are not
responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent license
would not permit royalty-free redistribution of the Program by all
those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain
entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License may
add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among countries
not thus excluded. In such case, this License incorporates the limitation
as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail
to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Program does not specify a version
number of this License, you may choose any version ever published by
the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the
author to ask for permission. For software which is copyrighted by
the Free Software Foundation, write to the Free Software Foundation;
we sometimes make exceptions for this. Our decision will be guided by
the two goals of preserving the free status of all derivatives of our
free software and of promoting the sharing and reuse of software
generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE
TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS

View File

@@ -1,3 +1,15 @@
GNU GENERAL PUBLIC LICENSE
The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
You may use, distribute and copy the Qt GUI Toolkit under the terms of
GNU Lesser General Public License version 3. That license references
the General Public License version 3, that is displayed below. Other
portions of the Qt Toolkit may be licensed directly under this license.
-------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

View File

@@ -1,15 +1,15 @@
GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
The Qt Toolkit is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt-project.org/legal
The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
You may use, distribute and copy the Qt GUI Toolkit under the terms of
GNU Lesser General Public License version 2.1, which is displayed below.
-------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -20,7 +20,7 @@
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -122,8 +122,8 @@ modification follow. Pay close attention to the difference between a
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
@@ -156,7 +156,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
@@ -442,7 +442,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@@ -465,7 +465,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries

175
LICENSE.LGPLv3 Normal file
View File

@@ -0,0 +1,175 @@
GNU LESSER GENERAL PUBLIC LICENSE
The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
You may use, distribute and copy the Qt GUI Toolkit under the terms of
GNU Lesser General Public License version 3, which is displayed below.
This license makes reference to the version 3 of the GNU General
Public License, which you can find in the LICENSE.GPLv3 file.
-------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
licensedocument, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, “this License” refers to version 3 of the GNU Lesser
General Public License, and the “GNU GPL” refers to version 3 of the
GNU General Public License.
“The Library” refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An “Application” is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A “Combined Work” is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the “Linked
Version”.
The “Minimal Corresponding Source” for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The “Corresponding Application Code” for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort
to ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this
license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken
together, effectively do not restrict modification of the portions of
the Library contained in the Combined Work and reverse engineering for
debugging such modifications, if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this
license document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of
this License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with
the Library. A suitable mechanism is one that (a) uses at run
time a copy of the Library already present on the user's
computer system, and (b) will operate properly with a modified
version of the Library that is interface-compatible with the
Linked Version.
e) Provide Installation Information, but only if you would
otherwise be required to provide such information under section 6
of the GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option
4d0, the Installation Information must accompany the Minimal
Corresponding Source and Corresponding Application Code. If you
use option 4d1, you must provide the Installation Information in
the manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library
side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities, conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of
it is a work based on the Library, and explaining where to find
the accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
as you received it specifies that a certain numbered version of the
GNU Lesser General Public License “or any later version” applies to
it, you have the option of following the terms and conditions either
of that published version or of any later version published by the
Free Software Foundation. If the Library as you received it does not
specify a version number of the GNU Lesser General Public License,
you may choose any version of the GNU Lesser General Public License
ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the Library.

8
README
View File

@@ -14,7 +14,7 @@ HOW TO BUILD QT5
For other platform specific requirements,
please see section "Setting up your machine" on:
http://qt-project.org/wiki/Get_The_Source
http://wiki.qt.io/Get_The_Source
Optional requirements
---------------------
@@ -119,9 +119,9 @@ HOW TO BUILD QT5
Building Qt5 from git
=====================
See http://qt-project.org/wiki/Building-Qt-5-from-Git and README.git
See http://wiki.qt.io/Building_Qt_5_from_Git and README.git
for more information.
See http://qt-project.org/wiki/Qt-5 for the reference platforms.
See http://wiki.qt.io/Qt_5 for the reference platforms.
Documentation
@@ -139,6 +139,6 @@ HOW TO BUILD QT5
Running "qmake -query" will list the value of QT_INSTALL_DOCS.
Information about Qt 5's documentation is located in qtbase/doc/README
or in the following page: http://qt-project.org/wiki/Qt5DocumentationProject
or in the following page: http://wiki.qt.io/Qt5DocumentationProject
Note: Building the documentation is only tested on desktop platforms.

View File

@@ -5,7 +5,7 @@ OBTAINING QT5 FROM GIT
========
For a more in-depth description on how to build Qt5 from git,
please see: http://qt-project.org/wiki/Building-Qt-5-from-Git
please see: http://wiki.qt.io/Building_Qt_5_from_Git
Get The Submodules
@@ -52,4 +52,4 @@ OBTAINING QT5 FROM GIT
================================
For more information on how to develop and contribute to Qt, please see:
http://qt-project.org/wiki/Category:Developing_Qt
http://wiki.qt.io/Category:Developing_Qt

36
configure vendored
View File

@@ -1,41 +1,33 @@
#! /bin/sh
#############################################################################
##
## Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
## Copyright (C) 2015 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the build tools of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## $QT_BEGIN_LICENSE:LGPL21$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
## a written agreement between you and The Qt Company. For licensing terms
## and conditions see http://www.qt.io/terms-conditions. For further
## information use the contact form at http://www.qt.io/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
## General Public License version 2.1 or version 3 as published by the Free
## Software Foundation and appearing in the file LICENSE.LGPLv21 and
## LICENSE.LGPLv3 included in the packaging of this file. Please review the
## following information to ensure the GNU Lesser General Public License
## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## As a special exception, The Qt Company gives you certain additional
## rights. These rights are described in The Qt Company LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
## GNU General Public License Usage
## Alternatively, this file may be used under the terms of the GNU
## General Public License version 3.0 as published by the Free Software
## Foundation and appearing in the file LICENSE.GPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU General Public License version 3.0 requirements will be
## met: http://www.gnu.org/copyleft/gpl.html.
##
##
## $QT_END_LICENSE$
##
#############################################################################

View File

@@ -1,41 +1,33 @@
@echo off
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
:: Contact: http://www.qt-project.org/legal
:: Copyright (C) 2015 The Qt Company Ltd.
:: Contact: http://www.qt.io/licensing/
::
:: This file is part of the tools applications of the Qt Toolkit.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: $QT_BEGIN_LICENSE:LGPL21$
:: Commercial License Usage
:: Licensees holding valid commercial Qt licenses may use this file in
:: accordance with the commercial license agreement provided with the
:: Software or, alternatively, in accordance with the terms contained in
:: a written agreement between you and Digia. For licensing terms and
:: conditions see http://qt.digia.com/licensing. For further information
:: use the contact form at http://qt.digia.com/contact-us.
:: a written agreement between you and The Qt Company. For licensing terms
:: and conditions see http://www.qt.io/terms-conditions. For further
:: information use the contact form at http://www.qt.io/contact-us.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file. Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
:: General Public License version 2.1 or version 3 as published by the Free
:: Software Foundation and appearing in the file LICENSE.LGPLv21 and
:: LICENSE.LGPLv3 included in the packaging of this file. Please review the
:: following information to ensure the GNU Lesser General Public License
:: requirements will be met: https://www.gnu.org/licenses/lgpl.html and
:: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Digia gives you certain additional
:: rights. These rights are described in the Digia Qt LGPL Exception
:: As a special exception, The Qt Company gives you certain additional
:: rights. These rights are described in The Qt Company LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: GNU General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU
:: General Public License version 3.0 as published by the Free Software
:: Foundation and appearing in the file LICENSE.GPL included in the
:: packaging of this file. Please review the following information to
:: ensure the GNU General Public License version 3.0 requirements will be
:: met: http://www.gnu.org/copyleft/gpl.html.
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

BIN
gnuwin32/bin/bison.exe Normal file → Executable file

Binary file not shown.

View File

@@ -1,2 +0,0 @@
#! /bin/sh
exec 'c:/progra~1/bison/bin/bison' -y "$@"

View File

@@ -27,7 +27,7 @@ Currently, the supported skeletons are:
These skeletons are the only ones supported by the Bison team.
Because the interface between skeletons and the bison program is not
finished, *we are not bound to it*. In particular, Bison is not
mature enough for us to consider that ``foreign skeletons'' are
mature enough for us to consider that "foreign skeletons" are
supported.
* m4sugar
@@ -52,7 +52,7 @@ into various formats.
-----
Copyright (C) 2002, 2008 Free Software Foundation, Inc.
Copyright (C) 2002, 2008-2013 Free Software Foundation, Inc.
This file is part of GNU Bison.

1063
gnuwin32/bin/data/bison.m4 Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
-*- Autoconf -*-
# C++ skeleton dispatching for Bison.
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
# Copyright (C) 2006-2007, 2009-2013 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

544
gnuwin32/bin/data/c++.m4 Normal file
View File

@@ -0,0 +1,544 @@
-*- Autoconf -*-
# C++ skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_include(b4_pkgdatadir/[c.m4])
# b4_comment(TEXT, [PREFIX])
# --------------------------
# Put TEXT in comment. Prefix all the output lines with PREFIX.
m4_define([b4_comment],
[b4_comment_([$1], [$2// ], [$2// ])])
## -------- ##
## Checks. ##
## -------- ##
b4_percent_define_check_kind([api.namespace], [code], [deprecated])
b4_percent_define_check_kind([parser_class_name], [code], [deprecated])
## ---------------- ##
## Default values. ##
## ---------------- ##
b4_percent_define_default([[parser_class_name]], [[parser]])
# Don't do that so that we remember whether we're using a user
# request, or the default value.
#
# b4_percent_define_default([[api.location.type]], [[location]])
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([[global_tokens_and_yystype]], [[false]])
b4_percent_define_default([[define_location_comparison]],
[m4_if(b4_percent_define_get([[filename_type]]),
[std::string], [[true]], [[false]])])
## ----------- ##
## Namespace. ##
## ----------- ##
m4_define([b4_namespace_ref], [b4_percent_define_get([[api.namespace]])])
# Don't permit an empty b4_namespace_ref. Any '::parser::foo' appended to it
# would compile as an absolute reference with 'parser' in the global namespace.
# b4_namespace_open would open an anonymous namespace and thus establish
# internal linkage. This would compile. However, it's cryptic, and internal
# linkage for the parser would be specified in all translation units that
# include the header, which is always generated. If we ever need to permit
# internal linkage somehow, surely we can find a cleaner approach.
m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
[[namespace reference is empty]])])
# Instead of assuming the C++ compiler will do it, Bison should reject any
# invalid b4_namepsace_ref that would be converted to a valid
# b4_namespace_open. The problem is that Bison doesn't always output
# b4_namespace_ref to uncommented code but should reserve the ability to do so
# in future releases without risking breaking any existing user grammars.
# Specifically, don't allow empty names as b4_namespace_open would just convert
# those into anonymous namespaces, and that might tempt some users.
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [],
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
[[namespace reference has consecutive "::"]])])
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [],
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
[[namespace reference has a trailing "::"]])])
m4_define([b4_namespace_open],
[b4_user_code([b4_percent_define_get_syncline([[api.namespace]])
[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
[^\(.\)[ ]*::], [\1])),
[::], [ { namespace ])[ {]])])
m4_define([b4_namespace_close],
[b4_user_code([b4_percent_define_get_syncline([[api.namespace]])
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]),
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*],
[\1])),
[::\([^][:]\|:[^:]\)*], [} ])[} // ]b4_namespace_ref])])
# b4_token_enums
# --------------
# Output the definition of the tokens as enums.
m4_define([b4_token_enums],
[[enum yytokentype
{
]m4_join([,
],
b4_symbol_map([b4_token_enum]))[
};]dnl
])
## ----------------- ##
## Semantic Values. ##
## ----------------- ##
# b4_value_type_declare
# ---------------------
# Declare semantic_type.
m4_define([b4_value_type_declare],
[b4_value_type_setup[]dnl
[ /// Symbol semantic values.
]m4_bmatch(b4_percent_define_get_kind([[api.value.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_union_members[
};]])])dnl
])
# b4_public_types_declare
# -----------------------
# Define the public types: token, semantic value, location, and so forth.
# Depending on %define token_lex, may be output in the header or source file.
m4_define([b4_public_types_declare],
[[#ifndef ]b4_api_PREFIX[STYPE
]b4_value_type_declare[
#else
typedef ]b4_api_PREFIX[STYPE semantic_type;
#endif]b4_locations_if([
/// Symbol locations.
typedef b4_percent_define_get([[api.location.type]],
[[location]]) location_type;])[
/// Syntax errors thrown from user actions.
struct syntax_error : std::runtime_error
{
syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m);]b4_locations_if([
location_type location;])[
};
/// Tokens.
struct token
{
]b4_token_enums[
};
/// (External) token type, as returned by yylex.
typedef token::yytokentype token_type;
/// Internal symbol number.
typedef int symbol_number_type;
/// Internal symbol number for tokens (subsumed by symbol_number_type).
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
/// A complete symbol.
///
/// Expects its Base type to provide access to the symbol type
/// via type_get().
///
/// Provide access to semantic value]b4_locations_if([ and location])[.
template <typename Base>
struct basic_symbol : Base
{
/// Alias to Base.
typedef Base super_type;
/// Default constructor.
basic_symbol ();
/// Copy constructor.
basic_symbol (const basic_symbol& other);
]b4_variant_if([[
/// Constructor for valueless symbols, and symbols from each type.
]b4_type_foreach([b4_basic_symbol_constructor_declare])], [[
/// Constructor for valueless symbols.
basic_symbol (typename Base::kind_type t]b4_locations_if([,
const location_type& l])[);]])[
/// Constructor for symbols with semantic value.
basic_symbol (typename Base::kind_type t,
const semantic_type& v]b4_locations_if([,
const location_type& l])[);
~basic_symbol ();
/// Destructive move, \a s is emptied into this.
void move (basic_symbol& s);
/// The semantic value.
semantic_type value;]b4_locations_if([
/// The location.
location_type location;])[
private:
/// Assignment operator.
basic_symbol& operator= (const basic_symbol& other);
};
/// Type access provider for token (enum) based symbols.
struct by_type
{
/// Default constructor.
by_type ();
/// Copy constructor.
by_type (const by_type& other);
/// The symbol type as needed by the constructor.
typedef token_type kind_type;
/// Constructor from (external) token numbers.
by_type (kind_type t);
/// Steal the symbol type from \a that.
void move (by_type& that);
/// The (internal) type number (corresponding to \a type).
/// -1 when this symbol is empty.
symbol_number_type type_get () const;
/// The token.
token_type token () const;
enum { empty = 0 };
/// The symbol type.
/// -1 when this symbol is empty.
token_number_type type;
};
/// "External" symbols: returned by the scanner.
typedef basic_symbol<by_type> symbol_type;
]b4_symbol_constructor_declare])
# b4_public_types_define
# ----------------------
# Provide the implementation needed by the public types.
m4_define([b4_public_types_define],
[[ inline
]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([
, location (l)])[
{}
// basic_symbol.
template <typename Base>
inline
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
: value ()
{}
template <typename Base>
inline
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const basic_symbol& other)
: Base (other)
, value ()]b4_locations_if([
, location (other.location)])[
{
]b4_variant_if([b4_symbol_variant([other.type_get ()], [value], [copy],
[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([[
// Implementation of basic_symbol constructor for each type.
]b4_type_foreach([b4_basic_symbol_constructor_define])], [[
/// Constructor for valueless symbols.
template <typename Base>
inline
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
[typename Base::kind_type t],
b4_locations_if([const location_type& l]))[)
: Base (t)
, value ()]b4_locations_if([
, location (l)])[
{}]])[
template <typename Base>
inline
]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol ()
{]b4_variant_if([[
// User destructor.
symbol_number_type yytype = this->type_get ();
switch (yytype)
{
]b4_symbol_foreach([b4_symbol_destructor])dnl
[ default:
break;
}
// Type destructor.
]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[
}
template <typename Base>
inline
void
]b4_parser_class_name[::basic_symbol<Base>::move (basic_symbol& s)
{
super_type::move(s);
]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [move],
[s.value])],
[value = s.value;])[]b4_locations_if([
location = s.location;])[
}
// by_type.
inline
]b4_parser_class_name[::by_type::by_type ()
: type (empty)
{}
inline
]b4_parser_class_name[::by_type::by_type (const by_type& other)
: type (other.type)
{}
inline
]b4_parser_class_name[::by_type::by_type (token_type t)
: type (yytranslate_ (t))
{}
inline
void
]b4_parser_class_name[::by_type::move (by_type& that)
{
type = that.type;
that.type = empty;
}
inline
int
]b4_parser_class_name[::by_type::type_get () const
{
return type;
}
]b4_token_ctor_if([[
inline
]b4_parser_class_name[::token_type
]b4_parser_class_name[::by_type::token () const
{
// YYTOKNUM[NUM] -- (External) token number corresponding to the
// (internal) symbol number NUM (which must be that of a token). */
static
const ]b4_int_type_for([b4_toknum])[
yytoken_number_[] =
{
]b4_toknum[
};
return static_cast<token_type> (yytoken_number_[type]);
}
]])[]dnl
b4_symbol_constructor_define])
# b4_symbol_constructor_declare
# b4_symbol_constructor_define
# -----------------------------
# Declare/define symbol constructors for all the value types.
# Use at class-level. Redefined in variant.hh.
m4_define([b4_symbol_constructor_declare], [])
m4_define([b4_symbol_constructor_define], [])
# b4_yytranslate_define
# ---------------------
# Define yytranslate_. Sometimes used in the header file,
# sometimes in the cc file.
m4_define([b4_yytranslate_define],
[[ // Symbol number corresponding to token number t.
inline
]b4_parser_class_name[::token_number_type
]b4_parser_class_name[::yytranslate_ (]b4_token_ctor_if([token_type],
[int])[ t)
{
static
const token_number_type
translate_table[] =
{
]b4_translate[
};
const unsigned int user_token_number_max_ = ]b4_user_token_number_max[;
const token_number_type undef_token_ = ]b4_undef_token_number[;
if (static_cast<int>(t) <= yyeof_)
return yyeof_;
else if (static_cast<unsigned int> (t) <= user_token_number_max_)
return translate_table[t];
else
return undef_token_;
}
]])
# b4_lhs_value([TYPE])
# --------------------
# Expansion of $<TYPE>$.
m4_define([b4_lhs_value],
[b4_symbol_value([yyval], [$1])])
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
# --------------------------------------
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
# symbols on RHS.
m4_define([b4_rhs_value],
[b4_symbol_value([yysemantic_stack_@{($1) - ($2)@}], [$3])])
# b4_lhs_location()
# -----------------
# Expansion of @$.
m4_define([b4_lhs_location],
[(yyloc)])
# b4_rhs_location(RULE-LENGTH, NUM)
# ---------------------------------
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
# on RHS.
m4_define([b4_rhs_location],
[(yylocation_stack_@{($1) - ($2)@})])
# b4_parse_param_decl
# -------------------
# Extra formal arguments of the constructor.
# Change the parameter names from "foo" into "foo_yyarg", so that
# there is no collision bw the user chosen attribute name, and the
# argument name in the constructor.
m4_define([b4_parse_param_decl],
[m4_ifset([b4_parse_param],
[m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
m4_define([b4_parse_param_decl_1],
[$1_yyarg])
# b4_parse_param_cons
# -------------------
# Extra initialisations of the constructor.
m4_define([b4_parse_param_cons],
[m4_ifset([b4_parse_param],
[
b4_cc_constructor_calls(b4_parse_param)])])
m4_define([b4_cc_constructor_calls],
[m4_map_sep([b4_cc_constructor_call], [,
], [$@])])
m4_define([b4_cc_constructor_call],
[$2 ($2_yyarg)])
# b4_parse_param_vars
# -------------------
# Extra instance variables.
m4_define([b4_parse_param_vars],
[m4_ifset([b4_parse_param],
[
// User arguments.
b4_cc_var_decls(b4_parse_param)])])
m4_define([b4_cc_var_decls],
[m4_map_sep([b4_cc_var_decl], [
], [$@])])
m4_define([b4_cc_var_decl],
[ $1;])
## ---------##
## Values. ##
## ---------##
# b4_yylloc_default_define
# ------------------------
# Define YYLLOC_DEFAULT.
m4_define([b4_yylloc_default_define],
[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
# ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
(Current).end = YYRHSLOC (Rhs, N).end; \
} \
else \
{ \
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
} \
while (/*CONSTCOND*/ false)
# endif
]])
## -------- ##
## 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]))])])

View File

@@ -0,0 +1,65 @@
-*- Autoconf -*-
# Common code for C-like languages (C, C++, Java, etc.)
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# b4_comment_(TEXT, OPEN, CONTINUE, END)
# --------------------------------------
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
# Avoid adding indentation to the first line, as the indentation comes
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
#
# Prefix all the output lines with PREFIX.
m4_define([b4_comment_],
[$2[]m4_bpatsubst(m4_expand([[$1]]), [
\(.\)], [
$3\1])$4])
# b4_comment(TEXT, [PREFIX])
# --------------------------
# Put TEXT in comment. Prefix all the output lines with PREFIX.
m4_define([b4_comment],
[b4_comment_([$1], [$2/* ], [$2 ], [ */])])
# b4_dollar_dollar_(VALUE, FIELD, DEFAULT-FIELD)
# ----------------------------------------------
# If FIELD (or DEFAULT-FIELD) is non-null, return "VALUE.FIELD",
# otherwise just VALUE. Be sure to pass "(VALUE)" is VALUE is a
# pointer.
m4_define([b4_dollar_dollar_],
[b4_symbol_value([$1],
m4_if([$2], [[]],
[[$3]], [[$2]]))])
# b4_dollar_pushdef(VALUE-POINTER, DEFAULT-FIELD, LOCATION)
# b4_dollar_popdef
# ---------------------------------------------------------
# Define b4_dollar_dollar for VALUE and DEFAULT-FIELD,
# and b4_at_dollar for LOCATION.
m4_define([b4_dollar_pushdef],
[m4_pushdef([b4_dollar_dollar],
[b4_dollar_dollar_([$1], m4_dquote($][1), [$2])])dnl
m4_pushdef([b4_at_dollar], [$3])dnl
])
m4_define([b4_dollar_popdef],
[m4_popdef([b4_at_dollar])dnl
m4_popdef([b4_dollar_dollar])dnl
])

View File

@@ -1,7 +1,8 @@
-*- Autoconf -*-
# C skeleton dispatching for Bison.
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
# Copyright (C) 2006-2007, 2009-2013 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

839
gnuwin32/bin/data/c.m4 Normal file
View File

@@ -0,0 +1,839 @@
-*- Autoconf -*-
# C M4 Macros for Bison.
# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_include(b4_pkgdatadir/[c-like.m4])
# b4_tocpp(STRING)
# ----------------
# Convert STRING into a valid C macro name.
m4_define([b4_tocpp],
[m4_toupper(m4_bpatsubst(m4_quote($1), [[^a-zA-Z0-9]+], [_]))])
# b4_cpp_guard(FILE)
# ------------------
# A valid C macro name to use as a CPP header guard for FILE.
m4_define([b4_cpp_guard],
[[YY_]b4_tocpp(m4_defn([b4_prefix])/[$1])[_INCLUDED]])
# b4_cpp_guard_open(FILE)
# b4_cpp_guard_close(FILE)
# ------------------------
# If FILE does not expand to nothing, open/close CPP inclusion guards for FILE.
m4_define([b4_cpp_guard_open],
[m4_ifval(m4_quote($1),
[#ifndef b4_cpp_guard([$1])
# define b4_cpp_guard([$1])])])
m4_define([b4_cpp_guard_close],
[m4_ifval(m4_quote($1),
[#endif b4_comment([!b4_cpp_guard([$1])])])])
## ---------------- ##
## Identification. ##
## ---------------- ##
# b4_identification
# -----------------
# Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or
# b4_pull_flag if they use the values of the %define variables api.pure or
# api.push-pull.
m4_define([b4_identification],
[[/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "]b4_version["
/* Skeleton name. */
#define YYSKELETON_NAME ]b4_skeleton[]m4_ifdef([b4_pure_flag], [[
/* Pure parsers. */
#define YYPURE ]b4_pure_flag])[]m4_ifdef([b4_push_flag], [[
/* Push parsers. */
#define YYPUSH ]b4_push_flag])[]m4_ifdef([b4_pull_flag], [[
/* Pull parsers. */
#define YYPULL ]b4_pull_flag])[
]])
## ---------------- ##
## Default values. ##
## ---------------- ##
# b4_api_prefix, b4_api_PREFIX
# ----------------------------
# Corresponds to %define api.prefix
b4_percent_define_default([[api.prefix]], [[yy]])
m4_define([b4_api_prefix],
[b4_percent_define_get([[api.prefix]])])
m4_define([b4_api_PREFIX],
[m4_toupper(b4_api_prefix)])
# b4_prefix
# ---------
# If the %name-prefix is not given, it is api.prefix.
m4_define_default([b4_prefix], [b4_api_prefix])
# If the %union is not named, its name is YYSTYPE.
m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE])
## ------------------------ ##
## Pure/impure interfaces. ##
## ------------------------ ##
# b4_lex_formals
# --------------
# All the yylex formal arguments.
# b4_lex_param arrives quoted twice, but we want to keep only one level.
m4_define([b4_lex_formals],
[b4_pure_if([[[[YYSTYPE *yylvalp]], [[&yylval]]][]dnl
b4_locations_if([, [[YYLTYPE *yyllocp], [&yylloc]]])])dnl
m4_ifdef([b4_lex_param], [, ]b4_lex_param)])
# b4_lex
# ------
# Call yylex.
m4_define([b4_lex],
[b4_function_call([yylex], [int], b4_lex_formals)])
# b4_user_args
# ------------
m4_define([b4_user_args],
[m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])])
# b4_parse_param
# --------------
# If defined, b4_parse_param arrives double quoted, but below we prefer
# it to be single quoted.
m4_define([b4_parse_param],
b4_parse_param)
# b4_parse_param_for(DECL, FORMAL, BODY)
# ---------------------------------------
# Iterate over the user parameters, binding the declaration to DECL,
# the formal name to FORMAL, and evaluating the BODY.
m4_define([b4_parse_param_for],
[m4_foreach([$1_$2], m4_defn([b4_parse_param]),
[m4_pushdef([$1], m4_unquote(m4_car($1_$2)))dnl
m4_pushdef([$2], m4_shift($1_$2))dnl
$3[]dnl
m4_popdef([$2])dnl
m4_popdef([$1])dnl
])])
# b4_parse_param_use([VAL], [LOC])
# --------------------------------
# 'YYUSE' VAL, LOC if locations are enabled, and all the parse-params.
m4_define([b4_parse_param_use],
[m4_ifvaln([$1], [ YYUSE ([$1]);])dnl
b4_locations_if([m4_ifvaln([$2], [ YYUSE ([$2]);])])dnl
b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal);
])dnl
])
## ------------ ##
## Data Types. ##
## ------------ ##
# b4_int_type(MIN, MAX)
# ---------------------
# Return the smallest int type able to handle numbers ranging from
# MIN to MAX (included).
m4_define([b4_int_type],
[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
b4_ints_in($@, [-128], [127]), [1], [signed char],
b4_ints_in($@, [0], [65535]), [1], [unsigned short int],
b4_ints_in($@, [-32768], [32767]), [1], [short int],
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
# b4_int_type_for(NAME)
# ---------------------
# Return the smallest int type able to handle numbers ranging from
# 'NAME_min' to 'NAME_max' (included).
m4_define([b4_int_type_for],
[b4_int_type($1_min, $1_max)])
# b4_table_value_equals(TABLE, VALUE, LITERAL)
# --------------------------------------------
# Without inducing a comparison warning from the compiler, check if the
# literal value LITERAL equals VALUE from table TABLE, which must have
# TABLE_min and TABLE_max defined.
m4_define([b4_table_value_equals],
[m4_if(m4_eval($3 < m4_indir([b4_]$1[_min])
|| m4_indir([b4_]$1[_max]) < $3), [1],
[[0]],
[(!!(($2) == ($3)))])])
## ----------------- ##
## Compiler issues. ##
## ----------------- ##
# b4_attribute_define
# -------------------
# Provide portability for __attribute__.
m4_define([b4_attribute_define],
[#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if (! defined __GNUC__ || __GNUC__ < 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
# define __attribute__(Spec) /* empty */
# 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__ && 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
])
## ---------##
## Values. ##
## ---------##
# b4_null_define
# --------------
# Portability issues: define a YY_NULL appropriate for the current
# language (C, C++98, or C++11).
m4_define([b4_null_define],
[# ifndef YY_NULL
# if defined __cplusplus && 201103L <= __cplusplus
# define YY_NULL nullptr
# else
# define YY_NULL 0
# endif
# endif[]dnl
])
# b4_null
# -------
# Return a null pointer constant.
m4_define([b4_null], [YY_NULL])
# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
# -------------------------------------------------------------
# Define "yy<TABLE-NAME>" whose contents is CONTENT.
m4_define([b4_integral_parser_table_define],
[m4_ifvaln([$3], [b4_comment([$3], [ ])])dnl
static const b4_int_type_for([$2]) yy$1[[]] =
{
$2
};dnl
])
## ------------------------- ##
## Assigning token numbers. ##
## ------------------------- ##
# b4_token_define(TOKEN-NUM)
# --------------------------
# Output the definition of this token as #define.
m4_define([b4_token_define],
[b4_token_format([#define %s %s], [$1])])
# b4_token_defines
# ----------------
# Output the definition of the tokens.
m4_define([b4_token_defines],
[b4_any_token_visible_if([/* Tokens. */
m4_join([
], b4_symbol_map([b4_token_define]))
])])
# b4_token_enum(TOKEN-NUM)
# ------------------------
# Output the definition of this token as an enum.
m4_define([b4_token_enum],
[b4_token_format([%s = %s], [$1])])
# b4_token_enums
# --------------
# Output the definition of the tokens (if there are) as enums.
m4_define([b4_token_enums],
[b4_any_token_visible_if([[/* Token type. */
#ifndef ]b4_api_PREFIX[TOKENTYPE
# define ]b4_api_PREFIX[TOKENTYPE
enum ]b4_api_prefix[tokentype
{
]m4_join([,
],
b4_symbol_map([b4_token_enum]))[
};
#endif
]])])
# b4_token_enums_defines
# ----------------------
# Output the definition of the tokens (if there are any) as enums and,
# if POSIX Yacc is enabled, as #defines.
m4_define([b4_token_enums_defines],
[b4_token_enums[]b4_yacc_if([b4_token_defines])])
## ----------------- ##
## Semantic Values. ##
## ----------------- ##
# b4_symbol_value(VAL, [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
# used safetly, it is put in parens to avoid nasty precedence issues.
# TYPE is *not* put in braces, provide some if needed.
m4_define([b4_symbol_value],
[($1[]m4_ifval([$2], [.$2]))])
## ---------------------- ##
## Defining C functions. ##
## ---------------------- ##
# b4_function_define(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# -----------------------------------------------------------
# Declare the function NAME in C.
m4_define([b4_function_define],
[$2
$1 (b4_formals(m4_shift2($@)))[]dnl
])
# b4_formals([DECL1, NAME1], ...)
# -------------------------------
# The formal arguments of a C function definition.
m4_define([b4_formals],
[m4_if([$#], [0], [void],
[$#$1], [1], [void],
[m4_map_sep([b4_formal], [, ], [$@])])])
m4_define([b4_formal],
[$1])
## ----------------------- ##
## Declaring C functions. ##
## ----------------------- ##
# b4_function_declare(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# ------------------------------------------------------------
# Declare the function NAME.
m4_define([b4_function_declare],
[$2 $1 (b4_formals(m4_shift2($@)));[]dnl
])
## --------------------- ##
## Calling C functions. ##
## --------------------- ##
# b4_function_call(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# -----------------------------------------------------------
# Call the function NAME with arguments NAME1, NAME2 etc.
m4_define([b4_function_call],
[$1 (b4_args(m4_shift2($@)))[]dnl
])
# b4_args([DECL1, NAME1], ...)
# ----------------------------
# Output the arguments NAME1, NAME2...
m4_define([b4_args],
[m4_map_sep([b4_arg], [, ], [$@])])
m4_define([b4_arg],
[$2])
## ----------- ##
## Synclines. ##
## ----------- ##
# b4_sync_start(LINE, FILE)
# -------------------------
m4_define([b4_sync_start], [[#]line $1 $2])
## -------------- ##
## User actions. ##
## -------------- ##
# b4_case(LABEL, STATEMENTS)
# --------------------------
m4_define([b4_case],
[ case $1:
$2
b4_syncline([@oline@], [@ofile@])
break;])
# b4_predicate_case(LABEL, CONDITIONS)
# ------------------------------------
m4_define([b4_predicate_case],
[ case $1:
if (! ($2)) YYERROR;
b4_syncline([@oline@], [@ofile@])
break;])
# b4_yydestruct_define
# --------------------
# Define the "yydestruct" function.
m4_define_default([b4_yydestruct_define],
[[/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
]b4_function_define([yydestruct],
[static void],
[[const char *yymsg], [yymsg]],
[[int yytype], [yytype]],
[[YYSTYPE *yyvaluep], [yyvaluep]][]dnl
b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
]b4_parse_param_use([yyvaluep], [yylocationp])dnl
[ if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
]b4_symbol_actions([destructor])[
YY_IGNORE_MAYBE_UNINITIALIZED_END
}]dnl
])
# b4_yy_symbol_print_define
# -------------------------
# Define the "yy_symbol_print" function.
m4_define_default([b4_yy_symbol_print_define],
[[
/*----------------------------------------.
| Print this symbol's value on YYOUTPUT. |
`----------------------------------------*/
]b4_function_define([yy_symbol_value_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
FILE *yyo = yyoutput;
]b4_parse_param_use([yyo], [yylocationp])dnl
[ if (!yyvaluep)
return;]
dnl glr.c does not feature yytoknum.
m4_if(b4_skeleton, ["yacc.c"],
[[# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
]])dnl
b4_symbol_actions([printer])[
}
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
]b4_function_define([yy_symbol_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
YYFPRINTF (yyoutput, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
YYFPRINTF (yyoutput, ": ");
])dnl
[ yy_symbol_value_print (yyoutput, yytype, yyvaluep]dnl
b4_locations_if([, yylocationp])[]b4_user_args[);
YYFPRINTF (yyoutput, ")");
}]dnl
])
## ---------------- ##
## 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 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_user_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. #
# ---------------- #
# 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. ##
## -------------- ##
# b4_value_type_define
# --------------------
m4_define([b4_value_type_define],
[b4_value_type_setup[]dnl
/* Value type. */
m4_bmatch(b4_percent_define_get_kind([[api.value.type]]),
[code],
[[#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;
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
#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
typedef union ]b4_union_name[ ]b4_api_PREFIX[STYPE;
union ]b4_union_name[
{
]b4_user_union_members[
};
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
#endif
]])])])
# b4_location_type_define
# -----------------------
m4_define([b4_location_type_define],
[[/* Location type. */
#if ! defined ]b4_api_PREFIX[LTYPE && ! defined ]b4_api_PREFIX[LTYPE_IS_DECLARED
typedef struct ]b4_api_PREFIX[LTYPE ]b4_api_PREFIX[LTYPE;
struct ]b4_api_PREFIX[LTYPE
{
int first_line;
int first_column;
int last_line;
int last_column;
};
# define ]b4_api_PREFIX[LTYPE_IS_DECLARED 1
# define ]b4_api_PREFIX[LTYPE_IS_TRIVIAL 1
#endif
]])
# b4_declare_yylstype
# -------------------
# Declarations that might either go into the header (if --defines) or
# in the parser body. Declare YYSTYPE/YYLTYPE, and yylval/yylloc.
m4_define([b4_declare_yylstype],
[b4_value_type_define[]b4_locations_if([
b4_location_type_define])
b4_pure_if([], [[extern ]b4_api_PREFIX[STYPE ]b4_prefix[lval;
]b4_locations_if([[extern ]b4_api_PREFIX[LTYPE ]b4_prefix[lloc;]])])[]dnl
])
# b4_YYDEBUG_define
# -----------------
m4_define([b4_YYDEBUG_define],
[[/* Debug traces. */
]m4_if(b4_api_prefix, [yy],
[[#ifndef YYDEBUG
# define YYDEBUG ]b4_parse_trace_if([1], [0])[
#endif]],
[[#ifndef ]b4_api_PREFIX[DEBUG
# if defined YYDEBUG
#if YYDEBUG
# define ]b4_api_PREFIX[DEBUG 1
# else
# define ]b4_api_PREFIX[DEBUG 0
# endif
# else /* ! defined YYDEBUG */
# define ]b4_api_PREFIX[DEBUG ]b4_parse_trace_if([1], [0])[
# endif /* ! defined YYDEBUG */
#endif /* ! defined ]b4_api_PREFIX[DEBUG */]])[]dnl
])
# b4_declare_yydebug
# ------------------
m4_define([b4_declare_yydebug],
[b4_YYDEBUG_define[
#if ]b4_api_PREFIX[DEBUG
extern int ]b4_prefix[debug;
#endif][]dnl
])
# b4_yylloc_default_define
# ------------------------
# Define YYLLOC_DEFAULT.
m4_define([b4_yylloc_default_define],
[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
} \
else \
{ \
(Current).first_line = (Current).last_line = \
YYRHSLOC (Rhs, 0).last_line; \
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
} \
while (0)
#endif
]])
# b4_yy_location_print_define
# ---------------------------
# Define YY_LOCATION_PRINT.
m4_define([b4_yy_location_print_define],
[b4_locations_if([[
/* YY_LOCATION_PRINT -- Print the location on the stream.
This macro was not mandated originally: define only if we know
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
# if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
__attribute__((__unused__))
]b4_function_define([yy_location_print_],
[static unsigned],
[[FILE *yyo], [yyo]],
[[YYLTYPE const * const yylocp], [yylocp]])[
{
unsigned res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += YYFPRINTF (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += YYFPRINTF (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += YYFPRINTF (yyo, "-%d", end_col);
}
return res;
}
# define YY_LOCATION_PRINT(File, Loc) \
yy_location_print_ (File, &(Loc))
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif]],
[[/* This macro is provided for backward compatibility. */
#ifndef YY_LOCATION_PRINT
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif]])
])
# b4_yyloc_default
# ----------------
# Expand to a possible default value for yylloc.
m4_define([b4_yyloc_default],
[[
# if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL
= { ]m4_join([, ],
m4_defn([b4_location_initial_line]),
m4_defn([b4_location_initial_column]),
m4_defn([b4_location_initial_line]),
m4_defn([b4_location_initial_column]))[ }
# endif
]])

2563
gnuwin32/bin/data/glr.c Normal file

File diff suppressed because it is too large Load Diff

345
gnuwin32/bin/data/glr.cc Normal file
View File

@@ -0,0 +1,345 @@
# C++ GLR skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This skeleton produces a C++ class that encapsulates a C glr parser.
# This is in order to reduce the maintenance burden. The glr.c
# skeleton is clean and pure enough so that there are no real
# problems. The C++ interface is the same as that of lalr1.cc. In
# fact, glr.c can replace yacc.c without the user noticing any
# difference, and similarly for glr.cc replacing lalr1.cc.
#
# The passing of parse-params
#
# The additional arguments are stored as members of the parser
# object, yyparser. The C routines need to carry yyparser
# throughout the C parser; that's easy: make yyparser an
# additional parse-param. But because the C++ skeleton needs to
# know the "real" original parse-param, we save them
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
# (and c.m4 strips one level of quotes). This is a PITA, and
# explains why there are so many levels of quotes.
#
# The locations
#
# We use location.cc just like lalr1.cc, but because glr.c stores
# the locations in a union, the position and location classes
# must not have a constructor. Therefore, contrary to lalr1.cc, we
# must not define "b4_location_constructors". As a consequence the
# user must initialize the first positions (in particular the
# filename member).
# We require a pure interface.
m4_define([b4_pure_flag], [1])
m4_include(b4_pkgdatadir/[c++.m4])
b4_bison_locations_if([m4_include(b4_pkgdatadir/[location.cc])])
m4_define([b4_parser_class_name],
[b4_percent_define_get([[parser_class_name]])])
# Save the parse parameters.
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
# b4_parse_param_wrap
# -------------------
# New ones.
m4_ifset([b4_parse_param],
[m4_define([b4_parse_param_wrap],
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]],]
m4_defn([b4_parse_param]))],
[m4_define([b4_parse_param_wrap],
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]]])
])
# b4_yy_symbol_print_define
# -------------------------
# Bypass the default implementation to generate the "yy_symbol_print"
# and "yy_symbol_value_print" functions.
m4_define([b4_yy_symbol_print_define],
[[
/*--------------------.
| Print this symbol. |
`--------------------*/
]b4_function_define([yy_symbol_print],
[static void],
[[FILE *], []],
[[int yytype], [yytype]],
[[const ]b4_namespace_ref::b4_parser_class_name[::semantic_type *yyvaluep],
[yyvaluep]][]dnl
b4_locations_if([,
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
[yylocationp]]]),
b4_parse_param)[
{
]b4_parse_param_use[]dnl
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[);
}
]])[
# Hijack the initial action to initialize the locations.
]b4_bison_locations_if([m4_define([b4_initial_action],
[yylloc.initialize ();]m4_ifdef([b4_initial_action], [
m4_defn([b4_initial_action])]))])[
# Hijack the post prologue to insert early definition of YYLLOC_DEFAULT
# and declaration of yyerror.
]m4_append([b4_post_prologue],
[b4_syncline([@oline@], [@ofile@])[
]b4_yylloc_default_define[
#define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
]b4_function_declare([yyerror],
[static void],b4_locations_if([
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
[yylocationp]],])
b4_parse_param,
[[const char* msg], [msg]])])
#undef yynerrs
#undef yychar
#undef yylval]b4_locations_if([
#undef yylloc])
m4_if(b4_prefix, [yy], [],
[[/* Substitute the variable and function names. */
#define yyparse ]b4_prefix[parse
#define yylex ]b4_prefix[lex
#define yyerror ]b4_prefix[error
#define yydebug ]b4_prefix[debug
]]b4_pure_if([], [[
#define yylval ]b4_prefix[lval
#define yychar ]b4_prefix[char
#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[
#define yylloc ]b4_prefix[lloc]])]))
# Hijack the epilogue to define implementations (yyerror, parser member
# functions etc.).
m4_append([b4_epilogue],
[b4_syncline([@oline@], [@ofile@])[
/*------------------.
| Report an error. |
`------------------*/
]b4_function_define([yyerror],
[static void],b4_locations_if([
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
[yylocationp]],])
b4_parse_param,
[[const char* msg], [msg]])[
{
]b4_parse_param_use[]dnl
[ yyparser.error (]b4_locations_if([[*yylocationp, ]])[msg);
}
]b4_namespace_open[
]dnl In this section, the parse params are the original parse_params.
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
[ /// Build a parser object.
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
:])[
#if ]b4_api_PREFIX[DEBUG
]m4_ifset([b4_parse_param], [ ], [ :])[yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
#endif]b4_parse_param_cons[
{
}
]b4_parser_class_name::~b4_parser_class_name[ ()
{
}
int
]b4_parser_class_name[::parse ()
{
return ::yyparse (*this]b4_user_args[);
}
#if ]b4_api_PREFIX[DEBUG
/*--------------------.
| Print this symbol. |
`--------------------*/
inline void
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[)
{]b4_locations_if([[
YYUSE (yylocationp);]])[
YYUSE (yyvaluep);
std::ostream& yyoutput = debug_stream ();
std::ostream& yyo = yyoutput;
YYUSE (yyo);
]b4_symbol_actions([printer])[
}
void
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[)
{
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
<< ' ' << yytname[yytype] << " ("]b4_locations_if([[
<< *yylocationp << ": "]])[;
yy_symbol_value_print_ (yytype, yyvaluep]b4_locations_if([[, yylocationp]])[);
*yycdebug_ << ')';
}
std::ostream&
]b4_parser_class_name[::debug_stream () const
{
return *yycdebug_;
}
void
]b4_parser_class_name[::set_debug_stream (std::ostream& o)
{
yycdebug_ = &o;
}
]b4_parser_class_name[::debug_level_type
]b4_parser_class_name[::debug_level () const
{
return yydebug;
}
void
]b4_parser_class_name[::set_debug_level (debug_level_type l)
{
// Actually, it is yydebug which is really used.
yydebug = l;
}
#endif
]m4_popdef([b4_parse_param])dnl
b4_namespace_close
])
# b4_shared_declarations
# ----------------------
# Declaration that might either go into the header (if --defines)
# or open coded in the parser body.
m4_define([b4_shared_declarations],
[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
b4_percent_code_get([[requires]])[
#include <stdexcept>
#include <string>
#include <iostream>]b4_defines_if([
b4_bison_locations_if([[#include "location.hh"]])])[
]b4_YYDEBUG_define[
]b4_namespace_open[
]b4_defines_if([],
[b4_bison_locations_if([b4_position_define
b4_location_define])])[
/// A Bison parser.
class ]b4_parser_class_name[
{
public:
]b4_public_types_declare[
/// Build a parser object.
]b4_parser_class_name[ (]b4_parse_param_decl[);
virtual ~]b4_parser_class_name[ ();
/// Parse.
/// \returns 0 iff parsing succeeded.
virtual int parse ();
/// The current debugging stream.
std::ostream& debug_stream () const;
/// Set the current debugging stream.
void set_debug_stream (std::ostream &);
/// Type for debugging levels.
typedef int debug_level_type;
/// The current debugging level.
debug_level_type debug_level () const;
/// Set the current debugging level.
void set_debug_level (debug_level_type l);
public:
/// Report a syntax error.]b4_locations_if([[
/// \param loc where the syntax error is found.]])[
/// \param msg a description of the syntax error.
virtual void error (]b4_locations_if([[const location_type& loc, ]])[const std::string& msg);
# if ]b4_api_PREFIX[DEBUG
public:
/// \brief Report a symbol value on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.]b4_locations_if([[
/// \param yylocationp Its location.]])[
virtual void yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[);
/// \brief Report a symbol on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.]b4_locations_if([[
/// \param yylocationp Its location.]])[
virtual void yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[);
private:
// Debugging.
std::ostream* yycdebug_;
#endif
]b4_parse_param_vars[
};
]dnl Redirections for glr.c.
b4_percent_define_flag_if([[global_tokens_and_yystype]],
[b4_token_defines])
[
#ifndef ]b4_api_PREFIX[STYPE
# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
#endif
#ifndef ]b4_api_PREFIX[LTYPE
# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
#endif
]b4_namespace_close[
]b4_percent_code_get([[provides]])[
]m4_popdef([b4_parse_param])dnl
])
b4_defines_if(
[b4_output_begin([b4_spec_defines_file])
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
[2002-2013])[
// C++ GLR parser skeleton written by Akim Demaille.
]b4_cpp_guard_open([b4_spec_defines_file])[
]b4_shared_declarations[
]b4_cpp_guard_close([b4_spec_defines_file])[
]b4_output_end()])
# Let glr.c (and b4_shared_declarations) believe that the user
# arguments include the parser itself.
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_wrap]))
m4_include(b4_pkgdatadir/[glr.c])
m4_popdef([b4_parse_param])

View File

@@ -1,7 +1,8 @@
-*- Autoconf -*-
# Java skeleton dispatching for Bison.
# Copyright (C) 2007 Free Software Foundation, Inc.
# Copyright (C) 2007, 2009-2013 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

View File

@@ -2,7 +2,7 @@
# Java language support for Bison
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
# Copyright (C) 2007-2013 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
@@ -17,19 +17,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# b4_comment(TEXT)
# ----------------
m4_define([b4_comment], [/* m4_bpatsubst([$1], [
], [
]) */])
m4_include(b4_pkgdatadir/[c-like.m4])
# b4_list2(LIST1, LIST2)
# --------------------------
# ----------------------
# Join two lists with a comma if necessary.
m4_define([b4_list2],
[$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
[$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
# b4_percent_define_get3(DEF, PRE, POST, NOT)
@@ -37,8 +32,8 @@ m4_define([b4_list2],
# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed,
# otherwise NOT.
m4_define([b4_percent_define_get3],
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
[$2[]b4_percent_define_get([$1])[]$3], [$4])])
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
[$2[]b4_percent_define_get([$1])[]$3], [$4])])
@@ -103,12 +98,12 @@ m4_define([b4_identification],
m4_define([b4_int_type],
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
b4_ints_in($@, [-32768], [32767]), [1], [short],
[int])])
[int])])
# b4_int_type_for(NAME)
# ---------------------
# 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],
[b4_int_type($1_min, $1_max)])
@@ -117,27 +112,45 @@ m4_define([b4_int_type_for],
m4_define([b4_null], [null])
# b4_typed_parser_table_define(TYPE, NAME, DATA, COMMENT)
# -------------------------------------------------------
m4_define([b4_typed_parser_table_define],
[m4_ifval([$4], [b4_comment([$4])
])dnl
[private static final ]$1[ yy$2_[] = yy$2_init();
private static final ]$1[[] yy$2_init()
{
return new ]$1[[]
{
]$3[
};
}]])
# b4_integral_parser_table_define(NAME, DATA, COMMENT)
#-----------------------------------------------------
m4_define([b4_integral_parser_table_define],
[b4_typed_parser_table_define([b4_int_type_for([$2])], [$1], [$2], [$3])])
## ------------------------- ##
## Assigning token numbers. ##
## ------------------------- ##
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
# ---------------------------------------
# b4_token_enum(TOKEN-NUM)
# ------------------------
# Output the definition of this token as an enum.
m4_define([b4_token_enum],
[ /** Token number, to be returned by the scanner. */
public static final int $1 = $2;
])
[b4_token_format([ /** Token number, to be returned by the scanner. */
static final int %s = %s;
], [$1])])
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
# -----------------------------------------------------
# b4_token_enums
# --------------
# Output the definition of the tokens (if there are) as enums.
m4_define([b4_token_enums],
[m4_if([$#$1], [1], [],
[/* Tokens. */
m4_map([b4_token_enum], [$@])])
])
[b4_any_token_visible_if([/* Tokens. */
b4_symbol_foreach([b4_token_enum])])])
# b4-case(ID, CODE)
# -----------------
@@ -148,31 +161,57 @@ m4_define([b4_case], [ case $1:
break;
])
# b4_predicate_case(LABEL, CONDITIONS)
# ------------------------------------
m4_define([b4_predicate_case], [ case $1:
if (! ($2)) YYERROR;
break;
])
## -------- ##
## 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. ##
## ---------------- ##
m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
b4_percent_define_default([[stype]], [[Object]])])
m4_define([b4_yystype], [b4_percent_define_get([[api.value.type]])])
b4_percent_define_default([[api.value.type]], [[Object]])
# %name-prefix
m4_define_default([b4_prefix], [[YY]])
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])])
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])])
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])])
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
b4_percent_define_default([[throws]], [])])
b4_percent_define_default([[throws]], [])
m4_define([b4_throws], [b4_percent_define_get([[throws]])])
b4_percent_define_default([[location_type]], [Location])])
m4_define([b4_location_type], [b4_percent_define_get([[location_type]])])
b4_percent_define_default([[init_throws]], [])
m4_define([b4_init_throws], [b4_percent_define_get([[init_throws]])])
b4_percent_define_default([[position_type]], [Position])])
m4_define([b4_position_type], [b4_percent_define_get([[position_type]])])
b4_percent_define_default([[api.location.type]], [Location])
m4_define([b4_location_type], [b4_percent_define_get([[api.location.type]])])
b4_percent_define_default([[api.position.type]], [Position])
m4_define([b4_position_type], [b4_percent_define_get([[api.position.type]])])
## ----------------- ##
@@ -218,21 +257,21 @@ m4_define([b4_rhs_location],
# it to be single quoted. Same for b4_parse_param.
# TODO: should be in bison.m4
m4_define_default([b4_lex_param], [[]]))
m4_define([b4_lex_param], b4_lex_param))
m4_define([b4_parse_param], b4_parse_param))
m4_define_default([b4_lex_param], [[]])
m4_define([b4_lex_param], b4_lex_param)
m4_define([b4_parse_param], b4_parse_param)
# b4_lex_param_decl
# -------------------
# -----------------
# Extra formal arguments of the constructor.
m4_define([b4_lex_param_decl],
[m4_ifset([b4_lex_param],
[b4_remove_comma([$1],
b4_param_decls(b4_lex_param))],
[$1])])
b4_param_decls(b4_lex_param))],
[$1])])
m4_define([b4_param_decls],
[m4_map([b4_param_decl], [$@])])
[m4_map([b4_param_decl], [$@])])
m4_define([b4_param_decl], [, $1])
m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
@@ -245,21 +284,21 @@ m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
m4_define([b4_parse_param_decl],
[m4_ifset([b4_parse_param],
[b4_remove_comma([$1],
b4_param_decls(b4_parse_param))],
[$1])])
b4_param_decls(b4_parse_param))],
[$1])])
# b4_lex_param_call
# -------------------
# -----------------
# Delegating the lexer parameters to the lexer constructor.
m4_define([b4_lex_param_call],
[m4_ifset([b4_lex_param],
[b4_remove_comma([$1],
b4_param_calls(b4_lex_param))],
[$1])])
[b4_remove_comma([$1],
b4_param_calls(b4_lex_param))],
[$1])])
m4_define([b4_param_calls],
[m4_map([b4_param_call], [$@])])
[m4_map([b4_param_call], [$@])])
m4_define([b4_param_call], [, $2])
@@ -269,13 +308,13 @@ m4_define([b4_param_call], [, $2])
# Extra initialisations of the constructor.
m4_define([b4_parse_param_cons],
[m4_ifset([b4_parse_param],
[b4_constructor_calls(b4_parse_param)])])
[b4_constructor_calls(b4_parse_param)])])
m4_define([b4_constructor_calls],
[m4_map([b4_constructor_call], [$@])])
[m4_map([b4_constructor_call], [$@])])
m4_define([b4_constructor_call],
[this.$2 = $2;
])
[this.$2 = $2;
])
@@ -284,15 +323,15 @@ m4_define([b4_constructor_call],
# Extra instance variables.
m4_define([b4_parse_param_vars],
[m4_ifset([b4_parse_param],
[
[
/* User arguments. */
b4_var_decls(b4_parse_param)])])
m4_define([b4_var_decls],
[m4_map_sep([b4_var_decl], [
[m4_map_sep([b4_var_decl], [
], [$@])])
m4_define([b4_var_decl],
[ protected final $1;])
[ protected final $1;])
@@ -300,4 +339,4 @@ m4_define([b4_var_decl],
# -----------------------
# Expand to either an empty string or "throws THROWS".
m4_define([b4_maybe_throws],
[m4_ifval($1, [throws $1])])
[m4_ifval($1, [throws $1])])

1161
gnuwin32/bin/data/lalr1.cc Normal file

File diff suppressed because it is too large Load Diff

1065
gnuwin32/bin/data/lalr1.java Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,45 @@
## Copyright (C) 2002, 2005-2013 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/>.
dist_pkgdata_DATA = \
data/README \
data/bison.m4 \
data/c++-skel.m4 \
data/c++.m4 \
data/c-like.m4 \
data/c-skel.m4 \
data/c.m4 \
data/glr.c \
data/glr.cc \
data/java-skel.m4 \
data/java.m4 \
data/lalr1.cc \
data/lalr1.java \
data/location.cc \
data/stack.hh \
data/variant.hh \
data/yacc.c
m4sugardir = $(pkgdatadir)/m4sugar
dist_m4sugar_DATA = \
data/m4sugar/foreach.m4 \
data/m4sugar/m4sugar.m4
xsltdir = $(pkgdatadir)/xslt
dist_xslt_DATA = \
data/xslt/bison.xsl \
data/xslt/xml2dot.xsl \
data/xslt/xml2text.xsl \
data/xslt/xml2xhtml.xsl

View File

@@ -0,0 +1,335 @@
# C++ skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_pushdef([b4_copyright_years],
[2002-2013])
# b4_position_define
# ------------------
# Define class position.
m4_define([b4_position_define],
[[ /// Abstract a position.
class position
{
public:]m4_ifdef([b4_location_constructors], [[
/// Construct a position.
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
: filename (f)
, line (l)
, column (c)
{
}
]])[
/// Initialization.
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL,
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
{
filename = fn;
line = l;
column = c;
}
/** \name Line and Column related manipulators
** \{ */
/// (line related) Advance to the COUNT next lines.
void lines (int count = 1)
{
if (count)
{
column = ]b4_location_initial_column[u;
line = add_ (line, count, ]b4_location_initial_line[);
}
}
/// (column related) Advance to the COUNT next columns.
void columns (int count = 1)
{
column = add_ (column, count, ]b4_location_initial_column[);
}
/** \} */
/// File name to which this position refers.
]b4_percent_define_get([[filename_type]])[* filename;
/// Current line number.
unsigned int line;
/// Current column number.
unsigned int column;
private:
/// Compute max(min, lhs+rhs) (provided min <= lhs).
static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min)
{
return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs
? rhs + lhs
: min);
}
};
/// Add and assign a position.
inline position&
operator+= (position& res, int width)
{
res.columns (width);
return res;
}
/// Add two position objects.
inline position
operator+ (position res, int width)
{
return res += width;
}
/// Add and assign a position.
inline position&
operator-= (position& res, int width)
{
return res += -width;
}
/// Add two position objects.
inline position
operator- (position res, int width)
{
return res -= width;
}
]b4_percent_define_flag_if([[define_location_comparison]], [[
/// Compare two position objects.
inline bool
operator== (const position& pos1, const position& pos2)
{
return (pos1.line == pos2.line
&& pos1.column == pos2.column
&& (pos1.filename == pos2.filename
|| (pos1.filename && pos2.filename
&& *pos1.filename == *pos2.filename)));
}
/// Compare two position objects.
inline bool
operator!= (const position& pos1, const position& pos2)
{
return !(pos1 == pos2);
}
]])[
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param pos a reference to the position to redirect
*/
template <typename YYChar>
inline std::basic_ostream<YYChar>&
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
{
if (pos.filename)
ostr << *pos.filename << ':';
return ostr << pos.line << '.' << pos.column;
}
]])
# b4_location_define
# ------------------
m4_define([b4_location_define],
[[ /// Abstract a location.
class location
{
public:
]m4_ifdef([b4_location_constructors], [
/// Construct a location from \a b to \a e.
location (const position& b, const position& e)
: begin (b)
, end (e)
{
}
/// Construct a 0-width location in \a p.
explicit location (const position& p = position ())
: begin (p)
, end (p)
{
}
/// Construct a 0-width location in \a f, \a l, \a c.
explicit location (]b4_percent_define_get([[filename_type]])[* f,
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
: begin (f, l, c)
, end (f, l, c)
{
}
])[
/// Initialization.
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
{
begin.initialize (f, l, c);
end = begin;
}
/** \name Line and Column related manipulators
** \{ */
public:
/// Reset initial location to final location.
void step ()
{
begin = end;
}
/// Extend the current location to the COUNT next columns.
void columns (int count = 1)
{
end += count;
}
/// Extend the current location to the COUNT next lines.
void lines (int count = 1)
{
end.lines (count);
}
/** \} */
public:
/// Beginning of the located region.
position begin;
/// End of the located region.
position end;
};
/// Join two location objects to create a location.
inline location operator+ (location res, const location& end)
{
res.end = end.end;
return res;
}
/// Change end position in place.
inline location& operator+= (location& res, int width)
{
res.columns (width);
return res;
}
/// Change end position.
inline location operator+ (location res, int width)
{
return res += width;
}
/// Change end position in place.
inline location& operator-= (location& res, int width)
{
return res += -width;
}
/// Change end position.
inline location operator- (const location& begin, int width)
{
return begin + -width;
}
]b4_percent_define_flag_if([[define_location_comparison]], [[
/// Compare two location objects.
inline bool
operator== (const location& loc1, const location& loc2)
{
return loc1.begin == loc2.begin && loc1.end == loc2.end;
}
/// Compare two location objects.
inline bool
operator!= (const location& loc1, const location& loc2)
{
return !(loc1 == loc2);
}
]])[
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param loc a reference to the location to redirect
**
** Avoid duplicate information.
*/
template <typename YYChar>
inline std::basic_ostream<YYChar>&
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
{
unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
ostr << loc.begin// << "(" << loc.end << ") "
;
if (loc.end.filename
&& (!loc.begin.filename
|| *loc.begin.filename != *loc.end.filename))
ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col;
else if (loc.begin.line < loc.end.line)
ostr << '-' << loc.end.line << '.' << end_col;
else if (loc.begin.column < end_col)
ostr << '-' << end_col;
return ostr;
}
]])
b4_defines_if([
b4_output_begin([b4_dir_prefix[]position.hh])
b4_copyright([Positions for Bison parsers in C++])[
/**
** \file ]b4_dir_prefix[position.hh
** Define the ]b4_namespace_ref[::position class.
*/
]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[
# include <algorithm> // std::max
# include <iostream>
# include <string>
]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_location_define[
]b4_namespace_close[
]b4_cpp_guard_close([b4_dir_prefix[]location.hh])
b4_output_end()
])
m4_popdef([b4_copyright_years])

View File

@@ -4,11 +4,12 @@
# Speeds up GNU M4 1.4.x by avoiding quadratic $@ recursion, but penalizes
# GNU M4 1.6 by requiring more memory and macro expansions.
#
# Copyright (C) 2008 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# Copyright (C) 2008-2013 Free Software Foundation, Inc.
# This file is part of Autoconf. This 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,
@@ -16,38 +17,16 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Under Section 7 of GPL version 3, you are granted additional
# permissions described in the Autoconf Configure Script Exception,
# version 3.0, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# and a copy of the Autoconf Configure Script Exception along with
# this program; see the files COPYINGv3 and COPYING.EXCEPTION
# respectively. If not, see <http://www.gnu.org/licenses/>.
# As a special exception, the Free Software Foundation gives unlimited
# permission to copy, distribute and modify the configure scripts that
# are the output of Autoconf. You need not follow the terms of the GNU
# General Public License when using or distributing such scripts, even
# though portions of the text of Autoconf appear in them. The GNU
# General Public License (GPL) does govern all other use of the material
# that constitutes the Autoconf program.
#
# Certain portions of the Autoconf source text are designed to be copied
# (in certain cases, depending on the input) into the output of
# Autoconf. We call these the "data" portions. The rest of the Autoconf
# source text consists of comments plus executable code that decides which
# of the data portions to output in any given case. We call these
# comments and executable code the "non-data" portions. Autoconf never
# copies any of the non-data portions into its output.
#
# This special exception to the GPL applies to versions of Autoconf
# released by the Free Software Foundation. When you make and
# distribute a modified version of Autoconf, you may extend this special
# exception to the GPL to apply to your modified version as well, *unless*
# your modified version has the potential to copy into its output some
# of the text that was the non-data portion of the version that you started
# with. (In other words, unless your change moves or copies text from
# the non-data portions to the data portions.) If your modification has
# such potential, you must delete any notice of this special exception
# to the GPL from your modified version.
#
# Written by Eric Blake.
#
# In M4 1.4.x, every byte of $@ is rescanned. This means that an
# algorithm on n arguments that recurses with one less argument each
@@ -77,29 +56,29 @@
#
# Please keep this file in sync with m4sugar.m4.
# m4_foreach(VARIABLE, LIST, EXPRESSION)
# --------------------------------------
# Expand EXPRESSION assigning each value of the LIST to VARIABLE.
# LIST should have the form `item_1, item_2, ..., item_n', i.e. the
# whole list must *quoted*. Quote members too if you don't want them
# to be expanded.
# _m4_foreach(PRE, POST, IGNORED, ARG...)
# ---------------------------------------
# Form the common basis of the m4_foreach and m4_map macros. For each
# ARG, expand PRE[ARG]POST[]. The IGNORED argument makes recursion
# easier, and must be supplied rather than implicit.
#
# This version minimizes the number of times that $@ is evaluated by
# using m4_for to generate a boilerplate into VARIABLE then passing $@
# to that temporary macro. Thus, the recursion is done in m4_for
# without reparsing any user input, and is not quadratic. For an idea
# of how this works, note that m4_foreach(i,[1,2],[i]) defines i to be
# m4_define([$1],[$3])$2[]m4_define([$1],[$4])$2[]m4_popdef([i])
# then calls i([i],[i],[1],[2]).
m4_define([m4_foreach],
[m4_if([$2], [], [], [_$0([$1], [$3], $2)])])
# using m4_for to generate a boilerplate into _m4_f then passing $@ to
# that temporary macro. Thus, the recursion is done in m4_for without
# reparsing any user input, and is not quadratic. For an idea of how
# this works, note that m4_foreach(i,[1,2],[i]) calls
# _m4_foreach([m4_define([i],],[)i],[],[1],[2])
# which defines _m4_f:
# $1[$4]$2[]$1[$5]$2[]_m4_popdef([_m4_f])
# then calls _m4_f([m4_define([i],],[)i],[],[1],[2]) for a net result:
# m4_define([i],[1])i[]m4_define([i],[2])i[]_m4_popdef([_m4_f]).
m4_define([_m4_foreach],
[m4_define([$1], m4_pushdef([$1])_m4_for([$1], [3], [$#], [1],
[$0_([1], [2], _m4_defn([$1]))])[m4_popdef([$1])])m4_indir([$1], $@)])
[m4_if([$#], [3], [],
[m4_pushdef([_m4_f], _m4_for([4], [$#], [1],
[$0_([1], [2],], [)])[_m4_popdef([_m4_f])])_m4_f($@)])])
m4_define([_m4_foreach_],
[[m4_define([$$1], [$$3])$$2[]]])
[[$$1[$$3]$$2[]]])
# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT)
# -----------------------------------------------------------
@@ -114,11 +93,14 @@ m4_define([_m4_foreach_],
# m4_if([$1],[$2],[$3],[$1],[$4],[$5],_m4_popdef([_m4_case])[$6])
m4_define([m4_case],
[m4_if(m4_eval([$# <= 2]), [1], [$2],
[m4_pushdef([_$0], [m4_if(]m4_for([_m4_count], [2], m4_decr([$#]), [2],
[_$0_([1], _m4_count, m4_incr(_m4_count))])[_m4_popdef(
[m4_pushdef([_$0], [m4_if(]_m4_for([2], m4_eval([($# - 1) / 2 * 2]), [2],
[_$0_(], [)])[_m4_popdef(
[_$0])]m4_dquote($m4_eval([($# + 1) & ~1]))[)])_$0($@)])])
m4_define([_m4_case_],
[$0_([1], [$1], m4_incr([$1]))])
m4_define([_m4_case__],
[[[$$1],[$$2],[$$3],]])
# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
@@ -142,15 +124,18 @@ m4_define([m4_bmatch],
[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
[$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
[$#], 2, [$2],
[m4_define([_m4_b], m4_pushdef([_m4_b])[m4_define([_m4_b],
_m4_defn([_$0]))]_m4_for([_m4_b], [3], m4_eval([($# + 1) / 2 * 2 - 1]),
[2], [_$0_([1], m4_decr(_m4_b), _m4_b)])[_m4_b([], [],]m4_dquote(
[$]m4_incr(_m4_b))[_m4_popdef([_m4_b]))])m4_unquote(_m4_b($@))])])
[m4_pushdef([_m4_b], [m4_define([_m4_b],
_m4_defn([_$0]))]_m4_for([3], m4_eval([($# + 1) / 2 * 2 - 1]),
[2], [_$0_(], [)])[_m4_b([], [],]m4_dquote([$]m4_eval(
[($# + 1) / 2 * 2]))[_m4_popdef([_m4_b]))])m4_unquote(_m4_b($@))])])
m4_define([_m4_bmatch],
[m4_if(m4_bregexp([$1], [$2]), [-1], [], [[$3]m4_define([$0])])])
m4_define([_m4_bmatch_],
[$0_([1], m4_decr([$1]), [$1])])
m4_define([_m4_bmatch__],
[[_m4_b([$$1], [$$2], [$$3])]])
@@ -170,12 +155,15 @@ m4_define([_m4_bmatch_],
# [[$m]m4_define([_m4_c])])])_m4_c([[$m+1]]_m4_popdef([_m4_c]))
# We invoke m4_unquote(_m4_c($@)), for concatenation with later text.
m4_define([_m4_cond],
[m4_define([_m4_c], m4_pushdef([_m4_c])[m4_define([_m4_c],
_m4_defn([m4_unquote]))]_m4_for([_m4_c], [2], m4_eval([$# / 3 * 3 - 1]), [3],
[$0_(m4_decr(_m4_c), _m4_c, m4_incr(_m4_c))])[_m4_c(]m4_dquote(m4_dquote(
[m4_pushdef([_m4_c], [m4_define([_m4_c],
_m4_defn([m4_unquote]))]_m4_for([2], m4_eval([$# / 3 * 3 - 1]), [3],
[$0_(], [)])[_m4_c(]m4_dquote(m4_dquote(
[$]m4_eval([$# / 3 * 3 + 1])))[_m4_popdef([_m4_c]))])m4_unquote(_m4_c($@))])
m4_define([_m4_cond_],
[$0_(m4_decr([$1]), [$1], m4_incr([$1]))])
m4_define([_m4_cond__],
[[_m4_c([m4_if(($$1), [($$2)], [[$$3]m4_define([_m4_c])])])]])
# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
@@ -196,11 +184,14 @@ m4_define([_m4_cond_],
# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$m-1], [$m]))m4_unquote(
# _m4_defn([_m4_p])_m4_popdef([_m4_p]))
m4_define([_m4_bpatsubsts],
[m4_define([_m4_p], m4_pushdef([_m4_p])[m4_define([_m4_p],
]m4_dquote([$]1)[)]_m4_for([_m4_p], [3], [$#], [2], [$0_(m4_decr(_m4_p),
_m4_p)])[m4_unquote(_m4_defn([_m4_p])_m4_popdef([_m4_p]))])_m4_p($@)])
[m4_pushdef([_m4_p], [m4_define([_m4_p],
]m4_dquote([$]1)[)]_m4_for([3], [$#], [2], [$0_(],
[)])[m4_unquote(_m4_defn([_m4_p])_m4_popdef([_m4_p]))])_m4_p($@)])
m4_define([_m4_bpatsubsts_],
[$0_(m4_decr([$1]), [$1])])
m4_define([_m4_bpatsubsts__],
[[m4_define([_m4_p],
m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$$1], [$$2]))]])
@@ -213,9 +204,9 @@ m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$$1], [$$2]))]])
# ,[$5],[$6],...,[$m]_m4_popdef([_m4_s])
# before calling m4_shift(_m4_s($@)).
m4_define([_m4_shiftn],
[m4_if(m4_incr([$1]), [$#], [], [m4_define([_m4_s],
m4_pushdef([_m4_s])_m4_for([_m4_s], m4_eval([$1 + 2]), [$#], [1],
[[,]m4_dquote([$]_m4_s)])[_m4_popdef([_m4_s])])m4_shift(_m4_s($@))])])
[m4_if(m4_incr([$1]), [$#], [], [m4_pushdef([_m4_s],
_m4_for(m4_eval([$1 + 2]), [$#], [1],
[[,]m4_dquote($], [)])[_m4_popdef([_m4_s])])m4_shift(_m4_s($@))])])
# m4_do(STRING, ...)
# ------------------
@@ -227,16 +218,16 @@ m4_define([_m4_shiftn],
# $1[]$2[]...[]$n[]_m4_popdef([_m4_do])
m4_define([m4_do],
[m4_if([$#], [0], [],
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [1], [$#], [1],
[$_$0[[]]])[_m4_popdef([_$0])])_$0($@)])])
[m4_pushdef([_$0], _m4_for([1], [$#], [1],
[$], [[[]]])[_m4_popdef([_$0])])_$0($@)])])
# m4_dquote_elt(ARGS)
# -------------------
# Return ARGS as an unquoted list of double-quoted arguments.
#
# m4_foreach to the rescue. It's easier to shift off the leading comma.
# _m4_foreach to the rescue.
m4_define([m4_dquote_elt],
[m4_shift(m4_foreach([_m4_elt], [$@], [,m4_dquote(_m4_defn([_m4_elt]))]))])
[m4_if([$#], [0], [], [[[$1]]_m4_foreach([,m4_dquote(], [)], $@)])])
# m4_reverse(ARGS)
# ----------------
@@ -246,67 +237,36 @@ m4_define([m4_dquote_elt],
# [$m], [$m-1], ..., [$2], [$1]_m4_popdef([_m4_r])
m4_define([m4_reverse],
[m4_if([$#], [0], [], [$#], [1], [[$1]],
[m4_define([_m4_r], m4_dquote([$$#])m4_pushdef([_m4_r])_m4_for([_m4_r],
m4_decr([$#]), [1], [-1],
[[, ]m4_dquote([$]_m4_r)])[_m4_popdef([_m4_r])])_m4_r($@)])])
[m4_pushdef([_m4_r], [[$$#]]_m4_for(m4_decr([$#]), [1], [-1],
[[, ]m4_dquote($], [)])[_m4_popdef([_m4_r])])_m4_r($@)])])
# m4_map(MACRO, LIST)
# -------------------
# Invoke MACRO($1), MACRO($2) etc. where $1, $2... are the elements
# of LIST. $1, $2... must in turn be lists, appropriate for m4_apply.
#
# m4_map/m4_map_sep only execute once; the speedup comes in fixing
# _m4_map. The mismatch in () is intentional, since $1 supplies the
# opening `(' (but it sure looks odd!). Build the temporary _m4_m:
# $1, [$3])$1, [$4])...$1, [$m])_m4_popdef([_m4_m])
m4_define([_m4_map],
[m4_if([$#], [2], [],
[m4_define([_m4_m], m4_pushdef([_m4_m])_m4_for([_m4_m], [3], [$#], [1],
[$0_([1], _m4_m)])[_m4_popdef([_m4_m])])_m4_m($@)])])
m4_define([_m4_map_],
[[$$1, [$$2])]])
# m4_transform(EXPRESSION, ARG...)
# --------------------------------
# Expand EXPRESSION([ARG]) for each argument. More efficient than
# m4_foreach([var], [ARG...], [EXPRESSION(m4_defn([var]))])
#
# Invoke the temporary macro _m4_transform, defined as:
# $1([$2])[]$1([$3])[]...$1([$m])[]_m4_popdef([_m4_transform])
m4_define([m4_transform],
[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
[$#], [1], [],
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [2], [$#], [1],
[_$0_([1], _$0)])[_m4_popdef([_$0])])_$0($@)])])
m4_define([_m4_transform_],
[[$$1([$$2])[]]])
# m4_transform_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...)
# --------------------------------------------------------------
# m4_map_args_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...)
# -------------------------------------------------------------
# Perform a pairwise grouping of consecutive ARGs, by expanding
# EXPRESSION([ARG1], [ARG2]). If there are an odd number of ARGs, the
# final argument is expanded with END-EXPR([ARGn]).
#
# Build the temporary macro _m4_transform_pair, with the $2([$m+1])
# Build the temporary macro _m4_map_args_pair, with the $2([$m+1])
# only output if $# is odd:
# $1([$3], [$4])[]$1([$5], [$6])[]...$1([$m-1],
# [$m])[]m4_default([$2], [$1])([$m+1])[]_m4_popdef([_m4_transform_pair])
m4_define([m4_transform_pair],
# [$m])[]m4_default([$2], [$1])([$m+1])[]_m4_popdef([_m4_map_args_pair])
m4_define([m4_map_args_pair],
[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
[$#], [1], [m4_fatal([$0: too few arguments: $#: $1])],
[$#], [2], [],
[$#], [3], [m4_default([$2], [$1])([$3])[]],
[m4_define([_$0], m4_pushdef([_$0])_m4_for([_$0], [3],
m4_eval([$# / 2 * 2 - 1]), [2], [_$0_([1], _$0, m4_incr(_$0))])_$0_end(
[m4_pushdef([_$0], _m4_for([3],
m4_eval([$# / 2 * 2 - 1]), [2], [_$0_(], [)])_$0_end(
[1], [2], [$#])[_m4_popdef([_$0])])_$0($@)])])
m4_define([_m4_transform_pair_],
m4_define([_m4_map_args_pair_],
[$0_([1], [$1], m4_incr([$1]))])
m4_define([_m4_map_args_pair__],
[[$$1([$$2], [$$3])[]]])
m4_define([_m4_transform_pair_end],
m4_define([_m4_map_args_pair_end],
[m4_if(m4_eval([$3 & 1]), [1], [[m4_default([$$2], [$$1])([$$3])[]]])])
# m4_join(SEP, ARG1, ARG2...)
@@ -316,23 +276,23 @@ m4_define([_m4_transform_pair_end],
#
# Use a self-modifying separator, since we don't know how many
# arguments might be skipped before a separator is first printed, but
# be careful if the separator contains $. m4_foreach to the rescue.
# be careful if the separator contains $. _m4_foreach to the rescue.
m4_define([m4_join],
[m4_pushdef([_m4_sep], [m4_define([_m4_sep], _m4_defn([m4_echo]))])]dnl
[m4_foreach([_m4_arg], [m4_shift($@)],
[m4_ifset([_m4_arg], [_m4_sep([$1])_m4_defn([_m4_arg])])])]dnl
[_m4_popdef([_m4_sep])])
[_m4_foreach([_$0([$1],], [)], $@)_m4_popdef([_m4_sep])])
m4_define([_m4_join],
[m4_if([$2], [], [], [_m4_sep([$1])[$2]])])
# m4_joinall(SEP, ARG1, ARG2...)
# ------------------------------
# Produce ARG1SEPARG2...SEPARGn. An empty ARG results in back-to-back SEP.
# No expansion is performed on SEP or ARGs.
#
# A bit easier than m4_join. m4_foreach to the rescue.
# A bit easier than m4_join. _m4_foreach to the rescue.
m4_define([m4_joinall],
[[$2]m4_if(m4_eval([$# <= 2]), [1], [],
[m4_foreach([_m4_arg], [m4_shift2($@)],
[[$1]_m4_defn([_m4_arg])])])])
[_m4_foreach([$1], [], m4_shift($@))])])
# m4_list_cmp(A, B)
# -----------------
@@ -346,24 +306,26 @@ m4_define([m4_joinall],
# is found. For example, m4_list_cmp([1], [1,2]) creates _m4_cmp as
# m4_if(m4_eval([($1) != ($3)]), [1], [m4_cmp([$1], [$3])],
# m4_eval([($2) != ($4)]), [1], [m4_cmp([$2], [$4])],
# [0]_m4_popdef([_m4_cmp], [_m4_size]))
# then calls _m4_cmp([1+0], [0], [1], [2+0])
# [0]_m4_popdef([_m4_cmp]))
# then calls _m4_cmp([1+0], [0*2], [1], [2+0])
m4_define([_m4_list_cmp_raw],
[m4_if([$1], [$2], 0, [m4_pushdef(
[_m4_size])_m4_list_cmp($1+0_m4_list_pad(m4_count($1), m4_count($2)),
$2+0_m4_list_pad(m4_count($2), m4_count($1)))])])
[m4_if([$1], [$2], 0,
[_m4_list_cmp($1+0_m4_list_pad(m4_count($1), m4_count($2)),
$2+0_m4_list_pad(m4_count($2), m4_count($1)))])])
m4_define([_m4_list_pad],
[m4_if(m4_eval($1 < $2), [1],
[_m4_for([_m4_size], m4_incr([$1]), [$2], [1], [,0])])])
[_m4_for(m4_incr([$1]), [$2], [1], [,0*])])])
m4_define([_m4_list_cmp],
[m4_define([_m4_size], m4_eval([$# >> 1]))]dnl
[m4_define([_m4_cmp], m4_pushdef([_m4_cmp])[m4_if(]_m4_for([_m4_cmp],
[1], _m4_size, [1], [$0_(_m4_cmp, m4_eval(_m4_cmp + _m4_size))])[
[0]_m4_popdef([_m4_cmp], [_m4_size]))])_m4_cmp($@)])
[m4_pushdef([_m4_cmp], [m4_if(]_m4_for(
[1], m4_eval([$# >> 1]), [1], [$0_(], [,]m4_eval([$# >> 1])[)])[
[0]_m4_popdef([_m4_cmp]))])_m4_cmp($@)])
m4_define([_m4_list_cmp_],
[$0_([$1], m4_eval([$1 + $2]))])
m4_define([_m4_list_cmp__],
[[m4_eval([($$1) != ($$2)]), [1], [m4_cmp([$$1], [$$2])],
]])
@@ -373,12 +335,12 @@ m4_define([_m4_list_cmp_],
# Return the decimal value of the maximum (or minimum) in a series of
# integer expressions.
#
# m4_foreach to the rescue; we only need to replace _m4_minmax. Here,
# _m4_foreach to the rescue; we only need to replace _m4_minmax. Here,
# we need a temporary macro to track the best answer so far, so that
# the foreach expression is tractable.
m4_define([_m4_minmax],
[m4_pushdef([_m4_best], m4_eval([$2]))m4_foreach([_m4_arg], [m4_shift2($@)],
[m4_define([_m4_best], $1(_m4_best, _m4_defn([_m4_arg])))])]dnl
[m4_pushdef([_m4_best], m4_eval([$2]))_m4_foreach(
[m4_define([_m4_best], $1(_m4_best,], [))], m4_shift($@))]dnl
[_m4_best[]_m4_popdef([_m4_best])])
# m4_set_add_all(SET, VALUE...)
@@ -386,15 +348,15 @@ m4_define([_m4_minmax],
# Add each VALUE into SET. This is O(n) in the number of VALUEs, and
# can be faster than calling m4_set_add for each VALUE.
#
# m4_foreach to the rescue. If no deletions have occurred, then avoid
# the speed penalty of m4_set_add.
# _m4_foreach to the rescue. If no deletions have occurred, then
# avoid the speed penalty of m4_set_add.
m4_define([m4_set_add_all],
[m4_if([$#], [0], [], [$#], [1], [],
[m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1])
+ m4_len(m4_foreach([_m4_arg], [m4_shift($@)],
m4_ifdef([_m4_set_cleanup($1)],
[[m4_set_add([$1], _m4_defn([_m4_arg]))]],
[[m4_ifdef([_m4_set([$1],]_m4_defn([_m4_arg])[)], [],
[m4_define([_m4_set([$1],]_m4_defn([_m4_arg])[)],
[1])m4_pushdef([_m4_set([$1])],
_m4_defn([_m4_arg]))-])]])))))])])
+ m4_len(_m4_foreach(m4_ifdef([_m4_set_cleanup($1)],
[[m4_set_add]], [[_$0]])[([$1],], [)], $@))))])])
m4_define([_m4_set_add_all],
[m4_ifdef([_m4_set([$1],$2)], [],
[m4_define([_m4_set([$1],$2)],
[1])m4_pushdef([_m4_set([$1])], [$2])-])])

154
gnuwin32/bin/data/stack.hh Normal file
View File

@@ -0,0 +1,154 @@
# C++ skeleton for Bison
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_pushdef([b4_copyright_years],
[2002-2013])
# b4_stack_define
# ---------------
m4_define([b4_stack_define],
[[ template <class T, class S = std::vector<T> >
class stack
{
public:
// Hide our reversed order.
typedef typename S::reverse_iterator iterator;
typedef typename S::const_reverse_iterator const_iterator;
stack ()
: seq_ ()
{
}
stack (unsigned int n)
: seq_ (n)
{
}
inline
T&
operator[] (unsigned int i)
{
return seq_[seq_.size () - 1 - i];
}
inline
const T&
operator[] (unsigned int i) const
{
return seq_[seq_.size () - 1 - i];
}
/// Steal the contents of \a t.
///
/// Close to move-semantics.
inline
void
push (T& t)
{
seq_.push_back (T());
operator[](0).move (t);
}
inline
void
pop (unsigned int n = 1)
{
for (; n; --n)
seq_.pop_back ();
}
void
clear ()
{
seq_.clear ();
}
inline
typename S::size_type
size () const
{
return seq_.size ();
}
inline
const_iterator
begin () const
{
return seq_.rbegin ();
}
inline
const_iterator
end () const
{
return seq_.rend ();
}
private:
stack (const stack&);
stack& operator= (const stack&);
/// The wrapped container.
S seq_;
};
/// Present a slice of the top of a stack.
template <class T, class S = stack<T> >
class slice
{
public:
slice (const S& stack, unsigned int range)
: stack_ (stack)
, range_ (range)
{
}
inline
const T&
operator [] (unsigned int i) const
{
return stack_[range_ - i];
}
private:
const S& stack_;
unsigned int range_;
};
]])
b4_defines_if(
[b4_output_begin([b4_dir_prefix[]stack.hh])
b4_copyright([Stack handling for Bison parsers in C++])[
/**
** \file ]b4_dir_prefix[stack.hh
** Define the ]b4_namespace_ref[::stack class.
*/
]b4_cpp_guard_open([b4_dir_prefix[]stack.hh])[
# 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])

View File

@@ -0,0 +1,362 @@
# C++ skeleton for Bison
# Copyright (C) 2002-2013 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/>.
## --------- ##
## variant. ##
## --------- ##
# b4_symbol_variant(YYTYPE, YYVAL, ACTION, [ARGS])
# ------------------------------------------------
# Run some ACTION ("build", or "destroy") on YYVAL of symbol type
# YYTYPE.
m4_define([b4_symbol_variant],
[m4_pushdef([b4_dollar_dollar],
[$2.$3< $][3 > (m4_shift3($@))])dnl
switch ($1)
{
b4_type_foreach([b4_type_action_])[]dnl
default:
break;
}
m4_popdef([b4_dollar_dollar])dnl
])
# _b4_char_sizeof_counter
# -----------------------
# A counter used by _b4_char_sizeof_dummy to create fresh symbols.
m4_define([_b4_char_sizeof_counter],
[0])
# _b4_char_sizeof_dummy
# ---------------------
# At each call return a new C++ identifier.
m4_define([_b4_char_sizeof_dummy],
[m4_define([_b4_char_sizeof_counter], m4_incr(_b4_char_sizeof_counter))dnl
dummy[]_b4_char_sizeof_counter])
# b4_char_sizeof(SYMBOL-NUMS)
# ---------------------------
# To be mapped on the list of type names to produce:
#
# char dummy1[sizeof(type_name_1)];
# char dummy2[sizeof(type_name_2)];
#
# for defined type names.
m4_define([b4_char_sizeof],
[b4_symbol_if([$1], [has_type],
[
m4_map([ b4_symbol_tag_comment], [$@])dnl
char _b4_char_sizeof_dummy@{sizeof(b4_symbol([$1], [type]))@};
])])
# b4_variant_includes
# -------------------
# The needed includes for variants support.
m4_define([b4_variant_includes],
[b4_parse_assert_if([[#include <typeinfo>]])[
#ifndef YYASSERT
# include <cassert>
# define YYASSERT assert
#endif
]])
# b4_variant_define
# -----------------
# Define "variant".
m4_define([b4_variant_define],
[[ /// A char[S] buffer to store and retrieve objects.
///
/// Sort of a variant, but does not keep track of the nature
/// of the stored data, since that knowledge is available
/// via the current state.
template <size_t S>
struct variant
{
/// Type of *this.
typedef variant<S> self_type;
/// Empty construction.
variant ()]b4_parse_assert_if([
: yytname_ (YY_NULL)])[
{}
/// Construct and fill.
template <typename T>
variant (const T& t)]b4_parse_assert_if([
: yytname_ (typeid (T).name ())])[
{
YYASSERT (sizeof (T) <= S);
new (yyas_<T> ()) T (t);
}
/// Destruction, allowed only if empty.
~variant ()
{]b4_parse_assert_if([
YYASSERT (!yytname_);
])[}
/// Instantiate an empty \a T in here.
template <typename T>
T&
build ()
{]b4_parse_assert_if([
YYASSERT (!yytname_);
YYASSERT (sizeof (T) <= S);
yytname_ = typeid (T).name ();])[
return *new (yyas_<T> ()) T;
}
/// Instantiate a \a T in here from \a t.
template <typename T>
T&
build (const T& t)
{]b4_parse_assert_if([
YYASSERT (!yytname_);
YYASSERT (sizeof (T) <= S);
yytname_ = typeid (T).name ();])[
return *new (yyas_<T> ()) T (t);
}
/// Accessor to a built \a T.
template <typename T>
T&
as ()
{]b4_parse_assert_if([
YYASSERT (yytname_ == typeid (T).name ());
YYASSERT (sizeof (T) <= S);])[
return *yyas_<T> ();
}
/// Const accessor to a built \a T (for %printer).
template <typename T>
const T&
as () const
{]b4_parse_assert_if([
YYASSERT (yytname_ == typeid (T).name ());
YYASSERT (sizeof (T) <= S);])[
return *yyas_<T> ();
}
/// Swap the content with \a other, of same type.
///
/// Both variants must be built beforehand, because swapping the actual
/// data requires reading it (with as()), and this is not possible on
/// unconstructed variants: it would require some dynamic testing, which
/// should not be the variant's responsability.
/// Swapping between built and (possibly) non-built is done with
/// variant::move ().
template <typename T>
void
swap (self_type& other)
{]b4_parse_assert_if([
YYASSERT (yytname_);
YYASSERT (yytname_ == other.yytname_);])[
std::swap (as<T> (), other.as<T> ());
}
/// Move the content of \a other to this.
///
/// Destroys \a other.
template <typename T>
void
move (self_type& other)
{]b4_parse_assert_if([
YYASSERT (!yytname_);])[
build<T> ();
swap<T> (other);
other.destroy<T> ();
}
/// Copy the content of \a other to this.
template <typename T>
void
copy (const self_type& other)
{
build<T> (other.as<T> ());
}
/// Destroy the stored \a T.
template <typename T>
void
destroy ()
{
as<T> ().~T ();]b4_parse_assert_if([
yytname_ = YY_NULL;])[
}
private:
/// Prohibit blind copies.
self_type& operator=(const self_type&);
variant (const self_type&);
/// Accessor to raw memory as \a T.
template <typename T>
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
{
/// Strongest alignment constraints.
long double yyalign_me;
/// 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.
const char *yytname_;])[
};
]])
## -------------------------- ##
## Adjustments for variants. ##
## -------------------------- ##
# b4_value_type_declare
# ---------------------
# Declare semantic_type.
m4_define([b4_value_type_declare],
[[ /// An auxiliary type to compute the largest semantic type.
union union_type
{]b4_type_foreach([b4_char_sizeof])[};
/// Symbol semantic values.
typedef variant<sizeof(union_type)> semantic_type;][]dnl
])
# How the semantic value is extracted when using variants.
# b4_symbol_value(VAL, [TYPE])
# ----------------------------
m4_define([b4_symbol_value],
[m4_ifval([$2],
[$1.as< $2 > ()],
[$1])])
# b4_symbol_value_template(VAL, [TYPE])
# -------------------------------------
# Same as b4_symbol_value, but used in a template method.
m4_define([b4_symbol_value_template],
[m4_ifval([$2],
[$1.template as< $2 > ()],
[$1])])
## ------------- ##
## make_SYMBOL. ##
## ------------- ##
# b4_symbol_constructor_declare_(SYMBOL-NUMBER)
# ---------------------------------------------
# Declare the overloaded version of make_symbol for the (common) type of
# these SYMBOL-NUMBERS. Use at class-level.
m4_define([b4_symbol_constructor_declare_],
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
[ static inline
symbol_type
make_[]b4_symbol_([$1], [id]) (dnl
b4_join(b4_symbol_if([$1], [has_type],
[const b4_symbol([$1], [type])& v]),
b4_locations_if([const location_type& l])));
])])])
# b4_symbol_constructor_declare
# -----------------------------
# Declare symbol constructors for all the value types.
# Use at class-level.
m4_define([b4_symbol_constructor_declare],
[ // Symbol constructors declarations.
b4_symbol_foreach([b4_symbol_constructor_declare_])])
# b4_symbol_constructor_define_(SYMBOL-NUMBER)
# --------------------------------------------
# Define symbol constructor for this SYMBOL-NUMBER.
m4_define([b4_symbol_constructor_define_],
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
[ b4_parser_class_name::symbol_type
b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl
b4_join(b4_symbol_if([$1], [has_type],
[const b4_symbol([$1], [type])& v]),
b4_locations_if([const location_type& l])))
{
return symbol_type (b4_join([token::b4_symbol([$1], [id])],
b4_symbol_if([$1], [has_type], [v]),
b4_locations_if([l])));
}
])])])
# b4_basic_symbol_constructor_declare
# -----------------------------------
# Generate a constructor declaration for basic_symbol from given type.
m4_define([b4_basic_symbol_constructor_declare],
[[
basic_symbol (]b4_join(
[typename Base::kind_type t],
b4_symbol_if([$1], [has_type], const b4_symbol([$1], [type])[ v]),
b4_locations_if([const location_type& l]))[);
]])
# b4_basic_symbol_constructor_define
# ----------------------------------
# Generate a constructor implementation for basic_symbol from given type.
m4_define([b4_basic_symbol_constructor_define],
[[
template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
[typename Base::kind_type t],
b4_symbol_if([$1], [has_type], const b4_symbol([$1], [type])[ v]),
b4_locations_if([const location_type& l]))[)
: Base (t)
, value (]b4_symbol_if([$1], [has_type], [v])[)]b4_locations_if([
, location (l)])[
{}
]])
# b4_symbol_constructor_define
# ----------------------------
# Define the overloaded versions of make_symbol for all the value types.
m4_define([b4_symbol_constructor_define],
[ // Implementation of make_symbol for each symbol type.
b4_symbol_foreach([b4_symbol_constructor_define_])])

View File

@@ -3,7 +3,7 @@
<!--
bison.xsl - common templates for Bison XSLT.
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -90,4 +90,16 @@
<xsl:value-of select="string-length(translate($conflict-data, 's', ''))"/>
</xsl:template>
<xsl:template name="space">
<xsl:param name="repeat">0</xsl:param>
<xsl:param name="fill" select="' '"/>
<xsl:if test="number($repeat) &gt;= 1">
<xsl:call-template name="space">
<xsl:with-param name="repeat" select="$repeat - 1"/>
<xsl:with-param name="fill" select="$fill"/>
</xsl:call-template>
<xsl:value-of select="$fill"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,397 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
xml2dot.xsl - transform Bison XML Report into DOT.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Written by Wojciech Polak <polak@gnu.org>.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bison="http://www.gnu.org/software/bison/">
<xsl:import href="bison.xsl"/>
<xsl:output method="text" encoding="UTF-8" indent="no"/>
<xsl:template match="/">
<xsl:apply-templates select="bison-xml-report"/>
</xsl:template>
<xsl:template match="bison-xml-report">
<xsl:text>// Generated by GNU Bison </xsl:text>
<xsl:value-of select="@version"/>
<xsl:text>.&#10;</xsl:text>
<xsl:text>// Report bugs to &lt;</xsl:text>
<xsl:value-of select="@bug-report"/>
<xsl:text>&gt;.&#10;</xsl:text>
<xsl:text>// Home page: &lt;</xsl:text>
<xsl:value-of select="@url"/>
<xsl:text>&gt;.&#10;&#10;</xsl:text>
<xsl:apply-templates select="automaton">
<xsl:with-param name="filename" select="filename"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="automaton">
<xsl:param name="filename"/>
<xsl:text>digraph "</xsl:text>
<xsl:call-template name="escape">
<xsl:with-param name="subject" select="$filename"/>
</xsl:call-template>
<xsl:text>"&#10;{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]
</xsl:text>
<xsl:apply-templates select="state"/>
<xsl:text>}&#10;</xsl:text>
</xsl:template>
<xsl:template match="automaton/state">
<xsl:call-template name="output-node">
<xsl:with-param name="number" select="@number"/>
<xsl:with-param name="label">
<xsl:apply-templates select="itemset/item"/>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="actions/transitions"/>
<xsl:apply-templates select="actions/reductions">
<xsl:with-param name="staten">
<xsl:value-of select="@number"/>
</xsl:with-param>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="actions/reductions">
<xsl:param name="staten"/>
<xsl:for-each select='reduction'>
<!-- These variables are needed because the current context can't be
refered to directly in XPath expressions. -->
<xsl:variable name="rul">
<xsl:value-of select="@rule"/>
</xsl:variable>
<xsl:variable name="ena">
<xsl:value-of select="@enabled"/>
</xsl:variable>
<!-- The foreach's body is protected by this, so that we are actually
going to iterate once per reduction rule, and not per lookahead. -->
<xsl:if test='not(preceding-sibling::*[@rule=$rul and @enabled=$ena])'>
<xsl:variable name="rule">
<xsl:choose>
<!-- The acceptation state is refered to as 'accept' in the XML, but
just as '0' in the DOT. -->
<xsl:when test="@rule='accept'">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@rule"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- The edge's beginning -->
<xsl:call-template name="reduction-edge-start">
<xsl:with-param name="state" select="$staten"/>
<xsl:with-param name="rule" select="$rule"/>
<xsl:with-param name="enabled" select="@enabled"/>
</xsl:call-template>
<!-- The edge's tokens -->
<!-- Don't show labels for the default action. In other cases, there will
always be at least one token, so 'label="[]"' will not occur. -->
<xsl:if test='$rule!=0 and not(../reduction[@enabled=$ena and @rule=$rule and @symbol="$default"])'>
<xsl:text>label="[</xsl:text>
<xsl:for-each select='../reduction[@enabled=$ena and @rule=$rule]'>
<xsl:call-template name="escape">
<xsl:with-param name="subject" select="@symbol"/>
</xsl:call-template>
<xsl:if test="position() != last ()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>]", </xsl:text>
</xsl:if>
<!-- The edge's end -->
<xsl:text>style=solid]&#10;</xsl:text>
<!-- The diamond representing the reduction -->
<xsl:call-template name="reduction-node">
<xsl:with-param name="state" select="$staten"/>
<xsl:with-param name="rule" select="$rule"/>
<xsl:with-param name="color">
<xsl:choose>
<xsl:when test='@enabled="true"'>
<xsl:text>3</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>5</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="actions/transitions">
<xsl:apply-templates select="transition"/>
</xsl:template>
<xsl:template match="item">
<xsl:param name="prev-rule-number"
select="preceding-sibling::item[1]/@rule-number"/>
<xsl:apply-templates select="key('bison:ruleByNumber', @rule-number)">
<xsl:with-param name="point" select="@point"/>
<xsl:with-param name="num" select="@rule-number"/>
<xsl:with-param name="prev-lhs"
select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]"
/>
</xsl:apply-templates>
<xsl:apply-templates select="lookaheads"/>
</xsl:template>
<xsl:template match="rule">
<xsl:param name="point"/>
<xsl:param name="num"/>
<xsl:param name="prev-lhs"/>
<xsl:text>&#10;</xsl:text>
<xsl:choose>
<xsl:when test="$num &lt; 10">
<xsl:text> </xsl:text>
</xsl:when>
<xsl:when test="$num &lt; 100">
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text></xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$num"/>
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="$prev-lhs = lhs[text()]">
<xsl:call-template name="lpad">
<xsl:with-param name="str" select="'|'"/>
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="lhs"/>
<xsl:text>:</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$point = 0">
<xsl:text> .</xsl:text>
</xsl:if>
<xsl:for-each select="rhs/symbol|rhs/empty">
<xsl:apply-templates select="."/>
<xsl:if test="$point = position()">
<xsl:text> .</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="symbol">
<xsl:text> </xsl:text>
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="empty"/>
<xsl:template match="lookaheads">
<xsl:text> [</xsl:text>
<xsl:apply-templates select="symbol"/>
<xsl:text>]</xsl:text>
</xsl:template>
<xsl:template match="lookaheads/symbol">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="reduction-edge-start">
<xsl:param name="state"/>
<xsl:param name="rule"/>
<xsl:param name="enabled"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$state"/>
<xsl:text> -> "</xsl:text>
<xsl:value-of select="$state"/>
<xsl:text>R</xsl:text>
<xsl:value-of select="$rule"/>
<xsl:if test='$enabled = "false"'>
<xsl:text>d</xsl:text>
</xsl:if>
<xsl:text>" [</xsl:text>
</xsl:template>
<xsl:template name="reduction-node">
<xsl:param name="state"/>
<xsl:param name="rule"/>
<xsl:param name="color"/>
<xsl:text> "</xsl:text>
<xsl:value-of select="$state"/>
<xsl:text>R</xsl:text>
<xsl:value-of select="$rule"/>
<xsl:if test="$color = 5">
<xsl:text>d</xsl:text>
</xsl:if>
<xsl:text>" [label="</xsl:text>
<xsl:choose>
<xsl:when test="$rule = 0">
<xsl:text>Acc", fillcolor=1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>R</xsl:text>
<xsl:value-of select="$rule"/>
<xsl:text>", fillcolor=</xsl:text>
<xsl:value-of select="$color"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>, shape=diamond, style=filled]&#10;</xsl:text>
</xsl:template>
<xsl:template match="transition">
<xsl:call-template name="output-edge">
<xsl:with-param name="src" select="../../../@number"/>
<xsl:with-param name="dst" select="@state"/>
<xsl:with-param name="style">
<xsl:choose>
<xsl:when test="@symbol = 'error'">
<xsl:text>dotted</xsl:text>
</xsl:when>
<xsl:when test="@type = 'shift'">
<xsl:text>solid</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>dashed</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="label">
<xsl:if test="not(@symbol = 'error')">
<xsl:value-of select="@symbol"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="output-node">
<xsl:param name="number"/>
<xsl:param name="label"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$number"/>
<xsl:text> [label="</xsl:text>
<xsl:text>State </xsl:text>
<xsl:value-of select="$number"/>
<xsl:text>\n</xsl:text>
<xsl:call-template name="escape">
<xsl:with-param name="subject" select="$label"/>
</xsl:call-template>
<xsl:text>\l"]&#10;</xsl:text>
</xsl:template>
<xsl:template name="output-edge">
<xsl:param name="src"/>
<xsl:param name="dst"/>
<xsl:param name="style"/>
<xsl:param name="label"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$src"/>
<xsl:text> -> </xsl:text>
<xsl:value-of select="$dst"/>
<xsl:text> [style=</xsl:text>
<xsl:value-of select="$style"/>
<xsl:if test="$label and $label != ''">
<xsl:text> label="</xsl:text>
<xsl:call-template name="escape">
<xsl:with-param name="subject" select="$label"/>
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<xsl:text>]&#10;</xsl:text>
</xsl:template>
<xsl:template name="escape">
<xsl:param name="subject"/> <!-- required -->
<xsl:call-template name="string-replace">
<xsl:with-param name="subject">
<xsl:call-template name="string-replace">
<xsl:with-param name="subject">
<xsl:call-template name="string-replace">
<xsl:with-param name="subject" select="$subject"/>
<xsl:with-param name="search" select="'\'"/>
<xsl:with-param name="replace" select="'\\'"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="search" select="'&quot;'"/>
<xsl:with-param name="replace" select="'\&quot;'"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="search" select="'&#10;'"/>
<xsl:with-param name="replace" select="'\l'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="string-replace">
<xsl:param name="subject"/>
<xsl:param name="search"/>
<xsl:param name="replace"/>
<xsl:choose>
<xsl:when test="contains($subject, $search)">
<xsl:variable name="before" select="substring-before($subject, $search)"/>
<xsl:variable name="after" select="substring-after($subject, $search)"/>
<xsl:value-of select="$before"/>
<xsl:value-of select="$replace"/>
<xsl:call-template name="string-replace">
<xsl:with-param name="subject" select="$after"/>
<xsl:with-param name="search" select="$search"/>
<xsl:with-param name="replace" select="$replace"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$subject"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="lpad">
<xsl:param name="str" select="''"/>
<xsl:param name="pad" select="0"/>
<xsl:variable name="diff" select="$pad - string-length($str)" />
<xsl:choose>
<xsl:when test="$diff &lt; 0">
<xsl:value-of select="$str"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space">
<xsl:with-param name="repeat" select="$diff"/>
</xsl:call-template>
<xsl:value-of select="$str"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -3,7 +3,7 @@
<!--
xml2text.xsl - transform Bison XML Report into plain text.
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -230,7 +230,7 @@
<xsl:template match="automaton/state">
<xsl:param name="pad"/>
<xsl:text>&#10;&#10;</xsl:text>
<xsl:text>state </xsl:text>
<xsl:text>State </xsl:text>
<xsl:value-of select="@number"/>
<xsl:text>&#10;&#10;</xsl:text>
<xsl:apply-templates select="itemset/item">
@@ -253,9 +253,9 @@
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates select="transition[@type = $type]">
<xsl:with-param name="pad">
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="transition[@type = $type]"/>
</xsl:call-template>
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="transition[@type = $type]"/>
</xsl:call-template>
</xsl:with-param>
</xsl:apply-templates>
</xsl:if>
@@ -266,9 +266,9 @@
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates select="error">
<xsl:with-param name="pad">
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="error"/>
</xsl:call-template>
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="error"/>
</xsl:call-template>
</xsl:with-param>
</xsl:apply-templates>
</xsl:if>
@@ -279,9 +279,9 @@
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates select="reduction">
<xsl:with-param name="pad">
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="reduction"/>
</xsl:call-template>
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="reduction"/>
</xsl:call-template>
</xsl:with-param>
</xsl:apply-templates>
</xsl:if>
@@ -290,7 +290,7 @@
<xsl:template match="item">
<xsl:param name="pad"/>
<xsl:param name="prev-rule-number"
select="preceding-sibling::item[1]/@rule-number"/>
select="preceding-sibling::item[1]/@rule-number"/>
<xsl:apply-templates
select="key('bison:ruleByNumber', current()/@rule-number)"
>
@@ -329,14 +329,14 @@
<xsl:choose>
<xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
<xsl:call-template name="lpad">
<xsl:with-param name="str" select="'|'"/>
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
<xsl:with-param name="str" select="'|'"/>
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
<xsl:call-template name="lpad">
<xsl:with-param name="str" select="'|'"/>
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
<xsl:with-param name="str" select="'|'"/>
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
@@ -373,7 +373,7 @@
</xsl:template>
<xsl:template match="empty">
<xsl:text> /* empty */</xsl:text>
<xsl:text> %empty</xsl:text>
</xsl:template>
<xsl:template match="lookaheads">
@@ -442,7 +442,7 @@
<xsl:value-of select="@rule"/>
<xsl:text> (</xsl:text>
<xsl:value-of
select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"/>
select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
@@ -479,9 +479,9 @@
<xsl:variable name="longest">
<xsl:for-each select="$node">
<xsl:sort data-type="number" select="string-length(@symbol)"
order="descending"/>
order="descending"/>
<xsl:if test="position() = 1">
<xsl:value-of select="string-length(@symbol)"/>
<xsl:value-of select="string-length(@symbol)"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
@@ -498,7 +498,7 @@
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space">
<xsl:with-param name="repeat" select="$diff"/>
<xsl:with-param name="repeat" select="$diff"/>
</xsl:call-template>
<xsl:value-of select="$str"/>
</xsl:otherwise>
@@ -516,24 +516,12 @@
<xsl:otherwise>
<xsl:value-of select="$str"/>
<xsl:call-template name="space">
<xsl:with-param name="repeat" select="$diff"/>
<xsl:with-param name="repeat" select="$diff"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="space">
<xsl:param name="repeat">0</xsl:param>
<xsl:param name="fill" select="' '"/>
<xsl:if test="number($repeat) &gt;= 1">
<xsl:call-template name="space">
<xsl:with-param name="repeat" select="$repeat - 1"/>
<xsl:with-param name="fill" select="$fill"/>
</xsl:call-template>
<xsl:value-of select="$fill"/>
</xsl:if>
</xsl:template>
<xsl:template name="line-wrap">
<xsl:param name="line-length"/> <!-- required -->
<xsl:param name="first-line-length" select="$line-length"/>

View File

@@ -3,7 +3,7 @@
<!--
xml2html.xsl - transform Bison XML Report into XHTML.
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -31,32 +31,32 @@
<xsl:import href="bison.xsl"/>
<xsl:output method="xml" encoding="UTF-8"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
indent="yes"/>
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
indent="yes"/>
<xsl:template match="/">
<html>
<head>
<title>
<xsl:value-of select="bison-xml-report/filename"/>
<xsl:text> - GNU Bison XML Automaton Report</xsl:text>
<xsl:value-of select="bison-xml-report/filename"/>
<xsl:text> - GNU Bison XML Automaton Report</xsl:text>
</title>
<style type="text/css"><![CDATA[
body {
font-family: "Nimbus Sans L", Arial, sans-serif;
font-size: 9pt;
font-size: 9pt;
}
a:link {
color: #1f00ff;
text-decoration: none;
color: #1f00ff;
text-decoration: none;
}
a:visited {
color: #1f00ff;
text-decoration: none;
color: #1f00ff;
text-decoration: none;
}
a:hover {
color: red;
color: red;
}
#menu a {
text-decoration: underline;
@@ -109,21 +109,21 @@
<li>
<a href="#reductions">Reductions</a>
<ul class="lower-alpha">
<li><a href="#nonterminals_useless_in_grammar">Nonterminals useless in grammar</a></li>
<li><a href="#terminals_unused_in_grammar">Terminals unused in grammar</a></li>
<li><a href="#rules_useless_in_grammar">Rules useless in grammar</a></li>
<xsl:if test="grammar/rules/rule[@usefulness='useless-in-parser']">
<li><a href="#rules_useless_in_parser">Rules useless in parser due to conflicts</a></li>
</xsl:if>
<li><a href="#nonterminals_useless_in_grammar">Nonterminals useless in grammar</a></li>
<li><a href="#terminals_unused_in_grammar">Terminals unused in grammar</a></li>
<li><a href="#rules_useless_in_grammar">Rules useless in grammar</a></li>
<xsl:if test="grammar/rules/rule[@usefulness='useless-in-parser']">
<li><a href="#rules_useless_in_parser">Rules useless in parser due to conflicts</a></li>
</xsl:if>
</ul>
</li>
<li><a href="#conflicts">Conflicts</a></li>
<li>
<a href="#grammar">Grammar</a>
<ul class="lower-alpha">
<li><a href="#grammar">Itemset</a></li>
<li><a href="#terminals">Terminal symbols</a></li>
<li><a href="#nonterminals">Nonterminal symbols</a></li>
<li><a href="#grammar">Itemset</a></li>
<li><a href="#terminals">Terminal symbols</a></li>
<li><a href="#nonterminals">Nonterminal symbols</a></li>
</ul>
</li>
<li><a href="#automaton">Automaton</a></li>
@@ -154,9 +154,9 @@
<xsl:if test="nonterminal[@usefulness='useless-in-grammar']">
<p class="pre">
<xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']">
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>&#10;</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>&#10;</xsl:text>
</xsl:for-each>
<xsl:text>&#10;&#10;</xsl:text>
</p>
@@ -173,9 +173,9 @@
<p class="pre">
<xsl:for-each select="terminal[@usefulness='unused-in-grammar']">
<xsl:sort select="@symbol-number" data-type="number"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>&#10;</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>&#10;</xsl:text>
</xsl:for-each>
<xsl:text>&#10;&#10;</xsl:text>
</p>
@@ -381,7 +381,7 @@
<h3>
<a>
<xsl:attribute name="name">
<xsl:value-of select="concat('state_', @number)"/>
<xsl:value-of select="concat('state_', @number)"/>
</xsl:attribute>
</a>
<xsl:text>state </xsl:text>
@@ -410,9 +410,9 @@
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates select="transition[@type = $type]">
<xsl:with-param name="pad">
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="transition[@type = $type]"/>
</xsl:call-template>
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="transition[@type = $type]"/>
</xsl:call-template>
</xsl:with-param>
</xsl:apply-templates>
</xsl:if>
@@ -423,9 +423,9 @@
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates select="error">
<xsl:with-param name="pad">
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="error"/>
</xsl:call-template>
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="error"/>
</xsl:call-template>
</xsl:with-param>
</xsl:apply-templates>
</xsl:if>
@@ -436,9 +436,9 @@
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates select="reduction">
<xsl:with-param name="pad">
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="reduction"/>
</xsl:call-template>
<xsl:call-template name="max-width-symbol">
<xsl:with-param name="node" select="reduction"/>
</xsl:call-template>
</xsl:with-param>
</xsl:apply-templates>
</xsl:if>
@@ -447,7 +447,7 @@
<xsl:template match="item">
<xsl:param name="pad"/>
<xsl:param name="prev-rule-number"
select="preceding-sibling::item[1]/@rule-number"/>
select="preceding-sibling::item[1]/@rule-number"/>
<xsl:apply-templates
select="key('bison:ruleByNumber', current()/@rule-number)"
>
@@ -477,7 +477,7 @@
<xsl:if test="$itemset != 'true'">
<a>
<xsl:attribute name="name">
<xsl:value-of select="concat('rule_', @number)"/>
<xsl:value-of select="concat('rule_', @number)"/>
</xsl:attribute>
</a>
</xsl:if>
@@ -486,19 +486,19 @@
<xsl:choose>
<xsl:when test="$itemset = 'true'">
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('#rule_', @number)"/>
</xsl:attribute>
<xsl:call-template name="lpad">
<xsl:with-param name="str" select="string(@number)"/>
<xsl:with-param name="pad" select="number($pad)"/>
</xsl:call-template>
<xsl:attribute name="href">
<xsl:value-of select="concat('#rule_', @number)"/>
</xsl:attribute>
<xsl:call-template name="lpad">
<xsl:with-param name="str" select="string(@number)"/>
<xsl:with-param name="pad" select="number($pad)"/>
</xsl:call-template>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="lpad">
<xsl:with-param name="str" select="string(@number)"/>
<xsl:with-param name="pad" select="number($pad)"/>
<xsl:with-param name="str" select="string(@number)"/>
<xsl:with-param name="pad" select="number($pad)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
@@ -508,19 +508,19 @@
<xsl:choose>
<xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
<xsl:call-template name="lpad">
<xsl:with-param name="str" select="'|'"/>
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
<xsl:with-param name="str" select="'|'"/>
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
<xsl:call-template name="lpad">
<xsl:with-param name="str" select="'|'"/>
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
<xsl:with-param name="str" select="'|'"/>
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<span class="i">
<xsl:value-of select="lhs"/>
<xsl:value-of select="lhs"/>
</span>
<xsl:text> &#8594;</xsl:text>
</xsl:otherwise>
@@ -589,18 +589,18 @@
<xsl:choose>
<xsl:when test="@type = 'shift'">
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('#state_', @state)"/>
</xsl:attribute>
<xsl:value-of select="concat('shift, and go to state ', @state)"/>
<xsl:attribute name="href">
<xsl:value-of select="concat('#state_', @state)"/>
</xsl:attribute>
<xsl:value-of select="concat('shift, and go to state ', @state)"/>
</a>
</xsl:when>
<xsl:when test="@type = 'goto'">
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('#state_', @state)"/>
</xsl:attribute>
<xsl:value-of select="concat('go to state ', @state)"/>
<xsl:attribute name="href">
<xsl:value-of select="concat('#state_', @state)"/>
</xsl:attribute>
<xsl:value-of select="concat('go to state ', @state)"/>
</a>
</xsl:when>
</xsl:choose>
@@ -637,10 +637,10 @@
</xsl:when>
<xsl:otherwise>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('#rule_', @rule)"/>
</xsl:attribute>
<xsl:value-of select="concat('reduce using rule ', @rule)"/>
<xsl:attribute name="href">
<xsl:value-of select="concat('#rule_', @rule)"/>
</xsl:attribute>
<xsl:value-of select="concat('reduce using rule ', @rule)"/>
</a>
<xsl:text> (</xsl:text>
<xsl:value-of
@@ -687,9 +687,9 @@
<xsl:variable name="longest">
<xsl:for-each select="$node">
<xsl:sort data-type="number" select="string-length(@symbol)"
order="descending"/>
order="descending"/>
<xsl:if test="position() = 1">
<xsl:value-of select="string-length(@symbol)"/>
<xsl:value-of select="string-length(@symbol)"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
@@ -706,7 +706,7 @@
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space">
<xsl:with-param name="repeat" select="$diff"/>
<xsl:with-param name="repeat" select="$diff"/>
</xsl:call-template>
<xsl:value-of select="$str"/>
</xsl:otherwise>
@@ -724,7 +724,7 @@
<xsl:otherwise>
<xsl:value-of select="$str"/>
<xsl:call-template name="space">
<xsl:with-param name="repeat" select="$diff"/>
<xsl:with-param name="repeat" select="$diff"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>

1915
gnuwin32/bin/data/yacc.c Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
gnuwin32/bin/flex.exe Normal file → Executable file

Binary file not shown.

Binary file not shown.

View File

@@ -1,2 +0,0 @@
#! /bin/sh
exec 'c:/progra~1/bison/bin/bison' -y "$@"

View File

@@ -1,54 +0,0 @@
* Bison-2.4.1 for Windows *
===========================
What is it?
-----------
Bison: Yacc-compatible parser generator
Description
-----------
Bison is a general purpose parser generator that converts a grammar description for an LALR(1) context-free grammar into a C program to parse that grammar. Bison can be used to develop a wide range of language parsers, from ones used in simple desk calculators to complex programming languages. Bison is upwardly compatible with Yacc, so any correctly written Yacc grammar should work with Bison without any changes. If you know Yacc, you shouldn't have any trouble using Bison. You do need to be very proficient in C programming to be able to use Bison. Bison is only needed on systems that are used for development. If your system will be used for C development, you should install Bison. The package contains also the -ly library sometimes used by programs using Bison-generated parsers. If you are developing programs using Bison, you might want to link with this library. This library is not required by all Bison-generated parsers, but may be employed by simple programs to supply minimal support for the generated parsers.
Homepage
--------
http://www.gnu.org/software/bison/bison.html
Sources: http://ftp.gnu.org/gnu/bison/bison-2.4.1.tar.gz
System
------
- Win32, i.e. MS-Windows 95 / 98 / ME / NT / 2000 / XP / 2003 / Vista / 2008 with msvcrt.dll
- if msvcrt.dll is not in your Windows/System folder, get it from
Microsoft <http://support.microsoft.com/kb/259403>
or by installing Internet Explorer 4.0 or higher
<http://www.microsoft.com/windows/ie>
- libintl-3 <http://gnuwin32.sourceforge.net/packages/libintl.htm>
- libiconv-2 <http://gnuwin32.sourceforge.net/packages/libiconv.htm>
- regex <http://gnuwin32.sourceforge.net/packages/regex.htm>
- m4 <http://gnuwin32.sourceforge.net/packages/m4.htm>
Notes
-----
- Bugs and questions on this MS-Windows port: gnuwin32@users.sourceforge.net
Package Availability
--------------------
- in: http://gnuwin32.sourceforge.net
Installation
------------
Bison may be installed in any directory, provided the subdirectory structure is maintained. Native language support is also active.
Sources
-------
- bison-2.4.1-src.zip
Compilation
-----------
The package has been compiled with GNU auto-tools, GNU make, and Mingw
(GCC for MS-Windows). Any differences from the original sources are given
in bison-2.4.1-GnuWin32.diffs in bison-2.4.1-src.zip. Libraries needed
for compilation can be found at the lines starting with 'LIBS = ' in the
Makefiles. Usually, these are standard libraries provided with Mingw, or
libraries from the package itself; 'gw32c' refers to the libgw32c package,
which provides MS-Windows substitutes or stubs for functions normally found in
Unix. For more information, see: http://gnuwin32.sourceforge.net/compile.html
and http://gnuwin32.sourceforge.net/packages/libgw32c.htm.

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +0,0 @@
Authors of GNU Bison.
Bison was written primarily by Robert Corbett.
Richard Stallman made it Yacc-compatible.
Wilfred Hansen of Carnegie Mellon University added multicharacter
string literals and other features.

View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
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/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

File diff suppressed because it is too large Load Diff

View File

@@ -1,291 +0,0 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007, 2008 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
6. Often, you can also type `make uninstall' to remove the installed
files again.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *Note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

File diff suppressed because it is too large Load Diff

View File

@@ -1,43 +0,0 @@
This package contains the GNU Bison parser generator.
See the file INSTALL for generic compilation and installation instructions.
See the section FAQ in the documentation (doc/bison.info) for
frequently asked questions. The documentation is also available in
PDF and HTML, provided you have a recent version of Texinfo installed:
run "make pdf" or "make html".
Bison requires GNU m4 1.4.6 or later. See:
ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
Bison can work with pre-1.4.6 distributions of GNU m4 if they are
sufficiently patched, but if you encounter a bug with an older
distribution and report a bug we will probably suggest that you
upgrade to 1.4.6 as the first step in trying to fix it.
Please send bug reports to <bug-bison@gnu.org>. Please include the
version number from `bison --version', and a complete, self-contained
test case in each bug report.
If you have questions about using Bison and the documentation does
not answer them, please send mail to <help-bison@gnu.org>.
-----
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005, 2008 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/>.

View File

@@ -1,30 +0,0 @@
-*- text -*-
This is a test release of this package. Using it more or less
implicitly signs you up to help us find whatever problems you report.
The documentation still needs more work. Suggestions welcome.
Patches even more welcome.
Please send comments and problem reports about this test release to
<bug-bison@gnu.org>. This program will get better only if you report
the problems you encounter.
-----
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Bison.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -1,104 +0,0 @@
Bison was originally written by Robert Corbett. It would not be what
it is today without the invaluable help of these people:
Airy Andre Airy.Andre@edf.fr
Akim Demaille akim@freefriends.org
Albert Chin-A-Young china@thewrittenword.com
Alexander Belopolsky alexb@rentec.com
Alexandre Duret-Lutz adl@src.lip6.fr
Andreas Schwab schwab@suse.de
Andrew Suffield asuffield@users.sourceforge.net
Anthony Heading ajrh@ajrh.net
Arnold Robbins arnold@skeeve.com
Art Haas ahaas@neosoft.com
Baron Schwartz baron@sequent.org
Benoit Perrot benoit.perrot@epita.fr
Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be
Bob Rossi bob@brasko.net
Brandon Lucia blucia@gmail.com
Bruce Lilly blilly@erols.com
Bruno Haible bruno@clisp.org
Charles-Henri de Boysson de-boy_c@epita.fr
Christian Burger cburger@sunysb.edu
Cris Bailiff c.bailiff+bison@awayweb.com
Cris van Pelt cris@amf03054.office.wxs.nl
Csaba Raduly csaba_22@yahoo.co.uk
Daniel Hagerty hag@gnu.org
David J. MacKenzie djm@gnu.org
Derek M. Jones derek@knosof.co.uk
Di-an Jan dianj@freeshell.org
Dick Streefland dick.streefland@altium.nl
Enrico Scholz enrico.scholz@informatik.tu-chemnitz.de
Eric Blake ebb9@byu.net
Evgeny Stambulchik fnevgeny@plasma-gate.weizmann.ac.il
Fabrice Bauzac noon@cote-dazur.com
Florian Krohm florian@edamail.fishkill.ibm.com
Frank Heckenbach frank@g-n-u.de
Frans Englich frans.englich@telia.com
Georg Sauthoff gsauthof@TechFak.Uni-Bielefeld.DE
Goran Uddeborg goeran@uddeborg.se
Guido Trentalancia trentalg@aston.ac.uk
H. Merijn Brand h.m.brand@hccnet.nl
Hans Aberg haberg@matematik.su.se
Jan Nieuwenhuizen janneke@gnu.org
Jesse Thilo jthilo@gnu.org
Jim Kent jkent@arch.sel.sony.com
Jim Meyering jim@meyering.net
Joel E. Denny jdenny@ces.clemson.edu
Juan Manuel Guerrero juan.guerrero@gmx.de
Kees Zeelenberg kzlg@users.sourceforge.net
Keith Browne kbrowne@legato.com
Laurent Mascherpa laurent.mascherpa@epita.fr
Magnus Fromreide magfr@lysator.liu.se
Marc Autret autret_m@epita.fr
Martin Mokrejs mmokrejs@natur.cuni.cz
Martin Nylin martin.nylin@linuxmail.org
Matt Kraai kraai@alumni.cmu.edu
Matt Rosing rosing@peakfive.com
Michael Hayes m.hayes@elec.canterbury.ac.nz
Mickael Labau labau_m@epita.fr
Mike Castle dalgoda@ix.netcom.com
Neil Booth NeilB@earthling.net
Nelson H. F. Beebe beebe@math.utah.edu
Nicolas Burrus nicolas.burrus@epita.fr
Nicolas Tisserand nicolas.tisserand@epita.fr
Noah Friedman friedman@gnu.org
Oleg Smolsky oleg.smolsky@pacific-simulators.co.nz
Paolo Bonzini bonzini@gnu.org
Pascal Bart pascal.bart@epita.fr
Paul Eggert eggert@cs.ucla.edu
Paul Hilfinger Hilfinger@CS.Berkeley.EDU
Per Allansson per@appgate.com
Peter Fales psfales@lucent.com
Peter Hamorsky hamo@upjs.sk
Piotr Gackiewicz gacek@intertel.com.pl
Quoc Peyrot chojin@lrde.epita.fr
R Blake blakers@mac.com
Raja R Harinath harinath@cs.umn.edu
Richard Stallman rms@gnu.org
Robert Anisko anisko_r@epita.fr
Satya Kiran Popuri satyakiran@gmail.com
Sebastien Fricker sebastien.fricker@gmail.com
Sebastian Setzer sebastian.setzer.ext@siemens.com
Sergei Steshenko sergstesh@yahoo.com
Shura debil_urod@ngs.ru
Steve Murphy murf@parsetree.com
Tim Josling tej@melbpc.org.au
Tim Van Holder tim.van.holder@pandora.be
Tom Lane tgl@sss.pgh.pa.us
Tom Tromey tromey@cygnus.com
Tommy Nordgren tommy.nordgren@chello.se
Troy A. Johnson troyj@ecn.purdue.edu
Tys Lefering twlevo@xs4all.nl
Vin Shelton acs@alumni.princeton.edu
Wayne Green wayne@infosavvy.com
Wolfram Wagner ww@mpi-sb.mpg.de
Wwp subscript@free.fr
Zack Weinberg zack@codesourcery.com
Many people are not named here because we lost track of them. We
thank them! Please, help us keeping this list up to date.
Local Variables:
mode: text
End:

View File

@@ -1,309 +0,0 @@
-*- outline -*-
* Header guards
From Franc,ois: should we keep the directory part in the CPP guard?
* Yacc.c: CPP Macros
Do some people use YYPURE, YYLSP_NEEDED like we do in the test suite?
They should not: it is not documented. But if they need to, let's
find something clean (not like YYLSP_NEEDED...).
* Installation
* Documentation
Before releasing, make sure the documentation ("Understanding your
parser") refers to the current `output' format.
* lalr1.cc
** vector
Move to using vector, drop stack.hh.
** I18n
Catch up with yacc.c.
* Report
** GLR
How would Paul like to display the conflicted actions? In particular,
what when two reductions are possible on a given lookahead token, but one is
part of $default. Should we make the two reductions explicit, or just
keep $default? See the following point.
** Disabled Reductions
See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
what we want to do.
** Documentation
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
undocumented ``features''. Maybe an empty action ought to be
presented too. Shall we try to make a single grammar with all these
features, or should we have several very small grammars?
** --report=conflict-path
Provide better assistance for understanding the conflicts by providing
a sample text exhibiting the (LALR) ambiguity. See the paper from
DeRemer and Penello: they already provide the algorithm.
** Statically check for potential ambiguities in GLR grammars. See
<http://www.i3s.unice.fr/~schmitz/papers.html#expamb> for an approach.
* Extensions
** Labeling the symbols
Have a look at the Lemon parser generator: instead of $1, $2 etc. they
can name the values. This is much more pleasant. For instance:
exp (res): exp (a) '+' exp (b) { $res = $a + $b; };
I love this. I have been bitten too often by the removal of the
symbol, and forgetting to shift all the $n to $n-1. If you are
unlucky, it compiles...
But instead of using $a etc., we can use regular variables. And
instead of using (), I propose to use `:' (again). Paul suggests
supporting `->' in addition to `:' to separate LHS and RHS. In other
words:
r:exp -> a:exp '+' b:exp { r = a + b; };
That requires an significant improvement of the grammar parser. Using
GLR would be nice. It also requires that Bison know the type of the
symbols (which will be useful for %include anyway). So we have some
time before...
Note that there remains the problem of locations: `@r'?
** $-1
We should find a means to provide an access to values deep in the
stack. For instance, instead of
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
we should be able to have:
foo($foo) bar($bar) baz($bar): qux($qux) { $baz = $foo + $bar + $qux; }
Or something like this.
** %if and the like
It should be possible to have %if/%else/%endif. The implementation is
not clear: should it be lexical or syntactic. Vadim Maslow thinks it
must be in the scanner: we must not parse what is in a switched off
part of %if. Akim Demaille thinks it should be in the parser, so as
to avoid falling into another CPP mistake.
** -D, --define-muscle NAME=VALUE
To define muscles via cli. Or maybe support directly NAME=VALUE?
** XML Output
There are couple of available extensions of Bison targeting some XML
output. Some day we should consider including them. One issue is
that they seem to be quite orthogonal to the parsing technique, and
seem to depend mostly on the possibility to have some code triggered
for each reduction. As a matter of fact, such hooks could also be
used to generate the yydebug traces. Some generic scheme probably
exists in there.
XML output for GNU Bison and gcc
http://www.cs.may.ie/~jpower/Research/bisonXML/
XML output for GNU Bison
http://yaxx.sourceforge.net/
* Unit rules
Maybe we could expand unit rules, i.e., transform
exp: arith | bool;
arith: exp '+' exp;
bool: exp '&' exp;
into
exp: exp '+' exp | exp '&' exp;
when there are no actions. This can significantly speed up some
grammars. I can't find the papers. In particular the book `LR
parsing: Theory and Practice' is impossible to find, but according to
`Parsing Techniques: a Practical Guide', it includes information about
this issue. Does anybody have it?
* Documentation
** History/Bibliography
Some history of Bison and some bibliography would be most welcome.
Are there any Texinfo standards for bibliography?
* Java, Fortran, etc.
* Coding system independence
Paul notes:
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
255). It also assumes that the 8-bit character encoding is
the same for the invocation of 'bison' as it is for the
invocation of 'cc', but this is not necessarily true when
people run bison on an ASCII host and then use cc on an EBCDIC
host. I don't think these topics are worth our time
addressing (unless we find a gung-ho volunteer for EBCDIC or
PDP-10 ports :-) but they should probably be documented
somewhere.
More importantly, Bison does not currently allow NUL bytes in
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
the source code. This should get fixed.
* --graph
Show reductions.
* Broken options ?
** %token-table
** Skeleton strategy
Must we keep %token-table?
* src/print_graph.c
Find the best graph parameters.
* BTYacc
See if we can integrate backtracking in Bison. Charles-Henri de
Boysson <de-boy_c@epita.fr> is working on this, and already has some
results. Vadim Maslow, the maintainer of BTYacc was contacted, and we
stay in touch with him. Adjusting the Bison grammar parser will be
needed to support some extra BTYacc features. This is less urgent.
** Keeping the conflicted actions
First, analyze the differences between byacc and btyacc (I'm referring
to the executables). Find where the conflicts are preserved.
** Compare with the GLR tables
See how isomorphic the way BTYacc and the way the GLR adjustments in
Bison are compatible. *As much as possible* one should try to use the
same implementation in the Bison executables. I insist: it should be
very feasible to use the very same conflict tables.
** Adjust the skeletons
Import the skeletons for C and C++.
** Improve the skeletons
Have them support yysymprint, yydestruct and so forth.
* Precedence
** Partial order
It is unfortunate that there is a total order for precedence. It
makes it impossible to have modular precedence information. We should
move to partial orders (sounds like series/parallel orders to me).
** Correlation b/w precedence and associativity
Also, I fail to understand why we have to assign the same
associativity to operators with the same precedence. For instance,
why can't I decide that the precedence of * and / is the same, but the
latter is nonassoc?
If there is really no profound motivation, we should find a new syntax
to allow specifying this.
** RR conflicts
See if we can use precedence between rules to solve RR conflicts. See
what POSIX says.
* $undefined
From Hans:
- If the Bison generated parser experiences an undefined number in the
character range, that character is written out in diagnostic messages, an
addition to the $undefined value.
Suggest: Change the name $undefined to undefined; looks better in outputs.
* Default Action
From Hans:
- For use with my C++ parser, I transported the "switch (yyn)" statement
that Bison writes to the bison.simple skeleton file. This way, I can remove
the current default rule $$ = $1 implementation, which causes a double
assignment to $$ which may not be OK under C++, replacing it with a
"default:" part within the switch statement.
Note that the default rule $$ = $1, when typed, is perfectly OK under C,
but in the C++ implementation I made, this rule is different from
$<type_name>$ = $<type_name>1. I therefore think that one should implement
a Bison option where every typed default rule is explicitly written out
(same typed ruled can of course be grouped together).
Note: Robert Anisko handles this. He knows how to do it.
* Warnings
It would be nice to have warning support. See how Autoconf handles
them, it is fairly well described there. It would be very nice to
implement this in such a way that other programs could use
lib/warnings.[ch].
Don't work on this without first announcing you do, as I already have
thought about it, and know many of the components that can be used to
implement it.
* Pre and post actions.
From: Florian Krohm <florian@edamail.fishkill.ibm.com>
Subject: YYACT_EPILOGUE
To: bug-bison@gnu.org
X-Sent: 1 week, 4 days, 14 hours, 38 minutes, 11 seconds ago
The other day I had the need for explicitly building the parse tree. I
used %locations for that and defined YYLLOC_DEFAULT to call a function
that returns the tree node for the production. Easy. But I also needed
to assign the S-attribute to the tree node. That cannot be done in
YYLLOC_DEFAULT, because it is invoked before the action is executed.
The way I solved this was to define a macro YYACT_EPILOGUE that would
be invoked after the action. For reasons of symmetry I also added
YYACT_PROLOGUE. Although I had no use for that I can envision how it
might come in handy for debugging purposes.
All is needed is to add
#if YYLSP_NEEDED
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen));
#else
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen);
#endif
at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
to bison. If you're interested, I'll work on a patch.
* Better graphics
Equip the parser with a means to create the (visual) parse tree.
-----
Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
Inc.
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/>.

View File

@@ -1,70 +0,0 @@
-*- outline -*-
This directory contains data needed by Bison.
* Skeletons
Bison skeletons: the general shapes of the different parser kinds,
that are specialized for specific grammars by the bison program.
Currently, the supported skeletons are:
- yacc.c
It used to be named bison.simple: it corresponds to C Yacc
compatible LALR(1) parsers.
- lalr1.cc
Produces a C++ parser class.
- lalr1.java
Produces a Java parser class.
- glr.c
A Generalized LR C parser based on Bison's LALR(1) tables.
- glr.cc
A Generalized LR C++ parser. Actually a C++ wrapper around glr.c.
These skeletons are the only ones supported by the Bison team.
Because the interface between skeletons and the bison program is not
finished, *we are not bound to it*. In particular, Bison is not
mature enough for us to consider that ``foreign skeletons'' are
supported.
* m4sugar
This directory contains M4sugar, sort of an extended library for M4,
which is used by Bison to instantiate the skeletons.
* xslt
This directory contains XSLT programs that transform Bison's XML output
into various formats.
- bison.xsl
A library of routines used by the other XSLT programs.
- xml2dot.xsl
Conversion into GraphViz's dot format.
- xml2text.xsl
Conversion into text.
- xml2xhtml.xsl
Conversion into XHTML.
-----
Copyright (C) 2002, 2008 Free Software Foundation, Inc.
This file is part of GNU Bison.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -1,195 +0,0 @@
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
1.: DJGPP specific changes.
=======================
The DJGPP port of Bison offers LFN and SFN support depending on which
OS it is running. If LFN support is available or not is determinated at
run time. If LFN support is available (DOS session under Win9X, Win2K,
WinXP, etc.) the standard posix file name extensions will be used.
These are: y.tab.c, y.tab.c++, y.tab.h, y.output, etc. If only SFN
support is available (plain DOS), then the standard MSDOS short file
names will be used. These are: y_tab.c, y_tab.h, y.out, etc.
It should be noticed that this bison version needs the m4 program as
back end to generate the parser file (y.tab.c etc.) from the skeleton
files. This implies that m4 must always be installed to get bison
working. m4 will use a couple of m4 scripts that will be installed in
/dev/env/DJDIR/share/bison and shall not be removed.
It should also be noticed that the skeleton files bison.simple and
bison.hairy are no longer supported. This applies also to the environ-
ment variables BISON_HAIRY and BISON_SIMPLE. Those variables are *no*
longer honored at all.
The kind of skeleton file bison.hairy is no longer supported at all.
The skeleton file bison.simple is now called yacc.c and is an m4 script.
The other two skeleton files supported by this bison version are glr.c
and lalr1.cc. The first one is a generalized LR C parser based on
Bison's LALR(1) tables and the second one is a experimental C++ parser
class.
As has been told before, bison uses m4 to generate the parser file.
This is done by forking and using pipes for the IPC. MSDOS does not
support this functionality so this has been reproduced in the usual
way by redirecting stdin and stdout of bison and m4 to temporary files
and processing these files in sequence.
It should be noticed that due to the great amount of file names that do
not cleanly map to 8.3 file names, you will need an OS with LFN support
to configure and compile the sources. On Win98 this implies that the
generation of numeric tails for 8.3 file name aliases must be enabled
or the compilation will fail.
Please **read** the docs.
2.: Installing the binary package.
==============================
2.1.: Copy the binary distribution into the top DJGPP installation directory,
just unzip it preserving the directory structure running *ONE* of the
following commands:
unzip32 bsn@PACKAGE_VERSION@b.zip or
djtarx bsn@PACKAGE_VERSION@b.zip or
pkunzip -d bsn@PACKAGE_VERSION@b.zip
3.: Building the binaries from sources.
===================================
3.1.: Create a temporary directory and copy the source package into the
directory. If you download the source distribution from one of the
DJGPP sites, just unzip it preserving the directory structure
running *ONE* of the following commands:
unzip32 bsn@PACKAGE_VERSION@s.zip or
djtarx bsn@PACKAGE_VERSION@s.zip or
pkunzip -d bsn@PACKAGE_VERSION@s.zip
and proceed to the paragraph 3.3, below.
3.2.: Source distributions downloaded from one of the GNU FTP sites need
some more work to unpack, if LFN support is not available. If LFN is
available then you can extract the source files from the archive with
any unzip program and proceed to the paragraph 3.3, below. Any file
name issue will be handled by the the DJGPP configuration files.
To unpack the source distribution on SFN systems, first, you MUST use
the `djunpack' batch file to unzip the package. That is because some
file names in the official distributions need to be changed to avoid
problems on the various platforms supported by DJGPP.
`djunpack' invokes the `djtar' program (that is part of the basic DJGPP
development kit) to rename these files on the fly given a file with
name mappings; the distribution includes a file `djgpp/fnchange.lst'
with the necessary mappings. So you need first to retrieve that batch
file, and then invoke it to unpack the distribution. Here's how:
djtar -x -p -o bison-@VERSION@/djgpp/djunpack.bat bison-@VERSION@.tar.gz > djunpack.bat
djunpack bison-@VERSION@.tar.gz
(The name of the distribution archive and the leading directory of the
path to `djunpack.bat' in the distribution will be different for
versions of Bison other than @VERSION@.)
If the argument to `djunpack.bat' include leading directories, it MUST
be given with the DOS-style backslashes; Unix-style forward slashes
will NOT work.
If the distribution comes as a .tar.bz2 archive, and your version of
`djtar' doesn't support bzip2 decompression, you need to unpack it as
follows:
bnzip2 bison-@VERSION@.tar.bz2
djtar -x -p -o bison-@VERSION@/djgpp/djunpack.bat bison-@VERSION@.tar > djunpack.bat
djunpack bison-@VERSION@.tar
3.3.: To build the binaries you will need the following binary packages:
djdev203.zip (or a later but NOT a prior version)
bsh204b.zip (or a later but NOT a prior version)
gccNNNb.zip, gppNNN.zip, bnuNNNb.zip, makNNNb.zip, filNNNb.zip,
perlNNNb.zip, shlNNNb.zip, txtNNNb.zip, txiNNNb.zip, grepNNNb.zip,
sedNNNb.zip and m4NNN.zip
If you want to run the check you will need also:
difNNNb.zip
NNN represents the latest version number of the binary packages. All
this packages can be found in the /v2gnu directory of any
ftp.delorie.com mirror.
You will need bsh204b.zip or later and *NOT* a prior version or
the build will fail. The same applies to djdev203.zip. Please note
that Bison requires m4-144b.zip or later to work properly.
3.4.: If for some reason you want to reconfigure the package cd into the top
srcdir (bison-@TREE_VERSION@) and run the following commands:
del djgpp\config.cache
make clean
djgpp\config
Please note that you *MUST* delete the config.cache file in the djgpp
subdir or you will not really reconfigure the sources because the
configuration informations will be read from the cache file instead
of being newly computed.
To build the programs in a directory other than where the sources are,
you must add the parameter that specifies the source directory,
e.g:
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
Lets assume you want to build the binaries in a directory placed on a
different drive (z:\build in this case) from where the sources are,
then you will run the following commands:
z:
md \build
cd \build
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
The order of the options and the srcdir option does not matter. You
*MUST* use forward slashes to specify the source directory.
The batch file will set same environment variables, make MSDOS specific
modifications to the Makefile.in's and supply all other needed options
to the configure script.
3.5.: To compile the package run from the top srcdir the command:
make
3.6.: Now you can run the tests if you like. From the top srcdir run the
command:
make check
No test should fail but the tests #131 (Doxygen Public Documentation)
and #132 (Doxygen Private Documentation) will be skipped. Please note
that the testsuite only works with LFN available. On plain DOS, most
of the tests will fail due to invalid DOS names.
3.7.: To install the binaries, header, library, catalogs, and info docs
run the following command from the top srcdir:
make install
This will install the products into your DJGPP installation tree given
by the default prefix "/dev/env/DJDIR". If you prefer to install them
into some other directory you will have to set prefix to the appropiate
value:
make install prefix=z:/some/other/place
Send GNU bison specific bug reports to <bug-bison@gnu.org>.
Send suggestions and bug reports concerning the DJGPP port to
comp.os.msdos.djgpp or <djgpp@delorie.com>.
Enjoy.
Guerrero, Juan Manuel <juan.guerrero@gmx.de>

File diff suppressed because it is too large Load Diff

View File

@@ -1,717 +0,0 @@
@c The GNU General Public License.
@center Version 3, 29 June 2007
@c This file is intended to be included within another document,
@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
@end display
@heading Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom
to share and change all versions of a program---to make sure it remains
free software for all its users. We, the Free Software Foundation,
use the GNU General Public License for most of our software; it
applies also to any other work released this way by its authors. You
can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you
have certain responsibilities if you distribute copies of the
software, or if you modify it: responsibilities to respect the freedom
of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too,
receive or can get the source code. And you must show them these
terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the
manufacturer can do so. This is fundamentally incompatible with the
aim of protecting users' freedom to change the software. The
systematic pattern of such abuse occurs in the area of products for
individuals to use, which is precisely where it is most unacceptable.
Therefore, we have designed this version of the GPL to prohibit the
practice for those products. If such problems arise substantially in
other domains, we stand ready to extend this provision to those
domains in future versions of the GPL, as needed to protect the
freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish
to avoid the special danger that patents applied to a free program
could make it effectively proprietary. To prevent this, the GPL
assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
@heading TERMS AND CONDITIONS
@enumerate 0
@item Definitions.
``This License'' refers to version 3 of the GNU General Public License.
``Copyright'' also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.
``The Program'' refers to any copyrightable work licensed under this
License. Each licensee is addressed as ``you''. ``Licensees'' and
``recipients'' may be individuals or organizations.
To ``modify'' a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of
an exact copy. The resulting work is called a ``modified version'' of
the earlier work or a work ``based on'' the earlier work.
A ``covered work'' means either the unmodified Program or a work based
on the Program.
To ``propagate'' a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To ``convey'' a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user
through a computer network, with no transfer of a copy, is not
conveying.
An interactive user interface displays ``Appropriate Legal Notices'' to
the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
@item Source Code.
The ``source code'' for a work means the preferred form of the work for
making modifications to it. ``Object code'' means any non-source form
of a work.
A ``Standard Interface'' means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The ``System Libraries'' of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
``Major Component'', in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The ``Corresponding Source'' for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can
regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same
work.
@item Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey,
without conditions so long as your license otherwise remains in force.
You may convey covered works to others for the sole purpose of having
them make modifications exclusively for you, or provide you with
facilities for running those works, provided that you comply with the
terms of this License in conveying all material for which you do not
control copyright. Those thus making or running the covered works for
you must do so exclusively on your behalf, under your direction and
control, on terms that prohibit them from making any copies of your
copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the
conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
@item Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such
circumvention is effected by exercising rights under this License with
respect to the covered work, and you disclaim any intention to limit
operation or modification of the work as a means of enforcing, against
the work's users, your or third parties' legal rights to forbid
circumvention of technological measures.
@item Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
@item Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these
conditions:
@enumerate a
@item
The work must carry prominent notices stating that you modified it,
and giving a relevant date.
@item
The work must carry prominent notices stating that it is released
under this License and any conditions added under section 7. This
requirement modifies the requirement in section 4 to ``keep intact all
notices''.
@item
You must license the entire work, as a whole, under this License to
anyone who comes into possession of a copy. This License will
therefore apply, along with any applicable section 7 additional terms,
to the whole of the work, and all its parts, regardless of how they
are packaged. This License gives no permission to license the work in
any other way, but it does not invalidate such permission if you have
separately received it.
@item
If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your work
need not make them do so.
@end enumerate
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
``aggregate'' if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
@item Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of
sections 4 and 5, provided that you also convey the machine-readable
Corresponding Source under the terms of this License, in one of these
ways:
@enumerate a
@item
Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium customarily
used for software interchange.
@item
Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a written
offer, valid for at least three years and valid for as long as you
offer spare parts or customer support for that product model, to give
anyone who possesses the object code either (1) a copy of the
Corresponding Source for all the software in the product that is
covered by this License, on a durable physical medium customarily used
for software interchange, for a price no more than your reasonable
cost of physically performing this conveying of source, or (2) access
to copy the Corresponding Source from a network server at no charge.
@item
Convey individual copies of the object code with a copy of the written
offer to provide the Corresponding Source. This alternative is
allowed only occasionally and noncommercially, and only if you
received the object code with such an offer, in accord with subsection
6b.
@item
Convey the object code by offering access from a designated place
(gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to copy
the object code is a network server, the Corresponding Source may be
on a different server (operated by you or a third party) that supports
equivalent copying facilities, provided you maintain clear directions
next to the object code saying where to find the Corresponding Source.
Regardless of what server hosts the Corresponding Source, you remain
obligated to ensure that it is available for as long as needed to
satisfy these requirements.
@item
Convey the object code using peer-to-peer transmission, provided you
inform other peers where the object code and Corresponding Source of
the work are being offered to the general public at no charge under
subsection 6d.
@end enumerate
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A ``User Product'' is either (1) a ``consumer product'', which means any
tangible personal property which is normally used for personal,
family, or household purposes, or (2) anything designed or sold for
incorporation into a dwelling. In determining whether a product is a
consumer product, doubtful cases shall be resolved in favor of
coverage. For a particular product received by a particular user,
``normally used'' refers to a typical or common use of that class of
product, regardless of the status of the particular user or of the way
in which the particular user actually uses, or expects or is expected
to use, the product. A product is a consumer product regardless of
whether the product has substantial commercial, industrial or
non-consumer uses, unless such uses represent the only significant
mode of use of the product.
``Installation Information'' for a User Product means any methods,
procedures, authorization keys, or other information required to
install and execute modified versions of a covered work in that User
Product from a modified version of its Corresponding Source. The
information must suffice to ensure that the continued functioning of
the modified object code is in no case prevented or interfered with
solely because modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or
updates for a work that has been modified or installed by the
recipient, or for the User Product in which it has been modified or
installed. Access to a network may be denied when the modification
itself materially and adversely affects the operation of the network
or violates the rules and protocols for communication across the
network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
@item Additional Terms.
``Additional permissions'' are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders
of that material) supplement the terms of this License with terms:
@enumerate a
@item
Disclaiming warranty or limiting liability differently from the terms
of sections 15 and 16 of this License; or
@item
Requiring preservation of specified reasonable legal notices or author
attributions in that material or in the Appropriate Legal Notices
displayed by works containing it; or
@item
Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
@item
Limiting the use for publicity purposes of names of licensors or
authors of the material; or
@item
Declining to grant rights under trademark law for use of some trade
names, trademarks, or service marks; or
@item
Requiring indemnification of licensors and authors of that material by
anyone who conveys the material (or modified versions of it) with
contractual assumptions of liability to the recipient, for any
liability that these contractual assumptions directly impose on those
licensors and authors.
@end enumerate
All other non-permissive additional terms are considered ``further
restrictions'' within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions; the
above requirements apply either way.
@item Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
@item Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run
a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
@item Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An ``entity transaction'' is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
@item Patents.
A ``contributor'' is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's ``contributor version''.
A contributor's ``essential patent claims'' are all patent claims owned
or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, ``control'' includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a ``patent license'' is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To ``grant'' such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. ``Knowingly relying'' means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is ``discriminatory'' if it does not include within the
scope of its coverage, prohibits the exercise of, or is conditioned on
the non-exercise of one or more of the rights that are specifically
granted under this License. You may not convey a covered work if you
are a party to an arrangement with a third party that is in the
business of distributing software, under which you make payment to the
third party based on the extent of your activity of conveying the
work, and under which the third party grants, to any of the parties
who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by
you (or copies made from those copies), or (b) primarily for and in
connection with specific products or compilations that contain the
covered work, unless you entered into that arrangement, or that patent
license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
@item No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey
a covered work so as to satisfy simultaneously your obligations under
this License and any other pertinent obligations, then as a
consequence you may not convey it at all. For example, if you agree
to terms that obligate you to collect a royalty for further conveying
from those to whom you convey the Program, the only way you could
satisfy both those terms and this License would be to refrain entirely
from conveying the Program.
@item Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
@item Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions
of the GNU General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies that a certain numbered version of the GNU General Public
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that numbered version or
of any later version published by the Free Software Foundation. If
the Program does not specify a version number of the GNU General
Public License, you may choose any version ever published by the Free
Software Foundation.
If the Program specifies that a proxy can decide which future versions
of the GNU General Public License can be used, that proxy's public
statement of acceptance of a version permanently authorizes you to
choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
@item Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
@item Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
@item Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
@end enumerate
@heading END OF TERMS AND CONDITIONS
@heading How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the ``copyright'' line and a pointer to where the full notice is found.
@smallexample
@var{one line to give the program's name and a brief idea of what it does.}
Copyright (C) @var{year} @var{name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see @url{http://www.gnu.org/licenses/}.
@end smallexample
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
@smallexample
@var{program} Copyright (C) @var{year} @var{name of author}
This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
This is free software, and you are welcome to redistribute it
under certain conditions; type @samp{show c} for details.
@end smallexample
The hypothetical commands @samp{show w} and @samp{show c} should show
the appropriate parts of the General Public License. Of course, your
program's commands might be different; for a GUI interface, you would
use an ``about box''.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a ``copyright disclaimer'' for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
@url{http://www.gnu.org/licenses/}.
The GNU General Public License does not permit incorporating your
program into proprietary programs. If your program is a subroutine
library, you may consider it more useful to permit linking proprietary
applications with the library. If this is what you want to do, use
the GNU Lesser General Public License instead of this License. But
first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.

View File

@@ -1,41 +0,0 @@
A directory of tools provided to people using CVS Bison. None of
these is distributed.
* bench.pl
A primitive Perl script to run benches. Currently its only bench is
the usual calculator: it has a lightweight processing part (but not
null), so it is really emphasizing the cost of the whole parsing
(including scanning and I/O).
Set the envvars BISON and CC to the programs and flags you want to
use. They default to bison and gcc. To run a non-installed bison
from a tarball built in _build, I suggest the following.
BISON=_build/tests/bison CC='gcc -O2' ./bench.pl
(The _build/tests/bison wrapper makes sure that _build/src/bison will
use the tarballs' skeletons, not those already installed as a
straightforward use of _build/src/bison would.)
--
Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Local Variables:
mode: outline
End:

View File

@@ -1,422 +0,0 @@
make.exe check-recursive
make[1]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1'
Making check in build-aux
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/build-aux'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/build-aux'
Making check in po
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/po'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/po'
Making check in runtime-po
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/runtime-po'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/runtime-po'
Making check in lib
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/lib'
make.exe check-recursive
make[3]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/lib'
make[4]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/lib'
make[4]: Nothing to be done for `check-am'.
make[4]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/lib'
make[3]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/lib'
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/lib'
Making check in data
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/data'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/data'
Making check in src
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/src'
make.exe check-am
make[3]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/src'
make[3]: Nothing to be done for `check-am'.
make[3]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/src'
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/src'
Making check in doc
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/doc'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/doc'
Making check in examples
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples'
Making check in calc++
make[3]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples/calc++'
make.exe check-am
make[4]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples/calc++'
make.exe calc++.exe
make[5]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples/calc++'
g++ -I. -I../../../bison-2.4.1-src/examples/calc++ -D__USE_MINGW_ACCESS -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DENABLE_RELOCATABLE -DINSTALLPREFIX=\"c:/progra~1/bison\" -DINSTALLDIR=\"c:/progra~1/bison/bin\" -DEXEEXT=\".exe\" -DNO_XMALLOC -ID:/Progra~1/GnuWin32/include -Wall -Wpointer-arith -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -ffast-math -fconserve-space -fno-rtti -D__STDC_LIMIT_MACROS -MT calc++-scanner.o -MD -MP -MF .deps/calc++-scanner.Tpo -c -o calc++-scanner.o ../../../bison-2.4.1-src/examples/calc++/calc++-scanner.cc
calc++-scanner.cc: In function `int yy_get_next_buffer()':
calc++-scanner.cc:1218: warning: comparison between signed and unsigned integer expressions
mv -f .deps/calc++-scanner.Tpo .deps/calc++-scanner.Po
g++ -I. -I../../../bison-2.4.1-src/examples/calc++ -D__USE_MINGW_ACCESS -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DENABLE_RELOCATABLE -DINSTALLPREFIX=\"c:/progra~1/bison\" -DINSTALLDIR=\"c:/progra~1/bison/bin\" -DEXEEXT=\".exe\" -DNO_XMALLOC -ID:/Progra~1/GnuWin32/include -Wall -Wpointer-arith -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -ffast-math -fconserve-space -fno-rtti -D__STDC_LIMIT_MACROS -MT calc++.o -MD -MP -MF .deps/calc++.Tpo -c -o calc++.o `test -f '../../../bison-2.4.1-src/examples/calc++/calc++.cc' || echo '../../../bison-2.4.1-src/examples/calc++/'`../../../bison-2.4.1-src/examples/calc++/calc++.cc
mv -f .deps/calc++.Tpo .deps/calc++.Po
g++ -I. -I../../../bison-2.4.1-src/examples/calc++ -D__USE_MINGW_ACCESS -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DENABLE_RELOCATABLE -DINSTALLPREFIX=\"c:/progra~1/bison\" -DINSTALLDIR=\"c:/progra~1/bison/bin\" -DEXEEXT=\".exe\" -DNO_XMALLOC -ID:/Progra~1/GnuWin32/include -Wall -Wpointer-arith -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -ffast-math -fconserve-space -fno-rtti -D__STDC_LIMIT_MACROS -MT calc++-driver.o -MD -MP -MF .deps/calc++-driver.Tpo -c -o calc++-driver.o `test -f '../../../bison-2.4.1-src/examples/calc++/calc++-driver.cc' || echo '../../../bison-2.4.1-src/examples/calc++/'`../../../bison-2.4.1-src/examples/calc++/calc++-driver.cc
mv -f .deps/calc++-driver.Tpo .deps/calc++-driver.Po
g++ -I. -I../../../bison-2.4.1-src/examples/calc++ -D__USE_MINGW_ACCESS -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DENABLE_RELOCATABLE -DINSTALLPREFIX=\"c:/progra~1/bison\" -DINSTALLDIR=\"c:/progra~1/bison/bin\" -DEXEEXT=\".exe\" -DNO_XMALLOC -ID:/Progra~1/GnuWin32/include -Wall -Wpointer-arith -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -ffast-math -fconserve-space -fno-rtti -D__STDC_LIMIT_MACROS -MT calc++-parser.o -MD -MP -MF .deps/calc++-parser.Tpo -c -o calc++-parser.o `test -f '../../../bison-2.4.1-src/examples/calc++/calc++-parser.cc' || echo '../../../bison-2.4.1-src/examples/calc++/'`../../../bison-2.4.1-src/examples/calc++/calc++-parser.cc
mv -f .deps/calc++-parser.Tpo .deps/calc++-parser.Po
g++ -Wall -Wpointer-arith -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -ffast-math -fconserve-space -fno-rtti -D__STDC_LIMIT_MACROS -Wl,-s -Wl,--force-exe-suffix -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--allow-multiple-definition -Wl,--enable-stdcall-fixup -LD:/Progra~1/GnuWin32/lib -o calc++.exe calc++-scanner.o calc++.o calc++-driver.o calc++-parser.o -Wl,-s -LD:/Progra~1/GnuWin32/lib -lintl -lwsock32 -lole32 -luuid -lmsvcp60
make[5]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples/calc++'
make.exe check-TESTS
make[5]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples/calc++'
PASS: test
==================
All 1 tests passed
==================
make[5]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples/calc++'
make[4]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples/calc++'
make[3]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples/calc++'
make[3]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples'
make[3]: Nothing to be done for `check-am'.
make[3]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples'
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/examples'
Making check in tests
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/tests'
make.exe bison
make[3]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/tests'
make[3]: `bison' is up to date.
make[3]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/tests'
make.exe check-local
make[3]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/tests'
/bin/sh ../../bison-2.4.1-src/tests/testsuite
## --------------------------- ##
## GNU Bison 2.4.1 test suite. ##
## --------------------------- ##
Input Processing.
1: Invalid $n and @n ok
2: Type Clashes ok
3: Unused values ok
4: Unused values before symbol declarations ok
5: Default %printer and %destructor redeclared ok
6: Per-type %printer and %destructor redeclared ok
7: Unused values with default %destructor ok
8: Unused values with per-type %destructor ok
9: Incompatible Aliases ok
10: Torturing the Scanner ok
11: Typed symbol aliases ok
12: Require 1.0 ok
13: Require 2.4.1 ok
14: Require 100.0 ok
15: String aliases for character tokens ok
16: Unclosed constructs ok
17: %start after first rule ok
18: %prec takes a token ok
19: Reject unused %code qualifiers ok
20: %define errors ok
21: %define Boolean variables ok
22: %define enum variables ok
23: Unused %define api.pure ok
24: C++ namespace reference errors ok
Output file names.
25: Output files: -dv ok
26: Output files: -dv >&- ok
27: Output files: -dv -o foo.c ok
28: Output files: -dv -o foo.tab.c ok
29: Output files: -dv -y ok
30: Output files: -dv -b bar ok
31: Output files: -dv -g -o foo.c ok
32: Output files: %defines %verbose ok
33: Output files: %defines %verbose %yacc ok
34: Output files: %defines %verbose %yacc ok
35: Output files: %file-prefix "bar" %defines %verbose ok
36: Output files: %output="bar.c" %defines %verbose %yacc ok
37: Output files: %file-prefix="baz" %output "bar.c" %defines %verbose %yacc ok
38: Output files: %defines %verbose ok
39: Output files: %defines %verbose -o foo.c ok
40: Output files: --defines=foo.hpp -o foo.c++ ok
41: Output files: %defines "foo.hpp" -o foo.c++ ok
42: Output files: -o foo.c++ --graph=foo.gph ok
43: Output files: %skeleton "lalr1.cc" %defines %verbose ok
44: Output files: %skeleton "lalr1.cc" %defines %verbose ok
45: Output files: %skeleton "lalr1.cc" %defines %verbose -o subdir/foo.cc ok
46: Output files: %skeleton "lalr1.cc" %defines %verbose %file-prefix "output_dir/foo" ok
47: Conflicting output files: --graph="foo.tab.c" ok
48: Conflicting output files: %defines "foo.output" -v ok
49: Conflicting output files: %skeleton "lalr1.cc" %defines --graph="location.hh" ok
50: Conflicting output files: -o foo.y ok
51: Output file name: `~!@#$%^&*()-=_+{}[]|\:;<>, .' FAILED (output.at:200)
52: Output file name: ( ok
53: Output file name: ) ok
54: Output file name: # ok
55: Output file name: @@ ok
56: Output file name: @{ ok
57: Output file name: @} ok
58: Output file name: [ ok
59: Output file name: ] ok
Skeleton Support.
60: Relative skeleton file names ok
61: Installed skeleton file names ok
62: %define Boolean variables: invalid skeleton defaults ok
63: Complaining during macro argument expansion ok
64: Fatal errors make M4 exit immediately ok
Grammar Sets (Firsts etc.).
65: Nullable ok
66: Broken Closure ok
67: Firsts ok
68: Accept ok
Grammar Reduction.
69: Useless Terminals ok
70: Useless Nonterminals ok
71: Useless Rules ok
72: Reduced Automaton ok
73: Underivable Rules ok
74: Empty Language ok
User Actions.
75: Prologue synch line ok
76: %union synch line ok
77: Postprologue synch line ok
78: Action synch line ok
79: Epilogue synch line ok
Parser Headers.
80: %union and --defines ok
81: Invalid CPP guards: input/input ok
82: Invalid CPP guards: 9foo ok
83: export YYLTYPE ok
User Actions.
84: Mid-rule actions ok
85: Exotic Dollars ok
86: Printers and Destructors : ok
87: Printers and Destructors with union: ok
88: Printers and Destructors : %defines %skeleton "lalr1.cc" ok
89: Printers and Destructors with union: %defines %skeleton "lalr1.cc" ok
90: Printers and Destructors : %glr-parser ok
91: Printers and Destructors with union: %glr-parser ok
92: Default tagless %printer and %destructor ok
93: Default tagged and per-type %printer and %destructor ok
94: Default %printer and %destructor for user-defined end token ok
95: Default %printer and %destructor are not for error or $undefined ok
96: Default %printer and %destructor are not for $accept ok
97: Default %printer and %destructor for mid-rule values ok
98: @$ in %initial-action implies %locations ok
99: @$ in %destructor implies %locations ok
100: @$ in %printer implies %locations ok
Conflicts.
101: S/R in initial ok
102: %nonassoc and eof ok
103: Unresolved SR Conflicts ok
104: Resolved SR Conflicts ok
105: Defaulted Conflicted Reduction ok
106: %expect not enough ok
107: %expect right ok
108: %expect too much ok
109: %expect with reduce conflicts ok
110: %no-default-prec without %prec ok
111: %no-default-prec with %prec ok
112: %default-prec ok
113: Unreachable States After Conflict Resolution ok
114: Solved conflicts report for multiple reductions in a state ok
115: %nonassoc error actions for multiple reductions in a state ok
Simple LALR(1) Calculator.
116: Calculator ok
117: Calculator %defines ok
118: Calculator %locations ok
119: Calculator %name-prefix="calc" ok
120: Calculator %verbose ok
121: Calculator %yacc ok
122: Calculator %error-verbose FAILED (calc.at:576)
123: Calculator %define api.pure %locations ok
124: Calculator %define api.push_pull "both" %define api.pure %locations ok
125: Calculator %error-verbose %locations FAILED (calc.at:580)
126: Calculator %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc FAILED (calc.at:582)
127: Calculator %debug ok
128: Calculator %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc FAILED (calc.at:585)
129: Calculator %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc FAILED (calc.at:587)
130: Calculator %define api.push_pull "both" %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc FAILED (calc.at:588)
131: Calculator %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} FAILED (calc.at:590)
Simple GLR Calculator.
132: Calculator %glr-parser ok
133: Calculator %glr-parser %defines ok
134: Calculator %glr-parser %locations ok
135: Calculator %glr-parser %name-prefix "calc" ok
136: Calculator %glr-parser %verbose ok
137: Calculator %glr-parser %yacc ok
138: Calculator %glr-parser %error-verbose FAILED (calc.at:614)
139: Calculator %glr-parser %define api.pure %locations ok
140: Calculator %glr-parser %error-verbose %locations FAILED (calc.at:617)
141: Calculator %glr-parser %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc FAILED (calc.at:619)
142: Calculator %glr-parser %debug ok
143: Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc FAILED (calc.at:622)
144: Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc FAILED (calc.at:624)
145: Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} FAILED (calc.at:626)
Simple LALR(1) C++ Calculator.
146: Calculator %skeleton "lalr1.cc" %defines %locations ok
147: Calculator %language "C++" %defines %locations ok
148: Calculator %language "C++" %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc FAILED (calc.at:646)
149: Calculator %language "C++" %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc FAILED (calc.at:648)
150: Calculator %language "C++" %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc FAILED (calc.at:650)
151: Calculator %language "C++" %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} FAILED (calc.at:652)
Simple GLR C++ Calculator.
152: Calculator %skeleton "glr.cc" %defines %locations ok
153: Calculator %language "C++" %glr-parser %defines %locations ok
154: Calculator %language "C++" %glr-parser %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc FAILED (calc.at:673)
155: Calculator %language "C++" %glr-parser %defines %locations %debug ok
156: Calculator %language "C++" %glr-parser %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc FAILED (calc.at:676)
157: Calculator %language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc FAILED (calc.at:678)
158: Calculator %language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} FAILED (calc.at:680)
Torture Tests.
159: Big triangle ok
160: Big horizontal ok
161: Many lookahead tokens ok
162: Exploding the Stack Size with Alloca ok
163: Exploding the Stack Size with Malloc ok
Existing Grammars.
164: GNU AWK Grammar ok
165: GNU Cim Grammar ok
166: GNU pic Grammar ok
Regression tests.
167: Trivial grammars ok
168: YYSTYPE typedef ok
169: Early token definitions with --yacc ok
170: Early token definitions without --yacc ok
171: Braces parsing ok
172: Duplicate string ok
173: Rule Line Numbers ok
174: Mixing %token styles ok
175: Invalid inputs ok
176: Invalid inputs with {} ok
177: Token definitions ok
178: Characters Escapes ok
179: Web2c Report ok
180: Web2c Actions ok
181: Dancer ok
182: Dancer %glr-parser ok
183: Dancer %skeleton "lalr1.cc" ok
184: Expecting two tokens ok
185: Expecting two tokens %glr-parser ok
186: Expecting two tokens %skeleton "lalr1.cc" ok
187: Braced code in declaration in rules section ok
188: String alias declared after use ok
189: Extra lookahead sets in report ok
190: Token number in precedence declaration ok
191: Fix user actions without a trailing semicolon ok
C++ Features.
192: Doxygen Public Documentation skipped (c++.at:100)
193: Doxygen Private Documentation skipped (c++.at:101)
194: Relative namespace references ok
195: Absolute namespace references ok
196: Syntactically invalid namespace references ok
Java Calculator.
197: Calculator skipped (java.at:385)
198: Calculator %error-verbose skipped (java.at:385)
199: Calculator %locations skipped (java.at:385)
200: Calculator %error-verbose %locations skipped (java.at:385)
201: Calculator %lex-param { InputStream is } skipped (java.at:394)
202: Calculator %error-verbose %lex-param { InputStream is } skipped (java.at:394)
203: Calculator %locations %lex-param { InputStream is } skipped (java.at:394)
204: Calculator %error-verbose %locations %lex-param { InputStream is } skipped (java.at:394)
Java Parameters.
205: Java parser class and package names skipped (java.at:482)
206: Java parser class modifiers skipped (java.at:503)
207: Java parser class extends and implements skipped (java.at:561)
208: Java %parse-param and %lex-param skipped (java.at:581)
209: Java throws specifications skipped (java.at:713)
210: Java stype, position_class and location_class skipped (java.at:744)
C++ Type Syntax (GLR).
211: GLR: Resolve ambiguity, impure, no locations ok
212: GLR: Resolve ambiguity, impure, locations ok
213: GLR: Resolve ambiguity, pure, no locations ok
214: GLR: Resolve ambiguity, pure, locations ok
215: GLR: Merge conflicting parses, impure, no locations ok
216: GLR: Merge conflicting parses, impure, locations ok
217: GLR: Merge conflicting parses, pure, no locations ok
218: GLR: Merge conflicting parses, pure, locations ok
219: GLR: Verbose messages, resolve ambiguity, impure, no locations ok
GLR Regression Tests
220: Badly Collapsed GLR States ok
221: Improper handling of embedded actions and dollar(-N) in GLR parsers ok
222: Improper merging of GLR delayed action sets ok
223: Duplicate representation of merged trees ok
224: User destructor for unresolved GLR semantic value ok
225: User destructor after an error during a split parse ok
226: Duplicated user destructor for lookahead ok
227: Incorrectly initialized location for empty right-hand side in GLR ok
228: No users destructors if stack 0 deleted ok
229: Corrupted semantic options if user action cuts parse ok
230: Undesirable destructors if user action cuts parse ok
231: Leaked semantic values if user action cuts parse ok
232: Incorrect lookahead during deterministic GLR ok
233: Incorrect lookahead during nondeterministic GLR ok
234: Leaked semantic values when reporting ambiguity ok
235: Leaked lookahead after nondeterministic parse syntax error ok
236: Uninitialized location when reporting ambiguity ok
237: Missed %merge type warnings when LHS type is declared later ok
Push Parsing Tests
238: Push Parsing: Memory Leak for Early Deletion ok
239: Push Parsing: Multiple impure instances ok
240: Push Parsing: Unsupported Skeletons ok
## ------------- ##
## Test results. ##
## ------------- ##
ERROR: 224 tests were run,
22 failed unexpectedly.
16 tests were skipped.
## -------------------------- ##
## testsuite.log was created. ##
## -------------------------- ##
Please send `tests/testsuite.log' and all information you think might help:
To: <bug-bison@gnu.org>
Subject: [GNU Bison 2.4.1] testsuite: 51 122 125 126 128 129 130 131 138 140 141 143 144 145 148 149 150 151 154 156 157 158 failed
You may investigate any problem if you feel able to do so, in which
case the test suite provides a good starting point. Its output may
be found below `tests/testsuite.dir'.
make[3]: [check-local] Error 1 (ignored)
make[3]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/tests'
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/tests'
Making check in etc
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/etc'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1/etc'
make[2]: Entering directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1'
make[2]: Nothing to be done for `check-am'.
make[2]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1'
make[1]: Leaving directory `/cygdrive/j/Devel/bison/2.4.1/bison-2.4.1'

View File

@@ -1,38 +0,0 @@
Flex carries the copyright used for BSD software, slightly modified
because it originated at the Lawrence Berkeley (not Livermore!) Laboratory,
which operates under a contract with the Department of Energy:
Copyright (c) 1990 The Regents of the University of California.
All rights reserved.
This code is derived from software contributed to Berkeley by
Vern Paxson.
The United States Government has rights in this work pursuant
to contract no. DE-AC03-76SF00098 between the United States
Department of Energy and the University of California.
Redistribution and use in source and binary forms with or without
modification are permitted provided that: (1) source distributions
retain this entire copyright notice and comment, and (2)
distributions including binaries display the following
acknowledgement: ``This product includes software developed by the
University of California, Berkeley and its contributors'' in the
documentation or other materials provided with the distribution and
in all advertising materials mentioning features or use of this
software. Neither the name of the University nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
This basically says "do whatever you please with this software except
remove this notice or take advantage of the University's (or the flex
authors') name".
Note that the "flex.skl" scanner skeleton carries no copyright notice.
You are free to do whatever you please with scanners generated using flex;
for them, you are not even bound by the above copyright.

View File

@@ -1,117 +0,0 @@
This is a generic INSTALL file for utilities distributions.
If this package does not come with, e.g., installable documentation or
data files, please ignore the references to them below.
To compile this package:
1. Configure the package for your system. In the directory that this
file is in, type `./configure'. If you're using `csh' on an old
version of System V, you might need to type `sh configure' instead to
prevent `csh' from trying to execute `configure' itself.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation, and
creates the Makefile(s) (one in each subdirectory of the source
directory). In some packages it creates a C header file containing
system-dependent definitions. It also creates a file `config.status'
that you can run in the future to recreate the current configuration.
Running `configure' takes a minute or two. While it is running, it
prints some messages that tell what it is doing. If you don't want to
see the messages, run `configure' with its standard output redirected
to `/dev/null'; for example, `./configure >/dev/null'.
To compile the package in a different directory from the one
containing the source code, you must use a version of `make' that
supports the VPATH variable, such as GNU `make'. `cd' to the directory
where you want the object files and executables to go and run
`configure'. `configure' automatically checks for the source code in
the directory that `configure' is in and in `..'. If for some reason
`configure' is not in the source code directory that you are
configuring, then it will report that it can't find the source code.
In that case, run `configure' with the option `--srcdir=DIR', where
DIR is the directory that contains the source code.
By default, `make install' will install the package's files in
/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify
an installation prefix other than /usr/local by giving `configure' the
option `--prefix=PATH'. Alternately, you can do so by giving a value
for the `prefix' variable when you run `make', e.g.,
make prefix=/usr/gnu
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If
you give `configure' the option `--exec-prefix=PATH' or set the
`make' variable `exec_prefix' to PATH, the package will use PATH as
the prefix for installing programs and libraries. Data files and
documentation will still use the regular prefix. Normally, all files
are installed using the regular prefix.
Another `configure' option is useful mainly in `Makefile' rules for
updating `config.status' and `Makefile'. The `--no-create' option
figures out the configuration for your system and records it in
`config.status', without actually configuring the package (creating
`Makefile's and perhaps a configuration header file). Later, you can
run `./config.status' to actually configure the package. You can also
give `config.status' the `--recheck' option, which makes it re-run
`configure' with the same arguments you used before. This option is
useful if you change `configure'.
Some packages pay attention to `--with-PACKAGE' options to `configure',
where PACKAGE is something like `gnu-libc' or `x' (for X windows).
The README should mention any --with- options that the package recognizes.
`configure' ignores any other arguments that you give it.
If your system requires unusual options for compilation or linking
that `configure' doesn't know about, you can give `configure' initial
values for some variables by setting them in the environment. In
Bourne-compatible shells, you can do that on the command line like
this:
CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure
The `make' variables that you might want to override with environment
variables when running `configure' are:
(For these variables, any value given in the environment overrides the
value that `configure' would choose:)
CC C compiler program.
Default is `cc', or `gcc' if `gcc' is in your PATH.
INSTALL Program to use to install files.
Default is `install' if you have it, `cp' otherwise.
(For these variables, any value given in the environment is added to
the value that `configure' chooses:)
DEFS Configuration options, in the form `-Dfoo -Dbar ...'
Do not use this variable in packages that create a
configuration header file.
LIBS Libraries to link with, in the form `-lfoo -lbar ...'
If you need to do unusual things to compile the package, we encourage
you to figure out how `configure' could check whether to do them, and
mail diffs or instructions to the address given in the README so we
can include them in the next release.
2. Type `make' to compile the package. If you want, you can override
the `make' variables CFLAGS and LDFLAGS like this:
make CFLAGS=-O2 LDFLAGS=-s
3. If the package comes with self-tests and you want to run them,
type `make check'. If you're not sure whether there are any, try it;
if `make' responds with something like
make: *** No way to make target `check'. Stop.
then the package does not come with self-tests.
4. Type `make install' to install programs, data files, and
documentation.
5. You can remove the program binaries and object files from the
source directory by typing `make clean'. To also remove the
Makefile(s), the header file containing system-dependent definitions
(if the package uses one), and `config.status' (all the files that
`configure' created), type `make distclean'.
The file `configure.in' is used as a template to create `configure' by
a program called `autoconf'. You will only need it if you want to
regenerate `configure' using a newer version of `autoconf'.

View File

@@ -1,66 +0,0 @@
Received: from 128.140.1.1 by ee.lbl.gov for <vern@ee.lbl.gov> (8.6.9/1.43r)
id PAA03966; Tue, 24 Jan 1995 15:03:57 -0800
Received: from larry-le0.cc.emory.edu by
emoryu1.cc.emory.edu (5.65/Emory_cc.4.0.1) via SMTP
id AA24158 ; Tue, 24 Jan 95 17:18:18 -0500
From: tkane01@unix.cc.emory.edu (Terrence O Kane)
Received: by larry.cc.emory.edu (5.0) id AA21979; Tue, 24 Jan 1995 17:17:40 -0500
Message-Id: <9501242217.AA21979@larry.cc.emory.edu>
Subject: Re: Beta test for DOS
To: vern@ee.lbl.gov (Vern Paxson)
Date: Tue, 24 Jan 1995 17:17:38 -0500 (EST)
In-Reply-To: <199501232138.NAA11430@daffy.ee.lbl.gov> from "Vern Paxson" at Jan 23, 95 01:38:02 pm
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 5792
Vern,
I've made flex 2.5.0.6 successfully with no changes to the source
code at all. I'm including the Borland 4.02 makefile and config.h
at the end of this message.
When you're ready for release, I'll be happy to take care of getting
the appropriate archive files up to Simtel if you wish.
I have not used this version for any of my "work-related" scanners
yet, but have run the fastwc benchmark. The compiles were for large
memory model and optimization for fastest possible code. The test
machine was a Pentium-90 (hey! timing output was integer!) with
enhanced IDE on a PCI bus and no file system caching. I ran the
test on two different input files.
(Times are in seconds.)
The first input was a typical postscript file concatenated 10 times;
by typical, I mean that there were relatively few spaces, lots of lines
with no space, using lots of parentheses.
lines words characters
91200 356260 5889240
mywc 8.89
wc1s 15.22 default
wc1 10.82 -Cf
wc2 10.16 -Cf
wc3 9.17 -Cf
wc4 9.22 -Cf
wc5 10.98 -Cf
The second test run was on a file that consisted of 20 concatenations
of 'misc/flex.man'.
lines words characters
69960 305140 2399960
mywc 4.01
wc1s 6.87
wc1 5.32
wc2 4.95
wc3 4.12
wc4 4.12
wc5 5.05
[[Makefile and config.h moved to separate files -VP]]

View File

@@ -1,44 +0,0 @@
These patches and supplemental programs should allow porting to MVS or MVS/XA
in an EBCDIC envrionment, using SAS C V4.00C.
Included are:
-rw-r--r-- 1 swl26 1573 Jul 17 14:32 README
-rw-rw-r-- 1 swl26 20861 Jul 17 13:41 diffs
-rw-rw-r-- 1 swl26 5022 Jul 17 14:00 fixit.l
-rw-rw-r-- 1 swl26 97644 Jul 17 13:42 initscan.mvs.c
-rw-rw-r-- 1 swl26 4898 Jul 17 14:08 unfixit.l
The file "diffs" contains context diffs for changes to flex 2.3.
The file "fixit.l" contains flex sources for a program to shorten external
variable and function names to 8 characters or less. This is required for the
"dumb" compiler linker used.
The file "unfixit.l" reverses the changes in "fixit.l", to restore long names.
This is useful when trying to build diff files as created here.
The file "initscan.mvs.c" is an already "flexed" version of scan.l, in an
EBCDIC environment.
To install in an MVS environment, use patch to apply the diffs to flex 2.3,
then run "fixit" on all .c, .h, .l, .y, and .skel files. Move the files
to the MVS machine, and compile each of the .c files. (You will need a
"yacc" functional equivalent under MVS to expand parse.y in that
environment.) Link together, and the resulting flex should be ready to
go. To test, run the MVSflex -is8 -Ce on the scan.l, and you should get
back a file which is identical to initscan.mvs.c.
Enjoy.
Steven W. Layten
Senior Engineer
Chemical Abstracts Service
PO Box 3012
2540 Olentangy River Road
Columbus, Ohio 43210
+1 614 421 3600 extension 3451
INET: swl26%cas.BITNET@CUNYVM.CUNY.Edu
UUCP: osu-cis!chemabs!swl26
BITNET: swl26@cas.bitnet

View File

@@ -1,76 +0,0 @@
Miscellaneous flex stuff. The items which have been tested with flex 2.5 are:
- texinfo/, a subdirectory containing a "texinfo" version of flex(1)
and the corresponding "info" files (contributed by Francois Pinard).
- VMS/, a subdirectory containing makefiles, configuration files,
run-time support, and installation notes for building flex 2.5
on VMS (contributed by Pat Rankin).
- Borland/ - makefile and config.h for Borland 4.02 compiler
(contributed by Terrence O Kane, who notes that no source
code changes were necessary).
- NT/ - Makefile and config.h for NT, contributed by Stan Adermann.
- OS2/ - Makefile and config.h for building flex under OS/2,
contributed by Kai Uwe Rommel.
- Amiga/: notes on building flex for the Amiga, contributed
by Andreas Scherer.
- parse.c, parse.h - output of running yacc (byacc, actually)
on parse.y. If your system doesn't have a flavor of yacc available,
copy these into the main flex source directory instead.
- flex.man - preformatted version of flex man page
The following have been tested using flex 2.4:
- debflex.awk, an awk script for anotating flex debug output.
It presently only works with gawk and mawk, not with "old"
or "new" awk.
- NeXT: ProjectBuilder.app support for use in the NeXT world.
- Notes on building flex for the Macintosh using Think-C,
in the Macintosh/ subdirectory.
- testxxLexer.l, a sample C++ program that uses flex's scanner
class option ("-+").
- fastwc/, a subdirectory containing examples of how to use flex
to write progressively higher-performance versions of the Unix
"wc" utility. This certainly should work with 2.5, but hasn't
been tested.
- Borland.old/: notes on building flex 2.4 for Borland C++ 3.1
on MS-DOS. These shouldn't be needed for flex 2.5. Included
only in case you encounter unanticipated difficulties.
- EBCDIC: contact information for building flex for EBCDIC.
The following are all out-of-date with respect to flex release 2.4 (and
in general up-to-date for flex 2.3):
- Atari/Atari.patches, patches for porting flex to the Atari and
to Minix.
- A number of notes and Makefiles for compiling flex under MS-DOS,
in the MSDOS/ subdirectory.
- Notes on building flex for MVS, in the MVS/ subdirectory.
If any of this is out-of-date and can be deleted, please let me know.
And the following is included for compatibility with some broken versions
of bison:
- alloca.c, a public-domain, mostly-portable version of the
alloca() routine (used by bison's parsers) written by D. A. Gwyn.
Many thanks to those who contributed these files. Updated versions will
be appreciated!

View File

@@ -1,56 +0,0 @@
This directory contains some examples illustrating techniques for extracting
high-performance from flex scanners. Each program implements a simplified
version of the Unix "wc" tool: read text from stdin and print the number of
characters, words, and lines present in the text. All programs were compiled
using gcc (version unavailable, sorry) with the -O flag, and run on a
SPARCstation 1+. The input used was a PostScript file, mainly containing
figures, with the following "wc" counts:
lines words characters
214217 635954 2592172
The basic principles illustrated by these programs are:
- match as much text with each rule as possible
- adding rules does not slow you down!
- avoid backing up
and the big caveat that comes with them is:
- you buy performance with decreased maintainability; make
sure you really need it before applying the above techniques.
See the "Performance Considerations" section of flexdoc for more
details regarding these principles.
The different versions of "wc":
mywc.c
a simple but fairly efficient C version
wc1.l a naive flex "wc" implementation
wc2.l somewhat faster; adds rules to match multiple tokens at once
wc3.l faster still; adds more rules to match longer runs of tokens
wc4.l fastest; still more rules added; hard to do much better
using flex (or, I suspect, hand-coding)
wc5.l identical to wc3.l except one rule has been slightly
shortened, introducing backing-up
Timing results (all times in user CPU seconds):
program time notes
------- ---- -----
wc1 16.4 default flex table compression (= -Cem)
wc1 6.7 -Cf compression option
/bin/wc 5.8 Sun's standard "wc" tool
mywc 4.6 simple but better C implementation!
wc2 4.6 as good as C implementation; built using -Cf
wc3 3.8 -Cf
wc4 3.3 -Cf
wc5 5.7 -Cf; ouch, backing up is expensive

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +0,0 @@
This is release 2.5 of flex. See "version.h" for the exact patch-level.
See the file "NEWS" to find out what is new in this Flex release.
Read the file "INSTALL" for general installation directives. Peek near
the beginning of the file "Makefile.in" for special DEFS values. On most
systems, you can just run the "configure" script and type "make" to build
flex; then "make check" to test whether it built correctly; and if it did,
then "make install" to install it.
If you're feeling adventurous, you can also issue "make bigcheck" (be
prepared to wait a while).
Note that flex is distributed under a copyright very similar to that of
BSD Unix, and not under the GNU General Public License (GPL), except for
the "configure" script, which is covered by the GPL.
Many thanks to the 2.5 beta-testers for finding bugs and helping test and
increase portability: Stan Adermann, Scott David Daniels, Charles Elliott,
Joe Gayda, Chris Meier, James Nordby, Terrence O'Kane, Karsten Pahnke,
Francois Pinard, Pat Rankin, Andreas Scherer, Marc Wiese, Nathan Zelle.
Please send bug reports and feedback to: Vern Paxson (vern@ee.lbl.gov).
The flex distribution consists of the following files:
README This message
NEWS Differences between the various releases
INSTALL General installation information
COPYING flex's copyright
conf.in, configure.in, configure, Makefile.in, install.sh,
mkinstalldirs
elements of the "autoconf" auto-configuration process
flexdef.h, parse.y, scan.l, ccl.c, dfa.c, ecs.c, gen.c, main.c,
misc.c, nfa.c, sym.c, tblcmp.c, yylex.c
source files
version.h version of this flex release
flex.skl flex scanner skeleton
mkskel.sh script for converting flex.skl to C source file skel.c
skel.c pre-converted C version of flex.skl
libmain.c flex library (-lfl) sources
libyywrap.c
initscan.c pre-flex'd version of scan.l
FlexLexer.h header file for C++ lexer class
flex.1 user documentation
MISC/ a directory containing miscellaneous contributions.
See MISC/README for details.

View File

@@ -1,3 +0,0 @@
kernel32.dll
msvcrt.dll
ntdll.dll

View File

@@ -1,51 +0,0 @@
* Flex-2.5.4a for Windows *
===========================
What is it?
-----------
Flex: fast lexical analyzer generator
Description
-----------
Flex is a fast lexical analyser generator. It is a tool for generating
programs that perform pattern-matching on text. There are many applications
for Flex, including writing compilers in conjunction with GNU Bison. Flex
is a free implementation of the well known Lex program. It features a Lex
compatibility mode, and also provides several new features such as exclusive
start conditions.
Homepage
--------
http://www.gnu.org/software/flex/flex.html
System
------
- MS-Windows 95 / 98 / ME / NT / 2000 / XP with msvcrt.dll
- if msvcrt.dll is not in your Windows/System folder, get it from
Microsoft <http://support.microsoft.com/default.aspx?scid=kb;en-us;259403">
or by installing Internet Explorer 4.0 or higher
<http://www.microsoft.com/windows/ie>
Notes
-----
- Bugs and questions on this MS-Windows port: gnuwin32@users.sourceforge.net
Package Availability
--------------------
- in: http://gnuwin32.sourceforge.net
Sources
-------
- flex-2.5.4a-1-src.zip
Compilation
-----------
The package has been compiled with GNU auto-tools, GNU make, and Mingw
(GCC for MS-Windows). Any differences from the original sources are given
in flex-2.5.4a-1-GnuWin32.diffs in flex-2.5.4a-1-src.zip. Libraries needed
for compilation can be found at the lines starting with 'LIBS = ' in the
Makefiles. Usually, these are standard libraries provided with Mingw, or
libraries from the package itself; 'gw32c' refers to the libgw32c package,
which provides MS-Windows substitutes or stubs for functions normally found in
Unix. For more information, see: http://gnuwin32.sourceforge.net/compile.html
and http://gnuwin32.sourceforge.net/packages/libgw32c.htm.

View File

@@ -1,188 +0,0 @@
BISON(1) User Commands BISON(1)
NAME s
bison - GNU Project parser generator (yacc replacement)
n
SYNOPSIS 2
j:l. [OPTION]... FILE
4
DESCRIPTION
Bison is a parser generator in the style of yacc(1). It
should be upwardly compatible with input files designed
for yacc.
Input files should follow the yacc convention of ending
in .y. Unlike yacc, the generated files do not have
fixed names, but instead use the prefix of the input
file. Moreover, if you need to put C++ code in the
input file, you can end his name by a C++-like extension
(.ypp or .y++), then bison will follow your extension to
name the output file (.cpp or .c++). For instance, a
grammar description file named parse.yxx would produce
the generated parser in a file named parse.tab.cxx,
instead of yacc's y.tab.c or old Bison version's
parse.tab.c.
This description of the options that can be given to
bison is adapted from the node Invocation in the
bison.texinfo manual, which should be taken as authori-
tative.
Bison supports both traditional single-letter options
and mnemonic long option names. Long option names are
indicated with -- instead of -. Abbreviations for
option names are allowed as long as they are unique.
When a long option takes an argument, like --file-pre-
fix, connect the option name and the argument with =.
Generate LALR(1) and GLR parsers.
Mandatory arguments to long options are mandatory for
short options too. The same is true for optional argu-
ments.
Operation modes:
-h, --help
display this help and exit
-V, --version
output version information and exit
--print-localedir
output directory containing locale-dependent data
--print-datadir
output directory containing skeletons and XSLT
-y, --yacc
emulate POSIX Yacc
-W, --warnings=[CATEGORY]
report the warnings falling in CATEGORY
Parser:
-L, --language=LANGUAGE
specify the output programming language (this is
an experimental feature)
-S, --skeleton=FILE
specify the skeleton to use
-t, --debug
instrument the parser for debugging
--locations
enable locations computation
-p, --name-prefix=PREFIX
prepend PREFIX to the external symbols
-l, --no-lines
don't generate `#line' directives
-k, --token-table
include a table of token names
Output:
--defines[=FILE]
also produce a header file
-d likewise but cannot specify FILE (for POSIX Yacc)
-r, --report=THINGS
also produce details on the automaton
--report-file=FILE
write report to FILE
-v, --verbose
same as `--report=state'
-b, --file-prefix=PREFIX
specify a PREFIX for output files
-o, --output=FILE
leave output to FILE
-g, --graph[=FILE]
also output a graph of the automaton
-x, --xml[=FILE]
also output an XML report of the automaton (the
XML schema is experimental)
Warning categories include:
`midrule-values'
unset or unused midrule values
`yacc' incompatibilities with POSIX YACC
`all' all the warnings
`no-CATEGORY'
turn off warnings in CATEGORY
`none' turn off all the warnings
`error'
treat warnings as errors
THINGS is a list of comma separated words that can
include:
`state'
describe the states
`itemset'
complete the core item sets with their closure
`lookahead'
explicitly associate lookahead tokens to items
`solved'
describe shift/reduce conflicts solving
`all' include all the above information
`none' disable the report
AUTHOR
Written by Robert Corbett and Richard Stallman.
Copyright (C) 2008 Free Software Foundation, Inc. This
is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
REPORTING BUGS
Report bugs to <bug-bison@gnu.org>.
SEE ALSO
lex(1), flex(1), yacc(1).
The full documentation for bison is maintained as a Tex-
info manual. If the info and bison programs are prop-
erly installed at your site, the command
info bison
should give you access to the complete manual.
bison 2.4.1 December 2008 BISON(1)

File diff suppressed because it is too large Load Diff

View File

@@ -1,98 +0,0 @@
bin/bison.exe 9b77c0ac22320107da171b714daf35cd
bin/m4.exe a8bba9be6f35bd142ea6070c712db7a4
bin/yacc 7a2ae4197f417a220f2a6383107a6eeb
share/aclocal/bison-i18n.m4 b78aeb51518d933888422fe184769bc3
share/bison/bison.m4 cb4d3b1e574c3f51977a41648250ea2f
share/bison/c++-skel.m4 a6b2b7bb3ca446274a8ac9cb8752fdb5
share/bison/c++.m4 81e10995ca04361bcb62def5102453ae
share/bison/c-skel.m4 d103c4295424188df871403af31862b2
share/bison/c.m4 0ae9fd3c1281bf04d488150835abb13e
share/bison/glr.c 2ca76e035567ea8c4e4ab7e5c8c71bcd
share/bison/glr.cc 5e3848ae6d72f3aeb39e3cead9b19189
share/bison/java-skel.m4 266040f19946adcd0690a137d01b33b3
share/bison/java.m4 f14d7d0f7a5e2389ff6268571196aaff
share/bison/lalr1.cc 1e0342ff750e8327f264ac9ba40ca04e
share/bison/lalr1.java 8cfa32f6655dd131c75be26030d4f9e0
share/bison/location.cc a3b1de56827c557848a2cd796d9f0cc6
share/bison/m4sugar/foreach.m4 1ed14337cd515cb4769fa0819aea4788
share/bison/m4sugar/m4sugar.m4 927efcb06a8f6c6f1f4ed2ab61544774
share/bison/README 733daf0795885b7517ac76e7d9ec6072
share/bison/xslt/bison.xsl f9427406765c733e55302d18986461f7
share/bison/xslt/xml2dot.xsl b888fc340fc1ab15463b11d4a64885a6
share/bison/xslt/xml2text.xsl a2f070ab483e67019fed68c256e4cf4d
share/bison/xslt/xml2xhtml.xsl 2fc9119e3a9a612f057981b45ac6c54b
share/bison/yacc.c 54166ae249681d10c6f4e08287f03c81
share/locale/da/LC_MESSAGES/bison-runtime.mo 6dfd5c4570b100e040de0ff9d8650739
share/locale/da/LC_MESSAGES/bison.mo e619bb77e5aec8c63446446e2431b246
share/locale/de/LC_MESSAGES/bison-runtime.mo 170170e01937e2c8beb80cf773d769a1
share/locale/de/LC_MESSAGES/bison.mo 287df753c5a821fabaf8026874b06e0c
share/locale/el/LC_MESSAGES/bison-runtime.mo 914180733f3313feb2651575f5fce815
share/locale/el/LC_MESSAGES/bison.mo 7429c8a50d9ca4e1c872892ec3a7e92d
share/locale/es/LC_MESSAGES/bison-runtime.mo 802296357a908e3f9b8b30966f038586
share/locale/es/LC_MESSAGES/bison.mo a79f3ded869c39eec6e395b8d237c68e
share/locale/et/LC_MESSAGES/bison-runtime.mo c7c2679f0f24815f66f6ea715de66471
share/locale/et/LC_MESSAGES/bison.mo bc09ed96ae443bfd29d443977e2fab3a
share/locale/fi/LC_MESSAGES/bison-runtime.mo eb9a3e5ae9781e6e5106417f9ac95682
share/locale/fr/LC_MESSAGES/bison-runtime.mo 61e8aa920508778cd0940693ba788f82
share/locale/fr/LC_MESSAGES/bison.mo 7042cbf9fc27b4792dffbfb5cb62b032
share/locale/ga/LC_MESSAGES/bison-runtime.mo f3c89935e4c036ccbac69331023a1d02
share/locale/ga/LC_MESSAGES/bison.mo 8b429255351e8fcb8220f31ab7f15380
share/locale/hr/LC_MESSAGES/bison-runtime.mo aab786adbdf55d09ef0f06d0c35e3505
share/locale/hr/LC_MESSAGES/bison.mo e1e882789f14ba67d0d024ba7295ee70
share/locale/id/LC_MESSAGES/bison-runtime.mo c5f7380032b2ef9f6b1de236871bbb2b
share/locale/id/LC_MESSAGES/bison.mo c5d710e68f8b65bd5cdd722e91037c2f
share/locale/it/LC_MESSAGES/bison-runtime.mo a9394c45eb4b8ec48aadd75b7422c89f
share/locale/it/LC_MESSAGES/bison.mo 8c2e838bf50f3c17e67f20884fb76422
share/locale/ja/LC_MESSAGES/bison-runtime.mo eb40cb10de57e3df7856c17b32a276d0
share/locale/ja/LC_MESSAGES/bison.mo 1b801a1081b0b14aed1e806e41e444ba
share/locale/ky/LC_MESSAGES/bison-runtime.mo e09a5920850d3beb179f936d4429013c
share/locale/lt/LC_MESSAGES/bison-runtime.mo 39e5df7115def15af732bd900bc96700
share/locale/ms/LC_MESSAGES/bison-runtime.mo 9e59662660f0d3c6f431974ade35b3a4
share/locale/ms/LC_MESSAGES/bison.mo 24464692b8dad9b43b053c770dc9c125
share/locale/nb/LC_MESSAGES/bison-runtime.mo f4b38d7e0d23efe7532c873c862f1c72
share/locale/nb/LC_MESSAGES/bison.mo 13df5b58f2cecd17197726419c884c12
share/locale/nl/LC_MESSAGES/bison-runtime.mo 26a294e26df2db2531cf6b4a3cb6f3bd
share/locale/nl/LC_MESSAGES/bison.mo 0cae765387f2a8fa74d675dc053a08d5
share/locale/pl/LC_MESSAGES/bison-runtime.mo db9a933d1852b4c93f0ae280bc81239d
share/locale/pl/LC_MESSAGES/bison.mo 73037bfd4b47336ef8b860eee3eab107
share/locale/pt_BR/LC_MESSAGES/bison-runtime.mo c1861e0a8d3b47ff8d82436acbad7a1d
share/locale/pt_BR/LC_MESSAGES/bison.mo abc75395c16fe23cebff32b495e5326a
share/locale/ro/LC_MESSAGES/bison-runtime.mo 81f0521018ff088ddb1dcf5a0c55304d
share/locale/ro/LC_MESSAGES/bison.mo 17e4bbc6258a9a3515ce9f2f5e375ac9
share/locale/ru/LC_MESSAGES/bison-runtime.mo 7cb4e547d5fd69d41e714bed5ea6e07f
share/locale/ru/LC_MESSAGES/bison.mo 2677e3d7a467c1836095c1926b3fccc8
share/locale/sl/LC_MESSAGES/bison-runtime.mo 529c3f31f53666dcde532c22c8b039a8
share/locale/sv/LC_MESSAGES/bison-runtime.mo 49f339132b3ba054d15db2c36bb7d415
share/locale/sv/LC_MESSAGES/bison.mo 147d21a3a9b6aa5dacbc153a3698523b
share/locale/th/LC_MESSAGES/bison-runtime.mo 940980271d3eb51e1a3d9d04276fa82d
share/locale/tr/LC_MESSAGES/bison-runtime.mo a6a3f122a5bd3bbfe523252dbdbb8bae
share/locale/tr/LC_MESSAGES/bison.mo c530ab29d98b29ada966d345e6e1b4cc
share/locale/uk/LC_MESSAGES/bison-runtime.mo 3503e13922340f9bb8c7e7dd1745ad56
share/locale/uk/LC_MESSAGES/bison.mo a64c5fca9b48094a1293d03944a6909d
share/locale/vi/LC_MESSAGES/bison-runtime.mo 47e72d9a6bae970ac7c1f80074a16fab
share/locale/vi/LC_MESSAGES/bison.mo b9e2b62efaa700bdaf98361898e8f698
share/locale/zh_CN/LC_MESSAGES/bison-runtime.mo ff3d1e2cfd6c97093b58ec9915da4512
share/locale/zh_TW/LC_MESSAGES/bison-runtime.mo 5480f8bd87280285cc3a93cd4d32a261
share/locale/zh_TW/LC_MESSAGES/bison.mo cfe91e1fe608c7d7d5911fc443b0a8ef
man/cat1/bison.1.txt a6055372a5deb55bd1724ee2a8dce3f9
man/cat1/yacc.1.txt 46db0be5355842507a52eac5903b7656
man/cat1p/yacc.1p.txt 616a07d308d3ce1a9b818d24d3db656b
contrib/bison/2.4.1/bison-2.4.1/check.log 1fca25fd5033310331b72223313ce9d7
contrib/bison/2.4.1/bison-2.4.1-GnuWin32.README 0b034363b6623940541f78785206172b
contrib/bison/2.4.1/bison-2.4.1-src/ABOUT-NLS f60c7a8c0f41f0c420f577b8eac3eb8d
contrib/bison/2.4.1/bison-2.4.1-src/AUTHORS 831615db728b01c7deba7327cd8dae7c
contrib/bison/2.4.1/bison-2.4.1-src/ChangeLog 86bf2bdbcf7ce19ac5d012c131354895
contrib/bison/2.4.1/bison-2.4.1-src/COPYING d32239bcb673463ab874e80d47fae504
contrib/bison/2.4.1/bison-2.4.1-src/data/README 733daf0795885b7517ac76e7d9ec6072
contrib/bison/2.4.1/bison-2.4.1-src/djgpp/README.in 6a9c802d502d3eaddd1c07845794f623
contrib/bison/2.4.1/bison-2.4.1-src/doc/bison.info d1327fbe26856b29ea3e5011666699c6
contrib/bison/2.4.1/bison-2.4.1-src/doc/gpl-3.0.texi 546c7be07c02468d7ff987d788457098
contrib/bison/2.4.1/bison-2.4.1-src/etc/README 54bd8e9cac2262ddff1d42a05b71d946
contrib/bison/2.4.1/bison-2.4.1-src/INSTALL 60f30af7e6443cf9bf9d8c91e8678dd8
contrib/bison/2.4.1/bison-2.4.1-src/NEWS 77a6406fe4da30964f9118590f4d65ce
contrib/bison/2.4.1/bison-2.4.1-src/README cf4640a624fe427a45c68042ecea9a07
contrib/bison/2.4.1/bison-2.4.1-src/README-alpha cbb41c6b143a533d323d47a38231eab1
contrib/bison/2.4.1/bison-2.4.1-src/THANKS 45de5fa016f19ad20c571c7f0bd3b603
contrib/bison/2.4.1/bison-2.4.1-src/TODO f35ceeef307431ca11ed45ba5f6ce771
manifest/bison-2.4.1-bin.mft
manifest/bison-2.4.1-bin.ver 740f684ae2a8d4b60e1e3359e7080e56

View File

@@ -1 +0,0 @@
Bison-2.4.1 (Yacc-compatible parser generator): Binaries

View File

@@ -1,5 +0,0 @@
bin/libiconv2.dll
bin/libintl3.dll
bin/regex2.dll
manifest/bison-2.4.1-dep.mft
manifest/bison-2.4.1-dep.ver bb151d843339f90abdc34f5eb49bff0e

View File

@@ -1 +0,0 @@
Bison-2.4.1 (Yacc-compatible parser generator): Dependencies

View File

@@ -1,15 +0,0 @@
bin/flex.exe
bin/flex++.exe
contrib/flex/2.5.4a/flex-2.5.4a/COPYING
contrib/flex/2.5.4a/flex-2.5.4a/depends-GnuWin32.lst
contrib/flex/2.5.4a/flex-2.5.4a/flex-2.5.4a-1-GnuWin32.README
contrib/flex/2.5.4a/flex-2.5.4a/INSTALL
contrib/flex/2.5.4a/flex-2.5.4a/MISC/Borland/NOTES
contrib/flex/2.5.4a/flex-2.5.4a/MISC/fastwc/README
contrib/flex/2.5.4a/flex-2.5.4a/MISC/MVS/README
contrib/flex/2.5.4a/flex-2.5.4a/MISC/README
contrib/flex/2.5.4a/flex-2.5.4a/NEWS
contrib/flex/2.5.4a/flex-2.5.4a/README
man/cat1/flex.1.txt
manifest/flex-2.5.4a-1-bin.mft
manifest/flex-2.5.4a-1-bin.ver

View File

@@ -1,2 +0,0 @@
Flex 2.5.4a: Binaries
Flex: fast lexical analyzer generator

View File

@@ -1,556 +0,0 @@
-*- Autoconf -*-
# Language-independent M4 Macros for Bison.
# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
# Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
## ---------------- ##
## Identification. ##
## ---------------- ##
# b4_copyright(TITLE, YEARS)
# --------------------------
m4_define([b4_copyright],
[b4_comment([A Bison parser, made by GNU Bison b4_version.])
b4_comment([$1
m4_text_wrap([Copyright (C) $2 Free Software Foundation, Inc.], [ ])
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.])
b4_comment([As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison.])])
## ---------------- ##
## Error handling. ##
## ---------------- ##
# The following error handling macros print error directives that should not
# become arguments of other macro invocations since they would likely then be
# mangled. Thus, they print to stdout directly.
# b4_cat(TEXT)
# ------------
# Write TEXT to stdout. Precede the final newline with an @ so that it's
# escaped. For example:
#
# b4_cat([[@complain(invalid input@)]])
m4_define([b4_cat],
[m4_syscmd([cat <<'_m4eof'
]m4_bpatsubst(m4_dquote($1), [_m4eof], [_m4@`eof])[@
_m4eof
])dnl
m4_if(m4_sysval, [0], [], [m4_fatal([$0: cannot write to stdout])])])
# b4_error(KIND, FORMAT, [ARG1], [ARG2], ...)
# -------------------------------------------
# Write @KIND(FORMAT@,ARG1@,ARG2@,...@) to stdout.
#
# For example:
#
# b4_error([[warn]], [[invalid value for `%s': %s]], [[foo]], [[3]])
m4_define([b4_error],
[b4_cat([[@]$1[(]$2[]]dnl
[m4_if([$#], [2], [],
[m4_foreach([b4_arg],
m4_dquote(m4_shift(m4_shift($@))),
[[@,]b4_arg])])[@)]])])
# b4_error_at(KIND, START, END, FORMAT, [ARG1], [ARG2], ...)
# ----------------------------------------------------------
# Write @KIND_at(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout.
#
# For example:
#
# b4_error_at([[complain]], [[input.y:2.3]], [[input.y:5.4]],
# [[invalid %s]], [[foo]])
m4_define([b4_error_at],
[b4_cat([[@]$1[_at(]$2[@,]$3[@,]$4[]]dnl
[m4_if([$#], [4], [],
[m4_foreach([b4_arg],
m4_dquote(m4_shift(m4_shift(m4_shift(m4_shift($@))))),
[[@,]b4_arg])])[@)]])])
# b4_warn(FORMAT, [ARG1], [ARG2], ...)
# ------------------------------------
# Write @warn(FORMAT@,ARG1@,ARG2@,...@) to stdout.
#
# For example:
#
# b4_warn([[invalid value for `%s': %s]], [[foo]], [[3]])
#
# As a simple test suite, this:
#
# m4_divert(-1)
# m4_define([asdf], [ASDF])
# m4_define([fsa], [FSA])
# m4_define([fdsa], [FDSA])
# b4_warn([[[asdf), asdf]]], [[[fsa), fsa]]], [[[fdsa), fdsa]]])
# b4_warn([[asdf), asdf]], [[fsa), fsa]], [[fdsa), fdsa]])
# b4_warn()
# b4_warn(1)
# b4_warn(1, 2)
#
# Should produce this without newlines:
#
# @warn([asdf), asdf]@,[fsa), fsa]@,[fdsa), fdsa]@)
# @warn(asdf), asdf@,fsa), fsa@,fdsa), fdsa@)
# @warn(@)
# @warn(1@)
# @warn(1@,2@)
m4_define([b4_warn],
[b4_error([[warn]], $@)])
# b4_warn_at(START, END, FORMAT, [ARG1], [ARG2], ...)
# ---------------------------------------------------
# Write @warn(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout.
#
# For example:
#
# b4_warn_at([[input.y:2.3]], [[input.y:5.4]], [[invalid %s]], [[foo]])
m4_define([b4_warn_at],
[b4_error_at([[warn]], $@)])
# b4_complain(FORMAT, [ARG1], [ARG2], ...)
# ----------------------------------------
# Write @complain(FORMAT@,ARG1@,ARG2@,...@) to stdout.
#
# See b4_warn example.
m4_define([b4_complain],
[b4_error([[complain]], $@)])
# b4_complain_at(START, END, FORMAT, [ARG1], [ARG2], ...)
# -------------------------------------------------------
# Write @complain(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout.
#
# See b4_warn_at example.
m4_define([b4_complain_at],
[b4_error_at([[complain]], $@)])
# b4_fatal(FORMAT, [ARG1], [ARG2], ...)
# -------------------------------------
# Write @fatal(FORMAT@,ARG1@,ARG2@,...@) to stdout and exit.
#
# See b4_warn example.
m4_define([b4_fatal],
[b4_error([[fatal]], $@)dnl
m4_exit(1)])
# b4_fatal_at(START, END, FORMAT, [ARG1], [ARG2], ...)
# ----------------------------------------------------
# Write @fatal(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout and exit.
#
# See b4_warn_at example.
m4_define([b4_fatal_at],
[b4_error_at([[fatal]], $@)dnl
m4_exit(1)])
## ---------------- ##
## Default values. ##
## ---------------- ##
# m4_define_default([b4_lex_param], []) dnl breaks other skeletons
m4_define_default([b4_pre_prologue], [])
m4_define_default([b4_post_prologue], [])
m4_define_default([b4_epilogue], [])
m4_define_default([b4_parse_param], [])
# The initial column and line.
m4_define_default([b4_location_initial_column], [1])
m4_define_default([b4_location_initial_line], [1])
## ------------ ##
## Data Types. ##
## ------------ ##
# b4_ints_in(INT1, INT2, LOW, HIGH)
# ---------------------------------
# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
m4_define([b4_ints_in],
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
## ------------------ ##
## Decoding options. ##
## ------------------ ##
# b4_flag_if(FLAG, IF-TRUE, IF-FALSE)
# -----------------------------------
# Run IF-TRUE if b4_FLAG_flag is 1, IF-FALSE if FLAG is 0, otherwise fail.
m4_define([b4_flag_if],
[m4_case(b4_$1_flag,
[0], [$3],
[1], [$2],
[m4_fatal([invalid $1 value: ]$1)])])
# b4_define_flag_if(FLAG)
# -----------------------
# Define "b4_FLAG_if(IF-TRUE, IF-FALSE)" that depends on the
# value of the Boolean FLAG.
m4_define([b4_define_flag_if],
[_b4_define_flag_if($[1], $[2], [$1])])
# _b4_define_flag_if($1, $2, FLAG)
# --------------------------------
# This macro works around the impossibility to define macros
# inside macros, because issuing `[$1]' is not possible in M4 :(.
# This sucks hard, GNU M4 should really provide M5 like $$1.
m4_define([_b4_define_flag_if],
[m4_if([$1$2], $[1]$[2], [],
[m4_fatal([$0: Invalid arguments: $@])])dnl
m4_define([b4_$3_if],
[b4_flag_if([$3], [$1], [$2])])])
# b4_FLAG_if(IF-TRUE, IF-FALSE)
# -----------------------------
# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise.
b4_define_flag_if([defines]) # Whether headers are requested.
b4_define_flag_if([error_verbose]) # Whether error are verbose.
b4_define_flag_if([glr]) # Whether a GLR parser is requested.
b4_define_flag_if([locations]) # Whether locations are tracked.
b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled.
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
## ------------------------- ##
## Assigning token numbers. ##
## ------------------------- ##
## ----------- ##
## Synclines. ##
## ----------- ##
# b4_basename(NAME)
# -----------------
# Similar to POSIX basename; the differences don't matter here.
# Beware that NAME is not evaluated.
m4_define([b4_basename],
[m4_bpatsubst([$1], [^.*/\([^/]+\)/*$], [\1])])
# b4_syncline(LINE, FILE)
# -----------------------
m4_define([b4_syncline],
[b4_flag_if([synclines], [
b4_sync_end([__line__], [b4_basename(m4_quote(__file__))])
b4_sync_start([$1], [$2])])])
m4_define([b4_sync_end], [b4_comment([Line $1 of $2])])
m4_define([b4_sync_start], [b4_comment([Line $1 of $2])])
# b4_user_code(USER-CODE)
# -----------------------
# Emit code from the user, ending it with synclines.
m4_define([b4_user_code],
[$1
b4_syncline([@oline@], [@ofile@])])
# b4_define_user_code(MACRO)
# --------------------------
# From b4_MACRO, build b4_user_MACRO that includes the synclines.
m4_define([b4_define_user_code],
[m4_define([b4_user_$1],
[b4_user_code([b4_$1])])])
# b4_user_actions
# b4_user_initial_action
# b4_user_post_prologue
# b4_user_pre_prologue
# b4_user_stype
# ----------------------
# Macros that issue user code, ending with synclines.
b4_define_user_code([actions])
b4_define_user_code([initial_action])
b4_define_user_code([post_prologue])
b4_define_user_code([pre_prologue])
b4_define_user_code([stype])
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
# --------------------------------------------------------
# Warn if any name of type WHAT is used by the user (as recorded in USER-LIST)
# but is not used by Bison (as recorded by macros in the namespace
# BISON-NAMESPACE).
#
# USER-LIST must expand to a list specifying all grammar occurrences of all
# names of type WHAT. Each item in the list must be a triplet specifying one
# occurrence: name, start boundary, and end boundary. Empty string names are
# fine. An empty list is fine.
#
# For example, to define b4_foo_user_names to be used for USER-LIST with three
# name occurrences and with correct quoting:
#
# m4_define([b4_foo_user_names],
# [[[[[[bar]], [[parser.y:1.7]], [[parser.y:1.16]]]],
# [[[[bar]], [[parser.y:5.7]], [[parser.y:5.16]]]],
# [[[[baz]], [[parser.y:8.7]], [[parser.y:8.16]]]]]])
#
# The macro BISON-NAMESPACE(bar) must be defined iff the name bar of type WHAT
# is used by Bison (in the front-end or in the skeleton). Empty string names
# are fine, but it would be ugly for Bison to actually use one.
#
# For example, to use b4_foo_bison_names for BISON-NAMESPACE and define that
# the names bar and baz are used by Bison:
#
# m4_define([b4_foo_bison_names(bar)])
# m4_define([b4_foo_bison_names(baz)])
#
# To invoke b4_check_user_names with TYPE foo, with USER-LIST
# b4_foo_user_names, with BISON-NAMESPACE b4_foo_bison_names, and with correct
# quoting:
#
# b4_check_user_names([[foo]], [b4_foo_user_names],
# [[b4_foo_bison_names]])
m4_define([b4_check_user_names],
[m4_foreach([b4_occurrence], $2,
[m4_pushdef([b4_occurrence], b4_occurrence)dnl
m4_pushdef([b4_user_name], m4_car(b4_occurrence))dnl
m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl
m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl
m4_ifndef($3[(]m4_quote(b4_user_name)[)],
[b4_warn_at([b4_start], [b4_end],
[[%s `%s' is not used]],
[$1], [b4_user_name])])[]dnl
m4_popdef([b4_occurrence])dnl
m4_popdef([b4_user_name])dnl
m4_popdef([b4_start])dnl
m4_popdef([b4_end])dnl
])])
# b4_percent_define_get(VARIABLE)
# -------------------------------
# Mimic muscle_percent_define_get in ../src/muscle_tab.h exactly. That is, if
# the %define variable VARIABLE is defined, emit its value. Also, record
# Bison's usage of VARIABLE by defining
# b4_percent_define_bison_variables(VARIABLE).
#
# For example:
#
# b4_percent_define_get([[foo]])
m4_define([b4_percent_define_get],
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
m4_ifdef([b4_percent_define(]$1[)], [m4_indir([b4_percent_define(]$1[)])])])
# b4_percent_define_get_loc(VARIABLE)
# -----------------------------------
# Mimic muscle_percent_define_get_loc in ../src/muscle_tab.h exactly. That is,
# if the %define variable VARIABLE is undefined, complain fatally since that's
# a Bison or skeleton error. Otherwise, return its definition location in a
# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or
# b4_fatal_at. Don't record this as a Bison usage of VARIABLE as there's no
# reason to suspect that the user-supplied value has yet influenced the output.
#
# For example:
#
# b4_complain_at(b4_percent_define_get_loc([[foo]]), [[invalid foo]])
m4_define([b4_percent_define_get_loc],
[m4_ifdef([b4_percent_define_loc(]$1[)],
[m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl
b4_loc[]dnl
m4_popdef([b4_loc])],
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_get_loc]], [$1])])])
# b4_percent_define_get_syncline(VARIABLE)
# ----------------------------------------
# Mimic muscle_percent_define_get_syncline in ../src/muscle_tab.h exactly.
# That is, if the %define variable VARIABLE is undefined, complain fatally
# since that's a Bison or skeleton error. Otherwise, return its definition
# location as a b4_syncline invocation. Don't record this as a Bison usage of
# VARIABLE as there's no reason to suspect that the user-supplied value has yet
# influenced the output.
#
# For example:
#
# b4_percent_define_get_syncline([[foo]])
m4_define([b4_percent_define_get_syncline],
[m4_ifdef([b4_percent_define_syncline(]$1[)],
[m4_indir([b4_percent_define_syncline(]$1[)])],
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_get_syncline]], [$1])])])
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
# ------------------------------------------------------
# Mimic muscle_percent_define_ifdef in ../src/muscle_tab.h exactly. That is,
# if the %define variable VARIABLE is defined, expand IF-TRUE, else expand
# IF-FALSE. Also, record Bison's usage of VARIABLE by defining
# b4_percent_define_bison_variables(VARIABLE).
#
# For example:
#
# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
m4_define([b4_percent_define_ifdef],
[m4_ifdef([b4_percent_define(]$1[)],
[m4_define([b4_percent_define_bison_variables(]$1[)])$2],
[$3])])
# b4_percent_define_flag_if(VARIABLE, IF-TRUE, [IF-FALSE])
# --------------------------------------------------------
# Mimic muscle_percent_define_flag_if in ../src/muscle_tab.h exactly. That is,
# if the %define variable VARIABLE is defined to "" or "true", expand IF-TRUE.
# If it is defined to "false", expand IF-FALSE. Complain if it is undefined
# (a Bison or skeleton error since the default value should have been set
# already) or defined to any other value (possibly a user error). Also, record
# Bison's usage of VARIABLE by defining
# b4_percent_define_bison_variables(VARIABLE).
#
# For example:
#
# b4_percent_define_flag_if([[foo]], [[it's true]], [[it's false]])
m4_define([b4_percent_define_flag_if],
[b4_percent_define_ifdef([$1],
[m4_case(b4_percent_define_get([$1]),
[], [$2], [true], [$2], [false], [$3],
[m4_expand_once([b4_complain_at(b4_percent_define_get_loc([$1]),
[[invalid value for %%define Boolean variable `%s']],
[$1])],
[[b4_percent_define_flag_if($1)]])])],
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_flag_if]], [$1])])])
# b4_percent_define_default(VARIABLE, DEFAULT)
# --------------------------------------------
# Mimic muscle_percent_define_default in ../src/muscle_tab.h exactly. That is,
# if the %define variable VARIABLE is undefined, set its value to DEFAULT.
# Don't record this as a Bison usage of VARIABLE as there's no reason to
# suspect that the value has yet influenced the output.
#
# For example:
#
# b4_percent_define_default([[foo]], [[default value]])
m4_define([b4_percent_define_default],
[m4_ifndef([b4_percent_define(]$1[)],
[m4_define([b4_percent_define(]$1[)], [$2])dnl
m4_define([b4_percent_define_loc(]$1[)],
[[[[[Bison:b4_percent_define_default]:1.0]], [[[Bison:b4_percent_define_default]:1.0]]]])dnl
m4_define([b4_percent_define_syncline(]$1[)],
[[]b4_syncline(1, [["[Bison:b4_percent_define_default]"]])[
]])])])
# b4_percent_define_check_values(VALUES)
# --------------------------------------
# Mimic muscle_percent_define_check_values in ../src/muscle_tab.h exactly
# except that the VALUES structure is more appropriate for M4. That is, VALUES
# is a list of sublists of strings. For each sublist, the first string is the
# name of a %define variable, and all remaining strings in that sublist are the
# valid values for that variable. Complain if such a variable is undefined (a
# Bison error since the default value should have been set already) or defined
# to any other value (possibly a user error). Don't record this as a Bison
# usage of the variable as there's no reason to suspect that the value has yet
# influenced the output.
#
# For example:
#
# b4_percent_define_check_values([[[[foo]], [[foo-value1]], [[foo-value2]]]],
# [[[[bar]], [[bar-value1]]]])
m4_define([b4_percent_define_check_values],
[m4_foreach([b4_sublist], m4_quote($@),
[_b4_percent_define_check_values(b4_sublist)])])
m4_define([_b4_percent_define_check_values],
[m4_ifdef([b4_percent_define(]$1[)],
[m4_pushdef([b4_good_value], [0])dnl
m4_if($#, 1, [],
[m4_foreach([b4_value], m4_dquote(m4_shift($@)),
[m4_if(m4_indir([b4_percent_define(]$1[)]), b4_value,
[m4_define([b4_good_value], [1])])])])dnl
m4_if(b4_good_value, [0],
[b4_complain_at(b4_percent_define_get_loc([$1]),
[[invalid value for %%define variable `%s': `%s']],
[$1],
m4_dquote(m4_indir([b4_percent_define(]$1[)])))])dnl
m4_popdef([b4_good_value])],
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_check_values]], [$1])])])
# b4_percent_code_get([QUALIFIER])
# --------------------------------
# If any %code blocks for QUALIFIER are defined, emit them beginning with a
# comment and ending with synclines and a newline. If QUALIFIER is not
# specified or empty, do this for the unqualified %code blocks. Also, record
# Bison's usage of QUALIFIER (if specified) by defining
# b4_percent_code_bison_qualifiers(QUALIFIER).
#
# For example, to emit any unqualified %code blocks followed by any %code
# blocks for the qualifier foo:
#
# b4_percent_code_get
# b4_percent_code_get([[foo]])
m4_define([b4_percent_code_get],
[m4_pushdef([b4_macro_name], [[b4_percent_code(]$1[)]])dnl
m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])dnl
m4_ifdef(b4_macro_name,
[b4_comment([m4_if([$#], [0], [[Unqualified %code]],
[["%code ]$1["]])[ blocks.]])
b4_user_code([m4_indir(b4_macro_name)])
])dnl
m4_popdef([b4_macro_name])])
# b4_percent_code_ifdef(QUALIFIER, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------
# If any %code blocks for QUALIFIER (or unqualified %code blocks if
# QUALIFIER is empty) are defined, expand IF-TRUE, else expand IF-FALSE.
# Also, record Bison's usage of QUALIFIER (if specified) by defining
# b4_percent_code_bison_qualifiers(QUALIFIER).
m4_define([b4_percent_code_ifdef],
[m4_ifdef([b4_percent_code(]$1[)],
[m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])$2],
[$3])])
## ----------------------------------------------------------- ##
## After processing the skeletons, check that all the user's ##
## %define variables and %code qualifiers were used by Bison. ##
## ----------------------------------------------------------- ##
m4_define([b4_check_user_names_wrap],
[m4_ifdef([b4_percent_]$1[_user_]$2[s],
[b4_check_user_names([[%]$1 $2],
[b4_percent_]$1[_user_]$2[s],
[[b4_percent_]$1[_bison_]$2[s]])])])
m4_wrap_lifo([
b4_check_user_names_wrap([[define]], [[variable]])
b4_check_user_names_wrap([[code]], [[qualifier]])
])

View File

@@ -1,170 +0,0 @@
-*- Autoconf -*-
# C++ skeleton for Bison
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
# Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_include(b4_pkgdatadir/[c.m4])
## ---------------- ##
## Default values. ##
## ---------------- ##
# Default parser class name.
b4_percent_define_default([[parser_class_name]], [[parser]])
b4_percent_define_default([[location_type]], [[location]])
b4_percent_define_default([[filename_type]], [[std::string]])
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
b4_percent_define_default([[define_location_comparison]],
[m4_if(b4_percent_define_get([[filename_type]]),
[std::string], [[true]], [[false]])])
## ----------- ##
## Namespace. ##
## ----------- ##
m4_define([b4_namespace_ref], [b4_percent_define_get([[namespace]])])
# Don't permit an empty b4_namespace_ref. Any `::parser::foo' appended to it
# would compile as an absolute reference with `parser' in the global namespace.
# b4_namespace_open would open an anonymous namespace and thus establish
# internal linkage. This would compile. However, it's cryptic, and internal
# linkage for the parser would be specified in all translation units that
# include the header, which is always generated. If we ever need to permit
# internal linkage somehow, surely we can find a cleaner approach.
m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
[[namespace reference is empty]])])
# Instead of assuming the C++ compiler will do it, Bison should reject any
# invalid b4_namepsace_ref that would be converted to a valid
# b4_namespace_open. The problem is that Bison doesn't always output
# b4_namespace_ref to uncommented code but should reserve the ability to do so
# in future releases without risking breaking any existing user grammars.
# Specifically, don't allow empty names as b4_namespace_open would just convert
# those into anonymous namespaces, and that might tempt some users.
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [],
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
[[namespace reference has consecutive "::"]])])
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [],
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
[[namespace reference has a trailing "::"]])])
m4_define([b4_namespace_open],
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
[^\(.\)[ ]*::], [\1])),
[::], [ { namespace ])[ {]])])
m4_define([b4_namespace_close],
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^][:]\)*],
[\1])),
[::\([^][:]\|:[^][:]\)*], [} ])[} // ]b4_namespace_ref])])
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
# -----------------------------------------------------
# Output the definition of the tokens as enums.
m4_define([b4_token_enums],
[/* Tokens. */
enum yytokentype {
m4_map_sep([ b4_token_enum], [,
],
[$@])
};
])
## ----------------- ##
## Semantic Values. ##
## ----------------- ##
# b4_lhs_value([TYPE])
# --------------------
# Expansion of $<TYPE>$.
m4_define([b4_lhs_value],
[(yyval[]m4_ifval([$1], [.$1]))])
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
# --------------------------------------
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
# symbols on RHS.
m4_define([b4_rhs_value],
[(yysemantic_stack_@{($1) - ($2)@}m4_ifval([$3], [.$3]))])
# b4_lhs_location()
# -----------------
# Expansion of @$.
m4_define([b4_lhs_location],
[(yyloc)])
# b4_rhs_location(RULE-LENGTH, NUM)
# ---------------------------------
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
# on RHS.
m4_define([b4_rhs_location],
[(yylocation_stack_@{($1) - ($2)@})])
# b4_parse_param_decl
# -------------------
# Extra formal arguments of the constructor.
# Change the parameter names from "foo" into "foo_yyarg", so that
# there is no collision bw the user chosen attribute name, and the
# argument name in the constructor.
m4_define([b4_parse_param_decl],
[m4_ifset([b4_parse_param],
[m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
m4_define([b4_parse_param_decl_1],
[$1_yyarg])
# b4_parse_param_cons
# -------------------
# Extra initialisations of the constructor.
m4_define([b4_parse_param_cons],
[m4_ifset([b4_parse_param],
[
b4_cc_constructor_calls(b4_parse_param)])])
m4_define([b4_cc_constructor_calls],
[m4_map_sep([b4_cc_constructor_call], [,
], [$@])])
m4_define([b4_cc_constructor_call],
[$2 ($2_yyarg)])
# b4_parse_param_vars
# -------------------
# Extra instance variables.
m4_define([b4_parse_param_vars],
[m4_ifset([b4_parse_param],
[
/* User arguments. */
b4_cc_var_decls(b4_parse_param)])])
m4_define([b4_cc_var_decls],
[m4_map_sep([b4_cc_var_decl], [
], [$@])])
m4_define([b4_cc_var_decl],
[ $1;])

View File

@@ -1,477 +0,0 @@
-*- Autoconf -*-
# C M4 Macros for Bison.
# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008 Free Software
# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
## ---------------- ##
## Identification. ##
## ---------------- ##
# b4_comment(TEXT)
# ----------------
m4_define([b4_comment], [/* m4_bpatsubst([$1], [
], [
]) */])
# b4_identification
# -----------------
# Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or
# b4_pull_flag if they use the values of the %define variables api.pure or
# api.push_pull.
m4_define([b4_identification],
[[/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "]b4_version["
/* Skeleton name. */
#define YYSKELETON_NAME ]b4_skeleton[]m4_ifdef([b4_pure_flag], [[
/* Pure parsers. */
#define YYPURE ]b4_pure_flag])[]m4_ifdef([b4_push_flag], [[
/* Push parsers. */
#define YYPUSH ]b4_push_flag])[]m4_ifdef([b4_pull_flag], [[
/* Pull parsers. */
#define YYPULL ]b4_pull_flag])[
/* Using locations. */
#define YYLSP_NEEDED ]b4_locations_flag[
]])
## ---------------- ##
## Default values. ##
## ---------------- ##
# If the %union is not named, its name is YYSTYPE.
m4_define_default([b4_union_name], [YYSTYPE])
# If the %name-prefix is not given, it is yy.
m4_define_default([b4_prefix], [yy])
## ------------------------ ##
## Pure/impure interfaces. ##
## ------------------------ ##
# b4_user_args
# ------------
m4_define([b4_user_args],
[m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])])
# b4_parse_param
# --------------
# If defined, b4_parse_param arrives double quoted, but below we prefer
# it to be single quoted.
m4_define([b4_parse_param],
b4_parse_param)
# b4_parse_param_for(DECL, FORMAL, BODY)
# ---------------------------------------
# Iterate over the user parameters, binding the declaration to DECL,
# the formal name to FORMAL, and evaluating the BODY.
m4_define([b4_parse_param_for],
[m4_foreach([$1_$2], m4_defn([b4_parse_param]),
[m4_pushdef([$1], m4_unquote(m4_car($1_$2)))dnl
m4_pushdef([$2], m4_shift($1_$2))dnl
$3[]dnl
m4_popdef([$2])dnl
m4_popdef([$1])dnl
])])
# b4_parse_param_use
# ------------------
# `YYUSE' all the parse-params.
m4_define([b4_parse_param_use],
[b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal);
])dnl
])
## ------------ ##
## Data Types. ##
## ------------ ##
# b4_int_type(MIN, MAX)
# ---------------------
# Return the smallest int type able to handle numbers ranging from
# MIN to MAX (included).
m4_define([b4_int_type],
[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
b4_ints_in($@, [-128], [127]), [1], [signed char],
b4_ints_in($@, [0], [65535]), [1], [unsigned short int],
b4_ints_in($@, [-32768], [32767]), [1], [short int],
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
# b4_int_type_for(NAME)
# ---------------------
# Return the smallest int type able to handle numbers ranging from
# `NAME_min' to `NAME_max' (included).
m4_define([b4_int_type_for],
[b4_int_type($1_min, $1_max)])
## ---------##
## Values. ##
## ---------##
# b4_null
---------
# Return a null pointer constant. NULL infringes on the user name
# space in C, so use 0 rather than NULL.
m4_define([b4_null], [0])
## ------------------------- ##
## Assigning token numbers. ##
## ------------------------- ##
# b4_token_define(TOKEN-NAME, TOKEN-NUMBER)
# -----------------------------------------
# Output the definition of this token as #define.
m4_define([b4_token_define],
[#define $1 $2
])
# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
# -------------------------------------------------------
# Output the definition of the tokens (if there are) as #defines.
m4_define([b4_token_defines],
[m4_if([$#$1], [1], [],
[/* Tokens. */
m4_map([b4_token_define], [$@])])
])
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
# ---------------------------------------
# Output the definition of this token as an enum.
m4_define([b4_token_enum],
[$1 = $2])
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
# -----------------------------------------------------
# Output the definition of the tokens (if there are) as enums.
m4_define([b4_token_enums],
[m4_if([$#$1], [1], [],
[/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
m4_map_sep([ b4_token_enum], [,
],
[$@])
};
#endif
])])
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
# -------------------------------------------------------------
# Output the definition of the tokens (if there are any) as enums and, if POSIX
# Yacc is enabled, as #defines.
m4_define([b4_token_enums_defines],
[b4_token_enums($@)b4_yacc_if([b4_token_defines($@)], [])
])
## --------------------------------------------- ##
## Defining C functions in both K&R and ANSI-C. ##
## --------------------------------------------- ##
# b4_modern_c
# -----------
# A predicate useful in #if to determine whether C is ancient or modern.
#
# If __STDC__ is defined, the compiler is modern. IBM xlc 7.0 when run
# as 'cc' doesn't define __STDC__ (or __STDC_VERSION__) for pedantic
# reasons, but it defines __C99__FUNC__ so check that as well.
# Microsoft C normally doesn't define these macros, but it defines _MSC_VER.
# Consider a C++ compiler to be modern if it defines __cplusplus.
#
m4_define([b4_c_modern],
[[(defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)]])
# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# ----------------------------------------------------------
# Declare the function NAME.
m4_define([b4_c_function_def],
[#if b4_c_modern
b4_c_ansi_function_def($@)
#else
$2
$1 (b4_c_knr_formal_names(m4_shift2($@)))
b4_c_knr_formal_decls(m4_shift2($@))
#endif[]dnl
])
# b4_c_ansi_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# ---------------------------------------------------------------
# Declare the function NAME in ANSI.
m4_define([b4_c_ansi_function_def],
[$2
$1 (b4_c_ansi_formals(m4_shift2($@)))[]dnl
])
# b4_c_ansi_formals([DECL1, NAME1], ...)
# --------------------------------------
# Output the arguments ANSI-C definition.
m4_define([b4_c_ansi_formals],
[m4_if([$#], [0], [void],
[$#$1], [1], [void],
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
m4_define([b4_c_ansi_formal],
[$1])
# b4_c_knr_formal_names([DECL1, NAME1], ...)
# ------------------------------------------
# Output the argument names.
m4_define([b4_c_knr_formal_names],
[m4_map_sep([b4_c_knr_formal_name], [, ], [$@])])
m4_define([b4_c_knr_formal_name],
[$2])
# b4_c_knr_formal_decls([DECL1, NAME1], ...)
# ------------------------------------------
# Output the K&R argument declarations.
m4_define([b4_c_knr_formal_decls],
[m4_map_sep([b4_c_knr_formal_decl],
[
],
[$@])])
m4_define([b4_c_knr_formal_decl],
[ $1;])
## ------------------------------------------------------------ ##
## Declaring (prototyping) C functions in both K&R and ANSI-C. ##
## ------------------------------------------------------------ ##
# b4_c_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# -----------------------------------------------------------
# Declare the function NAME.
m4_define([b4_c_function_decl],
[#if defined __STDC__ || defined __cplusplus
b4_c_ansi_function_decl($@)
#else
$2 $1 ();
#endif[]dnl
])
# b4_c_ansi_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# ----------------------------------------------------------------
# Declare the function NAME.
m4_define([b4_c_ansi_function_decl],
[$2 $1 (b4_c_ansi_formals(m4_shift2($@)));[]dnl
])
## --------------------- ##
## Calling C functions. ##
## --------------------- ##
# b4_c_function_call(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# -----------------------------------------------------------
# Call the function NAME with arguments NAME1, NAME2 etc.
m4_define([b4_c_function_call],
[$1 (b4_c_args(m4_shift2($@)))[]dnl
])
# b4_c_args([DECL1, NAME1], ...)
# ------------------------------
# Output the arguments NAME1, NAME2...
m4_define([b4_c_args],
[m4_map_sep([b4_c_arg], [, ], [$@])])
m4_define([b4_c_arg],
[$2])
## ----------- ##
## Synclines. ##
## ----------- ##
# b4_sync_start(LINE, FILE)
# -----------------------
m4_define([b4_sync_start], [[#]line $1 $2])
## -------------- ##
## User actions. ##
## -------------- ##
# b4_case(LABEL, STATEMENTS)
# --------------------------
m4_define([b4_case],
[ case $1:
$2
break;])
# b4_symbol_actions(FILENAME, LINENO,
# SYMBOL-TAG, SYMBOL-NUM,
# SYMBOL-ACTION, SYMBOL-TYPENAME)
# -------------------------------------------------
m4_define([b4_symbol_actions],
[m4_pushdef([b4_dollar_dollar],
[m4_ifval([$6], [(yyvaluep->$6)], [(*yyvaluep)])])dnl
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
case $4: /* $3 */
b4_syncline([$2], [$1])
$5;
b4_syncline([@oline@], [@ofile@])
break;
m4_popdef([b4_at_dollar])dnl
m4_popdef([b4_dollar_dollar])dnl
])
# b4_yydestruct_generate(FUNCTION-DECLARATOR)
# -------------------------------------------
# Generate the "yydestruct" function, which declaration is issued using
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
# or "b4_c_function_def" for K&R.
m4_define_default([b4_yydestruct_generate],
[[/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
/*ARGSUSED*/
]$1([yydestruct],
[static void],
[[const char *yymsg], [yymsg]],
[[int yytype], [yytype]],
[[YYSTYPE *yyvaluep], [yyvaluep]][]dnl
b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
YYUSE (yyvaluep);
]b4_locations_if([ YYUSE (yylocationp);
])dnl
b4_parse_param_use[]dnl
[
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
default:
break;
}
}]dnl
])
# b4_yy_symbol_print_generate(FUNCTION-DECLARATOR)
# ------------------------------------------------
# Generate the "yy_symbol_print" function, which declaration is issued using
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
# or "b4_c_function_def" for K&R.
m4_define_default([b4_yy_symbol_print_generate],
[[
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
/*ARGSUSED*/
]$1([yy_symbol_value_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
if (!yyvaluep)
return;
]b4_locations_if([ YYUSE (yylocationp);
])dnl
b4_parse_param_use[]dnl
[# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
YYUSE (yyoutput);
# endif
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
}
}
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
]$1([yy_symbol_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
if (yytype < YYNTOKENS)
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
YYFPRINTF (yyoutput, ": ");
])dnl
[ yy_symbol_value_print (yyoutput, yytype, yyvaluep]dnl
b4_locations_if([, yylocationp])[]b4_user_args[);
YYFPRINTF (yyoutput, ")");
}]dnl
])

File diff suppressed because it is too large Load Diff

View File

@@ -1,377 +0,0 @@
-*- C -*-
# C++ GLR skeleton for Bison
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
# Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This skeleton produces a C++ class that encapsulates a C glr parser.
# This is in order to reduce the maintenance burden. The glr.c
# skeleton is clean and pure enough so that there are no real
# problems. The C++ interface is the same as that of lalr1.cc. In
# fact, glr.c can replace yacc.c without the user noticing any
# difference, and similarly for glr.cc replacing lalr1.cc.
#
# The passing of parse-params
#
# The additional arguments are stored as members of the parser
# object, yyparser. The C routines need to carry yyparser
# throughout the C parser; that easy: just let yyparser become an
# additional parse-param. But because the C++ skeleton needs to
# know the "real" original parse-param, we save them
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
# (and c.m4 strips one level of quotes). This is a PITA, and
# explains why there are so many levels of quotes.
#
# The locations
#
# We use location.cc just like lalr1.cc, but because glr.c stores
# the locations in a (C++) union, the position and location classes
# must not have a constructor. Therefore, contrary to lalr1.cc, we
# must not define "b4_location_constructors". As a consequence the
# user must initialize the first positions (in particular the
# filename member).
# We require a pure interface using locations.
m4_define([b4_locations_flag], [1])
m4_define([b4_pure_flag], [1])
# The header is mandatory.
b4_defines_if([],
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
m4_include(b4_pkgdatadir/[c++.m4])
m4_include(b4_pkgdatadir/[location.cc])
m4_define([b4_parser_class_name],
[b4_percent_define_get([[parser_class_name]])])
# Save the parse parameters.
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
# b4_yy_symbol_print_generate
# ---------------------------
# Bypass the default implementation to generate the "yy_symbol_print"
# and "yy_symbol_value_print" functions.
m4_define([b4_yy_symbol_print_generate],
[[
/*--------------------.
| Print this symbol. |
`--------------------*/
]b4_c_ansi_function_def([yy_symbol_print],
[static void],
[[FILE *], []],
[[int yytype], [yytype]],
[[const b4_namespace_ref::b4_parser_class_name::semantic_type *yyvaluep],
[yyvaluep]],
[[const b4_namespace_ref::b4_parser_class_name::location_type *yylocationp],
[yylocationp]],
b4_parse_param)[
{
]b4_parse_param_use[]dnl
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[);
}
]])
# Declare yyerror.
m4_append([b4_post_prologue],
[b4_syncline([@oline@], [@ofile@])
b4_c_ansi_function_decl([yyerror],
[static void],
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
b4_parse_param,
[[const char* msg], [msg]])])
# Define yyerror.
m4_append([b4_epilogue],
[b4_syncline([@oline@], [@ofile@])[
/*------------------.
| Report an error. |
`------------------*/
]b4_c_ansi_function_def([yyerror],
[static void],
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
b4_parse_param,
[[const char* msg], [msg]])[
{
]b4_parse_param_use[]dnl
[ yyparser.error (*yylocationp, msg);
}
]b4_namespace_open[
]dnl In this section, the parse param are the original parse_params.
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
[ /// Build a parser object.
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
:])[
#if YYDEBUG
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
#endif]b4_parse_param_cons[
{
}
]b4_parser_class_name::~b4_parser_class_name[ ()
{
}
int
]b4_parser_class_name[::parse ()
{
return ::yyparse (*this]b4_user_args[);
}
#if YYDEBUG
/*--------------------.
| Print this symbol. |
`--------------------*/
inline void
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
{
/* Pacify ``unused variable'' warnings. */
YYUSE (yyvaluep);
YYUSE (yylocationp);
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
}
}
void
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
{
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
<< ' ' << yytname[yytype] << " ("
<< *yylocationp << ": ";
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
*yycdebug_ << ')';
}
std::ostream&
]b4_parser_class_name[::debug_stream () const
{
return *yycdebug_;
}
void
]b4_parser_class_name[::set_debug_stream (std::ostream& o)
{
yycdebug_ = &o;
}
]b4_parser_class_name[::debug_level_type
]b4_parser_class_name[::debug_level () const
{
return yydebug_;
}
void
]b4_parser_class_name[::set_debug_level (debug_level_type l)
{
yydebug_ = l;
}
#endif
]m4_popdef([b4_parse_param])dnl
b4_namespace_close[
]])
# Let glr.c believe that the user arguments include the parser itself.
m4_ifset([b4_parse_param],
[m4_pushdef([b4_parse_param],
m4_dquote([[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]],]
m4_defn([b4_parse_param])))],
[m4_pushdef([b4_parse_param],
[[[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]]]])
])
m4_include(b4_pkgdatadir/[glr.c])
m4_popdef([b4_parse_param])
m4_divert_push(0)
@output(b4_spec_defines_file@)
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
[2002, 2003, 2004, 2005, 2006])[
/* C++ GLR parser skeleton written by Akim Demaille. */
#ifndef PARSER_HEADER_H
# define PARSER_HEADER_H
]b4_percent_code_get([[requires]])[
#include <string>
#include <iostream>
/* Using locations. */
#define YYLSP_NEEDED ]b4_locations_flag[
]b4_namespace_open[
class position;
class location;
]b4_namespace_close[
#include "location.hh"
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG ]b4_debug_flag[
#endif
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
(Current).end = YYRHSLOC (Rhs, N).end; \
} \
else \
{ \
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
} \
while (/*CONSTCOND*/ 0)
#endif
]b4_namespace_open[
/// A Bison parser.
class ]b4_parser_class_name[
{
public:
/// Symbol semantic values.
#ifndef YYSTYPE
]m4_ifdef([b4_stype],
[ union semantic_type
{
b4_user_stype
};],
[m4_if(b4_tag_seen_flag, 0,
[[ typedef int semantic_type;]],
[[ typedef YYSTYPE semantic_type;]])])[
#else
typedef YYSTYPE semantic_type;
#endif
/// Symbol locations.
typedef ]b4_percent_define_get([[location_type]])[ location_type;
/// Tokens.
struct token
{
]b4_token_enums(b4_tokens)[
};
/// Token type.
typedef token::yytokentype token_type;
/// Build a parser object.
]b4_parser_class_name[ (]b4_parse_param_decl[);
virtual ~]b4_parser_class_name[ ();
/// Parse.
/// \returns 0 iff parsing succeeded.
virtual int parse ();
/// The current debugging stream.
std::ostream& debug_stream () const;
/// Set the current debugging stream.
void set_debug_stream (std::ostream &);
/// Type for debugging levels.
typedef int debug_level_type;
/// The current debugging level.
debug_level_type debug_level () const;
/// Set the current debugging level.
void set_debug_level (debug_level_type l);
private:
public:
/// Report a syntax error.
/// \param loc where the syntax error is found.
/// \param msg a description of the syntax error.
virtual void error (const location_type& loc, const std::string& msg);
private:
#if YYDEBUG
public:
/// \brief Report a symbol value on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
/// \brief Report a symbol on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
private:
/* Debugging. */
int yydebug_;
std::ostream* yycdebug_;
#endif
/// \brief Reclaim the memory associated to a symbol.
/// \param yymsg Why this token is reclaimed.
/// \param yytype The symbol type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
inline void yydestruct_ (const char* yymsg,
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
]b4_parse_param_vars[
};
]dnl Redirections for glr.c.
b4_percent_define_flag_if([[global_tokens_and_yystype]],
[b4_token_defines(b4_tokens)])
[
#ifndef YYSTYPE
# define YYSTYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
#endif
#ifndef YYLTYPE
# define YYLTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
#endif
]b4_namespace_close[
]b4_percent_code_get([[provides]])[]dnl
[#endif /* ! defined PARSER_HEADER_H */]
m4_divert_pop(0)

File diff suppressed because it is too large Load Diff

View File

@@ -1,880 +0,0 @@
# Java skeleton for Bison -*- autoconf -*-
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_include(b4_pkgdatadir/[java.m4])
b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java], [b4_skeleton])])
m4_ifval(m4_defn([b4_symbol_destructors]),
[b4_fatal([%s: %%destructor does not make sense in Java], [b4_skeleton])],
[])
m4_divert_push(0)dnl
@output(b4_parser_file_name@)
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
[2007, 2008])
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
])[/* First part of user declarations. */
]b4_pre_prologue
b4_percent_code_get([[imports]])
[/**
* A Bison parser, automatically generated from <tt>]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[</tt>.
*
* @@author LALR (1) parser skeleton written by Paolo Bonzini.
*/
]b4_public_if([public ])dnl
b4_abstract_if([abstract ])dnl
b4_final_if([final ])dnl
b4_strictfp_if([strictfp ])dnl
[class ]b4_parser_class_name[]dnl
b4_percent_define_get3([extends], [ extends ])dnl
b4_percent_define_get3([implements], [ implements ])[
{
]b4_identification[
/** True if verbose error messages are enabled. */
public boolean errorVerbose = ]b4_flag_value([error_verbose]);
b4_locations_if([[
/**
* A class defining a pair of positions. Positions, defined by the
* <code>]b4_position_type[</code> class, denote a point in the input.
* Locations represent a part of the input through the beginning
* and ending positions. */
public class ]b4_location_type[ {
/** The first, inclusive, position in the range. */
public ]b4_position_type[ begin;
/** The first position beyond the range. */
public ]b4_position_type[ end;
/**
* Create a <code>]b4_location_type[</code> denoting an empty range located at
* a given point.
* @@param loc The position at which the range is anchored. */
public ]b4_location_type[ (]b4_position_type[ loc) {
this.begin = this.end = loc;
}
/**
* Create a <code>]b4_location_type[</code> from the endpoints of the range.
* @@param begin The first position included in the range.
* @@param end The first position beyond the range. */
public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) {
this.begin = begin;
this.end = end;
}
/**
* Print a representation of the location. For this to be correct,
* <code>]b4_position_type[</code> should override the <code>equals</code>
* method. */
public String toString () {
if (begin.equals (end))
return begin.toString ();
else
return begin.toString () + "-" + end.toString ();
}
}
]])
[ /** Token returned by the scanner to signal the end of its input. */
public static final int EOF = 0;]
b4_token_enums(b4_tokens)
b4_locations_if([[
private ]b4_location_type[ yylloc (YYStack rhs, int n)
{
if (n > 0)
return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
else
return new ]b4_location_type[ (rhs.locationAt (0).end);
}]])[
/**
* Communication interface between the scanner and the Bison-generated
* parser <tt>]b4_parser_class_name[</tt>.
*/
public interface Lexer {
]b4_locations_if([[/**
* Method to retrieve the beginning position of the last scanned token.
* @@return the position at which the last scanned token starts. */
]b4_position_type[ getStartPos ();
/**
* Method to retrieve the ending position of the last scanned token.
* @@return the first position beyond the last scanned token. */
]b4_position_type[ getEndPos ();]])[
/**
* Method to retrieve the semantic value of the last scanned token.
* @@return the semantic value of the last scanned token. */
]b4_yystype[ getLVal ();
/**
* Entry point for the scanner. Returns the token identifier corresponding
* to the next token and prepares to return the semantic value
* ]b4_locations_if([and beginning/ending positions ])[of the token.
* @@return the token identifier corresponding to the next token. */
int yylex () ]b4_maybe_throws([b4_lex_throws])[;
/**
* Entry point for error reporting. Emits an error
* ]b4_locations_if([referring to the given location ])[in a user-defined way.
*
* ]b4_locations_if([[@@param loc The location of the element to which the
* error message is related]])[
* @@param s The string for the error message. */
void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s);]
}
b4_lexer_if([[private class YYLexer implements Lexer {
]b4_percent_code_get([[lexer]])[
}
]])[/** The object doing lexical analysis for us. */
private Lexer yylexer;
]
b4_parse_param_vars
b4_lexer_if([[
/**
* Instantiates the Bison-generated parser.
*/
public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) {
this.yylexer = new YYLexer(]b4_lex_param_call[);
]b4_parse_param_cons[
}
]])
/**
* Instantiates the Bison-generated parser.
* @@param yylexer The scanner that will supply tokens to the parser.
*/
b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) {
this.yylexer = yylexer;
]b4_parse_param_cons[
}
private java.io.PrintStream yyDebugStream = System.err;
/**
* Return the <tt>PrintStream</tt> on which the debugging output is
* printed.
*/
public final java.io.PrintStream getDebugStream () { return yyDebugStream; }
/**
* Set the <tt>PrintStream</tt> on which the debug output is printed.
* @@param s The stream that is used for debugging output.
*/
public final void setDebugStream(java.io.PrintStream s) { yyDebugStream = s; }
private int yydebug = 0;
/**
* Answer the verbosity of the debugging output; 0 means that all kinds of
* output from the parser are suppressed.
*/
public final int getDebugLevel() { return yydebug; }
/**
* Set the verbosity of the debugging output; 0 means that all kinds of
* output from the parser are suppressed.
* @@param level The verbosity level for debugging output.
*/
public final void setDebugLevel(int level) { yydebug = level; }
private final int yylex () ]b4_maybe_throws([b4_lex_throws]) [{
return yylexer.yylex ();
}
protected final void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s) {
yylexer.yyerror (]b4_locations_if([loc, ])[s);
}
]b4_locations_if([
protected final void yyerror (String s) {
yylexer.yyerror ((]b4_location_type[)null, s);
}
protected final void yyerror (]b4_position_type[ loc, String s) {
yylexer.yyerror (new ]b4_location_type[ (loc), s);
}])
[protected final void yycdebug (String s) {
if (yydebug > 0)
yyDebugStream.println (s);
}
private final class YYStack {
private int[] stateStack = new int[16];
]b4_locations_if([[private ]b4_location_type[[] locStack = new ]b4_location_type[[16];]])[
private ]b4_yystype[[] valueStack = new ]b4_yystype[[16];
public int size = 16;
public int height = -1;
public final void push (int state, ]b4_yystype[ value]dnl
b4_locations_if([, ]b4_location_type[ loc])[) {
height++;
if (size == height)
{
int[] newStateStack = new int[size * 2];
System.arraycopy (stateStack, 0, newStateStack, 0, height);
stateStack = newStateStack;
]b4_locations_if([[
]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2];
System.arraycopy (locStack, 0, newLocStack, 0, height);
locStack = newLocStack;]])
b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2];
System.arraycopy (valueStack, 0, newValueStack, 0, height);
valueStack = newValueStack;
size *= 2;
}
stateStack[height] = state;
]b4_locations_if([[locStack[height] = loc;]])[
valueStack[height] = value;
}
public final void pop () {
height--;
}
public final void pop (int num) {
// Avoid memory leaks... garbage collection is a white lie!
if (num > 0) {
java.util.Arrays.fill (valueStack, height - num + 1, height, null);
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
}
height -= num;
}
public final int stateAt (int i) {
return stateStack[height - i];
}
]b4_locations_if([[public final ]b4_location_type[ locationAt (int i) {
return locStack[height - i];
}
]])[public final ]b4_yystype[ valueAt (int i) {
return valueStack[height - i];
}
// Print the state stack on the debug stream.
public void print (java.io.PrintStream out)
{
out.print ("Stack now");
for (int i = 0; i < height; i++)
{
out.print (' ');
out.print (stateStack[i]);
}
out.println ();
}
}
/**
* Returned by a Bison action in order to stop the parsing process and
* return success (<tt>true</tt>). */
public static final int YYACCEPT = 0;
/**
* Returned by a Bison action in order to stop the parsing process and
* return failure (<tt>false</tt>). */
public static final int YYABORT = 1;
/**
* Returned by a Bison action in order to start error recovery without
* printing an error message. */
public static final int YYERROR = 2;
/**
* Returned by a Bison action in order to print an error message and start
* error recovery. */
public static final int YYFAIL = 3;
private static final int YYNEWSTATE = 4;
private static final int YYDEFAULT = 5;
private static final int YYREDUCE = 6;
private static final int YYERRLAB1 = 7;
private static final int YYRETURN = 8;
private int yyerrstatus_ = 0;
/**
* Return whether error recovery is being done. In this state, the parser
* reads token until it reaches a known state, and then restarts normal
* operation. */
public final boolean recovering ()
{
return yyerrstatus_ == 0;
}
private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[
{
]b4_yystype[ yyval;
]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[
/* If YYLEN is nonzero, implement the default value of the action:
`$$ = $1'. Otherwise, use the top of the stack.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
users should not rely upon it. */
if (yylen > 0)
yyval = yystack.valueAt (yylen - 1);
else
yyval = yystack.valueAt (0);
yy_reduce_print (yyn, yystack);
switch (yyn)
{
]b4_user_actions[
default: break;
}
yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[);
yystack.pop (yylen);
yylen = 0;
/* Shift the result of the reduction. */
yyn = yyr1_[yyn];
int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
if (0 <= yystate && yystate <= yylast_
&& yycheck_[yystate] == yystack.stateAt (0))
yystate = yytable_[yystate];
else
yystate = yydefgoto_[yyn - yyntokens_];
yystack.push (yystate, yyval]b4_locations_if([, yyloc])[);
return YYNEWSTATE;
}
/* Return YYSTR after stripping away unnecessary quotes and
backslashes, so that it's suitable for yyerror. The heuristic is
that double-quoting is unnecessary unless the string contains an
apostrophe, a comma, or backslash (other than backslash-backslash).
YYSTR is taken from yytname. */
private final String yytnamerr_ (String yystr)
{
if (yystr.charAt (0) == '"')
{
StringBuffer yyr = new StringBuffer ();
strip_quotes: for (int i = 1; i < yystr.length (); i++)
switch (yystr.charAt (i))
{
case '\'':
case ',':
break strip_quotes;
case '\\':
if (yystr.charAt(++i) != '\\')
break strip_quotes;
/* Fall through. */
default:
yyr.append (yystr.charAt (i));
break;
case '"':
return yyr.toString ();
}
}
else if (yystr.equals ("$end"))
return "end of input";
return yystr;
}
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
private void yy_symbol_print (String s, int yytype,
]b4_yystype[ yyvaluep]dnl
b4_locations_if([, Object yylocationp])[)
{
if (yydebug > 0)
yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ")
+ yytname_[yytype] + " ("]b4_locations_if([
+ yylocationp + ": "])[
+ (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
}
/**
* Parse input from the scanner that was specified at object construction
* time. Return whether the end of the input was reached successfully.
*
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
* imply that there were no syntax errors.
*/
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
{
/// Lookahead and lookahead in internal form.
int yychar = yyempty_;
int yytoken = 0;
/* State. */
int yyn = 0;
int yylen = 0;
int yystate = 0;
YYStack yystack = new YYStack ();
/* Error handling. */
int yynerrs_ = 0;
]b4_locations_if([/// The location where the error started.
]b4_location_type[ yyerrloc = null;
/// ]b4_location_type[ of the lookahead.
]b4_location_type[ yylloc = new ]b4_location_type[ (null, null);
/// @@$.
]b4_location_type[ yyloc;])
/// Semantic value of the lookahead.
b4_yystype[ yylval = null;
int yyresult;
yycdebug ("Starting parse\n");
yyerrstatus_ = 0;
]m4_ifdef([b4_initial_action], [
m4_pushdef([b4_at_dollar], [yylloc])dnl
m4_pushdef([b4_dollar_dollar], [yylval])dnl
/* User initialization code. */
b4_user_initial_action
m4_popdef([b4_dollar_dollar])dnl
m4_popdef([b4_at_dollar])])dnl
[ /* Initialize the stack. */
yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
int label = YYNEWSTATE;
for (;;)
switch (label)
{
/* New state. Unlike in the C/C++ skeletons, the state is already
pushed when we come here. */
case YYNEWSTATE:
yycdebug ("Entering state " + yystate + "\n");
if (yydebug > 0)
yystack.print (yyDebugStream);
/* Accept? */
if (yystate == yyfinal_)
return true;
/* Take a decision. First try without lookahead. */
yyn = yypact_[yystate];
if (yyn == yypact_ninf_)
{
label = YYDEFAULT;
break;
}
/* Read a lookahead token. */
if (yychar == yyempty_)
{
yycdebug ("Reading a token: ");
yychar = yylex ();]
b4_locations_if([[
yylloc = new ]b4_location_type[(yylexer.getStartPos (),
yylexer.getEndPos ());]])
yylval = yylexer.getLVal ();[
}
/* Convert token to internal form. */
if (yychar <= EOF)
{
yychar = yytoken = EOF;
yycdebug ("Now at end of input.\n");
}
else
{
yytoken = yytranslate_ (yychar);
yy_symbol_print ("Next token is", yytoken,
yylval]b4_locations_if([, yylloc])[);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
detect an error, take that action. */
yyn += yytoken;
if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
label = YYDEFAULT;
/* <= 0 means reduce or error. */
else if ((yyn = yytable_[yyn]) <= 0)
{
if (yyn == 0 || yyn == yytable_ninf_)
label = YYFAIL;
else
{
yyn = -yyn;
label = YYREDUCE;
}
}
else
{
/* Shift the lookahead token. */
yy_symbol_print ("Shifting", yytoken,
yylval]b4_locations_if([, yylloc])[);
/* Discard the token being shifted. */
yychar = yyempty_;
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus_ > 0)
--yyerrstatus_;
yystate = yyn;
yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
label = YYNEWSTATE;
}
break;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
case YYDEFAULT:
yyn = yydefact_[yystate];
if (yyn == 0)
label = YYFAIL;
else
label = YYREDUCE;
break;
/*-----------------------------.
| yyreduce -- Do a reduction. |
`-----------------------------*/
case YYREDUCE:
yylen = yyr2_[yyn];
label = yyaction (yyn, yystack, yylen);
yystate = yystack.stateAt (0);
break;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
case YYFAIL:
/* If not already recovering from an error, report this error. */
if (yyerrstatus_ == 0)
{
++yynerrs_;
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
}
]b4_locations_if([yyerrloc = yylloc;])[
if (yyerrstatus_ == 3)
{
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
if (yychar <= EOF)
{
/* Return failure if at end of input. */
if (yychar == EOF)
return false;
}
else
yychar = yyempty_;
}
/* Else will try to reuse lookahead token after shifting the error
token. */
label = YYERRLAB1;
break;
/*---------------------------------------------------.
| errorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
case YYERROR:
]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[
/* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */
yystack.pop (yylen);
yylen = 0;
yystate = yystack.stateAt (0);
label = YYERRLAB1;
break;
/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
case YYERRLAB1:
yyerrstatus_ = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact_[yystate];
if (yyn != yypact_ninf_)
{
yyn += yyterror_;
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
{
yyn = yytable_[yyn];
if (0 < yyn)
break;
}
}
/* Pop the current state because it cannot handle the error token. */
if (yystack.height == 1)
return false;
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
yystack.pop ();
yystate = yystack.stateAt (0);
if (yydebug > 0)
yystack.print (yyDebugStream);
}
]b4_locations_if([
/* Muck with the stack to setup for yylloc. */
yystack.push (0, null, yylloc);
yystack.push (0, null, yyerrloc);
yyloc = yylloc (yystack, 2);
yystack.pop (2);])[
/* Shift the error token. */
yy_symbol_print ("Shifting", yystos_[yyn],
yylval]b4_locations_if([, yyloc])[);
yystate = yyn;
yystack.push (yyn, yylval]b4_locations_if([, yyloc])[);
label = YYNEWSTATE;
break;
/* Accept. */
case YYACCEPT:
return true;
/* Abort. */
case YYABORT:
return false;
}
}
// Generate an error message.
private String yysyntax_error (int yystate, int tok)
{
if (errorVerbose)
{
int yyn = yypact_[yystate];
if (yypact_ninf_ < yyn && yyn <= yylast_)
{
StringBuffer res;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = yylast_ - yyn + 1;
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
int count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
++count;
// FIXME: This method of building the message is not compatible
// with internationalization.
res = new StringBuffer ("syntax error, unexpected ");
res.append (yytnamerr_ (yytname_[tok]));
if (count < 5)
{
count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
{
res.append (count++ == 0 ? ", expecting " : " or ");
res.append (yytnamerr_ (yytname_[x]));
}
}
return res.toString ();
}
}
return "syntax error";
}
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[;
private static final ]b4_int_type_for([b4_pact])[ yypact_[] =
{
]b4_pact[
};
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
doesn't specify something else to do. Zero means the default is an
error. */
private static final ]b4_int_type_for([b4_defact])[ yydefact_[] =
{
]b4_defact[
};
/* YYPGOTO[NTERM-NUM]. */
private static final ]b4_int_type_for([b4_pgoto])[ yypgoto_[] =
{
]b4_pgoto[
};
/* YYDEFGOTO[NTERM-NUM]. */
private static final ]b4_int_type_for([b4_defgoto])[
yydefgoto_[] =
{
]b4_defgoto[
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says. */
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
private static final ]b4_int_type_for([b4_table])[
yytable_[] =
{
]b4_table[
};
/* YYCHECK. */
private static final ]b4_int_type_for([b4_check])[
yycheck_[] =
{
]b4_check[
};
/* STOS_[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
private static final ]b4_int_type_for([b4_stos])[
yystos_[] =
{
]b4_stos[
};
/* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
to YYLEX-NUM. */
private static final ]b4_int_type_for([b4_toknum])[
yytoken_number_[] =
{
]b4_toknum[
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
private static final ]b4_int_type_for([b4_r1])[
yyr1_[] =
{
]b4_r1[
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
private static final ]b4_int_type_for([b4_r2])[
yyr2_[] =
{
]b4_r2[
};
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
private static final String yytname_[] =
{
]b4_tname[
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
private static final ]b4_int_type_for([b4_rhs])[ yyrhs_[] =
{
]b4_rhs[
};
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
private static final ]b4_int_type_for([b4_prhs])[ yyprhs_[] =
{
]b4_prhs[
};
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
private static final ]b4_int_type_for([b4_rline])[ yyrline_[] =
{
]b4_rline[
};
// Report on the debug stream that the rule yyrule is going to be reduced.
private void yy_reduce_print (int yyrule, YYStack yystack)
{
if (yydebug == 0)
return;
int yylno = yyrline_[yyrule];
int yynrhs = yyr2_[yyrule];
/* Print the symbols being reduced, and their result. */
yycdebug ("Reducing stack by rule " + (yyrule - 1)
+ " (line " + yylno + "), ");
/* The symbols being reduced. */
for (int yyi = 0; yyi < yynrhs; yyi++)
yy_symbol_print (" $" + (yyi + 1) + " =",
yyrhs_[yyprhs_[yyrule] + yyi],
]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
b4_rhs_location(yynrhs, yyi + 1)])[);
}
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
private static final ]b4_int_type_for([b4_translate])[ yytranslate_table_[] =
{
]b4_translate[
};
private static final ]b4_int_type_for([b4_translate])[ yytranslate_ (int t)
{
if (t >= 0 && t <= yyuser_token_number_max_)
return yytranslate_table_[t];
else
return yyundef_token_;
}
private static final int yylast_ = ]b4_last[;
private static final int yynnts_ = ]b4_nterms_number[;
private static final int yyempty_ = -2;
private static final int yyfinal_ = ]b4_final_state_number[;
private static final int yyterror_ = 1;
private static final int yyerrcode_ = 256;
private static final int yyntokens_ = ]b4_tokens_number[;
private static final int yyuser_token_number_max_ = ]b4_user_token_number_max[;
private static final int yyundef_token_ = ]b4_undef_token_number[;
]/* User implementation code. */
b4_percent_code_get[]dnl
}
b4_epilogue
m4_divert_pop(0)dnl

View File

@@ -1,275 +0,0 @@
# C++ skeleton for Bison
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
# Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# We do want M4 expansion after # for CPP macros.
m4_changecom()
m4_divert_push(0)dnl
@output(b4_dir_prefix[]position.hh@)
b4_copyright([Positions for Bison parsers in C++],
[2002, 2003, 2004, 2005, 2006])[
/**
** \file position.hh
** Define the ]b4_namespace_ref[::position class.
*/
#ifndef BISON_POSITION_HH
# define BISON_POSITION_HH
# include <iostream>
# include <string>
# include <algorithm>
]b4_namespace_open[
/// Abstract a position.
class position
{
public:
]m4_ifdef([b4_location_constructors], [
/// Construct a position.
position ()
: filename (0), line (]b4_location_initial_line[), column (]b4_location_initial_column[)
{
}
])[
/// Initialization.
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
{
filename = fn;
line = ]b4_location_initial_line[;
column = ]b4_location_initial_column[;
}
/** \name Line and Column related manipulators
** \{ */
public:
/// (line related) Advance to the COUNT next lines.
inline void lines (int count = 1)
{
column = ]b4_location_initial_column[;
line += count;
}
/// (column related) Advance to the COUNT next columns.
inline void columns (int count = 1)
{
column = std::max (]b4_location_initial_column[u, column + count);
}
/** \} */
public:
/// File name to which this position refers.
]b4_percent_define_get([[filename_type]])[* filename;
/// Current line number.
unsigned int line;
/// Current column number.
unsigned int column;
};
/// Add and assign a position.
inline const position&
operator+= (position& res, const int width)
{
res.columns (width);
return res;
}
/// Add two position objects.
inline const position
operator+ (const position& begin, const int width)
{
position res = begin;
return res += width;
}
/// Add and assign a position.
inline const position&
operator-= (position& res, const int width)
{
return res += -width;
}
/// Add two position objects.
inline const position
operator- (const position& begin, const int width)
{
return begin + -width;
}
]b4_percent_define_flag_if([[define_location_comparison]], [[
/// Compare two position objects.
inline bool
operator== (const position& pos1, const position& pos2)
{
return
(pos1.filename == pos2.filename
|| pos1.filename && pos2.filename && *pos1.filename == *pos2.filename)
&& pos1.line == pos2.line && pos1.column == pos2.column;
}
/// Compare two position objects.
inline bool
operator!= (const position& pos1, const position& pos2)
{
return !(pos1 == pos2);
}
]])[
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param pos a reference to the position to redirect
*/
inline std::ostream&
operator<< (std::ostream& ostr, const position& pos)
{
if (pos.filename)
ostr << *pos.filename << ':';
return ostr << pos.line << '.' << pos.column;
}
]b4_namespace_close[
#endif // not BISON_POSITION_HH]
@output(b4_dir_prefix[]location.hh@)
b4_copyright([Locations for Bison parsers in C++],
[2002, 2003, 2004, 2005, 2006])[
/**
** \file location.hh
** Define the ]b4_namespace_ref[::location class.
*/
#ifndef BISON_LOCATION_HH
# define BISON_LOCATION_HH
# include <iostream>
# include <string>
# include "position.hh"
]b4_namespace_open[
/// Abstract a location.
class location
{
public:
]m4_ifdef([b4_location_constructors], [
/// Construct a location.
location ()
: begin (), end ()
{
}
])[
/// Initialization.
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
{
begin.initialize (fn);
end = begin;
}
/** \name Line and Column related manipulators
** \{ */
public:
/// Reset initial location to final location.
inline void step ()
{
begin = end;
}
/// Extend the current location to the COUNT next columns.
inline void columns (unsigned int count = 1)
{
end += count;
}
/// Extend the current location to the COUNT next lines.
inline void lines (unsigned int count = 1)
{
end.lines (count);
}
/** \} */
public:
/// Beginning of the located region.
position begin;
/// End of the located region.
position end;
};
/// Join two location objects to create a location.
inline const location operator+ (const location& begin, const location& end)
{
location res = begin;
res.end = end.end;
return res;
}
/// Add two location objects.
inline const location operator+ (const location& begin, unsigned int width)
{
location res = begin;
res.columns (width);
return res;
}
/// Add and assign a location.
inline location& operator+= (location& res, unsigned int width)
{
res.columns (width);
return res;
}
]b4_percent_define_flag_if([[define_location_comparison]], [[
/// Compare two location objects.
inline bool
operator== (const location& loc1, const location& loc2)
{
return loc1.begin == loc2.begin && loc1.end == loc2.end;
}
/// Compare two location objects.
inline bool
operator!= (const location& loc1, const location& loc2)
{
return !(loc1 == loc2);
}
]])[
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param loc a reference to the location to redirect
**
** Avoid duplicate information.
*/
inline std::ostream& operator<< (std::ostream& ostr, const location& loc)
{
position last = loc.end - 1;
ostr << loc.begin;
if (last.filename
&& (!loc.begin.filename
|| *loc.begin.filename != *last.filename))
ostr << '-' << last;
else if (loc.begin.line != last.line)
ostr << '-' << last.line << '.' << last.column;
else if (loc.begin.column != last.column)
ostr << '-' << last.column;
return ostr;
}
]b4_namespace_close[
#endif // not BISON_LOCATION_HH]
m4_divert_pop(0)
m4_changecom([#])

View File

@@ -1,206 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
xml2dot.xsl - transform Bison XML Report into DOT.
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Written by Wojciech Polak <polak@gnu.org>.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bison="http://www.gnu.org/software/bison/">
<xsl:import href="bison.xsl"/>
<xsl:output method="text" encoding="UTF-8" indent="no"/>
<xsl:template match="/">
<xsl:apply-templates select="bison-xml-report"/>
</xsl:template>
<xsl:template match="bison-xml-report">
<xsl:apply-templates select="automaton"/>
</xsl:template>
<xsl:template match="automaton">
<xsl:text>digraph Automaton {&#10;</xsl:text>
<xsl:apply-templates select="state"/>
<xsl:text>}&#10;</xsl:text>
</xsl:template>
<xsl:template match="automaton/state">
<xsl:call-template name="output-node">
<xsl:with-param name="number" select="@number"/>
<xsl:with-param name="label">
<xsl:value-of select="@number"/>
<xsl:apply-templates select="itemset/item"/>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="actions/transitions"/>
</xsl:template>
<xsl:template match="actions/transitions">
<xsl:apply-templates select="transition"/>
</xsl:template>
<xsl:template match="item">
<xsl:apply-templates select="key('bison:ruleByNumber', @rule-number)">
<xsl:with-param name="point" select="@point"/>
</xsl:apply-templates>
<xsl:apply-templates select="lookaheads"/>
</xsl:template>
<xsl:template match="rule">
<xsl:param name="point"/>
<xsl:text>&#10;</xsl:text>
<xsl:value-of select="lhs"/>
<xsl:text> -&gt;</xsl:text>
<xsl:if test="$point = 0">
<xsl:text> .</xsl:text>
</xsl:if>
<xsl:for-each select="rhs/symbol|rhs/empty">
<xsl:apply-templates select="."/>
<xsl:if test="$point = position()">
<xsl:text> .</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="symbol">
<xsl:text> </xsl:text>
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="empty"/>
<xsl:template match="lookaheads">
<xsl:text>[</xsl:text>
<xsl:apply-templates select="symbol"/>
<xsl:text>]</xsl:text>
</xsl:template>
<xsl:template match="lookaheads/symbol">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="transition">
<xsl:call-template name="output-edge">
<xsl:with-param name="src" select="../../../@number"/>
<xsl:with-param name="dst" select="@state"/>
<xsl:with-param name="style">
<xsl:choose>
<xsl:when test="@symbol = 'error'">
<xsl:text>dotted</xsl:text>
</xsl:when>
<xsl:when test="@type = 'shift'">
<xsl:text>solid</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>dashed</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="label">
<xsl:if test="not(@symbol = 'error')">
<xsl:value-of select="@symbol"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="output-node">
<xsl:param name="number"/>
<xsl:param name="label"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$number"/>
<xsl:text> [label="</xsl:text>
<xsl:call-template name="escape">
<xsl:with-param name="subject" select="$label"/>
</xsl:call-template>
<xsl:text>"]&#10;</xsl:text>
</xsl:template>
<xsl:template name="output-edge">
<xsl:param name="src"/>
<xsl:param name="dst"/>
<xsl:param name="style"/>
<xsl:param name="label"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$src"/>
<xsl:text> -> </xsl:text>
<xsl:value-of select="$dst"/>
<xsl:text> [style=</xsl:text>
<xsl:value-of select="$style"/>
<xsl:if test="$label and $label != ''">
<xsl:text> label="</xsl:text>
<xsl:call-template name="escape">
<xsl:with-param name="subject" select="$label"/>
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<xsl:text>]&#10;</xsl:text>
</xsl:template>
<xsl:template name="escape">
<xsl:param name="subject"/> <!-- required -->
<xsl:call-template name="string-replace">
<xsl:with-param name="subject">
<xsl:call-template name="string-replace">
<xsl:with-param name="subject">
<xsl:call-template name="string-replace">
<xsl:with-param name="subject" select="$subject"/>
<xsl:with-param name="search" select="'\'"/>
<xsl:with-param name="replace" select="'\\'"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="search" select="'&quot;'"/>
<xsl:with-param name="replace" select="'\&quot;'"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="search" select="'&#10;'"/>
<xsl:with-param name="replace" select="'\n'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="string-replace">
<xsl:param name="subject"/>
<xsl:param name="search"/>
<xsl:param name="replace"/>
<xsl:choose>
<xsl:when test="contains($subject, $search)">
<xsl:variable name="before" select="substring-before($subject, $search)"/>
<xsl:variable name="after" select="substring-after($subject, $search)"/>
<xsl:value-of select="$before"/>
<xsl:value-of select="$replace"/>
<xsl:call-template name="string-replace">
<xsl:with-param name="subject" select="$after"/>
<xsl:with-param name="search" select="$search"/>
<xsl:with-param name="replace" select="$replace"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$subject"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@@ -1,41 +1,33 @@
#!/usr/bin/env perl
#############################################################################
##
## Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
## Copyright (C) 2015 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the utilities of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## $QT_BEGIN_LICENSE:LGPL21$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
## a written agreement between you and The Qt Company. For licensing terms
## and conditions see http://www.qt.io/terms-conditions. For further
## information use the contact form at http://www.qt.io/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
## General Public License version 2.1 or version 3 as published by the Free
## Software Foundation and appearing in the file LICENSE.LGPLv21 and
## LICENSE.LGPLv3 included in the packaging of this file. Please review the
## following information to ensure the GNU Lesser General Public License
## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## As a special exception, The Qt Company gives you certain additional
## rights. These rights are described in The Qt Company LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
## GNU General Public License Usage
## Alternatively, this file may be used under the terms of the GNU
## General Public License version 3.0 as published by the Free Software
## Foundation and appearing in the file LICENSE.GPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU General Public License version 3.0 requirements will be
## met: http://www.gnu.org/copyleft/gpl.html.
##
##
## $QT_END_LICENSE$
##
#############################################################################
@@ -99,11 +91,18 @@ Only initialize the specified subset of modules given as the argument. Specified
modules must already exist in .gitmodules.
The string "all" results in cloning all known modules. The default is the set of
maintained modules.
Module names may be prefixed with a dash to exclude them from a bigger set.
=item --no-update
Skip the `git submodule update' command.
=item --branch
Instead of checking out specific SHA1s, check out the submodule branches that
correspond with the current supermodule commit.
By default, this option will cause local commits in the submodules to be rebased.
With --no-update, the branches will be checked out, but their heads will not move.
=item --ignore-submodules
@@ -131,15 +130,6 @@ Switch to internal URLs and make use of the Oslo git mirrors.
(Implies `--mirror').
=item --http
Use the HTTP protocol for git operations. This may be useful if the git
protocol is blocked by a firewall. Note that this only works with the
external Gitorious server.
The `--http' option does not affect the gerrit remotes.
=item --codereview-username <Gerrit/JIRA username>
Specify the user name for the (potentially) writable `gerrit' remote
@@ -180,7 +170,7 @@ Uses <url-base> as the base URL for submodule git mirrors.
For example:
--mirror user@machine:/foo/bar
--mirror user@machine:/foo/bar/
...will use the following as a mirror for qtbase:
@@ -199,80 +189,6 @@ use Getopt::Long qw( GetOptionsFromArray );
use Pod::Usage qw( pod2usage );
use Cwd qw( getcwd );
my %PROTOCOLS = (
'http' => 'http://git.gitorious.org/' ,
);
my %GERRIT_REPOS = map { $_ => "qt/$_" } qw(
qt3d
qt5
qtactiveqt
qtandroidextras
qtbase
qtconnectivity
qtdeclarative
qtdoc
qtdocgallery
qtenginio
qtfeedback
qtgraphicaleffects
qtimageformats
qtjsondb
qtlocation
qtmacextras
qtmultimedia
qtpim
qtqa
qtquick1
qtquickcontrols
qtrepotools
qtscript
qtsensors
qtserialport
qtsvg
qtsystems
qttools
qttranslations
qtwayland
qtwebkit
qtwebkit-examples
qtwebsockets
qtwinextras
qtx11extras
qtxmlpatterns
);
my @DEFAULT_REPOS = qw(
qtactiveqt
qtandroidextras
qtbase
qtconnectivity
qtdeclarative
qtdoc
qtenginio
qtgraphicaleffects
qtimageformats
qtmacextras
qtmultimedia
qtqa
qtquick1
qtquickcontrols
qtlocation
qtrepotools
qtscript
qtsensors
qtserialport
qtsvg
qttools
qttranslations
qtwebsockets
qtwebkit
qtwebkit-examples
qtwinextras
qtx11extras
qtxmlpatterns
);
my $GERRIT_SSH_BASE
= 'ssh://@USER@codereview.qt-project.org@PORT@/';
@@ -315,20 +231,21 @@ sub parse_arguments
%{$self} = (%{$self},
'alternates' => "",
'branch' => 0,
'codereview-username' => "",
'detach-alternates' => 0 ,
'force' => 0 ,
'force-hooks' => 0 ,
'ignore-submodules' => 0 ,
'mirror-url' => "",
'protocol' => "",
'update' => 1 ,
'webkit' => 1 ,
'module-subset' => join(",", @DEFAULT_REPOS),
'module-subset' => "default",
);
GetOptionsFromArray(\@args,
'alternates=s' => \$self->{qw{ alternates }},
'branch' => \$self->{qw{ branch }},
'codereview-username=s' => \$self->{qw{ codereview-username }},
'copy-objects' => \$self->{qw{ detach-alternates }},
'force|f' => \$self->{qw{ force }},
@@ -341,7 +258,6 @@ sub parse_arguments
'module-subset=s' => \$self->{qw{ module-subset }},
'help|?' => sub { pod2usage(1); },
'http' => sub { $self->{protocol} = 'http'; },
'berlin' => sub {
$self->{'mirror-url'} = $BER_MIRROR_URL_BASE;
@@ -354,12 +270,9 @@ sub parse_arguments
# Replace any double trailing slashes from end of mirror
$self->{'mirror-url'} =~ s{//+$}{/};
if ($self->{'module-subset'} eq "all") {
$self->{'module-subset'} = "";
} else {
$self->{'module-subset'} = {
map { $_ => 1 } split(qr{,}, $self->{'module-subset'})
};
$self->{'module-subset'} = [ split(/,/, $self->{'module-subset'}) ];
if (!$self->{webkit}) {
push @{$self->{'module-subset'}}, "-qtwebkit", "-qtwebkit-examples";
}
return;
@@ -371,16 +284,7 @@ sub check_if_already_initialized
# We consider the repo as `initialized' if submodule.qtbase.url is set
if (qx(git config --get submodule.qtbase.url)) {
if ($self->{force}) {
my @configresult = qx(git config -l);
foreach (@configresult) {
# Example line: submodule.qtqa.url=git://gitorious.org/qt/qtqa.git
if (/(submodule\.[^.=]+)\.url=.*/) {
$self->exe('git', 'config', '--remove-section', $1);
}
}
}
else {
if (!$self->{force}) {
exit 0 if ($self->{quiet});
print "Will not reinitialize already initialized repository (use -f to force)!\n";
exit 1;
@@ -392,11 +296,10 @@ sub check_if_already_initialized
sub git_submodule_init
{
my ($self) = @_;
my ($self, @init_args) = @_;
my @init_args;
if ($self->{quiet}) {
push @init_args, '--quiet';
unshift @init_args, '--quiet';
}
$self->exe('git', 'submodule', 'init', @init_args);
@@ -408,75 +311,101 @@ sub git_submodule_init
return;
}
sub git_disable_webkit_submodule
{
my ($self) = @_;
$self->exe('git', 'config', '--remove', 'submodule.qtwebkit');
$self->exe('git', 'config', '--remove', 'submodule.qtwebkit-examples');
return;
}
sub git_prune_submodules
{
my ($self) = @_;
my @configresult = qx(git config -l);
foreach my $line (@configresult) {
if ($line =~ /submodule\.([^.=]+)\.url=/) {
my $module_name = $1;
if (!$self->{'module-subset'}{$module_name}) {
$self->exe('git', 'config', '--remove', "submodule.$module_name");
}
}
}
}
sub git_set_submodule_config
{
my ($self) = @_;
my @configresult = qx(git config -l);
my $protocol = $self->{protocol};
my $url_base_for_protocol = $PROTOCOLS{$protocol};
foreach my $line (@configresult) {
# Example line: submodule.qtqa.url=git://gitorious.org/qt/qtqa.git
next if ($line !~ /submodule\.([^.=]+)\.url=(.*)/);
my $key = $1;
my $value = $2;
if ($protocol) {
# rewrite URL to chosen protocol
$value =~ s,^git://gitorious\.org/,$url_base_for_protocol,;
}
$self->exe('git', 'config', "submodule.$key.url", $value);
if ($self->{'ignore-submodules'}) {
$self->exe('git', 'config', "submodule.$key.ignore", 'all');
}
}
return;
}
sub git_clone_all_submodules
{
my ($self) = @_;
my ($self, $my_repo_base, $co_branch, @subset) = @_;
my %subdirs = ();
my %subbranches = ();
my %subbases = ();
my %subinits = ();
my @submodconfig = qx(git config -l -f .gitmodules);
foreach my $line (@submodconfig) {
# Example line: submodule.qtqa.url=../qtqa.git
next if ($line !~ /^submodule\.([^.=]+)\.([^.=]+)=(.*)$/);
if ($2 eq "path") {
$subdirs{$1} = $3;
} elsif ($2 eq "branch") {
$subbranches{$1} = $3;
} elsif ($2 eq "url") {
my ($mod, $base) = ($1, $3);
next if ($base !~ /^\.\.\//);
$base = $my_repo_base.'/'.$base;
while ($base =~ s,/(?!\.\./)[^/]+/\.\./,/,g) {}
$subbases{$mod} = $base;
} elsif ($2 eq "update") {
push @subset, '-'.$1 if ($3 eq 'ignore');
} elsif ($2 eq "initrepo") {
$subinits{$1} = ($3 eq "yes" or $3 eq "true");
}
}
my %include = ();
foreach my $mod (@subset) {
if ($mod eq "all") {
map { $include{$_} = 1; } keys %subbases;
} elsif ($mod eq "default") {
map { $include{$_} = 1; } grep { $subinits{$_} } keys %subbases;
} elsif ($mod =~ s/^-//) {
delete $include{$mod};
} else {
$include{$mod} = 1;
}
}
my @modules = sort keys %include;
$self->git_submodule_init(map { $subdirs{$_} } @modules);
# manually clone each repo here, so we can easily use reference repos, mirrors etc
my @configresult = qx(git config -l);
foreach my $line (@configresult) {
if ($line =~ /submodule\.([^.=]+)\.url=(.*)/) {
$self->git_clone_one_submodule($1, $2);
# Example line: submodule.qtqa.url=git://gitorious.org/qt/qtqa.git
next if ($line !~ /submodule\.([^.=]+)\.url=/);
my $module = $1;
if (!defined($include{$module})) {
$self->exe('git', 'config', '--remove-section', "submodule.$module");
next;
}
if ($self->{'ignore-submodules'}) {
$self->exe('git', 'config', "submodule.$module.ignore", 'all');
}
}
foreach my $module (@modules) {
$self->git_clone_one_submodule($subdirs{$module}, $subbases{$module}, $subbranches{$module});
}
if ($co_branch) {
foreach my $module (@modules) {
my $branch = $subbranches{$module};
die("No branch defined for submodule $module.\n") if (!defined($branch));
my $orig_cwd = getcwd();
chdir($module) or confess "chdir $module: $OS_ERROR";
my $br = qx(git rev-parse -q --verify $branch);
if (!$br) {
$self->exe('git', 'checkout', '-b', $branch, "origin/$branch");
} else {
$self->exe('git', 'checkout', $branch);
}
chdir("$orig_cwd") or confess "chdir $orig_cwd: $OS_ERROR";
}
}
if ($self->{update}) {
$self->exe('git', 'submodule', 'update', '--recursive');
my @cmd = ('git', 'submodule', 'update', '--no-fetch');
push @cmd, '--remote', '--rebase' if ($co_branch);
$self->exe(@cmd);
foreach my $module (@modules) {
if (-f $module.'/.gitmodules') {
my $orig_cwd = getcwd();
chdir($module) or confess "chdir $module: $OS_ERROR";
$self->git_clone_all_submodules($subbases{$module}, 0, "all");
chdir("$orig_cwd") or confess "chdir $orig_cwd: $OS_ERROR";
}
}
}
return;
@@ -484,35 +413,26 @@ sub git_clone_all_submodules
sub git_add_remotes
{
my ($self, $repo_basename) = @_;
my ($self, $gerrit_repo_basename) = @_;
my $gerrit_repo_basename = $GERRIT_REPOS{$repo_basename};
if ($gerrit_repo_basename) {
my $gerrit_repo_url;
# If given a username, make a "verbose" remote.
# Otherwise, rely on proper SSH configuration.
if ($self->{'codereview-username'}) {
$gerrit_repo_url = $GERRIT_SSH_BASE;
$gerrit_repo_url =~ s,\@USER\@,$self->{'codereview-username'}\@,;
$gerrit_repo_url =~ s,\@PORT\@,:29418,;
}
else {
$gerrit_repo_url = $GERRIT_SSH_BASE;
$gerrit_repo_url =~ s,\@[^\@]+\@,,g;
}
$gerrit_repo_url .= $gerrit_repo_basename;
$self->exe('git', 'config', 'remote.gerrit.url', $gerrit_repo_url);
$self->exe('git', 'config', 'remote.gerrit.fetch', '+refs/heads/*:refs/remotes/gerrit/*', '/heads/');
my $gerrit_repo_url = $GERRIT_SSH_BASE;
# If given a username, make a "verbose" remote.
# Otherwise, rely on proper SSH configuration.
if ($self->{'codereview-username'}) {
$gerrit_repo_url =~ s,\@USER\@,$self->{'codereview-username'}\@,;
$gerrit_repo_url =~ s,\@PORT\@,:29418,;
} else {
$gerrit_repo_url =~ s,\@[^\@]+\@,,g;
}
return;
$gerrit_repo_url .= $gerrit_repo_basename;
$self->exe('git', 'config', 'remote.gerrit.url', $gerrit_repo_url);
$self->exe('git', 'config', 'remote.gerrit.fetch', '+refs/heads/*:refs/remotes/gerrit/*', '/heads/');
}
sub git_clone_one_submodule
{
my ($self, $submodule, $url) = @_;
my ($self, $submodule, $repo_basename, $branch) = @_;
my $alternates = $self->{ 'alternates' };
my $mirror_url = $self->{ 'mirror-url' };
@@ -523,7 +443,7 @@ sub git_clone_one_submodule
if ($alternates) {
# alternates is a qt5 repo, so the submodule will be under that.
if (-d "$alternates/$submodule") {
if (-e "$alternates/$submodule/.git") {
@reference_args = ('--reference', "$alternates/$submodule");
}
else {
@@ -531,10 +451,10 @@ sub git_clone_one_submodule
}
}
my $url = $self->{'base-url'}.$repo_basename;
my $mirror;
if ($mirror_url) {
$mirror = $mirror_url."qt/$submodule";
$mirror .= ".git" unless (-d $mirror); # Support local disk mirror
$mirror = $mirror_url.$repo_basename;
}
if ($mirror) {
@@ -546,21 +466,33 @@ sub git_clone_one_submodule
}
}
my $do_clone = (! -d "$submodule/.git");
my $do_clone = (! -e "$submodule/.git");
if ($do_clone) {
$self->exe('git', 'clone', @reference_args, ($mirror ? $mirror : $url), $submodule);
push @reference_args, '--branch', $branch if ($branch);
$self->exe('git', 'clone', @reference_args,
($mirror ? $mirror : $url), $submodule);
}
my $orig_cwd = getcwd();
chdir($submodule) or confess "chdir $submodule: $OS_ERROR";
$self->exe('git', 'config', 'remote.origin.url', $url);
if ($mirror) {
# This is only for the user's convenience - we make no use of it.
$self->exe('git', 'config', 'remote.mirror.url', $mirror);
$self->exe('git', 'config', 'remote.mirror.fetch', '+refs/heads/*:refs/remotes/mirror/*');
}
if (!$do_clone) {
$self->exe('git', 'fetch', ($mirror ? $mirror : $url));
if (!$do_clone && $self->{update}) {
# If we didn't clone, fetch from the right location. We always update
# the origin remote, so that submodule update --remote works.
$self->exe('git', 'config', 'remote.origin.url', ($mirror ? $mirror : $url));
$self->exe('git', 'fetch', 'origin');
}
if (!($do_clone || $self->{update}) || $mirror) {
# Leave the origin configured to the canonical URL. It's already correct
# if we cloned/fetched without a mirror; otherwise it may be anything.
$self->exe('git', 'config', 'remote.origin.url', $url);
}
my $template = getcwd()."/../.commit-template";
@@ -568,7 +500,7 @@ sub git_clone_one_submodule
$self->exe('git', 'config', 'commit.template', $template);
}
$self->git_add_remotes($submodule);
$self->git_add_remotes($repo_basename);
if ($self->{'detach-alternates'}) {
$self->exe('git', 'repack', '-a');
@@ -579,7 +511,7 @@ sub git_clone_one_submodule
}
}
chdir("..") or confess "cd ..: $OS_ERROR";
chdir($orig_cwd) or confess "cd $orig_cwd: $OS_ERROR";
return;
}
@@ -604,6 +536,8 @@ sub git_install_hooks
return if (!-d 'qtrepotools/git-hooks');
# Force C locale as git submodule returns the localized string "Entering"
local $ENV{LC_ALL} = 'C';
chomp(my @modules = `git submodule foreach :`);
push @modules, "";
for my $module (@modules) {
@@ -621,21 +555,16 @@ sub run
my ($self) = @_;
$self->check_if_already_initialized;
$self->git_submodule_init;
if (!$self->{webkit}) {
$self->git_disable_webkit_submodule;
}
chomp(my $url = `git config remote.origin.url`);
die("Have no origin remote.\n") if (!$url);
$url =~ s,\.git$,,;
$url =~ s,qt/qt5$,,;
$self->{'base-url'} = $url;
if ($self->{'module-subset'}) {
$self->git_prune_submodules;
}
$self->git_clone_all_submodules('qt/qt5', $self->{branch}, @{$self->{'module-subset'}});
$self->git_set_submodule_config;
$self->git_clone_all_submodules;
$self->git_add_remotes('qt5');
$self->git_add_remotes('qt/qt5');
$self->git_install_hooks;

20
qt.pro
View File

@@ -64,30 +64,32 @@ addModule(qtx11extras, qtbase)
addModule(qtsvg, qtbase)
addModule(qtxmlpatterns, qtbase)
addModule(qtdeclarative, qtbase, qtsvg qtxmlpatterns)
addModule(qtquickcontrols, qtdeclarative)
addModule(qtquickcontrols, qtdeclarative, qtgraphicaleffects)
addModule(qtmultimedia, qtbase, qtdeclarative)
addModule(qtwinextras, qtbase, qtdeclarative qtmultimedia)
addModule(qtactiveqt, qtbase)
addModule(qt3d, qtdeclarative)
addModule(qtjsondb, qtdeclarative)
addModule(qtsystems, qtbase, qtdeclarative)
addModule(qtlocation, qtbase, qt3d qtsystems qtmultimedia)
addModule(qtlocation, qtbase, qtdeclarative qtquickcontrols qtsystems)
addModule(qtsensors, qtbase, qtdeclarative)
addModule(qtconnectivity, qtbase $$ANDROID_EXTRAS, qtdeclarative)
addModule(qtfeedback, qtdeclarative, qtmultimedia)
addModule(qtpim, qtdeclarative, qtjsondb)
addModule(qtwebkit, qtdeclarative, qtlocation qtmultimedia qtsensors, WebKit.pro)
addModule(qtpim, qtdeclarative)
addModule(qtwebsockets, qtbase, qtdeclarative)
addModule(qtwebchannel, qtbase, qtdeclarative qtwebsockets)
addModule(qtwebkit, qtbase, qtdeclarative qtlocation qtmultimedia qtsensors qtwebchannel qtxmlpatterns, WebKit.pro)
addModule(qttools, qtbase, qtdeclarative qtactiveqt qtwebkit)
addModule(qtwebkit-examples, qtwebkit qttools)
addModule(qtimageformats, qtbase)
addModule(qt3d, qtdeclarative qtimageformats)
addModule(qtcanvas3d, qtdeclarative)
addModule(qtgraphicaleffects, qtdeclarative)
addModule(qtscript, qtbase, qttools)
addModule(qtquick1, qtscript, qtsvg qtxmlpatterns qtwebkit)
addModule(qtdocgallery, qtdeclarative, qtjsondb)
!win32:!mac:addModule(qtwayland, qtbase, qtdeclarative)
addModule(qtdocgallery, qtdeclarative)
addModule(qtwayland, qtbase, qtdeclarative)
addModule(qtserialport, qtbase)
addModule(qtenginio, qtdeclarative)
addModule(qtwebsockets, qtbase, qtdeclarative)
addModule(qtwebengine, qtquickcontrols qtwebchannel, qtwebkit qtlocation)
addModule(qttranslations, qttools)
addModule(qtdoc, qtdeclarative)
addModule(qtqa, qtbase)

2
qt3d

Submodule qt3d updated: 9a4f9f3eca...ec963e1063

2
qtbase

Submodule qtbase updated: 209a75f2d0...5ef14c52d0

1
qtcanvas3d Submodule

Submodule qtcanvas3d added at 9a714258f3

2
qtdoc

Submodule qtdoc updated: c326f4ee2b...12db3790ee

Some files were not shown because too many files have changed in this diff Show More