aboutsummaryrefslogtreecommitdiffstats
path: root/gnuwin32
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:34:00 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:34:00 +0200
commit92351a70e0b9193a1def156a470d9156beb8528b (patch)
treebbd040ad01c7a01d13939f45ad68c7d84d21b955 /gnuwin32
Long live the qt5 Qt repository
Diffstat (limited to 'gnuwin32')
-rw-r--r--gnuwin32/bin/bison.exebin0 -> 279552 bytes
-rw-r--r--gnuwin32/bin/bison.yacc2
-rw-r--r--gnuwin32/bin/flex++.exebin0 -> 170496 bytes
-rw-r--r--gnuwin32/bin/flex.exebin0 -> 170496 bytes
-rw-r--r--gnuwin32/bin/gperf.exebin0 -> 103424 bytes
-rw-r--r--gnuwin32/bin/iconv.exebin0 -> 16896 bytes
-rw-r--r--gnuwin32/bin/libcharset1.dllbin0 -> 11776 bytes
-rw-r--r--gnuwin32/bin/libiconv2.dllbin0 -> 1008128 bytes
-rw-r--r--gnuwin32/bin/libintl3.dllbin0 -> 103424 bytes
-rw-r--r--gnuwin32/bin/m4.exebin0 -> 179200 bytes
-rw-r--r--gnuwin32/bin/regex2.dllbin0 -> 79360 bytes
-rw-r--r--gnuwin32/bin/yacc2
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-GnuWin32.README54
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/ABOUT-NLS1111
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/AUTHORS8
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/COPYING674
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/ChangeLog21115
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/INSTALL291
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/NEWS1067
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/README43
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/README-alpha30
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/THANKS104
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/TODO309
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/data/README70
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/djgpp/README.in195
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/doc/bison.info11009
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/doc/gpl-3.0.texi717
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/etc/README41
-rw-r--r--gnuwin32/contrib/bison/2.4.1/bison-2.4.1/check.log422
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/COPYING38
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/INSTALL117
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/Borland/NOTES66
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/MVS/README44
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/README76
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/fastwc/README56
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/NEWS1233
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/README60
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/depends-GnuWin32.lst3
-rw-r--r--gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/flex-2.5.4a-1-GnuWin32.README51
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/depends-GnuWin32.lst3
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-GnuWin32.README54
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/AUTHORS2
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/COPYING340
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/ChangeLog3185
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/INSTALL183
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/NEWS80
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/README28
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1/check.log156
-rw-r--r--gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1/check_err.log21
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/depends-GnuWin32.lst9
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-1-GnuWin32.README54
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/ABOUT-NLS477
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/AUTHORS1
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/ChangeLog2633
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/DESIGN64
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/NEWS119
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/NOTES392
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/PORTS46
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/README149
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/THANKS13
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/djgpp/README122
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/extras/ChangeLog64
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/AUTHORS1
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/ChangeLog322
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/NEWS2
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/README60
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/djgpp/README123
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/lib/ChangeLog302
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/m4/ChangeLog18
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/tools/README25
-rw-r--r--gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/po/ChangeLog148
-rw-r--r--gnuwin32/lib/charset.alias4
-rw-r--r--gnuwin32/lib/libcharset.la35
-rw-r--r--gnuwin32/lib/libcharset.la.orig35
-rw-r--r--gnuwin32/lib/libiconv.la35
-rw-r--r--gnuwin32/lib/libiconv.la.orig35
-rw-r--r--gnuwin32/man/cat1/bison.1.txt188
-rw-r--r--gnuwin32/man/cat1/flex.1.txt3013
-rw-r--r--gnuwin32/man/cat1/gperf.1.txt226
-rw-r--r--gnuwin32/man/cat1/iconv.1.txt48
-rw-r--r--gnuwin32/man/cat1/yacc.1.txt42
-rw-r--r--gnuwin32/man/cat1p/yacc.1p.txt1269
-rw-r--r--gnuwin32/man/cat3/iconv.3.txt97
-rw-r--r--gnuwin32/man/cat3/iconv_close.3.txt32
-rw-r--r--gnuwin32/man/cat3/iconv_open.3.txt152
-rw-r--r--gnuwin32/manifest/bison-2.4.1-bin.mft98
-rw-r--r--gnuwin32/manifest/bison-2.4.1-bin.ver1
-rw-r--r--gnuwin32/manifest/bison-2.4.1-dep.mft5
-rw-r--r--gnuwin32/manifest/bison-2.4.1-dep.ver1
-rw-r--r--gnuwin32/manifest/flex-2.5.4a-1-bin.mft15
-rw-r--r--gnuwin32/manifest/flex-2.5.4a-1-bin.ver2
-rw-r--r--gnuwin32/manifest/gperf-3.0.1-bin.mft14
-rw-r--r--gnuwin32/manifest/gperf-3.0.1-bin.ver2
-rw-r--r--gnuwin32/manifest/libiconv-1.9.2-1-bin.mft0
-rw-r--r--gnuwin32/manifest/libiconv-1.9.2-1-bin.ver2
-rw-r--r--gnuwin32/manifest/libiconv-1.9.2-1-dep.mft0
-rw-r--r--gnuwin32/manifest/libiconv-1.9.2-1-dep.ver2
-rw-r--r--gnuwin32/share/aclocal/bison-i18n.m448
-rw-r--r--gnuwin32/share/bison/README70
-rw-r--r--gnuwin32/share/bison/bison.m4556
-rw-r--r--gnuwin32/share/bison/c++-skel.m425
-rw-r--r--gnuwin32/share/bison/c++.m4170
-rw-r--r--gnuwin32/share/bison/c-skel.m425
-rw-r--r--gnuwin32/share/bison/c.m4477
-rw-r--r--gnuwin32/share/bison/glr.c2653
-rw-r--r--gnuwin32/share/bison/glr.cc377
-rw-r--r--gnuwin32/share/bison/java-skel.m425
-rw-r--r--gnuwin32/share/bison/java.m4303
-rw-r--r--gnuwin32/share/bison/lalr1.cc1157
-rw-r--r--gnuwin32/share/bison/lalr1.java880
-rw-r--r--gnuwin32/share/bison/location.cc275
-rw-r--r--gnuwin32/share/bison/m4sugar/foreach.m4400
-rw-r--r--gnuwin32/share/bison/m4sugar/m4sugar.m42789
-rw-r--r--gnuwin32/share/bison/xslt/bison.xsl93
-rw-r--r--gnuwin32/share/bison/xslt/xml2dot.xsl206
-rw-r--r--gnuwin32/share/bison/xslt/xml2text.xsl581
-rw-r--r--gnuwin32/share/bison/xslt/xml2xhtml.xsl745
-rw-r--r--gnuwin32/share/bison/yacc.c1741
-rw-r--r--gnuwin32/share/locale/ca/LC_MESSAGES/libiconv.mobin0 -> 1803 bytes
-rw-r--r--gnuwin32/share/locale/da/LC_MESSAGES/bison-runtime.mobin0 -> 1268 bytes
-rw-r--r--gnuwin32/share/locale/da/LC_MESSAGES/bison.mobin0 -> 9458 bytes
-rw-r--r--gnuwin32/share/locale/da/LC_MESSAGES/libiconv.mobin0 -> 1728 bytes
-rw-r--r--gnuwin32/share/locale/de/LC_MESSAGES/bison-runtime.mobin0 -> 1347 bytes
-rw-r--r--gnuwin32/share/locale/de/LC_MESSAGES/bison.mobin0 -> 18417 bytes
-rw-r--r--gnuwin32/share/locale/de/LC_MESSAGES/libiconv.mobin0 -> 1847 bytes
-rw-r--r--gnuwin32/share/locale/el/LC_MESSAGES/bison-runtime.mobin0 -> 1545 bytes
-rw-r--r--gnuwin32/share/locale/el/LC_MESSAGES/bison.mobin0 -> 23536 bytes
-rw-r--r--gnuwin32/share/locale/eo/LC_MESSAGES/libiconv.mobin0 -> 1739 bytes
-rw-r--r--gnuwin32/share/locale/es/LC_MESSAGES/bison-runtime.mobin0 -> 514 bytes
-rw-r--r--gnuwin32/share/locale/es/LC_MESSAGES/bison.mobin0 -> 10645 bytes
-rw-r--r--gnuwin32/share/locale/es/LC_MESSAGES/libiconv.mobin0 -> 1758 bytes
-rw-r--r--gnuwin32/share/locale/et/LC_MESSAGES/bison-runtime.mobin0 -> 1248 bytes
-rw-r--r--gnuwin32/share/locale/et/LC_MESSAGES/bison.mobin0 -> 10820 bytes
-rw-r--r--gnuwin32/share/locale/et/LC_MESSAGES/libiconv.mobin0 -> 1723 bytes
-rw-r--r--gnuwin32/share/locale/fi/LC_MESSAGES/bison-runtime.mobin0 -> 1303 bytes
-rw-r--r--gnuwin32/share/locale/fi/LC_MESSAGES/libiconv.mobin0 -> 1862 bytes
-rw-r--r--gnuwin32/share/locale/fr/LC_MESSAGES/bison-runtime.mobin0 -> 1296 bytes
-rw-r--r--gnuwin32/share/locale/fr/LC_MESSAGES/bison.mobin0 -> 11517 bytes
-rw-r--r--gnuwin32/share/locale/fr/LC_MESSAGES/libiconv.mobin0 -> 1778 bytes
-rw-r--r--gnuwin32/share/locale/ga/LC_MESSAGES/bison-runtime.mobin0 -> 1324 bytes
-rw-r--r--gnuwin32/share/locale/ga/LC_MESSAGES/bison.mobin0 -> 18930 bytes
-rw-r--r--gnuwin32/share/locale/ga/LC_MESSAGES/libiconv.mobin0 -> 1704 bytes
-rw-r--r--gnuwin32/share/locale/gl/LC_MESSAGES/libiconv.mobin0 -> 1752 bytes
-rw-r--r--gnuwin32/share/locale/hr/LC_MESSAGES/bison-runtime.mobin0 -> 529 bytes
-rw-r--r--gnuwin32/share/locale/hr/LC_MESSAGES/bison.mobin0 -> 4127 bytes
-rw-r--r--gnuwin32/share/locale/hr/LC_MESSAGES/libiconv.mobin0 -> 1783 bytes
-rw-r--r--gnuwin32/share/locale/hu/LC_MESSAGES/libiconv.mobin0 -> 1876 bytes
-rw-r--r--gnuwin32/share/locale/id/LC_MESSAGES/bison-runtime.mobin0 -> 1393 bytes
-rw-r--r--gnuwin32/share/locale/id/LC_MESSAGES/bison.mobin0 -> 10896 bytes
-rw-r--r--gnuwin32/share/locale/id/LC_MESSAGES/libiconv.mobin0 -> 1767 bytes
-rw-r--r--gnuwin32/share/locale/it/LC_MESSAGES/bison-runtime.mobin0 -> 1232 bytes
-rw-r--r--gnuwin32/share/locale/it/LC_MESSAGES/bison.mobin0 -> 9864 bytes
-rw-r--r--gnuwin32/share/locale/it/LC_MESSAGES/libiconv.mobin0 -> 1913 bytes
-rw-r--r--gnuwin32/share/locale/ja/LC_MESSAGES/bison-runtime.mobin0 -> 505 bytes
-rw-r--r--gnuwin32/share/locale/ja/LC_MESSAGES/bison.mobin0 -> 4346 bytes
-rw-r--r--gnuwin32/share/locale/ky/LC_MESSAGES/bison-runtime.mobin0 -> 1582 bytes
-rw-r--r--gnuwin32/share/locale/lt/LC_MESSAGES/bison-runtime.mobin0 -> 1407 bytes
-rw-r--r--gnuwin32/share/locale/ms/LC_MESSAGES/bison-runtime.mobin0 -> 1362 bytes
-rw-r--r--gnuwin32/share/locale/ms/LC_MESSAGES/bison.mobin0 -> 16368 bytes
-rw-r--r--gnuwin32/share/locale/nb/LC_MESSAGES/bison-runtime.mobin0 -> 1302 bytes
-rw-r--r--gnuwin32/share/locale/nb/LC_MESSAGES/bison.mobin0 -> 9579 bytes
-rw-r--r--gnuwin32/share/locale/nl/LC_MESSAGES/bison-runtime.mobin0 -> 1275 bytes
-rw-r--r--gnuwin32/share/locale/nl/LC_MESSAGES/bison.mobin0 -> 18338 bytes
-rw-r--r--gnuwin32/share/locale/nl/LC_MESSAGES/libiconv.mobin0 -> 1719 bytes
-rw-r--r--gnuwin32/share/locale/pl/LC_MESSAGES/bison-runtime.mobin0 -> 1438 bytes
-rw-r--r--gnuwin32/share/locale/pl/LC_MESSAGES/bison.mobin0 -> 18475 bytes
-rw-r--r--gnuwin32/share/locale/pl/LC_MESSAGES/libiconv.mobin0 -> 1831 bytes
-rw-r--r--gnuwin32/share/locale/pt_BR/LC_MESSAGES/bison-runtime.mobin0 -> 1284 bytes
-rw-r--r--gnuwin32/share/locale/pt_BR/LC_MESSAGES/bison.mobin0 -> 9241 bytes
-rw-r--r--gnuwin32/share/locale/pt_BR/LC_MESSAGES/libiconv.mobin0 -> 1810 bytes
-rw-r--r--gnuwin32/share/locale/ro/LC_MESSAGES/bison-runtime.mobin0 -> 1366 bytes
-rw-r--r--gnuwin32/share/locale/ro/LC_MESSAGES/bison.mobin0 -> 9948 bytes
-rw-r--r--gnuwin32/share/locale/ro/LC_MESSAGES/libiconv.mobin0 -> 1408 bytes
-rw-r--r--gnuwin32/share/locale/ru/LC_MESSAGES/bison-runtime.mobin0 -> 571 bytes
-rw-r--r--gnuwin32/share/locale/ru/LC_MESSAGES/bison.mobin0 -> 7718 bytes
-rw-r--r--gnuwin32/share/locale/ru/LC_MESSAGES/libiconv.mobin0 -> 1793 bytes
-rw-r--r--gnuwin32/share/locale/sk/LC_MESSAGES/libiconv.mobin0 -> 1780 bytes
-rw-r--r--gnuwin32/share/locale/sl/LC_MESSAGES/bison-runtime.mobin0 -> 1513 bytes
-rw-r--r--gnuwin32/share/locale/sl/LC_MESSAGES/libiconv.mobin0 -> 1808 bytes
-rw-r--r--gnuwin32/share/locale/sr/LC_MESSAGES/libiconv.mobin0 -> 1989 bytes
-rw-r--r--gnuwin32/share/locale/sv/LC_MESSAGES/bison-runtime.mobin0 -> 1238 bytes
-rw-r--r--gnuwin32/share/locale/sv/LC_MESSAGES/bison.mobin0 -> 17501 bytes
-rw-r--r--gnuwin32/share/locale/sv/LC_MESSAGES/libiconv.mobin0 -> 1716 bytes
-rw-r--r--gnuwin32/share/locale/th/LC_MESSAGES/bison-runtime.mobin0 -> 1936 bytes
-rw-r--r--gnuwin32/share/locale/tr/LC_MESSAGES/bison-runtime.mobin0 -> 509 bytes
-rw-r--r--gnuwin32/share/locale/tr/LC_MESSAGES/bison.mobin0 -> 9654 bytes
-rw-r--r--gnuwin32/share/locale/tr/LC_MESSAGES/libiconv.mobin0 -> 1778 bytes
-rw-r--r--gnuwin32/share/locale/uk/LC_MESSAGES/bison-runtime.mobin0 -> 1781 bytes
-rw-r--r--gnuwin32/share/locale/uk/LC_MESSAGES/bison.mobin0 -> 14418 bytes
-rw-r--r--gnuwin32/share/locale/uk/LC_MESSAGES/libiconv.mobin0 -> 1809 bytes
-rw-r--r--gnuwin32/share/locale/vi/LC_MESSAGES/bison-runtime.mobin0 -> 1423 bytes
-rw-r--r--gnuwin32/share/locale/vi/LC_MESSAGES/bison.mobin0 -> 18090 bytes
-rw-r--r--gnuwin32/share/locale/wa/LC_MESSAGES/libiconv.mobin0 -> 2007 bytes
-rw-r--r--gnuwin32/share/locale/zh_CN/LC_MESSAGES/bison-runtime.mobin0 -> 1243 bytes
-rw-r--r--gnuwin32/share/locale/zh_CN/LC_MESSAGES/libiconv.mobin0 -> 1743 bytes
-rw-r--r--gnuwin32/share/locale/zh_TW/LC_MESSAGES/bison-runtime.mobin0 -> 1294 bytes
-rw-r--r--gnuwin32/share/locale/zh_TW/LC_MESSAGES/bison.mobin0 -> 10645 bytes
197 files changed, 67153 insertions, 0 deletions
diff --git a/gnuwin32/bin/bison.exe b/gnuwin32/bin/bison.exe
new file mode 100644
index 00000000..a56f1cb3
--- /dev/null
+++ b/gnuwin32/bin/bison.exe
Binary files differ
diff --git a/gnuwin32/bin/bison.yacc b/gnuwin32/bin/bison.yacc
new file mode 100644
index 00000000..0d8549e3
--- /dev/null
+++ b/gnuwin32/bin/bison.yacc
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec 'c:/progra~1/bison/bin/bison' -y "$@"
diff --git a/gnuwin32/bin/flex++.exe b/gnuwin32/bin/flex++.exe
new file mode 100644
index 00000000..59c75ccb
--- /dev/null
+++ b/gnuwin32/bin/flex++.exe
Binary files differ
diff --git a/gnuwin32/bin/flex.exe b/gnuwin32/bin/flex.exe
new file mode 100644
index 00000000..59c75ccb
--- /dev/null
+++ b/gnuwin32/bin/flex.exe
Binary files differ
diff --git a/gnuwin32/bin/gperf.exe b/gnuwin32/bin/gperf.exe
new file mode 100644
index 00000000..f71b09cb
--- /dev/null
+++ b/gnuwin32/bin/gperf.exe
Binary files differ
diff --git a/gnuwin32/bin/iconv.exe b/gnuwin32/bin/iconv.exe
new file mode 100644
index 00000000..fb2d0d2a
--- /dev/null
+++ b/gnuwin32/bin/iconv.exe
Binary files differ
diff --git a/gnuwin32/bin/libcharset1.dll b/gnuwin32/bin/libcharset1.dll
new file mode 100644
index 00000000..aec4d231
--- /dev/null
+++ b/gnuwin32/bin/libcharset1.dll
Binary files differ
diff --git a/gnuwin32/bin/libiconv2.dll b/gnuwin32/bin/libiconv2.dll
new file mode 100644
index 00000000..544dd92f
--- /dev/null
+++ b/gnuwin32/bin/libiconv2.dll
Binary files differ
diff --git a/gnuwin32/bin/libintl3.dll b/gnuwin32/bin/libintl3.dll
new file mode 100644
index 00000000..ec11e6b1
--- /dev/null
+++ b/gnuwin32/bin/libintl3.dll
Binary files differ
diff --git a/gnuwin32/bin/m4.exe b/gnuwin32/bin/m4.exe
new file mode 100644
index 00000000..a6673425
--- /dev/null
+++ b/gnuwin32/bin/m4.exe
Binary files differ
diff --git a/gnuwin32/bin/regex2.dll b/gnuwin32/bin/regex2.dll
new file mode 100644
index 00000000..f84a847a
--- /dev/null
+++ b/gnuwin32/bin/regex2.dll
Binary files differ
diff --git a/gnuwin32/bin/yacc b/gnuwin32/bin/yacc
new file mode 100644
index 00000000..0d8549e3
--- /dev/null
+++ b/gnuwin32/bin/yacc
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec 'c:/progra~1/bison/bin/bison' -y "$@"
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-GnuWin32.README b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-GnuWin32.README
new file mode 100644
index 00000000..c13a8f80
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-GnuWin32.README
@@ -0,0 +1,54 @@
+* 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.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/ABOUT-NLS b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/ABOUT-NLS
new file mode 100644
index 00000000..3575535a
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/ABOUT-NLS
@@ -0,0 +1,1111 @@
+1 Notes on the Free Translation Project
+***************************************
+
+Free software is going international! The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages. A few packages already provide translations for their
+messages.
+
+ If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site. But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+ Installers will find here some useful hints. These notes also
+explain how users should proceed for getting the programs to use the
+available translations. They tell how people wanting to contribute and
+work on translations can contact the appropriate team.
+
+ When reporting bugs in the `intl/' directory or bugs which may be
+related to internationalization, you should tell about the version of
+`gettext' which is used. The information can be found in the
+`intl/VERSION' file, in internationalized packages.
+
+1.1 Quick configuration advice
+==============================
+
+If you want to exploit the full power of internationalization, you
+should configure it using
+
+ ./configure --with-included-gettext
+
+to force usage of internationalizing routines provided within this
+package, despite the existence of internationalizing capabilities in the
+operating system where this package is being installed. So far, only
+the `gettext' implementation in the GNU C library version 2 provides as
+many features (such as locale alias, message inheritance, automatic
+charset conversion or plural form handling) as the implementation here.
+It is also not possible to offer this additional functionality on top
+of a `catgets' implementation. Future versions of GNU `gettext' will
+very likely convey even more functionality. So it might be a good idea
+to change to GNU `gettext' as soon as possible.
+
+ So you need _not_ provide this option if you are using GNU libc 2 or
+you have installed a recent copy of the GNU gettext package with the
+included `libintl'.
+
+1.2 INSTALL Matters
+===================
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language. Most such
+packages use GNU `gettext'. Other packages have their own ways to
+internationalization, predating GNU `gettext'.
+
+ By default, this package will be installed to allow translation of
+messages. It will automatically detect whether the system already
+provides the GNU `gettext' functions. If not, the included GNU
+`gettext' library will be used. This library is wholly contained
+within this package, usually in the `intl/' subdirectory, so prior
+installation of the GNU `gettext' package is _not_ required.
+Installers may use special options at configuration time for changing
+the default behaviour. The commands:
+
+ ./configure --with-included-gettext
+ ./configure --disable-nls
+
+will, respectively, bypass any pre-existing `gettext' to use the
+internationalizing routines provided within this package, or else,
+_totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl.a' file and
+will decide to use this. This might not be desirable. You should use
+the more recent version of the GNU `gettext' library. I.e. if the file
+`intl/VERSION' shows that the library which comes with this package is
+more recent, you should use
+
+ ./configure --with-included-gettext
+
+to prevent auto-detection.
+
+ The configuration process will not test for the `catgets' function
+and therefore it will not be used. The reason is that even an
+emulation of `gettext' on top of `catgets' could not provide all the
+extensions of the GNU `gettext' library.
+
+ Internationalized packages usually have many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language. Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package. However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+1.3 Using This Package
+======================
+
+As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
+and `CC' is an ISO 3166 two-letter country code. For example, let's
+suppose that you speak German and live in Germany. At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+ You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries. For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
+country code serves to distinguish the dialects.
+
+ The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc. On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
+locales supported by your system for your language by running the
+command `locale -a | grep '^LL''.
+
+ Not all programs have translations for all languages. By default, an
+English message is shown in place of a nonexistent translation. If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries. For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+ Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003). During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
+ In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect. For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+1.4 Translating Teams
+=====================
+
+For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list. The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
+area.
+
+ If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended. For example, speakers of Swedish can send a
+message to `sv-request@li.org', having this message body:
+
+ subscribe
+
+ Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around. If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `translation@iro.umontreal.ca' to reach the
+coordinator for all translator teams.
+
+ The English team is special. It works at improving and uniformizing
+the terminology in use. Proven linguistic skill are praised more than
+programming skill, here.
+
+1.5 Available Packages
+======================
+
+Languages are not equally supported in all packages. The following
+matrix shows the current state of internationalization, as of July
+2006. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+ Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo
+ +----------------------------------------------------+
+ GNUnet | [] |
+ a2ps | [] [] [] [] [] |
+ aegis | () |
+ ant-phone | () |
+ anubis | [] |
+ ap-utils | |
+ aspell | [] [] [] [] |
+ bash | [] [] [] |
+ batchelor | [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | [] |
+ bison | [] [] |
+ bison-runtime | [] |
+ bluez-pin | [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] [] |
+ console-tools | [] [] |
+ coreutils | [] [] [] [] |
+ cpio | |
+ cpplib | [] [] [] |
+ cryptonit | [] |
+ darkstat | [] () [] |
+ dialog | [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ error | [] [] [] [] |
+ fetchmail | [] [] () [] |
+ fileutils | [] [] |
+ findutils | [] [] [] |
+ flex | [] [] [] |
+ fslint | [] |
+ gas | |
+ gawk | [] [] [] |
+ gbiff | [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] |
+ gettext-tools | [] [] |
+ gimp-print | [] [] [] [] |
+ gip | [] |
+ gliv | [] |
+ glunarclock | [] |
+ gmult | [] [] |
+ gnubiff | () |
+ gnucash | () () [] |
+ gnucash-glossary | [] () |
+ gnuedu | |
+ gnulib | [] [] [] [] [] [] |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | [] [] |
+ gpe-clock | [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | |
+ gpe-edit | [] |
+ gpe-filemanager | |
+ gpe-go | [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] |
+ gpe-taskmanager | [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] [] |
+ gpe-todo | |
+ gphoto2 | [] [] [] [] |
+ gprof | [] [] |
+ gpsdrive | () () |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] |
+ gretl | |
+ gsasl | |
+ gss | |
+ gst-plugins | [] [] [] [] |
+ gst-plugins-base | [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] [] [] |
+ gtick | [] () |
+ gtkam | [] [] [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] |
+ id-utils | [] [] |
+ impost | |
+ indent | [] [] [] |
+ iso_3166 | [] [] |
+ iso_3166_1 | [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_3166_3 | [] |
+ iso_4217 | [] |
+ iso_639 | [] [] |
+ jpilot | [] |
+ jtag | |
+ jwhois | |
+ kbd | [] [] [] [] |
+ keytouch | |
+ keytouch-editor | |
+ keytouch-keyboa... | |
+ latrine | () |
+ ld | [] |
+ leafpad | [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] |
+ libgpewidget | [] [] [] |
+ libgpg-error | [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] [] |
+ libgsasl | |
+ libiconv | [] [] |
+ libidn | [] [] |
+ lifelines | [] () |
+ lilypond | [] |
+ lingoteach | |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailutils | [] |
+ make | [] [] |
+ man-db | [] () [] [] |
+ minicom | [] [] [] |
+ mysecretdiary | [] [] |
+ nano | [] [] () [] |
+ nano_1_0 | [] () [] [] |
+ opcodes | [] |
+ parted | |
+ pilot-qof | [] |
+ psmisc | [] |
+ pwdutils | |
+ python | |
+ qof | |
+ radius | [] |
+ recode | [] [] [] [] [] [] |
+ rpm | [] [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] [] |
+ sed | [] [] [] |
+ sh-utils | [] [] |
+ shared-mime-info | [] [] [] |
+ sharutils | [] [] [] [] [] [] |
+ shishi | |
+ silky | |
+ skencil | [] () |
+ sketch | [] () |
+ solfege | |
+ soundtracker | [] [] |
+ sp | [] |
+ stardict | [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] [] |
+ tar | [] |
+ texinfo | [] [] [] |
+ textutils | [] [] [] |
+ tin | () () |
+ tp-robot | [] |
+ tuxpaint | [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] [] |
+ vorbis-tools | [] [] [] [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] |
+ wget | [] [] |
+ xchat | [] [] [] [] [] |
+ xkeyboard-config | |
+ xpad | [] [] |
+ +----------------------------------------------------+
+ af am ar az be bg bs ca cs cy da de el en en_GB eo
+ 11 0 1 2 8 21 1 42 43 2 62 99 18 1 16 16
+
+ es et eu fa fi fr ga gl gu he hi hr hu id is it
+ +--------------------------------------------------+
+ GNUnet | |
+ a2ps | [] [] [] () |
+ aegis | |
+ ant-phone | [] |
+ anubis | [] |
+ ap-utils | [] [] |
+ aspell | [] [] [] |
+ bash | [] [] [] |
+ batchelor | [] [] |
+ bfd | [] |
+ bibshelf | [] [] [] |
+ binutils | [] [] [] |
+ bison | [] [] [] [] [] [] |
+ bison-runtime | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] |
+ cflow | |
+ clisp | [] [] |
+ console-tools | |
+ coreutils | [] [] [] [] [] [] |
+ cpio | [] [] [] |
+ cpplib | [] [] |
+ cryptonit | [] |
+ darkstat | [] () [] [] [] |
+ dialog | [] [] [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] [] [] [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] [] |
+ enscript | [] [] [] |
+ error | [] [] [] [] [] |
+ fetchmail | [] |
+ fileutils | [] [] [] [] [] [] |
+ findutils | [] [] [] [] |
+ flex | [] [] [] |
+ fslint | [] |
+ gas | [] [] |
+ gawk | [] [] [] [] |
+ gbiff | [] |
+ gcal | [] [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] |
+ gettext-tools | [] [] [] |
+ gimp-print | [] [] |
+ gip | [] [] [] |
+ gliv | () |
+ glunarclock | [] [] [] |
+ gmult | [] [] [] |
+ gnubiff | () () |
+ gnucash | () () () |
+ gnucash-glossary | [] [] |
+ gnuedu | [] |
+ gnulib | [] [] [] [] [] [] [] [] |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | [] [] [] [] |
+ gpe-clock | [] [] [] [] |
+ gpe-conf | [] |
+ gpe-contacts | [] [] |
+ gpe-edit | [] [] [] [] |
+ gpe-filemanager | [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] |
+ gpe-package | [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] [] |
+ gpe-taskmanager | [] [] [] |
+ gpe-timesheet | [] [] [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] |
+ gphoto2 | [] [] [] [] [] |
+ gprof | [] [] [] [] |
+ gpsdrive | () () [] () |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] [] [] [] [] [] [] |
+ gretl | [] [] [] |
+ gsasl | [] |
+ gss | [] |
+ gst-plugins | [] [] [] |
+ gst-plugins-base | [] [] |
+ gst-plugins-good | [] [] [] |
+ gstreamer | [] [] [] |
+ gtick | [] [] [] [] [] |
+ gtkam | [] [] [] [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] [] [] |
+ impost | [] [] |
+ indent | [] [] [] [] [] [] [] [] [] [] |
+ iso_3166 | [] [] [] |
+ iso_3166_1 | [] [] [] [] [] [] [] |
+ iso_3166_2 | [] |
+ iso_3166_3 | [] |
+ iso_4217 | [] [] [] [] |
+ iso_639 | [] [] [] [] [] |
+ jpilot | [] [] |
+ jtag | [] |
+ jwhois | [] [] [] [] [] |
+ kbd | [] [] |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ latrine | [] [] [] |
+ ld | [] [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] |
+ libgpewidget | [] [] [] [] [] |
+ libgpg-error | |
+ libgphoto2 | [] [] [] |
+ libgphoto2_port | [] [] |
+ libgsasl | [] [] |
+ libiconv | [] |
+ libidn | [] [] |
+ lifelines | () |
+ lilypond | [] |
+ lingoteach | [] [] [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] |
+ mailutils | [] [] |
+ make | [] [] [] [] [] [] [] [] |
+ man-db | () |
+ minicom | [] [] [] [] |
+ mysecretdiary | [] [] [] |
+ nano | [] () [] [] [] [] |
+ nano_1_0 | [] [] [] [] [] |
+ opcodes | [] [] [] [] |
+ parted | [] [] [] [] |
+ pilot-qof | |
+ psmisc | [] [] [] |
+ pwdutils | |
+ python | |
+ qof | |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rpm | [] [] |
+ screem | |
+ scrollkeeper | [] [] [] |
+ sed | [] [] [] [] [] |
+ sh-utils | [] [] [] [] [] [] [] |
+ shared-mime-info | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] [] |
+ shishi | |
+ silky | [] |
+ skencil | [] [] |
+ sketch | [] [] |
+ solfege | [] |
+ soundtracker | [] [] [] |
+ sp | [] |
+ stardict | [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] |
+ tar | [] [] [] [] [] [] |
+ texinfo | [] [] |
+ textutils | [] [] [] [] [] |
+ tin | [] () |
+ tp-robot | [] [] [] [] |
+ tuxpaint | [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | [] [] |
+ util-linux | [] [] [] [] [] [] [] |
+ vorbis-tools | [] [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] [] [] [] [] |
+ wget | [] [] [] [] [] [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] |
+ xpad | [] [] [] |
+ +--------------------------------------------------+
+ es et eu fa fi fr ga gl gu he hi hr hu id is it
+ 89 21 16 2 41 119 61 14 1 8 1 6 61 30 0 53
+
+ ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no
+ +--------------------------------------------------+
+ GNUnet | |
+ a2ps | () [] [] () |
+ aegis | () |
+ ant-phone | [] |
+ anubis | [] [] [] |
+ ap-utils | [] |
+ aspell | [] [] |
+ bash | [] |
+ batchelor | [] [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | |
+ bison | [] [] [] |
+ bison-runtime | [] [] [] |
+ bluez-pin | [] [] [] |
+ cflow | |
+ clisp | [] |
+ console-tools | |
+ coreutils | [] |
+ cpio | |
+ cpplib | [] |
+ cryptonit | [] |
+ darkstat | [] [] |
+ dialog | [] [] |
+ diffutils | [] [] [] |
+ doodle | |
+ e2fsprogs | [] |
+ enscript | [] |
+ error | [] |
+ fetchmail | [] [] |
+ fileutils | [] [] |
+ findutils | [] |
+ flex | [] [] |
+ fslint | [] [] |
+ gas | |
+ gawk | [] [] |
+ gbiff | [] |
+ gcal | |
+ gcc | |
+ gettext-examples | [] [] |
+ gettext-runtime | [] [] [] |
+ gettext-tools | [] [] |
+ gimp-print | [] [] |
+ gip | [] [] |
+ gliv | [] |
+ glunarclock | [] [] |
+ gmult | [] [] |
+ gnubiff | |
+ gnucash | () () |
+ gnucash-glossary | [] |
+ gnuedu | |
+ gnulib | [] [] [] [] |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] |
+ gpe-beam | [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | [] |
+ gpe-edit | [] [] |
+ gpe-filemanager | [] |
+ gpe-go | [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] |
+ gpe-package | [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] |
+ gpe-taskmanager | [] [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] |
+ gpe-todo | |
+ gphoto2 | [] [] |
+ gprof | |
+ gpsdrive | () () () |
+ gramadoir | () |
+ grep | [] [] [] |
+ gretl | |
+ gsasl | [] |
+ gss | |
+ gst-plugins | [] |
+ gst-plugins-base | |
+ gst-plugins-good | [] |
+ gstreamer | [] |
+ gtick | [] |
+ gtkam | [] |
+ gtkorphan | [] |
+ gtkspell | [] [] |
+ gutenprint | |
+ hello | [] [] [] [] [] [] [] [] |
+ id-utils | [] |
+ impost | |
+ indent | [] [] |
+ iso_3166 | [] |
+ iso_3166_1 | [] [] |
+ iso_3166_2 | [] |
+ iso_3166_3 | [] |
+ iso_4217 | [] [] [] |
+ iso_639 | [] [] |
+ jpilot | () () () |
+ jtag | |
+ jwhois | [] |
+ kbd | [] |
+ keytouch | [] |
+ keytouch-editor | |
+ keytouch-keyboa... | |
+ latrine | [] |
+ ld | |
+ leafpad | [] [] |
+ libc | [] [] [] [] [] |
+ libexif | |
+ libextractor | |
+ libgpewidget | [] |
+ libgpg-error | |
+ libgphoto2 | [] |
+ libgphoto2_port | [] |
+ libgsasl | [] |
+ libiconv | |
+ libidn | [] [] |
+ lifelines | [] |
+ lilypond | |
+ lingoteach | [] |
+ lynx | [] [] |
+ m4 | [] [] |
+ mailutils | |
+ make | [] [] [] |
+ man-db | () |
+ minicom | [] |
+ mysecretdiary | [] |
+ nano | [] [] [] |
+ nano_1_0 | [] [] [] |
+ opcodes | [] |
+ parted | [] [] |
+ pilot-qof | |
+ psmisc | [] [] [] |
+ pwdutils | |
+ python | |
+ qof | |
+ radius | |
+ recode | [] |
+ rpm | [] [] |
+ screem | [] |
+ scrollkeeper | [] [] [] [] |
+ sed | [] [] |
+ sh-utils | [] [] |
+ shared-mime-info | [] [] [] [] [] |
+ sharutils | [] [] |
+ shishi | |
+ silky | [] |
+ skencil | |
+ sketch | |
+ solfege | |
+ soundtracker | |
+ sp | () |
+ stardict | [] [] |
+ system-tools-ba... | [] [] [] [] |
+ tar | [] [] [] |
+ texinfo | [] [] [] |
+ textutils | [] [] [] |
+ tin | |
+ tp-robot | [] |
+ tuxpaint | [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] |
+ vorbis-tools | [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] |
+ xchat | [] [] [] [] |
+ xkeyboard-config | [] |
+ xpad | [] [] [] |
+ +--------------------------------------------------+
+ ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no
+ 40 24 2 1 1 3 1 2 3 21 0 15 1 101 5 3
+
+ nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+ +------------------------------------------------------+
+ GNUnet | |
+ a2ps | () [] [] [] [] [] [] |
+ aegis | () () |
+ ant-phone | [] [] |
+ anubis | [] [] [] |
+ ap-utils | () |
+ aspell | [] [] |
+ bash | [] [] [] |
+ batchelor | [] [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | [] [] |
+ bison | [] [] [] [] [] |
+ bison-runtime | [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] |
+ console-tools | [] |
+ coreutils | [] [] [] [] |
+ cpio | [] [] [] |
+ cpplib | [] |
+ cryptonit | [] [] |
+ darkstat | [] [] [] [] [] [] |
+ dialog | [] [] [] [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] [] |
+ error | [] [] [] [] |
+ fetchmail | [] [] [] |
+ fileutils | [] [] [] [] [] |
+ findutils | [] [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ fslint | [] [] [] [] |
+ gas | |
+ gawk | [] [] [] [] |
+ gbiff | [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] [] [] [] |
+ gimp-print | [] [] |
+ gip | [] [] [] [] |
+ gliv | [] [] [] [] |
+ glunarclock | [] [] [] [] [] [] |
+ gmult | [] [] [] [] |
+ gnubiff | () |
+ gnucash | () [] |
+ gnucash-glossary | [] [] [] |
+ gnuedu | |
+ gnulib | [] [] [] [] [] |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gpe-aerial | [] [] [] [] [] [] [] |
+ gpe-beam | [] [] [] [] [] [] [] |
+ gpe-calendar | [] [] [] [] [] [] [] [] |
+ gpe-clock | [] [] [] [] [] [] [] [] |
+ gpe-conf | [] [] [] [] [] [] [] |
+ gpe-contacts | [] [] [] [] [] |
+ gpe-edit | [] [] [] [] [] [] [] [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] [] [] [] |
+ gpe-login | [] [] [] [] [] [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] [] [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] [] [] [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] [] |
+ gphoto2 | [] [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] [] [] |
+ gretl | [] |
+ gsasl | [] [] |
+ gss | [] [] [] |
+ gst-plugins | [] [] [] [] |
+ gst-plugins-base | [] |
+ gst-plugins-good | [] [] [] [] |
+ gstreamer | [] [] [] |
+ gtick | [] [] [] |
+ gtkam | [] [] [] [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] [] [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] [] |
+ impost | [] |
+ indent | [] [] [] [] [] [] |
+ iso_3166 | [] [] [] [] [] [] |
+ iso_3166_1 | [] [] [] [] |
+ iso_3166_2 | |
+ iso_3166_3 | [] [] [] [] |
+ iso_4217 | [] [] [] [] |
+ iso_639 | [] [] [] [] |
+ jpilot | |
+ jtag | [] |
+ jwhois | [] [] [] [] |
+ kbd | [] [] [] |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ latrine | [] [] |
+ ld | [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] [] |
+ libgpewidget | [] [] [] [] [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] |
+ libgphoto2_port | [] [] [] |
+ libgsasl | [] [] [] [] |
+ libiconv | |
+ libidn | [] [] () |
+ lifelines | [] [] |
+ lilypond | |
+ lingoteach | [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailutils | [] [] [] [] |
+ make | [] [] [] [] |
+ man-db | [] [] |
+ minicom | [] [] [] [] [] |
+ mysecretdiary | [] [] [] [] |
+ nano | [] [] |
+ nano_1_0 | [] [] [] [] |
+ opcodes | [] [] |
+ parted | [] |
+ pilot-qof | [] |
+ psmisc | [] [] |
+ pwdutils | [] [] |
+ python | |
+ qof | [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] |
+ rpm | [] [] [] [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] |
+ sh-utils | [] [] [] |
+ shared-mime-info | [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | [] |
+ silky | [] |
+ skencil | [] [] [] |
+ sketch | [] [] [] |
+ solfege | [] |
+ soundtracker | [] [] |
+ sp | |
+ stardict | [] [] [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] [] |
+ tar | [] [] [] [] [] |
+ texinfo | [] [] [] [] |
+ textutils | [] [] [] |
+ tin | () |
+ tp-robot | [] |
+ tuxpaint | [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] [] |
+ vorbis-tools | [] [] |
+ wastesedge | |
+ wdiff | [] [] [] [] [] [] |
+ wget | [] [] [] [] |
+ xchat | [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] |
+ xpad | [] [] [] |
+ +------------------------------------------------------+
+ nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+ 0 2 3 58 31 53 5 76 72 5 42 48 12 51 130 2
+
+ tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
+ +---------------------------------------------------+
+ GNUnet | [] | 2
+ a2ps | [] [] [] | 19
+ aegis | | 0
+ ant-phone | [] [] | 6
+ anubis | [] [] [] | 11
+ ap-utils | () [] | 4
+ aspell | [] [] [] | 14
+ bash | [] | 11
+ batchelor | [] [] | 9
+ bfd | | 1
+ bibshelf | [] | 7
+ binutils | [] [] [] | 9
+ bison | [] [] [] | 19
+ bison-runtime | [] [] [] | 16
+ bluez-pin | [] [] [] [] [] [] | 28
+ cflow | [] [] | 4
+ clisp | | 6
+ console-tools | [] [] | 5
+ coreutils | [] [] | 17
+ cpio | [] [] [] | 9
+ cpplib | [] [] [] [] | 11
+ cryptonit | | 5
+ darkstat | [] () () | 15
+ dialog | [] [] [] [] [] | 30
+ diffutils | [] [] [] [] | 28
+ doodle | [] | 6
+ e2fsprogs | [] [] | 10
+ enscript | [] [] [] | 16
+ error | [] [] [] [] | 18
+ fetchmail | [] [] | 12
+ fileutils | [] [] [] | 18
+ findutils | [] [] [] | 17
+ flex | [] [] | 15
+ fslint | [] | 9
+ gas | [] | 3
+ gawk | [] [] | 15
+ gbiff | [] | 5
+ gcal | [] | 5
+ gcc | [] [] [] | 6
+ gettext-examples | [] [] [] [] [] [] | 26
+ gettext-runtime | [] [] [] [] [] [] | 28
+ gettext-tools | [] [] [] [] [] | 19
+ gimp-print | [] [] | 12
+ gip | [] [] | 12
+ gliv | [] [] | 8
+ glunarclock | [] [] [] | 15
+ gmult | [] [] [] [] | 15
+ gnubiff | [] | 1
+ gnucash | () | 2
+ gnucash-glossary | [] [] | 9
+ gnuedu | [] | 2
+ gnulib | [] [] [] [] [] | 28
+ gnunet-gtk | | 1
+ gnutls | | 2
+ gpe-aerial | [] [] | 14
+ gpe-beam | [] [] | 14
+ gpe-calendar | [] [] [] [] | 19
+ gpe-clock | [] [] [] [] | 20
+ gpe-conf | [] [] | 14
+ gpe-contacts | [] [] | 10
+ gpe-edit | [] [] [] [] | 19
+ gpe-filemanager | [] | 5
+ gpe-go | [] [] | 14
+ gpe-login | [] [] [] [] [] | 20
+ gpe-ownerinfo | [] [] [] [] | 20
+ gpe-package | [] | 5
+ gpe-sketchbook | [] [] | 16
+ gpe-su | [] [] [] | 19
+ gpe-taskmanager | [] [] [] | 19
+ gpe-timesheet | [] [] [] [] | 18
+ gpe-today | [] [] [] [] [] | 20
+ gpe-todo | [] | 6
+ gphoto2 | [] [] [] [] | 20
+ gprof | [] [] | 11
+ gpsdrive | | 4
+ gramadoir | [] | 7
+ grep | [] [] [] [] | 33
+ gretl | | 4
+ gsasl | [] [] | 6
+ gss | [] | 5
+ gst-plugins | [] [] [] | 15
+ gst-plugins-base | [] [] [] | 9
+ gst-plugins-good | [] [] [] | 18
+ gstreamer | [] [] [] | 17
+ gtick | [] | 11
+ gtkam | [] | 13
+ gtkorphan | [] | 7
+ gtkspell | [] [] [] [] [] [] | 26
+ gutenprint | | 3
+ hello | [] [] [] [] [] | 39
+ id-utils | [] [] | 14
+ impost | [] | 4
+ indent | [] [] [] [] | 25
+ iso_3166 | [] [] [] | 15
+ iso_3166_1 | [] [] | 20
+ iso_3166_2 | | 2
+ iso_3166_3 | [] [] | 9
+ iso_4217 | [] [] | 14
+ iso_639 | [] | 14
+ jpilot | [] [] [] [] | 7
+ jtag | [] | 3
+ jwhois | [] [] [] | 13
+ kbd | [] [] | 12
+ keytouch | [] | 4
+ keytouch-editor | | 2
+ keytouch-keyboa... | | 2
+ latrine | [] [] | 8
+ ld | [] [] [] [] | 8
+ leafpad | [] [] [] [] | 23
+ libc | [] [] [] | 23
+ libexif | [] | 4
+ libextractor | [] | 5
+ libgpewidget | [] [] [] | 19
+ libgpg-error | [] | 4
+ libgphoto2 | [] | 8
+ libgphoto2_port | [] [] [] | 11
+ libgsasl | [] | 8
+ libiconv | [] | 4
+ libidn | [] [] | 10
+ lifelines | | 4
+ lilypond | | 2
+ lingoteach | [] | 6
+ lynx | [] [] [] | 15
+ m4 | [] [] [] | 18
+ mailutils | [] | 8
+ make | [] [] [] | 20
+ man-db | [] | 6
+ minicom | [] | 14
+ mysecretdiary | [] [] | 12
+ nano | [] [] | 15
+ nano_1_0 | [] [] [] | 18
+ opcodes | [] [] | 10
+ parted | [] [] [] | 10
+ pilot-qof | [] | 3
+ psmisc | [] | 10
+ pwdutils | [] | 3
+ python | | 0
+ qof | [] | 2
+ radius | [] | 6
+ recode | [] [] [] | 25
+ rpm | [] [] [] [] | 14
+ screem | [] | 2
+ scrollkeeper | [] [] [] [] | 26
+ sed | [] [] [] | 22
+ sh-utils | [] | 15
+ shared-mime-info | [] [] [] [] | 23
+ sharutils | [] [] [] | 23
+ shishi | | 1
+ silky | [] | 4
+ skencil | [] | 7
+ sketch | | 6
+ solfege | | 2
+ soundtracker | [] [] | 9
+ sp | [] | 3
+ stardict | [] [] [] [] | 11
+ system-tools-ba... | [] [] [] [] [] [] [] | 37
+ tar | [] [] [] [] | 19
+ texinfo | [] [] [] | 15
+ textutils | [] [] [] | 17
+ tin | | 1
+ tp-robot | [] [] [] | 10
+ tuxpaint | [] [] [] | 16
+ unicode-han-tra... | | 0
+ unicode-transla... | | 2
+ util-linux | [] [] [] | 20
+ vorbis-tools | [] [] | 11
+ wastesedge | | 1
+ wdiff | [] [] | 22
+ wget | [] [] [] | 19
+ xchat | [] [] [] [] | 28
+ xkeyboard-config | [] [] [] [] | 11
+ xpad | [] [] [] | 14
+ +---------------------------------------------------+
+ 77 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
+ 172 domains 0 1 1 78 39 0 135 13 1 50 3 54 0 2054
+
+ Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect. This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+ For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer. There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+ If July 2006 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
+matrix with full percentage details can be found at
+`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
+
+1.6 Using `gettext' in new packages
+===================================
+
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package. Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library. This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+ Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project. Therefore the information given above
+applies also for every other Free Software Project. Contact
+`translation@iro.umontreal.ca' to make the `.pot' files available to
+the translation teams.
+
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/AUTHORS b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/AUTHORS
new file mode 100644
index 00000000..0a3ca6fd
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/AUTHORS
@@ -0,0 +1,8 @@
+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.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/COPYING b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/COPYING
new file mode 100644
index 00000000..94a9ed02
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/COPYING
@@ -0,0 +1,674 @@
+ 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>.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/ChangeLog b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/ChangeLog
new file mode 100644
index 00000000..f28a8478
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/ChangeLog
@@ -0,0 +1,21115 @@
+2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Version 2.4.1.
+ * NEWS: Set version and date.
+ * lib/Makefile.am: Update copyright year.
+ * tests/atlocal.in: Update copyright year.
+
+2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Semicolon feature removal is not about future language support.
+ * NEWS: The semicolon feature is no longer active for newer languages,
+ so don't claim that it causes trouble for them.
+
+2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * gnulib: Update submodule to HEAD.
+
+2008-12-09 Akim Demaille <demaille@gostai.com>
+
+ Update data/README.
+ * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
+
+2008-12-05 Eric Blake <ebb9@byu.net>
+
+ Build testsuite with newer autoconf.
+ * tests/output.at (m4_expand): Don't override in newer autoconf,
+ where the underlying implementation changed.
+ * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
+ (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
+ (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
+ (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
+ since some of them contain unbalanced ')'.
+
+2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS: Clarify a little.
+
+2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS: Update for recent changes.
+
+2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix unexpanded macros in GLR defines file.
+ Reported by Csaba Raduly at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
+ * THANKS (Csaba Raduly): Add.
+ * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
+ * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
+ lexer in a separate module that includes the defines file.
+ (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
+ source.
+ * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
+ Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
+ (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
+ (AT_DATA_SOURCE_PROLOGUE): New.
+ (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
+ (AT_DATA_SOURCE): New.
+ (AT_FULL_COMPILE): New, copied from master branch and extended to
+ support an additional source file.
+
+2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't let maintainer-*-check targets force a version update.
+ * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
+ handled.
+
+2008-11-17 Di-an Jan <dianj@freeshell.org>
+
+ * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
+ Align menus. Adjust word wrapping. Use node names for menu names.
+ (Examples): Don't abbreviate node names.
+ (LocalWords): Remove abbreviations.
+ (Copying): Make description a sentence.
+ (Java Action Features): Remove period to match the rest of menu.
+
+2008-11-11 Paolo Bonzini <bonzini@gnu.org>
+
+ * bootstrap.conf: Replace m4/warning.m4 with warnings module.
+ * configure.ac: Adjust usage.
+ * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
+ * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
+ * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
+
+2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't add a semicolon to actions for %skeleton or %language.
+ It breaks Java test cases as reported by Akim Demaille.
+ * src/scan-code.l: Implement.
+
+2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Clean up %skeleton and %language priority implementation.
+ * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
+ remove static qualifier because others will soon need to see it.
+ (language_prio): Likewise.
+ (getargs): Use command_line_prio rather than 0.
+ * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
+ enum fields.
+ (skeleton_prio): Extern it.
+ (language_prio): Extern it.
+ * src/parse-gram.y: Use grammar_prio rather than 1.
+
+2008-11-04 Akim Demaille <demaille@gostai.com>
+
+ * NEWS: Mention the trailing semicolon in action.
+
+2008-11-04 Akim Demaille <demaille@gostai.com>
+
+ Reformat NEWS.
+ * NEWS: Use more outline-mode markup.
+ Suggested by Jim Meyering.
+
+2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix user actions without a trailing semicolon.
+ Reported by Sergei Steshenko at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
+ * THANKS (Sergei Steshenko): Add.
+ * src/scan-code.l (SC_RULE_ACTION): Fix it.
+ * tests/regression.at (Fix user actions without a trailing semicolon):
+ New test case.
+
+2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Initiate further development.
+ * NEWS: Create an empty section for new entries.
+ * gnulib: Update submodule to HEAD.
+
+2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS: Version 2.4.
+
+2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Prepare for next release.
+ * NEWS: Briefly mention changes since 2.3b.
+ * README: Say GNU m4 1.4.6, which we've been requiring in release
+ announcements already, not 1.4.3, which breaks the build.
+
+2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Say %language is experimental.
+ We're thinking of extending it's effect on output file naming. See the
+ thread at
+ <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
+ * NEWS: Say it's experimental.
+ * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
+ recommend it over %skeleton for now.
+ (Bison Options): Likewise.
+ (C++ Bison Interface): Use %skeleton not %language.
+ (Calc++ Parser): Use %skeleton not %language.
+ * src/getargs.c (usage): Say it's experimental.
+
+2008-11-01 Di-an Jan <dianj@freeshell.org>
+ Paolo Bonzini <bonzini@gnu.org>
+
+ Support all Java parser class modifiers.
+ * data/java.m4 (b4_percent_define_get3): New.
+ (b4_final_if, b4_strictfp_if): New.
+ * data/lalr1.java (final, strictfp, extends, implements): Support.
+ * doc/bison.texinfo (final, strictfp, extends, implements): Add
+ documentation.
+ * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
+ (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
+ (AT_CHECK_JAVA_GREP): New.
+ (Java parser class modifiers): New test.
+ (Java parser class extends and implements): New test.
+
+ Model exception propagation better with throws and lex_throws.
+ * data/java.m4 (b4_list2): New.
+ (throws): Change default.
+ * data/lalr1.java (yyaction): Add throws.
+ (parse): Add lex_throws in addition to throws.
+ * doc/bison.texinfo (throws, lex_throws): Add documentation.
+ * tests/java.at (Java throws specifications): New test.
+
+ Improve documentation for Java parsers.
+ * doc/bison.texinfo (Java Parsers): Add subsections.
+ Don't quote first argument of %define.
+ (Java Bison Interface): Document output files. Move documentation
+ of parser class and merge into Java Parser Interface. Document
+ features that error out. Document directives with no effect.
+ Move note about Javadoc higher.
+ (Java Semantic Values): Explicitly mention stype.
+ Document that generic types cannot be used.
+ (Java Location Values): Use @deftypeivar. Document constructors.
+ Correct return value for toString.
+ (Java Parser Interface): List undocumented constants/fields.
+ Move documentation of fields added by %parse-param closer to list
+ of members. Document that token names are added as fields.
+ Document constructors accurately. Remove error method.
+ (Java Scanner Interface): Move note on %pure-parser to Java Bison
+ Interface. Describe %code lexer and yylex accutately.
+ Remove documentation that does not match the code.
+ (Java Action Features): New.
+ (Java Differences): Add reference. Add item on semantic values.
+ Add note about @{ ... @}. Clarify %% epilogue placement.
+ (Java Declarations Summary): New.
+
+ Fix Java skeleton.
+ * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
+ (b4_remove_comma): Quote test argument.
+ (b4_identification): Remove "bison" field.
+ * tests/java.at (Java parser class and package names): New test.
+ (Java %parse-param and %lex-param): New test.
+ (Java stype, position_class and location_class): New test.
+
+2008-10-31 Di-an Jan <dianj@freeshell.org>
+
+ * data/lalr1.jave: Update copyright years.
+ (YYParser): Correct name of "generated from" file in Javadoc:
+ use b4_file_name instead of @ofile@.
+ (Location constructor): Correct Javadoc parameter name.
+ (yylloc): Add missing opening m4 quote after b4_location_if.
+ This removes a stray [ in the Javadoc of Lexer.getStartPos.
+ (Lexer.yyerror): Fix incorrect m4 and Javadoc.
+ (YYParser constructor): Correct Javadoc parameter name.
+
+2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Always put auxiliary code files in the same dir as other output files.
+ * src/files.c (compute_file_name_parts): When the user specifies
+ --output but not --file-prefix, extract the directory prefix from the
+ file prefix not from the grammar file name. This affects the location
+ of files like location.hh generated by the C++ skeleton. The includes
+ in the other output files require this fix.
+ * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
+ for expected output files.
+ (Output files): Add a test for the above.
+
+2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * gnulib: Update submodule to HEAD.
+
+2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Update copyright year.
+ * src/files.c: Here.
+
+2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
+
+ Don't overwrite the input file.
+ * src/files.c (output_file_name_check): Fatal error if using input file
+ for output.
+ * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
+ argument.
+ (Conflicting output files): Add test.
+
+2008-10-28 Akim Demaille <demaille@gostai.com>
+
+ Space changes.
+ * data/lalr1.cc: Formatting changes.
+
+2008-10-28 Akim Demaille <demaille@gostai.com>
+
+ Don't define debugging functions when !YYDEBUG.
+ * data/lalr1.cc (debug_stream, set_debug_stream)
+ (debug_level_type, debug_level, set_debug_level): Don't
+ declare them when YYDEBUG is not defined.
+ The implementation are already YYDEBUG-aware.
+
+2008-10-28 Akim Demaille <demaille@gostai.com>
+
+ Prefer "continue" for empty loop bodies.
+ * etc/bench.pl.in: Use "continue" instead of {}.
+
+2008-10-28 Akim Demaille <demaille@gostai.com>
+
+ Space and comments changes.
+ * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
+ * data/c.m4, data/lalr1.cc: Space changes.
+
+2008-10-28 Akim Demaille <demaille@gostai.com>
+
+ Make gnulib a submodule.
+ * gnulib: New.
+ * .gitmodules (gnulib): New.
+
+2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix yyerror_range for user-defined location type in C++. Reported by
+ Georg Sauthoff at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
+ * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
+ * THANKS (Georg Sauthoff): Add.
+
+2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Update several administrative files mainly to facilitate releasing.
+ * HACKING (Administrivia): Make the git-merge-changelog notes more
+ helpful.
+ (Test suite): Don't say lalr1.cc is not exercised in the test suite.
+ (Release Procedure): Update for git and add numerous details that were
+ previously missing.
+ * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
+ * maint.mk (announcement): Don't list bison as a bootstrap tool so
+ that announcements don't claim we bootstrapped with whatever bison
+ happened to be in PATH. Add flex as a bootstrap tool.
+ * Makefile.maint: Remove, previously replaced by maint.mk.
+ * Makefile.cfg: Remove, and migrate settings to...
+ * cfg.mk: ... here for the sake of `make announcement'.
+ * bootstrap.conf (gnulib_modules): Add announce-gen.
+ * README: Say GNU Bison instead of just Bison. Suggested by Karl
+ Berry.
+
+2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
+
+ Small but important bugfixes for the Java skeleton.
+ * data/lalr1.java (yyerror): Change Location to b4_location_type.
+ (yy_symbol_print): Call toString on yyvaluep.
+
+2008-08-29 Akim Demaille <demaille@gostai.com>
+
+ Clarify UPDATED use.
+ * doc/bison.texinfo: It refers to the last edition of this file,
+ not to the release date of Bison.
+ Reported by Joel E. Denny.
+
+2008-08-29 Akim Demaille <demaille@gostai.com>
+
+ * README: Update FAQ pointer.
+ Reported by Joel E. Denny.
+
+2008-08-27 Eric Blake <ebb9@byu.net>
+
+ Resync m4sugar from autoconf.
+ * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
+ (m4_init): Adjust to latest m4.git changes.
+ (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
+ effects.
+ * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
+ (_m4_list_cmp): Reduce side effects.
+
+2008-08-27 Akim Demaille <demaille@gostai.com>
+
+ Check yyerrok in calc.at.
+ * tests/calc.at (calc.y): Use yyerrok on "( error )".
+ (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
+ expected.
+
+2008-08-27 Akim Demaille <demaille@gostai.com>
+
+ Support yyerrok in lalr1.cc.
+ YYBACKUP is still to import back into lalr1.cc.
+ * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
+
+2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ For maintainer-check*, don't recompile for a $(VERSION) update.
+ * cfg.mk: New file.
+ (_is-dist-target): Override the one in GNUmakefile.
+ * Makefile.am (EXTRA_DIST): Add cfg.mk.
+
+2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Update for recent change to gnulib.
+ * src/parse-gram.y: Don't include strverscmp.h. It comes from
+ string.h now.
+
+2008-08-15 Eric Blake <ebb9@byu.net>
+
+ Remaining m4sugar merge from autoconf.
+ * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
+ * data/m4sugar/foreach.m4: New file, copied from autoconf.
+ * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
+ * src/output.c (output_skeleton): Tell m4 how to find it.
+
+ Partial m4sugar merge from autoconf: m4_map.
+ * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
+ (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
+ (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
+ * data/java.m4 (b4_token_enums): Use more efficient short-circuit
+ for empty list.
+ * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
+ Likewise.
+ (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
+ declares it.
+
+2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Keep .version and PACKAGE_VERSION in sync.
+ * Makefile.am ($(top_srcdir)/.version): Declare configure as a
+ dependency, and add comments justifying this in more detail. Discussed
+ starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
+
+2008-08-06 Eric Blake <ebb9@byu.net>
+
+ Partial m4sugar merge from autoconf: m4_shiftn.
+ * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
+ (m4_shift2, m4_shift3): New macros.
+ (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
+ * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
+ (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
+ * data/java.m4 (b4_remove_comma): Likewise.
+
+ Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
+ * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
+ (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
+ (m4_init): Consolidate wrapped text into single m4_wrap.
+ * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
+ in wrapped text.
+
+2008-08-05 Eric Blake <ebb9@byu.net>
+
+ Partial m4sugar merge from autoconf: builtins, version.m4.
+ * data/m4sugar/m4sugar.m4 (changeword): Nuke.
+ (m4_prepend): Remove, as it is unused and inherently quadratic,
+ whereas m4_append is linear in newer m4.
+ (m4_mkstemp): New builtin.
+ (m4_symbols): Make rename conditional.
+ (m4_version_prereq): Ensure fatal error if used in bison, which
+ intentionally lacks version.m4.
+
+ Fix comments in m4sugar.
+ * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
+
+2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Update for recent .gitignore fix in Gnulib.
+ * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
+ anchored .gitignore entries.
+
+2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Set gnu or gnits strictness.
+ * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
+ development and gnits strictness for releases. Based on Eric Blake's
+ suggestion at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
+
+2008-07-31 Paolo Bonzini <bonzini@gnu.org>
+
+ * NEWS: Clarify documentation of %language.
+
+2008-07-31 Paolo Bonzini <bonzini@gnu.org>
+
+ Support usage of git-merge-changelog.
+ * .gitattributes: New.
+ * HACKING: Document usage of git-merge-changelog.
+ * bootstrap: Install git-merge-changelog entries in .git/config
+ if appropriate.
+
+2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Remove remaining dependence on CVS Id keyword.
+ * ChangeLog: For the sake of people still using CVS, don't use dollars
+ when mentioning Id.
+ * data/xslt/bison.xsl: Remove Id from header comments, where it was
+ unusual anyway.
+ * data/xslt/xml2dot.xsl: Likewise.
+ * data/xslt/xml2text.xsl: Likewise.
+ * data/xslt/xml2xhtml.xsl: Likewise.
+ * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
+ * doc/Makefile.am (neutralize): Remove, no longer needed.
+ (.x.1): Don't use neutralize.
+ (edit): Don't substitute for ID.
+ (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
+
+2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix dependence on computed configure variables.
+ * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
+ $(top_srcdir)/configure.ac so that changes to computed variables, such
+ as PACKAGE_VERSION, are seen.
+ * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
+
+2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Update copyright dates for recent changes.
+ * Makefile.am: Here.
+ * src/Makefile.am: Here.
+ * src/reduce.c: Here.
+ * tests/reduce.at: Here.
+
+2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Use git-version-gen for version names between releases.
+ * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
+ * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
+ * .prev-version: New.
+ * .version.in: Remove.
+ * ChangeLog: Remove the Id previously used for capturing the CVS
+ revision.
+ * GNUmakefile: Remove, now copied from Gnulib.
+ * Makefile.am: Add code suggested by comments in
+ build-aux/git-version-gen.
+ (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
+ .prev-version, and .version.
+ * NEWS (2.3b+): Rename to...
+ (?.?): ... this because we're dropping the "+" version naming scheme,
+ but, in general, we still can't be sure of our next release name.
+ * bootstrap: Add a quick hack to remove from .gitignore the
+ GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
+ entry. This should really be fixed in gnulib instead.
+ * bootstrap.conf (gnulib_modules): Add gnumakefile.
+ * configure.ac (AC_INIT): Set version name by invoking
+ build-aux/git-version-gen.
+ (AC_CONFIG_FILES): Remove .version, now generated by
+ build-aux/git-version-gen.
+ * maint.mk: New, copied from coreutils.
+ * doc/.cvsignore (bison.1): Add.
+ * doc/.gitignore (/bison.1): Add.
+ * doc/bison.1: Remove, generated.
+ * src/.cvsignore (revision.c): Remove.
+ * src/.gitignore (/revision.c): Remove.
+ * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
+ (BUILT_SOURCES): Remove revision.c.
+ (revision.c): Remove.
+ * src/getargs.c (version): Don't print revision after the VERSION.
+ * src/revision.h: Remove.
+
+2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix untranslatable composition of sentences. Reported by Goran
+ Uddeborg at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
+ * THANKS (Goran Uddeborg): Add.
+ * src/reduce.c (reduce_print): Report the number of nonterminals and
+ rules useless in the grammar in separate sentences.
+ * tests/reduce.at (Useless Rules): Update output.
+ (Reduced Automaton): Likewise.
+ (Underivable Rules): Likewise.
+ (Empty Language): Likewise.
+
+2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix some .gitignore and .cvsignore problems.
+ * bootstrap (insert_sorted_if_absent): Replace all uses with...
+ (insert_vc_ignore): ... this new function, which prepends `/' to all
+ .gitignore entries before passing them to insert_sorted_if_absent.
+ * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
+ .cvsignore files are maintained even though Bison developers run
+ bootstrap while using Git.
+ * .cvsignore (*.patch *.log log patches applied): Remove, apparently
+ unneeded by Bison.
+ (gnulib): Add.
+ * .gitignore (/*.patch *.log log patches applied): Remove, broken and
+ unneeded. Reported by Eric Blake.
+ * lib/.gitignore (/*~): Add.
+ * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
+ * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
+ Blake.
+ * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
+
+2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Improve forward-compatibility with GNU M4. Reported by Eric Blake at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
+ * bootstrap.conf (gnulib_modules): Add unsetenv.
+ * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
+ * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
+ (/setenv.m4): Add.
+ * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
+ the first argument because it may become position-dependent, and unset
+ POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
+ Add comments explaining these issues in more detail.
+
+2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Add .gitignore everywhere based on .cvsignore.
+ * .gitignore: New.
+ * build-aux/.gitignore: New.
+ * data/.gitignore: New.
+ * doc/.gitignore: New.
+ * etc/.gitignore: New.
+ * examples/.gitignore: New.
+ * examples/calc++/.gitignore: New.
+ * lib/.gitignore: New.
+ * m4/.gitignore: New.
+ * po/.gitignore: New.
+ * runtime-po/.gitignore: New.
+ * src/.gitignore: New.
+ * tests/.gitignore: New.
+
+2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS (2.3b+): New section, empty for now.
+ * configure.ac (AC_INIT): 2.3b -> 2.3b+.
+
+2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS (2.3b): Update release date since there has been a delay in
+ getting the announcements and tarballs out.
+
+2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS: Version 2.3b.
+ * configure.ac (AC_INIT): Likewise.
+ (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
+
+2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
+ been doing it for years.
+ (Test suite): Mention maintainer-push-check and maintainer-xml-check.
+ (Release Procedure): Add FIXME about make alpha being unmaintained.
+
+2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/yacc.c: Reformat m4 a little for readability.
+ * src/lalr.c (build_relations): Correct comment.
+
+2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ DJGPP specific issue.
+ * djgpp/config.sed: Fixes required to run configure scripts generated
+ by autoconf 2.62.
+
+2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * HACKING (Release Procedure): translation@iro.umontreal.ca is now
+ coordinator@translationproject.org.
+
+2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * THANKS: Add Eric Blake.
+
+2008-04-23 Eric Blake <ebb9@byu.net>
+
+ Revert prior patch, by working around autoconf regression.
+ * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
+ ("Output file name: ("): Uncomment test.
+ ("Output file name: )"): Likewise.
+ Based on an idea from Noah Misch.
+
+2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
+ 2.61. Reported by Juan Manuel Guerrero at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
+ * tests/output.at ("Output file name: ("): Comment out test case for
+ now.
+ ("Output file name: )"): Likewise.
+
+2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * GNUmakefile: Update git-version-gen invocation so make dist
+ succeeds.
+
+2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Update to the current gnulib CVS repository, and fix trigraph handling
+ in Bison.
+ * bootstrap: Update gnulib CVS repository URL.
+ (symlink_to_dir): Encapsulate the code that guarantees the destination
+ directory exists into...
+ (check_dst_dir): ... this new function, and...
+ (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
+ fail when copying files into lib/uniwidth/.
+ * src/output.c (prepare_symbols): When writing yytname muscles, where
+ symbol names will be encoded in C-string literals, tell quotearg to
+ escape trigraphs. This used to be the default in gnulib.
+ * tests/regression.at (Token definitions): Because of the change in
+ gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
+ escapes trigraphs in symbol names. Thus, yytname no longer has
+ trigraphs unnecessarily doubly escaped. Update test case output.
+ Extend test case to be sure Bison's own error messages will no longer
+ have trigraphs in symbol names unnecessarily escaped once.
+
+2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix make dist infinite loop reported by Juan Manuel Guerrero at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
+ * .cvsignore: Add .version.
+ * .version.in: New.
+ * bootstrap.conf (gnulib_modules): Add git-version-gen.
+ * configure.ac (AC_CONFIG_FILES): Add .version.
+ * build-aux/.cvsignore: Add git-version-gen.
+
+2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS (2.3a+): Mention that -g now takes an argument.
+ * doc/bison.texinfo (Bison Options): Reword -W entry a little for
+ consistency. Update the -g and -x entries now that they take
+ arguments. Use brackets to indicate optional arguments.
+ * src/getargs.c (usage): Explain the relationship between arguments of
+ long and short options more completely. Document --defines and -d
+ separately since the former takes an argument but, for POSIX Yacc, the
+ latter does not.
+ (short_options): Let -W take an optional argument like --warnings.
+ (getargs): Sort cases.
+
+2008-02-28 Akim Demaille <demaille@gostai.com>
+
+ * doc/bison.texinfo: Fix a few typos.
+
+2008-02-28 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Bison Options): Document -W.
+ Based on Joel E. Denny's NEWS entry, and Automake's documentation.
+
+2008-02-28 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (short_options): Split and sort for readability.
+ -g and -x take optional arguments, just like their long options.
+ * build-aux/cross-options.pl: Use /x to make the regexp easier to
+ understand.
+ Fix the handling of $opt which resulted in all the argument to be
+ considered as optional.
+
+2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
+ say its interface is experimental.
+ * doc/bison.texinfo (Decl Summary): In the %language entry, mention
+ Java.
+ (Bison Options): In the -L and --language entry, mention Java.
+ (Java Bison Interface): Say the interface is experimental.
+ * src/getargs.c (usage): Mention -L and --language.
+
+ * NEWS (2.3a+): Say the push parsing interface is experimental.
+ * doc/bison.texinfo (Push Decl): Likewise.
+ (Decl Summary): Likewise in the "%define api.push_pull" entry.
+ (Push Parser Function): Likewise.
+ (Pull Parser Function): Likewise.
+ (Parser Create Function): Likewise.
+ (Parser Delete Function): Likewise.
+ (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
+ yypull_parse, and yypush_parse entries.
+
+ * NEWS (2.3a+): Mention XML support, and say the schema is
+ experimental.
+ * doc/bison.texinfo (Bison Options): Mention -x and --xml.
+ * src/getargs.c (usage): Say the XML schema is experimental.
+
+ * NEWS (2.3a+): Say option instead of flag.
+
+2008-02-21 Wojciech Polak <polak@gnu.org>
+
+ * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
+ text.
+
+2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix impure push parser compile error reported by Bob Rossi at
+ <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
+ * data/yacc.c: Clean up whitespace in the output a little.
+ (yypstate_allocated): Define for impure push parsers regardless of
+ whether the pull interface is also requested.
+ * tests/push.at (Push Parsing: Multiple impure instances): Extend to
+ check impure push parsers without the pull interface.
+
+ * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
+ yyerror takes arguments specified by %parse-param while yypstate_new
+ does not.
+ * doc/bison.texinfo (Parser Create Function): Document that
+ yypstate_new returns 0 for multiple impure parser instances.
+ * tests/push.at (Push Parsing: Multiple impure instances): Update
+ expected stderr output.
+
+2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * runtime-po/POTFILES.in (push.c): Remove.
+
+2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
+ * data/push.c: Rename to...
+ * data/yacc.c: ... this, overwriting it.
+ * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
+ `%push-pull-parser' -> `%define api.push_pull "both"'.
+ Remove old yacc.c tests, and update push.c tests to yacc.c.
+
+2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/bison.m4 (b4_percent_code_get): Output %code block comments like
+ `"%code top" blocks' instead of `%code "top" blocks'.
+ * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
+ Clean up whitespace in the output a little.
+
+2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix documentation problems reported by Tim Josling at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
+ * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
+ * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
+ integers. Explain the effect of literal string aliases on error
+ messages. Copy token 0 documentation from the C++ skeleton
+ documentation.
+
+2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Accept a token number in a %left, %right, or %nonassoc for POSIX
+ conformance. Reported by Tim Josling at
+ <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
+ * NEWS (2.3a+): Mention.
+ * doc/bison.texinfo (Precedence Decl): Describe how literal strings
+ and code numbers are treated by precedence declarations.
+ * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
+ of symbols.1.
+ (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
+ of symbol.
+ (symbol.prec): New, just like symbol but allows INT.
+ * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
+ longer holds.
+ * tests/regression.at (Token number in precedence declaration): New
+ test case.
+
+2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ DJGPP specific issues.
+ * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
+ be changed. Copyright timestamp adjusted.
+ * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
+ be changed. Copyright timestamp adjusted.
+ * djgpp/config.site: Copyright timestamp adjusted.
+ * djgpp/config_h.sed: Copyright timestamp adjusted.
+ * djgpp/djunpack.bat: Copyright timestamp adjusted.
+ * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
+ filename translation list.
+ * djgpp/subpipe.c (init_subpipe): Check the environment variables
+ TMPDIR, TMP and TEMP, in that order, to determinate where the temp
+ files shall be created. Before trying to use the temp dir where the
+ environment variable points to check that the dir really exists. If
+ not default to the cwd as temp dir. Copyright timestamp adjusted.
+ * djgpp/subpipe.h: Copyright timestamp adjusted.
+ * djgpp/testsuite.sed: Copyright timestamp adjusted.
+
+2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
+
+2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (yyparse): Correct the comment when locations aren't used.
+ Problem reported by Claudio Saavedra in
+ <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
+
+2008-01-05 Wojciech Polak <polak@gnu.org>
+
+ * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
+ document's title with the input grammar file name.
+
+2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Automate regression testing of the XML/XSLT implementation. Discussed
+ starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
+ * configure.ac (XSLTPROC): New substitution.
+ * Makefile.am (maintainer-xml-check): New phony target invoking...
+ * tests/Makefile.am (maintainer-xml-check): ... this new phony target
+ invoking make maintainer-check with BISON_TEST_XML=1.
+ * tests/atlocal.in (XSLTPROC): New.
+ * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
+ not to report reachable memory when Bison is expected to have a
+ non-zero exit status and (2) to compare XML/XSLT output with --graph
+ and --report=all output for every working grammar when
+ BISON_TEST_XML=1.
+ (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
+ (AT_BISON_CHECK_XML): New.
+ (AT_QUELL_VALGRIND): New.
+ * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
+ (AT_CHECK): ... don't redefine this since this was the old way to
+ quell Valgrind.
+ * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
+ AT_BISON_CHECK invocations.
+ * tests/c++.at: Likewise.
+ * tests/calc.at: Likewise.
+ * tests/conflicts.at: Likewise.
+ * tests/cxx-type.at: Likewise.
+ * tests/existing.at: Likewise.
+ * tests/glr-regression.at: Likewise.
+ * tests/headers.at: Likewise.
+ * tests/input.at: Likewise.
+ * tests/java.at: Likewise.
+ * tests/output.at: Likewise.
+ * tests/push.at: Likewise.
+ * tests/reduce.at: Likewise.
+ * tests/regression.at: Likewise.
+ * tests/sets.at: Likewise.
+ * tests/skeletons.at: Likewise.
+ * tests/synclines.at: Likewise.
+ * tests/torture.at: Likewise.
+ (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
+ tends to hang xsltproc.
+ (Big horizontal): Likewise.
+
+2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ In XML output, remove redundant class attribute on symbol element.
+ * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
+ * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
+ look up a symbol to determine whether it's a nonterminal or terminal.
+ * src/gram.c (rule_rhs_print_xml): Remove class attribute.
+ * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
+
+ Add prec/assoc information to XML output.
+ * src/gram.c (grammar_rules_print_xml): For each rule that has a
+ %prec, add a percent_prec attribute.
+ * src/print-xml.c (print_grammar): For each terminal that has a
+ precedence or associativity, add a prec or assoc attribute.
+ (xml_indent): New.
+ (xml_puts): Use xml_indent.
+ (xml_printf): Use xml_indent.
+ * src/print-xml.h (xml_indent): Prototype.
+
+ * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
+ <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
+
+2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
+ (bison:ruleByNumber): ... this for clarity.
+ * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
+ * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
+ (xsl:template match="reduction"): Update.
+ (xsl:template match="item"): Update.
+ (xsl:template match="reduction"): Update.
+
+ In the XML output, don't print the list of rules where symbols appear.
+ Compute it in XSLT instead. Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
+ * data/xslt/bison.xsl (bison:ruleByLhs): New.
+ (bison:ruleByRhs): New.
+ * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
+ bison:ruleByRhs.
+ (xsl:template match="terminal/rule"): Remove.
+ (xsl:template match="nonterminal"): Use bison:ruleByLhs and
+ bison:ruleByRhs.
+ (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
+ Remove.
+ * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
+ bison:ruleByRhs and mode="number-link" for rule template.
+ (xsl:template match="terminal/rule"): Remove.
+ (xsl:template match="nonterminal"): Use bison:ruleByLhs and
+ bison:ruleByRhs and mode="number-link" for rule template.
+ (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
+ Rewrite as...
+ (xsl:template match="rule" mode="number-link"): ... this.
+ * src/print-xml.c (print_grammar): Don't print the list of rules.
+
+2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't let --report affect XML output; always print all information.
+ Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
+ * src/conflicts.c (log_resolution): Implement.
+ * src/print-xml.c (print_core): Implement.
+ (print_state): Implement.
+ (print_xml): Implement.
+
+ * NEWS (2.3a+): Fix quotes.
+ * src/parse-gram.y (prologue_declaration): For consistency with -v,
+ don't let %verbose clear the list specified by --report.
+
+2007-11-26 Akim Demaille <akim@epita.fr>
+
+ * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
+
+2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ In the XML output, list useless and unused symbols and rules with the
+ useful ones and add a "usefulness" attribute. Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
+ * src/gram.c (grammar_rules_partial_print_xml): Remove.
+ (grammar_rules_print_xml): Print all rules instead of just those
+ useful in the grammar, and add a "usefulness" attribute.
+ * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
+ * src/print-xml.c (print_rules_useless_in_parser): Remove.
+ (print_grammar): Print all nonterminals instead of just useful ones,
+ and add a "usefulness" attribute to nonterminals and terminals.
+ (print_xml): Don't print a separate "reductions" or
+ "rules-useless-in-parser" element.
+ * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
+ (reduce_xml): Remove.
+ (reduce_token_unused_in_grammar): New.
+ (reduce_nonterminal_useless_in_grammar): New.
+ * src/reduce.h (reduce_xml): Remove prototype.
+ (reduce_token_unused_in_grammar): Add prototype.
+ (reduce_nonterminal_useless_in_grammar): Add prototype.
+ * data/xslt/xml2text.xsl: Update for XML changes.
+ * data/xslt/xml2xhtml.xsl: Update for XML changes.
+ * tests/reduce.at (Useless Terminals): Update output.
+ (Useless Rules): Update output.
+ (Reduced Automaton): Update output.
+
+ Say "Terminals unused in grammar" instead of "Unused terminals".
+ * NEWS (2.3a+): Update.
+ * doc/bison.texinfo (Understanding): Update example output.
+ * src/reduce.c (reduce_output): Implement.
+ * data/xslt/xml2text.xsl: Implement.
+ * data/xslt/xml2xhtml.xsl: Implement.
+
+2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Accept --report-file=FILE to override the default `.output' filename.
+ * NEWS (2.3a+): Mention.
+ * doc/bison.texinfo (Bison Options): Add an entry.
+ * src/files.c (compute_output_file_names): Don't override
+ spec_verbose_file if already set.
+ * src/getargs.c (usage): Document --report-file.
+ (REPORT_FILE_OPTION): New anonymous enum member.
+ (long_options): Add entry for it.
+ (getargs): Add case for it setting spec_verbose_file.
+
+ * build-aux/cross-options.pl: Don't record a short option just because
+ there's an arg.
+ * doc/.cvsignore: Add yacc.1.
+
+2007-11-14 Akim Demaille <akim@epita.fr>
+
+ * doc/yacc.1.in: New.
+ * configure.ac, doc/Makefile.am: Adjust.
+ * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
+ config.h symbol.
+ Use AC_SUBST for assignments too.
+ * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
+
+2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/gram.c: Remove comments that duplicate comments in gram.h.
+
+ When reporting useless rules and nonterminals, say "useless in grammar"
+ instead of "useless", and say "useless in parser" instead of "never
+ reduced". Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
+ * NEWS (2.3a+): Mention this change.
+ * data/xslt/xml2text.xsl: Update output text and expected input XML
+ element names to match changes below.
+ * data/xslt/xml2xhtml.xsl: Likewise.
+ (xsl:template match="bison-xml-report"): Add missing entry in Table of
+ Contents: "Rules useless in parser due to conflicts".
+ * doc/bison.texinfo (Decl Summary): Reword a little.
+ (Understanding): Update example output for changes below.
+ * src/gram.c: (rule_useful_p): Rename to...
+ (rule_useful_in_grammar_p): ... this.
+ (rule_useless_p): Rename to...
+ (rule_useless_in_grammar_p): ... this.
+ (rule_never_reduced_p): Rename to...
+ (rule_useless_in_parser_p): ... this.
+ (grammar_rules_print): Update for renames.
+ (grammar_rules_print_xml): Update for renames.
+ (grammar_rules_never_reduced_report): Rename to...
+ (grammar_rules_useless_report): ... this since it is used for either
+ kind of useless rule.
+ * src/gram.h: Reword comments and update function names in prototypes.
+ * src/main.c (main): Say "rule useless in parser due to conflicts".
+ * src/print-xml.c (print_rules_never_reduced): Rename to...
+ (print_rules_useless_in_parser): ... this, and rename output XML
+ element "rules-never-reduced" to "rules-useless-in-parser".
+ (print_xml): Update for rename.
+ * src/print.c (print_results): Say "Rules useless in parser due to
+ conflicts".
+ * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
+ (nonterminals_reduce): Say "nonterminal useless in grammar".
+ (reduce_output): Say "Nonterminals useless in grammar".
+ Say "Rules useless in grammar".
+ (reduce_xml): Rename output XML element "useless" to
+ "useless-in-grammar".
+ (reduce_print): Don't report the count of grammatically useless rules
+ as "rules never reduced" just because %yacc is specified.
+ In the correct report of this count, say nonterminal(s) and rule(s)
+ "useless in grammar".
+ * tests/conflicts.at (S/R in initial): Update expected output.
+ (Defaulted Conflicted Reduction): Likewise.
+ (Unreachable States After Conflict Resolution): Likewise.
+ * tests/existing.at (GNU pic Grammar): Likewise.
+ * tests/reduce.at (Useless Nonterminals): Likewise.
+ (Useless Rules): Likewise.
+ (Reduced Automaton): Likewise.
+ (Underivable Rules): Likewise.
+ (Empty Language): Likewise.
+
+2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
+ here document and before the EOF so that BSD's implementation of Bourne
+ shell doesn't parse the delimiter as part of the here document.
+ * doc/.cvsignore: Add cross-options.texi.
+ * src/getargs.c (usage): Add a blank line after the warning categories.
+
+2007-11-08 Paolo Bonzini <bonzini@gnu.org>
+
+ * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
+
+2007-11-05 Akim Demaille <akim@epita.fr>
+
+ Remove Id: from bison.1.
+ * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
+ (perl -0777 -pi -e 's/\.PP\nId): New.
+ (.x.1): Use it to ignore the version control revision.
+
+2007-11-05 Akim Demaille <demaille@gostai.com>
+
+ * build-aux/Makefile.am: Ship cross-options.pl.
+ * doc/Makefile.am: Always refer to cross-options.texi with
+ $(srcdir).
+ (MAINTAINERCLEANFILES): Add it.
+
+2007-11-04 Akim Demaille <demaille@gostai.com>
+
+ Generate the long/short option cross-table.
+ * build-aux/cross-options.pl: New.
+ * doc/Makefile.am (cross-options.texi): New.
+ * doc/bison.texinfo: Use it.
+
+2007-11-04 Akim Demaille <demaille@gostai.com>
+
+ Generate bison.1 using help2man.
+ * doc/common.x, doc/bison.x: New.
+ * doc/Makefile.am (bison.1, .x.1): New.
+ The code is taken from autoconf-2.61/man/Makefile.am.
+ * configure.ac: Look for help2man.
+
+2007-11-04 Akim Demaille <demaille@gostai.com>
+
+ Complete --help.
+ * src/getargs.c (usage): Document -W, make it clear that -d,
+ -g and -x have optional arguments.
+
+2007-11-04 Akim Demaille <demaille@gostai.com>
+
+ Find sha1sum when named gsha1sum.
+ * bootstrap (find_tool): New.
+ ($SHA1SUM): New.
+
+2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Deprecate %pure-parser and add `%define api.pure'. Discussed starting
+ at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
+ * NEWS (2.3a+): Mention.
+ * data/bison.m4 (b4_pure_if): Don't define it here.
+ * data/c.m4 (b4_identification): Depend 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. Define
+ YYPURE, YYPUSH, and YYPULL accordingly.
+ * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
+ glr.cc has already defined b4_pure_flag.
+ * data/push.c: Define b4_pure_if based on `%define api.pure'.
+ Remove YYPUSH and YYPULL since they're back in b4_identification again.
+ * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
+ * doc/bison.texinfo (Pure Decl): Update.
+ (Push Decl): Update.
+ (Decl Summary): Add api.pure to %define entry.
+ In %pure-parser entry, say it's deprecated and reference %define.
+ (Pure Calling): Update.
+ (Error Reporting): Update.
+ (C++ Scanner Interface): Update.
+ (How Can I Reset the Parser): Update.
+ (Table of Symbols): In %pure-parser entry, say it's deprecated and
+ reference %define.
+ * src/getargs.c (pure_parser): Remove global variable.
+ * src/getargs.h (pure_parser): Remove extern.
+ * src/output.c (prepare): Don't define pure_flag muscle.
+ * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
+ wrapper around `%define api.pure'.
+ * tests/calc.at (Simple LALR Calculator): Update.
+ (Simple GLR Calculator): Update.
+ * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
+ Update.
+ (GLR: Resolve ambiguity, pure, locations): Update.
+ (GLR: Merge conflicting parses, pure, no locations): Update.
+ (GLR: Merge conflicting parses, pure, locations): Update.
+ * tests/glr-regression.at (Uninitialized location when reporting
+ ambiguity): Update
+ * tests/input.at (Unused %define api.pure): New test case.
+ * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
+ AT_PURE_IF and AT_PURE_AND_LOC_IF.
+ * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
+
+2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ %define push_pull -> %define api.push_pull. Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
+ * data/push.c: Expect the new name.
+ * data/yacc.c: Likewise.
+ * doc/bison.texinfo (Push Decl): Update.
+ (Decl Summary): Update %define entry.
+ (Push Parser Function): Update.
+ (Pull Parser Function): Update.
+ (Parser Create Function): Update.
+ (Parser Delete Function): Update.
+ * tests/calc.at (Simple LALR Calculator): Update.
+ * tests/input.at (%define enum variables): Update.
+ * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
+ (Push Parsing: Multiple impure instances): Update.
+ (Push Parsing: Unsupported Skeletons): Update.
+ * tests/torture.at (Exploding the Stack Size with Alloca): Update.
+ (Exploding the Stack Size with Malloc): Update.
+
+ * NEWS (2.3a+): Add an entry for the push parser, and clean up the
+ other entries some.
+
+2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ For the XML output's terminal element, rename @number to @token-number,
+ and add @symbol-number. In the nonterminal element, rename @number to
+ @symbol-number. Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
+ * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
+ renames.
+ (xsl:template match="nonterminal"): Likewise.
+ * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
+ (xsl:template match="nonterminal"): Likewise.
+ * src/print-xml.c (print_grammar): Implement.
+
+2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
+ 2007-10-11 change, the child elements here are items not rules.
+ (xsl:template match="item"): New.
+ (xsl:template match="rule"): Update for new reduced itemset.
+ (xsl:template match="point"): Remove.
+ (xsl:template match="empty"): For consistency with --graph, don't
+ output "/* empty */".
+ * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
+ line-wrap, don't pass a negative value as first-line-length since this
+ won't work with the following changes.
+ (xsl:template name="line-wrap"): Simplify slightly.
+ (xsl:template name="ws-search"): Eliminate recursion.
+ * src/print_graph.c (print_core): Don't print a reduction's lookahead
+ set next to an item whose dot is not at the end of the RHS even if it
+ happens to be associated with the same rule.
+
+2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Add %define lr.keep_unreachable_states.
+ * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
+ * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
+ * src/main.c (main): Implement it.
+ * tests/conflicts.at (Unreachable States After Conflict Resolution):
+ Extend to test it, and fix a typo.
+
+2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
+ * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
+ the example .output text.
+ * tests/regression.at (Extra lookahead sets in report): Improve wording
+ of comments.
+
+2007-10-17 Wojciech Polak <polak@gnu.org>
+
+ * src/print-xml.c (print_grammar): Renamed
+ <terminal> and <nonterminal> attributes:
+ "type" to "number" and "symbol" to "name".
+ * data/xslt/xml2text.xsl (xsl:template match="terminal"):
+ Use new attribute names.
+ (xsl:template match="nonterminal"): Likewise.
+ * data/xslt/xml2xhtml.xsl: Likewise.
+
+2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
+ (Option Cross Key): Likewise.
+
+ * src/print-xml.c (print_core): Don't print a reduction's lookahead set
+ next to an item whose dot is not at the end of the RHS even if it
+ happens to be associated with the same rule.
+ * src/print.c (print_core): Likewise.
+ * tests/conflicts.at (Unresolved SR Conflicts): Update output.
+ (Resolved SR Conflicts): Update output.
+ * tests/regression.at (Extra lookahead sets in report): New test case.
+
+2007-10-11 Wojciech Polak <polak@gnu.org>
+
+ * src/print-xml.c (print_core): Remove item set
+ redundancy.
+ * data/xslt/bison.xsl (bison:ruleNumber): New key.
+ Improve processing time. Suggested by Joel E. Denny.
+ * data/xslt/xml2dot.xsl (xsl:template name="escape"):
+ Write xsl:param "required" attribute as comment.
+ * data/xslt/xml2text.xsl (xsl:template match="item"): New.
+ (xsl:template match="rule"): Support new reduced itemset.
+ (xsl:template match="point"): Remove.
+ * data/xslt/xml2xhtml.xsl: Likewise.
+
+2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/getargs.c (version): Update copyright year.
+
+2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Make xml2dot.xsl and --graph produce the same output.
+ * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
+ instead of a `\n'. That is, don't add escapes yet or they'll be doubly
+ escaped later.
+ (xsl:template name="output-node"): Use the new escape template instead
+ of the string-replace template directly.
+ (xsl:template name="output-edge"): Likewise.
+ (xsl:template name="escape"): New, escapes backslashes and newlines in
+ addition to quotation marks.
+ * src/graphviz.c (start_graph, output_node, output_edge): Add
+ whitespace to output for legibility.
+
+ Make xml2text.xsl and --report produce the same output, and remove the
+ XML "conflicts" element since a conflict summary is easily extracted
+ from the automaton.
+ * data/xslt/bison.xsl: New.
+ (xsl:template match="state" mode="bison:count-conflicts): New.
+ * data/xslt/xml2text.xsl: Import bison.xsl.
+ (xsl:template match="bison-xml-report"): Instead of styling the
+ "conflicts" element, style the "automaton" element with mode
+ "conflicts". Unlike the former, the latter lists S/R and R/R
+ conflicts for a state on the same line.
+ (xsl:template match="conflicts"): Remove.
+ (xsl:template match="conflict"): Remove.
+ (xsl:template match="terminal"): Line-wrap the list of rules in which
+ the terminal is used.
+ (xsl:template match="nonterminal"): Likewise for nonterminals.
+ (xsl:template match="automaton" mode="conflicts"): New.
+ (xsl:template match="state" mode="conflicts"): New.
+ (xsl:template name="line-wrap"): New.
+ (xsl:template name="ws-search"): New.
+ * data/xslt/xml2xhtml.xsl: Import bison.xsl.
+ (xsl:template match="bison-xml-report"): Instead of styling the
+ "conflicts" element, style the "automaton" element with mode
+ "conflicts."
+ (xsl:template match="conflicts"): Remove.
+ (xsl:template match="conflict"): Remove.
+ (xsl:template match="automaton" mode="conflicts"): New.
+ (xsl:template match="state" mode="conflicts): New.
+ * src/conflicts.c (conflicts_output_xml): Remove.
+ * src/conflicts.h (conflicts_output_xml): Remove prototype.
+ * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
+ * src/print.c (print_grammar): Consistently wrap at the 66th column so
+ the corresponding XSLT is easier. Also, never wrap between a word and
+ the comma that follows it.
+
+2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Improve C++ namespace support. Discussed starting at
+ <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
+ * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
+ b4_namespace_close): New macros that interpret the %define variable
+ "namespace" so its value can contain "::" to indicate nested
+ namespaces.
+ * data/glr.cc (b4_namespace): Don't define, and replace all uses with
+ the above macros.
+ * data/lalr1.cc (b4_namespace): Likewise.
+ * data/location.cc (b4_namespace): Likewise.
+ * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
+ inside a new table in the general %define entry. Document `%define
+ namespace' there as well. Point the %name-prefix entry to it since it
+ explains it more completely in the case of C++.
+ (C++ Bison Interface): Mention `%define namespace' instead of
+ %name-prefix.
+ (Table of Symbols): Remove the `%define push_pull' entry. The %define
+ entry suffices.
+ * tests/c++.at (Relative namespace references): New test case.
+ (Absolute namespace references): New test case.
+ (Syntactically invalid namespace references): New test case.
+ * tests/input.at (C++ namespace reference errors): New test case.
+
+2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Add syncline support and location accessor to internal %define
+ interfaces.
+ * data/bison.m4 (b4_percent_define_get_loc): New.
+ (b4_percent_define_get_syncline): New.
+ (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
+ (b4_percent_define_default): Record defining location as line 1 rather
+ than 0 for the sake of synchronizing #line's, and define
+ b4_percent_define_syncline(VARIABLE).
+ (b4_percent_define_check_values): Use b4_percent_define_get_loc.
+ * src/muscle_tab.c (muscle_syncline_grow): New.
+ (muscle_code_grow): Use muscle_syncline_grow.
+ (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
+ define b4_percent_define_syncline(VARIABLE).
+ (muscle_percent_define_get_loc): New.
+ (muscle_percent_define_get_syncline): New.
+ (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
+ remove some unused variables.
+ (muscle_percent_define_default): Record defining location as line 1
+ rather than 0 for the sake of synchronizing #line's, and define
+ b4_percent_define_syncline(VARIABLE).
+ (muscle_percent_define_check_values): Use
+ muscle_percent_define_get_loc.
+ * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
+ (muscle_percent_define_get_syncline): Prototype.
+ * tests/skeletons.at (%define Boolean variables: invalid skeleton
+ defaults): Update output for location change.
+ (Complaining during macro argument expansion): Extend to test
+ b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
+
+2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix some error-reporting macro bugs.
+ * data/bison.m4 (b4_cat): New.
+ (b4_error, b4_error_at): Use b4_cat to send error directives directly
+ to stdout so they don't become arguments to other macros. Update
+ comments and add examples.
+ (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
+ add examples.
+ (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
+ after printing the error directive so that M4 doesn't report subsequent
+ problems that are induced by this problem.
+ * src/scan-skel.l: Recognize @` digraph outside of directive arguments
+ instead of just in them. Recognize @\n in both places. Both expand to
+ the empty string. Needed by b4_cat.
+ * tests/skeletons.at (Complaining during macro argument expansion):
+ New test case.
+ (Fatal errors make M4 exit immediately): New test case.
+
+2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Implement --print-datadir.
+ * src/getargs.c (usage): Mention.
+ (PRINT_DATADIR_OPTION): New anonymous enum member.
+ (long_options): Add entry for it.
+ (getargs): Add case for it calling compute_pkgdatadir.
+ * src/output.c (output_skeleton): Encapsulate data directory
+ computation from here...
+ (prepare): ... and from here...
+ (compute_pkgdatadir): ... into this new function.
+ * src/output.h (compute_pkgdatadir): Prototype.
+
+2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/print-xml.c (escape_bufs): New static global variable
+ replacing...
+ (xml_escape_n): ... the static local variable buf here.
+ (print_xml): Free memory for escape_bufs.
+ * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
+
+2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Replace `%push-parser' and `%push-pull-parser' with
+ `%define push_pull "push"' and `%define push_pull "both"'.
+ `%define push_pull "pull"' is the default.
+ * doc/bison.texinfo (Push Decl, Push Parser Function,
+ Pull Parser Function, Parser Create Function, Parser Delete Function):
+ Update declarations.
+ (Decl Summary, Table of Symbols): Replace %push-parser and
+ %push-pull-parser entries with a %define push_pull entry.
+ * data/bison.m4 (b4_percent_define_check_values): New macro.
+ (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
+ definitions...
+ * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
+ definitions...
+ * data/push.c: ... to here and compute them from the value of the
+ %define variable push_pull.
+ * data/c-skel.m4: Instead of choosing the push.c skeleton for push
+ parsing requests here...
+ * data/yacc.c: ... hack this to switch to push.c any time
+ b4_use_push_pull_flag or the %define variable push_pull is set. This
+ will go away when we mv push.c yacc.c.
+ * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
+ push parsing is not supported since unused %define variables are
+ reported anyway.
+ * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
+ * src/muscle_tab.h (muscle_percent_define_check_values): Update
+ comments for consistency with b4_percent_define_check_values.
+ * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
+ muscles.
+ * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
+ Remove.
+ (prologue_declaration): Remove %push-parser and %push-pull-parser
+ rules.
+ * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
+ * tests/calc.at: Update declarations.
+ * tests/input.at (%define enum variables): New test case.
+ * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
+ declaration.
+ (Push Parsing: Multiple impure instances): Update declaration.
+ (Push Parsing: Unsupported Skeletons): New test case.
+ * tests/torture.at (Exploding the Stack Size with Alloca): Update
+ declaration.
+ (Exploding the Stack Size with Malloc): Update declaration.
+
+2007-09-24 Wojciech Polak <polak@gnu.org>
+
+ Add XSLT transformations.
+
+ * data/xslt/xml2dot.xsl: Transform XML into DOT.
+ * data/xslt/xml2text.xsl: Transform XML into plain text.
+ * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
+ * data/Makefile.am (xsltdir): New variable.
+ (dist_xslt_DATA): Add xslt/*.xsl files.
+
+2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
+ Problem reported by Wojciech Polak.
+ * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
+ (xml_printf): Undo change I made on 21 September; that is,
+ indent 2 spaces, not 1.
+
+2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Pacify ./configure --enable-gcc-warnings.
+ * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
+ `char const *' instead of `char *'.
+ * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
+ local variable `sep'.
+
+2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
+ elsewhere.
+ * src/print-xml.c: Prefer "const" after types; that's more consistent.
+ (xml_printf): Indent just 1 space for level.
+ (e_char, xlate_char): Remove.
+ (xml_escape_string): Rewrite to avoid undefined behavior (used
+ storage that was freed from the stack).
+ (xml_escape_n): Don't bother checking for subscript error.
+
+2007-09-21 Wojciech Polak <polak@gnu.org>
+
+ Add Bison XML Automaton Report.
+
+ Add support for an -x option to generate an XML report.
+ It is not documented yet.
+ * src/print-xml.c: New file.
+ * src/print-xml.h: Likewise.
+ * lib/timevar.def (TV_XML): New var.
+ * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
+ * src/conflicts.c: Include print-xml.h.
+ (solved_conflicts_xml_obstack): New var.
+ (log_resolution, conflicts_solve, conflicts_free):
+ Add support for XML report.
+ (conflicts_output_val): New function.
+ * src/conflicts.h (conflicts_output_val): New decl.
+ * src/files.c (spec_xml_file): New var.
+ (compute_output_file_names, output_file_names_free): Add XML support.
+ * src/files.h (spec_xml_file): New decl.
+ * src/getargs.c (xml_flag): New var.
+ (usage, short_options, long_options, getargs): Add XML support.
+ * src/getargs.h (xml_flag): New decl.
+ * src/gram.c: Include print-xml.h.
+ (rule_lhs_print_xml, rule_rhs_print_xml):
+ (grammar_rules_partial_print_xml, grammar_rules_print_xml):
+ New functions.
+ * src/gram.h: Declare external ones.
+ * src/main.c: Include print-xml.h.
+ (main): Add XML support.
+ * src/reduce.c: Include print-xml.h.
+ (reduce_xml): New function.
+ * src/reduce.h: Declare it.
+ * src/state.c: Include print-xml.h.
+ (state_new): Add XML support.
+ (state_rule_lookahead_tokens_print_xml): New function.
+ * src/state.h: Declare it.
+ (struct state): New member solved_conflicts_xml.
+ * src/symtab.c (symbol_class_get_string): New function.
+ * src/symtab.h: Declare it.
+
+2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * GNUmakefile: Switch to coreutils's version.
+ * bootstrap: Likewise.
+ * Makefile.cfg: Adjust to new GNUmakefile.
+ * README-hacking: Likewise.
+
+ Import from gnulib:
+
+ 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
+ Bruno Haible <bruno@clisp.org>
+
+ * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
+ and is a script that invokes bison. Tighten the code. Add comments.
+
+2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Spell "boolean" as "Boolean". Reported by Akim Demaille.
+ * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
+ * doc/bison.texinfo (Decl Summary): Fix.
+ * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
+ * tests/input.at (Boolean %define variables): Update output.
+ * tests/skeletons.at (%define boolean variables: invalid skeleton
+ defaults): Rename to...
+ (%define Boolean variables: invalid skeleton defaults): ... this and
+ update output.
+
+2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ In impure push mode, don't allow more than one yypstate to be allocated
+ since multiple impure parsers would corrupt yynerrs.
+ * data/push.c (yypstate_allocated): New static global variable
+ initialized to 0.
+ (yypull_parse): If yypstate_new returns 0, don't report it as memory
+ exhaustion if yypstate_allocated is 1, but still return 2.
+ (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
+ already 1. Otherwise, set it to 1.
+ (yypstate_delete): Set it to 0.
+ * tests/push.at (Push Parsing: Multiple impure instances): New test
+ case.
+
+2007-08-17 Bob Rossi <bob@brasko.net>
+
+ * doc/bison.texinfo (Push Decl): Document the push parser.
+ (Table of Symbols): Ditto.
+ (Pure Decl): Ditto.
+ (Decl Summary): Ditto.
+ (Multiple Parsers, Push Parser Function, Pull Parser Function,
+ Parser Create Function, Parser Delete Function):
+ Add new push parser symbols.
+ (Table of Symbols): Document push-parser, push-pull-parser,
+ yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
+
+2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ Update to GPLv3.
+ * doc/gpl-3.0.texi: New file.
+ * doc/gpl.texi: Remove.
+ * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
+ * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
+ * README-hacking, TODO, bootstrap, bootstrap.conf:
+ * configure.ac, data/Makefile.am, data/README, data/bison.m4:
+ * data/c++-skel.m4, data/c++.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/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
+ * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
+ * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
+ * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
+ * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
+ * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
+ * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
+ * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
+ * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
+ * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
+ * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
+ * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
+ * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
+ * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
+ * lib/timevar.c, lib/timevar.def, lib/timevar.h:
+ * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
+ * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
+ * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
+ * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
+ * src/complain.c, src/complain.h, src/conflicts.c:
+ * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
+ * src/files.h, src/flex-scanner.h, src/getargs.c:
+ * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
+ * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
+ * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
+ * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
+ * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
+ * src/print.c, src/print.h, src/print_graph.c:
+ * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
+ * src/reduce.h, src/relation.c, src/relation.h:
+ * src/revision.h, src/scan-code.h, src/scan-code.l:
+ * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
+ * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
+ * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
+ * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
+ * tests/Makefile.am, tests/actions.at, tests/c++.at:
+ * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
+ * tests/existing.at, tests/glr-regression.at:
+ * tests/headers.at, tests/input.at, tests/java.at:
+ * tests/local.at, tests/output.at, tests/push.at:
+ * tests/reduce.at, tests/regression.at, tests/sets.at:
+ * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
+ * tests/torture.at:
+ Update to GPLv3.
+
+2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Get rid of broken %no-parser, -n, and --no-parser implementation and
+ documentation.
+ * TODO: Don't mention them.
+ * doc/bison.1: Likewise.
+ * doc/bison.texinfo (Decl Summary): Likewise.
+ (Bison Options): Likewise.
+ (Option Cross Key): Likewise.
+ * src/getargs.c (no_parser_flag): Remove global variable.
+ (usage): Don't print description of -n and --no-parser.
+ (long_options): Remove --no-parser entry here.
+ (getargs): Remove -n case in the switch here.
+ * src/getargs.h (no_parser_flag): Remove extern.
+ * tests/regression.at (Web2c Actions): Remove comment that mentions
+ --no-parser.
+
+2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
+ name user variables starting with `yy'. Just pass NULL instead of a
+ dummy local &yylval to yypush_parse.
+ * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
+ starting with `yy'.
+
+2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
+ true since it's then always used regardless of whether yyoverflow is
+ defined. Reported by Christian Burger at
+ <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
+ * THANKS: Add Christian Burger.
+
+ * ChangeLog: For changes in doc/bison.texinfo, consistently reference
+ node names: say "Decl Summary" not "Bison Declaration Summary".
+
+2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
+ determine whether this function has already complained about an invalid
+ value for a %define boolean variable, don't check whether Bison has
+ ever examined the value. As written, the check was a tautology.
+ Instead, record and check for this complaint using a separate muscle.
+
+2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix push parsing memory leak reported by Brandon Lucia at
+ <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
+ * THANKS: Add Brandon Lucia.
+ * data/push.c (yypstate_delete): Free the stack if it was reallocated
+ but the parse never completed and thus freed it.
+ * tests/Makefile.am (TESTSUITE_AT): Add push.at.
+ * tests/testsuite.at: Include push.at.
+ * test/push.at: New.
+ (Push Parsing: Memory Leak for Early Deletion): New test case.
+
+2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Improve handling of multiple S/R conflicts in the same state and of S/R
+ conflicts involving multiple reductions.
+ * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
+ set for a state here or Bison will abort if it is reassigned on a
+ later conflicted reduction in the same state.
+ Similarly, don't finalize and assign the solved conflicts report here
+ or it will be lost if it is reassigned on a later conflicted reduction
+ in the same state.
+ (set_conflicts): Instead, assign them both here after all S/R conflicts
+ in the state have been fully examined.
+ * src/print.c (shift_set): Rename to...
+ (no_reduce_set): ... this.
+ (print_reductions): Update for rename, and add %nonassoc error action
+ tokens to no_reduce_set so that, when printing the first remaining
+ reduction on an error action token, the reduction is enclosed in
+ brackets.
+ (print_results): Update for rename.
+ * tests/conflicts.at (Solved conflicts report for multiple reductions
+ in a state): New test case.
+ (%nonassoc error actions for multiple reductions in a state): New test
+ case.
+
+ * src/main.c (main): Don't depend on C99 features.
+
+2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * build-aux/.cvsignore: Add compile.
+ * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
+ uniwidth.
+
+2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * bootstrap (slurp): Create target directories that don't exist.
+ Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
+
+2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * LR0.c (new_itemsets): Fix wording in comments: say item index rather
+ than item number.
+ * closure.c (closure): Likewise.
+ * state.h (reductions): Comment sorting of rules.
+ (state): Comment sorting of items.
+
+2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix C++ test cases after recent Gnulib changes. Discussed starting at
+ <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
+ * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
+ definition in order to avoid Gnulib headers since we don't use config.h
+ here.
+ * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
+ rather than AT_DATA so that config.h is included.
+
+2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
+ instead of fprintf. Guard these functions with #if YYDEBUG instead of
+ #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
+ and so that YYFPRINTF is guaranteed to be defined here.
+
+2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
+ with...
+ (muscle_percent_define_check_values): ... this more helpful function.
+ Again, it's not used yet, but it will be.
+ * src/muscle_tab.h: Likewise.
+
+ Improve some comments in parser table construction.
+ * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
+ (generate_states): Don't mention ruleset, which is internal to closure.
+ * src/closure.c (closure): Explain sorting of core and itemset, which
+ is required for this function to behave correctly.
+ * src/closure.h (closure): Mention sorting.
+
+2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/lalr.c (state_lookahead_tokens_count): For code readability,
+ move the check for disabled transitions to an aver since conflict
+ resolution hasn't happened yet.
+
+ * src/lalr.c (state_lookahead_tokens_count): Remove the check that
+ labels a state as inconsistent just because it has error transitions.
+ The original form of this check appeared in revision 1.1 of lalr.c,
+ which was committed on 1991-12-21. Now (at least), changing the
+ consistency label on such a state appears to have no useful effect in
+ any of the places it is examined, which I enumerate below. The key
+ point to understanding each item in this enumeration is that a state
+ with an error transition is labelled consistent in the first place only
+ if it has no rules, so the check cannot matter for states that have
+ rules. (1) Labelling a state as inconsistent will cause set_conflicts
+ to try to identify its conflicts, and a state must have *rules* to have
+ conflicts. (2) Labelling a state as inconsistent will affect how
+ action_row sets the default *rule* for the state. (3) Labelling a
+ state as inconsistent will cause build_relations to add lookback edges
+ to *rules* in that state.
+ * src/state.h (struct state): Word the comment for member consistent
+ more carefully.
+
+2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't depend on C99 features.
+ * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
+ * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
+ * src/reader.c (check_and_convert_grammar): Fix for-loop.
+ * src/state.c (state_mark_reachable_states): Fix for-loop.
+ (state_remove_unreachable_states): Fix for-loop.
+
+ Don't widen struct state with member reachable just to temporarily
+ record reachability. Instead, use a local bitset.
+ * src/state.h (struct state): Remove member.
+ * src/state.c (state_new): Don't initialize it.
+ (state_mark_reachable_states): Rename to...
+ (state_record_reachable_states): ... this, and use bitset.
+ (state_remove_unreachable_states): Use bitset.
+
+2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/Makefile.am (yacc): Quote target action commands properly so
+ that the yacc script isn't corrupt. Reported by Hans Aberg at
+ <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
+
+ * data/glr.c (yylval): As in yacc.c, don't extern in the header for
+ the case of pure parsers. Reported by Frans Englich at
+ <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
+ * THANKS: Add Frans Englich.
+
+ * NEWS (2.3a+): In the %code entry, reference section `Bison
+ Declaration Summary' from the manual now since the %code summary has
+ moved there.
+ * doc/bison.texinfo (Prologue Alternatives): Mention that directives
+ in the rules section must be terminated by semicolons.
+
+2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Extend the front-end API for %define variables to more completely
+ mirror the back-end. This will be useful in the future.
+ * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
+ Update comments to mention the new front-end counterparts of these
+ macros.
+ * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
+ for muscle_string_decode and muscle_location_decode.
+ (muscle_string_decode): New static function.
+ (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
+ (muscle_percent_define_get, muscle_percent_define_ifdef): New
+ functions.
+ (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
+ muscle_percent_define_get to mimic the b4_percent_define_flag_if
+ implementation more closely.
+ (muscle_percent_define_invalid_value): New function.
+ * src/muscle_tab.h (muscle_percent_define_get,
+ muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
+ Prototype.
+
+2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS (2.3a+): Mention yesterday's state-removal change.
+ (2.3a): Remove the %language entry, which was added after 2.3a.
+ * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
+ src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
+ src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
+ tests/existing.at: Update copyright date.
+
+2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ If conflict resolution makes states unreachable, remove those states,
+ report rules that are then unused, and don't report conflicts in those
+ states.
+ * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
+ New global function.
+ * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
+ function.
+ * src/main.c (main): After conflict resolution, remove the unreachable
+ states and update all data structures that reference states by number.
+ * src/state.c (state_new): Initialize each state's reachable member to
+ false.
+ (state_mark_reachable_states): New static function.
+ (state_remove_unreachable_states): New global function.
+ * src/state.h (struct state): Add member bool reachable.
+ (state_remove_unreachable_states): Prototype.
+ * tests/conflicts.at (Unreachable States After Conflict Resolution):
+ New test case.
+ * tests/existing.at (GNU pic Grammar): Update test case output now that
+ an unused rule is discovered.
+
+2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Minor code cleanup in parser table construction.
+ * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
+ (new_itemsets, save_reductions): Update for rename to nitemset.
+ * src/closure.c (nritemset): Rename to...
+ (nitemset): ... this since the "r" appears to meaningless and isn't
+ used in the comments.
+ (closure): Update for rename.
+ * src/closure.h (nritemset): Update extern to...
+ (nitemset): ... this.
+ * src/lalr.c (LA): Fix a typo in comments.
+ * src/print.c (print_core): Update for rename to nitemset.
+ * src/print_graph.c (print_graph): Likewise.
+ * src/state.h: Fix some typos in header comments.
+
+2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
+ still sticks to ASCII. Sorry!
+
+ * README-hacking: New file, taken mostly from coreutils, with changes
+ for Bison. Contains much of the contents of:
+ * README-cvs: Remove.
+ * bootstrap: Sync from gnulib.
+ * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
+ * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
+
+2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
+ Setzer.
+ (Java Differences): Fix some typos.
+ * THANKS: Add Sebastian Setzer.
+
+2007-03-07 Paolo Bonzini <bonzini@gnu.org>
+
+ * data/java.m4 (b4_single_class_if): Remove.
+ (b4_abstract_if): Look at "%define abstract".
+ (b4_lexer_if): New.
+ (b4_union_name): Rename...
+ (b4_yystype): ... to this. Map to "%define stype".
+ (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
+ b4_maybe_throws): Fix quoting.
+ (b4_lex_param_call): Move below to keep b4_*_param_decl close.
+ * data/lalr1.java (Lexer interface): Always define.
+ (Lexer interface within parser class): Remove.
+ (YYLexer class): New, used when "%code lexer" is present.
+ (constructor): When "%code lexer" is used, pass %lex-param
+ to the lexer constructor.
+ (yylex, yyparse): Remove %lex-param from method invocations
+ (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
+
+ * doc/bison.texinfo (Java Bison Interface): Mention "%define
+ abstract". Rename "%define union_name" to "%define stype".
+ Rename method names according to previous patch.
+ (Java Scanner Interface): Describe "%code lexer" instead of
+ "%pure-parser" and "%define single_class".
+ (Java Differences): Mention "%code lexer".
+
+ * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
+ Include scanner here, using macros from tests/local.at.
+ (AT_DATA_CALC_Y): Remove final argument.
+ (_AT_CHECK_JAVA_CALC): Likewise.
+ (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
+ of %locations and %error-verbose.
+ (main): Test with and without %lex-param.
+ * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
+ (AT_BISON_OPTION_POPDEFS): Pop it.
+
+2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ DJGPP spefic issue. Inhibit the use of disallowed characters for
+ file name genertion on Win98, WinXP, etc. These are |<>":?*\
+ and concern testsuite case 46.
+ * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
+ * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
+ * djgpp/config.bat: Inhibit the use of disallowed characters.
+
+2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Miscellaneous %define and %code cleanup.
+ * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
+ values are interpreted.
+ * doc/bison.texinfo (Decl Summary): Clean up and extend %define
+ documentation a little more.
+ * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
+ muscle_percent_define_insert, muscle_percent_code_grow): New
+ functions/macros.
+ * src/muscle_tab.h (muscle_percent_define_insert,
+ muscle_percent_code_grow): Prototype.
+ * src/parse-gram.y (prologue_declaration): Use
+ muscle_percent_define_insert and muscle_percent_code_grow when parsing
+ %define and %code directives.
+
+ Make it easy to share %define boolean variables between the front-end
+ and back-end. Though not used yet, this will be useful in the future.
+ * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
+ Bison uses of names rather than just skeleton uses of names.
+ (b4_percent_define_get, b4_percent_define_ifdef): Rename
+ b4_percent_define_skeleton_variables(VARIABLE) to
+ b4_percent_define_bison_variables(VARIABLE).
+ (b4_percent_code_get, b4_percent_code_ifdef): Rename
+ b4_percent_code_skeleton_qualifiers(QUALIFIER) to
+ b4_percent_code_bison_qualifiers(QUALIFIER).
+ (b4_check_user_names_wrap): Update for renames.
+ * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
+ muscle_percent_define_default): New functions mimicking
+ b4_percent_define_flag_if and b4_percent_define_default.
+
+ For %define variables, report locations for invalid values and
+ redefinitions.
+ * data/bison.m4 (b4_percent_define_flag_if): Read
+ b4_percent_define_loc(VARIABLE) to report the location of an invalid
+ value for VARIABLE.
+ (b4_percent_define_default): Save a special location in
+ b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
+ must later be reported as invalid.
+ * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
+ functions.
+ (muscle_percent_define_insert): Record the location of VARIABLE in
+ muscle percent_define_loc(VARIABLE), and use it to report the previous
+ location for a redefinition.
+ (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
+ (muscle_percent_define_default): Update like b4_percent_define_default.
+ (muscle_grow_user_name_list): Rename to...
+ (muscle_user_name_list_grow): ... this for consistency and use
+ muscle_location_grow.
+ * src/muscle_tab.h (muscle_location_grow): Prototype.
+ * tests/input.at (%define errors): Update expected output.
+ * tests/skeletons.at (%define boolean variables: invalid skeleton
+ defaults): New test case.
+
+2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/print.c (lookahead_set, state_default_rule): Remove.
+ (print_reductions): Replace state_default_rule invocation with
+ equivalent use of yydefact, which was computed in token_actions in
+ tables.c.
+ (print_results): Don't allocate lookahead_set.
+
+2007-02-27 Paolo Bonzini <bonzini@gnu.org>
+
+ * data/lalr1.java: Prefix all private members with yy.
+
+2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Use YYFPRINTF instead of fprintf where appropriate. Reported by
+ Sebastien Fricker at
+ <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
+ * THANKS: Add Sebastien Fricker.
+ * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
+ * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
+ accept a variable number of arguments.
+
+2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
+
+2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
+ * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
+ * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
+
+2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ Undo my 2007-02-07 change, switching back to the c-strcase module
+ introduced in the 2007-02-03 change. Bruno Haible reported that
+ the 2007-02-07 change would be dangerous in Turkish if we add a
+ language whose name contains "i", since "i" is not lowercase "I"
+ in Turkish.
+ * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
+ * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
+ c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
+ * m4/.cvsignore: Remove strcase.m4.
+ * src/getargs.c: Revert 2007-02-07 change, as follows.
+ Include c-strcase.h.
+ (language_argmatch): Use c_strcasecmp rather than strcasecmp.
+
+2007-02-11 Bruno Haible <bruno@clisp.org>
+
+ Enable the Java related testsuite tests when the only Java compiler
+ found is a gcj < 4.3. Discussed at
+ <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
+ * configure.ac (gt_JAVACOMP): Don't specify a target_version.
+
+2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/Makefile.am: Update copyright date.
+ * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
+ yypstate_new returns NULL.
+ (yypstate_new): Return NULL if malloc does.
+ * src/reader.c (packgram): Move translation of rule actions from the
+ beginning of packgram to...
+ (check_and_convert_grammar): ... here right before packgram is invoked
+ so it's easier to write more complete comments, and remove redundant
+ code.
+
+2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ As in semantic actions, make @$ in %initial-action, %destructor, and
+ %printer imply %locations.
+ * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
+ scanning @$.
+ * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
+ (@$ in %initial-action implies %locations,
+ @$ in %destructor implies %locations,
+ @$ in %printer implies %locations): ... these new test cases.
+
+2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ Undo most of the 2007-02-03 change, switching to the strcase module
+ now that gnulib strcase has been fixed.
+ * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
+ * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
+ c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
+ * m4/.cvsignore: Add strcase.m4.
+ * src/getargs.c: Revert 2007-02-03 change, as follows.
+ Don't include c-strcase.h.
+ (language_argmatch): Use strcasecmp rather than c_strcasecmp.
+ strcasecmp has "unspecified behavior" outside the POSIX locale,
+ but it works fine in practice if at least one argument is ASCII,
+ as is the case in Bison.
+
+2007-02-07 Paolo Bonzini <bonzini@gnu.org>
+
+ * tests/java.at: Skip tests if only one of javac/java is present.
+ Reported by Joel E. Denny.
+ * tests/atlocal.in: Adjust copyright years.
+
+2007-02-05 Paolo Bonzini <bonzini@gnu.org>
+
+ * data/lalr1.java (Stack): Work around old verifiers that disallow
+ access to the private fields of an inner class, from the outer class.
+ We can make Stack's fields public because user code doesn't have access
+ to the instance of Stack used by parse(). Reported by Paul Eggert.
+
+2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
+ the right spot for these files?
+ * bootstrap.conf (gnulib_modules): Add c-strcase.
+ * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
+ c-strncasecmp.c.
+ * src/getargs.c: Include c-strcase.h.
+ (language_argmatch): Use c_strcasecmp rather than strcasecmp,
+ to avoid unspecified behavior.
+
+2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * doc/bison.texinfo (Decl Summary): Correct typo.
+
+2007-01-30 Paolo Bonzini <bonzini@gnu.org>
+
+ * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
+ Complain if the value does not match empty, "true" or "false".
+ * data/c++.m4: Adjust default definitions of %define variables.
+ * data/java.m4: Adjust default definitions of %define variables.
+ * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
+ to above behavior.
+ * tests/input.at (Boolean %define variables): Test new behavior.
+
+2007-01-29 Paolo Bonzini <bonzini@gnu.org>
+
+ * NEWS: Mention java.
+ * TODO: Remove things that are done.
+ * bootstrap.conf: Add javacomp-script and javaexec-script.
+ * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
+
+ * data/Makefile.am: Add new files.
+ * data/java-skel.m4: New.
+ * data/java.m4: New.
+ * data/lalr1.java: New.
+
+ * doc/bison.texinfo: Put "A Complete C++ Example" under
+ C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
+ under Other Languages.
+
+ * src/getargs.c (valid_languages): Add Java.
+ * src/getargs.h (struct bison_language): Update size of string fields.
+
+ * tests/Makefile.am: Add java.at.
+ * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
+ * tests/java.at: New.
+ * tests/testsuite.at: Include it.
+
+2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Clean up.
+ * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
+ at_directive_argv arguments so these no longer have to be global
+ variables. Also, update the implementation for the following changes.
+ (fail_for_at_directive_too_many_args,
+ fail_for_at_directive_too_few_args): Add at_directive_name argument.
+ (at_directive_name): Remove as at_directive_argv[0] will be used for
+ this now.
+ (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
+ for the directive name.
+ (at_directive_argc, at_directive_argv): Make these local within
+ skel_lex instead of global.
+ (INITIAL): Update directive start action for above changes.
+ (SC_AT_DIRECTIVE_ARG): Rename to...
+ (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
+ (SC_AT_DIRECTIVE_SKIP_WS): Update.
+ (scan_skel): Move yylex_destroy to...
+ (skel_scanner_free): ... here.
+ * tests/skeletons.at (installed skeleton file name): Rename to...
+ (installed skeleton file names): ... this.
+
+2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * ChangeLog: For changes in doc/bison.texinfo, consistently reference
+ node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
+ Summary" not "Directives".
+ * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
+ %code entry in "Decl Summary" rather than the one in "Table of Symbols"
+ since the former is now the more complete one.
+ (Prologue Alternatives): Likewise and do the same for %defines.
+ (Table of Symbols): Add summary of %code, add summary of %define, and
+ move full %code documentation to...
+ (Decl Summary): ... here for consistency with other entries in these
+ sections.
+ Move %define entry in order to keep this list alphabetized.
+ Reword %define entry a little to put less emphasis on the skeleton
+ concept, which most users shouldn't have to think about.
+
+2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ Adjust to recent gnulib changes.
+ * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
+ Add string.h, string_.h, unistd_.h, wchar_.h.
+ * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
+ * src/system.h: Don't include <stpcpy.h>; this is now done by
+ <string.h>.
+
+2007-01-23 Paolo Bonzini <bonzini@gnu.org>
+
+ Simplify implementation of unqualified %code, implement macros for
+ uniform treatment of boolean %define flags. Document %define.
+ * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
+ b4_percent_code_ifdef): New.
+ (b4_percent_code_get): Map unqualified %code to b4_percent_code().
+ * data/c++.m4: Define default value for global_tokens_and_yystype.
+ * data/glr.cc: Likewise.
+ * data/location.cc: Use b4_percent_define_flag_if.
+
+ * doc/bison.texinfo (Decl Summary): Document %define.
+
+ * src/parse-gram.y (Unqualified %code): Change muscle name to
+ b4_percent_code().
+ (content.opt): Default to empty.
+
+2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Implement support for relative and absolute skeleton file names.
+ Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
+ * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
+ (Bison Options): Document in --skeleton entry.
+ * src/output.c (output_skeleton): Use strncpy rather than strcpy since
+ full_skeleton can't necessarily hold all of pkgdatadir.
+ If the specified skeleton file name contains a `/', don't prepend
+ pkgdatadir.
+ * src/parse-gram.y (prologue_declaration): If the specified skeleton
+ file name contains a `/', prepend the grammar file directory.
+ * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
+ * skeletons.at: New file.
+ (relative skeleton file names): New test case.
+ (installed skeleton file names): New test case.
+ * tests/testsuite.at: Include skeletons.at.
+
+ * bootstrap: Update copyright to 2007.
+
+2007-01-17 Paolo Bonzini <bonzini@gnu.org>
+
+ * bootstrap: Remove occurrences of .#bootmp from the files.
+
+2007-01-17 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Calc++ Parser): Don't try to alias
+ nonterminals.
+ Use per-type %printer.
+
+2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
+ data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
+ djgpp/config.site, src/files.c, src/files.h, src/main.c,
+ src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
+ src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
+ tests/glr-regression.at, tests/input.at, tests/local.at,
+ tests/output.at, tests/torture.at: Update copyright to 2007.
+
+2007-01-16 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
+ error code.
+ (Calc++ Scanner): Exit with failure if we can't open the input
+ file.
+ Accept "-" standing for stdin.
+ (Calc++ Top Level): Print the result only if the parsing was
+ successful.
+
+2007-01-16 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
+
+2007-01-15 Paolo Bonzini <bonzini@gnu.org>
+ and Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Clean up %define and %code implementation in M4 some. Most
+ importantly, rename all related macros to be in the b4_percent_define
+ and b4_percent_code namespaces. Also, complete support for `.' in
+ %define variable names and %code qualifiers.
+ * data/bison.m4 (b4_check_user_names): Check for special
+ "SKELETON-NAMESPACE(name)" macros instead of using two nested
+ m4_foreach loops.
+ (b4_get_percent_define, b4_get_percent_code): Rename to...
+ (b4_percent_define_get, b4_percent_code_get): ... these.
+ Extend documentation with examples.
+ For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
+ b4_percent_define_skeleton_variables and
+ b4_percent_code_skeleton_qualifiers.
+ Expect any value for the %define variable `foo' to be stored in the
+ macro named `b4_percent_define(foo)'; expect any %code blocks for the
+ qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
+ expect any unqualified %code blocks to be stored in a macro named
+ `b4_percent_code_unqualified'.
+ Use m4_indir so that %define variable names and %code qualifiers can
+ contain `.', which is allowed by the grammar parser.
+ (b4_percent_define_default): New macro to set a default value for a
+ %define variable.
+ (m4_wrap): Update wrapped code, and fix some underquoting.
+ (b4_check_user_names_wrap): Update and define outside the m4_wrap.
+ Expect grammar uses of %define variables and %code qualifiers to be
+ defined in b4_percent_define_user_variables and
+ b4_percent_code_user_qualifiers.
+ * data/c++.m4: Use b4_percent_define_default rather than
+ m4_define_default. Fix some underquoting. Skeleton usage of %define
+ variable define_location_comparison now implies skeleton usage of
+ %define variable filename_type.
+ * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
+ data/push.c, data/yacc.c: Update macro names.
+ * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
+ muscle names.
+
+2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ DJGPP specific issues.
+
+ * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
+ default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
+
+2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
+ run parsers in all tests so that Valgrind is invoked during
+ maintainer-check-valgrind.
+ (Duplicate representation of merged trees): Free all semantic values.
+ (Duplicated user destructor for lookahead): Likewise.
+
+2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
+ command-line prefix.
+ * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
+ ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
+ miss Valgrind messages.
+ (Exploding the Stack Size with Malloc): Likewise.
+
+2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
+ locals. Reported by Juan Manuel Guerrero at
+ <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
+ * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
+ Fix some indentation also.
+ * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
+ explaining this issue.
+
+2007-01-09 Paolo Bonzini <bonzini@gnu.org>
+ and Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Simplify union and prologue handling, and escape union and lex/parse
+ params with digraphs.
+ * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
+ values to the empty string since these are no longer guaranteed
+ initialized by the front-end.
+ * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
+ braces around b4_user_stype since this is no longer done by the
+ front-end.
+ * src/files.c, src/files.h (pre_prologue_obstack,
+ post_prologue_obstack): Remove.
+ * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
+ comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
+ with digraphs. This fixes lex params and parse params.
+ * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
+ * src/output.c (prepare): Remove muscle insertion of the prologues.
+ (output): Remove freeing of pre_prologue_obstack and
+ post_prologue_obstack.
+ * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
+ than prologue_augment for prologue parsing so you don't need prologue
+ obstacks.
+ (grammar_declaration): For %union RHS, use `braceless' instead of
+ "{...}" so that braces are already stripped and code is escaped with
+ digraphs.
+ * src/reader.c (prologue_augment): Remove.
+ (reader): Remove initialization of pre_prologue_obstack and
+ post_prologue_obstack.
+ * src/reader.h (prologue_augment): Remove.
+
+ * data/c.m4: Remove stray parenthesis.
+
+2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Remove quotes from variables names in %define directives and from
+ qualifiers in %code directives, and restrict the characters that are
+ allowed in them to M4-friendly ones. For %define, continue to support
+ the quoted form as a deprecated feature. Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
+ * NEWS (2.3a+): Add entry for the change to %define. Update entry for
+ %code.
+ * doc/bison.texinfo (Prologue Alternatives): Update.
+ (Decl Summary): In %defines entry, update mention of `%code requires'
+ and `%code provides'.
+ (C++ Location Values): Update %define uses.
+ (Calc++ Parser Interface): Likewise.
+ (Calc++ Parser): Likewise, and update `%code requires' uses.
+ (Table of Symbols): Update %code documentation.
+ * src/parse-gram.y (prologue_declaration): For %define variables, use
+ `variable' instead of `STRING'.
+ (grammar_declaration): For %code qualifiers, use `ID' instead of
+ `STRING'.
+ (variable): New nonterminal that takes an `ID' or a `STRING'.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
+ and %define uses.
+ * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
+ * tests/input.at (Reject unused %code qualifiers): Update %code uses.
+ (%define errors): Update %define uses.
+
+2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
+ instead of muscle_insert for %define values so that M4-special
+ characters are replaced with digraphs.
+ * tests/input.at (%define errors): Extend to check weird values.
+
+2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Instead of having skeletons declare all valid %define variables and
+ %code qualifiers, provide macros that retrieve the associated values
+ and build these lists automatically. Thus Bison will now warn when a
+ variable or qualifier is not used by the skeleton in the current
+ invocation regardless of whether it might sometimes be used by that
+ skeleton in other invocations. Also, move all %define value macros to
+ the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
+ form, which is replaced by %code.
+ * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
+ (b4_check_user_names): ... this, and change the series of valid name
+ arguments to a single list argument for names used in the skeleton
+ similar to the existing list argument for names used in the grammar.
+ Warn instead of complaining.
+ (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
+ values and %code code, to format %code code properly, and to build
+ lists of all %define variables and %code qualifiers used in the
+ skeleton: b4_skeleton_percent_define_variables and
+ b4_skeleton_percent_code_qualifiers.
+ (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
+ Remove, and...
+ (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
+ the skeleton names lists can finish building first. In place of
+ b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
+ expect the lists b4_user_percent_define_variables and
+ b4_user_percent_code_qualifiers.
+ * data/c++.m4: Where setting default values for b4_parser_class_name,
+ b4_location_type, b4_filename_type, b4_namespace, and
+ b4_define_location_comparison, update their names to the
+ b4_percent_define_ namespace.
+ * data/glr.c: Don't use b4_check_percent_define_variables and
+ b4_check_percent_code_qualifiers. Use b4_get_percent_code.
+ * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
+ (b4_parser_class_name, b4_namespace): Define these using
+ b4_get_percent_define for parser_class_name and namespace.
+ * data/location.cc: Use b4_get_percent_define.
+ * data/push.c: Don't use b4_check_percent_define_variables and
+ b4_check_percent_code_qualifiers. Use b4_get_percent_code.
+ * data/yacc.c: Likewise, and don't call m4_exit in
+ b4_use_push_for_pull_if or m4_wrap code will never execute.
+ * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
+ Rename to...
+ (muscle_grow_user_name_list): ... this for consistency with the
+ terminology used in bison.m4.
+ * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
+ %define variable names, and rename muscle used_percent_define_variables
+ to user_percent_define_variables.
+ (grammar_declaration): Rename muscle used_percent_code_qualifiers to
+ user_percent_code_qualifiers.
+ (content): Remove.
+ (content.opt): Replace content RHS with STRING RHS so %define "NAME"
+ {CODE} form is no longer accepted.
+ * tests/input.at (Reject bad %code qualifiers): Rename to...
+ (Reject unused %code qualifiers): ... this, and update test output.
+ (%define error): Update test output.
+
+2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Check for unrecognized %define variables similar to checking for
+ unrecognized %code qualifiers. Check for redefined %define variables.
+ * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
+ generalizes...
+ (b4_check_percent_code_qualifiers): ... this, which now wraps it.
+ (b4_check_percent_define_variables): New, also wraps it.
+ * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
+ variables using b4_check_percent_define_variables.
+ * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
+ all those exercised in the test suite and all those listed in the
+ `Default values' section of c++.m4. Are there others?
+ * data/push.c, data/yacc.c: Declare no valid %define variables.
+ * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
+ similar to muscle_find, but it works even when the muscle stores a
+ const value.
+ (muscle_grow_used_name_list): New function for constructing the used
+ name list muscles that b4_check_for_unrecognized_names requires.
+ * src/parse-gram.y (prologue_declaration): Warn if a variable is
+ %define'd more than once. Define the b4_used_percent_define_variables
+ muscle with muscle_grow_used_name_list.
+ (grammar_declaration): Abbreviate %code code with
+ muscle_grow_used_name_list.
+ * tests/input.at (%define errors): New.
+
+2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Provide warn_at, complain_at, and fatal_at function callbacks to the
+ skeletons, and use this for %code qualifier complaints.
+ * data/bison.m4 (b4_error_at): New, invoked by...
+ (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
+ the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
+ @fatal_at(...@) directives.
+ (b4_check_percent_code_qualifiers): Rewrite to expect locations for
+ qualifiers in b4_used_percent_code_qualifiers and to use
+ b4_complain_at.
+ * src/location.c, src/location.h (boundary_set_from_string): New global
+ function.
+ * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
+ function.
+ * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
+ to b4_used_percent_code_qualifiers.
+ * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
+ function.
+ (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
+ (lineno): Rename to...
+ (out_lineno): ... this so I don't misunderstand it again.
+ (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
+ here; these newlines are in the input but not the output file.
+ (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
+ (at_directive_perform): ... this new static function, and add handling
+ of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
+ directives.
+ * tests/input.at (Reject bad %code qualifiers): Update test output with
+ locations and extend.
+
+ * tests/output.at (Output file name: [, Output file name: ]): Remove
+ bogus comment about these tests failing.
+
+2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Clean up b4_check_percent_code_qualifiers a little.
+ * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
+ in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
+ documentation and add examples.
+ * src/parse-gram.y (grammar_declaration): Double-M4-quote those
+ qualifiers here.
+
+2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
+ unreliable -- especially when they're hidden inside another macro.
+ * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
+ data/c.m4: Remove m4_divert(-1).
+ * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
+ data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
+ m4_divert_push(0) and m4_divert_pop(0).
+ * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
+ an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
+ pushed and popped by m4sugar, should be first on the stack.
+
+ Provide warn, complain, and fatal function callbacks to the skeletons.
+ This provides more flexibility than m4_fatal, improves the error
+ message format, and captures messages for translation. Discussed
+ starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
+ * data/bison.m4 (b4_error): New, invoked by...
+ (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
+ skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
+ directives. Because these M4 macros might be called when the current
+ diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
+ the previous removal of uses of m4_divert, which caused trouble.
+ (b4_check_percent_code_qualifiers): Use b4_complain instead of
+ m4_fatal to report unrecognized %code qualifiers.
+ * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
+ push parser requests.
+ * data/glr.c: Use b4_complain instead of m4_fatal to report
+ non-deterministic push parser requests.
+ Update @output usage to @output(...@) form.
+ * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
+ report missing %defines. Update @output usage to @output(...@) form.
+ * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
+ @output(...@) form.
+ * src/main.c (main): Invoke skel_scanner_free.
+ * src/scan-skel.h (skel_scanner_free): Prototype new function.
+ * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
+ obstack_for_string from flex-scanner.h.
+ (YY_DECL): Use to declare skel_lex static.
+ (decode_at_digraphs): Remove; now handled in the new
+ SC_AT_DIRECTIVE_ARG start condition.
+ (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
+ functions.
+ (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
+ at_directive_argv): New static globals.
+ (INITIAL): Use fail_for_invalid_at.
+ Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
+ recognize the start of a generalized `@directive(...@)' form and
+ start...
+ (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
+ directive args (using the new obstack_for_string), to decode the
+ contained @ diagraphs, and to perform the directive. It recognizes
+ @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
+ @output(...@).
+ (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
+ SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
+ `@,'.
+ (scan_skel): Initialize obstack_for_string on the first call.
+ (skel_scanner_free): New function to free obstack_for_string.
+ * tests/input.at (Reject bad %code qualifiers): Update test output.
+
+2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Consolidate the 4 prologue alternative directives (%code, %requires,
+ %provides, and %code-top) into a single %code directive with an
+ optional qualifier field. Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
+ * NEWS (2.3a+): Rewrite the existing entry for the prologue
+ alternatives.
+ * doc/bison.texinfo (Prologue Alternatives): Update.
+ (Decl Summary): Update to %code "requires" and %code "provides".
+ (Calc++ Parser): Update to %code "requires".
+ (Table of Symbols): Remove entries for %requires, %provides, and
+ %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
+ * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
+ are replaced by b4_percent_code_provides and b4_percent_code_requires,
+ which are skeleton-specific.
+ (b4_check_percent_code_qualifiers): New. A skeleton can use this to
+ declare what %code qualifiers it supports and to complain if any other
+ qualifiers were used in the grammar.
+ * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
+ and b4_user_code([b4_percent_code_provides]) in place of
+ b4_user_requires and b4_user_provides.
+ * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
+ Add b4_user_code([b4_percent_code_top]) and
+ b4_user_code([b4_percent_code]).
+ Invoke b4_check_percent_code_qualifiers.
+ * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
+ PERCENT_REQUIRES): Remove.
+ (grammar_declaration): Remove RHS's for %code-top, %provides, and
+ %requires. Rewrite the %code RHS as the unqualified form defining the
+ muscle b4_percent_code. Add another RHS for the qualified %code form,
+ which defines muscles of the form b4_percent_code_QUALIFIER and the
+ b4_used_percent_code_qualifiers muscle.
+ * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
+ PERCENT_REQUIRES): Remove.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
+ %code "requires" and %code "provides".
+ * tests/input.at (Reject bad %code qualifiers): New.
+
+2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Use the new code_props interface for destructors and printers.
+ * src/symtab.h (symbol, semantic_type): Remove destructor_location and
+ printer_location members, and change the type of the destructor and
+ printer members to code_props.
+ (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
+ symbol_printer_get, semantic_type_destructor_set,
+ semantic_type_printer_set, default_tagged_destructor_set,
+ default_tagless_destructor_set, default_tagged_printer_set,
+ default_tagless_printer_set): Use code_props in arguments and return
+ types in place of char const * and location.
+ (symbol_destructor_location_get, symbol_printer_location_get): Remove
+ since the locations are now contained in the return of
+ symbol_destructor_get and symbol_printer_get.
+ * src/output.c (symbol_destructors_output, symbol_printers_output):
+ Replace with...
+ (symbol_code_props_output): ... this to eliminate duplicate code.
+ (output_skeleton): Update to use symbol_code_props_output.
+ * src/reader.c (symbol_should_be_used): Update use of
+ symbol_destructor_get.
+ * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
+ Update uses of the various _destructor_set and _printer_set functions.
+ * src/symtab.c: (default_tagged_destructor_location,
+ default_tagless_destructor_location, default_tagged_printer_location,
+ default_tagless_printer_location): Remove since we...
+ (default_tagged_destructor, default_tagless_destructor,
+ default_tagged_printer, default_tagless_printer): ... change the type
+ of these to code_props.
+ (symbol_new, semantic_type_new, symbol_destructor_set,
+ semantic_type_destructor_set, symbol_destructor_get,
+ symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
+ symbol_check_alias_consistency, default_tagged_destructor_set,
+ default_tagless_destructor_set, default_tagged_printer_set,
+ default_tagless_printer_set): Update.
+ (symbol_destructor_location_get, symbol_printer_location_get): Remove.
+ (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
+ code_props members.
+ (symbol_print): Use SYMBOL_CODE_PRINT.
+
+2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Use the new code_props interface for rule actions.
+ * src/symlist.h (symbol_list): Replace action, action_location, and
+ used members with a code_props action_props member.
+ * src/reader.c (symbol_should_be_used, grammar_rule_check,
+ grammar_midrule_action, grammar_current_rule_merge_set,
+ grammar_current_rule_symbol_append, packgram): Update.
+ * src/scan-code.h (translate_rule_action): Remove, no longer used.
+ * src/scan-code.l (handle_action_dollar): Update.
+ (translate_rule_action): Remove, no longer used.
+ * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
+
+2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Use the new code_props interface in parse-gram.y.
+ * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
+ Update all uses of translate_* functions to use the new code_props
+ interface and to use gram_scanner_last_string_free and
+ code_scanner_last_string_free where possible.
+ (grammar_declaration): symbol_list_destructor_set and
+ symbol_list_printer_set now perform the translation, so don't do it
+ here. Use gram_scanner_last_string_free where possible.
+ * src/scan-code.h, src/scan-code.l (translate_symbol_action,
+ translate_code): Remove, no longer used.
+ * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
+ symbol_list_printer_set): Perform code translation here rather than
+ depending on the caller to do so.
+
+ * src/symlist.h (struct symbol_list): Correct some documentation typos.
+ * src/scan-gram.h (gram_last_string): Remove declaration.
+ * src/scan-gram.l (last_string): Declare it static.
+
+2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Encapsulate code properties and related functionality for the various
+ destructors, printers, and actions into a code_props structure and
+ interface. This patch merely implements code_props in scan-code.h and
+ scan-code.l. Future patches will rewrite other modules to use it.
+ Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
+ * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
+ consistently initialize const structs that have an empty location
+ field.
+ * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
+ to ensure consistency.
+ * src/scan-code.h (code_props): New structure.
+ (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
+ function, macro, and const global variable for initializing a
+ code_props with no code.
+ (code_props_plain_init, code_props_symbol_action_init,
+ code_props_rule_action_init, code_props_translate_code): The rest of
+ the new code_props functional interface. Among other things, the init
+ functions set the code_props kind field so that
+ code_props_translate_code will know whether to behave like
+ translate_symbol_action, translate_rule_action, or translate_code.
+ These old translate functions must remain until all other modules are
+ updated to use the new code_props interface.
+ (code_scanner_last_string_free): New function similar to
+ gram_scanner_last_string_free.
+ (code_scanner_free): Add documentation.
+ * src/scan-code.l: Implement the new interface.
+ (code_lex): Make it static, add a code_props* argument, and remove the
+ rule argument.
+ (last_string): New static global similar to the one in scan-gram.l.
+ (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
+ instead of rule.
+ (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
+ code_props since Bison may one day use this information for destructors
+ and printers.
+ (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
+ (handle_action_dollar): Use symbol_list_n_get and set used flag
+ directly since symbol_list_n_used_set is removed.
+ (translate_action): Add a code_props* argument and remove the rule,
+ action, and location arguments. Pass the code_props* on to code_lex.
+ (translate_rule_action, translate_symbol_action, translate_code):
+ Rewrite as wrappers around the new code_props interface.
+ * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
+ it would eventually need to break the encapsulation of code_props.
+
+2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * etc/.cvsignore: New.
+
+2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Add maintainer-push-check to run maintainer-check using push parsing in
+ place of pull parsing where available.
+ * Makefile.am (maintainer-push-check): New.
+ * data/bison.m4 (b4_use_push_for_pull_if): New.
+ * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
+ appropriately based on their existing values.
+ (yypush_parse): Don't print push-parser-specific diagnostics if push
+ parsing is being used in place of pull parsing.
+ * data/yacc.c: If push parsing should replace pull parsing, redirect to
+ push.c.
+ * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
+ variable, and insert b4_use_push_for_pull_flag into muscles.
+ * tests/Makefile.am (maintainer-push-check): New.
+
+2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
+ (whether successful or failed) so that yypush_parse can be invoked
+ again to start a new parse using the same yypstate.
+ * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
+ check multiple yypull_parse invocations on the same yypstate. For pull
+ mode, extend to check multiple yyparse invocations.
+ (Exploding the Stack Size with Alloca): Extend to try with
+ %push-pull-parser.
+ (Exploding the Stack Size with Malloc): Likewise.
+
+ * tests/calc.at (Simple LALR Calculator): Don't specify
+ %skeleton "push.c" since %push-pull-parser implies that now.
+ * tests/headers.at (export YYLTYPE): Don't check for the push
+ declarations. Otherwise, this test case can't be used to see if push
+ mode can truly emulate pull mode.
+ * tests/input.at (Torturing the Scanner): Likewise.
+ * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
+ (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
+ AT_YACC_IF, which now includes the case of push mode since %skeleton
+ need not be used for push mode. This will be more intuitive once
+ push.c is renamed to yacc.c.
+
+2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ For push mode, convert yyparse from a macro to a function, invoke yylex
+ instead of passing a yylexp argument to yypull_parse, and don't
+ generate yypull_parse or yyparse unless %push-pull-parser is declared.
+ Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
+ * data/bison.m4 (b4_pull_if): New.
+ * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
+ * data/push.c: Improve M4 quoting a little.
+ (b4_generate_macro_args, b4_parenthesize): Remove.
+ (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
+ any time a pull parser is requested.
+ Don't #define this as a wrapper around yypull_parse. Instead, when
+ both push and pull are requested, make it a function that does that
+ same thing.
+ (yypull_parse): If there's a b4_prefix, #define this to
+ b4_prefix[pull_parse] when both push and pull are requested.
+ Don't define this as a function unless both push and pull are
+ requested.
+ Remove the yylexp argument and hard-code yylex invocation instead.
+ * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
+ %push-parser.
+ * src/getargs.c (pull_parser): New global initialized to true.
+ * getargs.h (pull_parser): extern it.
+ * src/output.c (prepare): Insert pull_flag muscle.
+ * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
+ (prologue_declaration): Set both push_parser and pull_parser = true for
+ %push-pull-parser. Set push_parser = true and pull_parser = false for
+ %push-parser.
+ * src/scan-gram.l: Don't accept %push_parser as an alternative to
+ %push-parser since there's no backward-compatibility concern here.
+ Scan %push-pull-parser.
+ * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
+ instead of %push-parser.
+ * tests/headers.at (export YYLTYPE): Make yylex static, and don't
+ prototype it in the module that calls yyparse.
+ * tests/input.at (Torturing the Scanner): Likewise.
+ * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
+
+2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Update etc/bench.pl. Optimize push mode a little (the yyn change
+ deserves most of the credit).
+ * Makefile.am (SUBDIRS): Add etc subdirectory.
+ * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
+ * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
+ yytoken, yyval, and yyloc declarations to...
+ (yyparse or yypush_parse): ... here to improve performance. For
+ yypush_parse invocations after the first, be sure to assign yyn its old
+ value again.
+ (yypstate_new): Don't bother initializing the yyresult field since the
+ initial value isn't used.
+ (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
+ remove the #define that, in push mode, set it to yyps->NAME.
+ * etc/Makefile.am: New.
+ * etc/bench.pl: Remove and build it instead from...
+ * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
+ "tests/bison" from the build directory by default rather than just
+ invoking "bison" from $PATH.
+ (calc_grammar): Update push parser code: don't declare yylval globally,
+ don't define yyparse_wrapper, and don't #define yyparse.
+ (bench_grammar): Update to check all working combinations of yacc.c,
+ push.c, impure, pure, pull, and push.
+
+2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ For push mode, add pull wrappers around yypush_parse.
+ * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
+ (yypull_parse): New function wrapping yypush_parse.
+ (yyparse): New #define wrapping yypull_parse.
+ * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
+ is declared.
+ * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
+ prototype yylex in the module that calls yyparse, and don't prototype
+ yyparse there. Otherwise, the yyparse expansion won't compile.
+ * tests/input.at (Torturing the Scanner): Likewise.
+
+2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Enable push parsers to operate in impure mode. Thus, %push-parser no
+ longer implies %pure-parser. The point of this change is to move
+ towards being able to test the push parser code by running the entire
+ test suite as if %push-parser had been declared.
+ * data/push.c (yypush_parse): For impure mode, remove the
+ yypushed_char, yypushed_val, and yypushed_loc arguments.
+ Instead, declare these as local variables initialized to the global
+ yychar, yylval, and yylloc.
+ For the first yypush_parse invocation only, restore the initial values
+ of these global variables when it's time to read a token since they
+ have been overwritten.
+ * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
+ %push-parser.
+ * tests/calc.at (Simple LALR(1) Calculator): Always declare
+ %pure-parser along with %push-parser since this test case was designed
+ for pure push parsers.
+ * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
+ (AT_YACC_OR_PUSH_IF): New.
+ (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
+ add a note that it's still wrong for some cases (as it has been for a
+ while).
+ (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
+ %push-parser no longer implies %pure-parser.
+
+2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Remove some unnecessary differences between the pull parser code and
+ the push parser code. This patch enables yynerrs in push mode.
+ * data/push.c: Reformat M4 a little.
+ (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
+ (b4_declare_scanner_communication_variables): Don't omit yynerrs just
+ because push mode is on. Instead, if pure mode is on, move yynerrs
+ to...
+ (b4_declare_parser_state_variables): ... here.
+ (yynerrs, yyerror_range): For push mode, #define each NAME in this list
+ to yyps->NAME so it can be used in yypush_parse.
+ (yypush_parse): Don't omit uses of yynerrs in push mode.
+
+2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix bug such that the first pushed token's value and location are
+ sometimes overwritten (sometimes by %initial-action) before being used.
+ * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
+ yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
+ For the first yypush_parse invocation, initialize yychar to YYEMPTY to
+ more closely mimic the pull parser logic.
+ Don't copy the pushed token to yychar, yylval, and yylloc until it's
+ time to read a token, which is after any initialization of yylval and
+ yylloc.
+ (gottoken): Rename label to...
+ (yyread_pushed_token): ... for clarity and to avoid infringing on the
+ user namespace.
+
+2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Rearrange initialization of the parser state variables so that the
+ skeleton doesn't have to have a copy for pull mode and another for push
+ mode. This patch also fixes at least a bug such that yylloc was not
+ initialized (with b4_location_initial_line and
+ b4_location_initial_column) upon calling yypush_parse. However, that
+ initialization now overwrites the first token's location;
+ %initial-action assigning @$ already did the same thing, and both bugs
+ will be fixed in a later patch.
+ * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
+ (b4_declare_parser_state_variables): Remove initialization of yytoken,
+ yyss, yyvs, yyls, and yystacksize.
+ (yypstate_new): Remove initialization of some yypstate fields: yystate,
+ yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
+ yylsp.
+ (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
+ yyps->NAME so it can be used in yypush_parse.
+ (yyparse or yypush_parse): For yypush_parse, don't print the
+ "Starting parse" diagnostic for invocations after the first.
+ Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
+ yypush_parse, only do it for the first invocation.
+ Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
+ initialization to occur in yypush_parse but only on the first
+ invocation.
+
+2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/push.c: Add CPP guards around push parser declarations in both
+ the header and the code file.
+ In the code file, move the push parser declarations to the same place
+ they appear in the header file.
+ Clean up the M4 some, especially the inconsistent underquoting in
+ some b4_c_function_def and b4_c_function_decl uses.
+
+2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Encapsulate the push parser state variables into an M4 macro so the
+ push skeleton doesn't have to list them again for pull mode's yyparse.
+ For push mode, remove yypush_parse's local equivalents of these
+ variables to eliminate unnecessary copying between the two sets at
+ run-time. This patch also fixes at least a bug related to multiple
+ %initial-action invocations in push mode.
+ * data/push.c (b4_declare_parser_variables): Rename to...
+ (b4_declare_scanner_communication_variables): ... this for clarity and
+ update both uses.
+ (b4_declare_yyparse_variables): Remove and move its contents to the one
+ spot where it was invoked.
+ (b4_declare_parser_state_variables): New macro containing the parser
+ state variables required by push mode.
+ (struct yypstate): Replace all fields but yynew with
+ b4_declare_parser_state_variables.
+ (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
+ yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
+ each NAME in this list to yyps->NAME so it can be used in yypush_parse.
+ (yyparse or yypush_parse): For yyparse in pull mode, replace local
+ parser state variable declarations with
+ b4_declare_parser_state_variables.
+ Don't initialize parser state variables when calling yypush_parse since
+ yypstate_new already does that.
+ Invoke the user's initial action only upon the first yypush_parse
+ invocation.
+ Remove all code that copies between the local parser state variables
+ and the yypstate.
+
+2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
+ prevent a name collision in a future patch where these names will
+ sometimes be #define'd.
+ (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
+ since it no longer has the same name as the existing argument.
+ (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
+
+2006-12-19 Paolo Bonzini <bonzini@gnu.org>
+ and Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * doc/bison.texinfo (Decl Summary): In the %language entry, mention
+ that the argument is case-insensitive, and there's no `=' here.
+ For the %skeleton entry, mention that %language is better.
+ (Bison Options): Likewise for --language and --skeleton. Move the
+ --skeleton entry so that the `Tuning the parser' section is sorted
+ alphabetically on long options.
+ (C++ Bison Interface): Don't use the word skeleton. Don't explain the
+ %language directive in detail here; cross-reference the %language
+ documentation instead.
+ (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
+ `%require "2.3b"' so that the example is always up-to-date.
+ (Table of Symbols): Add entries for %language and %skeleton.
+ * examples/extexi (normalize): Instead of replacing every %require
+ argument with the current Bison version, just substitute for
+ `@value{VERSION}'. This guarantees that we're testing what actually
+ appears in the documentation.
+ * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
+ rather than `@VERSION@'.
+
+2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Reword the %language news a bit, and put it earlier.
+
+ * src/getargs.c (skeleton_arg): Last arg is now location const *.
+ Rewrite to simplify the logic.
+ (language_argmatch): Likewise.
+ (program_name): We now own this var.
+ * src/getargs.h (struct bison_language): Use char[] rather than
+ const char *.
+
+ * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
+ Java is supported.
+ * src/complain.c (program_name): Remove decl; no longer needed.
+ * src/main.c (program_name): Remove; now belongs to getargs.
+
+2006-12-18 Paolo Bonzini <bonzini@gnu.org>
+
+ * NEWS: Document %language.
+
+ * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
+
+ * data/c-skel.m4, data/c++-skel.m4: New files.
+ * data/glr.c: Complain on push parsers.
+
+ * doc/bison.texinfo (C++ Parser Interface): Prefer %language
+ over %skeleton.
+ (Decl Summary): Document %language and %skeleton.
+ (Command line): Document -L.
+
+ * examples/extexi: Rewrite %require directive.
+ * examples/calc++/Makefile.am: Pass VERSION to extexi.
+
+ * src/files.c (compute_exts_from_gc): Look in language structure
+ for .y extension.
+ (compute_file_name_parts): Check whether .tab should be added.
+ * src/getargs.c (valid_languages, skeleton_prio, language_prio):
+ (language, skeleton_arg, language_argmatch): New.
+ (long_options): Add --language.
+ (getargs): Use skeleton_arg, add -L/--language.
+ * src/getargs.h: Include location.h.
+ (struct bison_language, language, skeleton_arg, language_argmatch): New.
+ * src/output.c (prepare): Pick default skeleton from struct language.
+ Don't dispatch C skeletons here.
+ * src/parse-gram.y (PERCENT_LANGUAGE): New.
+ (prologue_declaration): Add "%language" rule, use skeleton_arg.
+ * src/scan-gram.l ("%language"): New rule.
+
+ * tests/calc.at: Test %skeleton and %language.
+ * tests/local.at (AT_SKEL_CC_IF): Look for %language.
+ (AT_GLR_IF): Look for %skeleton "glr.cc".
+ (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
+ (AT_YACC_IF): Reject %language.
+
+2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
+ since it wasn't used; only the typedef name 'semantic_type' is needed.
+ Also, omit trailing white space.
+
+ * bootstrap: Sync from coreutils.
+ (gnulib_extra_files): Add build-aux/announce.gen.
+ (slurp): Adjust .gitignore files like .cvsignore files.
+ * build-aux/announce-gen: Remove from CVS, since bootstrap
+ now creates this.
+
+2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Make %push-parser imply %pure-parser. This fixes several bugs; see
+ <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
+ * src/parse-gram.y (prologue_declaration): For %push-parser, also set
+ pure_parser = true.
+ * data/push.c: Don't bother testing b4_push_if when deciding whether
+ to expand b4_declare_parser_variables globally.
+ (yypush_parse): Likewise in here.
+
+ * data/push.c (yypush_parse): Add b4_parse_param to arguments.
+ (yy_reduce_print): Reformat M4 for readability.
+
+2006-12-15 Bob Rossi <bob@brasko.net>
+ and Joel Denny <jdenny@ces.clemson.edu>
+
+ * data/push.c (yypstate): Add typedef, and update all uses of
+ struct yypstate to just yypstate.
+ * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
+
+2006-12-14 Bob Rossi <bob@brasko.net>
+
+ * data/push.c (yypush_parse): Declare prototype regardless of
+ %locations option.
+
+2006-12-14 Bob Rossi <bob@brasko.net>
+
+ * data/push.c (yyparse): Remove the prototype and the #define when in
+ push-parser mode.
+
+2006-12-13 Bob Rossi <bob@brasko.net>
+
+ * data/push.c (yypstate_init): Rename to...
+ (yypstate_new): ... this and use b4_c_function_def.
+ (yypstate_delete): New.
+ (yypush_parse): Change parameters yynval and yynlloc to be const.
+ * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
+ yypstate_delete functions.
+
+2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
+ strange test case titles. Reported by Bob Rossi.
+
+2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * TODO: Add pointer to Sylvain Schmitz's work on static detection
+ of potential ambiguities in GLR grammers.
+
+2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
+ `bison ', use m4_index instead of m4_substr since chopping up a string
+ containing M4-special characters causes problems here.
+
+ Fix a couple of bugs related to special characters in user-specified
+ file names, and make it easier for skeletons to compute output file
+ names with the same file name prefix as Bison-computed output file
+ names.
+ * data/glr.cc, data/push.c, data/yacc.c: In @output, use
+ b4_parser_file_name and b4_spec_defines_file instead of
+ @output_parser_name@ and @output_header_name@, which are now redundant.
+ * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
+ b4_parser_file_name, b4_spec_defines_file, and the new
+ @basename(FILENAME@) instead of @output_parser_name@ and
+ @output_header_name@, which inappropriately escaped the file names as
+ C string literals.
+ * src/files.c (all_but_ext): Remove static qualifier.
+ (compute_output_file_names): Move `free (all_but_ext)' to...
+ (output_file_names_free): ... here since all_but_ext is needed later.
+ * src/files.h (all_but_ext): Extern.
+ * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
+ exactly what MUSCLE_INSERT_STRING used to do.
+ (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
+ characters are escaped properly.
+ * src/output.c (prepare): Define muscle file_name_all_but_ext as
+ all_but_ext.
+ For pkgdatadir muscle, maintain previous functionality by using
+ MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
+ is that b4_pkgdatadir is used inside m4_include in the skeletons, so
+ digraphs would never be expanded. Hopefully no one has M4-special
+ characters in his Bison installation path.
+ * src/scan-skel.l: Don't parse @output_header_name@ and
+ @output_parser_name@ anymore since they're now redundant.
+ In @output, use decode_at_digraphs.
+ Parse a new @basename command that invokes last_component.
+ (decode_at_digraphs): New.
+ (BASE_QPUTS): Remove unused.
+ * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
+ (Output file name): New tests.
+
+2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Warn about output files that are generated by the skeletons and that
+ conflict with other output files.
+ * data/glr.c: Don't generate the header file here when glr.cc does.
+ * src/files.c (file_names, file_names_count): New static globals.
+ (compute_output_file_names): Invoke output_file_name_check for files
+ not generated by the skeletons and remove existing checks.
+ (output_file_name_check): New function that warns about conflicting
+ output file names.
+ (output_file_names_free): Free file_names.
+ * src/files.h (output_file_name_check): Declare.
+ * src/scan-skel.l: Invoke output_file_name_check for files generated by
+ the skeletons.
+ * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
+ (Conflicting output files): New tests.
+
+2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * doc/bison.texinfo: Fix a couple of typos.
+
+2006-12-08 Bob Rossi <bob@brasko.net>
+
+ * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
+ Rename to...
+ (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
+ update all uses.
+ (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
+ (yypush_parse): Rename yypvars argument to yyps and remove redundant
+ local pv.
+ (yypstate_init, yypush_parse): Declare in Bison-generated header file.
+ * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
+
+2006-12-07 Bob Rossi <bob@brasko.net>
+ and Joel Denny <jdenny@ces.clemson.edu>
+
+ * data/push.c (yypvarsinit): Change return type from void* to struct
+ yypvars*. No longer cast to void* on return.
+ (struct yypvars): Remove yylen since it need not be remembered between
+ yypushparse invocations.
+ (yypushparse): Don't copy between yylen and pv->yylen.
+
+2006-12-05 Bob Rossi <bob@brasko.net>
+
+ * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
+ (yypushparse): Add yynchar, yynlval, yynlloc parameters.
+ (b4_declare_parser_variables): Do not declare yynerrs for push mode.
+ (struct yypvars): Remove b4_declare_parser_variables.
+ (yypvarsinit): Remove init code for removed variables.
+ (global scope): Do not declare b4_declare_parser_variables if
+ push or pure mode.
+ (yypushparse): Add b4_declare_parser_variables.
+ Init new local variables, and remove init code for removed
+ yypvars variables.
+ (yyparse): Delete.
+ * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
+ and yyparse for other modes.
+ (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
+ * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
+ (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
+ (AT_PURE_LEX_IF): True if pure or push parser.
+
+2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Document Yacc prologue alternatives and default %destructor's and
+ %printer's as experimental. Don't mention Java yet. Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
+ * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
+ (2.3a): Annotate this entry to say the old forms of these features were
+ also experimental.
+ * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
+ Table of Symbols): Say they're experimental. Comment out any mention
+ of Java (we'll want this back eventually).
+
+2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Support a file name argument to %defines. Deprecate `=' in
+ %file-prefix, %name-prefix, and %output. Discussed at
+ <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
+ * NEWS (2.3a+): Mention.
+ * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
+ form of %defines, and remove `=' from entries for %file-prefix,
+ %name-prefix, and %output.
+ * src/parse-gram.y (prologue_declaration): Implement.
+ * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
+ LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
+ all but one occurrence of %name-prefix.
+ * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
+ * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
+ * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
+ occurrence of each of %file-prefix and %output. Add check for %defines
+ with argument.
+ * tests/reduce.at (Useless Terminals, Useless Nonterminals,
+ Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
+ Remove the `=' from %output.
+
+2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't escape $ in test case titles since Autoconf 2.61 now does that
+ correctly.
+ * tests/actions.at (Default %printer and %destructor are not for error
+ or $undefined): Here.
+ (Default %printer and %destructor are not for $accept): Here.
+ * tests/input.at (Invalid $n and @n): Here.
+
+2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Rename <!> to <>. Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
+ * NEWS (2.3a+): Update.
+ * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
+ Update.
+ * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
+ * src/scan-gram.l (INITIAL): Implement.
+ * src/symlist.c (symbol_list_default_tagless_new): Update comment.
+ * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
+ comment.
+ * tests/actions.at (Default tagless %printer and %destructor,
+ Default tagged and per-type %printer and %destructor,
+ Default %printer and %destructor are not for error or $undefined,
+ Default %printer and %destructor are not for $accept,
+ Default %printer and %destructor for mid-rule values): Update.
+ * tests/input.at (Default %printer and %destructor redeclared,
+ Unused values with default %destructor): Update.
+
+2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't let %prec take a nonterminal.
+ * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
+ token.
+ * tests/input.at (%prec takes a token): New test checking that %prec
+ won't take a nonterminal.
+
+2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
+ it was double-quoted.
+ * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
+ grammar is maintained with Bison's highest standards.
+ * src/getargs.c: Fix some typos in Doxygen comments.
+
+2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix memory leaks in scanners generated by at least Flex 2.5.9 and
+ later. Reported by Paul Eggert in
+ <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
+ * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
+ * src/scan-code.l (translate_action): Don't bother invoking
+ yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
+ (code_scanner_free): Instead of invoking
+ yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
+ which frees more.
+ * src/scan-gram.l (gram_scanner_free): Likewise.
+ * src/scan-skel.l (scan_skel): Likewise.
+
+2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/files.c (tr): Change return type to void.
+ * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
+ has been called previously for the same key.
+ (muscle_find): Return storage instead of value so that
+ --enable-gcc-warnings doesn't produce warnings that the return discards
+ const. aver that the value and storage are the same since storage
+ could potentially be NULL when value is not.
+ * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
+ same as 0.
+
+2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
+ the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
+ us a slightly cleaner distribution, and also works.
+ * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
+ gnulib changes.
+
+2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
+ and Paul Eggert <eggert@cs.ucla.edu>
+
+ Don't let Bison leak memory except when it complains.
+ * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
+ (spec_defines_file, dir_prefix): Now char *, not const char *,
+ since they are freed.
+ * src/files.c: Likewise.
+ (all_but_ext, all_but_tab_ext, src_extension, header_extension):
+ Likewise.
+ (tr): Now operates in-place. All uses changed.
+ (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
+ values.
+ (compute_file_name_parts, compute_output_file_names): Don't store
+ read-only data in variables that will be freed.
+ (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
+ src_extension, and header_extension.
+ (output_file_names_free): New public function to free
+ spec_verbose_file, spec_graph_file, spec_defines_file,
+ parser_file_name, and dir_prefix.
+ * src/getargs.c (getargs): Don't store read-only data in variables that
+ will be freed.
+ * src/main.c (main): Invoke output_file_names_free, code_scanner_free
+ (which previously existed but was unused), and quotearg_free.
+ * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
+ * src/muscle_tab.c: Likewise.
+ (muscle_entry): Make the value char const *,
+ and add a new storage member that is char * and can be freed.
+ (muscle_entry_free): New private function.
+ (muscle_init): Use it instead of free.
+ (muscle_insert, muscle_grow): Update and use new storage member.
+ (muscle_code_grow): Free the string passed to muscle_grow
+ since it's not needed anymore.
+ * src/parse-gram.y (%union): Make `chars' member a `char const *', and
+ add a new `char *code' member.
+ ("{...}"): Declare semantic type as code.
+ * src/scan-code.h (translate_rule_action):
+ (translate_symbol_action, translate_code, translate_action): Return
+ `char const *' rather than `char *' since external code should not free
+ these strings.
+ * src/scan-code.l: Likewise.
+ * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
+ which is "{...}" in the parser.
+ * tests/Makefile.am (maintainer-check-valgrind): Set
+ VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
+ Valgrind.
+ * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
+ complain.
+ * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
+ expecting a non-zero exit status sets --leak-check=summary and
+ --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
+ this case, and we don't want to hear about it.
+
+2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap (runtime-po/Makevars): Derive from po/Makevars
+ instead of from the template, to simplify configuration a bit.
+ * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
+ and m4/wint_t.m4, as they are needed with the latest gnulib.
+
+2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Disable unset/unused mid-rule value warnings by default, and recognize
+ --warnings=midrule-values to enable them. Discussed starting at
+ <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
+ * NEWS (2.3a+): Mention.
+ * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
+ warnings): Add entry for midrule-values subargument.
+ * src/reader.c (symbol_should_be_used): Don't return true just because
+ the value is a set/used mid-rule value unless
+ --warnings=midrule-values was specified.
+ * tests/input.at (Unused values, Unused values before symbol
+ declarations): Run tests with and without --warnings=midrule-values.
+
+ * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
+ than LIST_FREE directly.
+
+2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Finish implementing --warnings=error, which should not be implied by
+ --warnings=all (or by its synonyms -W and --warnings without
+ subarguments).
+ * src/complain.c (set_warning_issued): New function to report that
+ warnings are being treated as errors and to record an error if so.
+ Invoke...
+ (warn_at, warn): ... here.
+ * src/getargs.c (warnings_args, warnings_types): Reorder so that
+ "error - warnings are errors" does not appear above "all - all of the
+ above".
+ (getargs): For -W and --warnings without subarguments, don't let
+ FLAGS_ARGMATCH set warnings_error in warnings_flag.
+ * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
+
+2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
+ empty subargument list. For example: `bison --warnings= parser.y'.
+
+2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/push.c, data/yacc.c: Make sure there's a newline at the end of
+ the parser header file so that gcc doesn't warn.
+
+2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Split the default %destructor/%printer into two kinds: <*> and <!>.
+ Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
+ * NEWS (2.3a+): Mention.
+ * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
+ previous change today related to mid-rules.
+ (Table of Symbols): Remove %symbol-default and add <*> and <!>.
+ * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
+ (TYPE_TAG_ANY): Add as <*>.
+ (TYPE_TAG_NONE): Add as <!>.
+ (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
+ for <*> and <!>.
+ * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
+ (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
+ * src/symlist.c (symbol_list_default_new): Split into tagged and
+ tagless versions.
+ (symbol_list_destructor_set, symbol_list_printer_set): Split
+ SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
+ SYMLIST_DEFAULT_TAGLESS.
+ * src/symlist.h: Update symbol_list_default*_new prototypes.
+ (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
+ SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
+ * src/symtab.c (default_destructor, default_destructor_location,
+ default_printer, default_printer_location): Split each into tagged and
+ tagless versions.
+ (symbol_destructor_get, symbol_destructor_location_get,
+ symbol_printer_get, symbol_printer_location_get): Implement tagged
+ default and tagless default cases.
+ (default_destructor_set, default_printer_set): Split each into tagged
+ and tagless versions.
+ * src/symtab.h: Update prototypes.
+ * tests/actions.at (Default %printer and %destructor): Rename to...
+ (Default tagless %printer and %destructor): ... this, and extend.
+ (Per-type %printer and %destructor): Rename to...
+ (Default tagged and per-type %printer and %destructor): ... this, and
+ extend.
+ (Default %printer and %destructor for user-defined end token): Extend.
+ (Default %printer and %destructor are not for error or $undefined):
+ Update.
+ (Default %printer and %destructor are not for $accept): Update.
+ (Default %printer and %destructor for mid-rule values): Extend.
+ * tests/input.at (Default %printer and %destructor redeclared): Extend.
+ (Unused values with default %destructor): Extend.
+
+2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't apply the default %destructor/%printer to an unreferenced midrule
+ value. Mentioned at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
+ * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
+ like $@n instead of just @n so that the default %destructor/%printer
+ logic doesn't see them as user-defined symbols.
+ (symbol_is_dummy): Check for both forms of the name.
+ * src/reader.c (packgram): Remove the `$' from each midrule symbol
+ name for which the midrule value is referenced in any action.
+ * tests/actions.at (Default %printer and %destructor for mid-rule
+ values): New test.
+ * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
+ for change to dummy symbol names.
+
+2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Warn about unset midrule $$ if the corresponding $n is used.
+ * src/reader.c (symbol_should_be_used): Check midrule parent rule for
+ $n usage.
+ (packgram): Before invoking grammar_rule_check on any rule, make sure
+ all actions have already been scanned in order to set `used' flags.
+ Otherwise, checking that a midrule's $$ is set will not always work
+ properly because the midrule check must forward-reference the midrule's
+ parent rule.
+ * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
+ warning.
+
+2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ More improvements to the documentation of the prologue alternatives:
+ * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
+ Bison manual.
+ * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
+ some text to clarify the relative importance of the new directives and
+ to show how these directives may be viewed as code labels.
+
+2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Similar to the recently removed %before-header, add %code-top as the
+ alternative to the pre-prologue. Mentioned at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
+ Also, let the prologue alternatives appear in the grammar section.
+ * src/parse-gram.y (PERCENT_CODE_TOP): New token.
+ (prologue_declaration): Move the existing prologue alternatives to...
+ (grammar_declaration): ... here and add %code-top.
+ * src/scan-gram.l (PERCENT_CODE_TOP): New token.
+
+ Clean up and extend documentation for the prologue alternatives.
+ * NEWS (2.3a+): Describe prologue alternatives.
+ * doc/bison.texinfo (Prologue): Move discussion of prologue
+ alternatives to...
+ (Prologue Alternatives): ... this new section, and extend it to discuss
+ all 4 directives in detail.
+ (Table of Symbols): Clean up discussion of prologue alternatives and
+ add %code-top.
+
+2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ DJGPP specific issues.
+
+ * djgpp/config.bat: config.hin has been moved to lib. Adjust
+ config.bat accordingly.
+ * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
+ * djgpp/config.site: Likewise.
+
+2006-10-16 Paolo Bonzini <bonzini@gnu.org>
+
+ Replace %*-header with %provides, %requires, %code. See discussion at
+ http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
+
+ * data/bison.m4 (b4_user_requires, b4_user_provides): New.
+ (b4_user_start_header): Remove.
+ * data/glr.c: Use new macros instead of b4_*start_header
+ and b4_*end_header.
+ * data/glr.cc: Likewise.
+ * data/lalr1.cc: Likewise.
+ * data/push.c: Likewise.
+ * data/yacc.c: Likewise.
+
+ * doc/bison.texinfo: Remove %before-header, rename
+ %{start,end,after}-header to %requires, %provides, %code.
+
+ * src/parse-gram.y: Likewise (also rename token names accordingly).
+ * src/scan-gram.l: Likewise.
+ * tests/actions.at: Likewise.
+
+2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
+ Problem reported by Joel E. Denny.
+
+2006-10-14 Jim Meyering <jim@meyering.net>
+
+ (Sync from coreutils.)
+ Work also when the working directory (with e.g. coreutils sources)
+ is version controlled with git, rather than CVS.
+ * bootstrap (CVS_only_file): Test for the existence of README-cvs,
+ rather than CVS.
+ In messages and comments, say e.g., "checked-out sources",
+ rather than "CVS sources".
+ (version_controlled_file): New function. Work for git as well as
+ for CVS. Don't use grep's -q option.
+ (slurp): Call it here, in place of CVS-specific code.
+
+2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix testsuite for ./configure --enable-gcc-warnings:
+ * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
+ Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
+ __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
+ * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
+ * test/regression.at (Diagnostic that expects two alternatives):
+ Likewise.
+
+2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap.conf (gnulib_modules): Add config-h.
+ * djgpp/subpipe.c: Include <config.h> unconditionally; don't
+ worry about HAVE_CONFIG_H.
+ * lib/abitset.c: Likewise.
+ * lib/bitset.c: Likewise.
+ * lib/bitset_stats.c: Likewise.
+ * lib/bitsetv-print.c: Likewise.
+ * lib/bitsetv.c: Likewise.
+ * lib/ebitset.c: Likewise.
+ * lib/get-errno.c: Likewise.
+ * lib/lbitset.c: Likewise.
+ * lib/subpipe.c: Likewise.
+ * lib/timevar.c: Likewise.
+ * lib/vbitset.c: Likewise.
+ * lib/bitset.c: Include "bitset.h" first, to test interface.
+ * lib/bitset_stats.c: Include "bitset_stats.h" first.
+ * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
+ * lib/bitsetv.c: Include "bitsetv.h" first.
+ * lib/get-errno.c: Include "get-errno.h" first.
+ * m4/.cvsignore: Add config-h.m4.
+ * tests/actions.at (Default %printer and %destructor for ...):
+ Adjust expected line numbers in output to reflect removal of #if
+ HAVE_CONFIG_H lines.
+ * tests/glr-regression.at (Missed %merge type warnings when ...):
+ Likewise.
+ * tests/regression.at (Braced code in declaration in rules section):
+ Likewise.
+ * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
+ * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
+ Include <config.h> unconditionally.
+
+ * bootstrap: Sync from coreutils, as follows:
+
+ 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
+ variable was sometimes used without being initialized. This
+ messed up the installation of the INSTALL file in some cases.
+
+ 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap (usage, main program, symlink_to_gnulib): Add option
+ --copy. Inspired by a suggestion from Bruno Haible.
+
+ 2006-10-03 Jim Meyering <jim@meyering.net>
+
+ * bootstrap: Undo last change to this file, since now gnulib-tool
+ sticks with the automake default in generating dependencies.
+
+2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
+ the old AC_PROG_CC / AM_PROG_CC_STDC combination.
+
+ * doc/bison.1: Add copyright notice.
+
+ * data/glr.c: Don't include <stdarg.h>; not used.
+
+ * NEWS: The -g and --graph options now output graphs in Graphviz
+ DOT format, not VCG format.
+ * doc/bison.1: Likewise.
+ * doc/bison.texinfo (Understanding, Bison Options): Likewise.
+ * THANKS: Add Satya Kiran Popuri, who proposed the initial version
+ of this change in
+ <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
+ * TODO: Remove Graphviz entry.
+ * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
+ remove vcg.c, vcg.h, vcg_defaults.h.
+ * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
+ * src/graphviz.c, src/graphviz.h: New files.
+ * src/files.c (compute_output_file_names): Output .dot, not .vcg.
+ * src/files.h: Make comment more generic.
+ * src/main.c (main): Likewise.
+ * src/print_graph.h: Likewise.
+ * src/getargs.c (usage): Make usage description more generic.
+ * src/print_graph.c: Include graphviz.h rather than vcg.h.
+ (static_graph, fgraph): Remove. All uses changed to pass
+ arguments instead of sharing a static var.
+ (print_core, print_actions, print_state, print_graph):
+ Output graphviz format rather than VCG format.
+ * tests/.cvsignore: Remove *.vcg; add *.dot.
+ * tests/output.at: Expect *.dot files, not *.vcg files.
+
+ * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
+ accommodates the 2006-10-08 change.
+
+2006-10-11 Bob Rossi <bob@brasko.net>
+
+ * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
+ (b4_yyssa, b4_yyerror_range): New macros.
+ (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
+ (yypvarsinit): Remove init of removed fields.
+ (yypushparse): Remove use of removed fields; use new macros instead.
+
+2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
+ in a push parser. Reindent slightly to match yacc.c better.
+
+2006-10-11 Bob Rossi <bob@brasko.net>
+
+ * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
+ yymsg_alloc fields.
+ (yypvarsinit, yypushparse): Remove init of removed fields.
+ (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
+
+2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * THANKS: Add Paolo Bonzini and Bob Rossi.
+
+2006-10-08 Paolo Bonzini <bonzini@gnu.org>
+
+ * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
+ b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
+ b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
+ b4_define_user_cde and uses): Remove.
+ (b4_comment, b4_prefix, b4_sync_start): New.
+ * data/bison.m4: New file, with most of the content removed from c.m4.
+ * src/muscle_tab.h: Use "do {...} while(0)" throughout.
+ * src/output.c (output_skeleton): Pass bison.m4.
+ (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
+ only if specified.
+
+2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix test failure reported by Tom Lane in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
+ and try to make such failures easier to catch in the future.
+ * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
+ that's now the caller's responsibility.
+ (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
+ Set yychar = YYEOF if it's negative.
+ * tests/actions.at (yylex): Abort if asked to read past EOF.
+ * tests/conflicts.at (yylex): Likewise.
+ * tests/cxx-type.at (yylex): Likewise.
+ * tests/glr-regression.at (yylex): Likewise.
+ * tests/input.at (yylex): Likewise.
+ * tests/regression.at (yylex): Likewise.
+ * tests/torture.at (yylex): Likewise.
+
+2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix problems with translating English-language diagnostics.
+ * bootstrap: Fix bug introduced in recent bootstrap changes, with
+ respect to bison-runtime pot generation. The YY_ stuff
+ wasn't being captured.
+ * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
+ * po/POTFILES.in: Add src/location.c, src/scan-code.l.
+ * runtime-po/POTFILES.in: Add data/push.c.
+
+2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge bootstrap changes from coreutils.
+
+ 2006-09-28 Jim Meyering <jim@meyering.net>
+
+ Automatically generated dependencies are important even
+ when all of the sources in a directory come from gnulib.
+ * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
+ option that gnulib-tool adds to what becomes our lib/gnulib.mk.
+
+ 2006-09-23 Jim Meyering <jim@meyering.net>
+
+ * bootstrap (gnulib_tool_options): Add "--local-dir gl".
+
+ 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap: Add support for --force.
+ (usage): New function. Describe usage less tersely.
+ (CVS_only_file): New var.
+
+2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/push.c (YYPUSH_MORE): Make it an enum instead.
+ (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
+ Adjust white space and comments to match GNU style better.
+
+2006-09-20 Bob Rossi <bob@brasko.net>
+
+ * data/push.c (yyresult_get): Remove function.
+ (YYPUSH_MORE): Add #define.
+ (yypushparse): Modify return value.
+
+2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * stamp-h.in: Remove; no longer needed.
+ * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
+ Remove config.h, config.hin, intl (no longer created).
+ * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
+ stamp-h1.
+
+ Sync bootstrap from coreutils, as follows:
+
+ 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap (symlink_to_gnulib): New function.
+ (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
+ to copies-of-gnulib.
+ (cp_mark_as_generated, slurp, gnulib_files):
+ Avoid making a copy if it's the same as the old version.
+ (gnulib_files): Add support for this variable (used by Bison).
+
+2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/getargs.c (usage): Rework to use conventions similar to
+ coreutils, to make translation a bit easier and the code a bit
+ smaller. Problem reported by Tim Van Holder.
+
+2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use some of gnulib's new modules, taken from coreutils.
+
+ * bootstrap: Sync from coreutils, except add support for gnulib_files.
+ * bootstrap.conf: New file.
+ (gnulib_modules): Add configmake, inttypes, unistd.
+ (XGETTEXT_OPTIONS): Add complain, complain_at,
+ fatal, fatal_at, warn, warn_at, unexpected_end.
+ * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
+ (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
+ (gl_EARLY): Add.
+ (AM_STDBOOL_H): Remove; gl_INIT now dows this.
+ (gl_INIT): Add
+ (GNULIB_AUTOCONF_SNIPPET): Remove.
+ (AM_GNU_GETTEXT): Add; require formatstring macros since that's
+ the pickiest.
+ * lib/.cvsignore: Add inttypes_.h.
+ * lib/Makefile.am: Include gnulib.mk first so we can append to it.
+ (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
+ (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
+ no-longer-necessary initializations.
+ (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
+ * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
+ use the unistd module.
+ * src/system.h: Likewise.
+ * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
+ ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
+ gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
+ * src/Makefile.am (DEFS): Remove, since configmake does this for us.
+ (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
+ * src/system.h: Include inttypes.h unconditionally, now that we
+ use the inttypes module. Don't bother to include stdint.h, since
+ inttypes.h now does that for us.
+ (LOCALEDIR): Remove, now that we use the configmake module.
+ * src/getargs.c: Include configmake.h.
+ * src/main.c: Likewise.
+ * src/output.c: Likewise.
+ * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
+ not from $abs_top_builddir, since config.h moved.
+
+
+ Port to GCC 2.95. First two problems reported by Michael Deutschmann in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
+
+ * src/parse-gram.y (symbol_declaration): Don't put statements
+ before declarations; it's not portable to C89.
+ * src/scan-code.l (handle_action_at): Likewise.
+
+ * src/scan-code.l: Always initialize braces_level; the old code
+ left it uninitialized and therefore had undefined behavior.
+
+ Don't attempt to redefine 'assert', since it runs afoul of
+ systems where standard headers (mistakenly) include <assert.h>.
+ Instead, define and use our own alternative, called 'aver'.
+ * src/reader.c: Don't include assert.h, since we no longer
+ use assert.
+ * src/scan-code.l: Likewise.
+ * src/system.h (assert): Remove, replacing with....
+ (aver): New function, taking a bool arg. All uses changed.
+ * src/tables.c (pack_vector): Ensure that aver arg is bool,
+ not merely an integer.
+
+2006-09-15 Bob Rossi <bob@brasko.net>
+
+ * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
+ * data/c.m4 (YYPUSH): New.
+ (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
+ * src/getargs.c (push_parser): New var.
+ * src/getargs.h (push_parser): New declaration.
+ * src/output.c (prepare): Add macro insertion of `push_flag'.
+ * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
+ (prologue_declaration): Parse %push-parser.
+ * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
+ * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
+ list of removed lines from the traces observed.
+ (AT_CHECK_CALC_LALR): Added push parser tests.
+
+2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 2.3a.
+ * configure.ac (AC_INIT): Likewise.
+
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
+ "#define YYSTYPE int" that caused "make maintainer-check" to fail
+ due to header ordering dependencies. I don't know why the #define
+ was there.
+
+ Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
+ runtime cost when YYDEBUG is not defined, and so that some tests
+ that used to fail now work. Problem and initial suggestion by
+ Paolo Bonzini.
+ * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
+ * data/glr.cc (b4_parser_class_name):
+ Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
+ (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
+ (yydebug_) [YYDEBUG]: New member.
+ (yycdebug_): Now defined only if YYDEBUG.
+ * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
+ (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
+ (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
+ if YYYDEBUG.
+ (debug_stream, set_debug_stream, debug_level, set_debug_level):
+ Define only if YYDEBUG.
+ * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
+ set_debug_level.
+ * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
+ * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
+ AT_CHECK_CALC_GLR_CC that are working now.
+
+2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
+ We don't need them in glr.cc, and glr.c defines them.
+ Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
+ assumes that defining it to anything is the same as defining
+ it to 1. Problem reported by Paolo Bonzini.
+
+2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
+
+ * data/c.m4 (b4_null, b4_case): Define.
+ * src/output.c (prepare_symbols): Use b4_null.
+ (user_actions_output): Use b4_case.
+
+2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (b4_shared_declarations): Put start-header first,
+ before any #includes that we generate, so that feature-test
+ macros work. Problem reported by Michael Deutschmann in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
+ * data/lalr1.cc: Likewise.
+ * doc/bison.texinfo (Prologue): Document that feature-test macros
+ should be defined before any Bison declarations.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
+ that depend on location.hh after, not before, Bison decls, since
+ we now include location.hh after the first user prologue.
+
+ * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
+ Sander Brandenburg in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
+ Also, fix minor white space and comment issues.
+ (Prologue): Mention that it's better to define feature-test macros
+ before Bison declarations. Problem reported by Michael Deutschmann.
+
+ * README-cvs: Fix typo: "&" should be "&&". Problem reported
+ by Jim Meyering.
+ * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
+ This adjusts to recent gnulib changes.
+
+2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Finish implementation of per-type %destructor/%printer. Discussed
+ starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
+ and
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
+ * NEWS (2.3+): Add a description of this feature to the default
+ %destructor/%printer description.
+ * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
+ * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
+ Invoke semantic_type_destructor_set or semantic_type_printer_set when a
+ list node contains a semantic type.
+ * src/symtab.c, src/symtab.h: Extend with a table that associates
+ semantic types with their %destructor's and %printer's.
+ (semantic_type_from_uniqstr, semantic_type_get,
+ semantic_type_destructor_set, semantic_type_printer_set): New functions
+ composing the public interface of that table.
+ (symbol_destructor_get, symbol_destructor_location_get,
+ symbol_printer_get, symbol_printer_location_get): If there's no
+ per-symbol %destructor/%printer, look up the per-type before trying
+ the default.
+ * tests/actions.at (Per-type %printer and %destructor): New test case.
+ * tests/input.at (Default %printer and %destructor redeclared):
+ Extend to check that multiple occurrences of %symbol-default in a
+ single %destructor/%printer declaration is an error.
+ (Per-type %printer and %destructor redeclared, Unused values with
+ per-type %destructor): New test cases.
+
+2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Require default %destructor/%printer to be declared using
+ %symbol-default instead of an empty symbol list, and start working on
+ new per-type %destructor/%printer. Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
+ * NEWS (2.3+): Add %symbol-default to example.
+ * bison.texinfo (Freeing Discarded Symbols): Likewise.
+ (Table of Symbols): Add entry for %symbol-default.
+ * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
+ (generic_symlist, generic_symlist_item): New nonterminals for creating
+ a list in which each item is a symbol, semantic type, or
+ %symbol-default.
+ (grammar_declaration): Use generic_symlist in %destructor and %printer
+ declarations instead of symbols.1 or an empty list.
+ (symbol_declaration, precedence_declaration, symbols.1): Update actions
+ for changes to symbol_list.
+ * src/reader.c: Update for changes to symbol_list.
+ * src/scan-code.l: Likewise.
+ * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
+ * src/symlist.c, src/symlist.h: Extend such that a list node may
+ represent a semantic type or a %symbol-default in addition to just an
+ ordinary symbol. Add switched functions for setting %destructor's and
+ %printer's.
+ * tests/actions.at, tests/input.at: Add %symbol-default to all default
+ %destructor/%printer declarations.
+
+2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Whether the default %destructor/%printer applies to a particular symbol
+ isn't a question of whether the user *declares* that symbol (in %token,
+ for example). It's a question of whether the user by any means
+ *defines* the symbol at all (by simply using a char token, for
+ example). $end is defined by Bison whereas any other token with token
+ number 0 is defined by the user. The error token is always defined by
+ Bison regardless of whether the user declares it with %token, but we
+ may one day let the user define error as a nonterminal instead.
+ * NEWS (2.3+): Say "user-defined" instead of "user-declared".
+ * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
+ the meaning of "user-defined".
+ * tests/actions.at (Default %printer and %destructor for user-declared
+ end token): Rename to...
+ (Default %printer and %destructor for user-defined end token): ...
+ this.
+
+ * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
+ computation of whether to apply the default, don't maintain a list of
+ every Bison-defined symbol. Instead, just check for a first character
+ of '$', which a user symbol cannot have, and check for the error token.
+
+2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't apply the default %destructor or %printer to the error token,
+ $undefined, or $accept. This change fits the general rule that the
+ default %destructor and %printer are only for user-declared symbols,
+ and it solves several difficulties that are described in the new test
+ cases listed below.
+ * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
+ * tests/actions.at (Default %printer and %destructor are not for error
+ or $undefined, Default %printer and %destructor are not for $accept):
+ New test cases.
+
+2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Allow %start after the first rule.
+ * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
+ when parsing the first rule.
+ (check_and_convert_grammar): Search for it here after all grammar
+ declarations have been parsed. Skip midrules, which have dummy LHS
+ nonterminals.
+ * src/symtab.c (symbol_is_dummy): New function.
+ * src/symtab.h (symbol_is_dummy): Declare it.
+ * tests/input.at (%start after first rule): New test.
+
+2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Redo some of the previous commit: add back the ability to use
+ non-aliased/undeclared string literals since it might be useful to
+ those declaring %token-table.
+ * src/reader.c (check_and_convert_grammar): Undo changes in previous
+ commit: don't worry about complaints from symbols_pack.
+ * src/symtab.c (symbol_new, symbol_class_set,
+ symbol_check_alias_consistency): Undo changes in previous commit: count
+ each string literal as a new symbol and token, assign it a symbol
+ number, and don't complain about non-aliased string literals.
+ (symbols_pack): Since symbol_make_alias still does not decrement symbol
+ and token counts but does still set aliased tokens to the same number,
+ symbol_pack_processor now leaves empty slots in the symbols array.
+ Remove those slots.
+ * tests/regression.at (Undeclared string literal): Remove test case
+ added in previous commit since non-aliased string literals are allowed
+ again.
+ (Characters Escapes, Web2c Actions): Undo changes in previous commit:
+ remove unnecessary string literal declarations.
+ * tests/sets.at (Firsts): Likewise.
+
+2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't allow an undeclared string literal, but allow a string literal to
+ be used before its declaration.
+ * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
+ symbols_pack complained.
+ * src/symtab.c (symbol_new): Don't count a string literal as a new
+ symbol.
+ (symbol_class_set): Don't count a string literal as a new token, and
+ don't assign it a symbol number since symbol_make_alias does that.
+ (symbol_make_alias): It's not necessary to decrement the symbol and
+ token counts anymore. Don't assume that an alias declaration occurs
+ before any uses of the identifier or string, and thus don't assert that
+ one of them has the highest symbol number so far.
+ (symbol_check_alias_consistency): Complain if there's a string literal
+ that wasn't declared as an alias.
+ (symbols_pack): Bail if symbol_check_alias_consistency failed since
+ symbol_pack asserts that every token has been assigned a symbol number
+ although undeclared string literals have not.
+ * tests/regression.at (String alias declared after use, Undeclared
+ string literal): New test cases.
+ (Characters Escapes, Web2c Actions): Declare string literals as
+ aliases.
+ * tests/sets.at (Firsts): Likewise.
+
+2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ In the grammar scanner, STRING_FINISH unclosed constructs and return
+ them to the parser in order to improve error messages.
+ * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
+ SC_BRACED_CODE, SC_PROLOGUE): Implement.
+ * tests/input.at (Unclosed constructs): New test case.
+ * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
+ seen.
+
+ * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
+ unused global.
+
+2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Handle string aliases for character tokens correctly.
+ * src/symtab.c (symbol_user_token_number_set): If the token has an
+ alias, check and set its alias's user token number instead of its own,
+ which is set to indicate the alias. Previously, every occurrence of
+ the character token in the grammar overwrote that alias indicator with
+ the character code.
+ * tests/input.at (String aliases for character tokens): New test.
+
+2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
+
+2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
+ to prevent failures when building on older platforms.
+ Check for autopoint failure.
+ Set XGETTEXT_OPTIONS to values that check for C format strings,
+ so that translators are warned about them (this also helps
+ prevent core dumps).
+
+ * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
+ function, since it simplifies our code a bit.
+
+ * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
+ rather than -W, so we don't get bogus warnings about sign comparisons.
+ Add -Wpointer-arith, since that warning is useful (it reports code
+ that does not conform to C89 and that some compilers reject).
+ * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
+ since it's no longer needed.
+
+2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Clean up scanners a bit.
+ * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
+ definitions so gcc won't warn when obstack_for_string is unused.
+ * src/scan-code.l: config.h and system.h are already #include'd by
+ scan-code-c.c, so get rid of them here.
+ * src/scan-gram.l: Likewise.
+ * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
+ definitions rather than duplicating the rest of it.
+ * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
+
+2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Suppress signed/unsigned comparison warnings for yycheck.
+ * data/c.m4 (b4_safest_int_type): New macro.
+ * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
+ a signed int type, cast it to b4_safest_int_type first.
+ * data/yacc.c: Likewise.
+ (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
+ also overwritten.
+
+2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
+
+ * doc/bison.texinfo: Fix some typos.
+
+2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
+ po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
+
+ * bootstrap (gnulib_tool): Stop using --assume-autoconf;
+ the latest gnulib does this a different way.
+ (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
+ translation was patched, so stop omitting it.
+
+2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Enable declaration of default %printer/%destructor. Make the parser
+ use these for all user-declared grammar symbols for which the user does
+ not declare a specific %printer/%destructor. Thus, the parser uses it
+ for token 0 if the user declares it but not if Bison generates it as
+ $end. Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
+ and
+ <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
+ * NEWS (2.3+): Mention.
+ * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
+ declare a %destructor for a mid-rule's semantic value. It's just
+ impossible to declare one specific to it.
+ (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
+ code. Describe default %destructor form.
+ * src/parse-gram.y (grammar_declaration): Parse default
+ %printer/%destructor declarations.
+ * src/output.c (symbol_destructors_output): Use symbol_destructor_get
+ and symbol_destructor_location_get rather than accessing the destructor
+ and destructor_location members of struct symbol.
+ (symbol_printers_output): Likewise but for %printer's.
+ * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
+ again.
+ * src/symtab.c (default_destructor, default_destructor_location,
+ default_printer, default_printer_location): New static global
+ variables to record the default %destructor and %printer.
+ (symbol_destructor_get, symbol_destructor_location_get,
+ symbol_printer_get, symbol_printer_location_get): New functions to
+ compute the appropriate %destructor and %printer for a symbol.
+ (default_destructor_set, default_printer_set): New functions to set the
+ default %destructor and %printer.
+ * src/symtab.h: Prototype all those new functions.
+ * tests/actions.at (Default %printer and %destructor): New test to
+ check that the right %printer and %destructor are called, that they're
+ not called for $end, and that $$ and @$ work correctly.
+ (Default %printer and %destructor for user-declared end token): New
+ test to check that the default %printer and %destructor are called for
+ a user-declared end token.
+ * tests/input.at (Default %printer and %destructor redeclared, Unused
+ values with default %destructor): New tests to check related grammar
+ warnings and errors.
+
+2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Clean up handling of %destructor for the end token (token 0).
+ Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
+ and
+ <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
+
+ Make the skeletons consistent in how they pop the end token and invoke
+ its %destructor.
+ * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
+ state, which has token number 0, since this would invoke the
+ %destructor for the end token.
+ * data/lalr1.cc (yy::parser::parse): Don't check for the final state
+ until after shifting the end token, or else it won't be popped.
+ * data/yacc.c (yyparse): Likewise.
+
+ * data/glr.c (yyparse): Clear the lookahead after shifting it even when
+ it's the end token. Upon termination, destroy an unshifted lookahead
+ even when it's the end token.
+ * data/lalr1.cc (yy::parser::parse): Likewise.
+ * data/yacc.c (yyparse): Likewise.
+
+ * src/reader.c (packgram): Don't check rule 0. This suppresses unused
+ value warnings for the end token when the user gives the end token a
+ %destructor.
+
+ * tests/actions.at (Printers and Destructors): Test all the above.
+
+2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ Update to latest gnulib and gettext versions.
+ * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
+ Add fopen-safer.
+ (gnulib_files): Add m4/warning.m4. Don't worry about files
+ overwritten by autopoint.
+ Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
+ Suppress "id", "ms", "tr" translations for now, since gettext 0.15
+ rejects them.
+ Don't use autoreconf; instead, invoke autopoint etc. by hand,
+ so that we can remove the intl files at a better time.
+ (intl_files_to_remove): Remove aclocal.m4, since it gets
+ rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
+ m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
+ m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
+ Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
+ Remove datarootdir hack; no longer needed.
+ * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
+ (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
+ * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
+ strdup.h.
+ * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
+ * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
+
+2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap: Adjust to today's change to gnulib-tool by invoking
+ it with --assume-autoconf='latest-stable'.
+
+2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
+ least 1.4.7 and 1.4.4) by putting a #line between `typedef union
+ YYSTYPE' and `{'.
+ * src/muscle_tab.h (muscle_grow): Replace the header comments with
+ those from muscle_tab.c since the old ones are misleading.
+
+2006-07-13 Akim Demaille <akim@epita.fr>
+
+ Support %define "KEY" {VALUE}.
+ * src/scan-code.h, src/scan-code.l (translate_action)
+ (translate_rule_action, translate_symbol_action, translate_code):
+ Return char *, not const char *.
+ * src/parse-gram.y (declaration): Rename as...
+ (prologue_declaration): this.
+ (string_content): Remove this nonterminal, use STRING.
+ (braceless, content, content.opt): New nonterminal.
+ Use them.
+ (%define): Now accept content.opt, i.e., accept also BRACED_CODE
+ as value.
+ * src/scan-gram.l (getargs.h): Don't include it.
+
+2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
+ rather than a for-loop that declares a local bool variable. This
+ should work around a compatibility problem with a Cray x1e C++
+ compiler reported by Hung Nguyen in
+ <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
+ The for-loop was introduced in the 2004-11-17 change but I don't
+ know why it was needed.
+
+2006-07-12 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4: Comment changes.
+
+2006-07-10 Akim Demaille <akim@lrde.epita.fr>
+
+ * src/complain.c (error_message, ERROR_MESSAGE): New.
+ To factor...
+ (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
+ * src/complain.h, src/complain.c (warning_issued): Remove, unused.
+
+2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Instead of %union, you can define and use your own union type
+ YYSTYPE if your grammar contains at least one <type> tag.
+ Your YYSTYPE need not be a macro; it can be a typedef.
+ * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
+ (Union Decl, Decl Summary): Document this.
+ * data/glr.c (YYSTYPE): Implement this.
+ * data/glr.cc (YYSTYPE): Likewise.
+ * data/lalr1.cc (YYSTYPE): Likewise.
+ * data/yacc.c (YYSTYPE): Likewise.
+ * src/output.c (prepare): Output tag_seen_flag.
+ * src/parse-gram.y (declaration, grammar_declaration):
+ Use 'union_seen' rather than 'typed' to determine whether
+ %union has been seen, since grammars can now be typed without
+ %union.
+ (symbol_declaration, type.opt, symbol_def):
+ Keep track of whether a tag has been seen.
+ * src/reader.c (union_seen, tag_seen): New vars.
+ (typed): remove.
+ * src/reader.h (union_seen, tag_seen, typed): Likewise.
+ * src/scan-code.l (untyped_var_seen): New variable.
+ (handle_action_dollar): Adjust to above changes.
+ (handle_action_dollar, handle_action_at):
+ Improve overflow checking for outlandish numbers.
+ * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
+ avoid new diagnostics generated by above changes.
+ * tests/regression.at (YYSTYPE typedef): Add test to check
+ for type tags without %union.
+
+ * src/symlist.c (symbol_list_length): Return int, not unsigned
+ int, since callers expect int. This may need to get revisited
+ once we have proper integer overflow checking.
+
+ * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
+ object is now static.
+
+ * src/getargs.c (flags_argmatch): Return void, not int,
+ to pacify ./configure --enable-gcc-warnings.
+
+ * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
+ since last_string is already defined to FLEX_PREFIX (last_string).
+
+2006-07-09 Akim Demaille <akim@lrde.epita.fr>
+
+ Implement --warnings/-W.
+ * src/getargs.c (report_argmatch, trace_argmatch): Remove,
+ replaced by...
+ (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
+ Adjust callers.
+ * src/getargs.h, src/getargs.c (warnings, warnings_flags)
+ (warnings_args, warnings_types): New.
+ (getargs, short_options, long_options): Accept -W/--warnings.
+ Sort the options by alphabetical order, upper case letter right
+ before its lower case.
+
+2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Change %merge result type clash warnings to errors. Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
+ * src/reader.c (record_merge_function_type): Use complain_at.
+ * tests/glr-regression.at (Missed %merge type warnings when LHS type is
+ declared later): Update test case results.
+
+2006-07-09 Akim Demaille <akim@lrde.epita.fr>
+
+ * src/getargs.h, src/getargs.c: Swap --report and --trace handling
+ to be in alphabetical order.
+ (trace_args): Spelling fixes.
+
+2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
+ so they don't collide with user-defined macros.
+ (yy_stack_print): Don't assume that yytype_int16 promotes to int;
+ this was never guaranteed, and now that we're using gnulib stdint,
+ which defines int_fast16_t to long int, the problem is exposed.
+
+2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/c.m4 (b4_basename): Simplify a bit, since we don't
+ need the full POSIX semantics (and weren't implementing them
+ anyway).
+
+ Adjust to Autoconf 2.60 and today's gnulib.
+ * bootstrap (gnulib_modules): Add stdint.
+ Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
+ no longer copies it.
+ (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
+ since stdint needs the former and wcwidth (which is now required
+ by mbswidth) needs the latter.
+ Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
+ work around a compatibility glitch between gettext 0.14.6 and
+ Autoconf 2.60.
+ * configure.ac (AC_PREREQ): Require Autoconf 2.60.
+ Do not check for uintptr_t, since new stdint module does the right
+ thing.
+ * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
+ Add stdint.h, stdint_.h, wcwidth.h.
+ * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
+ Add absolute-header.m4, double-slash-root.m4, longlong.m4,
+ stdint.m4, wchar_t.m4, wcwidth.m4.
+ * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
+ usual order for ../lib/*.h files.
+ (file_name_split): Use last_component, not base_name, to adjust
+ to gnulib changes.
+ * src/parse-gram.h: Include <strverscmp.h> in the usual order
+ for ../lib/*.h files.
+ (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
+ Define unconditionally, since we now assume the stdint module.
+ * src/scan-skel.l: Include <dirname.h>.
+ (BASE_QPUTS): Use last_component, not base_name.
+ * src/system.h: Include <unlocked-io.h> in the usual order
+ for ../lib/*.h files. Include <stdint.h> unconditionally,
+ since we now use the stdint module.
+ (uintptr_t): Declare if UINTPTR_MAX is not defined, not
+ HAVE_UINTPTR_T, since we now use the stdint module.
+ (base_name): Remove decl, since files now include <dirname.h>
+ to get the decl.
+
+2006-07-08 Akim Demaille <akim@lrde.epita.fr>
+
+ * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
+ New, default to 1.
+ * data/yacc.c, data/glr.c, data/location.cc: Use them.
+ * NEWS, doc/bison.texinfo: The initial column and line are 1 by
+ default.
+ * tests/calc.at: Adjust.
+
+2006-07-08 Akim Demaille <akim@lrde.epita.fr>
+
+ * data/c.m4 (b4_basename): New.
+ (b4_syncline): Also output the location of its invocation (from
+ the skeleton).
+ (b4_user_action, b4_define_user_action, b4_user_actions)
+ (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
+ (b4_user_stype): New.
+ * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
+
+2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ In the grammar file, the first column is 1 not 0 on the first line as
+ on every other line.
+ * src/parse-gram.y (%initial-action): Initialize @$ correctly.
+ * tests/input.at (Torturing the Scanner): Update output.
+
+ * src/scan-gram.l (scanner_cursor): Declare it static.
+
+2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ In warnings, say "previous declaration" rather than "first
+ declaration".
+ * src/symtab.c (redeclaration): Do that here.
+ * src/reader.c (record_merge_function_type): In the case of a result
+ type clash, report the previous declaration rather than the very first
+ one in the grammar file.
+ * tests/glr-regression.at (Missed %merge type warnings when LHS type is
+ declared later): Add a third declaration to check this behavior.
+ * tests/input.at (Incompatible Aliases): Update output.
+
+2006-06-27 Akim Demaille <akim@epita.fr>
+
+ * doc/Doxyfile.in: New.
+ * doc/Makefile.am: Use it.
+ * src/lalr.h, src/symtab.h: Initial doxygenation.
+
+2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't miss %merge result type warnings just because the LHS types are
+ declared after the %merge. This continues the effort of the previous
+ patch.
+ * src/reader.c (get_merge_function): Don't set the merger type yet.
+ (record_merge_function_type): New function for setting the merger type
+ and checking for clashes.
+ (grammar_current_rule_merge_set): Set the location of the %merge for
+ the current rule.
+ (packgram): Invoke record_merge_function_type for each rule now that
+ all symbol type declarations have been parsed.
+ * src/reader.h (merger_list.type_declaration_location): New member
+ storing the location of the first %merge from which the type for this
+ merging function was derived.
+ * src/symlist.h (symbol_list.merger_declaration_location): New member
+ storing the location of a rule's %merge, if any.
+ * tests/glr-regression.at (Missed %merge type warnings when LHS type is
+ declared later): New test to catch the error fixed by the above patch.
+
+2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Get action warnings (grammar_rule_check) right even when symbol
+ declarations appear after the rules. Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
+ and
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
+ Don't mistake the type of $$ in a midrule to be that of its parent
+ rule's $$.
+ * src/reader.c (grammar_current_rule_end): Don't invoke
+ grammar_rule_check yet since not all symbol declarations may have been
+ parsed yet.
+ (grammar_midrule_action): Likewise.
+ Don't record whether the midrule's $$ has been used yet since actions
+ haven't been translated yet.
+ Record the midrule's parent rule and its RHS index within the parent
+ rule.
+ (grammar_current_rule_action_append): Don't translate the action yet
+ since not all symbol declarations may have been parsed yet and, thus,
+ warnings about types for $$, $n, @$, and @n can't be reported yet.
+ (packgram): Translate the action and invoke grammar_rule_check now that
+ all symbol declarations have been parsed.
+ * src/scan-code.l (handle_action_dollar): Now that this is invoked
+ after parsing the entire grammar file, the symbol list here in the case
+ of a midrule is actually the midrule's empty RHS, so reference its
+ parent rule's RHS where necessary.
+ On the other hand, now that you can already know it's a midrule, you
+ aren't forced to think $$ has the same type as its parent rule's $$.
+ (handle_action_at): In the case of a midrule, reference the parent rule
+ where necessary.
+ * src/symlist.c (symbol_list_new): Initialize new midrule-related
+ members.
+ (symbol_list_length): Now that this is invoked after all rules have
+ been parsed, a NULL symbol (rather than a NULL symbol list node)
+ terminates a rule. symbol_list_print already does this correctly.
+ * src/symlist.h (symbol_list.midrule_parent_rule,
+ symbol_list.midrule_parent_rhs_index): New members so that midrules can
+ remember their relationships with their parents.
+ * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
+ fixed by the above patch.
+ (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
+ implementing...
+ (Unused values): ... this old test case and...
+ (Unused values before symbol declarations): ... this new test case.
+ This one is the same as `Unused values' except that all symbol
+ declarations appear after the rules in order to catch the rest of the
+ errors fixed by the above patch.
+
+2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ More cleanup.
+ * src/reader.c (current_rule): Declare it static since it's no longer
+ used outside this file.
+ (grammar_current_rule_action_append): Remove redundant arguments from
+ translate_rule_action invocation.
+ * src/reader.h (current_rule): Remove this unused extern.
+ * src/scan-code.h (translate_rule_action): Remove redundant arguments.
+ * src/scan-code.l (translate_rule_action): Likewise.
+
+2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Clean up yesterday's patch.
+ * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
+ to...
+ * src/reader.c (grammar_current_rule_action_append): ... here for
+ consistency with grammar_current_rule_symbol_append.
+ * tests/regression.at (Braced code in declaration in rules section):
+ Make yyerror and yylex static as usual.
+
+2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Fix bug that mistakes braced code in a declaration in the rules section
+ to be a rule action. Mentioned at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
+ * src/scan-gram.l: Move midrule action detection from the start of the
+ scanning of any braced code to...
+ * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
+ action. For readability, use $2 and @2 rather than the equivalent
+ global variables.
+ * tests/regression.at (Braced code in declaration in rules section):
+ New test to catch the error fixed by the above patch.
+
+ Work on code readability some.
+ * src/scan-code.l (current_rule): Get rid of this misleading and
+ redundant declaration: it's actually extern'ed in reader.h.
+ (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
+ translate_action): Add a rule argument and use it instead of the global
+ current_rule.
+ (translate_rule_action): This already receives current_rule through an
+ argument, so pass it on to translate_action instead of assigning
+ current_rule to current_rule.
+ (translate_symbol_action, translate_code): Pass rule = NULL to
+ translate_action.
+
+2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Rename %before-definitions to %start-header and %after-definitions to
+ %end-header. Don't use these declarations to separate pre-prologue
+ blocks from post-prologue blocks. Add new order-independent
+ declarations %before-header and %after-header as alternatives to the
+ traditional Yacc pre-prologue and post-prologue blocks. Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
+ * NEWS (2.3+): Update for these changes.
+ * data/glr.c (b4_before_definitions): Update to...
+ (b4_start_header): ... this.
+ (b4_after_definitions): Update to...
+ (b4_end_header): ... this.
+ * data/glr.cc: Likewise.
+ * data/lalr1.cc: Likewise.
+ * data/yacc.c: Likewise.
+ * doc/bison.texinfo (The prologue): Update names, and replace remaining
+ prologue blocks with %*-header declarations.
+ (Calc++ Parser): Likewise.
+ (Decl Summary): Update names.
+ (Table of Symbols): Update description.
+ * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
+ (PERCENT_END_HEADER): ... this.
+ (PERCENT_BEFORE_DEFINITIONS): Update to...
+ (PERCENT_START_HEADER): ... this.
+ (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
+ (declaration): Update token names and m4 macro names.
+ When parsing %end-header and %start-header, invoke translate_code
+ before muscle_code_grow, and no longer set global booleans to remember
+ whether these declarations have been seen.
+ Parse new %after-header and %before-header.
+ * src/reader.c (before_definitions, after_definitions): Remove.
+ (prologue_augment): Accept a new bool argument to specify whether to
+ augment the pre-prologue or post-prologue.
+ * src/reader.h (before_definitions, after_definitions): Remove these
+ extern's.
+ (prologue_augment): Add new bool argument.
+ * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
+ (PERCENT_END_HEADER): ... this.
+ (PERCENT_BEFORE_DEFINITIONS): Update to...
+ (PERCENT_START_HEADER): ... this.
+ (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
+ * tests/actions.at (Printers and Destructors): Update names.
+
+2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Add comparison operators for C++ location classes. Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
+ * data/c++.m4 (b4_define_location_comparison): New boolean %define
+ declaration indicating whether filename_type has an operator==. If
+ filename_type is `std::string', it defaults to `1', `0' otherwise.
+ * data/location.cc: Iff b4_define_location_comparison is `1', add
+ operator== and operator!= for class position and for class location.
+
+ Some minor fixes.
+ * src/scan-action.l: Remove unused file.
+ * src/symtab.c (symbol_printer_set): Use printer_location not
+ destructor_location.
+ * src/symtab.h (struct symbol): Replace incorrect source comment for
+ printer members.
+ * tests/input.at (Incompatible Aliases): Update output with correct
+ printer location.
+
+2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't put the pre-prologue in the header file. For the yacc.c code
+ file and the glr.c header and code files, move the pre-prologue before
+ the token definitions. Add new %before-definitions and
+ %after-definitions to declare code that will go in both the header file
+ and code file. Discussed at
+ <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
+ <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
+ and
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
+ * NEWS (2.3+): Describe these changes.
+ * data/glr.c (b4_pre_prologue): Move from within to before...
+ (b4_shared_declarations): ... this.
+ Add new b4_before_definitions before b4_token_enums.
+ Add new b4_after_definitions at the end.
+ * data/glr.cc (b4_pre_prologue): Replace with...
+ (b4_before_definitions): ... this in the header file.
+ (b4_after_definitions): New near the end of the header file.
+ * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
+ code file right before including the header file.
+ (b4_before_definitions): New in the previous position of
+ b4_pre_prologue in the header file.
+ (b4_after_definitions): New near the end of the header file.
+ * data/yacc.c: Clean up some m4 quoting especially in the header file.
+ (b4_token_enums_defines): In the code file, move to right before
+ YYSTYPE for consistency with the header file.
+ (b4_before_definitions): New right before b4_token_enums_defines in
+ both the header and code file.
+ (b4_after_definitions): New right after YYLTYPE and yylloc in both the
+ header and code file.
+ * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
+ of prologues for %union dependencies.
+ (Decl Summary): In %defines description, mention the effect of
+ %before-definitions and %after-definitions on the header file.
+ (Calc++ Parser): Forward declare driver in a %before-definitions rather
+ than in the pre-prologue so that make check succeeds.
+ (Table of Symbols): Add entries for %before-definitions and
+ %after-definitions.
+ * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
+ %before-definitions.
+ (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
+ (declaration): Parse those declarations and append to
+ b4_before_definitions and b4_after_definitions, respectively.
+ * src/reader.c (before_definitions, after_definitions): New bools to
+ track whether those declarations have been seen.
+ (prologue_augment): Add to the post-prologue if %union,
+ %before-definitions, or %after-definitions has been seen.
+ * src/reader.h (before_definitions, after_definitions): New extern's.
+ * src/scan-gram.l: Scan the new declarations.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
+ prologue block in a %before-definitions or a %after-definitions based
+ on whether the %union is declared.
+ * tests/regression.at (Early token definitions with --yacc, Early token
+ definitions without --yacc): Move tests for token definitions into the
+ post-prologue since token names are no longer defined in the
+ pre-prologue.
+
+2006-06-20 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
+ (symbol_get): Use it.
+ * src/parse-gram.y: Use it.
+
+2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/scan-gram.l: Remove unused declaration of last_string_1 so the
+ build succeeds when configured with --enable-gcc-warnings.
+
+2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/parse-gram.y (char_name): New function.
+ (CHAR, STRING, string_content): For %printer, properly escape.
+ (ID): Prefer fputs to fprintf.
+ (id): Reindent to be consistent with other rules.
+ Properly quote char.
+
+ The Translation Project changed its way of publishing translations
+ to maintainers. I haven't received any responses to my request
+ for supporting the old way, or for documenting the new way. I
+ have modified 'bootstrap' to use screen scraping
+ (in this case, HTML scraping). This is unreliable and inelegant,
+ but I don't see any better way. Yuck.
+ * bootstrap (TP_URL, WGET_COMMAND): New vars.
+ (get_translations): New function, which uses HTML scraping to
+ deduce locations of latest translations.
+ Use this function to grab both bison and bison-runtime .po files.
+ Don't bother priming the pump for the runtime-po domain any more,
+ as it's now translated better than bison is.
+
+2006-06-19 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l: No longer "parse" things after `%union' until
+ `{'. Rather, return a single "%union" token.
+ No longer make symbols: return strings, and leave the conversion
+ to symbols to the parser.
+ (SC_PRE_CODE, token_type): Remove.
+ * src/parse-gram.y (%union): New field `character'.
+ Sort tokens.
+ (CHAR): New token.
+ (ID, ID_COLON): Now that the scanner no longer makes them
+ identifiers, adjust all uses to invoke symbol_get.
+ (id_colon): New, wraps the conversion from string to symbol.
+ (%union): Accept a possible union_name.
+ (symbol): Now can be a char.
+ * data/c.m4 (b4_union_name): Leave a default value.
+ * data/glr.c, data/yacc.c: Use it.
+
+2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ For associating token numbers with token names for "yacc.c", don't use
+ #define statements unless `--yacc' is specified; always use enum
+ yytokentype. Most important discussions start at:
+ <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
+ <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
+ and
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
+ * NEWS (2.3+): Mention.
+ * data/c.m4 (b4_yacc_if): New.
+ (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
+ token #define's.
+ * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
+ on token name definitions.
+ * src/getargs.c (usage): Capitalize `Yacc' in English.
+ * src/output.c (prepare): Define b4_yacc_flag.
+ * tests/regression.at (Early token definitions): Test that tokens names
+ are defined before the pre-prologue not just before the post-prologue.
+ Remove this test case and copy to...
+ (Early token definitions with --yacc): ... this to test #define's.
+ (Early token definitions without --yacc): ... and this to test enums.
+
+2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Reword the post-2.3 change to not be so optimistic about
+ removing the old "look-ahead" spelling.
+ Update previous look-ahead/lookahead change reports.
+ * REFERENCES: look-ahead -> lookahead (since that's
+ what he actually wrote).
+ * doc/refcard.tex: look ahead -> lookahead,
+ look-ahead -> lookahead
+
+2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ For consistency, use `lookahead' instead of `look-ahead' or
+ `look_ahead'. Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
+ and then at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
+ * NEWS: For the next release, note the change to `--report'.
+ * TODO, doc/bison.1: Update English.
+ * doc/bison.texinfo: Update English.
+ (Understanding Your Parser, Bison Options): Document as
+ `--report=lookahead' rather than `--report=look-ahead'.
+ * src/conflicts.c: Update English in comments.
+ (lookahead_set): Rename from look_ahead_set.
+ (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
+ (resolve_sr_conflict): Rename local look_ahead_tokens to
+ lookahead_tokens, and update other uses.
+ (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
+ count_rr_conflicts, conflicts_free): Update uses.
+ * src/getargs.c (report_args): Move "lookahead" before alternate
+ spellings.
+ (report_types): Update uses.
+ (usage): For `--report' usage description, state `lookahead' spelling
+ rather than `look-ahead'.
+ * src/getargs.h (report.report_lookahead_tokens): Rename from
+ report_look_ahead_tokens.
+ * src/lalr.c: Update English in comments.
+ (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
+ (state_lookahead_tokens_count): Rename from
+ state_look_ahead_tokens_count.
+ Rename local n_look_ahead_tokens to n_lookahead_tokens.
+ (lookahead_tokens_print): Rename from look_ahead_tokens_print.
+ Rename local n_look_ahead_tokens to n_lookahead_tokens.
+ Update other uses.
+ Update English in output.
+ (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
+ * src/print.c: Update English in comments.
+ (lookahead_set): Rename from look_ahead_set.
+ (print_reduction): Rename argument lookahead_token from
+ look_ahead_token.
+ (print_core, state_default_rule, print_reductions, print_results):
+ Update uses.
+ * src/print_graph.c: Update English in comments.
+ (print_core): Update uses.
+ * src/state.c: Update English in comments.
+ (reductions_new): Update uses.
+ (state_rule_lookahead_tokens_print): Rename from
+ state_rule_look_ahead_tokens_print, and update other uses.
+ * src/state.h: Update English in comments.
+ (reductions.lookahead_tokens): Rename from look_ahead_tokens.
+ (state_rule_lookahead_tokens_print): Rename from
+ state_rule_look_ahead_tokens_print.
+ * src/tables.c: Update English in comments.
+ (conflict_row, action_row): Update uses.
+ * tests/glr-regression.at
+ (Incorrect lookahead during deterministic GLR,
+ Incorrect lookahead during nondeterministic GLR): Rename
+ print_look_ahead to print_lookahead.
+ * tests/torture.at: Update English in comments.
+ (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
+ AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
+ (Many lookahead tokens): Update uses.
+ * data/glr.c: Update English in comments.
+ * lalr1.cc: Likewise.
+ * yacc.c: Likewise.
+ * src/conflicts.h: Likewise.
+ * src/lalr.h: Likewise.
+ * src/main.c: Likewise.
+ * src/output.c: Likewise.
+ * src/parse-gram.c: Likewise.
+ * src/tables.h: Likewise.
+ * tests/calc.at: Likewise.
+
+2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
+
+2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * TODO: Add request from Nelson H. F. Beebe to be able to install
+ Bison without installing the yacc script.
+
+2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
+ and yytext if they're already #define'd.
+ * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
+ * src/scan-code-c.c: ... here.
+ * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
+ <config.h>.
+
+2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Get Bison to build again when configured with --enable-gcc-warnings.
+ * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
+ missing #include's.
+ * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
+ loc argument as it shadows a global.
+ * src/scan-gram.l: Remove stray comma that prevents boundary_set
+ invocation.
+
+ * src/.cvsignore: Add scan-code.c.
+
+2006-06-07 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l: Move the "add a trailing ; to actions" code
+ to...
+ * src/scan-code.l: here.
+ * tests/input.at (Torturing the Scanner): Fix another location
+ error.
+
+2006-06-07 Akim Demaille <akim@epita.fr>
+
+ * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
+
+2006-06-06 Akim Demaille <akim@epita.fr>
+
+ Extract the parsing of user actions from the grammar scanner.
+ As a consequence, the relation between the grammar scanner and
+ parser is much simpler. We can also split "composite tokens" back
+ into simple tokens.
+ * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
+ * src/scan-gram.l (add_column_width, adjust_location): Move to and
+ rename as...
+ * src/location.h, src/location.c (add_column_width)
+ (location_compute): these.
+ Fix the column count: the initial column is 0.
+ (location_print): Be robust to ending column being 0.
+ * src/location.h (boundary_set): New.
+ * src/main.c: Adjust to scanner_free being renamed as
+ gram_scanner_free.
+ * src/output.c: Include scan-code.h.
+ * src/parse-gram.y: Include scan-gram.h and scan-code.h.
+ Use boundary_set.
+ (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
+ (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
+ which is now, again, a separate token.
+ Adjust all dependencies.
+ Whereever actions with $ and @ are used, use translate_code.
+ (action): Remove this nonterminal which is now useless.
+ * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
+ (grammar_current_rule_action_append): Use translate_code.
+ (packgram): Bound check ruleno, itemno, and rule_length.
+ * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
+ (last_string, last_braced_code_loc, max_left_semantic_context)
+ (scanner_initialize, scanner_free, scanner_last_string_free)
+ (gram_out, gram_lineno, YY_DECL_): Move to...
+ * src/scan-gram.h: this new file.
+ (YY_DECL): Rename as...
+ (GRAM_DECL): this.
+ * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
+ * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
+ (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
+ (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
+ Move these declarations, and...
+ (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
+ these to...
+ * src/flex-scanner.h: this new file.
+ * src/scan-gram.l (rule_length, rule_length_overflow)
+ (increment_rule_length): Remove.
+ (last_braced_code_loc): Rename as...
+ (gram_last_braced_code_loc): this.
+ Adjust to the changes of the parser.
+ Move all the handling of $ and @ into...
+ * src/scan-code.l: here.
+ * src/scan-gram.l (handle_dollar, handle_at): Remove.
+ (handle_action_dollar, handle_action_at): Move to...
+ * src/scan-code.l: here.
+ * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
+ scan-code.h, scan-code-c.c, scan-gram.h.
+ (EXTRA_bison_SOURCES): Add scan-code.l.
+ (BUILT_SOURCES): Add scan-code.c.
+ (yacc): Be robust to white spaces.
+
+ * tests/conflicts.at, tests/input.at, tests/reduce.at,
+ * tests/regression.at: Adjust the column numbers.
+ * tests/regression.at: Adjust the error message.
+
+2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
+ Use Akim's wording from
+ <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
+
+2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Between Bison releases, manually append `+' to the previous Bison
+ release number, and use that as a signal to automatically print the
+ ChangeLog's CVS Id keyword from --version. Discussed starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
+ * ChangeLog: Add Id header.
+ * configure.ac (AC_INIT): Append `+' to `2.3'.
+ * src/.cvsignore: Add revision.c.
+ * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
+ (BUILT_SOURCES): Add revision.c.
+ (revision.c): New target rule. This file defines a new global variable
+ named revision. It initializes it with either the Id from ChangeLog
+ or, if VERSION doesn't contain `+', with the empty string.
+ * src/getargs.c (version): Print the value of revision.
+ * src/revision.h: Extern revision.
+
+2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 2.3.
+ * configure.ac (AC_INIT): Likewise.
+
+2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (YYRECOVERING): Define to be a function-like macro
+ with no arguments, not as an object-like macro. This is for
+ compatibility with data/yacc.c. Problem reported by John P. Hartmann in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
+ * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
+ Document this.
+
+2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/getargs.c (usage): Back out yesterday's modification of the
+ --help output so that we don't have to wait for translation before
+ releasing 2.3.
+
+2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
+ Problem reported by Akim Demaille.
+
+2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
+
+2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (yy_reduce_print): Omit trailing white space in
+ generated source code. Problem reported by Frans Englich in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
+
+2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
+ shell, not within 'make', so that 'make' by an ordinary builder
+ (using GNU make) does not worry about configuring gzip. This also
+ works around a bug reported independently by Keith Thompson and by
+ Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
+ stderr rather than stdout, messing up the build logs.
+
+2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
+ to make sure that YYID will never be unused. This fixes a 'make
+ maintainer-check' failure caused by the recent changes to the 'Trivial
+ grammars' test case, which caused g++ 4.1.0 to complain that YYID was
+ not used.
+ * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
+
+2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
+ state before an empty RHS is always resolved here. Only the location
+ of that state is guaranteed to be resolved, and that's enough. This
+ fixes the remaining bug reported by Derek M. Jones in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
+ * tests/glr-regression.at (Uninitialized location when reporting
+ ambiguity): Test the above case.
+ Also, the embedded comments in this test case claim it checks the case
+ of an empty RHS that has inherited the initial location. However, the
+ corresponding LHS was already resolved, so yyresolveLocations didn't
+ actually have reason to modify it. Fix this by forcing
+ nondeterministic operation at the beginning of the parse.
+
+2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/c.m4 (b4_yy_symbol_print_generate):
+ (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
+ 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
+ of the bugs reported today by Derek M Jones in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
+ * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
+ defined to be a type name without parens or brackets.
+ (Location Type): Similarly for YYLTYPE.
+ * tests/regression.at (Trivial grammars): Put in a test for this
+ bug that will be caught by 'make maintainer-check' (though not,
+ alas, by 'make check' unless your compiler is picky).
+
+2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 2.2.
+ * configure.ac (AC_INIT): Likewise.
+
+2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/glr.c (yyreportTree): Make room in yystates for the state
+ preceding the RHS. This fixes the segmentation fault reported by Derek
+ M. Jones in
+ <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
+ (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
+ to the user. Reported for yyreportTree by Derek M. Jones later in the
+ same thread.
+ * THANKS: Add Derek M. Jones.
+ Update my email address.
+ Fix typo in Steve Murphy's name.
+
+2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
+ checking against YYLAST that caused the parser to miss a potential
+ alternative in its diagnostic.
+ Problem reported by Maria Jose Moron Fernandez in
+ <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
+ * data/lalr1.cc (yysyntax_error_): Likewise.
+ * data/yacc.c (yysyntax_error): Likewise.
+ * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
+ tokens, in case we run into an older C compiler.
+ (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
+ Use them to check for the off-by-one error fixed above.
+
+ * data/yacc.c (yytnamerr): Fix typo: local var should be of type
+ YYSIZE_T, not size_t.
+ * tests/regression.at (Trivial grammars): New test, to catch
+ the error fixed by the above patch.
+
+2006-05-14 Akim Demaille <akim@lrde.epita.fr>
+
+ * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
+ scheme.
+ Reported by Steve Murphy.
+
+2006-05-14 Akim Demaille <akim@lrde.epita.fr>
+
+ * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
+ * data/glr.cc: b4_location_flag is now b4_locations_flag.
+
+2006-05-14 Akim Demaille <akim@lrde.epita.fr>
+
+ Implement --trace=m4.
+ * src/getargs.c (trace_types, trace_args): Accept trace_m4.
+ * src/output.c (output_skeleton): When set, pass -dV to m4.
+
+ Factor the handling of flags in m4.
+ * src/output.c (prepare): Rename the muscle names debug, defines,
+ error_verbose to debug_flag, defines_flag, error_verbose_flag.
+ * data/c.m4: Adjust.
+ (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
+ Use b4_define_flag_if to define other b4_FLAG_if macros.
+ (b4_location_if): As a consequence, rename as...
+ (b4_locations_if): this, for consistency.
+ Adjust all the skeletons.
+
+2006-05-14 Akim Demaille <akim@lrde.epita.fr>
+
+ * etc/bench.pm: Shorten bench names.
+
+2006-05-14 Akim Demaille <akim@lrde.epita.fr>
+
+ * src/output.h, src/output.c (error_verbose): Move to...
+ * src/getargs.h, src/getargs.c: here.
+ Sort the flags.
+ Adjust dependencies.
+
+2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/c.m4 (b4_copyright): Put the special exception for Bison
+ skeletons here, so we don't have to put it in each skeleton. All
+ uses changed. Suggested by Akim Demaille. Also, wrap the
+ copyright notice, in case it is longer than 80 columns. Replace
+ comma by newline after title.
+
+2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
+ incompatibility, not a bug. Mention that it wasn't fixed as of
+ flex 2.5.33.
+
+2006-05-11 Akim Demaille <akim@lrde.epita.fr>
+
+ * examples/extexi: Enforce the precedence of concatenation over
+ >>.
+ Reported by Tommy Nordgren.
+
+2006-05-11 Akim Demaille <akim@lrde.epita.fr>
+
+ * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
+ with the member "token".
+ Reported by Martin Nylin.
+
+2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c: Switch to Bison 2.2 special-exception language in
+ the copyright notice. Use more-regular format for titles and
+ copyright notices.
+ * data/glr.cc: Likewise.
+ * data/location.cc: Likewise.
+ * data/yacc.cc: Likewise.
+ * doc/bison.texinfo (Conditions): Document this.
+ * NEWS: likewise. Upgrade version to 2.2.
+
+2006-04-27 Akim Demaille <akim@lrde.epita.fr>
+
+ * data/glr.cc: Remove dead code.
+
+2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
+ that variable and the line breaks the bootstrap. Problem reported
+ by Juan M. Guerrero.
+
+2006-04-24 Akim Demaille <akim@lrde.epita.fr>
+
+ * doc/bison.texinfo (Multiple start-symbols): New.
+
+2006-04-24 Akim Demaille <akim@lrde.epita.fr>
+
+ * etc/README, etc/bench.pl: New.
+
+2006-04-03 Akim Demaille <akim@lrde.epita.fr>
+
+ * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
+ rule.
+ Reported by Mickael Labau.
+ * tests/input.at (Torturing the Scanner): Test it.
+
+2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
+ Problem reported by Bob Rossi.
+
+2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
+ and didn't really work.
+ For the index, use @ifnotinfo, not @iftex.
+ Minor cleanups of spacing and terminology.
+
+2006-03-12 Akim Demaille <akim@lrde.epita.fr>
+
+ * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
+ of AT_NAME_PREFIX when %name-prefix is not used.
+
+2006-03-12 Akim Demaille <akim@lrde.epita.fr>
+
+ Apply --prefix to C++ skeletons too: they change the namespace.
+ The test suite already exercize these cases.
+ * data/c++.m4 (b4_namespace): New.
+ * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
+ * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
+ * data/yacc.c, data/glr.c: Remove a useless `[]'.
+ * doc/bison.texinfo: Document it.
+ (Option Cross Key): Use @multitable in all formats. It looks
+ nicer, even in TeX outputs.
+ (Rules): Use the same code whatever the output type is.
+ * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
+ (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
+ * tests/calc.at: Use it, instead of hard coding `yy'.
+
+2006-03-10 Akim Demaille <akim@lrde.epita.fr>
+
+ * TODO: Remove dead items.
+
+2006-03-10 Akim Demaille <akim@lrde.epita.fr>
+
+ * doc/FAQ: Remove, merged into...
+ * doc/bison.texinfo (FAQ): this.
+ * doc/Makefile.am (EXTRA_DIST): Adjust.
+
+2006-03-10 Akim Demaille <akim@lrde.epita.fr>
+
+ * data/c.m4 (b4_token_enum): Always define the enum of tokens,
+ even if empty.
+ * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
+ * doc/bison.texinfo (Calc++ Scanner): Use it.
+
+2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix two nits reported by twlevo, plus one more that I discovered.
+
+ * src/assoc.h (assoc_to_string): Give a name to the arg, as
+ this is the usual Bison style.
+ * src/location.h (location_print): Likewise.
+
+ * src/reader.h (token_name): Likewise.
+
+2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix some nits reported by twlevo.
+ * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
+ and "POSIX". Use more-modern syntax for URLs. Mention C++
+ and ask for Java. Don't hardwire OS version numbers. Add
+ copyright notice.
+ * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
+ * src/conflicts.c (solved_conflicts_obstack): Now static.
+
+2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
+ page. Say "you can use it" not "you may use it" as on the web page;
+ we're describing capabilities not granting permission.
+
+2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yyresolveLocations): Rename local variables to avoid
+ shadowing warnings. Use usual patter for iterating through RHS.
+ * tests/glr-regression.at
+ (Uninitialized location when reporting ambiguity):
+ Modify yylex so that it uses its argument, rather than trying
+ to rely on ARGSUSED (which doesn't work for gcc with warnings).
+ const char -> char const.
+
+ * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
+ Don't use tabs inside commands; it messes up 'ps'.
+ Problem reported by twlevo.
+
+2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * tests/glr-regression.at (Uninitialized location when reporting
+ ambiguity): New test case.
+ * data/glr.c (yyresolveLocations): New function, which uses
+ YYLLOC_DEFAULT.
+ (yyresolveValue): Invoke yyresolveLocations before reporting an
+ ambiguity.
+ * doc/bison.texinfo (Default Action for Locations): Note
+ YYLLOC_DEFAULT's usage for ambiguity locations.
+ (GLR Semantic Actions): Cross-reference those notes.
+
+2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * tests/glr-regression.at (Leaked semantic values when reporting
+ ambiguity): Remove unnecessary union and type declarations.
+ (Leaked lookahead after nondeterministic parse syntax error): New test
+ case.
+ * data/glr.c (yyparse): Check for zero stacks remaining before
+ attempting to shift the lookahead so that you don't lose it.
+
+2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
+ * tests/glr-regression.at (Leaked semantic values when reporting
+ ambiguity): New test case.
+ * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
+ yyabort rather than invoking yyFail, which invokes longjmp. Remove the
+ now unnecessary yystackp parameter.
+ (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
+ destructors can be called.
+
+ * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
+ in existing testcases.
+
+2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't leak semantic values for parent RHS when a user action cuts the
+ parser, and clean up related code a bit.
+ * tests/glr-regression.at (Leaked merged semantic value if user action
+ cuts parse): Rename to...
+ (Leaked semantic values if user action cuts parse): ... this. Add check
+ for leaked parent RHS values.
+ * data/glr.c (yydestroyGLRState): In debugging output, distinguish
+ between an unresolved state (non-empty chain of semantic options) and
+ an incomplete one (signaled by an empty chain).
+ (yyresolveStates): Document the interface. Move all manipulation of a
+ successfully or unsuccessfully resolved yyGLRState to...
+ (yyresolveValue): ... here so that yyresolveValue always leaves a
+ yyGLRState with consistent data and thus is easier to understand.
+ Remove the yyvalp and yylocp parameters since they are always just
+ taken from the yys parameter. When reporting a discarded merged value
+ in debugging output, note that it is incompletely merged. Document the
+ interface.
+ (yyresolveAction): If resolving any of the RHS states fails, destroy
+ them all rather than leaking them. Thus, as long as user actions are
+ written to clean up the RHS correctly, yyresolveAction always cleans up
+ the RHS of a semantic option. Document the interface.
+
+2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
+ led to a segmentation fault in GNU Pascal. Problem reported
+ by Waldek Hebisch.
+
+2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
+ mid-rule action inside a nonterminal symbol in order to declare a
+ destructor for its semantic value.
+
+2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
+ YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
+ __cplusplus && ! defined _STDLIB_H && !
+ ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
+ defined free))]: Include <stdlib.h> rather than rolling our own
+ declarations of malloc and free, to avoid problems with
+ incompatible declarations (using 'throw') C++'s stdlib.h. This
+ should fix Debian bug 340012
+ <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
+ reported by Guillaume Melquiond.
+
+2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Clarify symbols versus types in unused-value warnings.
+
+ * configure.ac (AC_INIT): Bump version number.
+
+2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 2.1a.
+ * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
+ since C99 requires this.
+
+2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * m4/c-working.m4: New file.
+ * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
+
+2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ * Makefile.maint: Merge from coreutils.
+
+2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ More portability fixes for problems summarized by Nelson H. F. Beebe.
+
+ * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
+ configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
+ CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
+ LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
+ messes up because C++ code is compiled in 32-bit mode but linked
+ in 64-bit mode.
+
+2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ More portability fixes for problems summarized by Nelson H. F. Beebe.
+
+ * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
+ 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
+
+ * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
+ nodist_PROGRAMS, since we don't need to actually compile the
+ example if we're just doing a plain 'make'. This avoids bothering
+ the installer unnecessarily about problems due to weird C++
+ compilers.
+
+2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ More portability fixes for problems summarized by Nelson H. F. Beebe.
+
+ * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
+ than #include "...", and compile with -I'.'. The old method was
+ not portable, according to Posix and the C standard, and it does
+ not work with Sun C 5.7, where previous #line directives affect
+ the working directory used in later #include "..." directives.
+
+2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ Various DJGGP specific issues in /djgpp
+
+2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ More portability fixes for problems summarized by Nelson H. F. Beebe.
+
+ * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
+ '#include <map>' works and that you can apply ++ to iterators.
+
+2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Work around portability problems summarized by Nelson H. F. Beebe in
+ <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
+
+ * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
+ that '#include <string>' works.
+
+ * data/lalr1.cc (yytranslate_): No longer inline, to work around a
+ porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
+ "warning: sorry: semantics of inline function static data `const
+ unsigned char translate_table[262]' are wrong (you'll wind up with
+ multiple copies)".
+
+ * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
+ or, xor to not_, and_, or_, and xor_, respectively. This works
+ around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
+ random system header somewhere that includes the equivalent of
+ <iso646.h>.
+
+ * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
+ -E" works; it apparently doesn't work with PathScale EKO Compiler
+ Suite Version 2.0.
+
+2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ During deterministic GLR operation, user actions should be able to
+ influence the parse by changing yychar. To make this easier to fix and
+ to make glr.c easier to evolve in general, don't maintain yytoken in
+ parallel with yychar; just compute yytoken when needed.
+ * tests/glr-regression.at (Incorrect lookahead during deterministic
+ GLR): Check that setting yychar in a user action has the intended
+ effect.
+ * data/glr.c (yyGLRStack): Remove yytokenp member.
+ (yyclearin): Don't set *yytokenp.
+ (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
+ yychar rather than *yytokenp to determine the current lookahead.
+ Compute yytoken locally when needed.
+ (yyparse): Likewise. Remove the local yytoken that yytokenp used to
+ point to.
+
+ * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
+ after `--report' documentation.
+
+2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/parse-gram.y (grammar_declaration): Location of printer
+ symbol is @1, not list->location. Bug reported by twlevo.
+ * tests/input.at (Incompatible Aliases): Adjust to above change.
+
+2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
+ all the test at once. This makes the output easier to read in the
+ normal case.
+
+ Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
+ got from <http://bro-ids.org/download.html>. The bug is that
+ when two actions appeared in succession, the second one was
+ scanned before the first one was added to the grammar rule
+ as a midrule action. Bison then output the incorrect warning
+ "parse.y:905.17-906.36: warning: unused value: $3".
+ * src/parse-gram.y (BRACED_CODE, action): These are no longer
+ associated with a value.
+ (rhs): Don't invoke grammar_current_rule_action_append.
+ (action): Invoke it here instead.
+ * src/reader.c (grammar_midrule_action): Now extern.
+ (grammar_current_rule_action_append): Don't invoke
+ grammar_midrule_action; that is now the scanner's job.
+ * src/reader.h (last_string, last_braced_code_loc):
+ (grammar_midrule_action): New decls.
+ * src/scan-gram.l (last_string): Now extern, sigh.
+ (last_braced_code_loc): New extern variable.
+ (<INITIAL>"{"): Invoke grammar_midrule_action if the current
+ rule already has an action.
+ (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
+ * tests/input.at (AT_CHECK_UNUSED_VALUES):
+ Add some tests to check that the above changes fixed the bug.
+
+2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
+ All used changed. Check whether the symbol has a destructor,
+ not whether it is typed.
+ * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
+ that the values are still reported as unused. All line numbers
+ adjusted.
+
+2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ Work around a bug in bro 0.8, which underparenthesizes its
+ definition of YYLLOC_DEFAULT.
+ * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
+ their arguments.
+ * data/lalr1.cc: Likewise.
+ * data/yacc.cc: Likewise.
+
+2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ Work around a bug in Pike 7.0, and give the Pike folks a
+ better way to override the usual int widths.
+ * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
+ user can override the types.
+ (short): #undef, to work around a bug in Pike 7.0.
+ (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
+ (union yyalloc.yyss): Use yytype_int16 rather than short.
+ All uses changed.
+ (yysigned_char): Remove.
+ * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
+ (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
+ * tests/regression.at (Web2c Actions): Adjust to above changes.
+
+ * src/reader.c (check_and_convert_grammar): New function.
+ (reader): Close the input file even if something went wrong during
+ parsing. Minor file descriptor leak reported by twlevo.
+
+ * src/assoc.c (assoc_to_string): Use a default: abort (); case
+ to pacify gcc -Wswitch-default.
+ * src/scan-gram.l (adjust_location): Use a default: break; case
+ to pacify gcc -Wswitch-default.
+ * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
+ (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
+ (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
+ Move these decls to scan-skel.l, since they don't need to be
+ visible elsewhere.
+ * src/scan-skel.l: Accept the above decls.
+ (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
+ is used.
+
+2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * Makefile.cfg (local-checks-to-skip): Add changelog-check,
+ since we don't want to insist on a version number at the start
+ of the changelog every time.
+ * Makefile.maint: Sync from coreutils a bit better.
+ (sc_trailing_blank): Renamed from sc_trailing_space.
+ All uses changed.
+ (sc_no_if_have_config_h, sc_require_config_h):
+ (sc_prohibit_assert_without_use): New rules.
+ (sc_obsolete_symbols): Don't catch Makefile.maint itself.
+ (sc_dd_max_sym_length): Fix leading spaces in rule.
+ (sc_system_h_headers): Prefix with @.
+ (sc_useless_cpp_parens, m4-check): Output line numbers.
+ (changelog-check): Allow version only in head.
+ * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
+ satisfy new Makefile.maint rule.
+ * data/glr.c: Likewise.
+ * data/glr.cc: Likewise.
+ * data/lalr1.cc: Likewise.
+ * data/yacc.c: Likewise.
+ * lib/ebitsetv.c: Likewise.
+ * lib/lbitset.c: Likewise.
+ * lib/subpipe.c: Likewise.
+ * lib/timevar.c: Likewise.
+ * src/system.h: Likewise.
+ * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
+ * djgpp/Makefile.maint: Add copyright notice.
+ * djgpp/README.in: Likewise.
+ * djgpp/config.bat: Likewise.
+ * djgpp/config.site: Likewise.
+ * djgpp/config_h.sed: Likewise.
+ * djgpp/djunpack.bat: Likewise.
+ * djgpp/config.sed: Fix copyright notice to match standard format.
+ * djgpp/subpipe.h: Likewise.
+ * lib/bitsetv-print.c: Likewise.
+ * lib/bitsetv.c: Likewise.
+ * lib/subpipe.h: Likewise.
+ * lib/timevar.c: Likewise.
+ * lib/timevar.h: Likewise.
+ * djgpp/subpipe.c: Use standard recipe for config.h.
+ * lib/abitset.c: Likewise.
+ * lib/bitset.c: Likewise.
+ * lib/bitset_stats.c: Likewise.
+ * lib/bitsetv-print.c: Likewise.
+ * lib/bitsetv.c: Likewise.
+ * lib/ebitsetv.c: Likewise.
+ * lib/get-errno.c: Likewise.
+ * lib/lbitset.c: Likewise.
+ * lib/subpipe.c: Likewise.
+ * lib/timevar.c: Likewise.
+ * lib/vbitset.c: Likewise.
+ * tests/local.at: Likewise.
+ * src/scan-gram.l: Don't include verify.h, since system.h does
+ that for us.
+ * .x-sc_require_config_h: New file.
+ * .x-sc_unmarked_diagnostics: New file.
+
+2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ Be a bit more systematic about using 'abort'.
+ * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
+ * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
+ Put 'default: abort ();' before some other case, to satisfy older
+ pedantic compilers.
+ * lib/bitset_stats.c (bitset_stats_init): Likewise.
+ * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
+ * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
+ * src/conflicts.c (resolve_sr_conflict): Likewise.
+ * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
+ (get_decision_str, get_orientation_str, get_node_alignment_str):
+ (get_arrow_mode_str, get_crossing_type_str, get_view_str):
+ (get_linestyle_str, get_arrowstyle_str): Likewise.
+ * src/conflicts.c (resolve_sr_conflict):
+ Use a default case rather than one for the one remaining enum
+ value, to catch invalid enum values as well.
+ * src/lalr.c (set_goto_map, map_goto):
+ Prefer "assert (FOO);" to "if (!FOO) abort ();".
+ * src/nullable.c (nullable_compute, token_definitions_output):
+ Likewise.
+ * src/reader.c (packgram, reader): Likewise.
+ * src/state.c (transitions_to, state_new, state_reduction_find):
+ Likewise.
+ * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
+ (symbol_pack): Likewise.
+ * src/tables.c (conflict_row, pack_vector): Likewise.
+ * src/scan-skel.l (QPUTS): Remove unnecessary parens.
+ (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
+ * src/system.h: Don't include <assert.h>.
+ (assert): New macro.
+
+ * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
+ (Destructor Decl, Parser Function, Pure Calling):
+ Describe rules for braces inside C code more carefully.
+
+2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix some porting glitches found by Nelson H. F. Beebe.
+ * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
+ compilers that don't understand that abort () does not return.
+ * src/state.c (transitions_to): Likewise.
+ * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
+ that '#include <cstdlib>' works.
+ * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
+ (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
+ #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
+ for the benefit of some pre-C99 compilers.
+
+ * bootstrap: Undo changes to gnulib files that autoreconf made.
+
+ Minor fixups to get 'make maintainer-check' to work.
+ * configure.ac: Don't use -Wnested-externs, as it's incompatible
+ with the new verify.h implementation.
+ * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
+ * data/glr.c (YYUSE): Depend on __GNUC__ as well.
+ * data/yacc.c (YYUSE): Likewise.
+ * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
+ * lib/subpipe.c (end_of_output_subpipe): The args are unused.
+ * src/parse-gram.y (declaration): Don't pass a string constant
+ to a function that expects char *, since GCC might complain
+ about the constant value.
+ * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
+ * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
+ before #defining them.
+ * tests/glr-regression.at
+ (Incorrectly initialized location for empty right-hand side in GLR):
+ In yyerror, use the msg arg.
+ (Corrupted semantic options if user action cuts parse):
+ (Incorrect lookahead during deterministic GLR):
+ (Incorrect lookahead during nondeterministic GLR):
+ Don't name a local var 'index'; it shadows string.h's 'index'.
+
+2006-01-19 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
+ location, not just parts of it.
+
+2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Document the fact that multiple %unions are now allowed.
+ * doc/bison.texinfo (Union Decl): Likewise.
+ * TODO: This feature is now implemented, so remove it from
+ the wishlist.
+
+ * Makefile.maint: Merge with coreutils Makefile.maint.
+ (CVS_LIST): Use build-aux version if available.
+ (VERSION_REGEXP): New macro.
+ (syntax-check-rules): Add sc_no_if_have_config_h,
+ sc_prohibit_assert_without_use, sc_require_config_h,
+ sc_useless_cpp_parens.
+ (sc_obsolete_symbols): Check for O_NDELAY.
+ (sc_dd_max_sym_length): Track coreutils.
+ (sc_unmarked_diagnostics): Look in all files, not just *.c.
+ (sc_useless_cpp_parens): New rule.
+ (news-date-check): Look for version or today's date.
+ (changelog-check): Don't require version number near head.
+ (copyright-check): Use current year instead of hardwiring 2005.
+ (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
+ (announcement): Add --gpg-key-ID.
+
+ * djgpp/config.sed: Add copyright notice, and replace "filesystem"
+ with "file system".
+
+ Avoid undefined behavior that addressed just before the start of an
+ array. Problem reported by twlevo.
+ * src/reader.c (packgram): Prepend a new sentinel before ritem.
+ * src/lalr.c (build_relations): Rely on new sentinel.
+ * src/gram.c (gram_free): Adjust to new sentinel.
+
+2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
+ yylookaheadNeeds. All uses updated.
+ (yysplitStack): Rename local yynewLookaheadStatuses to
+ yynewLookaheadNeeds.
+ * data/glr-regression.at (Incorrect lookahead during nondeterministic
+ GLR): In comments, change `lookahead status' to `lookahead need'.
+
+2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
+
+ * data/glr.c (yysplitStack): A little stylistic rewrite.
+
+2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
+
+ * data/glr.c (yyaddDeferredAction): Flesh out the comment.
+
+2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * doc/bison.texinfo: Fix some typos.
+ (GLR Semantic Actions): New subsection discussing special
+ considerations because GLR semantic actions might be deferred.
+ (Actions): Mention look-ahead usage of yylval.
+ (Actions and Locations): Mention look-ahead usage of yylloc.
+ (Special Features for Use in Actions): Add YYEOF entry and mention it
+ in the yychar entry.
+ In the yychar entry, remove mention of the local yychar case (pure
+ parser) since this is irrelevant information when writing semantic
+ actions and since it's already discussed in `Table of Symbols' where
+ yychar is otherwise described as an external variable.
+ In the yychar entry, don't call it the `current' look-ahead since it
+ isn't when semantic actions are deferred.
+ In the yychar and yyclearin entries, add note about deferred semantic
+ actions.
+ Add yylloc and yylval entries discussing look-ahead usage.
+ (Look-Ahead Tokens): When discussing yychar, don't call it the
+ `current' look-ahead, and do mention yylval and yylloc.
+ (Error Recovery): Cross-reference `Action Features' when mentioning
+ yyclearin.
+ (Table of Symbols): In the yychar entry, don't call it the `current'
+ look-ahead.
+ In the yylloc and yylval entries, mention look-ahead usage.
+
+2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * tests/glr-regression.at: Update copyright year to 2006.
+
+2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
+ use during nondeterministic operation to track which stacks have
+ actually needed the current lookahead.
+ (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
+ Allocate, deallocate, resize, and otherwise shuffle space for
+ yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
+ (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
+ appropriately during nondeterministic operation.
+ (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
+ members to store the current lookahead to be used by the deferred
+ user action.
+ (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
+ from which the RHS is taken. Set the lookahead members of the new
+ yySemanticOption according to the lookahead status for stack yyk.
+ (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
+ yyaddDeferredAction.
+ (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
+ members of yySemanticOption before invoking yyuserAction, and then set
+ them back to their current values afterward.
+ (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
+ (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
+ * tests/glr-regression.at: Remove `.' from the ends of recent test case
+ titles for consistency.
+ (Leaked merged semantic value if user action cuts parse): In order to
+ suppress lint warnings, use arguments in merge function, and assign
+ char value < 128 in main.
+ (Incorrect lookahead during deterministic GLR): New test case.
+ (Incorrect lookahead during nondeterministic GLR): New test case.
+
+2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
+ !yyvaluep as signal that no semantic value is available to print.
+ * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
+ to print a semantic value.
+
+2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * tests/glr-regression.at: For consistency with my newer test cases,
+ don't thank myself.
+
+2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/glr.c (yyresolveValue): When merging semantic options, if at
+ least one user action succeeds but a later one cuts the parse, then
+ destroy the semantic value before returning rather than leaking it.
+ (yyresolveStates): If a user action cuts the parse and thus
+ yyresolveValue fails, ignore the (unset) semantic value rather than
+ corrupting the yyGLRState, and empty the semantic options list since
+ the user actions should have called all necessary destructors.
+ Simplify code with YYCHK.
+ * tests/glr-regression.at (Corrupted semantic options if user action
+ cuts parse): New test case.
+ (Undesirable destructors if user action cuts parse): New test case.
+ Before applying any of this patch, this test case never actually failed
+ for me... but only because the corrupted semantic options usually
+ masked this bug.
+ (Leaked merged semantic value if user action cuts parse): New test
+ case.
+
+2006-01-05 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
+
+2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/c.m4 (b4_c_modern): New macro, with a new provision for
+ _MSC_VER. Problem reported by Cenzato Marco.
+ (b4_c_function_def): Use it.
+ * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
+ b4_c_modern.
+ (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
+ than rolling our own.
+
+2006-01-04 Akim Demaille <akim@epita.fr>
+
+ Also warn about non-used mid-rule values.
+ * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
+ member.
+ (symbol_list_new): Adjust.
+ * src/reader.c (symbol_typed_p): New.
+ (grammar_rule_check): Use it.
+ (grammar_midrule_action): Bind a mid-rule LHS to its rule.
+ Check its rule.
+ * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
+ Use it.
+ * tests/actions.at (Exotic Dollars): Adjust.
+
+2006-01-04 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (grammar_midrule_action): If $$ is set in a
+ mid-rule, move the `used' bit to its lhs.
+ * tests/input.at (Unused values): New.
+ * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
+
+2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Bison Options): Say more accurately what
+ --yacc does.
+ * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
+ about declarations in the grammar when in Yacc mode, as POSIX does
+ not require a diagnostic when the grammar uses extensions.
+
+ * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
+
+ Warn about dubious constructions like "%token T T".
+ Reported by twlevo.
+ * src/symtab.h (struct symbol.declared): New member.
+ * src/symtab.c (symbol_new): Initialize it to false.
+ (symbol_class_set): New arg DECLARING, specifying whether
+ this is a declaration that we want to warn about, if there
+ is more than one of them. All uses changed.
+
+ * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
+ Allow multiple %union directives, whose contents concatenate.
+ * src/parse-gram.y (grammar_declaration): Likewise.
+ Use muscle_code_grow, so that we don't need stype_line any more.
+ All uses changed.
+
+ * src/muscle_tab.c (muscle_grow): Fix comment.
+
+ * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
+ * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
+ Update copyright year to 2006.
+
+2006-01-03 Akim Demaille <akim@epita.fr>
+
+ Have glr.cc pass (some of) the calc.at tests.
+ * data/glr.cc (b4_parse_param_orig): New.
+ (b4_parse_param): Improve its definition, and bound it more
+ clearly in the skeleton.
+ (b4_epilogue): Append, instead of prepending, in order to keep
+ #line consistency.
+ Simplify the generation of auxiliary functions: locations and
+ purity are mandated.
+ (b4_global_tokens_and_yystype): Honor it.
+ * data/location.cc (c++.m4): Don't include it.
+ * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
+ and AT_SKEL_CC_IF.
+ * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
+ AT_LALR1_CC_IF.
+ Be sure to initialize the first position's filename.
+ (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
+ mandated anyway.
+ (AT_CHECK_CALC_GLR_CC): New.
+ Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
+
+2006-01-02 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_skeleton): Don't hard wire the inclusion of
+ c.m4.
+ * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
+ * data/glr.cc: Do not include stack.hh.
+
+2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ * data/glr.c: Reformat whitespace with tabs.
+ (b4_lpure_formals): Remove this unused m4 macro.
+ * tests/cxx-type.at: Reformat whitespace with tabs.
+ (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
+ since it's a member. Rename type to isNterm for clarity.
+
+2005-12-29 Akim <akim@sulaco.local>
+
+ Let glr.cc catch up with symbol_value_print.
+ * data/glr.cc (b4_yysymprint_generate): Replace by...
+ (b4_yy_symbol_print_generate): this.
+ (yy_symbol_print, yy_symbol_value_print): Declare them.
+
+2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/location.h (boundary): Note that a line or column equal
+ to INT_MAX indicates an overflow.
+ * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
+ (rule_length_overflow, increment_rule_length, add_column_width):
+ New functions.
+ (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
+ (<SC_BRACED_CODE>"}"):
+ Use increment_rule_length rather than incrementing it by hand.
+ (adjust_location, handle_syncline): Diagnose overflow.
+ (handle_action_dollar, handle_action_at):
+ Fix bug with monstrosities like $-2147483648.
+ Remove now-unnecessary checks.
+ (scan_integer): Verify assumptions and remove now-unnecessary checks.
+ (convert_ucn_to_byte): Verify assumptions.
+ (handle_syncline): New arg LOC. All callers changed.
+ Don't store through a value derived from char const * pointer.
+
+ * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
+ GCC warnings.
+
+2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/reader.c (grammar_midrule_action, grammar_symbol_append):
+ Remove unnecessary forward static decls.
+
+2005-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (grammar_current_rule_check): Also check that $$
+ is used.
+ Take the rule to check as argument, hence rename as...
+ (grammar_rule_check): this.
+ * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
+ Rename as...
+ (grammar_rule_begin, grammar_rule_end): these, for consistency.
+ (grammar_midrule_action, grammar_symbol_append): Now static.
+ * tests/torture.at (input): Don't rely on the default action
+ being always performed.
+ * tests/calc.at: "Set" $$ even when the action is "cut" with
+ YYERROR or other.
+ * tests/actions.at (Exotic Dollars): Instead of using unused
+ values, check that the warning is issued.
+
+2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Improve wording for unused-value warnings.
+
+2005-12-22 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
+ (b4_yysymprint_generate): Rename as...
+ (b4_yy_symbol_print_generate): this.
+ Generate yy_symbol_print instead of yysymprint.
+ Generate also yy_symbol_value_print, and use it.
+
+2005-12-22 Akim Demaille <akim@epita.fr>
+
+ * NEWS: Warn about unused values.
+ * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
+ a `used' member.
+ (symbol_list_n_get, symbol_list_n_used_set): New.
+ (symbol_list_n_type_name_get): Use symbol_list_n_get.
+ * src/scan-gram.l (handle_action_dollar): Flag used symbols.
+ * src/reader.c (grammar_current_rule_check): Check that values are
+ used.
+ * src/symtab.c (symbol_print): Accept 0.
+ * tests/existing.at: Remove the type information.
+ Empty the actions.
+ Remove useless actions (beware of mid-rule actions: perl -000
+ -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
+ * tests/actions.at (Exotic Dollars): Use unused values.
+ * tests/calc.at: Likewise.
+ * tests/glr-regression.at (No users destructors if stack 0 deleted):
+ Likewise.
+
+ * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
+ rule_useful_p.
+
+2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Undo 2005-12-01 tentative license wording change. The wording is
+ still being reviewed by the lawyers, and we don't want to wait for
+ them before publishing a test release. For now, revert to the
+ previous wording.
+ * NEWS: Undo 2005-12-01 change.
+ * data/glr.c: Revert to previous license wording.
+ * data/glr.cc: Likewise.
+ * data/lalr1.cc: Likewise.
+ * data/location.cc: Likewise.
+ * data/yacc.c: Likewise.
+
+ * NEWS: Reword %destructor vs YYABORT etc.
+ * data/glr.c: Use American spacing, for consistency.
+ * data/glr.cc: Likewise.
+ * data/lalr1.cc: Likewise.
+ * data/yacc.c: Likewise.
+ * data/yacc.c: Reformat comments slightly.
+ * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
+ for consistency. Fix some spelling errors and reword recently-included
+ text slightly.
+ * tests/cxx-type.at: Cast results of malloc, for C++.
+
+2005-12-21 Joel E. Denny <address@hidden>
+
+ * tests/cxx-type.at: Construct a tree, count the parents of shared
+ nodes, and free each node once and only once. Previously, the memory
+ for semantic values was leaked instead.
+
+2005-12-21 Joel E. Denny <address@hidden>
+
+ * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
+ (yylval, yylloc): If pure, #define to yystackp->yyval and
+ yystackp->yyloc similar to yychar and yynerrs.
+ (yyparse): If pure, remove local yylval and yylloc. Add local
+ yystackp to accommodate pure definitions of yylval and yylloc.
+ (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
+ yylvalp and yyllocp to &yylval and &yylloc.
+ (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
+ namespace. Previously, nerrs and char were missing, but lval and lloc
+ weren't necessary.
+ (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
+ yylvalp and yyllocp parameters since, if pure, these are now always
+ accessible through yystackp. If not pure, they are still accessible
+ globally.
+ * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
+ `if (YYID (N))' to pacify lint.
+
+2005-12-21 Akim Demaille <akim@epita.fr>
+
+ YYACCEPT, YYERROR, and YYABORT, as user actions, should not
+ destroy the RHS symbols of a rule.
+ * data/yacc.c (yylen): Initialize to 0.
+ Keep its value to the number of items to possibly shift.
+ In particular, a regular successful parse that ends on YYFINAL by
+ a (internal) YYACCEPT must not have yylen != 0.
+ (yyerrorlab, yyreturn): Pop the RHS.
+ Reorder a bit to emphasize the `shifting' bits of code.
+ (YYPOPSTACK): Now accept a number of items to pop.
+ * data/lalr1.cc: Likewise.
+ * data/glr.c: Formatting changes.
+ Use goto instead of fall through.
+ * doc/bison.texinfo (Destructor Decl): Complete.
+
+2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ * Makefile.am: DJGPP specific files added to EXTRA_DIST.
+ * djgpp/Makefile.maint: Fix PACKAGE variable computation.
+ * djgpp/config.bat: Replace every occurence of the file name
+ scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
+ c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
+ * djgpp/config.sed: Replace every occurence of the file name
+ scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
+ c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
+ * djgpp/djunpack.bat: DJGPP specific file.
+ * djgpp/fnchange.lst: DJGPP specific file.
+ * djgpp/README.in: Add new information about how to unpack the bison
+ source on MSDOS and other systems which have 8.3 file name restrictions
+ using djunpack.bat and fnchange.lst.
+
+2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap (build_cvs_prefix): Remove; unused.
+ (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
+ when getting gnulib.
+
+2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
+
+ * data/glr.c: Reorder typedef declarations for structs to match order
+ of struct declarations.
+ Rename yystack everywhere to yystackp except in yyparse where it's not
+ a pointer.
+ (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
+ consistency.
+ (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
+ (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
+ (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
+ lint.
+
+2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/sets.at (Accept): Fix typos in regular expression used to
+ sed out the final state number.
+
+ Work around portability problem on Solaris 10: flex-generated
+ files include <stdio.h> before <config.h>, which messes up
+ because the latter defines __EXTENSIONS__. Address the problem
+ by creating two new little files that include <config.h> first,
+ then include the flex-generated files. Rewrite everyone else
+ to include <config.h> first, as well.
+ * lib/timevar.c: Always include "config.h".
+ * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
+ scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
+ (EXTRA_bison_SOURCES): New macro.
+ * src/scan-gram-c.c, src/scan-skel-c.c: New files.
+ * src/system.h: Don't include config.h.
+ * src/LR0.c: Include <config.h> first.
+ * src/assoc.c: Likewise.
+ * src/closure.c: Likewise.
+ * src/complain.c: Likewise.
+ * src/conflicts.c: Likewise.
+ * src/derives.c: Likewise.
+ * src/files.c: Likewise.
+ * src/getargs.c: Likewise.
+ * src/gram.c: Likewise.
+ * src/lalr.c: Likewise.
+ * src/location.c: Likewise.
+ * src/main.c: Likewise.
+ * src/muscle_tab.c: Likewise.
+ * src/nullable.c: Likewise.
+ * src/output.c: Likewise.
+ * src/parse-gram.y: Likewise.
+ * src/print.c: Likewise.
+ * src/print_graph.c: Likewise.
+ * src/reader.c: Likewise.
+ * src/reduce.c: Likewise.
+ * src/relation.c: Likewise.
+ * src/state.c: Likewise.
+ * src/symlist.c: Likewise.
+ * src/symtab.c: Likewise.
+ * src/tables.c: Likewise.
+ * src/uniqstr.c: Likewise.
+ * src/vcg.c: Likewise.
+
+ * src/parse-gram.y: Fix minor problems uncovered by lint.
+ (current_lhs, current_lhs_location): Now static.
+ (current_assoc): Remove unused variable.
+
+ Cleanups so that Bison-generated parsers have less lint.
+ * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
+ Prepend /*ARGSUSED*/, for lint's sake.
+ * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
+ definition if 'lint' is defined.
+ (YYID): New macro (or function, if lint).
+ All uses of /*CONSTCOND*/0 replaced by YYID(0).
+ * data/yacc.c: Likewise.
+ * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
+ (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
+ * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
+ is C++ only.
+ * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
+ * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
+ Use YYID(0) rather than 0, for lint.
+ (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
+ (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
+
+2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/glr-regression.at
+ (Improper handling of embedded actions and dollar(-N) in GLR parsers):
+ Close memory leak reported by twlevo.
+
+2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
+
+ * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
+ all stacks.
+ (yyparse): Iterate another stack in order to call user destructors.
+ * tests/glr-regression.at (No users destructors if stack 0 deleted):
+ New test case.
+ (Duplicated user destructor for lookahead): This test now is expected
+ to succeed.
+
+2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Document the following change.
+ * data/yacc.c: Say "parser skeleton" rather than "file", since
+ it's no longer just a file.
+ * data/glr.c: Grant a special exception for C GLR parsers, that
+ reads like the already-existing exception for C LALR(1) parsers.
+ * data/glr.cc: Likewise.
+ * data/lalr1.cc: Likewise.
+ * data/location.cc: Likewise.
+ * data/yacc.c: Reword the "written by" statement to clarify that
+ it was the parser skeleton, not the entire output file.
+ * data/glr.c: Written by Paul Hilfinger.
+ * data/glr.cc: Written by Akim Demaille.
+ * data/lalr1.cc: Likewise.
+
+2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
+ Fix typos in previous change that broke 'make check'.
+ YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
+ supported in C.
+ * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
+ Don't check NUM-STDERR-LINES, since the output format is fluctuating.
+ We can revert this once things settle down.
+
+ * src/conflicts.c (conflicts_print): Don't print file name twice
+ when %expect fails because there were no conflicts.
+ * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
+ change.
+ * tests/conflicts.at (%expect not enough, %expect too much):
+ (%expect with reduce conflicts): Adjust to new behavior.
+
+2005-11-18 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
+ errors.
+ * NEWS: Document this.
+ * doc/bison.texinfo (Expect Decl): Likewise.
+
+2005-11-16 Akim Demaille <akim@epita.fr>
+
+ Generalize the display of semantic values and locations in traces.
+ * data/glr.c (yy_reduce_print): Fix indices (again).
+ * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
+ literal integers.
+ * data/lalr1.cc (yyreduce_print): Rename as...
+ (yy_reduce_print): this.
+ Display values and locations.
+ * data/yacc.c (yy_reduce_print): Likewise.
+ (YY_REDUCE_PRINT): Adjust to pass the required arguments.
+ (yysymprint): Move higher to be visible from yy_reduce_print).
+ (yyparse): Adjust.
+ * tests/calc.at: Adjust the expected length of the traces.
+
+2005-11-14 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
+ from 1 to N, while values and location start at 0.
+ (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
+
+2005-11-14 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c (yy_reduce_print): Fix the $ number.
+
+2005-11-14 Akim Demaille <akim@epita.fr>
+
+ "Use" parse parameters.
+ * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
+ * data/glr.c, data/glr.cc: Use them.
+ * data/glr.c (YYUSE): Have a C++ definition that supports
+ non-pointer types.
+
+2005-11-14 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c (yyexpandGLRStack): Declare only if defined.
+
+2005-11-14 Akim Demaille <akim@epita.fr>
+
+ * data/glr.cc: New.
+ * data/m4sugar/m4sugar.m4 (m4_prepend): New.
+
+2005-11-12 Akim Demaille <akim@epita.fr>
+
+ Let position and location be PODs.
+ * data/location.cc (position::initialize, location::initialize): New.
+ (position::position, location::location): Define only if
+ b4_location_constructors is defined.
+ * data/lalr1.cc (b4_location_constructors): Define it for backward
+ compatibility.
+ * doc/bison.texinfo (Initial Action Decl): Use initialize.
+
+2005-11-12 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc: Move the body of the ctor and dtor into the
+ parser file (instead of the header).
+ Wrap the implementations in a "namespace yy".
+
+2005-11-12 Akim Demaille <akim@epita.fr>
+
+ Have glr.c include its header file when created.
+ * data/glr.c (b4_shared_declarations): New.
+ Output them verbatim in the parser if !%defines, otherwise
+ output then in the header file, and include it instead.
+
+2005-11-11 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c: Comment changes.
+
+2005-11-11 Akim Demaille <akim@epita.fr>
+
+ When yydebug, report semantic and location values for reductions.
+ * data/glr.c (yy_reduce_print): Report the semantic values and the
+ locations.
+ (YY_REDUCE_PRINT): Adjust.
+ (yyglrReduce): Use them.
+ (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
+ * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
+ * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
+ traces.
+
+2005-11-10 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
+ (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
+ (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
+
+2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
+
+ * m4/cxx.m4, examples/Makefile.am: Don't build
+ examples/calc++ if no C++ compiler is available. (trivial change)
+
+2005-11-09 Akim Demaille <akim@epita.fr>
+
+ * src/scan-skel.l: Use a couple of asserts.
+
+2005-11-03 Akim Demaille <akim@epita.fr>
+
+ In some (weird) cases, the final state number is incorrect.
+ Reported by Alexandre Duret-Lutz.
+ * src/LR0.c (state_list_append): Remove the computation of
+ final_state.
+ (save_reductions): Do it here.
+ (get_state): Alpha conversion.
+ (generate_states): Use a for loop.
+ * src/gram.h (item_number_is_rule_number)
+ (item_number_is_symbol_number): New.
+ * src/state.c: Use assert.
+ * src/system.h: Include assert.h.
+ * tests/sets.at (Accept): New.
+
+2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
+
+ * data/glr.c (yyfill): Adjust comment.
+ (yyresolveAction): Initialize default location properly
+ for empty right-hand sides.
+ (yydoAction): Ditto.
+ Add comment explaining apparently dead code.
+ * tests/glr-regression.at
+ (Incorrectly initialized location for empty right-hand side in GLR):
+ New test.
+
+2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap (cleanup_gnulib): New function. Use it to clean up
+ gnulib when interrupted. This fixes some race conditions and
+ works around some portability problems (one noted by Paul
+ Hilfinger).
+
+2005-10-22 Akim <akim@epita.fr>
+
+ * Makefile.cfg: Adjust to config -> build-aux.
+ Reported by twledo.
+
+2005-10-21 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
+ the %parse-params.
+ * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
+ * data/yacc.c (b4_Pure_if): Rename as...
+ (b4_yacc_pure_if): this.
+ (YY_SYMBOL_PRINT, yyparse): Adjust.
+ * doc/bison.texinfo: Formatting changes.
+
+2005-10-21 Akim Demaille <akim@epita.fr>
+
+ Finish the transition config -> build-aux.
+ * configure.ac, Makefile.am: Use build-aux.
+ * config/prev-version, config/announce-gen, config/Makefile.am:
+ Move to...
+ * build-aux/prev-version, build-aux/announce-gen,
+ * build-aux/Makefile.am: here.
+
+2005-10-14 Akim Demaille <akim@epita.fr>
+
+ * examples/calc++/test: Use set -x only when VERBOSE.
+
+2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
+ * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
+
+2005-10-13 Akim Demaille <akim@epita.fr>
+
+ * src/scan-skel.l: Output the base name parts of the parser and
+ header file names.
+ * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
+ additional checks.
+ Use this to exercise C++ outputs in subdirs.
+ Reported by Oleg Smolsky.
+
+2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
+ __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
+ Problem reported by John P. Hartmann.
+ * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
+ already defined it.
+
+2005-10-12 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y (version_check): Exit 63 to please missing
+ (stands for "version mismatch).
+ * tests/input.at, doc/bison.texinfo: Adjust.
+
+2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ Work around portability problems with Visual Age C compiler
+ (xlc and xlC_r) reported by John P. Hartmann.
+ * data/location.cc (initial_column, initial_line): Remove.
+ All uses replaced by 0 and 1.
+ * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
+ that xlc complains about.
+ * src/scan-skel.l (skel_wrap): Likewise.
+ * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
+ as __STDC__.
+ * data/yacc.c (YYMODERN_C): New macro, which also looks at
+ __STDC_VERSION__. Use it everywhere instead of looking at
+ __STDC__ and __cplusplus.
+
+2005-10-10 Akim Demaille <akim@epita.fr>
+
+ * examples/calc++/test: Be quiet unless VERBOSE.
+
+2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/c.m4 (yydestruct, yysymprint):
+ Use YYUSE instead of casting to void.
+ * data/glr.c (YYUSE): New macro.
+ (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
+ Use it instead of rolling our own.
+ (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
+ (YYCHK1):
+ Use /*CONSTCOND*/ to suppress lint warnings.
+ * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
+ (YY_STACK_PRINT): Use 'false' not '0'.
+ (YYUSE): New macro.
+ (yysymprint_, yydestruct_): Use it instead of rolling our own.
+ * data/yacc.c (YYUSE): New macro.
+ (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
+ (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
+ (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
+
+
+ * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
+ (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
+
+2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ Undo the parts of the unlocked-I/O change that substituted
+ putc or puts for printf. This might hurt performance a bit,
+ but some people prefer the printf style.
+ * data/c.m4 (yysymprint): Prefer printf to puts and putc.
+ * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
+ All uses replaced by YYFPRINTF and YYDPRINTF.
+ * data/yacc.c: Likewise.
+ * lib/bitset.c (bitset_print): Likewise.
+ * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
+ putc and puts.
+ * lib/lbitset.c (debug_lbitset): Likewise.
+ * src/closure.c (print_firsts, print_fderives): Likewise.
+ * src/gram.c (grammar_dump): Likewise.
+ * src/lalr.c (look_ahead_tokens_print): Likewise.
+ * src/output.c (escaped_output): Likewise.
+ (user_actions_output): Break apart two printfs.
+ * src/parse-gram.y (%printer): Prefer printf to putc and puts.
+ * src/reduce.c (reduce_print): Likewise.
+ * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
+ * src/system.h: Include unlocked-io.h rathe than stdio.h.
+
+ * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
+ Use assignments rather than casts-to-void to suppress
+ unused-variable warnings. This pacifies 'lint'.
+ * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
+ unused-variable warnings.
+
+2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ * Makefile.am: DJGPP specific files added to EXTRA_DIST.
+
+2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use unlocked I/O for a minor performance improvement on hosts like
+ GNU/Linux and Solaris that support unlocked I/O. The basic idea
+ is to use the gnlib unlocked-io module, and to prefer putc and
+ puts to printf when either will work (since the latter doesn't
+ come in an unlocked flavor).
+ * bootstrap (gnulib_modules): Add unlocked-io.
+ * data/c.m4 (yysymprint): Prefer puts and putc to printf.
+ * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
+ Prefer them to YYFPRINTF and YYDPRINTF if either will do,
+ and similarly for puts and putc and printf.
+ * data/yacc.c: Likewise.
+ * lib/bitset.c (bitset_print): Likewise.
+ * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
+ * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
+ to printf.
+ * lib/lbitset.c (debug_lbitset): Likewise.
+ * src/closure.c (print_firsts, print_fderives): Likewise.
+ * src/gram.c (grammar_dump): Likewise.
+ * src/lalr.c (look_ahead_tokens_print): Likewise.
+ * src/output.c (escaped_output): Likewise.
+ (user_actions_output): Coalesce two printfs.
+ * src/parse-gram.y (%printer): Prefer putc and puts to printf.
+ * src/reduce.c (reduce_print): Likewise.
+ * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
+ * src/system.h: Include unlocked-io.h rather than stdio.h.
+
+ * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
+ this confuses xgettext.
+
+2005-10-02 Akim Demaille <akim@epita.fr>
+
+ * bootstrap (gnulib_modules): Add strverscmp.
+ * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
+ * m4/.cvsignore: Add strverscmp.m4.
+ * src/parse-gram.y (%require): New token, new rule.
+ (version_check): New.
+ * src/scan-gram.l (%require): Adjust.
+ * tests/input.at (AT_REQUIRE): New.
+ Use it.
+ * doc/bison.texinfo (Require Decl): New.
+ (Calc++ Parser): Use %require.
+
+2005-10-02 Akim Demaille <akim@epita.fr>
+
+ * data/location.cc: New.
+
+2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
+ Akim Demaille <akim@epita.fr>
+
+ Make sure -odir/foo.cc creates dir/location.hh etc.
+ * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
+ (spec_file_prefix, spec_verbose_file, spec_graph_file)
+ (spec_defines_file): Now const.
+ (dir_prefix): New.
+ (short_base_name): Remove.
+ * src/files.c: Adjust.
+ (dirname.h): Include.
+ (base_name): Don't prototype it.
+ (finput): Remove, duplicates gram_in.
+ (full_base_name, short_base_name): Replace by...
+ (all_but_ext, all_but_tab_ext): these.
+ (compute_base_names): Rename as...
+ (compute_file_name_parts): this.
+ Update to compute the new variables, including dir_prefix.
+ Adjust dependencies.
+ * src/output.c (prepare): Output them.
+ * src/reader.c: Adjust to use gram_in, not finput.
+ * src/scan-skel.l (@dir_prefix@): New.
+
+2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ * lib/subpipe.c: New function end_of_output_subpipe() added
+ to allow support for non-posix systems. This is a no-op function
+ for posix systems.
+
+ * lib/subpipe.h: New function end_of_output_subpipe() added
+ to allow support for non-posix systems. This is a no-op function
+ for posix systems.
+
+ * src/output.c (output_skeleton): Use end_of_output_subpipe() to
+ handle the lack of pipe/fork functionality on non-posix systems.
+
+ * djgpp/Makefile.maint: DJGPP specific file.
+
+ * djgpp/README.in: DJGPP specific file.
+
+ * djgpp/config.bat: DJGPP specific configuration file.
+
+ * djgpp/config.sed: DJGPP specific configuration file.
+
+ * djgpp/config.site: DJGPP specific configuration file.
+
+ * djgpp/config_h.sed: DJGPP specific configuration file.
+
+ * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
+
+ * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
+
+2005-10-02 Akim Demaille <akim@epita.fr>
+
+ * data/location.cc: New, extract from...
+ * data/lalr1.cc: here.
+ (location.hh): Include it after the user prologue, in case the
+ filename type is defined by the user.
+ Forward declation location and position before the pre-prologue.
+ (yyresult_): Rename as...
+ (yyresult): this, it's a local variable, not an attribute.
+ * data/Makefile.am (dist_pkgdata_DATA): Adjust.
+
+2005-10-01 Akim Demaille <akim@epita.fr>
+
+ * examples/extexi: Restore the #line generation.
+
+2005-09-30 Akim Demaille <akim@epita.fr>,
+ Alexandre Duret-Lutz <adl@gnu.org>
+
+ Move the token type and YYSTYPE in the parser class.
+ * data/lalr1.cc (stack.hh, location.hh): Include earlier.
+ (parser::token): New, from the moved free definition of tokens.
+ (parser::semantic_value): Now a full definition instead of an
+ indirection to YYSTYPE.
+ (b4_post_prologue): No longer included in the header file, but
+ in the implementation file.
+ * doc/bison.texi (C+ Language Interface): Update.
+ * src/parse-gram.y: Support unary %define.
+ * tests/actions.at: Define global_tokens_and_yystype for backward
+ compatibility until we update the tests.
+ * tests/calc.at: Idem.
+ (first_line, first_column, last_line, last_column): Define for lalr1.cc
+ to simplify the code.
+
+2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
+
+ Port to SunOS 4.1.4, which lacks strtoul and strerror.
+ Ah, the good old days! Problem reported by Peter Klein.
+ * bootstrap (gnulib_modules): Add strerror, strtoul.
+ * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
+ * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
+
+2005-09-29 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_error_verbose_if): New.
+ * data/lalr1.cc: Use it.
+ (YYERROR_VERBOSE_IF): Remove.
+ (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
+ parser members, replaced by...
+ (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
+ local variables.
+ (yysyntax_error_): Takes the state number as argument.
+ (yyreduce_print_): Use the argument yyrule, not the former
+ attribute yyn_.
+
+2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap (gnulib_modules): Add verify.
+ * lib/.cvsignore: Add verify.h.
+ * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
+ * src/system.h (verify): Remove.
+ Include verify.h instead.
+ * src/tables.c (tables_generate): Use new API for 'verify'.
+
+2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
+ local variables whose names begin with 'yy'.
+ * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
+ Trivial changes from Joel E. Denny.
+
+ * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
+ it itself.
+ * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
+ don't use alloca any more.
+
+ * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
+ __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
+ defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
+ * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
+ to match yacc.c, to test more hosts.
+
+2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
+ doesn't affect behavior.
+ (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
+ Solaris, AIX, MSC.
+ (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
+ This works a bit better with glibc, if user code has already included
+ stdlib.h.
+ * doc/bison.texinfo (Bison Parser): Document that users can't
+ arbitrarily use malloc and free for other purposes. Document
+ that <alloca.h> and <malloc.h> might be included.
+ (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
+ user must declare alloca.
+
+ * HACKING (release): Forwarn the Translation Project about
+ stable releses.
+
+2005-09-20 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
+
+2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (YYSIZE_MAXIMUM): New macro.
+ (YYSTACK_ALLOC_MAXIMUM): Use it.
+ (yysyntax_error): New function.
+ (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
+ multiple syntax errors are reported, and alloca is being used.
+ Instead, reallocate buffers twice as big each time, so that
+ we waste at most half the allocated memory. Start with a small
+ (128-byte) buffer that will suffice in most cases anyway.
+ Use yysyntax_error to do most of the work.
+
+ * doc/bison.texinfo (Error Reporting, Table of Symbols):
+ yynerrs is the number of errors reported, not the number of
+ errors encountered.
+
+ * tests/glr-regression.at (Duplicated user destructor for lookahead):
+ Mark it as expected to fail.
+ Cast result of malloc; problem reported by twlevo@xs4all.nl.
+ * tests/actions.at, tests/calc.at, tests/glr-regression.at:
+ Don't start user-code symbols with "yy", to avoid name space problems.
+
+2005-09-19 Akim Demaille <akim@epita.fr>
+
+ Remove the traits, failed experiment.
+ It never proved useful, and anyway because of the current
+ definition, it was not possible to have several specialization of
+ this traits, making it useless.
+ * data/lalr1.cc (yy:traits): Remove.
+ Inline its definitions in the parser class.
+
+2005-09-19 Akim Demaille <akim@epita.fr>
+
+ * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
+ least Mac OSX with a /usr/local install of gettext.
+
+2005-09-19 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
+ and yytoken for similarity with the other skeletons.
+
+2005-09-19 Akim Demaille <akim@epita.fr>
+
+ * NEWS, configure.ac: update version number to 2.1a.
+
+2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 2.1.
+
+ * NEWS: Remove notice of yytname change, since it was never in an
+ official release.
+ * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
+ diagnostic.
+ * src/output.c (prepare): Likewise.
+ * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
+ (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
+ is not defined. This is an awful hack, but it's enough for now.
+ All callers changed.
+ * tests/glr-regression-at (make_value): Args are const pointers now,
+ to avoid GCC warning.
+ (Duplicated user destructor for lookahead): New test. Currently
+ skipped. It fails on my host but I'm not sure it'll always fail.
+
+2005-09-16 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h (struct symbol): Declare the printer and destructor
+ as const, to avoid accidental calls to free.
+ (symbol_destructor_set, symbol_printer_set): Adjust.
+ * src/symtab.c: Adjust.
+
+2005-09-16 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_token_enums): New.
+ (b4_token_defines): Rename as...
+ (b4_token_enums_defines): this.
+ (b4_token_defines): New, output only the #defines.
+ * data/yacc.c, data/glr.c: Adjust.
+ * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
+ * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
+ as default values.
+
+2005-09-16 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (yylex_): Remove, inline its code.
+ (yyreport_syntax_error_): Remove, replaced by...
+ (yysyntax_error_): this which returns a string and leaves to the
+ caller the call to the users' error function.
+ (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
+ Move from members of the parser object...
+ (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
+ to local variables of the parse function.
+
+2005-09-16 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
+ since it's in Bison's name space.
+
+2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yyresolveValue): Add default case to pacify
+ gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
+
+ * NEWS: Document when yyparse started to return 2.
+ * doc/bison.texinfo (Parser Function): Document when yyparse
+ returns 2.
+
+ * data/lalr1.cc: Revert part of previous change, as it's incompatible.
+ (b4_filename_type): Renamed back from b4_file_name_type. All uses
+ changed.
+ (class position): file_name -> filename (reverting). All uses changed.
+
+2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
+ do anything if $@ exists. This reverts part of the 2005-07-07
+ patch.
+
+2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
+ contains obsolete information and isn't worth distributing as a
+ separate file anyway.
+ * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
+ (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
+ All uses of jmp_buf, setjmp, longjmp changed to use these instead.
+ (yyparse): Abort if user code uses longjmp to throw an unexpected
+ value.
+
+2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/c.m4 (b4_identification): Define YYBISON_VERSION.
+ Suggested by twlevo@xs4all.nl.
+
+ * data/glr.c (YYCHK1): Do not assume YYE is in range.
+ This avoids a diagnostic from gcc -Wswitch-enum.
+ Problem reported by twlevo@xs4all.nl.
+
+ * doc/bison.texinfo: Don't use "filename", as per GNU coding
+ standards. Use "file name" or "file" or "name", depending on
+ the context.
+ (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
+ not to hack/foo.tab.c.
+ (Calc++ Top Level): 2nd arg of main is not const.
+ * data/glr.c: b4_filename -> b4_file_name.
+ * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
+ All uses changed.
+ (class position): filename -> file_name. All uses changed.
+ * data/yacc.c: b4_filename -> b4_file_name.
+ * lib/bitset.h: filename -> file_name in local vars.
+ * lib/bitset_stats.c: Likewise.
+ * src/files.c: Likewise.
+ * src/scan-skel.l ("@output ".*\n): Likewise.
+ * src/files.c (file_name_split): Renamed from filename_split.
+ * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
+
+2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
+ to accommodate latest gnulib.
+
+ * tests/glr-regression.at (Duplicate representation of merged trees):
+ Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
+
+ * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
+ needed.
+
+2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
+ All uses changed. Invoke user destructor after an error during a
+ split parse (trivial change from Joel E. Denny).
+
+ * tests/glr-regression.at
+ (User destructor after an error during a split parse): New test case.
+ Problem reported by Joel E. Denny in:
+ http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
+
+2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ * README-cvs: Give URLs for recommended tools.
+ Mention Gzip version problem, and bootstrapping issues.
+ Remove troubleshooting section, as it's somewhat obsolete.
+
+ * bootstrap (no_cache): New var, to accommodate different wget
+ variants. Use it instead of '-C off'. Problem reported by
+ twlevo@xs4all.nl.
+
+ * data/glr.c (yydestroyStackItem): New function.
+ (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
+ debugging information. Problem reported by Joel E. Denny.
+
+2005-08-25 Akim Demaille <akim@epita.fr>
+
+ * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
+
+2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yyrecoverSyntaxError, yyreturn):
+ Don't invoke destructor on unresolved entries.
+ * tests/glr-regression.at
+ (User destructor for unresolved GLR semantic value): New test case.
+ Problem reported by Joel E. Denny in:
+ http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
+
+2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
+ Add strnlen.c.
+ * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
+ lib-prefix.m4, po.m4.
+
+ * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
+ in yydestruct diagnostic, since it might not be an error.
+ Problem reported by Joel Denny near end of
+ <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
+ * data/lalr1.cc (yyerturn): Likewise.
+ * data/yacc.c (yyreturn): Likewise.
+ * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
+
+ * src/files.c: Remove obsolete FIXME comment.
+
+ * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
+ with the other templates, and to fix bogus run-on messages such
+ as the one reported at the end of
+ <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
+ All callers changed to avoid the newline.
+ (yyprocessOneStack): Output two lines rather than one, to accommodate
+ the above change. This changes the debug output format slightly.
+
+ * data/glr.c (yyresolveValue): Fix redundant parse tree problem
+ reported by Joel E. Denny in
+ <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
+ (trivial change).
+ * tests/glr-regression.at (Duplicate representation of merged trees):
+ New test, from Joel E. Denny in:
+ <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
+ * THANKS: Add Joel E. Denny.
+
+ * configure.ac (AC_INIT): Bump to 2.0c.
+
+2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 2.0b.
+
+ * Makefile.am (SUBDIRS): Put examples before tests, so that
+ "make check" doesn't finish with "All 1 tests passed".
+
+ * tests/regression.at (Token definitions): Don't rely on
+ AT_PARSER_CHECK for data that contains backslashes. It currently
+ uses 'echo', and 'echo' isn't portable if its argument contains
+ backslashes. Problem found on OpenBSD 3.4. Also, do not assume
+ that the byte '\0xff' is not printable in the C locale; it is,
+ under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
+ not printable, so use '\0x81' to test.
+
+ * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
+ version of GCC, since the macro is used with non-GCC compilers.
+
+ Fix core dump reported by Pablo De Napoli in
+ <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
+ * tests/regression.at (Invalid inputs with {}): New test.
+ * src/parse-gram.y (token_name): Translate type before using
+ it as an index.
+
+ * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
+ the user's name space. All uses changed to __attribute__
+ ((__unused__)).
+ (yyFail, yyMemoryExhausted, yyreportAmbiguity):
+ Add __attribute__ ((__noreturn__)).
+
+ * etc/clcommit: Remove. We weren't using it, and it failed
+ "make maintainer-distcheck".
+ * Makefile.maint: Merge from coreutils.
+ (CVS_LIST, CVS_LIST_EXCEPT): New macros.
+ (syntax-check-rules): Change list of rules as described below.
+ (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
+ (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
+ (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
+ (sc_trailing_space): New rules.
+ (sc_xalloc_h_in_src): Remove.
+ (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
+ (sc_space_tab, sc_error_exit_success, sc_changelog):
+ (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
+ (makefile-check, po-check, author_mark_check):
+ (makefile_path_separator_check, copyright-check):
+ Use grep -n, to make it easier to find violations.
+ Use CVS_LIST and CVS_LIST_EXCEPT.
+ (header_regexp, h_re): Remove.
+ (dd_c): New macro.
+ (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
+ (my-distcheck): Use more-modern GCC flags.
+ (signatures, %.asc): Remove.
+ (rel-files, announcement): Remove signatures.
+ Restore old updating code, even though we don't use it, so
+ that we're the same as coreutils.
+ (alpha, beta, major): Depend on news-date-check.
+ Make the upload commands.
+
+ * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
+ * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
+ * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
+ * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
+ * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
+ * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
+ * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
+ * tests/sets.at: Likewise.
+
+ * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
+ we comment out the Autoconf version number.
+ * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
+ it's error-prone and "make maintainer-distcheck" rejects it.
+
+ * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
+ Indent calls to "error" to pacify "make maintainer-distcheck",
+ when the calls are not intended to be translated.
+ * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
+
+ * src/Makefile.am (DEFS): Use +=, to pacify
+ "make maintainer-distcheck".
+ (bison_SOURCES): Add scan-skel.h.
+ (sc_tight_scope): New rule, from coreutils.
+
+ * src/files.c (src_extension, header_extension):
+ Now static, not extern.
+ * src/getargs.c (short_options): Likewise.
+ * src/muscle_tab.c (muscle_table): Likewise.
+ * src/parse-gram.y (current_class, current_type, current_prec):
+ Likewise.
+ * src/reader.c (grammar_end, previous_rule_end): Likewise.
+ * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
+ * src/main.c (main): Cast bindtextdomain and textdomain calls to
+ void, to avoid warning when NLS is disabled.
+ * src/output.c: Include scan-skel.h.
+ (scan_skel): Remove decl, since scan-skel.h does this.
+ (output_skeleton):
+ Indent calls to "error" to pacify "make maintainer-distcheck".
+ * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
+ * src/reader.h (gram_end, gram_lineno): New decls to pacify
+ "make maintainer-distcheck".
+ * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
+ (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
+ (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
+ (skel_lex_destroy, scan_skel): Move these decls to...
+ * src/scan-skel.h: New file.
+ * src/uniqstr.c (uniqstr_assert):
+ Indent calls to "error" to pacify "make maintainer-distcheck".
+
+ * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
+ not @VAR@.
+
+ * tests/torture.at: Revamp to avoid misuse of atoi that
+ "make maintainer-distcheck" complained about.
+
+ * examples/extexi (message): Don't print a message more than once,
+ and omit line-number decoration that makes Emacs compile think
+ that informative messages are worth worrying about.
+
+2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * configure.ac: Update version number.
+
+ * Makefile.am (SUBDIRS): Add examples; somehow this got removed
+ accidentally.
+ * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
+ autogenerated by the maintainer.
+ * examples/calc++/.cvsignore: Add *.yy.
+
+ * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
+ * lib/bitset_stats.c (bitset_stats_init): Likewise.
+ * lib/bitsetv.c (bitsetv_alloc): Likewise.
+
+ * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
+
+ * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
+ from maintainer-distcheck about casting the argument of 'free'.
+
+ * NEWS: Mention recent yytname changes.
+ * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
+
+ * bootstrap: For translations that have not yet been upgraded to
+ the new runtime-po domain, prime the pump by extracting the
+ relevant strings from the obsolete translations. This code can be
+ removed once the bison-runtime domain has been translated by each
+ team.
+
+ * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
+ now that token names are already quoted.
+
+ Fix problem reported by Anthony Heading.
+ * data/glr.c (YYTOKEN_TABLE): New macro.
+ (yytname): Define if YYTOKEN_TABLE.
+ * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
+ * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
+ (YYERROR_VERBOSE): Define the same way the other skeletons do.
+ * src/output.c (prepare_symbols): Output token_table_flag.
+
+2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
+ again if the first call fails.
+
+ * data/glr.c (yytnamerr): New function.
+ (yyreportSyntaxError): Use it to dequote most string literals.
+ * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
+ with other skeletons. All uses changed.
+ (yytnameerr_): New function.
+ (yyreport_syntax_error): Use it to dequote most string literals.
+ * data/yacc.c (yytnamerr): New function.
+ (yyerrlab): Use it to decode most string literals.
+ * doc/bison.texinfo (Decl Summary, Calling Convention):
+ Clarify quoting convention of yytname.
+ * src/output.c (prepare_symbols): Quote all names. This undoes
+ the 2005-04-17 change, which is now accomplished (mostly) via
+ changes in the parsers as described above.
+ * tests/regression.at (Token definitions, Web2c Actions):
+ Undo most 2005-04-17 change here, too.
+
+2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix more problems reported by twlevo@xs4all.nl.
+ * tests/cxx-type.at: Don't pipe output of ./types through sed to
+ remove trailing spaces. This loses the exit status of ./types,
+ and isn't needed since ./types shouldn't be emitting trailing
+ spaces.
+ * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
+ as the stack isn't valid in that case.
+
+ * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
+ (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
+ (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
+ Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
+ is used.
+ * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
+ (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
+ (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
+ Likewise.
+
+ * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
+ overly-picky compilers that reject 'char *foo = "bar";'.
+
+ * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
+ to FILE * parameter, not to stderr. This fixes a typo introduced
+ in the 2005-07-12 change.
+
+ * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
+ warnings from GCC 4.
+
+ * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
+ (yyglrShiftDefer, yysplitStack):
+ Remove unused parameters b4_pure_formals. All uses changed.
+ (yyglrShift): Remove unused parameters b4_user_formals.
+ All uses changed.
+ (yyglrReduce): Removed unused parameter yylocp. All uses changed.
+
+2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ Destructor cleanups and regularization among the three skeletons.
+ * NEWS: Document the behavior changes.
+ * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
+ stack before failing, as the cleanup code will do it for us now.
+ * data/lalr1.cc (yyerrlab): Likewise.
+ * data/glr.c (yyparse): Pop everything off the stack before
+ freeing it, so that destructors get called properly.
+ * data/lalr1.cc (yyreturn): Likewise.
+ * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
+ This is more consistent.
+ * doc/bison.texinfo (Destructor Decl): Mention more reasons
+ why destructors might be called. 1.875 -> 2.1.
+ (Destructor Decl, Decl Summary, Table of Symbols):
+ Some English-language cleanups for %destructor.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
+ Add output line for destructor of start symbol.
+ * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
+ because of that same extra output line.
+
+ * NEWS: Document minor wording changes in diagnostics of
+ Bison-generated parsers.
+ * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
+ Remove unused formals. All uses changed.
+ (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
+ (yyparse): Rename yyoverflowlab to yyexhaustedlab.
+ * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
+ Rename yyoverflowab to yyexhaustedlab.
+ When memory exhaustion occurs during syntax-error reporting,
+ report it separately rather than in a single diagnostic; this
+ eases translation.
+ * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
+ (Memory Exhausted): Renamed from Parser Stack Overflow.
+ Revamp wording slightly to prefer "memory exhaustion".
+ * tests/actions.at: "parser stack overflow" -> "memory exhausted".
+
+ * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
+
+ Add i18n support to the GLR skeleton. Partially fix the C++
+ skeleton; a C++ expert needs to finish this. Remove debugging
+ msgids; there's little point to having them translated, since they
+ can be understood only by someone who can read the
+ (English-language) source code.
+
+ Generate runtime-po/bison-runtime.pot automatically, so that we
+ don't have to worry about garbage getting in that file. We'll
+ make sure after the next official release that old msgids don't
+ get lost. See
+ <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
+
+ * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
+ Now auto-generated.
+ * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
+ Fix typos in explanations of the runtime file.
+ * bootstrap: Change gettext keyword from YYI18N to YY_.
+ Use standard Makefile.in.in in runtime-po, since we'll arrange
+ for backward-compatible bison-runtime.po files in a different way.
+ * data/glr.c (YY_): New macro, from yacc.c.
+ (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
+ Translate messages intended for users.
+ (yyreportSyntaxError): Change "virtual memory" to "memory" to match
+ the wording in the other skeletons. We don't know that the memory
+ is virtual.
+ * data/lalr1.cc (YY_): Renamed from _. All uses changed.
+ Use same method that yacc.c uses.
+ Don't translate debugging messages.
+ (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
+ it doesn't work (yet), and requires C++ expertise to fix.
+ * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
+ Move defn to a more logical place, to be consistent with other
+ skeletons.
+ Don't translate debugging messages.
+ Don't assume line numbers fit in unsigned int; use unsigned long fmts.
+ * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
+ to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
+ * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
+
+ Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
+ * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
+ void, not int.
+ * tests/glr-regression.at (Badly Collapsed GLR States):
+ Likewise.
+ (Improper handling of embedded actions and dollar(-N) in GLR parsers):
+ yylex should return 0 at EOF rather than aborting.
+
+ Improve tests for stack overflow in GLR parser.
+ Problem reported by twlevo@xs4all.nl.
+ * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
+ All uses removed.
+ (yyStackOverflow): Just longjmp, but with value 2 so that caller
+ can handle the problem.
+ (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
+ (yyparse): New local variable yyresult to record the result.
+ Use result of setjmp to set it, rather than storing itinto
+ struct.
+ (yyDone): Remove label.
+ (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
+ to mimic yacc.c. Do not discard lookahead if it's EOF (possible
+ if YYABORT is used).
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
+ yyparse status; put status > 1 into diagnostic.
+ Check that status==2 works.
+ * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
+ Use exit status 3 for failure to open (which shouldn't happen).
+
+2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/conflicts.at (%nonassoc and eof): Don't exit with status
+ 1 on syntax error; just let yyparse do its thing.
+ * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
+ * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
+ (Exploding the Stack Size with Alloca):
+ (Exploding the Stack Size with Malloc):
+ Expect exit status 2, not 1, since the parser is supposed to blow
+ its stack. Problem reported by twlevo@xs4all.nl.
+
+ * data/glr.c (yyparse): Don't assume that the initial calls
+ to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
+ Print a stack-overflow message and fail instead.
+ Initialize the line-number information before creating the stack,
+ so that the stack-overflow message can report line zero safely.
+
+2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix problems reported by twlevo@xs4all.nl.
+ * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
+ (yyuserMerge): Provide a default case if b4_mergers is empty.
+ * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
+ * tests/glr-regression.at
+ (Improper handling of embedded actions and dollar(-N) in GLR parsers):
+ Add casts to pacify C++ compilers.
+ * tests/glr-regression.at (Improper merging of GLR delayed action
+ sets): Declare yylex before using it.
+ * tests/Makefile.am (maintainer-check-g++): Fix a stray
+ $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
+ test for valgrind; valgrind is independent of g++.
+ (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
+ for compatibility with POSIX 1003.1-2001 (if running coreutils).
+ * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
+ Use a destructor, so that we can expand the stack. Change
+ YYSTYPE to char * so that we can free it. Cast result of malloc.
+
+2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
+
+ * data/glr.c (yyuserAction): Fix uninitialized variable that caused
+ a valgrind failure. Problem reported by twlevo@xs4all.nl.
+
+2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * PACKAGING: New file, suggested by Bruno Haible and taken from
+ similar wording in gettext's PACKAGING file.
+ * NEWS: Mention PACKAGING.
+ * Makefile.am (EXTRA_DIST): Add PACKAGING.
+
+2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Document recent i18n improvements.
+ * bootstrap: Get runtime translations into runtime-po.
+ Create runtime-po files automatically, if possible.
+ * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
+ * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
+ does not infringe on the user's name space.
+ (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
+ * doc/bison.texinfo (Internationalization): Revamp the English
+ and Texinfo syntax a bit, to try to make it clearer.
+ (Bison Options, Option Cross Key): Mention --print-localedir.
+ * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
+ YYENABLE_NLS. Quote a bit more.
+ * runtime-po/.cvsignore: New file.
+ * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
+ * runtime-po/Rules-quot: Remove; now created by bootstrap.
+ * runtime-po/quot.sed: Likewise.
+ * runtime-po/boldquot.sed: Likewise.
+ * runtime-po/en@quot.header: Likewise.
+ * runtime-po/en@boldquot.header: Likewise.
+ * runtime-po/insert-header.sin: Likewise.
+ * runtime-po/remove-potcdate.sin: Likewise.
+ * runtime-po/Makevars: Likewise.
+ * runtime-po/LINGUAS: Likewise.
+ * runtime-po/de.po: Likewise; we will rely on the translation project
+ to maintain this, so "bootstrap" should get it.
+ * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
+ its value.
+ * src/main.c (main): Bind the bison-runtime domain, too.
+
+2005-07-12 Bruno Haible <bruno@clisp.org>
+
+ * data/yacc.c: Include <libintl.h> when NLS is enabled.
+ (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
+ * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
+ * runtime-po: New directory.
+ * runtime-po/Makefile.in.in: New file, copied from po/, with modified
+ $(DOMAIN).pot-update rule, so that old messages are never dropped.
+ * runtime-po/Rules-quot: New file, copied from po/.
+ * runtime-po/quot.sed: Likewise.
+ * runtime-po/boldquot.sed: Likewise.
+ * runtime-po/en@quot.header: Likewise.
+ * runtime-po/en@boldquot.header: Likewise.
+ * runtime-po/insert-header.sin: Likewise.
+ * runtime-po/remove-potcdate.sin: Likewise.
+ * runtime-po/Makevars: New file.
+ * runtime-po/POTFILES.in: New file.
+ * runtime-po/LINGUAS: New file.
+ * runtime-po/bison-runtime.pot: New file.
+ * runtime-po/de.po: New file.
+ * m4/bison.m4: New file.
+ * Makefile.am (SUBDIRS): Add runtime-po.
+ (aclocaldir, aclocal_DATA): New variables.
+ * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
+ Define aclocaldir.
+ * src/getargs.c (usage): Document --print-localedir option.
+ (PRINT_LOCALEDIR_OPTION): New enum item.
+ (long_options): Add --print-localedir option.
+ (getargs): Handle --print-localedir option.
+ * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
+ (Internationalization): New section.
+
+2005-07-12 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
+ for consistency with the rest of the code.
+ * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
+ Add separators.
+
+2005-07-12 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y: Use %printer instead of YYPRINT.
+
+2005-07-12 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h, src/symtab.c (symbol_print): New.
+ * src/symlist.h, src/symlist.c (symbol_list_print): New.
+ * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
+
+2005-07-12 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c (b4_syncline): Fix (swap) the definitions of
+ b4_at_dollar and b4_dollar_dollar.
+
+2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
+ and Pennello's paper.
+
+2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (yyparse): Undo previous patch. Instead,
+ set yylsp[0] and yyvsp[0] only if the initial action
+ sets yylloc and yylval, respectively.
+
+ * data/yacc.c (yyparse): In the initial action, set
+ yylsp[0] and yyvsp[0] rather than yylloc and yylval.
+ This avoids the use of undefined variables if the initial
+ action does not set yylloc and/or yylval.
+
+2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
+ * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
+ Remove from CVS. These files are automatically generated.
+ * examples/extexi: Clarify that this file is now part of Bison,
+ not GNU M4, and that it works with any POSIX-compatible Awk.
+ * examples/calc++/Makefile.am (run_extexi): Remove; not used.
+ ($(calc_extracted)): Renamed from $(calc_sources_extracted),
+ so that we also get calc++-parser.yy. Geneate it.
+ Use $(AWK), not gawk, since any conforming Awk will do.
+ Put comment before action, since older 'make' can't handle comment
+ in action.
+ $(BUILT_SOURCES): List all built sources, not just some of them.
+ $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
+ $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
+ $($(calc_sources_generated)): Remove unnecessary test for existence
+ of target. (This had a shell syntax error anyway; a stray "x".)
+ (calc_extracted): List $(srcdir)/calc++-parser.yy, not
+ calc++-parser.yy.
+ * examples/.cvsignore, examples/calc++/.cvsignore: New files.
+
+ * bootstrap (gnulib_modules): Add gettext, now that it's no longer
+ implied by the other modules.
+
+2005-07-06 Akim Demaille <akim@epita.fr>
+
+ Bind examples/calc++ to the package.
+ * examples/calc++/Makefile: Remove, replaced by...
+ * examples/calc++/Makefile.am: ... this new file.
+ * examples/calc++/test: Remove input.
+ * examples/calc++/compile: Remove.
+ * examples/Makefile.am: New.
+ * configure.ac, Makefile.am: Adjust.
+ * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
+
+2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yyFail): Drastically simplify; since the format argument
+ never had any % directives, we can simply pass it to yyerror.
+ (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
+ be modified later, as that is the usual style in glr.c.
+ Problems reported by Paul Hilfinger.
+
+ Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
+ and size overflow errors.
+ * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
+ in case the user prolog sets feature-test macros like _GNU_SOURCE.
+ (YYSIZEMAX): New macro.
+ (yystpcpy): New function, taken from yacc.c.
+ (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
+ (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
+ so that we don't have to maintain their signatures.
+ (yyFail): Check for buffer overflow, by using vsnprintf rather
+ than vsprintf. Allocate a bigger buffer if possible.
+ Report an error if buffer allocation fails.
+ (yyStackOverflow): New function.
+ (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
+ the initialization was successful. It might fail if storage was
+ exhausted.
+ (yyexpandGLRStack): Add more checks for storage allocation failure.
+ Use yyStackOverflow to report failures.
+ (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
+ (yysplitStack, yyprocessOneStack, yyparse, yypstack):
+ Don't assume stack number fits in int.
+ (yysplitStack): Check for storage allocation failure.
+ (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
+ can print diagnostics on storage allocation failure. All callers
+ changed.
+ (yyresolveValue): Use yybool for boolean.
+ (yyreportSyntaxError): Check for size-calculation overflow.
+ This code is taken from yacc.c.
+ (yyparse): Check for storage allocation errors when allocating
+ the initial stack.
+
+2005-07-05 Akim Demaille <akim@epita.fr>
+
+ Extract calc++ from the documentation.
+ * doc/bison.texinfo (Calc++): Add the extraction marks.
+ * examples/extexi: New, from the aborted GNU Programming 2E.
+ Separate the different paragraph of a file with empty lines.
+ * examples/Makefile: Use it to extract the whole calc++ example.
+
+2005-06-24 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
+ class typedefs.
+
+2005-06-22 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (C++ Language Interface): First stab.
+ (C++ Parsers): Remove.
+
+2005-06-22 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (yylex_): Honor %lex-param.
+
+2005-06-22 Akim Demaille <akim@epita.fr>
+
+ Start a set of simple examples.
+ * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
+ * examples/calc++/calc++-driver.hh,
+ * examples/calc++/calc++-parser.yy,
+ * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
+ * examples/calc++/compile, examples/calc++/test: New.
+
+2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
+ extern "C" {}. This fixes a problem reported by Paul Hilfinger,
+ which stems from the 2005-05-27 patch.
+
+2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
+
+ * data/glr.c: Modify treatment of unused parameters to permit use
+ of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
+
+2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix infringement on user name space reported by Janos Zoltan Szabo.
+ * data/yacc.c (yyparse): strlen -> yystrlen.
+
+2005-05-30 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (_): New.
+ Translate the various messages.
+
+2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix infringement on user name space reported by Bruno Haible.
+ * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
+ Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
+ the user's name space.
+ (alloca): Include <stdlib.h> to get it, if it's not built in.
+ (YYMALLOC, YYFREE): Define only if needed.
+ (malloc, free): Declare, but only if needed, as this infringes on
+ the user name space.
+
+2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
+ * lib/bitset.c (bitset_print): Don't assume size_t can be printed
+ with %d format.
+ * lib/ebitset.c (min, max): Undef before defining.
+ * lib/vbitset.c (min, max): Likewise.
+ * lib/subpipe.c (create_subpipe): Save local variables in case
+ vfork clobbers them.
+
+2005-05-24 Bruno Haible <bruno@clisp.org>
+
+ * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
+ error message syntax used by gcc-4.0.
+
+2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ * README: Mention m4 1.4.3. Remove obsolete advice about
+ Sun Forte Developer 6 update 2, VMS, and MS-DOS.
+
+ * bootstrap: Remove workaround for problem I encountered with
+ gettext 0.14.1; it seems to be fixed now.
+
+2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 2.0a.
+
+ * src/files.c: Include "stdio-safer.h"; this fixes a typo in
+ the previous change.
+
+ Various maintainer cleanups.
+ * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
+ conftest*, for benefit of CVS commands run at the same time as
+ "configure". Add build-aux, since "bootstrap" now creates it and
+ its subfiles.
+ * Makefile.cfg (move_if_change): Remove.
+ * Makefile.maint: Remove the update stuff; we now use "bootstrap".
+ (ftp-gnu, www-gnu, move_if_change, local_updates, update):
+ (po_repo, do-po-update, po-update, wget_files, get-targets):
+ (config.guess-url_prefix, config.sub-url_prefix):
+ (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
+ (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
+ ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
+ Remove.
+ * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
+ this is now the recommended name.
+ * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
+ depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
+ ylwrap. These files now go into build-aux.
+ * config/move-if-change: Remove.
+ * config/prev-version.txt: Bump from 1.75 to 2.0.
+
+ * bootstrap: Add stdio-safer, unistd-safer modules.
+ Remove m4/glibc2.m4 (introduced by latest gnulib, but
+ we don't need it).
+ * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
+ fopen-safer.c, stdio-safer.h, unistd-safer.h.
+ * lib/subpipe.c: Include "unistd-safer.h".
+ (create_subpipe): Make sure all the newly-created
+ file descriptors are > 2, so that diagnostics don't
+ get sent down them (which might cause Bison to hang, in theory).
+ * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
+ * src/files.c (xfopen): Use fopen_safer, not fopen.
+
+ * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
+ yesterday's yacc.c fix.
+
+2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c, data/lalr1.cc: Update copyright date.
+
+ Fix a destructor bug reported by Wolfgang Spraul in
+ <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
+ * data/yacc.c (yyabortlab): Don't call destructor, and
+ don't set yychar to EMPTY.
+ (yyoverflowlab): Don't call destructor.
+ (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
+ * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
+ since we no longer output the message "discarding lookahead token
+ end of input ()".
+
+2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
+
+ * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
+ fix a small glitch in debugging output.
+ (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
+ after YY_SYMBOL_PRINT where needed.
+
+ (struct yyGLRState): Add some comments.
+ (struct yySemanticOption): Add some comments.
+ (union yyGLRStackItem): Add comment.
+
+ (yymergeOptionSets): Correct this to properly perform the union,
+ avoiding infinite reported by Michael Rosien.
+ Update comment.
+
+ * tests/glr-regression.at: Add test for GLR merging error reported
+ by M. Rosien.
+
+2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
+ Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
+ README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
+ data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
+ data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
+ doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
+ lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
+ lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
+ lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
+ lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
+ lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
+ lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
+ lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
+ lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
+ m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
+ src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
+ src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
+ src/derives.h, src/files.c, src/files.h, src/getargs.c,
+ src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
+ src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
+ src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
+ src/output.h, src/parse-gram.c, src/parse-gram.h,
+ src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
+ src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
+ src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
+ src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
+ src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
+ src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
+ src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
+ tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
+ tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
+ tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
+ tests/reduce.at, tests/regression.at, tests/sets.at,
+ tests/synclines.at, tests/testsuite.at, tests/torture.at:
+ Update FSF postal mail address.
+
+2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
+ Problem reported by Ralf Menzel.
+
+2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/actions.at: Test that stack overflow invokes destructors.
+ From Marcus Holland-Moritz.
+ * data/yacc.c (yyerrlab): Move the code that destroys the stack
+ from here....
+ (yyreturn): to here. That way, destructors are called properly
+ even if the stack overflows, or the user calls YYACCEPT or
+ YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
+ (yyoverflowlab): Destroy the lookahead.
+
+2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
+
+2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Bison-generated C parsers no longer quote literal strings
+ associated with tokens.
+ * src/output.c (prepare_symbols): Don't escape strings,
+ since users don't want to see C escapes.
+ * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
+ in diagnostics.
+ * tests/input.at (Torturing the Scanner): Likewise.
+ * tests/regression.at (Token definitions, Web2c Actions): Likewise.
+
+2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
+ the data size is known to be too small and we can't increase it.
+ This works around an HP-UX 11.00 glitch reported by Andrew Benham.
+
+2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/parse-gram.y: Include quotearg.h.
+ (string_as_id): Quote $1 before using it as a key, since the
+ lexer no longer quotes it for us.
+ (string_content): Don't strip quotes, since lexer no longer
+ quotes it for us.
+ * src/scan-gram.l: Include quotearg.h.
+ ("\""): Omit quote.
+ ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
+ a key, since the rest of the lexer doesn't quote it.
+ * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
+ * tests/regression.at (Token definitions): Check for backslashes
+ in token strings.
+
+ * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
+ (YYSIZE_T): Define to unsigned long int when using an older compiler.
+ (yyparse): Revamp code to generate long syntax error message, to
+ make it easier to translate, and to avoid problems with arithmetic
+ overflow. Change "virtual memory" to "memory" in diagnostic, since
+ we don't know whether the memory is virtual.
+
+2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Bison-generated C parsers now use the _ macro to
+ translate strings.
+ * data/yacc.c (_) [!defined _]: New macro.
+ All English strings wrapped inside this macro.
+ * doc/bison.texinfo (Bison Parser): Document _.
+ * po/POTFILES.in: Include src/parse-gram.c, since it now
+ includes translateable strings that parse-gram.y doesn't.
+
+2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/symtab.c (symbol_make_alias): Call symbol_type_set,
+ reverting the 2004-10-11 change to this function.
+ (symbol_check_alias_consistency): Don't call symbol_type_set
+ if the type name is already correct.
+ * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
+
+2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/regression.at (Token definitions): Don't use a token named
+ c, as that generates a "#define c ..." that runs afoul of buggy
+ stdlib.h that uses the identifier c as a member of struct
+ drand48_data. Problem reported by Horst Wente.
+
+2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap: Change translation URL from
+ http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
+ http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
+ redirection glitches. Problem reported by twlevo@xs4all.nl.
+
+2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
+ after operands; POSIX says this isn't portable for the c99 command.
+
+2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/glr-regression.at (glr-regr2a.y): Try to dump core
+ immediately if a data overrun has occurred; this may help us track
+ down what may be a spurious failure on MacOS.
+
+2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Respond to problems reported by twlevo@xs4all.nl.
+
+ * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
+
+ * src/vcg.h: Comment fix.
+ * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
+ (G_CMAX): Change to -1 instead of INT_MAX.
+
+ * data/yacc.c (yyparse): Omit spaces before #line.
+
+2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/tables.c (state_number_to_vector_number): Put it inside an
+ "#if 0", since it's not currently used. Problem reported by
+ Roland McGrath.
+
+2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/output.c (escaped_output): Renamed from
+ escaped_file_name_output, since we now use it for symbol tags as
+ well. All uses changed.
+ (symbol_destructors_output, symbol_printers_output):
+ Escape symbol tags too.
+ Problem reported by Matyas Forstner in
+ <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
+
+ * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
+ not needed.
+ * src/output.c (user_actions_output, token_definitions_output,
+ symbol_destructors_output, symbol_printers_output): Likewise.
+ * src/reader.c (prologue_augment): Likewise.
+ * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
+
+ * src/vcg.c (output_edge): Don't quote linestyle arg.
+ Problem reported by twlevo@xs4all.nl.
+
+2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
+ example, reported by Derek M Jones. Also, make the example even
+ more outrageous, to better illustrate how bad the problem is.
+
+2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
+ putsym. Typo reported by Sebastian Piping.
+
+2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Language and Grammar): some -> same
+ (Epilogue): int he -> in the
+ Typos reported by Sebastian Piping via Justin Pence.
+
+2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/glr-regression.at (Improper handling of embedded actions
+ and dollar(-N) in GLR parsers): Renamed from "Improper handling of
+ embedded actions and $-N in GLR parsers", work around an Autoconf bug
+ with dollar signs in test names.
+ * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
+ for a similar reason.
+
+2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
+ wants to redefine G_VIEW.
+
+2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/vcg.c (get_view_str): Remove case for normal_view.
+ Problem reported by twlevo@xs4all.nl.
+
+2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
+ Problem reported by twlevo@xs4all.nl.
+
+ * doc/bison.texinfo: Change @dircategory from "GNU programming
+ tools" to "Software development". Requested by Richard Stallman
+ via Karl Berry.
+
+2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
+ Problem reported by twlevo@xs4all.nl.
+
+2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
+ keyword; it's not needed with modern compilers, and it doesn't
+ affect correctness with older compilers. Suggested by
+ twlevo@xs4all.nl.
+
+2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yyuserAction): Add "default: break;" case to pacify
+ gcc -Wswitch-default.
+ * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
+ * data/yacc.c (yyparse): Likewise.
+
+2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
+ already. Let config.h define any nonstandard values.
+
+2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
+ for the benefit of slower hosts. Problem reported by
+ Nelson H. F. Beebe.
+
+2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
+ being defined and not used.
+ * data/lalr1.cc (yyparse): Likewise.
+ Use "if (false)" rather than "if (0)".
+
+2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ * TODO: Mention that we should allow NUL bytes in tokens.
+
+2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/scan-skel.l (<<EOF>>): Don't close standard output.
+ Problem reported by Hans Aberg.
+
+2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/getargs.c (version): Happy new year; update overall
+ program copyright date from 2004 to 2005.
+
+ * src/scan-skel.l ("@output ".*\n): Don't close standard output.
+ Problem reported by Hans Aberg.
+ * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
+ (Output file names.): Add a test for the case when standard output
+ is closed.
+
+2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
+ to fix an oversight in the Bison 2.0 manual.
+
+2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 2.0. Reformat the existing news items since
+ 1.875, so that related items are grouped together.
+ * configure.ac (AC_INIT): Bump version to 2.0.
+ * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
+
+ * tests/torture.at (Exploding the Stack Size with Alloca): Set
+ YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
+ otherwise, we're not testing alloca. Unfortunately there's no
+ simple way to consult HAVE_ALLOCA here.
+
+ * data/lalr1.cc (yydestruct_): Pacify unused variable warning
+ for yymsg, too.
+
+ * src/LR0.c (new_itemsets): Use memset rather than zeroing by
+ hand. This avoids a warning about comparing int to size_t when
+ GCC warnings are enabled.
+
+2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Bison-generated parsers no longer default to using the
+ alloca function (when available) to extend the parser stack, due
+ to widespread problems in unchecked stack-overflow detection.
+ * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
+ responsibility to set it to a positive value. This lets the user
+ specify a value that is not a preprocessor constant.
+ * data/yacc.c (YYMAXDEPTH): Likewise.
+ (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
+ * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
+ to be a compile-time constant. However, explain the constraints on it.
+ Also, explain the constraints on YYINITDEPTH.
+ (Table of Symbols): Explain that alloca is no longer the default.
+ Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
+ to 1.
+
+ * doc/bison.texinfo (Location Default Action): Mention that n must
+ be zero when k is zero. Suggested by Frank Heckenbach.
+
+2004-12-22 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
+ (parser::state_type, parser::semantic_type, parser::location_type):
+ Private, not public.
+ (parser::parse): Return ints, not bool.
+ Returning a bool introduces a problem: 0 corresponds to false, and
+ it seems weird to return false on success. Returning true changes
+ the conventions for yyparse.
+ Alternatively we could return void and send an exception.
+ There is no clear consensus (yet?).
+ (state_stack, semantic_stack, location_stack): Rename as...
+ (state_stack_type, semantic_stack_type, location_stack_type): these.
+ Private, not public.
+ * tests/c++.at: New.
+ * tests/testsuite.at, tests/Makefile.am: Adjust.
+
+2004-12-21 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (parser::parse): Return a bool instead of an int.
+
+2004-12-21 Akim Demaille <akim@epita.fr>
+
+ Don't impose std::string for filenames.
+
+ * data/lalr1.cc (b4_filename_type): New.
+ (position::filename): Use it.
+ (parser.hh): Move the inclusion of stack.hh and location.hh below
+ the user code, so that needed headers for the filename type can be
+ included first.
+ Forward declare them before the user code.
+ * tests/Makefile.am (check-local, installcheck-local): Pass
+ TESTSUITEFLAGS to the TESTSUITE.
+
+2004-12-20 Akim Demaille <akim@epita.fr>
+
+ Use more STL like names: my_class instead of MyClass.
+
+ * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
+ (SemanticStack, SemanticType, StateStack, StateType)
+ (TokenNumberType, Stack, Slice, Traits, Parser::location)
+ (Parser::value): Rename as...
+ (location_stack, location_type, rhs_number_type, semantic_stack)
+ (semantic_type, state_stack, state_type, token_number_type, stack)
+ (slice, traits, parser::yylloc, parser::yylval): these.
+
+ * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
+
+2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
+ * data/yacc.c (YYLLOC_DEFAULT): Likewise.
+
+2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Remove uses of 'short int' and 'unsigned short int'. This raises
+ some arbitrary limits. It uses more memory but nowadays that's
+ not much of an issue.
+
+ This change does not affect the generated parsers; that's a different
+ task, as some users will want to conserve memory there.
+
+ Ideally we should use size_t to represent all object counts, and
+ something like ptrdiff_t to represent signed differences of object
+ counts; but that will require more code-cleanup than I have the
+ time to do right now.
+
+ * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
+ Use size_t, not int or short int, to count objects.
+ * src/closure.c (nritemset, closure): Likewise.
+ * src/closure.h (nritemset, closure): Likewise.
+ * src/nullable.c (nullable_compute): Likewise.
+ * src/print.c (print_core): Likewise.
+ * src/print_graph.c (print_core): Likewise.
+ * src/state.c (state_compare, state_hash): Likewise.
+ * src/state.h (struct state): Likewise.
+ * src/tables.c (default_goto, goto_actions): Likewise.
+
+ * src/gram.h (rule_number, rule): Use int, not short int.
+ * src/output.c (prepare_rules): Likewise.
+ * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
+ errs, reductions): Likewise.
+ * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
+ Likewise.
+ * src/tables.c (vector_number, tally, action_number,
+ ACTION_NUMBER_MINIMUM): Likewise.
+ * src/output.c (muscle_insert_short_int_table): Remove.
+
+2004-12-17 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc: Extensive Doxygenation.
+ (error_): Rename as...
+ (error): this, since it is visible to the user.
+ Adjust callers.
+ (Parser::message): Now an automatic variable from...
+ (Parser::yyreport_syntax_error_): here.
+ * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
+ Parser::error.
+ * tests/input.at: Escape $.
+
+2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
+ Parenthesize rhs to avoid obscure problems with mistakes like
+ "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
+ * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
+ b4_rhs_location): Likewise.
+ * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
+ b4_rhs_location): Likewise.
+
+2004-12-16 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
+ yacc.c: be sure to stay within yycheck_.
+ * tests/actions.at: Re-enable C++ tests.
+
+2004-12-16 Akim Demaille <akim@epita.fr>
+
+ * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
+ real.
+
+2004-12-16 Akim Demaille <akim@epita.fr>
+
+ Use #define to handle the %name-prefix.
+
+ * data/glr.c, data/yacc.c: Comment changes.
+ * data/lalr1.cc (yylex): Use #define to select the name of yylex,
+ so that one can refer to yylex in the parser file, and have it
+ renamed, as is the case with other skeletons.
+
+2004-12-16 Akim Demaille <akim@epita.fr>
+
+ Move lalr1.cc internals into yy*.
+
+ * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
+ (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
+ (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
+ (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
+ (empty_, final_, terror_, errcode_, ntokens_)
+ (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
+ (looka_, ilooka_, error_range_, nerrs_):
+ Rename as...
+ (yysemantic_stack_, yylocation_stack_, yystate_stack_)
+ (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
+ (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
+ (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
+ (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
+ (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
+ (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
+ (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
+ these.
+
+2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix some problems reported by twlevo at xs4all.
+ * src/symtab.c (symbol_new): Report an error if the input grammar
+ contains too many symbols. This is better than calling abort() later.
+ * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
+ (struct node, struct graph):
+ Rename member expand to stretch. All uses changed.
+ (struct graph): Remove member layoutalgorithm. All uses removed.
+ * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
+ * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
+ All uses changed.
+ (N_STRETCH): Rename from N_EXPAND. All uses changed.
+
+2004-12-15 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc: Normalize /** \brief ... */ to ///.
+ Add more Doxygen comments.
+ (symprint_, stack_print_, reduce_print_, destruct_, pop)
+ (report_syntax_error_, translate_): Rename as...
+ (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
+ (yypop_, yyreport_syntax_error_, yytranslate_): this.
+
+2004-12-15 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (lex_): Rename as...
+ (yylex_): this.
+ Move the trace here.
+ Take the %name-prefix into account.
+ Reported by Alexandre Duret-Lutz.
+
+2004-12-15 Akim Demaille <akim@epita.fr>
+
+ Simplify the C++ parser constructor.
+
+ * data/lalr1.cc (debug_): Rename as...
+ (yydebug_): so that the parser's internals are always in the yy*
+ pseudo namespace.
+ Adjust uses.
+ (b4_parse_param_decl): Remove the leading comma as it is now only
+ called as unique argument list.
+ (Parser::Parser): Remove the constructor accepting a location and
+ an initial debugging level.
+ Remove from the other ctor the argument for the debugging level.
+ (debug_level_type, debug_level, set_debug_level): New.
+
+ * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
+ constructor calls.
+
+2004-12-15 Akim Demaille <akim@epita.fr>
+
+ Remove b4_root related material: failure experiment
+ (which goal was to allow to derive from a class).
+
+ * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
+ definitions and uses.
+
+2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
+ not 2, since it's not portable to subtract 1 from the start of an
+ array. The new item 0 is never set or used. All uses changed.
+
+ (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
+ the default definition of YYLLOC_DEFAULT. Problem reported
+ by Frank Heckenbach.
+
+2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (YYRHSLOC): Don't have two definitions, one for
+ the normal case and one for the error case. Just use the
+ first one uniformly. Problem reported by Frank Heckenbach.
+ (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
+ use exactly the same macro in both places.
+ (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
+ so that the normal-case YYRHSLOC works for the error case too.
+ All uses changed.
+ * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
+ (YYLLOC_DEFAULT): Use the same macro as glr.c.
+ * doc/bison.texinfo (Location Default Action): Don't claim that
+ we have an array of locations. Use the same macro for both glr
+ and lalr parsers. Mention YYRHSLOC. Mention what happens when
+ the index is 0.
+
+2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ * HACKING: Update email addresses to send announcements to.
+
+ * configure.ac (AC_INIT): Bump version to 1.875f.
+
+2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 1.875e.
+ * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
+
+ * src/scan-skel.l: Include "complain.h", for "fatal".
+
+ * src/relation.h (relation_print, relation_digraph):
+ Relation sizes are of type relation_node, not size_t (this is
+ merely a doc fix, since the two types are equivalent).
+ (relation_transpose): Relation sizes are of type relation_node,
+ not int.
+ * src/relation.c: Likewise.
+ (top, infinity): Now of type relation_node, not int.
+ (traverse, relation_transpose): Use relation_node, not int.
+
+ * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
+ with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
+ (yyparse): Remove unused local introduced in 2004-10-25 patch.
+
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
+ specifying whether the test should be skipped. Use it tp
+ specify that the [%defines %skeleton "lalr1.cc"] tests currently
+ fail on some hosts, and should be skipped.
+
+2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
+ changed to use xcalloc, xnmalloc, xnrealloc, respectively,
+ unless otherwise specified below.
+
+ * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
+ to allocate kernel_base, kernel_items, kernel_size, since
+ they needn't be initialized to 0.
+ (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
+ * src/closure.c (new_closure): Likewise, for itemset.
+ * src/derives.c (derives_compute): Likewise, for delts, derives, q.
+ * src/lalr.c (set_goto_map): Likewise, for temp_map.
+ (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
+ (build_relations): Likewise for edge, states1, includes.
+ * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
+ * src/reader.c (packgram): Likewise, for ritem, rules.
+ * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
+ * src/relation.c (relation_digraph): Likewise for VERTICES.
+ (relation_transpose): Likewise for new_R, end_R.
+ * src/symtab.c (symbols_token_translations_init): Likewise for
+ token_translations.
+ * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
+ (token_actions): Likewise for yydefact, actrow, conflrow,
+ conflict_list.
+ (save_column): Likewise for froms[symno], tos[symno].
+ (goto_actions): Likewise for state_count.
+ (pack_table): Likewise for base, pos, check.
+ (tables_generate): Likewise for width.
+
+ * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
+ for initial core. Just have a separate core, so we needn't worry
+ about whether kernel_size and kernel_base are initialized.
+
+ * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
+ kernel_size, kernel_items): Remove unnecessary initialization.
+ * src/conflicts.c (conflicts): Likewise.
+ * src/derives.c (derives): Likewise.
+ * src/muscle_tablc (muscle_insert): Likewise.
+ * src/relation.c (relation_digraph): Likewise.
+ * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
+ conflrow, conflict_table, conflict_list, table, check):
+ Likewise.
+
+ * src/closure.c (new_closure): Arg is of type unsigned int, not int.
+ This is because all callers pass unsigned int.
+ * src/closure.h (new_closure): Likewise.
+
+ * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
+ (build_relations): Initialize includes[i] in all cases.
+ * src/reader.c (packgram): Always initialize rules[ruleno].prec
+ and rules[ruleno].precsym. Initialize members in order.
+ * src/relation.c (relation_transpose): Always initialize new_R[i]
+ and end_R[i].
+ * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
+
+ * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
+ conflict_list[0] was always 0, but now it isn't initialized.
+
+ * src/table.c (table_grow): When conflict_table grew, the grown
+ area wasn't cleared. Fix this.
+
+ * lib/.cvsignore: Add strdup.c, strdup.h.
+ * m4/.cvsignore: Add strdup.m4.
+
+2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
+ * src/lalr.c (set_goto_map): Don't allow ngotos to equal
+ GOTO_NUMBER_MAXIMUM, since we occasionally compute
+ ngotos + 1 without checking for overflow.
+ (build_relations): Use END_NODE, not -1, to denote end of edges.
+ * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
+ build_relations): Use goto_number, not int, for goto numbers.
+ * src/tables.c (save_column, default_goto): Likewise.
+
+2004-11-23 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
+ of #defining from yystype.
+ Don't typedef yystype, C++ does not need it.
+ This lets it possible to forward declare it as union.
+
+2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bootstrap (gnulib_modules): Add extensions.
+ Problem reported by Jim Meyering.
+
+2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
+ src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
+ src/system.h, src/tables.c: XFREE -> free, to accommodate
+ recent change to gnulib xalloc.h.
+ Problem reported by Jim Meyering.
+
+2004-11-17 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
+
+2004-11-17 Akim Demaille <akim@epita.fr>,
+ Alexandre Duret-Lutz <adl@gnu.org>
+
+ * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
+ changes.
+ (YYCDEBUG): Adjust.
+ Use it instead of cdebug_.
+ (Parser::debug_stream, Parser::set_debug_stream): New.
+ (Parser::symprint_): Define cdebug_ for temporary backward
+ compatibility.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
+ debug_stream ().
+
+2004-11-17 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
+ * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
+ * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
+
+2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yyloc_default): Remove; not used.
+ Problem reported by Frank Heckenbach.
+
+2004-10-25 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c (YYRHSLOC): Move its definition next to its uses.
+ Introduce another definition to address simple location arrays.
+ (yyGLRStack): New member: yyerror_range.
+ (yyrecoverSyntaxError, yyparse): Update it.
+ (yyrecoverSyntaxError): Use it when shifting the error token to
+ have an accurate range, equivalent to the one computed by both
+ yacc.c and lalr1.cc.
+ * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
+ that column numbers start at column 0, as per GNU Coding
+ Standards, the others tests, and the doc.
+ (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
+ Adjust to the above change (first column is 0).
+ And adjust the location of the "<error>", now covering the whole
+ line.
+
+2004-10-22 Akim Demaille <akim@epita.fr>
+ and Paul Eggert <eggert@cs.ucla.edu>
+
+ Remove some arbitrary limits on goto numbers and relations.
+ * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
+ initial values, since they're never used.
+ (set_goto_map): ngotos is now unsigned, so test for overflow
+ by seeing whether it wraps around to zero.
+ * src/lalr.h (goto_number): Now size_t, not short int.
+ (GOTO_NUMBER_MAXIMUM): Remove.
+ * src/relation.c (relation_print, traverse, relation_transpose):
+ Check for END_NODE rather than looking at sign.
+ * src/relation.h (END_NODE): New macro.
+ (relation_node): Now size_t, not short int.
+
+2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo (Language and Grammar): In example, "int" is a
+ keyword, not an identifier. Problem reported by Baron Schwartz in
+ <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
+
+2004-10-11 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.c (symbol_check_alias_consistency): Also check
+ type names, destructors, and printers.
+ Reported by Alexandre Duret-Lutz.
+ Recode the handling of associativity and precedence in terms
+ of symbol_precedence_set.
+ Accept no redeclaration at all, not even equal to the previous
+ value.
+ (redeclaration): New.
+ Use it to factor redeclaration complaints.
+ (symbol_make_alias): Don't set the type of the alias, let
+ symbol_check_alias_consistency do it as for other features.
+ * src/symtab.h (symbol): Add new member prec_location, and
+ type_location.
+ * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
+ * tests/input.at (Incompatible Aliases): New.
+
+2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ .cvsignore fixes to accommodate gnulib changes,
+ and the practice of naming build directories "_build".
+ * .cvsignore: Add "_*". Sort.
+ * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
+ * m4/.cvsignore: Add "*_gl.m4".
+
+2004-10-06 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y (add_param): Fix the truncation of trailing
+ spaces.
+
+2004-10-05 Akim Demaille <akim@epita.fr>
+
+ In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
+ whether the reducion was empty or not. This leaves room to
+ improve the use of YYLLOC_DEFAULT in such a case.
+ lalr1.cc is still experimental, so changing this is acceptable.
+ And finally, there are probably not many users who changed the
+ handling of locations in GLR, so changing is admissible too.
+
+ * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
+ empty reduction, set @$ to an empty location ending the previously
+ stacked symbol.
+ Adjust uses to make sure the code is triggered on empty
+ reductions.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
+ expected output: empty reductions have empty locations.
+
+2004-09-29 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc: Move towards a more standard C++ coding style
+ for templates: Class < T > -> Class<T>.
+
+2004-09-29 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc: Reinstall the former ctor, for sake of
+ compatibility, but warn it will be removed.
+ Move towards a more standard C++ coding style (i.e., type *var ->
+ type* var).
+
+2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/parse-gram.y (add_param): Rewrite to avoid strchr,
+ since it's less likely to work if NULs are involved in the future.
+
+2004-09-27 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
+
+2004-09-27 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (b4_parse_param_decl_1): New.
+ (b4_parse_param_decl): Use it to have different names between attribute
+ and argument names.
+ (b4_cc_constructor_call): Likewise.
+
+2004-09-24 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y (add_param): Strip the leading and trailing
+ blanks from a formal argument declaration.
+ (YY_LOCATION_PRINT): New.
+
+2004-09-24 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
+ after the location.
+
+2004-09-24 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Table of Symbols): Sort.
+
+2004-09-21 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
+ the useless parentheses.
+ Suggested by Paul Eggert.
+
+2004-09-20 Akim Demaille <akim@epita.fr>
+
+ Let the initial-action act on the look-ahead, and use it for the
+ "initial push" (corresponding to an hypothetical beginning-of-file).
+ And let lalr1.cc honor %initial-action.
+
+ * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
+ example.
+ * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
+ (Parser::Parser): Remove the ctor that used to initialize it.
+ (Parser::parse): Like in the other skeletons, issue the "starting
+ parse" message before any action.
+ Honor %initial-action.
+ Initialize the stacks with the lookahead.
+ * data/yacc.c: Let $$ and @$ in %initial-action designate the
+ look-ahead.
+ Push them in the stacks.
+ * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
+
+2004-09-20 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Initial Action Decl): New.
+
+2004-09-20 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
+ clearer criterion to define it.
+ (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
+ When reducing on an empty RHS, use the latest stacked location as
+ location.
+ yylloc is not always available.
+ * data/glr.c: Likewise.
+ Also, honor initial-actions.
+
+2004-09-20 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c (YY_LOCATION_PRINT): New.
+ Define when we know YYLTYPE's structure, i.e., when the default
+ YYLLOC_DEFAULT is used.
+ * data/c.m4 (b4_yysymprint_generate): Use it.
+ * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
+ value of the result.
+ (error_start_): Replace with...
+ (error_range_): this location array.
+ This allows to replace code relying on the implementation of
+ locations by portable code.
+ * data/yacc.c (yylerrsp): Replace with...
+ (yyerror_range): this.
+ Every time a token is popped, update yyerror_range[0], to have an
+ accurate location for the error token.
+ * data/glr.c (YY_LOCATION_PRINT): New.
+ (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
+ deference a pointer.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
+ report the location in %printers.
+
+ * src/scan-skel.l: Instead of abort, report error messages to ease
+ understanding skeleton scanning failures.
+
+2004-09-16 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
+ (iterator, const_iterator): these, to be more in the C++ spirit.
+ Also, return reverse iterators so that when displaying the stack
+ we display its bottom first.
+ (Parser::stack_print_, Parser::reduce_print_): Match the messages
+ from yacc.c.
+ We should probably use vector here though.
+
+2004-09-16 Akim Demaille <akim@epita.fr>
+
+ Have more complete shift traces.
+
+ * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
+ to report Shifts instead of ad hoc YYDPRINTF invocations,
+ including for the error token.
+ * data/lalr1.cc (symprint_): Output the location.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
+ output the location within the %printer.
+ Activate GLR tests, at least to make sure they compile properly.
+ They still don't pass though.
+ * tests/calc.at: Adjust expect verbose output, since now "Entering
+ state..." is on a different line than the "Shifting" message.
+
+2004-09-08 Akim Demaille <akim@epita.fr>
+
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
+ Bison directive from the Bison file to the invocation of this
+ macro, so that these directives are passed to
+ AT_BISON_OPTION_PUSHDEFS to get correct help macros.
+ Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
+ Move the AT_SETUP/AT_CLEANUP outside, to report as test title
+ the extra Bison directives instead of the whole series.
+ Change the grammar so that there are recoverable errors, and
+ unrecoverable errors. Now we can have the parser give up before
+ consuming the whole input. As a result we now can observe that
+ the lookahead is freed when needed.
+ Change the parser source to parse argv[1] instead of a hard coded
+ string.
+ Simplify yylex, and give a value and location to EOF.
+ Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
+ passed directives already coded in the file.
+ Add some tests to check the location of "error".
+ For some tests, the C++ parser is correct, and not yacc.c.
+ For other tests, they provide different, but unsatisfying, values,
+ so keep the C++ value so that at least one parser is "correct"
+ according to the test suite.
+ (Actions after errors): Remove, this is subsumed by the
+ AT_CHECK_PRINTER_AND_DESTRUCTOR series.
+
+2004-09-06 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc: Adjust the indentation of the labels.
+ (Parser::pop): New.
+ Use it.
+
+2004-09-06 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
+ argument, an informative message.
+ Call YY_SYMBOL_PRINT.
+ Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
+ * data/lalr1.cc (destruct_): Likewise.
+ In addition, no longer depend on b4_yysymprint_generate and
+ b4_yydestruct_generate to generate these functions, do it "by
+ hand".
+
+2004-09-03 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
+ invoked, yydestruct the lookahead.
+ * tests/calc.at (Calculator $1): Update the expected lengths of
+ traces: there is an added line for the discarded lookahead.
+ * doc/bison.texinfo (Destructor Decl): Some rewording.
+ Define "discarded" symbols.
+
+2004-09-02 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (translate_, destruct_): No reason to be static.
+
+2004-09-02 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
+ (YYDSYMPRINTF): Rename as...
+ (YY_SYMBOL_PRINT): this.
+ * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
+ two.
+ Use it instead of direct symprint_ calls.
+ (yybackup): Tweak the "Now at end of input" case to match yacc.c's
+ one.
+
+2004-09-02 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (b4_yysymprint_generate): New.
+ (symprint_): New member function, defined when YYDEBUG.
+ Use it consistently instead of token/nterm debugging output by
+ hand.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
+ %printer calls to use cdebug_ when using lalr1.cc.
+
+2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
+
+ * data/glr.c: Guard the declarations of yypstack and yypdumpstack
+ with #ifdef YYDEBUG.
+
+2004-08-26 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Implementing Loops): Rename as...
+ (Implementing Gotos/Loops): this.
+
+2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ Adjust to latest gnulib.
+ * bootstrap (gnulib_modules): Add xalloc-die.
+ Set LC_ALL=C so that file names sort consistently.
+ Prefer the gnulib copies of gettext.m4, glibc21.m4,
+ inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
+ uintmax_t.m4, ulonglong.m4.
+ (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
+ po.m4 since we are now using _gl.m4 instead.
+
+2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
+
+ * src/scan-action.l: Remove. Scanning of semantic actions is
+ handled in scan-gram.l.
+
+2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
+
+ * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
+
+ * src/location.h (struct): The file member is a uniqstr.
+ (equal_boundaries): Use UNIQSTR_EQ for comparison.
+
+2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix bug with non-%union parsers that have printers or destructors,
+ which led to a Bison core dump. Reported by Peter Fales in
+ <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
+
+ * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
+ * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
+ not to our own type.
+ * src/output.c (symbol_destructors_output, symbol_printers_output):
+ Don't assume %union.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
+ AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
+ UNION-FLAG. All callers changed.
+ (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
+ Use type char, not unsigned int, when declaring an array of char;
+ this lets us remove a cast.
+ (Printers and Destructors): Add non-%union test cases.
+
+2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/bison.texinfo: Minor editorial changes, mostly to the new
+ GLR writeups. E.g., avoid frenchspacing and the future tense,
+ change "lookahead" to "look-ahead", and change "wrt" to "with
+ respect to".
+
+2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
+
+ * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
+ New sections, split off from the GLR Parsers section. Put the new
+ Simple GLR Parser near the start of the GLR section, for clarity.
+ Rewrite connective text.
+
+2004-06-21 Frank Heckenbach <frank@g-n-u.de>
+
+ * doc/bison.texinfo (Simple GLR Parsers): New section.
+
+2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS, TODO, doc/bison.texinfo:
+ Use "look-ahead" instead of "lookahead", to be consistent.
+ * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
+ while we're fixing "look-ahead".
+ * src/conflicts.c (shift_set): Renamed from shiftset.
+ (look_ahead_set): Renamed from lookaheadset.
+ * src/print.c: Likewise.
+ * src/getargs.c (report_args): Add "look-ahead" as the new canonical
+ name for "lookahead".
+ (report_types, usage): Likewise.
+ * src/getargs.h (report_look_ahead_tokens): Renamed from
+ report_lookaheads.
+ * src/lalr.c (compute_look_ahead_tokens): Renamed from
+ compute_lookaheads.
+ (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
+ (look_ahead_tokens_print): Renamed from lookaheads_print.
+ * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
+ state_rule_lookaheads_print.
+ * src/state.h: Likewise.
+ (reductions.look_ahead_tokens): Renamed from lookaheads.
+ * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
+ AT_DATA_LOOKAHEADS_GRAMMAR.
+
+2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ * README: Update location of patched M4 distribution.
+
+2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
+
+ Don't assume the C++ compiler takes the same arguments as the C compiler
+ (trivial change).
+ * configure.ac (O0CXXFLAGS): New var.
+ * tests/atlocal.in (CXXFLAGS): Use it.
+
+2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix some "make check" problems with C++ reported by
+ Albert Chin-A-Young for Tru64 C++ in this thread:
+ http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
+
+ * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
+ Output to a .cc file for C++, not to a .c file.
+ * tests/calc.at (AT_CHECK_CALC): Likewise.
+ * tests/regression.at (AT_CHECK_DANCER): Likewise.
+ * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
+
+2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
+
+ * tests/calc.at, tests/actions.at: Workaround for SGI
+ C++ compiler. (trivial change)
+
+2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ Spent a few hours checking out which prerequisite versions the
+ current sources actually require. I went all the way back to
+ Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
+ a seemingly endless set of combinations of versions more recent
+ than that. The bottom line is that the current sources require
+ fairly recent versions of the build tools, and it'll be some work
+ to change this.
+ * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
+ (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
+ (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
+ Add comments explaining why those particular versions are
+ currently needed.
+
+ * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
+ in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
+ <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
+
+ * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
+ (it fails with a Autoconf-without-aclocal-m4 diagnostic).
+
+2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
+ 0.11.5. Suggested by Bruno Haible.
+ * bootstrap: Remove gettext version checking.
+
+ * doc/bison.texinfo (Decl Summary): Also mention that %union
+ can depend on prerequisite types. Problem reported by Tim
+ Van Holder.
+
+2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ * README: Mention GNU m4 1.4 bugs and Akim's patched version.
+ * README-alpha: Don't tell people not to package this.
+
+ * bootstrap: Don't assume $(...) works; use `...` instead.
+ Problem reported by Paul Hilfinger. Also, diagnose non-GNU
+ gettext better.
+
+ * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
+ put into the -d output file, and mention what to do if YYSTYPE is
+ defined as a macro.
+
+2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ Undo change made earlier today: it caused autopoint to not bring
+ in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
+ autopoint's.
+
+ * bootstrap: Check that gettext version matches what's in
+ configure.ac. Warn users to ignore robots.txt ERROR 404.
+ * bootstrap: Undo today's earlier change (logged below).
+ * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
+
+ The gettext version checking is causing more trouble than it's
+ curing; remove it. Problem reported by Paul Hilfinger.
+
+ * bootstrap: Issue a warning that one can expect a message
+ 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
+ * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
+
+2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ Ensure that the C++ compiler used for testing actually works on a
+ simple test program; if not, skip the C++-related tests. Problem
+ reported by Vin Shelton in:
+ http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
+
+ * m4/cxx.m4: New file.
+ * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
+ * tests/atlocal.in (BISON_CXX_WORKS): Add.
+ * tests/local.at (AT_COMPILE_CXX): Use it.
+
+2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * data/glr.c (yylloc): Output this macro even if locations are not
+ being generated, as the GLR parser needs it even in that case.
+ Problem reported by Troy A. Johnson
+ <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
+
+ * configure.ac (AC_INIT): Update to 1.875e.
+
+2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Version 1.875d.
+ * configure.ac (AC_INIT): Likewise.
+ * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
+
+ * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
+ -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
+ lalr1.cc runs afoul of the first, and the last two are no longer
+ supported by GCC 3.4.0.
+ * README: Mention GNU m4 1.4 or later; mention m4 patches.
+ * HACKING: Use ./bootstrap, not "make update" to import foreign files.
+
+2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
+ unsigned int, for compatibility with latest gnulib hash module.
+ * src/state.c (state_hash, state_hasher): Likewise.
+ * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
+ * src/uniqstr.c (hash_uniqstr): Likewise.
+
+2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Unescaped newlines are no longer allowed in char & strings.
+
+ * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
+ SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
+ character and string literals.
+ (unexpected_end): New function.
+ (unexpected_eof): Use it.
+ (unexpected_newline): New function.
+ (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
+ actions.
+
+ * NEWS: Document %expect-rr.
+
+ * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
+ Fix typo by replacing $1 with $option.
+ Remove more 'intl'-related files.
+ Don't DEFUN AM_INTL_SUBDIR twice.
+
+ * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
+ memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
+ strtoul.c.
+ * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
+ hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
+ xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
+ inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
+ stdint_h.m4, uintmax_t.m4, ulonglong.m4.
+ * src/.cvsignore: Add *.output.
+
+ * src/parse-gram.y: Put copyright notice inside %{ %} so it
+ gets copied to the output file.
+
+2004-04-28 Paul Eggert <eggert@twinsun.com>
+
+ Get files from the gnulib and po repositories, instead of relying
+ on them being in our CVS. Upgrade to latest versions of gnulib
+ and Automake.
+
+ * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
+ * bootstrap: Bootstrap from gnulib and po repositories.
+ Much of this code was stolen from GNU diff and GNU tar's bootstrap.
+ * README-cvs: Document these changes. Remove version numbers from
+ mentions of build tools, since they change so often. Mention Flex.
+
+ * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
+ (gl_USE_SYSTEM_EXTENSIONS): Add.
+ (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
+ Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
+ does this for us.
+ (AC_ISC_POSIX): Remove; we no longer support this
+ ancient OS, as it gets in the way of latest Autoconf & gnulib.
+ (AC_HEADER_STDC): Remove: we now assume C89 or better.
+ (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
+ Do not check for C89 headers, except for locale.h which is used
+ by the Yacc library and must port to K&R hosts.
+ (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
+ Do not check for C89 functions, except for setlocale which is
+ used by the Yacc library.
+ (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
+ (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
+ gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
+ gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
+ gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
+ AM_GNU_GETTEXT): Remove; now done by:
+ (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
+ (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
+ for us.
+
+ * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
+ (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
+ Define to empty, as gnulib.mk will do the rest for us.
+ ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
+ for us.
+ (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
+ (lib_SOURCES): New symbol, containing only the non-gnulib libs.
+
+ * src/files.c: Include gnulib's xstrndup.h.
+
+ * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
+ (REALLOC): Use xnrealloc, for likewise.
+ (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
+ (strnlen, memrchr): Remove decls; functions no longer used.
+ Include <stpcpy.h>.
+
+ * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
+ lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
+ lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
+ lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
+ lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
+ lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
+ lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
+ lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
+ lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
+ lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
+ lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
+ m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
+ m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
+ m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
+ m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
+ m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
+ m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
+ m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
+ po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
+ po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
+ po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
+ Remove, as these files are now generated automatically
+ by bootstrap or automake.
+
+ * po/ChangeLog: Remove: all but one entry was a duplicate
+ of this file, and I moved that 2000-11-02 entry here.
+
+ * config/.cvsignore: Add Makefile, depcomp, install-sh.
+ * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
+ argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
+ exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
+ getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
+ hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
+ memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
+ quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
+ strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
+ strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
+ unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
+ xstrndup.h.
+ * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
+ dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
+ mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
+ stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
+ * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
+ * src/.cvsignore: Remove *_.c.
+
+
+ * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
+ support it. (The latest stable gzip doesn't.)
+
+2004-04-27 Paul Eggert <eggert@twinsun.com>
+
+ * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
+ case, as stos_ is now used by destructors due to the 2004-02-09
+ change.
+
+ Remove more K&R C support.
+ * lib/libiberty.y (PARAMS): Remove. All uses removed.
+ * lib/subpipe.c (errno): Remove decl.
+ Include <stdlib.h> unconditionally.
+ (EXIT_FAILURE): Remove macro.
+ * src/complain.c (vfprintf, strerror): Remove.
+ * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
+ unconditionally.
+ (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
+ Use latest Autoconf recommendations for including inttypes.h, stdint.h.
+ (strchr, strspn, memchr): Remove decls.
+ * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
+ unconditionally. Do not declare perror.
+ * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
+ unconditionally.
+
+ * src/complain.c (_): Remove useless defn, as system.h defines this.
+
+ * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
+ with latest obstack.h.
+ * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
+ to procedure types, as obstack.h now does that for us.
+ * lib/lbitset.c (lbitset_elt_alloc): Likewise.
+
+ * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
+ so that this include file can stand alone.
+ * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
+ does this now. Include subpipe.h first after config.h, to
+ test whether it can stand alone.
+
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
+ declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
+ unused declaration.
+
+ * tests/synclines.at (%union synch line): Put a dummy member in
+ the union, because empty unions aren't allowed in C. Caught
+ by GCC 3.4.0.
+
+2004-04-13 Jim Meyering <jim@meyering.net>
+
+ * src/conflicts.c (conflicts_print): Correct format string typo:
+ use `%%' to produce literal `%'. (trivial change)
+
+2004-03-30 Paul Eggert <eggert@twinsun.com>
+
+ * src/getargs.c (version): Update copyright year to 2004.
+
+ * data/c.m4 (b4_int_type): Use 'short int' rather than
+ 'short', and similarly for 'long', 'unsigned', etc.
+ * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
+ yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
+ yy_yypstack, yydumpstack): Likewise.
+ * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
+ translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
+ Likewise.
+ * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
+ yy_stack_print, yyparse): Likewise.
+ * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
+ * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
+ * lib/bitset.c (bitset_print): Likewise.
+ * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
+ * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
+ * lib/bitsetv.c (bitsetv_dump): Likewise.
+ * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
+ * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
+ Likewise.
+ * src/LR0.c (allocate_itemsets): Likewise.
+ * src/gram.h (rule_number, rule): Likewise.
+ * src/lalr.h (goto_number): Likewise.
+ * src/nullable.c (nullable_compute): Likewise.
+ * src/output.c (prepare_rules): Likewise.
+ * src/relation.c (relation_print, relation_digraph): Likewise.
+ * src/relation.h (relation_node): Likewise.
+ * src/state.h (state_number, transitions, errs, reductions,
+ struct state): Likewise.
+ * src/symtab.h (symbol_number, struct symbol): Likewise.
+ * src/tables.c (vector_number, tally, action_number,
+ default_goto, goto_actions): Likewise.
+ * tests/existing.at (GNU Cim Grammar): Likewise.
+ * tests/regression.at (Web2c Actions): Likewise.
+
+ * src/output.c (muscle_insert_short_int_table): Renamed from
+ muscle_insert_short_table. All uses changed.
+
+2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
+
+ * src/parse-gram.y: Define PERCENT_EXPECT_RR.
+ (declaration): Replace expected_conflicts with expected_sr_conflicts.
+ Add %expect-rr rule.
+
+ * src/scan-gram.l: Recognize %expect-rr.
+
+ * src/conflicts.h (expected_sr_conflicts): Rename from
+ expected_conflicts.
+ (expected_rr_conflicts): Declare.
+
+ * src/conflicts.c (expected_sr_conflicts): Rename from
+ expected_conflicts.
+ (expected_rr_conflicts): Define.
+ (conflicts_print): Check r/r conflicts against expected_rr_conflicts
+ for GLR parsers.
+ Use expected_sr_conflicts in place of expected_conflicts.
+ Warn if expected_rr_conflicts used in non-GLR parser.
+
+ * doc/bison.texinfo: Add documentation for %expect-rr.
+
+2004-03-08 Paul Eggert <eggert@gnu.org>
+
+ Add support for hex token numbers. Suggested by Odd Arild Olsen in
+ <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
+
+ * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
+ in lalr1.cc.
+ * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
+ * src/scan-gram.l (scan_integer): New function.
+ ({int}): Use it.
+ (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
+ (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
+ handle_action_dollar, handle_action_at, convert_ucn_to_byte):
+ Say "long int", not "long", for uniformity with GNU style.
+
+2004-02-25 Paul Eggert <eggert@twinsun.com>
+
+ * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
+ compilers. This fixes a problem with Intel's C++ compiler being
+ chatty, reported by Guido Trentalancia in
+ <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
+
+2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
+
+ Support %destructor and merge error locations in lalr1.cc.
+
+ * data/lalr1.cc (b4_cxx_destruct_def): New macro.
+ (Parser::stos_): Define unconditionally.
+ (Parser::destruct_): New method. Generate its body with
+ b4_yydestruct_generate.
+ (Parser::error_start_): New attribute.
+ (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
+ token which are discarded.
+ (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
+ error_start_ when erroneous token are discarded.
+ (Parser::parse) <yyerrlab1>: Compute the location of the error
+ token so that it covers all the discarded tokens.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
+ it can be called with `%skeleton "lalr1.cc"', and do that.
+
+2004-02-02 Paul Eggert <eggert@twinsun.com>
+
+ * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
+ $(top_srcdir)/lib and ../lib. This fixes a bug reported
+ by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
+ There's no need to mention top_builddir since Automake does that
+ for us.
+ (INCLUDES): Remove, as Automake says it's obsolescent.
+ Contents migrated into AM_CPPFLAGS as described above.
+ * lib/Makefile.am (INCLUDES): Remove; obsolescent.
+
+2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
+
+ * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
+ (yyreportSyntaxError): Handle case where lookahead token is
+ YYEMPTY.
+
+2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
+ resulting parsers are compilable with C++.
+
+2003-12-23 Paul Eggert <eggert@twinsun.com>
+
+ * config/depcomp, config/install-sh: Sync with Automake 1.8.
+ * src/output.c (output_skeleton): Rename local var.
+ * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
+ Bison tokens, as this runs afoul of the 2003-10-07 change that
+ disallowed NUL bytes in character constants or string literals.
+
+ * tests/local.at: Require Autoconf 2.59's Autotest.
+ * tests/testsuite.at: Don't include local.at, since we now assume
+ Autoconf 2.59 or later. Autoconf 2.59 had some problems with
+ including it.
+ * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
+ multiple inclusion warnings.
+
+2003-12-02 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (How Can I Reset the Parser): More about start
+ conditions.
+ From Bruno Haible.
+
+2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
+
+2003-10-07 Paul Eggert <eggert@twinsun.com>
+
+ * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
+ if testsuite doesn't exist.
+
+ * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
+ literals, unfortunately.
+ * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
+ Complain about NUL bytes in character constants or string literals.
+
+2003-10-05 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS: Don't document %no-default-prec, as it's still
+ too experimental.
+ * doc/bison.texinfo: Document %no-default-prec only if
+ the defaultprec flag is set. Normally it's not.
+
+2003-10-04 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
+ non-modifiable lvalue, instead of a modifiable one.
+ * doc/bison.texinfo (Actions): Document that $$ can
+ be assigned to. Do not claim that $$ and $N are
+ array element references: user code should not rely on this.
+
+2003-10-01 Paul Eggert <eggert@twinsun.com>
+
+ * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
+ (grammar_declaration): Use it.
+ * src/scan-gram.l: New token %no-default-prec.
+ * tests/conflicts.at: Revamp tests to use %no-default-prec.
+ * NEWS, doc/bison.texinfo: Document the above.
+
+2003-10-01 Akim Demaille <akim@epita.fr>
+
+ VCG no longer supports long_straight_phase.
+
+ * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
+ * src/print_graph.c (print_graph): Adjust.
+
+2003-09-30 Frank Heckenbach <frank@g-n-u.de>
+ and Paul Eggert <eggert@twinsun.com>
+
+ * doc/bison.texinfo (Decl Summary, Contextual Precedence,
+ Table of Symbols): Document %default-prec.
+ * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
+ (grammar_declaration): Set default_prec on %default-prec.
+ * src/scan-gram.l (%default-prec): New token.
+ * src/reader.h (default_prec): New flag.
+ * src/reader.c: Likewise.
+ (packgram): Handle it.
+ * tests/conflicts.at (%default-prec without %prec,
+ %default-prec with %prec, %default-prec 1): New tests.
+
+2003-09-30 Paul Eggert <eggert@twinsun.com>
+
+ * tests/testsuite.at: Include local.at, not input.at, fixing
+ a typo in the 2003-08-25 patch.
+
+2003-08-27 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
+ GCC warnings.
+
+2003-08-26 Akim Demaille <akim@epita.fr>
+
+ * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
+ "<\#" to avoid magic from Gnus when posting parts of this script.
+
+2003-08-26 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
+ (Parser::parse): here.
+ Adjust: nerrs and errstatus is now replaced by...
+ (Parser::nerrs_, Parser::errstatus_): New.
+
+2003-08-25 Akim Demaille <akim@epita.fr>
+
+ * config/announce-gen, Makefile.cfg: New.
+ * Makefile.am: Adjust.
+ * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
+ keeping local WGET and WGETFLAGS modifications from Paul Eggert.
+
+2003-08-25 Akim Demaille <akim@epita.fr>
+
+ When reducing initial empty rules, Bison parser read an initial
+ location that is not defined. This results in garbage, and that
+ affects Bison's own parser. Therefore we need (i) to extend Bison
+ to support a means to initialize this location, and (ii) to use
+ this CVS Bison to fix CVS Bison's parser.
+
+ * src/reader.h, reader.c (epilogue_augment): Remove, replace
+ with...
+ * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
+ * src/parse-gram.y: Adjust.
+ (%initial-action): New.
+ (%error-verbose): Since we require CVS Bison, there is no reason
+ not to use it.
+ * src/scan-gram.l: Adjust.
+ * src/Makefile.am (YACC): New, to make sure we use our own parser.
+ * data/yacc.c (yyparse): Use b4_initial_action.
+
+2003-08-25 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Don't promote stdout for error messages.
+
+2003-08-25 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
+ From Alexandre Duret-Lutz.
+
+2003-08-25 Akim Demaille <akim@epita.fr>
+
+ Version 1.875c.
+
+2003-08-25 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
+ Use them.
+
+2003-08-25 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (Parser::reduce_print_): New.
+ Use it.
+
+2003-08-25 Akim Demaille <akim@epita.fr>
+
+ Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
+ error recovery loops. This patch is based on
+ <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
+ Also, augment the similarity between lalr1.cc and yacc.c.
+ Note: the locations of error recovery rules are not correct yet.
+
+ * data/lalr1.cc: Comment changes to augment the similarity between
+ lalr1.cc and yacc.c.
+ (YYERROR): Goto to yyerrorlab, not yyerrlab1.
+ (yyerrlab1): Remove, but where it used to be (now the bottom part of
+ yyerrlab), when hitting EOF, pop the whole stack here instead of
+ merely falling thru the default error handling mechanism.
+ (yyerrorlab): New label, with the old contents of YYERROR,
+ plus the following change: pop the stack of rhs corresponding
+ to the production that invoked YYERROR. That is how Yacc
+ behaves (required by POSIX).
+ * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
+ fail.
+
+2003-08-25 Akim Demaille <akim@epita.fr>
+
+ Tune local.at so that people can "autom4te -l autotest calc.at -o
+ calc" for instance, to extract a sub test suite.
+
+ * tests/testsuite.at: Move the initialization, Autotest version
+ requirement, and AT_TESTED invocation into...
+ * tests/local.at: here.
+ * tests/testsuite.at: Include it for compatibility with Autoconf
+ 2.57.
+ * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
+ be ignore.
+
+2003-08-04 Paul Eggert <eggert@twinsun.com>
+
+ Rework code slightly to avoid gcc -Wtraditional warnings.
+ * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
+ The returned value is now stored in *YY0. All callers changed.
+ * src/output.c (merge_output): Adjust to the above change.
+
+2003-07-26 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (YYASSERT): New macro.
+ (yyfillin, yydoAction, yyglrReduce, yysplitStack,
+ yyresolveStates, yyprocessOneStack):
+ Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
+ Derived from a suggestion by Frank Heckenbach.
+
+2003-07-25 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
+ for portability to K&R C (after ansi2knr, presumably). See
+ <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
+ by Frank Heckenbach, though I have omitted the structure-initialization
+ part of his glr-knr.diff patch since I recall that the Portable
+ C Compiler didn't require that change.
+
+ Let the user specify how to allocate and free memory.
+ Derived from a suggestion by Frank Heckenbach in
+ <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
+ * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
+ All uses of free, malloc, realloc changed to use these macros,
+ and unnecessary casts removed.
+ * data/yacc.c (YYFREE, YYMALLOC): Likewise.
+
+2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
+
+ * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
+ use s.empty() rather than s == "" to test for empty string; see
+ <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
+ (trivial change)
+
+2003-06-25 Akim Demaille <akim@epita.fr>
+
+ * config/depcomp, config/install-sh: Update from masters.
+
+2003-06-20 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
+ and return properly parenthesized result.
+ * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
+ * data/yacc.c (YYLLOC_DEFAULT): Likewise.
+ Remove unnecessary parentheses from uses.
+ * doc/bison.texinfo (Location Default Action): Describe the
+ conventions for parentheses.
+
+2003-06-19 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
+ yyreportTree): Do not assume that size_t is the same width as int,
+ when printing sizes. Print sizes using an unsigned format.
+ Problem reported by Frank Heckenbach in
+ <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
+
+ Port to Forte Developer 7 C compiler.
+ * data/glr.c (struct YYLTYPE): If locations are not being used,
+ declare a single dummy member, as empty structs do not conform
+ to the C standard.
+ (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
+ the Forte Developer 7 C compiler complains that end-of-loop
+ code is not reached.
+
+2003-06-17 Paul Eggert <eggert@twinsun.com>
+
+ * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
+ avoid warnings from picky compilers about redefinition of PARAMS.
+
+2003-06-17 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.875b.
+
+ * NEWS: Document 1.875b.
+
+ * lib/bbitset.h: Do not include config.h; that's the includer's job.
+ Do not include <sys/types.h>; shouldn't be needed on a C89 host.
+ * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
+ Don't use 'index' in comments, as it's a builtin fn on some hosts.
+ * lib/bitset_stats.c: Include gettext.h unconditionally, as
+ per recent gettext manual's suggestion.
+ * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
+ Use prototypes, not old-style definitions.
+ * lib/lbitset.c (lbitset_unused_clear): Likewise.
+ * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
+ vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
+ vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
+ vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
+ vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
+ vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
+ vbitset_or_and_cmp, vbitset_copy): Likewise.
+
+ * lib/libiberty.h: Do not include config.h; that's the includer's job.
+ Do not include <stdlib.h>.
+ (PARAMS): Define unconditionally for C89.
+ (ATTRIBUTE_NORETURN): Remove.
+ (ATTRIBUTE_UNUSED): Define unconditionally.
+
+ Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
+ <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
+ * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
+ * lib/vbitset.c, lib/vbitset.h: New files.
+ * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
+ lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
+ from libbitset.
+
+ * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
+ `How Can I Reset @code{yyparse}', since texinfo does not allow
+ arbitrary @ in node names.
+
+ * m4/Makefile.am (EXTRA_DIST): Add the following files, which
+ shouldn't be needed according to the gettext 0.12.1 documentation
+ but which seem to be needed anyway: codeset.m4 glibc21.m4
+ intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
+ lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
+ * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
+
+ * lib/.cvsignore: Add stdbool.h.
+ * m4/.cvsignore: Add nls.m4, po.m4.
+
+ Upgrade to CVS gnulib.
+ * stdbool_.h: File renamed from stdbool.h.in.
+ * configure.ac (AM_STDBOOL_H): Invoke this instead of
+ AC_HEADER_STDBOOL.
+ (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
+ (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
+ * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
+ (MOSTLYCLEANFILES): New var.
+ ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
+ (stdbool.h): New rule.
+ * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
+ lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
+ lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
+ m4/quote.m4: Upgrade to today's gnulib.
+
+ * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
+ (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
+ the tests right now.
+ * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
+ yyerror are declared before use; C99 requires this.
+
+2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
+ first.
+ (yyrecoverSyntaxError): Correct the logic for setting and testing
+ yyerrState.
+ Correct comment on handling EOF.
+ Allow states with only a default reduction, rather than failing
+ (I can't quite reconstruct why these were not allowed before).
+
+ Fixes to avoid problem that $-N rules in GLR parsers can cause
+ buffer overruns, corrupting state.
+
+ * src/output.c (prepare_rules): Output max_left_semantic_context
+ definition.
+ * src/reader.h (max_left_semantic_context): New variable declaration.
+ * src/scan-gram.l (max_left_semantic_context): Define.
+ (handle_action_dollar): Update max_left_semantic_context.
+ * data/glr.c (YYMAXLEFT): New definition.
+ (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
+ (yyresolveAction): Ditto.
+
+ Fixes to problems with location handling in GLR parsers reported by
+ Frank Heckenbach (2003/06/05).
+
+ * data/glr.c (YYLTYPE): Make trivial if locations not used.
+ (YYRHSLOC): Add parentheses, and define only if locations used.
+ (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
+ locations not used.
+ (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
+ (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
+
+ * tests/cxx-type.at: Exercise location information; update tests
+ to differentiate output with and without locations.
+ Remove forward declarations of yylex and yyerror---caused errors
+ because default YYLTYPE not yet defined.
+ Change semantic actions to compute strings, rather than printing
+ them directly (to test proper passing of semantics values). Change
+ output to prefix notation and update test data and expected results.
+ (yylex): Track locations.
+ (stmtMerge): Return value rather than printing, and include arguments
+ in value.
+
+2003-06-03 Paul Eggert <eggert@twinsun.com>
+
+ Avoid warnings generated by GCC 2.95.4 when Bison is
+ configured with --enable-gcc-warnings.
+ * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
+ yy::]b4_parser_class_name[::translate_,
+ yy::Stack::operator[] (unsigned),
+ yy::Stack::operator[] (unsigned) const,
+ yy::Slice::operator[] (unsigned),
+ yy::Slice::operator[] (unsigned) const):
+ Rename local vars to avoid warnings.
+ * tests/glr-regression.at (Improper handling of embedded actions
+ and $-N in GLR parsers): Remove unused local variable from yylex.
+ * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
+ (void) as arg when not pure, since we now assume C89 when building
+ Bison. Pacify GCC by using parameter.
+
+2003-06-02 Paul Eggert <eggert@twinsun.com>
+
+ * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
+ yy::Location::lines, yy::Location::columns): Rename arguments
+ to avoid shadowing; this removes a warning generated by GCC 3.3.
+
+2003-06-01 Paul Eggert <eggert@twinsun.com>
+
+ Don't pass C-only warning optins (e.g., -Wmissing-declarations)
+ to g++, as GCC 3.3 complains if you do it.
+ * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
+ everything that WARNING_CFLAGS has, except omit warnings
+ not suitable for C++.
+ (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
+ * tests/atlocal.in (CXXFLAGS): New var.
+ * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
+
+ Fix a GLR parser bug I reported in February; see
+ <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
+ The problem was that GLR parsers did not conform to the C standard,
+ because actions like { $1 = $2 + $3; } expanded to expressions
+ that invoked YYFILL in separate subexpressions, and YYFILL assigned
+ to a local variable. The C standard says that expressions
+ like (var = f ()) + (var = f ()) have undefined behavior.
+ Another problem was that GCC sometimes issues warnings that
+ yyfill and its parameters are unused.
+
+ * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
+ as possibly unused.
+ (yyfill): New function.
+ (YYFILL): Use it.
+ (yyuserAction): Change type of yynormal to bool, so that it matches
+ the new yyfill signature. Mark it as possibly unused.
+
+
+ Follow up on a bug I reported in February, where a Bison-generated
+ parser can loop. Provide a test case and a fix for yacc.c. I
+ don't have a fix for lalr1.cc or for glr.c, unfortunately.
+ The original bug report is in:
+ <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
+
+ * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
+ macro's size was becoming unwieldy.
+ (yyerrlab): Do not discard an empty lookahead symbol, as this
+ might destroy garbage.
+ (yyerrorlab): New label, with the old contents of YYERROR,
+ plus the following change: pop the stack of rhs corresponding
+ to the production that invoked YYERROR. That is how Yacc
+ behaves, and POSIX requires this behavior.
+ (yyerrlab1): Use YYPOPSTACK instead of its definiens.
+ * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
+ Define 'alarm' to do nothing if unistd.h is not available.
+ Add a new rule "exp: '-' error;" to test the above change to
+ data/yacc.c. Use 'alarm' to abort any test taking longer than
+ 10 seconds, as it's probably looping.
+ (AT_CHECK_CALC): Test recovery from error in new grammar rule.
+ Also, the new yacc.c generates two fewer diagnostics for an
+ existing test.
+
+2003-05-24 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
+ YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
+ This fixes a problem reported by John Bowman when the Compaq/HP
+ Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
+ -ansi -Wall -gall).
+ * data/yacc.c (union yyalloc): Likewise.
+ (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
+
+ Switch from 'int' to 'bool' where that makes sense.
+
+ * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
+ abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
+ abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
+ abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
+ Return or accept bool, not int. All callers changed.
+ * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
+ bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
+ * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
+ bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
+ bitset_or_and_cmp_): Likewise.
+ * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
+ * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
+ bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
+ bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
+ bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
+ bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
+ bitset_stats_or_and_cmp): Likewise.
+ * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
+ ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
+ ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
+ ebitset_xor_cmp): Likewise.
+ * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
+ lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
+ lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
+ lbitset_xor_cmp): Likewise.
+ * lib/bbitset.h: Include <stdbool.h>.
+ (struct bitset_vtable): The following members now return bool, not
+ int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
+ and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
+ or_and_cmp).
+ * src/conflicts.c (count_rr_conflicts): Likewise.
+ * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
+ All uses changed.
+ * lib/ebitset.c (ebitset_obstack_init): Likewise.
+ * lib/lbitset.c (lbitset_obstack_init): Likewise.
+ * src/getargs.c (debug_flag, defines_flag, locations_flag,
+ no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
+ graph_flag): Likewise.
+ * src/getargs.h (debug_flag, defines_flag, locations_flag,
+ no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
+ graph_flag): Likewise.
+ * src/output.c (error_verbose): Likewise.
+ * src/output.h (error_verbose): Likewise.
+ * src/reader.c (start_flag, typed): Likewise.
+ * src/reader.h (typed): Likewise.
+ * src/getargs.c (LOCATIONS_OPTION): New constant.
+ (long_options, getargs): Use it.
+ * src/lalr.c (build_relations): Use bool, not int.
+ * src/nullable.c (nullable_compute): Likewise.
+ * src/print.c (print_reductions): Likewise.
+ * src/tables.c (action_row, pack_vector): Likewise.
+ * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
+ * src/output.c (prepare): Use it.
+ * src/output.c (token_definitions_output,
+ symbol_destructors_output, symbol_destructors_output): Use string,
+ not boolean integer, to keep track of whether to output separator.
+ * src/print_graph.c (print_core): Likewise.
+ * src/state.c (state_rule_lookaheads_print): Likewise.
+
+ * config/install-sh: Sync from automake 1.7.5.
+
+2003-05-14 Paul Eggert <eggert@twinsun.com>
+
+ * src/parse-gram.y (rules_or_grammar_declaration): Require a
+ semicolon after a grammar declaration, in the interest of possible
+ future changes to the Bison input language.
+ Do not allow a stray semicolon at the start of the grammar.
+ (rhses.1): Allow one or more semicolons after any rule, including
+ just before "|" as required by POSIX.
+ * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
+ grammar.
+
+2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
+
+ %parse-param support for lalr1.cc.
+
+ * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
+ b4_cc_constructor_calls, b4_cc_constructor_call,
+ b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
+ definitions.
+ (yy::b4_parser_class_name::b4_parser_class_name): Take extra
+ parse-param arguments.
+ (yy::b4_parser_class_name): Declare instance variables to
+ hold parse-param arguments.
+ * tests/calc.at: s/value/semantic_value/ because value clashes
+ with a member of yy::b4_parser_class_name. Adjust C++ code
+ to handle %parse-param. Enable %parse-param test in C++.
+
+2003-05-12 Paul Eggert <eggert@twinsun.com>
+
+ * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
+ English a bit. Fix fclose typo. Change "const char" to "char
+ const", and use ANSI C rather than K&R for "main". Suggest
+ YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
+ and suggest yy_switch_to_buffer.
+
+2003-05-05 Paul Eggert <eggert@twinsun.com>
+
+ * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
+ C89. This avoids a diagnostic on compilers that define __STDC__
+ to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
+
+2003-05-03 Paul Eggert <eggert@twinsun.com>
+
+ * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
+ Do not overrun array bounds.
+ This should fix a bug reported today by Olatunji Oluwabukunmi in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
+
+2003-04-29 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
+ * src/getargs.c, src/getargs.h: here, as bool, not int.
+ (nondeterministic_parser): New.
+ * src/parse-gram.y, src/scan-gram.l: Support
+ %nondeterministic-parser.
+ * src/output.c (prepare): Use nondeterministic_parser instead
+ of glr_parser where appropriate.
+ * src/tables.c (conflict_row, action_row, save_row)
+ (token_actions, token_actions, pack_vector): Ditto.
+
+2003-04-29 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
+
+2003-04-29 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
+ with %pure-parser and %locations to exercise the patch from Yakov
+ Markovitch below.
+
+2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
+
+ * data/yacc.c: (b4_lex_param): Corrected for the case where
+ %lex-param is provided and %pure-parser isn't.
+
+2003-04-27 Paul Eggert <eggert@twinsun.com>
+
+ Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
+ * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
+ if it is not defined.
+ (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
+
+2003-04-26 Paul Eggert <eggert@twinsun.com>
+
+ * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
+ Declare to be of type suitable for the ninf value itself, not of
+ type suitable for the corresponding table, since the latter might
+ be unsigned but the ninf value might be negative. This fixes a
+ bug reported by Alexandre Duret-Lutz in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
+
+ * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
+ invokes it. We shouldn't invoke it twice because it will attempt
+ to put error.o in the archive twice. This fixes a glitch reported
+ by Martin Mokrejs in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
+
+2003-04-21 Paul Eggert <eggert@twinsun.com>
+
+ * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
+ to gnulib.
+
+2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
+
+ * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
+ Fix obvious typo that results in uncompilable GLR parsers
+ when both %pure-parser and %locations are used. (trivial change)
+
+2003-04-17 Paul Eggert <eggert@twinsun.com>
+
+ * src/scan-gram.l: Add %option nounput, since we no longer use unput.
+ (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
+ Do not insert the expected token via unput, as this runs afoul
+ of a POSIX-compatibility bug in flex 2.5.31.
+ All uses changed to BEGIN the parent state,
+ since we no longer insert the expected token via unput.
+ * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
+ that is no longer emitted after the above change.
+
+ * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
+ the first one. This change is from Paul Hilfinger, and it fixes
+ regression reported by Werner Lemberg in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
+
+ (resolve_sr_conflict): Don't invoke state_errs_set
+ unless one or more tokens have been explicitly made errors.
+ Otherwise, the above change causes Bison to abort.
+
+ * tests/existing.at (GNU pic Grammar): New test case, taken from
+ Lemberg's email.
+
+2003-03-31 Akim Demaille <akim@epita.fr>
+
+ * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
+
+2003-03-31 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (prepare_symbols): Avoid trailing spaces in the
+ output.
+
+2003-03-31 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
+ From Paul Hilfinger.
+
+2003-03-29 Akim Demaille <akim@epita.fr>
+
+ * m4/error.m4: Do not put under dynamic conditions some code which
+ expansion is under static control.
+
+2003-03-29 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
+
+2003-03-29 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Strings are Destroyed): New.
+
+2003-03-13 Paul Eggert <eggert@twinsun.com>
+
+ * .cvsignore: Add configure.lineno.
+ * src/.cvsignore: Add yacc.
+ * tests/.cvsignore: Add testsuite.log.
+ * doc/fdl.texi: Sync with latest FSF version.
+
+2003-03-12 Paul Eggert <eggert@twinsun.com>
+
+ * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
+ (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
+ cursor, instead of leaving it undefined. This fixes a bug
+ reported by Tim Van Holder in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
+ * tests/input.at (Torturing the Scanner): Test the scanner on
+ an empty input file, which was Tim Van Holder's test case.
+
+ * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
+ <sys/resource.h> can be included, include sys/time.h and
+ sys/times.h first, if available. This works around the SunOS
+ 4.1.4 porting bug reported by Bruce Becker in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
+
+ * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
+ AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
+ AC_HEADER_SYS_WAIT.
+
+ Merge changes from gnulib. This was prompted because the CVS
+ snapshot didn't build on Solaris 7 due to strnlen problems.
+
+ These changes need to be merged back into gnulib:
+ * lib/hash.c: Include <stdbool.h> unconditionally.
+ * m4/onceonly.m4 (m4_quote): New macro.
+ (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
+ Quote AC_FOREACH variable-expansions properly.
+ The 2003-01-03 obstack.h change also needs merging.
+ {end of changes requiring merging}
+
+ * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
+ m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
+ m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
+ m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
+ m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
+ New files, imported from gnulib.
+ * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
+ above.
+
+ * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
+ m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
+ gnulib sources.
+
+ * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
+ Add.
+ (gl_ERROR): New, replacing jm_PREREQ_ERROR.
+ (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
+ (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
+ (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
+ (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
+ (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
+ (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
+ (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
+ (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
+ (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
+ (jm_PREREQ_ARGMATCH): Remove.
+ (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
+ * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
+
+ * src/system.h: Include <stdbool.h> unconditionally.
+
+ * lib/bbitset.h: Include <limits.h> unconditionally. We have been
+ assuming at least C89 in the bitset code for some time now.
+
+2003-03-03 Akim Demaille <akim@epita.fr>
+
+ * ro.po: New.
+
+2003-03-02 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Table of Symbols): Reactivate the
+ documentation for %lex-param, and %parse-param.
+
+2003-03-02 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
+ generate verbose error messages.
+ Use the number of tokens as an upper bound in yytname, as it
+ cannot be a non terminal.
+
+2003-03-02 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
+ message.
+
+2003-03-02 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
+ Use them to exercise yycheck overrun.
+ Based on Andrew Suffield's grammar.
+
+2003-03-02 Akim Demaille <akim@epita.fr>
+
+ Create tests/local.at for Bison generic testing macros.
+
+ * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
+ * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
+ This new file.
+ * tests/calc.at (AT_CHECK_CALC): Adjust.
+ * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
+ (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
+ * tests/local.at: here.
+ (AT_COMPILE_CXX): Tags the tests using it as c++.
+ Ignore the test if CXX is not functional.
+
+2003-03-01 Paul Eggert <eggert@twinsun.com>
+
+ * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
+ not loc->end, since loc->end might contain garbage and this leads
+ to undefined behavior on some platforms.
+ (id_loc, token_start): Use (IF_LINTed) initial values that do not
+ depend on *loc, so that the reader doesn't give the the false
+ impression that *loc is initialized.
+ (<INITIAL>"%%"): Do not bother setting code_start, since its value
+ does not survive the return.
+
+2003-03-01 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l (code_start): Always initialize it when entering
+ into yylex, as SC_EPILOGUE is activated *before* the corresponding
+ yylex invocation. An alternative would be making it static, but
+ then it starts with the second %%'s beginning, instead of its end.
+
+2003-02-28 Paul Eggert <eggert@twinsun.com>
+
+ * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
+ around a UnixWare 7.1.1 porting bug reported by John Hughes in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
+
+2003-02-26 Paul Eggert <eggert@twinsun.com>
+
+ * README: Mention compiler bug in Sun Forte Developer 6 update 2.
+ Remove Sequent/Pyramid discussion (nobody uses them any more).
+ Merge VMS and MS-DOS discussion; these ports may well be dead
+ but let's keep mentioning them for now. Put <> around email
+ addresses. Add copyright notice.
+
+2003-02-24 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (yy_reduce_print): yylineno -> yylno,
+ to avoid collision with flex use of yylineno.
+ Problem reported by Bruce Lilly in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
+ * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
+ * data/yacc.c (yy_reduce_print): Likewise.
+
+ * config/depcomp: Sync with Automake 1.7.3.
+
+2003-02-21 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc: Use temporary variables instead of casts to
+ change integer types.
+ Suggested by Paul Eggert.
+
+2003-02-21 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Use "location" consistently to refer to @n,
+ to avoid confusions with lalr1.cc's notion of Position.
+ Suggested by Paul Eggert.
+
+2003-02-20 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (position.hh): Make sure "columns" never pushes
+ before initial_columns.
+ (location.hh): Use consistent variable names when defining the
+ operator<<.
+ Use "last" so that we subtract from Positions, not from unsigned.
+
+2003-02-20 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (position.hh): New subfile, including the extended
+ and Doxygen'ed documentation of class Position.
+ (location.hh): Use it.
+ Document a` la Doxygen.
+ With the help of Benoit Perrot.
+
+2003-02-20 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
+ AT_YACC_IF.
+ Redefine AT_YYERROR_SEES_LOC_IF using it.
+ (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
+ not defined.
+ Don't use the location in yy::Parser::error_ and
+ yy::Parser::print_ when not %locations.
+ Activate more lalr1.cc tests.
+
+2003-02-19 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc: When displaying a line number, be sure to make it
+ an int.
+
+2003-02-19 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
+ Remove, useless.
+ (YYABORT, YYACCEPT, YYERROR): New.
+ * tests/calc.at: Renable the lalr1.cc test.
+
+2003-02-19 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
+ error recovery, mixing with/without pops and discarding of the
+ lookahead.
+ Exercise YYERROR.
+ Disable the lalr1.cc tests as currently it doesn't support YYERROR.
+
+2003-02-17 Paul Eggert <eggert@twinsun.com>
+
+ * tests/atlocal.in (LDFLAGS, LIBS): New vars.
+ * tests/testsuite.at (AT_COMPILE): Use them.
+ This fixes the testsuite problem reported by Robert Lentz in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
+
+2003-02-12 Paul Eggert <eggert@twinsun.com>
+
+ * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
+ Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
+ * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
+ Check for malloc failure, for consistency with yacc.c.
+ (yytname_size): Remove, for consistency with yacc.c.
+
+ The bug still remains in data/lalr1.cc, as I didn't have time
+ to fix it there.
+
+2003-02-06 Akim Demaille <akim@epita.fr>
+
+ * configure.ac (GXX): Rename as...
+ (CXX): this, to keep the original Autoconf semantics.
+ Require 2.57.
+ * data/lalr1.cc: Fix b4_copyright invocations.
+ If YYDEBUG is not defined, don't depend upon name_ being defined.
+ (location.hh): Include string and iostream.
+ (Position::filename): New member.
+ (Position::Position ()): New.
+ (operator<< (Position)): New.
+ (operator- (Position, int)): New.
+ (Location::first, Location::last): Rename as...
+ (Location::begin, Location::end): these, to mock the conventional
+ iterator names.
+ (operator<< (Location)): New.
+ * tests/atlocal.in (CXX): New.
+ * tests/testsuite.at (AT_COMPILE_CXX): New.
+ * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
+ locations in a more synthetic way.
+ (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
+ lalr1.cc is used.
+ Adjust the C locations to match those from Emacs: first column is
+ column 0.
+ Change all the expected results.
+ Conform to the GCS: simplify the locations when applicable.
+ (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
+ (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
+ these CPP macros with the m4 macros new defined by...
+ (AT_CHECK_PUSHDEFS): this, i.e.:
+ (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
+ (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
+ New macros.
+ (AT_CHECK_POPDEFS): Undefine them.
+ (AT_CHECK_CALC_LALR1_CC): New.
+ Use it for the first lalr1.cc test.
+
+2003-02-04 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
+ Location as is defined.
+
+2003-02-04 Akim Demaille <akim@epita.fr>
+
+ * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
+ name_ being defined.
+
+2003-02-03 Paul Eggert <eggert@twinsun.com>
+
+ * src/gram.h (start_symbol): Remove unused decl.
+
+ Use more-consistent naming conventions for local vars.
+
+ * src/derives.c (derives_compute): Change type of local var from
+ int to rule_number.
+ * src/gram.c (grammar_rules_partial_print): Likewise.
+ * src/print.c (print_core): Likewise.
+ * src/reduce.c (reduce_grammar_tables): Likewise.
+
+ * src/gram.c (grammar_dump): Change name of item_number *
+ local var from r to rp.
+ * src/nullable.c (nullable_compute): Likewise.
+
+ * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
+
+ * src/gram.h (symbol_number_as_item_number): Use sym, not s,
+ for symbol or symbol_number var.
+ * src/reader.c (grammar_start_symbol_set): Likewise.
+ * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
+ Likewise.
+ * src/state.c (transitions_to): Likewise.
+ * src/state.h: Likewise.
+ * src/tables.c (symbol_number_to_vector_number): Likewise.
+
+ * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
+ char * var.
+
+ * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
+ var.
+
+ * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
+ var.
+
+ * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
+ Use str, not s, for char * var. Use ch, not c, for character var.
+ Use size for size var.
+
+ * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
+ char * var.
+ (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
+ uniqstr var.
+ * src/uniqstr.h: Likewise.
+
+ * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
+ get_layoutalgorithm_str, get_decision_str, get_orientation_str,
+ get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
+ get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
+ param to have same name as that of enum, so that we don't use
+ "s" to stand for a non-state.
+
+2003-02-02 Akim Demaille <akim@epita.fr>
+
+ * src/scan-skel.l: Scan more than one inert character per yylex
+ invocation.
+
+2003-02-01 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.875a.
+
+ * po/LINGUAS: Add ms.
+
+2003-01-30 Akim Demaille <akim@epita.fr>
+
+ * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
+
+2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
+ of $1.
+
+ Changes in response to error report by S. Eken: GLR mode does not
+ handle negative $ indices or $ indices in embedded rules correctly.
+ See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
+
+ * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
+ (b4_rhs_location): Ditto.
+ (yyfill): New function to copy from stack tree into array
+ incrementally.
+ (yyuserAction): Modify to allow incremental move of semantic values
+ to rhs array when in GLR mode.
+ Define YYFILL to use in user-defined actions to fill semantic array
+ as needed.
+ Remove dummy use of yystack, as there is now a guaranteed use.
+ (yydoAction): Modify to allow incremental move of semantic values
+ to rhs array when in GLR mode.
+ (yyresolveAction): Ditto.
+ (yyglrShiftDefer): Update comment.
+ (yyresolveStates): Use X == NULL for pointers, not !X.
+ (yyglrReduce): Ditto.
+ (yydoAction): Ditto
+
+ * tests/glr-regr1.at: Rename to ...
+ * tests/glr-regression.at: Add new regression test for the problems
+ described above (adapted from S. Eken).
+ Update copyright notice.
+ * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
+ * tests/Makefile.am: Ditto.
+
+2003-01-28 Paul Eggert <eggert@twinsun.com>
+
+ * data/lalr1.cc: Do not use @output_header_name@ unless
+ b4_defines_flag is set. This fixes two bugs reported by
+ Tim Van Holder in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
+ and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
+
+2003-01-21 Paul Eggert <eggert@twinsun.com>
+
+ * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
+ we don't need to worry about yyerrlab1 being reported as an
+ "unused label" by non-GCC C compilers. The downside is that if
+ locations are used then a couple of statements are duplicated each
+ time YYERROR is invoked, but the upside is that the warnings
+ should vanish.
+ (yyerrlab1): Move code to YERROR.
+ (yyerrlab2): Remove. Change uses back to yyerrlab1.
+ This reverts some of the 2002-12-27 change.
+
+2003-01-17 Paul Eggert <eggert@twinsun.com>
+
+ * src/output.c (symbol_printers_output): Fix typo that led
+ to core dump. Problem reported by Antonio Rus in
+ <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
+
+2003-01-13 Akim Demaille <akim@epita.fr>,
+ Quoc Peyrot <chojin@lrde.epita.fr>,
+ Robert Anisko <anisko_r@lrde.epita.fr>
+
+ * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
+ when the stacks contain one element, as the loop would otherwise
+ free the last state, and then use the top state (the one we just
+ popped). This means that the initial elements will not be freed
+ explicitly, as is the case in yacc.c; it is not a problem, as
+ these elements have fake values.
+
+2003-01-11 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS: %expect-violations are now just warnings, reverting
+ to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
+ bootstrapping problem reported by Matthias Klose; see
+ <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
+ * src/conflicts.c (conflicts_print): Likewise.
+ * tests/conflicts.at (%expect not enough, %expect too much,
+ %expect with reduce conflicts): Likewise.
+ * doc/bison.texinfo (Expect Decl): Document this. Also mention
+ that the warning is enabled if the number of conflicts changes
+ (not necessarily increases).
+
+ * src/getargs.c (version): Update copyright year.
+
+2003-01-09 Akim Demaille <akim@epita.fr>
+
+ * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
+
+2003-01-08 Paul Eggert <eggert@twinsun.com>
+
+ * Makefile.maint (WGETFLAGS):
+ New macro, containing "-C off" to disable proxy caches.
+ All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
+ (rel-check): Use $(WGET) instead of wget.
+
+2003-01-06 Paul Eggert <eggert@twinsun.com>
+
+ * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
+ the GLR paper of Scott, Johnstone and Hussain.
+
+2003-01-04 Paul Eggert <eggert@twinsun.com>
+
+ * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
+ (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
+ * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
+ (EXTRA_LIBRARIES): New var, for liby.a.
+ * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
+ (EXTRA_SCRIPTS): New var, for yacc.
+
+ * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
+ since GNU C++ (as of 3.2.1) does not allow attributes on labels.
+ Problem reported by Nelson H. F. Beebe.
+
+2003-01-03 Paul Eggert <eggert@twinsun.com>
+
+ * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
+ (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
+ when compiling Bison 1.875's `bitset bset = obstack_alloc
+ (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
+
+ * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
+ ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
+ grow to a huge size with typical invocation.
+
+ * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
+ Use the pattern recommended by Autoconf 2.57, except also protect
+ against double-definition.
+ * src/system.h: Likewise.
+ Portability issues reported by Nelson H. F. Beebe.
+
+ * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
+ All uses changed. Provide a definition in both C and C++.
+ (yytrue, yyfalse): Define even if defined (__cplusplus).
+
+ * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
+ Reported by Nelson H. F. Beebe.
+
+ * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
+
+2003-01-02 Paul Eggert <eggert@twinsun.com>
+
+ * data/yacc.c (yyerrlab1): Append `;' after attribute, to
+ pacify the buggy "smart preprocessor" in MacOS 10.2.3.
+ Bug reported by Nelson H. F. Beebe.
+
+2003-01-01 Paul Eggert <eggert@twinsun.com>
+
+ * Version 1.875.
+
+2002-12-30 Paul Eggert <eggert@twinsun.com>
+
+ * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
+ Moved here from...
+ (<INITIAL>","): Here. This causes stray "," to be treated
+ more uniformly.
+
+ * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
+ last brace in braced code when not in Yacc mode, for compatibility
+ with Bison 1.35. This resurrects the 2001-12-15 patch to
+ src/reader.c.
+
+ * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
+ yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
+
+2002-12-28 Paul Eggert <eggert@twinsun.com>
+
+ * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
+ that of SYM's type. This fixes Debian bug 168069, reported by
+ Thomas Olsson.
+
+2002-12-28 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.75f.
+
+ Switch back to the Yacc style of conflict reports, undoing some
+ of the 2002-07-30 change.
+ * doc/bison.texinfo (Understanding): Use Yacc style for
+ conflict reports. Also, use new way of locating rules.
+ * src/conflicts.c (conflict_report):
+ Renamed from conflict_report_yacc, removing the old
+ 'conflict_report'. Translate the entire conflict report at once,
+ so that we don't assume that "," has the same interpretation in
+ all languages.
+ (conflicts_output): Use Yacc-style conflict report for each state,
+ instead of our more-complicated style.
+ (conflicts_print): Use Yacc-style conflict report, except print
+ the input file name when not emulating Yacc.
+ * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
+ Conflicted Reduction, %expect not enough, %expect too much,
+ %expect with reduce conflicts): Switch to Yacc-style conflict reports.
+ * tests/existing.at (GNU Cim Grammar): Likewise.
+ * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
+
+ * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
+ fatal): Don't invoke fflush; it's not needed and it might even be
+ harmful for stdout, as stdout might not be open.
+ * src/reduce.c (reduce_print): Likewise.
+
+2002-12-27 Paul Eggert <eggert@twinsun.com>
+
+ Fix a bug where error locations were not being recorded correctly.
+ This problem was originally reported by Paul Hilfinger in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
+
+ * data/yacc.c (yyparse): New local var yylerrsp, to record the
+ top of the location stack's error locations.
+ (yyerrlab): Set it. When discarding a token, push its location
+ onto yylerrsp so that we don't lose track of the error's end.
+ (yyerrlab1): Now is only the target of YYERROR, so that we can
+ properly record the location of the action that failed. For GCC
+ 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
+ GCC warning about yyerrlab1 being unused if YYERROR is unused.
+ (yyerrlab2): New label, which yyerrlab now falls through to.
+ Compute the error's location by applying YYLLOC_DEFAULT to
+ the locations of all the symbols that went into the error.
+ * doc/bison.texinfo (Location Default Action): Mention that
+ YYLLOC_DEFAULT is also invoked for syntax errors.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
+ Error locations include the locations of all the tokens that were
+ discarded, not just the last token.
+
+2002-12-26 Paul Eggert <eggert@twinsun.com>
+
+ * src/files.c: Include quote.h.
+ (compute_output_file_names): Warn if we detect conflicting
+ outputs to the same file. This should catch the misunderstanding
+ exemplified by Debian Bug 165349, reported by Bruce Stephens..
+
+ * src/conflicts.c (conflicts_print): If the user specifies
+ "%expect N", report an error if there are any reduce/reduce
+ conflicts. This is what the manual says should happen.
+ This fixes Debian bug 130890, reported by Anthony DeRobertis.
+ * tests/conflicts.at (%expect with reduce conflicts): New test.
+
+ Don't use m4_include on relative file names, as it doesn't work as
+ desired if there happens to be a file with that name under ".".
+
+ * m4sugar/version.m4: Remove; it was included but it wasn't used.
+ * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
+ * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
+ * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
+ * src/output.c (output_skeleton): Use full path names when
+ specifying a file to include; don't rely on include path, as
+ it's unreliable when the working file contains a file with
+ that name.
+
+2002-12-25 Paul Eggert <eggert@twinsun.com>
+
+ Remove obsolete references to bison.simple and bison.hairy.
+ Problem mentioned by Aubin Mahe in
+ <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
+ * data/glr.c: Comment fix.
+ * doc/bison.1: Remove references. Also, mention "yacc".
+
+ * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
+ with -g option.
+
+ * src/parse-gram.y (declaration): Use enum "report_states" rather
+ than its numeric value 1.
+
+ * src/scan-skel.l ("@output ".*\n): Close any old yyout before
+ opening a new one. This fixes Debian bug 165349, reported by
+ Bruce Stephens.
+
+2002-12-24 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.75e.
+
+ * Makefile.maint (cvs-update): Don't assume that the shell
+ supports $(...), as Solaris sh doesn't.
+
+ * src/parse-gram.y (lloc_default): Remove test for empty
+ nonterminals at the end, since it didn't change the result.
+
+2002-12-24 Paul Eggert <eggert@twinsun.com>
+
+ If the user does not define YYSTYPE as a macro, Bison now declares it
+ using typedef instead of defining it as a macro. POSIX requires this.
+ For consistency, YYLTYPE is also declared instead of defined.
+
+ %union directives can now have a tag before the `{', e.g., the
+ directive `%union foo {...}' now generates the C code
+ `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
+ The default union tag is `YYSTYPE', for compatibility with Solaris 9
+ Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
+ instead of `yyltype'.
+
+ `yystype' and `yyltype' are now obsolescent macros instead of being
+ typedefs or tags; they are no longer documented and will be
+ withdrawn in a future release.
+
+ * data/glr.c (b4_location_type): Remove.
+ (YYSTYPE): Renamed from yystype.
+ (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
+ (struct YYLTYPE): Renamed from struct yyltype.
+ (YYLTYPE): Renamed from yyltype.
+ (yyltype, yystype): New (and obsolescent) macros,
+ for backward compatibility.
+ * data/yacc.c: Likewise.
+
+ * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
+ does not specify a union tag. This is for compatibility with
+ Solaris 9 yacc.
+
+ * src/parse-gram.y (add_param): 2nd arg is now char * not char
+ const *, since it is now modified by stripping surrounding { }.
+ (current_braced_code): Remove.
+ (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
+ PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
+ trailing " {...}". Now of type <chars>.
+ (grammar_declaration): Adjust to bundled tokens.
+ (code_content): Remove; stripping is now done by add_param.
+ (print_token_value): Print contents of bundled tokens.
+ (token_name): New function.
+
+ * src/reader.h (braced_code, current_braced_code): Remove.
+ (token_name): New decl.
+
+ * src/scan-gram.l (handle_dollar, handle_at): Now takes int
+ token_type, not braced_code code_kind. All uses changed.
+ (SC_PRE_CODE): New state, for scanning after a keyword that
+ has (or usually has) an immediately-following braced code.
+ (token_type): New local var, to keep track of which token type
+ to return when scanning braced code.
+ (<INITIAL>"%destructor", <INITIAL>"%lex-param",
+ <INITIAL>"%parse-param", <INITIAL>"%printer",
+ <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
+ instead of returning a token type immediately.
+ (<INITIAL>"{"): Set token type.
+ (<SC_BRACED_CODE>"}"): Use it.
+ (handle_action_dollar, handle_action_at): Now returns bool
+ indicating success. Fail if ! current_rule; this prevents a core dump.
+ (handle_symbol_code_dollar, handle_symbol_code_at):
+ Remove; merge body into caller.
+ (handle_dollar, handle_at): Complain in invalid contexts.
+
+ * NEWS, doc/bison.texinfo: Document the above.
+ * NEWS: Fix years and program names in copyright notice.
+
+2002-12-17 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
+ Reporting, Table of Symbols): Omit mentions of %lex-param and
+ %parse-param from the documentation for now.
+
+2002-12-15 Paul Eggert <eggert@twinsun.com>
+
+ Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
+ GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
+ lookahead symbol, and which sets yychar in parser actions) and it
+ disagreed with the Bison documentation. Bug
+ reported by Andrew Walrond.
+
+ * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
+ as the caller now does that.
+ (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
+ (YYEMPTY): Parenthesize right hand side, since others use it.
+ (yyparse): Don't assume that our generated code is the only code
+ that sets yychar.
+
+2002-12-13 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.75d.
+
+ POSIX requires a "yacc" command.
+ * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
+ (MOSTLYCLEANFILES): Add yacc.
+ (yacc): New rule.
+ * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
+ as an alias for bison y.
+
+ * po/LINGUAS: Add da.
+
+ * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
+ problem with latest <getopt.h>.
+ (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
+
+ * doc/fdl.texi: Upgrade to 1.2.
+ * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
+ lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
+ lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
+ gnulib.
+ * config/install-sh: Sync with autotools.
+
+ Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
+ * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
+ locations are requested.
+ (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
+ locations are requested.
+
+2002-12-12 Paul Eggert <eggert@twinsun.com>
+
+ Remove unportable casts and storage allocation tricks.
+ While we're at it, remove almost all casts, since they
+ usually aren't needed and are a sign of trouble.
+
+ * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
+
+ * src/derives.c (derives_compute): Do not subtract NTOKENS from
+ the pointer DSET returned by malloc; this isn't portable.
+ Instead, always use DSET[i - NTOKENS] rather than DSET[i].
+ Similarly for DERIVES.
+ * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
+ * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
+ * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
+
+ * src/derives.c (derives_compute): Do not bother invoking
+ int_of_rule_number, since rule numbers are integers.
+
+ * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
+ rather than XMALLOC (char, N).
+
+ * src/files.c (filename_split): Rewrite to avoid cast.
+
+ * src/gram.h (symbol_number_as_item_number,
+ item_number_as_symbol_number, rule_number_as_item_number,
+ item_number_as_rule_number):
+ Now inline functions rather than macros, to avoid casts.
+ * src/state.h (state_number_as_int): Likewise.
+ * src/tables.c (state_number_to_vector_number,
+ symbol_number_to_vector_number): Likewise.
+
+ * src/gram.h (int_of_rule_number): Remove; no longer used.
+
+ * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
+ since the resulting storage is always stored into.
+
+ * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
+ where it's needed.
+
+ * src/muscle_tab.c (muscle_m4_output):
+ Now inline. Return bool, not int.
+ * src/state.c (state_compare): Likewise.
+ * src/symtab.c (symbol_check_defined,
+ symbol_check_alias_consistency, symbol_pack, symbol_translation,
+ hash_compare_symbol, hash_symbol):
+ Likewise.
+ * src/uniqstr.c (uniqstr_print): Likewise.
+ * src/muscle_tab.c (muscle_m4_output_processor):
+ New function, to avoid casts.
+ * src/state.c (state_comparator, stage_hasher): Likewise.
+ * src/symtab.c (symbol_check_defined_processor,
+ symbol_check_alias_consistency_processor, symbol_pack_processor,
+ symbol_translation_processor, hash_symbol_comparator,
+ hash_symbol_hasher): Likewise.
+ * src/uniqstr.c (uniqstr_print_processor): Likewise.
+ * src/muscle_tab.c (muscles_m4_output):
+ Use new functions instead of casting old functions unportably.
+ * src/state.c (state_hash_new): Likewise.
+ * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
+ symbols_token_translations_init):
+ Likewise.
+ * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
+
+ * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
+ var instead of casting to long, to avoid casts.
+ (prepare_states): Use MALLOC rather than alloca, so that we don't
+ have to worry about alloca.
+ * src/state.c (state_hash_lookup): Likewise.
+
+ * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
+ local var instead of casting to unsigned char, to avoid casts.
+
+ * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
+ STATE_ALLOC): Remove.
+ (transitions_new, errs_new, reductions_new, state_new): Use malloc
+ rather than calloc, and use offsetof to avoid allocating slightly
+ too much storage.
+ (state_new): Initialize all members.
+
+ * src/state.c (state_hash): Use unsigned accumulator, not signed.
+
+ * src/symtab.c (symbol_free): Remove; unused.
+ (symbol_get): Remove cast in lhs of assignment.
+ (symbols_do): Now static. Accept generic arguments, not
+ hashing-related ones.
+
+ * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
+ (symbol_processor): Remove.
+ (symbols_do): Remove decl; now static.
+
+ * src/system.h (alloca): Remove; decl no longer needed.
+ (<stddef.h>): Include, for offsetof.
+ (<inttypes.>, <stdint.h>): Include if available.
+ (uintptr_t): New type, if system lacks it.
+ (CALLOC, MALLOC, REALLOC): New macros.
+ All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
+ new macros.
+
+ * src/tables.c (table_size): Now int, to pacify GCC.
+ (table_grow, table_ninf_remap): Use signed table size.
+ (save_row): Don't bother initializing locals when not needed.
+ (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
+ * src/uniqstr.c (hash_compare_uniqstr): Likewise.
+
+ * src/vcg.h: Correct misspellings.
+
+ * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
+
+
+ * src/getargs.c (getargs): Don't assume EOF == -1.
+
+2002-12-09 Paul Eggert <eggert@twinsun.com>
+
+ Change identifier spellings to avoid collisions with names
+ that are reserved by POSIX.
+
+ Don't use names ending in _t, since POSIX reserves them.
+ For consistency, remove _e and _s endings -- they're weren't
+ needed to remove ambiguity. All uses changed.
+ * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
+ turn was just renamed from struniq_t.
+ * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
+ which in turn was just renamed from struniq_processor_t.
+ (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
+ in turn was renamed from hash_compare_struniq_t.
+ * src/LR0.c (struct state_list): Renamed from struct state_list_s.
+ (state_list): Renamed from state_list_t.
+ * src/assoc.h (assoc): Renamed from assoc_t.
+ * src/conflicts.c (enum conflict_resolution): Renamed from
+ enum conflict_resolution_e.
+ * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
+ (rule_list): Renamed from rule_list_t.
+ * src/getargs.h (enum trace): Renamed from enum trace_e.
+ (enum report): Renamed from enum report_e.
+ * src/gram.h (item_number): Renamed from item_number_t.
+ (rule_number): Renamed from rule_number_t.
+ (struct rule_s): Remove the "rule_s" part; not used.
+ (rule): Renamed from rule_t.
+ (rule_filter): Renamed from rule_filter_t.
+ * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
+ (goto_list): Renamed from goto_list_t.
+ * src/lalr.h (goto_number): Renamed from goto_number_t.
+ * src/location.h (location): Renamed from location_t.
+ * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
+ and moved here from:
+ * src/muscle_tab.h (muscle_entry_t): here.
+ * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
+ (rule_list): Renamed from rule_list_t.
+ * src/print_graph.c (static_graph): Renamed from graph.
+ * src/reader.h (braced_code): Renamed from braced_code_t.
+ Remove brace_code_e tag.
+ * src/relation.h (relation_node): Renamed from relation_node_t.
+ (relation_nodes): Renamed from relation_nodes_t.
+ (relation): Renamed from relation_t.
+ * src/state.h (state_number): Renamed from state_number_t.
+ (struct state): Renamed from struct state_s.
+ (state): Renamed from state_t.
+ (transitions): Renamed from transitions_t. Unused (and
+ misspelled) transtion_s tag removed.
+ (errs): Renamed from errs_t. Unused errs_s tag removed.
+ (reductions): Renamed from reductions_t. Unused tag
+ reductions_s removed.
+ * src/symlist.h (symbol_list): Renamed from symbol_list_t.
+ (struct symbol_list): Renamed from struct symbol_list_s.
+ * src/symtab.h (symbol_number): Renamed from symbol_number_t.
+ (struct symbol): Renamed from struct symbol_s.
+ (symbol): Renamed from symbol_t.
+ * src/tables.c (vector_number): Renamed from vector_number_t.
+ (action_number): Renamed from action_t.
+ * src/tables.h (base_number): Renamed from base_t.
+ * src/vcg.h (enum color): Renamed from enum color_e.
+ (enum textmode): Renamed from enum textmode_e.
+ (enum shape): Renamed from enum shape_e.
+ (struct colorentry): Renamed from struct colorentry_s.
+ (struct classname): Renamed from struct classname_s.
+ (struct infoname): Renamed from struct infoname_s.
+ (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
+ (enum decision): Renamed from enum decision_e.
+ (enum orientation): Renamed from enum orientation_e.
+ (enum alignment): Renamed from enum alignment_e.
+ (enum arrow_mode): Renamed from enum arrow_mode_e.
+ (enum crossing_type): Renamed from enum crossing_type_e.
+ (enum view): Renamed from enum view_e.
+ (struct node): Renamed from struct node_s.
+ (node): Renamed from node_t.
+ (enum linestyle): Renamed from enum linestyle_e.
+ (enum arrowstyle): Renamed from enum arrowstyle_e.
+ (struct edge): Renamed from struct edge.
+ (edge): Renamed from edge_t.
+ (struct graph): Renamed from struct graph_s.
+ (graph): Renamed from graph_t.
+ * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
+ Rename value_t -> value.
+ * tests/input.at (Torturing the Scanner): Rename value_t -> value,
+ value_t_as_yystype -> value_as_yystype.
+
+ Don't include <errno.h> in the mainstream code, since it
+ reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
+ * lib/get-errno.c, lib/get-errno.h: New files.
+ * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
+ get-errno.c.
+ * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
+ * src/output.c (output_skeleton): Likewise.
+ * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
+ instead of errno.
+ (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
+ Likewise.
+ (handle_action_dollar, handle_action_at): Likewise.
+ * src/system.h: Do not include <errno.h>.
+ (TAB_EXT): Renamed from EXT_TAB.
+ (OUTPUT_EXT): Renamed from EXT_OUTPUT.
+
+ Avoid str[a-z]*, since <string.h> reserves that name space.
+ Change all instances of "struniq" in names to "uniqstr", and
+ likewise for "STRUNIQ" and "UNIQSTR".
+ * src/uniqstr.c: Renamed from src/struniq.c.
+ * src/uniqstr.h: Renamed from src/struniq.h.
+ * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
+ * src/files.c (strsuffix): Remove; unused.
+ (concat2): Renamed from stringappend. Now static.
+ * src/files.h (strsuffix, stringappend): Remove; unused.
+ * src/parse-gram.y (<chars>): Renamed from <string>.
+ (<uniqstr>): Renamed from <struniq>.
+ * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
+ * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
+ (struct graph_s.expand): Renamed from struct graph_s.stretch.
+ * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
+ (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
+ (N_EXPAND): Renamed from N_STRETCH.
+
+ Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
+ * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
+ * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
+ Remove; unused.
+ * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
+ * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
+ * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
+ * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
+ (BASE_MAXIMUM): Renamed from BASE_MAX.
+ (BASE_MINIMUM): Renamed from BASE_MIN.
+ (ACTION_MAX): Remove; unused.
+ (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
+ Unnecessary casts removed from above defines.
+
+
+ Fix misspelling in names.
+ * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
+ * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
+ G_NODE_ALIGNEMENT.
+
+
+ * lib/timevar.c (timevar_report): Renamed from time_report,
+ for consistency with other names.
+ * lib/timevar.h (timevar_report): New decl.
+ * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
+
+
+ Sort include-file uses.
+
+ Reorder all include files under src to be in the order "system.h".
+ then the ../lib include files in angle brackets (alphabetized),
+ then the . include files in double-quotes (alphabetized). Fix
+ dependency breakages encountered in this process, as follows:
+ * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
+ * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
+ * src/state.h: Include "symtab.h".
+
+2002-12-08 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
+ since this causes problems when __file__ contains character
+ sequences like "@" that are treated specially by src/scan-skel.l.
+ Instead, just use the file's basename. This fixes the bug
+ reported by Martin Mokrejs in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
+
+2002-12-06 Paul Eggert <eggert@twinsun.com>
+
+ Add support for rules that do not have trailing semicolons, as
+ POSIX requires. Improve the quality of locations in Bison
+ diagnostics.
+
+ * src/location.c: Include <quotearg.h>.
+ (empty_location): Now const.
+ (location_print): New function. Follow the recommendation of the
+ GNU Coding Standards for locations that span file boundaries.
+ * src/location.h: Do not include <quotearg.h>; no longer needed.
+ (boundary): New type.
+ (location_t): Use it. This allows locations to span file boundaries.
+ All member uses changed: file -> start.file or end.file (as needed),
+ first_line -> start.line, first_column -> start.column,
+ last_line -> end.line, last_column -> end.column.
+ (equal_boundaries): New function.
+ (LOCATION_RESET, LOCATION_STEP): Remove.
+ (LOCATION_PRINT): Remove. All callers changed to use location_print.
+ (empty_location): Now const.
+ (location_print): New decl.
+ * src/parse-gram.y (lloc_default): New function, which handles
+ empty locations more accurately.
+ (YYLLOC_DEFAULT): Use it.
+ (%token COLON): Remove.
+ (%token ID_COLON): New token.
+ (rules): Use it.
+ (declarations, rules): Remove trailing semicolon.
+ (declaration, rules_or_grammar_declaration):
+ Allow empty (";") declaration.
+ (symbol_def): Remove empty actions; no longer needed.
+ (rules_or_grammar_declaration): Remove trailing semicolon.
+ (semi_colon.opt): Remove.
+ * src/reader.h: Include location.h.
+ (scanner_cursor): New decl.
+ * src/reduce.c (nonterminals_reduce): Use warn_at rather than
+ rolling our own.
+ * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
+ of *loc.
+ (STEP): Remove. No longer needed, now that adjust_location does
+ the work. All uses removed.
+ (scanner_cursor): New var.
+ (adjust_location): Renamed from extend_location. It now sets
+ *loc and adjusts the scanner cursor. All uses changed.
+ Don't bother testing for CR.
+ (handle_syncline): Remove location arg; now updates scanner cursor.
+ All callers changed.
+ (unexpected_end_of_file): Now accepts start boundary of token or
+ comment, not location. All callers changed. Update scanner cursor,
+ not the location.
+ (SC_AFTER_IDENTIFIER): New state.
+ (context_state): Renamed from c_context. All uses changed.
+ (id_loc, code_start, token_start): New local vars.
+ (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
+ processing of Yacc white space and equivalents here.
+ (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
+ instead of returning ID immediately, since we need to search for
+ a subsequent colon.
+ (<INITIAL>"'", "\""): Save token_start.
+ (<INITIAL>"%{", "{", "%%"): Save code_start.
+ (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
+ (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
+ BEGIN context_state at end, not INITIAL.
+ (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
+ <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
+ Return correct token start.
+ (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
+ the start of a character, string or multiline comment is found.
+ * tests/conflicts.at (S/R in initial, Defaulted Conflicted
+ Reduction): Adjust reported locations to match the more-precise
+ results now expected.
+ * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
+ * tests/reduce.at (Useless Rules, Reduced Automaton,
+ Underivable Rules): Likewise.
+ * tests/regression.at (Invalid inputs): No longer `expecting ";"
+ or "|"' now that so many other tokens are allowed by the new grammar.
+
+ * src/complain.h (current_file): Remove duplicate decl;
+ current_file is now owned by files.h.
+ * src/complain.c, src/scan-gram.l: Include files.h.
+
+2002-12-06 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
+ promotes to int; it might be unsigned int.
+ * data/yacc.c (yy_reduce_print): Likewise.
+
+ * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
+ be #defined in the prologue, not in the Bison declarations.
+ This fixes Debian Bug 102878, reported by Shaul Karl.
+
+2002-12-02 Paul Eggert <eggert@twinsun.com>
+
+ * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
+ * lib/strtoul.c: New file, from gnulib.
+ This fixes a porting bug reported by Peter Klein in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
+
+2002-11-30 Paul Eggert <eggert@twinsun.com>
+
+ * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
+ and put only a forward declaration in the prologue. This is for
+ consistency with the other scanner helper functions.
+
+ Type clashes now generate warnings, not errors, since it
+ appears that POSIX may allow some grammars with type clashes.
+ * src/reader.c (grammar_current_rule_check): Warn about
+ type clashes instead of complaining.
+ * tests/input.at (Type Clashes): Expect warnings, not complaints.
+
+ Add Yacc library, since POSIX requires it.
+ * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
+ * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
+ * lib/main.c, lib/yyerror.c: New files.
+
+ gram_error can be static; it need not be extern.
+ * src/reader.h (gram_error): Remove decl.
+ * src/parse-gram.y (gram_error): Now static. Add static decl.
+ (print_token_value): Omit parameter names from forward decl,
+ for consistency.
+
+2002-11-29 Paul Eggert <eggert@twinsun.com>
+
+ * doc/bison.texinfo: Emphasize that yylex and yyerror must
+ be declared before being used. E.g., one should typically
+ declare them in the prologue. Use GNU coding style in examples.
+ Put "const" consistently after the type it modifies. Mention
+ that C99 supports "inline". Mention that yyerror traditionally
+ returns "int".
+
+ %parse-param and %lex-param now take just one argument, the
+ declaration; the argument name is deduced from the declaration.
+
+ * doc/bison.texinfo (Parser Function, Pure Calling, Error
+ Reporting, Table of Symbols): Document this.
+ * src/parse-gram.y (add_param): New function.
+ (COMMA): Remove.
+ (declaration): Implement new rule for %parse-param and %lex-param.
+ * src/scan-gram.l: "," now elicits a warning, rather than being
+ a token; this is more compatible with byacc.
+ * tests/calc.at (Simple LALR Calculator): Adopt new convention.
+
+2002-11-27 Paul Eggert <eggert@twinsun.com>
+
+ Rename identifiers to avoid real and potential collisions.
+
+ * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
+ to avoid collision with lex macro described by Bruce Lilly in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
+ * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
+ * src/parse-gram.y (print_token_value): Renamed from yyprint.
+ All uses changed.
+ (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
+ The name "yycontrol" violates the name space rules, and this stuff
+ wasn't being used anyway.
+ (input): Remove action; this stuff wasn't being used.
+ (gram_error): Rename local variable yylloc -> loc.
+ * src/reader.h (struct gram_control_s, gram_control_t): Remove.
+ (YY_DECL): Don't use "yy" at start of local variables.
+ All uses changed, e.g., yylloc -> loc.
+ * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
+ (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
+ (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
+ (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
+
+ * src/parse-gram.y (gram_error): loc is now const *.
+ * src/reader.h (gram_error): Likewise.
+
+2002-11-24 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.75c.
+
+ * tests/actions.at (Actions after errors): Use an output format
+ more similar to that of the Printers and Destructors test.
+ Test the position of the ';' token too.
+ (Printers and Destructors): Likewise.
+ (Printers and Destructors: %glr-parser): Remove for now, to avoid
+ unnecessarily alarming people when the test fails.
+
+ * data/yacc.c (yyerrlab1): Move this label down, so that the
+ parser does not discard the lookahead token if the user code
+ invokes YYERROR. This change is required for POSIX conformance.
+
+ * lib/error.c: Sync with gnulib.
+
+2002-11-22 Paul Eggert <eggert@twinsun.com>
+
+ * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
+ * lib/mbswidth.c, lib/mbswidth.h: Likewise.
+ * lib/xmalloc.c: Likewise.
+
+2002-11-20 Paul Eggert <eggert@twinsun.com>
+
+ * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
+
+2002-11-20 Paul Eggert <eggert@twinsun.com>
+
+ Avoid use of <assert.h>, as the GNU Coding Standards hint that one
+ should use `if (! x) abort ();' rather than `assert (x);', and
+ anyway it's one less thing to worry about configuring.
+
+ * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
+ and replace all instances of assert with abort.
+ * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
+ * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
+
+ * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
+ yyresolveAction, yyprocessOneStack): Use abort rather than assert.
+ * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
+ hash_find_entry, hash_rehash, hash_insert): Likewise.
+ * src/conflicts.c (resolve_sr_conflict): Likewise.
+ * src/lalr.c (set_goto_map, map_goto): Likewise.
+ * src/nullable.c (nullable_compute): Likewise.
+ * src/output.c (prepare_rules, token_definitions_output): Likewise.
+ * src/reader.c (packgram, reader): Likewise.
+ * src/state.c (state_new, state_free, state_transitions_set,
+ state_reduction_find): Likewise.
+ * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
+ symbol_pack): Likewise.
+ * src/tables.c (conflict_row, pack_vector): Likewise.
+ * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
+ get_layoutalgorithm_str, get_decision_str, get_orientation_str,
+ get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
+ get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
+
+ * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
+ (ARGMATCH_CONSTRAINT): New macro.
+ (ARGMATCH_ASSERT): Use it.
+
+ * src/system.h (verify): New macro.
+ * src/getargs.c (trace_argmatch, report_argmatch): Use verify
+ rather than assert.
+ * src/tables.c (tables_generate): Likewise.
+
+ * src/struniq.c (struniq_assert): Now returns void, and aborts
+ if the assertion is false.
+ (struniq_assert_p): Remove.
+ * src/struniq.h: Likewise.
+
+2002-11-18 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (yygetLRActions): Replace `yyindex' with
+ `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
+ This fixes the regression with Sun ONE Studio 7 cc that I reported in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
+
+2002-11-18 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
+ space.
+ From Tim Van Holder.
+
+2002-11-17 Paul Eggert <eggert@twinsun.com>
+
+ Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
+ to "SyntaxError" for consistency with my 2002-11-15 change.
+
+ * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
+ not define to {}, since this breaks the common use of `YYDPRINTF
+ ((...));' if a single statement is desired (e.g. before `else').
+ Work around GCC warnings by surrounding corresponding calls with
+ {} if needed.
+ (yyhasResolvedValue): Remove unused function.
+ (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
+ loop body.
+ (yyreportSyntaxError): Renamed from yyreportParseError.
+ (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
+ All uses changed.
+ * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
+ extern when possible. Remove unused initializations.
+
+2002-11-16 Akim Demaille <akim@epita.fr>
+
+ Augment the similarity between GLR and LALR traces.
+
+ * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
+ (YY_REDUCE_PRINT): New.
+ (yyparse): Use them.
+ * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
+ YYDPRINT here.
+ (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
+ state reached after the reduction/recovery, since...
+ (yyparse, yyprocessOneStack): Report the state we are entering in.
+
+2002-11-16 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
+ Add support for --trace=skeleton.
+ * src/scan-skel.l: %option debug.
+ Scan strings of non-@ or \n instead of character by character.
+ (scan_skel): Handle trace_skeleton.
+ (QPUTS): New.
+ (@output_parser_name@, @output_header_name@): ``Restore'' their
+ support (used to be M4 macros).
+ * data/yacc.c: Quote larger chunks, a la glr.c.
+ * data/lalr1.cc: Likewise.
+ The header guards are no longer available, so use some other
+ string than `YYLSP_NEEDED'.
+
+2002-11-16 Akim Demaille <akim@epita.fr>
+
+ Make the ``Printers and Destructors'' test more verbose, taking
+ `yacc.c''s behavior as (possibly wrong) reference.
+
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
+ instead of fprint on stdout.
+ Set and report the last_line of the symbols.
+ Consistently display values and locations.
+
+2002-11-16 Paul Eggert <eggert@twinsun.com>
+
+ * data/yacc.c: Avoid over-quoting of __line__ and __file__.
+
+2002-11-15 Paul Eggert <eggert@twinsun.com>
+
+ * tests/actions.at (Actions after errors): New test case.
+
+ * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
+ src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
+ tests/action.at, tests/calc.at, tests/conflicts.at,
+ tests/cxx-type.at, tests/regression.at:
+ "parse error" -> "syntax error" for POSIX compatibility.
+ "parsing stack overflow..." -> "parser stack overflow" so
+ that code matches Bison documentation.
+
+2002-11-15 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y (declaration): Have %parse-param and %lex-param
+ take two BRACED_CODE, not two string_content.
+ Free the scanner's obstack when we are done.
+ (code_content): New.
+ * tests/calc.at: Adjust.
+ * doc/bison.texinfo: Adjust.
+ Also, make sure to include the `,' for these declarations.
+
+2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
+
+ * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
+ definition; avoids potential autoreconf problems.
+
+2002-11-15 Akim Demaille <akim@epita.fr>
+
+ Always check the value returned by yyparse.
+
+ * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
+ returned by yyparse.
+ (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
+ Adjust calls.
+ * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
+ returned by yyparse.
+
+2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
+ on input.at test.
+
+2002-11-14 Paul Eggert <eggert@twinsun.com>
+
+ * src/output.c (output_skeleton): Call xfopen instead of
+ duplicating xfopen's body.
+
+ Fix bugs reported by Nelson H. F. Beebe in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
+
+ * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
+ "$CC -E foo.h" is allowed, as this doesn't work with the Portland
+ Group compiler. Instead, use "$CC -E bar.c". Include the .h
+ file twice in the grammar, as an extra check.
+
+ * tests/input.at (Torturing the Scanner): Surround the
+ backslash-newline tests with "#if 0", to make it less likely that
+ we'll run into compiler bugs. Bring back solitary \ inside
+ comment, but add a closing comment to work around HP C bug. Don't
+ test backslash-newline in C character constant.
+
+2002-11-14 Akim Demaille <akim@epita.fr>
+
+ * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
+ status of the compiler.
+ Calling `exit 1' is no longer needed.
+ Reported by Nelson H. F. Beebe.
+
+2002-11-14 Akim Demaille <akim@epita.fr>
+
+ * tests/atlocal.in (CPPFLAGS): We have config.h.
+ * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
+ New.
+ * tests/actions.at, tests/calc.at, tests/conflicts.at,
+ * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
+ * tests/regression.at, tests/torture.at: Use them for all the
+ grammars that are to be compiled.
+ * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
+ * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
+ * doc/bison.texinfo (GLR Parsers): Document `inline'.
+
+2002-11-14 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Various formatting changes (alignments in
+ samples, additional @group/@end group, GCS in samples.
+ Use @deffn instead of simple @table to define the directives,
+ macros, variables etc.
+
+2002-11-13 Paul Eggert <eggert@twinsun.com>
+
+ Fix some bugs reported by Albert Chin-A-Young in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
+
+ * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
+ -o c"; the HP C compiler chatters during compilation.
+ Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
+ * tests/headers.at (export YYLTYPE): Likewise.
+
+ * tests/input.at (Torturing the Scanner): Remove lines containing
+ solitary backslashes, as they tickle a bug in the HP C compiler.
+
+ * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
+ comments, since they're not portable. Use GNU coding style.
+
+2002-11-13 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c: Leave bigger chunks of quoted text.
+ (YYDSYMPRINTF): New.
+ Use it to report symbol activities.
+ * data/glr.c (YYDSYMPRINTF): New.
+ Use it.
+
+2002-11-12 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.75b.
+
+ * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
+ (yyglrReduce): Return yyok, not 0.
+ This should avoid the enumerated-type warnings reported
+ by Nelson H. F. Beebe in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
+
+ * lib/bbitset.h (BITSET_INLINE): Remove.
+ * lib/bitset.h [! BITSET_INLINE]: Remove.
+ (bitset_set, bitset_reset, bitset_test): Rename local vars
+ to avoid shadowing warnings by GCC.
+
+ * data/glr.c (inline): Remove #define. It's the user's
+ responsibility to #define it away, just like 'const'.
+ This fixes one of the bugs reported by Nelson H. F. Beebe in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
+
+ * Makefile.maint (po-check): Scan .l and .y files instead of the
+ .c and the .h files that they generate. This fixes the bug
+ reported by Tim Van Holder in:
+ <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
+ Look for N_ as well as for _. Try to avoid matching #define for
+ N_ and _.
+ * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
+ src/system.h. Add src/parse-gram.y, src/scan-gram.l.
+ * src/scan-gram.l: Revamp regular expressions so that " and '
+ do not confuse xgettext.
+
+ * src/struniq.h (struniq_new): Do not declare the return type
+ to be 'const'; this violates the C standard.
+ * src/struniq.c (struniq_new): Likewise.
+
+2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
+
+ * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
+ duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
+ linker.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * Makefile.maint: Sync with Autoconf:
+ (local_updates): New.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * po/POTFILES.in (src/lalr.c, src/state.c): Remove
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
+ locations.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
+ not yyvalue.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
+ Use it to test the GLR parser.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
+ defines it.
+ * data/glr.c (yystos): New.
+ (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
+ (YYDSYMPRINT): New.
+ (yyval): Don't define it, it is handled via M4.
+ (yyrecoverParseError): Free verbosely the discarded symbols.
+ * data/yacc.c (yysymprint): Remove, rather...
+ (b4_yysymprint_generate): invoke.
+ * data/c.m4 (b4_yysymprint_generate): New.
+ Accept pointers as arguments, as opposed to the version from
+ yacc.c.
+ (b4_yydestruct_generate): Likewise.
+ * tests/cations.at (Printers and Destructors): Use Bison directives
+ instead of CPP macros.
+ Don't rely on internal details.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
+ * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
+ Don't work on yychar (i.e., do set it to YYEMPTY, don't match
+ it against YYEMPTY and so forth), work on yytoken (i.e., set
+ it to YYEMPTY etc.).
+ (yydestruct): Replace with a b4_yydestruct_generate invocation.
+ (b4_symbol_actions): Remove.
+ * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
+ for 0, end-of-input.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Destructor Decl): New.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/tables.c (tables_generate): Use free for pointers that
+ cannot be NULL, not XFREE.
+ (pack_vector): Use assert, not fatal, for bound violations.
+ * src/state.c (state_new): Likewise.
+ * src/reader.c (reader): Likewise.
+ * src/lalr.c (set_goto_map): Likewise.
+ * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
+ the file name.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l, src/reader.h (scanner_last_string_free):
+ Restore.
+ * src/scan-gram.l (last_string): Is global to the file, not to
+ yylex.
+ * src/parse-gram.y (input): Don't append the epilogue here,
+ (epilogue.opt): do it here, and free the scanner's obstack.
+ * src/reader.c (epilogue_set): Rename as...
+ (epilogue_augment): this.
+ * data/c.m4 (b4_epilogue): Defaults to empty.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (long_options): Remove duplicates.
+ * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
+ Remove.
+ * doc/bison.rnh: Remove.
+ * doc/bison.texinfo (VMS Invocation): Remove.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/struniq.h, src/struniq.c (struniq_t): Is const.
+ (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
+
+ Use struniq for symbols.
+
+ * src/symtab.h (symbol_t): The tag member is a struniq.
+ (symbol_type_set): Adjust.
+ * src/symtab.c (symbol_new): Takes a struniq.
+ (symbol_free): Don't free the tag member.
+ (hash_compare_symbol_t, hash_symbol_t): Rename as...
+ (hash_compare_symbol, hash_symbol): these.
+ Use the fact that tags as struniqs.
+ (symbol_get): Use struniq_new.
+ * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
+ Returns a strniq.
+ * src/reader.h (merger_list, grammar_currentmerge_set): The name
+ and type members are struniqs.
+ * src/reader.c (get_merge_function)
+ (grammar_current_rule_merge_set): Adjust.
+ (TYPE, current_type): Are struniq.
+
+ Use struniq for file names.
+
+ * src/files.h, src/files.c (infile): Split into...
+ (grammar_file, current_file): these.
+ * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
+ * src/reduce.c (reduce_print): Likewise.
+ * src/getargs.c (getargs): Likewise.
+ * src/complain.h, src/complain.c: Likewise.
+ * src/main.c (main): Call struniqs_new early enough to use it for
+ file names.
+ Don't free the input file name.
+
+2002-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.c (symbol_free): Remove dead deactivated code:
+ type_name are properly removed.
+ Don't use XFREE to free items that cannot be NULL.
+ * src/struniq.h, src/struniq.c: New.
+ * src/main.c (main): Initialize/free struniqs.
+ * src/parse-gram.y (%union): Add astruniq member.
+ (yyprint): Adjust.
+ * src/scan-gram.l (<{tag}>): Return a struniq.
+ Free the obstack bit that used to store it.
+ * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
+
+2002-11-11 Paul Eggert <eggert@twinsun.com>
+
+ Revamp to fix many (but not all) of the C- and M4-related quoting
+ problems. Among other things, this fixes the Bison bug reported
+ by Jan Hubicka when processing the Bash grammar; see:
+ <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
+
+ Use new @ escapes consistently. Represent brackets with @{ and @}
+ rather than @<:@ and @:>@, since this works a bit better with dumb
+ editors like vi. Represent @ with @@, since @ is now consistently
+ an escape. Use @oline@ and @ofile@ rather than __oline__ and
+ __ofile__, to avoid unexpected expansions. Similarly, use @output
+ rather than #output.
+
+ * data/c.m4 (b4_copyright): Omit file name from comment, since
+ the file name could contain "*/".
+ (b4_synclines_flag): Don't quote the 2nd argument; it should already
+ be quoted. All uses changed.
+
+ * data/glr.c: Use new @ escapes consistently.
+ (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
+ b4_output_header_suffix, b4_output_header_name, b4_header_guard):
+ Remove, since they couldn't handle arbitrary characters in file
+ names.
+ * data/lalr1.cc: Likewise.
+ * data/yacc.c: Likewise.
+
+ * src/files.c (output_infix): Remove; all uses removed.
+ * src/files.h: Likewise.
+
+ * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
+ mishandled funny characters in file names, and anyway it isn't
+ needed any more.
+ * data/yacc.c: Likewise.
+ * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
+
+ * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
+ * data/yacc.c: Likewise.
+
+ * src/muscle_tab.c: Include quotearg.h, since we need to quote C
+ strings now.
+ (muscle_init): Quote filename as a C string.
+ * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
+ (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
+ * src/output.c (escaped_file_name_output): New function.
+ (prepare_symbols): Quote tokens for M4.
+ (prepare): Don't insert output_infix, output_prefix,
+ output_parser_name, output_header_name; this is now down by scan-skel.
+ Insert skeleton as a C string.
+
+ * src/output.c (user_actions_output, symbol_destructors_output,
+ symbol_printers_output): Quote filenames for C and M4.
+ * src/reader.c (prologue_augment, epilogue_set): Likewise.
+
+ * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
+ escapes other than \\ and \'; this simplifies the code.
+ (<SC_STRING>): Likewise, for \\ and \".
+ (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
+ SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
+ Use new escapes @{ and @} for [ and ].
+
+ * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
+ them with auto vars.
+ Switch to new escape scheme, where @ is the escape character uniformly.
+ Abort if a stray escape character is found. Avoid unbounded input
+ buffer when parsing non-escaped text.
+
+ * tests/input.at (Torturing the Scanner): Add tests that @oline@,
+ __oline__, #output, $@, and @{ do not have unintended meanings.
+
+2002-11-09 Paul Eggert <eggert@twinsun.com>
+
+ Fix the test failure due to GCC warnings described in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
+ * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
+ evaluate to 0 if it's impossible for NINF to be in the respective
+ table.
+ (yygetLRActions, yyrecoverParseError): Use them.
+
+ * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
+ counted in the token inserted at end of file. Now takes
+ location_t *, not location_t, so that the location can be
+ adjusted. All uses changed.
+
+ * tests/regression.at (Invalid inputs): Adjust wording in
+ diagnostic to match the new behavior.
+
+ * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
+ AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
+ AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
+ abort ();'. This reduces the runtime of the "Many lookaheads"
+ test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
+ GCC 3.2.
+
+2002-11-07 Paul Eggert <eggert@twinsun.com>
+
+ * src/parse-gram.y (CHARACTER): Remove unused token.
+ All uses removed.
+
+ * src/scan-gram.l: Remove stack option. We no longer use the
+ stack, since the stack was never deeper than 1; instead, use the
+ new auto var c_context to record the stacked value.
+
+ Remove nounput option. At an unexpected end of file, we now unput
+ the minimal input necessary to end cleanly; this simplifies the
+ code.
+
+ Avoid unbounded token sizes where this is easy.
+
+ (unexpected_end_of_file): New function.
+ Use it to systematize the error message on unexpected EOF.
+ (last-string): Now auto, not static.
+ (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
+ (scanner_last_string_free): Remove; not used.
+ (percent_percent_count): Move decl to just before use.
+ (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
+ not the (never otherwised-used) CHARACTER.
+
+2002-11-07 Akim Demaille <akim@epita.fr>
+
+ Let yyerror always receive the msg as last argument, so that
+ yyerror can be variadic.
+
+ * data/yacc.c (b4_yyerror_args): New.
+ Use it when calling yyerror.
+ * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
+ Use it when calling yyerror.
+ * doc/bison.texinfo (Error Reporting): Adjust.
+ * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
+ * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
+
+2002-11-06 Akim Demaille <akim@epita.fr>
+
+ #line should have quoted strings.
+ Ideally, this should be done by m4_quotearg.
+
+ * src/scan-skel.l: Include quotearg.h.
+ Quote __ofile__.
+ * src/output.c (symbol_printers_output)
+ (symbol_destructors_output): Quote the file name.
+
+2002-11-06 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Invalid inputs): Adjust to the recent
+ messages.
+
+2002-11-06 Akim Demaille <akim@epita.fr>
+
+ Restore --no-lines.
+ Reported by Jim Kent.
+
+ * data/c.m4 (b4_syncline): New.
+ * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
+ * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
+ * src/output.c (user_actions_output): Likewise.
+ (prepare): Define 'b4_synclines_flag'.
+ * src/muscle_tab.c (muscle_init): Don't define b4_linef.
+
+2002-11-06 Akim Demaille <akim@epita.fr>
+
+ * src/main.c (main): Free `infile'.
+ * src/scan-gram.l (handle_syncline): New.
+ Recognize `#line'.
+ * src/output.c (user_actions_output, symbol_destructors_output)
+ (symbol_printers_output): Use the location's file name, not
+ infile.
+ * src/reader.c (prologue_augment, epilogue_set): Likewise.
+
+2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * src/tables.c (matching_state): Don't allow states to match if
+ either has GLR conflict entries.
+
+2002-11-05 Paul Eggert <eggert@twinsun.com>
+
+ * src/scan-gram.l: Use more accurate diagnostics, e.g.
+ "integer out of range" rather than "invalid value".
+ * tests/input.at (Invalid $n, Invalid @n): Change expected wording
+ accordingly.
+
+ Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
+ Also, remove one static variable in the scanner.
+
+ * src/scan-gram.l (braces_level): Now auto, not static.
+ Initialize to zero if the compiler is being picky.
+ (INITIAL): Clear braces_level instead of incrementing it.
+ (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
+ as POSIX 1003.1-2001 requires.
+ * src/system.h (IF_LINT): New macro, taken from coreutils.
+ * configure.ac: Define "lint" if --enable-gcc-warnings.
+
+2002-11-05 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l: When it starts with `%', complain about the
+ whole directive, not just that `invalid character: %'.
+
+2002-11-04 Akim Demaille <akim@epita.fr>
+
+ * Makefile.maint: Update from Autoconf.
+ (update, cvs-update, po-update, do-po-update): New.
+
+2002-11-04 Akim Demaille <akim@epita.fr>
+
+ * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
+ and yyerror.
+ Have yyerror `use' its arguments.
+ * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
+ returns true when location & yacc & pure & parse-param.
+ (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
+
+2002-11-04 Akim Demaille <akim@epita.fr>
+
+ * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
+ clashes.
+ * src/scan-gram.l: Use [\'] instead of ['] to pacify
+ font-lock-mode.
+ Use complain_at.
+ Use quote, not quote_n since LOCATION_PRINT no longer uses the
+ slot 0.
+
+2002-11-03 Paul Eggert <eggert@twinsun.com>
+
+ * src/reader.c (get_merge_function, grammar_current_rule_check):
+ Use consistent diagnostics for reporting type name clashes.
+ Quote the types with <>, for consistency with Yacc.
+ * tests/input.at (Type Clashes): Adjust to diagnostic changes.
+
+2002-11-03 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
+ New.
+ * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
+ (b4_parse_param): Remove.
+ Use b4_identification.
+ Propagate b4_pure_args where needed to pass them to yyerror.
+ * data/glr.m4 (b4_parse_param): Remove.
+ (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
+ (b4_lpure_formals): New.
+ Use b4_identification.
+ (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
+ b4_user_formals and b4_user_args.
+ (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
+ (yyreportAmbiguity): When using a pure parser, also need
+ the location, and the parse-params.
+ Adjust callers.
+ (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
+ When using a pure parser, also need the parse-params.
+ Adjust callers.
+ * tests/calc.at: Test pure (%pure-parser) and absolutely pure
+ (%pure-parser + %parse-param) LALR and GLR parsers.
+ (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
+ AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
+ AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
+ (_AT_DATA_CALC_Y): Equip for purity of yyerror.
+ (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
+ * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
+ * doc/bison.texinfo: Untabify the whole file.
+ (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
+ (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
+ (Error Reporting): Adjust to these new directives.
+ Document %error-verbose, deprecate YYERROR_VERBOSE.
+
+2002-11-03 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
+ AT_CHECK_CALC_GLR invocations to use % directives, instead of
+ command line options.
+ * tests/cxx-type.at: Formatting changes.
+
+2002-11-03 Paul Eggert <eggert@twinsun.com>
+
+ * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
+ to count columns correctly, and to check for invalid inputs.
+
+ Use mbsnwidth to count columns correctly. Account for tabs, too.
+ Include mbswidth.h.
+ (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
+ (extend_location): New function.
+ (YY_LINES): Remove.
+
+ Handle CRLF in C code rather than in Lex code.
+ (YY_INPUT): New macro.
+ (no_cr_read): New function.
+
+ Scan UCNs, even though we don't fully handle them yet.
+ (convert_ucn_to_byte): New function.
+
+ Handle backslash-newline correctly in C code.
+ (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
+ (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
+ all uses changed.
+ (tag, splice): New EREs. Do not allow NUL or newline in tags.
+ Use {splice} wherever C allows backslash-newline.
+ YY_STEP after space, newline, vertical-tab.
+ ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
+
+ (letter, id): Don't assume ASCII; e.g., spell out a-z.
+
+ ({int}, handle_action_dollar, handle_action_at): Check for integer
+ overflow.
+
+ (YY_STEP): Omit trailing semicolon, so that it's more like C.
+
+ (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
+ as well as \000. Check for UCHAR_MAX, not 255.
+ Allow \x with an arbitrary positive number of digits, as in C.
+ Check for overflow here.
+ Allow \? and UCNs, for compatibility with C.
+
+ (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
+ with quote slot used by complain_at.
+
+ * tests/input.at: Add tests for backslash-newline, m4 quotes
+ in symbols, long literals, and funny escapes in strings.
+
+ * configure.ac (jm_PREREQ_MBSWIDTH): Add.
+ * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
+ * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
+ * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
+ * m4/mbswidth.m4: New file, from GNU coreutils.
+
+ * doc/bison.texinfo (Grammar Outline): Document // comments.
+ (Symbols): Document that trigraphs have no special meaning in Bison,
+ nor is backslash-newline allowed.
+ (Actions): Document that trigraphs have no special meaning.
+
+ * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
+ no longer used.
+
+2002-11-02 Paul Eggert <eggert@twinsun.com>
+
+ * src/reader.c: Don't include quote.h; not needed.
+ (get_merge_function): Reword warning to be consistent with
+ type clash diagnostic in grammar_current_rule_check.
+
+ * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
+ bug in trigraph handling.
+
+ * src/output.c (prepare_symbols): When printing token names,
+ escape "[" as "@<:@" and likewise for "]".
+
+ * src/system.h (errno): Remove declaration, as we are now
+ assuming C89 or better, and C89 guarantees errno.
+
+2002-10-30 Paul Eggert <eggert@twinsun.com>
+
+ * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
+ Check for close failures.
+ * src/files.h (xfclose): Return void, not int, since it always
+ returned zero.
+ * src/files.c (xfclose): Likewise. Report I/O error if ferror
+ indicates one.
+ * src/output.c (output_skeleton): Use xfclose rather than fclose
+ and ferror. xfclose now checks ferror.
+
+ * data/glr.c (YYLEFTMOST_STATE): Remove.
+ (yyreportTree): Use a stack-based leftmost state. This avoids
+ our continuing battles with bogus warnings about initializers.
+
+2002-10-30 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
+ #if.
+
+2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * tests/glr-regr1.at: New test for reported regressions.
+ * tests/testsuite.at: Add glr-regr1.at test.
+ * tests/Makefile.am: Add glr-regr1.at test.
+
+2002-10-24 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.75a.
+
+ * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
+ * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
+ we use malloc. Don't assume 'A' through 'Z' are contiguous.
+ Don't assume strdup exists; POSIX says its an XSI extension.
+ Check for buffer overflow on input.
+
+2002-10-24 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_skeleton): Don't disable M4sugar comments
+ too soon: it results in comments being expanded.
+ * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
+ first output.
+
+2002-10-24 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c (m4_int_type): New.
+ * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
+ char' as only yacc.c wants K&R portability.
+ * data/glr.c (yysigned_char): Remove.
+ * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
+ Reported by Quoc Peyrot.
+
+2002-10-23 Paul Eggert <eggert@twinsun.com>
+
+ * src/main.c (main): With --trace=time, report times even if a
+ non-fatal error occurs. Formerly, the times were reported in some
+ such cases but not in others.
+ * src/reader.c (reader): Just return if a complaint has been issued,
+ instead of exiting, so that 'main' can report times.
+
+2002-10-22 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: Include sys/types.
+ Reported by Bert Deknuydt.
+
+2002-10-23 Paul Eggert <eggert@twinsun.com>
+
+ * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
+ Suggested by Art Haas.
+
+2002-10-22 Paul Eggert <eggert@twinsun.com>
+
+ * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
+ decl; not needed any more.
+ * src/main.c (main): Use return to exit, undoing yesterday's change.
+ The last OS that we could find where this wouldn't work is
+ SunOS 3.5, and that's too old to worry about now.
+
+ * data/glr.c (struct yyltype): Define members even when not
+ doing locations. This is more consistent with yacc.c, and it
+ works around the following bug reports:
+ http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
+ http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
+
+ * doc/bison.texinfo: Minor spelling and typographical fixes. Use
+ @acronym consistently. Standardize on "Yacc" instead of "YACC",
+ "Algol" instead of "ALGOL". Give a bit more history about BNF.
+
+2002-10-22 Akim Demaille <akim@epita.fr>
+
+ * data/README: New.
+
+2002-10-21 Paul Eggert <eggert@twinsun.com>
+
+ Be consistent about 'bool'; the old code used an enum in one
+ module and an int in another, and this violates the C standard.
+ * m4/stdbool.m4: New file, from coreutils 4.5.3.
+ * configure.ac (AC_HEADER_STDBOOL): Add.
+ * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
+ * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
+ * src/symtab.c (hash_compare_symbol_t): Likewise.
+ * src/system.h (bool, false, true): Use a definition consistent
+ with ../lib/hash.c. All uses changed.
+
+ * src/complain.c (warning_issued): Renamed from warn_message_count,
+ so that we needn't worry about integer overflow (!).
+ Now of type bool. All uses changed.
+ (complaint_issued): Renamed from complain_message_count; likewise.
+
+ * src/main.c (main): Use exit to exit with failure.
+
+ * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
+ rather than 1 and 0.
+ * src/main.c (main): Likewise.
+ * src/getargs.c (getargs): Likewise.
+ * src/reader.c (reader): Likewise.
+
+ * src/getarg.c (getargs): Remove duplicate code for
+ "Try `bison --help'".
+
+ * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
+ What was that "2" for?
+
+ * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
+ * src/getargs.c (usage): Likewise.
+
+ * src/getargs.c (getargs): When there are too few operands, report
+ the last one. When there are too many, report the first extra
+ one. This is how diffutils does it.
+
+2002-10-20 Paul Eggert <eggert@twinsun.com>
+
+ Remove K&R vestiges.
+ * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
+ * src/complain.c (VA_START): Remove. Assume prototypes.
+ (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
+ (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
+ fatal): Assume prototypes.
+ * src/complain.h: Assume prototypes.
+ * src/system.h (PARAMS): Remove.
+ Include <limits.h> unconditionally, since it's guaranteeed even
+ for a freestanding C89 compiler.
+ (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
+ * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
+ * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
+ (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
+ (yyresolveStates, yyresolveAction, yyresolveStack)
+ (yyprocessOneStack): Use them.
+ (yy_reduce_print): New.
+ * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_c_ansi_args): Recognize functions with no
+ arguments and output `void'.
+ (b4_c_function): Rename as...
+ (b4_c_function_def): this.
+ (b4_c_function_decl, b4_c_ansi_function_def)
+ (b4_c_ansi_function_decl): New.
+ Change the interpretation of the arguments: before `int, foo', now
+ `int foo, foo'.
+ * data/yacc.c (yyparse): Prototype and define thanks to these.
+ Adjust b4_c_function_def uses.
+ * data/glr.c (yyparse): Likewise, but ANSI only.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (prepare): Move the definition of `tokens_number',
+ `nterms_number', `undef_token_number', `user_token_number_max'
+ to...
+ (prepare_tokens): Here.
+ (prepare_tokens): Rename as...
+ (prepare_symbols): this.
+ (prepare): Move the definition of `rules_number' to...
+ (prepare_rules): here.
+ (prepare): Move the definition of `last', `final_state_number',
+ `states_number' to...
+ (prepare_states): here.
+ * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * src/tables.h, src/tables.c, src/output.c: Comment changes.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
+ * data/c.m4: here.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
+ * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
+ `pair'.
+ (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
+ `name' to...
+ * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
+ (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
+ These.
+
+2002-10-19 Paul Eggert <eggert@twinsun.com>
+
+ Do not create a temporary file, as that involves security and
+ cleanup headaches. Instead, use a pair of pipes.
+ Derived from a suggestion by Florian Krohm.
+ * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
+ * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
+ * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
+ (BISON_PREREQ_SUBPIPE): Add.
+ * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
+ Add subpipe.h, subpipe.c.
+ * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
+ * po/POTFILES.in: Add lib/subpipe.c.
+ * src/output.c: Include "subpipe.h".
+ (m4_invoke): Remove decl.
+ (scan_skel): New decl.
+ (output_skeleton): Use pipe rather than temporary file for m4 input.
+ Check that m4sugar.m4 is readable, to avoid deadlock.
+ Check for pipe I/O error.
+ * src/scan-skel.l (readpipe): Remove decl.
+ (scan_skel): New function, to be used in place of m4_invoke.
+ Read from stream rather than file.
+
+ * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
+ float, as this generates a warning on Solaris 8 + GCC 3.2 with
+ --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
+ this generates a more-accurate value anyway.
+
+ * lib/timevar.c (timervar_accumulate): Rename locals to
+ avoid confusion with similarly-named more-global.
+ * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
+
+ * src/output.c (prepare): Use xstrdup to convert char const *
+ to char *, to avoid GCC warning.
+
+2002-10-19 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
+ LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
+ Use them to have `calc.y' ready for %pure-parser.
+ * data/yacc.c (YYLEX): Pass a yylex return type to
+ b4_c_function_call.
+
+2002-10-19 Akim Demaille <akim@epita.fr>
+
+ Prototype support of %lex-param and %parse-param.
+
+ * src/parse-gram.y: Add the definition of the %lex-param and
+ %parse-param tokens, plus their rules.
+ Drop the `_' version of %glr-parser.
+ Add the "," token.
+ * src/scan-gram.l (INITIAL): Scan them.
+ * src/muscle_tab.c: Comment changes.
+ (muscle_insert, muscle_find): Rename `pair' as `probe'.
+ * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
+ (muscle_entry_s): The `value' member is no longer const.
+ Adjust all dependencies.
+ * src/muscle_tab.c (muscle_init): Adjust: use
+ MUSCLE_INSERT_STRING.
+ Initialize the obstack earlier.
+ * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
+ (muscle_pair_list_grow): New.
+ * data/c.m4 (b4_c_function_call, b4_c_args): New.
+ * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
+ * tests/calc.at: Use %locations, not --locations.
+ (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
+
+2002-10-19 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (usage): Take status as argument and exit
+ accordingly.
+ Report the traditional `Try ... --help' message when status != 0.
+ (usage, version): Don't take a FILE * as arg, it is pointless.
+ (getargs): When there is an incorrect number of arguments, make it
+ an error, and report it GNUlically thanks to `usage ()'.
+
+2002-10-18 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (yyreportParseError): Don't assume that sprintf
+ yields the length of the printed string, as this is not true
+ on SunOS 4.1.4. Reported by Peter Klein.
+
+ * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
+ * tests/conflicts.at (%nonassoc and eof): Likewise.
+ Fixes SunOS 4.1.4 test failure reported by Peter Klein.
+
+2002-10-17 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
+ * src/getargs.c (trace_types, trace_args): Adjust.
+ * src/reader.c (grammar_current_rule_prec_set)
+ (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
+ Standardize error messages.
+ And s/@prec/%prec/!
+ (reader): Use trace_flag to enable scanner/parser debugging,
+ instead of an adhoc scheme.
+ * src/scan-gram.l: Remove trailing debugging code.
+
+2002-10-16 Paul Eggert <eggert@twinsun.com>
+
+ * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
+ MUSCLE_TAB_H.
+
+ * NEWS: Officially drop support for building Bison with K&R C,
+ since it didn't work anyway and it's not worth worrying about.
+ * Makefile.maint (wget_files): Remove ansi2knr.c.
+ (ansi2knr.c-url_prefix): Remove.
+ * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
+ * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
+ * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
+
+2002-10-15 Paul Eggert <eggert@twinsun.com>
+
+ Stop using the "enum_" trick for K&R-style function definitions;
+ it confused me, and I was the author! Instead, assume that people
+ who want to use K&R C compilers (when using these modules in GCC,
+ perhaps?) will run ansi2knr.
+
+ * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
+ All uses of "enum_" changed to "enum ".
+ * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
+ * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
+
+ * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
+ abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
+ abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
+ abitset_copy1, abitset_disjoint_p, abitset_empty_p,
+ abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
+ abitset_not, abitset_ones, abitset_or, abitset_or_and,
+ abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
+ abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
+ abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
+ Use function prototypes; this removes the need for declaring
+ static functions simply to provide their prototypes.
+ * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
+ bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
+ bitset_count_, bitset_create, bitset_dump, bitset_first,
+ bitset_free, bitset_init, bitset_last, bitset_next,
+ bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
+ bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
+ bitset_print, bitset_release_memory, bitset_toggle_,
+ bitset_type_choose, bitset_type_get, bitset_type_name_get,
+ debug_bitset): Likewise.
+ * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
+ * lib/bitset_stats.c (bitset_log_histogram_print,
+ bitset_percent_histogram_print, bitset_stats_and,
+ bitset_stats_and_cmp, bitset_stats_and_or,
+ bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
+ bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
+ bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
+ bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
+ bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
+ bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
+ bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
+ bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
+ bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
+ bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
+ bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
+ bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
+ bitset_stats_zero): Likewise.
+ * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
+ bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
+ bitsetv_dump, debug_bitsetv): Likewise.
+ * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
+ ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
+ ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
+ ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
+ ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
+ ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
+ ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
+ ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
+ ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
+ ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
+ ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
+ Likewise.
+ * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
+ lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
+ lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
+ lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
+ lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
+ lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
+ lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
+ lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
+ lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
+ lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
+ lbitset_xor_cmp, lbitset_zero): Likewise.
+
+2002-10-14 Akim Demaille <akim@epita.fr>
+
+ Version 1.75.
+
+2002-10-14 Akim Demaille <akim@epita.fr>
+
+ * tests/Makefile.am (maintainer-check-posix): New.
+
+2002-10-14 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
+ member.
+
+2002-10-14 Akim Demaille <akim@epita.fr>
+
+ * src/tables.c (table_ninf_remap): base -> tab.
+ Reported by Matt Rosing.
+
+2002-10-14 Paul Eggert <eggert@twinsun.com>
+
+ * tests/action.at, tests/calc.at, tests/conflicts.at,
+ tests/cxx-type.at, tests/headers.at, tests/input.at,
+ tests/regression.at, tests/synclines.at, tests/torture.at:
+ Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
+ so that the tests still work even if POSIXLY_CORRECT is set.
+ * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
+
+ * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
+ for portability to K&R hosts. Fix typo: signed char is guaranteed
+ only to 127, not to 128.
+ * data/glr.c (yysigned_char): New type.
+ * data/yacc.c (yysigned_char): Likewise.
+ * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
+
+2002-10-13 Paul Eggert <eggert@twinsun.com>
+
+ * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
+ true due to limited range of data type" warning from GCC.
+
+ * data/c.m4 (b4_token_defines): Protect against double-inclusion
+ by wrapping enum yytokentype's definition inside #ifndef
+ YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
+
+2002-10-13 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
+ Un yy- yyrhs to avoid the name clash with the global YYRHS.
+
+2002-10-13 Akim Demaille <akim@epita.fr>
+
+ * Makefile.maint: Update from Autoconf 2.54.
+ * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
+
+2002-10-13 Akim Demaille <akim@epita.fr>
+
+ * src/print.c (print_state): Separate the list of solved conflicts
+ from the other items.
+ * tests/conflicts.at (Resolved SR Conflicts): Adjust.
+
+2002-10-13 Akim Demaille <akim@epita.fr>
+
+ Let nondeterministic skeletons be usable with deterministic
+ tables.
+
+ With the patch, GAWK compiled by GCC without -O2 passes its test
+ suite using a GLR parser driven by LALR tables. It fails with -O2
+ because `struct stat' gives two different answers on my machine:
+ 88 (definition of an auto var) and later 96 (memset on this var).
+ Hence the stack is badly corrumpted. The headers inclusion is to
+ blame: if I move the awk.h inclusion before GLR's system header
+ inclusion, the two struct stat have the same size.
+
+ * src/tables.c (pack_table): Always create conflict_table.
+ (token_actions): Always create conflict_list.
+ * data/glr.c (YYFLAG): Remove, unused.
+
+2002-10-13 Akim Demaille <akim@epita.fr>
+
+ * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
+ (O0FLAGS): New.
+ (VALGRIND, GXX): New.
+ * tests/atlocal.in (CFLAGS): Use O0FLAGS.
+ * tests/bison.in: Run $PREBISON a pre-command.
+ * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
+ (maintainer-check-g++): New.
+ * Makefile.am (maintainer-check): New.
+
+2002-10-13 Akim Demaille <akim@epita.fr>
+
+ * data/glr.c: Formatting changes.
+ Tweak some trace messages to match yacc.c's.
+
+2002-10-13 Akim Demaille <akim@epita.fr>
+
+ GLR parsers sometimes raise parse errors instead of performing the
+ default reduction.
+ Reported by Charles-Henry de Boysson.
+
+ * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
+ check the length of the traces when %glr.
+ (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
+ GLR's traces.
+ (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
+ Test GLR parsers.
+ * data/glr.c (YYLEFTMOST_STATE): Fix its value.
+ (yyltype): Remove the yy prefix from the member names.
+ (yytable): Complete its comment.
+ (yygetLRActions): Map error action number from YYTABLE from
+ YYTABLE_NINF to 0.
+ (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
+ (which was a bug: it should have been YYTABEL_NINF, and yet it was
+ not satisfying as we could compare an YYACTION computed from
+ YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
+ only value for error actions.
+ (yyreportParseError): In verbose parse error messages, don't issue
+ `error' in the list of expected tokens.
+ * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
+ next action to perform to match glr.c's decoding.
+ (yytable): Complete its comment.
+
+2002-10-13 Paul Eggert <eggert@twinsun.com>
+
+ Fix problem reported by Henrik Grubbstroem in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
+ "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
+ because the Bison parser reads the second action before reducing
+ the first one.
+ * src/scan-gram.l (rule_length): New static var.
+ Use it to keep track of the rule length in the scanner, since
+ we can't expect the parser to be in lock-step sync with the scanner.
+ (handle_action_dollar, handle_action_at): Use this var.
+ * tests/actions.at (Exotic Dollars): Test for the problem.
+
+2002-10-12 Paul Eggert <eggert@twinsun.com>
+
+ * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
+ * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
+ Include <sys/time.h> when checking for clock_t and struct tms.
+ Use same include order as source.
+ This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
+
+ * lib/timevar.c: Update copyright date and clarify comments.
+ (get_time) [IN_GCC]: Keep the GCC version for reference.
+
+ * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
+ GCC version as of today, then merge Bison's changes.
+ Change "GCC" to "Bison" in copyright notice. timevar.def's
+ author is Akim, so change that too.
+
+ * src/reader.c (grammar_current_rule_check):
+ Don't worry about the default action if $$ is untyped.
+ Prevents bogus warnings reported by Jim Gifford in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
+
+ * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
+ * data/glr.c, data/lalr1.cc, data/yacc.c:
+ Output token definitions before the first part of user declarations.
+ Fixes compatibility problem reported by Jim Gifford for kbd in
+ <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
+
+2002-10-11 Paul Eggert <eggert@twinsun.com>
+
+ * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
+ (yyparse): here. This undoes some of the 2002-07-25 change.
+ Compatibility problem reported by Ralf S. Engelschall with
+ OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
+
+2002-10-11 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at Characters Escapes): New.
+ * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
+ characters.
+ Reported by Jan Nieuwenhuizen.
+
+2002-10-11 Akim Demaille <akim@epita.fr>
+
+ * po/id.po: New.
+
+2002-10-10 Paul Eggert <eggert@twinsun.com>
+
+ Portability fixes for bitsets; this also avoids several GCC
+ warnings.
+
+ * lib/abitset.c: Include <stddef.h>, for offsetof.
+ * lib/lbitset.c: Likewise.
+
+ * lib/abitset.c (abitset_bytes): Return a size that is aligned
+ properly for vectors of objects. Do not assume that adding a
+ header size to a multiple of a word size yields a value that is
+ properly aligned for the whole union.
+ * lib/bitsetv.c (bitsetv_alloc): Likewise.
+
+ * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
+ unique names for structures.
+ * lib/ebitset.c (ebitset_bytes): Likewise.
+ * lib/lbitset.c (lbitset_bytes): Likewise.
+
+ * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
+ abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
+ abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
+ abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
+ abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
+ abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
+ abitset_or_and_cmp, abitset_copy): Supply prototype decls,
+ to improve the type-checking that GCC can do.
+ * lib/bitset.c (bitset_op4_cmp): Likewise.
+ * lib/bitset_stats.c (bitset_stats_count,
+ bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
+ bitset_stats_copy, bitset_stats_disjoint_p,
+ bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
+ bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
+ bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
+ bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
+ bitset_stats_and_or_cmp, bitset_stats_andn_or,
+ bitset_stats_andn_or_cmp, bitset_stats_or_and,
+ bitset_stats_or_and_cmp): Likewise.
+ * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
+ lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
+ lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
+ lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
+
+ * lib/abitset.h: Include bitset.h, not bbitset.h.
+ * lib/ebitset.h: Likewise.
+ * lib/lbitset.h: Likewise.
+
+ * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
+ All instances of parameters of type enum bitset_opts are now of
+ type enum_bitset_opts, to conform to the C Standard, and similarly
+ for enum_bitset_type.
+ * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
+ * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
+
+ Do not use "struct bitset_struct" to mean different things in
+ different modules. Not only is this confusing, it violates
+ the C Standard, which requires that structure types in different
+ modules must be compatible if one is to be passed to the other.
+ * lib/bbitset.h (bitset): Now points to a union, not to a struct.
+ All instances of "struct bitset_struct *" replaced with "bitset".
+ * lib/bitset.h (struct bitset_struct): Remove, replacing with....
+ (union bitset_union, struct abitset_struct, struct ebitset_struct,
+ struct lbitset_struct, struct bitset_stats_struct): New types.
+ All uses of struct bitset_struct changed to union bitset_union,
+ etc.
+ * lib/abitset.c (struct abitset_struct, abitset,
+ struct bitset_struct): Remove.
+ * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
+ struct bitset_struct): Remove.
+ * lib/ebitset.c (struct ebitset_struct, ebitset, struct
+ bitset_struct): Remove.
+ * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
+ Likewise.
+
+ Do not call a function of type T using a call that assumes the
+ function is of a different type U. Standard C requires that a
+ function must be called with a type that is compatible with its
+ definition.
+ * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
+ New decls.
+ * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
+ New functions.
+ * lib/ebitset.c (PFV): Remove.
+ * lib/lbitset.c (PFV): Likewise.
+ * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
+ ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
+ decls.
+ (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
+ (ebitset_vtable): Use them.
+ * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
+ lbitset_xor): New functions.
+ (lbitset_vtable): Use them.
+
+ * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
+ Declare.
+
+ * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
+ GCC warning.
+ * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
+ Use offsetof, for simplicity.
+
+2002-10-06 Paul Eggert <eggert@twinsun.com>
+
+ * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
+ the same width as int. This reapplies a hunk of the 2002-08-12 patch
+ <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
+ which was inadvertently undone by the 2002-09-30 patch.
+ * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
+ the same width as int.
+
+2002-10-04 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.50.
+
+ * configure.ac (AC_INIT), NEWS: Increment version number.
+
+ * doc/bison.texinfo: Minor spelling, grammar, and white space
+ fixes.
+ (Symbols): Mention that any negative value returned from yylex
+ signifies end-of-input. Warn about negative chars. Mention
+ the portable Standard C character set.
+
+ The GNU coding standard says CFLAGS and YFLAGS are reserved
+ for the installer to set.
+ * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
+ * src/Makefile.am (AM_CFLAGS): Likewise.
+ (AM_YFLAGS): Renamed from YFLAGS.
+
+ Fix some MAX and MIN problems.
+ * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
+ * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
+ * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
+ * src/reader.c (reader): Use it.
+
+ * tests/regression.at (Braces parsing): Use grep, not fgrep, as
+ POSIX 1003.1-2001 has removed fgrep.
+
+2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
+ interpreted as signed.
+ * lib/ebitset.c (ebitset_list): Fix bug.
+
+2002-10-01 Paul Eggert <eggert@twinsun.com>
+
+ More fixes for 64-bit hosts and large bitsets.
+
+ * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
+ abitset_size, abitset_list, abitset_list_reverse, abitset_list):
+ Use bitset_bindex, not int or unsigned int or size_t, to count bits.
+ * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
+ struct bitset_vtable.list, struct bitset_vtable.list_reverse,
+ bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
+ bitset_count_): Likewise.
+ * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
+ bitset_first, bitset_last): Likewise.
+ * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
+ bitset_stats_list_reverse, bitset_stats_size,
+ bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
+ Likewise.
+ * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
+ * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
+ bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
+ bitsetv_reflexive_transitive_closure): Likewise.
+ * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
+ * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
+ Likewise.
+ * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
+ Likewise.
+
+ * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
+ Use size_t, not unsigned int, to count bytes.
+ * lib/abitset.h (abitset_bytes): Likewise.
+ * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
+ Likewise.
+ * lib/bitset.h (bitset_bytes): Likewise.
+ * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
+ * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
+ * lib/bitsetv.c (bitsetv_alloc): Likewise.
+ * lib/ebitset.c (ebitset_bytes): Likewise.
+ * lib/ebitset.h (ebitset_bytes): Likewise.
+ * lib/lbitset.c (lbitset_bytes): Likewise.
+ * lib/lbitset.h (lbitset_bytes): Likewise.
+
+ * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
+ abitset_subset_p, abitset_disjoint_p, abitset_and,
+ abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
+ abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
+ abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
+ abitset_or_and, abitset_or_and_cmp):
+ Use bitset_windex instead of unsigned int.
+ * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
+ * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
+ ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
+ ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
+ Likewise.
+ * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
+
+ * lib/bitset.c (bitset_print):
+ Use proper printf formats for widths of integer types.
+ * lib/bitset_stats.c (bitset_percent_histogram_print,
+ bitset_log_histogram_print, bitset_stats_print_1): Likewise.
+ * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
+ * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
+ * lib/lbitset.c (lbitset_bytes): Likewise.
+
+ * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
+ BITSET_SIZE_MAX): New macros.
+ (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
+ sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
+ to BITSET_WINDEX_MAX.
+
+ * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
+ bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
+ since we now return the bitset_bindex type (not int).
+
+ * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
+ when computing sizes.
+ * lib/ebitset.c (ebitset_elts_grow): Likewise.
+
+ * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
+ and avoid cast to unsigned.
+
+2002-09-30 Akim Demaille <akim@epita.fr>
+
+ * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
+ * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
+ Updates from Michael Hayes.
+
+2002-09-30 Art Haas <ahaas@neosoft.com>
+
+ * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
+ invocations.
+ * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
+ defined.
+
+2002-09-27 Akim Demaille <akim@epita.fr>
+
+ Version 1.49c.
+
+2002-09-27 Akim Demaille <akim@epita.fr>
+
+ * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
+ (Because of AC_LIBSOURCE).
+
+2002-09-27 Akim Demaille <akim@epita.fr>
+
+ Playing with Autoscan.
+
+ * configure.ac: Remove the old LIBOBJ tweaks.
+ (AC_REPLACE_FUNCS): Add strrchr and strtol.
+ * lib/strrchr.c: New.
+ * lib/strtol.c: New, from the Coreutils 4.5.1.
+
+2002-09-27 Akim Demaille <akim@epita.fr>
+
+ Playing with Autoscan.
+
+ * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
+ * lib/Makefile.am (libbison_a_SOURCES): No longer include
+ argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
+ * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
+ Coreutils 4.5.1.
+
+2002-09-24 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Stack Overflow): xref to Recursion.
+ (Frequently Asked Questions, Parser Stack Overflow): New.
+
+2002-09-13 Akim Demaille <akim@epita.fr>
+
+ Playing with autoscan.
+
+ * src/reader.c (get_merge_function): Use xstrdup, not strdup.
+ * src/files.c (skeleton_find): Remove, unused.
+ * m4/memcmp.m4: New, from the Coreutils 4.5.1.
+ * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
+
+2002-09-13 Akim Demaille <akim@epita.fr>
+
+ * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
+ * Makefile.am (AUTOMAKE_OPTIONS): Don't.
+
+2002-09-13 Akim Demaille <akim@epita.fr>
+
+ * configure.ac: Require 2.54.
+ s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
+ s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
+ * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
+ Remove, provided by Autoconf macros.
+
+2002-09-12 Akim Demaille <akim@epita.fr>
+
+ * m4/prereq.m4: Update, from Coreutils 4.5.1.
+
+2002-09-12 Akim Demaille <akim@epita.fr>
+
+ * m4/prereq.m4: Update, from Fileutils 4.1.5.
+ * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
+ Reported by Martin Mokrejs.
+
+2002-09-10 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y: Associate a human readable string to each
+ token type.
+ * tests/regression.at (Invalid inputs): Adjust.
+
+2002-09-10 Gary V. Vaughan <gary@gnu.org>
+
+ * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
+ with an Autoconf-2.5x style configure.ac.
+
+2002-09-06 Paul Eggert <eggert@twinsun.com>
+
+ * doc/bison.texinfo (Conditions): Make explicit that the GPL
+ exception applies only to yacc.c. This is a modification of a
+ patch originally suggested by Akim Demaille.
+
+2002-09-06 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_copyright): Move the GPL exception comment from
+ here to...
+ * data/yacc.c: here.
+
+ * data/lalr1.cc (struct yyltype): Don't define it, since we use
+ LocationType.
+ (b4_ltype): Default to yy::Location from location.hh.
+
+2002-09-04 Jim Meyering <jim@meyering.net>
+
+ * data/yacc.c: Guard the declaration of yytoknum also with
+ `#ifdef YYPRINT', so it is declared only when used.
+
+2002-09-04 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Rename as...
+ * configure.ac: this.
+ Bump to 1.49c.
+
+2002-09-04 Akim Demaille <akim@epita.fr>
+
+ * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
+ * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
+ translate maintainer only messages.
+
+2002-08-12 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.49b.
+
+ * Makefile.am (SUBDIRS): Remove intl.
+ (DISTCLEANFILES): Remove.
+ * NEWS: Mention that GNU M4 is now required. Clarify what is
+ meant by "larger grammars". Mention the pt_BR translation.
+ * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
+ (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
+ Bump version from 0.11.2 to 0.11.5.
+ (BISON_PREREQ_STAGE): Remove.
+ (AM_GNU_GETTEXT): Use external gettext.
+ (AC_OUTPUT): Remove intl/Makefile.
+
+ * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
+
+ * data/glr.c: Include string.h, for strlen.
+ (yyreportParseError): Use size_t for yysize.
+ (yy_yypstack): No longer nested inside yypstates, as nested
+ functions are not portable. Do not assume size_t is the
+ same width as int.
+ (yypstates): Do not assume that ptrdiff_t is the same width
+ as int, and similarly for yyposn and YYINDEX.
+
+ * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
+
+ * lib/Makefile.am (INCLUDES): Do not include from the intl
+ directory, which has been removed.
+ * src/Makefile.am (INCLUDES): Likewise.
+
+ * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
+ (bitsets_sources, additional_bitsets_sources, timevars_sources):
+ New vars.
+
+ * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
+ * tests/Makefile.am (EXTRA_DIST): Likewise.
+
+ * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
+ Do not assume that bitset_windex is the same width as unsigned.
+
+ * lib/abitset.c (abitset_unused_clear): Do not assume that
+ bitset_word is the same width as int.
+ * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
+ * lib/bitset.h (bitset_set, bitset_reset): Likewise.
+ * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
+ * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
+ * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
+
+ * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
+ portability to one's complement hosts!).
+ * lib/ebitset.c (ebitset_op1): Likewise.
+ * lib/lbitset.c (lbitset_op1): Likewise.
+
+ * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
+ * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
+ lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
+ Sync with fileutils.
+ * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
+ lib/gettext.h: Sync with diffutils.
+
+ * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
+ lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
+
+ * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
+ PROTOTYPES to check for prototypes, and "defined __STDC__" to
+ check for void *.
+
+ * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
+ size_t; the old version tried to do this but casted improperly.
+ (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
+ (bitset_test): Now returns int, not unsigned long.
+
+ * lib/bitset_stats.c: Include "gettext.h".
+ (_): New macro.
+ (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
+ name locals "index", as it generates unnecessary warnings on some
+ hosts that have an "index" function.
+
+ * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
+ bitset_stats_read, bitset_stats_write): Wrap strings in _() if
+ they need translation.
+ * src/LR0.c (state_list_append, new_itemsets, get_state,
+ append_states, generate_states): Likewise.
+ * src/assoc.c (assoc_to_string): Likewise.
+ * src/closure.c (print_closure, set_firsts, closure): Likewise.
+ * src/gram.c (grammar_dump): Likewise.
+ * src/injections.c (injections_compute): Likewise.
+ * src/lalr.c (lookaheads_print): Likewise.
+ * src/relation.c (relation_transpose): Likewise.
+ * src/scan-gram.l: Likewise.
+ * src/tables.c (table_grow, pack_vector): Likewise.
+
+ * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
+ glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
+ * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
+ * m4/mbstate_t.m4: Sync with fileutils.
+ * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
+
+ * po/LINGUAS: Add pt_BR.
+ * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
+ src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
+ lib/timevar.c.
+ Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
+ manual recommends.
+ Similarly, use src/scan-gram.l instead of src/scan-gram.c.
+
+ * src/complain.c (strerror_r): Remove decl; not needed.
+ (strerror): Use same pattern as ../lib/error.c.
+
+ * src/files.c, src/files.h (compute_header_macro): Remove; unused.
+
+ * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
+
+ * src/main.c (main): Cast result of bindtextdomain and textdomain
+ to void, to avoid a GCC warning when --disable-nls is in effect.
+
+ * src/scan-gram.l: Use strings rather than escapes when possible,
+ to minimize the number of warnings from xgettext.
+ (handle_action_dollar, handle_action_at): Don't use isdigit,
+ as it mishandles negative chars and it may not work as expected
+ outside the C locale.
+
+ * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
+ this is a GCC extension and is not portable to other compilers.
+
+ * src/system.h (alloca): Use same pattern as ../lib/error.c.
+ Do not include <ctype.h>; no longer needed.
+ Do not include <malloc.h>; no longer needed (and generates
+ warnings on OpenBSD 3.0).
+
+ * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
+ it's not portable.
+
+ * tests/regression.at: Do not use 'cc -c input.c -o input';
+ Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
+
+ * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
+ exit status as failure, not just exit status 1. Sun C exits
+ with status 2 sometimes.
+
+ * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
+ Use it for the two large tests.
+
+2002-08-02 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (conflicts_output): Don't output rules never
+ reduced here, since anyway that computation doesn't work.
+ * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
+ (rule_useless_p, rule_never_reduced_p): New.
+ (grammar_rules_partial_print): Use a filter instead of a range.
+ Display the title only if needed.
+ (grammar_rules_print): Adjust.
+ (grammar_rules_never_reduced_report): New.
+ * src/tables.c (action_row): Move the computation of rules never
+ reduced to...
+ (token_actions): here.
+ * src/main.c (main): Make the parser before making the report, so
+ that rules never reduced are computed.
+ Call grammar_rules_never_reduced_report.
+ * src/print.c (print_results): Report rules never reduced.
+ * tests/conflicts.at, tests/reduce.at: Adjust.
+
+2002-08-01 Akim Demaille <akim@epita.fr>
+
+ Instead of attaching lookaheads and duplicating the rules being
+ reduced by a state, attach the lookaheads to the reductions.
+
+ * src/state.h (state_t): Remove the `lookaheads',
+ `lookaheads_rule' member.
+ (reductions_t): Add a `lookaheads' member.
+ Use a regular array for the `rules'.
+ * src/state.c (reductions_new): Initialize the lookaheads member
+ to 0.
+ (state_rule_lookaheads_print): Adjust.
+ * src/state.h, src/state.c (state_reductions_find): New.
+ * src/conflicts.c (resolve_sr_conflict, set_conflicts)
+ (count_rr_conflicts): Adjust.
+ * src/lalr.c (LArule): Remove.
+ (add_lookback_edge): Adjust.
+ (state_lookaheads_count): New.
+ (states_lookaheads_initialize): Merge into...
+ (initialize_LA): this.
+ (lalr_free): Adjust.
+ * src/main.c (main): Don't free nullable and derives too early: it
+ is used by --verbose.
+ * src/print.c, src/print_graph.c, src/tables.c: Adjust.
+
+2002-08-01 Akim Demaille <akim@epita.fr>
+
+ * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
+ `rule_number_t**'.
+ (set_derives, free_derives): Rename as...
+ (derives_compute, derives_free): this.
+ Adjust all dependencies.
+ * src/nullable.c (set_nullable, free_nullable): Rename as...
+ (nullable_compute, nullable_free): these.
+ (rule_list_t): Store rule_t *, not rule_number_t.
+ * src/state.c (state_rule_lookaheads_print): Directly compare rule
+ pointers, instead of their numbers.
+ * src/main.c (main): Call nullable_free, and derives_free earlier,
+ as they were lo longer used.
+
+2002-08-01 Akim Demaille <akim@epita.fr>
+
+ * lib/timevar.c (get_time): Include children time.
+ * src/lalr.h (LA, LArule): Don't export them: used with the
+ state_t.
+ * src/lalr.c (LA, LArule): Static.
+ * src/lalr.h, src/lalr.c (lalr_free): New.
+ * src/main.c (main): Call it.
+ * src/tables.c (pack_vector): Check whether loc is >= to the
+ table_size, not >.
+ (pack_tables): Don't free froms, tos, conflict_tos, and pos...
+ (tables_generate): do it, since that's also it which allocates
+ them.
+ Don't free LA and LArule, main does.
+
+2002-07-31 Akim Demaille <akim@epita.fr>
+
+ Separate parser tables computation and output.
+
+ * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
+ (conflict_list, conflict_list_cnt, table, check, table_ninf)
+ (yydefgoto, yydefact, high): Move to...
+ * src/tables.h, src/tables.c: here.
+ * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
+ (VECTOR_NUMBER_MIN, state_number_to_vector_number)
+ (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
+ (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
+ (ACTION_MIN, actrow, order, nentries, pos, conflrow)
+ (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
+ (action_row, save_row, token_actions, save_column, default_goto)
+ (goto_actions, sort_actions, matching_state, pack_vector)
+ (table_ninf_remap, pack_table, prepare_actions): Move to...
+ * src/tables.c: here.
+ * src/tables.h, src/tables.c(tables_generate, tables_free): New.
+ * src/output.c (token_actions, output_base, output_conflicts)
+ (output_check): Merge into...
+ (prepare_actions): this.
+ (actions_output): Rename as...
+ (user_actions_output): this.
+ * src/main.c (main): Call tables_generate and tables_free.
+
+2002-07-31 Akim Demaille <akim@epita.fr>
+
+ Steal GCC's --time-report support.
+
+ * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
+ stolen/adjusted from GCC.
+ * m4/stage.m4: Remove time related checks.
+ * m4/timevar.m4: New.
+ * configure.in: Adjust.
+ * src/system.h: Adjust to using timevar.h.
+ * src/getargs.h, src/getargs.c: Support trace_time for
+ --trace=time.
+ * src/main.c (stage): Remove.
+ (main): Replace `stage' invocations with timevar calls.
+ * src/output.c: Insert pertinent timevar calls.
+
+2002-07-31 Akim Demaille <akim@epita.fr>
+
+ Let --trace have arguments.
+
+ * src/getargs.h (enum trace_e): New.
+ * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
+ (long_options, short_options): --trace/-T takes an optional
+ argument.
+ Change all the uses of trace_flag to reflect the new flags.
+ * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
+
+ Strengthen `stage' portability.
+
+ * m4/stage.m4 (BISON_PREREQ_STAGE): New.
+ * configure.in: Use it.
+ Don't check for malloc.h and sys/times.h.
+ * src/system.h: Include them when appropriate.
+ * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
+ times and struct tms are available.
+
+2002-07-30 Akim Demaille <akim@epita.fr>
+
+ In verbose parse error message, don't report `error' as an
+ expected token.
+ * tests/actions.at (Printers and Destructors): Adjust.
+ * tests/calc.at (Calculator $1): Adjust.
+ * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
+ error message, do not report the parser accepts the error token in
+ that state.
+
+2002-07-30 Akim Demaille <akim@epita.fr>
+
+ Normalize conflict related messages.
+
+ * src/complain.h, src/complain.c (warn, complain): New.
+ * src/conflicts.c (conflicts_print): Use them.
+ (conflict_report_yacc): New, extracted from...
+ (conflicts_print): here.
+ * tests/conflicts.at, tests/existing.at: Adjust.
+
+2002-07-30 Akim Demaille <akim@epita.fr>
+
+ Report rules which are never reduced by the parser: those hidden
+ by conflicts.
+
+ * src/LR0.c (save_reductions): Don't make the final state too
+ different: save its reduction (accept) instead of having a state
+ without any action (no shift or goto, no reduce).
+ Note: the final state is now a ``regular'' state, i.e., the
+ parsers now contain `reduce 0' as default reduction.
+ Nevertheless, since they decide to `accept' when yystate =
+ final_state, they still will not reduce rule 0.
+ * src/print.c (print_actions, print_reduction): Adjust.
+ * src/output.c (action_row): Track reduced rules.
+ (token_actions): Report rules never reduced.
+ * tests/conflicts.at, tests/regression.at: Adjust.
+
+2002-07-30 Akim Demaille <akim@epita.fr>
+
+ `stage' was accidently included in a previous patch.
+ Initiate its autoconfiscation.
+
+ * configure.in: Look for malloc.h and sys/times.h.
+ * src/main.c (stage): Adjust.
+ Report only when trace_flag.
+
+2002-07-29 Akim Demaille <akim@epita.fr>
+
+ * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
+ state_number_t.
+ (errs_t): symbol_t*, not symbol_number_t.
+ (reductions_t): rule_t*, not rule_number_t.
+ (FOR_EACH_SHIFT): New.
+ * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
+ * src/print.c, src/print_graph.c: Adjust.
+
+2002-07-29 Akim Demaille <akim@epita.fr>
+
+ Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
+
+ * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
+ (endtoken, accept): these.
+ * src/reader.c (reader): Set endtoken's default tag to "$end".
+ Set undeftoken's tag to "$undefined" instead of "$undefined.".
+ * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
+ Adjust.
+
+2002-07-29 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (reduce_grammar): When the language is empty,
+ complain about the start symbol, not the axiom.
+ Use its location.
+ * tests/reduce.at (Empty Language): New.
+
+2002-07-26 Akim Demaille <akim@epita.fr>
+
+ * src/reader.h, src/reader.c (gram_error): ... can't get
+ yycontrol without making too strong assumptions on the parser
+ itself.
+ * src/output.c (prepare_tokens): Use the real 0th value of
+ token_translations instead of `0'.
+ * src/parse-gram.y (yyerror): Don't rely on yycontrol being
+ visible here.
+ * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
+ for the time being: %locations ought to provide it to yyerror.
+
+2002-07-25 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
+ * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
+ * tests/regression.at (Web2c Actions): Adjust.
+
+2002-07-25 Akim Demaille <akim@epita.fr>
+
+ Stop storing rules from 1 to nrules + 1.
+
+ * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
+ * src/nullable.c, src/output.c, src/print.c, src/reader.c
+ * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
+ Iterate from 0 to nrules.
+ Use rule_number_as_item_number and item_number_as_rule_number.
+ Adjust to `derive' now containing possibly 0.
+ * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
+ Handle the `- 1' part in rule numbers from/to item numbers.
+ * src/conflicts.c (log_resolution): Fix the message which reversed
+ shift and reduce.
+ * src/output.c (action_row): Initialize default_rule to -1.
+ (token_actions): Adjust.
+ * tests/sets.at (Nullable, Firsts): Fix the previously bogus
+ expected output.
+ * tests/conflicts.at (Resolved SR Conflicts): Likewise.
+
+2002-07-25 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
+ (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
+ (b4_c_knr_arg_decl): New.
+ * data/yacc.c: Use it to define yysymprint, yydestruct, and
+ yyreport_parse_error.
+
+2002-07-25 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c (yyreport_parse_error): New, extracted from...
+ (yyparse): here.
+ (yydestruct, yysymprint): Move above yyparse.
+ Be K&R compliant.
+
+2002-07-25 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
+ replace...
+ (b4_sint_type, b4_uint_type): these.
+ * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
+ * tests/regression.at (Web2c Actions): Adjust.
+
+2002-07-25 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (TIEM_NUMBER_MAX): New.
+ (item_number_of_rule_number, rule_number_of_item_number): Rename
+ as...
+ (rule_number_as_item_number, item_number_as_rule_number): these.
+ Adjust dependencies.
+ * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
+ (VECTOR_NUMBER_MIN, state_number_to_vector_number)
+ (symbol_number_to_vector_number): New.
+ (order): Of vector_number_t* type.
+ (base_t, BASE_MAX, BASE_MIN): New.
+ (froms, tos, width, pos, check): Of base_t type.
+ (action_number_t, ACTION_MIN, ACTION_MAX): New.
+ (actrow): Of action_number_t type.
+ (conflrow): Of unsigned int type.
+ (table_ninf, base_ninf): New.
+ (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
+ (muscle_insert_int_table, muscle_insert_base_table)
+ (muscle_insert_rule_number_table): New.
+ (prepare_tokens): Output `toknum' as int_table.
+ (action_row): Returns a rule_number_t.
+ Use ACTION_MIN, not SHRT_MIN.
+ (token_actions): yydefact is rule_number_t*.
+ (table_ninf_remap): New.
+ (pack_table): Use it for `base' and `table'.
+ * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
+ replaced with...
+ (YYPACT_NINF, YYTABLE_NINF): these.
+ (yypact, yytable): Compute their types instead of hard-coded
+ `short'.
+ * tests/regression.at (Web2c Actions): Adjust.
+
+2002-07-19 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l (id): Can start with an underscore.
+
+2002-07-16 Akim Demaille <akim@epita.fr>
+
+ * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
+ Adjust all former `associativity' dependencies.
+ * src/symtab.c (symbol_new): Default associativity is `undef', not
+ `right'.
+ (symbol_check_alias_consistence): Adjust.
+
+2002-07-09 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Properly set the ``header'' part.
+ Use @dircategory ``GNU programming tools'' as per Texinfo's
+ documentation.
+ Use @copying.
+
+2002-07-09 Akim Demaille <akim@epita.fr>
+
+ * lib/quotearg.h: Protect against multiple inclusions.
+ * src/location.h (location_t): Add a `file' member.
+ (LOCATION_RESET, LOCATION_PRINT): Adjust.
+ * src/complain.c (warn_at, complain_at, fatal_at): Drop
+ `error_one_per_line' support.
+
+2002-07-09 Akim Demaille <akim@epita.fr>
+
+ * src/complain.h, src/complain.c (warn, complain): Remove, unused.
+ * src/reader.c (lineno): Remove.
+ Adjust all dependencies.
+ (get_merge_function): Take a location and use complain_at.
+ * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
+ * tests/regression.at (Invalid inputs, Mixing %token styles):
+ Adjust.
+
+2002-07-09 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y (rules_or_grammar_declaration): Add an error
+ recovery rule, and forbid extensions when --yacc.
+ (gram_error): Use complain_at.
+ * src/reader.c (reader): Exit if there were parse errors.
+
+2002-07-09 Akim Demaille <akim@epita.fr>
+
+ * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
+ (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
+ Reported by R Blake <blakers@mac.com>.
+
+2002-07-09 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c: Output the copyright notive in the header.
+
+2002-07-03 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (froms, tos): Are state_number_t.
+ (save_column): sp, sp1, and sp2 are state_number_t.
+ (prepare): Rename `final' as `final_state_number', `nnts' as
+ `nterms_number', `nrules' as `rules_number', `nstates' as
+ `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
+ unused.
+ * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
+ * data/lalr1.cc (nsym_): Remove, unused.
+
+2002-07-03 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h, src/lalr.c (goto_number_t): New.
+ * src/lalr.c (goto_list_t): New.
+ Propagate them.
+ * src/nullable.c (rule_list_t): New.
+ Propagate.
+ * src/types.h: Remove.
+
+2002-07-03 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (print_fderives): Use rule_rhs_print.
+ * src/derives.c (print_derives): Use rule_rhs_print.
+ (rule_list_t): New, replaces `shorts'.
+ (set_derives): Add comments.
+ * tests/sets.at (Nullable, Firsts): Adjust.
+
+2002-07-03 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (prepare_actions): Free `tally' and `width'.
+ (prepare_actions): Allocate and free `order'.
+ * src/symtab.c (symbols_free): Free `symbols'.
+ * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
+ * src/output.c (m4_invoke): Move to...
+ * src/scan-skel.l: here.
+ (<<EOF>>): Close yyout, and free its name.
+
+2002-07-03 Akim Demaille <akim@epita.fr>
+
+ Fix some memory leaks, and fix a bug: state 0 was examined twice.
+
+ * src/LR0.c (new_state): Merge into...
+ (state_list_append): this.
+ (new_states): Merge into...
+ (generate_states): here.
+ (set_states): Don't ensure a proper `errs' state member here, do it...
+ * src/conflicts.c (conflicts_solve): here.
+ * src/state.h, src/state.c: Comment changes.
+ (state_t): Rename member `shifts' as `transitions'.
+ Adjust all dependencies.
+ (errs_new): For consistency, also take the values as argument.
+ (errs_dup): Remove.
+ (state_errs_set): New.
+ (state_reductions_set, state_transitions_set): Assert that no
+ previous value was assigned.
+ (state_free): New.
+ (states_free): Use it.
+ * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
+ temporary storage: use `errs' and `nerrs' as elsewhere.
+ (set_conflicts): Allocate and free this `errs'.
+
+2002-07-02 Akim Demaille <akim@epita.fr>
+
+ * lib/libiberty.h: New.
+ * lib: Update the bitset implementation from upstream.
+ * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
+ * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
+ * src/main.c: Adjust bitset stats calls.
+
+2002-07-01 Paul Eggert <eggert@twinsun.com>
+
+ * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
+ char, so that negative chars don't collide with $.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ Have the GLR tests be `warning' checked, and fix the warnings.
+
+ * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
+ (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
+ (yyremoveDeletes): `yyi' and `yyj' are size_t.
+ Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
+ (yyaddDeferredAction): static.
+ (yyglrReduce): yyi, yyk, amd yyposn are size_t.
+ (yyreportParseError): yyprefix is const.
+ yytokenp is used only when verbose.
+ (yy__GNUC__): Replace with __GNUC__.
+ (yypdumpstack): yyi is size_t.
+ (yypreference): Un-yy local variables and arguments, to avoid
+ clashes with `yyr1'. Anyway, we are not in the user name space.
+ (yytname_size): be an int, as is compared with ints.
+ * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
+ Use them.
+ * tests/cxx-gram.at: Use quotation to protect $1.
+ Use AT_COMPILE to enable warnings hunts.
+ Prototype yylex and yyerror.
+ `Use' argc.
+ Include `string.h', not `strings.h'.
+ Produce and prototype stmtMerge only when used.
+ yylex takes a location.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ We spend a lot of time in quotearg, in particular when --verbose.
+
+ * src/symtab.c (symbol_get): Store a quoted version of the key.
+ (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
+ Adjust all callers.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (reductions_t): Rename member `nreds' as num.
+ (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
+ * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
+ (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
+ (shifts_to): Rename as...
+ (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
+ (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
+ (TRANSITION_IS_DISABLED, transitions_to): these.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/print.c (print_shifts, print_gotos): Merge into...
+ (print_transitions): this.
+ (print_transitions, print_errs, print_reductions): Align the
+ lookaheads columns.
+ (print_core, print_transitions, print_errs, print_state,
+ print_grammar): Output empty lines separator before, not after.
+ (state_default_rule_compute): Rename as...
+ (state_default_rule): this.
+ * tests/conflicts.at (Defaulted Conflicted Reduction),
+ (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
+ * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ Display items as we display rules.
+
+ * src/gram.h, src/gram.c (rule_lhs_print): New.
+ * src/gram.c (grammar_rules_partial_print): Use it.
+ * src/print.c (print_core): Likewise.
+ * tests/conflicts.at (Defaulted Conflicted Reduction),
+ (Unresolved SR Conflicts): Adjust.
+ (Unresolved SR Conflicts): Adjust and rename as...
+ (Resolved SR Conflicts): this, as was meant.
+ * tests/regression.at (Web2c Report): Adjust.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/print.c (state_default_rule_compute): New, extracted from...
+ (print_reductions): here.
+ Pessimize, but clarify the code.
+ * tests/conflicts.at (Defaulted Conflicted Reduction): New.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (action_row): Let default_rule be always a rule
+ number.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (print_firsts, print_fderives, closure):
+ Use BITSET_EXECUTE.
+ * src/lalr.c (lookaheads_print): Likewise.
+ * src/state.c (state_rule_lookaheads_print): Likewise.
+ * src/print_graph.c (print_core): Likewise.
+ * src/print.c (print_reductions): Likewise.
+ * src/output.c (action_row): Likewise.
+ Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/print_graph.c: Use report_flag.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
+ to...
+ * src/relation.h, src/relation.c (traverse, relation_digraph)
+ (relation_print, relation_transpose): New.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/state.h, src/state.c (shifts_to): New.
+ * src/lalr.c (build_relations): Use it.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
+ (item_number_of_rule_number, rule_number_of_item_number): New.
+ * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
+ * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
+ * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
+ Propagate their use.
+ Much remains to be done, in particular wrt `shorts' from types.h.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.c (symbol_new): Initialize the `printer' member.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (save_reductions): Remove, replaced by...
+ * src/state.h, src/state.c (state_reductions_set): New.
+ (reductions, errs): Rename as...
+ (reductions_t, errs_t): these.
+ Adjust all dependencies.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (state_list_t, state_list_append): New.
+ (first_state, last_state): Now symbol_list_t.
+ (this_state): Remove.
+ (new_itemsets, append_states, save_reductions): Take a state_t as
+ argument.
+ (set_states, generate_states): Adjust.
+ (save_shifts): Remove, replaced by...
+ * src/state.h, src/state.c (state_shifts_set): New.
+ (shifts): Rename as...
+ (shifts_t): this.
+ Adjust all dependencies.
+ * src/state.h (state_t): Remove the `next' member.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
+ escaped in slot 0.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ Use hash.h for the state hash table.
+
+ * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
+ (allocate_storage): Use state_hash_new.
+ (free_storage): Use state_hash_free.
+ (new_state, get_state): Adjust.
+ * src/lalr.h, src/lalr.c (states): Move to...
+ * src/states.h (state_t): Remove the `link' member, no longer
+ used.
+ * src/states.h, src/states.c: here.
+ (state_hash_new, state_hash_free, state_hash_lookup)
+ (state_hash_insert, states_free): New.
+ * src/states.c (state_table, state_compare, state_hash): New.
+ * src/output.c (output_actions): Do not free states now, since we
+ still need to know the final_state number in `prepare', called
+ afterwards. Do it...
+ * src/main.c (main): here: call states_free after `output'.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/state.h, src/state.c (state_new): New, extracted from...
+ * src/LR0.c (new_state): here.
+ * src/state.h (STATE_ALLOC): Move to...
+ * src/state.c: here.
+ * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
+ * src/state.h, src/state.c: here.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (gensym): Rename as...
+ * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
+ (getsym): Rename as...
+ (symbol_get): this.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
+ * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
+ * src/output.c, src/print.c, src/print_graph.c: Propagate.
+ * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
+
+2002-06-30 Akim Demaille <akim@epita.fr>
+
+ Make the test suite pass with warnings checked.
+
+ * tests/actions.at (Printers and Destructors): Improve.
+ Avoid unsigned vs. signed issues.
+ * tests/calc.at: Don't exercise the scanner here, do it...
+ * tests/input.at (Torturing the Scanner): here.
+
+2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * data/glr.c: Correct typo in Emacs-mode directive. Slightly
+ reorganize first lines parallel to yacc.c.
+
+2002-06-28 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
+ (b4_token_enum, b4_token_defines): New, factored from...
+ * data/lalr1.cc, data/yacc.c, glr.c: here.
+
+2002-06-28 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
+ unused variables.
+ * src/output.c (merger_output): static.
+
+2002-06-28 Akim Demaille <akim@epita.fr>
+
+ * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
+ * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
+ pacify GCC.
+ * src/output.c (save_row): Initialize all the variables to pacify GCC.
+
+2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ Accumulated changelog for new GLR parsing features.
+
+ * src/conflicts.c (count_total_conflicts): Change name to
+ conflicts_total_count.
+ * src/conflicts.h: Ditto.
+ * src/output.c (token_actions): Use the new name.
+ (output_conflicts): Change conflp => conflict_list_heads, and
+ confl => conflict_list for better readability.
+ * data/glr.c: Use the new names.
+ * NEWS: Add self to GLR announcement.
+
+ * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
+
+ * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
+ Akim Demaille.
+
+ * data/bison.glr: Change name to glr.c
+ * data/glr.c: Renamed from bison.glr.
+ * data/Makefile.am: Add glr.c
+
+ * src/getargs.c:
+
+ * src/symlist.h: Add dprec and merger fields to symbol_list_s.
+ * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
+
+ Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * data/bison.glr: Be sure to restore the
+ current #line when returning to the skeleton contents after having
+ exposed the input file's #line.
+
+ Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * data/bison.glr: Bring up to date with changes to bison.simple.
+
+ Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * data/bison.glr: Correct definitions that use b4_prefix.
+ Various reformatting.
+ (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
+ (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
+ yytokenp argument; now part of stack.
+ (yychar): Define to behave as documented.
+ (yyclearin): Ditto.
+
+ Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * src/reader.h: Add declaration for free_merger_functions.
+
+ * src/reader.c (merge_functions): New variable.
+ (get_merge_function): New function.
+ (free_merger_functions): New function.
+ (readgram): Check for %prec that is not followed by a symbol.
+ Handle %dprec and %merge declarations.
+ (packgram): Initialize dprec and merger fields in rules array.
+
+ * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
+ conflict_list_cnt, conflict_list_free): New variables.
+ (table_grow): Also grow conflict_table.
+ (prepare_rules): Output dprec and merger tables.
+ (conflict_row): New function.
+ (action_row): Output conflict lists for GLR parser. Don't use
+ default reduction in conflicted states for GLR parser so that there
+ are spaces for the conflict lists.
+ (save_row): Also save conflict information.
+ (token_actions): Allocate conflict list.
+ (merger_output): New function.
+ (pack_vector): Pack conflict table, too.
+ (output_conflicts): New function to output yyconflp and yyconfl.
+ (output_check): Allocate conflict_tos.
+ (output_actions): Output conflict tables, also.
+ (output_skeleton): Output b4_mergers definition.
+ (prepare): Output b4_max_rhs_length definition.
+ Use 'bison.glr' as default skeleton for GLR parsers.
+
+ * src/gram.c (glr_parser): New flag.
+ (grammar_free): Call free_merger_functions.
+
+ * src/conflicts.c (count_rr_conflicts): Augment to optionally count
+ all pairs of conflicting reductions, rather than just all tokens
+ causing conflicts. Needed to size conflict tables.
+ (conflicts_output): Modify call to count_rr_conflicts for new
+ interface.
+ (conflicts_print): Ditto.
+ (count_total_conflicts): New function.
+
+ * src/reader.h (merger_list): New type.
+ (merge_functions): New variable.
+
+ * src/lex.h (tok_dprec, tok_merge): New token types.
+
+ * src/gram.h (rule_s): Add dprec and merger fields.
+ (glr_parser): New flag.
+
+ * src/conflicts.h (count_total_conflicts): New function.
+
+ * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
+
+ * doc/bison.texinfo (Generalized LR Parsing): New section.
+ (GLR Parsers): New section.
+ (Language and Grammar): Mention GLR parsing.
+ (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
+ Correct typo ("tge" -> "the").
+
+ * data/bison.glr: New skeleton for GLR parsing.
+
+ * tests/cxx-gram.at: New tests for GLR parsing.
+
+ * tests/testsuite.at: Include cxx-gram.at.
+
+ * tests/Makefile.am: Add cxx-gram.at.
+
+ * src/parse-gram.y:
+
+ * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
+
+ * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
+
+2002-06-27 Akim Demaille <akim@epita.fr>
+
+ * src/options.h, src/options.c: Remove.
+ * src/getargs.c (short_options, long_options): New.
+
+2002-06-27 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple, data/bison.c++: Rename as...
+ * data/yacc.c, data/lalr1.cc: these.
+ * doc/bison.texinfo (Environment Variables): Remove.
+
+2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
+
+ * src/getargs.c (report_argmatch): Initialize strtok().
+
+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (b4_symbol_actions): New, replaces...
+ (b4_symbol_destructor, b4_symbol_printer): these.
+ (yysymprint): Be sure to call YYPRINT only for tokens, and using
+ user token numbers.
+
+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (yydestructor): Rename as...
+ (yydestruct): this.
+
+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h, src/symtab.c (symbol_type_set)
+ (symbol_destructor_set, symbol_precedence_set): The location is
+ the last argument.
+ Adjust all callers.
+
+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
+ internals.
+ * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
+ Takes a location.
+ * src/symtab.h, src/symtab.c (symbol_class_set)
+ (symbol_user_token_number_set): Likewise.
+ Adjust all callers.
+ Promote complain_at.
+ * tests/input.at (Type Clashes): Adjust.
+
+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (YYLEX): Fix the declaration when
+ %pure-parser.
+
+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (yysymprint): Don't print the token number,
+ just its name.
+ * tests/actions.at (Destructors): Rename as...
+ (Printers and Destructors): this.
+ Also exercise %printer.
+
+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (YYDSYMPRINT): New.
+ Use it to remove many of the #if YYDEBUG/if (yydebug).
+
+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h, src/symtab.c (symbol_t): printer and
+ printer_location are new members.
+ (symbol_printer_set): New.
+ * src/parse-gram.y (PERCENT_PRINTER): New token.
+ Handle its associated rule.
+ * src/scan-gram.l: Adjust.
+ (handle_destructor_at, handle_destructor_dollar): Rename as...
+ (handle_symbol_code_at, handle_symbol_code_dollar): these.
+ * src/output.c (symbol_printers_output): New.
+ (output_skeleton): Call it.
+ * data/bison.simple (yysymprint): New. Cannot be named yyprint
+ since there are already many grammar files with a user `yyprint'.
+ Replace the calls to YYPRINT to calls to yysymprint.
+ * tests/calc.at: Adjust.
+ * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
+ taking advantage of parser very internal details (stack size!).
+
+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l: Complete the scanner with the missing patterns
+ to pacify Flex.
+ Use `quote' and `symbol_tag_get' where appropriate.
+
+2002-06-19 Akim Demaille <akim@epita.fr>
+
+ * tests/actions.at (Destructors): Augment to test locations.
+ * data/bison.simple (yydestructor): Pass it the current location
+ if locations are enabled.
+ Prototype only when __STDC__ or C++.
+ Change the argument names to move into the yy name space: there is
+ user code here.
+
+2002-06-19 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (b4_pure_if): New.
+ Use it instead of #ifdef YYPURE.
+
+2002-06-19 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (b4_location_if): New.
+ Use it instead of #ifdef YYLSP_NEEDED.
+
+2002-06-19 Akim Demaille <akim@epita.fr>
+
+ Prepare @$ in %destructor, but currently don't bind it in the
+ skeleton, as %location use is not cleaned up yet.
+
+ * src/scan-gram.l (handle_dollar, handle_destructor_at)
+ (handle_action_at): New.
+ (handle_at, handle_action_dollar, handle_destructor_dollar): Take
+ a braced_code_t and a location as additional arguments.
+ (handle_destructor_dollar): Instead of requiring `b4_eval', just
+ unquote one when outputting `b4_dollar_dollar'.
+ Adjust callers.
+ * data/bison.simple (b4_eval): Remove.
+ (b4_symbol_destructor): Adjust.
+ * tests/input.at (Invalid @n): Adjust.
+
+2002-06-19 Zack Weinberg <zack@codesourcery.com>
+
+ * doc/bison.texinfo: Document ability to have multiple
+ prologue sections.
+
+2002-06-18 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (compute_base_names): When computing the output file
+ names from the input file name, strip the directory part.
+
+2002-06-18 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple.new: Comment changes.
+ Reported by Andreas Schwab.
+
+2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
+ there are no `label `yyoverflowlab' defined but not used' warnings
+ when yyoverflow is defined.
+
+2002-06-18 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
+ new member.
+ (symbol_destructor_set): Adjust.
+ * src/output.c (symbol_destructors_output): Output the destructor
+ locations.
+ Output the symbol name.
+ * data/bison.simple (b4_symbol_destructor): Adjust.
+
+2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
+ and Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
+ what's left on the stack when the error recovery hits EOF.
+ * tests/actions.at (Destructors): Complete to exercise this case.
+
+2002-06-17 Akim Demaille <akim@epita.fr>
+
+ * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
+ arguments is really empty, not only equal to `[]'.
+ * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
+ member.
+ (symbol_destructor_set): New.
+ * src/output.c (symbol_destructors_output): New.
+ * src/reader.h (brace_code_t, current_braced_code): New.
+ * src/scan-gram.l (BRACED_CODE): Use it to branch on...
+ (handle_dollar): Rename as...
+ (handle_action_dollar): this.
+ (handle_destructor_dollar): New.
+ * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
+ (grammar_declaration): Use it.
+ * data/bison.simple (yystos): Is always defined.
+ (yydestructor): New.
+ * tests/actions.at (Destructors): New.
+ * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
+
+2002-06-17 Akim Demaille <akim@epita.fr>
+
+ * src/symlist.h, src/symlist.c (symbol_list_length): New.
+ * src/scan-gram.l (handle_dollar, handle_at): Compute the
+ rule_length only when needed.
+ * src/output.c (actions_output, token_definitions_output): Output
+ the full M4 block.
+ * src/symtab.c: Don't access directly to the symbol tag, use
+ symbol_tag_get.
+ * src/parse-gram.y: Use symbol_list_free.
+
+2002-06-17 Akim Demaille <akim@epita.fr>
+
+ * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
+ (symbol_list_prepend, get_type_name): Move to...
+ * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
+ (symbol_list_prepend, symbol_list_n_type_name_get): here.
+ Adjust all callers.
+ (symbol_list_free): New.
+ * src/scan-gram.l (handle_dollar): Takes a location.
+ * tests/input.at (Invalid $n): Adjust.
+
+2002-06-17 Akim Demaille <akim@epita.fr>
+
+ * src/reader.h, src/reader.c (symbol_list_new): Export it.
+ (symbol_list_prepend): New.
+ * src/parse-gram.y (%union): `list' is a new member.
+ (symbols.1): New, replaces...
+ (terms_to_prec.1, nterms_to_type.1): these.
+ * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
+ Take a location as additional argument.
+ Adjust all callers.
+
+2002-06-15 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y: Move %token in the declaration section so that
+ we don't depend upon CVS Bison.
+
+2002-06-15 Akim Demaille <akim@epita.fr>
+
+ * src/state.h, src/state.c (state_rule_lookaheads_print): New.
+ * src/print.c (print_core): Use it.
+
+2002-06-15 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (log_resolution): Accept the rule involved in
+ the sr conflicts instead of the lookahead number that points to
+ that rule.
+ (flush_reduce): Accept the current lookahead vector as argument,
+ instead of the index in LA.
+ (resolve_sr_conflict): Accept the current number of lookahead
+ bitset to consider for the STATE, instead of the index in LA.
+ (set_conflicts): Adjust.
+ * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
+
+2002-06-15 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (state_t): Replace the `lookaheadsp' member, a
+ short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
+ Adjust all dependencies.
+ * src/lalr.c (initialize_lookaheads): Split into...
+ (states_lookaheads_count, states_lookaheads_initialize): these.
+ (lalr): Adjust.
+
+2002-06-15 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
+ out of...
+ (grammar_rules_print): here.
+ * src/reduce.c (reduce_output): Use it.
+ * tests/reduce.at (Useless Rules, Reduced Automaton)
+ (Underivable Rules): Adjust.
+
+2002-06-15 Akim Demaille <akim@epita.fr>
+
+ Copy BYacc's nice way to report the grammar.
+
+ * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
+ New.
+ Don't print the rules' location, it is confusing and useless.
+ (rule_print): Use grammar_rhs_print.
+ * src/print.c (print_grammar): Use grammar_rules_print.
+
+2002-06-15 Akim Demaille <akim@epita.fr>
+
+ Complete and rationalize `useless thing' warnings.
+
+ * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
+ (symbol_tag_print): New.
+ Use them everywhere in place of accessing directly the tag member.
+ * src/gram.h, src/gram.c (rule_print): New.
+ Use it where a rule used to be printed `by hand'.
+ * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
+ (reduce_grammar_tables): Report the useless rules.
+ (reduce_print): Useless things are a warning, not an error.
+ Report it as such.
+ * tests/reduce.at (Useless Nonterminals, Useless Rules):
+ (Reduced Automaton, Underivable Rules): Adjust.
+ * tests/regression.at (Web2c Report, Web2c Report): Adjust.
+ * tests/conflicts.at (Unresolved SR Conflicts)
+ (Solved SR Conflicts): Adjust.
+
+2002-06-15 Akim Demaille <akim@epita.fr>
+
+ Let symbols have a location.
+
+ * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
+ (getsym): Adjust.
+ Adjust all callers.
+ * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
+ Use location_t, not int.
+ * src/symtab.c (symbol_check_defined): Take advantage of the
+ location.
+ * tests/regression.at (Invalid inputs): Adjust.
+
+2002-06-15 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
+ (input): Don't try to initialize yylloc here, do it in the
+ scanner.
+ * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
+ * src/gram.h (rule_t): Change line and action_line into location
+ and action_location, of location_t type.
+ Adjust all dependencies.
+ * src/location.h, src/location.c (empty_location): New.
+ * src/reader.h, src/reader.c (grammar_start_symbol_set)
+ (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
+ (grammar_current_rule_symbol_append)
+ (grammar_current_rule_action_append): Expect a location as argument.
+ * src/reader.c (grammar_midrule_action): Adjust to attach an
+ action's location as dummy symbol location.
+ * src/symtab.h, src/symtab.c (startsymbol_location): New.
+ * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
+ the line numbers.
+
+2002-06-14 Akim Demaille <akim@epita.fr>
+
+ Grammar declarations may be found in the grammar section.
+
+ * src/parse-gram.y (rules_or_grammar_declaration): New.
+ (declarations): Each declaration may end with a semicolon, not
+ just...
+ (grammar_declaration): `"%union"'.
+ (grammar): Branch to rules_or_grammar_declaration.
+
+2002-06-14 Akim Demaille <akim@epita.fr>
+
+ * src/main.c (main): Invoke scanner_free.
+
+2002-06-14 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (m4_invoke): Extracted from...
+ (output_skeleton): here.
+ Free tempfile.
+
+2002-06-14 Akim Demaille <akim@epita.fr>
+
+ * src/parse-gram.y (directives, directive, gram)
+ (grammar_directives, precedence_directives, precedence_directive):
+ Rename as...
+ (declarations, declaration, grammar, grammar_declaration)
+ (precedence_declaration, precedence_declarator): these.
+ (symbol_declaration): New.
+
+2002-06-14 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (action_obstack): Remove, unused.
+ (output_obstack): Remove it, and all its dependencies, as it is no
+ longer needed.
+ * src/reader.c (epilogue_set): Build the epilogue in the
+ muscle_obstack.
+ * src/output.h, src/output.c (muscle_obstack): Move to...
+ * src/muscle_tab.h, src/muscle_tab.h: here.
+ (muscle_init): Initialize muscle_obstack.
+ (muscle_free): New.
+ * src/main.c (main): Call it.
+
+2002-06-14 Akim Demaille <akim@epita.fr>
+
+ * src/location.h: New, extracted from...
+ * src/reader.h: here.
+ * src/Makefile.am (noinst_HEADERS): Merge into
+ (bison_SOURCES): this.
+ Add location.h.
+ * src/parse-gram.y: Use location_t instead of Bison's.
+ * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
+ Use location_t instead of ints.
+
+2002-06-14 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple, data/bison.c++: Be sure to restore the
+ current #line when returning to the skeleton contents after having
+ exposed the input file's #line.
+
+2002-06-12 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
+ eager.
+ * tests/actions.at (Exotic Dollars): New.
+
+2002-06-12 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
+ ['"/] too eagerly.
+ * tests/input.at (Torturing the Scanner): New.
+
+2002-06-11 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
+ [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
+ [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
+ * src/reader.h, src/scan-gram.l (scanner_initialize): this.
+ * src/reader.c (reader): Use it.
+
+2002-06-11 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
+ Adjust all callers.
+ (scanner_last_string_free): New.
+
+2002-06-11 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
+ (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
+ (last_string, YY_OBS_FREE): New.
+ Use them when returning an ID.
+
+2002-06-11 Akim Demaille <akim@epita.fr>
+
+ Have Bison grammars parsed by a Bison grammar.
+
+ * src/reader.c, src/reader.h (prologue_augment): New.
+ * src/reader.c (copy_definition): Remove.
+
+ * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
+ (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
+ (grammar_current_rule_prec_set, grammar_current_rule_check)
+ (grammar_current_rule_symbol_append)
+ (grammar_current_rule_action_append): Export.
+ * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
+ (symbol_list_action_append): Remove.
+ Hook the routines from reader.
+ * src/scan-gram.l: In INITIAL, characters and strings are tokens.
+ * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
+
+ * src/reader.c (read_declarations): Remove, unused.
+
+ * src/parse-gram.y: Handle the epilogue.
+ * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
+ (grammar_start_symbol_set): this.
+ * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
+ * src/reader.c (readgram): Remove, unused.
+ (reader): Adjust to insert eoftoken and axiom where appropriate.
+
+ * src/reader.c (copy_dollar): Replace with...
+ * src/scan-gram.h (handle_dollar): this.
+ * src/parse-gram.y: Remove `%thong'.
+
+ * src/reader.c (copy_at): Replace with...
+ * src/scan-gram.h (handle_at): this.
+
+ * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
+ New.
+
+ * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
+ time being.
+
+ * src/reader.h, src/reader.c (grammar_rule_end): New.
+
+ * src/parse.y (current_type, current_class): New.
+ Implement `%nterm', `%token' support.
+ Merge `%term' into `%token'.
+ (string_as_id): New.
+ * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
+ type name.
+
+ * src/parse-gram.y: Be sure to handle properly the beginning of
+ rules.
+
+ * src/parse-gram.y: Handle %type.
+ * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
+
+ * src/parse-gram.y: More directives support.
+ * src/options.c: No longer handle source directives.
+
+ * src/parse-gram.y: Fix %output.
+
+ * src/parse-gram.y: Handle %union.
+ Use the prologue locations.
+ * src/reader.c (parse_union_decl): Remove.
+
+ * src/reader.h, src/reader.c (epilogue_set): New.
+ * src/parse-gram.y: Use it.
+
+ * data/bison.simple, data/bison.c++: b4_stype is now either not
+ defined, then default to int, or to the contents of %union,
+ without `union' itself.
+ Adjust.
+ * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
+
+ * src/output.c (actions_output): Don't output braces, as they are
+ already handled by the scanner.
+
+ * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
+ characters to themselves.
+
+ * tests/reduce.at (Reduced Automaton): End the grammars with %% so
+ that the epilogue has a proper #line.
+
+ * src/parse-gram.y: Handle precedence/associativity.
+
+ * src/symtab.c (symbol_precedence_set): Requires the symbol to be
+ a terminal.
+ * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
+ * tests/calc.at: Do not use `%token "foo"' as it makes not sense
+ at all to define terminals that cannot be emitted.
+
+ * src/scan-gram.l: Escape M4 characters.
+
+ * src/scan-gram.l: Working properly with escapes in user
+ strings/characters.
+
+ * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
+ (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
+ grammar.
+ Use more modest sizes, as for the time being the parser does not
+ release memory, and therefore the process swallows a huge amount
+ of memory.
+
+ * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
+ stricter %token grammar.
+
+ * src/symtab.h (associativity): Add `undef_assoc'.
+ (symbol_precedence_set): Do nothing when passed an undef_assoc.
+ * src/symtab.c (symbol_check_alias_consistence): Adjust.
+
+ * tests/regression.at (Invalid %directive): Remove, as it is now
+ meaningless.
+ (Invalid inputs): Adjust to the new error messages.
+ (Token definitions): The new grammar doesn't allow too many
+ eccentricities.
+
+ * src/lex.h, src/lex.c: Remove.
+ * src/reader.c (lastprec, skip_to_char, read_signed_integer)
+ (copy_character, copy_string2, copy_string, copy_identifier)
+ (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
+ (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
+ (parse_action): Remove.
+ * po/POTFILES.in: Adjust.
+
+2002-06-11 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (parse_action): Don't store directly into the
+ rule's action member: return the action as a string.
+ Don't require `rule_length' as an argument: compute it.
+ (grammar_current_rule_symbol_append)
+ (grammar_current_rule_action_append): New, eved out from
+ (readgram): here.
+ Remove `action_flag', `rulelength', unused now.
+
+2002-06-11 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (grammar_current_rule_prec_set).
+ (grammar_current_rule_check): New, eved out from...
+ (readgram): here.
+ Remove `xaction', `first_rhs': useless.
+ * tests/input.at (Type clashes): New.
+ * tests/existing.at (GNU Cim Grammar): Adjust.
+
+2002-06-11 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (grammar_midrule_action): New, Eved out from
+ (readgram): here.
+
+2002-06-11 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
+ New.
+ (readgram): Use them as replacement of inlined code, crule and
+ crule1.
+
+2002-06-11 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (grammar_end, grammar_symbol_append): New.
+ (readgram): Use them.
+ Make the use of `p' as local as possible.
+
+2002-06-10 Akim Demaille <akim@epita.fr>
+
+ GCJ's parser requires the tokens to be defined before the prologue.
+
+ * data/bison.simple: Output the token definition before the user's
+ prologue.
+ * tests/regression.at (Braces parsing, Duplicate string)
+ (Mixing %token styles): Check the output from bison.
+ (Early token definitions): New.
+
+2002-06-10 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.c (symbol_user_token_number_set): Don't complain when
+ assigning twice the same user number to a token, so that we can
+ use it in...
+ * src/lex.c (lex): here.
+ Also use `symbol_class_set' instead of hand written code.
+ * src/reader.c (parse_assoc_decl): Likewise.
+
+2002-06-10 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.c, src/symtab.c (symbol_class_set)
+ (symbol_user_token_number_set): New.
+ * src/reader.c (parse_token_decl): Use them.
+ Use a switch instead of ifs.
+ Use a single argument.
+
+2002-06-10 Akim Demaille <akim@epita.fr>
+
+ Remove `%thong' support as it is undocumented, unused, duplicates
+ `%token's job, and creates useless e-mail traffic with people who
+ want to know what it is, why it is undocumented, unused, and
+ duplicates `%token's job.
+
+ * src/reader.c (parse_thong_decl): Remove.
+ * src/options.c (option_table): Remove "thong".
+ * src/lex.h (tok_thong): Remove.
+
+2002-06-10 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.c, src/symtab.c (symbol_type_set)
+ (symbol_precedence_set): New.
+ * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
+ (value_components_used): Remove, unused.
+
+2002-06-09 Akim Demaille <akim@epita.fr>
+
+ Move symbols handling code out of the reader.
+
+ * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
+ (axiom): Move to...
+ * src/symtab.h, src/symtab.c: here.
+
+ * src/gram.c (start_symbol): Remove: use startsymbol->number.
+ * src/reader.c (startval): Rename as...
+ * src/symtab.h, src/symtab.c (startsymbol): this.
+ * src/reader.c: Adjust.
+
+ * src/reader.c (symbol_check_defined, symbol_make_alias)
+ (symbol_check_alias_consistence, symbol_pack, symbol_translation)
+ (token_translations_init)
+ Move to...
+ * src/symtab.c: here.
+ * src/reader.c (packsymbols): Move to...
+ * src/symtab.h, src/symtab.c (symbols_pack): here.
+ * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
+ argument.
+
+2002-06-03 Akim Demaille <akim@epita.fr>
+
+ * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
+ then statements.
+
+2002-06-03 Akim Demaille <akim@epita.fr>
+
+ * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
+ structs with non literals.
+ * src/scan-skel.l: never-interactive.
+ * src/conflicts.c (enum conflict_resolution_e): No trailing
+ comma.
+ * src/getargs.c (usage): Split long literal strings.
+ Reported by Hans Aberg.
+
+2002-05-28 Akim Demaille <akim@epita.fr>
+
+ * data/bison.c++: Use C++ ostreams.
+ (cdebug_): New member.
+
+2002-05-28 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_skeleton): Be sure to allocate enough room
+ for `/' _and_ for `\0' in full_skeleton.
+
+2002-05-28 Akim Demaille <akim@epita.fr>
+
+ * data/bison.c++: Catch up with bison.simple:
+ 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+ and Paul Eggert <eggert@twinsun.com>: `error' handing.
+ 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
+ and popping traces.
+
+2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * src/output.c (output_skeleton): Put an explicit path in front of
+ the skeleton file name, rather than relying on the -I directory,
+ to partially alleviate effects of having a skeleton file lying around
+ in the current directory.
+
+2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * src/conflicts.c (log_resolution): Correct typo:
+ obstack_printf should be obstack_fgrow1.
+
+2002-05-26 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (state_t): `solved_conflicts' is a new member.
+ * src/LR0.c (new_state): Set it to 0.
+ * src/conflicts.h, src/conflicts.c (print_conflicts)
+ (free_conflicts, solve_conflicts): Rename as...
+ (conflicts_print, conflicts_free, conflicts_solve): these.
+ Adjust callers.
+ * src/conflicts.c (enum conflict_resolution_e)
+ (solved_conflicts_obstack): New, used by...
+ (log_resolution): this.
+ Adjust to attach the conflict resolution to each state.
+ Complete the description with the precedence/associativity
+ information.
+ (resolve_sr_conflict): Adjust.
+ * src/print.c (print_state): Output its solved_conflicts.
+ * tests/conflicts.at (Unresolved SR Conflicts)
+ (Solved SR Conflicts): Exercise --report=all.
+
+2002-05-26 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
+ * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
+ * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
+ (token_number_t, item_number_as_token_number)
+ (token_number_as_item_number, muscle_insert_token_number_table):
+ Rename as...
+ (symbol_number_t, item_number_as_symbol_number)
+ (symbol_number_as_item_number, muscle_insert_symbol_number_table):
+ these, since it is more appropriate.
+
+2002-05-26 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
+ `Error:' lines.
+ * data/bison.simple (yystos) [YYDEBUG]: New.
+ (yyparse) [YYDEBUG]: Display the symbols which are popped during
+ error recovery.
+ * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
+
+2002-05-25 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Debugging): Split into...
+ (Tracing): this new section, its former contents, and...
+ (Understanding): this new section.
+ * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
+ by...
+ (report_flag): this.
+ Adjust all dependencies.
+ (report_args, report_types, report_argmatch): New.
+ (usage, getargs): Report/support -r, --report.
+ * src/options.h
+ (struct option_table_struct): Rename as..,
+ (struct option_table_s): this.
+ Rename the `set_flag' member to `flag' to match with getopt_long's
+ struct.
+ * src/options.c (option_table): Split verbose into an entry for
+ %verbose, and another for --verbose.
+ Support --report/-r, so remove -r from the obsolete --raw.
+ * src/print.c: Attach full item sets and lookaheads reports to
+ report_flag instead of trace_flag.
+ * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
+
+2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+ and Paul Eggert <eggert@twinsun.com>
+
+ * data/bison.simple (yyparse): Correct error handling to conform to
+ POSIX and yacc. Specifically, after syntax error is discovered,
+ do not reduce further before shifting the error token.
+ Clean up the code a bit by removing the labels yyerrdefault,
+ yyerrhandle, yyerrpop.
+ * NEWS: Document the above.
+
+2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * data/bison.simple (yyr1): Don't use yy_token_number_type as element
+ type; it isn't always big enough, since it doesn't necessarily
+ include non-terminals.
+ (yytranslate): Expand definition of yy_token_number_type, so that
+ the latter can be removed.
+ (yy_token_number_type): Remove, only one use.
+ * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
+ don't use TokenNumberType as element type.
+
+ * tests/regression.at: Modify expected output to agree with change
+ to yyr1 and yytranslate.
+
+2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
+
+ * src/reader.c (parse_action): Use copy_character instead of
+ obstack_1grow.
+
+2002-05-13 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Token definitions): Prototype yylex and
+ yyerror.
+
+2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
+
+ * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
+ * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
+ 32-bit arithmetic.
+ * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
+
+2002-05-07 Akim Demaille <akim@epita.fr>
+
+ * tests/synclines.at: Be sure to prototype yylex and yyerror to
+ avoid GCC warnings.
+
+2002-05-07 Akim Demaille <akim@epita.fr>
+
+ Kill GCC warnings.
+
+ * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
+ over the RHS of each rule.
+ * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
+ * src/state.h (state_t): Member `nitems' is unsigned short.
+ * src/LR0.c (get_state): Adjust.
+ * src/reader.c (packgram): Likewise.
+ * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
+ `Type'.
+ (muscle_insert_int_table): Remove, unused.
+ (prepare_rules): Remove `max'.
+
+2002-05-06 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (print_firsts): Display of the symbol tags.
+ (bitmatrix_print): Move to...
+ * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
+ here.
+ * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
+
+2002-05-06 Akim Demaille <akim@epita.fr>
+
+ * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
+ hash_do_for_each.
+
+2002-05-06 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (new_state, get_state): Instead of using the global
+ `kernel_size' and `kernel_base', have two new arguments:
+ `core_size' and `core'.
+ Adjust callers.
+
+2002-05-06 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (packgram): No longer end `ritem' with a 0
+ sentinel: it is not used.
+
+2002-05-05 Akim Demaille <akim@epita.fr>
+
+ New experimental feature: display the lookaheads in the report and
+ graph.
+
+ * src/print (print_core): When --trace-flag, display the rules
+ lookaheads.
+ * src/print_graph.c (print_core): Likewise.
+ Swap the arguments.
+ Adjust caller.
+
+2002-05-05 Akim Demaille <akim@epita.fr>
+
+ * tests/torture.at (Many lookaheads): New test.
+
+2002-05-05 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
+ (GENERATE_MUSCLE_INSERT_TABLE): this.
+ (output_int_table, output_unsigned_int_table, output_short_table)
+ (output_token_number_table, output_item_number_table): Replace with...
+ (muscle_insert_int_table, muscle_insert_unsigned_int_table)
+ (muscle_insert_short_table, muscle_insert_token_number_table)
+ (muscle_insert_item_number_table): these.
+ Adjust all callers.
+ (prepare_tokens): Don't free `translations', since...
+ * src/reader.h, src/reader.c (grammar_free): do it.
+ Move to...
+ * src/gram.h, src/gram.c (grammar_free): here.
+ * data/bison.simple, data/bison.c++: b4_token_number_max is now
+ b4_translate_max.
+
+2002-05-05 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_unsigned_int_table): New.
+ (prepare_rules): `i' is unsigned.
+ `prhs', `rline', `r2' are unsigned int.
+ Rename muscle `rhs_number_max' as `rhs_max'.
+ Output muscles `prhs_max', `rline_max', and `r2_max'.
+ Free rline and r1.
+ * data/bison.simple, data/bison.c++: Adjust to use these muscles
+ to compute types instead of constant types.
+ * tests/regression.at (Web2c Actions): Adjust.
+
+2002-05-04 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h (SALIAS, SUNDEF): Rename as...
+ (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
+ Adjust dependencies.
+ * src/output.c (token_definitions_output): Be sure not to output a
+ `#define 'a'' when fed with `%token 'a' "a"'.
+ * tests/regression.at (Token definitions): New.
+
+2002-05-03 Paul Eggert <eggert@twinsun.com>
+
+ * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
+ for K&R C.
+
+2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.am (SUBDIRS): Remove intl.
+ (EXTRA_DIST): Add config/config.rpath.
+
+2002-05-03 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (m4_if): Don't output empty enums.
+ And actually, output valid enum definitions :(.
+
+2002-05-03 Akim Demaille <akim@epita.fr>
+
+ * configure.bat: Remove, completely obsolete.
+ * Makefile.am (EXTRA_DIST): Adjust.
+ Don't distribute config.rpath...
+ * config/Makefile.am (EXTRA_DIST): Do it.
+
+2002-05-03 Akim Demaille <akim@epita.fr>
+
+ * configure.in (GETTEXT_VERSION): New.
+ Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
+
+2002-05-03 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (b4_token_enum): New.
+ (b4_token_defines): Use it to output tokens both as #define and
+ enums.
+ Suggested by Paul Eggert.
+ * src/output.c (token_definitions_output): Don't output spurious
+ white spaces.
+
+2002-05-03 Akim Demaille <akim@epita.fr>
+
+ * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
+
+2002-05-02 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
+ Update the stack class, give a try to deque as the default container.
+
+2002-05-02 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (yyparse): Do not implement @$ = @1.
+ (YYLLOC_DEFAULT): Adjust to do it.
+ * doc/bison.texinfo (Location Default Action): Fix.
+
+2002-05-02 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (parse_braces): Merge into...
+ (parse_action): this.
+
+2002-05-02 Akim Demaille <akim@epita.fr>
+
+ * configure.in (ALL_LINGUAS): Remove.
+ * po/LINGUAS, hr.po: New.
+
+2002-05-02 Akim Demaille <akim@epita.fr>
+
+ Remove the so called hairy (semantic) parsers.
+
+ * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
+ * src/gram.h, src/gram.c (semantic_parser): Remove.
+ (rule_t): Remove the guard and guard_line members.
+ * src/lex.h (token_t): remove tok_guard.
+ * src/options.c (option_table): Remove %guard and %semantic_parser
+ support.
+ * src/output.c, src/output.h (guards_output): Remove.
+ (prepare): Adjust.
+ (token_definitions_output): Don't output the `T'
+ tokens (???).
+ (output_skeleton): Don't output the guards.
+ * src/files.c, src/files.c (attrsfile): Remove.
+ * src/reader.c (symbol_list): Remove the guard and guard_line
+ members.
+ Adjust dependencies.
+ (parse_guard): Remove.
+ * data/bison.hairy: Remove.
+ * doc/bison.texinfo (Environment Variables): Remove occurrences of
+ BISON_HAIRY.
+
+2002-05-02 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
+ (parse_guard): Rename the formal argument `stack_offset' as
+ `rule_length', which is more readable.
+ Adjust callers.
+ (copy_at, copy_dollar): Instead of outputting the hard coded
+ values of $$, $n and so forth, output invocation to b4_lhs_value,
+ b4_lhs_location, b4_rhs_value, and b4_rhs_location.
+ Note: this patch partially drops `semantic-parser' support: it
+ always does `rule_length - n', where semantic parsers ought to
+ always use `-n'.
+ * data/bison.simple, data/bison.c++ (b4_lhs_value)
+ (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
+
+2002-05-02 Akim Demaille <akim@epita.fr>
+
+ * configure.in (AC_INIT): Bump to 1.49b.
+ (AM_INIT_AUTOMAKE): Short invocation.
+
+2002-05-02 Akim Demaille <akim@epita.fr>
+
+ Version 1.49a.
+
+2002-05-01 Akim Demaille <akim@epita.fr>
+
+ * src/skeleton.h: Remove.
+
+2002-05-01 Akim Demaille <akim@epita.fr>
+
+ * src/skeleton.h: Fix the #endif.
+ Reported by Magnus Fromreide.
+
+2002-04-26 Paul Eggert <eggert@twinsun.com>
+
+ * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
+ Define if we define YYSTYPE and YYLTYPE, respectively.
+ (YYCOPY): Fix [] quoting problem in the non-GCC case.
+
+2002-04-25 Robert Anisko <robert@lrde.epita.fr>
+
+ * src/scan-skel.l: Postprocess quadrigraphs.
+
+ * src/reader.c (copy_character): New function, used to output
+ single characters while replacing `[' and `]' with quadrigraphs, to
+ avoid troubles with M4 quotes.
+ (copy_comment): Output characters with copy_character.
+ (read_additionnal_code): Likewise.
+ (copy_string2): Likewise.
+ (copy_definition): Likewise.
+
+ * tests/calc.at: Exercise M4 quoting.
+
+2002-04-25 Akim Demaille <akim@epita.fr>
+
+ * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
+ between `!' and the command.
+ Reported by Paul Eggert.
+
+2002-04-24 Robert Anisko <robert@lrde.epita.fr>
+
+ * tests/calc.at: Exercise prologue splitting.
+
+ * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
+ `b4_post_prologue' instead of `b4_prologue'.
+
+ * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
+ muscles.
+ (output): Free pre_prologue_obstack and post_prologue_obstack.
+ * src/files.h, src/files.c (attrs_obstack): Remove.
+ (pre_prologue_obstack, post_prologue_obstack): New.
+ * src/reader.c (copy_definition): Add a parameter to specify the
+ obstack to fill, instead of using attrs_obstack unconditionally.
+ (read_declarations): Pass pre_prologue_obstack to copy_definition if
+ `%union' has not yet been seen, pass post_prologue_obstack otherwise.
+
+2002-04-23 Paul Eggert <eggert@twinsun.com>
+
+ * data/bison.simple: Remove unnecessary commentary and white
+ space differences from 1_29-branch.
+ Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
+
+ (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
+ YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
+ if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
+ constructors or destructors.
+
+ (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
+
+2002-04-23 Akim Demaille <akim@epita.fr>
+
+ * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
+ * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
+ location with columns.
+ * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
+ All reported by Paul Eggert.
+
+2002-04-22 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (dump_grammar): Move to...
+ * src/gram.h, src/gram.c (grammar_dump): here.
+ Be sure to separate long item numbers.
+ Don't read the members of a rule's prec if its nil.
+
+2002-04-22 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (table_size, table_grow): New.
+ (MAXTABLE): Remove, replace uses with table_size.
+ (pack_vector): Instead of dying when the table is too big, grow it.
+
+2002-04-22 Akim Demaille <akim@epita.fr>
+
+ * data/bison.simple (yyr1): Its type is that of a token number.
+ * data/bison.c++ (r1_): Likewise.
+ * tests/regression.at (Web2c Actions): Adjust.
+
+2002-04-22 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (token_translations_init): 256 is now the default
+ value for the error token, i.e., it will be assigned another
+ number if the user assigned 256 to one of her tokens.
+ (reader): Don't force 256 to error.
+ * doc/bison.texinfo (Symbols): Adjust.
+ * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
+ (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
+ etc. instead of 10, 20, 30 (which was used to `jump' over error
+ (256) and undefined (2)).
+
+2002-04-22 Akim Demaille <akim@epita.fr>
+
+ Propagate more token_number_t.
+
+ * src/gram.h (token_number_as_item_number)
+ (item_number_as_token_number): New.
+ * src/output.c (GENERATE_OUTPUT_TABLE): New.
+ Use it to create output_item_number_table and
+ output_token_number_table.
+ * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
+ * src/lex.c, src/nullable.c, src/output.c, src/print.c,
+ * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
+ * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
+
+2002-04-22 Akim Demaille <akim@epita.fr>
+
+ * src/output.h, src/output.c (get_lines_number): Remove.
+
+2002-04-19 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Actions): Make clear that `|' is not the same
+ as Lex/Flex'.
+ (Debugging): More details about enabling the debugging features.
+ (Table of Symbols): Describe $$, $n, @$, and @n.
+ Suggested by Tim Josling.
+
+2002-04-19 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Remove the uses of the obsolete @refill.
+
+2002-04-10 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: Rely on HAVE_LIMITS_H.
+ Suggested by Paul Eggert.
+
+2002-04-09 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
+ full stderr, and strip it according to the bison options, instead
+ of composing the error message from different bits.
+ This makes it easier to check for several error messages.
+ Adjust all the invocations.
+ Add an invocation exercising the error token.
+ Add an invocation demonstrating a stupid error message.
+ (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
+ Adjust the tests.
+ Error message are for stderr, not stdout.
+
+2002-04-09 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h, src/gram.c (error_token_number): Remove, use
+ errtoken->number.
+ * src/reader.c (reader): Don't specify the user token number (2)
+ for $undefined, as it uselessly prevents using it.
+ * src/gram.h (token_number_t): Move to...
+ * src/symtab.h: here.
+ (state_t.number): Is a token_number_t.
+ * src/print.c, src/reader.c: Use undeftoken->number instead of
+ hard coded 2.
+ (Even though this 2 is not the same as above: the number of the
+ undeftoken remains being 2, it is its user token number which
+ might not be 2).
+ * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
+ `user_token_number_max'.
+ Output `undef_token_number'.
+ * data/bison.simple, data/bison.c++: Use them.
+ Be sure to map invalid yylex return values to
+ `undef_token_number'. This saves us from gratuitous SEGV.
+
+ * tests/conflicts.at (Solved SR Conflicts)
+ (Unresolved SR Conflicts): Adjust.
+ * tests/regression.at (Web2c Actions): Adjust.
+
+2002-04-08 Akim Demaille <akim@epita.fr>
+
+ * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
+ Adding #line.
+ Remove the duplicate `typedefs'.
+ (RhsNumberType): Fix the declaration and various other typos.
+ Use __ofile__.
+ * data/bison.simple: Use __ofile__.
+ * src/scan-skel.l: Handle __ofile__.
+
+2002-04-08 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (item_number_t): New, the type of item numbers in
+ RITEM. Note that it must be able to code symbol numbers as
+ positive number, and the negation of rule numbers as negative
+ numbers.
+ Adjust all dependencies (pretty many).
+ * src/reduce.c (rule): Remove this `short *' pointer: use
+ item_number_t.
+ * src/system.h (MINSHORT, MAXSHORT): Remove.
+ Include `limits.h'.
+ Adjust dependencies to using SHRT_MAX and SHRT_MIN.
+ (shortcpy): Remove.
+ (MAXTABLE): Move to...
+ * src/output.c (MAXTABLE): here.
+ (prepare_rules): Use output_int_table to output rhs.
+ * data/bison.simple, data/bison.c++: Adjust.
+ * tests/torture.at (Big triangle): Move the limit from 254 to
+ 500.
+ * tests/regression.at (Web2c Actions): Ajust.
+
+ Trying with bigger grammars shows various phenomena: at 3000 (28Mb
+ of grammar file) bison is killed by my system, at 2000 (12Mb) bison
+ passes, but produces negative #line number, once fixed, GCC is
+ killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
+ C), it passes.
+ * src/state.h (state_h): Code input lines on ints, not shorts.
+
+2002-04-08 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (reduce_grammar): First reduce the nonterminals,
+ and then the grammar.
+
+2002-04-08 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: No longer using strndup.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
+ * src/output.c (output_table_data): Return the longest number.
+ (prepare_tokens): Output `token_number_max').
+ * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
+ New.
+ Use them to define yy_token_number_type/TokenNumberType.
+ Use this type for yytranslate.
+ * tests/torture.at (Big triangle): Push the limit from 124 to
+ 253.
+ * tests/regression.at (Web2c Actions): Adjust.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * tests/torture.at (Big triangle): New.
+ (GNU AWK Grammar, GNU Cim Grammar): Move to...
+ * tests/existing.at: here.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
+ nritems.
+ Adjust dependencies.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c: Normalize increments to prefix form.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c, symtab.c: Remove debugging code.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ Rename all the `bucket's as `symbol_t'.
+
+ * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
+ * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
+ * src/symtab.c, src/symtab.h (bucket): Rename as...
+ (symbol_t): this.
+ (symbol_list_new, bucket_check_defined, bucket_make_alias)
+ (bucket_check_alias_consistence, bucket_pack, bucket_translation)
+ (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
+ (buckets_new, buckets_free, buckets_do): Rename as...
+ (symbol_list_new, symbol_check_defined, symbol_make_alias)
+ (symbol_check_alias_consistence, symbol_pack, symbol_translation)
+ (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
+ (symbols_new, symbols_free, symbols_do): these.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ Use lib/hash for the symbol table.
+
+ * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
+ EOF.
+ * src/lex.c (lex): Set the `number' member of new terminals.
+ * src/reader.c (bucket_check_defined, bucket_make_alias)
+ (bucket_check_alias_consistence, bucket_translation): New.
+ (reader, grammar_free, readgram, token_translations_init)
+ (packsymbols): Adjust.
+ (reader): Number the predefined tokens.
+ * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
+ for predefined tokens.
+ * src/symtab.h (bucket): Remove all the hash table related
+ members.
+ * src/symtab.c (symtab): Replace by...
+ (bucket_table): this.
+ (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
+ (buckets_new, buckets_do): New.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
+ (start_symbol, max_user_token_number, semantic_parser)
+ (error_token_number): Initialize.
+ * src/reader.c (grammar, start_flag, startval, typed, lastprec):
+ Initialize.
+ (reader): Don't.
+ (errtoken, eoftoken, undeftoken, axiom): Extern.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (rule_s): prec and precsym are now pointers
+ to the bucket giving the priority/associativity.
+ Member `associativity' removed: useless.
+ * src/reduce.c, src/conflicts.c: Adjust.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
+ Properly escape the symbols' TAG when outputting them.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h (LA): Is a bitsetv, not bitset*.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h, src/lalr.c (LAruleno): Replace with...
+ (LArule): this, which is an array to rule_t*.
+ * src/print.c, src/conflicts.c: Adjust.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (rule_t): Rename `number' as `user_number'.
+ `number' is a new member.
+ Adjust dependencies.
+ * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ As a result of the previous patch, it is no longer needed
+ to reorder ritem itself.
+
+ * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ Be sure never to walk through RITEMS, but use only data related to
+ the rules themselves. RITEMS should be banished.
+
+ * src/output.c (output_token_translations): Rename as...
+ (prepare_tokens): this.
+ In addition to `translate', prepare the muscles `tname' and
+ `toknum', which were handled by...
+ (output_rule_data): this.
+ Remove, and move the remainder of its outputs into...
+ (prepare_rules): this new routines, which also merges content from
+ (output_gram): this.
+ (prepare_rules): Be sure never to walk through RITEMS.
+ (output_stos): Rename as...
+ (prepare_stos): this.
+ (output): Always invoke prepare_states, after all, just don't use it
+ in the output if you don't need it.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (new_state): Display `nstates' as the name of the
+ newly created state.
+ Adjust to initialize first_state and last_state if needed.
+ Be sure to distinguish the initial from the final state.
+ (new_states): Create the itemset of the initial state, and use
+ new_state.
+ * src/closure.c (closure): Now that the initial state has its
+ items properly set, there is no need for a special case when
+ creating `ruleset'.
+
+ As a result, now the rule 0, reducing to $axiom, is visible in the
+ outputs. Adjust the test suite.
+
+ * tests/conflicts.at (Solved SR Conflicts)
+ (Unresolved SR Conflicts): Adjust.
+ * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
+ * tests/conflicts.at (S/R in initial): New.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
+ the RHS of the rules.
+ * src/output.c (output_gram): Likewise.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
+ bucket.
+ Adjust all dependencies.
+ * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
+ `number' of the buckets too.
+ * src/gram.h: Include `symtab.h'.
+ (associativity): Move to...
+ * src/symtab.h: here.
+ No longer include `gram.h'.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h, src/gram.c (rules_rhs_length): New.
+ (ritem_longest_rhs): Use it.
+ * src/gram.h (rule_t): `number' is a new member.
+ * src/reader.c (packgram): Set it.
+ * src/reduce.c (reduce_grammar_tables): Move the useless rules at
+ the end of `rules', and count them out of `nrules'.
+ (reduce_output, dump_grammar): Adjust.
+ * src/print.c (print_grammar): It is no longer needed to check for
+ the usefulness of a rule, as useless rules are beyond `nrules + 1'.
+ * tests/reduce.at (Reduced Automaton): New test.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
+ lacking `+ 1' to nrules, Bison reported as useless a token if it
+ was used solely to set the precedence of the last rule...
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * data/bison.c++, data/bison.simple: Don't output the current file
+ name in #line, to avoid useless diffs between two identical
+ outputs under different names.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
+ Normalize loops to using `< nrules + 1', not `<= nrules'.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * TODO: Update.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
+ bucket.value as bucket.number.
+
+2002-04-07 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
+ * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
+ * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
+ RHS, instead of being an index in RITEMS.
+
+2002-04-04 Paul Eggert <eggert@twinsun.com>
+
+ * doc/bison.texinfo: Update copyright date.
+ (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
+ (Symbols): Warn about running Bison in one character set,
+ but compiling and/or running in an incompatible one.
+ Warn about character code 256, too.
+
+2002-04-03 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.data (YYSTACK_ALLOC): Depend on whether
+ YYERROR_VERBOSE is nonzero, not whether it is defined.
+
+ Merge changes from bison-1_29-branch.
+
+2002-03-20 Paul Eggert <eggert@twinsun.com>
+
+ Merge fixes from Debian bison_1.34-1.diff.
+
+ * configure.in (AC_PREREQ): 2.53.
+
+2002-03-20 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (log_resolution): Argument `resolution' is const.
+
+2002-03-19 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.simple (YYCOPY): New macro.
+ (YYSTACK_RELOCATE): Use it.
+ Remove Type arg; no longer needed. All callers changed.
+ (yymemcpy): Remove; no longer needed.
+
+ * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
+ * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
+
+2002-03-19 Akim Demaille <akim@epita.fr>
+
+ Test and fix the #line outputs.
+
+ * tests/atlocal.at (GCC): New.
+ * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
+ (Prologue synch line, %union synch line, Postprologue synch line)
+ (Action synch line, Epilogue synch line): New tests.
+ * src/reader.c (parse_union_decl): Define the muscle stype_line.
+ * data/bison.simple, data/bison.c++: Use it.
+
+2002-03-19 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
+ (Solved SR Conflicts, %expect not enough, %expect right)
+ (%expect too much): Move to...
+ * tests/conflicts.at: this new file.
+
+2002-03-19 Akim Demaille <akim@epita.fr>
+
+ * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
+ * data/bison.simple, data/bison.c++: Handle the `#define' part, so
+ that we can move to enums for instance.
+ * src/output.c (token_definitions_output): Output a list of
+ `token-name, token-number' instead of the #define.
+ (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
+
+2002-03-14 Akim Demaille <akim@epita.fr>
+
+ Use Gettext 0.11.1.
+
+2002-03-09 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++: Make the user able to add members to the generated
+ parser by subclassing.
+
+2002-03-05 Robert Anisko <robert@lrde.epita.fr>
+
+ * src/reader.c (read_additionnal_code): `c' should be an integer, not
+ a character.
+ Reported by Nicolas Tisserand and Nicolas Burrus.
+
+2002-03-04 Robert Anisko <robert@lrde.epita.fr>
+
+ * src/reader.c: Warn about lacking semi-colons, do not complain.
+
+2002-03-04 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++: Remove a debug line.
+
+2002-03-04 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
+ location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
+ provide a default implementation.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
+ * tests/output.at (AT_CHECK_OUTPUT): Likewise.
+ * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
+ * tests/semantic.at (Parsing Guards): Similarly.
+ * src/reader.at (readgram): Complain if the last rule is not ended
+ with a semi-colon.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
+ * src/closure.c: here.
+ (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
+ RTC.
+ * src/warshall.h, src/warshall.c: Remove.
+ * tests/sets.at (Broken Closure): Adjust.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_skeleton): tempdir is const.
+ bytes_read is unused.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
+ * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
+ Update.
+ From Michael Hayes.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (closure): `r' is unused.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * tests/sets.at (Broken Closure): Add the ending `;'.
+ * src/reader.at (readgram): Complain if a rule is not ended with a
+ semi-colon.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
+ (count_sr_conflicts): Use bitset_count.
+ * src/reduce.c (inaccessable_symbols): Ditto.
+ (bits_size): Remove.
+ * src/warshall.h, src/warshall.c: Convert to bitsetv.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
+ * src/reduce.c: Remove the `bitset_zero's following the
+ `bitset_create's, as now it is performed by the latter.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
+ * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
+ * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
+ latest sources from Michael.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output): Don't free the grammar.
+ * src/reader.c (grammar_free): New.
+ * src/main.c (main): Call it and don't free symtab here.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
+ before returning.
+ Reported by Benoit Perrot.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ Use bitset operations when possible, not loops over bits.
+
+ * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
+ bitset_or.
+ * src/print.c (print_reductions): Use bitset_and, bitset_andn.
+ * src/reduce.c (useless_nonterminals): Formatting changes.
+ * src/warshall.c (TC): Use bitset_or.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
+ * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
+ Ditto.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (F): Now a bitset*.
+ Adjust all dependencies.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (shiftset, lookaheadset): Now bitset.
+ Adjust all dependencies.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/L0.c, src/LR0.h (nstates): Be size_t.
+ Adjust comparisons (signed vs unsigned).
+ * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
+ bitset*.
+ Adjust all dependencies.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (firsts): Now, also a bitset.
+ Adjust all dependencies.
+ (varsetsize): Remove, now unused.
+ * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/print.c: Convert to use bitset.h, not hand coded iterations
+ over ints.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (ruleset): Be a bitset.
+ (rulesetsize): Remove.
+
+2002-03-04 Akim Demaille <akim@epita.fr>
+
+ * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
+ * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
+ * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
+ * src/closure.c (fderives): Be an array of bitsets.
+
+2002-02-28 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++: Merge the two generated headers. Insert a copyright
+ notice in each output file.
+
+2002-02-28 Akim Demaille <akim@epita.fr>
+
+ * data/bison.c++: Copy the prologue of bison.simple to fetch
+ useful M4 definitions, such as b4_header_guard.
+
+2002-02-25 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (version): Give the name of the authors, and use a
+ translator friendly scheme for the bgr
+ copyright notice.
+
+2002-02-25 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (header_output): Remove, now handled completely via
+ M4.
+
+2002-02-25 Akim Demaille <akim@epita.fr>
+
+ * m4/m4.m4: New, from CVS Autoconf.
+ * configure.in: Invoke it.
+ * src/output.c (output_skeleton): Use its result instead of the
+ hard coded name.
+
+2002-02-25 Akim Demaille <akim@epita.fr>
+
+ * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
+ Fileutils 4.1.5.
+ * configure.in: Invoke UTILS_FUNC_MKSTEMP.
+ * src/output.c (output_skeleton): Use mkstemp to create a real
+ temporary file.
+ Move the filling of `skeleton' and its muscle to...
+ (prepare): here.
+ (output): Move the definition of the prologue muscle to...
+ (prepare): here.
+ * src/system.h (DEFAULT_TMPDIR): New.
+
+2002-02-14 Paul Eggert <eggert@twinsun.com>
+
+ Remove the support for C++ namespace cleanliness; it was
+ causing more problems than it was curing, since it didn't work
+ properly on some nonstandard C++ compilers. This can wait
+ for a proper C++ parser.
+
+ * NEWS: Document this.
+ * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
+ of C++, as it's treated like C now.
+ * src/bison.simple (YYSTD): Remove.
+ (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
+ Treat C++ just like Standard C instead of trying to support
+ namespace cleanliness.
+
+2002-02-14 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (else): Adjust to Andreas' change.
+
+2002-02-14 Akim Demaille <akim@epita.fr>
+
+ * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
+
+2002-02-13 Andreas Schwab <schwab@suse.de>
+
+ * src/output.c (output_rule_data): Don't output NULL, it might
+ not be defined yet.
+
+2002-02-11 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
+ (Copyright notice): Update.
+
+2002-02-11 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (%nonassoc and eof): Don't include
+ nonportable headers.
+
+2002-02-08 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++: Correct error recovery. Make the user able to
+ initialize the starting location.
+
+2002-02-07 Akim Demaille <akim@epita.fr>
+
+ * tests/input.at: New.
+
+2002-02-07 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++: Replace some direct m4 expansions by constants. Be
+ more consistent when naming methods and variables. Put preprocessor
+ directives around tables only needed for debugging.
+
+2002-02-07 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
+ C++ parsers.
+ (yy::b4_name::parse): Use print_.
+
+2002-02-07 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
+
+2002-02-07 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
+ C++ parsers.
+ (yy::b4_name::parse): Build verbose error messages, and use error_.
+
+2002-02-06 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++: Fix m4 quoting in comments.
+
+2002-02-06 Robert Anisko <robert@lrde.epita.fr>
+
+ * data/bison.c++: Adjust the parser code. Fix some muscles that were
+ not expanded by m4.
+
+2002-02-05 Akim Demaille <akim@epita.fr>
+
+ * data/bison.c++: Adjust to the M4 back end.
+ More is certainly needed.
+
+2002-02-05 Akim Demaille <akim@epita.fr>
+
+ Give a try to M4 as a back end.
+
+ * lib/readpipe.c: New, from wdiff.
+ * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
+ BISON_HAIRY.
+ * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
+ specific values. Now it is m4 that performs the lookup.
+ * src/parse-skel.y: Remove.
+ * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
+ * src/output.c (actions_output, guards_output)
+ (token_definitions_output): No longer keeps track of the output
+ line number, hence remove the second argument.
+ (guards_output): Check against the guard member of a rule, not the
+ action member.
+ Adjust callers.
+ (output_skeleton): Don't look for the skeleton location, let m4 do
+ that.
+ Create `/tmp/muscles.m4'. This is temporary, a proper temporary
+ file will be used.
+ Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
+ (prepare): Given that for the time being changesyntax is not
+ usable in M4, rename the muscles using `-' to `_'.
+ Define `defines_flag', `output_parser_name' and `output_header_name'.
+ * src/output.h (actions_output, guards_output)
+ (token_definitions_output): Adjust prototypes.
+ * src/scan-skel.l: Instead of scanning the skeletons, it now
+ processes the output of m4: `__oline__' and `#output'.
+ * data/bison.simple: Adjust to be used by M4(sugar).
+ * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
+ to date.
+ * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
+ instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
+ * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
+ shamelessly stolen from CVS Autoconf.
+
+2002-02-05 Akim Demaille <akim@epita.fr>
+
+ * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
+ * configure.in: Check for the declarations of free and malloc.
+ * src/muscle_tab.c: Adjust.
+
+2002-02-05 Akim Demaille <akim@epita.fr>
+
+ * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
+ which have no values.
+
+2002-02-05 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
+ * data/: here.
+
+2002-01-29 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.simple (YYSIZE_T): Do not define merely because
+ YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
+ On some platforms, <alloca.h> does not declare YYSTD (size_t).
+
+2002-01-27 Akim Demaille <akim@epita.fr>
+
+ Fix `%nonassoc and eof'.
+
+ * src/state.c (errs_dup): Aaaah! The failure was due to bytes
+ which were not properly copied! Replace
+ memcpy (res->errs, src->errs, src->nerrs);
+ with
+ memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
+ !!!
+ * tests/regression.at (%nonassoc and eof): Adjust to newest
+ Autotest: `.' is not in the PATH.
+
+2002-01-27 Akim Demaille <akim@epita.fr>
+
+ * tests/sets.at (AT_EXTRACT_SETS): New.
+ (Nullable): Use it.
+ (Firsts): New.
+
+2002-01-26 Akim Demaille <akim@epita.fr>
+
+ * tests/actions.at, tests/calc.at, tests/headers.at,
+ * tests/torture.at: Adjust to the newest Autotest which no longer
+ forces `.' in the PATH.
+
+2002-01-25 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (%nonassoc and eof): New.
+ Suggested by Robert Anisko.
+
+2002-01-24 Akim Demaille <akim@epita.fr>
+
+ Bison dumps core when trying to complain about broken input files.
+ Reported by Cris van Pelt.
+
+ * src/lex.c (parse_percent_token): Be sure to set token_buffer.
+ * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
+ into...
+ (Invalid inputs): Strengthen: exercise parse_percent_token.
+
+2002-01-24 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/Makefile.am: Add bison.c++.
+ * src/bison.c++: New skeleton.
+
+2002-01-21 Paolo Bonzini <bonzini@gnu.org>
+
+ * po/it.po: New.
+
+2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
+
+ * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
+
+2002-01-20 Marc Autret <marc@gnu.org>
+
+ * src/files.c (compute_output_file_names): Fix
+
+2002-01-20 Marc Autret <marc@gnu.org>
+
+ * tests/output.at: New test.
+ * src/files.c (compute_base_names): Don't map extensions when
+ the YACC flag is set, use defaults.
+ Reported by Evgeny Stambulchik.
+
+2002-01-20 Marc Autret <marc@gnu.org>
+
+ * src/system.h: Need to define __attribute__ away for non-GCC
+ compilers as well (i.e., the vendor C compiler).
+ Suggested by Albert Chin-A-Young.
+
+2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
+
+ * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
+ canonical definition.
+ * src/system.h: Use the canonical definition for PARAMS (avoids
+ a conflict with the macro from lib/hash.h).
+
+2002-01-11 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Use AC_FUNC_STRNLEN.
+ Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
+
+2002-01-09 Akim Demaille <akim@epita.fr>
+
+ * src/files.c, src/files.h (output_infix): New.
+ (tab_extension): Remove.
+ (compute_base_names): Compute the former, drop the latter.
+ * src/output.c (prepare): Insert the muscles `output-infix', and
+ `output-suffix'.
+ * src/parse-skel.y (string, string.1): New.
+ (section.header): Use it.
+ (section.yacc): Remove.
+ (prefix): Remove too.
+ * src/scan-skel.l: Adjust.
+ * src/bison.simple, src/bison.hairy: Adjust.
+
+2002-01-09 Akim Demaille <akim@epita.fr>
+
+ * configure.in (WERROR_CFLAGS): Compute it.
+ * src/Makefile.am (CFLAGS): Pass it.
+ * tests/atlocal.in (CFLAGS): Idem.
+ * src/files.c: Fix a few warnings.
+ (get_extension_index): Remove, unused.
+
+2002-01-08 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (AS_FILE_NAME): New.
+ (getargs): Use it to convert DOSish file names.
+ * src/files.c (base_name): Rename as full_base_name to avoid
+ clashes with `base_name ()'.
+ (filename_split): New.
+ (compute_base_names): N-th rewrite, using filename_split.
+
+2002-01-08 Akim Demaille <akim@epita.fr>
+
+ * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
+ New, stolen from the Fileutils 4.1.
+ * lib/Makefile.am (libbison_a_SOURCES): Adjust.
+ * configure.in: Check for the presence of memrchr, and of its
+ prototype.
+
+2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
+
+ * lib/hash.h (__P): Added definition for this macro.
+ * src/Makefile.am: Add parse-skel.c and scan-skel.c to
+ BUILT_SOURCES, to ensure they are generated first.
+ * src/parse-skel.y: Use YYERROR_VERBOSE instead of
+ %error-verbose to allow bootstrapping with bison 1.30x.
+
+2002-01-06 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (parse_braces): Don't fetch the next char, the
+ convention is to fetch on entry.
+ * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
+ 'switch' without a following semicolon.
+ * tests/regression.at (braces parsing): New.
+
+2002-01-06 Akim Demaille <akim@epita.fr>
+
+ Bison is dead wrong in its RR conflict reports.
+
+ * tests/torture.at (GNU Cim Grammar): New.
+ * src/conflicts.c (count_rr_conflicts): Fix.
+
+2002-01-06 Akim Demaille <akim@epita.fr>
+
+ Creating package.m4 from configure.ac causes too many problems.
+
+ * tests/Makefile.am (package.m4): Create it by hand,
+ AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
+
+2002-01-06 Akim Demaille <akim@epita.fr>
+
+ * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
+ skeleton.h.
+
+2002-01-04 Paul Eggert <eggert@twinsun.com>
+
+ * doc/bison.texinfo (Debugging):
+ Remove YYSTDERR; it's no longer defined or used.
+ Also, s/cstdio.h/cstdio/.
+
+2002-01-03 Akim Demaille <akim@epita.fr>
+
+ * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
+
+2002-01-03 Akim Demaille <akim@epita.fr>
+
+ * src/parse-skel.y (process_skeleton): Don't bind the parser's
+ tracing code to --trace, wait for a better --trace option, with
+ args.
+
+2002-01-03 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
+ The ISO C++ standard is extremely clear about it: stderr is
+ considered a macro, not a regular symbol (see table 94 `Header
+ <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
+ Therefore std:: does not apply to it. It still does with fprintf.
+ Also, s/cstdio.h/cstdio/.
+
+2002-01-03 Akim Demaille <akim@epita.fr>
+
+ * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
+ for non system headers.
+
+2002-01-02 Akim Demaille <akim@epita.fr>
+
+ Equip the skeleton chain with location tracking, runtime trace,
+ pure parser and scanner.
+
+ * src/parse-skel.y: Request a pure parser, locations, and prefix
+ renaming.
+ (%union): Having several members with the same type does not help
+ type mismatches, simplify.
+ (YYPRINT, yyprint): New.
+ (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
+ (skel_error): this.
+ Handle locations.
+ * src/scan-skel.l: Adjust to these changes.
+ * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
+ (LOCATION_PRINT, skel_control_t): New.
+
+2001-12-30 Akim Demaille <akim@epita.fr>
+
+ * src/parse-skel.y: Get rid of the shift/reduce conflict:
+ replace `gb' with BLANKS.
+ * src/scan-skel.l: Adjust.
+
+2001-12-30 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: We don't need nor want bcopy.
+ Throw away MS-DOS crap: we don't need getpid.
+ * configure.in: We don't need strndup. It was even causing
+ problems: because Flex includes the headers *before* us,
+ _GNU_SOURCE is not defined by config.h, and therefore strndup was
+ not visible.
+ * lib/xstrndup.c: New.
+ * src/scan-skel.l: Use it.
+ Be sure to initialize yylval.muscle member when scanning a MUSCLE.
+ * src/parse-skel.y: Use %directives instead of #defines.
+
+2001-12-30 Akim Demaille <akim@epita.fr>
+
+ * src/skeleton.h: New.
+ * src/output.c (output_parser, output_master_parser): Remove, dead
+ code.
+ * src/output.h (get_lines_number, actions_output, guards_output)
+ (token_definitions_output): Prototype them.
+ * src/parse-skel.y: Add the license notice.
+ Include output.h and skeleton.h.
+ (process_skeleton): Returns void, and takes a single parameter.
+ * src/scan-skel.l: Add the license notice.
+ Include skeleton.h.
+ Don't use %option yylineno: it seems that then Flex imagines
+ REJECT has been used, and therefore it won't reallocate its
+ buffers (which makes no other sense to me than a bug). It results
+ in warnings for `unused: yy_flex_realloc'.
+
+2001-12-30 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
+ (MUSCLE_INSERT_PREFIX): ...to there.
+ * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
+ (MUSCLE_INSERT_PREFIX): Move from here...
+
+ * src/bison.hairy: Add a section directive. Put braces around muscle
+ names. This parser skeleton is still broken, but Bison should not
+ choke on a bad muscle 'syntax'.
+ * src/bison.simple: Add a section directive. Put braces around muscle
+ names.
+
+ * src/files.h (strsuffix, stringappend): Add declarations.
+ (tab_extension): Add declaration.
+ (short_base_name): Add declaration.
+
+ * src/files.c (strsuffix, stringappend): No longer static. These
+ functions are used in the skeleton parser.
+ (tab_extension): New.
+ (compute_base_names): Use the computations done in this function
+ to guess if the generated parsers should have '.tab' in their
+ names.
+ (short_base_name): No longer static.
+
+ * src/output.c (output_skeleton): New.
+ (output): Disable call to output_master_parser, and give a try to
+ a new skeleton handling system.
+ (guards_output, actions_output): No longer static.
+ (token_definitions_output, get_lines_number): No longer static.
+
+ * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
+
+ * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
+ parse-skel.y.
+
+ * src/parse-skel.y: New file.
+ * src/scan-skel.l: New file.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ %name-prefix is broken.
+
+ * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
+ Adjust all dependencies.
+ * tests/headers.at (export YYLTYPE): Strengthen this test: use
+ %name-prefix.
+
+ Renaming yylval but not yylloc is not consistent. Now we do.
+
+ * src/bison.simple: Prefix yylloc if used.
+ * doc/bison.texinfo (Decl Summary): Document that.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Promote `%long-directive' over
+ `%long_directive'.
+ Remove all references to fixed-output-files, yacc is enough.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
+ user prologue. These are defaults.
+ * tests/actions.at (Mid-rule actions): Make sure the user can
+ define YYDEBUG and YYERROR_VERBOSE.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (header_output): Don't forget to export YYLTYPE and
+ yylloc.
+ * tests/headers.at (export YYLTYPE): New, make sure it does.
+ * tests/regression.at (%union and --defines, Invalid CPP headers):
+ Move to...
+ * tests/headers.at: here.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * tests/actions.at (Mid-rule actions): Output on a single line
+ instead of several.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Formatting changes.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ Don't store the token defs in a muscle, just be ready to output it
+ on command. Now possible via `symbols'. Fixes a memory leak.
+
+ * src/output.c (token_definitions_output): New.
+ (output_parser, header_output): Use it.
+ * src/reader.c (symbols_save): Remove.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple: Do not provide a default for YYSTYPE and
+ YYLTYPE before the user's prologue. Otherwise it's hardly... a
+ default.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ Mid-rule actions are simply... ignored!
+
+ * src/reader.c (readgram): Be sure to attach mid-rule actions to
+ the empty-rule associated to the dummy symbol, not to the host
+ rule.
+ * tests/actions.at (Mid-rule actions): New.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ Memory leak.
+
+ * src/reader.c (reader): Free grammar.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ Memory leak.
+
+ * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
+ since it allocates it for each state, although only one is needed.
+ (allocate_storage): Do it here.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/options.h, src/options.c (create_long_option_table): Rename
+ as...
+ (long_option_table_new): this, with a clearer prototype.
+ (percent_table): Remove, unused,
+ * src/getargs.c (getargs): Adjust.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
+ * src/print.c, src/print_graph.c, src/state.h: Rename state_table
+ as states.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (build_relations): Rename `states' as `states1'.
+ Sorry, I don't understand exactly what it is, no better name...
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
+ * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
+ * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
+ as rules.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
+ ago.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c, src/reader.h (user_toknums): Remove.
+ Adjust all users to use symbols[i]->user_token_number.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/gram.c, src/gram.h (sprec, sassoc): Remove.
+ Adjust all users to use symbols[i]->prec or ->assoc.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c, src/reader.h (tags): Remove.
+ Adjust all users to use symbols[i]->tag.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h, src/gram.c (symbols): New, similar to state_table
+ and rule_table.
+ * src/reader.c (packsymbols): Fill this table.
+ Drop sprec.
+ * src/conflicts.c (resolve_sr_conflict): Adjust.
+ * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
+ single table.
+ Use symbols[i]->tag instead of tags[i].
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
+ In addition, put a comment in there, to replace...
+ * tests/regression.at (%union and C comments): Remove.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Web2c Actions): Blindly move the actual
+ output as expected output. The contents *seem* right to me, but I
+ can't pretend reading perfectly parser tables... Nonetheless, all
+ the other tests pass correctly, the table look OK, even though the
+ presence of `$axiom' is to be noted: AFAICS it is useless (but
+ harmless).
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (readgram): Don't add the rule 0 if there were no
+ rules read. In other words, add it _after_ having performed
+ grammar sanity checks.
+ Fixes the `tests/regression.at (Invalid input: 1)' Failure.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
+ visible, and some states have now a different number.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (readgram): Bind the initial rule's lineno to that
+ of the first rule.
+ * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
+ (Solved SR Conflicts): Adjust rule 0's line number.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ Fix the `GAWK Grammar' failure.
+
+ * src/LR0.c (final_state): Initialize to -1 so that we do compute
+ the reductions of the first state which was mistakenly confused
+ with the final state because precisely final_state was initialized
+ to 0.
+ * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
+ now noticed by Bison.
+ * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
+ have a reduction on $default.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
+ rule line numbers.
+ * src/closure.c (print_closure): Likewise.
+ * src/derives.c (print_derives): Likewise.
+ * tests/sets.at (Nullable): Adjust: the rule numbers are correct
+ now.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (lookaheads_print): New.
+ (lalr): Call it when --trace-flag.
+ * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
+ are dumped.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
+ when walking through ritem, even via rule->rhs.
+ * src/reduce.c (dump_grammar, useful_production, reduce_output)
+ (useful_production, useless_nonterminals): Likewise.
+ (reduce_grammar_tables): Likewise, plus update nritems.
+ * src/nullable.c (set_nullable): Likewise.
+ * src/lalr.c (build_relations): Likewise.
+ * tests/sets.at (Nullable): Adjust.
+ Fortunately, now, the $axiom is no longer nullable.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (generate_states): Use nritems, not nitems, nor using
+ the 0-sentinel.
+ * src/gram.c (ritem_longest_rhs): Likewise.
+ * src/reduce.c (nonterminals_reduce): Likewise.
+ * src/print_graph.c (print_graph): Likewise.
+ * src/output.c (output_rule_data): Likewise.
+ * src/nullable.c (set_nullable): Likewise.
+
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/output.c: Comment changes.
+
+2001-12-27 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
+ cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
+ Sparc, as they were causing more porting problems than the
+ (minor) performance improvement was worth.
+
+ Also, catch up with 1.31's YYSTD.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_gram): Rely on nritems, not the
+ 0-sentinel. See below.
+ Use -1 as separator, not 0.
+ * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
+ Rely on -1 as separator in yyrhs, instead of 0.
+ * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
+ twice `Now at end of input', therefore there are two lines less to
+ expect.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Unresolved SR Conflicts):
+ (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
+ below.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (new_state): Recognize the final state by the fact it
+ is reached by eoftoken.
+ (insert_start_shifting_state, insert_eof_shifting_state)
+ (insert_accepting_state, augment_automaton): Remove, since now
+ these states are automatically computed from the initial state.
+ (generate_states): Adjust.
+ * src/print.c: When reporting a rule number to the user, substract
+ 1, so that the axiom rule is rule 0, and the first user rule is 1.
+ * src/reduce.c: Likewise.
+ * src/print_graph.c (print_core): For the time being, just as for
+ the report, depend upon --trace-flags to dump the full set of
+ items.
+ * src/reader.c (readgram): Once the grammar read, insert the rule
+ 0: `$axiom: START-SYMBOL $'.
+ * tests/set.at: Adjust: rule 0 is now displayed, and since the
+ number of the states has changed (the final state is no longer
+ necessarily the last), catch up.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ Try to make the use of the eoftoken valid. Given that its value
+ is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
+ is used instead of > 0 where appropriate, (ii), depend upon nritems
+ instead of the 0-sentinel.
+
+ * src/gram.h, src/gram.c (nritems): New.
+ Expected to be duplication of nitems, but for the time being...
+ * src/reader.c (packgram): Assert nritems and nitems are equal.
+ * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
+ * src/closure.c (print_closure, print_fderives): Likewise.
+ * src/gram.c (ritem_print): Likewise.
+ * src/print.c (print_core, print_grammar): Likewise.
+ * src/print_graph.c: Likewise.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/main.c (main): If there are complains after grammar
+ reductions, then output the report anyway if requested, then die.
+ * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
+ * src/reader.c (eoftoken): New.
+ (parse_token_decl): If the token being defined has value `0', it
+ is the eoftoken.
+ (packsymbols): No longer hack `tags' to insert `$' by hand.
+ Be sure to preserve the value of the eoftoken.
+ (reader): Make sure eoftoken is defined.
+ Initialize nsyms to 0: now eoftoken is created just like the others.
+ * src/print.c (print_grammar): Don't special case the eof token.
+ * src/regression.at: Adjust: `$' has value 0, not -1, which was a
+ lie anyway, albeit pleasant.
+ * tests/calc.at: Exercise error messages with eoftoken.
+ Change the grammar so that empty input is invalid.
+ Adjust expectations.
+ When yyungeting, be sure to use a valid yylloc: use last_yylloc.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Check the protos of strchr ans strspn.
+ Replace strchr if needed.
+ * src/system.h: Provide the protos of strchr, strspn and memchr if
+ missing.
+ * lib/strchr.c: New.
+ * src/reader.c (symbols_save): Use strchr.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/print.c, src/print_graph.c (escape): New.
+ Use it to quote the TAGS outputs.
+ * src/print_graph.c (print_state): Now errors are in red, and
+ reductions in green.
+ Prefer high to wide: output the state number on a line of its own.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/state.h, src/state.c (reductions_new): New.
+ * src/LR0.c (set_state_table): Let all the states have a
+ `reductions', even if reduced to 0.
+ (save_reductions): Adjust.
+ * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
+ * src/print.c (print_reductions, print_actions): Adjust.
+ * src/output.c (action_row): Adjust.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/state.h, src/state.c (errs_new, errs_dup): New.
+ * src/LR0.c (set_state_table): Let all the states have an errs,
+ even if reduced to 0.
+ * src/print.c (print_errs, print_reductions): Adjust.
+ * src/output.c (output_actions, action_row): Adjust.
+ * src/conflicts.c (resolve_sr_conflict): Adjust.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
+ * src/print.c: here.
+ (lookaheadset, shiftset): New, used as additional storage by
+ print_reductions.
+ (print_results): Adjust.
+ (print_shifts, print_gotos, print_errs): New, extracted from...
+ (print_actions): here.
+ * src/print_graph.c (print_actions): Remove dead code.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
+ `$n' and `@n'.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
+ (build_relations): Adjust.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (set_goto_map): Remove a wrong but benign loop
+ duplication.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (packgram): Catch nitems overflows.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/files.c, src/files.h (guard_obstack): Remove.
+ * src/output.c (output): Adjust.
+ * src/reader.c (parse_braces): New, factoring...
+ (copy_action, copy_guard): these two which are renamed as...
+ (parse_action, parse_guard): these.
+ As a voluntary consequence, using braces around guards is now
+ mandatory.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (rule_t): `guard' and `guard_line' are new members.
+ * src/reader.c (symbol_list): `guard' and `guard_line' are new
+ members.
+ (symbol_list_new): Adjust.
+ (copy_action): action_line is the first line, not the last.
+ (copy_guard): Just as for actions, store the `action' only, not
+ the switch/case/break flesh.
+ Don't parse the user action that might follow the guard, let...
+ (readgram): do it, i.e., now, there can be an action after a
+ guard.
+ In other words the guard is just explicitly optional.
+ (packgram): Adjust.
+ * src/output.c (guards_output): New.
+ (output_parser): Call it when needed.
+ (output): Also free the guard and attrs obstacks.
+ * src/files.c, src/files.h (obstack_save): Remove.
+ (output_files): Remove.
+ As a result, if one needs the former `.act' file, using an
+ appropriate skeleton which requires actions and guards is now
+ required.
+ * src/main.c (main): Adjust.
+ * tests/semantic.at: New.
+ * tests/regression.at: Use `input.y' as input file name.
+ Avoid 8+3 problems by requiring input.c when the test needs the
+ parser.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (symbol_list_new): Be sure to initialize all the
+ fields.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ All the hacks using a final pseudo state are now useless.
+
+ * src/LR0.c (set_state_table): state_table holds exactly nstates.
+ * src/lalr.c (nLA): New.
+ (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
+ instead of lookaheadsp from the pseudo state (nstate + 1).
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (action_row, token_actions): Use a state_t instead
+ of a integer, and nlookaheads instead of the following state's
+ lookaheadsp.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (log_resolution, flush_shift)
+ (resolve_sr_conflict, set_conflicts, solve_conflicts)
+ (count_sr_conflicts, count_rr_conflicts, conflicts_output)
+ (conflicts_print, print_reductions): Use a state_t instead of an
+ integer when referring to a state.
+ As much as possible, depend upon nlookaheads, instead of the
+ `lookaheadsp' member of the following state (since lookaheads of
+ successive states are successive, the difference between state n + 1
+ and n served as the number of lookaheads for state n).
+ * src/lalr.c (add_lookback_edge): Likewise.
+ * src/print.c (print_core, print_actions, print_state)
+ (print_results): Likewise.
+ * src/print_graph.c (print_core, print_actions, print_state)
+ (print_graph): Likewise.
+ * src/conflicts.h: Adjust.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/bison.hairy: Formatting/comment changes.
+ ANSIfy.
+ Remove `register' indications.
+ Add plenty of `static'.
+
+2001-12-27 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (prepare): Drop the muscle `ntbase' which
+ duplicates ntokens.
+ * src/bison.simple: Formatting/comment changes.
+ Use YYNTOKENS only, which is documented, but not YYNTBASE, which
+ is an undocumented synonym.
+
+2001-12-22 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_table_data): Change the prototype to use
+ `int' for array ranges: some invocations do pass an int, not a
+ short.
+ Reported by Wayne Green.
+
+2001-12-22 Akim Demaille <akim@epita.fr>
+
+ Some actions of web2c.y are improperly triggered.
+ Reported by Mike Castle.
+
+ * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
+ * tests/regression.at (Web2c): Rename as...
+ (Web2c Report): this.
+ (Web2c Actions): New.
+
+2001-12-22 Akim Demaille <akim@epita.fr>
+
+ Reductions in web2c.y are improperly reported.
+ Reported by Mike Castle.
+
+ * src/conflicts.c (print_reductions): Fix.
+ * tests/regression.at (Web2c): New.
+
+2001-12-18 Akim Demaille <akim@epita.fr>
+
+ Some host fail on `assert (!"foo")', which expands to
+ ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
+ Reported by Nelson Beebee.
+
+ * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
+ `#define it_succeeded 0' and `assert (it_succeeded)'.
+
+2001-12-17 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple: Don't hard code the skeleton line and filename.
+ * src/output.c (output_parser): Rename 'line' as 'output_line'.
+ New line counter 'skeleton_line' (skeleton-line muscle).
+
+2001-12-17 Paul Eggert <eggert@twinsun.com>
+
+ * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
+ YYDEBUG must be defined to a nonzero value.
+
+ * src/bison.simple (yytname): Do not assume that the user defines
+ YYDEBUG to a properly parenthesized expression.
+
+2001-12-17 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (state_t): Rename lookaheads as lookaheadsp.
+ nlookaheads is a new member.
+ Adjust all users.
+ * src/lalr.h (nlookaheads): Remove this orphan declaration.
+ * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
+ state.
+
+2001-12-17 Akim Demaille <akim@epita.fr>
+
+ * src/files.h, src/files.c (open_files, close_files): Remove.
+ * src/main.c (main): Don't open/close files, nor invoke lex_free,
+ let...
+ * src/reader.c (reader): Do it.
+
+2001-12-17 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (print_reductions): Formatting changes.
+
+2001-12-17 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (flush_shift): Also adjust lookaheadset.
+ (flush_reduce): New.
+ (resolve_sr_conflict): Adjust.
+
+2001-12-17 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_obstack): Be static and rename as...
+ (format_obstack): this, to avoid any confusion with files.c's
+ output_obstack.
+ * src/reader.h (muscle_obstack): Move to...
+ * src/output.h: here, since it's defined in output.c.
+
+2001-12-17 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (action_row, save_column, default_goto)
+ (sort_actions, matching_state, pack_vector): Better variable
+ locality.
+
+2001-12-17 Akim Demaille <akim@epita.fr>
+
+ * src/output.c: Various formatting changes.
+
+2001-12-17 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (output_files): Free the output_obstack.
+ * src/main.c (main): Call print and print_graph conditionally.
+ * src/print.c (print): Work unconditionally.
+ * src/print_graph.c (print_graph): Work unconditionally.
+ * src/conflicts.c (log_resolution): Output only if verbose_flag.
+
+2001-12-16 Marc Autret <autret_m@epita.fr>
+
+ * src/output.c (actions_output): Fix. When we use %no-lines,
+ there is one less line per action.
+
+2001-12-16 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple: Remove a useless #line directive.
+ s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
+ * src/output.c (get_lines_number): New.
+ (output_parser): Adjust, now takes care about the lines of a
+ output muscles.
+ Fix line numbering.
+ (actions_output): Computes the number of lines taken by actions.
+ (output_master_parser): Insert new skeleton which is the name of
+ the output parser file name.
+
+2001-12-15 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
+
+2001-12-15 Marc Autret <autret_m@epita.fr>
+
+ * src/output.c (output_gram): Keep track of the hairy one.
+
+2001-12-15 Akim Demaille <akim@epita.fr>
+
+ Make `make distcheck' work.
+
+ * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
+ system.h which uses libgettext.h.
+
+2001-12-15 Akim Demaille <akim@epita.fr>
+
+ * src/nullable.c (set_nullable): Useless rules must be skipped,
+ otherwise, since we range over their symbols, we might look at a
+ nonterminal which no longer ``exists'', i.e., it is not counted in
+ `nvars', hence we overflow our arrays.
+
+2001-12-15 Akim Demaille <akim@epita.fr>
+
+ The header can also be produced directly, without any obstack!
+ Yahoo!
+
+ * src/files.c, src/files.h (defines_obstack): Remove.
+ (compute_header_macro): Global.
+ (defines_obstack_save): Remove.
+ * src/reader.c (parse_union_decl): No longer output to
+ defines_obstack: its content can be found in the `stype' muscle
+ anyway.
+ (output_token_translations): Merge into...
+ (symbols_output): this.
+ Rename as...
+ (symbols_save): this.
+ (reader): Adjust.
+ * src/output.c (header_output): New.
+ (output): Call it.
+
+2001-12-15 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (parse_union_decl): Instead of handling two obstack
+ simultaneously, use one to define the `stype' muscle, and use the
+ value of the latter to fill defines_obstack.
+ (copy_comment): Remove.
+ (copy_comment2): Work for a single obstack.
+ Rename as...
+ (copy_comment): this.
+
+2001-12-15 Akim Demaille <akim@epita.fr>
+
+ * src/lex.c, src/lex.h (xgetc): No longer static.
+ * src/reader.c (parse_union_decl): Revamp.
+
+2001-12-15 Akim Demaille <akim@epita.fr>
+
+ Still making progress in separating Bison into (i) input, (ii)
+ process, (iii) output: now we can directly output the parser file
+ without using table_obstack at all.
+
+ * src/files.c, src/files.h (table_obstack): Bye bye.
+ (parser_file_name): New.
+ * src/files.c (compute_output_file_names): Compute it.
+ * src/output.c (actions_output, output_parser)
+ (output_master_parser): To a file instead of an obstack.
+
+2001-12-15 Akim Demaille <akim@epita.fr>
+
+ Attach actions to rules, instead of pre-outputting them to
+ actions_obstack.
+
+ * src/gram.h (rule_t): action and action_line are new members.
+ * src/reader.c (symbol_list): Likewise.
+ (copy_action): Save the actions within the rule.
+ (packgram): Save them in rule_table.
+ * src/output.c (actions_output): New.
+ (output_parser): Use it on `%%actions'.
+ (output_rule_data): Don't free rule_table.
+ (output): Do it.
+ (prepare): Don't save the `action' muscle.
+ * src/bison.simple: s/%%action/%%actions/.
+
+2001-12-15 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_action): When --yacc, don't append a `;'
+ to the user action: let it fail if lacking.
+ Suggested by Arnold Robbins and Tom Tromey.
+
+2001-12-14 Akim Demaille <akim@epita.fr>
+
+ * src/lex.c (literalchar): Simply return the char you decoded, non
+ longer mess around with obstacks and int pointers.
+ Adjust all callers.
+
+2001-12-14 Akim Demaille <akim@epita.fr>
+
+ * src/lex.c (literalchar): Don't escape the special characters,
+ just decode them, and keep them as char (before, eol was output as
+ the 2 char string `\n' etc.).
+ * src/output.c (output_rule_data): Use quotearg to output the
+ token strings.
+
+2001-12-13 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
+ Do not infringe on the global user namespace when using C++.
+ (YYFPRINTF, YYSTDERR): New macros, needed for the above.
+ All uses of `fprintf' and `stderr' changed.
+
+ * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
+
+2001-12-13 Akim Demaille <akim@epita.fr>
+
+ The computation of nullable is broken: it doesn't handle empty
+ RHS's properly.
+
+ * tests/torture.at (GNU AWK Grammar): New.
+ * tests/sets.at (Nullable): New.
+ * src/nullable.c (set_nullable): Instead of blindly looping over
+ `ritems', loop over the rules, and then over their rhs's.
+
+ Work around Autotest bugs.
+
+ * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
+ frame, because Autotest understand lines starting with a `+' as
+ traces from the shell. Then, they are not processed properly.
+ Admittedly an Autotest bug, but we don't have time to wait for
+ Autotest to catch up.
+ * tests/regression.at (Broken Closure): Adjust to the new table
+ frames.
+ Move to...
+ * tests/sets.at: here.
+
+2001-12-13 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (closure): Use nrules instead of playing tricks
+ with BITS_PER_WORD.
+
+2001-12-13 Akim Demaille <akim@epita.fr>
+
+ * src/print.c (print_actions): Output the handling of `$' as the
+ traces do: shifting the token EOF. Before EOF was treated as a
+ nonterminal.
+ * tests/regression.at: Adjust some tests.
+ * src/print_graph.c (print_core): Complete the set of items via
+ closure. The next-to-final and final states are still unsatisfying,
+ but that's to be addressed elsewhere.
+ No longer output the rule numbers, but do output the state number.
+ A single loop for the shifts + gotos is enough, but picked a
+ distinct color for each.
+ (print_graph): Initialize and finalize closure.
+
+2001-12-13 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (readgram): Remove dead code, an strip useless
+ braces.
+ (get_type): Remove, unused.
+
+2001-12-12 Akim Demaille <akim@epita.fr>
+
+ * src/complain.h, src/complain.c: Remove error_one_per_line, rely
+ on that of lib/error.c.
+
+2001-12-12 Akim Demaille <akim@epita.fr>
+
+ Some hosts don't like `/' in includes.
+
+ * src/system.h: Include libgettext.h without qualifying the path.
+ * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
+ $(top_srcdir).
+
+2001-12-11 Marc Autret <autret_m@epita.fr>
+
+ * src/output.c (output_parser): Remove useless muscle.
+
+2001-12-11 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple: Remove #line just before %%epilogue. It
+ is now handled in ...
+ * src/reader.c (read_additionnal_code): Add the output of a
+ #line for the epilogue.
+
+2001-12-10 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (copy_definition): Re-use CPP-outed code which
+ replace precedent remove.
+ * src/bison.simple: Remove #line before %%prologue because
+ %%input-line is wrong at this time.
+
+2001-12-10 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (symbols_output): Clean up.
+ * src/output.c (output_gram, output): Clean up.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (initialize_lookaheads): New. Extracted from...
+ * src/LR0.c (set_state_table): here.
+ * src/lalr.c (lalr): Call it.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (shifts): Remove the `number' member: shifts are
+ attached to state, hence no longer need to be labelled with a
+ state number.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ Now that states have a complete set of members, the linked list of
+ shifts is useless: just fill directly the state's shifts member.
+
+ * src/state.h (shifts): Remove the `next' member.
+ * src/LR0.c (first_state, last_state): Remove.
+ Adjust the callers.
+ (augment_automaton): Don't look for the shifts that must be added
+ a shift on EOF: it is those of the state we looked for! But now,
+ since shifts are attached, it is no longer needed to looking
+ merely by its id: its number.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (augment_automaton): Better variable locality.
+ Remove an impossible branch: if there is a state corresponding to
+ the start symbol being shifted, then there is shift for the start
+ symbol from the initial state.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
+ only when appropriate: when insert_start_shifting_state' is not
+ invoked.
+ * tests/regression.at (Rule Line Numbers): Adjust.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (augment_automaton): Now that all states have shifts,
+ merge the two cases addition shifts to the initial state.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (set_state_table): Move to...
+ * src/LR0.c: here.
+ * src/lalr.c (lalr): Don't call it...
+ * src/LR0.c (generate_states): do it.
+ * src/LR0.h (first_state): Remove, only the table is used.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.h (first_shift, first_reduction): Remove.
+ * src/lalr.c: Don't use first_shift: find shifts through the
+ states.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c: Attach shifts to states as soon as they are
+ computed.
+ * src/lalr.c (set_state_table): Instead of assigning shifts to
+ state, just assert that the mapping was properly done.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (insert_start_shift): Rename as...
+ (insert_start_shifting_state): this.
+ (insert_eof_shifting_state, insert_accepting_state): New.
+ (augment_automaton): Adjust.
+ Better locality of the variables.
+ When looking if the start_symbol is shifted from the initial
+ state, using `while (... symbol != start_symbol ...)' sounds
+ better than `while (... symbol < start_symbol ...)': If fail
+ to see how the order between symbols could be relevant!
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.h: Don't declare `spec_name_prefix' and
+ `spec_file_prefix', declared by src/files.h.
+ * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
+ * src/muscle_tab.c (muscle_init): Default prefix to NULL.
+ * src/output.c (prepare): Adjust.
+ * src/reader.c (symbols_output): Likewise.
+ * src/vmsgetargs.c: Vaguely adjust, but who cares?
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/muscle_tab.c (muscle_init): NULL is a better default than
+ `"0"'.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (reader): Calling symbols_output once is enough.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ Now that states have a complete set of members, the linked list of
+ reductions is useless: just fill directly the state's reductions
+ member.
+
+ * src/state.h (struct reductions): Remove member `number' and
+ `next'.
+ * src/LR0.c (first_reduction, last_reduction): Remove.
+ (save_reductions): Don't link the new reductions, store them in
+ this_state.
+ * src/lalr.c (set_state_table): No need to attach reductions to
+ states, it's already done.
+ * src/output.c (output_actions): No longer free the shifts, then
+ the reductions, then the states: free all the states and their
+ members.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/options.c (OPTN, DRTV, BOTH): New.
+ (option_table): Use them.
+
+ * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
+ the job of system.h.
+ * src/options.c: Don't include stdio.h and xalloc.h for the same
+ reasons.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output, prepare): Make sure the values of the
+ muscles `action' and `prologue' are 0-terminated.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ Clean up GCC warnings.
+
+ * src/reader.c (copy_action): `buf' is not used.
+ (parse_skel_decl): Be static.
+ * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
+ * src/options.h (create_long_option_table): Have a real prototype.
+ * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
+ (hash_delete_at): Return const void *.
+ Adjust casts to preserve the const.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Require 2.52g.
+ M4 is not needed, but AUTOM4TE is.
+ * m4/m4.m4: Remove.
+ * tests/Makefile.am: Adjust.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ One structure for states is enough, even though theoretically
+ there are LR(0) states and LALR(1) states.
+
+ * src/lalr.h (state_t): Remove.
+ (state_table): Be state_t **, not state_t *.
+ * src/state.h (core, CORE_ALLOC): Rename as...
+ (state_t, STATE_ALLOC): this.
+ Add the LALR(1) members: shifts, reductions, errs.
+ * src/LR0.c (state_table): Rename as...
+ (state_hash): this, to avoid name clashes with the global
+ `state_table'.
+ * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
+ * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
+
+2001-12-10 Akim Demaille <akim@epita.fr>
+
+ Bison dumps core on bash.y.
+ Reported by Pascal Bart.
+
+ * src/warshall.c (bitmatrix_print): New.
+ (TC): Use it.
+ When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
+ j must be the outer loop.
+ * tests/regression.at (Broken Closure): New.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
+ its argument.
+ Reported by Peter Hamorsky.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (err_table): Remove.
+ (resolve_sr_conflict): Adjust.
+ * src/lalr.h (state_t.reduction_table, state_t.shift_table):
+ Rename as...
+ (state_t.reductions, state_t.shifts): this.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (reduce_grammar_tables): No longer disable the
+ removal of useless rules via CPP but via `if (0)', so that the
+ compiler still check the code is valid.
+ For instance, it should have noticed `rline' no longer exists: use
+ the `line' member of rule_t.
+ * src/gram.c (dummy, rline): Remove, unused.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (pack_vector): Use assert, not berror.
+ * src/main.c (berror): Remove, unused.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ New experimental feature: if --verbose --trace output all the
+ items of a state, not only its kernel.
+
+ * src/print.c (print_core): If `trace_flag', then invoke closure
+ before outputting the items of the state (print_core is no longer
+ a correct name them).
+ (print_results): Invoke new_closure/free_closure if needed.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
+ * src/closure.c, src/closure.h (itemsetsize): Rename as...
+ (nitemset): for consistency with the rest of the project.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (print_closure): Improve.
+ (closure): Use it for printing input and output.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
+ indexed by nonterminals.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
+ what it was!).
+ * src/warshall.h: Remove accidental duplication of the content.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (set_fderives): De-obfuscate.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (print_firsts, print_fderives): De-obfuscate.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (set_firsts): De-obfuscate.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (action_row): De-obfuscate
+ using the good o' techniques: arrays not pointers, variable
+ locality, BITISSET, RESETBIT etc.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ Pessimize the code to simplify it: from now on, all the states
+ have a valid SHIFTS, which NSHIFTS is possibly 0.
+
+ * src/LR0.c (shifts_new): Be global and move to..
+ * src/state.c, src/state.h: here.
+ * src/conflicts, src/lalr.c, src/output.c, src/print.c,
+ * src/print_graph: Adjust.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
+ * src/conflicts.c: Use it.
+ Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
+ incorrectly ``simplified''.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
+ using the good o' techniques: arrays not pointers, variable
+ locality, BITISSET, RESETBIT etc.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (SHIFT_SYMBOL): New.
+ * src/conflicts.c: Use it to deobfuscate.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
+ (print_reductions): De-obfuscate using the good o' techniques:
+ arrays not pointers, variable locality, BITISSET.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (print_reductions): Arrays, not pointers.
+ Use BITISSET.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (print_reductions): Pessimize, but clarify.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (print_reductions): Improve variable locality.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (print_reductions): Pessimize, but clarify.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (print_reductions): Improve variable locality.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
+ * src/lalr.c: Use them.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (augment_automaton): Formatting changes.
+ Better variable locality.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (matrix_print): New.
+ (transpose): Use it.
+ Use arrays instead of pointers.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (maxrhs): Move to...
+ * src/gram.c, src/gram.h (ritem_longest_rhs): here.
+ * src/lalr.c (build_relations): Adjust.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (transpose): Free the memory allocated to the
+ argument, as it is replaced by the results by the unique caller.
+ (build_relations): Merely invoke transpose: it handles the memory
+ deallocation.
+ Improve variable locality.
+ Avoid variables used as mere abbreviations.
+ (compute_lookaheads): Use arrays instead of pointers.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (initialize_F): Improve variable locality.
+ Avoid variables used as mere abbreviations.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/derives.c (print_derives): Display the ruleno.
+ * src/lalr.c (initialize_F, transpose): Better variable locality
+ to improve readability.
+ Avoid variables used as mere abbreviations.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (traverse): Use arrays instead of pointers.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
+ the handling of squeue.
+ `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ Because useless nonterminals are now kept alive (instead of being
+ `destroyed'), we now sometimes examine them, and store information
+ related to them. Hence we need to know their number, and adjust
+ memory allocations.
+
+ * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
+ static.
+ * src/LR0.c (allocate_itemsets): The memory allocated to
+ `symbol_count' was used for two different purpose: once to count
+ the number of occurrences of each symbol, and later reassigned to
+ `shift_symbol', containing the symbol that can be shifted from a
+ given state.
+ Deobfuscate, i.e., allocate, use and free `symbol_count' here
+ only, and...
+ (new_itemsets): Allocate `shift_symbol' here.
+ (allocate_itemsets): symbol_count includes useless nonterminals.
+ Make room for them.
+ (free_storage): Use `free', not `XFREE', for pointers that cannot
+ be null.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/nullable.c (set_nullable): Deobfuscate the handling of
+ ritem.
+ `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
+
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/gram.c, src/gram.h (ritem_print): New.
+ * src/gram.c (dummy): Remove, now there is actual code in gram.c.
+ (This useless function was defined only to work around VMS linkers
+ that can't handle compilation units with variables only).
+ * src/reduce.c (dump_grammar): Use it to trace the construction of
+ ritem.
+
+2001-12-04 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.simple (union yyalloc): Change member names
+ to be the same as the stack names.
+ (yyparse): yyptr is now union yyalloc *, not char *.
+ (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
+ and may generate better code on some machines.
+ (yystpcpy): Use prototype if __STDC__ is defined, not just
+ if __cplusplus is defined.
+
+2001-11-30 Akim Demaille <akim@epita.fr>
+
+ * configure.in (WARNING_CFLAGS): Add -Werror when possible.
+ (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
+ Gettext doesn't compile cleanly, and dies with -Werror.
+ * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
+ Include WARNING_CFLAGS here.
+ * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
+ before being defined.
+
+2001-11-27 Paul Eggert <eggert@twinsun.com>
+
+ * lib/quotearg.h (quotearg_n, quotearg_n_style):
+ First arg is int, not unsigned.
+ * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
+ (SIZE_MAX, UINT_MAX): New macros.
+ (quotearg_n_options): Abort if N is negative.
+ Avoid overflow check on hosts where size_t is 64 bits and int
+ is 32 bits, as overflow is impossible there.
+ Fix off-by-one typo that caused unnecessary reallocation.
+
+2001-11-29 Paul Eggert <eggert@twinsun.com>
+
+ Name space cleanup in generated parser.
+
+ * doc/bison.texinfo (Bison Parser): Discuss system headers
+ and their effect on the user name space.
+
+ * src/bison.simple:
+ (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
+ YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
+ i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
+
+ (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
+ on user names when possible.
+
+ (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
+ Simplify test for whather <alloca.h> exists.
+
+ (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
+
+ (<stdio.h>): Include if YYDEBUG.
+
+ (yymemcpy): Renamed from __yy_memcpy. Do not define unless
+ ! defined (yyoverflow) && ! defined (yymemcpy).
+
+ (yymemcpy, yyparse): Rename local variables as needed so that
+ they all begin with 'yy'.
+
+ (yystrlen, yystpcpy): New functions.
+
+ (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
+ All uses changed.
+
+ (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
+ instead of relying on string.h functions. Use YYSTACK_ALLOC
+ and YYSTACK_FREE instead of malloc and free.
+
+2001-11-30 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
+ before their first uses.
+ (YYBISON, YYPURE): Move to the top of the output.
+
+2001-11-30 Akim Demaille <akim@epita.fr>
+
+ * tests/reduce.at (Useless Nonterminals): Fix.
+
+2001-11-30 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
+ if body instead of `;' to pacify GCC's warnings.
+
+2001-11-30 Akim Demaille <akim@epita.fr>
+
+ Instead of mapping the LHS of unused rules to -1, keep the LHS
+ valid, but flag the rules as invalid.
+
+ * src/gram.h (rule_t): `useful' is a new member.
+ * src/print.c (print_grammar): Adjust.
+ * src/derives.c (set_derives): Likewise.
+ * src/reader.c (packgram, reduce_output): Likewise.
+ * src/reduce.c (reduce_grammar_tables): Likewise.
+ * tests/reduce.at (Underivable Rules, Useless Rules): New.
+
+2001-11-30 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (reduce_output): Formatting changes.
+ * src/print.c (print_results, print_grammar): Likewise.
+ * tests/regression.at (Rule Line Numbers)
+ (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
+
+2001-11-30 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (nonterminals_reduce): Instead of throwing away
+ useless nonterminals, move them at the end of the symbol arrays.
+ (reduce_output): Adjust.
+ * tests/reduce.at (Useless Nonterminals): Adjust.
+
+2001-11-30 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c: Various comment/formatting changes.
+ (nonterminals_reduce): New, extracted from...
+ (reduce_grammar_tables): here.
+ (reduce_grammar): Call nonterminals_reduce.
+
+2001-11-29 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.simple (YYSTACK_REALLOC): Remove.
+ (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
+ (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
+ New macros.
+ (union yyalloc): New type.
+ (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
+ an arbitrary restriction on hosts where size_t is wider than int.
+
+ (yyparse): Don't dump core if alloca or malloc fails; instead, report
+ a parser stack overflow. Allocate just one block of memory for all
+ three stacks, instead of allocating three blocks; this typically is
+ faster and reduces fragmentation.
+
+ Do not limit the number of items in the stack to a value that fits
+ in 'int', as this is an arbitrary limit on hosts with 64-bit
+ size_t and 32-bit int.
+
+2001-11-29 Marc Autret <autret_m@epita.fr>
+
+ * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
+ of defining YYERROR_VERBOSE.
+ [AT_DATA]: $4 is now out of C declarations in the prologue.
+
+2001-11-28 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (parse_dquoted_param): New.
+ (parse_skel_decl): Use it.
+ * src/lex.h: Add its prototype.
+ * src/lex.c (literalchar): Become not static.
+
+2001-11-28 Marc Autret <autret_m@epita.fr>
+
+ * src/output.h: And put its extern declaration here.
+ * src/output.c (error_verbose): Define here.
+ (prepare): Echo name modification.
+ * src/getargs.h: Clean its extern declaration.
+ * src/getargs.c (error_verbose_flag): Remove.
+ (getargs): Remove case 'e'.
+ * src/options.c (option_table): 'error-verbose' is now seen as simple
+ percent option.
+ Include output.h.
+
+ * src/reader.c (read_declarations): Remove case tok_include.
+ (parse_include_decl): Remove.
+ * src/lex.h (token_t): Remove tok_include.
+ * src/options.c (option_table): 'include' is now a simple command line
+ option.
+
+2001-11-28 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple: Adjust muscle names.
+ * src/muscle_tab.c (muscle_init): Also rename the muscles.
+ * src/output.c (prepare): s/_/-/ for the muscles names.
+ (output_parser): When scanning for a muscle, allow '-' instead of '_'.
+
+2001-11-28 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple: Fix debug.
+ [YYERROR_VERBOSE]: Re-integrate as an internal macro.
+
+2001-11-28 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (shifts_new): New.
+ (save_shifts, insert_start_shift, augment_automaton): Use it.
+
+2001-11-28 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (closure): `b' and `ruleno' denote the same value:
+ keep ruleno only.
+
+2001-11-28 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (closure): Instead of looping over word in array
+ then bits in words, loop over bits in array.
+
+2001-11-28 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (closure): No longer optimize the special case
+ where all the bits of `ruleset[r]' are set to 0, to make the code
+ clearer.
+
+2001-11-28 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (closure): `r' and `c' are new variables, used to
+ de-obfuscate accesses to RULESET and CORE.
+
+2001-11-28 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (reduce_print): Use ngettext.
+ (dump_grammar): Improve the trace accuracy.
+
+2001-11-28 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (dump_grammar): Don't translate trace messages.
+
+2001-11-28 Akim Demaille <akim@epita.fr>
+
+ * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
+ * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
+ as all tags are free'ed afterwards.
+ From Enrico Scholz.
+
+2001-11-27 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
+ use alloca when we didn't want to, and vice versa.
+
+2001-11-27 Marc Autret <autret_m@epita.fr>
+
+ * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
+ initialization.
+ * src/output.c (prepare): Remove its update.
+
+2001-11-27 Marc Autret <autret_m@epita.fr>
+
+ * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
+ Use %error-verbose.
+
+2001-11-27 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple: Remove YYERROR_VERBOSE using.
+ Use %%error_verbose.
+ (yyparse): Likewise.
+ * src/output.c (prepare): Give its final value.
+ * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
+ * src/getargs.h: Add its extern declaration.
+ * src/getargs.c (error_verbose_flag): New int.
+ (getargs): Update to catch new case.
+ * src/options.c (option_table): 'error-verbose' is a new option.
+ (shortopts): Update.
+
+2001-11-27 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: Use intl/libgettext.h.
+ * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
+
+2001-11-27 Akim Demaille <akim@epita.fr>
+
+ * tests/torture.at (Exploding the Stack Size with Malloc):
+ s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
+
+2001-11-27 Akim Demaille <akim@epita.fr>
+
+ * src/files.c: Include error.h.
+ Reported by Hans Aberg.
+
+2001-11-26 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (parse_include_decl): New, not yet implemented.
+ (read_declarations): Add case tok_include.
+ * src/getargs.h (include): Add its extern definition.
+ * src/getargs.c (include): New const char *.
+ (getargs): Add case '-I'.
+ * src/options.c (option_table): Add include as command line and
+ percent option.
+ * src/lex.h (token_t): Add tok_include.
+
+2001-11-26 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (readgram): Make sure rules for mid-rule actions
+ have a lineno equal to that of their host rule.
+ Reported by Hans Aberg.
+ * tests/regression.at (Rule Line Numbers): New.
+
+2001-11-26 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
+ size_ts.
+
+2001-11-26 Akim Demaille <akim@epita.fr>
+
+ * src/complain.c, src/complain.h (error): Remove, provided by
+ lib/error.[ch].
+
+2001-11-26 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (read_declarations): Don't abort on tok_illegal,
+ issue an error message.
+ * tests/regression.at (Invalid %directive): New.
+ Reported by Hans Aberg.
+
+2001-11-26 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
+ * lib/Makefile.am (libbison_a_SOURCES): Adjust.
+
+2001-11-26 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (conflicts_print): Don't complain at all when
+ there are no reduce/reduce conflicts, and as many shift/reduce
+ conflicts as expected.
+ * tests/regression.at (%expect right): Adjust.
+
+2001-11-23 Akim Demaille <akim@epita.fr>
+
+ * lib/alloca.c: Update, from fileutils.
+
+2001-11-23 Akim Demaille <akim@epita.fr>
+
+ * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
+
+2001-11-23 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: Include alloca.h.
+ * src/main.c (main) [C_ALLOCA]: Call alloca (0).
+
+2001-11-23 Akim Demaille <akim@epita.fr>
+
+ * src/print_graph.c (print_actions): Remove `rule', unused.
+ * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
+ pacify GCC's signed < unsigned warnings.
+ * src/closure.c (itemsetsize): Likewise.
+ * src/reader.c (symbol_list_new): Static.
+
+2001-11-23 Akim Demaille <akim@epita.fr>
+
+ Attaching lineno to buckets is stupid, since only one copy of each
+ symbol is kept, only the line of the first occurrence is kept too.
+
+ * src/symtab.h, src/symtab.c (bucket): Remove the line member.
+ * src/reader.c (rline_allocated): Remove, unused.
+ (symbol_list): Have a `line' member.
+ (symbol_list_new): New.
+ (readgram): Use it.
+ * src/print.c (print_grammar): Output the rule line numbers.
+ * tests/regression.at (Solved SR Conflicts)
+ (Unresolved SR Conflicts): Adjust.
+ Reported by Hans Aberg.
+
+2001-11-22 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
+
+2001-11-22 Marc Autret <autret_m@epita.fr>
+
+ * src/muscle_tab.c (muscle_init): Remove initialization of
+ skeleton muscle.
+ * src/output.c (output_master_parser): Do it here.
+
+2001-11-20 Akim Demaille <akim@epita.fr>
+
+ * po/sv.po: New.
+ * configure.in (ALL_LINGUAS): Adjust.
+ * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
+ longer contains strings to translate.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (conflicts_print): Add a missing \n.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/nullable.c (nullable_print): New.
+ (set_nullable): Call it when tracing.
+ Better locality of variables.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/print.c (print_actions): Better locality of variables.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/derives.c (print_derives): Fix and enrich.
+ * src/closure.c (print_fderives): Likewise.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (itemsetend): Remove, replaced with...
+ (itemsetsize): new.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (kernel_end): Remove, replaced with...
+ (kernel_size): new.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (set_conflicts): Use arrays instead of pointers
+ to clarify.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (closure): Use arrays instead of pointers to clarify.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c, src/derives.c, src/nullable.c: Adjust various
+ trace messages.
+ * src/LR0.c: Likewise.
+ (allocate_itemsets): Use arrays instead of pointers to clarify.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (statistics_flag): Replace with...
+ (trace_flag): New.
+ (longopts): Accept --trace instead of --statistics.
+ * src/getargs.h, src/options.c: Adjust.
+ * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
+ * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
+ pointers to clarify the code.
+ (save_reductions, save_shifts): Factor common parts of alternatives.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (new_state, get_state): Complete TRACE code.
+ * src/closure.c: Include `reader.h' to get `tags', needed by the
+ trace code.
+ Rename the conditional DEBUG as TRACE.
+ Output consistently TRACEs to stderr, not stdout.
+ * src/derives.c: Likewise.
+ * src/reduce.c: (inaccessable_symbols): Using if is better style
+ than goto.
+ Use `#if TRACE' instead of `#if 0' for tracing code.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/system.h (LIST_FREE, shortcpy): New.
+ * src/LR0.c: Use them.
+ * src/output.c (free_itemsets, free_reductions, free_shifts):
+ Remove, replaced by LIST_FREE.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
+ (REDUCTIONS_ALLOC): New.
+ * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
+ allocation.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.c (new_state): Complete trace code.
+ * src/nullable.c (set_nullable): Don't translate traces.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/print_graph.c (print_core): Better locality of variables.
+ * src/print.c (print_core): Likewise.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/vcg.c: You do the output, so you are responsible of the
+ handling of VCG syntax, in particular: use quotearg.
+ * src/print_graph.c: Don't.
+ (print_actions): Don't output the actions as part of the nodes,
+ since that's the job of the edges.
+ (print_state): Don't output by hand: fill the node description,
+ and ask for its output.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple (yyparse): When verbosely reporting an error,
+ no longer put additional quotes around token names.
+ * tests/calc.at: Adjust.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
+ * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
+ * src/output.c: Adjust.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
+ (rule_t): this.
+ * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (rule_t): New.
+ (rule_table): New.
+ (rrhs, rlhs): Remove, part of state_t.
+ * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
+ * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
+ * src/reader.c, src/reduce.c: Adjust.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (symbols_output): New, extracted from...
+ (packsymbols): Here.
+ (reader): Call it.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
+ (maxrhs): this new function.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (F): New macro to access the variable F.
+ Adjust.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h (LA): New macro to access the variable LA.
+ * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
+ * src/lalr.c: Adjust.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.c (initialize_LA): Only initialize LA. Let...
+ (set_state_table): handle the `lookaheads' members.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h (lookaheads): Removed array, whose contents is now
+ a member of...
+ (state_t): this structure.
+ * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
+ Adjust.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h (consistent): Removed array, whose contents is now
+ a member of...
+ (state_t): this structure.
+ * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
+ Adjust.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
+ contents are now members of...
+ (state_t): this structure.
+ * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
+ Adjust.
+
+2001-11-19 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h (state_t): New.
+ (state_table): Be a state_t * instead of a core **.
+ (accessing_symbol): Remove, part of state_t.
+ * src/lalr.c: Adjust.
+ (set_accessing_symbol): Merge into...
+ (set_state_table): this.
+ * src/print_graph.c, src/conflicts.c: Adjust.
+
+2001-11-14 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at, tests/output.at, tests/regression.at,
+ * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
+ now the tests are run in private dirs, therefore AC_CLEANUP and
+ family can be simplified to 0-ary.
+ * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
+ use abs. path to find config.h.
+ * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
+ stderr, there can be way too much random noise.
+ Instead pass -Werror to GCC and rely on the exit status.
+ Reported by Wolfram Wagner.
+
+2001-11-14 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
+ defined only if yyoverflow is defined, to avoid `warning: unused
+ variable `yyvs1''.
+ Reported by The Test Suite.
+
+2001-11-14 Akim Demaille <akim@epita.fr>
+
+ * src/print.c: Include reduce.h.
+ Reported by Hans Aberg.
+
+2001-11-14 Akim Demaille <akim@epita.fr>
+
+ * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
+ Revert a previous patch: these are really const.
+ * src/conflicts.c (conflict_report): Additional useless pair of
+ braces to pacify GCC's warnings for `if () if () {} else {}'.
+ * src/lex.c (parse_percent_token): Replace equal_offset with
+ arg_offset.
+ arg is const.
+ Be sure to strdup `arg' when used, since there is no reason for
+ token_buffer not to change.
+
+2001-11-14 Akim Demaille <akim@epita.fr>
+
+ * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
+ definition.
+ * src/main.c (main): Use them.
+ Suggested by Hans Aberg.
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/system.h (ngettext): Now that we use ngettext, be sure to
+ provide a default definition when NLS are not used.
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
+ Use @kbd to denote user input.
+ (Language and Grammar): ANSIfy the example.
+ Adjust its layout for info/notinfo.
+ (Location Tracking Calc): Output error messages to stderr.
+ Output locations in a more GNUtically correct way.
+ Fix a couple of Englishos.
+ Adjust @group/@end group pairs.
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ %expect was not functioning at all.
+
+ * src/conflicts.c (expected_conflicts): Set to -1.
+ (conflict_report): Use ngettext.
+ (conflicts_print): Check %expect and make its violation an error.
+ * doc/bison.texinfo (Expect Decl): Adjust.
+ * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
+ * tests/regression.at (%expect not enough, %expect right)
+ (%expect too much): New.
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Conflicts): Rename as...
+ (Unresolved SR Conflicts): this.
+ (Solved SR Conflicts): New.
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.c (print_results): Rename as...
+ (reduce_output): This.
+ Output to OUT, passed as argument, instead of output_obstack.
+ (dump_grammar): Likewise.
+ (reduce_free): New.
+ Also free V1.
+ (reduce_grammar): No longer call reduce_output, since...
+ * src/print.c (print_results): do it.
+ * src/main.c (main): Call reduce_free;
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (print_reductions): Accept OUT as argument.
+ Output to it, not to output_obstack.
+ * src/print.c (print_actions): Adjust.
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
+ the result instead of using...
+ (src_total, rrc_total, src_count, rrc_count): Remove.
+ (any_conflicts): Remove.
+ (print_conflicts): Split into...
+ (conflicts_print, conflicts_output): New.
+ * src/conflicts.h: Adjust.
+ * src/main.c (main): Invoke both conflicts_output and conflicts_print.
+ * src/print.c (print_grammar): Issue `\n' between two rules.
+ * tests/regression.at (Conflicts): New.
+ Reported by Tom Lane.
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Invalid input): Remove, duplicate with
+ ``Invalid input: 1''.
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ * tests/torture.at (AT_DATA_STACK_TORTURE)
+ (Exploding the Stack Size with Alloca)
+ (Exploding the Stack Size with Malloc): New.
+
+2001-11-12 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple (YYSTACK_REALLOC): New.
+ (yyparse) [!yyoverflow]: Use it and free the old stack.
+ Reported by Per Allansson.
+
+2001-11-12 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/bison.simple: Define type yystype instead of YYSTYPE, and
+ define CPP macro, which substitute YYSTYPE by yystype.
+ * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
+ with yyltype/YYLTYPE. This allows inclusion of the generated
+ header within the parser if the compiler, such as GGC, accepts
+ multiple equivalent #defines.
+ From Akim.
+
+2001-11-05 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (symbols_output): New, extracted from...
+ (packsymbols): here.
+ (reader): Adjust.
+
+2001-11-05 Akim Demaille <akim@epita.fr>
+
+ * src/lex.c (parse_percent_token): s/quotearg/quote/.
+
+2001-11-05 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
+ pattern.
+
+2001-11-05 Akim Demaille <akim@epita.fr>
+
+ * src/options.h (struct option_table_struct): set_flags is void*.
+ * src/options.c (longopts): Support `--output' and `%output'.
+ (usage): Adjust.
+ * src/lex.h (tok_setopt): Remove, replaced with...
+ (tok_intopt, tok_stropt): these new guys.
+ * src/lex.c (getopt.h): Not needed.
+ (token_buffer, unlexed_token_buffer): Not const.
+ (percent_table): Promote `-' over `_' in directive names.
+ Active `%name-prefix', `file-prefix', and `output'.
+ (parse_percent_token): Accept possible arguments to directives.
+ Promote `-' over `_' in directive names.
+
+2001-11-04 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Decl Summary): Split the list into
+ `directives for grammars' and `directives for bison'.
+ Sort'em.
+ Add description of `%name-prefix', `file-prefix', and `output'.
+ Promote `-' over `_' in directive names.
+ (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
+ Simplify the description of `--name-prefix'.
+ Promote `-' over `_' in directive names.
+ Promote `--output' over `--output-file'.
+ Fix the description of `--defines'.
+ * tests/output.at: Exercise %file-prefix and %output.
+
+2001-11-02 Akim Demaille <akim@epita.fr>
+
+ * doc/refcard.tex: Update.
+
+2001-11-02 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h (SUNDEF): New.
+ * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
+ stand for `uninitialized', instead of 0.
+ * src/reader.c (packsymbols, parse_thong_decl): Adjust.
+ * src/lex.c (lex): Adjust.
+
+ * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
+ Number it 0.
+ Let yylex return it instead of a plain 0.
+ Reported by Dick Streefland.
+
+2001-11-02 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Mixing %token styles): New test.
+
+2001-11-02 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (parse_thong_decl): Formatting changes.
+ (token_translations_init): New, extracted from...
+ (packsymbols): Here.
+ Adjust.
+
+2001-11-01 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
+ Check that `9foo.y' produces correct cpp guards.
+ * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
+ guards.
+ Reported by Wwp.
+
+2001-11-01 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Invalid input: 2): New.
+ * src/lex.c (unlexed_token_buffer): New.
+ (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
+ too.
+ Reported by Wwp.
+
+2001-11-01 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at: Catch up with 1.30.
+ * configure.in: Bump to 1.49a.
+ Adjust to newer Autotest.
+
+2001-10-19 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/conflicts.c: Move global variables rrc_total and src_total ...
+ (print_conflicts): here.
+ * src/output.c (output): Free global variable user_toknums.
+ * src/lex.c (token_obstack): Become static.
+
+2001-10-18 Akim Demaille <akim@epita.fr>
+
+ * tests/atlocal.in (GCC): Add.
+ * tests/calc.at: s/m4_match/m4_bmatch/.
+ s/m4_patsubst/m4_bpatsubst/.
+ (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
+ * configure.in: AC_SUBST(GCC).
+
+2001-10-14 Marc Autret <autret_m@epita.fr>
+
+ * src/options.c (create_long_option_table): Fix.
+
+2001-10-10 Akim Demaille <akim@epita.fr>
+
+ * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
+
+2001-10-04 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (parse_union_decl): Push the caracters in
+ union_obstack, not attrs_obstack.
+
+2001-10-04 Akim Demaille <akim@epita.fr>
+
+ Merge in the branch 1.29.
+
+ * src/reader.c (packsymbols): Use a temporary obstack for
+ `%%tokendef', since output_stack is already used elsewhere.
+
+ 2001-10-02 Akim Demaille <akim@epita.fr>
+
+ Bump 1.29d.
+
+ 2001-10-02 Akim Demaille <akim@epita.fr>
+
+ Version 1.29c.
+
+ 2001-10-02 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Invalid CPP headers): New.
+ From Alexander Belopolsky.
+ * src/files.c (compute_header_macro): Map non alnum chars to `_'.
+
+ 2001-10-02 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.at (Invalid input): New.
+ * src/lex.c (lex): Be sure to set `token_buffer' in any case.
+ Reported by Shura.
+
+ 2001-10-02 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at: Now that --debug works, the tests must be adjusted.
+
+ 2001-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_parser): Assert `skeleton'.
+ * src/files.c (skeleton_find): Look harder for skeletons on DOSish
+ systems.
+ From Shura.
+
+ 2001-10-01 Marc Autret <autret_m@epita.fr>
+
+ * src/lex.h: Echo modifications.
+ * src/lex.c (unlex): Parameter is now token_t.
+ From Hans Aberg.
+
+ 2001-10-01 Marc Autret <autret_m@epita.fr>
+
+ * src/main.c: Include lex.h.
+ From Hans Aberg.
+
+ 2001-09-29 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
+
+ 2001-09-28 Akim Demaille <akim@epita.fr>
+
+ * tests/testsuite.at: Update to newer Autotest.
+ * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
+
+ 2001-09-27 Akim Demaille <akim@epita.fr>
+
+ Position independent wrapper.
+
+ * tests/bison: Remove.
+ * tests/bison.in: New.
+ * configure.in: Adjust.
+
+ 2001-09-27 Paul Eggert <eggert@twinsun.com>
+
+ Port quotearg fixes from tar 1.13.24.
+
+ * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
+ tm to be declared.
+ (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
+ (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
+
+ * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
+ * m4/mbrtowc.m4: New file.
+ * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
+ Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
+
+ 2001-09-27 Akim Demaille <akim@epita.fr>
+
+ Bump to 1.29c.
+
+ 2001-09-27 Akim Demaille <akim@epita.fr>
+
+ Version 1.29b.
+
+ 2001-09-25 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: Include `xalloc.h'.
+ Remove it from the C files.
+ * src/files.c (output_files): Free the obstacks.
+ * src/lex.c (init_lex): Rename as...
+ (lex_init): this.
+ (lex_free): New.
+ * src/main.c (main): Use it.
+
+ 2001-09-24 Marc Autret <autret_m@epita.fr>
+
+ * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
+ to output informations in fout (FILE*).
+ (open_graph, close_graph): Likewise.
+ (output_graph, output_edge, output_node): Likewise.
+ * src/vcg.h: Update function prototypes.
+ * src/print_graph.c (print_graph): Open output graph file.
+ (print_actions): Adjust.
+ * src/files.h: Remove extern declaration.
+ * src/files.c: Remove graph_obstack declaration.
+ (open_files): Remove graph_obstack initialization.
+ (output_files): Remove graph_obstack saving.
+
+ 2001-09-24 Marc Autret <autret_m@epita.fr>
+
+ * src/files.c (compute_output_file_names): Fix.
+
+ 2001-09-24 Marc Autret <autret_m@epita.fr>,
+ Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (reader): Remove call to free_symtab ().
+ * src/main.c (main): Call it here.
+ Include symtab.h.
+ * src/conflicts.c (initialize_conflicts): Rename as...
+ (solve_conflicts): this.
+ * src/print.c (print_core, print_actions, print_state)
+ (print_grammar): Dump to a file instead a `output_obstack'.
+ (print_results): Dump `output_obstack', and then proceed with the
+ FILE *.
+ * src/files.c (compute_output_file_names, close_files): New.
+ (output_files): Adjust.
+ * src/main.c (main): Adjust.
+
+ 2001-09-23 Marc Autret <autret_m@epita.fr>
+
+ * src/files.c (compute_header_macro): Computes header macro name
+ from spec_defines_file when given.
+
+ 2001-09-23 Marc Autret <autret_m@epita.fr>
+
+ * src/files.c (output_files): Add default extensions.
+
+ 2001-09-22 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (finalize_conflicts): Rename as...
+ (free_conflicts): this.
+
+ 2001-09-22 Akim Demaille <akim@epita.fr>
+
+ * src/gram.c (gram_free): Rename back as...
+ (dummy): this.
+ (output_token_translations): Free `token_translations'.
+ * src/symtab.c (free_symtab): Free the tag field.
+
+ 2001-09-22 Akim Demaille <akim@epita.fr>
+
+ Remove `translations' as it is always set to true.
+
+ * src/gram.h: Adjust.
+ * src/reader.c (packsymbols, parse_token_decl): Adjust
+ * src/print.c (print_grammar): Adjust.
+ * src/output.c (output_token_translations): Adjust.
+ * src/lex.c (lex): Adjust.
+ * src/gram.c: Be sure the set pointers to NULL.
+ (dummy): Rename as...
+ (gram_free): this.
+
+ 2001-09-22 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Invoke AM_LIB_DMALLOC.
+ * src/system.h: Use dmalloc.
+ * src/LR0.c: Be sure to have pointers initialized to NULL.
+ (allocate_itemsets): Allocate kernel_items only if needed.
+
+ 2001-09-22 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Bump to 1.29b.
+ * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
+ * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
+ need xmalloc.c in calc.y.
+ From Pascal Bart.
+
+ 2001-09-21 Akim Demaille <akim@epita.fr>
+
+ Version 1.29a.
+ * Makefile.maint, config/config.guess, config/config.sub,
+ * config/missing: Update from masters.
+ * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
+ upon package.m4.
+ * configure.in (ALL_LINGUAS): Add `tr'.
+
+ 2001-09-21 Akim Demaille <akim@epita.fr>
+
+ * tests/Makefile.am (package.m4): Move to...
+ ($(srcdir)/$(TESTSUITE)): here.
+
+ 2001-09-20 Akim Demaille <akim@epita.fr>
+
+ * src/complain.c: No longer try to be standalone: use system.h.
+ Don't assume __STDC__ is defined to 1. Just test if it is defined.
+ * src/complain.h: Likewise.
+ * src/reduce.c (useless_nonterminals, inaccessable_symbols):
+ Remove the unused variable `n'.
+ From Albert Chin-A-Young.
+
+ 2001-09-18 Marc Autret <autret_m@epita.fr>
+
+ * doc/bison.1: Update.
+ * doc/bison.texinfo (Bison Options): Update --defines and --graph
+ descriptions.
+ (Option Cross Key): Update.
+ Add --graph.
+
+ 2001-09-18 Marc Autret <autret_m@epita.fr>
+
+ * tests/regression.at: New test (comment in %union).
+
+ 2001-09-18 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
+ do that.
+ Reported by Keith Browne.
+
+ 2001-09-18 Marc Autret <autret_m@epita.fr>
+
+ * tests/output.at: Add tests for --defines and --graph.
+
+ 2001-09-18 Marc Autret <autret_m@epita.fr>
+
+ * tests/output.at: Removes tests of %{header,src}_extension features.
+
+ 2001-09-18 Akim Demaille <akim@epita.fr>
+
+ * tests/Makefile.am (package.m4): New.
+ * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
+ (_AT_CHECK_CALC_ERROR): Likewise.
+ Factor the `, ' part of verbose error messages.
+
+ 2001-09-18 Marc Autret <autret_m@epita.fr>
+
+ * src/getargs.c (longopts): Declare --defines and --graph as options
+ with optional arguments.
+ * src/files.h: Add extern declarations.
+ * src/files.c (spec_graph_file, spec_defines_file): New.
+ (output_files): Update.
+ Remove CPP-outed code.
+
+ 2001-09-18 Marc Autret <autret_m@epita.fr>
+
+ Turn off %{source,header}_extension feature.
+
+ * src/files.c (compute_exts_from_gf): Update.
+ (compute_exts_from_src): Update.
+ (output_files): CPP-out useless code.
+ * src/files.h: Remove {header,source}_extension extern declarations.
+ * src/reader.c (parse_dquoted_param): CPP-out.
+ (parse_header_extension_decl): Remove.
+ (parse_source_extension_decl): Remove.
+ (read_declarations): Remove cases tok_{hdrext,srcext}.
+ * src/lex.c (percent_table): Remove {header,source}_extension entries.
+ * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
+
+ 2001-09-10 Akim Demaille <akim@epita.fr>
+
+ * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
+ (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
+ (AT_CHECK_OUTPUT): this.
+ Merely check ls' exit status, its output is useless.
+
+ 2001-09-10 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at: Use m4_match.
+ (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
+
+ 2001-09-10 Marc Autret <autret_m@epita.fr>,
+ Akim Demaille <akim@epita.fr>
+
+ * src/vcg.h (graph_s): color, textcolor, bordercolor are now
+ enum color_e.
+ * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
+ to `normal'.
+ * src/reader.c (parse_token_decl): Initialize token with tok_eof.
+ * src/lex.h: Adjust prototype.
+ (token_t): Add `tok_undef'.
+ * src/lex.c (struct percent_table_struct): Retval is now a token_t.
+ (parse_percent_token): Now returns token_t.
+ Add default statement in switch.
+ (lex): Separate `c' as an input variable, from the token_t result
+ part.
+ (unlexed): Is a token_t.
+
+ 2001-09-10 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Bump to 1.29a.
+
+ 2001-09-07 Akim Demaille <akim@epita.fr>
+
+ Version 1.29.
+
+ 2001-08-30 Akim Demaille <akim@epita.fr>
+
+ * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
+ * m4/atconfig.m4: Remove.
+ * tests/testsuite.at, tests/atlocal.in, tests/output.at,
+ * tests/bison: New.
+ * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
+ m4_if, m4_patsubst, and m4_regexp.
+ * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
+ `input' file instead of echo.
+
+ 2001-08-29 Akim Demaille <akim@epita.fr>
+
+ Bump to 1.28e.
+
+ 2001-08-29 Akim Demaille <akim@epita.fr>
+
+ Version 1.28d.
+
+ 2001-08-29 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.simple (yyparse): Don't take the address of an
+ item before the start of an array, as that doesn't conform to
+ the C Standard.
+
+ 2001-08-29 Robert Anisko <anisko_r@epita.fr>
+
+ * doc/bison.texinfo (Location Tracking Calc): New node.
+
+ 2001-08-29 Paul Eggert <eggert@twinsun.com>
+
+ * src/output.c (output): Do not define const, as this now
+ causes more problems than it cures.
+
+ 2001-08-29 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
+ the nodes.
+ Be sure to tag the `detailmenu'.
+
+ 2001-08-29 Akim Demaille <akim@epita.fr>
+
+ * Makefile.maint (do-po-update): Wget refuses to overwrite files:
+ download in a tmp dir.
+
+ 2001-08-28 Marc Autret <autret_m@epita.fr>
+
+ * config/depcomp: New file.
+
+ 2001-08-28 Marc Autret <autret_m@epita.fr>
+
+ * doc/bison.1 (mandoc): Adjust.
+ From Juan Manuel Guerrero.
+
+ 2001-08-28 Marc Autret <autret_m@epita.fr>
+
+ * src/print_graph.c (print_state): Fix.
+
+ 2001-08-27 Marc Autret <autret_m@epita.fr>
+
+ * src/vcg.h (classname_s, infoname_s, node_s): Constify the
+ char * members.
+ Echo modifications to the functions prototypes.
+ * src/vcg.c (add_classname, add_infoname): Adjust arguments.
+
+ 2001-08-27 Marc Autret <autret_m@epita.fr>
+
+ * src/vcg.c: Include `xalloc.h'.
+ (add_colorentry): New.
+ (add_classname): New.
+ (add_infoname): New.
+ * src/vcg.h: Add new prototypes.
+
+ 2001-08-27 Akim Demaille <akim@epita.fr>
+
+ * Makefile.maint: Sync. again with CVS Autoconf.
+
+ 2001-08-27 Akim Demaille <akim@epita.fr>
+
+ * Makefile.maint: Formatting changes.
+ (po-update, cvs-update, update): New targets.
+ (AMTAR): Remove.
+
+ 2001-08-27 Akim Demaille <akim@epita.fr>
+
+ * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
+ * Makefile.maint: Sync. with CVS Autoconf.
+
+ 2001-08-27 Marc Autret <autret_m@epita.fr>
+
+ * src/vcg.h (struct infoname_s): New.
+ (struct colorentry_s): New.
+ (graph_s): New fields {vertical,horizontal}_order in structure.
+ Add `infoname' field.
+ Add `colorentry' field;
+ * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
+ (G_HORIZONTAL_ORDER): New.
+ (G_INFONAME): New.
+ (G_COLORENTRY): New.
+ * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
+ Add output of `infoname'.
+ Add output of `colorentry'.
+
+ 2001-08-27 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
+ This one shadowed a global parameter.
+
+ 2001-08-24 Marc Autret <autret_m@epita.fr>
+
+ * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
+ instead of `unsigned'.
+ (print_state): Do not call obstack_object_size () in obstack_grow ()
+ to avoid macro variables shadowing.
+
+ 2001-08-23 Marc Autret <autret_m@epita.fr>
+
+ * src/lex.c (percent_table): Typo: s/naem/name/.
+ Add graph option.
+ Normalize new options declarations.
+
+ 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
+
+ * tests/suite.at: Exercise %header_extension and %source_extension.
+
+ 2001-08-16 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (parse_dquoted_param): New.
+ (parse_header_extension_decl): Use it.
+ (parse_source_extension_decl): Likewise.
+
+ 2001-08-16 Marc Autret <autret_m@epita.fr>
+
+ * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
+ (get_xxxx_str): Use assert () instead of complain ().
+ Remove return invokations in default cases.
+ (get_decision_str): Modify default behaviour. Remove second argument.
+ Echo modifications on calls.
+ (output_graph): Fix.
+
+ 2001-08-16 Marc Autret <autret_m@epita.fr>
+
+ * src/getargs.c (usage): Update with ``-g, --graph''.
+
+ 2001-08-16 Marc Autret <autret_m@epita.fr>
+
+ * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
+ (Option Cross Key): Likewise.
+ * doc/bison.1: Update.
+
+2001-09-25 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/output.c (output_master_parser): Don't finish action_obstack.
+ (output_parser): Don't care about the muscle action, here.
+ (prepare): Copy the action_obstack in the action muscle.
+ (output): Free action_obstack.
+
+2001-09-23 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
+ will contain `%union' declaration.
+ (parse_union_decl): Delete #line directive output.
+ (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
+ informations about %union.
+ (parse_union_decl): Copy the union_obstack in the muscle stype.
+ * src/bison.simple: Add new #line directive.
+ Add typdef %%stype YYSTYPE.
+
+2001-09-23 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/bison.simple: Add new `#line' directive.
+
+2001-09-22 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/bison.simple: New `#line' directive.
+ * src/output.c (output_parser): Support new dynamic muscle input_line.
+
+2001-09-22 Marc Autret <autret_m@epita.fr>
+
+ * src/output.c (output_master_parser): New.
+ (output_parser): Be more re-entrant.
+
+2001-09-21 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (copy_definition, parse_union_decl): Update and use
+ `linef' muscle.
+ (copy_action): Likewise.
+ Use obstack_1grow ().
+ * src/muscle_tab.c (muscle_init): Add muscle `linef'.
+
+2001-09-21 Marc Autret <autret_m@epita.fr>
+
+ * src/options.c (option_table): Adjust.
+ * src/lex.c (parse_percent_token): Fix.
+
+2001-09-20 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/options.c (symtab.h): Include it, need by lex.h.
+
+2001-09-20 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/lex.c (parse_percent_token): Change type of variable `tx', which
+ is now an option_table_struct*.
+ (option_strcmp): New function option_strcmp.
+ (parse_percent_token): Call option_strcmp.
+ * src/getargs.c (xalloc.h, options.h): Include it.
+ (getargs): Call create_long_option_table.
+ (getargs): Free longopts at the end of the function.
+ (shortopts): Move in options.c.
+ * src/options.c (create_long_option_table): New function. Convert
+ information from option_table to option structure.
+ * src/reader.c (options.h): Include it.
+
+ * src/Makefile.am: Adjust.
+ * src/options.c (option_table): Create from longopts and percent_table.
+ * src/getargs.c (longopts): Delete.
+ * src/lex.c (struct percent_table_struct): Delete.
+ (percent_table): Delete.
+ (options.h): Include it.
+ * src/options.c: Create.
+ * src/options.h: Create.
+ Declare enum opt_access_e.
+ Define struct option_table_struct.
+
+2001-09-20 Marc Autret <autret_m@epita.fr>
+
+ * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
+ sections of Bison.
+
+2001-09-19 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/bison.simple: s/%%filename/%%skeleton.
+ * src/muscle_tab.c (getargs.h): Include it.
+ (muscle_init): Insert new muscle skeleton.
+
+2001-09-18 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/output.c (output_parser): Delete unused variable actions_dumped.
+
+2001-09-07 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/output.c (output): Delete call to reader_output_yylsp.
+ * src/reader.c (reader): Likewise.
+ * src/reader.h: Delete declaration of reader_output_yylsp.
+
+2001-09-02 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c: Include muscle_tab.h.
+ (parse_union_decl): Update.
+ (parse_macro_decl): Rename parse_muscle_decl.
+ Update to use renamed functions and variable.
+ (read_declarations, copy_action, read_additionnal_code, : Updated
+ with correct variables and functions names.
+ (packsymbols, reader): Likewise.
+
+ * src/reader.h (muscle_obstack): Extern declaration update.
+
+ * src/output.c: Include muscle_tab.h
+ In all functions using macro_insert, change by using muscle_insert ().
+ (macro_obstack): Rename muscle_obstack.
+ Echo modifications in the whole file.
+ (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
+ (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
+ (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
+
+ * src/muscle_tab.h: Update double inclusion macros.
+ (macro_entry_s): Rename muscle_entry_s.
+ Update prototypes.
+
+ * src/muscle_tab.c: Include muscle_tab.h.
+ Rename macro_tabble to muscle_table.
+ (mhash1, mhash2, mcmp): Use muscle_entry.
+ (macro_init): Rename muscle_init. Update.
+ (macro_insert): Rename muscle_insert. Update.
+ (macro_find): Rename muscle_find. Update.
+
+ * src/main.c: Include muscle_tab.h.
+ (main): Call muscle_init ().
+ * src/Makefile.am (bison_SOURCES): Echo modifications.
+
+2001-09-02 Marc Autret <autret_m@epita.fr>
+
+ Now the files macro_tab.[ch] are named muscle_tab.[ch].
+
+ * src/muscle_tab.c, src/muscle_tab.h: Add files.
+
+2001-09-02 Marc Autret <autret_m@epita.fr>
+
+ * src/macrotab.c, src/macrotab.h: Remove.
+
+2001-09-01 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/reader.c (copy_guard): Use muscle to specify the `#line'
+ filename.
+
+2001-09-01 Marc Autret <autret_m@epita.fr>
+
+ * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
+ to an explicit value to activate the feature. We do it here.
+
+2001-08-31 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/output.c (prepare): Delete the `filename' muscule insertion.
+ * src/reader.c (copy_action): Use `filename' muscule with `#line'.
+ (parse_union_decl): Likewise.
+ * src/macrotab.c (macro_init): Initialize filename by infile.
+
+2001-08-31 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple (YYLSP_NEEDED): New definition.
+ * src/output.c (prepare): Add macro insertion of `locations_flag'
+
+2001-08-31 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/output.c (prepare): Delete insertion of previous muscles,
+ and insert the `prefix' muscles.
+ * src/macrotab.c (macro_init): Likewise.
+ (macro_init): Initialization prefix directive by `yy'.
+ * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
+ %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
+ yylval, yydebug, yyerror, yynerrs and yyparse.
+ New directive `#define' to substitute yydebug, ... with option
+ name_prefix.
+
+2001-08-31 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/main.c (main): Standardize.
+ * src/output.c (output_table_data, output_parser): Likewise.
+ * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
+
+2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (read_additionnal_code): Rename %%user_code to
+ %%epilogue.
+ * src/output.c (output): Rename %%declarations to %%prologue.
+ * src/bison.simple: Echo modifications.
+
+2001-08-31 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (readgram): CleanUp.
+ (output_token_defines): Likewise.
+ (packsymbols): Likewise.
+ (reader): Likewise.
+ * src/output.c (output): CPP-out useless code.
+
+2001-08-31 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/reader.c (reader): Delete obsolete call to function
+ output_trailers and output_headers.
+ * src/output.h: Remove obsolete functions prototypes of output_headers
+ and output_trailers.
+
+2001-08-30 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/main.c: Include macrotab.h.
+ * src/macrotab.h (macro_entry_s): Constify fields.
+ Adjust functions prototypes.
+ * src/macrotab.c (macro_insert): Constify key and value.
+ (macro_find): Constify key.
+ (macro_insert): Include 'xalloc.h'
+ (macro_insert): Use XMALLOC.
+ (macro_find): Constify return value.
+ * src/output.c (output_table_data): Rename table to table_data.
+ (output_parser): Constify macro_key, macro_value.
+
+2001-08-30 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (parse_skel_decl): New.
+ (read_declarations): Add case `tok_skel', call parse_skel_decl ().
+ * src/lex.h (token_t): New token `tok_skel'.
+ * src/lex.c (percent_table): Add skeleton option entry.
+ Standardize.
+
+2001-08-29 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple: Add %%user_code directive at the end.
+ * src/reader.c (read_additionnal_code): New.
+ (reader): Use it.
+ * src/output.c (output_program): Remove.
+ (output): Update.
+
+2001-08-28 Marc Autret <autret_m@epita.fr>
+
+ * src/output.c (output_actions): Clean up.
+ (output_gram): CPP-out useless code.
+ * src/reader.c (reader): Clean up, CPP-out useless code.
+
+2001-08-28 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/output.c (output): Copy attrs_obstack in the '%%definitions'
+ directive.
+ * src/bison.simple: Add `%%definitions'.
+
+2001-08-28 Marc Autret <autret_m@epita.fr>
+
+ * config/depcomp: New file.
+
+2001-08-27 Paul Eggert <eggert@twinsun.com>
+
+ * src/bison.simple (yyparse): Don't take the address of an
+ item before the start of an array, as that doesn't conform to
+ the C Standard.
+
+2001-08-27 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/output.c (output): Remove the initialization of the macro
+ obstack. It was done too late here.
+
+ * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
+ completely wrong.
+ (reader): Initialize the macro obstack here, since we need it to grow
+ '%define' directives.
+
+ * src/reader.h: Declare the macro obstack as extern.
+
+2001-08-27 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/output.c (output_parser): Fix. Store single '%' characters in
+ the output obstack instead of throwing them away.
+
+2001-08-27 Akim Demaille <akim@epita.fr>
+
+ * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
+
+2001-08-25 Robert Anisko <robert.anisko@epita.fr>
+
+ * lib/Makefile.am: Adjust.
+
+2001-08-25 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/bison.simple: Update and add '%%' directives.
+
+2001-08-25 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/reader.c (reader): Remove calls to 'output_headers' and
+ 'output_trailers'. Remove some C output.
+ (readgram): Disable a piece of code that was writing a default
+ definition for 'YYSTYPE'.
+ (reader_output_yylsp): Remove.
+ (packsymbols): Output token defintions to a macro.
+ (copy_definition): Disable C output.
+
+ * src/reader.c (parse_macro_decl): New function used to parse macro
+ declarations.
+ (copy_string2): Put the body of copy_string into this new function.
+ Add a parameter to let the caller choose whether he wants to copy the
+ string delimiters or not.
+ (copy_string): Be a simple call to copy_string2 with the last argument
+ bound to true.
+ (read_declarations): Add case for macro definition.
+ (copy_identifier): New.
+ (parse_macro_decl): Read macro identifiers using copy_identifier
+ rather than lex.
+
+2001-08-25 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/output.c (prepare): Add prefixed names.
+ (output_parser): Output semantic actions.
+ (output_parser): Fix bug on '%%line' directives.
+
+ * src/output.c (output_headers): Remove. The C code printed by this
+ function should now be in the skeletons.
+ (output_trailers): Remove.
+ (output): Disable call to 'reader_output_yylsp'.
+ (output_rule_data): Do not output tables to the table obstack.
+
+ * src/output.c: Remove some C dedicated output.
+ Improve the use of macro and output obstacks.
+ (output_defines): Remove.
+
+ * src/output.c (output_token_translations): Associate 'translate'
+ table with a macro. No output to the table obstack.
+ (output_gram): Same for 'rhs' and 'prhs'.
+ (output_stos): Same for 'stos'.
+ (output_rule_data): Same for 'r1' and 'r2'.
+ (token_actions): Same for 'defact'.
+ (goto_actions): Same for 'defgoto'.
+ (output_base): Same for 'pact' and 'pgoto'.
+ (output_table): Same for 'table'.
+ (output_check): Same for 'check'.
+
+ * src/output.c (output_table_data): New function.
+ (output_short_table): Remove.
+ (output_short_or_char_table): Remove.
+
+ * src/output.c (output_parser): Replace most of the skeleton copy code
+ with something new. Skeletons are now processed character by character
+ rather than line by line, and Bison looks for '%%' macros. This is the
+ first step in making Bison's output process (a lot) more flexible.
+ (output_parser): Use the macro table.
+
+2001-08-25 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/main.c (main): Initialize the macro table.
+
+2001-08-25 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/lex.c (percent_table): Add tok_define.
+ * src/lex.h: Add tok_define.
+
+2001-08-25 Robert Anisko <robert.anisko@epita.fr>
+
+ * src/macrotab.c: New file.
+ * src/macrotab.h: New file.
+ * src/Makefile.am: Update.
+
+2001-08-25 Robert Anisko <robert.anisko@epita.fr>
+
+ * lib/hash.c: New file.
+ * lib/hash.h: New file.
+ * lib/Makefile.am: Update.
+
+2001-08-15 Akim Demaille <akim@epita.fr>
+
+ Version 1.28c.
+
+2001-08-15 Marc Autret <autret_m@epita.fr>
+
+ * src/reader.c (readgram): Indent output macro YYSTYPE.
+ (packsymbols): Likewise.
+ (output_token_defines): Likewise.
+ * src/files.c: Standardize.
+ (compute_header_macro): New.
+ (defines_obstack_save): New. Use compute_header_macro.
+ (output_files): Update. Use defines_obstack_save.
+
+2001-08-15 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo (Table of Symbols): Document
+ YYSTACK_USE_ALLOCA.
+
+2001-08-15 Akim Demaille <akim@epita.fr>
+
+ * missing: Update from CVS Automake.
+ * config/config.guess, config/config.sub, config/texinfo.tex:
+ Update from gnu.org.
+
+2001-08-15 Akim Demaille <akim@epita.fr>
+
+ * Makefile.maint: Sync with CVS Autoconf.
+
+2001-08-14 Pascal Bart <pascal.bart@epita.fr>
+
+ * doc/bison.texinfo: Include GNU Free Documentation License from
+ `fdl.texi'.
+ * doc/fdl.texi: Add to package.
+
+2001-08-14 Marc Autret <autret_m@epita.fr>
+
+ Turn on %{source,header}_extension features.
+
+ * src/lex.c (percent_table): Un-CPP out header_extension and
+ source_extension.
+ * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
+ (compute_exts_from_src): Remove conditions. It restores priorities
+ between options.
+
+2001-08-14 Marc Autret <autret_m@epita.fr>
+
+ * src/files.c (compute_base_names): Add extensions computing when
+ `--file-prefix' used.
+ Standardize function calls.
+
+2001-08-13 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
+ defining it (defined but null disables alloca).
+
+2001-08-13 Marc Autret <autret_m@epita.fr>
+
+ * src/bison.simple (_yy_memcpy): CPP reformat.
+
+2001-08-13 Pascal Bart <pascal.bart@epita.fr>
+
+ * tests/atconfig.in (CPPFLAGS): Fix.
+
+2001-08-10 Pascal Bart <pascal.bart@epita.fr>
+
+ * doc/bison.texinfo: Include GNU General Public License from
+ `gpl.texi'.
+ * doc/gpl.texi: Add to package.
+
+2001-08-10 Marc Autret <autret_m@epita.fr>
+
+ * src/print_graph.h: Fix.
+ * src/reader.c (read_declarations): Use parse_header_extension_decl ().
+
+2001-08-10 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: Provide default declarations for stpcpy, strndup,
+ and strnlen.
+
+2001-08-10 Robert Anisko <anisko_r@epita.fr>
+
+ * doc/bison.texinfo (Locations): Update @$ stuff.
+
+2001-08-09 Robert Anisko <anisko_r@epita.fr>
+
+ * src/bison.simple (YYLLOC_DEFAULT): Update.
+ (yyparse): Adjust.
+
+2001-08-08 Marc Autret <autret_m@epita.fr>
+
+ * doc/bison.texinfo: Change @samp{$<@dots{}>} to
+ @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
+ Reported by Fabrice Bauzac.
+
+2001-08-08 Marc Autret <autret_m@epita.fr>
+
+ * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
+ * src/vcg.c (output_node): Fix.
+ * src/vcg.h: Cleanup.
+ * src/print_graph.c: Add comments.
+ (node_output_size): New global variable. Simplify the formatting of
+ the VCG graph output.
+ (print_actions): Unused code is now used. It notifies the final state
+ and no action states in the VCG graph. It also give the reduce actions.
+ The `shift and goto' edges are red and the `go to state' edges are
+ blue.
+ Get the current node name and node_obstack by argument.
+ (node_obstack): New variable.
+ (print_state): Manage node_obstack.
+ (print_core): Use node_obstack given by argument.
+ A node is not only computed here but in print_actions also.
+ (print_graph): CPP out useless code instead of commenting it.
+
+2001-08-07 Pascal Bart <pascal.bart@epita.fr>
+
+ * tests/atconfig.in (CPPFLAGS): Fix.
+
+2001-08-07 Akim Demaille <akim@epita.fr>
+
+ * src/print_graph.c (quote): New.
+ (print_core): Use it.
+
+2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
+
+ * src/vcg.c (complain.h): Include it.
+ Unepitaize `return' invocations.
+ [NDEBUG] (main): Remove.
+ * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
+ * src/files.c (open_files): Initialize graph_obstack.
+ * src/print_graph.c (print_actions): CPP out useless code.
+ (print_core): Don't output the last `\n' in labels.
+ Use `quote'.
+ * src/files.c (output_files): Output the VCG file.
+ * src/main.c (main): Invoke print_graph ();
+
+2001-08-06 Marc Autret <autret_m@epita.fr>
+
+ Automaton VCG graph output.
+ Using option ``-g'' or long option ``--graph'', you can generate
+ a gram_filename.vcg file containing a VCG description of the LALR (1)
+ automaton of your grammar.
+
+ * src/main.c: Call to print_graph() function.
+ * src/getargs.h: Update.
+ * src/getargs.c (options): Update to catch `-g' and `--graph' options.
+ (graph_flag): New flag.
+ (longopts): Update.
+ (getargs): Add case `g'.
+ * src/files.c (graph_obstack): New obstack struct.
+ (open_files): Initialize new obstack.
+ (output_files): Saves graph_obstack if required.
+ * src/files.h (graph_obstack): New extern declaration.
+ * src/Makefile.am: Add new source files.
+
+2001-08-06 Marc Autret <autret_m@epita.fr>
+
+ * src/print_graph.c, src/print_graph.h (graph): New.
+ * src/vcg.h: New file.
+ * src/vcg.c: New file, VCG graph handling.
+
+2001-08-06 Marc Autret <autret_m@epita.fr>
+
+ Add of %source_extension and %header_extension which specify
+ the source or/and the header output file extension.
+
+ * src/files.c (compute_base_names): Remove initialisation of
+ src_extension and header_extension.
+ (compute_exts_from_gf): Update.
+ (compute_exts_from_src): Update.
+ (output_files): Update.
+ * src/reader.c (parse_header_extension_decl): New.
+ (parse_source_extension_decl): New.
+ (read_declarations): New case statements for the new tokens.
+ * src/lex.c (percent_table): Add entries for %source_extension
+ and %header_extension.
+ * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
+
+2001-08-06 Marc Autret <autret_m@epita.fr>
+
+ * configure.in: Bump to 1.28c.
+ * doc/bison.texinfo: Texinfo thingies.
+
+2001-08-04 Pascal Bart <pascal.bart@epita.fr>
+
+ * tests/atconfig.in (CPPFLAGS): Add.
+ * tests/calc.at (AT_CHECK): Use CPPFLAGS.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ Version 1.28b.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ * tests/Makefile.am (check-local): Ship testsuite.
+ * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
+ Include `string.h'.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Try using -Wformat when compiling.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Bump to 1.28b.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ * src/complain.c: Adjust strerror_r portability issues.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ Version 1.28a.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c, src/getarg.h (skeleton)): Constify.
+ * src/lex.c (literalchar): Avoid name clashes on `buf'.
+ * src/getargs.c: Include complain.h.
+ * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
+ * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (readgram): Display hidden chars in error messages.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ Update to gettext 0.10.39.
+
+2001-08-03 Akim Demaille <akim@epita.fr>
+
+ * lib/strspn.c: New.
+
+2001-08-01 Marc Autret <autret_m@epita.fr>
+
+ * doc/bison.texinfo: Update.
+ * doc/bison.1 (mandoc): Update.
+ * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
+ * src/files.c: Support output files extensions computing.
+ (src_extension): New static variable.
+ (header_extension): New static variable.
+ (tr): New function.
+ (get_extension_index): New function, gets the index of an extension
+ filename in a string.
+ (compute_exts_from_gf): New function, computes extensions from the
+ grammar file extension.
+ (compute_exts_from_src): New functions, computes extensions from the
+ C source file extension, file given by ``-o'' option.
+ (compute_base_names): Update.
+ (output_files): Update.
+
+2001-08-01 Robert Anisko <anisko_r@epita.fr>
+
+ * doc/bison.texi: Document @$.
+ (Locations): New section.
+
+2001-07-18 Akim Demaille <akim@epita.fr>
+
+ * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
+ * config/prev-version.txt, config/move-if-change: New.
+ * Makefile.am: Adjust.
+
+2001-07-08 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/bison.simple (yyparse): Suppress warning `comparaison
+ between signed and unsigned'.
+
+2001-07-05 Pascal Bart <pascal.bart@epita.fr>
+
+ * src/getargs.h (raw_flag): Remove.
+ * src/getargs.c: Die on `-r'/`--raw'.
+ * src/lex.c (parse_percent_token): Die on `%raw'.
+ * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
+ * tests/calc.at: Suppress test with option `--raw'.
+
+2001-07-14 Akim Demaille <akim@epita.fr>
+
+ * config/: New.
+ * configure.in: Require Autoconf 2.50.
+ Update to gettext 0.10.38.
+
+2001-03-16 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: ANSIfy the examples.
+
+2001-03-16 Akim Demaille <akim@epita.fr>
+
+ * getargs.c (skeleton): New variable.
+ (longopts): --skeleton is a new option.
+ (shortopts, getargs): -S is a new option.
+ * getargs.h: Declare skeleton.
+ * output.c (output_parser): Use it.
+
+2001-03-16 Akim Demaille <akim@epita.fr>
+
+ * m4/strerror_r.m4: New.
+ * m4/error.m4: Run AC_FUNC_STRERROR_R.
+ * lib/error.h, lib/error.c: Update.
+
+2001-03-16 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (longopts): Clean up.
+
+2001-02-21 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (gensym): `gensym_count' is your own.
+ Use a static buf to create the symbol name, as token_buffer is no
+ longer a buffer.
+
+2001-02-08 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (conflict_report): Be sure not to append to res
+ between two calls, which could happen if both first sprintf were
+ skipped, but not the first cp += strlen.
+
+2001-02-08 Akim Demaille <akim@epita.fr>
+
+ * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
+ New, from fileutils 4.0.37.
+ * configure.in: Require Autoconf 2.49c. I took some time before
+ making this decision. This is the only way out for portability
+ issues in Bison, it would mean way too much duplicate effort to
+ import in Bison features implemented in 2.49c since 2.13.
+ AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
+
+2001-02-02 Akim Demaille <akim@epita.fr>
+
+ * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
+ * lib/xalloc.h, lib/xmalloc.c: Update.
+
+2001-01-19 Akim Demaille <akim@epita.fr>
+
+ Get rid of the ad hoc handling of token_buffer in the scanner: use
+ the obstacks.
+
+ * src/lex.c (token_obstack): New.
+ (init_lex): Initialize it. No longer call...
+ (grow_token_buffer): this. Remove it.
+ Adjust all the places which used it to use the obstack.
+
+2001-01-19 Akim Demaille <akim@epita.fr>
+
+ * src/lex.h: Rename all the tokens:
+ s/\bENDFILE\b/tok_eof/g;
+ s/\bIDENTIFIER\b/tok_identifier/g;
+ etc.
+ Let them be enums, not #define, to ease debugging.
+ Adjust all the code.
+
+2001-01-18 Akim Demaille <akim@epita.fr>
+
+ * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
+ * src/lex.c (maxtoken, grow_token_buffer): Static.
+
+2001-01-18 Akim Demaille <akim@epita.fr>
+
+ Since we now use obstacks, more % directives can be enabled.
+
+ * src/lex.c (percent_table): Also accept `%yacc',
+ `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
+ `%debug'.
+ Handle the actions for `%semantic_parser' and `%pure_parser' here,
+ instead of returning a token.
+ * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
+ * src/reader.c (read_declarations): Adjust.
+ * src/files.c (open_files): Don't call `compute_base_names', don't
+ compute `attrsfile' since they depend upon data which might be
+ *in* the input file now.
+ (output_files): Do it here.
+ * src/output.c (output_headers): Document the fact that this patch
+ introduces a guaranteed SEGV for semantic parsers.
+ * doc/bison.texinfo: Document them.
+ * tests/suite.at: Exercise these %options.
+
+2000-12-20 Akim Demaille <akim@epita.fr>
+
+ Also handle the output file (--verbose) with obstacks.
+
+ * files.c (foutput): Remove.
+ (output_obstack): New.
+ Adjust all dependencies.
+ * src/conflicts.c: Return a string.
+ * src/system.h (obstack_grow_string): Rename as...
+ (obstack_sgrow): this. Be ready to work with non literals.
+ (obstack_fgrow4): New.
+
+2000-12-20 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (open_files): Fix the computation of short_base_name
+ in the case of `-o foo.tab.c'.
+
+2000-12-20 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
+ (copy_dollar): Now that everything uses obstacks, get rid of the
+ FILE * parameters.
+
+2000-12-20 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (open_files): Actually the `.output' file is based
+ on the short_base_name, not base_name.
+ * tests/suite.at (Checking output file names): Adjust.
+
+2000-12-20 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1: Remove, we now use directly...
+ * src/bison.simple: this.
+ * src/Makefile.am: Use pkgdata instead of data.
+
+2000-12-20 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (guard_obstack): New.
+ (open_files): Initialize it.
+ (output_files): Dump it...
+ * src/files.h: Export it.
+ * src/reader.c (copy_guard): Use it.
+
+2000-12-19 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (outfile, defsfile, actfile): Removed as global
+ vars.
+ (open_files): Don't compute them.
+ (output_files): Adjust.
+ (base_name, short_base_name): Be global.
+ Adjust dependencies.
+
+2000-12-19 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (strsuffix): New.
+ (stringappend): Be just like strcat but allocate.
+ (base_names): Eve out from open_files.
+ Try to simplify the rather hairy computation of base_name and
+ short_base_name.
+ (open_files): Use it.
+ * tests/suite.at (Checking output file names): New test.
+
+2000-12-19 Akim Demaille <akim@epita.fr>
+
+ * src/system.h (obstack_grow_literal_string): Rename as...
+ (obstack_grow_string): this.
+ * src/output.c (output_parser): Recognize `%% actions' instead of
+ `$'.
+ * src/bison.s1: s/$/%% actions/.
+ * src/bison.hairy: Likewise.
+
+2000-12-19 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_parser): Compute the `#line' lines when
+ there are.
+ * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
+ Suggested by Hans Aberg.
+
+2000-12-19 Akim Demaille <akim@epita.fr>
+
+ Let the handling of the skeleton files be local to the procedures
+ that use it.
+
+ * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
+ longer static.
+ (fparser, open_extra_files): Remove.
+ (open_files, output_files): Don't take care of fparser.
+ * src/files.h: Adjust.
+ * src/output.c (output_parser): Open and close the file to the
+ skeleton.
+ * src/reader.c (read_declarations): When %semantic_parser, open
+ fguard.
+
+2000-12-19 Akim Demaille <akim@epita.fr>
+
+ * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
+ * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
+
+2000-12-19 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (open_files): Yipee! We no longer need all the code
+ looking for `/tmp' since we have no tmp file.
+
+2000-12-19 Akim Demaille <akim@epita.fr>
+
+ * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
+ New macros.
+ * src/files.c (open_files): Less dependency on MSDOS etc.
+
+2000-12-14 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1 (YYLLOC_DEFAULT): New macro.
+ Provide a default definition.
+ Use it when executing the default @ action.
+ * src/reader.c (reader_output_yylsp): No longer include
+ `timestamp' and `text' in the default YYLTYPE.
+
+2000-12-12 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_definition, parse_union_decl, copy_action)
+ (copy_guard): Quote the file names.
+ Reported by Laurent Mascherpa.
+
+2000-12-12 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_headers, output_program, output): Be sure
+ to escape special characters when outputting filenames.
+ (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
+ (output_headers): Don't depend on them, Use ACTSTR.
+
+2000-11-17 Akim Demaille <akim@epita.fr>
+
+ * lib/obstack.h: Formatting changes.
+ (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
+ prevents type checking.
+ (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
+ cast the value to (void *): assigning a `foo *' to a `void *'
+ variable is valid.
+ (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
+ * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
+ append characters.
+
+2000-11-17 Akim Demaille <akim@epita.fr>
+
+ * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
+ as...
+ (suite.m4, regression.m4, calc.m4): these.
+ * tests/atgeneral.m4: Update from CVS Autoconf.
+
+2000-11-17 Akim Demaille <akim@epita.fr>
+
+ * tests/regression.m4 (%union and --defines): New test,
+ demonstrating a current bug in the obstack implementation.
+
+2000-11-17 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
+ macros.
+ Use them to declare the variables which are global or local to
+ `yyparse'.
+
+2000-11-17 Akim Demaille <akim@epita.fr>
+
+ * acconfig.h: Remove, no longer used.
+
+2000-11-07 Akim Demaille <akim@epita.fr>
+
+ * src: s/Copyright (C)/Copyright/g.
+
+2000-11-07 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
+ defining.
+ * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
+
+2000-11-07 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
+ Merge in a single CPP if/else.
+
+2000-11-07 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output): Remove useless variables.
+ * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
+ argument `data' for consistency with the prototypes.
+ Qualify it `const'.
+ (obstack_copy, obstack_copy0): Rename the second argument as
+ `address' for consistency. Qualify it `const'.
+ * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
+ (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
+ `const' their input argument (`data' or `address').
+ Adjust the corresponding macros to include `const' in casts.
+
+2000-11-03 Akim Demaille <akim@epita.fr>
+
+ * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
+ s/PFILE1/BISON_HAIRY/.
+ Adjust dependencies.
+
+2000-11-03 Akim Demaille <akim@epita.fr>
+
+ For some reason, this was not applied.
+
+ * src/files.c [VMS]: No longer include `ssdef.h', no longer define
+ `unlink': it's no longer used.
+
+2000-11-03 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (skeleton_find): New function, eved out of...
+ (open_files, open_extra_files): here.
+
+2000-11-03 Akim Demaille <akim@epita.fr>
+
+ Don't use `atexit'.
+
+ * src/files.c (obstack_save): New function.
+ (done): Rename as...
+ (output_files): this.
+ Use `obstack_save'.
+ * src/main.c (main): Don't use `atexit' to register `done', since
+ it no longer has to remove tmp files, just call `output_files'
+ when there are no errors.
+
+2000-11-02 Akim Demaille <akim@epita.fr>
+
+ * src/files.c [VMS]: No longer include `ssdef.h', no longer define
+ `unlink': it's no longer used.
+ * src/files.h: Formatting changes.
+
+2000-11-02 Akim Demaille <akim@epita.fr>
+
+ Remove the last uses of mktemp and unlink/delete.
+
+ * src/files.c (fdefines, ftable): Removed.
+ (defines_ostack, table_obstack): New.
+ Adjust dependencies of the former into uses of the latter.
+ * src/output.c (output_short_or_char_table, output_short_table):
+ Convert to using obstacks.
+ * src/reader.c (copy_comment2): Accept one FILE * and two
+ obstacks.
+ (output_token_defines, reader_output_yylsp): Use obstacks.
+ * src/system.h (obstack_fgrow3): New.
+ * po/POTFILES.in: Adjust.
+
+2000-11-01 Akim Demaille <akim@epita.fr>
+
+ Change each use of `fattrs' into a use of `attrs_obstack'.
+
+ * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
+ * src/files.c (fattrs): Remove.
+ (attrs_obstack): New.
+ Adjust all dependencies.
+ (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
+
+2000-11-01 Akim Demaille <akim@epita.fr>
+
+ Introduce obstacks.
+ Change each use of `faction' into a use of `action_obstack'.
+
+ * lib/obstack.h, lib/obstack.c: New files.
+ * src/files.c (faction): Remove.
+ (action_obstack): New.
+ Adjust all dependencies.
+
+2000-10-20 Akim Demaille <akim@epita.fr>
+
+ * lib/quote.h (PARAMS): New macro. Use it.
+
+2000-10-16 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_short_or_char_table): New function.
+ (output_short_table, output_token_translations): Use it.
+ (goto_actions): Use output_short_table.
+
+2000-10-16 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.c (bucket_new): New function.
+ (getsym): Use it.
+
+ * src/output.c (output_short_table): New argument to display the
+ comment associated with the table.
+ Adjust dependencies.
+ (output_gram): Use it.
+ (output_rule_data): Nicer output layout for YYTNAME.
+
+2000-10-16 Akim Demaille <akim@epita.fr>
+
+ * src/lex.c (read_typename): New function.
+ (lex): Use it.
+ * src/reader.c (copy_dollar): Likewise.
+
+2000-10-16 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_comment2): Expect the input stream to be on
+ the `/' which is suspected to open a comment, instead of being
+ called after `//' or `/*' was read.
+ (copy_comment, copy_definition, parse_union_decl, copy_action)
+ (copy_guard): Adjust.
+
+2000-10-16 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (parse_expect_decl): Use `skip_white_space' and
+ `read_signed_integer'.
+
+2000-10-16 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_dollar): New function.
+ (copy_guard, copy_action): Use it.
+
+2000-10-16 Akim Demaille <akim@epita.fr>
+
+ * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
+ * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
+ New files, from Fileutils 4.0.27.
+ * src/main.c (printable_version): Remove.
+ * src/lex.c, src/reader.c: Use `quote'.
+
+2000-10-04 Akim Demaille <akim@epita.fr>
+
+ * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
+
+2000-10-04 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Various typos spotted by Neil Booth.
+
+2000-10-04 Akim Demaille <akim@epita.fr>
+
+ When a literal string is used to define two different tokens,
+ `bison -v' segfaults.
+ Reported by Piotr Gackiewicz, and fixed by Neil Booth.
+
+ * tests/regression.m4: New file.
+ Include the core of the sample provided by Piotr Gackiewicz.
+ * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
+ properly.
+
+2000-10-04 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (parse_expect_decl): Keep `count' within the size
+ of `buffer'.
+ From Neil Booth.
+
+2000-10-02 Paul Eggert <eggert@twinsun.com>
+
+ * bison.s1 (yyparse): Assign the default value
+ unconditionally, to avoid a GCC warning and make the parser a
+ tad smaller.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (getargs): Don't dump `--help' on unrecognized
+ options.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/derives.c, src/print.c, src/reduce.c: To ease the
+ translation, move some `\n' out of the translated strings.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ The location tracking mechanism is precious for parse error
+ messages. Nevertheless, it is enabled only when `@n' is used in
+ the grammar, which is a different issue (you can use it in error
+ message, but not in the grammar per se). Therefore, there should
+ be another means to enable it.
+
+ * src/getargs.c (getargs): Support `--locations'.
+ (usage): Report it.
+ * src/getargs.h (locationsflag): Export it.
+ * src/lex.c (percent_table): Support `%locations'.
+ * src/reader.c (yylsp_needed): Remove this variable, now replaced
+ with `locationsflag'.
+ * doc/bison.texinfo: Document `--locations' and `%locations'.
+ Sort the options.
+ * tests/calc.m4: Test it.
+
+ For regularity of the names, replace each
+ (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
+ (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
+ In addition replace each `flag' with `_flag'.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ Also test parse error messages, including with YYERROR_VERBOSE.
+
+ * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
+ associative).
+ Use it to check the computations.
+ Use it to check `nonassoc' is honored.
+ (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
+ `--yyerror-verbose'.
+ (_AT_CHECK_CALC): Adjust to this option.
+ (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ Test also `--verbose', `--defines' and `--name-prefix'. Testing
+ the latter demonstrates a flaw in the handling of non debugging
+ parsers introduced by myself on 2000-03-16: `#define yydebug 0'
+ was used in order to simplify:
+
+ #if YYDEBUG
+ if (yydebug)
+ {
+ ...
+ }
+ #endif
+
+ into
+
+ if (yydebug)
+ {
+ ...
+ }
+
+ unfortunately this leads to a CPP conflict when
+ `--name-prefix=foo' is used since it produces `#define yydebug
+ foodebug'.
+
+ * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
+ (YYDPRINTF): New macro.
+ Spread its use.
+ * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
+ the bison options.
+ Also test `--verbose', `--defines' and `--name-prefix'.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ Improve the readability of the produced parsers.
+
+ * src/bison.s1: Formatting changes.
+ Improve the comment related to the `$' mark.
+ (yydefault): Don't fall through to `yyresume': `goto' there.
+ * src/output.c (output_parser): When the `$' is met, skip the end
+ of its line.
+ New variable, `number_of_dollar_signs', to check there's exactly
+ one `$' in the parser skeleton.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * lib/xstrdup.c: New file, from the fileutils.
+ * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
+ (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
+ instead of strlen + xmalloc + strcpy.
+ * src/symtab.c (copys): Remove, use xstrdup instead.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/gram.h (associativity): New enum type which replaces the
+ former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
+ `right_assoc', `left_assoc' and `non_assoc'.
+ Adjust all dependencies.
+ * src/reader.c: Formatting changes.
+ (LTYPESTR): Don't define it, use it as a literal in
+ `reader_output_yylsp'.
+ * src/symtab.h (symbol_class): New enum type which replaces the
+ former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
+ `sunknown', `stoken and `snterm'.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (fixed_outfiles): Rename as...
+ (yaccflag): for consistency and accuracy.
+ Adjust dependencies.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ Use the more standard files `xalloc.h' and `xmalloc.c' instead of
+ Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
+ difficult and introduced a lot of core dump. It turns out that
+ Bison used an implementation of `xmalloc' based on `calloc', and
+ at various places it does depend upon the initialization to 0. I
+ have not tried to isolate the pertinent places, and all the former
+ calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
+ someone should address this issue.
+
+ * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
+ * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
+ files.
+ Adjust dependencies.
+ * src/warshall.h: New file.
+ Propagate.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ Various anti-`extern in *.c' changes.
+
+ * src/system.h: Include `assert.h'.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/state.h (nstates, final_state, first_state, first_shift)
+ (first_reduction): Move their exportation from here...
+ * src/LR0.h: to here.
+ Adjust dependencies.
+ * src/getargs.c (statisticsflag): New variable.
+ Add support for `--statistics'.
+ Adjust dependencies.
+
+ Remove a lot of now useless `extern' statements in most files.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/LR0.h: New file.
+ Propagate its use.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/print.h: New file.
+ Propagate its use.
+ * src/print.c: Formatting and ordering changes.
+ (verbose, terse): Replace with...
+ (print_results): this new function.
+ Adjust dependencies.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/conflicts.c (conflict_report): New function.
+ (conflict_log, verbose_conflict_log): Replace with...
+ (print_conflicts): this function.
+ Adjust dependencies.
+ * src/conflicts.h: New file.
+ Propagate its inclusion.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/nullable.h: New file.
+ Propagate its inclusion.
+ * src/nullable.c: Formatting changes.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/reduce.h: New file.
+ Propagate its inclusion.
+ * src/reduce.c: Topological sort and other formatting changes.
+ (bool, TRUE, FALSE): Move their definition to...
+ * src/system.h: here.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/files.c: Formatting changes.
+ (tryopen, tryclose, openfiles): Rename as...
+ (xfopen, xfclose, open_files): this.
+ (stringappend): static.
+ * src/files.h: Complete the list of exported symbols.
+ Propagate its use.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/reader.h: New file.
+ Propagate its use instead of tedious list of `extern' and
+ prototypes.
+ * src/reader.c: Formatting changes, topological sort,
+ s/register//.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/lex.h: Prototype `lex.c' exported functions.
+ * src/reader.c: Adjust.
+ * src/lex.c: Formatting changes.
+ (safegetc): Rename as...
+ (xgetc): this.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/lalr.h: New file.
+ Propagate its inclusion instead of prototypes and `extern'.
+ * src/lalr.c: Formatting changes, topological sorting etc.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (token_actions): Introduce a temporary array,
+ YYDEFACT, that makes it possible for this function to use
+ output_short_table.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ `user_toknums' is output as a `short[]' in `output.c', while it is
+ defined as a `int[]' in `reader.c'. For consistency with the
+ other output tables, `user_toknums' is now defined as a table of
+ shorts.
+
+ * src/reader.c (user_toknums): Be a short table instead of an int
+ table.
+ Adjust dependencies.
+
+ Factor the short table outputs.
+
+ * src/output.c (output_short_table): New function.
+ * src/output.c (output_gram, output_stos, output_rule_data)
+ (output_base, output_table, output_check): Use it.
+
+2000-10-02 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output): Topological sort of the functions, in
+ order to get rid of the `static' prototypes.
+ No longer use `register'.
+ * src/output.h: New file.
+ Propagate its inclusion in files explicitly prototyping functions
+ from output.c.
+
+2000-09-21 Akim Demaille <akim@epita.fr>
+
+ * src/atgeneral.m4: Update from Autoconf.
+
+2000-09-21 Akim Demaille <akim@epita.fr>
+
+ * src/closure.h: New file.
+ * src/closure.c: Formatting changes, topological sort over the
+ functions, use of closure.h.
+ (initialize_closure, finalize_closure): Rename as...
+ (new_closure, free_closure): these. Adjust dependencies.
+ * src/LR0.c: Formatting changes, topological sort, use of
+ cloture.h.
+ (initialize_states): Rename as...
+ (new_states): this.
+ * src/Makefile.am (noinst_HEADERS): Adjust.
+
+2000-09-20 Akim Demaille <akim@epita.fr>
+
+ * src/acconfig.h: Don't protect config.h against multiple
+ inclusion.
+ Don't define PARAMS.
+ * src/system.h: Define PARAMS.
+ Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
+ purpose of config.h. system.h must not try to fix wrong
+ definitions in config.h.
+
+2000-09-20 Akim Demaille <akim@epita.fr>
+
+ * src/derives.h: New file.
+ * src/main.c, src/derives.h: Use it.
+ Formatting changes.
+ * src/Makefile.am (noinst_HEADERS): Adjust.
+
+2000-09-20 Akim Demaille <akim@epita.fr>
+
+ * tests/atgeneral.m4: Update from Autoconf.
+ * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
+ (AT_CHECK_CALC): New macros.
+ Use these macros to test bison with options `', `--raw',
+ `--debug', `--yacc', `--yacc --debug'.
+
+2000-09-19 Akim Demaille <akim@epita.fr>
+
+ * src/output.c: Formatting changes.
+ * src/machine.h: Remove, leaving its contents in...
+ * src/system.h: here.
+ Include stdio.h.
+ Adjust all dependencies on stdio.h and machine.h.
+ * src/getargs.h: New file.
+ Let all `extern' declarations about getargs.c be replaced with
+ inclusion of `getargs.h'.
+ * src/Makefile.am (noinst_HEADERS): Adjust.
+
+ * tests/calc.m4 (yyin): Be initialized in main, not on the global
+ scope.
+ (yyerror): Returns void, not int.
+ * doc/bison.texinfo: Formatting changes.
+
+2000-09-19 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
+ portable.
+
+2000-09-18 Akim Demaille <akim@epita.fr>
+
+ * configure.in: Append WARNING_CFLAGS to CFLAGS.
+ * src/Makefile.am (INCLUDES): Don't.
+ Be ready to fetch headers in lib/.
+
+2000-09-18 Akim Demaille <akim@epita.fr>
+
+ * doc/bison.texinfo: Update the copyright.
+ ANSIfy and GNUify the examples.
+ Remove the old menu.
+
+2000-09-18 Akim Demaille <akim@epita.fr>
+
+ First set of tests: use the `calc' example from the documentation.
+
+ * src/bison.s1 (yyparse): Condition the code using `yytname' which
+ is defined only when YYDEBUG is.
+ * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
+ * src/files.c (tryopen, tryclose): Formatting changes.
+ Move to the top and be static.
+ * src/reader.c (read_signed_integer): Likewise.
+ * tests/calc.m4: New file.
+ * Makefile.am, suite.m4: Adjust.
+ * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
+
+2000-09-18 Akim Demaille <akim@epita.fr>
+
+ Add support for an Autotest test suite for Bison.
+
+ * m4/m4.m4, m4/atconfig.m4: New files.
+ * m4/Makefile.am (EXTRA_DIST): Adjust.
+ * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
+ files.
+ * src/getargs.c: Display a more standard --version message.
+ * src/reader.c (reader): Formatting changes.
+ No longer depend upon VERSION_STRING.
+ * configure.in: No longer use `dnl'.
+ Set up the test suite and the new directory `tests/.
+ (VERSION_STRING): Remove.
+
+2000-04-14 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_comment2): New function, same as former
+ `copy_comment', but outputs into two FILE *.
+ (copy_comment): Use it.
+ (parse_union_decl): Use it.
+ (get_type, parse_start_decl): Use the same `invalid' message.
+ (parse_start_decl, parse_union_decl): Use the same `multiple'
+ message.
+ (parse_union_decl, copy_guard, copy_action): Use the same
+ `unmatched' message.
+ * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
+
+2000-03-31 Akim Demaille <akim@epita.fr>
+
+ * src/files.c (tryopen, tryclose): Move to the top.
+ Be static.
+
+2000-03-31 Akim Demaille <akim@epita.fr>
+
+ * src/main.c (main): Don't call `done', exit does it.
+
+2000-03-31 Akim Demaille <akim@epita.fr>
+
+ * allocate.c: s/return (foo)/return foo/.
+ * lalr.c: Likewise.
+ * LR0.c: Likewise.
+ * output.c: Likewise.
+ * reader.c: Likewise.
+ * symtab.c: Likewise.
+ * vmsgetargs.c: Likewise.
+
+2000-03-31 Akim Demaille <akim@epita.fr>
+
+ Clean up the error reporting functions.
+
+ * src/report.c: New file.
+ * src/report.h: Likewise.
+ * src/Makefile.am: Adjust.
+ * m4/error.m4: New file.
+ * m4/Makefile.am: Adjust.
+ * configure.in (jm_PREREQ_ERROR): Call it.
+ * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
+ Remove.
+ (fatal, fatals): Remove. All callers use complain.c::fatal.
+ (warn, warni, warns, warnss, warnss): Remove. All callers use
+ complain.c::complain.
+ (toomany): Remove, use fatal instead.
+ * src/files.c (done): No argument, use complain_message_count.
+ * src/main.c (main): Register `done' to `atexit'.
+
+ * src/getargs.c (usage): More `fputs', less `fprintf'.
+
+2000-03-28 Akim Demaille <akim@epita.fr>
+
+ * lib/: New directory.
+ * Makefile.am (SUBDIRS): Adjust.
+ * configure.in: Adjust.
+ (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
+ useless.
+ * src/alloca.c: Moved to lib/.
+ * src/getopt.c: Likewise.
+ * src/getopt1.c: Likewise.
+ * src/getopt.h: Likewise.
+ * src/ansi2knr.c: Likewise.
+ * src/ansi2knr.1: Likewise.
+ * src/Makefile.am: Adjust.
+ * lib/Makefile.am: New file.
+
+2000-03-28 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (usage): Refresh the help message.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/getopt1.c: Updated from textutils 2.0e
+ * src/getopt.c: Likewise.
+ * src/getopt.h: Likewise.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/Makefile.am (bison.simple): Fix the awk program: quote only
+ the file name, not the whole `#line LINE FILE'.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ On syntax errors, report the token on which we choked.
+
+ * src/bison.s1 (yyparse): In the label yyerrlab, when
+ YYERROR_VERBOSE, add yychar in msg.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_at): New function.
+ (copy_guard): Use it.
+ (copy_action): Use it.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ Be kind to translators, save some useless translations.
+
+ * src/main.c (banner): New function.
+ (fatal_banner): Use it.
+ (warn_banner): Use it.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_definition): Use copy_string and
+ copy_comment. Removed now unused `match', `ended',
+ `cplus_comment'.
+ (copy_comment, copy_string): Moved, to be visible from
+ copy_definition.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_string): Declare `static inline'. No
+ problems with inline, since it is checked by configure.
+ (copy_comment): Likewise.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (packsymbols): Formatting changes.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_comment): New function, factored out from:
+ (copy_action): Use it. Removed now unused `match', `ended',
+ `cplus_comment'.
+ (copy_guard): Likewise.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c (copy_string): New function, factored out from:
+ (copy_action): Use it.
+ (copy_guard): Likewise.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ Change the handling of @s so that they behave exactly like $s.
+ There is now a pseudo variable @$ (readble and writable), location
+ of the lhs of the rule (by default ranging from the location of
+ the first symbol of the rhs, to the location of the last symbol,
+ or, if the rhs is empty, YYLLOC).
+
+ * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
+ yyval.
+ (yyparse): When providing a default semantic action, provide a
+ default location action.
+ (after the $): No longer change `*YYLSP', just stack YYLOC the
+ same way you stack YYVAL.
+ * src/reader.c (read_declarations): Use warns.
+ (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
+ (copy_action, case '@'): Likewise.
+ Use a standard error message, to save useless work from
+ translators.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1: Formatting and cosmetics changes.
+ * src/reader.c: Likewise.
+ Update the Copyright notice.
+
+2000-03-17 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1 (#line): All set to `#line' only, since the
+ Makefile now handles them.
+
+2000-03-16 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_rule_data): Output the documentation of
+ some of the tables.
+ (Copyright notice): Update.
+ Formatting changes.
+
+2000-03-16 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
+ remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
+ One `#if YYDEBUG' remains, since it uses variables which are
+ defined only if `YYDEBUG != 0'.
+
+2000-03-16 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
+ and related variables so that the similarities are highlighted.
+
+2000-03-16 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1: Properly indent CPP directives.
+
+2000-03-16 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1: Properly indent the `alloca' CPP section.
+
+2000-03-16 Akim Demaille <akim@epita.fr>
+
+ Do not hard code values of directories in `configure.in'.
+ Update the `configure' tool chain.
+
+ * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
+ src/makefile.am.
+ (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
+ (AC_OUTPUT): Add m4/Makefile.
+ Bump to bison 1.28a, 1.29 has never been released.
+ * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
+ handled via src/Makefile.am.
+ (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
+ HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
+ autoheader.
+ * Makefile.am (SUBDIRS): Add m4.
+ (ACLOCAL_AM_FLAGS): New variable.
+ (AUTOMAKE_OPTIONS): Add check-news.
+ * src/Makefile.am (bison.simple): Use awk to replace #line lines with
+ the proper line number and file name.
+ (DEFS): Propagate the location of bison library files and of the
+ locale files.
+ (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
+ builddir.
+ * acinclude.m4: Remove, replaced by the directory m4.
+ * m4/Makefile.am (EXTRA_DIST): New variable.
+ * m4/gettext.m4: New file, from the fileutils.
+ * m4/lcmessage.m4: Likewise
+ * m4/progtest.m4: Likewise.
+ * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
+
+2000-03-10 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c:
+ Formatting changes of various comments.
+ Respect the GNU coding standards at various places.
+ Don't use `_()' when no translation is needed.
+
+1999-12-13 Jesse Thilo <jthilo@gnu.org>
+
+ * src/files.c:
+ OS/2 honors TMPDIR environment variable.
+
+1999-12-13 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/bison.texinfo: Tweaked spelling and grammar.
+ Updated ISBN.
+ Removed reference to price of printed copy.
+ Mention BISON_SIMPLE and BISON_HAIRY.
+
+1999-12-13 Jesse Thilo <jthilo@gnu.org>
+
+ * configure.in, NEWS:
+ Bison 1.29 released.
+
+1999-10-27 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
+ Added reference card.
+
+1999-07-26 Jesse Thilo <jthilo@gnu.org>
+
+ * po/ru.po: Added Russian translation.
+
+1999-07-26 Jesse Thilo <jthilo@gnu.org>
+
+ * configure.in: Added Russian translation.
+
+1999-07-06 Jesse Thilo <jthilo@gnu.org>
+
+ * configure.in, NEWS, README:
+ Released version 1.28.
+
+1999-06-14 Jesse Thilo <jthilo@gnu.org>
+
+ * src/system.h:
+ Squashed redefinition warning on some systems.
+
+ * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
+ Have configure build version string instead of relying on ANSI string
+ concatentation.
+
+1999-06-14 Jesse Thilo <jthilo@gnu.org>
+
+ * po/POTFILES.in: Got rid of version.c.
+
+1999-06-14 Jesse Thilo <jthilo@gnu.org>
+
+ * acconfig.h, configure.in:
+ Have configure build version string instead of relying on ANSI string
+ concatentation.
+
+1999-06-08 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/bison.1:
+ Dropped mention of `+' for long-named options.
+
+1999-05-30 Jesse Thilo <jthilo@gnu.org>
+
+ * src/files.c: Added <unistd.h> for unlink().
+
+ * src/Makefile.am, src/system.h:
+ I18n fixes.
+
+1999-05-30 Jesse Thilo <jthilo@gnu.org>
+
+ * README: Added a FAQ list.
+
+ * configure.in, acconfig.h:
+ I18n fixes.
+
+1999-05-30 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/FAQ, doc/Makefile.am:
+ Added a FAQ list.
+
+1999-05-19 Jesse Thilo <jthilo@gnu.org>
+
+ * src/alloc.h, src/symtab.h, src/version.c:
+ Protected inclusion of "config.h" with HAVE_CONFIG_H.
+
+1999-04-18 Jesse Thilo <jthilo@gnu.org>
+
+ * src/.cvsignore, src/Makefile.am:
+ Reorganized: sources in `src', documentation in `doc'.
+
+ * src/lex.c (literalchar):
+ fixed the code for escaping double quotes (thanks
+ Jonathan Czisny.)
+
+1999-04-18 Jesse Thilo <jthilo@gnu.org>
+
+ * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
+ Adjusted paths to reflect directory reorganization.
+
+1999-04-18 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/.cvsignore, doc/Makefile.am:
+ Reorganized: sources in `src', documentation in `doc'.
+
+1999-04-18 Jesse Thilo <jthilo@gnu.org>
+
+ * configure.in:
+ Updated AC_INIT file to reflect directory reorganization.
+
+ * configure.in, .cvsignore, Makefile.am, POTFILES.in:
+ Reorganized: sources in `src', documentation in `doc'.
+
+1999-04-13 Jesse Thilo <jthilo@gnu.org>
+
+ * src/allocate.c:
+ Don't declare calloc() and realloc() if not necessary.
+
+1999-04-13 Jesse Thilo <jthilo@gnu.org>
+
+ * configure.in, acconfig.h, acinclude.m4:
+ Don't declare calloc() and realloc() if not necessary.
+
+1999-03-23 Jesse Thilo <jthilo@gnu.org>
+
+ * po/.cvsignore: Added i18n support.
+
+1999-03-23 Jesse Thilo <jthilo@gnu.org>
+
+ * acconfig.h, configure.in, Makefile.am:
+ Added i18n support.
+
+1999-03-22 Jesse Thilo <jthilo@gnu.org>
+
+ * src/bison.s1: Fixed #line numbers.
+
+1999-03-15 Jesse Thilo <jthilo@gnu.org>
+
+ * po/es.po, po/fr.po, po/nl.po, po/de.po:
+ Added PO files from Translation Project.
+
+1999-03-03 Jesse Thilo <jthilo@gnu.org>
+
+ * Makefile.am:
+ Added support for non-ANSI compilers (ansi2knr).
+
+1999-02-16 Jesse Thilo <jthilo@gnu.org>
+
+ * configure.in: Bumped version number to 1.27.
+
+ * Makefile.am:
+ Added `bison.simple' to list of files removed by `make distclean'.
+
+1999-02-12 Jesse Thilo <jthilo@gnu.org>
+
+ * src/files.c, src/files.h:
+ Defined locations of parser files in config.h instead of Makefile.
+
+1999-02-12 Jesse Thilo <jthilo@gnu.org>
+
+ * acconfig.h, acinclude.m4, configure.in, Makefile.am:
+ Defined locations of parser files in config.h instead of Makefile.
+
+1999-02-09 Jesse Thilo <jthilo@gnu.org>
+
+ * Makefile.am:
+ Removed inappropriate use of $< macro.
+
+1999-02-05 Jesse Thilo <jthilo@gnu.org>
+
+ * po/Makefile.in.in, po/POTFILES.in:
+ Add `po' directory skeleton.
+
+1999-01-27 Jesse Thilo <jthilo@gnu.org>
+
+ * README: Document help-bison list.
+
+ * configure.in: Add check for mkstemp().
+
+1999-01-20 Jesse Thilo <jthilo@gnu.org>
+
+ * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
+ Hush a few compiler warnings.
+
+ * src/files.c:
+ Add tryclose(), which verifies that fclose was successful.
+ Hush a couple of compiler warnings.
+
+1999-01-20 Jesse Thilo <jthilo@gnu.org>
+
+ * Makefile.am, OChangeLog:
+ ChangeLog is now automatically generated. Include the old version as
+ OChangeLog.
+
+1999-01-14 Jesse Thilo <jthilo@gnu.org>
+
+ * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c:
+ Update FSF address.
+
+1999-01-14 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/bison.texinfo: Fix formatting glitch.
+
+ * doc/bison.texinfo: Update FSF address.
+
+1999-01-14 Jesse Thilo <jthilo@gnu.org>
+
+ * acconfig.h: Update FSF address.
+
+1999-01-08 Jesse Thilo <jthilo@gnu.org>
+
+ * src/system.h:
+ Don't define PACKAGE here, since config.h defines it.
+
+1998-12-30 Jesse Thilo <jthilo@gnu.org>
+
+ * src/reader.c: Update copyright date.
+
+ * src/main.c:
+ Ditch sprintf to statically-sized buffers in fatal/warn functions in
+ favor of output directly to stderr (avoids buffer overruns).
+
+ * src/reader.c: Some checks for premature EOF.
+
+ * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c:
+ Use prototypes if the compiler understands them.
+
+ * src/files.c: Honor TMPDIR on Unix hosts.
+ Use prototypes if the compiler understands them.
+
+ * src/reader.c:
+ Fix a couple of buffer overrun bugs.
+ Use prototypes if the compiler understands them.
+
+ * src/system.h: Include unistd.h and ctype.h.
+ Use #ifdef instead of #if for NLS symbols.
+
+1998-12-30 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/bison.texinfo:
+ Delete comment "consider using @set for edition number, etc..." since
+ we now are doing so.
+
+1998-12-30 Jesse Thilo <jthilo@gnu.org>
+
+ * configure.in:
+ Use prototypes if the compiler understands them.
+
+ * NEWS: Document 1.26 highlights.
+
+ * Makefile.am: Require Automake 1.3 or later.
+
+ * acconfig.h:
+ Use prototypes if the compiler understands them.
+
+1998-12-29 Jesse Thilo <jthilo@gnu.org>
+
+ * src/version.c:
+ Use VERSION symbol from automake for version number.
+
+1998-12-29 Jesse Thilo <jthilo@gnu.org>
+
+ * acconfig.h, configure.in, version.cin:
+ Use VERSION symbol from automake for version number.
+
+1998-11-28 Jesse Thilo <jthilo@gnu.org>
+
+ * Makefile.am:
+ Distribute original version of simple parser (bison.s1), not built
+ version (bison.simple).
+
+1998-11-28 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/bison.texinfo: Add info dir entry.
+
+ * doc/bison.texinfo:
+ Let automake put version number into documentation.
+
+1998-11-26 Jesse Thilo <jthilo@gnu.org>
+
+ * src/bison.cld, src/build.com, src/vmshlp.mar:
+ Add non-RCS files from /gd/gnu/bison.
+
+1998-11-26 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/bison.1:
+ Document the BISON_HAIRY and BISON_SIMPLE variables.
+
+1998-11-25 Jesse Thilo <jthilo@gnu.org>
+
+ * src/version.c: Build version.c automatically.
+
+ * src/reader.c:
+ Fix token numbering (used to start at 258, not 257).
+
+ * src/system.h: Include config.h.
+
+ * src/getargs.c: Update bug report address.
+
+ * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
+ Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
+
+1998-11-25 Jesse Thilo <jthilo@gnu.org>
+
+ * Makefile.am:
+ Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
+
+ * configure.in, version.cin:
+ Build version.c automatically.
+
+ * AUTHORS: Add AUTHORS file.
+
+ * README: Update bug report address.
+
+ * bison.simple:
+ Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
+
+ * configure.in, Makefile.am, Makefile.in, stamp-h.in:
+ Add automake stuff.
+
+1998-11-25 Jesse Thilo <jthilo@gnu.org>
+
+ * doc/bison.texinfo: Clean up some formatting.
+
+1998-05-05 Richard Stallman <rms@gnu.org>
+
+ * doc/bison.texinfo:
+ Explain better why to make a pure parser.
+
+1998-01-05 Richard Stallman <rms@gnu.org>
+
+ * src/files.c (openfiles):
+ [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
+ find a temporary directory, if possible. Do not unlink files while
+ they are open.
+
+1997-08-25 Richard Stallman <rms@gnu.org>
+
+ * src/reader.c (stack_offset;):
+ Change some warni to warns.
+
+ * src/lex.c (literalchar): Use warns, not warni.
+
+1997-06-28 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: Add a Bison version comment.
+
+ * src/main.c (fatal, warn, berror):
+ Use program_name.
+
+1997-06-28 Richard Stallman <rms@gnu.org>
+
+ * Makefile.in (bison_version): New variable.
+ (dist): Use that variable.
+ (bison.s1): Substitute the Bison version into bison.simple.
+
+ * bison.simple: Add a Bison version comment.
+
+1997-06-18 Richard Stallman <rms@gnu.org>
+
+ * src/main.c (fatal, warn, berror):
+ Make error messages standard.
+ (toomany): Improve error message text.
+
+ * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c:
+ new.h renamed to alloc.h.
+
+1997-06-18 Richard Stallman <rms@gnu.org>
+
+ * Makefile.in: new.h renamed to alloc.h.
+
+1997-05-24 Richard Stallman <rms@gnu.org>
+
+ * src/lex.c (literalchar):
+ Fix the code for escaping \, " and '.
+
+ (lex): Avoid trouble when there are many chars
+ to discard in a char literal with just several chars in it.
+
+1997-05-17 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1:
+ Use malloc, if using alloca is troublesome.
+ (YYSTACK_USE_ALLOCA): New flag macro.
+ Define it for some systems and compilers.
+ (YYSTACK_ALLOC): New macro.
+ (yyparse): Use YYSTACK_ALLOC to allocate stack.
+ If it was malloc'd, free it.
+
+1997-05-17 Richard Stallman <rms@gnu.org>
+
+ * bison.simple:
+ Use malloc, if using alloca is troublesome.
+ (YYSTACK_USE_ALLOCA): New flag macro.
+ Define it for some systems and compilers.
+ (YYSTACK_ALLOC): New macro.
+ (yyparse): Use YYSTACK_ALLOC to allocate stack.
+ If it was malloc'd, free it.
+
+1997-04-23 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1:
+ (alloca) [__hpux]: Always define as __builtin_alloca.
+
+1997-04-23 Richard Stallman <rms@gnu.org>
+
+ * bison.simple:
+ (alloca) [__hpux]: Always define as __builtin_alloca.
+
+1997-04-22 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1:
+ [__hpux]: Include alloca.h (right for HPUX 10)
+ instead of declaring alloca (right for HPUX 9).
+
+ * src/bison.s1 (__yy_memcpy):
+ Declare arg `count' as unsigned int.
+ (yyparse): Cast third arg to __yy_memcpy to unsigned int.
+
+1997-04-22 Richard Stallman <rms@gnu.org>
+
+ * bison.simple:
+ [__hpux]: Include alloca.h (right for HPUX 10)
+ instead of declaring alloca (right for HPUX 9).
+
+ * bison.simple (__yy_memcpy):
+ Declare arg `count' as unsigned int.
+ (yyparse): Cast third arg to __yy_memcpy to unsigned int.
+
+1997-01-03 Richard Stallman <rms@gnu.org>
+
+ * src/allocate.c: [__STDC__ or _MSC_VER]:
+ Declare calloc and realloc to return void *.
+
+1997-01-02 Richard Stallman <rms@gnu.org>
+
+ * src/system.h:
+ [_MSC_VER]: Include stdlib.h and process.h.
+ [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
+
+ * src/main.c (main): Return FAILURE as a value.
+ (printable_version): Declare arg as int, not char.
+
+1997-01-02 Richard Stallman <rms@gnu.org>
+
+ * Makefile.in (dist):
+ Explicitly check for symlinks, and copy them.
+
+1996-12-19 Richard Stallman <rms@gnu.org>
+
+ * src/files.c:
+ [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
+
+1996-12-18 Paul Eggert <eggert@gnu.org>
+
+ * src/bison.s1 (yyparse):
+ If __GNUC__ and YYPARSE_PARAM are both defined,
+ declare yyparse to have a void * argument.
+
+1996-12-18 Paul Eggert <eggert@gnu.org>
+
+ * bison.simple (yyparse):
+ If __GNUC__ and YYPARSE_PARAM are both defined,
+ declare yyparse to have a void * argument.
+
+1996-12-17 Richard Stallman <rms@gnu.org>
+
+ * src/reduce.c (nbits): Add some casts.
+
+1996-08-12 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: Test _MSDOS as well as _MSDOS_.
+
+1996-08-12 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: Test _MSDOS as well as _MSDOS_.
+
+1996-07-31 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1:
+ [__sun && __i386]: Include alloca.h.
+
+1996-07-31 Richard Stallman <rms@gnu.org>
+
+ * bison.simple:
+ [__sun && __i386]: Include alloca.h.
+
+1996-07-30 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: Comment change.
+
+ * src/bison.s1: Test _MSDOS_, not MSDOS.
+
+1996-07-30 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: Comment change.
+
+ * bison.simple: Test _MSDOS_, not MSDOS.
+
+1996-06-01 Richard Stallman <rms@gnu.org>
+
+ * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c:
+ Insert `_' macro around many string constants.
+
+ * src/main.c:
+ Insert `_' macro around many string constants.
+
+ (main): Call setlocale, bindtextdomain and textdomain.
+
+ * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
+ [! HAVE_LOCALE_H] (setlocale): Define as no-op.
+ [ENABLE_NLS]: Include libintl.h.
+ [ENABLE_NLS] (gettext): Define.
+ [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
+ (N_, PACKAGE, LOCALEDIR): New macros.
+
+1996-06-01 Richard Stallman <rms@gnu.org>
+
+ * POTFILES.in: New file.
+
+ * Makefile.in (allocate.o):
+ Define target explicitly.
+
+ * Makefile.in (CFLAGS): Set to @CFLAGS@.
+ (LDFLAGS): Set to @LDFLAGS@.
+ (configure): Run autoconf only if preceding `cd' succeeds.
+ (bison.s1): Redirect output to temporary file then move the
+ temporary to the target, rather than redirecting directly to bison.s1.
+ (clean): Remove config.status and config.log.
+ (distclean): Don't remove config.status here.
+
+1996-05-12 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1:
+ (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
+
+1996-05-12 Richard Stallman <rms@gnu.org>
+
+ * bison.simple:
+ (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
+
+1996-05-11 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1 (__yy_memcpy):
+ Really reorder the args, as was supposedly done on Feb 14 1995.
+ (yyparse): Calls changed accordingly.
+
+1996-05-11 Richard Stallman <rms@gnu.org>
+
+ * Makefile.in (dist): Don't use $(srcdir).
+
+ * bison.simple (__yy_memcpy):
+ Really reorder the args, as was supposedly done on Feb 14 1995.
+ (yyparse): Calls changed accordingly.
+
+1996-01-27 Richard Stallman <rms@gnu.org>
+
+ * src/output.c (output_rule_data):
+ Test YYERROR_VERBOSE in the conditional
+ around the definition of ttyname.
+
+1995-12-29 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1:
+ Fix line numbers in #line commands.
+
+1995-12-29 Richard Stallman <rms@gnu.org>
+
+ * bison.simple:
+ Fix line numbers in #line commands.
+
+1995-12-27 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1 (YYPARSE_PARAM_DECL):
+ In C++, make it always null.
+ (YYPARSE_PARAM_ARG): New macro.
+ (yyparse): Use YYPARSE_PARAM_ARG.
+
+1995-12-27 Richard Stallman <rms@gnu.org>
+
+ * bison.simple (YYPARSE_PARAM_DECL):
+ In C++, make it always null.
+ (YYPARSE_PARAM_ARG): New macro.
+ (yyparse): Use YYPARSE_PARAM_ARG.
+
+1995-11-29 Richard Stallman <rms@gnu.org>
+
+ * doc/bison.texinfo:
+ Describe literal string tokens, %raw, %no_lines, %token_table.
+
+1995-11-29 Daniel Hagerty <hag@gnu.org>
+
+ * doc/bison.texinfo: Fixed update date
+
+1995-10-16 Richard Stallman <rms@gnu.org>
+
+ * src/version.c: Version 1.25.
+
+1995-10-16 Richard Stallman <rms@gnu.org>
+
+ * NEWS: *** empty log message ***
+
+1995-10-16 Richard Stallman <rms@gnu.org>
+
+ * doc/bison.1, doc/bison.rnh:
+ Add new options.
+
+1995-10-15 Richard Stallman <rms@gnu.org>
+
+ * src/vmsgetargs.c, src/getargs.c:
+ Added -n, -k, and -raw switches.
+ (noparserflag, toknumflag, rawtoknumflag): New variables.
+
+ * src/symtab.h (SALIAS):
+ New #define for adding aliases to %token.
+ (struct bucket): Added `alias' field.
+
+ * src/reduce.c (reduce_grammar):
+ Revise error message.
+ (print_notices): Remove final `.' from error message.
+
+ * src/reader.c (reader_output_yylsp):
+ New function.
+ (readgram): Use `#if 0' around code that accepted %command
+ inside grammar rules: The documentation doesn't allow it,
+ and it will fail since the %command processors scan for the next %.
+ (parse_token_decl): Extended the %token
+ declaration to allow a multi-character symbol as an alias.
+ (parse_thong_decl): New function.
+ (read_declarations): Added %thong declarations.
+ (read_declarations): Handle NOOP to deal with allowing
+ % declarations as another means to specify the flags.
+ (readgram): Allow %prec prior to semantics embedded in a rule.
+ (skip_to_char, read_declarations, copy_definition)
+ (parse_token_decl, parse_start_decl, parse_type_decl)
+ (parse_assoc_decl, parse_union_decl, parse_expect_decl)
+ (get_type_name, copy_guard, copy_action, readgram)
+ (get_type, packsymbols): Revised most error messages.
+ Changed `fatal' to `warnxxx' to avoid aborting for error.
+ Revised and use multiple warnxxx functions to avoid using VARARGS1.
+ (read_declarations): Improve the error message for
+ an invalid character. Do not abort.
+ (read_declarations, copy_guard, copy_action): Use
+ printable_version to avoid unprintable characters in printed output.
+ (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
+ (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
+ Allow the type of a non-terminal can be given
+ more than once, as long as all specifications give the same type.
+
+ * src/output.c:
+ (output_headers, output_trailers, output, output_gram)
+ (output_rule_data): Implement noparserflag variable.
+ Implement toknumflag variable.
+ (output): Call reader_output_yylsp to output LTYPESTR.
+
+ * src/main.c (main):
+ If reader sees an error, don't process the grammar.
+ (fatals): Updated to not use VARARGS1.
+ (printable_version, int_to_string, warn, warni, warns, warnss)
+ (warnsss): New error reporting functions. Avoid abort for error.
+
+ * src/lex.h:
+ Added THONG and NOOP for alias processing.
+ Added SETOPT for the new code that allows setting options with %flags.
+
+ * src/lex.c:
+ Include getopt.h. Add some extern decls.
+ (safegetc): New function to deal with EOF gracefully.
+ (literalchar); new function to deal with reading \ escapes.
+ (lex): Use literalchar.
+ (lex): Implemented "..." tokens.
+ (literalchar, lex, parse_percent_token): Made tokenbuffer
+ always contain the token. This includes growing the token
+ buffer while reading an integer.
+ (parse_percent_token): Replaced if-else statement with percent_table.
+ (parse_percent_token): Added % declarations as another
+ way to specify the flags -n, -l, and -r. Also added hooks for
+ -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
+ major changes to files.c.
+ (lex) Retain in the incoming stream a character following
+ an incorrect '/'.
+ (skip_white_space, lex): Revised most error messages
+ and changed fatal to warn to avoid aborting.
+ (percent_table): Added %thong declarations.
+
+ * src/gram.h: Comment changes.
+
+ * src/files.c (openfiles, open_extra_files, done):
+ Add faction flag
+ and actfile file. Handle noparserflag. Both for -n switch.
+
+ * src/conflicts.c (resolve_sr_conflict):
+ Remove use of alloca.
+
+1995-06-01 Jim Meyering <meyering@gnu.org>
+
+ * doc/bison.texinfo: *** empty log message ***
+
+1995-05-06 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: Comment change.
+
+1995-05-06 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: Comment change.
+
+1995-05-03 Richard Stallman <rms@gnu.org>
+
+ * src/version.c: Version now 1.24.
+
+ * src/bison.s1: Change distribution terms.
+
+ * src/version.c: Version now 1.23.
+
+1995-05-03 Richard Stallman <rms@gnu.org>
+
+ * doc/bison.texinfo:
+ Rewrite "Conditions for Using Bison".
+ Update version to 1.24.
+
+1995-05-03 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: Change distribution terms.
+
+1995-02-23 Richard Stallman <rms@gnu.org>
+
+ * src/files.c: Test __VMS_POSIX as well as VMS.
+
+1995-02-14 Jim Meyering <meyering@gnu.org>
+
+ * src/bison.s1 (__yy_memcpy):
+ Renamed from __yy_bcopy to avoid
+ confusion. Reverse FROM and TO arguments to be consistent with
+ those of memcpy.
+
+1995-02-14 Jim Meyering <meyering@gnu.org>
+
+ * bison.simple (__yy_memcpy):
+ Renamed from __yy_bcopy to avoid
+ confusion. Reverse FROM and TO arguments to be consistent with
+ those of memcpy.
+
+1994-11-10 David J. MacKenzie <djm@gnu.org>
+
+ * NEWS: reformat
+
+ * NEWS: New file.
+
+ * Makefile.in (DISTFILES): Include NEWS.
+
+ * Makefile.in (DISTFILES):
+ Include install-sh, not install.sh.
+
+ * configure.in: Update to Autoconf v2 macro names.
+
+1994-10-05 David J. MacKenzie <djm@gnu.org>
+
+ * Makefile.in: fix typo
+
+ * Makefile.in (prefix, exec_prefix):
+ Let configure set them.
+
+1994-09-28 David J. MacKenzie <djm@gnu.org>
+
+ * Makefile.in: Set datadir to $(prefix)/share.
+
+1994-09-15 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1:
+ Update copyright notice and GPL version.
+
+1994-09-15 Richard Stallman <rms@gnu.org>
+
+ * bison.simple:
+ Update copyright notice and GPL version.
+
+1994-07-12 Richard Stallman <rms@gnu.org>
+
+ * src/reduce.c, src/reader.c:
+ entered into RCS
+
+1994-05-05 David J. MacKenzie <djm@gnu.org>
+
+ * Makefile.in: entered into RCS
+
+1994-03-26 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: entered into RCS
+
+1994-03-26 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: entered into RCS
+
+1994-03-25 Richard Stallman <rms@gnu.org>
+
+ * src/main.c: entered into RCS
+
+1994-03-24 Richard Stallman <rms@gnu.org>
+
+ * src/conflicts.c: entered into RCS
+
+1994-01-02 Richard Stallman <rms@gnu.org>
+
+ * Makefile.in: *** empty log message ***
+
+1993-11-21 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: *** empty log message ***
+
+1993-11-21 Richard Stallman <rms@gnu.org>
+
+ * doc/bison.texinfo: entered into RCS
+
+ * doc/bison.texinfo: *** empty log message ***
+
+1993-11-21 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: *** empty log message ***
+
+1993-10-25 David J. MacKenzie <djm@gnu.org>
+
+ * doc/bison.texinfo: *** empty log message ***
+
+1993-10-19 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: *** empty log message ***
+
+1993-10-19 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: *** empty log message ***
+
+1993-10-14 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: *** empty log message ***
+
+1993-10-14 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: *** empty log message ***
+
+1993-09-14 David J. MacKenzie <djm@gnu.org>
+
+ * doc/bison.texinfo: *** empty log message ***
+
+1993-09-13 Noah Friedman <friedman@gnu.org>
+
+ * Makefile.in: *** empty log message ***
+
+1993-09-10 Richard Stallman <rms@gnu.org>
+
+ * src/conflicts.c: *** empty log message ***
+
+ * src/system.h: entered into RCS
+
+1993-09-10 Richard Stallman <rms@gnu.org>
+
+ * doc/bison.1: entered into RCS
+
+1993-09-06 Noah Friedman <friedman@gnu.org>
+
+ * src/version.c: entered into RCS
+
+1993-09-06 Noah Friedman <friedman@gnu.org>
+
+ * Makefile.in: *** empty log message ***
+
+1993-07-30 David J. MacKenzie <djm@gnu.org>
+
+ * Makefile.in: *** empty log message ***
+
+1993-07-24 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: *** empty log message ***
+
+1993-07-24 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: *** empty log message ***
+
+1993-07-08 David J. MacKenzie <djm@gnu.org>
+
+ * Makefile.in: *** empty log message ***
+
+1993-07-04 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: *** empty log message ***
+
+1993-07-04 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: *** empty log message ***
+
+1993-06-26 David J. MacKenzie <djm@gnu.org>
+
+ * src/getargs.c: entered into RCS
+
+1993-06-26 David J. MacKenzie <djm@gnu.org>
+
+ * doc/bison.texinfo: *** empty log message ***
+
+ * doc/bison.1: New file.
+
+1993-06-25 Richard Stallman <rms@gnu.org>
+
+ * src/getargs.c: New file.
+
+1993-06-16 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: *** empty log message ***
+
+1993-06-16 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: *** empty log message ***
+
+1993-06-03 Richard Stallman <rms@gnu.org>
+
+ * src/bison.s1: New file.
+
+1993-06-03 Richard Stallman <rms@gnu.org>
+
+ * doc/bison.texinfo: *** empty log message ***
+
+1993-06-03 Richard Stallman <rms@gnu.org>
+
+ * bison.simple: New file.
+
+1993-05-19 Richard Stallman <rms@gnu.org>
+
+ * doc/bison.texinfo: New file.
+
+1993-05-07 Noah Friedman <friedman@gnu.org>
+
+ * Makefile.in: *** empty log message ***
+
+1993-04-28 Noah Friedman <friedman@gnu.org>
+
+ * src/reader.c: *** empty log message ***
+
+1993-04-23 Noah Friedman <friedman@gnu.org>
+
+ * src/alloc.h: entered into RCS
+
+1993-04-20 David J. MacKenzie <djm@gnu.org>
+
+ * src/version.c: *** empty log message ***
+
+ * src/files.c, src/allocate.c:
+ entered into RCS
+
+ * src/reader.c: *** empty log message ***
+
+ * src/lex.c: entered into RCS
+
+ * src/conflicts.c: New file.
+
+ * src/symtab.c: entered into RCS
+
+ * src/alloc.h: New file.
+
+ * src/LR0.c: entered into RCS
+
+1993-04-18 Noah Friedman <friedman@gnu.org>
+
+ * src/reader.c: New file.
+
+ * src/version.c: *** empty log message ***
+
+1993-04-18 Noah Friedman <friedman@gnu.org>
+
+ * Makefile.in: *** empty log message ***
+
+1993-04-17 Noah Friedman <friedman@gnu.org>
+
+ * Makefile.in: *** empty log message ***
+
+1993-04-15 Richard Stallman <rms@gnu.org>
+
+ * src/main.c, src/files.c:
+ New file.
+
+1993-04-15 Noah Friedman <friedman@gnu.org>
+
+ * configure.in: entered into RCS
+
+ * configure.in: *** empty log message ***
+
+ * configure.in: New file.
+
+1993-04-14 Richard Stallman <rms@gnu.org>
+
+ * Makefile.in: New file.
+
+1993-04-13 Richard Stallman <rms@gnu.org>
+
+ * src/version.c: New file.
+
+1993-03-25 Richard Stallman <rms@gnu.org>
+
+ * src/output.c: entered into RCS
+
+1992-09-25 Richard Stallman <rms@gnu.org>
+
+ * configure.bat: entered into RCS
+
+1992-06-22 Richard Stallman <rms@gnu.org>
+
+ * src/vmsgetargs.c: entered into RCS
+
+1992-06-22 Richard Stallman <rms@gnu.org>
+
+ * doc/bison.rnh: entered into RCS
+
+1992-04-20 David J. MacKenzie <djm@gnu.org>
+
+ * README: entered into RCS
+
+1992-01-22 Richard Stallman <rms@gnu.org>
+
+ * src/machine.h: entered into RCS
+
+1991-12-21 Richard Stallman <rms@gnu.org>
+
+ * src/lalr.c, src/closure.c:
+ entered into RCS
+
+1991-12-20 Richard Stallman <rms@gnu.org>
+
+ * src/state.h: entered into RCS
+
+1991-12-18 Richard Stallman <rms@gnu.org>
+
+ * src/print.c, src/nullable.c, src/derives.c:
+ entered into RCS
+
+1991-11-03 David J. MacKenzie <djm@gnu.org>
+
+ * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
+ entered into RCS
+
+1988-09-09 Richard Stallman <rms@gnu.org>
+
+ * src/bison.hairy: entered into RCS
+
+1987-12-16 Richard Stallman <rms@gnu.org>
+
+ * REFERENCES: entered into RCS
+
+
+ -----
+
+ Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without
+ modification, are permitted provided the copyright notice and this
+ notice are preserved.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/INSTALL b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/INSTALL
new file mode 100644
index 00000000..8b82ade0
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/INSTALL
@@ -0,0 +1,291 @@
+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.
+
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/NEWS b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/NEWS
new file mode 100644
index 00000000..7d1a444d
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/NEWS
@@ -0,0 +1,1067 @@
+Bison News
+----------
+
+* Changes in version 2.4.1 (2008-12-11):
+
+** In the GLR defines file, unexpanded M4 macros in the yylval and yylloc
+ declarations have been fixed.
+
+** Temporary hack for adding a semicolon to the user action.
+
+ Bison used to prepend a trailing semicolon at the end of the user
+ action for reductions. This allowed actions such as
+
+ exp: exp "+" exp { $$ = $1 + $3 };
+
+ instead of
+
+ exp: exp "+" exp { $$ = $1 + $3; };
+
+ Some grammars still depend on this `feature'. Bison 2.4.1 restores
+ the previous behavior in the case of C output (specifically, when
+ neither %language or %skeleton or equivalent command-line options
+ are used) to leave more time for grammars depending on the old
+ behavior to be adjusted. Future releases of Bison will disable this
+ feature.
+
+** A few minor improvements to the Bison manual.
+
+* Changes in version 2.4 (2008-11-02):
+
+** %language is an experimental feature.
+
+ We first introduced this feature in test release 2.3b as a cleaner
+ alternative to %skeleton. Since then, we have discussed the possibility of
+ modifying its effect on Bison's output file names. Thus, in this release,
+ we consider %language to be an experimental feature that will likely evolve
+ in future releases.
+
+** Forward compatibility with GNU M4 has been improved.
+
+** Several bugs in the C++ skeleton and the experimental Java skeleton have been
+ fixed.
+
+* Changes in version 2.3b (2008-05-27):
+
+** The quotes around NAME that used to be required in the following directive
+ are now deprecated:
+
+ %define NAME "VALUE"
+
+** The directive `%pure-parser' is now deprecated in favor of:
+
+ %define api.pure
+
+ which has the same effect except that Bison is more careful to warn about
+ unreasonable usage in the latter case.
+
+** Push Parsing
+
+ Bison can now generate an LALR(1) parser in C with a push interface. That
+ is, instead of invoking `yyparse', which pulls tokens from `yylex', you can
+ push one token at a time to the parser using `yypush_parse', which will
+ return to the caller after processing each token. By default, the push
+ interface is disabled. Either of the following directives will enable it:
+
+ %define api.push_pull "push" // Just push; does not require yylex.
+ %define api.push_pull "both" // Push and pull; requires yylex.
+
+ See the new section `A Push Parser' in the Bison manual for details.
+
+ The current push parsing interface is experimental and may evolve. More user
+ feedback will help to stabilize it.
+
+** The -g and --graph options now output graphs in Graphviz DOT format,
+ not VCG format. Like --graph, -g now also takes an optional FILE argument
+ and thus cannot be bundled with other short options.
+
+** Java
+
+ Bison can now generate an LALR(1) parser in Java. The skeleton is
+ `data/lalr1.java'. Consider using the new %language directive instead of
+ %skeleton to select it.
+
+ See the new section `Java Parsers' in the Bison manual for details.
+
+ The current Java interface is experimental and may evolve. More user
+ feedback will help to stabilize it.
+
+** %language
+
+ This new directive specifies the programming language of the generated
+ parser, which can be C (the default), C++, or Java. Besides the skeleton
+ that Bison uses, the directive affects the names of the generated files if
+ the grammar file's name ends in ".y".
+
+** XML Automaton Report
+
+ Bison can now generate an XML report of the LALR(1) automaton using the new
+ `--xml' option. The current XML schema is experimental and may evolve. More
+ user feedback will help to stabilize it.
+
+** The grammar file may now specify the name of the parser header file using
+ %defines. For example:
+
+ %defines "parser.h"
+
+** When reporting useless rules, useless nonterminals, and unused terminals,
+ Bison now employs the terms "useless in grammar" instead of "useless",
+ "useless in parser" instead of "never reduced", and "unused in grammar"
+ instead of "unused".
+
+** Unreachable State Removal
+
+ Previously, Bison sometimes generated parser tables containing unreachable
+ states. A state can become unreachable during conflict resolution if Bison
+ disables a shift action leading to it from a predecessor state. Bison now:
+
+ 1. Removes unreachable states.
+
+ 2. Does not report any conflicts that appeared in unreachable states.
+ WARNING: As a result, you may need to update %expect and %expect-rr
+ directives in existing grammar files.
+
+ 3. For any rule used only in such states, Bison now reports the rule as
+ "useless in parser due to conflicts".
+
+ This feature can be disabled with the following directive:
+
+ %define lr.keep_unreachable_states
+
+ See the %define entry in the `Bison Declaration Summary' in the Bison manual
+ for further discussion.
+
+** Lookahead Set Correction in the `.output' Report
+
+ When instructed to generate a `.output' file including lookahead sets
+ (using `--report=lookahead', for example), Bison now prints each reduction's
+ lookahead set only next to the associated state's one item that (1) is
+ associated with the same rule as the reduction and (2) has its dot at the end
+ of its RHS. Previously, Bison also erroneously printed the lookahead set
+ next to all of the state's other items associated with the same rule. This
+ bug affected only the `.output' file and not the generated parser source
+ code.
+
+** --report-file=FILE is a new option to override the default `.output' file
+ name.
+
+** The `=' that used to be required in the following directives is now
+ deprecated:
+
+ %file-prefix "parser"
+ %name-prefix "c_"
+ %output "parser.c"
+
+** An Alternative to `%{...%}' -- `%code QUALIFIER {CODE}'
+
+ Bison 2.3a provided a new set of directives as a more flexible alternative to
+ the traditional Yacc prologue blocks. Those have now been consolidated into
+ a single %code directive with an optional qualifier field, which identifies
+ the purpose of the code and thus the location(s) where Bison should generate
+ it:
+
+ 1. `%code {CODE}' replaces `%after-header {CODE}'
+ 2. `%code requires {CODE}' replaces `%start-header {CODE}'
+ 3. `%code provides {CODE}' replaces `%end-header {CODE}'
+ 4. `%code top {CODE}' replaces `%before-header {CODE}'
+
+ See the %code entries in section `Bison Declaration Summary' in the Bison
+ manual for a summary of the new functionality. See the new section `Prologue
+ Alternatives' for a detailed discussion including the advantages of %code
+ over the traditional Yacc prologues.
+
+ The prologue alternatives are experimental. More user feedback will help to
+ determine whether they should become permanent features.
+
+** Revised warning: unset or unused mid-rule values
+
+ Since Bison 2.2, Bison has warned about mid-rule values that are set but not
+ used within any of the actions of the parent rule. For example, Bison warns
+ about unused $2 in:
+
+ exp: '1' { $$ = 1; } '+' exp { $$ = $1 + $4; };
+
+ Now, Bison also warns about mid-rule values that are used but not set. For
+ example, Bison warns about unset $$ in the mid-rule action in:
+
+ exp: '1' { $1 = 1; } '+' exp { $$ = $2 + $4; };
+
+ However, Bison now disables both of these warnings by default since they
+ sometimes prove to be false alarms in existing grammars employing the Yacc
+ constructs $0 or $-N (where N is some positive integer).
+
+ To enable these warnings, specify the option `--warnings=midrule-values' or
+ `-W', which is a synonym for `--warnings=all'.
+
+** Default %destructor or %printer with `<*>' or `<>'
+
+ Bison now recognizes two separate kinds of default %destructor's and
+ %printer's:
+
+ 1. Place `<*>' in a %destructor/%printer symbol list to define a default
+ %destructor/%printer for all grammar symbols for which you have formally
+ declared semantic type tags.
+
+ 2. Place `<>' in a %destructor/%printer symbol list to define a default
+ %destructor/%printer for all grammar symbols without declared semantic
+ type tags.
+
+ Bison no longer supports the `%symbol-default' notation from Bison 2.3a.
+ `<*>' and `<>' combined achieve the same effect with one exception: Bison no
+ longer applies any %destructor to a mid-rule value if that mid-rule value is
+ not actually ever referenced using either $$ or $n in a semantic action.
+
+ The default %destructor's and %printer's are experimental. More user
+ feedback will help to determine whether they should become permanent
+ features.
+
+ See the section `Freeing Discarded Symbols' in the Bison manual for further
+ details.
+
+** %left, %right, and %nonassoc can now declare token numbers. This is required
+ by POSIX. However, see the end of section `Operator Precedence' in the Bison
+ manual for a caveat concerning the treatment of literal strings.
+
+** The nonfunctional --no-parser, -n, and %no-parser options have been
+ completely removed from Bison.
+
+* Changes in version 2.3a, 2006-09-13:
+
+** Instead of %union, you can define and use your own union type
+ YYSTYPE if your grammar contains at least one <type> tag.
+ Your YYSTYPE need not be a macro; it can be a typedef.
+ This change is for compatibility with other Yacc implementations,
+ and is required by POSIX.
+
+** Locations columns and lines start at 1.
+ In accordance with the GNU Coding Standards and Emacs.
+
+** You may now declare per-type and default %destructor's and %printer's:
+
+ For example:
+
+ %union { char *string; }
+ %token <string> STRING1
+ %token <string> STRING2
+ %type <string> string1
+ %type <string> string2
+ %union { char character; }
+ %token <character> CHR
+ %type <character> chr
+ %destructor { free ($$); } %symbol-default
+ %destructor { free ($$); printf ("%d", @$.first_line); } STRING1 string1
+ %destructor { } <character>
+
+ guarantees that, when the parser discards any user-defined symbol that has a
+ semantic type tag other than `<character>', it passes its semantic value to
+ `free'. However, when the parser discards a `STRING1' or a `string1', it
+ also prints its line number to `stdout'. It performs only the second
+ `%destructor' in this case, so it invokes `free' only once.
+
+ [Although we failed to mention this here in the 2.3a release, the default
+ %destructor's and %printer's were experimental, and they were rewritten in
+ future versions.]
+
+** Except for LALR(1) parsers in C with POSIX Yacc emulation enabled (with `-y',
+ `--yacc', or `%yacc'), Bison no longer generates #define statements for
+ associating token numbers with token names. Removing the #define statements
+ helps to sanitize the global namespace during preprocessing, but POSIX Yacc
+ requires them. Bison still generates an enum for token names in all cases.
+
+** Handling of traditional Yacc prologue blocks is now more consistent but
+ potentially incompatible with previous releases of Bison.
+
+ As before, you declare prologue blocks in your grammar file with the
+ `%{ ... %}' syntax. To generate the pre-prologue, Bison concatenates all
+ prologue blocks that you've declared before the first %union. To generate
+ the post-prologue, Bison concatenates all prologue blocks that you've
+ declared after the first %union.
+
+ Previous releases of Bison inserted the pre-prologue into both the header
+ file and the code file in all cases except for LALR(1) parsers in C. In the
+ latter case, Bison inserted it only into the code file. For parsers in C++,
+ the point of insertion was before any token definitions (which associate
+ token numbers with names). For parsers in C, the point of insertion was
+ after the token definitions.
+
+ Now, Bison never inserts the pre-prologue into the header file. In the code
+ file, it always inserts it before the token definitions.
+
+** Bison now provides a more flexible alternative to the traditional Yacc
+ prologue blocks: %before-header, %start-header, %end-header, and
+ %after-header.
+
+ For example, the following declaration order in the grammar file reflects the
+ order in which Bison will output these code blocks. However, you are free to
+ declare these code blocks in your grammar file in whatever order is most
+ convenient for you:
+
+ %before-header {
+ /* Bison treats this block like a pre-prologue block: it inserts it into
+ * the code file before the contents of the header file. It does *not*
+ * insert it into the header file. This is a good place to put
+ * #include's that you want at the top of your code file. A common
+ * example is `#include "system.h"'. */
+ }
+ %start-header {
+ /* Bison inserts this block into both the header file and the code file.
+ * In both files, the point of insertion is before any Bison-generated
+ * token, semantic type, location type, and class definitions. This is a
+ * good place to define %union dependencies, for example. */
+ }
+ %union {
+ /* Unlike the traditional Yacc prologue blocks, the output order for the
+ * new %*-header blocks is not affected by their declaration position
+ * relative to any %union in the grammar file. */
+ }
+ %end-header {
+ /* Bison inserts this block into both the header file and the code file.
+ * In both files, the point of insertion is after the Bison-generated
+ * definitions. This is a good place to declare or define public
+ * functions or data structures that depend on the Bison-generated
+ * definitions. */
+ }
+ %after-header {
+ /* Bison treats this block like a post-prologue block: it inserts it into
+ * the code file after the contents of the header file. It does *not*
+ * insert it into the header file. This is a good place to declare or
+ * define internal functions or data structures that depend on the
+ * Bison-generated definitions. */
+ }
+
+ If you have multiple occurrences of any one of the above declarations, Bison
+ will concatenate the contents in declaration order.
+
+ [Although we failed to mention this here in the 2.3a release, the prologue
+ alternatives were experimental, and they were rewritten in future versions.]
+
+** The option `--report=look-ahead' has been changed to `--report=lookahead'.
+ The old spelling still works, but is not documented and may be removed
+ in a future release.
+
+* Changes in version 2.3, 2006-06-05:
+
+** GLR grammars should now use `YYRECOVERING ()' instead of `YYRECOVERING',
+ for compatibility with LALR(1) grammars.
+
+** It is now documented that any definition of YYSTYPE or YYLTYPE should
+ be to a type name that does not contain parentheses or brackets.
+
+* Changes in version 2.2, 2006-05-19:
+
+** The distribution terms for all Bison-generated parsers now permit
+ using the parsers in nonfree programs. Previously, this permission
+ was granted only for Bison-generated LALR(1) parsers in C.
+
+** %name-prefix changes the namespace name in C++ outputs.
+
+** The C++ parsers export their token_type.
+
+** Bison now allows multiple %union declarations, and concatenates
+ their contents together.
+
+** New warning: unused values
+ Right-hand side symbols whose values are not used are reported,
+ if the symbols have destructors. For instance:
+
+ exp: exp "?" exp ":" exp { $1 ? $1 : $3; }
+ | exp "+" exp
+ ;
+
+ will trigger a warning about $$ and $5 in the first rule, and $3 in
+ the second ($1 is copied to $$ by the default rule). This example
+ most likely contains three errors, and could be rewritten as:
+
+ exp: exp "?" exp ":" exp
+ { $$ = $1 ? $3 : $5; free ($1 ? $5 : $3); free ($1); }
+ | exp "+" exp
+ { $$ = $1 ? $1 : $3; if ($1) free ($3); }
+ ;
+
+ However, if the original actions were really intended, memory leaks
+ and all, the warnings can be suppressed by letting Bison believe the
+ values are used, e.g.:
+
+ exp: exp "?" exp ":" exp { $1 ? $1 : $3; (void) ($$, $5); }
+ | exp "+" exp { $$ = $1; (void) $3; }
+ ;
+
+ If there are mid-rule actions, the warning is issued if no action
+ uses it. The following triggers no warning: $1 and $3 are used.
+
+ exp: exp { push ($1); } '+' exp { push ($3); sum (); };
+
+ The warning is intended to help catching lost values and memory leaks.
+ If a value is ignored, its associated memory typically is not reclaimed.
+
+** %destructor vs. YYABORT, YYACCEPT, and YYERROR.
+ Destructors are now called when user code invokes YYABORT, YYACCEPT,
+ and YYERROR, for all objects on the stack, other than objects
+ corresponding to the right-hand side of the current rule.
+
+** %expect, %expect-rr
+ Incorrect numbers of expected conflicts are now actual errors,
+ instead of warnings.
+
+** GLR, YACC parsers.
+ The %parse-params are available in the destructors (and the
+ experimental printers) as per the documentation.
+
+** Bison now warns if it finds a stray `$' or `@' in an action.
+
+** %require "VERSION"
+ This specifies that the grammar file depends on features implemented
+ in Bison version VERSION or higher.
+
+** lalr1.cc: The token and value types are now class members.
+ The tokens were defined as free form enums and cpp macros. YYSTYPE
+ was defined as a free form union. They are now class members:
+ tokens are enumerations of the `yy::parser::token' struct, and the
+ semantic values have the `yy::parser::semantic_type' type.
+
+ If you do not want or can update to this scheme, the directive
+ `%define "global_tokens_and_yystype" "1"' triggers the global
+ definition of tokens and YYSTYPE. This change is suitable both
+ for previous releases of Bison, and this one.
+
+ If you wish to update, then make sure older version of Bison will
+ fail using `%require "2.2"'.
+
+** DJGPP support added.
+
+* Changes in version 2.1, 2005-09-16:
+
+** The C++ lalr1.cc skeleton supports %lex-param.
+
+** Bison-generated parsers now support the translation of diagnostics like
+ "syntax error" into languages other than English. The default
+ language is still English. For details, please see the new
+ Internationalization section of the Bison manual. Software
+ distributors should also see the new PACKAGING file. Thanks to
+ Bruno Haible for this new feature.
+
+** Wording in the Bison-generated parsers has been changed slightly to
+ simplify translation. In particular, the message "memory exhausted"
+ has replaced "parser stack overflow", as the old message was not
+ always accurate for modern Bison-generated parsers.
+
+** Destructors are now called when the parser aborts, for all symbols left
+ behind on the stack. Also, the start symbol is now destroyed after a
+ successful parse. In both cases, the behavior was formerly inconsistent.
+
+** When generating verbose diagnostics, Bison-generated parsers no longer
+ quote the literal strings associated with tokens. For example, for
+ a syntax error associated with '%token NUM "number"' they might
+ print 'syntax error, unexpected number' instead of 'syntax error,
+ unexpected "number"'.
+
+* Changes in version 2.0, 2004-12-25:
+
+** Possibly-incompatible changes
+
+ - Bison-generated parsers no longer default to using the alloca function
+ (when available) to extend the parser stack, due to widespread
+ problems in unchecked stack-overflow detection. You can "#define
+ YYSTACK_USE_ALLOCA 1" to require the use of alloca, but please read
+ the manual to determine safe values for YYMAXDEPTH in that case.
+
+ - Error token location.
+ During error recovery, the location of the syntax error is updated
+ to cover the whole sequence covered by the error token: it includes
+ the shifted symbols thrown away during the first part of the error
+ recovery, and the lookahead rejected during the second part.
+
+ - Semicolon changes:
+ . Stray semicolons are no longer allowed at the start of a grammar.
+ . Semicolons are now required after in-grammar declarations.
+
+ - Unescaped newlines are no longer allowed in character constants or
+ string literals. They were never portable, and GCC 3.4.0 has
+ dropped support for them. Better diagnostics are now generated if
+ forget a closing quote.
+
+ - NUL bytes are no longer allowed in Bison string literals, unfortunately.
+
+** New features
+
+ - GLR grammars now support locations.
+
+ - New directive: %initial-action.
+ This directive allows the user to run arbitrary code (including
+ initializing @$) from yyparse before parsing starts.
+
+ - A new directive "%expect-rr N" specifies the expected number of
+ reduce/reduce conflicts in GLR parsers.
+
+ - %token numbers can now be hexadecimal integers, e.g., `%token FOO 0x12d'.
+ This is a GNU extension.
+
+ - The option `--report=lookahead' was changed to `--report=look-ahead'.
+ [However, this was changed back after 2.3.]
+
+ - Experimental %destructor support has been added to lalr1.cc.
+
+ - New configure option --disable-yacc, to disable installation of the
+ yacc command and -ly library introduced in 1.875 for POSIX conformance.
+
+** Bug fixes
+
+ - For now, %expect-count violations are now just warnings, not errors.
+ This is for compatibility with Bison 1.75 and earlier (when there are
+ reduce/reduce conflicts) and with Bison 1.30 and earlier (when there
+ are too many or too few shift/reduce conflicts). However, in future
+ versions of Bison we plan to improve the %expect machinery so that
+ these violations will become errors again.
+
+ - Within Bison itself, numbers (e.g., goto numbers) are no longer
+ arbitrarily limited to 16-bit counts.
+
+ - Semicolons are now allowed before "|" in grammar rules, as POSIX requires.
+
+* Changes in version 1.875, 2003-01-01:
+
+** The documentation license has been upgraded to version 1.2
+ of the GNU Free Documentation License.
+
+** syntax error processing
+
+ - In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error
+ locations too. This fixes bugs in error-location computation.
+
+ - %destructor
+ It is now possible to reclaim the memory associated to symbols
+ discarded during error recovery. This feature is still experimental.
+
+ - %error-verbose
+ This new directive is preferred over YYERROR_VERBOSE.
+
+ - #defining yyerror to steal internal variables is discouraged.
+ It is not guaranteed to work forever.
+
+** POSIX conformance
+
+ - Semicolons are once again optional at the end of grammar rules.
+ This reverts to the behavior of Bison 1.33 and earlier, and improves
+ compatibility with Yacc.
+
+ - `parse error' -> `syntax error'
+ Bison now uniformly uses the term `syntax error'; formerly, the code
+ and manual sometimes used the term `parse error' instead. POSIX
+ requires `syntax error' in diagnostics, and it was thought better to
+ be consistent.
+
+ - The documentation now emphasizes that yylex and yyerror must be
+ declared before use. C99 requires this.
+
+ - Bison now parses C99 lexical constructs like UCNs and
+ backslash-newline within C escape sequences, as POSIX 1003.1-2001 requires.
+
+ - File names are properly escaped in C output. E.g., foo\bar.y is
+ output as "foo\\bar.y".
+
+ - Yacc command and library now available
+ The Bison distribution now installs a `yacc' command, as POSIX requires.
+ Also, Bison now installs a small library liby.a containing
+ implementations of Yacc-compatible yyerror and main functions.
+ This library is normally not useful, but POSIX requires it.
+
+ - Type clashes now generate warnings, not errors.
+
+ - If the user does not define YYSTYPE as a macro, Bison now declares it
+ using typedef instead of defining it as a macro.
+ For consistency, YYLTYPE is also declared instead of defined.
+
+** Other compatibility issues
+
+ - %union directives can now have a tag before the `{', e.g., the
+ directive `%union foo {...}' now generates the C code
+ `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
+ The default union tag is `YYSTYPE', for compatibility with Solaris 9 Yacc.
+ For consistency, YYLTYPE's struct tag is now `YYLTYPE' not `yyltype'.
+ This is for compatibility with both Yacc and Bison 1.35.
+
+ - `;' is output before the terminating `}' of an action, for
+ compatibility with Bison 1.35.
+
+ - Bison now uses a Yacc-style format for conflict reports, e.g.,
+ `conflicts: 2 shift/reduce, 1 reduce/reduce'.
+
+ - `yystype' and `yyltype' are now obsolescent macros instead of being
+ typedefs or tags; they are no longer documented and are planned to be
+ withdrawn in a future release.
+
+** GLR parser notes
+
+ - GLR and inline
+ Users of Bison have to decide how they handle the portability of the
+ C keyword `inline'.
+
+ - `parsing stack overflow...' -> `parser stack overflow'
+ GLR parsers now report `parser stack overflow' as per the Bison manual.
+
+** Bison now warns if it detects conflicting outputs to the same file,
+ e.g., it generates a warning for `bison -d -o foo.h foo.y' since
+ that command outputs both code and header to foo.h.
+
+** #line in output files
+ - --no-line works properly.
+
+** Bison can no longer be built by a K&R C compiler; it requires C89 or
+ later to be built. This change originally took place a few versions
+ ago, but nobody noticed until we recently asked someone to try
+ building Bison with a K&R C compiler.
+
+* Changes in version 1.75, 2002-10-14:
+
+** Bison should now work on 64-bit hosts.
+
+** Indonesian translation thanks to Tedi Heriyanto.
+
+** GLR parsers
+ Fix spurious parse errors.
+
+** Pure parsers
+ Some people redefine yyerror to steal yyparse' private variables.
+ Reenable this trick until an official feature replaces it.
+
+** Type Clashes
+ In agreement with POSIX and with other Yaccs, leaving a default
+ action is valid when $$ is untyped, and $1 typed:
+
+ untyped: ... typed;
+
+ but the converse remains an error:
+
+ typed: ... untyped;
+
+** Values of mid-rule actions
+ The following code:
+
+ foo: { ... } { $$ = $1; } ...
+
+ was incorrectly rejected: $1 is defined in the second mid-rule
+ action, and is equal to the $$ of the first mid-rule action.
+
+* Changes in version 1.50, 2002-10-04:
+
+** GLR parsing
+ The declaration
+ %glr-parser
+ causes Bison to produce a Generalized LR (GLR) parser, capable of handling
+ almost any context-free grammar, ambiguous or not. The new declarations
+ %dprec and %merge on grammar rules allow parse-time resolution of
+ ambiguities. Contributed by Paul Hilfinger.
+
+ Unfortunately Bison 1.50 does not work properly on 64-bit hosts
+ like the Alpha, so please stick to 32-bit hosts for now.
+
+** Output Directory
+ When not in Yacc compatibility mode, when the output file was not
+ specified, running `bison foo/bar.y' created `foo/bar.c'. It
+ now creates `bar.c'.
+
+** Undefined token
+ The undefined token was systematically mapped to 2 which prevented
+ the use of 2 by the user. This is no longer the case.
+
+** Unknown token numbers
+ If yylex returned an out of range value, yyparse could die. This is
+ no longer the case.
+
+** Error token
+ According to POSIX, the error token must be 256.
+ Bison extends this requirement by making it a preference: *if* the
+ user specified that one of her tokens is numbered 256, then error
+ will be mapped onto another number.
+
+** Verbose error messages
+ They no longer report `..., expecting error or...' for states where
+ error recovery is possible.
+
+** End token
+ Defaults to `$end' instead of `$'.
+
+** Error recovery now conforms to documentation and to POSIX
+ When a Bison-generated parser encounters a syntax error, it now pops
+ the stack until it finds a state that allows shifting the error
+ token. Formerly, it popped the stack until it found a state that
+ allowed some non-error action other than a default reduction on the
+ error token. The new behavior has long been the documented behavior,
+ and has long been required by POSIX. For more details, please see
+ Paul Eggert, "Reductions during Bison error handling" (2002-05-20)
+ <http://lists.gnu.org/archive/html/bug-bison/2002-05/msg00038.html>.
+
+** Traces
+ Popped tokens and nonterminals are now reported.
+
+** Larger grammars
+ Larger grammars are now supported (larger token numbers, larger grammar
+ size (= sum of the LHS and RHS lengths), larger LALR tables).
+ Formerly, many of these numbers ran afoul of 16-bit limits;
+ now these limits are 32 bits on most hosts.
+
+** Explicit initial rule
+ Bison used to play hacks with the initial rule, which the user does
+ not write. It is now explicit, and visible in the reports and
+ graphs as rule 0.
+
+** Useless rules
+ Before, Bison reported the useless rules, but, although not used,
+ included them in the parsers. They are now actually removed.
+
+** Useless rules, useless nonterminals
+ They are now reported, as a warning, with their locations.
+
+** Rules never reduced
+ Rules that can never be reduced because of conflicts are now
+ reported.
+
+** Incorrect `Token not used'
+ On a grammar such as
+
+ %token useless useful
+ %%
+ exp: '0' %prec useful;
+
+ where a token was used to set the precedence of the last rule,
+ bison reported both `useful' and `useless' as useless tokens.
+
+** Revert the C++ namespace changes introduced in 1.31
+ as they caused too many portability hassles.
+
+** Default locations
+ By an accident of design, the default computation of @$ was
+ performed after another default computation was performed: @$ = @1.
+ The latter is now removed: YYLLOC_DEFAULT is fully responsible of
+ the computation of @$.
+
+** Token end-of-file
+ The token end of file may be specified by the user, in which case,
+ the user symbol is used in the reports, the graphs, and the verbose
+ error messages instead of `$end', which remains being the default.
+ For instance
+ %token MYEOF 0
+ or
+ %token MYEOF 0 "end of file"
+
+** Semantic parser
+ This old option, which has been broken for ages, is removed.
+
+** New translations
+ Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
+ Croatian, thanks to Denis Lackovic.
+
+** Incorrect token definitions
+ When given `%token 'a' "A"', Bison used to output `#define 'a' 65'.
+
+** Token definitions as enums
+ Tokens are output both as the traditional #define's, and, provided
+ the compiler supports ANSI C or is a C++ compiler, as enums.
+ This lets debuggers display names instead of integers.
+
+** Reports
+ In addition to --verbose, bison supports --report=THINGS, which
+ produces additional information:
+ - itemset
+ complete the core item sets with their closure
+ - lookahead [changed to `look-ahead' in 1.875e through 2.3, but changed back]
+ explicitly associate lookahead tokens to items
+ - solved
+ describe shift/reduce conflicts solving.
+ Bison used to systematically output this information on top of
+ the report. Solved conflicts are now attached to their states.
+
+** Type clashes
+ Previous versions don't complain when there is a type clash on
+ the default action if the rule has a mid-rule action, such as in:
+
+ %type <foo> bar
+ %%
+ bar: '0' {} '0';
+
+ This is fixed.
+
+** GNU M4 is now required when using Bison.
+
+* Changes in version 1.35, 2002-03-25:
+
+** C Skeleton
+ Some projects use Bison's C parser with C++ compilers, and define
+ YYSTYPE as a class. The recent adjustment of C parsers for data
+ alignment and 64 bit architectures made this impossible.
+
+ Because for the time being no real solution for C++ parser
+ generation exists, kludges were implemented in the parser to
+ maintain this use. In the future, when Bison has C++ parsers, this
+ kludge will be disabled.
+
+ This kludge also addresses some C++ problems when the stack was
+ extended.
+
+* Changes in version 1.34, 2002-03-12:
+
+** File name clashes are detected
+ $ bison foo.y -d -o foo.x
+ fatal error: header and parser would both be named `foo.x'
+
+** A missing `;' at the end of a rule triggers a warning
+ In accordance with POSIX, and in agreement with other
+ Yacc implementations, Bison will mandate this semicolon in the near
+ future. This eases the implementation of a Bison parser of Bison
+ grammars by making this grammar LALR(1) instead of LR(2). To
+ facilitate the transition, this release introduces a warning.
+
+** Revert the C++ namespace changes introduced in 1.31, as they caused too
+ many portability hassles.
+
+** DJGPP support added.
+
+** Fix test suite portability problems.
+
+* Changes in version 1.33, 2002-02-07:
+
+** Fix C++ issues
+ Groff could not be compiled for the definition of size_t was lacking
+ under some conditions.
+
+** Catch invalid @n
+ As is done with $n.
+
+* Changes in version 1.32, 2002-01-23:
+
+** Fix Yacc output file names
+
+** Portability fixes
+
+** Italian, Dutch translations
+
+* Changes in version 1.31, 2002-01-14:
+
+** Many Bug Fixes
+
+** GNU Gettext and %expect
+ GNU Gettext asserts 10 s/r conflicts, but there are 7. Now that
+ Bison dies on incorrect %expectations, we fear there will be
+ too many bug reports for Gettext, so _for the time being_, %expect
+ does not trigger an error when the input file is named `plural.y'.
+
+** Use of alloca in parsers
+ If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
+ malloc exclusively. Since 1.29, but was not NEWS'ed.
+
+ alloca is used only when compiled with GCC, to avoid portability
+ problems as on AIX.
+
+** yyparse now returns 2 if memory is exhausted; formerly it dumped core.
+
+** When the generated parser lacks debugging code, YYDEBUG is now 0
+ (as POSIX requires) instead of being undefined.
+
+** User Actions
+ Bison has always permitted actions such as { $$ = $1 }: it adds the
+ ending semicolon. Now if in Yacc compatibility mode, the semicolon
+ is no longer output: one has to write { $$ = $1; }.
+
+** Better C++ compliance
+ The output parsers try to respect C++ namespaces.
+ [This turned out to be a failed experiment, and it was reverted later.]
+
+** Reduced Grammars
+ Fixed bugs when reporting useless nonterminals.
+
+** 64 bit hosts
+ The parsers work properly on 64 bit hosts.
+
+** Error messages
+ Some calls to strerror resulted in scrambled or missing error messages.
+
+** %expect
+ When the number of shift/reduce conflicts is correct, don't issue
+ any warning.
+
+** The verbose report includes the rule line numbers.
+
+** Rule line numbers are fixed in traces.
+
+** Swedish translation
+
+** Parse errors
+ Verbose parse error messages from the parsers are better looking.
+ Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
+ Now: parse error: unexpected '/', expecting "number" or '-' or '('
+
+** Fixed parser memory leaks.
+ When the generated parser was using malloc to extend its stacks, the
+ previous allocations were not freed.
+
+** Fixed verbose output file.
+ Some newlines were missing.
+ Some conflicts in state descriptions were missing.
+
+** Fixed conflict report.
+ Option -v was needed to get the result.
+
+** %expect
+ Was not used.
+ Mismatches are errors, not warnings.
+
+** Fixed incorrect processing of some invalid input.
+
+** Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
+
+** Fixed some typos in the documentation.
+
+** %token MY_EOF 0 is supported.
+ Before, MY_EOF was silently renumbered as 257.
+
+** doc/refcard.tex is updated.
+
+** %output, %file-prefix, %name-prefix.
+ New.
+
+** --output
+ New, aliasing `--output-file'.
+
+* Changes in version 1.30, 2001-10-26:
+
+** `--defines' and `--graph' have now an optional argument which is the
+ output file name. `-d' and `-g' do not change; they do not take any
+ argument.
+
+** `%source_extension' and `%header_extension' are removed, failed
+ experiment.
+
+** Portability fixes.
+
+* Changes in version 1.29, 2001-09-07:
+
+** The output file does not define const, as this caused problems when used
+ with common autoconfiguration schemes. If you still use ancient compilers
+ that lack const, compile with the equivalent of the C compiler option
+ `-Dconst='. autoconf's AC_C_CONST macro provides one way to do this.
+
+** Added `-g' and `--graph'.
+
+** The Bison manual is now distributed under the terms of the GNU FDL.
+
+** The input and the output files has automatically a similar extension.
+
+** Russian translation added.
+
+** NLS support updated; should hopefully be less troublesome.
+
+** Added the old Bison reference card.
+
+** Added `--locations' and `%locations'.
+
+** Added `-S' and `--skeleton'.
+
+** `%raw', `-r', `--raw' is disabled.
+
+** Special characters are escaped when output. This solves the problems
+ of the #line lines with path names including backslashes.
+
+** New directives.
+ `%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
+ `%debug', `%source_extension' and `%header_extension'.
+
+** @$
+ Automatic location tracking.
+
+* Changes in version 1.28, 1999-07-06:
+
+** Should compile better now with K&R compilers.
+
+** Added NLS.
+
+** Fixed a problem with escaping the double quote character.
+
+** There is now a FAQ.
+
+* Changes in version 1.27:
+
+** The make rule which prevented bison.simple from being created on
+ some systems has been fixed.
+
+* Changes in version 1.26:
+
+** Bison now uses automake.
+
+** New mailing lists: <bug-bison@gnu.org> and <help-bison@gnu.org>.
+
+** Token numbers now start at 257 as previously documented, not 258.
+
+** Bison honors the TMPDIR environment variable.
+
+** A couple of buffer overruns have been fixed.
+
+** Problems when closing files should now be reported.
+
+** Generated parsers should now work even on operating systems which do
+ not provide alloca().
+
+* Changes in version 1.25, 1995-10-16:
+
+** Errors in the input grammar are not fatal; Bison keeps reading
+the grammar file, and reports all the errors found in it.
+
+** Tokens can now be specified as multiple-character strings: for
+example, you could use "<=" for a token which looks like <=, instead
+of chosing a name like LESSEQ.
+
+** The %token_table declaration says to write a table of tokens (names
+and numbers) into the parser file. The yylex function can use this
+table to recognize multiple-character string tokens, or for other
+purposes.
+
+** The %no_lines declaration says not to generate any #line preprocessor
+directives in the parser file.
+
+** The %raw declaration says to use internal Bison token numbers, not
+Yacc-compatible token numbers, when token names are defined as macros.
+
+** The --no-parser option produces the parser tables without including
+the parser engine; a project can now use its own parser engine.
+The actions go into a separate file called NAME.act, in the form of
+a switch statement body.
+
+* Changes in version 1.23:
+
+The user can define YYPARSE_PARAM as the name of an argument to be
+passed into yyparse. The argument should have type void *. It should
+actually point to an object. Grammar actions can access the variable
+by casting it to the proper pointer type.
+
+Line numbers in output file corrected.
+
+* Changes in version 1.22:
+
+--help option added.
+
+* Changes in version 1.20:
+
+Output file does not redefine const for C++.
+
+Local Variables:
+mode: outline
+End:
+
+-----
+
+Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+2004, 2005, 2006, 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/>.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/README b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/README
new file mode 100644
index 00000000..498671f0
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/README
@@ -0,0 +1,43 @@
+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/>.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/README-alpha b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/README-alpha
new file mode 100644
index 00000000..550ca327
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/README-alpha
@@ -0,0 +1,30 @@
+-*- 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/>.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/THANKS b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/THANKS
new file mode 100644
index 00000000..40291c71
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/THANKS
@@ -0,0 +1,104 @@
+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:
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/TODO b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/TODO
new file mode 100644
index 00000000..b2bca354
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/TODO
@@ -0,0 +1,309 @@
+-*- 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/>.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/data/README b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/data/README
new file mode 100644
index 00000000..18e025c1
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/data/README
@@ -0,0 +1,70 @@
+-*- 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/>.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/djgpp/README.in b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/djgpp/README.in
new file mode 100644
index 00000000..d559a096
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/djgpp/README.in
@@ -0,0 +1,195 @@
+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>
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/doc/bison.info b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/doc/bison.info
new file mode 100644
index 00000000..35f574f3
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/doc/bison.info
@@ -0,0 +1,11009 @@
+This is ../../bison-2.4.1-src/doc/bison.info, produced by makeinfo
+version 4.8 from ../../bison-2.4.1-src/doc/bison.texinfo.
+
+ This manual (19 November 2008) is for GNU Bison (version 2.4.1), the
+GNU parser generator.
+
+ Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
+Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Free Documentation License,
+ Version 1.2 or any later version published by the Free Software
+ Foundation; with no Invariant Sections, with the Front-Cover texts
+ being "A GNU Manual," and with the Back-Cover Texts as in (a)
+ below. A copy of the license is included in the section entitled
+ "GNU Free Documentation License."
+
+ (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
+ modify this GNU manual. Buying copies from the FSF supports it in
+ developing GNU and promoting software freedom."
+
+INFO-DIR-SECTION Software development
+START-INFO-DIR-ENTRY
+* bison: (bison). GNU parser generator (Yacc replacement).
+END-INFO-DIR-ENTRY
+
+
+File: bison.info, Node: Top, Next: Introduction, Up: (dir)
+
+Bison
+*****
+
+This manual (19 November 2008) is for GNU Bison (version 2.4.1), the
+GNU parser generator.
+
+ Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1998, 1999,
+2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
+Foundation, Inc.
+
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Free Documentation License,
+ Version 1.2 or any later version published by the Free Software
+ Foundation; with no Invariant Sections, with the Front-Cover texts
+ being "A GNU Manual," and with the Back-Cover Texts as in (a)
+ below. A copy of the license is included in the section entitled
+ "GNU Free Documentation License."
+
+ (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
+ modify this GNU manual. Buying copies from the FSF supports it in
+ developing GNU and promoting software freedom."
+
+* Menu:
+
+* Introduction::
+* Conditions::
+* Copying:: The GNU General Public License says
+ how you can copy and share Bison.
+
+Tutorial sections:
+* Concepts:: Basic concepts for understanding Bison.
+* Examples:: Three simple explained examples of using Bison.
+
+Reference sections:
+* Grammar File:: Writing Bison declarations and rules.
+* Interface:: C-language interface to the parser function `yyparse'.
+* Algorithm:: How the Bison parser works at run-time.
+* Error Recovery:: Writing rules for error recovery.
+* Context Dependency:: What to do if your language syntax is too
+ messy for Bison to handle straightforwardly.
+* Debugging:: Understanding or debugging Bison parsers.
+* Invocation:: How to run Bison (to produce the parser source file).
+* Other Languages:: Creating C++ and Java parsers.
+* FAQ:: Frequently Asked Questions
+* Table of Symbols:: All the keywords of the Bison language are explained.
+* Glossary:: Basic concepts are explained.
+* Copying This Manual:: License for copying this manual.
+* Index:: Cross-references to the text.
+
+ --- The Detailed Node Listing ---
+
+The Concepts of Bison
+
+* Language and Grammar:: Languages and context-free grammars,
+ as mathematical ideas.
+* Grammar in Bison:: How we represent grammars for Bison's sake.
+* Semantic Values:: Each token or syntactic grouping can have
+ a semantic value (the value of an integer,
+ the name of an identifier, etc.).
+* Semantic Actions:: Each rule can have an action containing C code.
+* GLR Parsers:: Writing parsers for general context-free languages.
+* Locations Overview:: Tracking Locations.
+* Bison Parser:: What are Bison's input and output,
+ how is the output used?
+* Stages:: Stages in writing and running Bison grammars.
+* Grammar Layout:: Overall structure of a Bison grammar file.
+
+Writing GLR Parsers
+
+* Simple GLR Parsers:: Using GLR parsers on unambiguous grammars.
+* Merging GLR Parses:: Using GLR parsers to resolve ambiguities.
+* GLR Semantic Actions:: Deferred semantic actions have special concerns.
+* Compiler Requirements:: GLR parsers require a modern C compiler.
+
+Examples
+
+* RPN Calc:: Reverse polish notation calculator;
+ a first example with no operator precedence.
+* Infix Calc:: Infix (algebraic) notation calculator.
+ Operator precedence is introduced.
+* Simple Error Recovery:: Continuing after syntax errors.
+* Location Tracking Calc:: Demonstrating the use of @N and @$.
+* Multi-function Calc:: Calculator with memory and trig functions.
+ It uses multiple data-types for semantic values.
+* Exercises:: Ideas for improving the multi-function calculator.
+
+Reverse Polish Notation Calculator
+
+* Rpcalc Declarations:: Prologue (declarations) for rpcalc.
+* Rpcalc Rules:: Grammar Rules for rpcalc, with explanation.
+* Rpcalc Lexer:: The lexical analyzer.
+* Rpcalc Main:: The controlling function.
+* Rpcalc Error:: The error reporting function.
+* Rpcalc Generate:: Running Bison on the grammar file.
+* Rpcalc Compile:: Run the C compiler on the output code.
+
+Grammar Rules for `rpcalc'
+
+* Rpcalc Input::
+* Rpcalc Line::
+* Rpcalc Expr::
+
+Location Tracking Calculator: `ltcalc'
+
+* Ltcalc Declarations:: Bison and C declarations for ltcalc.
+* Ltcalc Rules:: Grammar rules for ltcalc, with explanations.
+* Ltcalc Lexer:: The lexical analyzer.
+
+Multi-Function Calculator: `mfcalc'
+
+* Mfcalc Declarations:: Bison declarations for multi-function calculator.
+* Mfcalc Rules:: Grammar rules for the calculator.
+* Mfcalc Symbol Table:: Symbol table management subroutines.
+
+Bison Grammar Files
+
+* Grammar Outline:: Overall layout of the grammar file.
+* Symbols:: Terminal and nonterminal symbols.
+* Rules:: How to write grammar rules.
+* Recursion:: Writing recursive rules.
+* Semantics:: Semantic values and actions.
+* Locations:: Locations and actions.
+* Declarations:: All kinds of Bison declarations are described here.
+* Multiple Parsers:: Putting more than one Bison parser in one program.
+
+Outline of a Bison Grammar
+
+* Prologue:: Syntax and usage of the prologue.
+* Prologue Alternatives:: Syntax and usage of alternatives to the prologue.
+* Bison Declarations:: Syntax and usage of the Bison declarations section.
+* Grammar Rules:: Syntax and usage of the grammar rules section.
+* Epilogue:: Syntax and usage of the epilogue.
+
+Defining Language Semantics
+
+* Value Type:: Specifying one data type for all semantic values.
+* Multiple Types:: Specifying several alternative data types.
+* Actions:: An action is the semantic definition of a grammar rule.
+* Action Types:: Specifying data types for actions to operate on.
+* Mid-Rule Actions:: Most actions go at the end of a rule.
+ This says when, why and how to use the exceptional
+ action in the middle of a rule.
+
+Tracking Locations
+
+* Location Type:: Specifying a data type for locations.
+* Actions and Locations:: Using locations in actions.
+* Location Default Action:: Defining a general way to compute locations.
+
+Bison Declarations
+
+* Require Decl:: Requiring a Bison version.
+* Token Decl:: Declaring terminal symbols.
+* Precedence Decl:: Declaring terminals with precedence and associativity.
+* Union Decl:: Declaring the set of all semantic value types.
+* Type Decl:: Declaring the choice of type for a nonterminal symbol.
+* Initial Action Decl:: Code run before parsing starts.
+* Destructor Decl:: Declaring how symbols are freed.
+* Expect Decl:: Suppressing warnings about parsing conflicts.
+* Start Decl:: Specifying the start symbol.
+* Pure Decl:: Requesting a reentrant parser.
+* Push Decl:: Requesting a push parser.
+* Decl Summary:: Table of all Bison declarations.
+
+Parser C-Language Interface
+
+* Parser Function:: How to call `yyparse' and what it returns.
+* Push Parser Function:: How to call `yypush_parse' and what it returns.
+* Pull Parser Function:: How to call `yypull_parse' and what it returns.
+* Parser Create Function:: How to call `yypstate_new' and what it returns.
+* Parser Delete Function:: How to call `yypstate_delete' and what it returns.
+* Lexical:: You must supply a function `yylex'
+ which reads tokens.
+* Error Reporting:: You must supply a function `yyerror'.
+* Action Features:: Special features for use in actions.
+* Internationalization:: How to let the parser speak in the user's
+ native language.
+
+The Lexical Analyzer Function `yylex'
+
+* Calling Convention:: How `yyparse' calls `yylex'.
+* Token Values:: How `yylex' must return the semantic value
+ of the token it has read.
+* Token Locations:: How `yylex' must return the text location
+ (line number, etc.) of the token, if the
+ actions want that.
+* Pure Calling:: How the calling convention differs in a pure parser
+ (*note A Pure (Reentrant) Parser: Pure Decl.).
+
+The Bison Parser Algorithm
+
+* Lookahead:: Parser looks one token ahead when deciding what to do.
+* Shift/Reduce:: Conflicts: when either shifting or reduction is valid.
+* Precedence:: Operator precedence works by resolving conflicts.
+* Contextual Precedence:: When an operator's precedence depends on context.
+* Parser States:: The parser is a finite-state-machine with stack.
+* Reduce/Reduce:: When two rules are applicable in the same situation.
+* Mystery Conflicts:: Reduce/reduce conflicts that look unjustified.
+* Generalized LR Parsing:: Parsing arbitrary context-free grammars.
+* Memory Management:: What happens when memory is exhausted. How to avoid it.
+
+Operator Precedence
+
+* Why Precedence:: An example showing why precedence is needed.
+* Using Precedence:: How to specify precedence in Bison grammars.
+* Precedence Examples:: How these features are used in the previous example.
+* How Precedence:: How they work.
+
+Handling Context Dependencies
+
+* Semantic Tokens:: Token parsing can depend on the semantic context.
+* Lexical Tie-ins:: Token parsing can depend on the syntactic context.
+* Tie-in Recovery:: Lexical tie-ins have implications for how
+ error recovery rules must be written.
+
+Debugging Your Parser
+
+* Understanding:: Understanding the structure of your parser.
+* Tracing:: Tracing the execution of your parser.
+
+Invoking Bison
+
+* Bison Options:: All the options described in detail,
+ in alphabetical order by short options.
+* Option Cross Key:: Alphabetical list of long options.
+* Yacc Library:: Yacc-compatible `yylex' and `main'.
+
+Parsers Written In Other Languages
+
+* C++ Parsers:: The interface to generate C++ parser classes
+* Java Parsers:: The interface to generate Java parser classes
+
+C++ Parsers
+
+* C++ Bison Interface:: Asking for C++ parser generation
+* C++ Semantic Values:: %union vs. C++
+* C++ Location Values:: The position and location classes
+* C++ Parser Interface:: Instantiating and running the parser
+* C++ Scanner Interface:: Exchanges between yylex and parse
+* A Complete C++ Example:: Demonstrating their use
+
+A Complete C++ Example
+
+* Calc++ --- C++ Calculator:: The specifications
+* Calc++ Parsing Driver:: An active parsing context
+* Calc++ Parser:: A parser class
+* Calc++ Scanner:: A pure C++ Flex scanner
+* Calc++ Top Level:: Conducting the band
+
+Java Parsers
+
+* Java Bison Interface:: Asking for Java parser generation
+* Java Semantic Values:: %type and %token vs. Java
+* Java Location Values:: The position and location classes
+* Java Parser Interface:: Instantiating and running the parser
+* Java Scanner Interface:: Specifying the scanner for the parser
+* Java Action Features:: Special features for use in actions
+* Java Differences:: Differences between C/C++ and Java Grammars
+* Java Declarations Summary:: List of Bison declarations used with Java
+
+Frequently Asked Questions
+
+* Memory Exhausted:: Breaking the Stack Limits
+* How Can I Reset the Parser:: `yyparse' Keeps some State
+* Strings are Destroyed:: `yylval' Loses Track of Strings
+* Implementing Gotos/Loops:: Control Flow in the Calculator
+* Multiple start-symbols:: Factoring closely related grammars
+* Secure? Conform?:: Is Bison POSIX safe?
+* I can't build Bison:: Troubleshooting
+* Where can I find help?:: Troubleshouting
+* Bug Reports:: Troublereporting
+* More Languages:: Parsers in C++, Java, and so on
+* Beta Testing:: Experimenting development versions
+* Mailing Lists:: Meeting other Bison users
+
+Copying This Manual
+
+* Copying This Manual:: License for copying this manual.
+
+
+File: bison.info, Node: Introduction, Next: Conditions, Prev: Top, Up: Top
+
+Introduction
+************
+
+"Bison" is a general-purpose parser generator that converts an
+annotated context-free grammar into an LALR(1) or GLR parser for that
+grammar. Once you are proficient with Bison, you can use it to develop
+a wide range of language parsers, from those used in simple desk
+calculators to complex programming languages.
+
+ Bison is upward compatible with Yacc: all properly-written Yacc
+grammars ought to work with Bison with no change. Anyone familiar with
+Yacc should be able to use Bison with little trouble. You need to be
+fluent in C or C++ programming in order to use Bison or to understand
+this manual.
+
+ We begin with tutorial chapters that explain the basic concepts of
+using Bison and show three explained examples, each building on the
+last. If you don't know Bison or Yacc, start by reading these
+chapters. Reference chapters follow which describe specific aspects of
+Bison in detail.
+
+ Bison was written primarily by Robert Corbett; Richard Stallman made
+it Yacc-compatible. Wilfred Hansen of Carnegie Mellon University added
+multi-character string literals and other features.
+
+ This edition corresponds to version 2.4.1 of Bison.
+
+
+File: bison.info, Node: Conditions, Next: Copying, Prev: Introduction, Up: Top
+
+Conditions for Using Bison
+**************************
+
+The distribution terms for Bison-generated parsers permit using the
+parsers in nonfree programs. Before Bison version 2.2, these extra
+permissions applied only when Bison was generating LALR(1) parsers in
+C. And before Bison version 1.24, Bison-generated parsers could be
+used only in programs that were free software.
+
+ The other GNU programming tools, such as the GNU C compiler, have
+never had such a requirement. They could always be used for nonfree
+software. The reason Bison was different was not due to a special
+policy decision; it resulted from applying the usual General Public
+License to all of the Bison source code.
+
+ The output of the Bison utility--the Bison parser file--contains a
+verbatim copy of a sizable piece of Bison, which is the code for the
+parser's implementation. (The actions from your grammar are inserted
+into this implementation at one point, but most of the rest of the
+implementation is not changed.) When we applied the GPL terms to the
+skeleton code for the parser's implementation, the effect was to
+restrict the use of Bison output to free software.
+
+ We didn't change the terms because of sympathy for people who want to
+make software proprietary. *Software should be free.* But we
+concluded that limiting Bison's use to free software was doing little to
+encourage people to make other software free. So we decided to make the
+practical conditions for using Bison match the practical conditions for
+using the other GNU tools.
+
+ This exception applies when Bison is generating code for a parser.
+You can tell whether the exception applies to a Bison output file by
+inspecting the file for text beginning with "As a special
+exception...". The text spells out the exact terms of the exception.
+
+
+File: bison.info, Node: Copying, Next: Concepts, Prev: Conditions, Up: Top
+
+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: bison.info, Node: Concepts, Next: Examples, Prev: Copying, Up: Top
+
+1 The Concepts of Bison
+***********************
+
+This chapter introduces many of the basic concepts without which the
+details of Bison will not make sense. If you do not already know how to
+use Bison or Yacc, we suggest you start by reading this chapter
+carefully.
+
+* Menu:
+
+* Language and Grammar:: Languages and context-free grammars,
+ as mathematical ideas.
+* Grammar in Bison:: How we represent grammars for Bison's sake.
+* Semantic Values:: Each token or syntactic grouping can have
+ a semantic value (the value of an integer,
+ the name of an identifier, etc.).
+* Semantic Actions:: Each rule can have an action containing C code.
+* GLR Parsers:: Writing parsers for general context-free languages.
+* Locations Overview:: Tracking Locations.
+* Bison Parser:: What are Bison's input and output,
+ how is the output used?
+* Stages:: Stages in writing and running Bison grammars.
+* Grammar Layout:: Overall structure of a Bison grammar file.
+
+
+File: bison.info, Node: Language and Grammar, Next: Grammar in Bison, Up: Concepts
+
+1.1 Languages and Context-Free Grammars
+=======================================
+
+In order for Bison to parse a language, it must be described by a
+"context-free grammar". This means that you specify one or more
+"syntactic groupings" and give rules for constructing them from their
+parts. For example, in the C language, one kind of grouping is called
+an `expression'. One rule for making an expression might be, "An
+expression can be made of a minus sign and another expression".
+Another would be, "An expression can be an integer". As you can see,
+rules are often recursive, but there must be at least one rule which
+leads out of the recursion.
+
+ The most common formal system for presenting such rules for humans
+to read is "Backus-Naur Form" or "BNF", which was developed in order to
+specify the language Algol 60. Any grammar expressed in BNF is a
+context-free grammar. The input to Bison is essentially
+machine-readable BNF.
+
+ There are various important subclasses of context-free grammar.
+Although it can handle almost all context-free grammars, Bison is
+optimized for what are called LALR(1) grammars. In brief, in these
+grammars, it must be possible to tell how to parse any portion of an
+input string with just a single token of lookahead. Strictly speaking,
+that is a description of an LR(1) grammar, and LALR(1) involves
+additional restrictions that are hard to explain simply; but it is rare
+in actual practice to find an LR(1) grammar that fails to be LALR(1).
+*Note Mysterious Reduce/Reduce Conflicts: Mystery Conflicts, for more
+information on this.
+
+ Parsers for LALR(1) grammars are "deterministic", meaning roughly
+that the next grammar rule to apply at any point in the input is
+uniquely determined by the preceding input and a fixed, finite portion
+(called a "lookahead") of the remaining input. A context-free grammar
+can be "ambiguous", meaning that there are multiple ways to apply the
+grammar rules to get the same inputs. Even unambiguous grammars can be
+"nondeterministic", meaning that no fixed lookahead always suffices to
+determine the next grammar rule to apply. With the proper
+declarations, Bison is also able to parse these more general
+context-free grammars, using a technique known as GLR parsing (for
+Generalized LR). Bison's GLR parsers are able to handle any
+context-free grammar for which the number of possible parses of any
+given string is finite.
+
+ In the formal grammatical rules for a language, each kind of
+syntactic unit or grouping is named by a "symbol". Those which are
+built by grouping smaller constructs according to grammatical rules are
+called "nonterminal symbols"; those which can't be subdivided are called
+"terminal symbols" or "token types". We call a piece of input
+corresponding to a single terminal symbol a "token", and a piece
+corresponding to a single nonterminal symbol a "grouping".
+
+ We can use the C language as an example of what symbols, terminal and
+nonterminal, mean. The tokens of C are identifiers, constants (numeric
+and string), and the various keywords, arithmetic operators and
+punctuation marks. So the terminal symbols of a grammar for C include
+`identifier', `number', `string', plus one symbol for each keyword,
+operator or punctuation mark: `if', `return', `const', `static', `int',
+`char', `plus-sign', `open-brace', `close-brace', `comma' and many more.
+(These tokens can be subdivided into characters, but that is a matter of
+lexicography, not grammar.)
+
+ Here is a simple C function subdivided into tokens:
+
+ int /* keyword `int' */
+ square (int x) /* identifier, open-paren, keyword `int',
+ identifier, close-paren */
+ { /* open-brace */
+ return x * x; /* keyword `return', identifier, asterisk,
+ identifier, semicolon */
+ } /* close-brace */
+
+ The syntactic groupings of C include the expression, the statement,
+the declaration, and the function definition. These are represented in
+the grammar of C by nonterminal symbols `expression', `statement',
+`declaration' and `function definition'. The full grammar uses dozens
+of additional language constructs, each with its own nonterminal
+symbol, in order to express the meanings of these four. The example
+above is a function definition; it contains one declaration, and one
+statement. In the statement, each `x' is an expression and so is `x *
+x'.
+
+ Each nonterminal symbol must have grammatical rules showing how it
+is made out of simpler constructs. For example, one kind of C
+statement is the `return' statement; this would be described with a
+grammar rule which reads informally as follows:
+
+ A `statement' can be made of a `return' keyword, an `expression'
+ and a `semicolon'.
+
+There would be many other rules for `statement', one for each kind of
+statement in C.
+
+ One nonterminal symbol must be distinguished as the special one which
+defines a complete utterance in the language. It is called the "start
+symbol". In a compiler, this means a complete input program. In the C
+language, the nonterminal symbol `sequence of definitions and
+declarations' plays this role.
+
+ For example, `1 + 2' is a valid C expression--a valid part of a C
+program--but it is not valid as an _entire_ C program. In the
+context-free grammar of C, this follows from the fact that `expression'
+is not the start symbol.
+
+ The Bison parser reads a sequence of tokens as its input, and groups
+the tokens using the grammar rules. If the input is valid, the end
+result is that the entire token sequence reduces to a single grouping
+whose symbol is the grammar's start symbol. If we use a grammar for C,
+the entire input must be a `sequence of definitions and declarations'.
+If not, the parser reports a syntax error.
+
+
+File: bison.info, Node: Grammar in Bison, Next: Semantic Values, Prev: Language and Grammar, Up: Concepts
+
+1.2 From Formal Rules to Bison Input
+====================================
+
+A formal grammar is a mathematical construct. To define the language
+for Bison, you must write a file expressing the grammar in Bison syntax:
+a "Bison grammar" file. *Note Bison Grammar Files: Grammar File.
+
+ A nonterminal symbol in the formal grammar is represented in Bison
+input as an identifier, like an identifier in C. By convention, it
+should be in lower case, such as `expr', `stmt' or `declaration'.
+
+ The Bison representation for a terminal symbol is also called a
+"token type". Token types as well can be represented as C-like
+identifiers. By convention, these identifiers should be upper case to
+distinguish them from nonterminals: for example, `INTEGER',
+`IDENTIFIER', `IF' or `RETURN'. A terminal symbol that stands for a
+particular keyword in the language should be named after that keyword
+converted to upper case. The terminal symbol `error' is reserved for
+error recovery. *Note Symbols::.
+
+ A terminal symbol can also be represented as a character literal,
+just like a C character constant. You should do this whenever a token
+is just a single character (parenthesis, plus-sign, etc.): use that
+same character in a literal as the terminal symbol for that token.
+
+ A third way to represent a terminal symbol is with a C string
+constant containing several characters. *Note Symbols::, for more
+information.
+
+ The grammar rules also have an expression in Bison syntax. For
+example, here is the Bison rule for a C `return' statement. The
+semicolon in quotes is a literal character token, representing part of
+the C syntax for the statement; the naked semicolon, and the colon, are
+Bison punctuation used in every rule.
+
+ stmt: RETURN expr ';'
+ ;
+
+*Note Syntax of Grammar Rules: Rules.
+
+
+File: bison.info, Node: Semantic Values, Next: Semantic Actions, Prev: Grammar in Bison, Up: Concepts
+
+1.3 Semantic Values
+===================
+
+A formal grammar selects tokens only by their classifications: for
+example, if a rule mentions the terminal symbol `integer constant', it
+means that _any_ integer constant is grammatically valid in that
+position. The precise value of the constant is irrelevant to how to
+parse the input: if `x+4' is grammatical then `x+1' or `x+3989' is
+equally grammatical.
+
+ But the precise value is very important for what the input means
+once it is parsed. A compiler is useless if it fails to distinguish
+between 4, 1 and 3989 as constants in the program! Therefore, each
+token in a Bison grammar has both a token type and a "semantic value".
+*Note Defining Language Semantics: Semantics, for details.
+
+ The token type is a terminal symbol defined in the grammar, such as
+`INTEGER', `IDENTIFIER' or `',''. It tells everything you need to know
+to decide where the token may validly appear and how to group it with
+other tokens. The grammar rules know nothing about tokens except their
+types.
+
+ The semantic value has all the rest of the information about the
+meaning of the token, such as the value of an integer, or the name of an
+identifier. (A token such as `','' which is just punctuation doesn't
+need to have any semantic value.)
+
+ For example, an input token might be classified as token type
+`INTEGER' and have the semantic value 4. Another input token might
+have the same token type `INTEGER' but value 3989. When a grammar rule
+says that `INTEGER' is allowed, either of these tokens is acceptable
+because each is an `INTEGER'. When the parser accepts the token, it
+keeps track of the token's semantic value.
+
+ Each grouping can also have a semantic value as well as its
+nonterminal symbol. For example, in a calculator, an expression
+typically has a semantic value that is a number. In a compiler for a
+programming language, an expression typically has a semantic value that
+is a tree structure describing the meaning of the expression.
+
+
+File: bison.info, Node: Semantic Actions, Next: GLR Parsers, Prev: Semantic Values, Up: Concepts
+
+1.4 Semantic Actions
+====================
+
+In order to be useful, a program must do more than parse input; it must
+also produce some output based on the input. In a Bison grammar, a
+grammar rule can have an "action" made up of C statements. Each time
+the parser recognizes a match for that rule, the action is executed.
+*Note Actions::.
+
+ Most of the time, the purpose of an action is to compute the
+semantic value of the whole construct from the semantic values of its
+parts. For example, suppose we have a rule which says an expression
+can be the sum of two expressions. When the parser recognizes such a
+sum, each of the subexpressions has a semantic value which describes
+how it was built up. The action for this rule should create a similar
+sort of value for the newly recognized larger expression.
+
+ For example, here is a rule that says an expression can be the sum of
+two subexpressions:
+
+ expr: expr '+' expr { $$ = $1 + $3; }
+ ;
+
+The action says how to produce the semantic value of the sum expression
+from the values of the two subexpressions.
+
+
+File: bison.info, Node: GLR Parsers, Next: Locations Overview, Prev: Semantic Actions, Up: Concepts
+
+1.5 Writing GLR Parsers
+=======================
+
+In some grammars, Bison's standard LALR(1) parsing algorithm cannot
+decide whether to apply a certain grammar rule at a given point. That
+is, it may not be able to decide (on the basis of the input read so
+far) which of two possible reductions (applications of a grammar rule)
+applies, or whether to apply a reduction or read more of the input and
+apply a reduction later in the input. These are known respectively as
+"reduce/reduce" conflicts (*note Reduce/Reduce::), and "shift/reduce"
+conflicts (*note Shift/Reduce::).
+
+ To use a grammar that is not easily modified to be LALR(1), a more
+general parsing algorithm is sometimes necessary. If you include
+`%glr-parser' among the Bison declarations in your file (*note Grammar
+Outline::), the result is a Generalized LR (GLR) parser. These parsers
+handle Bison grammars that contain no unresolved conflicts (i.e., after
+applying precedence declarations) identically to LALR(1) parsers.
+However, when faced with unresolved shift/reduce and reduce/reduce
+conflicts, GLR parsers use the simple expedient of doing both,
+effectively cloning the parser to follow both possibilities. Each of
+the resulting parsers can again split, so that at any given time, there
+can be any number of possible parses being explored. The parsers
+proceed in lockstep; that is, all of them consume (shift) a given input
+symbol before any of them proceed to the next. Each of the cloned
+parsers eventually meets one of two possible fates: either it runs into
+a parsing error, in which case it simply vanishes, or it merges with
+another parser, because the two of them have reduced the input to an
+identical set of symbols.
+
+ During the time that there are multiple parsers, semantic actions are
+recorded, but not performed. When a parser disappears, its recorded
+semantic actions disappear as well, and are never performed. When a
+reduction makes two parsers identical, causing them to merge, Bison
+records both sets of semantic actions. Whenever the last two parsers
+merge, reverting to the single-parser case, Bison resolves all the
+outstanding actions either by precedences given to the grammar rules
+involved, or by performing both actions, and then calling a designated
+user-defined function on the resulting values to produce an arbitrary
+merged result.
+
+* Menu:
+
+* Simple GLR Parsers:: Using GLR parsers on unambiguous grammars.
+* Merging GLR Parses:: Using GLR parsers to resolve ambiguities.
+* GLR Semantic Actions:: Deferred semantic actions have special concerns.
+* Compiler Requirements:: GLR parsers require a modern C compiler.
+
+
+File: bison.info, Node: Simple GLR Parsers, Next: Merging GLR Parses, Up: GLR Parsers
+
+1.5.1 Using GLR on Unambiguous Grammars
+---------------------------------------
+
+In the simplest cases, you can use the GLR algorithm to parse grammars
+that are unambiguous, but fail to be LALR(1). Such grammars typically
+require more than one symbol of lookahead, or (in rare cases) fall into
+the category of grammars in which the LALR(1) algorithm throws away too
+much information (they are in LR(1), but not LALR(1), *Note Mystery
+Conflicts::).
+
+ Consider a problem that arises in the declaration of enumerated and
+subrange types in the programming language Pascal. Here are some
+examples:
+
+ type subrange = lo .. hi;
+ type enum = (a, b, c);
+
+The original language standard allows only numeric literals and
+constant identifiers for the subrange bounds (`lo' and `hi'), but
+Extended Pascal (ISO/IEC 10206) and many other Pascal implementations
+allow arbitrary expressions there. This gives rise to the following
+situation, containing a superfluous pair of parentheses:
+
+ type subrange = (a) .. b;
+
+Compare this to the following declaration of an enumerated type with
+only one value:
+
+ type enum = (a);
+
+(These declarations are contrived, but they are syntactically valid,
+and more-complicated cases can come up in practical programs.)
+
+ These two declarations look identical until the `..' token. With
+normal LALR(1) one-token lookahead it is not possible to decide between
+the two forms when the identifier `a' is parsed. It is, however,
+desirable for a parser to decide this, since in the latter case `a'
+must become a new identifier to represent the enumeration value, while
+in the former case `a' must be evaluated with its current meaning,
+which may be a constant or even a function call.
+
+ You could parse `(a)' as an "unspecified identifier in parentheses",
+to be resolved later, but this typically requires substantial
+contortions in both semantic actions and large parts of the grammar,
+where the parentheses are nested in the recursive rules for expressions.
+
+ You might think of using the lexer to distinguish between the two
+forms by returning different tokens for currently defined and undefined
+identifiers. But if these declarations occur in a local scope, and `a'
+is defined in an outer scope, then both forms are possible--either
+locally redefining `a', or using the value of `a' from the outer scope.
+So this approach cannot work.
+
+ A simple solution to this problem is to declare the parser to use
+the GLR algorithm. When the GLR parser reaches the critical state, it
+merely splits into two branches and pursues both syntax rules
+simultaneously. Sooner or later, one of them runs into a parsing
+error. If there is a `..' token before the next `;', the rule for
+enumerated types fails since it cannot accept `..' anywhere; otherwise,
+the subrange type rule fails since it requires a `..' token. So one of
+the branches fails silently, and the other one continues normally,
+performing all the intermediate actions that were postponed during the
+split.
+
+ If the input is syntactically incorrect, both branches fail and the
+parser reports a syntax error as usual.
+
+ The effect of all this is that the parser seems to "guess" the
+correct branch to take, or in other words, it seems to use more
+lookahead than the underlying LALR(1) algorithm actually allows for.
+In this example, LALR(2) would suffice, but also some cases that are
+not LALR(k) for any k can be handled this way.
+
+ In general, a GLR parser can take quadratic or cubic worst-case time,
+and the current Bison parser even takes exponential time and space for
+some grammars. In practice, this rarely happens, and for many grammars
+it is possible to prove that it cannot happen. The present example
+contains only one conflict between two rules, and the type-declaration
+context containing the conflict cannot be nested. So the number of
+branches that can exist at any time is limited by the constant 2, and
+the parsing time is still linear.
+
+ Here is a Bison grammar corresponding to the example above. It
+parses a vastly simplified form of Pascal type declarations.
+
+ %token TYPE DOTDOT ID
+
+ %left '+' '-'
+ %left '*' '/'
+
+ %%
+
+ type_decl : TYPE ID '=' type ';'
+ ;
+
+ type : '(' id_list ')'
+ | expr DOTDOT expr
+ ;
+
+ id_list : ID
+ | id_list ',' ID
+ ;
+
+ expr : '(' expr ')'
+ | expr '+' expr
+ | expr '-' expr
+ | expr '*' expr
+ | expr '/' expr
+ | ID
+ ;
+
+ When used as a normal LALR(1) grammar, Bison correctly complains
+about one reduce/reduce conflict. In the conflicting situation the
+parser chooses one of the alternatives, arbitrarily the one declared
+first. Therefore the following correct input is not recognized:
+
+ type t = (a) .. b;
+
+ The parser can be turned into a GLR parser, while also telling Bison
+to be silent about the one known reduce/reduce conflict, by adding
+these two declarations to the Bison input file (before the first `%%'):
+
+ %glr-parser
+ %expect-rr 1
+
+No change in the grammar itself is required. Now the parser recognizes
+all valid declarations, according to the limited syntax above,
+transparently. In fact, the user does not even notice when the parser
+splits.
+
+ So here we have a case where we can use the benefits of GLR, almost
+without disadvantages. Even in simple cases like this, however, there
+are at least two potential problems to beware. First, always analyze
+the conflicts reported by Bison to make sure that GLR splitting is only
+done where it is intended. A GLR parser splitting inadvertently may
+cause problems less obvious than an LALR parser statically choosing the
+wrong alternative in a conflict. Second, consider interactions with
+the lexer (*note Semantic Tokens::) with great care. Since a split
+parser consumes tokens without performing any actions during the split,
+the lexer cannot obtain information via parser actions. Some cases of
+lexer interactions can be eliminated by using GLR to shift the
+complications from the lexer to the parser. You must check the
+remaining cases for correctness.
+
+ In our example, it would be safe for the lexer to return tokens
+based on their current meanings in some symbol table, because no new
+symbols are defined in the middle of a type declaration. Though it is
+possible for a parser to define the enumeration constants as they are
+parsed, before the type declaration is completed, it actually makes no
+difference since they cannot be used within the same enumerated type
+declaration.
+
+
+File: bison.info, Node: Merging GLR Parses, Next: GLR Semantic Actions, Prev: Simple GLR Parsers, Up: GLR Parsers
+
+1.5.2 Using GLR to Resolve Ambiguities
+--------------------------------------
+
+Let's consider an example, vastly simplified from a C++ grammar.
+
+ %{
+ #include <stdio.h>
+ #define YYSTYPE char const *
+ int yylex (void);
+ void yyerror (char const *);
+ %}
+
+ %token TYPENAME ID
+
+ %right '='
+ %left '+'
+
+ %glr-parser
+
+ %%
+
+ prog :
+ | prog stmt { printf ("\n"); }
+ ;
+
+ stmt : expr ';' %dprec 1
+ | decl %dprec 2
+ ;
+
+ expr : ID { printf ("%s ", $$); }
+ | TYPENAME '(' expr ')'
+ { printf ("%s <cast> ", $1); }
+ | expr '+' expr { printf ("+ "); }
+ | expr '=' expr { printf ("= "); }
+ ;
+
+ decl : TYPENAME declarator ';'
+ { printf ("%s <declare> ", $1); }
+ | TYPENAME declarator '=' expr ';'
+ { printf ("%s <init-declare> ", $1); }
+ ;
+
+ declarator : ID { printf ("\"%s\" ", $1); }
+ | '(' declarator ')'
+ ;
+
+This models a problematic part of the C++ grammar--the ambiguity between
+certain declarations and statements. For example,
+
+ T (x) = y+z;
+
+parses as either an `expr' or a `stmt' (assuming that `T' is recognized
+as a `TYPENAME' and `x' as an `ID'). Bison detects this as a
+reduce/reduce conflict between the rules `expr : ID' and `declarator :
+ID', which it cannot resolve at the time it encounters `x' in the
+example above. Since this is a GLR parser, it therefore splits the
+problem into two parses, one for each choice of resolving the
+reduce/reduce conflict. Unlike the example from the previous section
+(*note Simple GLR Parsers::), however, neither of these parses "dies,"
+because the grammar as it stands is ambiguous. One of the parsers
+eventually reduces `stmt : expr ';'' and the other reduces `stmt :
+decl', after which both parsers are in an identical state: they've seen
+`prog stmt' and have the same unprocessed input remaining. We say that
+these parses have "merged."
+
+ At this point, the GLR parser requires a specification in the
+grammar of how to choose between the competing parses. In the example
+above, the two `%dprec' declarations specify that Bison is to give
+precedence to the parse that interprets the example as a `decl', which
+implies that `x' is a declarator. The parser therefore prints
+
+ "x" y z + T <init-declare>
+
+ The `%dprec' declarations only come into play when more than one
+parse survives. Consider a different input string for this parser:
+
+ T (x) + y;
+
+This is another example of using GLR to parse an unambiguous construct,
+as shown in the previous section (*note Simple GLR Parsers::). Here,
+there is no ambiguity (this cannot be parsed as a declaration).
+However, at the time the Bison parser encounters `x', it does not have
+enough information to resolve the reduce/reduce conflict (again,
+between `x' as an `expr' or a `declarator'). In this case, no
+precedence declaration is used. Again, the parser splits into two, one
+assuming that `x' is an `expr', and the other assuming `x' is a
+`declarator'. The second of these parsers then vanishes when it sees
+`+', and the parser prints
+
+ x T <cast> y +
+
+ Suppose that instead of resolving the ambiguity, you wanted to see
+all the possibilities. For this purpose, you must merge the semantic
+actions of the two possible parsers, rather than choosing one over the
+other. To do so, you could change the declaration of `stmt' as follows:
+
+ stmt : expr ';' %merge <stmtMerge>
+ | decl %merge <stmtMerge>
+ ;
+
+and define the `stmtMerge' function as:
+
+ static YYSTYPE
+ stmtMerge (YYSTYPE x0, YYSTYPE x1)
+ {
+ printf ("<OR> ");
+ return "";
+ }
+
+with an accompanying forward declaration in the C declarations at the
+beginning of the file:
+
+ %{
+ #define YYSTYPE char const *
+ static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
+ %}
+
+With these declarations, the resulting parser parses the first example
+as both an `expr' and a `decl', and prints
+
+ "x" y z + T <init-declare> x T <cast> y z + = <OR>
+
+ Bison requires that all of the productions that participate in any
+particular merge have identical `%merge' clauses. Otherwise, the
+ambiguity would be unresolvable, and the parser will report an error
+during any parse that results in the offending merge.
+
+
+File: bison.info, Node: GLR Semantic Actions, Next: Compiler Requirements, Prev: Merging GLR Parses, Up: GLR Parsers
+
+1.5.3 GLR Semantic Actions
+--------------------------
+
+By definition, a deferred semantic action is not performed at the same
+time as the associated reduction. This raises caveats for several
+Bison features you might use in a semantic action in a GLR parser.
+
+ In any semantic action, you can examine `yychar' to determine the
+type of the lookahead token present at the time of the associated
+reduction. After checking that `yychar' is not set to `YYEMPTY' or
+`YYEOF', you can then examine `yylval' and `yylloc' to determine the
+lookahead token's semantic value and location, if any. In a
+nondeferred semantic action, you can also modify any of these variables
+to influence syntax analysis. *Note Lookahead Tokens: Lookahead.
+
+ In a deferred semantic action, it's too late to influence syntax
+analysis. In this case, `yychar', `yylval', and `yylloc' are set to
+shallow copies of the values they had at the time of the associated
+reduction. For this reason alone, modifying them is dangerous.
+Moreover, the result of modifying them is undefined and subject to
+change with future versions of Bison. For example, if a semantic
+action might be deferred, you should never write it to invoke
+`yyclearin' (*note Action Features::) or to attempt to free memory
+referenced by `yylval'.
+
+ Another Bison feature requiring special consideration is `YYERROR'
+(*note Action Features::), which you can invoke in a semantic action to
+initiate error recovery. During deterministic GLR operation, the
+effect of `YYERROR' is the same as its effect in an LALR(1) parser. In
+a deferred semantic action, its effect is undefined.
+
+ Also, see *Note Default Action for Locations: Location Default
+Action, which describes a special usage of `YYLLOC_DEFAULT' in GLR
+parsers.
+
+
+File: bison.info, Node: Compiler Requirements, Prev: GLR Semantic Actions, Up: GLR Parsers
+
+1.5.4 Considerations when Compiling GLR Parsers
+-----------------------------------------------
+
+The GLR parsers require a compiler for ISO C89 or later. In addition,
+they use the `inline' keyword, which is not C89, but is C99 and is a
+common extension in pre-C99 compilers. It is up to the user of these
+parsers to handle portability issues. For instance, if using Autoconf
+and the Autoconf macro `AC_C_INLINE', a mere
+
+ %{
+ #include <config.h>
+ %}
+
+will suffice. Otherwise, we suggest
+
+ %{
+ #if __STDC_VERSION__ < 199901 && ! defined __GNUC__ && ! defined inline
+ #define inline
+ #endif
+ %}
+
+
+File: bison.info, Node: Locations Overview, Next: Bison Parser, Prev: GLR Parsers, Up: Concepts
+
+1.6 Locations
+=============
+
+Many applications, like interpreters or compilers, have to produce
+verbose and useful error messages. To achieve this, one must be able
+to keep track of the "textual location", or "location", of each
+syntactic construct. Bison provides a mechanism for handling these
+locations.
+
+ Each token has a semantic value. In a similar fashion, each token
+has an associated location, but the type of locations is the same for
+all tokens and groupings. Moreover, the output parser is equipped with
+a default data structure for storing locations (*note Locations::, for
+more details).
+
+ Like semantic values, locations can be reached in actions using a
+dedicated set of constructs. In the example above, the location of the
+whole grouping is `@$', while the locations of the subexpressions are
+`@1' and `@3'.
+
+ When a rule is matched, a default action is used to compute the
+semantic value of its left hand side (*note Actions::). In the same
+way, another default action is used for locations. However, the action
+for locations is general enough for most cases, meaning there is
+usually no need to describe for each rule how `@$' should be formed.
+When building a new location for a given grouping, the default behavior
+of the output parser is to take the beginning of the first symbol, and
+the end of the last symbol.
+
+
+File: bison.info, Node: Bison Parser, Next: Stages, Prev: Locations Overview, Up: Concepts
+
+1.7 Bison Output: the Parser File
+=================================
+
+When you run Bison, you give it a Bison grammar file as input. The
+output is a C source file that parses the language described by the
+grammar. This file is called a "Bison parser". Keep in mind that the
+Bison utility and the Bison parser are two distinct programs: the Bison
+utility is a program whose output is the Bison parser that becomes part
+of your program.
+
+ The job of the Bison parser is to group tokens into groupings
+according to the grammar rules--for example, to build identifiers and
+operators into expressions. As it does this, it runs the actions for
+the grammar rules it uses.
+
+ The tokens come from a function called the "lexical analyzer" that
+you must supply in some fashion (such as by writing it in C). The Bison
+parser calls the lexical analyzer each time it wants a new token. It
+doesn't know what is "inside" the tokens (though their semantic values
+may reflect this). Typically the lexical analyzer makes the tokens by
+parsing characters of text, but Bison does not depend on this. *Note
+The Lexical Analyzer Function `yylex': Lexical.
+
+ The Bison parser file is C code which defines a function named
+`yyparse' which implements that grammar. This function does not make a
+complete C program: you must supply some additional functions. One is
+the lexical analyzer. Another is an error-reporting function which the
+parser calls to report an error. In addition, a complete C program must
+start with a function called `main'; you have to provide this, and
+arrange for it to call `yyparse' or the parser will never run. *Note
+Parser C-Language Interface: Interface.
+
+ Aside from the token type names and the symbols in the actions you
+write, all symbols defined in the Bison parser file itself begin with
+`yy' or `YY'. This includes interface functions such as the lexical
+analyzer function `yylex', the error reporting function `yyerror' and
+the parser function `yyparse' itself. This also includes numerous
+identifiers used for internal purposes. Therefore, you should avoid
+using C identifiers starting with `yy' or `YY' in the Bison grammar
+file except for the ones defined in this manual. Also, you should
+avoid using the C identifiers `malloc' and `free' for anything other
+than their usual meanings.
+
+ In some cases the Bison parser file includes system headers, and in
+those cases your code should respect the identifiers reserved by those
+headers. On some non-GNU hosts, `<alloca.h>', `<malloc.h>',
+`<stddef.h>', and `<stdlib.h>' are included as needed to declare memory
+allocators and related types. `<libintl.h>' is included if message
+translation is in use (*note Internationalization::). Other system
+headers may be included if you define `YYDEBUG' to a nonzero value
+(*note Tracing Your Parser: Tracing.).
+
+
+File: bison.info, Node: Stages, Next: Grammar Layout, Prev: Bison Parser, Up: Concepts
+
+1.8 Stages in Using Bison
+=========================
+
+The actual language-design process using Bison, from grammar
+specification to a working compiler or interpreter, has these parts:
+
+ 1. Formally specify the grammar in a form recognized by Bison (*note
+ Bison Grammar Files: Grammar File.). For each grammatical rule in
+ the language, describe the action that is to be taken when an
+ instance of that rule is recognized. The action is described by a
+ sequence of C statements.
+
+ 2. Write a lexical analyzer to process input and pass tokens to the
+ parser. The lexical analyzer may be written by hand in C (*note
+ The Lexical Analyzer Function `yylex': Lexical.). It could also
+ be produced using Lex, but the use of Lex is not discussed in this
+ manual.
+
+ 3. Write a controlling function that calls the Bison-produced parser.
+
+ 4. Write error-reporting routines.
+
+ To turn this source code as written into a runnable program, you
+must follow these steps:
+
+ 1. Run Bison on the grammar to produce the parser.
+
+ 2. Compile the code output by Bison, as well as any other source
+ files.
+
+ 3. Link the object files to produce the finished product.
+
+
+File: bison.info, Node: Grammar Layout, Prev: Stages, Up: Concepts
+
+1.9 The Overall Layout of a Bison Grammar
+=========================================
+
+The input file for the Bison utility is a "Bison grammar file". The
+general form of a Bison grammar file is as follows:
+
+ %{
+ PROLOGUE
+ %}
+
+ BISON DECLARATIONS
+
+ %%
+ GRAMMAR RULES
+ %%
+ EPILOGUE
+
+The `%%', `%{' and `%}' are punctuation that appears in every Bison
+grammar file to separate the sections.
+
+ The prologue may define types and variables used in the actions.
+You can also use preprocessor commands to define macros used there, and
+use `#include' to include header files that do any of these things.
+You need to declare the lexical analyzer `yylex' and the error printer
+`yyerror' here, along with any other global identifiers used by the
+actions in the grammar rules.
+
+ The Bison declarations declare the names of the terminal and
+nonterminal symbols, and may also describe operator precedence and the
+data types of semantic values of various symbols.
+
+ The grammar rules define how to construct each nonterminal symbol
+from its parts.
+
+ The epilogue can contain any code you want to use. Often the
+definitions of functions declared in the prologue go here. In a simple
+program, all the rest of the program can go here.
+
+
+File: bison.info, Node: Examples, Next: Grammar File, Prev: Concepts, Up: Top
+
+2 Examples
+**********
+
+Now we show and explain three sample programs written using Bison: a
+reverse polish notation calculator, an algebraic (infix) notation
+calculator, and a multi-function calculator. All three have been tested
+under BSD Unix 4.3; each produces a usable, though limited, interactive
+desk-top calculator.
+
+ These examples are simple, but Bison grammars for real programming
+languages are written the same way. You can copy these examples into a
+source file to try them.
+
+* Menu:
+
+* RPN Calc:: Reverse polish notation calculator;
+ a first example with no operator precedence.
+* Infix Calc:: Infix (algebraic) notation calculator.
+ Operator precedence is introduced.
+* Simple Error Recovery:: Continuing after syntax errors.
+* Location Tracking Calc:: Demonstrating the use of @N and @$.
+* Multi-function Calc:: Calculator with memory and trig functions.
+ It uses multiple data-types for semantic values.
+* Exercises:: Ideas for improving the multi-function calculator.
+
+
+File: bison.info, Node: RPN Calc, Next: Infix Calc, Up: Examples
+
+2.1 Reverse Polish Notation Calculator
+======================================
+
+The first example is that of a simple double-precision "reverse polish
+notation" calculator (a calculator using postfix operators). This
+example provides a good starting point, since operator precedence is
+not an issue. The second example will illustrate how operator
+precedence is handled.
+
+ The source code for this calculator is named `rpcalc.y'. The `.y'
+extension is a convention used for Bison input files.
+
+* Menu:
+
+* Rpcalc Declarations:: Prologue (declarations) for rpcalc.
+* Rpcalc Rules:: Grammar Rules for rpcalc, with explanation.
+* Rpcalc Lexer:: The lexical analyzer.
+* Rpcalc Main:: The controlling function.
+* Rpcalc Error:: The error reporting function.
+* Rpcalc Generate:: Running Bison on the grammar file.
+* Rpcalc Compile:: Run the C compiler on the output code.
+
+
+File: bison.info, Node: Rpcalc Declarations, Next: Rpcalc Rules, Up: RPN Calc
+
+2.1.1 Declarations for `rpcalc'
+-------------------------------
+
+Here are the C and Bison declarations for the reverse polish notation
+calculator. As in C, comments are placed between `/*...*/'.
+
+ /* Reverse polish notation calculator. */
+
+ %{
+ #define YYSTYPE double
+ #include <math.h>
+ int yylex (void);
+ void yyerror (char const *);
+ %}
+
+ %token NUM
+
+ %% /* Grammar rules and actions follow. */
+
+ The declarations section (*note The prologue: Prologue.) contains two
+preprocessor directives and two forward declarations.
+
+ The `#define' directive defines the macro `YYSTYPE', thus specifying
+the C data type for semantic values of both tokens and groupings (*note
+Data Types of Semantic Values: Value Type.). The Bison parser will use
+whatever type `YYSTYPE' is defined as; if you don't define it, `int' is
+the default. Because we specify `double', each token and each
+expression has an associated value, which is a floating point number.
+
+ The `#include' directive is used to declare the exponentiation
+function `pow'.
+
+ The forward declarations for `yylex' and `yyerror' are needed
+because the C language requires that functions be declared before they
+are used. These functions will be defined in the epilogue, but the
+parser calls them so they must be declared in the prologue.
+
+ The second section, Bison declarations, provides information to Bison
+about the token types (*note The Bison Declarations Section: Bison
+Declarations.). Each terminal symbol that is not a single-character
+literal must be declared here. (Single-character literals normally
+don't need to be declared.) In this example, all the arithmetic
+operators are designated by single-character literals, so the only
+terminal symbol that needs to be declared is `NUM', the token type for
+numeric constants.
+
+
+File: bison.info, Node: Rpcalc Rules, Next: Rpcalc Lexer, Prev: Rpcalc Declarations, Up: RPN Calc
+
+2.1.2 Grammar Rules for `rpcalc'
+--------------------------------
+
+Here are the grammar rules for the reverse polish notation calculator.
+
+ input: /* empty */
+ | input line
+ ;
+
+ line: '\n'
+ | exp '\n' { printf ("\t%.10g\n", $1); }
+ ;
+
+ exp: NUM { $$ = $1; }
+ | exp exp '+' { $$ = $1 + $2; }
+ | exp exp '-' { $$ = $1 - $2; }
+ | exp exp '*' { $$ = $1 * $2; }
+ | exp exp '/' { $$ = $1 / $2; }
+ /* Exponentiation */
+ | exp exp '^' { $$ = pow ($1, $2); }
+ /* Unary minus */
+ | exp 'n' { $$ = -$1; }
+ ;
+ %%
+
+ The groupings of the rpcalc "language" defined here are the
+expression (given the name `exp'), the line of input (`line'), and the
+complete input transcript (`input'). Each of these nonterminal symbols
+has several alternate rules, joined by the vertical bar `|' which is
+read as "or". The following sections explain what these rules mean.
+
+ The semantics of the language is determined by the actions taken
+when a grouping is recognized. The actions are the C code that appears
+inside braces. *Note Actions::.
+
+ You must specify these actions in C, but Bison provides the means for
+passing semantic values between the rules. In each action, the
+pseudo-variable `$$' stands for the semantic value for the grouping
+that the rule is going to construct. Assigning a value to `$$' is the
+main job of most actions. The semantic values of the components of the
+rule are referred to as `$1', `$2', and so on.
+
+* Menu:
+
+* Rpcalc Input::
+* Rpcalc Line::
+* Rpcalc Expr::
+
+
+File: bison.info, Node: Rpcalc Input, Next: Rpcalc Line, Up: Rpcalc Rules
+
+2.1.2.1 Explanation of `input'
+..............................
+
+Consider the definition of `input':
+
+ input: /* empty */
+ | input line
+ ;
+
+ This definition reads as follows: "A complete input is either an
+empty string, or a complete input followed by an input line". Notice
+that "complete input" is defined in terms of itself. This definition
+is said to be "left recursive" since `input' appears always as the
+leftmost symbol in the sequence. *Note Recursive Rules: Recursion.
+
+ The first alternative is empty because there are no symbols between
+the colon and the first `|'; this means that `input' can match an empty
+string of input (no tokens). We write the rules this way because it is
+legitimate to type `Ctrl-d' right after you start the calculator. It's
+conventional to put an empty alternative first and write the comment
+`/* empty */' in it.
+
+ The second alternate rule (`input line') handles all nontrivial
+input. It means, "After reading any number of lines, read one more
+line if possible." The left recursion makes this rule into a loop.
+Since the first alternative matches empty input, the loop can be
+executed zero or more times.
+
+ The parser function `yyparse' continues to process input until a
+grammatical error is seen or the lexical analyzer says there are no more
+input tokens; we will arrange for the latter to happen at end-of-input.
+
+
+File: bison.info, Node: Rpcalc Line, Next: Rpcalc Expr, Prev: Rpcalc Input, Up: Rpcalc Rules
+
+2.1.2.2 Explanation of `line'
+.............................
+
+Now consider the definition of `line':
+
+ line: '\n'
+ | exp '\n' { printf ("\t%.10g\n", $1); }
+ ;
+
+ The first alternative is a token which is a newline character; this
+means that rpcalc accepts a blank line (and ignores it, since there is
+no action). The second alternative is an expression followed by a
+newline. This is the alternative that makes rpcalc useful. The
+semantic value of the `exp' grouping is the value of `$1' because the
+`exp' in question is the first symbol in the alternative. The action
+prints this value, which is the result of the computation the user
+asked for.
+
+ This action is unusual because it does not assign a value to `$$'.
+As a consequence, the semantic value associated with the `line' is
+uninitialized (its value will be unpredictable). This would be a bug if
+that value were ever used, but we don't use it: once rpcalc has printed
+the value of the user's input line, that value is no longer needed.
+
+
+File: bison.info, Node: Rpcalc Expr, Prev: Rpcalc Line, Up: Rpcalc Rules
+
+2.1.2.3 Explanation of `expr'
+.............................
+
+The `exp' grouping has several rules, one for each kind of expression.
+The first rule handles the simplest expressions: those that are just
+numbers. The second handles an addition-expression, which looks like
+two expressions followed by a plus-sign. The third handles
+subtraction, and so on.
+
+ exp: NUM
+ | exp exp '+' { $$ = $1 + $2; }
+ | exp exp '-' { $$ = $1 - $2; }
+ ...
+ ;
+
+ We have used `|' to join all the rules for `exp', but we could
+equally well have written them separately:
+
+ exp: NUM ;
+ exp: exp exp '+' { $$ = $1 + $2; } ;
+ exp: exp exp '-' { $$ = $1 - $2; } ;
+ ...
+
+ Most of the rules have actions that compute the value of the
+expression in terms of the value of its parts. For example, in the
+rule for addition, `$1' refers to the first component `exp' and `$2'
+refers to the second one. The third component, `'+'', has no meaningful
+associated semantic value, but if it had one you could refer to it as
+`$3'. When `yyparse' recognizes a sum expression using this rule, the
+sum of the two subexpressions' values is produced as the value of the
+entire expression. *Note Actions::.
+
+ You don't have to give an action for every rule. When a rule has no
+action, Bison by default copies the value of `$1' into `$$'. This is
+what happens in the first rule (the one that uses `NUM').
+
+ The formatting shown here is the recommended convention, but Bison
+does not require it. You can add or change white space as much as you
+wish. For example, this:
+
+ exp : NUM | exp exp '+' {$$ = $1 + $2; } | ... ;
+
+means the same thing as this:
+
+ exp: NUM
+ | exp exp '+' { $$ = $1 + $2; }
+ | ...
+ ;
+
+The latter, however, is much more readable.
+
+
+File: bison.info, Node: Rpcalc Lexer, Next: Rpcalc Main, Prev: Rpcalc Rules, Up: RPN Calc
+
+2.1.3 The `rpcalc' Lexical Analyzer
+-----------------------------------
+
+The lexical analyzer's job is low-level parsing: converting characters
+or sequences of characters into tokens. The Bison parser gets its
+tokens by calling the lexical analyzer. *Note The Lexical Analyzer
+Function `yylex': Lexical.
+
+ Only a simple lexical analyzer is needed for the RPN calculator.
+This lexical analyzer skips blanks and tabs, then reads in numbers as
+`double' and returns them as `NUM' tokens. Any other character that
+isn't part of a number is a separate token. Note that the token-code
+for such a single-character token is the character itself.
+
+ The return value of the lexical analyzer function is a numeric code
+which represents a token type. The same text used in Bison rules to
+stand for this token type is also a C expression for the numeric code
+for the type. This works in two ways. If the token type is a
+character literal, then its numeric code is that of the character; you
+can use the same character literal in the lexical analyzer to express
+the number. If the token type is an identifier, that identifier is
+defined by Bison as a C macro whose definition is the appropriate
+number. In this example, therefore, `NUM' becomes a macro for `yylex'
+to use.
+
+ The semantic value of the token (if it has one) is stored into the
+global variable `yylval', which is where the Bison parser will look for
+it. (The C data type of `yylval' is `YYSTYPE', which was defined at
+the beginning of the grammar; *note Declarations for `rpcalc': Rpcalc
+Declarations.)
+
+ A token type code of zero is returned if the end-of-input is
+encountered. (Bison recognizes any nonpositive value as indicating
+end-of-input.)
+
+ Here is the code for the lexical analyzer:
+
+ /* The lexical analyzer returns a double floating point
+ number on the stack and the token NUM, or the numeric code
+ of the character read if not a number. It skips all blanks
+ and tabs, and returns 0 for end-of-input. */
+
+ #include <ctype.h>
+
+ int
+ yylex (void)
+ {
+ int c;
+
+ /* Skip white space. */
+ while ((c = getchar ()) == ' ' || c == '\t')
+ ;
+ /* Process numbers. */
+ if (c == '.' || isdigit (c))
+ {
+ ungetc (c, stdin);
+ scanf ("%lf", &yylval);
+ return NUM;
+ }
+ /* Return end-of-input. */
+ if (c == EOF)
+ return 0;
+ /* Return a single char. */
+ return c;
+ }
+
+
+File: bison.info, Node: Rpcalc Main, Next: Rpcalc Error, Prev: Rpcalc Lexer, Up: RPN Calc
+
+2.1.4 The Controlling Function
+------------------------------
+
+In keeping with the spirit of this example, the controlling function is
+kept to the bare minimum. The only requirement is that it call
+`yyparse' to start the process of parsing.
+
+ int
+ main (void)
+ {
+ return yyparse ();
+ }
+
+
+File: bison.info, Node: Rpcalc Error, Next: Rpcalc Generate, Prev: Rpcalc Main, Up: RPN Calc
+
+2.1.5 The Error Reporting Routine
+---------------------------------
+
+When `yyparse' detects a syntax error, it calls the error reporting
+function `yyerror' to print an error message (usually but not always
+`"syntax error"'). It is up to the programmer to supply `yyerror'
+(*note Parser C-Language Interface: Interface.), so here is the
+definition we will use:
+
+ #include <stdio.h>
+
+ /* Called by yyparse on error. */
+ void
+ yyerror (char const *s)
+ {
+ fprintf (stderr, "%s\n", s);
+ }
+
+ After `yyerror' returns, the Bison parser may recover from the error
+and continue parsing if the grammar contains a suitable error rule
+(*note Error Recovery::). Otherwise, `yyparse' returns nonzero. We
+have not written any error rules in this example, so any invalid input
+will cause the calculator program to exit. This is not clean behavior
+for a real calculator, but it is adequate for the first example.
+
+
+File: bison.info, Node: Rpcalc Generate, Next: Rpcalc Compile, Prev: Rpcalc Error, Up: RPN Calc
+
+2.1.6 Running Bison to Make the Parser
+--------------------------------------
+
+Before running Bison to produce a parser, we need to decide how to
+arrange all the source code in one or more source files. For such a
+simple example, the easiest thing is to put everything in one file. The
+definitions of `yylex', `yyerror' and `main' go at the end, in the
+epilogue of the file (*note The Overall Layout of a Bison Grammar:
+Grammar Layout.).
+
+ For a large project, you would probably have several source files,
+and use `make' to arrange to recompile them.
+
+ With all the source in a single file, you use the following command
+to convert it into a parser file:
+
+ bison FILE.y
+
+In this example the file was called `rpcalc.y' (for "Reverse Polish
+CALCulator"). Bison produces a file named `FILE.tab.c', removing the
+`.y' from the original file name. The file output by Bison contains
+the source code for `yyparse'. The additional functions in the input
+file (`yylex', `yyerror' and `main') are copied verbatim to the output.
+
+
+File: bison.info, Node: Rpcalc Compile, Prev: Rpcalc Generate, Up: RPN Calc
+
+2.1.7 Compiling the Parser File
+-------------------------------
+
+Here is how to compile and run the parser file:
+
+ # List files in current directory.
+ $ ls
+ rpcalc.tab.c rpcalc.y
+
+ # Compile the Bison parser.
+ # `-lm' tells compiler to search math library for `pow'.
+ $ cc -lm -o rpcalc rpcalc.tab.c
+
+ # List files again.
+ $ ls
+ rpcalc rpcalc.tab.c rpcalc.y
+
+ The file `rpcalc' now contains the executable code. Here is an
+example session using `rpcalc'.
+
+ $ rpcalc
+ 4 9 +
+ 13
+ 3 7 + 3 4 5 *+-
+ -13
+ 3 7 + 3 4 5 * + - n Note the unary minus, `n'
+ 13
+ 5 6 / 4 n +
+ -3.166666667
+ 3 4 ^ Exponentiation
+ 81
+ ^D End-of-file indicator
+ $
+
+
+File: bison.info, Node: Infix Calc, Next: Simple Error Recovery, Prev: RPN Calc, Up: Examples
+
+2.2 Infix Notation Calculator: `calc'
+=====================================
+
+We now modify rpcalc to handle infix operators instead of postfix.
+Infix notation involves the concept of operator precedence and the need
+for parentheses nested to arbitrary depth. Here is the Bison code for
+`calc.y', an infix desk-top calculator.
+
+ /* Infix notation calculator. */
+
+ %{
+ #define YYSTYPE double
+ #include <math.h>
+ #include <stdio.h>
+ int yylex (void);
+ void yyerror (char const *);
+ %}
+
+ /* Bison declarations. */
+ %token NUM
+ %left '-' '+'
+ %left '*' '/'
+ %left NEG /* negation--unary minus */
+ %right '^' /* exponentiation */
+
+ %% /* The grammar follows. */
+ input: /* empty */
+ | input line
+ ;
+
+ line: '\n'
+ | exp '\n' { printf ("\t%.10g\n", $1); }
+ ;
+
+ exp: NUM { $$ = $1; }
+ | exp '+' exp { $$ = $1 + $3; }
+ | exp '-' exp { $$ = $1 - $3; }
+ | exp '*' exp { $$ = $1 * $3; }
+ | exp '/' exp { $$ = $1 / $3; }
+ | '-' exp %prec NEG { $$ = -$2; }
+ | exp '^' exp { $$ = pow ($1, $3); }
+ | '(' exp ')' { $$ = $2; }
+ ;
+ %%
+
+The functions `yylex', `yyerror' and `main' can be the same as before.
+
+ There are two important new features shown in this code.
+
+ In the second section (Bison declarations), `%left' declares token
+types and says they are left-associative operators. The declarations
+`%left' and `%right' (right associativity) take the place of `%token'
+which is used to declare a token type name without associativity.
+(These tokens are single-character literals, which ordinarily don't
+need to be declared. We declare them here to specify the
+associativity.)
+
+ Operator precedence is determined by the line ordering of the
+declarations; the higher the line number of the declaration (lower on
+the page or screen), the higher the precedence. Hence, exponentiation
+has the highest precedence, unary minus (`NEG') is next, followed by
+`*' and `/', and so on. *Note Operator Precedence: Precedence.
+
+ The other important new feature is the `%prec' in the grammar
+section for the unary minus operator. The `%prec' simply instructs
+Bison that the rule `| '-' exp' has the same precedence as `NEG'--in
+this case the next-to-highest. *Note Context-Dependent Precedence:
+Contextual Precedence.
+
+ Here is a sample run of `calc.y':
+
+ $ calc
+ 4 + 4.5 - (34/(8*3+-3))
+ 6.880952381
+ -56 + 2
+ -54
+ 3 ^ 2
+ 9
+
+
+File: bison.info, Node: Simple Error Recovery, Next: Location Tracking Calc, Prev: Infix Calc, Up: Examples
+
+2.3 Simple Error Recovery
+=========================
+
+Up to this point, this manual has not addressed the issue of "error
+recovery"--how to continue parsing after the parser detects a syntax
+error. All we have handled is error reporting with `yyerror'. Recall
+that by default `yyparse' returns after calling `yyerror'. This means
+that an erroneous input line causes the calculator program to exit.
+Now we show how to rectify this deficiency.
+
+ The Bison language itself includes the reserved word `error', which
+may be included in the grammar rules. In the example below it has been
+added to one of the alternatives for `line':
+
+ line: '\n'
+ | exp '\n' { printf ("\t%.10g\n", $1); }
+ | error '\n' { yyerrok; }
+ ;
+
+ This addition to the grammar allows for simple error recovery in the
+event of a syntax error. If an expression that cannot be evaluated is
+read, the error will be recognized by the third rule for `line', and
+parsing will continue. (The `yyerror' function is still called upon to
+print its message as well.) The action executes the statement
+`yyerrok', a macro defined automatically by Bison; its meaning is that
+error recovery is complete (*note Error Recovery::). Note the
+difference between `yyerrok' and `yyerror'; neither one is a misprint.
+
+ This form of error recovery deals with syntax errors. There are
+other kinds of errors; for example, division by zero, which raises an
+exception signal that is normally fatal. A real calculator program
+must handle this signal and use `longjmp' to return to `main' and
+resume parsing input lines; it would also have to discard the rest of
+the current line of input. We won't discuss this issue further because
+it is not specific to Bison programs.
+
+
+File: bison.info, Node: Location Tracking Calc, Next: Multi-function Calc, Prev: Simple Error Recovery, Up: Examples
+
+2.4 Location Tracking Calculator: `ltcalc'
+==========================================
+
+This example extends the infix notation calculator with location
+tracking. This feature will be used to improve the error messages. For
+the sake of clarity, this example is a simple integer calculator, since
+most of the work needed to use locations will be done in the lexical
+analyzer.
+
+* Menu:
+
+* Ltcalc Declarations:: Bison and C declarations for ltcalc.
+* Ltcalc Rules:: Grammar rules for ltcalc, with explanations.
+* Ltcalc Lexer:: The lexical analyzer.
+
+
+File: bison.info, Node: Ltcalc Declarations, Next: Ltcalc Rules, Up: Location Tracking Calc
+
+2.4.1 Declarations for `ltcalc'
+-------------------------------
+
+The C and Bison declarations for the location tracking calculator are
+the same as the declarations for the infix notation calculator.
+
+ /* Location tracking calculator. */
+
+ %{
+ #define YYSTYPE int
+ #include <math.h>
+ int yylex (void);
+ void yyerror (char const *);
+ %}
+
+ /* Bison declarations. */
+ %token NUM
+
+ %left '-' '+'
+ %left '*' '/'
+ %left NEG
+ %right '^'
+
+ %% /* The grammar follows. */
+
+Note there are no declarations specific to locations. Defining a data
+type for storing locations is not needed: we will use the type provided
+by default (*note Data Types of Locations: Location Type.), which is a
+four member structure with the following integer fields: `first_line',
+`first_column', `last_line' and `last_column'. By conventions, and in
+accordance with the GNU Coding Standards and common practice, the line
+and column count both start at 1.
+
+
+File: bison.info, Node: Ltcalc Rules, Next: Ltcalc Lexer, Prev: Ltcalc Declarations, Up: Location Tracking Calc
+
+2.4.2 Grammar Rules for `ltcalc'
+--------------------------------
+
+Whether handling locations or not has no effect on the syntax of your
+language. Therefore, grammar rules for this example will be very close
+to those of the previous example: we will only modify them to benefit
+from the new information.
+
+ Here, we will use locations to report divisions by zero, and locate
+the wrong expressions or subexpressions.
+
+ input : /* empty */
+ | input line
+ ;
+
+ line : '\n'
+ | exp '\n' { printf ("%d\n", $1); }
+ ;
+
+ exp : NUM { $$ = $1; }
+ | exp '+' exp { $$ = $1 + $3; }
+ | exp '-' exp { $$ = $1 - $3; }
+ | exp '*' exp { $$ = $1 * $3; }
+ | exp '/' exp
+ {
+ if ($3)
+ $$ = $1 / $3;
+ else
+ {
+ $$ = 1;
+ fprintf (stderr, "%d.%d-%d.%d: division by zero",
+ @3.first_line, @3.first_column,
+ @3.last_line, @3.last_column);
+ }
+ }
+ | '-' exp %prec NEG { $$ = -$2; }
+ | exp '^' exp { $$ = pow ($1, $3); }
+ | '(' exp ')' { $$ = $2; }
+
+ This code shows how to reach locations inside of semantic actions, by
+using the pseudo-variables `@N' for rule components, and the
+pseudo-variable `@$' for groupings.
+
+ We don't need to assign a value to `@$': the output parser does it
+automatically. By default, before executing the C code of each action,
+`@$' is set to range from the beginning of `@1' to the end of `@N', for
+a rule with N components. This behavior can be redefined (*note
+Default Action for Locations: Location Default Action.), and for very
+specific rules, `@$' can be computed by hand.
+
+
+File: bison.info, Node: Ltcalc Lexer, Prev: Ltcalc Rules, Up: Location Tracking Calc
+
+2.4.3 The `ltcalc' Lexical Analyzer.
+------------------------------------
+
+Until now, we relied on Bison's defaults to enable location tracking.
+The next step is to rewrite the lexical analyzer, and make it able to
+feed the parser with the token locations, as it already does for
+semantic values.
+
+ To this end, we must take into account every single character of the
+input text, to avoid the computed locations of being fuzzy or wrong:
+
+ int
+ yylex (void)
+ {
+ int c;
+
+ /* Skip white space. */
+ while ((c = getchar ()) == ' ' || c == '\t')
+ ++yylloc.last_column;
+
+ /* Step. */
+ yylloc.first_line = yylloc.last_line;
+ yylloc.first_column = yylloc.last_column;
+
+ /* Process numbers. */
+ if (isdigit (c))
+ {
+ yylval = c - '0';
+ ++yylloc.last_column;
+ while (isdigit (c = getchar ()))
+ {
+ ++yylloc.last_column;
+ yylval = yylval * 10 + c - '0';
+ }
+ ungetc (c, stdin);
+ return NUM;
+ }
+
+ /* Return end-of-input. */
+ if (c == EOF)
+ return 0;
+
+ /* Return a single char, and update location. */
+ if (c == '\n')
+ {
+ ++yylloc.last_line;
+ yylloc.last_column = 0;
+ }
+ else
+ ++yylloc.last_column;
+ return c;
+ }
+
+ Basically, the lexical analyzer performs the same processing as
+before: it skips blanks and tabs, and reads numbers or single-character
+tokens. In addition, it updates `yylloc', the global variable (of type
+`YYLTYPE') containing the token's location.
+
+ Now, each time this function returns a token, the parser has its
+number as well as its semantic value, and its location in the text.
+The last needed change is to initialize `yylloc', for example in the
+controlling function:
+
+ int
+ main (void)
+ {
+ yylloc.first_line = yylloc.last_line = 1;
+ yylloc.first_column = yylloc.last_column = 0;
+ return yyparse ();
+ }
+
+ Remember that computing locations is not a matter of syntax. Every
+character must be associated to a location update, whether it is in
+valid input, in comments, in literal strings, and so on.
+
+
+File: bison.info, Node: Multi-function Calc, Next: Exercises, Prev: Location Tracking Calc, Up: Examples
+
+2.5 Multi-Function Calculator: `mfcalc'
+=======================================
+
+Now that the basics of Bison have been discussed, it is time to move on
+to a more advanced problem. The above calculators provided only five
+functions, `+', `-', `*', `/' and `^'. It would be nice to have a
+calculator that provides other mathematical functions such as `sin',
+`cos', etc.
+
+ It is easy to add new operators to the infix calculator as long as
+they are only single-character literals. The lexical analyzer `yylex'
+passes back all nonnumeric characters as tokens, so new grammar rules
+suffice for adding a new operator. But we want something more
+flexible: built-in functions whose syntax has this form:
+
+ FUNCTION_NAME (ARGUMENT)
+
+At the same time, we will add memory to the calculator, by allowing you
+to create named variables, store values in them, and use them later.
+Here is a sample session with the multi-function calculator:
+
+ $ mfcalc
+ pi = 3.141592653589
+ 3.1415926536
+ sin(pi)
+ 0.0000000000
+ alpha = beta1 = 2.3
+ 2.3000000000
+ alpha
+ 2.3000000000
+ ln(alpha)
+ 0.8329091229
+ exp(ln(beta1))
+ 2.3000000000
+ $
+
+ Note that multiple assignment and nested function calls are
+permitted.
+
+* Menu:
+
+* Mfcalc Declarations:: Bison declarations for multi-function calculator.
+* Mfcalc Rules:: Grammar rules for the calculator.
+* Mfcalc Symbol Table:: Symbol table management subroutines.
+
+
+File: bison.info, Node: Mfcalc Declarations, Next: Mfcalc Rules, Up: Multi-function Calc
+
+2.5.1 Declarations for `mfcalc'
+-------------------------------
+
+Here are the C and Bison declarations for the multi-function calculator.
+
+ %{
+ #include <math.h> /* For math functions, cos(), sin(), etc. */
+ #include "calc.h" /* Contains definition of `symrec'. */
+ int yylex (void);
+ void yyerror (char const *);
+ %}
+ %union {
+ double val; /* For returning numbers. */
+ symrec *tptr; /* For returning symbol-table pointers. */
+ }
+ %token <val> NUM /* Simple double precision number. */
+ %token <tptr> VAR FNCT /* Variable and Function. */
+ %type <val> exp
+
+ %right '='
+ %left '-' '+'
+ %left '*' '/'
+ %left NEG /* negation--unary minus */
+ %right '^' /* exponentiation */
+ %% /* The grammar follows. */
+
+ The above grammar introduces only two new features of the Bison
+language. These features allow semantic values to have various data
+types (*note More Than One Value Type: Multiple Types.).
+
+ The `%union' declaration specifies the entire list of possible types;
+this is instead of defining `YYSTYPE'. The allowable types are now
+double-floats (for `exp' and `NUM') and pointers to entries in the
+symbol table. *Note The Collection of Value Types: Union Decl.
+
+ Since values can now have various types, it is necessary to
+associate a type with each grammar symbol whose semantic value is used.
+These symbols are `NUM', `VAR', `FNCT', and `exp'. Their declarations
+are augmented with information about their data type (placed between
+angle brackets).
+
+ The Bison construct `%type' is used for declaring nonterminal
+symbols, just as `%token' is used for declaring token types. We have
+not used `%type' before because nonterminal symbols are normally
+declared implicitly by the rules that define them. But `exp' must be
+declared explicitly so we can specify its value type. *Note
+Nonterminal Symbols: Type Decl.
+
+
+File: bison.info, Node: Mfcalc Rules, Next: Mfcalc Symbol Table, Prev: Mfcalc Declarations, Up: Multi-function Calc
+
+2.5.2 Grammar Rules for `mfcalc'
+--------------------------------
+
+Here are the grammar rules for the multi-function calculator. Most of
+them are copied directly from `calc'; three rules, those which mention
+`VAR' or `FNCT', are new.
+
+ input: /* empty */
+ | input line
+ ;
+
+ line:
+ '\n'
+ | exp '\n' { printf ("\t%.10g\n", $1); }
+ | error '\n' { yyerrok; }
+ ;
+
+ exp: NUM { $$ = $1; }
+ | VAR { $$ = $1->value.var; }
+ | VAR '=' exp { $$ = $3; $1->value.var = $3; }
+ | FNCT '(' exp ')' { $$ = (*($1->value.fnctptr))($3); }
+ | exp '+' exp { $$ = $1 + $3; }
+ | exp '-' exp { $$ = $1 - $3; }
+ | exp '*' exp { $$ = $1 * $3; }
+ | exp '/' exp { $$ = $1 / $3; }
+ | '-' exp %prec NEG { $$ = -$2; }
+ | exp '^' exp { $$ = pow ($1, $3); }
+ | '(' exp ')' { $$ = $2; }
+ ;
+ /* End of grammar. */
+ %%
+
+
+File: bison.info, Node: Mfcalc Symbol Table, Prev: Mfcalc Rules, Up: Multi-function Calc
+
+2.5.3 The `mfcalc' Symbol Table
+-------------------------------
+
+The multi-function calculator requires a symbol table to keep track of
+the names and meanings of variables and functions. This doesn't affect
+the grammar rules (except for the actions) or the Bison declarations,
+but it requires some additional C functions for support.
+
+ The symbol table itself consists of a linked list of records. Its
+definition, which is kept in the header `calc.h', is as follows. It
+provides for either functions or variables to be placed in the table.
+
+ /* Function type. */
+ typedef double (*func_t) (double);
+
+ /* Data type for links in the chain of symbols. */
+ struct symrec
+ {
+ char *name; /* name of symbol */
+ int type; /* type of symbol: either VAR or FNCT */
+ union
+ {
+ double var; /* value of a VAR */
+ func_t fnctptr; /* value of a FNCT */
+ } value;
+ struct symrec *next; /* link field */
+ };
+
+ typedef struct symrec symrec;
+
+ /* The symbol table: a chain of `struct symrec'. */
+ extern symrec *sym_table;
+
+ symrec *putsym (char const *, int);
+ symrec *getsym (char const *);
+
+ The new version of `main' includes a call to `init_table', a
+function that initializes the symbol table. Here it is, and
+`init_table' as well:
+
+ #include <stdio.h>
+
+ /* Called by yyparse on error. */
+ void
+ yyerror (char const *s)
+ {
+ printf ("%s\n", s);
+ }
+
+ struct init
+ {
+ char const *fname;
+ double (*fnct) (double);
+ };
+
+ struct init const arith_fncts[] =
+ {
+ "sin", sin,
+ "cos", cos,
+ "atan", atan,
+ "ln", log,
+ "exp", exp,
+ "sqrt", sqrt,
+ 0, 0
+ };
+
+ /* The symbol table: a chain of `struct symrec'. */
+ symrec *sym_table;
+
+ /* Put arithmetic functions in table. */
+ void
+ init_table (void)
+ {
+ int i;
+ symrec *ptr;
+ for (i = 0; arith_fncts[i].fname != 0; i++)
+ {
+ ptr = putsym (arith_fncts[i].fname, FNCT);
+ ptr->value.fnctptr = arith_fncts[i].fnct;
+ }
+ }
+
+ int
+ main (void)
+ {
+ init_table ();
+ return yyparse ();
+ }
+
+ By simply editing the initialization list and adding the necessary
+include files, you can add additional functions to the calculator.
+
+ Two important functions allow look-up and installation of symbols in
+the symbol table. The function `putsym' is passed a name and the type
+(`VAR' or `FNCT') of the object to be installed. The object is linked
+to the front of the list, and a pointer to the object is returned. The
+function `getsym' is passed the name of the symbol to look up. If
+found, a pointer to that symbol is returned; otherwise zero is returned.
+
+ symrec *
+ putsym (char const *sym_name, int sym_type)
+ {
+ symrec *ptr;
+ ptr = (symrec *) malloc (sizeof (symrec));
+ ptr->name = (char *) malloc (strlen (sym_name) + 1);
+ strcpy (ptr->name,sym_name);
+ ptr->type = sym_type;
+ ptr->value.var = 0; /* Set value to 0 even if fctn. */
+ ptr->next = (struct symrec *)sym_table;
+ sym_table = ptr;
+ return ptr;
+ }
+
+ symrec *
+ getsym (char const *sym_name)
+ {
+ symrec *ptr;
+ for (ptr = sym_table; ptr != (symrec *) 0;
+ ptr = (symrec *)ptr->next)
+ if (strcmp (ptr->name,sym_name) == 0)
+ return ptr;
+ return 0;
+ }
+
+ The function `yylex' must now recognize variables, numeric values,
+and the single-character arithmetic operators. Strings of alphanumeric
+characters with a leading letter are recognized as either variables or
+functions depending on what the symbol table says about them.
+
+ The string is passed to `getsym' for look up in the symbol table. If
+the name appears in the table, a pointer to its location and its type
+(`VAR' or `FNCT') is returned to `yyparse'. If it is not already in
+the table, then it is installed as a `VAR' using `putsym'. Again, a
+pointer and its type (which must be `VAR') is returned to `yyparse'.
+
+ No change is needed in the handling of numeric values and arithmetic
+operators in `yylex'.
+
+ #include <ctype.h>
+
+ int
+ yylex (void)
+ {
+ int c;
+
+ /* Ignore white space, get first nonwhite character. */
+ while ((c = getchar ()) == ' ' || c == '\t');
+
+ if (c == EOF)
+ return 0;
+
+ /* Char starts a number => parse the number. */
+ if (c == '.' || isdigit (c))
+ {
+ ungetc (c, stdin);
+ scanf ("%lf", &yylval.val);
+ return NUM;
+ }
+
+ /* Char starts an identifier => read the name. */
+ if (isalpha (c))
+ {
+ symrec *s;
+ static char *symbuf = 0;
+ static int length = 0;
+ int i;
+
+ /* Initially make the buffer long enough
+ for a 40-character symbol name. */
+ if (length == 0)
+ length = 40, symbuf = (char *)malloc (length + 1);
+
+ i = 0;
+ do
+ {
+ /* If buffer is full, make it bigger. */
+ if (i == length)
+ {
+ length *= 2;
+ symbuf = (char *) realloc (symbuf, length + 1);
+ }
+ /* Add this character to the buffer. */
+ symbuf[i++] = c;
+ /* Get another character. */
+ c = getchar ();
+ }
+ while (isalnum (c));
+
+ ungetc (c, stdin);
+ symbuf[i] = '\0';
+
+ s = getsym (symbuf);
+ if (s == 0)
+ s = putsym (symbuf, VAR);
+ yylval.tptr = s;
+ return s->type;
+ }
+
+ /* Any other character is a token by itself. */
+ return c;
+ }
+
+ This program is both powerful and flexible. You may easily add new
+functions, and it is a simple job to modify this code to install
+predefined variables such as `pi' or `e' as well.
+
+
+File: bison.info, Node: Exercises, Prev: Multi-function Calc, Up: Examples
+
+2.6 Exercises
+=============
+
+ 1. Add some new functions from `math.h' to the initialization list.
+
+ 2. Add another array that contains constants and their values. Then
+ modify `init_table' to add these constants to the symbol table.
+ It will be easiest to give the constants type `VAR'.
+
+ 3. Make the program report an error if the user refers to an
+ uninitialized variable in any way except to store a value in it.
+
+
+File: bison.info, Node: Grammar File, Next: Interface, Prev: Examples, Up: Top
+
+3 Bison Grammar Files
+*********************
+
+Bison takes as input a context-free grammar specification and produces a
+C-language function that recognizes correct instances of the grammar.
+
+ The Bison grammar input file conventionally has a name ending in
+`.y'. *Note Invoking Bison: Invocation.
+
+* Menu:
+
+* Grammar Outline:: Overall layout of the grammar file.
+* Symbols:: Terminal and nonterminal symbols.
+* Rules:: How to write grammar rules.
+* Recursion:: Writing recursive rules.
+* Semantics:: Semantic values and actions.
+* Locations:: Locations and actions.
+* Declarations:: All kinds of Bison declarations are described here.
+* Multiple Parsers:: Putting more than one Bison parser in one program.
+
+
+File: bison.info, Node: Grammar Outline, Next: Symbols, Up: Grammar File
+
+3.1 Outline of a Bison Grammar
+==============================
+
+A Bison grammar file has four main sections, shown here with the
+appropriate delimiters:
+
+ %{
+ PROLOGUE
+ %}
+
+ BISON DECLARATIONS
+
+ %%
+ GRAMMAR RULES
+ %%
+
+ EPILOGUE
+
+ Comments enclosed in `/* ... */' may appear in any of the sections.
+As a GNU extension, `//' introduces a comment that continues until end
+of line.
+
+* Menu:
+
+* Prologue:: Syntax and usage of the prologue.
+* Prologue Alternatives:: Syntax and usage of alternatives to the prologue.
+* Bison Declarations:: Syntax and usage of the Bison declarations section.
+* Grammar Rules:: Syntax and usage of the grammar rules section.
+* Epilogue:: Syntax and usage of the epilogue.
+
+
+File: bison.info, Node: Prologue, Next: Prologue Alternatives, Up: Grammar Outline
+
+3.1.1 The prologue
+------------------
+
+The PROLOGUE section contains macro definitions and declarations of
+functions and variables that are used in the actions in the grammar
+rules. These are copied to the beginning of the parser file so that
+they precede the definition of `yyparse'. You can use `#include' to
+get the declarations from a header file. If you don't need any C
+declarations, you may omit the `%{' and `%}' delimiters that bracket
+this section.
+
+ The PROLOGUE section is terminated by the first occurrence of `%}'
+that is outside a comment, a string literal, or a character constant.
+
+ You may have more than one PROLOGUE section, intermixed with the
+BISON DECLARATIONS. This allows you to have C and Bison declarations
+that refer to each other. For example, the `%union' declaration may
+use types defined in a header file, and you may wish to prototype
+functions that take arguments of type `YYSTYPE'. This can be done with
+two PROLOGUE blocks, one before and one after the `%union' declaration.
+
+ %{
+ #define _GNU_SOURCE
+ #include <stdio.h>
+ #include "ptypes.h"
+ %}
+
+ %union {
+ long int n;
+ tree t; /* `tree' is defined in `ptypes.h'. */
+ }
+
+ %{
+ static void print_token_value (FILE *, int, YYSTYPE);
+ #define YYPRINT(F, N, L) print_token_value (F, N, L)
+ %}
+
+ ...
+
+ When in doubt, it is usually safer to put prologue code before all
+Bison declarations, rather than after. For example, any definitions of
+feature test macros like `_GNU_SOURCE' or `_POSIX_C_SOURCE' should
+appear before all Bison declarations, as feature test macros can affect
+the behavior of Bison-generated `#include' directives.
+
+
+File: bison.info, Node: Prologue Alternatives, Next: Bison Declarations, Prev: Prologue, Up: Grammar Outline
+
+3.1.2 Prologue Alternatives
+---------------------------
+
+(The prologue alternatives described here are experimental. More user
+feedback will help to determine whether they should become permanent
+features.)
+
+ The functionality of PROLOGUE sections can often be subtle and
+inflexible. As an alternative, Bison provides a %code directive with
+an explicit qualifier field, which identifies the purpose of the code
+and thus the location(s) where Bison should generate it. For C/C++,
+the qualifier can be omitted for the default location, or it can be one
+of `requires', `provides', `top'. *Note %code: Decl Summary.
+
+ Look again at the example of the previous section:
+
+ %{
+ #define _GNU_SOURCE
+ #include <stdio.h>
+ #include "ptypes.h"
+ %}
+
+ %union {
+ long int n;
+ tree t; /* `tree' is defined in `ptypes.h'. */
+ }
+
+ %{
+ static void print_token_value (FILE *, int, YYSTYPE);
+ #define YYPRINT(F, N, L) print_token_value (F, N, L)
+ %}
+
+ ...
+
+Notice that there are two PROLOGUE sections here, but there's a subtle
+distinction between their functionality. For example, if you decide to
+override Bison's default definition for `YYLTYPE', in which PROLOGUE
+section should you write your new definition? You should write it in
+the first since Bison will insert that code into the parser source code
+file _before_ the default `YYLTYPE' definition. In which PROLOGUE
+section should you prototype an internal function, `trace_token', that
+accepts `YYLTYPE' and `yytokentype' as arguments? You should prototype
+it in the second since Bison will insert that code _after_ the
+`YYLTYPE' and `yytokentype' definitions.
+
+ This distinction in functionality between the two PROLOGUE sections
+is established by the appearance of the `%union' between them. This
+behavior raises a few questions. First, why should the position of a
+`%union' affect definitions related to `YYLTYPE' and `yytokentype'?
+Second, what if there is no `%union'? In that case, the second kind of
+PROLOGUE section is not available. This behavior is not intuitive.
+
+ To avoid this subtle `%union' dependency, rewrite the example using a
+`%code top' and an unqualified `%code'. Let's go ahead and add the new
+`YYLTYPE' definition and the `trace_token' prototype at the same time:
+
+ %code top {
+ #define _GNU_SOURCE
+ #include <stdio.h>
+
+ /* WARNING: The following code really belongs
+ * in a `%code requires'; see below. */
+
+ #include "ptypes.h"
+ #define YYLTYPE YYLTYPE
+ typedef struct YYLTYPE
+ {
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+ char *filename;
+ } YYLTYPE;
+ }
+
+ %union {
+ long int n;
+ tree t; /* `tree' is defined in `ptypes.h'. */
+ }
+
+ %code {
+ static void print_token_value (FILE *, int, YYSTYPE);
+ #define YYPRINT(F, N, L) print_token_value (F, N, L)
+ static void trace_token (enum yytokentype token, YYLTYPE loc);
+ }
+
+ ...
+
+In this way, `%code top' and the unqualified `%code' achieve the same
+functionality as the two kinds of PROLOGUE sections, but it's always
+explicit which kind you intend. Moreover, both kinds are always
+available even in the absence of `%union'.
+
+ The `%code top' block above logically contains two parts. The first
+two lines before the warning need to appear near the top of the parser
+source code file. The first line after the warning is required by
+`YYSTYPE' and thus also needs to appear in the parser source code file.
+However, if you've instructed Bison to generate a parser header file
+(*note %defines: Decl Summary.), you probably want that line to appear
+before the `YYSTYPE' definition in that header file as well. The
+`YYLTYPE' definition should also appear in the parser header file to
+override the default `YYLTYPE' definition there.
+
+ In other words, in the `%code top' block above, all but the first two
+lines are dependency code required by the `YYSTYPE' and `YYLTYPE'
+definitions. Thus, they belong in one or more `%code requires':
+
+ %code top {
+ #define _GNU_SOURCE
+ #include <stdio.h>
+ }
+
+ %code requires {
+ #include "ptypes.h"
+ }
+ %union {
+ long int n;
+ tree t; /* `tree' is defined in `ptypes.h'. */
+ }
+
+ %code requires {
+ #define YYLTYPE YYLTYPE
+ typedef struct YYLTYPE
+ {
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+ char *filename;
+ } YYLTYPE;
+ }
+
+ %code {
+ static void print_token_value (FILE *, int, YYSTYPE);
+ #define YYPRINT(F, N, L) print_token_value (F, N, L)
+ static void trace_token (enum yytokentype token, YYLTYPE loc);
+ }
+
+ ...
+
+Now Bison will insert `#include "ptypes.h"' and the new `YYLTYPE'
+definition before the Bison-generated `YYSTYPE' and `YYLTYPE'
+definitions in both the parser source code file and the parser header
+file. (By the same reasoning, `%code requires' would also be the
+appropriate place to write your own definition for `YYSTYPE'.)
+
+ When you are writing dependency code for `YYSTYPE' and `YYLTYPE', you
+should prefer `%code requires' over `%code top' regardless of whether
+you instruct Bison to generate a parser header file. When you are
+writing code that you need Bison to insert only into the parser source
+code file and that has no special need to appear at the top of that
+file, you should prefer the unqualified `%code' over `%code top'.
+These practices will make the purpose of each block of your code
+explicit to Bison and to other developers reading your grammar file.
+Following these practices, we expect the unqualified `%code' and `%code
+requires' to be the most important of the four PROLOGUE alternatives.
+
+ At some point while developing your parser, you might decide to
+provide `trace_token' to modules that are external to your parser.
+Thus, you might wish for Bison to insert the prototype into both the
+parser header file and the parser source code file. Since this
+function is not a dependency required by `YYSTYPE' or `YYLTYPE', it
+doesn't make sense to move its prototype to a `%code requires'. More
+importantly, since it depends upon `YYLTYPE' and `yytokentype', `%code
+requires' is not sufficient. Instead, move its prototype from the
+unqualified `%code' to a `%code provides':
+
+ %code top {
+ #define _GNU_SOURCE
+ #include <stdio.h>
+ }
+
+ %code requires {
+ #include "ptypes.h"
+ }
+ %union {
+ long int n;
+ tree t; /* `tree' is defined in `ptypes.h'. */
+ }
+
+ %code requires {
+ #define YYLTYPE YYLTYPE
+ typedef struct YYLTYPE
+ {
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+ char *filename;
+ } YYLTYPE;
+ }
+
+ %code provides {
+ void trace_token (enum yytokentype token, YYLTYPE loc);
+ }
+
+ %code {
+ static void print_token_value (FILE *, int, YYSTYPE);
+ #define YYPRINT(F, N, L) print_token_value (F, N, L)
+ }
+
+ ...
+
+Bison will insert the `trace_token' prototype into both the parser
+header file and the parser source code file after the definitions for
+`yytokentype', `YYLTYPE', and `YYSTYPE'.
+
+ The above examples are careful to write directives in an order that
+reflects the layout of the generated parser source code and header
+files: `%code top', `%code requires', `%code provides', and then
+`%code'. While your grammar files may generally be easier to read if
+you also follow this order, Bison does not require it. Instead, Bison
+lets you choose an organization that makes sense to you.
+
+ You may declare any of these directives multiple times in the
+grammar file. In that case, Bison concatenates the contained code in
+declaration order. This is the only way in which the position of one
+of these directives within the grammar file affects its functionality.
+
+ The result of the previous two properties is greater flexibility in
+how you may organize your grammar file. For example, you may organize
+semantic-type-related directives by semantic type:
+
+ %code requires { #include "type1.h" }
+ %union { type1 field1; }
+ %destructor { type1_free ($$); } <field1>
+ %printer { type1_print ($$); } <field1>
+
+ %code requires { #include "type2.h" }
+ %union { type2 field2; }
+ %destructor { type2_free ($$); } <field2>
+ %printer { type2_print ($$); } <field2>
+
+You could even place each of the above directive groups in the rules
+section of the grammar file next to the set of rules that uses the
+associated semantic type. (In the rules section, you must terminate
+each of those directives with a semicolon.) And you don't have to
+worry that some directive (like a `%union') in the definitions section
+is going to adversely affect their functionality in some
+counter-intuitive manner just because it comes first. Such an
+organization is not possible using PROLOGUE sections.
+
+ This section has been concerned with explaining the advantages of
+the four PROLOGUE alternatives over the original Yacc PROLOGUE.
+However, in most cases when using these directives, you shouldn't need
+to think about all the low-level ordering issues discussed here.
+Instead, you should simply use these directives to label each block of
+your code according to its purpose and let Bison handle the ordering.
+`%code' is the most generic label. Move code to `%code requires',
+`%code provides', or `%code top' as needed.
+
+
+File: bison.info, Node: Bison Declarations, Next: Grammar Rules, Prev: Prologue Alternatives, Up: Grammar Outline
+
+3.1.3 The Bison Declarations Section
+------------------------------------
+
+The BISON DECLARATIONS section contains declarations that define
+terminal and nonterminal symbols, specify precedence, and so on. In
+some simple grammars you may not need any declarations. *Note Bison
+Declarations: Declarations.
+
+
+File: bison.info, Node: Grammar Rules, Next: Epilogue, Prev: Bison Declarations, Up: Grammar Outline
+
+3.1.4 The Grammar Rules Section
+-------------------------------
+
+The "grammar rules" section contains one or more Bison grammar rules,
+and nothing else. *Note Syntax of Grammar Rules: Rules.
+
+ There must always be at least one grammar rule, and the first `%%'
+(which precedes the grammar rules) may never be omitted even if it is
+the first thing in the file.
+
+
+File: bison.info, Node: Epilogue, Prev: Grammar Rules, Up: Grammar Outline
+
+3.1.5 The epilogue
+------------------
+
+The EPILOGUE is copied verbatim to the end of the parser file, just as
+the PROLOGUE is copied to the beginning. This is the most convenient
+place to put anything that you want to have in the parser file but
+which need not come before the definition of `yyparse'. For example,
+the definitions of `yylex' and `yyerror' often go here. Because C
+requires functions to be declared before being used, you often need to
+declare functions like `yylex' and `yyerror' in the Prologue, even if
+you define them in the Epilogue. *Note Parser C-Language Interface:
+Interface.
+
+ If the last section is empty, you may omit the `%%' that separates it
+from the grammar rules.
+
+ The Bison parser itself contains many macros and identifiers whose
+names start with `yy' or `YY', so it is a good idea to avoid using any
+such names (except those documented in this manual) in the epilogue of
+the grammar file.
+
+
+File: bison.info, Node: Symbols, Next: Rules, Prev: Grammar Outline, Up: Grammar File
+
+3.2 Symbols, Terminal and Nonterminal
+=====================================
+
+"Symbols" in Bison grammars represent the grammatical classifications
+of the language.
+
+ A "terminal symbol" (also known as a "token type") represents a
+class of syntactically equivalent tokens. You use the symbol in grammar
+rules to mean that a token in that class is allowed. The symbol is
+represented in the Bison parser by a numeric code, and the `yylex'
+function returns a token type code to indicate what kind of token has
+been read. You don't need to know what the code value is; you can use
+the symbol to stand for it.
+
+ A "nonterminal symbol" stands for a class of syntactically
+equivalent groupings. The symbol name is used in writing grammar rules.
+By convention, it should be all lower case.
+
+ Symbol names can contain letters, digits (not at the beginning),
+underscores and periods. Periods make sense only in nonterminals.
+
+ There are three ways of writing terminal symbols in the grammar:
+
+ * A "named token type" is written with an identifier, like an
+ identifier in C. By convention, it should be all upper case. Each
+ such name must be defined with a Bison declaration such as
+ `%token'. *Note Token Type Names: Token Decl.
+
+ * A "character token type" (or "literal character token") is written
+ in the grammar using the same syntax used in C for character
+ constants; for example, `'+'' is a character token type. A
+ character token type doesn't need to be declared unless you need to
+ specify its semantic value data type (*note Data Types of Semantic
+ Values: Value Type.), associativity, or precedence (*note Operator
+ Precedence: Precedence.).
+
+ By convention, a character token type is used only to represent a
+ token that consists of that particular character. Thus, the token
+ type `'+'' is used to represent the character `+' as a token.
+ Nothing enforces this convention, but if you depart from it, your
+ program will confuse other readers.
+
+ All the usual escape sequences used in character literals in C can
+ be used in Bison as well, but you must not use the null character
+ as a character literal because its numeric code, zero, signifies
+ end-of-input (*note Calling Convention for `yylex': Calling
+ Convention.). Also, unlike standard C, trigraphs have no special
+ meaning in Bison character literals, nor is backslash-newline
+ allowed.
+
+ * A "literal string token" is written like a C string constant; for
+ example, `"<="' is a literal string token. A literal string token
+ doesn't need to be declared unless you need to specify its semantic
+ value data type (*note Value Type::), associativity, or precedence
+ (*note Precedence::).
+
+ You can associate the literal string token with a symbolic name as
+ an alias, using the `%token' declaration (*note Token
+ Declarations: Token Decl.). If you don't do that, the lexical
+ analyzer has to retrieve the token number for the literal string
+ token from the `yytname' table (*note Calling Convention::).
+
+ *Warning*: literal string tokens do not work in Yacc.
+
+ By convention, a literal string token is used only to represent a
+ token that consists of that particular string. Thus, you should
+ use the token type `"<="' to represent the string `<=' as a token.
+ Bison does not enforce this convention, but if you depart from
+ it, people who read your program will be confused.
+
+ All the escape sequences used in string literals in C can be used
+ in Bison as well, except that you must not use a null character
+ within a string literal. Also, unlike Standard C, trigraphs have
+ no special meaning in Bison string literals, nor is
+ backslash-newline allowed. A literal string token must contain
+ two or more characters; for a token containing just one character,
+ use a character token (see above).
+
+ How you choose to write a terminal symbol has no effect on its
+grammatical meaning. That depends only on where it appears in rules and
+on when the parser function returns that symbol.
+
+ The value returned by `yylex' is always one of the terminal symbols,
+except that a zero or negative value signifies end-of-input. Whichever
+way you write the token type in the grammar rules, you write it the
+same way in the definition of `yylex'. The numeric code for a
+character token type is simply the positive numeric code of the
+character, so `yylex' can use the identical value to generate the
+requisite code, though you may need to convert it to `unsigned char' to
+avoid sign-extension on hosts where `char' is signed. Each named token
+type becomes a C macro in the parser file, so `yylex' can use the name
+to stand for the code. (This is why periods don't make sense in
+terminal symbols.) *Note Calling Convention for `yylex': Calling
+Convention.
+
+ If `yylex' is defined in a separate file, you need to arrange for the
+token-type macro definitions to be available there. Use the `-d'
+option when you run Bison, so that it will write these macro definitions
+into a separate header file `NAME.tab.h' which you can include in the
+other source files that need it. *Note Invoking Bison: Invocation.
+
+ If you want to write a grammar that is portable to any Standard C
+host, you must use only nonnull character tokens taken from the basic
+execution character set of Standard C. This set consists of the ten
+digits, the 52 lower- and upper-case English letters, and the
+characters in the following C-language string:
+
+ "\a\b\t\n\v\f\r !\"#%&'()*+,-./:;<=>?[\\]^_{|}~"
+
+ The `yylex' function and Bison must use a consistent character set
+and encoding for character tokens. For example, if you run Bison in an
+ASCII environment, but then compile and run the resulting program in an
+environment that uses an incompatible character set like EBCDIC, the
+resulting program may not work because the tables generated by Bison
+will assume ASCII numeric values for character tokens. It is standard
+practice for software distributions to contain C source files that were
+generated by Bison in an ASCII environment, so installers on platforms
+that are incompatible with ASCII must rebuild those files before
+compiling them.
+
+ The symbol `error' is a terminal symbol reserved for error recovery
+(*note Error Recovery::); you shouldn't use it for any other purpose.
+In particular, `yylex' should never return this value. The default
+value of the error token is 256, unless you explicitly assigned 256 to
+one of your tokens with a `%token' declaration.
+
+
+File: bison.info, Node: Rules, Next: Recursion, Prev: Symbols, Up: Grammar File
+
+3.3 Syntax of Grammar Rules
+===========================
+
+A Bison grammar rule has the following general form:
+
+ RESULT: COMPONENTS...
+ ;
+
+where RESULT is the nonterminal symbol that this rule describes, and
+COMPONENTS are various terminal and nonterminal symbols that are put
+together by this rule (*note Symbols::).
+
+ For example,
+
+ exp: exp '+' exp
+ ;
+
+says that two groupings of type `exp', with a `+' token in between, can
+be combined into a larger grouping of type `exp'.
+
+ White space in rules is significant only to separate symbols. You
+can add extra white space as you wish.
+
+ Scattered among the components can be ACTIONS that determine the
+semantics of the rule. An action looks like this:
+
+ {C STATEMENTS}
+
+This is an example of "braced code", that is, C code surrounded by
+braces, much like a compound statement in C. Braced code can contain
+any sequence of C tokens, so long as its braces are balanced. Bison
+does not check the braced code for correctness directly; it merely
+copies the code to the output file, where the C compiler can check it.
+
+ Within braced code, the balanced-brace count is not affected by
+braces within comments, string literals, or character constants, but it
+is affected by the C digraphs `<%' and `%>' that represent braces. At
+the top level braced code must be terminated by `}' and not by a
+digraph. Bison does not look for trigraphs, so if braced code uses
+trigraphs you should ensure that they do not affect the nesting of
+braces or the boundaries of comments, string literals, or character
+constants.
+
+ Usually there is only one action and it follows the components.
+*Note Actions::.
+
+ Multiple rules for the same RESULT can be written separately or can
+be joined with the vertical-bar character `|' as follows:
+
+ RESULT: RULE1-COMPONENTS...
+ | RULE2-COMPONENTS...
+ ...
+ ;
+
+They are still considered distinct rules even when joined in this way.
+
+ If COMPONENTS in a rule is empty, it means that RESULT can match the
+empty string. For example, here is how to define a comma-separated
+sequence of zero or more `exp' groupings:
+
+ expseq: /* empty */
+ | expseq1
+ ;
+
+ expseq1: exp
+ | expseq1 ',' exp
+ ;
+
+It is customary to write a comment `/* empty */' in each rule with no
+components.
+
+
+File: bison.info, Node: Recursion, Next: Semantics, Prev: Rules, Up: Grammar File
+
+3.4 Recursive Rules
+===================
+
+A rule is called "recursive" when its RESULT nonterminal appears also
+on its right hand side. Nearly all Bison grammars need to use
+recursion, because that is the only way to define a sequence of any
+number of a particular thing. Consider this recursive definition of a
+comma-separated sequence of one or more expressions:
+
+ expseq1: exp
+ | expseq1 ',' exp
+ ;
+
+Since the recursive use of `expseq1' is the leftmost symbol in the
+right hand side, we call this "left recursion". By contrast, here the
+same construct is defined using "right recursion":
+
+ expseq1: exp
+ | exp ',' expseq1
+ ;
+
+Any kind of sequence can be defined using either left recursion or right
+recursion, but you should always use left recursion, because it can
+parse a sequence of any number of elements with bounded stack space.
+Right recursion uses up space on the Bison stack in proportion to the
+number of elements in the sequence, because all the elements must be
+shifted onto the stack before the rule can be applied even once. *Note
+The Bison Parser Algorithm: Algorithm, for further explanation of this.
+
+ "Indirect" or "mutual" recursion occurs when the result of the rule
+does not appear directly on its right hand side, but does appear in
+rules for other nonterminals which do appear on its right hand side.
+
+ For example:
+
+ expr: primary
+ | primary '+' primary
+ ;
+
+ primary: constant
+ | '(' expr ')'
+ ;
+
+defines two mutually-recursive nonterminals, since each refers to the
+other.
+
+
+File: bison.info, Node: Semantics, Next: Locations, Prev: Recursion, Up: Grammar File
+
+3.5 Defining Language Semantics
+===============================
+
+The grammar rules for a language determine only the syntax. The
+semantics are determined by the semantic values associated with various
+tokens and groupings, and by the actions taken when various groupings
+are recognized.
+
+ For example, the calculator calculates properly because the value
+associated with each expression is the proper number; it adds properly
+because the action for the grouping `X + Y' is to add the numbers
+associated with X and Y.
+
+* Menu:
+
+* Value Type:: Specifying one data type for all semantic values.
+* Multiple Types:: Specifying several alternative data types.
+* Actions:: An action is the semantic definition of a grammar rule.
+* Action Types:: Specifying data types for actions to operate on.
+* Mid-Rule Actions:: Most actions go at the end of a rule.
+ This says when, why and how to use the exceptional
+ action in the middle of a rule.
+
+
+File: bison.info, Node: Value Type, Next: Multiple Types, Up: Semantics
+
+3.5.1 Data Types of Semantic Values
+-----------------------------------
+
+In a simple program it may be sufficient to use the same data type for
+the semantic values of all language constructs. This was true in the
+RPN and infix calculator examples (*note Reverse Polish Notation
+Calculator: RPN Calc.).
+
+ Bison normally uses the type `int' for semantic values if your
+program uses the same data type for all language constructs. To
+specify some other type, define `YYSTYPE' as a macro, like this:
+
+ #define YYSTYPE double
+
+`YYSTYPE''s replacement list should be a type name that does not
+contain parentheses or square brackets. This macro definition must go
+in the prologue of the grammar file (*note Outline of a Bison Grammar:
+Grammar Outline.).
+
+
+File: bison.info, Node: Multiple Types, Next: Actions, Prev: Value Type, Up: Semantics
+
+3.5.2 More Than One Value Type
+------------------------------
+
+In most programs, you will need different data types for different kinds
+of tokens and groupings. For example, a numeric constant may need type
+`int' or `long int', while a string constant needs type `char *', and
+an identifier might need a pointer to an entry in the symbol table.
+
+ To use more than one data type for semantic values in one parser,
+Bison requires you to do two things:
+
+ * Specify the entire collection of possible data types, either by
+ using the `%union' Bison declaration (*note The Collection of
+ Value Types: Union Decl.), or by using a `typedef' or a `#define'
+ to define `YYSTYPE' to be a union type whose member names are the
+ type tags.
+
+ * Choose one of those types for each symbol (terminal or
+ nonterminal) for which semantic values are used. This is done for
+ tokens with the `%token' Bison declaration (*note Token Type
+ Names: Token Decl.) and for groupings with the `%type' Bison
+ declaration (*note Nonterminal Symbols: Type Decl.).
+
+
+File: bison.info, Node: Actions, Next: Action Types, Prev: Multiple Types, Up: Semantics
+
+3.5.3 Actions
+-------------
+
+An action accompanies a syntactic rule and contains C code to be
+executed each time an instance of that rule is recognized. The task of
+most actions is to compute a semantic value for the grouping built by
+the rule from the semantic values associated with tokens or smaller
+groupings.
+
+ An action consists of braced code containing C statements, and can be
+placed at any position in the rule; it is executed at that position.
+Most rules have just one action at the end of the rule, following all
+the components. Actions in the middle of a rule are tricky and used
+only for special purposes (*note Actions in Mid-Rule: Mid-Rule
+Actions.).
+
+ The C code in an action can refer to the semantic values of the
+components matched by the rule with the construct `$N', which stands for
+the value of the Nth component. The semantic value for the grouping
+being constructed is `$$'. Bison translates both of these constructs
+into expressions of the appropriate type when it copies the actions
+into the parser file. `$$' is translated to a modifiable lvalue, so it
+can be assigned to.
+
+ Here is a typical example:
+
+ exp: ...
+ | exp '+' exp
+ { $$ = $1 + $3; }
+
+This rule constructs an `exp' from two smaller `exp' groupings
+connected by a plus-sign token. In the action, `$1' and `$3' refer to
+the semantic values of the two component `exp' groupings, which are the
+first and third symbols on the right hand side of the rule. The sum is
+stored into `$$' so that it becomes the semantic value of the
+addition-expression just recognized by the rule. If there were a
+useful semantic value associated with the `+' token, it could be
+referred to as `$2'.
+
+ Note that the vertical-bar character `|' is really a rule separator,
+and actions are attached to a single rule. This is a difference with
+tools like Flex, for which `|' stands for either "or", or "the same
+action as that of the next rule". In the following example, the action
+is triggered only when `b' is found:
+
+ a-or-b: 'a'|'b' { a_or_b_found = 1; };
+
+ If you don't specify an action for a rule, Bison supplies a default:
+`$$ = $1'. Thus, the value of the first symbol in the rule becomes the
+value of the whole rule. Of course, the default action is valid only
+if the two data types match. There is no meaningful default action for
+an empty rule; every empty rule must have an explicit action unless the
+rule's value does not matter.
+
+ `$N' with N zero or negative is allowed for reference to tokens and
+groupings on the stack _before_ those that match the current rule.
+This is a very risky practice, and to use it reliably you must be
+certain of the context in which the rule is applied. Here is a case in
+which you can use this reliably:
+
+ foo: expr bar '+' expr { ... }
+ | expr bar '-' expr { ... }
+ ;
+
+ bar: /* empty */
+ { previous_expr = $0; }
+ ;
+
+ As long as `bar' is used only in the fashion shown here, `$0' always
+refers to the `expr' which precedes `bar' in the definition of `foo'.
+
+ It is also possible to access the semantic value of the lookahead
+token, if any, from a semantic action. This semantic value is stored
+in `yylval'. *Note Special Features for Use in Actions: Action
+Features.
+
+
+File: bison.info, Node: Action Types, Next: Mid-Rule Actions, Prev: Actions, Up: Semantics
+
+3.5.4 Data Types of Values in Actions
+-------------------------------------
+
+If you have chosen a single data type for semantic values, the `$$' and
+`$N' constructs always have that data type.
+
+ If you have used `%union' to specify a variety of data types, then
+you must declare a choice among these types for each terminal or
+nonterminal symbol that can have a semantic value. Then each time you
+use `$$' or `$N', its data type is determined by which symbol it refers
+to in the rule. In this example,
+
+ exp: ...
+ | exp '+' exp
+ { $$ = $1 + $3; }
+
+`$1' and `$3' refer to instances of `exp', so they all have the data
+type declared for the nonterminal symbol `exp'. If `$2' were used, it
+would have the data type declared for the terminal symbol `'+'',
+whatever that might be.
+
+ Alternatively, you can specify the data type when you refer to the
+value, by inserting `<TYPE>' after the `$' at the beginning of the
+reference. For example, if you have defined types as shown here:
+
+ %union {
+ int itype;
+ double dtype;
+ }
+
+then you can write `$<itype>1' to refer to the first subunit of the
+rule as an integer, or `$<dtype>1' to refer to it as a double.
+
+
+File: bison.info, Node: Mid-Rule Actions, Prev: Action Types, Up: Semantics
+
+3.5.5 Actions in Mid-Rule
+-------------------------
+
+Occasionally it is useful to put an action in the middle of a rule.
+These actions are written just like usual end-of-rule actions, but they
+are executed before the parser even recognizes the following components.
+
+ A mid-rule action may refer to the components preceding it using
+`$N', but it may not refer to subsequent components because it is run
+before they are parsed.
+
+ The mid-rule action itself counts as one of the components of the
+rule. This makes a difference when there is another action later in
+the same rule (and usually there is another at the end): you have to
+count the actions along with the symbols when working out which number
+N to use in `$N'.
+
+ The mid-rule action can also have a semantic value. The action can
+set its value with an assignment to `$$', and actions later in the rule
+can refer to the value using `$N'. Since there is no symbol to name
+the action, there is no way to declare a data type for the value in
+advance, so you must use the `$<...>N' construct to specify a data type
+each time you refer to this value.
+
+ There is no way to set the value of the entire rule with a mid-rule
+action, because assignments to `$$' do not have that effect. The only
+way to set the value for the entire rule is with an ordinary action at
+the end of the rule.
+
+ Here is an example from a hypothetical compiler, handling a `let'
+statement that looks like `let (VARIABLE) STATEMENT' and serves to
+create a variable named VARIABLE temporarily for the duration of
+STATEMENT. To parse this construct, we must put VARIABLE into the
+symbol table while STATEMENT is parsed, then remove it afterward. Here
+is how it is done:
+
+ stmt: LET '(' var ')'
+ { $<context>$ = push_context ();
+ declare_variable ($3); }
+ stmt { $$ = $6;
+ pop_context ($<context>5); }
+
+As soon as `let (VARIABLE)' has been recognized, the first action is
+run. It saves a copy of the current semantic context (the list of
+accessible variables) as its semantic value, using alternative
+`context' in the data-type union. Then it calls `declare_variable' to
+add the new variable to that list. Once the first action is finished,
+the embedded statement `stmt' can be parsed. Note that the mid-rule
+action is component number 5, so the `stmt' is component number 6.
+
+ After the embedded statement is parsed, its semantic value becomes
+the value of the entire `let'-statement. Then the semantic value from
+the earlier action is used to restore the prior list of variables. This
+removes the temporary `let'-variable from the list so that it won't
+appear to exist while the rest of the program is parsed.
+
+ In the above example, if the parser initiates error recovery (*note
+Error Recovery::) while parsing the tokens in the embedded statement
+`stmt', it might discard the previous semantic context `$<context>5'
+without restoring it. Thus, `$<context>5' needs a destructor (*note
+Freeing Discarded Symbols: Destructor Decl.). However, Bison currently
+provides no means to declare a destructor specific to a particular
+mid-rule action's semantic value.
+
+ One solution is to bury the mid-rule action inside a nonterminal
+symbol and to declare a destructor for that symbol:
+
+ %type <context> let
+ %destructor { pop_context ($$); } let
+
+ %%
+
+ stmt: let stmt
+ { $$ = $2;
+ pop_context ($1); }
+ ;
+
+ let: LET '(' var ')'
+ { $$ = push_context ();
+ declare_variable ($3); }
+ ;
+
+Note that the action is now at the end of its rule. Any mid-rule
+action can be converted to an end-of-rule action in this way, and this
+is what Bison actually does to implement mid-rule actions.
+
+ Taking action before a rule is completely recognized often leads to
+conflicts since the parser must commit to a parse in order to execute
+the action. For example, the following two rules, without mid-rule
+actions, can coexist in a working parser because the parser can shift
+the open-brace token and look at what follows before deciding whether
+there is a declaration or not:
+
+ compound: '{' declarations statements '}'
+ | '{' statements '}'
+ ;
+
+But when we add a mid-rule action as follows, the rules become
+nonfunctional:
+
+ compound: { prepare_for_local_variables (); }
+ '{' declarations statements '}'
+ | '{' statements '}'
+ ;
+
+Now the parser is forced to decide whether to run the mid-rule action
+when it has read no farther than the open-brace. In other words, it
+must commit to using one rule or the other, without sufficient
+information to do it correctly. (The open-brace token is what is called
+the "lookahead" token at this time, since the parser is still deciding
+what to do about it. *Note Lookahead Tokens: Lookahead.)
+
+ You might think that you could correct the problem by putting
+identical actions into the two rules, like this:
+
+ compound: { prepare_for_local_variables (); }
+ '{' declarations statements '}'
+ | { prepare_for_local_variables (); }
+ '{' statements '}'
+ ;
+
+But this does not help, because Bison does not realize that the two
+actions are identical. (Bison never tries to understand the C code in
+an action.)
+
+ If the grammar is such that a declaration can be distinguished from a
+statement by the first token (which is true in C), then one solution
+which does work is to put the action after the open-brace, like this:
+
+ compound: '{' { prepare_for_local_variables (); }
+ declarations statements '}'
+ | '{' statements '}'
+ ;
+
+Now the first token of the following declaration or statement, which
+would in any case tell Bison which rule to use, can still do so.
+
+ Another solution is to bury the action inside a nonterminal symbol
+which serves as a subroutine:
+
+ subroutine: /* empty */
+ { prepare_for_local_variables (); }
+ ;
+
+ compound: subroutine
+ '{' declarations statements '}'
+ | subroutine
+ '{' statements '}'
+ ;
+
+Now Bison can execute the action in the rule for `subroutine' without
+deciding which rule for `compound' it will eventually use.
+
+
+File: bison.info, Node: Locations, Next: Declarations, Prev: Semantics, Up: Grammar File
+
+3.6 Tracking Locations
+======================
+
+Though grammar rules and semantic actions are enough to write a fully
+functional parser, it can be useful to process some additional
+information, especially symbol locations.
+
+ The way locations are handled is defined by providing a data type,
+and actions to take when rules are matched.
+
+* Menu:
+
+* Location Type:: Specifying a data type for locations.
+* Actions and Locations:: Using locations in actions.
+* Location Default Action:: Defining a general way to compute locations.
+
+
+File: bison.info, Node: Location Type, Next: Actions and Locations, Up: Locations
+
+3.6.1 Data Type of Locations
+----------------------------
+
+Defining a data type for locations is much simpler than for semantic
+values, since all tokens and groupings always use the same type.
+
+ You can specify the type of locations by defining a macro called
+`YYLTYPE', just as you can specify the semantic value type by defining
+a `YYSTYPE' macro (*note Value Type::). When `YYLTYPE' is not defined,
+Bison uses a default structure type with four members:
+
+ typedef struct YYLTYPE
+ {
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+ } YYLTYPE;
+
+ At the beginning of the parsing, Bison initializes all these fields
+to 1 for `yylloc'.
+
+
+File: bison.info, Node: Actions and Locations, Next: Location Default Action, Prev: Location Type, Up: Locations
+
+3.6.2 Actions and Locations
+---------------------------
+
+Actions are not only useful for defining language semantics, but also
+for describing the behavior of the output parser with locations.
+
+ The most obvious way for building locations of syntactic groupings
+is very similar to the way semantic values are computed. In a given
+rule, several constructs can be used to access the locations of the
+elements being matched. The location of the Nth component of the right
+hand side is `@N', while the location of the left hand side grouping is
+`@$'.
+
+ Here is a basic example using the default data type for locations:
+
+ exp: ...
+ | exp '/' exp
+ {
+ @$.first_column = @1.first_column;
+ @$.first_line = @1.first_line;
+ @$.last_column = @3.last_column;
+ @$.last_line = @3.last_line;
+ if ($3)
+ $$ = $1 / $3;
+ else
+ {
+ $$ = 1;
+ fprintf (stderr,
+ "Division by zero, l%d,c%d-l%d,c%d",
+ @3.first_line, @3.first_column,
+ @3.last_line, @3.last_column);
+ }
+ }
+
+ As for semantic values, there is a default action for locations that
+is run each time a rule is matched. It sets the beginning of `@$' to
+the beginning of the first symbol, and the end of `@$' to the end of the
+last symbol.
+
+ With this default action, the location tracking can be fully
+automatic. The example above simply rewrites this way:
+
+ exp: ...
+ | exp '/' exp
+ {
+ if ($3)
+ $$ = $1 / $3;
+ else
+ {
+ $$ = 1;
+ fprintf (stderr,
+ "Division by zero, l%d,c%d-l%d,c%d",
+ @3.first_line, @3.first_column,
+ @3.last_line, @3.last_column);
+ }
+ }
+
+ It is also possible to access the location of the lookahead token,
+if any, from a semantic action. This location is stored in `yylloc'.
+*Note Special Features for Use in Actions: Action Features.
+
+
+File: bison.info, Node: Location Default Action, Prev: Actions and Locations, Up: Locations
+
+3.6.3 Default Action for Locations
+----------------------------------
+
+Actually, actions are not the best place to compute locations. Since
+locations are much more general than semantic values, there is room in
+the output parser to redefine the default action to take for each rule.
+The `YYLLOC_DEFAULT' macro is invoked each time a rule is matched,
+before the associated action is run. It is also invoked while
+processing a syntax error, to compute the error's location. Before
+reporting an unresolvable syntactic ambiguity, a GLR parser invokes
+`YYLLOC_DEFAULT' recursively to compute the location of that ambiguity.
+
+ Most of the time, this macro is general enough to suppress location
+dedicated code from semantic actions.
+
+ The `YYLLOC_DEFAULT' macro takes three parameters. The first one is
+the location of the grouping (the result of the computation). When a
+rule is matched, the second parameter identifies locations of all right
+hand side elements of the rule being matched, and the third parameter
+is the size of the rule's right hand side. When a GLR parser reports
+an ambiguity, which of multiple candidate right hand sides it passes to
+`YYLLOC_DEFAULT' is undefined. When processing a syntax error, the
+second parameter identifies locations of the symbols that were
+discarded during error processing, and the third parameter is the
+number of discarded symbols.
+
+ By default, `YYLLOC_DEFAULT' is defined this way:
+
+ # 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)
+
+ where `YYRHSLOC (rhs, k)' is the location of the Kth symbol in RHS
+when K is positive, and the location of the symbol just before the
+reduction when K and N are both zero.
+
+ When defining `YYLLOC_DEFAULT', you should consider that:
+
+ * All arguments are free of side-effects. However, only the first
+ one (the result) should be modified by `YYLLOC_DEFAULT'.
+
+ * For consistency with semantic actions, valid indexes within the
+ right hand side range from 1 to N. When N is zero, only 0 is a
+ valid index, and it refers to the symbol just before the reduction.
+ During error processing N is always positive.
+
+ * Your macro should parenthesize its arguments, if need be, since the
+ actual arguments may not be surrounded by parentheses. Also, your
+ macro should expand to something that can be used as a single
+ statement when it is followed by a semicolon.
+
+
+File: bison.info, Node: Declarations, Next: Multiple Parsers, Prev: Locations, Up: Grammar File
+
+3.7 Bison Declarations
+======================
+
+The "Bison declarations" section of a Bison grammar defines the symbols
+used in formulating the grammar and the data types of semantic values.
+*Note Symbols::.
+
+ All token type names (but not single-character literal tokens such as
+`'+'' and `'*'') must be declared. Nonterminal symbols must be
+declared if you need to specify which data type to use for the semantic
+value (*note More Than One Value Type: Multiple Types.).
+
+ The first rule in the file also specifies the start symbol, by
+default. If you want some other symbol to be the start symbol, you
+must declare it explicitly (*note Languages and Context-Free Grammars:
+Language and Grammar.).
+
+* Menu:
+
+* Require Decl:: Requiring a Bison version.
+* Token Decl:: Declaring terminal symbols.
+* Precedence Decl:: Declaring terminals with precedence and associativity.
+* Union Decl:: Declaring the set of all semantic value types.
+* Type Decl:: Declaring the choice of type for a nonterminal symbol.
+* Initial Action Decl:: Code run before parsing starts.
+* Destructor Decl:: Declaring how symbols are freed.
+* Expect Decl:: Suppressing warnings about parsing conflicts.
+* Start Decl:: Specifying the start symbol.
+* Pure Decl:: Requesting a reentrant parser.
+* Push Decl:: Requesting a push parser.
+* Decl Summary:: Table of all Bison declarations.
+
+
+File: bison.info, Node: Require Decl, Next: Token Decl, Up: Declarations
+
+3.7.1 Require a Version of Bison
+--------------------------------
+
+You may require the minimum version of Bison to process the grammar. If
+the requirement is not met, `bison' exits with an error (exit status
+63).
+
+ %require "VERSION"
+
+
+File: bison.info, Node: Token Decl, Next: Precedence Decl, Prev: Require Decl, Up: Declarations
+
+3.7.2 Token Type Names
+----------------------
+
+The basic way to declare a token type name (terminal symbol) is as
+follows:
+
+ %token NAME
+
+ Bison will convert this into a `#define' directive in the parser, so
+that the function `yylex' (if it is in this file) can use the name NAME
+to stand for this token type's code.
+
+ Alternatively, you can use `%left', `%right', or `%nonassoc' instead
+of `%token', if you wish to specify associativity and precedence.
+*Note Operator Precedence: Precedence Decl.
+
+ You can explicitly specify the numeric code for a token type by
+appending a nonnegative decimal or hexadecimal integer value in the
+field immediately following the token name:
+
+ %token NUM 300
+ %token XNUM 0x12d // a GNU extension
+
+It is generally best, however, to let Bison choose the numeric codes for
+all token types. Bison will automatically select codes that don't
+conflict with each other or with normal characters.
+
+ In the event that the stack type is a union, you must augment the
+`%token' or other token declaration to include the data type
+alternative delimited by angle-brackets (*note More Than One Value
+Type: Multiple Types.).
+
+ For example:
+
+ %union { /* define stack type */
+ double val;
+ symrec *tptr;
+ }
+ %token <val> NUM /* define token NUM and its type */
+
+ You can associate a literal string token with a token type name by
+writing the literal string at the end of a `%token' declaration which
+declares the name. For example:
+
+ %token arrow "=>"
+
+For example, a grammar for the C language might specify these names with
+equivalent literal string tokens:
+
+ %token <operator> OR "||"
+ %token <operator> LE 134 "<="
+ %left OR "<="
+
+Once you equate the literal string and the token name, you can use them
+interchangeably in further declarations or the grammar rules. The
+`yylex' function can use the token name or the literal string to obtain
+the token type code number (*note Calling Convention::). Syntax error
+messages passed to `yyerror' from the parser will reference the literal
+string instead of the token name.
+
+ The token numbered as 0 corresponds to end of file; the following
+line allows for nicer error messages referring to "end of file" instead
+of "$end":
+
+ %token END 0 "end of file"
+
+
+File: bison.info, Node: Precedence Decl, Next: Union Decl, Prev: Token Decl, Up: Declarations
+
+3.7.3 Operator Precedence
+-------------------------
+
+Use the `%left', `%right' or `%nonassoc' declaration to declare a token
+and specify its precedence and associativity, all at once. These are
+called "precedence declarations". *Note Operator Precedence:
+Precedence, for general information on operator precedence.
+
+ The syntax of a precedence declaration is nearly the same as that of
+`%token': either
+
+ %left SYMBOLS...
+
+or
+
+ %left <TYPE> SYMBOLS...
+
+ And indeed any of these declarations serves the purposes of `%token'.
+But in addition, they specify the associativity and relative precedence
+for all the SYMBOLS:
+
+ * The associativity of an operator OP determines how repeated uses
+ of the operator nest: whether `X OP Y OP Z' is parsed by grouping
+ X with Y first or by grouping Y with Z first. `%left' specifies
+ left-associativity (grouping X with Y first) and `%right'
+ specifies right-associativity (grouping Y with Z first).
+ `%nonassoc' specifies no associativity, which means that `X OP Y
+ OP Z' is considered a syntax error.
+
+ * The precedence of an operator determines how it nests with other
+ operators. All the tokens declared in a single precedence
+ declaration have equal precedence and nest together according to
+ their associativity. When two tokens declared in different
+ precedence declarations associate, the one declared later has the
+ higher precedence and is grouped first.
+
+ For backward compatibility, there is a confusing difference between
+the argument lists of `%token' and precedence declarations. Only a
+`%token' can associate a literal string with a token type name. A
+precedence declaration always interprets a literal string as a
+reference to a separate token. For example:
+
+ %left OR "<=" // Does not declare an alias.
+ %left OR 134 "<=" 135 // Declares 134 for OR and 135 for "<=".
+
+
+File: bison.info, Node: Union Decl, Next: Type Decl, Prev: Precedence Decl, Up: Declarations
+
+3.7.4 The Collection of Value Types
+-----------------------------------
+
+The `%union' declaration specifies the entire collection of possible
+data types for semantic values. The keyword `%union' is followed by
+braced code containing the same thing that goes inside a `union' in C.
+
+ For example:
+
+ %union {
+ double val;
+ symrec *tptr;
+ }
+
+This says that the two alternative types are `double' and `symrec *'.
+They are given names `val' and `tptr'; these names are used in the
+`%token' and `%type' declarations to pick one of the types for a
+terminal or nonterminal symbol (*note Nonterminal Symbols: Type Decl.).
+
+ As an extension to POSIX, a tag is allowed after the `union'. For
+example:
+
+ %union value {
+ double val;
+ symrec *tptr;
+ }
+
+specifies the union tag `value', so the corresponding C type is `union
+value'. If you do not specify a tag, it defaults to `YYSTYPE'.
+
+ As another extension to POSIX, you may specify multiple `%union'
+declarations; their contents are concatenated. However, only the first
+`%union' declaration can specify a tag.
+
+ Note that, unlike making a `union' declaration in C, you need not
+write a semicolon after the closing brace.
+
+ Instead of `%union', you can define and use your own union type
+`YYSTYPE' if your grammar contains at least one `<TYPE>' tag. For
+example, you can put the following into a header file `parser.h':
+
+ union YYSTYPE {
+ double val;
+ symrec *tptr;
+ };
+ typedef union YYSTYPE YYSTYPE;
+
+and then your grammar can use the following instead of `%union':
+
+ %{
+ #include "parser.h"
+ %}
+ %type <val> expr
+ %token <tptr> ID
+
+
+File: bison.info, Node: Type Decl, Next: Initial Action Decl, Prev: Union Decl, Up: Declarations
+
+3.7.5 Nonterminal Symbols
+-------------------------
+
+When you use `%union' to specify multiple value types, you must declare
+the value type of each nonterminal symbol for which values are used.
+This is done with a `%type' declaration, like this:
+
+ %type <TYPE> NONTERMINAL...
+
+Here NONTERMINAL is the name of a nonterminal symbol, and TYPE is the
+name given in the `%union' to the alternative that you want (*note The
+Collection of Value Types: Union Decl.). You can give any number of
+nonterminal symbols in the same `%type' declaration, if they have the
+same value type. Use spaces to separate the symbol names.
+
+ You can also declare the value type of a terminal symbol. To do
+this, use the same `<TYPE>' construction in a declaration for the
+terminal symbol. All kinds of token declarations allow `<TYPE>'.
+
+
+File: bison.info, Node: Initial Action Decl, Next: Destructor Decl, Prev: Type Decl, Up: Declarations
+
+3.7.6 Performing Actions before Parsing
+---------------------------------------
+
+Sometimes your parser needs to perform some initializations before
+parsing. The `%initial-action' directive allows for such arbitrary
+code.
+
+ -- Directive: %initial-action { CODE }
+ Declare that the braced CODE must be invoked before parsing each
+ time `yyparse' is called. The CODE may use `$$' and `@$' --
+ initial value and location of the lookahead -- and the
+ `%parse-param'.
+
+ For instance, if your locations use a file name, you may use
+
+ %parse-param { char const *file_name };
+ %initial-action
+ {
+ @$.initialize (file_name);
+ };
+
+
+File: bison.info, Node: Destructor Decl, Next: Expect Decl, Prev: Initial Action Decl, Up: Declarations
+
+3.7.7 Freeing Discarded Symbols
+-------------------------------
+
+During error recovery (*note Error Recovery::), symbols already pushed
+on the stack and tokens coming from the rest of the file are discarded
+until the parser falls on its feet. If the parser runs out of memory,
+or if it returns via `YYABORT' or `YYACCEPT', all the symbols on the
+stack must be discarded. Even if the parser succeeds, it must discard
+the start symbol.
+
+ When discarded symbols convey heap based information, this memory is
+lost. While this behavior can be tolerable for batch parsers, such as
+in traditional compilers, it is unacceptable for programs like shells or
+protocol implementations that may parse and execute indefinitely.
+
+ The `%destructor' directive defines code that is called when a
+symbol is automatically discarded.
+
+ -- Directive: %destructor { CODE } SYMBOLS
+ Invoke the braced CODE whenever the parser discards one of the
+ SYMBOLS. Within CODE, `$$' designates the semantic value
+ associated with the discarded symbol, and `@$' designates its
+ location. The additional parser parameters are also available
+ (*note The Parser Function `yyparse': Parser Function.).
+
+ When a symbol is listed among SYMBOLS, its `%destructor' is called
+ a per-symbol `%destructor'. You may also define a per-type
+ `%destructor' by listing a semantic type tag among SYMBOLS. In
+ that case, the parser will invoke this CODE whenever it discards
+ any grammar symbol that has that semantic type tag unless that
+ symbol has its own per-symbol `%destructor'.
+
+ Finally, you can define two different kinds of default
+ `%destructor's. (These default forms are experimental. More user
+ feedback will help to determine whether they should become
+ permanent features.) You can place each of `<*>' and `<>' in the
+ SYMBOLS list of exactly one `%destructor' declaration in your
+ grammar file. The parser will invoke the CODE associated with one
+ of these whenever it discards any user-defined grammar symbol that
+ has no per-symbol and no per-type `%destructor'. The parser uses
+ the CODE for `<*>' in the case of such a grammar symbol for which
+ you have formally declared a semantic type tag (`%type' counts as
+ such a declaration, but `$<tag>$' does not). The parser uses the
+ CODE for `<>' in the case of such a grammar symbol that has no
+ declared semantic type tag.
+
+For example:
+
+ %union { char *string; }
+ %token <string> STRING1
+ %token <string> STRING2
+ %type <string> string1
+ %type <string> string2
+ %union { char character; }
+ %token <character> CHR
+ %type <character> chr
+ %token TAGLESS
+
+ %destructor { } <character>
+ %destructor { free ($$); } <*>
+ %destructor { free ($$); printf ("%d", @$.first_line); } STRING1 string1
+ %destructor { printf ("Discarding tagless symbol.\n"); } <>
+
+guarantees that, when the parser discards any user-defined symbol that
+has a semantic type tag other than `<character>', it passes its
+semantic value to `free' by default. However, when the parser discards
+a `STRING1' or a `string1', it also prints its line number to `stdout'.
+It performs only the second `%destructor' in this case, so it invokes
+`free' only once. Finally, the parser merely prints a message whenever
+it discards any symbol, such as `TAGLESS', that has no semantic type
+tag.
+
+ A Bison-generated parser invokes the default `%destructor's only for
+user-defined as opposed to Bison-defined symbols. For example, the
+parser will not invoke either kind of default `%destructor' for the
+special Bison-defined symbols `$accept', `$undefined', or `$end' (*note
+Bison Symbols: Table of Symbols.), none of which you can reference in
+your grammar. It also will not invoke either for the `error' token
+(*note error: Table of Symbols.), which is always defined by Bison
+regardless of whether you reference it in your grammar. However, it
+may invoke one of them for the end token (token 0) if you redefine it
+from `$end' to, for example, `END':
+
+ %token END 0
+
+ Finally, Bison will never invoke a `%destructor' for an unreferenced
+mid-rule semantic value (*note Actions in Mid-Rule: Mid-Rule Actions.).
+That is, Bison does not consider a mid-rule to have a semantic value if
+you do not reference `$$' in the mid-rule's action or `$N' (where N is
+the RHS symbol position of the mid-rule) in any later action in that
+rule. However, if you do reference either, the Bison-generated parser
+will invoke the `<>' `%destructor' whenever it discards the mid-rule
+symbol.
+
+
+ "Discarded symbols" are the following:
+
+ * stacked symbols popped during the first phase of error recovery,
+
+ * incoming terminals during the second phase of error recovery,
+
+ * the current lookahead and the entire stack (except the current
+ right-hand side symbols) when the parser returns immediately, and
+
+ * the start symbol, when the parser succeeds.
+
+ The parser can "return immediately" because of an explicit call to
+`YYABORT' or `YYACCEPT', or failed error recovery, or memory exhaustion.
+
+ Right-hand side symbols of a rule that explicitly triggers a syntax
+error via `YYERROR' are not discarded automatically. As a rule of
+thumb, destructors are invoked only when user actions cannot manage the
+memory.
+
+
+File: bison.info, Node: Expect Decl, Next: Start Decl, Prev: Destructor Decl, Up: Declarations
+
+3.7.8 Suppressing Conflict Warnings
+-----------------------------------
+
+Bison normally warns if there are any conflicts in the grammar (*note
+Shift/Reduce Conflicts: Shift/Reduce.), but most real grammars have
+harmless shift/reduce conflicts which are resolved in a predictable way
+and would be difficult to eliminate. It is desirable to suppress the
+warning about these conflicts unless the number of conflicts changes.
+You can do this with the `%expect' declaration.
+
+ The declaration looks like this:
+
+ %expect N
+
+ Here N is a decimal integer. The declaration says there should be N
+shift/reduce conflicts and no reduce/reduce conflicts. Bison reports
+an error if the number of shift/reduce conflicts differs from N, or if
+there are any reduce/reduce conflicts.
+
+ For normal LALR(1) parsers, reduce/reduce conflicts are more
+serious, and should be eliminated entirely. Bison will always report
+reduce/reduce conflicts for these parsers. With GLR parsers, however,
+both kinds of conflicts are routine; otherwise, there would be no need
+to use GLR parsing. Therefore, it is also possible to specify an
+expected number of reduce/reduce conflicts in GLR parsers, using the
+declaration:
+
+ %expect-rr N
+
+ In general, using `%expect' involves these steps:
+
+ * Compile your grammar without `%expect'. Use the `-v' option to
+ get a verbose list of where the conflicts occur. Bison will also
+ print the number of conflicts.
+
+ * Check each of the conflicts to make sure that Bison's default
+ resolution is what you really want. If not, rewrite the grammar
+ and go back to the beginning.
+
+ * Add an `%expect' declaration, copying the number N from the number
+ which Bison printed. With GLR parsers, add an `%expect-rr'
+ declaration as well.
+
+ Now Bison will warn you if you introduce an unexpected conflict, but
+will keep silent otherwise.
+
+
+File: bison.info, Node: Start Decl, Next: Pure Decl, Prev: Expect Decl, Up: Declarations
+
+3.7.9 The Start-Symbol
+----------------------
+
+Bison assumes by default that the start symbol for the grammar is the
+first nonterminal specified in the grammar specification section. The
+programmer may override this restriction with the `%start' declaration
+as follows:
+
+ %start SYMBOL
+
+
+File: bison.info, Node: Pure Decl, Next: Push Decl, Prev: Start Decl, Up: Declarations
+
+3.7.10 A Pure (Reentrant) Parser
+--------------------------------
+
+A "reentrant" program is one which does not alter in the course of
+execution; in other words, it consists entirely of "pure" (read-only)
+code. Reentrancy is important whenever asynchronous execution is
+possible; for example, a nonreentrant program may not be safe to call
+from a signal handler. In systems with multiple threads of control, a
+nonreentrant program must be called only within interlocks.
+
+ Normally, Bison generates a parser which is not reentrant. This is
+suitable for most uses, and it permits compatibility with Yacc. (The
+standard Yacc interfaces are inherently nonreentrant, because they use
+statically allocated variables for communication with `yylex',
+including `yylval' and `yylloc'.)
+
+ Alternatively, you can generate a pure, reentrant parser. The Bison
+declaration `%define api.pure' says that you want the parser to be
+reentrant. It looks like this:
+
+ %define api.pure
+
+ The result is that the communication variables `yylval' and `yylloc'
+become local variables in `yyparse', and a different calling convention
+is used for the lexical analyzer function `yylex'. *Note Calling
+Conventions for Pure Parsers: Pure Calling, for the details of this.
+The variable `yynerrs' becomes local in `yyparse' in pull mode but it
+becomes a member of yypstate in push mode. (*note The Error Reporting
+Function `yyerror': Error Reporting.). The convention for calling
+`yyparse' itself is unchanged.
+
+ Whether the parser is pure has nothing to do with the grammar rules.
+You can generate either a pure parser or a nonreentrant parser from any
+valid grammar.
+
+
+File: bison.info, Node: Push Decl, Next: Decl Summary, Prev: Pure Decl, Up: Declarations
+
+3.7.11 A Push Parser
+--------------------
+
+(The current push parsing interface is experimental and may evolve.
+More user feedback will help to stabilize it.)
+
+ A pull parser is called once and it takes control until all its input
+is completely parsed. A push parser, on the other hand, is called each
+time a new token is made available.
+
+ A push parser is typically useful when the parser is part of a main
+event loop in the client's application. This is typically a
+requirement of a GUI, when the main event loop needs to be triggered
+within a certain time period.
+
+ Normally, Bison generates a pull parser. The following Bison
+declaration says that you want the parser to be a push parser (*note
+%define api.push_pull: Decl Summary.):
+
+ %define api.push_pull "push"
+
+ In almost all cases, you want to ensure that your push parser is also
+a pure parser (*note A Pure (Reentrant) Parser: Pure Decl.). The only
+time you should create an impure push parser is to have backwards
+compatibility with the impure Yacc pull mode interface. Unless you know
+what you are doing, your declarations should look like this:
+
+ %define api.pure
+ %define api.push_pull "push"
+
+ There is a major notable functional difference between the pure push
+parser and the impure push parser. It is acceptable for a pure push
+parser to have many parser instances, of the same type of parser, in
+memory at the same time. An impure push parser should only use one
+parser at a time.
+
+ When a push parser is selected, Bison will generate some new symbols
+in the generated parser. `yypstate' is a structure that the generated
+parser uses to store the parser's state. `yypstate_new' is the
+function that will create a new parser instance. `yypstate_delete'
+will free the resources associated with the corresponding parser
+instance. Finally, `yypush_parse' is the function that should be
+called whenever a token is available to provide the parser. A trivial
+example of using a pure push parser would look like this:
+
+ int status;
+ yypstate *ps = yypstate_new ();
+ do {
+ status = yypush_parse (ps, yylex (), NULL);
+ } while (status == YYPUSH_MORE);
+ yypstate_delete (ps);
+
+ If the user decided to use an impure push parser, a few things about
+the generated parser will change. The `yychar' variable becomes a
+global variable instead of a variable in the `yypush_parse' function.
+For this reason, the signature of the `yypush_parse' function is
+changed to remove the token as a parameter. A nonreentrant push parser
+example would thus look like this:
+
+ extern int yychar;
+ int status;
+ yypstate *ps = yypstate_new ();
+ do {
+ yychar = yylex ();
+ status = yypush_parse (ps);
+ } while (status == YYPUSH_MORE);
+ yypstate_delete (ps);
+
+ That's it. Notice the next token is put into the global variable
+`yychar' for use by the next invocation of the `yypush_parse' function.
+
+ Bison also supports both the push parser interface along with the
+pull parser interface in the same generated parser. In order to get
+this functionality, you should replace the `%define api.push_pull
+"push"' declaration with the `%define api.push_pull "both"'
+declaration. Doing this will create all of the symbols mentioned
+earlier along with the two extra symbols, `yyparse' and `yypull_parse'.
+`yyparse' can be used exactly as it normally would be used. However,
+the user should note that it is implemented in the generated parser by
+calling `yypull_parse'. This makes the `yyparse' function that is
+generated with the `%define api.push_pull "both"' declaration slower
+than the normal `yyparse' function. If the user calls the
+`yypull_parse' function it will parse the rest of the input stream. It
+is possible to `yypush_parse' tokens to select a subgrammar and then
+`yypull_parse' the rest of the input stream. If you would like to
+switch back and forth between between parsing styles, you would have to
+write your own `yypull_parse' function that knows when to quit looking
+for input. An example of using the `yypull_parse' function would look
+like this:
+
+ yypstate *ps = yypstate_new ();
+ yypull_parse (ps); /* Will call the lexer */
+ yypstate_delete (ps);
+
+ Adding the `%define api.pure' declaration does exactly the same
+thing to the generated parser with `%define api.push_pull "both"' as it
+did for `%define api.push_pull "push"'.
+
+
+File: bison.info, Node: Decl Summary, Prev: Push Decl, Up: Declarations
+
+3.7.12 Bison Declaration Summary
+--------------------------------
+
+Here is a summary of the declarations used to define a grammar:
+
+ -- Directive: %union
+ Declare the collection of data types that semantic values may have
+ (*note The Collection of Value Types: Union Decl.).
+
+ -- Directive: %token
+ Declare a terminal symbol (token type name) with no precedence or
+ associativity specified (*note Token Type Names: Token Decl.).
+
+ -- Directive: %right
+ Declare a terminal symbol (token type name) that is
+ right-associative (*note Operator Precedence: Precedence Decl.).
+
+ -- Directive: %left
+ Declare a terminal symbol (token type name) that is
+ left-associative (*note Operator Precedence: Precedence Decl.).
+
+ -- Directive: %nonassoc
+ Declare a terminal symbol (token type name) that is nonassociative
+ (*note Operator Precedence: Precedence Decl.). Using it in a way
+ that would be associative is a syntax error.
+
+ -- Directive: %type
+ Declare the type of semantic values for a nonterminal symbol
+ (*note Nonterminal Symbols: Type Decl.).
+
+ -- Directive: %start
+ Specify the grammar's start symbol (*note The Start-Symbol: Start
+ Decl.).
+
+ -- Directive: %expect
+ Declare the expected number of shift-reduce conflicts (*note
+ Suppressing Conflict Warnings: Expect Decl.).
+
+
+In order to change the behavior of `bison', use the following
+directives:
+
+ -- Directive: %code {CODE}
+ This is the unqualified form of the `%code' directive. It inserts
+ CODE verbatim at a language-dependent default location in the
+ output(1).
+
+ For C/C++, the default location is the parser source code file
+ after the usual contents of the parser header file. Thus, `%code'
+ replaces the traditional Yacc prologue, `%{CODE%}', for most
+ purposes. For a detailed discussion, see *Note Prologue
+ Alternatives::.
+
+ For Java, the default location is inside the parser class.
+
+ (Like all the Yacc prologue alternatives, this directive is
+ experimental. More user feedback will help to determine whether
+ it should become a permanent feature.)
+
+ -- Directive: %code QUALIFIER {CODE}
+ This is the qualified form of the `%code' directive. If you need
+ to specify location-sensitive verbatim CODE that does not belong
+ at the default location selected by the unqualified `%code' form,
+ use this form instead.
+
+ QUALIFIER identifies the purpose of CODE and thus the location(s)
+ where Bison should generate it. Not all values of QUALIFIER are
+ available for all target languages:
+
+ * requires
+
+ * Language(s): C, C++
+
+ * Purpose: This is the best place to write dependency code
+ required for `YYSTYPE' and `YYLTYPE'. In other words,
+ it's the best place to define types referenced in
+ `%union' directives, and it's the best place to override
+ Bison's default `YYSTYPE' and `YYLTYPE' definitions.
+
+ * Location(s): The parser header file and the parser
+ source code file before the Bison-generated `YYSTYPE'
+ and `YYLTYPE' definitions.
+
+ * provides
+
+ * Language(s): C, C++
+
+ * Purpose: This is the best place to write additional
+ definitions and declarations that should be provided to
+ other modules.
+
+ * Location(s): The parser header file and the parser
+ source code file after the Bison-generated `YYSTYPE',
+ `YYLTYPE', and token definitions.
+
+ * top
+
+ * Language(s): C, C++
+
+ * Purpose: The unqualified `%code' or `%code requires'
+ should usually be more appropriate than `%code top'.
+ However, occasionally it is necessary to insert code
+ much nearer the top of the parser source code file. For
+ example:
+
+ %code top {
+ #define _GNU_SOURCE
+ #include <stdio.h>
+ }
+
+ * Location(s): Near the top of the parser source code file.
+
+ * imports
+
+ * Language(s): Java
+
+ * Purpose: This is the best place to write Java import
+ directives.
+
+ * Location(s): The parser Java file after any Java package
+ directive and before any class definitions.
+
+ (Like all the Yacc prologue alternatives, this directive is
+ experimental. More user feedback will help to determine whether
+ it should become a permanent feature.)
+
+ For a detailed discussion of how to use `%code' in place of the
+ traditional Yacc prologue for C/C++, see *Note Prologue
+ Alternatives::.
+
+ -- Directive: %debug
+ In the parser file, define the macro `YYDEBUG' to 1 if it is not
+ already defined, so that the debugging facilities are compiled.
+ *Note Tracing Your Parser: Tracing.
+
+ -- Directive: %define VARIABLE
+ -- Directive: %define VARIABLE "VALUE"
+ Define a variable to adjust Bison's behavior. The possible
+ choices for VARIABLE, as well as their meanings, depend on the
+ selected target language and/or the parser skeleton (*note
+ %language: Decl Summary, *note %skeleton: Decl Summary.).
+
+ Bison will warn if a VARIABLE is defined multiple times.
+
+ Omitting `"VALUE"' is always equivalent to specifying it as `""'.
+
+ Some VARIABLEs may be used as Booleans. In this case, Bison will
+ complain if the variable definition does not meet one of the
+ following four conditions:
+
+ 1. `"VALUE"' is `"true"'
+
+ 2. `"VALUE"' is omitted (or is `""'). This is equivalent to
+ `"true"'.
+
+ 3. `"VALUE"' is `"false"'.
+
+ 4. VARIABLE is never defined. In this case, Bison selects a
+ default value, which may depend on the selected target
+ language and/or parser skeleton.
+
+ Some of the accepted VARIABLEs are:
+
+ * api.pure
+
+ * Language(s): C
+
+ * Purpose: Request a pure (reentrant) parser program.
+ *Note A Pure (Reentrant) Parser: Pure Decl.
+
+ * Accepted Values: Boolean
+
+ * Default Value: `"false"'
+
+ * api.push_pull
+
+ * Language(s): C (LALR(1) only)
+
+ * Purpose: Requests a pull parser, a push parser, or both.
+ *Note A Push Parser: Push Decl. (The current push
+ parsing interface is experimental and may evolve. More
+ user feedback will help to stabilize it.)
+
+ * Accepted Values: `"pull"', `"push"', `"both"'
+
+ * Default Value: `"pull"'
+
+ * lr.keep_unreachable_states
+
+ * Language(s): all
+
+ * Purpose: Requests that Bison allow unreachable parser
+ states to remain in the parser tables. Bison considers
+ a state to be unreachable if there exists no sequence of
+ transitions from the start state to that state. A state
+ can become unreachable during conflict resolution if
+ Bison disables a shift action leading to it from a
+ predecessor state. Keeping unreachable states is
+ sometimes useful for analysis purposes, but they are
+ useless in the generated parser.
+
+ * Accepted Values: Boolean
+
+ * Default Value: `"false"'
+
+ * Caveats:
+
+ * Unreachable states may contain conflicts and may
+ use rules not used in any other state. Thus,
+ keeping unreachable states may induce warnings that
+ are irrelevant to your parser's behavior, and it
+ may eliminate warnings that are relevant. Of
+ course, the change in warnings may actually be
+ relevant to a parser table analysis that wants to
+ keep unreachable states, so this behavior will
+ likely remain in future Bison releases.
+
+ * While Bison is able to remove unreachable states,
+ it is not guaranteed to remove other kinds of
+ useless states. Specifically, when Bison disables
+ reduce actions during conflict resolution, some
+ goto actions may become useless, and thus some
+ additional states may become useless. If Bison
+ were to compute which goto actions were useless and
+ then disable those actions, it could identify such
+ states as unreachable and then remove those states.
+ However, Bison does not compute which goto actions
+ are useless.
+
+ * namespace
+
+ * Languages(s): C++
+
+ * Purpose: Specifies the namespace for the parser class.
+ For example, if you specify:
+
+ %define namespace "foo::bar"
+
+ Bison uses `foo::bar' verbatim in references such as:
+
+ foo::bar::parser::semantic_type
+
+ However, to open a namespace, Bison removes any leading
+ `::' and then splits on any remaining occurrences:
+
+ namespace foo { namespace bar {
+ class position;
+ class location;
+ } }
+
+ * Accepted Values: Any absolute or relative C++ namespace
+ reference without a trailing `"::"'. For example,
+ `"foo"' or `"::foo::bar"'.
+
+ * Default Value: The value specified by `%name-prefix',
+ which defaults to `yy'. This usage of `%name-prefix' is
+ for backward compatibility and can be confusing since
+ `%name-prefix' also specifies the textual prefix for the
+ lexical analyzer function. Thus, if you specify
+ `%name-prefix', it is best to also specify `%define
+ namespace' so that `%name-prefix' _only_ affects the
+ lexical analyzer function. For example, if you specify:
+
+ %define namespace "foo"
+ %name-prefix "bar::"
+
+ The parser namespace is `foo' and `yylex' is referenced
+ as `bar::lex'.
+
+
+ -- Directive: %defines
+ Write a header file containing macro definitions for the token type
+ names defined in the grammar as well as a few other declarations.
+ If the parser output file is named `NAME.c' then this file is
+ named `NAME.h'.
+
+ For C parsers, the output header declares `YYSTYPE' unless
+ `YYSTYPE' is already defined as a macro or you have used a
+ `<TYPE>' tag without using `%union'. Therefore, if you are using
+ a `%union' (*note More Than One Value Type: Multiple Types.) with
+ components that require other definitions, or if you have defined
+ a `YYSTYPE' macro or type definition (*note Data Types of Semantic
+ Values: Value Type.), you need to arrange for these definitions to
+ be propagated to all modules, e.g., by putting them in a
+ prerequisite header that is included both by your parser and by
+ any other module that needs `YYSTYPE'.
+
+ Unless your parser is pure, the output header declares `yylval' as
+ an external variable. *Note A Pure (Reentrant) Parser: Pure Decl.
+
+ If you have also used locations, the output header declares
+ `YYLTYPE' and `yylloc' using a protocol similar to that of the
+ `YYSTYPE' macro and `yylval'. *Note Tracking Locations: Locations.
+
+ This output file is normally essential if you wish to put the
+ definition of `yylex' in a separate source file, because `yylex'
+ typically needs to be able to refer to the above-mentioned
+ declarations and to the token type codes. *Note Semantic Values
+ of Tokens: Token Values.
+
+ If you have declared `%code requires' or `%code provides', the
+ output header also contains their code. *Note %code: Decl Summary.
+
+ -- Directive: %defines DEFINES-FILE
+ Same as above, but save in the file DEFINES-FILE.
+
+ -- Directive: %destructor
+ Specify how the parser should reclaim the memory associated to
+ discarded symbols. *Note Freeing Discarded Symbols: Destructor
+ Decl.
+
+ -- Directive: %file-prefix "PREFIX"
+ Specify a prefix to use for all Bison output file names. The
+ names are chosen as if the input file were named `PREFIX.y'.
+
+ -- Directive: %language "LANGUAGE"
+ Specify the programming language for the generated parser.
+ Currently supported languages include C, C++, and Java. LANGUAGE
+ is case-insensitive.
+
+ This directive is experimental and its effect may be modified in
+ future releases.
+
+ -- Directive: %locations
+ Generate the code processing the locations (*note Special Features
+ for Use in Actions: Action Features.). This mode is enabled as
+ soon as the grammar uses the special `@N' tokens, but if your
+ grammar does not use it, using `%locations' allows for more
+ accurate syntax error messages.
+
+ -- Directive: %name-prefix "PREFIX"
+ Rename the external symbols used in the parser so that they start
+ with PREFIX instead of `yy'. The precise list of symbols renamed
+ in C parsers is `yyparse', `yylex', `yyerror', `yynerrs',
+ `yylval', `yychar', `yydebug', and (if locations are used)
+ `yylloc'. If you use a push parser, `yypush_parse',
+ `yypull_parse', `yypstate', `yypstate_new' and `yypstate_delete'
+ will also be renamed. For example, if you use `%name-prefix
+ "c_"', the names become `c_parse', `c_lex', and so on. For C++
+ parsers, see the `%define namespace' documentation in this section.
+ *Note Multiple Parsers in the Same Program: Multiple Parsers.
+
+ -- Directive: %no-lines
+ Don't generate any `#line' preprocessor commands in the parser
+ file. Ordinarily Bison writes these commands in the parser file
+ so that the C compiler and debuggers will associate errors and
+ object code with your source file (the grammar file). This
+ directive causes them to associate errors with the parser file,
+ treating it an independent source file in its own right.
+
+ -- Directive: %output "FILE"
+ Specify FILE for the parser file.
+
+ -- Directive: %pure-parser
+ Deprecated version of `%define api.pure' (*note %define: Decl
+ Summary.), for which Bison is more careful to warn about
+ unreasonable usage.
+
+ -- Directive: %require "VERSION"
+ Require version VERSION or higher of Bison. *Note Require a
+ Version of Bison: Require Decl.
+
+ -- Directive: %skeleton "FILE"
+ Specify the skeleton to use.
+
+ If FILE does not contain a `/', FILE is the name of a skeleton
+ file in the Bison installation directory. If it does, FILE is an
+ absolute file name or a file name relative to the directory of the
+ grammar file. This is similar to how most shells resolve commands.
+
+ -- Directive: %token-table
+ Generate an array of token names in the parser file. The name of
+ the array is `yytname'; `yytname[I]' is the name of the token
+ whose internal Bison token code number is I. The first three
+ elements of `yytname' correspond to the predefined tokens `"$end"',
+ `"error"', and `"$undefined"'; after these come the symbols
+ defined in the grammar file.
+
+ The name in the table includes all the characters needed to
+ represent the token in Bison. For single-character literals and
+ literal strings, this includes the surrounding quoting characters
+ and any escape sequences. For example, the Bison single-character
+ literal `'+'' corresponds to a three-character name, represented
+ in C as `"'+'"'; and the Bison two-character literal string `"\\/"'
+ corresponds to a five-character name, represented in C as
+ `"\"\\\\/\""'.
+
+ When you specify `%token-table', Bison also generates macro
+ definitions for macros `YYNTOKENS', `YYNNTS', and `YYNRULES', and
+ `YYNSTATES':
+
+ `YYNTOKENS'
+ The highest token number, plus one.
+
+ `YYNNTS'
+ The number of nonterminal symbols.
+
+ `YYNRULES'
+ The number of grammar rules,
+
+ `YYNSTATES'
+ The number of parser states (*note Parser States::).
+
+ -- Directive: %verbose
+ Write an extra output file containing verbose descriptions of the
+ parser states and what is done for each type of lookahead token in
+ that state. *Note Understanding Your Parser: Understanding, for
+ more information.
+
+ -- Directive: %yacc
+ Pretend the option `--yacc' was given, i.e., imitate Yacc,
+ including its naming conventions. *Note Bison Options::, for more.
+
+ ---------- Footnotes ----------
+
+ (1) The default location is actually skeleton-dependent; writers
+of non-standard skeletons however should choose the default location
+consistently with the behavior of the standard Bison skeletons.
+
+
+File: bison.info, Node: Multiple Parsers, Prev: Declarations, Up: Grammar File
+
+3.8 Multiple Parsers in the Same Program
+========================================
+
+Most programs that use Bison parse only one language and therefore
+contain only one Bison parser. But what if you want to parse more than
+one language with the same program? Then you need to avoid a name
+conflict between different definitions of `yyparse', `yylval', and so
+on.
+
+ The easy way to do this is to use the option `-p PREFIX' (*note
+Invoking Bison: Invocation.). This renames the interface functions and
+variables of the Bison parser to start with PREFIX instead of `yy'.
+You can use this to give each parser distinct names that do not
+conflict.
+
+ The precise list of symbols renamed is `yyparse', `yylex',
+`yyerror', `yynerrs', `yylval', `yylloc', `yychar' and `yydebug'. If
+you use a push parser, `yypush_parse', `yypull_parse', `yypstate',
+`yypstate_new' and `yypstate_delete' will also be renamed. For
+example, if you use `-p c', the names become `cparse', `clex', and so
+on.
+
+ *All the other variables and macros associated with Bison are not
+renamed.* These others are not global; there is no conflict if the same
+name is used in different parsers. For example, `YYSTYPE' is not
+renamed, but defining this in different ways in different parsers causes
+no trouble (*note Data Types of Semantic Values: Value Type.).
+
+ The `-p' option works by adding macro definitions to the beginning
+of the parser source file, defining `yyparse' as `PREFIXparse', and so
+on. This effectively substitutes one name for the other in the entire
+parser file.
+
+
+File: bison.info, Node: Interface, Next: Algorithm, Prev: Grammar File, Up: Top
+
+4 Parser C-Language Interface
+*****************************
+
+The Bison parser is actually a C function named `yyparse'. Here we
+describe the interface conventions of `yyparse' and the other functions
+that it needs to use.
+
+ Keep in mind that the parser uses many C identifiers starting with
+`yy' and `YY' for internal purposes. If you use such an identifier
+(aside from those in this manual) in an action or in epilogue in the
+grammar file, you are likely to run into trouble.
+
+* Menu:
+
+* Parser Function:: How to call `yyparse' and what it returns.
+* Push Parser Function:: How to call `yypush_parse' and what it returns.
+* Pull Parser Function:: How to call `yypull_parse' and what it returns.
+* Parser Create Function:: How to call `yypstate_new' and what it returns.
+* Parser Delete Function:: How to call `yypstate_delete' and what it returns.
+* Lexical:: You must supply a function `yylex'
+ which reads tokens.
+* Error Reporting:: You must supply a function `yyerror'.
+* Action Features:: Special features for use in actions.
+* Internationalization:: How to let the parser speak in the user's
+ native language.
+
+
+File: bison.info, Node: Parser Function, Next: Push Parser Function, Up: Interface
+
+4.1 The Parser Function `yyparse'
+=================================
+
+You call the function `yyparse' to cause parsing to occur. This
+function reads tokens, executes actions, and ultimately returns when it
+encounters end-of-input or an unrecoverable syntax error. You can also
+write an action which directs `yyparse' to return immediately without
+reading further.
+
+ -- Function: int yyparse (void)
+ The value returned by `yyparse' is 0 if parsing was successful
+ (return is due to end-of-input).
+
+ The value is 1 if parsing failed because of invalid input, i.e.,
+ input that contains a syntax error or that causes `YYABORT' to be
+ invoked.
+
+ The value is 2 if parsing failed due to memory exhaustion.
+
+ In an action, you can cause immediate return from `yyparse' by using
+these macros:
+
+ -- Macro: YYACCEPT
+ Return immediately with value 0 (to report success).
+
+ -- Macro: YYABORT
+ Return immediately with value 1 (to report failure).
+
+ If you use a reentrant parser, you can optionally pass additional
+parameter information to it in a reentrant way. To do so, use the
+declaration `%parse-param':
+
+ -- Directive: %parse-param {ARGUMENT-DECLARATION}
+ Declare that an argument declared by the braced-code
+ ARGUMENT-DECLARATION is an additional `yyparse' argument. The
+ ARGUMENT-DECLARATION is used when declaring functions or
+ prototypes. The last identifier in ARGUMENT-DECLARATION must be
+ the argument name.
+
+ Here's an example. Write this in the parser:
+
+ %parse-param {int *nastiness}
+ %parse-param {int *randomness}
+
+Then call the parser like this:
+
+ {
+ int nastiness, randomness;
+ ... /* Store proper data in `nastiness' and `randomness'. */
+ value = yyparse (&nastiness, &randomness);
+ ...
+ }
+
+In the grammar actions, use expressions like this to refer to the data:
+
+ exp: ... { ...; *randomness += 1; ... }
+
+
+File: bison.info, Node: Push Parser Function, Next: Pull Parser Function, Prev: Parser Function, Up: Interface
+
+4.2 The Push Parser Function `yypush_parse'
+===========================================
+
+(The current push parsing interface is experimental and may evolve.
+More user feedback will help to stabilize it.)
+
+ You call the function `yypush_parse' to parse a single token. This
+function is available if either the `%define api.push_pull "push"' or
+`%define api.push_pull "both"' declaration is used. *Note A Push
+Parser: Push Decl.
+
+ -- Function: int yypush_parse (yypstate *yyps)
+ The value returned by `yypush_parse' is the same as for yyparse
+ with the following exception. `yypush_parse' will return
+ YYPUSH_MORE if more input is required to finish parsing the
+ grammar.
+
+
+File: bison.info, Node: Pull Parser Function, Next: Parser Create Function, Prev: Push Parser Function, Up: Interface
+
+4.3 The Pull Parser Function `yypull_parse'
+===========================================
+
+(The current push parsing interface is experimental and may evolve.
+More user feedback will help to stabilize it.)
+
+ You call the function `yypull_parse' to parse the rest of the input
+stream. This function is available if the `%define api.push_pull
+"both"' declaration is used. *Note A Push Parser: Push Decl.
+
+ -- Function: int yypull_parse (yypstate *yyps)
+ The value returned by `yypull_parse' is the same as for `yyparse'.
+
+
+File: bison.info, Node: Parser Create Function, Next: Parser Delete Function, Prev: Pull Parser Function, Up: Interface
+
+4.4 The Parser Create Function `yystate_new'
+============================================
+
+(The current push parsing interface is experimental and may evolve.
+More user feedback will help to stabilize it.)
+
+ You call the function `yypstate_new' to create a new parser instance.
+This function is available if either the `%define api.push_pull "push"'
+or `%define api.push_pull "both"' declaration is used. *Note A Push
+Parser: Push Decl.
+
+ -- Function: yypstate *yypstate_new (void)
+ The fuction will return a valid parser instance if there was
+ memory available or 0 if no memory was available. In impure mode,
+ it will also return 0 if a parser instance is currently allocated.
+
+
+File: bison.info, Node: Parser Delete Function, Next: Lexical, Prev: Parser Create Function, Up: Interface
+
+4.5 The Parser Delete Function `yystate_delete'
+===============================================
+
+(The current push parsing interface is experimental and may evolve.
+More user feedback will help to stabilize it.)
+
+ You call the function `yypstate_delete' to delete a parser instance.
+function is available if either the `%define api.push_pull "push"' or
+`%define api.push_pull "both"' declaration is used. *Note A Push
+Parser: Push Decl.
+
+ -- Function: void yypstate_delete (yypstate *yyps)
+ This function will reclaim the memory associated with a parser
+ instance. After this call, you should no longer attempt to use
+ the parser instance.
+
+
+File: bison.info, Node: Lexical, Next: Error Reporting, Prev: Parser Delete Function, Up: Interface
+
+4.6 The Lexical Analyzer Function `yylex'
+=========================================
+
+The "lexical analyzer" function, `yylex', recognizes tokens from the
+input stream and returns them to the parser. Bison does not create
+this function automatically; you must write it so that `yyparse' can
+call it. The function is sometimes referred to as a lexical scanner.
+
+ In simple programs, `yylex' is often defined at the end of the Bison
+grammar file. If `yylex' is defined in a separate source file, you
+need to arrange for the token-type macro definitions to be available
+there. To do this, use the `-d' option when you run Bison, so that it
+will write these macro definitions into a separate header file
+`NAME.tab.h' which you can include in the other source files that need
+it. *Note Invoking Bison: Invocation.
+
+* Menu:
+
+* Calling Convention:: How `yyparse' calls `yylex'.
+* Token Values:: How `yylex' must return the semantic value
+ of the token it has read.
+* Token Locations:: How `yylex' must return the text location
+ (line number, etc.) of the token, if the
+ actions want that.
+* Pure Calling:: How the calling convention differs in a pure parser
+ (*note A Pure (Reentrant) Parser: Pure Decl.).
+
+
+File: bison.info, Node: Calling Convention, Next: Token Values, Up: Lexical
+
+4.6.1 Calling Convention for `yylex'
+------------------------------------
+
+The value that `yylex' returns must be the positive numeric code for
+the type of token it has just found; a zero or negative value signifies
+end-of-input.
+
+ When a token is referred to in the grammar rules by a name, that name
+in the parser file becomes a C macro whose definition is the proper
+numeric code for that token type. So `yylex' can use the name to
+indicate that type. *Note Symbols::.
+
+ When a token is referred to in the grammar rules by a character
+literal, the numeric code for that character is also the code for the
+token type. So `yylex' can simply return that character code, possibly
+converted to `unsigned char' to avoid sign-extension. The null
+character must not be used this way, because its code is zero and that
+signifies end-of-input.
+
+ Here is an example showing these things:
+
+ int
+ yylex (void)
+ {
+ ...
+ if (c == EOF) /* Detect end-of-input. */
+ return 0;
+ ...
+ if (c == '+' || c == '-')
+ return c; /* Assume token type for `+' is '+'. */
+ ...
+ return INT; /* Return the type of the token. */
+ ...
+ }
+
+This interface has been designed so that the output from the `lex'
+utility can be used without change as the definition of `yylex'.
+
+ If the grammar uses literal string tokens, there are two ways that
+`yylex' can determine the token type codes for them:
+
+ * If the grammar defines symbolic token names as aliases for the
+ literal string tokens, `yylex' can use these symbolic names like
+ all others. In this case, the use of the literal string tokens in
+ the grammar file has no effect on `yylex'.
+
+ * `yylex' can find the multicharacter token in the `yytname' table.
+ The index of the token in the table is the token type's code. The
+ name of a multicharacter token is recorded in `yytname' with a
+ double-quote, the token's characters, and another double-quote.
+ The token's characters are escaped as necessary to be suitable as
+ input to Bison.
+
+ Here's code for looking up a multicharacter token in `yytname',
+ assuming that the characters of the token are stored in
+ `token_buffer', and assuming that the token does not contain any
+ characters like `"' that require escaping.
+
+ for (i = 0; i < YYNTOKENS; i++)
+ {
+ if (yytname[i] != 0
+ && yytname[i][0] == '"'
+ && ! strncmp (yytname[i] + 1, token_buffer,
+ strlen (token_buffer))
+ && yytname[i][strlen (token_buffer) + 1] == '"'
+ && yytname[i][strlen (token_buffer) + 2] == 0)
+ break;
+ }
+
+ The `yytname' table is generated only if you use the
+ `%token-table' declaration. *Note Decl Summary::.
+
+
+File: bison.info, Node: Token Values, Next: Token Locations, Prev: Calling Convention, Up: Lexical
+
+4.6.2 Semantic Values of Tokens
+-------------------------------
+
+In an ordinary (nonreentrant) parser, the semantic value of the token
+must be stored into the global variable `yylval'. When you are using
+just one data type for semantic values, `yylval' has that type. Thus,
+if the type is `int' (the default), you might write this in `yylex':
+
+ ...
+ yylval = value; /* Put value onto Bison stack. */
+ return INT; /* Return the type of the token. */
+ ...
+
+ When you are using multiple data types, `yylval''s type is a union
+made from the `%union' declaration (*note The Collection of Value
+Types: Union Decl.). So when you store a token's value, you must use
+the proper member of the union. If the `%union' declaration looks like
+this:
+
+ %union {
+ int intval;
+ double val;
+ symrec *tptr;
+ }
+
+then the code in `yylex' might look like this:
+
+ ...
+ yylval.intval = value; /* Put value onto Bison stack. */
+ return INT; /* Return the type of the token. */
+ ...
+
+
+File: bison.info, Node: Token Locations, Next: Pure Calling, Prev: Token Values, Up: Lexical
+
+4.6.3 Textual Locations of Tokens
+---------------------------------
+
+If you are using the `@N'-feature (*note Tracking Locations:
+Locations.) in actions to keep track of the textual locations of tokens
+and groupings, then you must provide this information in `yylex'. The
+function `yyparse' expects to find the textual location of a token just
+parsed in the global variable `yylloc'. So `yylex' must store the
+proper data in that variable.
+
+ By default, the value of `yylloc' is a structure and you need only
+initialize the members that are going to be used by the actions. The
+four members are called `first_line', `first_column', `last_line' and
+`last_column'. Note that the use of this feature makes the parser
+noticeably slower.
+
+ The data type of `yylloc' has the name `YYLTYPE'.
+
+
+File: bison.info, Node: Pure Calling, Prev: Token Locations, Up: Lexical
+
+4.6.4 Calling Conventions for Pure Parsers
+------------------------------------------
+
+When you use the Bison declaration `%define api.pure' to request a
+pure, reentrant parser, the global communication variables `yylval' and
+`yylloc' cannot be used. (*Note A Pure (Reentrant) Parser: Pure Decl.)
+In such parsers the two global variables are replaced by pointers
+passed as arguments to `yylex'. You must declare them as shown here,
+and pass the information back by storing it through those pointers.
+
+ int
+ yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
+ {
+ ...
+ *lvalp = value; /* Put value onto Bison stack. */
+ return INT; /* Return the type of the token. */
+ ...
+ }
+
+ If the grammar file does not use the `@' constructs to refer to
+textual locations, then the type `YYLTYPE' will not be defined. In
+this case, omit the second argument; `yylex' will be called with only
+one argument.
+
+ If you wish to pass the additional parameter data to `yylex', use
+`%lex-param' just like `%parse-param' (*note Parser Function::).
+
+ -- Directive: lex-param {ARGUMENT-DECLARATION}
+ Declare that the braced-code ARGUMENT-DECLARATION is an additional
+ `yylex' argument declaration.
+
+ For instance:
+
+ %parse-param {int *nastiness}
+ %lex-param {int *nastiness}
+ %parse-param {int *randomness}
+
+results in the following signature:
+
+ int yylex (int *nastiness);
+ int yyparse (int *nastiness, int *randomness);
+
+ If `%define api.pure' is added:
+
+ int yylex (YYSTYPE *lvalp, int *nastiness);
+ int yyparse (int *nastiness, int *randomness);
+
+and finally, if both `%define api.pure' and `%locations' are used:
+
+ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
+ int yyparse (int *nastiness, int *randomness);
+
+
+File: bison.info, Node: Error Reporting, Next: Action Features, Prev: Lexical, Up: Interface
+
+4.7 The Error Reporting Function `yyerror'
+==========================================
+
+The Bison parser detects a "syntax error" or "parse error" whenever it
+reads a token which cannot satisfy any syntax rule. An action in the
+grammar can also explicitly proclaim an error, using the macro
+`YYERROR' (*note Special Features for Use in Actions: Action Features.).
+
+ The Bison parser expects to report the error by calling an error
+reporting function named `yyerror', which you must supply. It is
+called by `yyparse' whenever a syntax error is found, and it receives
+one argument. For a syntax error, the string is normally
+`"syntax error"'.
+
+ If you invoke the directive `%error-verbose' in the Bison
+declarations section (*note The Bison Declarations Section: Bison
+Declarations.), then Bison provides a more verbose and specific error
+message string instead of just plain `"syntax error"'.
+
+ The parser can detect one other kind of error: memory exhaustion.
+This can happen when the input contains constructions that are very
+deeply nested. It isn't likely you will encounter this, since the Bison
+parser normally extends its stack automatically up to a very large
+limit. But if memory is exhausted, `yyparse' calls `yyerror' in the
+usual fashion, except that the argument string is `"memory exhausted"'.
+
+ In some cases diagnostics like `"syntax error"' are translated
+automatically from English to some other language before they are
+passed to `yyerror'. *Note Internationalization::.
+
+ The following definition suffices in simple programs:
+
+ void
+ yyerror (char const *s)
+ {
+ fprintf (stderr, "%s\n", s);
+ }
+
+ After `yyerror' returns to `yyparse', the latter will attempt error
+recovery if you have written suitable error recovery grammar rules
+(*note Error Recovery::). If recovery is impossible, `yyparse' will
+immediately return 1.
+
+ Obviously, in location tracking pure parsers, `yyerror' should have
+an access to the current location. This is indeed the case for the GLR
+parsers, but not for the Yacc parser, for historical reasons. I.e., if
+`%locations %define api.pure' is passed then the prototypes for
+`yyerror' are:
+
+ void yyerror (char const *msg); /* Yacc parsers. */
+ void yyerror (YYLTYPE *locp, char const *msg); /* GLR parsers. */
+
+ If `%parse-param {int *nastiness}' is used, then:
+
+ void yyerror (int *nastiness, char const *msg); /* Yacc parsers. */
+ void yyerror (int *nastiness, char const *msg); /* GLR parsers. */
+
+ Finally, GLR and Yacc parsers share the same `yyerror' calling
+convention for absolutely pure parsers, i.e., when the calling
+convention of `yylex' _and_ the calling convention of `%define
+api.pure' are pure. I.e.:
+
+ /* Location tracking. */
+ %locations
+ /* Pure yylex. */
+ %define api.pure
+ %lex-param {int *nastiness}
+ /* Pure yyparse. */
+ %parse-param {int *nastiness}
+ %parse-param {int *randomness}
+
+results in the following signatures for all the parser kinds:
+
+ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
+ int yyparse (int *nastiness, int *randomness);
+ void yyerror (YYLTYPE *locp,
+ int *nastiness, int *randomness,
+ char const *msg);
+
+The prototypes are only indications of how the code produced by Bison
+uses `yyerror'. Bison-generated code always ignores the returned
+value, so `yyerror' can return any type, including `void'. Also,
+`yyerror' can be a variadic function; that is why the message is always
+passed last.
+
+ Traditionally `yyerror' returns an `int' that is always ignored, but
+this is purely for historical reasons, and `void' is preferable since
+it more accurately describes the return type for `yyerror'.
+
+ The variable `yynerrs' contains the number of syntax errors reported
+so far. Normally this variable is global; but if you request a pure
+parser (*note A Pure (Reentrant) Parser: Pure Decl.) then it is a
+local variable which only the actions can access.
+
+
+File: bison.info, Node: Action Features, Next: Internationalization, Prev: Error Reporting, Up: Interface
+
+4.8 Special Features for Use in Actions
+=======================================
+
+Here is a table of Bison constructs, variables and macros that are
+useful in actions.
+
+ -- Variable: $$
+ Acts like a variable that contains the semantic value for the
+ grouping made by the current rule. *Note Actions::.
+
+ -- Variable: $N
+ Acts like a variable that contains the semantic value for the Nth
+ component of the current rule. *Note Actions::.
+
+ -- Variable: $<TYPEALT>$
+ Like `$$' but specifies alternative TYPEALT in the union specified
+ by the `%union' declaration. *Note Data Types of Values in
+ Actions: Action Types.
+
+ -- Variable: $<TYPEALT>N
+ Like `$N' but specifies alternative TYPEALT in the union specified
+ by the `%union' declaration. *Note Data Types of Values in
+ Actions: Action Types.
+
+ -- Macro: YYABORT;
+ Return immediately from `yyparse', indicating failure. *Note The
+ Parser Function `yyparse': Parser Function.
+
+ -- Macro: YYACCEPT;
+ Return immediately from `yyparse', indicating success. *Note The
+ Parser Function `yyparse': Parser Function.
+
+ -- Macro: YYBACKUP (TOKEN, VALUE);
+ Unshift a token. This macro is allowed only for rules that reduce
+ a single value, and only when there is no lookahead token. It is
+ also disallowed in GLR parsers. It installs a lookahead token
+ with token type TOKEN and semantic value VALUE; then it discards
+ the value that was going to be reduced by this rule.
+
+ If the macro is used when it is not valid, such as when there is a
+ lookahead token already, then it reports a syntax error with a
+ message `cannot back up' and performs ordinary error recovery.
+
+ In either case, the rest of the action is not executed.
+
+ -- Macro: YYEMPTY
+ Value stored in `yychar' when there is no lookahead token.
+
+ -- Macro: YYEOF
+ Value stored in `yychar' when the lookahead is the end of the input
+ stream.
+
+ -- Macro: YYERROR;
+ Cause an immediate syntax error. This statement initiates error
+ recovery just as if the parser itself had detected an error;
+ however, it does not call `yyerror', and does not print any
+ message. If you want to print an error message, call `yyerror'
+ explicitly before the `YYERROR;' statement. *Note Error
+ Recovery::.
+
+ -- Macro: YYRECOVERING
+ The expression `YYRECOVERING ()' yields 1 when the parser is
+ recovering from a syntax error, and 0 otherwise. *Note Error
+ Recovery::.
+
+ -- Variable: yychar
+ Variable containing either the lookahead token, or `YYEOF' when the
+ lookahead is the end of the input stream, or `YYEMPTY' when no
+ lookahead has been performed so the next token is not yet known.
+ Do not modify `yychar' in a deferred semantic action (*note GLR
+ Semantic Actions::). *Note Lookahead Tokens: Lookahead.
+
+ -- Macro: yyclearin;
+ Discard the current lookahead token. This is useful primarily in
+ error rules. Do not invoke `yyclearin' in a deferred semantic
+ action (*note GLR Semantic Actions::). *Note Error Recovery::.
+
+ -- Macro: yyerrok;
+ Resume generating error messages immediately for subsequent syntax
+ errors. This is useful primarily in error rules. *Note Error
+ Recovery::.
+
+ -- Variable: yylloc
+ Variable containing the lookahead token location when `yychar' is
+ not set to `YYEMPTY' or `YYEOF'. Do not modify `yylloc' in a
+ deferred semantic action (*note GLR Semantic Actions::). *Note
+ Actions and Locations: Actions and Locations.
+
+ -- Variable: yylval
+ Variable containing the lookahead token semantic value when
+ `yychar' is not set to `YYEMPTY' or `YYEOF'. Do not modify
+ `yylval' in a deferred semantic action (*note GLR Semantic
+ Actions::). *Note Actions: Actions.
+
+ -- Value: @$
+ Acts like a structure variable containing information on the
+ textual location of the grouping made by the current rule. *Note
+ Tracking Locations: Locations.
+
+
+ -- Value: @N
+ Acts like a structure variable containing information on the
+ textual location of the Nth component of the current rule. *Note
+ Tracking Locations: Locations.
+
+
+File: bison.info, Node: Internationalization, Prev: Action Features, Up: Interface
+
+4.9 Parser Internationalization
+===============================
+
+A Bison-generated parser can print diagnostics, including error and
+tracing messages. By default, they appear in English. However, Bison
+also supports outputting diagnostics in the user's native language. To
+make this work, the user should set the usual environment variables.
+*Note The User's View: (gettext)Users. For example, the shell command
+`export LC_ALL=fr_CA.UTF-8' might set the user's locale to French
+Canadian using the UTF-8 encoding. The exact set of available locales
+depends on the user's installation.
+
+ The maintainer of a package that uses a Bison-generated parser
+enables the internationalization of the parser's output through the
+following steps. Here we assume a package that uses GNU Autoconf and
+GNU Automake.
+
+ 1. Into the directory containing the GNU Autoconf macros used by the
+ package--often called `m4'--copy the `bison-i18n.m4' file
+ installed by Bison under `share/aclocal/bison-i18n.m4' in Bison's
+ installation directory. For example:
+
+ cp /usr/local/share/aclocal/bison-i18n.m4 m4/bison-i18n.m4
+
+ 2. In the top-level `configure.ac', after the `AM_GNU_GETTEXT'
+ invocation, add an invocation of `BISON_I18N'. This macro is
+ defined in the file `bison-i18n.m4' that you copied earlier. It
+ causes `configure' to find the value of the `BISON_LOCALEDIR'
+ variable, and it defines the source-language symbol `YYENABLE_NLS'
+ to enable translations in the Bison-generated parser.
+
+ 3. In the `main' function of your program, designate the directory
+ containing Bison's runtime message catalog, through a call to
+ `bindtextdomain' with domain name `bison-runtime'. For example:
+
+ bindtextdomain ("bison-runtime", BISON_LOCALEDIR);
+
+ Typically this appears after any other call `bindtextdomain
+ (PACKAGE, LOCALEDIR)' that your package already has. Here we rely
+ on `BISON_LOCALEDIR' to be defined as a string through the
+ `Makefile'.
+
+ 4. In the `Makefile.am' that controls the compilation of the `main'
+ function, make `BISON_LOCALEDIR' available as a C preprocessor
+ macro, either in `DEFS' or in `AM_CPPFLAGS'. For example:
+
+ DEFS = @DEFS@ -DBISON_LOCALEDIR='"$(BISON_LOCALEDIR)"'
+
+ or:
+
+ AM_CPPFLAGS = -DBISON_LOCALEDIR='"$(BISON_LOCALEDIR)"'
+
+ 5. Finally, invoke the command `autoreconf' to generate the build
+ infrastructure.
+
+
+File: bison.info, Node: Algorithm, Next: Error Recovery, Prev: Interface, Up: Top
+
+5 The Bison Parser Algorithm
+****************************
+
+As Bison reads tokens, it pushes them onto a stack along with their
+semantic values. The stack is called the "parser stack". Pushing a
+token is traditionally called "shifting".
+
+ For example, suppose the infix calculator has read `1 + 5 *', with a
+`3' to come. The stack will have four elements, one for each token
+that was shifted.
+
+ But the stack does not always have an element for each token read.
+When the last N tokens and groupings shifted match the components of a
+grammar rule, they can be combined according to that rule. This is
+called "reduction". Those tokens and groupings are replaced on the
+stack by a single grouping whose symbol is the result (left hand side)
+of that rule. Running the rule's action is part of the process of
+reduction, because this is what computes the semantic value of the
+resulting grouping.
+
+ For example, if the infix calculator's parser stack contains this:
+
+ 1 + 5 * 3
+
+and the next input token is a newline character, then the last three
+elements can be reduced to 15 via the rule:
+
+ expr: expr '*' expr;
+
+Then the stack contains just these three elements:
+
+ 1 + 15
+
+At this point, another reduction can be made, resulting in the single
+value 16. Then the newline token can be shifted.
+
+ The parser tries, by shifts and reductions, to reduce the entire
+input down to a single grouping whose symbol is the grammar's
+start-symbol (*note Languages and Context-Free Grammars: Language and
+Grammar.).
+
+ This kind of parser is known in the literature as a bottom-up parser.
+
+* Menu:
+
+* Lookahead:: Parser looks one token ahead when deciding what to do.
+* Shift/Reduce:: Conflicts: when either shifting or reduction is valid.
+* Precedence:: Operator precedence works by resolving conflicts.
+* Contextual Precedence:: When an operator's precedence depends on context.
+* Parser States:: The parser is a finite-state-machine with stack.
+* Reduce/Reduce:: When two rules are applicable in the same situation.
+* Mystery Conflicts:: Reduce/reduce conflicts that look unjustified.
+* Generalized LR Parsing:: Parsing arbitrary context-free grammars.
+* Memory Management:: What happens when memory is exhausted. How to avoid it.
+
+
+File: bison.info, Node: Lookahead, Next: Shift/Reduce, Up: Algorithm
+
+5.1 Lookahead Tokens
+====================
+
+The Bison parser does _not_ always reduce immediately as soon as the
+last N tokens and groupings match a rule. This is because such a
+simple strategy is inadequate to handle most languages. Instead, when a
+reduction is possible, the parser sometimes "looks ahead" at the next
+token in order to decide what to do.
+
+ When a token is read, it is not immediately shifted; first it
+becomes the "lookahead token", which is not on the stack. Now the
+parser can perform one or more reductions of tokens and groupings on
+the stack, while the lookahead token remains off to the side. When no
+more reductions should take place, the lookahead token is shifted onto
+the stack. This does not mean that all possible reductions have been
+done; depending on the token type of the lookahead token, some rules
+may choose to delay their application.
+
+ Here is a simple case where lookahead is needed. These three rules
+define expressions which contain binary addition operators and postfix
+unary factorial operators (`!'), and allow parentheses for grouping.
+
+ expr: term '+' expr
+ | term
+ ;
+
+ term: '(' expr ')'
+ | term '!'
+ | NUMBER
+ ;
+
+ Suppose that the tokens `1 + 2' have been read and shifted; what
+should be done? If the following token is `)', then the first three
+tokens must be reduced to form an `expr'. This is the only valid
+course, because shifting the `)' would produce a sequence of symbols
+`term ')'', and no rule allows this.
+
+ If the following token is `!', then it must be shifted immediately so
+that `2 !' can be reduced to make a `term'. If instead the parser were
+to reduce before shifting, `1 + 2' would become an `expr'. It would
+then be impossible to shift the `!' because doing so would produce on
+the stack the sequence of symbols `expr '!''. No rule allows that
+sequence.
+
+ The lookahead token is stored in the variable `yychar'. Its
+semantic value and location, if any, are stored in the variables
+`yylval' and `yylloc'. *Note Special Features for Use in Actions:
+Action Features.
+
+
+File: bison.info, Node: Shift/Reduce, Next: Precedence, Prev: Lookahead, Up: Algorithm
+
+5.2 Shift/Reduce Conflicts
+==========================
+
+Suppose we are parsing a language which has if-then and if-then-else
+statements, with a pair of rules like this:
+
+ if_stmt:
+ IF expr THEN stmt
+ | IF expr THEN stmt ELSE stmt
+ ;
+
+Here we assume that `IF', `THEN' and `ELSE' are terminal symbols for
+specific keyword tokens.
+
+ When the `ELSE' token is read and becomes the lookahead token, the
+contents of the stack (assuming the input is valid) are just right for
+reduction by the first rule. But it is also legitimate to shift the
+`ELSE', because that would lead to eventual reduction by the second
+rule.
+
+ This situation, where either a shift or a reduction would be valid,
+is called a "shift/reduce conflict". Bison is designed to resolve
+these conflicts by choosing to shift, unless otherwise directed by
+operator precedence declarations. To see the reason for this, let's
+contrast it with the other alternative.
+
+ Since the parser prefers to shift the `ELSE', the result is to attach
+the else-clause to the innermost if-statement, making these two inputs
+equivalent:
+
+ if x then if y then win (); else lose;
+
+ if x then do; if y then win (); else lose; end;
+
+ But if the parser chose to reduce when possible rather than shift,
+the result would be to attach the else-clause to the outermost
+if-statement, making these two inputs equivalent:
+
+ if x then if y then win (); else lose;
+
+ if x then do; if y then win (); end; else lose;
+
+ The conflict exists because the grammar as written is ambiguous:
+either parsing of the simple nested if-statement is legitimate. The
+established convention is that these ambiguities are resolved by
+attaching the else-clause to the innermost if-statement; this is what
+Bison accomplishes by choosing to shift rather than reduce. (It would
+ideally be cleaner to write an unambiguous grammar, but that is very
+hard to do in this case.) This particular ambiguity was first
+encountered in the specifications of Algol 60 and is called the
+"dangling `else'" ambiguity.
+
+ To avoid warnings from Bison about predictable, legitimate
+shift/reduce conflicts, use the `%expect N' declaration. There will be
+no warning as long as the number of shift/reduce conflicts is exactly N.
+*Note Suppressing Conflict Warnings: Expect Decl.
+
+ The definition of `if_stmt' above is solely to blame for the
+conflict, but the conflict does not actually appear without additional
+rules. Here is a complete Bison input file that actually manifests the
+conflict:
+
+ %token IF THEN ELSE variable
+ %%
+ stmt: expr
+ | if_stmt
+ ;
+
+ if_stmt:
+ IF expr THEN stmt
+ | IF expr THEN stmt ELSE stmt
+ ;
+
+ expr: variable
+ ;
+
+
+File: bison.info, Node: Precedence, Next: Contextual Precedence, Prev: Shift/Reduce, Up: Algorithm
+
+5.3 Operator Precedence
+=======================
+
+Another situation where shift/reduce conflicts appear is in arithmetic
+expressions. Here shifting is not always the preferred resolution; the
+Bison declarations for operator precedence allow you to specify when to
+shift and when to reduce.
+
+* Menu:
+
+* Why Precedence:: An example showing why precedence is needed.
+* Using Precedence:: How to specify precedence in Bison grammars.
+* Precedence Examples:: How these features are used in the previous example.
+* How Precedence:: How they work.
+
+
+File: bison.info, Node: Why Precedence, Next: Using Precedence, Up: Precedence
+
+5.3.1 When Precedence is Needed
+-------------------------------
+
+Consider the following ambiguous grammar fragment (ambiguous because the
+input `1 - 2 * 3' can be parsed in two different ways):
+
+ expr: expr '-' expr
+ | expr '*' expr
+ | expr '<' expr
+ | '(' expr ')'
+ ...
+ ;
+
+Suppose the parser has seen the tokens `1', `-' and `2'; should it
+reduce them via the rule for the subtraction operator? It depends on
+the next token. Of course, if the next token is `)', we must reduce;
+shifting is invalid because no single rule can reduce the token
+sequence `- 2 )' or anything starting with that. But if the next token
+is `*' or `<', we have a choice: either shifting or reduction would
+allow the parse to complete, but with different results.
+
+ To decide which one Bison should do, we must consider the results.
+If the next operator token OP is shifted, then it must be reduced first
+in order to permit another opportunity to reduce the difference. The
+result is (in effect) `1 - (2 OP 3)'. On the other hand, if the
+subtraction is reduced before shifting OP, the result is
+`(1 - 2) OP 3'. Clearly, then, the choice of shift or reduce should
+depend on the relative precedence of the operators `-' and OP: `*'
+should be shifted first, but not `<'.
+
+ What about input such as `1 - 2 - 5'; should this be `(1 - 2) - 5'
+or should it be `1 - (2 - 5)'? For most operators we prefer the
+former, which is called "left association". The latter alternative,
+"right association", is desirable for assignment operators. The choice
+of left or right association is a matter of whether the parser chooses
+to shift or reduce when the stack contains `1 - 2' and the lookahead
+token is `-': shifting makes right-associativity.
+
+
+File: bison.info, Node: Using Precedence, Next: Precedence Examples, Prev: Why Precedence, Up: Precedence
+
+5.3.2 Specifying Operator Precedence
+------------------------------------
+
+Bison allows you to specify these choices with the operator precedence
+declarations `%left' and `%right'. Each such declaration contains a
+list of tokens, which are operators whose precedence and associativity
+is being declared. The `%left' declaration makes all those operators
+left-associative and the `%right' declaration makes them
+right-associative. A third alternative is `%nonassoc', which declares
+that it is a syntax error to find the same operator twice "in a row".
+
+ The relative precedence of different operators is controlled by the
+order in which they are declared. The first `%left' or `%right'
+declaration in the file declares the operators whose precedence is
+lowest, the next such declaration declares the operators whose
+precedence is a little higher, and so on.
+
+
+File: bison.info, Node: Precedence Examples, Next: How Precedence, Prev: Using Precedence, Up: Precedence
+
+5.3.3 Precedence Examples
+-------------------------
+
+In our example, we would want the following declarations:
+
+ %left '<'
+ %left '-'
+ %left '*'
+
+ In a more complete example, which supports other operators as well,
+we would declare them in groups of equal precedence. For example,
+`'+'' is declared with `'-'':
+
+ %left '<' '>' '=' NE LE GE
+ %left '+' '-'
+ %left '*' '/'
+
+(Here `NE' and so on stand for the operators for "not equal" and so on.
+We assume that these tokens are more than one character long and
+therefore are represented by names, not character literals.)
+
+
+File: bison.info, Node: How Precedence, Prev: Precedence Examples, Up: Precedence
+
+5.3.4 How Precedence Works
+--------------------------
+
+The first effect of the precedence declarations is to assign precedence
+levels to the terminal symbols declared. The second effect is to assign
+precedence levels to certain rules: each rule gets its precedence from
+the last terminal symbol mentioned in the components. (You can also
+specify explicitly the precedence of a rule. *Note Context-Dependent
+Precedence: Contextual Precedence.)
+
+ Finally, the resolution of conflicts works by comparing the
+precedence of the rule being considered with that of the lookahead
+token. If the token's precedence is higher, the choice is to shift.
+If the rule's precedence is higher, the choice is to reduce. If they
+have equal precedence, the choice is made based on the associativity of
+that precedence level. The verbose output file made by `-v' (*note
+Invoking Bison: Invocation.) says how each conflict was resolved.
+
+ Not all rules and not all tokens have precedence. If either the
+rule or the lookahead token has no precedence, then the default is to
+shift.
+
+
+File: bison.info, Node: Contextual Precedence, Next: Parser States, Prev: Precedence, Up: Algorithm
+
+5.4 Context-Dependent Precedence
+================================
+
+Often the precedence of an operator depends on the context. This sounds
+outlandish at first, but it is really very common. For example, a minus
+sign typically has a very high precedence as a unary operator, and a
+somewhat lower precedence (lower than multiplication) as a binary
+operator.
+
+ The Bison precedence declarations, `%left', `%right' and
+`%nonassoc', can only be used once for a given token; so a token has
+only one precedence declared in this way. For context-dependent
+precedence, you need to use an additional mechanism: the `%prec'
+modifier for rules.
+
+ The `%prec' modifier declares the precedence of a particular rule by
+specifying a terminal symbol whose precedence should be used for that
+rule. It's not necessary for that symbol to appear otherwise in the
+rule. The modifier's syntax is:
+
+ %prec TERMINAL-SYMBOL
+
+and it is written after the components of the rule. Its effect is to
+assign the rule the precedence of TERMINAL-SYMBOL, overriding the
+precedence that would be deduced for it in the ordinary way. The
+altered rule precedence then affects how conflicts involving that rule
+are resolved (*note Operator Precedence: Precedence.).
+
+ Here is how `%prec' solves the problem of unary minus. First,
+declare a precedence for a fictitious terminal symbol named `UMINUS'.
+There are no tokens of this type, but the symbol serves to stand for its
+precedence:
+
+ ...
+ %left '+' '-'
+ %left '*'
+ %left UMINUS
+
+ Now the precedence of `UMINUS' can be used in specific rules:
+
+ exp: ...
+ | exp '-' exp
+ ...
+ | '-' exp %prec UMINUS
+
+
+File: bison.info, Node: Parser States, Next: Reduce/Reduce, Prev: Contextual Precedence, Up: Algorithm
+
+5.5 Parser States
+=================
+
+The function `yyparse' is implemented using a finite-state machine.
+The values pushed on the parser stack are not simply token type codes;
+they represent the entire sequence of terminal and nonterminal symbols
+at or near the top of the stack. The current state collects all the
+information about previous input which is relevant to deciding what to
+do next.
+
+ Each time a lookahead token is read, the current parser state
+together with the type of lookahead token are looked up in a table.
+This table entry can say, "Shift the lookahead token." In this case,
+it also specifies the new parser state, which is pushed onto the top of
+the parser stack. Or it can say, "Reduce using rule number N." This
+means that a certain number of tokens or groupings are taken off the
+top of the stack, and replaced by one grouping. In other words, that
+number of states are popped from the stack, and one new state is pushed.
+
+ There is one other alternative: the table can say that the lookahead
+token is erroneous in the current state. This causes error processing
+to begin (*note Error Recovery::).
+
+
+File: bison.info, Node: Reduce/Reduce, Next: Mystery Conflicts, Prev: Parser States, Up: Algorithm
+
+5.6 Reduce/Reduce Conflicts
+===========================
+
+A reduce/reduce conflict occurs if there are two or more rules that
+apply to the same sequence of input. This usually indicates a serious
+error in the grammar.
+
+ For example, here is an erroneous attempt to define a sequence of
+zero or more `word' groupings.
+
+ sequence: /* empty */
+ { printf ("empty sequence\n"); }
+ | maybeword
+ | sequence word
+ { printf ("added word %s\n", $2); }
+ ;
+
+ maybeword: /* empty */
+ { printf ("empty maybeword\n"); }
+ | word
+ { printf ("single word %s\n", $1); }
+ ;
+
+The error is an ambiguity: there is more than one way to parse a single
+`word' into a `sequence'. It could be reduced to a `maybeword' and
+then into a `sequence' via the second rule. Alternatively,
+nothing-at-all could be reduced into a `sequence' via the first rule,
+and this could be combined with the `word' using the third rule for
+`sequence'.
+
+ There is also more than one way to reduce nothing-at-all into a
+`sequence'. This can be done directly via the first rule, or
+indirectly via `maybeword' and then the second rule.
+
+ You might think that this is a distinction without a difference,
+because it does not change whether any particular input is valid or
+not. But it does affect which actions are run. One parsing order runs
+the second rule's action; the other runs the first rule's action and
+the third rule's action. In this example, the output of the program
+changes.
+
+ Bison resolves a reduce/reduce conflict by choosing to use the rule
+that appears first in the grammar, but it is very risky to rely on
+this. Every reduce/reduce conflict must be studied and usually
+eliminated. Here is the proper way to define `sequence':
+
+ sequence: /* empty */
+ { printf ("empty sequence\n"); }
+ | sequence word
+ { printf ("added word %s\n", $2); }
+ ;
+
+ Here is another common error that yields a reduce/reduce conflict:
+
+ sequence: /* empty */
+ | sequence words
+ | sequence redirects
+ ;
+
+ words: /* empty */
+ | words word
+ ;
+
+ redirects:/* empty */
+ | redirects redirect
+ ;
+
+The intention here is to define a sequence which can contain either
+`word' or `redirect' groupings. The individual definitions of
+`sequence', `words' and `redirects' are error-free, but the three
+together make a subtle ambiguity: even an empty input can be parsed in
+infinitely many ways!
+
+ Consider: nothing-at-all could be a `words'. Or it could be two
+`words' in a row, or three, or any number. It could equally well be a
+`redirects', or two, or any number. Or it could be a `words' followed
+by three `redirects' and another `words'. And so on.
+
+ Here are two ways to correct these rules. First, to make it a
+single level of sequence:
+
+ sequence: /* empty */
+ | sequence word
+ | sequence redirect
+ ;
+
+ Second, to prevent either a `words' or a `redirects' from being
+empty:
+
+ sequence: /* empty */
+ | sequence words
+ | sequence redirects
+ ;
+
+ words: word
+ | words word
+ ;
+
+ redirects:redirect
+ | redirects redirect
+ ;
+
+
+File: bison.info, Node: Mystery Conflicts, Next: Generalized LR Parsing, Prev: Reduce/Reduce, Up: Algorithm
+
+5.7 Mysterious Reduce/Reduce Conflicts
+======================================
+
+Sometimes reduce/reduce conflicts can occur that don't look warranted.
+Here is an example:
+
+ %token ID
+
+ %%
+ def: param_spec return_spec ','
+ ;
+ param_spec:
+ type
+ | name_list ':' type
+ ;
+ return_spec:
+ type
+ | name ':' type
+ ;
+ type: ID
+ ;
+ name: ID
+ ;
+ name_list:
+ name
+ | name ',' name_list
+ ;
+
+ It would seem that this grammar can be parsed with only a single
+token of lookahead: when a `param_spec' is being read, an `ID' is a
+`name' if a comma or colon follows, or a `type' if another `ID'
+follows. In other words, this grammar is LR(1).
+
+ However, Bison, like most parser generators, cannot actually handle
+all LR(1) grammars. In this grammar, two contexts, that after an `ID'
+at the beginning of a `param_spec' and likewise at the beginning of a
+`return_spec', are similar enough that Bison assumes they are the same.
+They appear similar because the same set of rules would be active--the
+rule for reducing to a `name' and that for reducing to a `type'. Bison
+is unable to determine at that stage of processing that the rules would
+require different lookahead tokens in the two contexts, so it makes a
+single parser state for them both. Combining the two contexts causes a
+conflict later. In parser terminology, this occurrence means that the
+grammar is not LALR(1).
+
+ In general, it is better to fix deficiencies than to document them.
+But this particular deficiency is intrinsically hard to fix; parser
+generators that can handle LR(1) grammars are hard to write and tend to
+produce parsers that are very large. In practice, Bison is more useful
+as it is now.
+
+ When the problem arises, you can often fix it by identifying the two
+parser states that are being confused, and adding something to make them
+look distinct. In the above example, adding one rule to `return_spec'
+as follows makes the problem go away:
+
+ %token BOGUS
+ ...
+ %%
+ ...
+ return_spec:
+ type
+ | name ':' type
+ /* This rule is never used. */
+ | ID BOGUS
+ ;
+
+ This corrects the problem because it introduces the possibility of an
+additional active rule in the context after the `ID' at the beginning of
+`return_spec'. This rule is not active in the corresponding context in
+a `param_spec', so the two contexts receive distinct parser states. As
+long as the token `BOGUS' is never generated by `yylex', the added rule
+cannot alter the way actual input is parsed.
+
+ In this particular example, there is another way to solve the
+problem: rewrite the rule for `return_spec' to use `ID' directly
+instead of via `name'. This also causes the two confusing contexts to
+have different sets of active rules, because the one for `return_spec'
+activates the altered rule for `return_spec' rather than the one for
+`name'.
+
+ param_spec:
+ type
+ | name_list ':' type
+ ;
+ return_spec:
+ type
+ | ID ':' type
+ ;
+
+ For a more detailed exposition of LALR(1) parsers and parser
+generators, please see: Frank DeRemer and Thomas Pennello, Efficient
+Computation of LALR(1) Look-Ahead Sets, `ACM Transactions on
+Programming Languages and Systems', Vol. 4, No. 4 (October 1982), pp.
+615-649 `http://doi.acm.org/10.1145/69622.357187'.
+
+
+File: bison.info, Node: Generalized LR Parsing, Next: Memory Management, Prev: Mystery Conflicts, Up: Algorithm
+
+5.8 Generalized LR (GLR) Parsing
+================================
+
+Bison produces _deterministic_ parsers that choose uniquely when to
+reduce and which reduction to apply based on a summary of the preceding
+input and on one extra token of lookahead. As a result, normal Bison
+handles a proper subset of the family of context-free languages.
+Ambiguous grammars, since they have strings with more than one possible
+sequence of reductions cannot have deterministic parsers in this sense.
+The same is true of languages that require more than one symbol of
+lookahead, since the parser lacks the information necessary to make a
+decision at the point it must be made in a shift-reduce parser.
+Finally, as previously mentioned (*note Mystery Conflicts::), there are
+languages where Bison's particular choice of how to summarize the input
+seen so far loses necessary information.
+
+ When you use the `%glr-parser' declaration in your grammar file,
+Bison generates a parser that uses a different algorithm, called
+Generalized LR (or GLR). A Bison GLR parser uses the same basic
+algorithm for parsing as an ordinary Bison parser, but behaves
+differently in cases where there is a shift-reduce conflict that has not
+been resolved by precedence rules (*note Precedence::) or a
+reduce-reduce conflict. When a GLR parser encounters such a situation,
+it effectively _splits_ into a several parsers, one for each possible
+shift or reduction. These parsers then proceed as usual, consuming
+tokens in lock-step. Some of the stacks may encounter other conflicts
+and split further, with the result that instead of a sequence of states,
+a Bison GLR parsing stack is what is in effect a tree of states.
+
+ In effect, each stack represents a guess as to what the proper parse
+is. Additional input may indicate that a guess was wrong, in which case
+the appropriate stack silently disappears. Otherwise, the semantics
+actions generated in each stack are saved, rather than being executed
+immediately. When a stack disappears, its saved semantic actions never
+get executed. When a reduction causes two stacks to become equivalent,
+their sets of semantic actions are both saved with the state that
+results from the reduction. We say that two stacks are equivalent when
+they both represent the same sequence of states, and each pair of
+corresponding states represents a grammar symbol that produces the same
+segment of the input token stream.
+
+ Whenever the parser makes a transition from having multiple states
+to having one, it reverts to the normal LALR(1) parsing algorithm,
+after resolving and executing the saved-up actions. At this
+transition, some of the states on the stack will have semantic values
+that are sets (actually multisets) of possible actions. The parser
+tries to pick one of the actions by first finding one whose rule has
+the highest dynamic precedence, as set by the `%dprec' declaration.
+Otherwise, if the alternative actions are not ordered by precedence,
+but there the same merging function is declared for both rules by the
+`%merge' declaration, Bison resolves and evaluates both and then calls
+the merge function on the result. Otherwise, it reports an ambiguity.
+
+ It is possible to use a data structure for the GLR parsing tree that
+permits the processing of any LALR(1) grammar in linear time (in the
+size of the input), any unambiguous (not necessarily LALR(1)) grammar in
+quadratic worst-case time, and any general (possibly ambiguous)
+context-free grammar in cubic worst-case time. However, Bison currently
+uses a simpler data structure that requires time proportional to the
+length of the input times the maximum number of stacks required for any
+prefix of the input. Thus, really ambiguous or nondeterministic
+grammars can require exponential time and space to process. Such badly
+behaving examples, however, are not generally of practical interest.
+Usually, nondeterminism in a grammar is local--the parser is "in doubt"
+only for a few tokens at a time. Therefore, the current data structure
+should generally be adequate. On LALR(1) portions of a grammar, in
+particular, it is only slightly slower than with the default Bison
+parser.
+
+ For a more detailed exposition of GLR parsers, please see: Elizabeth
+Scott, Adrian Johnstone and Shamsa Sadaf Hussain, Tomita-Style
+Generalised LR Parsers, Royal Holloway, University of London,
+Department of Computer Science, TR-00-12,
+`http://www.cs.rhul.ac.uk/research/languages/publications/tomita_style_1.ps',
+(2000-12-24).
+
+
+File: bison.info, Node: Memory Management, Prev: Generalized LR Parsing, Up: Algorithm
+
+5.9 Memory Management, and How to Avoid Memory Exhaustion
+=========================================================
+
+The Bison parser stack can run out of memory if too many tokens are
+shifted and not reduced. When this happens, the parser function
+`yyparse' calls `yyerror' and then returns 2.
+
+ Because Bison parsers have growing stacks, hitting the upper limit
+usually results from using a right recursion instead of a left
+recursion, *Note Recursive Rules: Recursion.
+
+ By defining the macro `YYMAXDEPTH', you can control how deep the
+parser stack can become before memory is exhausted. Define the macro
+with a value that is an integer. This value is the maximum number of
+tokens that can be shifted (and not reduced) before overflow.
+
+ The stack space allowed is not necessarily allocated. If you
+specify a large value for `YYMAXDEPTH', the parser normally allocates a
+small stack at first, and then makes it bigger by stages as needed.
+This increasing allocation happens automatically and silently.
+Therefore, you do not need to make `YYMAXDEPTH' painfully small merely
+to save space for ordinary inputs that do not need much stack.
+
+ However, do not allow `YYMAXDEPTH' to be a value so large that
+arithmetic overflow could occur when calculating the size of the stack
+space. Also, do not allow `YYMAXDEPTH' to be less than `YYINITDEPTH'.
+
+ The default value of `YYMAXDEPTH', if you do not define it, is 10000.
+
+ You can control how much stack is allocated initially by defining the
+macro `YYINITDEPTH' to a positive integer. For the C LALR(1) parser,
+this value must be a compile-time constant unless you are assuming C99
+or some other target language or compiler that allows variable-length
+arrays. The default is 200.
+
+ Do not allow `YYINITDEPTH' to be greater than `YYMAXDEPTH'.
+
+ Because of semantical differences between C and C++, the LALR(1)
+parsers in C produced by Bison cannot grow when compiled by C++
+compilers. In this precise case (compiling a C parser as C++) you are
+suggested to grow `YYINITDEPTH'. The Bison maintainers hope to fix
+this deficiency in a future release.
+
+
+File: bison.info, Node: Error Recovery, Next: Context Dependency, Prev: Algorithm, Up: Top
+
+6 Error Recovery
+****************
+
+It is not usually acceptable to have a program terminate on a syntax
+error. For example, a compiler should recover sufficiently to parse the
+rest of the input file and check it for errors; a calculator should
+accept another expression.
+
+ In a simple interactive command parser where each input is one line,
+it may be sufficient to allow `yyparse' to return 1 on error and have
+the caller ignore the rest of the input line when that happens (and
+then call `yyparse' again). But this is inadequate for a compiler,
+because it forgets all the syntactic context leading up to the error.
+A syntax error deep within a function in the compiler input should not
+cause the compiler to treat the following line like the beginning of a
+source file.
+
+ You can define how to recover from a syntax error by writing rules to
+recognize the special token `error'. This is a terminal symbol that is
+always defined (you need not declare it) and reserved for error
+handling. The Bison parser generates an `error' token whenever a
+syntax error happens; if you have provided a rule to recognize this
+token in the current context, the parse can continue.
+
+ For example:
+
+ stmnts: /* empty string */
+ | stmnts '\n'
+ | stmnts exp '\n'
+ | stmnts error '\n'
+
+ The fourth rule in this example says that an error followed by a
+newline makes a valid addition to any `stmnts'.
+
+ What happens if a syntax error occurs in the middle of an `exp'? The
+error recovery rule, interpreted strictly, applies to the precise
+sequence of a `stmnts', an `error' and a newline. If an error occurs in
+the middle of an `exp', there will probably be some additional tokens
+and subexpressions on the stack after the last `stmnts', and there will
+be tokens to read before the next newline. So the rule is not
+applicable in the ordinary way.
+
+ But Bison can force the situation to fit the rule, by discarding
+part of the semantic context and part of the input. First it discards
+states and objects from the stack until it gets back to a state in
+which the `error' token is acceptable. (This means that the
+subexpressions already parsed are discarded, back to the last complete
+`stmnts'.) At this point the `error' token can be shifted. Then, if
+the old lookahead token is not acceptable to be shifted next, the
+parser reads tokens and discards them until it finds a token which is
+acceptable. In this example, Bison reads and discards input until the
+next newline so that the fourth rule can apply. Note that discarded
+symbols are possible sources of memory leaks, see *Note Freeing
+Discarded Symbols: Destructor Decl, for a means to reclaim this memory.
+
+ The choice of error rules in the grammar is a choice of strategies
+for error recovery. A simple and useful strategy is simply to skip the
+rest of the current input line or current statement if an error is
+detected:
+
+ stmnt: error ';' /* On error, skip until ';' is read. */
+
+ It is also useful to recover to the matching close-delimiter of an
+opening-delimiter that has already been parsed. Otherwise the
+close-delimiter will probably appear to be unmatched, and generate
+another, spurious error message:
+
+ primary: '(' expr ')'
+ | '(' error ')'
+ ...
+ ;
+
+ Error recovery strategies are necessarily guesses. When they guess
+wrong, one syntax error often leads to another. In the above example,
+the error recovery rule guesses that an error is due to bad input
+within one `stmnt'. Suppose that instead a spurious semicolon is
+inserted in the middle of a valid `stmnt'. After the error recovery
+rule recovers from the first error, another syntax error will be found
+straightaway, since the text following the spurious semicolon is also
+an invalid `stmnt'.
+
+ To prevent an outpouring of error messages, the parser will output
+no error message for another syntax error that happens shortly after
+the first; only after three consecutive input tokens have been
+successfully shifted will error messages resume.
+
+ Note that rules which accept the `error' token may have actions, just
+as any other rules can.
+
+ You can make error messages resume immediately by using the macro
+`yyerrok' in an action. If you do this in the error rule's action, no
+error messages will be suppressed. This macro requires no arguments;
+`yyerrok;' is a valid C statement.
+
+ The previous lookahead token is reanalyzed immediately after an
+error. If this is unacceptable, then the macro `yyclearin' may be used
+to clear this token. Write the statement `yyclearin;' in the error
+rule's action. *Note Special Features for Use in Actions: Action
+Features.
+
+ For example, suppose that on a syntax error, an error handling
+routine is called that advances the input stream to some point where
+parsing should once again commence. The next symbol returned by the
+lexical scanner is probably correct. The previous lookahead token
+ought to be discarded with `yyclearin;'.
+
+ The expression `YYRECOVERING ()' yields 1 when the parser is
+recovering from a syntax error, and 0 otherwise. Syntax error
+diagnostics are suppressed while recovering from a syntax error.
+
+
+File: bison.info, Node: Context Dependency, Next: Debugging, Prev: Error Recovery, Up: Top
+
+7 Handling Context Dependencies
+*******************************
+
+The Bison paradigm is to parse tokens first, then group them into larger
+syntactic units. In many languages, the meaning of a token is affected
+by its context. Although this violates the Bison paradigm, certain
+techniques (known as "kludges") may enable you to write Bison parsers
+for such languages.
+
+* Menu:
+
+* Semantic Tokens:: Token parsing can depend on the semantic context.
+* Lexical Tie-ins:: Token parsing can depend on the syntactic context.
+* Tie-in Recovery:: Lexical tie-ins have implications for how
+ error recovery rules must be written.
+
+ (Actually, "kludge" means any technique that gets its job done but is
+neither clean nor robust.)
+
+
+File: bison.info, Node: Semantic Tokens, Next: Lexical Tie-ins, Up: Context Dependency
+
+7.1 Semantic Info in Token Types
+================================
+
+The C language has a context dependency: the way an identifier is used
+depends on what its current meaning is. For example, consider this:
+
+ foo (x);
+
+ This looks like a function call statement, but if `foo' is a typedef
+name, then this is actually a declaration of `x'. How can a Bison
+parser for C decide how to parse this input?
+
+ The method used in GNU C is to have two different token types,
+`IDENTIFIER' and `TYPENAME'. When `yylex' finds an identifier, it
+looks up the current declaration of the identifier in order to decide
+which token type to return: `TYPENAME' if the identifier is declared as
+a typedef, `IDENTIFIER' otherwise.
+
+ The grammar rules can then express the context dependency by the
+choice of token type to recognize. `IDENTIFIER' is accepted as an
+expression, but `TYPENAME' is not. `TYPENAME' can start a declaration,
+but `IDENTIFIER' cannot. In contexts where the meaning of the
+identifier is _not_ significant, such as in declarations that can
+shadow a typedef name, either `TYPENAME' or `IDENTIFIER' is
+accepted--there is one rule for each of the two token types.
+
+ This technique is simple to use if the decision of which kinds of
+identifiers to allow is made at a place close to where the identifier is
+parsed. But in C this is not always so: C allows a declaration to
+redeclare a typedef name provided an explicit type has been specified
+earlier:
+
+ typedef int foo, bar;
+ int baz (void)
+ {
+ static bar (bar); /* redeclare `bar' as static variable */
+ extern foo foo (foo); /* redeclare `foo' as function */
+ return foo (bar);
+ }
+
+ Unfortunately, the name being declared is separated from the
+declaration construct itself by a complicated syntactic structure--the
+"declarator".
+
+ As a result, part of the Bison parser for C needs to be duplicated,
+with all the nonterminal names changed: once for parsing a declaration
+in which a typedef name can be redefined, and once for parsing a
+declaration in which that can't be done. Here is a part of the
+duplication, with actions omitted for brevity:
+
+ initdcl:
+ declarator maybeasm '='
+ init
+ | declarator maybeasm
+ ;
+
+ notype_initdcl:
+ notype_declarator maybeasm '='
+ init
+ | notype_declarator maybeasm
+ ;
+
+Here `initdcl' can redeclare a typedef name, but `notype_initdcl'
+cannot. The distinction between `declarator' and `notype_declarator'
+is the same sort of thing.
+
+ There is some similarity between this technique and a lexical tie-in
+(described next), in that information which alters the lexical analysis
+is changed during parsing by other parts of the program. The
+difference is here the information is global, and is used for other
+purposes in the program. A true lexical tie-in has a special-purpose
+flag controlled by the syntactic context.
+
+
+File: bison.info, Node: Lexical Tie-ins, Next: Tie-in Recovery, Prev: Semantic Tokens, Up: Context Dependency
+
+7.2 Lexical Tie-ins
+===================
+
+One way to handle context-dependency is the "lexical tie-in": a flag
+which is set by Bison actions, whose purpose is to alter the way tokens
+are parsed.
+
+ For example, suppose we have a language vaguely like C, but with a
+special construct `hex (HEX-EXPR)'. After the keyword `hex' comes an
+expression in parentheses in which all integers are hexadecimal. In
+particular, the token `a1b' must be treated as an integer rather than
+as an identifier if it appears in that context. Here is how you can do
+it:
+
+ %{
+ int hexflag;
+ int yylex (void);
+ void yyerror (char const *);
+ %}
+ %%
+ ...
+ expr: IDENTIFIER
+ | constant
+ | HEX '('
+ { hexflag = 1; }
+ expr ')'
+ { hexflag = 0;
+ $$ = $4; }
+ | expr '+' expr
+ { $$ = make_sum ($1, $3); }
+ ...
+ ;
+
+ constant:
+ INTEGER
+ | STRING
+ ;
+
+Here we assume that `yylex' looks at the value of `hexflag'; when it is
+nonzero, all integers are parsed in hexadecimal, and tokens starting
+with letters are parsed as integers if possible.
+
+ The declaration of `hexflag' shown in the prologue of the parser file
+is needed to make it accessible to the actions (*note The Prologue:
+Prologue.). You must also write the code in `yylex' to obey the flag.
+
+
+File: bison.info, Node: Tie-in Recovery, Prev: Lexical Tie-ins, Up: Context Dependency
+
+7.3 Lexical Tie-ins and Error Recovery
+======================================
+
+Lexical tie-ins make strict demands on any error recovery rules you
+have. *Note Error Recovery::.
+
+ The reason for this is that the purpose of an error recovery rule is
+to abort the parsing of one construct and resume in some larger
+construct. For example, in C-like languages, a typical error recovery
+rule is to skip tokens until the next semicolon, and then start a new
+statement, like this:
+
+ stmt: expr ';'
+ | IF '(' expr ')' stmt { ... }
+ ...
+ error ';'
+ { hexflag = 0; }
+ ;
+
+ If there is a syntax error in the middle of a `hex (EXPR)'
+construct, this error rule will apply, and then the action for the
+completed `hex (EXPR)' will never run. So `hexflag' would remain set
+for the entire rest of the input, or until the next `hex' keyword,
+causing identifiers to be misinterpreted as integers.
+
+ To avoid this problem the error recovery rule itself clears
+`hexflag'.
+
+ There may also be an error recovery rule that works within
+expressions. For example, there could be a rule which applies within
+parentheses and skips to the close-parenthesis:
+
+ expr: ...
+ | '(' expr ')'
+ { $$ = $2; }
+ | '(' error ')'
+ ...
+
+ If this rule acts within the `hex' construct, it is not going to
+abort that construct (since it applies to an inner level of parentheses
+within the construct). Therefore, it should not clear the flag: the
+rest of the `hex' construct should be parsed with the flag still in
+effect.
+
+ What if there is an error recovery rule which might abort out of the
+`hex' construct or might not, depending on circumstances? There is no
+way you can write the action to determine whether a `hex' construct is
+being aborted or not. So if you are using a lexical tie-in, you had
+better make sure your error recovery rules are not of this kind. Each
+rule must be such that you can be sure that it always will, or always
+won't, have to clear the flag.
+
+
+File: bison.info, Node: Debugging, Next: Invocation, Prev: Context Dependency, Up: Top
+
+8 Debugging Your Parser
+***********************
+
+Developing a parser can be a challenge, especially if you don't
+understand the algorithm (*note The Bison Parser Algorithm:
+Algorithm.). Even so, sometimes a detailed description of the automaton
+can help (*note Understanding Your Parser: Understanding.), or tracing
+the execution of the parser can give some insight on why it behaves
+improperly (*note Tracing Your Parser: Tracing.).
+
+* Menu:
+
+* Understanding:: Understanding the structure of your parser.
+* Tracing:: Tracing the execution of your parser.
+
+
+File: bison.info, Node: Understanding, Next: Tracing, Up: Debugging
+
+8.1 Understanding Your Parser
+=============================
+
+As documented elsewhere (*note The Bison Parser Algorithm: Algorithm.)
+Bison parsers are "shift/reduce automata". In some cases (much more
+frequent than one would hope), looking at this automaton is required to
+tune or simply fix a parser. Bison provides two different
+representation of it, either textually or graphically (as a DOT file).
+
+ The textual file is generated when the options `--report' or
+`--verbose' are specified, see *Note Invoking Bison: Invocation. Its
+name is made by removing `.tab.c' or `.c' from the parser output file
+name, and adding `.output' instead. Therefore, if the input file is
+`foo.y', then the parser file is called `foo.tab.c' by default. As a
+consequence, the verbose output file is called `foo.output'.
+
+ The following grammar file, `calc.y', will be used in the sequel:
+
+ %token NUM STR
+ %left '+' '-'
+ %left '*'
+ %%
+ exp: exp '+' exp
+ | exp '-' exp
+ | exp '*' exp
+ | exp '/' exp
+ | NUM
+ ;
+ useless: STR;
+ %%
+
+ `bison' reports:
+
+ calc.y: warning: 1 nonterminal and 1 rule useless in grammar
+ calc.y:11.1-7: warning: nonterminal useless in grammar: useless
+ calc.y:11.10-12: warning: rule useless in grammar: useless: STR
+ calc.y: conflicts: 7 shift/reduce
+
+ When given `--report=state', in addition to `calc.tab.c', it creates
+a file `calc.output' with contents detailed below. The order of the
+output and the exact presentation might vary, but the interpretation is
+the same.
+
+ The first section includes details on conflicts that were solved
+thanks to precedence and/or associativity:
+
+ Conflict in state 8 between rule 2 and token '+' resolved as reduce.
+ Conflict in state 8 between rule 2 and token '-' resolved as reduce.
+ Conflict in state 8 between rule 2 and token '*' resolved as shift.
+...
+
+
+The next section lists states that still have conflicts.
+
+ State 8 conflicts: 1 shift/reduce
+ State 9 conflicts: 1 shift/reduce
+ State 10 conflicts: 1 shift/reduce
+ State 11 conflicts: 4 shift/reduce
+
+The next section reports useless tokens, nonterminal and rules. Useless
+nonterminals and rules are removed in order to produce a smaller parser,
+but useless tokens are preserved, since they might be used by the
+scanner (note the difference between "useless" and "unused" below):
+
+ Nonterminals useless in grammar:
+ useless
+
+ Terminals unused in grammar:
+ STR
+
+ Rules useless in grammar:
+ #6 useless: STR;
+
+The next section reproduces the exact grammar that Bison used:
+
+ Grammar
+
+ Number, Line, Rule
+ 0 5 $accept -> exp $end
+ 1 5 exp -> exp '+' exp
+ 2 6 exp -> exp '-' exp
+ 3 7 exp -> exp '*' exp
+ 4 8 exp -> exp '/' exp
+ 5 9 exp -> NUM
+
+and reports the uses of the symbols:
+
+ Terminals, with rules where they appear
+
+ $end (0) 0
+ '*' (42) 3
+ '+' (43) 1
+ '-' (45) 2
+ '/' (47) 4
+ error (256)
+ NUM (258) 5
+
+ Nonterminals, with rules where they appear
+
+ $accept (8)
+ on left: 0
+ exp (9)
+ on left: 1 2 3 4 5, on right: 0 1 2 3 4
+
+Bison then proceeds onto the automaton itself, describing each state
+with it set of "items", also known as "pointed rules". Each item is a
+production rule together with a point (marked by `.') that the input
+cursor.
+
+ state 0
+
+ $accept -> . exp $ (rule 0)
+
+ NUM shift, and go to state 1
+
+ exp go to state 2
+
+ This reads as follows: "state 0 corresponds to being at the very
+beginning of the parsing, in the initial rule, right before the start
+symbol (here, `exp'). When the parser returns to this state right
+after having reduced a rule that produced an `exp', the control flow
+jumps to state 2. If there is no such transition on a nonterminal
+symbol, and the lookahead is a `NUM', then this token is shifted on the
+parse stack, and the control flow jumps to state 1. Any other
+lookahead triggers a syntax error."
+
+ Even though the only active rule in state 0 seems to be rule 0, the
+report lists `NUM' as a lookahead token because `NUM' can be at the
+beginning of any rule deriving an `exp'. By default Bison reports the
+so-called "core" or "kernel" of the item set, but if you want to see
+more detail you can invoke `bison' with `--report=itemset' to list all
+the items, include those that can be derived:
+
+ state 0
+
+ $accept -> . exp $ (rule 0)
+ exp -> . exp '+' exp (rule 1)
+ exp -> . exp '-' exp (rule 2)
+ exp -> . exp '*' exp (rule 3)
+ exp -> . exp '/' exp (rule 4)
+ exp -> . NUM (rule 5)
+
+ NUM shift, and go to state 1
+
+ exp go to state 2
+
+In the state 1...
+
+ state 1
+
+ exp -> NUM . (rule 5)
+
+ $default reduce using rule 5 (exp)
+
+the rule 5, `exp: NUM;', is completed. Whatever the lookahead token
+(`$default'), the parser will reduce it. If it was coming from state
+0, then, after this reduction it will return to state 0, and will jump
+to state 2 (`exp: go to state 2').
+
+ state 2
+
+ $accept -> exp . $ (rule 0)
+ exp -> exp . '+' exp (rule 1)
+ exp -> exp . '-' exp (rule 2)
+ exp -> exp . '*' exp (rule 3)
+ exp -> exp . '/' exp (rule 4)
+
+ $ shift, and go to state 3
+ '+' shift, and go to state 4
+ '-' shift, and go to state 5
+ '*' shift, and go to state 6
+ '/' shift, and go to state 7
+
+In state 2, the automaton can only shift a symbol. For instance,
+because of the item `exp -> exp . '+' exp', if the lookahead if `+', it
+will be shifted on the parse stack, and the automaton control will jump
+to state 4, corresponding to the item `exp -> exp '+' . exp'. Since
+there is no default action, any other token than those listed above
+will trigger a syntax error.
+
+ The state 3 is named the "final state", or the "accepting state":
+
+ state 3
+
+ $accept -> exp $ . (rule 0)
+
+ $default accept
+
+the initial rule is completed (the start symbol and the end of input
+were read), the parsing exits successfully.
+
+ The interpretation of states 4 to 7 is straightforward, and is left
+to the reader.
+
+ state 4
+
+ exp -> exp '+' . exp (rule 1)
+
+ NUM shift, and go to state 1
+
+ exp go to state 8
+
+ state 5
+
+ exp -> exp '-' . exp (rule 2)
+
+ NUM shift, and go to state 1
+
+ exp go to state 9
+
+ state 6
+
+ exp -> exp '*' . exp (rule 3)
+
+ NUM shift, and go to state 1
+
+ exp go to state 10
+
+ state 7
+
+ exp -> exp '/' . exp (rule 4)
+
+ NUM shift, and go to state 1
+
+ exp go to state 11
+
+ As was announced in beginning of the report, `State 8 conflicts: 1
+shift/reduce':
+
+ state 8
+
+ exp -> exp . '+' exp (rule 1)
+ exp -> exp '+' exp . (rule 1)
+ exp -> exp . '-' exp (rule 2)
+ exp -> exp . '*' exp (rule 3)
+ exp -> exp . '/' exp (rule 4)
+
+ '*' shift, and go to state 6
+ '/' shift, and go to state 7
+
+ '/' [reduce using rule 1 (exp)]
+ $default reduce using rule 1 (exp)
+
+ Indeed, there are two actions associated to the lookahead `/':
+either shifting (and going to state 7), or reducing rule 1. The
+conflict means that either the grammar is ambiguous, or the parser lacks
+information to make the right decision. Indeed the grammar is
+ambiguous, as, since we did not specify the precedence of `/', the
+sentence `NUM + NUM / NUM' can be parsed as `NUM + (NUM / NUM)', which
+corresponds to shifting `/', or as `(NUM + NUM) / NUM', which
+corresponds to reducing rule 1.
+
+ Because in LALR(1) parsing a single decision can be made, Bison
+arbitrarily chose to disable the reduction, see *Note Shift/Reduce
+Conflicts: Shift/Reduce. Discarded actions are reported in between
+square brackets.
+
+ Note that all the previous states had a single possible action:
+either shifting the next token and going to the corresponding state, or
+reducing a single rule. In the other cases, i.e., when shifting _and_
+reducing is possible or when _several_ reductions are possible, the
+lookahead is required to select the action. State 8 is one such state:
+if the lookahead is `*' or `/' then the action is shifting, otherwise
+the action is reducing rule 1. In other words, the first two items,
+corresponding to rule 1, are not eligible when the lookahead token is
+`*', since we specified that `*' has higher precedence than `+'. More
+generally, some items are eligible only with some set of possible
+lookahead tokens. When run with `--report=lookahead', Bison specifies
+these lookahead tokens:
+
+ state 8
+
+ exp -> exp . '+' exp (rule 1)
+ exp -> exp '+' exp . [$, '+', '-', '/'] (rule 1)
+ exp -> exp . '-' exp (rule 2)
+ exp -> exp . '*' exp (rule 3)
+ exp -> exp . '/' exp (rule 4)
+
+ '*' shift, and go to state 6
+ '/' shift, and go to state 7
+
+ '/' [reduce using rule 1 (exp)]
+ $default reduce using rule 1 (exp)
+
+ The remaining states are similar:
+
+ state 9
+
+ exp -> exp . '+' exp (rule 1)
+ exp -> exp . '-' exp (rule 2)
+ exp -> exp '-' exp . (rule 2)
+ exp -> exp . '*' exp (rule 3)
+ exp -> exp . '/' exp (rule 4)
+
+ '*' shift, and go to state 6
+ '/' shift, and go to state 7
+
+ '/' [reduce using rule 2 (exp)]
+ $default reduce using rule 2 (exp)
+
+ state 10
+
+ exp -> exp . '+' exp (rule 1)
+ exp -> exp . '-' exp (rule 2)
+ exp -> exp . '*' exp (rule 3)
+ exp -> exp '*' exp . (rule 3)
+ exp -> exp . '/' exp (rule 4)
+
+ '/' shift, and go to state 7
+
+ '/' [reduce using rule 3 (exp)]
+ $default reduce using rule 3 (exp)
+
+ state 11
+
+ exp -> exp . '+' exp (rule 1)
+ exp -> exp . '-' exp (rule 2)
+ exp -> exp . '*' exp (rule 3)
+ exp -> exp . '/' exp (rule 4)
+ exp -> exp '/' exp . (rule 4)
+
+ '+' shift, and go to state 4
+ '-' shift, and go to state 5
+ '*' shift, and go to state 6
+ '/' shift, and go to state 7
+
+ '+' [reduce using rule 4 (exp)]
+ '-' [reduce using rule 4 (exp)]
+ '*' [reduce using rule 4 (exp)]
+ '/' [reduce using rule 4 (exp)]
+ $default reduce using rule 4 (exp)
+
+Observe that state 11 contains conflicts not only due to the lack of
+precedence of `/' with respect to `+', `-', and `*', but also because
+the associativity of `/' is not specified.
+
+
+File: bison.info, Node: Tracing, Prev: Understanding, Up: Debugging
+
+8.2 Tracing Your Parser
+=======================
+
+If a Bison grammar compiles properly but doesn't do what you want when
+it runs, the `yydebug' parser-trace feature can help you figure out why.
+
+ There are several means to enable compilation of trace facilities:
+
+the macro `YYDEBUG'
+ Define the macro `YYDEBUG' to a nonzero value when you compile the
+ parser. This is compliant with POSIX Yacc. You could use
+ `-DYYDEBUG=1' as a compiler option or you could put `#define
+ YYDEBUG 1' in the prologue of the grammar file (*note The
+ Prologue: Prologue.).
+
+the option `-t', `--debug'
+ Use the `-t' option when you run Bison (*note Invoking Bison:
+ Invocation.). This is POSIX compliant too.
+
+the directive `%debug'
+ Add the `%debug' directive (*note Bison Declaration Summary: Decl
+ Summary.). This is a Bison extension, which will prove useful
+ when Bison will output parsers for languages that don't use a
+ preprocessor. Unless POSIX and Yacc portability matter to you,
+ this is the preferred solution.
+
+ We suggest that you always enable the debug option so that debugging
+is always possible.
+
+ The trace facility outputs messages with macro calls of the form
+`YYFPRINTF (stderr, FORMAT, ARGS)' where FORMAT and ARGS are the usual
+`printf' format and variadic arguments. If you define `YYDEBUG' to a
+nonzero value but do not define `YYFPRINTF', `<stdio.h>' is
+automatically included and `YYFPRINTF' is defined to `fprintf'.
+
+ Once you have compiled the program with trace facilities, the way to
+request a trace is to store a nonzero value in the variable `yydebug'.
+You can do this by making the C code do it (in `main', perhaps), or you
+can alter the value with a C debugger.
+
+ Each step taken by the parser when `yydebug' is nonzero produces a
+line or two of trace information, written on `stderr'. The trace
+messages tell you these things:
+
+ * Each time the parser calls `yylex', what kind of token was read.
+
+ * Each time a token is shifted, the depth and complete contents of
+ the state stack (*note Parser States::).
+
+ * Each time a rule is reduced, which rule it is, and the complete
+ contents of the state stack afterward.
+
+ To make sense of this information, it helps to refer to the listing
+file produced by the Bison `-v' option (*note Invoking Bison:
+Invocation.). This file shows the meaning of each state in terms of
+positions in various rules, and also what each state will do with each
+possible input token. As you read the successive trace messages, you
+can see that the parser is functioning according to its specification in
+the listing file. Eventually you will arrive at the place where
+something undesirable happens, and you will see which parts of the
+grammar are to blame.
+
+ The parser file is a C program and you can use C debuggers on it,
+but it's not easy to interpret what it is doing. The parser function
+is a finite-state machine interpreter, and aside from the actions it
+executes the same code over and over. Only the values of variables
+show where in the grammar it is working.
+
+ The debugging information normally gives the token type of each token
+read, but not its semantic value. You can optionally define a macro
+named `YYPRINT' to provide a way to print the value. If you define
+`YYPRINT', it should take three arguments. The parser will pass a
+standard I/O stream, the numeric code for the token type, and the token
+value (from `yylval').
+
+ Here is an example of `YYPRINT' suitable for the multi-function
+calculator (*note Declarations for `mfcalc': Mfcalc Declarations.):
+
+ %{
+ static void print_token_value (FILE *, int, YYSTYPE);
+ #define YYPRINT(file, type, value) print_token_value (file, type, value)
+ %}
+
+ ... %% ... %% ...
+
+ static void
+ print_token_value (FILE *file, int type, YYSTYPE value)
+ {
+ if (type == VAR)
+ fprintf (file, "%s", value.tptr->name);
+ else if (type == NUM)
+ fprintf (file, "%d", value.val);
+ }
+
+
+File: bison.info, Node: Invocation, Next: Other Languages, Prev: Debugging, Up: Top
+
+9 Invoking Bison
+****************
+
+The usual way to invoke Bison is as follows:
+
+ bison INFILE
+
+ Here INFILE is the grammar file name, which usually ends in `.y'.
+The parser file's name is made by replacing the `.y' with `.tab.c' and
+removing any leading directory. Thus, the `bison foo.y' file name
+yields `foo.tab.c', and the `bison hack/foo.y' file name yields
+`foo.tab.c'. It's also possible, in case you are writing C++ code
+instead of C in your grammar file, to name it `foo.ypp' or `foo.y++'.
+Then, the output files will take an extension like the given one as
+input (respectively `foo.tab.cpp' and `foo.tab.c++'). This feature
+takes effect with all options that manipulate file names like `-o' or
+`-d'.
+
+ For example :
+
+ bison -d INFILE.YXX
+ will produce `infile.tab.cxx' and `infile.tab.hxx', and
+
+ bison -d -o OUTPUT.C++ INFILE.Y
+ will produce `output.c++' and `outfile.h++'.
+
+ For compatibility with POSIX, the standard Bison distribution also
+contains a shell script called `yacc' that invokes Bison with the `-y'
+option.
+
+* Menu:
+
+* Bison Options:: All the options described in detail,
+ in alphabetical order by short options.
+* Option Cross Key:: Alphabetical list of long options.
+* Yacc Library:: Yacc-compatible `yylex' and `main'.
+
+
+File: bison.info, Node: Bison Options, Next: Option Cross Key, Up: Invocation
+
+9.1 Bison Options
+=================
+
+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-prefix',
+connect the option name and the argument with `='.
+
+ Here is a list of options that can be used with Bison, alphabetized
+by short option. It is followed by a cross key alphabetized by long
+option.
+
+Operations modes:
+`-h'
+`--help'
+ Print a summary of the command-line options to Bison and exit.
+
+`-V'
+`--version'
+ Print the version number of Bison and exit.
+
+`--print-localedir'
+ Print the name of the directory containing locale-dependent data.
+
+`--print-datadir'
+ Print the name of the directory containing skeletons and XSLT.
+
+`-y'
+`--yacc'
+ Act more like the traditional Yacc command. This can cause
+ different diagnostics to be generated, and may change behavior in
+ other minor ways. Most importantly, imitate Yacc's output file
+ name conventions, so that the parser output file is called
+ `y.tab.c', and the other outputs are called `y.output' and
+ `y.tab.h'. Also, if generating an LALR(1) parser in C, generate
+ `#define' statements in addition to an `enum' to associate token
+ numbers with token names. Thus, the following shell script can
+ substitute for Yacc, and the Bison distribution contains such a
+ script for compatibility with POSIX:
+
+ #! /bin/sh
+ bison -y "$@"
+
+ The `-y'/`--yacc' option is intended for use with traditional Yacc
+ grammars. If your grammar uses a Bison extension like
+ `%glr-parser', Bison might not be Yacc-compatible even if this
+ option is specified.
+
+`-W'
+`--warnings'
+ Output warnings falling in CATEGORY. CATEGORY can be one of:
+ `midrule-values'
+ Warn about mid-rule values that are set but not used within
+ any of the actions of the parent rule. For example, warn
+ about unused `$2' in:
+
+ exp: '1' { $$ = 1; } '+' exp { $$ = $1 + $4; };
+
+ Also warn about mid-rule values that are used but not set.
+ For example, warn about unset `$$' in the mid-rule action in:
+
+ exp: '1' { $1 = 1; } '+' exp { $$ = $2 + $4; };
+
+ These warnings are not enabled by default since they
+ sometimes prove to be false alarms in existing grammars
+ employing the Yacc constructs `$0' or `$-N' (where N is some
+ positive integer).
+
+ `yacc'
+ Incompatibilities with POSIX Yacc.
+
+ `all'
+ All the warnings.
+
+ `none'
+ Turn off all the warnings.
+
+ `error'
+ Treat warnings as errors.
+
+ A category can be turned off by prefixing its name with `no-'. For
+ instance, `-Wno-syntax' will hide the warnings about unused
+ variables.
+
+Tuning the parser:
+
+`-t'
+`--debug'
+ In the parser file, define the macro `YYDEBUG' to 1 if it is not
+ already defined, so that the debugging facilities are compiled.
+ *Note Tracing Your Parser: Tracing.
+
+`-L LANGUAGE'
+`--language=LANGUAGE'
+ Specify the programming language for the generated parser, as if
+ `%language' was specified (*note Bison Declaration Summary: Decl
+ Summary.). Currently supported languages include C, C++, and Java.
+ LANGUAGE is case-insensitive.
+
+ This option is experimental and its effect may be modified in
+ future releases.
+
+`--locations'
+ Pretend that `%locations' was specified. *Note Decl Summary::.
+
+`-p PREFIX'
+`--name-prefix=PREFIX'
+ Pretend that `%name-prefix "PREFIX"' was specified. *Note Decl
+ Summary::.
+
+`-l'
+`--no-lines'
+ Don't put any `#line' preprocessor commands in the parser file.
+ Ordinarily Bison puts them in the parser file so that the C
+ compiler and debuggers will associate errors with your source
+ file, the grammar file. This option causes them to associate
+ errors with the parser file, treating it as an independent source
+ file in its own right.
+
+`-S FILE'
+`--skeleton=FILE'
+ Specify the skeleton to use, similar to `%skeleton' (*note Bison
+ Declaration Summary: Decl Summary.).
+
+ If FILE does not contain a `/', FILE is the name of a skeleton
+ file in the Bison installation directory. If it does, FILE is an
+ absolute file name or a file name relative to the current working
+ directory. This is similar to how most shells resolve commands.
+
+`-k'
+`--token-table'
+ Pretend that `%token-table' was specified. *Note Decl Summary::.
+
+Adjust the output:
+
+`--defines[=FILE]'
+ Pretend that `%defines' was specified, i.e., write an extra output
+ file containing macro definitions for the token type names defined
+ in the grammar, as well as a few other declarations. *Note Decl
+ Summary::.
+
+`-d'
+ This is the same as `--defines' except `-d' does not accept a FILE
+ argument since POSIX Yacc requires that `-d' can be bundled with
+ other short options.
+
+`-b FILE-PREFIX'
+`--file-prefix=PREFIX'
+ Pretend that `%file-prefix' was specified, i.e., specify prefix to
+ use for all Bison output file names. *Note Decl Summary::.
+
+`-r THINGS'
+`--report=THINGS'
+ Write an extra output file containing verbose description of the
+ comma separated list of THINGS among:
+
+ `state'
+ Description of the grammar, conflicts (resolved and
+ unresolved), and LALR automaton.
+
+ `lookahead'
+ Implies `state' and augments the description of the automaton
+ with each rule's lookahead set.
+
+ `itemset'
+ Implies `state' and augments the description of the automaton
+ with the full set of items for each state, instead of its
+ core only.
+
+`--report-file=FILE'
+ Specify the FILE for the verbose description.
+
+`-v'
+`--verbose'
+ Pretend that `%verbose' was specified, i.e., write an extra output
+ file containing verbose descriptions of the grammar and parser.
+ *Note Decl Summary::.
+
+`-o FILE'
+`--output=FILE'
+ Specify the FILE for the parser file.
+
+ The other output files' names are constructed from FILE as
+ described under the `-v' and `-d' options.
+
+`-g[FILE]'
+`--graph[=FILE]'
+ Output a graphical representation of the LALR(1) grammar automaton
+ computed by Bison, in Graphviz (http://www.graphviz.org/) DOT
+ (http://www.graphviz.org/doc/info/lang.html) format. `FILE' is
+ optional. If omitted and the grammar file is `foo.y', the output
+ file will be `foo.dot'.
+
+`-x[FILE]'
+`--xml[=FILE]'
+ Output an XML report of the LALR(1) automaton computed by Bison.
+ `FILE' is optional. If omitted and the grammar file is `foo.y',
+ the output file will be `foo.xml'. (The current XML schema is
+ experimental and may evolve. More user feedback will help to
+ stabilize it.)
+
+
+File: bison.info, Node: Option Cross Key, Next: Yacc Library, Prev: Bison Options, Up: Invocation
+
+9.2 Option Cross Key
+====================
+
+Here is a list of options, alphabetized by long option, to help you find
+the corresponding short option.
+
+Long Option Short Option
+-------------------------------------------------
+`--debug' `-t'
+`--defines=[FILE]'
+`--file-prefix=PREFIX' `-b' PREFIX
+`--graph=[FILE]' `-g' [FILE]
+`--help' `-h'
+`--language=LANGUAGE' `-L' LANGUAGE
+`--locations'
+`--name-prefix=PREFIX' `-p' PREFIX
+`--no-lines' `-l'
+`--output=FILE' `-o' FILE
+`--print-datadir'
+`--print-localedir'
+`--report-file=FILE'
+`--report=THINGS' `-r' THINGS
+`--skeleton=FILE' `-S' FILE
+`--token-table' `-k'
+`--verbose' `-v'
+`--version' `-V'
+`--warnings' `-W'
+`--xml=[FILE]' `-x' [FILE]
+`--yacc' `-y'
+
+
+File: bison.info, Node: Yacc Library, Prev: Option Cross Key, Up: Invocation
+
+9.3 Yacc Library
+================
+
+The Yacc library contains default implementations of the `yyerror' and
+`main' functions. These default implementations are normally not
+useful, but POSIX requires them. To use the Yacc library, link your
+program with the `-ly' option. Note that Bison's implementation of the
+Yacc library is distributed under the terms of the GNU General Public
+License (*note Copying::).
+
+ If you use the Yacc library's `yyerror' function, you should declare
+`yyerror' as follows:
+
+ int yyerror (char const *);
+
+ Bison ignores the `int' value returned by this `yyerror'. If you
+use the Yacc library's `main' function, your `yyparse' function should
+have the following type signature:
+
+ int yyparse (void);
+
+
+File: bison.info, Node: Other Languages, Next: FAQ, Prev: Invocation, Up: Top
+
+10 Parsers Written In Other Languages
+*************************************
+
+* Menu:
+
+* C++ Parsers:: The interface to generate C++ parser classes
+* Java Parsers:: The interface to generate Java parser classes
+
+
+File: bison.info, Node: C++ Parsers, Next: Java Parsers, Up: Other Languages
+
+10.1 C++ Parsers
+================
+
+* Menu:
+
+* C++ Bison Interface:: Asking for C++ parser generation
+* C++ Semantic Values:: %union vs. C++
+* C++ Location Values:: The position and location classes
+* C++ Parser Interface:: Instantiating and running the parser
+* C++ Scanner Interface:: Exchanges between yylex and parse
+* A Complete C++ Example:: Demonstrating their use
+
+
+File: bison.info, Node: C++ Bison Interface, Next: C++ Semantic Values, Up: C++ Parsers
+
+10.1.1 C++ Bison Interface
+--------------------------
+
+The C++ LALR(1) parser is selected using the skeleton directive,
+`%skeleton "lalr1.c"', or the synonymous command-line option
+`--skeleton=lalr1.c'. *Note Decl Summary::.
+
+ When run, `bison' will create several entities in the `yy' namespace. Use
+the `%define namespace' directive to change the namespace name, see
+*Note Decl Summary::. The various classes are generated in the
+following files:
+
+`position.hh'
+`location.hh'
+ The definition of the classes `position' and `location', used for
+ location tracking. *Note C++ Location Values::.
+
+`stack.hh'
+ An auxiliary class `stack' used by the parser.
+
+`FILE.hh'
+`FILE.cc'
+ (Assuming the extension of the input file was `.yy'.) The
+ declaration and implementation of the C++ parser class. The
+ basename and extension of these two files follow the same rules as
+ with regular C parsers (*note Invocation::).
+
+ The header is _mandatory_; you must either pass `-d'/`--defines'
+ to `bison', or use the `%defines' directive.
+
+ All these files are documented using Doxygen; run `doxygen' for a
+complete and accurate documentation.
+
+
+File: bison.info, Node: C++ Semantic Values, Next: C++ Location Values, Prev: C++ Bison Interface, Up: C++ Parsers
+
+10.1.2 C++ Semantic Values
+--------------------------
+
+The `%union' directive works as for C, see *Note The Collection of
+Value Types: Union Decl. In particular it produces a genuine
+`union'(1), which have a few specific features in C++.
+ - The type `YYSTYPE' is defined but its use is discouraged: rather
+ you should refer to the parser's encapsulated type
+ `yy::parser::semantic_type'.
+
+ - Non POD (Plain Old Data) types cannot be used. C++ forbids any
+ instance of classes with constructors in unions: only _pointers_
+ to such objects are allowed.
+
+ Because objects have to be stored via pointers, memory is not
+reclaimed automatically: using the `%destructor' directive is the only
+means to avoid leaks. *Note Freeing Discarded Symbols: Destructor Decl.
+
+ ---------- Footnotes ----------
+
+ (1) In the future techniques to allow complex types within
+pseudo-unions (similar to Boost variants) might be implemented to
+alleviate these issues.
+
+
+File: bison.info, Node: C++ Location Values, Next: C++ Parser Interface, Prev: C++ Semantic Values, Up: C++ Parsers
+
+10.1.3 C++ Location Values
+--------------------------
+
+When the directive `%locations' is used, the C++ parser supports
+location tracking, see *Note Locations Overview: Locations. Two
+auxiliary classes define a `position', a single point in a file, and a
+`location', a range composed of a pair of `position's (possibly
+spanning several files).
+
+ -- Method on position: std::string* file
+ The name of the file. It will always be handled as a pointer, the
+ parser will never duplicate nor deallocate it. As an experimental
+ feature you may change it to `TYPE*' using `%define filename_type
+ "TYPE"'.
+
+ -- Method on position: unsigned int line
+ The line, starting at 1.
+
+ -- Method on position: unsigned int lines (int HEIGHT = 1)
+ Advance by HEIGHT lines, resetting the column number.
+
+ -- Method on position: unsigned int column
+ The column, starting at 0.
+
+ -- Method on position: unsigned int columns (int WIDTH = 1)
+ Advance by WIDTH columns, without changing the line number.
+
+ -- Method on position: position& operator+= (position& POS, int WIDTH)
+ -- Method on position: position operator+ (const position& POS, int
+ WIDTH)
+ -- Method on position: position& operator-= (const position& POS, int
+ WIDTH)
+ -- Method on position: position operator- (position& POS, int WIDTH)
+ Various forms of syntactic sugar for `columns'.
+
+ -- Method on position: position operator<< (std::ostream O, const
+ position& P)
+ Report P on O like this: `FILE:LINE.COLUMN', or `LINE.COLUMN' if
+ FILE is null.
+
+ -- Method on location: position begin
+ -- Method on location: position end
+ The first, inclusive, position of the range, and the first beyond.
+
+ -- Method on location: unsigned int columns (int WIDTH = 1)
+ -- Method on location: unsigned int lines (int HEIGHT = 1)
+ Advance the `end' position.
+
+ -- Method on location: location operator+ (const location& BEGIN,
+ const location& END)
+ -- Method on location: location operator+ (const location& BEGIN, int
+ WIDTH)
+ -- Method on location: location operator+= (const location& LOC, int
+ WIDTH)
+ Various forms of syntactic sugar.
+
+ -- Method on location: void step ()
+ Move `begin' onto `end'.
+
+
+File: bison.info, Node: C++ Parser Interface, Next: C++ Scanner Interface, Prev: C++ Location Values, Up: C++ Parsers
+
+10.1.4 C++ Parser Interface
+---------------------------
+
+The output files `OUTPUT.hh' and `OUTPUT.cc' declare and define the
+parser class in the namespace `yy'. The class name defaults to
+`parser', but may be changed using `%define parser_class_name "NAME"'.
+The interface of this class is detailed below. It can be extended
+using the `%parse-param' feature: its semantics is slightly changed
+since it describes an additional member of the parser class, and an
+additional argument for its constructor.
+
+ -- Type of parser: semantic_value_type
+ -- Type of parser: location_value_type
+ The types for semantics value and locations.
+
+ -- Method on parser: parser (TYPE1 ARG1, ...)
+ Build a new parser object. There are no arguments by default,
+ unless `%parse-param {TYPE1 ARG1}' was used.
+
+ -- Method on parser: int parse ()
+ Run the syntactic analysis, and return 0 on success, 1 otherwise.
+
+ -- Method on parser: std::ostream& debug_stream ()
+ -- Method on parser: void set_debug_stream (std::ostream& O)
+ Get or set the stream used for tracing the parsing. It defaults to
+ `std::cerr'.
+
+ -- Method on parser: debug_level_type debug_level ()
+ -- Method on parser: void set_debug_level (debug_level L)
+ Get or set the tracing level. Currently its value is either 0, no
+ trace, or nonzero, full tracing.
+
+ -- Method on parser: void error (const location_type& L, const
+ std::string& M)
+ The definition for this member function must be supplied by the
+ user: the parser uses it to report a parser error occurring at L,
+ described by M.
+
+
+File: bison.info, Node: C++ Scanner Interface, Next: A Complete C++ Example, Prev: C++ Parser Interface, Up: C++ Parsers
+
+10.1.5 C++ Scanner Interface
+----------------------------
+
+The parser invokes the scanner by calling `yylex'. Contrary to C
+parsers, C++ parsers are always pure: there is no point in using the
+`%define api.pure' directive. Therefore the interface is as follows.
+
+ -- Method on parser: int yylex (semantic_value_type& YYLVAL,
+ location_type& YYLLOC, TYPE1 ARG1, ...)
+ Return the next token. Its type is the return value, its semantic
+ value and location being YYLVAL and YYLLOC. Invocations of
+ `%lex-param {TYPE1 ARG1}' yield additional arguments.
+
+
+File: bison.info, Node: A Complete C++ Example, Prev: C++ Scanner Interface, Up: C++ Parsers
+
+10.1.6 A Complete C++ Example
+-----------------------------
+
+This section demonstrates the use of a C++ parser with a simple but
+complete example. This example should be available on your system,
+ready to compile, in the directory "../bison/examples/calc++". It
+focuses on the use of Bison, therefore the design of the various C++
+classes is very naive: no accessors, no encapsulation of members etc.
+We will use a Lex scanner, and more precisely, a Flex scanner, to
+demonstrate the various interaction. A hand written scanner is
+actually easier to interface with.
+
+* Menu:
+
+* Calc++ --- C++ Calculator:: The specifications
+* Calc++ Parsing Driver:: An active parsing context
+* Calc++ Parser:: A parser class
+* Calc++ Scanner:: A pure C++ Flex scanner
+* Calc++ Top Level:: Conducting the band
+
+
+File: bison.info, Node: Calc++ --- C++ Calculator, Next: Calc++ Parsing Driver, Up: A Complete C++ Example
+
+10.1.6.1 Calc++ -- C++ Calculator
+.................................
+
+Of course the grammar is dedicated to arithmetics, a single expression,
+possibly preceded by variable assignments. An environment containing
+possibly predefined variables such as `one' and `two', is exchanged
+with the parser. An example of valid input follows.
+
+ three := 3
+ seven := one + two * three
+ seven * seven
+
+
+File: bison.info, Node: Calc++ Parsing Driver, Next: Calc++ Parser, Prev: Calc++ --- C++ Calculator, Up: A Complete C++ Example
+
+10.1.6.2 Calc++ Parsing Driver
+..............................
+
+To support a pure interface with the parser (and the scanner) the
+technique of the "parsing context" is convenient: a structure
+containing all the data to exchange. Since, in addition to simply
+launch the parsing, there are several auxiliary tasks to execute (open
+the file for parsing, instantiate the parser etc.), we recommend
+transforming the simple parsing context structure into a fully blown
+"parsing driver" class.
+
+ The declaration of this driver class, `calc++-driver.hh', is as
+follows. The first part includes the CPP guard and imports the
+required standard library components, and the declaration of the parser
+class.
+
+ #ifndef CALCXX_DRIVER_HH
+ # define CALCXX_DRIVER_HH
+ # include <string>
+ # include <map>
+ # include "calc++-parser.hh"
+
+Then comes the declaration of the scanning function. Flex expects the
+signature of `yylex' to be defined in the macro `YY_DECL', and the C++
+parser expects it to be declared. We can factor both as follows.
+
+ // Tell Flex the lexer's prototype ...
+ # define YY_DECL \
+ yy::calcxx_parser::token_type \
+ yylex (yy::calcxx_parser::semantic_type* yylval, \
+ yy::calcxx_parser::location_type* yylloc, \
+ calcxx_driver& driver)
+ // ... and declare it for the parser's sake.
+ YY_DECL;
+
+The `calcxx_driver' class is then declared with its most obvious
+members.
+
+ // Conducting the whole scanning and parsing of Calc++.
+ class calcxx_driver
+ {
+ public:
+ calcxx_driver ();
+ virtual ~calcxx_driver ();
+
+ std::map<std::string, int> variables;
+
+ int result;
+
+To encapsulate the coordination with the Flex scanner, it is useful to
+have two members function to open and close the scanning phase.
+
+ // Handling the scanner.
+ void scan_begin ();
+ void scan_end ();
+ bool trace_scanning;
+
+Similarly for the parser itself.
+
+ // Run the parser. Return 0 on success.
+ int parse (const std::string& f);
+ std::string file;
+ bool trace_parsing;
+
+To demonstrate pure handling of parse errors, instead of simply dumping
+them on the standard error output, we will pass them to the compiler
+driver using the following two member functions. Finally, we close the
+class declaration and CPP guard.
+
+ // Error handling.
+ void error (const yy::location& l, const std::string& m);
+ void error (const std::string& m);
+ };
+ #endif // ! CALCXX_DRIVER_HH
+
+ The implementation of the driver is straightforward. The `parse'
+member function deserves some attention. The `error' functions are
+simple stubs, they should actually register the located error messages
+and set error state.
+
+ #include "calc++-driver.hh"
+ #include "calc++-parser.hh"
+
+ calcxx_driver::calcxx_driver ()
+ : trace_scanning (false), trace_parsing (false)
+ {
+ variables["one"] = 1;
+ variables["two"] = 2;
+ }
+
+ calcxx_driver::~calcxx_driver ()
+ {
+ }
+
+ int
+ calcxx_driver::parse (const std::string &f)
+ {
+ file = f;
+ scan_begin ();
+ yy::calcxx_parser parser (*this);
+ parser.set_debug_level (trace_parsing);
+ int res = parser.parse ();
+ scan_end ();
+ return res;
+ }
+
+ void
+ calcxx_driver::error (const yy::location& l, const std::string& m)
+ {
+ std::cerr << l << ": " << m << std::endl;
+ }
+
+ void
+ calcxx_driver::error (const std::string& m)
+ {
+ std::cerr << m << std::endl;
+ }
+
+
+File: bison.info, Node: Calc++ Parser, Next: Calc++ Scanner, Prev: Calc++ Parsing Driver, Up: A Complete C++ Example
+
+10.1.6.3 Calc++ Parser
+......................
+
+The parser definition file `calc++-parser.yy' starts by asking for the
+C++ LALR(1) skeleton, the creation of the parser header file, and
+specifies the name of the parser class. Because the C++ skeleton
+changed several times, it is safer to require the version you designed
+the grammar for.
+
+ %skeleton "lalr1.cc" /* -*- C++ -*- */
+ %require "2.4.1"
+ %defines
+ %define parser_class_name "calcxx_parser"
+
+Then come the declarations/inclusions needed to define the `%union'.
+Because the parser uses the parsing driver and reciprocally, both
+cannot include the header of the other. Because the driver's header
+needs detailed knowledge about the parser class (in particular its
+inner types), it is the parser's header which will simply use a forward
+declaration of the driver. *Note %code: Decl Summary.
+
+ %code requires {
+ # include <string>
+ class calcxx_driver;
+ }
+
+The driver is passed by reference to the parser and to the scanner.
+This provides a simple but effective pure interface, not relying on
+global variables.
+
+ // The parsing context.
+ %parse-param { calcxx_driver& driver }
+ %lex-param { calcxx_driver& driver }
+
+Then we request the location tracking feature, and initialize the first
+location's file name. Afterwards new locations are computed relatively
+to the previous locations: the file name will be automatically
+propagated.
+
+ %locations
+ %initial-action
+ {
+ // Initialize the initial location.
+ @$.begin.filename = @$.end.filename = &driver.file;
+ };
+
+Use the two following directives to enable parser tracing and verbose
+error messages.
+
+ %debug
+ %error-verbose
+
+Semantic values cannot use "real" objects, but only pointers to them.
+
+ // Symbols.
+ %union
+ {
+ int ival;
+ std::string *sval;
+ };
+
+The code between `%code {' and `}' is output in the `*.cc' file; it
+needs detailed knowledge about the driver.
+
+ %code {
+ # include "calc++-driver.hh"
+ }
+
+The token numbered as 0 corresponds to end of file; the following line
+allows for nicer error messages referring to "end of file" instead of
+"$end". Similarly user friendly named are provided for each symbol.
+Note that the tokens names are prefixed by `TOKEN_' to avoid name
+clashes.
+
+ %token END 0 "end of file"
+ %token ASSIGN ":="
+ %token <sval> IDENTIFIER "identifier"
+ %token <ival> NUMBER "number"
+ %type <ival> exp
+
+To enable memory deallocation during error recovery, use `%destructor'.
+
+ %printer { debug_stream () << *$$; } "identifier"
+ %destructor { delete $$; } "identifier"
+
+ %printer { debug_stream () << $$; } <ival>
+
+The grammar itself is straightforward.
+
+ %%
+ %start unit;
+ unit: assignments exp { driver.result = $2; };
+
+ assignments: assignments assignment {}
+ | /* Nothing. */ {};
+
+ assignment:
+ "identifier" ":=" exp
+ { driver.variables[*$1] = $3; delete $1; };
+
+ %left '+' '-';
+ %left '*' '/';
+ exp: exp '+' exp { $$ = $1 + $3; }
+ | exp '-' exp { $$ = $1 - $3; }
+ | exp '*' exp { $$ = $1 * $3; }
+ | exp '/' exp { $$ = $1 / $3; }
+ | "identifier" { $$ = driver.variables[*$1]; delete $1; }
+ | "number" { $$ = $1; };
+ %%
+
+Finally the `error' member function registers the errors to the driver.
+
+ void
+ yy::calcxx_parser::error (const yy::calcxx_parser::location_type& l,
+ const std::string& m)
+ {
+ driver.error (l, m);
+ }
+
+
+File: bison.info, Node: Calc++ Scanner, Next: Calc++ Top Level, Prev: Calc++ Parser, Up: A Complete C++ Example
+
+10.1.6.4 Calc++ Scanner
+.......................
+
+The Flex scanner first includes the driver declaration, then the
+parser's to get the set of defined tokens.
+
+ %{ /* -*- C++ -*- */
+ # include <cstdlib>
+ # include <errno.h>
+ # include <limits.h>
+ # include <string>
+ # include "calc++-driver.hh"
+ # include "calc++-parser.hh"
+
+ /* Work around an incompatibility in flex (at least versions
+ 2.5.31 through 2.5.33): it generates code that does
+ not conform to C89. See Debian bug 333231
+ <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
+ # undef yywrap
+ # define yywrap() 1
+
+ /* By default yylex returns int, we use token_type.
+ Unfortunately yyterminate by default returns 0, which is
+ not of token_type. */
+ #define yyterminate() return token::END
+ %}
+
+Because there is no `#include'-like feature we don't need `yywrap', we
+don't need `unput' either, and we parse an actual file, this is not an
+interactive session with the user. Finally we enable the scanner
+tracing features.
+
+ %option noyywrap nounput batch debug
+
+Abbreviations allow for more readable rules.
+
+ id [a-zA-Z][a-zA-Z_0-9]*
+ int [0-9]+
+ blank [ \t]
+
+The following paragraph suffices to track locations accurately. Each
+time `yylex' is invoked, the begin position is moved onto the end
+position. Then when a pattern is matched, the end position is advanced
+of its width. In case it matched ends of lines, the end cursor is
+adjusted, and each time blanks are matched, the begin cursor is moved
+onto the end cursor to effectively ignore the blanks preceding tokens.
+Comments would be treated equally.
+
+ %{
+ # define YY_USER_ACTION yylloc->columns (yyleng);
+ %}
+ %%
+ %{
+ yylloc->step ();
+ %}
+ {blank}+ yylloc->step ();
+ [\n]+ yylloc->lines (yyleng); yylloc->step ();
+
+The rules are simple, just note the use of the driver to report errors.
+It is convenient to use a typedef to shorten
+`yy::calcxx_parser::token::identifier' into `token::identifier' for
+instance.
+
+ %{
+ typedef yy::calcxx_parser::token token;
+ %}
+ /* Convert ints to the actual type of tokens. */
+ [-+*/] return yy::calcxx_parser::token_type (yytext[0]);
+ ":=" return token::ASSIGN;
+ {int} {
+ errno = 0;
+ long n = strtol (yytext, NULL, 10);
+ if (! (INT_MIN <= n && n <= INT_MAX && errno != ERANGE))
+ driver.error (*yylloc, "integer is out of range");
+ yylval->ival = n;
+ return token::NUMBER;
+ }
+ {id} yylval->sval = new std::string (yytext); return token::IDENTIFIER;
+ . driver.error (*yylloc, "invalid character");
+ %%
+
+Finally, because the scanner related driver's member function depend on
+the scanner's data, it is simpler to implement them in this file.
+
+ void
+ calcxx_driver::scan_begin ()
+ {
+ yy_flex_debug = trace_scanning;
+ if (file == "-")
+ yyin = stdin;
+ else if (!(yyin = fopen (file.c_str (), "r")))
+ {
+ error (std::string ("cannot open ") + file);
+ exit (1);
+ }
+ }
+
+ void
+ calcxx_driver::scan_end ()
+ {
+ fclose (yyin);
+ }
+
+
+File: bison.info, Node: Calc++ Top Level, Prev: Calc++ Scanner, Up: A Complete C++ Example
+
+10.1.6.5 Calc++ Top Level
+.........................
+
+The top level file, `calc++.cc', poses no problem.
+
+ #include <iostream>
+ #include "calc++-driver.hh"
+
+ int
+ main (int argc, char *argv[])
+ {
+ calcxx_driver driver;
+ for (++argv; argv[0]; ++argv)
+ if (*argv == std::string ("-p"))
+ driver.trace_parsing = true;
+ else if (*argv == std::string ("-s"))
+ driver.trace_scanning = true;
+ else if (!driver.parse (*argv))
+ std::cout << driver.result << std::endl;
+ }
+
+
+File: bison.info, Node: Java Parsers, Prev: C++ Parsers, Up: Other Languages
+
+10.2 Java Parsers
+=================
+
+* Menu:
+
+* Java Bison Interface:: Asking for Java parser generation
+* Java Semantic Values:: %type and %token vs. Java
+* Java Location Values:: The position and location classes
+* Java Parser Interface:: Instantiating and running the parser
+* Java Scanner Interface:: Specifying the scanner for the parser
+* Java Action Features:: Special features for use in actions
+* Java Differences:: Differences between C/C++ and Java Grammars
+* Java Declarations Summary:: List of Bison declarations used with Java
+
+
+File: bison.info, Node: Java Bison Interface, Next: Java Semantic Values, Up: Java Parsers
+
+10.2.1 Java Bison Interface
+---------------------------
+
+(The current Java interface is experimental and may evolve. More user
+feedback will help to stabilize it.)
+
+ The Java parser skeletons are selected using the `%language "Java"'
+directive or the `-L java'/`--language=java' option.
+
+ When generating a Java parser, `bison BASENAME.y' will create a
+single Java source file named `BASENAME.java'. Using an input file
+without a `.y' suffix is currently broken. The basename of the output
+file can be changed by the `%file-prefix' directive or the
+`-p'/`--name-prefix' option. The entire output file name can be
+changed by the `%output' directive or the `-o'/`--output' option. The
+output file contains a single class for the parser.
+
+ You can create documentation for generated parsers using Javadoc.
+
+ Contrary to C parsers, Java parsers do not use global variables; the
+state of the parser is always local to an instance of the parser class.
+Therefore, all Java parsers are "pure", and the `%pure-parser' and
+`%define api.pure' directives does not do anything when used in Java.
+
+ Push parsers are currently unsupported in Java and `%define
+api.push_pull' have no effect.
+
+ GLR parsers are currently unsupported in Java. Do not use the
+`glr-parser' directive.
+
+ No header file can be generated for Java parsers. Do not use the
+`%defines' directive or the `-d'/`--defines' options.
+
+ Currently, support for debugging and verbose errors are always
+compiled in. Thus the `%debug' and `%token-table' directives and the
+`-t'/`--debug' and `-k'/`--token-table' options have no effect. This
+may change in the future to eliminate unused code in the generated
+parser, so use `%debug' and `%verbose-error' explicitly if needed.
+Also, in the future the `%token-table' directive might enable a public
+interface to access the token names and codes.
+
+
+File: bison.info, Node: Java Semantic Values, Next: Java Location Values, Prev: Java Bison Interface, Up: Java Parsers
+
+10.2.2 Java Semantic Values
+---------------------------
+
+There is no `%union' directive in Java parsers. Instead, the semantic
+values' types (class names) should be specified in the `%type' or
+`%token' directive:
+
+ %type <Expression> expr assignment_expr term factor
+ %type <Integer> number
+
+ By default, the semantic stack is declared to have `Object' members,
+which means that the class types you specify can be of any class. To
+improve the type safety of the parser, you can declare the common
+superclass of all the semantic values using the `%define stype'
+directive. For example, after the following declaration:
+
+ %define stype "ASTNode"
+
+any `%type' or `%token' specifying a semantic type which is not a
+subclass of ASTNode, will cause a compile-time error.
+
+ Types used in the directives may be qualified with a package name.
+Primitive data types are accepted for Java version 1.5 or later. Note
+that in this case the autoboxing feature of Java 1.5 will be used.
+Generic types may not be used; this is due to a limitation in the
+implementation of Bison, and may change in future releases.
+
+ Java parsers do not support `%destructor', since the language adopts
+garbage collection. The parser will try to hold references to semantic
+values for as little time as needed.
+
+ Java parsers do not support `%printer', as `toString()' can be used
+to print the semantic values. This however may change (in a
+backwards-compatible way) in future versions of Bison.
+
+
+File: bison.info, Node: Java Location Values, Next: Java Parser Interface, Prev: Java Semantic Values, Up: Java Parsers
+
+10.2.3 Java Location Values
+---------------------------
+
+When the directive `%locations' is used, the Java parser supports
+location tracking, see *Note Locations Overview: Locations. An
+auxiliary user-defined class defines a "position", a single point in a
+file; Bison itself defines a class representing a "location", a range
+composed of a pair of positions (possibly spanning several files). The
+location class is an inner class of the parser; the name is `Location'
+by default, and may also be renamed using `%define location_type
+"CLASS-NAME'.
+
+ The location class treats the position as a completely opaque value.
+By default, the class name is `Position', but this can be changed with
+`%define position_type "CLASS-NAME"'. This class must be supplied by
+the user.
+
+ -- Instance Variable of Location: Position begin
+ -- Instance Variable of Location: Position end
+ The first, inclusive, position of the range, and the first beyond.
+
+ -- Constructor on Location: Location (Position LOC)
+ Create a `Location' denoting an empty range located at a given
+ point.
+
+ -- Constructor on Location: Location (Position BEGIN, Position END)
+ Create a `Location' from the endpoints of the range.
+
+ -- Method on Location: String toString ()
+ Prints the range represented by the location. For this to work
+ properly, the position class should override the `equals' and
+ `toString' methods appropriately.
+
+
+File: bison.info, Node: Java Parser Interface, Next: Java Scanner Interface, Prev: Java Location Values, Up: Java Parsers
+
+10.2.4 Java Parser Interface
+----------------------------
+
+The name of the generated parser class defaults to `YYParser'. The
+`YY' prefix may be changed using the `%name-prefix' directive or the
+`-p'/`--name-prefix' option. Alternatively, use `%define
+parser_class_name "NAME"' to give a custom name to the class. The
+interface of this class is detailed below.
+
+ By default, the parser class has package visibility. A declaration
+`%define public' will change to public visibility. Remember that,
+according to the Java language specification, the name of the `.java'
+file should match the name of the class in this case. Similarly, you
+can use `abstract', `final' and `strictfp' with the `%define'
+declaration to add other modifiers to the parser class.
+
+ The Java package name of the parser class can be specified using the
+`%define package' directive. The superclass and the implemented
+interfaces of the parser class can be specified with the `%define
+extends' and `%define implements' directives.
+
+ The parser class defines an inner class, `Location', that is used
+for location tracking (see *Note Java Location Values::), and a inner
+interface, `Lexer' (see *Note Java Scanner Interface::). Other than
+these inner class/interface, and the members described in the interface
+below, all the other members and fields are preceded with a `yy' or
+`YY' prefix to avoid clashes with user code.
+
+ The parser class can be extended using the `%parse-param' directive.
+Each occurrence of the directive will add a `protected final' field to
+the parser class, and an argument to its constructor, which initialize
+them automatically.
+
+ Token names defined by `%token' and the predefined `EOF' token name
+are added as constant fields to the parser class.
+
+ -- Constructor on YYParser: YYParser (LEX_PARAM, ..., PARSE_PARAM,
+ ...)
+ Build a new parser object with embedded `%code lexer'. There are
+ no parameters, unless `%parse-param's and/or `%lex-param's are
+ used.
+
+ -- Constructor on YYParser: YYParser (Lexer LEXER, PARSE_PARAM, ...)
+ Build a new parser object using the specified scanner. There are
+ no additional parameters unless `%parse-param's are used.
+
+ If the scanner is defined by `%code lexer', this constructor is
+ declared `protected' and is called automatically with a scanner
+ created with the correct `%lex-param's.
+
+ -- Method on YYParser: boolean parse ()
+ Run the syntactic analysis, and return `true' on success, `false'
+ otherwise.
+
+ -- Method on YYParser: boolean recovering ()
+ During the syntactic analysis, return `true' if recovering from a
+ syntax error. *Note Error Recovery::.
+
+ -- Method on YYParser: java.io.PrintStream getDebugStream ()
+ -- Method on YYParser: void setDebugStream (java.io.printStream O)
+ Get or set the stream used for tracing the parsing. It defaults to
+ `System.err'.
+
+ -- Method on YYParser: int getDebugLevel ()
+ -- Method on YYParser: void setDebugLevel (int L)
+ Get or set the tracing level. Currently its value is either 0, no
+ trace, or nonzero, full tracing.
+
+
+File: bison.info, Node: Java Scanner Interface, Next: Java Action Features, Prev: Java Parser Interface, Up: Java Parsers
+
+10.2.5 Java Scanner Interface
+-----------------------------
+
+There are two possible ways to interface a Bison-generated Java parser
+with a scanner: the scanner may be defined by `%code lexer', or defined
+elsewhere. In either case, the scanner has to implement the `Lexer'
+inner interface of the parser class.
+
+ In the first case, the body of the scanner class is placed in `%code
+lexer' blocks. If you want to pass parameters from the parser
+constructor to the scanner constructor, specify them with `%lex-param';
+they are passed before `%parse-param's to the constructor.
+
+ In the second case, the scanner has to implement the `Lexer'
+interface, which is defined within the parser class (e.g.,
+`YYParser.Lexer'). The constructor of the parser object will then
+accept an object implementing the interface; `%lex-param' is not used
+in this case.
+
+ In both cases, the scanner has to implement the following methods.
+
+ -- Method on Lexer: void yyerror (Location LOC, String MSG)
+ This method is defined by the user to emit an error message. The
+ first parameter is omitted if location tracking is not active.
+ Its type can be changed using `%define location_type "CLASS-NAME".'
+
+ -- Method on Lexer: int yylex ()
+ Return the next token. Its type is the return value, its semantic
+ value and location are saved and returned by the ther methods in
+ the interface.
+
+ Use `%define lex_throws' to specify any uncaught exceptions.
+ Default is `java.io.IOException'.
+
+ -- Method on Lexer: Position getStartPos ()
+ -- Method on Lexer: Position getEndPos ()
+ Return respectively the first position of the last token that
+ `yylex' returned, and the first position beyond it. These methods
+ are not needed unless location tracking is active.
+
+ The return type can be changed using `%define position_type
+ "CLASS-NAME".'
+
+ -- Method on Lexer: Object getLVal ()
+ Return the semantical value of the last token that yylex returned.
+
+ The return type can be changed using `%define stype "CLASS-NAME".'
+
+
+File: bison.info, Node: Java Action Features, Next: Java Differences, Prev: Java Scanner Interface, Up: Java Parsers
+
+10.2.6 Special Features for Use in Java Actions
+-----------------------------------------------
+
+The following special constructs can be uses in Java actions. Other
+analogous C action features are currently unavailable for Java.
+
+ Use `%define throws' to specify any uncaught exceptions from parser
+actions, and initial actions specified by `%initial-action'.
+
+ -- Variable: $N
+ The semantic value for the Nth component of the current rule.
+ This may not be assigned to. *Note Java Semantic Values::.
+
+ -- Variable: $<TYPEALT>N
+ Like `$N' but specifies a alternative type TYPEALT. *Note Java
+ Semantic Values::.
+
+ -- Variable: $$
+ The semantic value for the grouping made by the current rule. As a
+ value, this is in the base type (`Object' or as specified by
+ `%define stype') as in not cast to the declared subtype because
+ casts are not allowed on the left-hand side of Java assignments.
+ Use an explicit Java cast if the correct subtype is needed. *Note
+ Java Semantic Values::.
+
+ -- Variable: $<TYPEALT>$
+ Same as `$$' since Java always allow assigning to the base type.
+ Perhaps we should use this and `$<>$' for the value and `$$' for
+ setting the value but there is currently no easy way to distinguish
+ these constructs. *Note Java Semantic Values::.
+
+ -- Variable: @N
+ The location information of the Nth component of the current rule.
+ This may not be assigned to. *Note Java Location Values::.
+
+ -- Variable: @$
+ The location information of the grouping made by the current rule.
+ *Note Java Location Values::.
+
+ -- Statement: return YYABORT;
+ Return immediately from the parser, indicating failure. *Note
+ Java Parser Interface::.
+
+ -- Statement: return YYACCEPT;
+ Return immediately from the parser, indicating success. *Note
+ Java Parser Interface::.
+
+ -- Statement: return YYERROR;
+ Start error recovery without printing an error message. *Note
+ Error Recovery::.
+
+ -- Statement: return YYFAIL;
+ Print an error message and start error recovery. *Note Error
+ Recovery::.
+
+ -- Function: boolean recovering ()
+ 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. *Note Error Recovery::.
+
+ -- Function: protected void yyerror (String msg)
+ -- Function: protected void yyerror (Position pos, String msg)
+ -- Function: protected void yyerror (Location loc, String msg)
+ Print an error message using the `yyerror' method of the scanner
+ instance in use.
+
+
+File: bison.info, Node: Java Differences, Next: Java Declarations Summary, Prev: Java Action Features, Up: Java Parsers
+
+10.2.7 Differences between C/C++ and Java Grammars
+--------------------------------------------------
+
+The different structure of the Java language forces several differences
+between C/C++ grammars, and grammars designed for Java parsers. This
+section summarizes these differences.
+
+ * Java lacks a preprocessor, so the `YYERROR', `YYACCEPT', `YYABORT'
+ symbols (*note Table of Symbols::) cannot obviously be macros.
+ Instead, they should be preceded by `return' when they appear in
+ an action. The actual definition of these symbols is opaque to
+ the Bison grammar, and it might change in the future. The only
+ meaningful operation that you can do, is to return them. See
+ *note Java Action Features::.
+
+ Note that of these three symbols, only `YYACCEPT' and `YYABORT'
+ will cause a return from the `yyparse' method(1).
+
+ * Java lacks unions, so `%union' has no effect. Instead, semantic
+ values have a common base type: `Object' or as specified by
+ `%define stype'. Angle backets on `%token', `type', `$N' and `$$'
+ specify subtypes rather than fields of an union. The type of
+ `$$', even with angle brackets, is the base type since Java casts
+ are not allow on the left-hand side of assignments. Also, `$N'
+ and `@N' are not allowed on the left-hand side of assignments. See
+ *note Java Semantic Values:: and *note Java Action Features::.
+
+ * The prolog declarations have a different meaning than in C/C++
+ code.
+ `%code imports'
+ blocks are placed at the beginning of the Java source code.
+ They may include copyright notices. For a `package'
+ declarations, it is suggested to use `%define package'
+ instead.
+
+ unqualified `%code'
+ blocks are placed inside the parser class.
+
+ `%code lexer'
+ blocks, if specified, should include the implementation of the
+ scanner. If there is no such block, the scanner can be any
+ class that implements the appropriate interface (see *note
+ Java Scanner Interface::).
+
+ Other `%code' blocks are not supported in Java parsers. In
+ particular, `%{ ... %}' blocks should not be used and may give an
+ error in future versions of Bison.
+
+ The epilogue has the same meaning as in C/C++ code and it can be
+ used to define other classes used by the parser _outside_ the
+ parser class.
+
+ ---------- Footnotes ----------
+
+ (1) Java parsers include the actions in a separate method than
+`yyparse' in order to have an intuitive syntax that corresponds to
+these C macros.
+
+
+File: bison.info, Node: Java Declarations Summary, Prev: Java Differences, Up: Java Parsers
+
+10.2.8 Java Declarations Summary
+--------------------------------
+
+This summary only include declarations specific to Java or have special
+meaning when used in a Java parser.
+
+ -- Directive: %language "Java"
+ Generate a Java class for the parser.
+
+ -- Directive: %lex-param {TYPE NAME}
+ A parameter for the lexer class defined by `%code lexer' _only_,
+ added as parameters to the lexer constructor and the parser
+ constructor that _creates_ a lexer. Default is none. *Note Java
+ Scanner Interface::.
+
+ -- Directive: %name-prefix "PREFIX"
+ The prefix of the parser class name `PREFIXParser' if `%define
+ parser_class_name' is not used. Default is `YY'. *Note Java
+ Bison Interface::.
+
+ -- Directive: %parse-param {TYPE NAME}
+ A parameter for the parser class added as parameters to
+ constructor(s) and as fields initialized by the constructor(s).
+ Default is none. *Note Java Parser Interface::.
+
+ -- Directive: %token <TYPE> TOKEN ...
+ Declare tokens. Note that the angle brackets enclose a Java
+ _type_. *Note Java Semantic Values::.
+
+ -- Directive: %type <TYPE> NONTERMINAL ...
+ Declare the type of nonterminals. Note that the angle brackets
+ enclose a Java _type_. *Note Java Semantic Values::.
+
+ -- Directive: %code { CODE ... }
+ Code appended to the inside of the parser class. *Note Java
+ Differences::.
+
+ -- Directive: %code imports { CODE ... }
+ Code inserted just after the `package' declaration. *Note Java
+ Differences::.
+
+ -- Directive: %code lexer { CODE ... }
+ Code added to the body of a inner lexer class within the parser
+ class. *Note Java Scanner Interface::.
+
+ -- Directive: %% CODE ...
+ Code (after the second `%%') appended to the end of the file,
+ _outside_ the parser class. *Note Java Differences::.
+
+ -- Directive: %{ CODE ... %}
+ Not supported. Use `%code import' instead. *Note Java
+ Differences::.
+
+ -- Directive: %define abstract
+ Whether the parser class is declared `abstract'. Default is false.
+ *Note Java Bison Interface::.
+
+ -- Directive: %define extends "SUPERCLASS"
+ The superclass of the parser class. Default is none. *Note Java
+ Bison Interface::.
+
+ -- Directive: %define final
+ Whether the parser class is declared `final'. Default is false.
+ *Note Java Bison Interface::.
+
+ -- Directive: %define implements "INTERFACES"
+ The implemented interfaces of the parser class, a comma-separated
+ list. Default is none. *Note Java Bison Interface::.
+
+ -- Directive: %define lex_throws "EXCEPTIONS"
+ The exceptions thrown by the `yylex' method of the lexer, a
+ comma-separated list. Default is `java.io.IOException'. *Note
+ Java Scanner Interface::.
+
+ -- Directive: %define location_type "CLASS"
+ The name of the class used for locations (a range between two
+ positions). This class is generated as an inner class of the
+ parser class by `bison'. Default is `Location'. *Note Java
+ Location Values::.
+
+ -- Directive: %define package "PACKAGE"
+ The package to put the parser class in. Default is none. *Note
+ Java Bison Interface::.
+
+ -- Directive: %define parser_class_name "NAME"
+ The name of the parser class. Default is `YYParser' or
+ `NAME-PREFIXParser'. *Note Java Bison Interface::.
+
+ -- Directive: %define position_type "CLASS"
+ The name of the class used for positions. This class must be
+ supplied by the user. Default is `Position'. *Note Java Location
+ Values::.
+
+ -- Directive: %define public
+ Whether the parser class is declared `public'. Default is false.
+ *Note Java Bison Interface::.
+
+ -- Directive: %define stype "CLASS"
+ The base type of semantic values. Default is `Object'. *Note
+ Java Semantic Values::.
+
+ -- Directive: %define strictfp
+ Whether the parser class is declared `strictfp'. Default is false.
+ *Note Java Bison Interface::.
+
+ -- Directive: %define throws "EXCEPTIONS"
+ The exceptions thrown by user-supplied parser actions and
+ `%initial-action', a comma-separated list. Default is none.
+ *Note Java Parser Interface::.
+
+
+File: bison.info, Node: FAQ, Next: Table of Symbols, Prev: Other Languages, Up: Top
+
+11 Frequently Asked Questions
+*****************************
+
+Several questions about Bison come up occasionally. Here some of them
+are addressed.
+
+* Menu:
+
+* Memory Exhausted:: Breaking the Stack Limits
+* How Can I Reset the Parser:: `yyparse' Keeps some State
+* Strings are Destroyed:: `yylval' Loses Track of Strings
+* Implementing Gotos/Loops:: Control Flow in the Calculator
+* Multiple start-symbols:: Factoring closely related grammars
+* Secure? Conform?:: Is Bison POSIX safe?
+* I can't build Bison:: Troubleshooting
+* Where can I find help?:: Troubleshouting
+* Bug Reports:: Troublereporting
+* More Languages:: Parsers in C++, Java, and so on
+* Beta Testing:: Experimenting development versions
+* Mailing Lists:: Meeting other Bison users
+
+
+File: bison.info, Node: Memory Exhausted, Next: How Can I Reset the Parser, Up: FAQ
+
+11.1 Memory Exhausted
+=====================
+
+ My parser returns with error with a `memory exhausted'
+ message. What can I do?
+
+ This question is already addressed elsewhere, *Note Recursive Rules:
+Recursion.
+
+
+File: bison.info, Node: How Can I Reset the Parser, Next: Strings are Destroyed, Prev: Memory Exhausted, Up: FAQ
+
+11.2 How Can I Reset the Parser
+===============================
+
+The following phenomenon has several symptoms, resulting in the
+following typical questions:
+
+ I invoke `yyparse' several times, and on correct input it works
+ properly; but when a parse error is found, all the other calls fail
+ too. How can I reset the error flag of `yyparse'?
+
+or
+
+ My parser includes support for an `#include'-like feature, in
+ which case I run `yyparse' from `yyparse'. This fails
+ although I did specify `%define api.pure'.
+
+ These problems typically come not from Bison itself, but from
+Lex-generated scanners. Because these scanners use large buffers for
+speed, they might not notice a change of input file. As a
+demonstration, consider the following source file, `first-line.l':
+
+
+%{
+#include <stdio.h>
+#include <stdlib.h>
+%}
+%%
+.*\n ECHO; return 1;
+%%
+int
+yyparse (char const *file)
+{
+ yyin = fopen (file, "r");
+ if (!yyin)
+ exit (2);
+ /* One token only. */
+ yylex ();
+ if (fclose (yyin) != 0)
+ exit (3);
+ return 0;
+}
+
+int
+main (void)
+{
+ yyparse ("input");
+ yyparse ("input");
+ return 0;
+}
+
+If the file `input' contains
+
+
+input:1: Hello,
+input:2: World!
+
+then instead of getting the first line twice, you get:
+
+ $ flex -ofirst-line.c first-line.l
+ $ gcc -ofirst-line first-line.c -ll
+ $ ./first-line
+ input:1: Hello,
+ input:2: World!
+
+ Therefore, whenever you change `yyin', you must tell the
+Lex-generated scanner to discard its current buffer and switch to the
+new one. This depends upon your implementation of Lex; see its
+documentation for more. For Flex, it suffices to call
+`YY_FLUSH_BUFFER' after each change to `yyin'. If your Flex-generated
+scanner needs to read from several input streams to handle features
+like include files, you might consider using Flex functions like
+`yy_switch_to_buffer' that manipulate multiple input buffers.
+
+ If your Flex-generated scanner uses start conditions (*note Start
+conditions: (flex)Start conditions.), you might also want to reset the
+scanner's state, i.e., go back to the initial start condition, through
+a call to `BEGIN (0)'.
+
+
+File: bison.info, Node: Strings are Destroyed, Next: Implementing Gotos/Loops, Prev: How Can I Reset the Parser, Up: FAQ
+
+11.3 Strings are Destroyed
+==========================
+
+ My parser seems to destroy old strings, or maybe it loses track of
+ them. Instead of reporting `"foo", "bar"', it reports
+ `"bar", "bar"', or even `"foo\nbar", "bar"'.
+
+ This error is probably the single most frequent "bug report" sent to
+Bison lists, but is only concerned with a misunderstanding of the role
+of the scanner. Consider the following Lex code:
+
+
+%{
+#include <stdio.h>
+char *yylval = NULL;
+%}
+%%
+.* yylval = yytext; return 1;
+\n /* IGNORE */
+%%
+int
+main ()
+{
+ /* Similar to using $1, $2 in a Bison action. */
+ char *fst = (yylex (), yylval);
+ char *snd = (yylex (), yylval);
+ printf ("\"%s\", \"%s\"\n", fst, snd);
+ return 0;
+}
+
+ If you compile and run this code, you get:
+
+ $ flex -osplit-lines.c split-lines.l
+ $ gcc -osplit-lines split-lines.c -ll
+ $ printf 'one\ntwo\n' | ./split-lines
+ "one
+ two", "two"
+
+this is because `yytext' is a buffer provided for _reading_ in the
+action, but if you want to keep it, you have to duplicate it (e.g.,
+using `strdup'). Note that the output may depend on how your
+implementation of Lex handles `yytext'. For instance, when given the
+Lex compatibility option `-l' (which triggers the option `%array') Flex
+generates a different behavior:
+
+ $ flex -l -osplit-lines.c split-lines.l
+ $ gcc -osplit-lines split-lines.c -ll
+ $ printf 'one\ntwo\n' | ./split-lines
+ "two", "two"
+
+
+File: bison.info, Node: Implementing Gotos/Loops, Next: Multiple start-symbols, Prev: Strings are Destroyed, Up: FAQ
+
+11.4 Implementing Gotos/Loops
+=============================
+
+ My simple calculator supports variables, assignments, and functions,
+ but how can I implement gotos, or loops?
+
+ Although very pedagogical, the examples included in the document blur
+the distinction to make between the parser--whose job is to recover the
+structure of a text and to transmit it to subsequent modules of the
+program--and the processing (such as the execution) of this structure.
+This works well with so called straight line programs, i.e., precisely
+those that have a straightforward execution model: execute simple
+instructions one after the others.
+
+ If you want a richer model, you will probably need to use the parser
+to construct a tree that does represent the structure it has recovered;
+this tree is usually called the "abstract syntax tree", or "AST" for
+short. Then, walking through this tree, traversing it in various ways,
+will enable treatments such as its execution or its translation, which
+will result in an interpreter or a compiler.
+
+ This topic is way beyond the scope of this manual, and the reader is
+invited to consult the dedicated literature.
+
+
+File: bison.info, Node: Multiple start-symbols, Next: Secure? Conform?, Prev: Implementing Gotos/Loops, Up: FAQ
+
+11.5 Multiple start-symbols
+===========================
+
+ I have several closely related grammars, and I would like to share their
+ implementations. In fact, I could use a single grammar but with
+ multiple entry points.
+
+ Bison does not support multiple start-symbols, but there is a very
+simple means to simulate them. If `foo' and `bar' are the two pseudo
+start-symbols, then introduce two new tokens, say `START_FOO' and
+`START_BAR', and use them as switches from the real start-symbol:
+
+ %token START_FOO START_BAR;
+ %start start;
+ start: START_FOO foo
+ | START_BAR bar;
+
+ These tokens prevents the introduction of new conflicts. As far as
+the parser goes, that is all that is needed.
+
+ Now the difficult part is ensuring that the scanner will send these
+tokens first. If your scanner is hand-written, that should be
+straightforward. If your scanner is generated by Lex, them there is
+simple means to do it: recall that anything between `%{ ... %}' after
+the first `%%' is copied verbatim in the top of the generated `yylex'
+function. Make sure a variable `start_token' is available in the
+scanner (e.g., a global variable or using `%lex-param' etc.), and use
+the following:
+
+ /* Prologue. */
+ %%
+ %{
+ if (start_token)
+ {
+ int t = start_token;
+ start_token = 0;
+ return t;
+ }
+ %}
+ /* The rules. */
+
+
+File: bison.info, Node: Secure? Conform?, Next: I can't build Bison, Prev: Multiple start-symbols, Up: FAQ
+
+11.6 Secure? Conform?
+======================
+
+ Is Bison secure? Does it conform to POSIX?
+
+ If you're looking for a guarantee or certification, we don't provide
+it. However, Bison is intended to be a reliable program that conforms
+to the POSIX specification for Yacc. If you run into problems, please
+send us a bug report.
+
+
+File: bison.info, Node: I can't build Bison, Next: Where can I find help?, Prev: Secure? Conform?, Up: FAQ
+
+11.7 I can't build Bison
+========================
+
+ I can't build Bison because `make' complains that
+ `msgfmt' is not found.
+ What should I do?
+
+ Like most GNU packages with internationalization support, that
+feature is turned on by default. If you have problems building in the
+`po' subdirectory, it indicates that your system's internationalization
+support is lacking. You can re-configure Bison with `--disable-nls' to
+turn off this support, or you can install GNU gettext from
+`ftp://ftp.gnu.org/gnu/gettext/' and re-configure Bison. See the file
+`ABOUT-NLS' for more information.
+
+
+File: bison.info, Node: Where can I find help?, Next: Bug Reports, Prev: I can't build Bison, Up: FAQ
+
+11.8 Where can I find help?
+===========================
+
+ I'm having trouble using Bison. Where can I find help?
+
+ First, read this fine manual. Beyond that, you can send mail to
+<help-bison@gnu.org>. This mailing list is intended to be populated
+with people who are willing to answer questions about using and
+installing Bison. Please keep in mind that (most of) the people on the
+list have aspects of their lives which are not related to Bison (!), so
+you may not receive an answer to your question right away. This can be
+frustrating, but please try not to honk them off; remember that any
+help they provide is purely voluntary and out of the kindness of their
+hearts.
+
+
+File: bison.info, Node: Bug Reports, Next: More Languages, Prev: Where can I find help?, Up: FAQ
+
+11.9 Bug Reports
+================
+
+ I found a bug. What should I include in the bug report?
+
+ Before you send a bug report, make sure you are using the latest
+version. Check `ftp://ftp.gnu.org/pub/gnu/bison/' or one of its
+mirrors. Be sure to include the version number in your bug report. If
+the bug is present in the latest version but not in a previous version,
+try to determine the most recent version which did not contain the bug.
+
+ If the bug is parser-related, you should include the smallest grammar
+you can which demonstrates the bug. The grammar file should also be
+complete (i.e., I should be able to run it through Bison without having
+to edit or add anything). The smaller and simpler the grammar, the
+easier it will be to fix the bug.
+
+ Include information about your compilation environment, including
+your operating system's name and version and your compiler's name and
+version. If you have trouble compiling, you should also include a
+transcript of the build session, starting with the invocation of
+`configure'. Depending on the nature of the bug, you may be asked to
+send additional files as well (such as `config.h' or `config.cache').
+
+ Patches are most welcome, but not required. That is, do not
+hesitate to send a bug report just because you can not provide a fix.
+
+ Send bug reports to <bug-bison@gnu.org>.
+
+
+File: bison.info, Node: More Languages, Next: Beta Testing, Prev: Bug Reports, Up: FAQ
+
+11.10 More Languages
+====================
+
+ Will Bison ever have C++ and Java support? How about INSERT YOUR
+ FAVORITE LANGUAGE HERE?
+
+ C++ and Java support is there now, and is documented. We'd love to
+add other languages; contributions are welcome.
+
+
+File: bison.info, Node: Beta Testing, Next: Mailing Lists, Prev: More Languages, Up: FAQ
+
+11.11 Beta Testing
+==================
+
+ What is involved in being a beta tester?
+
+ It's not terribly involved. Basically, you would download a test
+release, compile it, and use it to build and run a parser or two. After
+that, you would submit either a bug report or a message saying that
+everything is okay. It is important to report successes as well as
+failures because test releases eventually become mainstream releases,
+but only if they are adequately tested. If no one tests, development is
+essentially halted.
+
+ Beta testers are particularly needed for operating systems to which
+the developers do not have easy access. They currently have easy
+access to recent GNU/Linux and Solaris versions. Reports about other
+operating systems are especially welcome.
+
+
+File: bison.info, Node: Mailing Lists, Prev: Beta Testing, Up: FAQ
+
+11.12 Mailing Lists
+===================
+
+ How do I join the help-bison and bug-bison mailing lists?
+
+ See `http://lists.gnu.org/'.
+
+
+File: bison.info, Node: Table of Symbols, Next: Glossary, Prev: FAQ, Up: Top
+
+Appendix A Bison Symbols
+************************
+
+ -- Variable: @$
+ In an action, the location of the left-hand side of the rule.
+ *Note Locations Overview: Locations.
+
+ -- Variable: @N
+ In an action, the location of the N-th symbol of the right-hand
+ side of the rule. *Note Locations Overview: Locations.
+
+ -- Variable: $$
+ In an action, the semantic value of the left-hand side of the rule.
+ *Note Actions::.
+
+ -- Variable: $N
+ In an action, the semantic value of the N-th symbol of the
+ right-hand side of the rule. *Note Actions::.
+
+ -- Delimiter: %%
+ Delimiter used to separate the grammar rule section from the Bison
+ declarations section or the epilogue. *Note The Overall Layout of
+ a Bison Grammar: Grammar Layout.
+
+ -- Delimiter: %{CODE%}
+ All code listed between `%{' and `%}' is copied directly to the
+ output file uninterpreted. Such code forms the prologue of the
+ input file. *Note Outline of a Bison Grammar: Grammar Outline.
+
+ -- Construct: /*...*/
+ Comment delimiters, as in C.
+
+ -- Delimiter: :
+ Separates a rule's result from its components. *Note Syntax of
+ Grammar Rules: Rules.
+
+ -- Delimiter: ;
+ Terminates a rule. *Note Syntax of Grammar Rules: Rules.
+
+ -- Delimiter: |
+ Separates alternate rules for the same result nonterminal. *Note
+ Syntax of Grammar Rules: Rules.
+
+ -- Directive: <*>
+ Used to define a default tagged `%destructor' or default tagged
+ `%printer'.
+
+ This feature is experimental. More user feedback will help to
+ determine whether it should become a permanent feature.
+
+ *Note Freeing Discarded Symbols: Destructor Decl.
+
+ -- Directive: <>
+ Used to define a default tagless `%destructor' or default tagless
+ `%printer'.
+
+ This feature is experimental. More user feedback will help to
+ determine whether it should become a permanent feature.
+
+ *Note Freeing Discarded Symbols: Destructor Decl.
+
+ -- Symbol: $accept
+ The predefined nonterminal whose only rule is `$accept: START
+ $end', where START is the start symbol. *Note The Start-Symbol:
+ Start Decl. It cannot be used in the grammar.
+
+ -- Directive: %code {CODE}
+ -- Directive: %code QUALIFIER {CODE}
+ Insert CODE verbatim into output parser source. *Note %code: Decl
+ Summary.
+
+ -- Directive: %debug
+ Equip the parser for debugging. *Note Decl Summary::.
+
+ -- Directive: %debug
+ Equip the parser for debugging. *Note Decl Summary::.
+
+ -- Directive: %define DEFINE-VARIABLE
+ -- Directive: %define DEFINE-VARIABLE VALUE
+ Define a variable to adjust Bison's behavior. *Note %define: Decl
+ Summary.
+
+ -- Directive: %defines
+ Bison declaration to create a header file meant for the scanner.
+ *Note Decl Summary::.
+
+ -- Directive: %defines DEFINES-FILE
+ Same as above, but save in the file DEFINES-FILE. *Note Decl
+ Summary::.
+
+ -- Directive: %destructor
+ Specify how the parser should reclaim the memory associated to
+ discarded symbols. *Note Freeing Discarded Symbols: Destructor
+ Decl.
+
+ -- Directive: %dprec
+ Bison declaration to assign a precedence to a rule that is used at
+ parse time to resolve reduce/reduce conflicts. *Note Writing GLR
+ Parsers: GLR Parsers.
+
+ -- Symbol: $end
+ The predefined token marking the end of the token stream. It
+ cannot be used in the grammar.
+
+ -- Symbol: error
+ A token name reserved for error recovery. This token may be used
+ in grammar rules so as to allow the Bison parser to recognize an
+ error in the grammar without halting the process. In effect, a
+ sentence containing an error may be recognized as valid. On a
+ syntax error, the token `error' becomes the current lookahead
+ token. Actions corresponding to `error' are then executed, and
+ the lookahead token is reset to the token that originally caused
+ the violation. *Note Error Recovery::.
+
+ -- Directive: %error-verbose
+ Bison declaration to request verbose, specific error message
+ strings when `yyerror' is called.
+
+ -- Directive: %file-prefix "PREFIX"
+ Bison declaration to set the prefix of the output files. *Note
+ Decl Summary::.
+
+ -- Directive: %glr-parser
+ Bison declaration to produce a GLR parser. *Note Writing GLR
+ Parsers: GLR Parsers.
+
+ -- Directive: %initial-action
+ Run user code before parsing. *Note Performing Actions before
+ Parsing: Initial Action Decl.
+
+ -- Directive: %language
+ Specify the programming language for the generated parser. *Note
+ Decl Summary::.
+
+ -- Directive: %left
+ Bison declaration to assign left associativity to token(s). *Note
+ Operator Precedence: Precedence Decl.
+
+ -- Directive: %lex-param {ARGUMENT-DECLARATION}
+ Bison declaration to specifying an additional parameter that
+ `yylex' should accept. *Note Calling Conventions for Pure
+ Parsers: Pure Calling.
+
+ -- Directive: %merge
+ Bison declaration to assign a merging function to a rule. If
+ there is a reduce/reduce conflict with a rule having the same
+ merging function, the function is applied to the two semantic
+ values to get a single result. *Note Writing GLR Parsers: GLR
+ Parsers.
+
+ -- Directive: %name-prefix "PREFIX"
+ Bison declaration to rename the external symbols. *Note Decl
+ Summary::.
+
+ -- Directive: %no-lines
+ Bison declaration to avoid generating `#line' directives in the
+ parser file. *Note Decl Summary::.
+
+ -- Directive: %nonassoc
+ Bison declaration to assign nonassociativity to token(s). *Note
+ Operator Precedence: Precedence Decl.
+
+ -- Directive: %output "FILE"
+ Bison declaration to set the name of the parser file. *Note Decl
+ Summary::.
+
+ -- Directive: %parse-param {ARGUMENT-DECLARATION}
+ Bison declaration to specifying an additional parameter that
+ `yyparse' should accept. *Note The Parser Function `yyparse':
+ Parser Function.
+
+ -- Directive: %prec
+ Bison declaration to assign a precedence to a specific rule.
+ *Note Context-Dependent Precedence: Contextual Precedence.
+
+ -- Directive: %pure-parser
+ Deprecated version of `%define api.pure' (*note %define: Decl
+ Summary.), for which Bison is more careful to warn about
+ unreasonable usage.
+
+ -- Directive: %require "VERSION"
+ Require version VERSION or higher of Bison. *Note Require a
+ Version of Bison: Require Decl.
+
+ -- Directive: %right
+ Bison declaration to assign right associativity to token(s).
+ *Note Operator Precedence: Precedence Decl.
+
+ -- Directive: %skeleton
+ Specify the skeleton to use; usually for development. *Note Decl
+ Summary::.
+
+ -- Directive: %start
+ Bison declaration to specify the start symbol. *Note The
+ Start-Symbol: Start Decl.
+
+ -- Directive: %token
+ Bison declaration to declare token(s) without specifying
+ precedence. *Note Token Type Names: Token Decl.
+
+ -- Directive: %token-table
+ Bison declaration to include a token name table in the parser file.
+ *Note Decl Summary::.
+
+ -- Directive: %type
+ Bison declaration to declare nonterminals. *Note Nonterminal
+ Symbols: Type Decl.
+
+ -- Symbol: $undefined
+ The predefined token onto which all undefined values returned by
+ `yylex' are mapped. It cannot be used in the grammar, rather, use
+ `error'.
+
+ -- Directive: %union
+ Bison declaration to specify several possible data types for
+ semantic values. *Note The Collection of Value Types: Union Decl.
+
+ -- Macro: YYABORT
+ Macro to pretend that an unrecoverable syntax error has occurred,
+ by making `yyparse' return 1 immediately. The error reporting
+ function `yyerror' is not called. *Note The Parser Function
+ `yyparse': Parser Function.
+
+ For Java parsers, this functionality is invoked using `return
+ YYABORT;' instead.
+
+ -- Macro: YYACCEPT
+ Macro to pretend that a complete utterance of the language has been
+ read, by making `yyparse' return 0 immediately. *Note The Parser
+ Function `yyparse': Parser Function.
+
+ For Java parsers, this functionality is invoked using `return
+ YYACCEPT;' instead.
+
+ -- Macro: YYBACKUP
+ Macro to discard a value from the parser stack and fake a lookahead
+ token. *Note Special Features for Use in Actions: Action Features.
+
+ -- Variable: yychar
+ External integer variable that contains the integer value of the
+ lookahead token. (In a pure parser, it is a local variable within
+ `yyparse'.) Error-recovery rule actions may examine this variable.
+ *Note Special Features for Use in Actions: Action Features.
+
+ -- Variable: yyclearin
+ Macro used in error-recovery rule actions. It clears the previous
+ lookahead token. *Note Error Recovery::.
+
+ -- Macro: YYDEBUG
+ Macro to define to equip the parser with tracing code. *Note
+ Tracing Your Parser: Tracing.
+
+ -- Variable: yydebug
+ External integer variable set to zero by default. If `yydebug' is
+ given a nonzero value, the parser will output information on input
+ symbols and parser action. *Note Tracing Your Parser: Tracing.
+
+ -- Macro: yyerrok
+ Macro to cause parser to recover immediately to its normal mode
+ after a syntax error. *Note Error Recovery::.
+
+ -- Macro: YYERROR
+ Macro to pretend that a syntax error has just been detected: call
+ `yyerror' and then perform normal error recovery if possible
+ (*note Error Recovery::), or (if recovery is impossible) make
+ `yyparse' return 1. *Note Error Recovery::.
+
+ For Java parsers, this functionality is invoked using `return
+ YYERROR;' instead.
+
+ -- Function: yyerror
+ User-supplied function to be called by `yyparse' on error. *Note
+ The Error Reporting Function `yyerror': Error Reporting.
+
+ -- Macro: YYERROR_VERBOSE
+ An obsolete macro that you define with `#define' in the prologue
+ to request verbose, specific error message strings when `yyerror'
+ is called. It doesn't matter what definition you use for
+ `YYERROR_VERBOSE', just whether you define it. Using
+ `%error-verbose' is preferred.
+
+ -- Macro: YYINITDEPTH
+ Macro for specifying the initial size of the parser stack. *Note
+ Memory Management::.
+
+ -- Function: yylex
+ User-supplied lexical analyzer function, called with no arguments
+ to get the next token. *Note The Lexical Analyzer Function
+ `yylex': Lexical.
+
+ -- Macro: YYLEX_PARAM
+ An obsolete macro for specifying an extra argument (or list of
+ extra arguments) for `yyparse' to pass to `yylex'. The use of this
+ macro is deprecated, and is supported only for Yacc like parsers.
+ *Note Calling Conventions for Pure Parsers: Pure Calling.
+
+ -- Variable: yylloc
+ External variable in which `yylex' should place the line and column
+ numbers associated with a token. (In a pure parser, it is a local
+ variable within `yyparse', and its address is passed to `yylex'.)
+ You can ignore this variable if you don't use the `@' feature in
+ the grammar actions. *Note Textual Locations of Tokens: Token
+ Locations. In semantic actions, it stores the location of the
+ lookahead token. *Note Actions and Locations: Actions and
+ Locations.
+
+ -- Type: YYLTYPE
+ Data type of `yylloc'; by default, a structure with four members.
+ *Note Data Types of Locations: Location Type.
+
+ -- Variable: yylval
+ External variable in which `yylex' should place the semantic value
+ associated with a token. (In a pure parser, it is a local
+ variable within `yyparse', and its address is passed to `yylex'.)
+ *Note Semantic Values of Tokens: Token Values. In semantic
+ actions, it stores the semantic value of the lookahead token.
+ *Note Actions: Actions.
+
+ -- Macro: YYMAXDEPTH
+ Macro for specifying the maximum size of the parser stack. *Note
+ Memory Management::.
+
+ -- Variable: yynerrs
+ Global variable which Bison increments each time it reports a
+ syntax error. (In a pure parser, it is a local variable within
+ `yyparse'. In a pure push parser, it is a member of yypstate.)
+ *Note The Error Reporting Function `yyerror': Error Reporting.
+
+ -- Function: yyparse
+ The parser function produced by Bison; call this function to start
+ parsing. *Note The Parser Function `yyparse': Parser Function.
+
+ -- Function: yypstate_delete
+ The function to delete a parser instance, produced by Bison in
+ push mode; call this function to delete the memory associated with
+ a parser. *Note The Parser Delete Function `yypstate_delete':
+ Parser Delete Function. (The current push parsing interface is
+ experimental and may evolve. More user feedback will help to
+ stabilize it.)
+
+ -- Function: yypstate_new
+ The function to create a parser instance, produced by Bison in
+ push mode; call this function to create a new parser. *Note The
+ Parser Create Function `yypstate_new': Parser Create Function.
+ (The current push parsing interface is experimental and may evolve.
+ More user feedback will help to stabilize it.)
+
+ -- Function: yypull_parse
+ The parser function produced by Bison in push mode; call this
+ function to parse the rest of the input stream. *Note The Pull
+ Parser Function `yypull_parse': Pull Parser Function. (The
+ current push parsing interface is experimental and may evolve.
+ More user feedback will help to stabilize it.)
+
+ -- Function: yypush_parse
+ The parser function produced by Bison in push mode; call this
+ function to parse a single token. *Note The Push Parser Function
+ `yypush_parse': Push Parser Function. (The current push parsing
+ interface is experimental and may evolve. More user feedback will
+ help to stabilize it.)
+
+ -- Macro: YYPARSE_PARAM
+ An obsolete macro for specifying the name of a parameter that
+ `yyparse' should accept. The use of this macro is deprecated, and
+ is supported only for Yacc like parsers. *Note Calling
+ Conventions for Pure Parsers: Pure Calling.
+
+ -- Macro: YYRECOVERING
+ The expression `YYRECOVERING ()' yields 1 when the parser is
+ recovering from a syntax error, and 0 otherwise. *Note Special
+ Features for Use in Actions: Action Features.
+
+ -- Macro: YYSTACK_USE_ALLOCA
+ Macro used to control the use of `alloca' when the C LALR(1)
+ parser needs to extend its stacks. If defined to 0, the parser
+ will use `malloc' to extend its stacks. If defined to 1, the
+ parser will use `alloca'. Values other than 0 and 1 are reserved
+ for future Bison extensions. If not defined, `YYSTACK_USE_ALLOCA'
+ defaults to 0.
+
+ In the all-too-common case where your code may run on a host with a
+ limited stack and with unreliable stack-overflow checking, you
+ should set `YYMAXDEPTH' to a value that cannot possibly result in
+ unchecked stack overflow on any of your target hosts when `alloca'
+ is called. You can inspect the code that Bison generates in order
+ to determine the proper numeric values. This will require some
+ expertise in low-level implementation details.
+
+ -- Type: YYSTYPE
+ Data type of semantic values; `int' by default. *Note Data Types
+ of Semantic Values: Value Type.
+
+
+File: bison.info, Node: Glossary, Next: Copying This Manual, Prev: Table of Symbols, Up: Top
+
+Appendix B Glossary
+*******************
+
+Backus-Naur Form (BNF; also called "Backus Normal Form")
+ Formal method of specifying context-free grammars originally
+ proposed by John Backus, and slightly improved by Peter Naur in
+ his 1960-01-02 committee document contributing to what became the
+ Algol 60 report. *Note Languages and Context-Free Grammars:
+ Language and Grammar.
+
+Context-free grammars
+ Grammars specified as rules that can be applied regardless of
+ context. Thus, if there is a rule which says that an integer can
+ be used as an expression, integers are allowed _anywhere_ an
+ expression is permitted. *Note Languages and Context-Free
+ Grammars: Language and Grammar.
+
+Dynamic allocation
+ Allocation of memory that occurs during execution, rather than at
+ compile time or on entry to a function.
+
+Empty string
+ Analogous to the empty set in set theory, the empty string is a
+ character string of length zero.
+
+Finite-state stack machine
+ A "machine" that has discrete states in which it is said to exist
+ at each instant in time. As input to the machine is processed, the
+ machine moves from state to state as specified by the logic of the
+ machine. In the case of the parser, the input is the language
+ being parsed, and the states correspond to various stages in the
+ grammar rules. *Note The Bison Parser Algorithm: Algorithm.
+
+Generalized LR (GLR)
+ A parsing algorithm that can handle all context-free grammars,
+ including those that are not LALR(1). It resolves situations that
+ Bison's usual LALR(1) algorithm cannot by effectively splitting
+ off multiple parsers, trying all possible parsers, and discarding
+ those that fail in the light of additional right context. *Note
+ Generalized LR Parsing: Generalized LR Parsing.
+
+Grouping
+ A language construct that is (in general) grammatically divisible;
+ for example, `expression' or `declaration' in C. *Note Languages
+ and Context-Free Grammars: Language and Grammar.
+
+Infix operator
+ An arithmetic operator that is placed between the operands on
+ which it performs some operation.
+
+Input stream
+ A continuous flow of data between devices or programs.
+
+Language construct
+ One of the typical usage schemas of the language. For example,
+ one of the constructs of the C language is the `if' statement.
+ *Note Languages and Context-Free Grammars: Language and Grammar.
+
+Left associativity
+ Operators having left associativity are analyzed from left to
+ right: `a+b+c' first computes `a+b' and then combines with `c'.
+ *Note Operator Precedence: Precedence.
+
+Left recursion
+ A rule whose result symbol is also its first component symbol; for
+ example, `expseq1 : expseq1 ',' exp;'. *Note Recursive Rules:
+ Recursion.
+
+Left-to-right parsing
+ Parsing a sentence of a language by analyzing it token by token
+ from left to right. *Note The Bison Parser Algorithm: Algorithm.
+
+Lexical analyzer (scanner)
+ A function that reads an input stream and returns tokens one by
+ one. *Note The Lexical Analyzer Function `yylex': Lexical.
+
+Lexical tie-in
+ A flag, set by actions in the grammar rules, which alters the way
+ tokens are parsed. *Note Lexical Tie-ins::.
+
+Literal string token
+ A token which consists of two or more fixed characters. *Note
+ Symbols::.
+
+Lookahead token
+ A token already read but not yet shifted. *Note Lookahead Tokens:
+ Lookahead.
+
+LALR(1)
+ The class of context-free grammars that Bison (like most other
+ parser generators) can handle; a subset of LR(1). *Note
+ Mysterious Reduce/Reduce Conflicts: Mystery Conflicts.
+
+LR(1)
+ The class of context-free grammars in which at most one token of
+ lookahead is needed to disambiguate the parsing of any piece of
+ input.
+
+Nonterminal symbol
+ A grammar symbol standing for a grammatical construct that can be
+ expressed through rules in terms of smaller constructs; in other
+ words, a construct that is not a token. *Note Symbols::.
+
+Parser
+ A function that recognizes valid sentences of a language by
+ analyzing the syntax structure of a set of tokens passed to it
+ from a lexical analyzer.
+
+Postfix operator
+ An arithmetic operator that is placed after the operands upon
+ which it performs some operation.
+
+Reduction
+ Replacing a string of nonterminals and/or terminals with a single
+ nonterminal, according to a grammar rule. *Note The Bison Parser
+ Algorithm: Algorithm.
+
+Reentrant
+ A reentrant subprogram is a subprogram which can be in invoked any
+ number of times in parallel, without interference between the
+ various invocations. *Note A Pure (Reentrant) Parser: Pure Decl.
+
+Reverse polish notation
+ A language in which all operators are postfix operators.
+
+Right recursion
+ A rule whose result symbol is also its last component symbol; for
+ example, `expseq1: exp ',' expseq1;'. *Note Recursive Rules:
+ Recursion.
+
+Semantics
+ In computer languages, the semantics are specified by the actions
+ taken for each instance of the language, i.e., the meaning of each
+ statement. *Note Defining Language Semantics: Semantics.
+
+Shift
+ A parser is said to shift when it makes the choice of analyzing
+ further input from the stream rather than reducing immediately some
+ already-recognized rule. *Note The Bison Parser Algorithm:
+ Algorithm.
+
+Single-character literal
+ A single character that is recognized and interpreted as is.
+ *Note From Formal Rules to Bison Input: Grammar in Bison.
+
+Start symbol
+ The nonterminal symbol that stands for a complete valid utterance
+ in the language being parsed. The start symbol is usually listed
+ as the first nonterminal symbol in a language specification.
+ *Note The Start-Symbol: Start Decl.
+
+Symbol table
+ A data structure where symbol names and associated data are stored
+ during parsing to allow for recognition and use of existing
+ information in repeated uses of a symbol. *Note Multi-function
+ Calc::.
+
+Syntax error
+ An error encountered during parsing of an input stream due to
+ invalid syntax. *Note Error Recovery::.
+
+Token
+ A basic, grammatically indivisible unit of a language. The symbol
+ that describes a token in the grammar is a terminal symbol. The
+ input of the Bison parser is a stream of tokens which comes from
+ the lexical analyzer. *Note Symbols::.
+
+Terminal symbol
+ A grammar symbol that has no rules in the grammar and therefore is
+ grammatically indivisible. The piece of text it represents is a
+ token. *Note Languages and Context-Free Grammars: Language and
+ Grammar.
+
+
+File: bison.info, Node: Copying This Manual, Next: Index, Prev: Glossary, Up: Top
+
+Appendix C Copying This Manual
+******************************
+
+ Version 1.2, November 2002
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
+
+ This License is a kind of "copyleft", which means that derivative
+ works of the document must themselves be free in the same sense.
+ It complements the GNU General Public License, which is a copyleft
+ license designed for free software.
+
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to
+ software manuals; it can be used for any textual work, regardless
+ of subject matter or whether it is published as a printed book.
+ We recommend this License principally for works whose purpose is
+ instruction or reference.
+
+ 1. APPLICABILITY AND DEFINITIONS
+
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
+
+ A "Modified Version" of the Document means any work containing the
+ Document or a portion of it, either copied verbatim, or with
+ modifications and/or translated into another language.
+
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
+
+ The "Invariant Sections" are certain Secondary Sections whose
+ titles are designated, as being those of Invariant Sections, in
+ the notice that says that the Document is released under this
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
+
+ The "Cover Texts" are certain short passages of text that are
+ listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
+
+ A "Transparent" copy of the Document means a machine-readable copy,
+ represented in a format whose specification is available to the
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
+ composed of pixels) generic paint programs or (for drawings) some
+ widely available drawing editor, and that is suitable for input to
+ text formatters or for automatic translation to a variety of
+ formats suitable for input to text formatters. A copy made in an
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
+
+ Examples of suitable formats for Transparent copies include plain
+ ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
+
+ The "Title Page" means, for a printed book, the title page itself,
+ plus such following pages as are needed to hold, legibly, the
+ material this License requires to appear in the title page. For
+ works in formats which do not have any title page as such, "Title
+ Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.
+
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
+ 2. VERBATIM COPYING
+
+ You may copy and distribute the Document in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that you
+ add no other conditions whatsoever to those of this License. You
+ may not use technical measures to obstruct or control the reading
+ or further copying of the copies you make or distribute. However,
+ you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow
+ the conditions in section 3.
+
+ You may also lend copies, under the same conditions stated above,
+ and you may publicly display copies.
+
+ 3. COPYING IN QUANTITY
+
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The
+ front cover must present the full title with all words of the
+ title equally prominent and visible. You may add other material
+ on the covers in addition. Copying with changes limited to the
+ covers, as long as they preserve the title of the Document and
+ satisfy these conditions, can be treated as verbatim copying in
+ other respects.
+
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+
+ If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a
+ machine-readable Transparent copy along with each Opaque copy, or
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
+ latter option, you must take reasonably prudent steps, when you
+ begin distribution of Opaque copies in quantity, to ensure that
+ this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you
+ distribute an Opaque copy (directly or through your agents or
+ retailers) of that edition to the public.
+
+ It is requested, but not required, that you contact the authors of
+ the Document well before redistributing any large number of
+ copies, to give them a chance to provide you with an updated
+ version of the Document.
+
+ 4. MODIFICATIONS
+
+ You may copy and distribute a Modified Version of the Document
+ under the conditions of sections 2 and 3 above, provided that you
+ release the Modified Version under precisely this License, with
+ the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version to
+ whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:
+
+ A. Use in the Title Page (and on the covers, if any) a title
+ distinct from that of the Document, and from those of
+ previous versions (which should, if there were any, be listed
+ in the History section of the Document). You may use the
+ same title as a previous version if the original publisher of
+ that version gives permission.
+
+ B. List on the Title Page, as authors, one or more persons or
+ entities responsible for authorship of the modifications in
+ the Modified Version, together with at least five of the
+ principal authors of the Document (all of its principal
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
+
+ C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+
+ D. Preserve all the copyright notices of the Document.
+
+ E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+
+ F. Include, immediately after the copyright notices, a license
+ notice giving the public permission to use the Modified
+ Version under the terms of this License, in the form shown in
+ the Addendum below.
+
+ G. Preserve in that license notice the full lists of Invariant
+ Sections and required Cover Texts given in the Document's
+ license notice.
+
+ H. Include an unaltered copy of this License.
+
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
+ authors, and publisher of the Modified Version as given on
+ the Title Page. If there is no section Entitled "History" in
+ the Document, create one stating the title, year, authors,
+ and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in
+ the previous sentence.
+
+ J. Preserve the network location, if any, given in the Document
+ for public access to a Transparent copy of the Document, and
+ likewise the network locations given in the Document for
+ previous versions it was based on. These may be placed in
+ the "History" section. You may omit a network location for a
+ work that was published at least four years before the
+ Document itself, or if the original publisher of the version
+ it refers to gives permission.
+
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
+ acknowledgements and/or dedications given therein.
+
+ L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section
+ titles.
+
+ M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
+
+ If the Modified Version includes new front-matter sections or
+ appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option
+ designate some or all of these sections as invariant. To do this,
+ add their titles to the list of Invariant Sections in the Modified
+ Version's license notice. These titles must be distinct from any
+ other section titles.
+
+ You may add a section Entitled "Endorsements", provided it contains
+ nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+
+ You may add a passage of up to five words as a Front-Cover Text,
+ and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one
+ passage of Front-Cover Text and one of Back-Cover Text may be
+ added by (or through arrangements made by) any one entity. If the
+ Document already includes a cover text for the same cover,
+ previously added by you or by arrangement made by the same entity
+ you are acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+
+ The author(s) and publisher(s) of the Document do not by this
+ License give permission to use their names for publicity for or to
+ assert or imply endorsement of any Modified Version.
+
+ 5. COMBINING DOCUMENTS
+
+ You may combine the Document with other documents released under
+ this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination
+ all of the Invariant Sections of all of the original documents,
+ unmodified, and list them all as Invariant Sections of your
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
+
+ The combined work need only contain one copy of this License, and
+ multiple identical Invariant Sections may be replaced with a single
+ copy. If there are multiple Invariant Sections with the same name
+ but different contents, make the title of each such section unique
+ by adding at the end of it, in parentheses, the name of the
+ original author or publisher of that section if known, or else a
+ unique number. Make the same adjustment to the section titles in
+ the list of Invariant Sections in the license notice of the
+ combined work.
+
+ In the combination, you must combine any sections Entitled
+ "History" in the various original documents, forming one section
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
+
+ 6. COLLECTIONS OF DOCUMENTS
+
+ You may make a collection consisting of the Document and other
+ documents released under this License, and replace the individual
+ copies of this License in the various documents with a single copy
+ that is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+
+ You may extract a single document from such a collection, and
+ distribute it individually under this License, provided you insert
+ a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.
+
+ 7. AGGREGATION WITH INDEPENDENT WORKS
+
+ A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume of
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included in an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
+
+ If the Cover Text requirement of section 3 is applicable to these
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
+
+ 8. TRANSLATION
+
+ Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section
+ 4. Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include a
+ translation of this License, and all the license notices in the
+ Document, and any Warranty Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
+
+ 9. TERMINATION
+
+ You may not copy, modify, sublicense, or distribute the Document
+ except as expressly provided for under this License. Any other
+ attempt to copy, modify, sublicense or distribute the Document is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.
+
+ 10. FUTURE REVISIONS OF THIS LICENSE
+
+ The Free Software Foundation may publish new, revised versions of
+ the GNU Free Documentation License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns. See
+ `http://www.gnu.org/copyleft/'.
+
+ Each version of the License is given a distinguishing version
+ number. If the Document specifies that a particular numbered
+ version of this License "or any later version" applies to it, you
+ have the option of following the terms and conditions either of
+ that specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.
+
+ADDENDUM: How to use this License for your documents
+====================================================
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and license
+notices just after the title page:
+
+ Copyright (C) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+ If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License, to
+permit their use in free software.
+
+
+File: bison.info, Node: Index, Prev: Copying This Manual, Up: Top
+
+Index
+*****
+
+
+* Menu:
+
+* $ <1>: Table of Symbols. (line 19)
+* $ <2>: Action Features. (line 14)
+* $: Java Action Features.
+ (line 13)
+* $$ <1>: Action Features. (line 10)
+* $$ <2>: Java Action Features.
+ (line 21)
+* $$ <3>: Actions. (line 6)
+* $$: Table of Symbols. (line 15)
+* $< <1>: Java Action Features.
+ (line 17)
+* $< <2>: Action Features. (line 23)
+* $< <3>: Java Action Features.
+ (line 29)
+* $<: Action Features. (line 18)
+* $accept: Table of Symbols. (line 65)
+* $end: Table of Symbols. (line 104)
+* $N: Actions. (line 6)
+* $undefined: Table of Symbols. (line 212)
+* % <1>: Java Declarations Summary.
+ (line 53)
+* %: Table of Symbols. (line 28)
+* %% <1>: Table of Symbols. (line 23)
+* %%: Java Declarations Summary.
+ (line 49)
+* %code <1>: Table of Symbols. (line 71)
+* %code <2>: Prologue Alternatives.
+ (line 6)
+* %code <3>: Java Declarations Summary.
+ (line 37)
+* %code <4>: Calc++ Parser. (line 64)
+* %code: Decl Summary. (line 63)
+* %code imports <1>: Java Declarations Summary.
+ (line 41)
+* %code imports: Decl Summary. (line 115)
+* %code lexer: Java Declarations Summary.
+ (line 45)
+* %code provides <1>: Prologue Alternatives.
+ (line 6)
+* %code provides: Decl Summary. (line 303)
+* %code requires <1>: Decl Summary. (line 72)
+* %code requires <2>: Calc++ Parser. (line 17)
+* %code requires: Prologue Alternatives.
+ (line 6)
+* %code top <1>: Decl Summary. (line 98)
+* %code top: Prologue Alternatives.
+ (line 6)
+* %debug <1>: Table of Symbols. (line 78)
+* %debug <2>: Tracing. (line 23)
+* %debug <3>: Decl Summary. (line 134)
+* %debug: Table of Symbols. (line 75)
+* %define <1>: Table of Symbols. (line 81)
+* %define <2>: Decl Summary. (line 140)
+* %define: Table of Symbols. (line 82)
+* %define abstract: Java Declarations Summary.
+ (line 57)
+* %define api.pure <1>: Decl Summary. (line 166)
+* %define api.pure: Pure Decl. (line 6)
+* %define api.push_pull <1>: Push Decl. (line 6)
+* %define api.push_pull: Decl Summary. (line 177)
+* %define extends: Java Declarations Summary.
+ (line 61)
+* %define final: Java Declarations Summary.
+ (line 65)
+* %define implements: Java Declarations Summary.
+ (line 69)
+* %define lex_throws: Java Declarations Summary.
+ (line 73)
+* %define location_type: Java Declarations Summary.
+ (line 78)
+* %define lr.keep_unreachable_states: Decl Summary. (line 190)
+* %define namespace <1>: Decl Summary. (line 232)
+* %define namespace: C++ Bison Interface. (line 10)
+* %define package: Java Declarations Summary.
+ (line 84)
+* %define parser_class_name: Java Declarations Summary.
+ (line 88)
+* %define position_type: Java Declarations Summary.
+ (line 92)
+* %define public: Java Declarations Summary.
+ (line 97)
+* %define strictfp: Java Declarations Summary.
+ (line 105)
+* %define stype: Java Declarations Summary.
+ (line 101)
+* %define throws: Java Declarations Summary.
+ (line 109)
+* %defines <1>: Table of Symbols. (line 90)
+* %defines <2>: Decl Summary. (line 307)
+* %defines: Table of Symbols. (line 86)
+* %destructor <1>: Destructor Decl. (line 22)
+* %destructor <2>: Decl Summary. (line 310)
+* %destructor <3>: Destructor Decl. (line 6)
+* %destructor <4>: Mid-Rule Actions. (line 59)
+* %destructor <5>: Table of Symbols. (line 94)
+* %destructor: Destructor Decl. (line 22)
+* %dprec <1>: Table of Symbols. (line 99)
+* %dprec: Merging GLR Parses. (line 6)
+* %error-verbose <1>: Table of Symbols. (line 118)
+* %error-verbose: Error Reporting. (line 17)
+* %expect <1>: Decl Summary. (line 38)
+* %expect: Expect Decl. (line 6)
+* %expect-rr <1>: Expect Decl. (line 6)
+* %expect-rr: Simple GLR Parsers. (line 6)
+* %file-prefix <1>: Decl Summary. (line 315)
+* %file-prefix: Table of Symbols. (line 122)
+* %glr-parser <1>: Simple GLR Parsers. (line 6)
+* %glr-parser <2>: Table of Symbols. (line 126)
+* %glr-parser: GLR Parsers. (line 6)
+* %initial-action <1>: Table of Symbols. (line 130)
+* %initial-action: Initial Action Decl. (line 11)
+* %language <1>: Decl Summary. (line 319)
+* %language: Table of Symbols. (line 134)
+* %language "Java": Java Declarations Summary.
+ (line 10)
+* %left <1>: Using Precedence. (line 6)
+* %left <2>: Decl Summary. (line 21)
+* %left: Table of Symbols. (line 138)
+* %lex-param <1>: Table of Symbols. (line 142)
+* %lex-param <2>: Pure Calling. (line 31)
+* %lex-param: Java Declarations Summary.
+ (line 13)
+* %locations: Decl Summary. (line 327)
+* %merge <1>: Merging GLR Parses. (line 6)
+* %merge: Table of Symbols. (line 147)
+* %name-prefix <1>: Java Declarations Summary.
+ (line 19)
+* %name-prefix <2>: Decl Summary. (line 334)
+* %name-prefix: Table of Symbols. (line 154)
+* %no-lines <1>: Decl Summary. (line 346)
+* %no-lines: Table of Symbols. (line 158)
+* %nonassoc <1>: Table of Symbols. (line 162)
+* %nonassoc <2>: Using Precedence. (line 6)
+* %nonassoc: Decl Summary. (line 25)
+* %output <1>: Decl Summary. (line 354)
+* %output: Table of Symbols. (line 166)
+* %parse-param <1>: Java Declarations Summary.
+ (line 24)
+* %parse-param <2>: Parser Function. (line 36)
+* %parse-param <3>: Table of Symbols. (line 170)
+* %parse-param: Parser Function. (line 36)
+* %prec <1>: Table of Symbols. (line 175)
+* %prec: Contextual Precedence.
+ (line 6)
+* %pure-parser <1>: Table of Symbols. (line 179)
+* %pure-parser: Decl Summary. (line 357)
+* %require <1>: Table of Symbols. (line 184)
+* %require <2>: Require Decl. (line 6)
+* %require: Decl Summary. (line 362)
+* %right <1>: Using Precedence. (line 6)
+* %right <2>: Decl Summary. (line 17)
+* %right: Table of Symbols. (line 188)
+* %skeleton <1>: Decl Summary. (line 366)
+* %skeleton: Table of Symbols. (line 192)
+* %start <1>: Table of Symbols. (line 196)
+* %start <2>: Decl Summary. (line 34)
+* %start: Start Decl. (line 6)
+* %token <1>: Decl Summary. (line 13)
+* %token <2>: Token Decl. (line 6)
+* %token <3>: Java Declarations Summary.
+ (line 29)
+* %token: Table of Symbols. (line 200)
+* %token-table <1>: Decl Summary. (line 374)
+* %token-table: Table of Symbols. (line 204)
+* %type <1>: Java Declarations Summary.
+ (line 33)
+* %type <2>: Type Decl. (line 6)
+* %type <3>: Table of Symbols. (line 208)
+* %type: Decl Summary. (line 30)
+* %union <1>: Decl Summary. (line 9)
+* %union <2>: Union Decl. (line 6)
+* %union: Table of Symbols. (line 217)
+* %verbose: Decl Summary. (line 407)
+* %yacc: Decl Summary. (line 413)
+* *yypstate_new: Parser Create Function.
+ (line 15)
+* /*: Table of Symbols. (line 33)
+* :: Table of Symbols. (line 36)
+* ;: Table of Symbols. (line 40)
+* <*> <1>: Destructor Decl. (line 6)
+* <*>: Table of Symbols. (line 47)
+* <> <1>: Destructor Decl. (line 6)
+* <>: Table of Symbols. (line 56)
+* @$ <1>: Action Features. (line 98)
+* @$ <2>: Java Action Features.
+ (line 39)
+* @$ <3>: Table of Symbols. (line 7)
+* @$: Actions and Locations.
+ (line 6)
+* @N <1>: Action Features. (line 104)
+* @N <2>: Actions and Locations.
+ (line 6)
+* @N <3>: Table of Symbols. (line 11)
+* @N <4>: Action Features. (line 104)
+* @N: Java Action Features.
+ (line 35)
+* abstract syntax tree: Implementing Gotos/Loops.
+ (line 17)
+* action: Actions. (line 6)
+* action data types: Action Types. (line 6)
+* action features summary: Action Features. (line 6)
+* actions in mid-rule <1>: Mid-Rule Actions. (line 6)
+* actions in mid-rule: Destructor Decl. (line 88)
+* actions, location: Actions and Locations.
+ (line 6)
+* actions, semantic: Semantic Actions. (line 6)
+* additional C code section: Epilogue. (line 6)
+* algorithm of parser: Algorithm. (line 6)
+* ambiguous grammars <1>: Generalized LR Parsing.
+ (line 6)
+* ambiguous grammars: Language and Grammar.
+ (line 33)
+* associativity: Why Precedence. (line 33)
+* AST: Implementing Gotos/Loops.
+ (line 17)
+* Backus-Naur form: Language and Grammar.
+ (line 16)
+* begin of Location: Java Location Values.
+ (line 21)
+* begin on location: C++ Location Values. (line 44)
+* Bison declaration summary: Decl Summary. (line 6)
+* Bison declarations: Declarations. (line 6)
+* Bison declarations (introduction): Bison Declarations. (line 6)
+* Bison grammar: Grammar in Bison. (line 6)
+* Bison invocation: Invocation. (line 6)
+* Bison parser: Bison Parser. (line 6)
+* Bison parser algorithm: Algorithm. (line 6)
+* Bison symbols, table of: Table of Symbols. (line 6)
+* Bison utility: Bison Parser. (line 6)
+* bison-i18n.m4: Internationalization.
+ (line 20)
+* bison-po: Internationalization.
+ (line 6)
+* BISON_I18N: Internationalization.
+ (line 27)
+* BISON_LOCALEDIR: Internationalization.
+ (line 27)
+* BNF: Language and Grammar.
+ (line 16)
+* braced code: Rules. (line 31)
+* C code, section for additional: Epilogue. (line 6)
+* C-language interface: Interface. (line 6)
+* calc: Infix Calc. (line 6)
+* calculator, infix notation: Infix Calc. (line 6)
+* calculator, location tracking: Location Tracking Calc.
+ (line 6)
+* calculator, multi-function: Multi-function Calc. (line 6)
+* calculator, simple: RPN Calc. (line 6)
+* character token: Symbols. (line 31)
+* column on position: C++ Location Values. (line 25)
+* columns on location: C++ Location Values. (line 48)
+* columns on position: C++ Location Values. (line 28)
+* compiling the parser: Rpcalc Compile. (line 6)
+* conflicts <1>: Shift/Reduce. (line 6)
+* conflicts <2>: Merging GLR Parses. (line 6)
+* conflicts <3>: GLR Parsers. (line 6)
+* conflicts: Simple GLR Parsers. (line 6)
+* conflicts, reduce/reduce: Reduce/Reduce. (line 6)
+* conflicts, suppressing warnings of: Expect Decl. (line 6)
+* context-dependent precedence: Contextual Precedence.
+ (line 6)
+* context-free grammar: Language and Grammar.
+ (line 6)
+* controlling function: Rpcalc Main. (line 6)
+* core, item set: Understanding. (line 129)
+* dangling else: Shift/Reduce. (line 6)
+* data type of locations: Location Type. (line 6)
+* data types in actions: Action Types. (line 6)
+* data types of semantic values: Value Type. (line 6)
+* debug_level on parser: C++ Parser Interface.
+ (line 31)
+* debug_stream on parser: C++ Parser Interface.
+ (line 26)
+* debugging: Tracing. (line 6)
+* declaration summary: Decl Summary. (line 6)
+* declarations: Prologue. (line 6)
+* declarations section: Prologue. (line 6)
+* declarations, Bison: Declarations. (line 6)
+* declarations, Bison (introduction): Bison Declarations. (line 6)
+* declaring literal string tokens: Token Decl. (line 6)
+* declaring operator precedence: Precedence Decl. (line 6)
+* declaring the start symbol: Start Decl. (line 6)
+* declaring token type names: Token Decl. (line 6)
+* declaring value types: Union Decl. (line 6)
+* declaring value types, nonterminals: Type Decl. (line 6)
+* default action: Actions. (line 50)
+* default data type: Value Type. (line 6)
+* default location type: Location Type. (line 6)
+* default stack limit: Memory Management. (line 30)
+* default start symbol: Start Decl. (line 6)
+* deferred semantic actions: GLR Semantic Actions.
+ (line 6)
+* defining language semantics: Semantics. (line 6)
+* discarded symbols: Destructor Decl. (line 98)
+* discarded symbols, mid-rule actions: Mid-Rule Actions. (line 59)
+* else, dangling: Shift/Reduce. (line 6)
+* end of Location: Java Location Values.
+ (line 22)
+* end on location: C++ Location Values. (line 45)
+* epilogue: Epilogue. (line 6)
+* error <1>: Error Recovery. (line 20)
+* error: Table of Symbols. (line 108)
+* error on parser: C++ Parser Interface.
+ (line 37)
+* error recovery: Error Recovery. (line 6)
+* error recovery, mid-rule actions: Mid-Rule Actions. (line 59)
+* error recovery, simple: Simple Error Recovery.
+ (line 6)
+* error reporting function: Error Reporting. (line 6)
+* error reporting routine: Rpcalc Error. (line 6)
+* examples, simple: Examples. (line 6)
+* exercises: Exercises. (line 6)
+* file format: Grammar Layout. (line 6)
+* file on position: C++ Location Values. (line 13)
+* finite-state machine: Parser States. (line 6)
+* formal grammar: Grammar in Bison. (line 6)
+* format of grammar file: Grammar Layout. (line 6)
+* freeing discarded symbols: Destructor Decl. (line 6)
+* frequently asked questions: FAQ. (line 6)
+* generalized LR (GLR) parsing <1>: Generalized LR Parsing.
+ (line 6)
+* generalized LR (GLR) parsing <2>: Language and Grammar.
+ (line 33)
+* generalized LR (GLR) parsing: GLR Parsers. (line 6)
+* generalized LR (GLR) parsing, ambiguous grammars: Merging GLR Parses.
+ (line 6)
+* generalized LR (GLR) parsing, unambiguous grammars: Simple GLR Parsers.
+ (line 6)
+* getDebugLevel on YYParser: Java Parser Interface.
+ (line 67)
+* getDebugStream on YYParser: Java Parser Interface.
+ (line 62)
+* getEndPos on Lexer: Java Scanner Interface.
+ (line 39)
+* getLVal on Lexer: Java Scanner Interface.
+ (line 47)
+* getStartPos on Lexer: Java Scanner Interface.
+ (line 38)
+* gettext: Internationalization.
+ (line 6)
+* glossary: Glossary. (line 6)
+* GLR parsers and inline: Compiler Requirements.
+ (line 6)
+* GLR parsers and yychar: GLR Semantic Actions.
+ (line 10)
+* GLR parsers and yyclearin: GLR Semantic Actions.
+ (line 18)
+* GLR parsers and YYERROR: GLR Semantic Actions.
+ (line 28)
+* GLR parsers and yylloc: GLR Semantic Actions.
+ (line 10)
+* GLR parsers and YYLLOC_DEFAULT: Location Default Action.
+ (line 6)
+* GLR parsers and yylval: GLR Semantic Actions.
+ (line 10)
+* GLR parsing <1>: Language and Grammar.
+ (line 33)
+* GLR parsing <2>: Generalized LR Parsing.
+ (line 6)
+* GLR parsing: GLR Parsers. (line 6)
+* GLR parsing, ambiguous grammars: Merging GLR Parses. (line 6)
+* GLR parsing, unambiguous grammars: Simple GLR Parsers. (line 6)
+* grammar file: Grammar Layout. (line 6)
+* grammar rule syntax: Rules. (line 6)
+* grammar rules section: Grammar Rules. (line 6)
+* grammar, Bison: Grammar in Bison. (line 6)
+* grammar, context-free: Language and Grammar.
+ (line 6)
+* grouping, syntactic: Language and Grammar.
+ (line 47)
+* i18n: Internationalization.
+ (line 6)
+* infix notation calculator: Infix Calc. (line 6)
+* inline: Compiler Requirements.
+ (line 6)
+* interface: Interface. (line 6)
+* internationalization: Internationalization.
+ (line 6)
+* introduction: Introduction. (line 6)
+* invoking Bison: Invocation. (line 6)
+* item: Understanding. (line 107)
+* item set core: Understanding. (line 129)
+* kernel, item set: Understanding. (line 129)
+* LALR(1): Mystery Conflicts. (line 36)
+* LALR(1) grammars: Language and Grammar.
+ (line 22)
+* language semantics, defining: Semantics. (line 6)
+* layout of Bison grammar: Grammar Layout. (line 6)
+* left recursion: Recursion. (line 16)
+* lex-param: Pure Calling. (line 31)
+* lexical analyzer: Lexical. (line 6)
+* lexical analyzer, purpose: Bison Parser. (line 6)
+* lexical analyzer, writing: Rpcalc Lexer. (line 6)
+* lexical tie-in: Lexical Tie-ins. (line 6)
+* line on position: C++ Location Values. (line 19)
+* lines on location: C++ Location Values. (line 49)
+* lines on position: C++ Location Values. (line 22)
+* literal string token: Symbols. (line 53)
+* literal token: Symbols. (line 31)
+* location <1>: Locations Overview. (line 6)
+* location: Locations. (line 6)
+* location actions: Actions and Locations.
+ (line 6)
+* Location on Location: Java Location Values.
+ (line 25)
+* location tracking calculator: Location Tracking Calc.
+ (line 6)
+* location, textual <1>: Locations. (line 6)
+* location, textual: Locations Overview. (line 6)
+* location_value_type: C++ Parser Interface.
+ (line 16)
+* lookahead token: Lookahead. (line 6)
+* LR(1): Mystery Conflicts. (line 36)
+* LR(1) grammars: Language and Grammar.
+ (line 22)
+* ltcalc: Location Tracking Calc.
+ (line 6)
+* main function in simple example: Rpcalc Main. (line 6)
+* memory exhaustion: Memory Management. (line 6)
+* memory management: Memory Management. (line 6)
+* mfcalc: Multi-function Calc. (line 6)
+* mid-rule actions <1>: Destructor Decl. (line 88)
+* mid-rule actions: Mid-Rule Actions. (line 6)
+* multi-function calculator: Multi-function Calc. (line 6)
+* multicharacter literal: Symbols. (line 53)
+* mutual recursion: Recursion. (line 32)
+* NLS: Internationalization.
+ (line 6)
+* nondeterministic parsing <1>: Generalized LR Parsing.
+ (line 6)
+* nondeterministic parsing: Language and Grammar.
+ (line 33)
+* nonterminal symbol: Symbols. (line 6)
+* nonterminal, useless: Understanding. (line 62)
+* operator precedence: Precedence. (line 6)
+* operator precedence, declaring: Precedence Decl. (line 6)
+* operator+ on location: C++ Location Values. (line 53)
+* operator+ on position: C++ Location Values. (line 33)
+* operator+= on location: C++ Location Values. (line 57)
+* operator+= on position: C++ Location Values. (line 31)
+* operator- on position: C++ Location Values. (line 36)
+* operator-= on position: C++ Location Values. (line 35)
+* operator<< on position: C++ Location Values. (line 40)
+* options for invoking Bison: Invocation. (line 6)
+* overflow of parser stack: Memory Management. (line 6)
+* parse error: Error Reporting. (line 6)
+* parse on parser: C++ Parser Interface.
+ (line 23)
+* parse on YYParser: Java Parser Interface.
+ (line 54)
+* parser: Bison Parser. (line 6)
+* parser on parser: C++ Parser Interface.
+ (line 19)
+* parser stack: Algorithm. (line 6)
+* parser stack overflow: Memory Management. (line 6)
+* parser state: Parser States. (line 6)
+* pointed rule: Understanding. (line 107)
+* polish notation calculator: RPN Calc. (line 6)
+* precedence declarations: Precedence Decl. (line 6)
+* precedence of operators: Precedence. (line 6)
+* precedence, context-dependent: Contextual Precedence.
+ (line 6)
+* precedence, unary operator: Contextual Precedence.
+ (line 6)
+* preventing warnings about conflicts: Expect Decl. (line 6)
+* Prologue <1>: Decl Summary. (line 129)
+* Prologue <2>: Prologue. (line 6)
+* Prologue: Decl Summary. (line 50)
+* Prologue Alternatives: Prologue Alternatives.
+ (line 6)
+* pure parser: Pure Decl. (line 6)
+* push parser: Push Decl. (line 6)
+* questions: FAQ. (line 6)
+* recovering: Java Action Features.
+ (line 59)
+* recovering on YYParser: Java Parser Interface.
+ (line 58)
+* recovery from errors: Error Recovery. (line 6)
+* recursive rule: Recursion. (line 6)
+* reduce/reduce conflict: Reduce/Reduce. (line 6)
+* reduce/reduce conflicts <1>: GLR Parsers. (line 6)
+* reduce/reduce conflicts <2>: Simple GLR Parsers. (line 6)
+* reduce/reduce conflicts: Merging GLR Parses. (line 6)
+* reduction: Algorithm. (line 6)
+* reentrant parser: Pure Decl. (line 6)
+* requiring a version of Bison: Require Decl. (line 6)
+* return YYABORT;: Java Action Features.
+ (line 43)
+* return YYACCEPT;: Java Action Features.
+ (line 47)
+* return YYERROR;: Java Action Features.
+ (line 51)
+* return YYFAIL;: Java Action Features.
+ (line 55)
+* reverse polish notation: RPN Calc. (line 6)
+* right recursion: Recursion. (line 16)
+* rpcalc: RPN Calc. (line 6)
+* rule syntax: Rules. (line 6)
+* rule, pointed: Understanding. (line 107)
+* rule, useless: Understanding. (line 62)
+* rules section for grammar: Grammar Rules. (line 6)
+* running Bison (introduction): Rpcalc Generate. (line 6)
+* semantic actions: Semantic Actions. (line 6)
+* semantic value: Semantic Values. (line 6)
+* semantic value type: Value Type. (line 6)
+* semantic_value_type: C++ Parser Interface.
+ (line 15)
+* set_debug_level on parser: C++ Parser Interface.
+ (line 32)
+* set_debug_stream on parser: C++ Parser Interface.
+ (line 27)
+* setDebugLevel on YYParser: Java Parser Interface.
+ (line 68)
+* setDebugStream on YYParser: Java Parser Interface.
+ (line 63)
+* shift/reduce conflicts <1>: Simple GLR Parsers. (line 6)
+* shift/reduce conflicts <2>: Shift/Reduce. (line 6)
+* shift/reduce conflicts: GLR Parsers. (line 6)
+* shifting: Algorithm. (line 6)
+* simple examples: Examples. (line 6)
+* single-character literal: Symbols. (line 31)
+* stack overflow: Memory Management. (line 6)
+* stack, parser: Algorithm. (line 6)
+* stages in using Bison: Stages. (line 6)
+* start symbol: Language and Grammar.
+ (line 96)
+* start symbol, declaring: Start Decl. (line 6)
+* state (of parser): Parser States. (line 6)
+* step on location: C++ Location Values. (line 60)
+* string token: Symbols. (line 53)
+* summary, action features: Action Features. (line 6)
+* summary, Bison declaration: Decl Summary. (line 6)
+* suppressing conflict warnings: Expect Decl. (line 6)
+* symbol: Symbols. (line 6)
+* symbol table example: Mfcalc Symbol Table. (line 6)
+* symbols (abstract): Language and Grammar.
+ (line 47)
+* symbols in Bison, table of: Table of Symbols. (line 6)
+* syntactic grouping: Language and Grammar.
+ (line 47)
+* syntax error: Error Reporting. (line 6)
+* syntax of grammar rules: Rules. (line 6)
+* terminal symbol: Symbols. (line 6)
+* textual location <1>: Locations Overview. (line 6)
+* textual location: Locations. (line 6)
+* token: Language and Grammar.
+ (line 47)
+* token type: Symbols. (line 6)
+* token type names, declaring: Token Decl. (line 6)
+* token, useless: Understanding. (line 62)
+* toString on Location: Java Location Values.
+ (line 32)
+* tracing the parser: Tracing. (line 6)
+* unary operator precedence: Contextual Precedence.
+ (line 6)
+* useless nonterminal: Understanding. (line 62)
+* useless rule: Understanding. (line 62)
+* useless token: Understanding. (line 62)
+* using Bison: Stages. (line 6)
+* value type, semantic: Value Type. (line 6)
+* value types, declaring: Union Decl. (line 6)
+* value types, nonterminals, declaring: Type Decl. (line 6)
+* value, semantic: Semantic Values. (line 6)
+* version requirement: Require Decl. (line 6)
+* warnings, preventing: Expect Decl. (line 6)
+* writing a lexical analyzer: Rpcalc Lexer. (line 6)
+* YYABORT <1>: Table of Symbols. (line 221)
+* YYABORT: Parser Function. (line 29)
+* YYABORT;: Action Features. (line 28)
+* YYACCEPT <1>: Table of Symbols. (line 230)
+* YYACCEPT: Parser Function. (line 26)
+* YYACCEPT;: Action Features. (line 32)
+* YYBACKUP <1>: Table of Symbols. (line 238)
+* YYBACKUP: Action Features. (line 36)
+* yychar <1>: Action Features. (line 69)
+* yychar <2>: Lookahead. (line 47)
+* yychar <3>: Table of Symbols. (line 242)
+* yychar: GLR Semantic Actions.
+ (line 10)
+* yyclearin <1>: GLR Semantic Actions.
+ (line 18)
+* yyclearin <2>: Table of Symbols. (line 248)
+* yyclearin: Error Recovery. (line 97)
+* yyclearin;: Action Features. (line 76)
+* yydebug <1>: Tracing. (line 6)
+* yydebug: Table of Symbols. (line 256)
+* YYDEBUG <1>: Table of Symbols. (line 252)
+* YYDEBUG: Tracing. (line 12)
+* YYEMPTY: Action Features. (line 49)
+* YYENABLE_NLS: Internationalization.
+ (line 27)
+* YYEOF: Action Features. (line 52)
+* yyerrok <1>: Table of Symbols. (line 261)
+* yyerrok: Error Recovery. (line 92)
+* yyerrok;: Action Features. (line 81)
+* YYERROR: Action Features. (line 56)
+* yyerror: Java Action Features.
+ (line 64)
+* YYERROR: Table of Symbols. (line 265)
+* yyerror <1>: Table of Symbols. (line 274)
+* yyerror: Error Reporting. (line 6)
+* YYERROR: GLR Semantic Actions.
+ (line 28)
+* yyerror on Lexer: Java Scanner Interface.
+ (line 25)
+* YYERROR;: Action Features. (line 56)
+* YYERROR_VERBOSE: Table of Symbols. (line 278)
+* YYINITDEPTH <1>: Table of Symbols. (line 285)
+* YYINITDEPTH: Memory Management. (line 32)
+* yylex <1>: Table of Symbols. (line 289)
+* yylex: Lexical. (line 6)
+* yylex on Lexer: Java Scanner Interface.
+ (line 30)
+* yylex on parser: C++ Scanner Interface.
+ (line 12)
+* YYLEX_PARAM: Table of Symbols. (line 294)
+* yylloc <1>: Token Locations. (line 6)
+* yylloc <2>: Table of Symbols. (line 300)
+* yylloc <3>: GLR Semantic Actions.
+ (line 10)
+* yylloc <4>: Action Features. (line 86)
+* yylloc <5>: Lookahead. (line 47)
+* yylloc: Actions and Locations.
+ (line 60)
+* YYLLOC_DEFAULT: Location Default Action.
+ (line 6)
+* YYLTYPE <1>: Table of Symbols. (line 310)
+* YYLTYPE: Token Locations. (line 19)
+* yylval <1>: Actions. (line 74)
+* yylval <2>: Action Features. (line 92)
+* yylval <3>: Table of Symbols. (line 314)
+* yylval <4>: GLR Semantic Actions.
+ (line 10)
+* yylval <5>: Lookahead. (line 47)
+* yylval: Token Values. (line 6)
+* YYMAXDEPTH <1>: Table of Symbols. (line 322)
+* YYMAXDEPTH: Memory Management. (line 14)
+* yynerrs <1>: Error Reporting. (line 92)
+* yynerrs: Table of Symbols. (line 326)
+* yyparse <1>: Table of Symbols. (line 332)
+* yyparse: Parser Function. (line 6)
+* YYPARSE_PARAM: Table of Symbols. (line 365)
+* YYParser on YYParser: Java Parser Interface.
+ (line 41)
+* YYPRINT: Tracing. (line 71)
+* yypstate_delete <1>: Table of Symbols. (line 336)
+* yypstate_delete: Parser Delete Function.
+ (line 6)
+* yypstate_new <1>: Parser Create Function.
+ (line 6)
+* yypstate_new: Table of Symbols. (line 344)
+* yypull_parse <1>: Pull Parser Function.
+ (line 6)
+* yypull_parse <2>: Table of Symbols. (line 351)
+* yypull_parse: Pull Parser Function.
+ (line 14)
+* yypush_parse <1>: Push Parser Function.
+ (line 15)
+* yypush_parse: Table of Symbols. (line 358)
+* YYRECOVERING <1>: Action Features. (line 64)
+* YYRECOVERING <2>: Error Recovery. (line 109)
+* YYRECOVERING <3>: Action Features. (line 64)
+* YYRECOVERING: Table of Symbols. (line 371)
+* YYSTACK_USE_ALLOCA: Table of Symbols. (line 376)
+* YYSTYPE: Table of Symbols. (line 392)
+* | <1>: Table of Symbols. (line 43)
+* |: Rules. (line 49)
+
+
+
+Tag Table:
+Node: Top1174
+Node: Introduction13739
+Node: Conditions15002
+Node: Copying16893
+Node: Concepts54431
+Node: Language and Grammar55612
+Node: Grammar in Bison61501
+Node: Semantic Values63430
+Node: Semantic Actions65536
+Node: GLR Parsers66723
+Node: Simple GLR Parsers69470
+Node: Merging GLR Parses76122
+Node: GLR Semantic Actions80691
+Node: Compiler Requirements82581
+Node: Locations Overview83317
+Node: Bison Parser84770
+Node: Stages87710
+Node: Grammar Layout88998
+Node: Examples90330
+Node: RPN Calc91533
+Node: Rpcalc Declarations92533
+Node: Rpcalc Rules94461
+Node: Rpcalc Input96277
+Node: Rpcalc Line97752
+Node: Rpcalc Expr98880
+Node: Rpcalc Lexer100847
+Node: Rpcalc Main103441
+Node: Rpcalc Error103848
+Node: Rpcalc Generate104881
+Node: Rpcalc Compile106016
+Node: Infix Calc106895
+Node: Simple Error Recovery109658
+Node: Location Tracking Calc111553
+Node: Ltcalc Declarations112249
+Node: Ltcalc Rules113338
+Node: Ltcalc Lexer115354
+Node: Multi-function Calc117677
+Node: Mfcalc Declarations119253
+Node: Mfcalc Rules121300
+Node: Mfcalc Symbol Table122695
+Node: Exercises128871
+Node: Grammar File129385
+Node: Grammar Outline130234
+Node: Prologue131084
+Node: Prologue Alternatives132873
+Node: Bison Declarations142558
+Node: Grammar Rules142986
+Node: Epilogue143457
+Node: Symbols144473
+Node: Rules151176
+Node: Recursion153655
+Node: Semantics155373
+Node: Value Type156472
+Node: Multiple Types157307
+Node: Actions158474
+Node: Action Types161889
+Node: Mid-Rule Actions163201
+Node: Locations169666
+Node: Location Type170317
+Node: Actions and Locations171103
+Node: Location Default Action173564
+Node: Declarations177284
+Node: Require Decl178811
+Node: Token Decl179130
+Node: Precedence Decl181556
+Node: Union Decl183566
+Node: Type Decl185340
+Node: Initial Action Decl186266
+Node: Destructor Decl187037
+Node: Expect Decl192501
+Node: Start Decl194494
+Node: Pure Decl194882
+Node: Push Decl196632
+Node: Decl Summary201131
+Ref: Decl Summary-Footnote-1218017
+Node: Multiple Parsers218221
+Node: Interface219860
+Node: Parser Function221178
+Node: Push Parser Function223194
+Node: Pull Parser Function224004
+Node: Parser Create Function224655
+Node: Parser Delete Function225478
+Node: Lexical226249
+Node: Calling Convention227681
+Node: Token Values230641
+Node: Token Locations231805
+Node: Pure Calling232699
+Node: Error Reporting234580
+Node: Action Features238710
+Node: Internationalization243012
+Node: Algorithm245553
+Node: Lookahead247919
+Node: Shift/Reduce250128
+Node: Precedence253023
+Node: Why Precedence253679
+Node: Using Precedence255552
+Node: Precedence Examples256529
+Node: How Precedence257239
+Node: Contextual Precedence258396
+Node: Parser States260192
+Node: Reduce/Reduce261436
+Node: Mystery Conflicts264977
+Node: Generalized LR Parsing268684
+Node: Memory Management273303
+Node: Error Recovery275516
+Node: Context Dependency280819
+Node: Semantic Tokens281668
+Node: Lexical Tie-ins284738
+Node: Tie-in Recovery286315
+Node: Debugging288492
+Node: Understanding289158
+Node: Tracing300317
+Node: Invocation304419
+Node: Bison Options305818
+Node: Option Cross Key312822
+Node: Yacc Library313874
+Node: Other Languages314699
+Node: C++ Parsers315026
+Node: C++ Bison Interface315523
+Node: C++ Semantic Values316791
+Ref: C++ Semantic Values-Footnote-1317733
+Node: C++ Location Values317886
+Node: C++ Parser Interface320259
+Node: C++ Scanner Interface321976
+Node: A Complete C++ Example322678
+Node: Calc++ --- C++ Calculator323620
+Node: Calc++ Parsing Driver324134
+Node: Calc++ Parser327915
+Node: Calc++ Scanner331705
+Node: Calc++ Top Level335131
+Node: Java Parsers335780
+Node: Java Bison Interface336457
+Node: Java Semantic Values338420
+Node: Java Location Values340034
+Node: Java Parser Interface341590
+Node: Java Scanner Interface344828
+Node: Java Action Features347013
+Node: Java Differences349740
+Ref: Java Differences-Footnote-1352315
+Node: Java Declarations Summary352465
+Node: FAQ356713
+Node: Memory Exhausted357660
+Node: How Can I Reset the Parser357970
+Node: Strings are Destroyed360239
+Node: Implementing Gotos/Loops361828
+Node: Multiple start-symbols363111
+Node: Secure? Conform?364656
+Node: I can't build Bison365104
+Node: Where can I find help?365822
+Node: Bug Reports366615
+Node: More Languages368076
+Node: Beta Testing368434
+Node: Mailing Lists369308
+Node: Table of Symbols369519
+Node: Glossary384901
+Node: Copying This Manual391798
+Node: Index414191
+
+End Tag Table
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/doc/gpl-3.0.texi b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/doc/gpl-3.0.texi
new file mode 100644
index 00000000..1908d1f8
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/doc/gpl-3.0.texi
@@ -0,0 +1,717 @@
+@c The GNU General Public License.
+@center Version 3, 29 June 2007
+
+@c This file is intended to be included within another document,
+@c hence no sectioning command or @node.
+
+@display
+Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+@end display
+
+@heading Preamble
+
+The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom
+to share and change all versions of a program---to make sure it remains
+free software for all its users. We, the Free Software Foundation,
+use the GNU General Public License for most of our software; it
+applies also to any other work released this way by its authors. You
+can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you
+have certain responsibilities if you distribute copies of the
+software, or if you modify it: responsibilities to respect the freedom
+of others.
+
+For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too,
+receive or can get the source code. And you must show them these
+terms so they know their rights.
+
+Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the
+manufacturer can do so. This is fundamentally incompatible with the
+aim of protecting users' freedom to change the software. The
+systematic pattern of such abuse occurs in the area of products for
+individuals to use, which is precisely where it is most unacceptable.
+Therefore, we have designed this version of the GPL to prohibit the
+practice for those products. If such problems arise substantially in
+other domains, we stand ready to extend this provision to those
+domains in future versions of the GPL, as needed to protect the
+freedom of users.
+
+Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish
+to avoid the special danger that patents applied to a free program
+could make it effectively proprietary. To prevent this, the GPL
+assures that patents cannot be used to render the program non-free.
+
+The precise terms and conditions for copying, distribution and
+modification follow.
+
+@heading TERMS AND CONDITIONS
+
+@enumerate 0
+@item Definitions.
+
+``This License'' refers to version 3 of the GNU General Public License.
+
+``Copyright'' also means copyright-like laws that apply to other kinds
+of works, such as semiconductor masks.
+
+``The Program'' refers to any copyrightable work licensed under this
+License. Each licensee is addressed as ``you''. ``Licensees'' and
+``recipients'' may be individuals or organizations.
+
+To ``modify'' a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of
+an exact copy. The resulting work is called a ``modified version'' of
+the earlier work or a work ``based on'' the earlier work.
+
+A ``covered work'' means either the unmodified Program or a work based
+on the Program.
+
+To ``propagate'' a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+To ``convey'' a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user
+through a computer network, with no transfer of a copy, is not
+conveying.
+
+An interactive user interface displays ``Appropriate Legal Notices'' to
+the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+@item Source Code.
+
+The ``source code'' for a work means the preferred form of the work for
+making modifications to it. ``Object code'' means any non-source form
+of a work.
+
+A ``Standard Interface'' means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+The ``System Libraries'' of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+``Major Component'', in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+The ``Corresponding Source'' for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can
+regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same
+work.
+
+@item Basic Permissions.
+
+All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey,
+without conditions so long as your license otherwise remains in force.
+You may convey covered works to others for the sole purpose of having
+them make modifications exclusively for you, or provide you with
+facilities for running those works, provided that you comply with the
+terms of this License in conveying all material for which you do not
+control copyright. Those thus making or running the covered works for
+you must do so exclusively on your behalf, under your direction and
+control, on terms that prohibit them from making any copies of your
+copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the
+conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+@item Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such
+circumvention is effected by exercising rights under this License with
+respect to the covered work, and you disclaim any intention to limit
+operation or modification of the work as a means of enforcing, against
+the work's users, your or third parties' legal rights to forbid
+circumvention of technological measures.
+
+@item Conveying Verbatim Copies.
+
+You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+@item Conveying Modified Source Versions.
+
+You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these
+conditions:
+
+@enumerate a
+@item
+The work must carry prominent notices stating that you modified it,
+and giving a relevant date.
+
+@item
+The work must carry prominent notices stating that it is released
+under this License and any conditions added under section 7. This
+requirement modifies the requirement in section 4 to ``keep intact all
+notices''.
+
+@item
+You must license the entire work, as a whole, under this License to
+anyone who comes into possession of a copy. This License will
+therefore apply, along with any applicable section 7 additional terms,
+to the whole of the work, and all its parts, regardless of how they
+are packaged. This License gives no permission to license the work in
+any other way, but it does not invalidate such permission if you have
+separately received it.
+
+@item
+If the work has interactive user interfaces, each must display
+Appropriate Legal Notices; however, if the Program has interactive
+interfaces that do not display Appropriate Legal Notices, your work
+need not make them do so.
+@end enumerate
+
+A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+``aggregate'' if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+@item Conveying Non-Source Forms.
+
+You may convey a covered work in object code form under the terms of
+sections 4 and 5, provided that you also convey the machine-readable
+Corresponding Source under the terms of this License, in one of these
+ways:
+
+@enumerate a
+@item
+Convey the object code in, or embodied in, a physical product
+(including a physical distribution medium), accompanied by the
+Corresponding Source fixed on a durable physical medium customarily
+used for software interchange.
+
+@item
+Convey the object code in, or embodied in, a physical product
+(including a physical distribution medium), accompanied by a written
+offer, valid for at least three years and valid for as long as you
+offer spare parts or customer support for that product model, to give
+anyone who possesses the object code either (1) a copy of the
+Corresponding Source for all the software in the product that is
+covered by this License, on a durable physical medium customarily used
+for software interchange, for a price no more than your reasonable
+cost of physically performing this conveying of source, or (2) access
+to copy the Corresponding Source from a network server at no charge.
+
+@item
+Convey individual copies of the object code with a copy of the written
+offer to provide the Corresponding Source. This alternative is
+allowed only occasionally and noncommercially, and only if you
+received the object code with such an offer, in accord with subsection
+6b.
+
+@item
+Convey the object code by offering access from a designated place
+(gratis or for a charge), and offer equivalent access to the
+Corresponding Source in the same way through the same place at no
+further charge. You need not require recipients to copy the
+Corresponding Source along with the object code. If the place to copy
+the object code is a network server, the Corresponding Source may be
+on a different server (operated by you or a third party) that supports
+equivalent copying facilities, provided you maintain clear directions
+next to the object code saying where to find the Corresponding Source.
+Regardless of what server hosts the Corresponding Source, you remain
+obligated to ensure that it is available for as long as needed to
+satisfy these requirements.
+
+@item
+Convey the object code using peer-to-peer transmission, provided you
+inform other peers where the object code and Corresponding Source of
+the work are being offered to the general public at no charge under
+subsection 6d.
+
+@end enumerate
+
+A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+A ``User Product'' is either (1) a ``consumer product'', which means any
+tangible personal property which is normally used for personal,
+family, or household purposes, or (2) anything designed or sold for
+incorporation into a dwelling. In determining whether a product is a
+consumer product, doubtful cases shall be resolved in favor of
+coverage. For a particular product received by a particular user,
+``normally used'' refers to a typical or common use of that class of
+product, regardless of the status of the particular user or of the way
+in which the particular user actually uses, or expects or is expected
+to use, the product. A product is a consumer product regardless of
+whether the product has substantial commercial, industrial or
+non-consumer uses, unless such uses represent the only significant
+mode of use of the product.
+
+``Installation Information'' for a User Product means any methods,
+procedures, authorization keys, or other information required to
+install and execute modified versions of a covered work in that User
+Product from a modified version of its Corresponding Source. The
+information must suffice to ensure that the continued functioning of
+the modified object code is in no case prevented or interfered with
+solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or
+updates for a work that has been modified or installed by the
+recipient, or for the User Product in which it has been modified or
+installed. Access to a network may be denied when the modification
+itself materially and adversely affects the operation of the network
+or violates the rules and protocols for communication across the
+network.
+
+Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+@item Additional Terms.
+
+``Additional permissions'' are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders
+of that material) supplement the terms of this License with terms:
+
+@enumerate a
+@item
+Disclaiming warranty or limiting liability differently from the terms
+of sections 15 and 16 of this License; or
+
+@item
+Requiring preservation of specified reasonable legal notices or author
+attributions in that material or in the Appropriate Legal Notices
+displayed by works containing it; or
+
+@item
+Prohibiting misrepresentation of the origin of that material, or
+requiring that modified versions of such material be marked in
+reasonable ways as different from the original version; or
+
+@item
+Limiting the use for publicity purposes of names of licensors or
+authors of the material; or
+
+@item
+Declining to grant rights under trademark law for use of some trade
+names, trademarks, or service marks; or
+
+@item
+Requiring indemnification of licensors and authors of that material by
+anyone who conveys the material (or modified versions of it) with
+contractual assumptions of liability to the recipient, for any
+liability that these contractual assumptions directly impose on those
+licensors and authors.
+@end enumerate
+
+All other non-permissive additional terms are considered ``further
+restrictions'' within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions; the
+above requirements apply either way.
+
+@item Termination.
+
+You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+@item Acceptance Not Required for Having Copies.
+
+You are not required to accept this License in order to receive or run
+a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+@item Automatic Licensing of Downstream Recipients.
+
+Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+An ``entity transaction'' is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+@item Patents.
+
+A ``contributor'' is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's ``contributor version''.
+
+A contributor's ``essential patent claims'' are all patent claims owned
+or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, ``control'' includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+In the following three paragraphs, a ``patent license'' is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To ``grant'' such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. ``Knowingly relying'' means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+A patent license is ``discriminatory'' if it does not include within the
+scope of its coverage, prohibits the exercise of, or is conditioned on
+the non-exercise of one or more of the rights that are specifically
+granted under this License. You may not convey a covered work if you
+are a party to an arrangement with a third party that is in the
+business of distributing software, under which you make payment to the
+third party based on the extent of your activity of conveying the
+work, and under which the third party grants, to any of the parties
+who would receive the covered work from you, a discriminatory patent
+license (a) in connection with copies of the covered work conveyed by
+you (or copies made from those copies), or (b) primarily for and in
+connection with specific products or compilations that contain the
+covered work, unless you entered into that arrangement, or that patent
+license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+@item No Surrender of Others' Freedom.
+
+If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey
+a covered work so as to satisfy simultaneously your obligations under
+this License and any other pertinent obligations, then as a
+consequence you may not convey it at all. For example, if you agree
+to terms that obligate you to collect a royalty for further conveying
+from those to whom you convey the Program, the only way you could
+satisfy both those terms and this License would be to refrain entirely
+from conveying the Program.
+
+@item Use with the GNU Affero General Public License.
+
+Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+@item Revised Versions of this License.
+
+The Free Software Foundation may publish revised and/or new versions
+of the GNU General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies that a certain numbered version of the GNU General Public
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that numbered version or
+of any later version published by the Free Software Foundation. If
+the Program does not specify a version number of the GNU General
+Public License, you may choose any version ever published by the Free
+Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions
+of the GNU General Public License can be used, that proxy's public
+statement of acceptance of a version permanently authorizes you to
+choose that version for the Program.
+
+Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+@item Disclaimer of Warranty.
+
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
+DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
+CORRECTION.
+
+@item Limitation of Liability.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
+CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
+NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
+LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
+TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
+PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+@item Interpretation of Sections 15 and 16.
+
+If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+@end enumerate
+
+@heading END OF TERMS AND CONDITIONS
+
+@heading How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the ``copyright'' line and a pointer to where the full notice is found.
+
+@smallexample
+@var{one line to give the program's name and a brief idea of what it does.}
+Copyright (C) @var{year} @var{name of author}
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see @url{http://www.gnu.org/licenses/}.
+@end smallexample
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+@smallexample
+@var{program} Copyright (C) @var{year} @var{name of author}
+This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type @samp{show c} for details.
+@end smallexample
+
+The hypothetical commands @samp{show w} and @samp{show c} should show
+the appropriate parts of the General Public License. Of course, your
+program's commands might be different; for a GUI interface, you would
+use an ``about box''.
+
+You should also get your employer (if you work as a programmer) or school,
+if any, to sign a ``copyright disclaimer'' for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+@url{http://www.gnu.org/licenses/}.
+
+The GNU General Public License does not permit incorporating your
+program into proprietary programs. If your program is a subroutine
+library, you may consider it more useful to permit linking proprietary
+applications with the library. If this is what you want to do, use
+the GNU Lesser General Public License instead of this License. But
+first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/etc/README b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/etc/README
new file mode 100644
index 00000000..d7fce478
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1-src/etc/README
@@ -0,0 +1,41 @@
+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:
diff --git a/gnuwin32/contrib/bison/2.4.1/bison-2.4.1/check.log b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1/check.log
new file mode 100644
index 00000000..610e46e5
--- /dev/null
+++ b/gnuwin32/contrib/bison/2.4.1/bison-2.4.1/check.log
@@ -0,0 +1,422 @@
+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'
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/COPYING b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/COPYING
new file mode 100644
index 00000000..c041f02c
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/COPYING
@@ -0,0 +1,38 @@
+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.
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/INSTALL b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/INSTALL
new file mode 100644
index 00000000..6e7ed85d
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/INSTALL
@@ -0,0 +1,117 @@
+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'.
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/Borland/NOTES b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/Borland/NOTES
new file mode 100644
index 00000000..caac3cc9
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/Borland/NOTES
@@ -0,0 +1,66 @@
+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]]
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/MVS/README b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/MVS/README
new file mode 100644
index 00000000..09741ab0
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/MVS/README
@@ -0,0 +1,44 @@
+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
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/README b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/README
new file mode 100644
index 00000000..dc16b023
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/README
@@ -0,0 +1,76 @@
+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!
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/fastwc/README b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/fastwc/README
new file mode 100644
index 00000000..0dd3afe4
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/MISC/fastwc/README
@@ -0,0 +1,56 @@
+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
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/NEWS b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/NEWS
new file mode 100644
index 00000000..3e23e7d9
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/NEWS
@@ -0,0 +1,1233 @@
+Changes between release 2.5.4 (11Sep96) and release 2.5.3:
+
+ - Fixed a bug introduced in 2.5.3 that blew it when a call
+ to input() occurred at the end of an input file.
+
+ - Fixed scanner skeleton so the example in the man page of
+ scanning strings using exclusive start conditions works.
+
+ - Minor Makefile tweaks.
+
+
+Changes between release 2.5.3 (29May96) and release 2.5.2:
+
+ - Some serious bugs in yymore() have been fixed. In particular,
+ when using AT&T-lex-compatibility or %array, you can intermix
+ calls to input(), unput(), and yymore(). (This still doesn't
+ work for %pointer, and isn't likely to in the future.)
+
+ - A bug in handling NUL's in the input stream of scanners using
+ REJECT has been fixed.
+
+ - The default main() in libfl.a now repeatedly calls yylex() until
+ it returns 0, rather than just calling it once.
+
+ - Minor tweak for Windows NT Makefile, MISC/NT/Makefile.
+
+
+Changes between release 2.5.2 (25Apr95) and release 2.5.1:
+
+ - The --prefix configuration option now works.
+
+ - A bug that completely broke the "-Cf" table compression
+ option has been fixed.
+
+ - A major headache involving "const" declarators and Solaris
+ systems has been fixed.
+
+ - An octal escape sequence in a flex regular expression must
+ now contain only the digits 0-7.
+
+ - You can now use "--" on the flex command line to mark the
+ end of flex options.
+
+ - You can now specify the filename '-' as a synonym for stdin.
+
+ - By default, the scanners generated by flex no longer
+ statically initialize yyin and yyout to stdin and stdout.
+ This change is necessary because in some ANSI environments,
+ stdin and stdout are not compile-time constant. You can
+ force the initialization using "%option stdinit" in the first
+ section of your flex input.
+
+ - "%option nounput" now correctly omits the unput() routine
+ from the output.
+
+ - "make clean" now removes config.log, config.cache, and the
+ flex binary. The fact that it removes the flex binary means
+ you should take care if making changes to scan.l, to make
+ sure you don't wind up in a bootstrap problem.
+
+ - In general, the Makefile has been reworked somewhat (thanks
+ to Francois Pinard) for added flexibility - more changes will
+ follow in subsequent releases.
+
+ - The .texi and .info files in MISC/texinfo/ have been updated,
+ thanks also to Francois Pinard.
+
+ - The FlexLexer::yylex(istream* new_in, ostream* new_out) method
+ now does not have a default for the first argument, to disambiguate
+ it from FlexLexer::yylex().
+
+ - A bug in destructing a FlexLexer object before doing any scanning
+ with it has been fixed.
+
+ - A problem with including FlexLexer.h multiple times has been fixed.
+
+ - The alloca() chud necessary to accommodate bison has grown
+ even uglier, but hopefully more correct.
+
+ - A portability tweak has been added to accommodate compilers that
+ use char* generic pointers.
+
+ - EBCDIC contact information in the file MISC/EBCDIC has been updated.
+
+ - An OS/2 Makefile and config.h for flex 2.5 is now available in
+ MISC/OS2/, contributed by Kai Uwe Rommel.
+
+ - The descrip.mms file for building flex under VMS has been updated,
+ thanks to Pat Rankin.
+
+ - The notes on building flex for the Amiga have been updated for
+ flex 2.5, contributed by Andreas Scherer.
+
+
+Changes between release 2.5.1 (28Mar95) and release 2.4.7:
+
+ - A new concept of "start condition" scope has been introduced.
+ A start condition scope is begun with:
+
+ <SCs>{
+
+ where SCs is a list of one or more start conditions. Inside
+ the start condition scope, every rule automatically has the
+ prefix <SCs> applied to it, until a '}' which matches the
+ initial '{'. So, for example:
+
+ <ESC>{
+ "\\n" return '\n';
+ "\\r" return '\r';
+ "\\f" return '\f';
+ "\\0" return '\0';
+ }
+
+ is equivalent to:
+
+ <ESC>"\\n" return '\n';
+ <ESC>"\\r" return '\r';
+ <ESC>"\\f" return '\f';
+ <ESC>"\\0" return '\0';
+
+ As indicated in this example, rules inside start condition scopes
+ (and any rule, actually, other than the first) can be indented,
+ to better show the extent of the scope.
+
+ Start condition scopes may be nested.
+
+ - The new %option directive can be used in the first section of
+ a flex scanner to control scanner-generation options. Most
+ options are given simply as names, optionally preceded by the
+ word "no" (with no intervening whitespace) to negate their
+ meaning. Some are equivalent to flex flags, so putting them
+ in your scanner source is equivalent to always specifying
+ the flag (%option's take precedence over flags):
+
+ 7bit -7 option
+ 8bit -8 option
+ align -Ca option
+ backup -b option
+ batch -B option
+ c++ -+ option
+ caseful opposite of -i option (caseful is the default);
+ case-sensitive same as above
+ caseless -i option;
+ case-insensitive same as above
+ debug -d option
+ default opposite of -s option
+ ecs -Ce option
+ fast -F option
+ full -f option
+ interactive -I option
+ lex-compat -l option
+ meta-ecs -Cm option
+ perf-report -p option
+ read -Cr option
+ stdout -t option
+ verbose -v option
+ warn opposite of -w option (so use "%option nowarn" for -w)
+
+ array equivalent to "%array"
+ pointer equivalent to "%pointer" (default)
+
+ Some provide new features:
+
+ always-interactive generate a scanner which always
+ considers its input "interactive" (no call to isatty()
+ will be made when the scanner runs)
+ main supply a main program for the scanner, which
+ simply calls yylex(). Implies %option noyywrap.
+ never-interactive generate a scanner which never
+ considers its input "interactive" (no call to isatty()
+ will be made when the scanner runs)
+ stack if set, enable start condition stacks (see below)
+ stdinit if unset ("%option nostdinit"), initialize yyin
+ and yyout statically to nil FILE* pointers, instead
+ of stdin and stdout
+ yylineno if set, keep track of the current line
+ number in global yylineno (this option is expensive
+ in terms of performance). The line number is available
+ to C++ scanning objects via the new member function
+ lineno().
+ yywrap if unset ("%option noyywrap"), scanner does not
+ call yywrap() upon EOF but simply assumes there
+ are no more files to scan
+
+ Flex scans your rule actions to determine whether you use the
+ REJECT or yymore features (this is not new). Two %options can be
+ used to override its decision, either by setting them to indicate
+ the feature is indeed used, or unsetting them to indicate it
+ actually is not used:
+
+ reject
+ yymore
+
+ Three %option's take string-delimited values, offset with '=':
+
+ outfile="<name>" equivalent to -o<name>
+ prefix="<name>" equivalent to -P<name>
+ yyclass="<name>" set the name of the C++ scanning class
+ (see below)
+
+ A number of %option's are available for lint purists who
+ want to suppress the appearance of unneeded routines in
+ the generated scanner. Each of the following, if unset,
+ results in the corresponding routine not appearing in the
+ generated scanner:
+
+ input, unput
+ yy_push_state, yy_pop_state, yy_top_state
+ yy_scan_buffer, yy_scan_bytes, yy_scan_string
+
+ You can specify multiple options with a single %option directive,
+ and multiple directives in the first section of your flex input file.
+
+ - The new function:
+
+ YY_BUFFER_STATE yy_scan_string( const char *str )
+
+ returns a YY_BUFFER_STATE (which also becomes the current input
+ buffer) for scanning the given string, which occurs starting
+ with the next call to yylex(). The string must be NUL-terminated.
+ A related function:
+
+ YY_BUFFER_STATE yy_scan_bytes( const char *bytes, int len )
+
+ creates a buffer for scanning "len" bytes (including possibly NUL's)
+ starting at location "bytes".
+
+ Note that both of these functions create and scan a *copy* of
+ the string/bytes. (This may be desirable, since yylex() modifies
+ the contents of the buffer it is scanning.) You can avoid the
+ copy by using:
+
+ YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+
+ which scans in place the buffer starting at "base", consisting
+ of "size" bytes, the last two bytes of which *must* be
+ YY_END_OF_BUFFER_CHAR (these bytes are not scanned; thus, scanning
+ consists of base[0] through base[size-2], inclusive). If you
+ fail to set up "base" in this manner, yy_scan_buffer returns a
+ nil pointer instead of creating a new input buffer.
+
+ The type yy_size_t is an integral type to which you can cast
+ an integer expression reflecting the size of the buffer.
+
+ - Three new routines are available for manipulating stacks of
+ start conditions:
+
+ void yy_push_state( int new_state )
+
+ pushes the current start condition onto the top of the stack
+ and BEGIN's "new_state" (recall that start condition names are
+ also integers).
+
+ void yy_pop_state()
+
+ pops the top of the stack and BEGIN's to it, and
+
+ int yy_top_state()
+
+ returns the top of the stack without altering the stack's
+ contents.
+
+ The start condition stack grows dynamically and so has no built-in
+ size limitation. If memory is exhausted, program execution
+ is aborted.
+
+ To use start condition stacks, your scanner must include
+ a "%option stack" directive.
+
+ - flex now supports POSIX character class expressions. These
+ are expressions enclosed inside "[:" and ":]" delimiters (which
+ themselves must appear between the '[' and ']' of a character
+ class; other elements may occur inside the character class, too).
+ The expressions flex recognizes are:
+
+ [:alnum:] [:alpha:] [:blank:] [:cntrl:] [:digit:] [:graph:]
+ [:lower:] [:print:] [:punct:] [:space:] [:upper:] [:xdigit:]
+
+ These expressions all designate a set of characters equivalent to
+ the corresponding isXXX function (for example, [:alnum:] designates
+ those characters for which isalnum() returns true - i.e., any
+ alphabetic or numeric). Some systems don't provide isblank(),
+ so flex defines [:blank:] as a blank or a tab.
+
+ For example, the following character classes are all equivalent:
+
+ [[:alnum:]]
+ [[:alpha:][:digit:]
+ [[:alpha:]0-9]
+ [a-zA-Z0-9]
+
+ If your scanner is case-insensitive (-i flag), then [:upper:]
+ and [:lower:] are equivalent to [:alpha:].
+
+ - The promised rewrite of the C++ FlexLexer class has not yet
+ been done. Support for FlexLexer is limited at the moment to
+ fixing show-stopper bugs, so, for example, the new functions
+ yy_scan_string() & friends are not available to FlexLexer
+ objects.
+
+ - The new macro
+
+ yy_set_interactive(is_interactive)
+
+ can be used to control whether the current buffer is considered
+ "interactive". An interactive buffer is processed more slowly,
+ but must be used when the scanner's input source is indeed
+ interactive to avoid problems due to waiting to fill buffers
+ (see the discussion of the -I flag in flex.1). A non-zero value
+ in the macro invocation marks the buffer as interactive, a zero
+ value as non-interactive. Note that use of this macro overrides
+ "%option always-interactive" or "%option never-interactive".
+
+ yy_set_interactive() must be invoked prior to beginning to
+ scan the buffer.
+
+ - The new macro
+
+ yy_set_bol(at_bol)
+
+ can be used to control whether the current buffer's scanning
+ context for the next token match is done as though at the
+ beginning of a line (non-zero macro argument; makes '^' anchored
+ rules active) or not at the beginning of a line (zero argument,
+ '^' rules inactive).
+
+ - Related to this change, the mechanism for determining when a scan is
+ starting at the beginning of a line has changed. It used to be
+ that '^' was active iff the character prior to that at which the
+ scan started was a newline. The mechanism now is that '^' is
+ active iff the last token ended in a newline (or the last call to
+ input() returned a newline). For most users, the difference in
+ mechanisms is negligible. Where it will make a difference,
+ however, is if unput() or yyless() is used to alter the input
+ stream. When in doubt, use yy_set_bol().
+
+ - The new beginning-of-line mechanism involved changing some fairly
+ twisted code, so it may have introduced bugs - beware ...
+
+ - The macro YY_AT_BOL() returns true if the next token scanned from
+ the current buffer will have '^' rules active, false otherwise.
+
+ - The new function
+
+ void yy_flush_buffer( struct yy_buffer_state* b )
+
+ flushes the contents of the current buffer (i.e., next time
+ the scanner attempts to match a token using b as the current
+ buffer, it will begin by invoking YY_INPUT to fill the buffer).
+ This routine is also available to C++ scanners (unlike some
+ of the other new routines).
+
+ The related macro
+
+ YY_FLUSH_BUFFER
+
+ flushes the contents of the current buffer.
+
+ - A new "-ooutput" option writes the generated scanner to "output".
+ If used with -t, the scanner is still written to stdout, but
+ its internal #line directives (see previous item) use "output".
+
+ - Flex now generates #line directives relating the code it
+ produces to the output file; this means that error messages
+ in the flex-generated code should be correctly pinpointed.
+
+ - When generating #line directives, filenames with embedded '\'s
+ have those characters escaped (i.e., turned into '\\'). This
+ feature helps with reporting filenames for some MS-DOS and OS/2
+ systems.
+
+ - The FlexLexer class includes two new public member functions:
+
+ virtual void switch_streams( istream* new_in = 0,
+ ostream* new_out = 0 )
+
+ reassigns yyin to new_in (if non-nil) and yyout to new_out
+ (ditto), deleting the previous input buffer if yyin is
+ reassigned. It is used by:
+
+ int yylex( istream* new_in = 0, ostream* new_out = 0 )
+
+ which first calls switch_streams() and then returns the value
+ of calling yylex().
+
+ - C++ scanners now have yy_flex_debug as a member variable of
+ FlexLexer rather than a global, and member functions for testing
+ and setting it.
+
+ - When generating a C++ scanning class, you can now use
+
+ %option yyclass="foo"
+
+ to inform flex that you have derived "foo" as a subclass of
+ yyFlexLexer, so flex will place your actions in the member
+ function foo::yylex() instead of yyFlexLexer::yylex(). It also
+ generates a yyFlexLexer::yylex() member function that generates a
+ run-time error if called (by invoking yyFlexLexer::LexerError()).
+ This feature is necessary if your subclass "foo" introduces some
+ additional member functions or variables that you need to access
+ from yylex().
+
+ - Current texinfo files in MISC/texinfo, contributed by Francois
+ Pinard.
+
+ - You can now change the name "flex" to something else (e.g., "lex")
+ by redefining $(FLEX) in the Makefile.
+
+ - Two bugs (one serious) that could cause "bigcheck" to fail have
+ been fixed.
+
+ - A number of portability/configuration changes have been made
+ for easier portability.
+
+ - You can use "YYSTATE" in your scanner as an alias for YY_START
+ (for AT&T lex compatibility).
+
+ - input() now maintains yylineno.
+
+ - input() no longer trashes yytext.
+
+ - interactive scanners now read characters in YY_INPUT up to a
+ newline, a large performance gain.
+
+ - C++ scanner objects now work with the -P option. You include
+ <FlexLexer.h> once per scanner - see comments in <FlexLexer.h>
+ (or flex.1) for details.
+
+ - C++ FlexLexer objects now use the "cerr" stream to report -d output
+ instead of stdio.
+
+ - The -c flag now has its full glorious POSIX interpretation (do
+ nothing), rather than being interpreted as an old-style -C flag.
+
+ - Scanners generated by flex now include two #define's giving
+ the major and minor version numbers (YY_FLEX_MAJOR_VERSION,
+ YY_FLEX_MINOR_VERSION). These can then be tested to see
+ whether certain flex features are available.
+
+ - Scanners generated using -l lex compatibility now have the symbol
+ YY_FLEX_LEX_COMPAT #define'd.
+
+ - When initializing (i.e., yy_init is non-zero on entry to yylex()),
+ generated scanners now set yy_init to zero before executing
+ YY_USER_INIT. This means that you can set yy_init back to a
+ non-zero value in YY_USER_INIT if you need the scanner to be
+ reinitialized on the next call.
+
+ - You can now use "#line" directives in the first section of your
+ scanner specification.
+
+ - When generating full-table scanners (-Cf), flex now puts braces
+ around each row of the 2-d array initialization, to silence warnings
+ on over-zealous compilers.
+
+ - Improved support for MS-DOS. The flex sources have been successfully
+ built, unmodified, for Borland 4.02 (all that's required is a
+ Borland Makefile and config.h file, which are supplied in
+ MISC/Borland - contributed by Terrence O Kane).
+
+ - Improved support for Macintosh using Think C - the sources should
+ build for this platform "out of the box". Contributed by Scott
+ Hofmann.
+
+ - Improved support for VMS, in MISC/VMS/, contributed by Pat Rankin.
+
+ - Support for the Amiga, in MISC/Amiga/, contributed by Andreas
+ Scherer. Note that the contributed files were developed for
+ flex 2.4 and have not been tested with flex 2.5.
+
+ - Some notes on support for the NeXT, in MISC/NeXT, contributed
+ by Raf Schietekat.
+
+ - The MISC/ directory now includes a preformatted version of flex.1
+ in flex.man, and pre-yacc'd versions of parse.y in parse.{c,h}.
+
+ - The flex.1 and flexdoc.1 manual pages have been merged. There
+ is now just one document, flex.1, which includes an overview
+ at the beginning to help you find the section you need.
+
+ - Documentation now clarifies that start conditions persist across
+ switches to new input files or different input buffers. If you
+ want to e.g., return to INITIAL, you must explicitly do so.
+
+ - The "Performance Considerations" section of the manual has been
+ updated.
+
+ - Documented the "yy_act" variable, which when YY_USER_ACTION is
+ invoked holds the number of the matched rule, and added an
+ example of using yy_act to profile how often each rule is matched.
+
+ - Added YY_NUM_RULES, a definition that gives the total number
+ of rules in the file, including the default rule (even if you
+ use -s).
+
+ - Documentation now clarifies that you can pass a nil FILE* pointer
+ to yy_create_buffer() or yyrestart() if you've arrange YY_INPUT
+ to not need yyin.
+
+ - Documentation now clarifies that YY_BUFFER_STATE is a pointer to
+ an opaque "struct yy_buffer_state".
+
+ - Documentation now stresses that you gain the benefits of removing
+ backing-up states only if you remove *all* of them.
+
+ - Documentation now points out that traditional lex allows you
+ to put the action on a separate line from the rule pattern if
+ the pattern has trailing whitespace (ugh!), but flex doesn't
+ support this.
+
+ - A broken example in documentation of the difference between
+ inclusive and exclusive start conditions is now fixed.
+
+ - Usage (-h) report now goes to stdout.
+
+ - Version (-V) info now goes to stdout.
+
+ - More #ifdef chud has been added to the parser in attempt to
+ deal with bison's use of alloca().
+
+ - "make clean" no longer deletes emacs backup files (*~).
+
+ - Some memory leaks have been fixed.
+
+ - A bug was fixed in which dynamically-expanded buffers were
+ reallocated a couple of bytes too small.
+
+ - A bug was fixed which could cause flex to read and write beyond
+ the end of the input buffer.
+
+ - -S will not be going away.
+
+
+Changes between release 2.4.7 (03Aug94) and release 2.4.6:
+
+ - Fixed serious bug in reading multiple files.
+
+ - Fixed bug in scanning NUL's.
+
+ - Fixed bug in input() returning 8-bit characters.
+
+ - Fixed bug in matching text with embedded NUL's when
+ using %array or lex compatibility.
+
+ - Fixed multiple invocations of YY_USER_ACTION when using '|'
+ continuation action.
+
+ - Minor prototyping fixes.
+
+Changes between release 2.4.6 (04Jan94) and release 2.4.5:
+
+ - Linking with -lfl no longer required if your program includes
+ its own yywrap() and main() functions. (This change will cause
+ problems if you have a non-ANSI compiler on a system for which
+ sizeof(int) != sizeof(void*) or sizeof(int) != sizeof(size_t).)
+
+ - The use of 'extern "C++"' in FlexLexer.h has been modified to
+ get around an incompatibility with g++'s header files.
+
+Changes between release 2.4.5 (11Dec93) and release 2.4.4:
+
+ - Fixed bug breaking C++ scanners that use REJECT or variable
+ trailing context.
+
+ - Fixed serious input problem for interactive scanners on
+ systems for which char is unsigned.
+
+ - Fixed bug in incorrectly treating '$' operator as variable
+ trailing context.
+
+ - Fixed bug in -CF table representation that could lead to
+ corrupt tables.
+
+ - Fixed fairly benign memory leak.
+
+ - Added `extern "C++"' wrapper to FlexLexer.h header. This
+ should overcome the g++ 2.5.X problems mentioned in the
+ NEWS for release 2.4.3.
+
+ - Changed #include of FlexLexer.h to use <> instead of "".
+
+ - Added feature to control whether the scanner attempts to
+ refill the input buffer once it's exhausted. This feature
+ will be documented in the 2.5 release.
+
+
+Changes between release 2.4.4 (07Dec93) and release 2.4.3:
+
+ - Fixed two serious bugs in scanning 8-bit characters.
+
+ - Fixed bug in YY_USER_ACTION that caused it to be executed
+ inappropriately (on the scanner's own internal actions, and
+ with incorrect yytext/yyleng values).
+
+ - Fixed bug in pointing yyin at a new file and resuming scanning.
+
+ - Portability fix regarding min/max/abs macros conflicting with
+ function definitions in standard header files.
+
+ - Added a virtual LexerError() method to the C++ yyFlexLexer class
+ for reporting error messages instead of always using cerr.
+
+ - Added warning in flexdoc that the C++ scanning class is presently
+ experimental and subject to considerable change between major
+ releases.
+
+
+Changes between release 2.4.3 (03Dec93) and release 2.4.2:
+
+ - Fixed bug causing fatal scanner messages to fail to print.
+
+ - Fixed things so FlexLexer.h can be included in other C++
+ sources. One side-effect of this change is that -+ and -CF
+ are now incompatible.
+
+ - libfl.a now supplies private versions of the the <string.h>/
+ <strings.h> string routines needed by flex and the scanners
+ it generates, to enhance portability to some BSD systems.
+
+ - More robust solution to 2.4.2's flexfatal() bug fix.
+
+ - Added ranlib of installed libfl.a.
+
+ - Some lint tweaks.
+
+ - NOTE: problems have been encountered attempting to build flex
+ C++ scanners using g++ version 2.5.X. The problem is due to an
+ unfortunate heuristic in g++ 2.5.X that attempts to discern between
+ C and C++ headers. Because FlexLexer.h is installed (by default)
+ in /usr/local/include and not /usr/local/lib/g++-include, g++ 2.5.X
+ decides that it's a C header :-(. So if you have problems, install
+ the header in /usr/local/lib/g++-include instead.
+
+
+Changes between release 2.4.2 (01Dec93) and release 2.4.1:
+
+ - Fixed bug in libfl.a referring to non-existent "flexfatal" function.
+
+ - Modified to produce both compress'd and gzip'd tar files for
+ distributions (you probably don't care about this change!).
+
+
+Changes between release 2.4.1 (30Nov93) and release 2.3.8:
+
+ - The new '-+' flag instructs flex to generate a C++ scanner class
+ (thanks to Kent Williams). flex writes an implementation of the
+ class defined in FlexLexer.h to lex.yy.cc. You may include
+ multiple scanner classes in your program using the -P flag. Note
+ that the scanner class also provides a mechanism for creating
+ reentrant scanners. The scanner class uses C++ streams for I/O
+ instead of FILE*'s (thanks to Tom Epperly). If the flex executable's
+ name ends in '+' then the '-+' flag is automatically on, so creating
+ a symlink or copy of "flex" to "flex++" results in a version of
+ flex that can be used exclusively for C++ scanners.
+
+ Note that without the '-+' flag, flex-generated scanners can still
+ be compiled using C++ compilers, though they use FILE*'s for I/O
+ instead of streams.
+
+ See the "GENERATING C++ SCANNERS" section of flexdoc for details.
+
+ - The new '-l' flag turns on maximum AT&T lex compatibility. In
+ particular, -l includes support for "yylineno" and makes yytext
+ be an array instead of a pointer. It does not, however, do away
+ with all incompatibilities. See the "INCOMPATIBILITIES WITH LEX
+ AND POSIX" section of flexdoc for details.
+
+ - The new '-P' option specifies a prefix to use other than "yy"
+ for the scanner's globally-visible variables, and for the
+ "lex.yy.c" filename. Using -P you can link together multiple
+ flex scanners in the same executable.
+
+ - The distribution includes a "texinfo" version of flexdoc.1,
+ contributed by Roland Pesch (thanks also to Marq Kole, who
+ contributed another version). It has not been brought up to
+ date, but reflects version 2.3. See MISC/flex.texinfo.
+
+ The flex distribution will soon include G.T. Nicol's flex
+ manual; he is presently bringing it up-to-date for version 2.4.
+
+ - yywrap() is now a function, and you now *must* link flex scanners
+ with libfl.a.
+
+ - Site-configuration is now done via an autoconf-generated
+ "configure" script contributed by Francois Pinard.
+
+ - Scanners now use fread() (or getc(), if interactive) and not
+ read() for input. A new "table compression" option, -Cr,
+ overrides this change and causes the scanner to use read()
+ (because read() is a bit faster than fread()). -f and -F
+ are now equivalent to -Cfr and -CFr; i.e., they imply the
+ -Cr option.
+
+ - In the blessed name of POSIX compliance, flex supports "%array"
+ and "%pointer" directives in the definitions (first) section of
+ the scanner specification. The former specifies that yytext
+ should be an array (of size YYLMAX), the latter, that it should
+ be a pointer. The array version of yytext is universally slower
+ than the pointer version, but has the advantage that its contents
+ remain unmodified across calls to input() and unput() (the pointer
+ version of yytext is, still, trashed by such calls).
+
+ "%array" cannot be used with the '-+' C++ scanner class option.
+
+ - The new '-Ca' option directs flex to trade off memory for
+ natural alignment when generating a scanner's tables. In
+ particular, table entries that would otherwise be "short"
+ become "long".
+
+ - The new '-h' option produces a summary of the flex flags.
+
+ - The new '-V' option reports the flex version number and exits.
+
+ - The new scanner macro YY_START returns an integer value
+ corresponding to the current start condition. You can return
+ to that start condition by passing the value to a subsequent
+ "BEGIN" action. You also can implement "start condition stacks"
+ by storing the values in an integer stack.
+
+ - You can now redefine macros such as YY_INPUT by just #define'ing
+ them to some other value in the first section of the flex input;
+ no need to first #undef them.
+
+ - flex now generates warnings for rules that can't be matched.
+ These warnings can be turned off using the new '-w' flag. If
+ your scanner uses REJECT then you will not get these warnings.
+
+ - If you specify the '-s' flag but the default rule can be matched,
+ flex now generates a warning.
+
+ - "yyleng" is now a global, and may be modified by the user (though
+ doing so and then using yymore() will yield weird results).
+
+ - Name definitions in the first section of a scanner specification
+ can now include a leading '^' or trailing '$' operator. In this
+ case, the definition is *not* pushed back inside of parentheses.
+
+ - Scanners with compressed tables are now "interactive" (-I option)
+ by default. You can suppress this attribute (which makes them
+ run slightly slower) using the new '-B' flag.
+
+ - Flex now generates 8-bit scanners by default, unless you use the
+ -Cf or -CF compression options (-Cfe and -CFe result in 8-bit
+ scanners). You can force it to generate a 7-bit scanner using
+ the new '-7' flag. You can build flex to generate 8-bit scanners
+ for -Cf and -CF, too, by adding -DDEFAULT_CSIZE=256 to CFLAGS
+ in the Makefile.
+
+ - You no longer need to call the scanner routine yyrestart() to
+ inform the scanner that you have switched to a new file after
+ having seen an EOF on the current input file. Instead, just
+ point yyin at the new file and continue scanning.
+
+ - You no longer need to invoke YY_NEW_FILE in an <<EOF>> action
+ to indicate you wish to continue scanning. Simply point yyin
+ at a new file.
+
+ - A leading '#' no longer introduces a comment in a flex input.
+
+ - flex no longer considers formfeed ('\f') a whitespace character.
+
+ - %t, I'm happy to report, has been nuked.
+
+ - The '-p' option may be given twice ('-pp') to instruct flex to
+ report minor performance problems as well as major ones.
+
+ - The '-v' verbose output no longer includes start/finish time
+ information.
+
+ - Newlines in flex inputs can optionally include leading or
+ trailing carriage-returns ('\r'), in support of several PC/Mac
+ run-time libraries that automatically include these.
+
+ - A start condition of the form "<*>" makes the following rule
+ active in every start condition, whether exclusive or inclusive.
+
+ - The following items have been corrected in the flex documentation:
+
+ - '-C' table compression options *are* cumulative.
+
+ - You may modify yytext but not lengthen it by appending
+ characters to the end. Modifying its final character
+ will affect '^' anchoring for the next rule matched
+ if the character is changed to or from a newline.
+
+ - The term "backtracking" has been renamed "backing up",
+ since it is a one-time repositioning and not a repeated
+ search. What used to be the "lex.backtrack" file is now
+ "lex.backup".
+
+ - Unindented "/* ... */" comments are allowed in the first
+ flex input section, but not in the second.
+
+ - yyless() can only be used in the flex input source, not
+ externally.
+
+ - You can use "yyrestart(yyin)" to throw away the
+ current contents of the input buffer.
+
+ - To write high-speed scanners, attempt to match as much
+ text as possible with each rule. See MISC/fastwc/README
+ for more information.
+
+ - Using the beginning-of-line operator ('^') is fairly
+ cheap. Using unput() is expensive. Using yyless() is
+ cheap.
+
+ - An example of scanning strings with embedded escape
+ sequences has been added.
+
+ - The example of backing-up in flexdoc was erroneous; it
+ has been corrected.
+
+ - A flex scanner's internal buffer now dynamically grows if needed
+ to match large tokens. Note that growing the buffer presently
+ requires rescanning the (large) token, so consuming a lot of
+ text this way is a slow process. Also note that presently the
+ buffer does *not* grow if you unput() more text than can fit
+ into the buffer.
+
+ - The MISC/ directory has been reorganized; see MISC/README for
+ details.
+
+ - yyless() can now be used in the third (user action) section
+ of a scanner specification, thanks to Ceriel Jacobs. yyless()
+ remains a macro and cannot be used outside of the scanner source.
+
+ - The skeleton file is no longer opened at run-time, but instead
+ compiled into a large string array (thanks to John Gilmore and
+ friends at Cygnus). You can still use the -S flag to point flex
+ at a different skeleton file.
+
+ - flex no longer uses a temporary file to store the scanner's
+ actions.
+
+ - A number of changes have been made to decrease porting headaches.
+ In particular, flex no longer uses memset() or ctime(), and
+ provides a single simple mechanism for dealing with C compilers
+ that still define malloc() as returning char* instead of void*.
+
+ - Flex now detects if the scanner specification requires the -8 flag
+ but the flag was not given or on by default.
+
+ - A number of table-expansion fencepost bugs have been fixed,
+ making flex more robust for generating large scanners.
+
+ - flex more consistently identifies the location of errors in
+ its input.
+
+ - YY_USER_ACTION is now invoked only for "real" actions, not for
+ internal actions used by the scanner for things like filling
+ the buffer or handling EOF.
+
+ - The rule "[^]]" now matches any character other than a ']';
+ formerly it matched any character at all followed by a ']'.
+ This change was made for compatibility with AT&T lex.
+
+ - A large number of miscellaneous bugs have been found and fixed
+ thanks to Gerhard Wilhelms.
+
+ - The source code has been heavily reformatted, making patches
+ relative to previous flex releases no longer accurate.
+
+
+Changes between 2.3 Patch #8 (21Feb93) and 2.3 Patch #7:
+
+ - Fixed bugs in dynamic memory allocation leading to grievous
+ fencepost problems when generating large scanners.
+ - Fixed bug causing infinite loops on character classes with 8-bit
+ characters in them.
+ - Fixed bug in matching repetitions with a lower bound of 0.
+ - Fixed bug in scanning NUL characters using an "interactive" scanner.
+ - Fixed bug in using yymore() at the end of a file.
+ - Fixed bug in misrecognizing rules with variable trailing context.
+ - Fixed bug compiling flex on Suns using gcc 2.
+ - Fixed bug in not recognizing that input files with the character
+ ASCII 128 in them require the -8 flag.
+ - Fixed bug that could cause an infinite loop writing out
+ error messages.
+ - Fixed bug in not recognizing old-style lex % declarations if
+ followed by a tab instead of a space.
+ - Fixed potential crash when flex terminated early (usually due
+ to a bad flag) and the -v flag had been given.
+ - Added some missing declarations of void functions.
+ - Changed to only use '\a' for __STDC__ compilers.
+ - Updated mailing addresses.
+
+
+Changes between 2.3 Patch #7 (28Mar91) and 2.3 Patch #6:
+
+ - Fixed out-of-bounds array access that caused bad tables
+ to be produced on machines where the bad reference happened
+ to yield a 1. This caused problems installing or running
+ flex on some Suns, in particular.
+
+
+Changes between 2.3 Patch #6 (29Aug90) and 2.3 Patch #5:
+
+ - Fixed a serious bug in yymore() which basically made it
+ completely broken. Thanks goes to Jean Christophe of
+ the Nethack development team for finding the problem
+ and passing along the fix.
+
+
+Changes between 2.3 Patch #5 (16Aug90) and 2.3 Patch #4:
+
+ - An up-to-date version of initscan.c so "make test" will
+ work after applying the previous patches
+
+
+Changes between 2.3 Patch #4 (14Aug90) and 2.3 Patch #3:
+
+ - Fixed bug in hexadecimal escapes which allowed only digits,
+ not letters, in escapes
+ - Fixed bug in previous "Changes" file!
+
+
+Changes between 2.3 Patch #3 (03Aug90) and 2.3 Patch #2:
+
+ - Correction to patch #2 for gcc compilation; thanks goes to
+ Paul Eggert for catching this.
+
+
+Changes between 2.3 Patch #2 (02Aug90) and original 2.3 release:
+
+ - Fixed (hopefully) headaches involving declaring malloc()
+ and free() for gcc, which defines __STDC__ but (often) doesn't
+ come with the standard include files such as <stdlib.h>.
+ Reordered #ifdef maze in the scanner skeleton in the hope of
+ getting the declarations right for cfront and g++, too.
+
+ - Note that this patch supercedes patch #1 for release 2.3,
+ which was never announced but was available briefly for
+ anonymous ftp.
+
+
+Changes between 2.3 (full) release of 28Jun90 and 2.2 (alpha) release:
+
+ User-visible:
+
+ - A lone <<EOF>> rule (that is, one which is not qualified with
+ a list of start conditions) now specifies the EOF action for
+ *all* start conditions which haven't already had <<EOF>> actions
+ given. To specify an end-of-file action for just the initial
+ state, use <INITIAL><<EOF>>.
+
+ - -d debug output is now contigent on the global yy_flex_debug
+ being set to a non-zero value, which it is by default.
+
+ - A new macro, YY_USER_INIT, is provided for the user to specify
+ initialization action to be taken on the first call to the
+ scanner. This action is done before the scanner does its
+ own initialization.
+
+ - yy_new_buffer() has been added as an alias for yy_create_buffer()
+
+ - Comments beginning with '#' and extending to the end of the line
+ now work, but have been deprecated (in anticipation of making
+ flex recognize #line directives).
+
+ - The funky restrictions on when semi-colons could follow the
+ YY_NEW_FILE and yyless macros have been removed. They now
+ behave identically to functions.
+
+ - A bug in the sample redefinition of YY_INPUT in the documentation
+ has been corrected.
+
+ - A bug in the sample simple tokener in the documentation has
+ been corrected.
+
+ - The documentation on the incompatibilities between flex and
+ lex has been reordered so that the discussion of yylineno
+ and input() come first, as it's anticipated that these will
+ be the most common source of headaches.
+
+
+ Things which didn't used to be documented but now are:
+
+ - flex interprets "^foo|bar" differently from lex. flex interprets
+ it as "match either a 'foo' or a 'bar', providing it comes at the
+ beginning of a line", whereas lex interprets it as "match either
+ a 'foo' at the beginning of a line, or a 'bar' anywhere".
+
+ - flex initializes the global "yyin" on the first call to the
+ scanner, while lex initializes it at compile-time.
+
+ - yy_switch_to_buffer() can be used in the yywrap() macro/routine.
+
+ - flex scanners do not use stdio for their input, and hence when
+ writing an interactive scanner one must explictly call fflush()
+ after writing out a prompt.
+
+ - flex scanner can be made reentrant (after a fashion) by using
+ "yyrestart( yyin );". This is useful for interactive scanners
+ which have interrupt handlers that long-jump out of the scanner.
+
+ - a defense of why yylineno is not supported is included, along
+ with a suggestion on how to convert scanners which rely on it.
+
+
+ Other changes:
+
+ - Prototypes and proper declarations of void routines have
+ been added to the flex source code, courtesy of Kevin B. Kenny.
+
+ - Routines dealing with memory allocation now use void* pointers
+ instead of char* - see Makefile for porting implications.
+
+ - Error-checking is now done when flex closes a file.
+
+ - Various lint tweaks were added to reduce the number of gripes.
+
+ - Makefile has been further parameterized to aid in porting.
+
+ - Support for SCO Unix added.
+
+ - Flex now sports the latest & greatest UC copyright notice
+ (which is only slightly different from the previous one).
+
+ - A note has been added to flexdoc.1 mentioning work in progress
+ on modifying flex to generate straight C code rather than a
+ table-driven automaton, with an email address of whom to contact
+ if you are working along similar lines.
+
+
+Changes between 2.2 Patch #3 (30Mar90) and 2.2 Patch #2:
+
+ - fixed bug which caused -I scanners to bomb
+
+
+Changes between 2.2 Patch #2 (27Mar90) and 2.2 Patch #1:
+
+ - fixed bug writing past end of input buffer in yyunput()
+ - fixed bug detecting NUL's at the end of a buffer
+
+
+Changes between 2.2 Patch #1 (23Mar90) and 2.2 (alpha) release:
+
+ - Makefile fixes: definition of MAKE variable for systems
+ which don't have it; installation of flexdoc.1 along with
+ flex.1; fixed two bugs which could cause "bigtest" to fail.
+
+ - flex.skel fix for compiling with g++.
+
+ - README and flexdoc.1 no longer list an out-of-date BITNET address
+ for contacting me.
+
+ - minor typos and formatting changes to flex.1 and flexdoc.1.
+
+
+Changes between 2.2 (alpha) release of March '90 and previous release:
+
+ User-visible:
+
+ - Full user documentation now available.
+
+ - Support for 8-bit scanners.
+
+ - Scanners now accept NUL's.
+
+ - A facility has been added for dealing with multiple
+ input buffers.
+
+ - Two manual entries now. One which fully describes flex
+ (rather than just its differences from lex), and the
+ other for quick(er) reference.
+
+ - A number of changes to bring flex closer into compliance
+ with the latest POSIX lex draft:
+
+ %t support
+ flex now accepts multiple input files and concatenates
+ them together to form its input
+ previous -c (compress) flag renamed -C
+ do-nothing -c and -n flags added
+ Any indented code or code within %{}'s in section 2 is
+ now copied to the output
+
+ - yyleng is now a bona fide global integer.
+
+ - -d debug information now gives the line number of the
+ matched rule instead of which number rule it was from
+ the beginning of the file.
+
+ - -v output now includes a summary of the flags used to generate
+ the scanner.
+
+ - unput() and yyrestart() are now globally callable.
+
+ - yyrestart() no longer closes the previous value of yyin.
+
+ - C++ support; generated scanners can be compiled with C++ compiler.
+
+ - Primitive -lfl library added, containing default main()
+ which calls yylex(). A number of routines currently living
+ in the scanner skeleton will probably migrate to here
+ in the future (in particular, yywrap() will probably cease
+ to be a macro and instead be a function in the -lfl library).
+
+ - Hexadecimal (\x) escape sequences added.
+
+ - Support for MS-DOS, VMS, and Turbo-C integrated.
+
+ - The %used/%unused operators have been deprecated. They
+ may go away soon.
+
+
+ Other changes:
+
+ - Makefile enhanced for easier testing and installation.
+ - The parser has been tweaked to detect some erroneous
+ constructions which previously were missed.
+ - Scanner input buffer overflow is now detected.
+ - Bugs with missing "const" declarations fixed.
+ - Out-of-date Minix/Atari patches provided.
+ - Scanners no longer require printf() unless FLEX_DEBUG is being used.
+ - A subtle input() bug has been fixed.
+ - Line numbers for "continued action" rules (those following
+ the special '|' action) are now correct.
+ - unput() bug fixed; had been causing problems porting flex to VMS.
+ - yymore() handling rewritten to fix bug with interaction
+ between yymore() and trailing context.
+ - EOF in actions now generates an error message.
+ - Bug involving -CFe and generating equivalence classes fixed.
+ - Bug which made -CF be treated as -Cf fixed.
+ - Support for SysV tmpnam() added.
+ - Unused #define's for scanner no longer generated.
+ - Error messages which are associated with a particular input
+ line are now all identified with their input line in standard
+ format.
+ - % directives which are valid to lex but not to flex are
+ now ignored instead of generating warnings.
+ - -DSYS_V flag can now also be specified -DUSG for System V
+ compilation.
+
+
+Changes between 2.1 beta-test release of June '89 and previous release:
+
+ User-visible:
+
+ - -p flag generates a performance report to stderr. The report
+ consists of comments regarding features of the scanner rules
+ which result in slower scanners.
+
+ - -b flag generates backtracking information to lex.backtrack.
+ This is a list of scanner states which require backtracking
+ and the characters on which they do so. By adding rules
+ one can remove backtracking states. If all backtracking states
+ are eliminated, the generated scanner will run faster.
+ Backtracking is not yet documented in the manual entry.
+
+ - Variable trailing context now works, i.e., one can have
+ rules like "(foo)*/[ \t]*bletch". Some trailing context
+ patterns still cannot be properly matched and generate
+ error messages. These are patterns where the ending of the
+ first part of the rule matches the beginning of the second
+ part, such as "zx*/xy*", where the 'x*' matches the 'x' at
+ the beginning of the trailing context. Lex won't get these
+ patterns right either.
+
+ - Faster scanners.
+
+ - End-of-file rules. The special rule "<<EOF>>" indicates
+ actions which are to be taken when an end-of-file is
+ encountered and yywrap() returns non-zero (i.e., indicates
+ no further files to process). See manual entry for example.
+
+ - The -r (reject used) flag is gone. flex now scans the input
+ for occurrences of the string "REJECT" to determine if the
+ action is needed. It tries to be intelligent about this but
+ can be fooled. One can force the presence or absence of
+ REJECT by adding a line in the first section of the form
+ "%used REJECT" or "%unused REJECT".
+
+ - yymore() has been implemented. Similarly to REJECT, flex
+ detects the use of yymore(), which can be overridden using
+ "%used" or "%unused".
+
+ - Patterns like "x{0,3}" now work (i.e., with lower-limit == 0).
+
+ - Removed '\^x' for ctrl-x misfeature.
+
+ - Added '\a' and '\v' escape sequences.
+
+ - \<digits> now works for octal escape sequences; previously
+ \0<digits> was required.
+
+ - Better error reporting; line numbers are associated with rules.
+
+ - yyleng is a macro; it cannot be accessed outside of the
+ scanner source file.
+
+ - yytext and yyleng should not be modified within a flex action.
+
+ - Generated scanners #define the name FLEX_SCANNER.
+
+ - Rules are internally separated by YY_BREAK in lex.yy.c rather
+ than break, to allow redefinition.
+
+ - The macro YY_USER_ACTION can be redefined to provide an action
+ which is always executed prior to the matched rule's action.
+
+ - yyrestart() is a new action which can be used to restart
+ the scanner after it has seen an end-of-file (a "real" one,
+ that is, one for which yywrap() returned non-zero). It takes
+ a FILE* argument indicating a new file to scan and sets
+ things up so that a subsequent call to yylex() will start
+ scanning that file.
+
+ - Internal scanner names all preceded by "yy_"
+
+ - lex.yy.c is deleted if errors are encountered during processing.
+
+ - Comments may be put in the first section of the input by preceding
+ them with '#'.
+
+
+
+ Other changes:
+
+ - Some portability-related bugs fixed, in particular for machines
+ with unsigned characters or sizeof( int* ) != sizeof( int ).
+ Also, tweaks for VMS and Microsoft C (MS-DOS), and identifiers all
+ trimmed to be 31 or fewer characters. Shortened file names
+ for dinosaur OS's. Checks for allocating > 64K memory
+ on 16 bit'ers. Amiga tweaks. Compiles using gcc on a Sun-3.
+ - Compressed and fast scanner skeletons merged.
+ - Skeleton header files done away with.
+ - Generated scanner uses prototypes and "const" for __STDC__.
+ - -DSV flag is now -DSYS_V for System V compilation.
+ - Removed all references to FTL language.
+ - Software now covered by BSD Copyright.
+ - flex will replace lex in subsequent BSD releases.
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/README b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/README
new file mode 100644
index 00000000..7a4224dc
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/README
@@ -0,0 +1,60 @@
+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.
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/depends-GnuWin32.lst b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/depends-GnuWin32.lst
new file mode 100644
index 00000000..972dbc1b
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/depends-GnuWin32.lst
@@ -0,0 +1,3 @@
+kernel32.dll
+msvcrt.dll
+ntdll.dll
diff --git a/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/flex-2.5.4a-1-GnuWin32.README b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/flex-2.5.4a-1-GnuWin32.README
new file mode 100644
index 00000000..d4d9aa04
--- /dev/null
+++ b/gnuwin32/contrib/flex/2.5.4a/flex-2.5.4a/flex-2.5.4a-1-GnuWin32.README
@@ -0,0 +1,51 @@
+* 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.
diff --git a/gnuwin32/contrib/gperf/3.0.1/depends-GnuWin32.lst b/gnuwin32/contrib/gperf/3.0.1/depends-GnuWin32.lst
new file mode 100644
index 00000000..972dbc1b
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/depends-GnuWin32.lst
@@ -0,0 +1,3 @@
+kernel32.dll
+msvcrt.dll
+ntdll.dll
diff --git a/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-GnuWin32.README b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-GnuWin32.README
new file mode 100644
index 00000000..56531d85
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-GnuWin32.README
@@ -0,0 +1,54 @@
+* Gperf-3.0.1 for Windows *
+===========================
+
+What is it?
+-----------
+Gperf: generate a perfect hash function from a key set
+
+Description
+-----------
+GNU gperf is a perfect hash function generator. For a given list of
+strings, it produces a hash function and hash table in the form of
+C or C++ code, for looking up a value depending on the input string.
+The hash function is perfect,' which means that the hash table has
+no collisions, and the hash table lookup needs a single string
+comparison only. GNU gperf is highly customizable. There are options
+for generating C and C++ code, for emitting 'switch' statements or
+nested 'ifs' instead of a hash table, and for tuning the algorithm
+that gperf uses.
+
+Homepage
+--------
+http://www.gnu.org/software/gperf/gperf.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
+-------
+- gperf-3.0.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 gperf-3.0.1-GnuWin32.diffs in gperf-3.0.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.
diff --git a/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/AUTHORS b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/AUTHORS
new file mode 100644
index 00000000..184c7ce6
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/AUTHORS
@@ -0,0 +1,2 @@
+Douglas C. Schmidt <schmidt@ics.uci.edu>
+Bruno Haible <bruno@clisp.org>
diff --git a/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/COPYING b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/COPYING
new file mode 100644
index 00000000..bab08afa
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307,
+ 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 Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+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
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <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 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/ChangeLog b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/ChangeLog
new file mode 100644
index 00000000..1af586c4
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/ChangeLog
@@ -0,0 +1,3185 @@
+2003-06-12 Bruno Haible <bruno@clisp.org>
+
+ * gperf-3.0.1 released.
+
+ * src/version.cc: Bump version number to 3.0.1.
+ * doc/gperf.texi: Likewise.
+ * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
+ tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
+ tests/java.exp, tests/languages.exp, tests/modula2.exp,
+ tests/objc.exp, tests/permut2.exp, tests/permut3.exp,
+ tests/permutc2.exp, tests/test-4.exp: Update.
+
+2003-05-31 Bruno Haible <bruno@clisp.org>
+
+ * doc/gperf.texi (User-supplied Struct): Mention the possibility of an
+ abbreviated struct declaration.
+ * src/input.cc (Input::read_input): Support struct declarations of the
+ form "struct foo;".
+ * tests/incomplete.gperf: New file.
+ * tests/incomplete.exp: New file.
+ * tests/Makefile.in (check-test): Check incomplete.gperf too.
+ Reported by Rob Leslie <rob@mars.org>.
+
+2003-05-20 Bruno Haible <bruno@clisp.org>
+
+ * doc/Makefile.in (gperf.ps): Don't use $< in a target rule.
+
+2003-05-27 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.vms (CC): Correct value.
+ (getopt.obj, getopt1.obj, getline.obj, hash.obj): Don't set
+ HAVE_CONFIG_H.
+
+2003-05-17 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.msvc (DEBUGFLAGS): New variable.
+ (gperf.exe): Use it, and MFLAGS too.
+
+2003-05-08 Bruno Haible <bruno@clisp.org>
+
+ * gperf-3.0 released.
+
+2003-05-07 Bruno Haible <bruno@clisp.org>
+
+ * src/version.cc: Bump version number to 3.0.
+ * doc/gperf.texi: Likewise.
+ * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
+ tests/cplusplus.exp, tests/gpc.exp, tests/java.exp,
+ tests/languages.exp, tests/modula2.exp, tests/objc.exp,
+ tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp,
+ tests/test-4.exp: Update.
+
+ * src/configure.in: Fix AC_INIT argument.
+
+ * Makefile.devel (configure, lib/configure, src/configure,
+ tests/configure, doc/configure): Use the newest autoconf.
+ (src/config.h.in): Use the newest autoheader.
+
+2003-05-03 Bruno Haible <bruno@clisp.org>
+
+ * doc/gperf.texi: Use two spaces as sentence separator, as recommended
+ by the texinfo manual.
+
+2003-04-12 Bruno Haible <bruno@clisp.org>
+
+ * doc/configure.in (mandir): Change default value.
+ * doc/Makefile.in (docdir): Use datadir instead of prefix.
+ * Makefile.msvc (datadir): New variable.
+ (mandir, docdir): Use it instead of prefix.
+ (install, installdirs): Update.
+ * Makefile.vms (datadir): New variable.
+ (mandir, docdir): Use it instead of prefix.
+ (install, installdirs): Update.
+
+2003-04-12 Bruno Haible <bruno@clisp.org>
+
+ * README.vms: New file.
+ * Makefile.vms: New file.
+ * Makefile.devel (src/config.h_vms): New rule.
+ (all): Depend on it.
+
+2003-03-19 Bruno Haible <bruno@clisp.org>
+
+ * src/input.cc (Input::read_input): Ignore comments at the beginning
+ of the declarations section.
+ * doc/gperf.texi (Controls for GNU indent): New section.
+ Reported by Bruce Lilly <blilly@erols.com>.
+
+2003-03-19 Bruno Haible <bruno@clisp.org>
+
+ * src/output.cc (Output::output_hash_function): Avoid lint warning if
+ not all arguments of the hash function are used. Avoid lint warning
+ for fallthrough in switch.
+ * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
+ tests/cplusplus.exp, tests/java.exp, tests/languages.exp,
+ tests/modula2.exp, tests/objc.exp: All /*FALLTHROUGH*/ to expected
+ output.
+ Reported by Bruce Lilly <blilly@erols.com>.
+
+2003-03-01 Bruno Haible <bruno@clisp.org>
+
+ * src/options.h (Options::set_initializer_suffix): New declaration.
+ * src/options.cc (Options::set_initializer_suffix): New method.
+ * src/input.cc (Input::read_input): Recognize %define
+ initializer-suffix.
+ * doc/gperf.texi (Gperf Declarations): Document %define
+ initializer-suffix.
+ * NEWS: Update.
+
+2003-02-26 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.msvc: New file.
+ * README.woe32: New file.
+ * Makefile.devel (all): Depend on src/config.h.msvc.
+ (src/config.h.msvc): New rule.
+
+2003-01-07 Bruno Haible <bruno@clisp.org>
+
+ * src/input.h (Input::_charset_dependent): New field.
+ * src/input.cc (Input::read_input): Also set _charset_dependent.
+ * src/main.cc (main): Pass _charset_dependent from Input to Output.
+ * src/output.h (Output::Output): Add charset_dependent argument.
+ (Output::_charset_dependent): New field.
+ * src/output.cc (Output::Output): Add charset_dependent argument.
+ (Output::output): Provoke a compilation error if the execution
+ character set doesn't match the expectations.
+ * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
+ tests/cplusplus.exp, tests/gpc.exp, tests/java.exp,
+ tests/languages.exp, tests/modula2.exp, tests/objc.exp,
+ tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp,
+ tests/test-4.exp: Update.
+
+ * src/options.cc (Options::long_usage): Change bug report address to
+ <bug-gnu-gperf@gnu.org>.
+ * tests/test-6.exp: Update.
+
+ * src/output.cc (USE_DOWNCASE_TABLE): New macro.
+ (output_upperlower_table): New function.
+ (output_upperlower_strcmp, output_upperlower_strncmp,
+ output_upperlower_memcmp): Emit gperf_downcase array accesses.
+ (Output::output): Call output_upperlower_table.
+ * tests/permutc2.exp: Update.
+
+ * src/keyword-list.icc (KeywordExt_List::rest): Use a portable cast.
+ (Only in GCC a cast of an lvalue is an lvalue.)
+
+2003-01-01 Bruno Haible <bruno@clisp.org>
+
+ * src/options.cc (Options::parse_options): Update copyright year.
+
+ * doc/gperf.texi (@author): Add me.
+
+ * src/options.h (NULLSTRINGS): New enum value.
+ (Options::get_stringpool_name, Options::set_stringpool_name): New
+ method declarations.
+ (Options::_stringpool_name): New field.
+ * src/options.icc (Options::get_stringpool_name): New method.
+ * src/options.cc (DEFAULT_STRINGPOOL_NAME): New variable.
+ (Options::long_usage): Document -Q and --null-strings.
+ (Options::Options): Initialize _stringpool_name.
+ (Options::~Options): Output _stringpool_name, NULLSTRINGS values too.
+ (Options::set_stringpool_name): New method.
+ (long_options): Add options --string-pool-name, --null-strings.
+ (Options::parse_options): Implement options -P, -Q and --null-strings.
+ * src/input.cc (Input::read_input): Recognize declarations %pic,
+ %define string-pool-name, %null-strings.
+ * src/output.h (Output::output_string_pool,
+ Output::output_lookup_pools): New method declarations.
+ (Output::_wordlist_eltype): New field.
+ * src/output.cc (Output::output_keylength_table): Trivial
+ simplification.
+ (Output::output_string_pool): New method.
+ (output_keyword_entry): Add stringpool_index argument. For SHAREDLIB,
+ use struct offsets.
+ (output_keyword_blank_entries): For SHAREDLIB, use -1 instead of "".
+ (Output::output_keyword_table): Use _wordlist_eltype instead of
+ _struct_tag. Compute stringpool_index for output_keyword_entry.
+ (Output::output_lookup_pools): New method.
+ (Output::output_lookup_function_body): Use _wordlist_eltype instead of
+ _struct_tag. For SHAREDLIB, use "+ stringpool" to convert offsets to
+ strings. Use "o >= 0" to test for nonempty table entry.
+ (Output::output_lookup_function): Call output_lookup_pools.
+ (Output::output): Initialize _wordlist_eltype. Call
+ output_lookup_pools.
+ * tests/jstest4.gperf: New file.
+ * tests/test-6.exp: Update.
+ * tests/Makefile.in (check-lang-syntax): Drop test of -p. Add tests of
+ -P and -Q.
+ * doc/gperf.texi (User-supplied Struct): Mention that first field has
+ to be of type 'int' if -P is given.
+ (Gperf Declarations): Document %pic, %define string-pool-name,
+ %null-strings.
+ (Output Details): Update description of option -P. Document options -Q
+ and --null-strings.
+
+ * tests/Makefile.in (check-link-c, check-ada, check-pascal,
+ check-test): Omit option -p.
+ * tests/c-parse.exp: Regenerated.
+ * tests/chill.exp: Regenerated.
+ * tests/cplusplus.exp: Regenerated.
+ * tests/gpc.exp: Regenerated.
+ * tests/java.exp: Regenerated.
+ * tests/objc.exp: Regenerated.
+ * tests/test-4.exp: Regenerated.
+
+ * src/output.cc (Output::output_lookup_function_body): Omit the
+ multicompare code section and its variables when it is not used.
+ * tests/chill.exp: Regenerated.
+
+ * src/output.c (Output_Compare::output_firstchar_comparison): New
+ method.
+ (Output_Compare_Strcmp::output_comparison,
+ Output_Compare_Strncmp::output_comparison,
+ Output_Compare_Memcmp::output_comparison): Use it.
+ * tests/permutc2.exp: Update.
+
+ * tests/smtp.gperf: New file, based on a contribution by Bruce Lilly.
+ * tests/Makefile.in (check-smtp): New rule.
+ (check): Depend on it.
+ (clean): Update.
+
+2002-12-12 Bruno Haible <bruno@clisp.org>
+
+ * src/search.h (Search::init_selchars_tuple,
+ Search::count_duplicates_tuple): Add alpha_unify argument.
+ (Search::count_duplicates_tuple): New method declaration.
+ * src/search.cc (Search::init_selchars_tuple,
+ Search::count_duplicates_tuple): Add alpha_unify argument.
+ (Search::find_positions): Update.
+ (Search::count_duplicates_tuple): New method.
+ (Search::count_duplicates_multiset): Free temp alpha_unify vector.
+ (Search::find_alpha_inc): Call count_duplicates_tuple.
+
+ * src/configure.in: Add test for stack-allocated variable-size arrays.
+ * src/config.h.in: Regenerated.
+ * src/search.cc: Include config.h.
+ (DYNAMIC_ARRAY, FREE_DYNAMIC_ARRAY): New macros.
+ (Search::find_alpha_inc, Search::count_possible_collisions,
+ Search::find_asso_values): Use them.
+ * src/Makefile.in (search.o): Depend on config.h.
+
+ * src/search.h (Search::keyword_list_length, Search::max_key_length,
+ Search::get_max_keysig_size, Search::prepare): Remove declarations.
+ (Search::prepare): Renamed from Search::preprepare.
+ (Search::_max_selchars_length): New field.
+ * src/search.cc (Search::prepare): Renamed from Search::preprepare.
+ (Search::prepare_asso_values): Merged with old Search::prepare.
+ Initialize _max_selchars_length.
+ (Search::keyword_list_length): Remove function. Use _list_len instead.
+ (Search::max_key_length): Remove function. Use _max_key_len instead.
+ (Search::get_max_keysig_size): Remove function. Use
+ _max_selchars_length instead.
+ (Search::count_possible_collisions, Search::find_asso_values): Update.
+ (Search::find_good_asso_values): Call just prepare_asso_values.
+ (Search::~Search): Update.
+
+ * src/output.h (Output::output_asso_values_ref): New declaration.
+ * src/output.cc (char_to_index): Remove variable.
+ (Output::output_asso_values_ref): New function.
+ (Output::output_hash_function): Use it.
+ (Output::output): Update.
+
+ * src/positions.h (Positions::is_useall, Positions::set_useall,
+ Positions::iterator, Positions::reviterator): New method declarations.
+ (Positions::_useall): New field.
+ (PositionIterator): Make constructor private. Add a constructor and a
+ copy constructor.
+ (PositionIterator::remaining): New declaration.
+ (PositionReverseIterator): Make constructor private. Add a constructor
+ and a copy constructor.
+ (PositionReverseIterator::remaining): New declaration.
+ (PositionReverseIterator::_minindex): New field.
+ * src/positions.icc (Positions::Positions): Initialize _useall.
+ (Positions::operator=): Likewise.
+ (Positions::is_useall, Positions::set_useall): New methods.
+ (Positions::sort): Do nothing if _useall is set.
+ (Positions::iterator, Positions::reviterator): New methods.
+ (PositionIterator::PositionIterator): New constructor.
+ (PositionIterator::remaining): New method.
+ (PositionReverseIterator::PositionReverseIterator): New constructor.
+ (PositionReverseIterator::next): Use _minindex as bound.
+ (PositionReverseIterator::remaining): New method.
+ * src/positions.cc (Positions::add, Positions::remove): Reset the
+ useall flag.
+ (Positions::print): Handle the useall case.
+ * src/options.h (ALLCHARS): Remove.
+ * src/options.cc (Options::~Options): Update.
+ (Options::parse_options): Use Positions::set_useall().
+ * src/keyword.h (KeywordExt::init_selchars_tuple,
+ KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low):
+ Remove use_all_chars argument.
+ * src/keyword.cc (KeywordExt::init_selchars_low): Remove use_all_chars
+ argument. Tell the position iterator to stop at _allchars_length.
+ Remove special case code for -k'*'.
+ (KeywordExt::init_selchars_tuple, KeywordExt::init_selchars_multiset):
+ Remove use_all_chars argument.
+ * src/search.h (Search::init_selchars_tuple): Remove use_all_chars
+ argument.
+ (Search::init_selchars_multiset): Likewise.
+ * src/search.cc (Search::init_selchars_tuple): Remove use_all_chars
+ argument.
+ (Search::count_duplicates_tuple, Search::find_positions): Update.
+ (Search::compute_alpha_unify): Remove special case code for -k'*'.
+ (Search::init_selchars_multiset): Remove use_all_chars argument.
+ (Search::count_duplicates_multiset): Update.
+ (Search::find_alpha_inc): Remove special case code for -k'*'.
+ (Search::prepare): Update.
+ (Search::get_max_keysig_size): Update.
+ * src/output.cc (Output::output_hash_function): Remove special case
+ code for -k'*'.
+ * tests/chill.exp: Regenerated.
+
+2002-12-11 Bruno Haible <bruno@clisp.org>
+
+ Change the positions to be 0-based, instead of 1-based.
+ * src/positions.h (Positions::LASTCHAR): Set to -1.
+ (Positions::MAX_SIZE): New constant.
+ (Positions::pointer): Change return type.
+ (Positions::_positions): Change element type.
+ (PositionIterator::EOS, PositionReverseIterator::EOS): Set to -2.
+ * src/positions.icc (Positions::pointer): Change return type.
+ (Positions::sort): Update.
+ * src/positions.cc (Positions::contains, Positions::add,
+ Positions::remove): Update.
+ (Positions::print): Update. Fix off-by-one bug.
+ * src/options.cc (Options::~Options): Update.
+ (Options::parse_options): Set BAD_VALUE to -3. Update.
+ * src/keyword.cc (KeywordExt::init_selchars_low): Update.
+ * src/search.cc (Search::find_positions, Search::compute_alpha_unify,
+ Search::find_alpha_inc): Update.
+ * src/output.cc (Output::output_hash_function): Update. Don't emit
+ a 'case' statement right after 'default:'.
+ * tests/c-parse.exp: Regenerated.
+ * tests/charsets.exp: Regenerated.
+ * tests/cplusplus.exp: Regenerated.
+ * tests/java.exp: Regenerated.
+ * tests/languages.exp: Regenerated.
+ * tests/modula2.exp: Regenerated.
+ * tests/objc.exp: Regenerated.
+
+2002-12-10 Bruno Haible <bruno@clisp.org>
+
+ * src/options.h: Reorder enum values.
+ (Options::short_usage, Options::long_usage): Make static.
+ * src/options.cc (Options::short_usage); No longer print a monster
+ usage line.
+ (Options::print_options): Improve output of options like
+ --key-positions=1,2,$.
+ (Options::~Options): Update.
+
+ * src/options.h (UPPERLOWER): New enum value.
+ * src/options.cc (Options::long_usage): Document option --ignore-case.
+ (Options::~Options): Update.
+ (long_options): Add option --ignore-case.
+ (Options::parse_options): Handle option --ignore-case.
+ * src/input.cc (Input::read_input): Recognize option %ignore-case.
+ * src/keyword.h (KeywordExt::init_selchars_tuple,
+ KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low):
+ Add alpha_unify argument.
+ * src/keyword.cc (KeywordExt::init_selchars_low): Add alpha_unify
+ argument.
+ (KeywordExt::init_selchars_tuple): Add alpha_unify argument.
+ (KeywordExt::init_selchars_multiset): Add alpha_unify argument.
+ * src/search.h (Search::compute_alpha_size,
+ Search::compute_alpha_unify): New declarations.
+ (Search::init_selchars_multiset): Add alpha_unify argument.
+ (Search::_alpha_unify): New field.
+ * src/search.cc (Search::compute_alpha_size,
+ Search::compute_alpha_unify): New functions.
+ (Search::init_selchars_tuple): Update.
+ (Search::find_positions): Temporarily set _alpha_unify. Perform a
+ case insensitive comparison if needed.
+ (Search::init_selchars_multiset): Add alpha_unify argument.
+ (Search::count_duplicates_multiset): Call compute_alpha_unify.
+ (Search::find_alpha_inc): Temporarily set _alpha_unify. At the end,
+ set _alpha_size and _alpha_unify.
+ (Search::prepare): Update. Don't compute _alpga_size here.
+ (Search::optimize): Propagate unified asso_values.
+ (Search::~Search) Delete _alpha_unify.
+ * src/output.cc (output_upperlower_strcmp, output_upperlower_strncmp,
+ output_upperlower_memcmp): New functions.
+ (Output_Compare_Strcmp::output_comparison,
+ Output_Compare_Strncmp::output_comparison,
+ Output_Compare_Memcmp::output_comparison): Use the case-insensitive
+ comparison function if --ignore-case was given.
+ (Output::output): Emit the auxiliary case-insensitive comparison
+ function if needed.
+ * tests/permutc2.gperf, tests/permutc2.exp: New files.
+ * tests/Makefile.in (check-test): Also check permutc2.gperf.
+ * tests/test-6.exp: Update.
+ * doc/gperf.texi (Gperf Declarations): Document %ignore-case.
+ (Input Details): Document option --ignore-case.
+ * NEWS: Update.
+
+ * src/search.cc (Search::optimize): Fill unused asso_values[] entries
+ with a large value.
+ * src/output.h (Output::Output): Remove occurrences argument.
+ (Output::_occurrences): Remove field.
+ * src/output.cc (Output::Output): Remove occurrences argument.
+ (Output::output_hash_function): Ignore _occurrences.
+ * src/main.cc (main): Don't pass the _occurrences to Output.
+
+ * src/search.cc (Search::preprepare): Exit if keywords contain
+ out-of-range characters.
+
+ * src/search.cc (for): Define so as to avoid errors with old compilers.
+
+ * src/options.h (SHAREDLIB): New enum value.
+ * src/options.cc (Options::short_usage): Mention option -P.
+ (Options::long_usage): Document option -P.
+ (long_options): Add option --pic.
+ (Options::parse_options): Handle option -P/--pic.
+ * src/output.cc (output_keyword_blank_entries): When SHAREDLIB is
+ specified, emit NULL pointers instead of "".
+ (Output::output_lookup_function_body): When SHAREDLIB is specified
+ and SWITCH and DUP and not specified, test the table entry against
+ NULL before the string comparison.
+ * tests/test-6.exp: Update.
+ * doc/gperf.texi (Output Details): Document option -P.
+ * NEWS: Update.
+ Suggested by Ulrich Drepper.
+
+2002-12-08 Bruno Haible <bruno@clisp.org>
+
+ * tests/permut2.gperf, tests/permut2.exp: New files.
+ * tests/permut3.gperf, tests/permut3.exp: New files.
+ * tests/charsets.gperf: New file, from Bruce Lilly.
+ * tests/charsets.exp: New file.
+ * tests/languages.gperf: New file, from Bruce Lilly.
+ * tests/languages.exp: New file.
+ * Makefile.in (check-test): Test them all.
+
+ Completely new asso_values search algorithm.
+ * src/search.h (Search::compute_occurrence, Search::clear_determined,
+ Search::set_determined, Search::already_determined, Search::reorder):
+ Remove functions.
+ (Search::init_asso_values, Search::sort_by_occurrence,
+ Search::compute_occurrence, Search::sort_by_occurrence,
+ Search::has_collisions, Search::collision_prior_to): Remove functions.
+ (Search::compute_partition, Search::count_possible_collisions,
+ Search::unchanged_partition): New method declarations.
+ (Search::_determined): Remove field.
+ * src/search.cc (Search::prepare): Don't initialize _determined.
+ (Search::compute_occurrence, greater_by_occurrence,
+ Search::clear_determined, Search::set_determined,
+ Search::already_determined, Search::reorder): Remove functions.
+ (Search::init_asso_values, compute_disjoint_union,
+ Search::sort_by_occurrence, Search::compute_occurrence,
+ Search::sort_by_occurrence, Search::has_collisions,
+ Search::collision_prior_to): Remove functions.
+ (StackEntry): Remove class.
+ (EquivalenceClass, Step): New classes.
+ (equals, Search::compute_partition, delete_partition,
+ Search::count_possible_collisions, Search::unchanged_partition): New
+ functions.
+ (Search::find_asso_values): Completely rewritten.
+ (Search::find_good_asso_values): Don't call reorder().
+ (Search::~Search): Don't free _determined.
+ * src/keyword.h (KeywordExt::_occurrence): Remove field.
+ * src/options.h (ORDER, FAST, OPT_CHOICE): Remove enum values.
+ (Options::_iterations): Remove field.
+ * src/options.icc (Options::get_iterations): Remove method.
+ * src/options.cc (Options::long_usage): Remove mention of -f and -o.
+ (Options::Options): Don't initialize _iterations.
+ (Options::~Options): Update.
+ (Options::parse_options): Do nothing for options -f, -o, -O.
+ * doc/gperf.texi: (Contributors): Update.
+ (Algorithmic Details): Remove options -f and -o. Update description
+ of option -s.
+ * tests/c-parse.exp, tests/chill.exp, tests/cplusplus.exp,
+ tests/gpc.exp, tests/java.exp, tests/modula2.exp, tests/objc.exp,
+ tests/test-4.exp): Regenerated, smaller than before.
+ * tests/test-6.exp: Update.
+ * NEWS: Update.
+
+2002-12-08 Bruno Haible <bruno@clisp.org>
+
+ * src/search.h (Search::_alpha_size): Change type to 'unsigned int'.
+ (Search::_asso_value_max): Likewise.
+ * src/search.cc (Search::prepare_asso_values): Update.
+ (Search::init_asso_values): Update.
+ (Search::~Search): Update.
+ * src/output.h (Output::Output): Change alpha_size type to
+ 'unsigned int'.
+ (Output::_alpha_size): Change type to 'unsigned int'.
+ * src/output.cc (Output::Output): Change alpha_size type to
+ 'unsigned int'.
+ (Output::output_hash_function): Update.
+
+2002-12-07 Bruno Haible <bruno@clisp.org>
+
+ * src/options.h (OPT_CHOICE): New enum value.
+ * src/options.cc (Options::~Options): Update.
+ (long_options): New option --optimized-collision-resolution.
+ (Options::parse_options): Accept option -O.
+ * src/search.h (Search::sort_by_occurrence): Change argument to
+ 'unsigned int'.
+ (Search::compute_occurrence, Search::sort_by_occurrence): New method
+ declarations.
+ * src/search.cc (Search::sort_by_occurrence): Change argument to
+ 'unsigned int'.
+ (Search::compute_occurrence, Search::sort_by_occurrence): New methods.
+ (Search::find_asso_values): Implement OPT_CHOICE. More debugging
+ output.
+
+ * src/search.cc (Search::prepare_asso_values) [DEBUG]: Also print
+ the keyword list in order.
+ (Search::find_asso_values) [DEBUG]: Upon failure, print the union_set.
+
+ * src/options.h (Options::get_size_multiple): Change return type to
+ float.
+ (Options::_size_multiple): Change type to float.
+ * src/options.icc (Options::get_size_multiple): Change return type to
+ float.
+ * src/options.cc (Options::long_usage): Update description of option
+ -s.
+ (Options::~Options): Update.
+ (Options::parse_options): For option -s, accept a fraction.
+ * src/search.cc (Search::prepare_asso_values): Use get_size_multiple
+ as it is.
+ * tests/test-6.exp: Update.
+ * doc/gperf.texi (Algorithmic Details): Update description of option
+ -s.
+
+2002-12-04 Bruno Haible <bruno@clisp.org>
+
+ Improve debugging output.
+ * src/hash-table.h (Hash_Table::dump): New method.
+ * src/hash-table.cc (Hash_Table::dump): New method, extracted from
+ destructor.
+ (Hash_Table::~Hash_Table): No longer print the contents.
+ * src/positions.h (PositionReverseIterator): New class.
+ * src/positions.icc (PositionReverseIterator::PositionReverseIterator,
+ PositionReverseIterator::next): New methods.
+ * src/search.cc (Search::find_positions): If debugging, print the
+ result.
+ (Search::find_alpha_inc): If debugging, print the result.
+ (Search::prepare): Explicitly dump the hash table's contents here.
+
+ Portability fixes.
+ * src/positions.h (Positions::LASTCHAR, Positions::MAX_KEY_POS,
+ PositionIterator::EOS): Define as compile-time constants using enum.
+ * src/bool-array.cc (Bool_Array::~Bool_Array): Remove const qualifier
+ of pointer to be deleted.
+ * src/input.cc (Input::~Input): Likewise.
+ * src/keyword.cc (KeywordExt::delete_selchars): Likewise.
+ * src/main.cc (main): Likewise.
+ * src/hash-table.cc (Hash_Table::~Hash_Table): Limit scope of 'for'
+ variables.
+ * src/search.cc (Search::prepare_asso_values): Use a static_cast to
+ convert from time_t to long. This is possible because ISO C 99 says
+ time_t is a numeric type.
+
+2002-11-20 Bruno Haible <bruno@clisp.org>
+
+ * src/search.cc (Search::find_asso_values): Avoid gcc warnings about
+ uninitialized variables.
+
+ Implement backtracking.
+ * src/search.h (Search::has_collisions): Renamed from
+ Search::less_collisions. Return a boolean.
+ * src/search.cc (Search::has_collisions): Renamed from
+ Search::less_collisions. Return a boolean.
+ (StackEntry): Remove field _collisions_so_far.
+ (Search::find_asso_values): Backtrack when encountering an unresolved
+ collision. Assume collisions_so_far is always zero.
+ (Search::optimize): Exit if there are accidental duplicates at the end.
+ * src/output.cc (Output::num_hash_values): Simply return the list
+ length.
+ (Output::output_keylength_table): Remove handling of accidental
+ duplicates.
+ (Output::output_keyword_table, Output::output_lookup_array): Likewise.
+ (output_switch_case, output_switches): Likewise.
+ * doc/gperf.texi (Algorithmic Details): Adjust description of options
+ -D, -f, -o, -r.
+ (Bugs): Remove note about missing backtracking.
+ (Projects): Likewise.
+
+2002-11-19 Bruno Haible <bruno@clisp.org>
+
+ Prepare for backtracking.
+ * src/search.h (Search::try_asso_value, Search::change_some_asso_value):
+ Remove declarations.
+ (Search::less_collisions, Search::collision_prior_to): New declarations.
+ (Search::_fewest_collisions, Search::_union_set, Search::_num_done):
+ Remove fields.
+ * src/search.cc (Search::prepare_asso_values): Don't initialize
+ _union_set.
+ (Search::try_asso_value, Search::change_some_asso_value): Remove
+ methods.
+ (Search::less_collisions, Search::collision_prior_to): New methods.
+ (StackEntry): New class.
+ (Search::find_asso_values): Reorganized to use pseudo-recursion.
+ (Search::~Search): Don't free _union_set.
+
+ * src/search.h (Search::find_good_asso_values): New declaration.
+ * src/search.cc: Add comments about the basic structure of the
+ algorithm.
+ (Search::find_positions): Move the option[POSITIONS] test to here.
+ (Search::find_good_asso_values): New method, extracted from
+ Search::optimize.
+ (Search::optimize): Remove option[POSITIONS] test. Call
+ find_good_asso_values.
+
+2002-11-17 Bruno Haible <bruno@clisp.org>
+
+ * src/options.cc (Options::parse_options): Include copyright notice
+ and authors in --version output.
+
+ Avoid artificial duplicates.
+ * src/keyword.h (KeywordExt::init_selchars_tuple): New declaration.
+ (KeywordExt::init_selchars_multiset): Renamed from
+ KeywordExt::init_selchars.
+ (KeywordExt::init_selchars_low): New declaration.
+ * src/keyword.cc (KeywordExt::init_selchars_low): Renamed from
+ KeywordExt::init_selchars. Add alpha_inc argument. Remove sorting.
+ (KeywordExt::init_selchars_tuple): New method.
+ (KeywordExt::init_selchars_multiset): New method, replaces
+ KeywordExt::init_selchars.
+ * src/search.h (Search::init_selchars_tuple): Renamed from
+ Search::init_selchars.
+ (Search::count_duplicates_tuple): Renamed from Search::count_duplicates.
+ (Search::init_selchars_multiset, Search::count_duplicates_multiset,
+ Search::find_alpha_inc): New declarations.
+ (Search::_alpha_inc): New field.
+ (Search::_alpha_size, Search::_occurrences, Search::_asso_values,
+ Search::_determined): Make non-const.
+ * src/search.cc (Search::Search): Don't initialize _key_positions,
+ _alpha_size, _occurrences, _asso_values, _determined here.
+ (Search::init_selchars_tuple): Renamed from Search::init_selchars.
+ (Search::count_duplicates_tuple): Renamed from Search::count_duplicates.
+ (Search::find_positions): Update.
+ (Search::init_selchars_multiset, Search::count_duplicates_multiset,
+ Search::find_alpha_inc): New methods.
+ (Search::prepare): Move preprepare, find_positions calls away.
+ Initialize _alpha_size, _occurrences, _asso_values, _determined here.
+ (Search::optimize): Call preprepare, find_positions here. Initialize
+ _key_positions here.
+ (Search::~Search): Deallocate _alpha_inc.
+ * src/output.cc (Output::Output): Add alpha_inc argument.
+ (Output::output_hash_function): Use _alpha_inc.
+ * src/output.h (Output::Output): Add alpha_inc argument.
+ (Output::_alpha_inc): New field.
+ * src/main.cc (main): Pass _alpha_inc from Search to Output.
+ * tests/chill.exp: Update.
+ * doc/gperf.texi (Algorithmic Details): Remove description of
+ artificial duplicates.
+
+ * src/keyword.h (KeywordExt::_selchars): Change type to
+ 'const unsigned int *'.
+ * src/keyword.cc (sort_char_set): Change argument type to
+ 'unsigned int *'.
+ (KeywordExt::init_selchars): Update.
+ * src/search.h (Search::sort_by_occurrence): Change argument type to
+ 'unsigned int *'.
+ (Search::try_asso_value): Change argument type to 'unsigned int'.
+ (Search::_union_set): Change type to 'unsigned int *'.
+ * src/search.cc (Search::prepare, Search::compute_occurrence,
+ Search::set_determined, Search::already_determined,
+ Search::prepare_asso_values, Search::compute_hash): Update.
+ (compute_disjoint_union): Change argument types to 'unsigned int *'.
+ (Search::sort_by_occurrence): Likewise.
+ (Search::try_asso_value): Change argument type to 'unsigned int'.
+ (Search::change_some_asso_value, Search::~Search): Update.
+ * src/hash-table.cc (Hash_Table::~Hash_Table, Hash_Table::equal,
+ Hash_Table::insert): Update.
+
+ * src/positions.h: New file, extracted from options.h.
+ * src/positions.icc: New file, extracted from options.icc.
+ * src/positions.cc: New file, extracted from options.cc.
+ * src/options.h: Include positions.h. Move classes Positions and
+ PositionsIterator away.
+ * src/options.icc: Move classes Positions and PositionsIterator away.
+ * src/options.cc: Move class Positions away.
+ * src/keyword.cc: Include positions.h instead of options.h.
+ * src/output.h: Include positions.h instead of options.h.
+ * src/search.h: Include positions.h instead of options.h.
+ * src/Makefile.in (OBJECTS): Add positions.o.
+ (POSITIONS_H): New variable.
+ (OPTIONS_H, SEARCH_H, OUTPUT_H, keyword.o): Use it.
+ (positions.o): New rule.
+
+ * src/options.h (POSITIONS): New enum value.
+ (Positions::Positions): New copy constructor.
+ (Positions::operator=, Positions::contains, Position::add,
+ Positions::remove, Positions::print): New method declaration.
+ (Options::get_max_keysig_size): Remove method.
+ * src/options.icc (Positions::Positions): New copy constructor.
+ (Positions::operator=): New method.
+ (Options::get_max_keysig_size): Remove method.
+ * src/options.cc (Options::Options): Initialize _key_positions
+ trivially.
+ (Options::parse_options): Option -k sets POSITIONS.
+ (Positions::contains, Positions::add, Positions::remove,
+ Positions::print): New methods.
+ * src/hash-table.cc (Hash_Table::~Hash_Table): Compute the field
+ width explicitly, instead of using Options::get_max_keysig_size.
+ * src/keyword.h (KeywordExt::init_selchars): Add arguments
+ use_all_chars, positions.
+ (KeywordExt::delete_selchars): New declaration.
+ * src/keyword.cc (KeywordExt::init_selchars): Add arguments
+ use_all_chars, positions. Remove error message if there are no key
+ positions.
+ (KeywordExt::delete_selchars): New method.
+ * src/search.h: Include options.h.
+ (Search::preprepare, Search::init_selchars, Search::delete_selchars,
+ Search::count_duplicates, Search::find_positions): New declarations.
+ (Search::_key_positions): New field.
+ * src/search.cc (Search::Search): Initialize _key_positions.
+ (Search::preprepare, Search::init_selchars, Search::delete_selchars,
+ Search::count_duplicates, Search::find_positions): New functions.
+ (Search::prepare): Call preprepare and find_positions. Tweak error
+ message.
+ (Search::get_max_keysig_size): Use _key_positions instead of
+ option.get_key_positions().
+ (Search::optimize): Tweak error message.
+ * src/output.h: Include options.h.
+ (Output::Output): Add Positions argument.
+ (Output::_key_positions): New field.
+ * src/output.cc (Output::Output): Add Positions argument.
+ (Output::output_hash_function): Omit the table if there are no
+ positions at all. Use _key_positions instead of
+ option.get_key_positions().
+ (Output::output): Output the computed positions as a comment.
+ * src/main.cc (main): Pass the Positions from Searcher to Output.
+ * src/Makefile.in (SEARCH_H, OUTPUT_H): Include OPTIONS_H.
+ * tests/Makefile.in (check-test): Pass key positions explicitly.
+ * tests/gpc.exp: Update.
+ * tests/test-4.exp: Update.
+ * doc/gperf.texi (Algorithmic Details): Mention that -k is not needed
+ usually.
+
+2002-11-16 Bruno Haible <bruno@clisp.org>
+
+ * src/options.h (Options::get_slot_name): Renamed from
+ Options::get_key_name.
+ (Options::set, Options::set_language, Options::set_total_switches,
+ Options::set_function_name, Options::set_slot_name,
+ Options::set_class_name, Options::set_hash_name,
+ Options::set_wordlist_name, Options::set_delimiters): New method
+ declarations.
+ (Options::_language): New field.
+ (Options::_slot_name): Renamed from Options::_key_name.
+ * src/options.icc (Options::set): New method.
+ (Options::get_slot_name): Renamed from Options::get_key_name.
+ * src/options.cc (DEFAULT_FUNCTION_NAME): Renamed from DEFAULT_NAME.
+ (DEFAULT_SLOT_NAME): Renamed from DEFAULT_NAME.
+ (Options::Options): Initialize _language. Update.
+ (Options::~Options): Update.
+ (Options::set_language, Options::set_total_switches,
+ Options::set_function_name, Options::set_slot_name,
+ Options::set_class_name, Options::set_hash_name,
+ Options::set_wordlist_name, Options::set_delimiters): New methods.
+ (Options::parse_options): Call set_language. Update.
+ * src/input.cc (is_declaration, is_declaration_with_arg,
+ is_define_declaration): New functions.
+ (Input::read_input): Accept %DECL declarations.
+ * src/output.cc (Output::output_lookup_function_body): Update.
+ * doc/gperf.texi (Declarations): Add new subnodes.
+ (User-supplied Struct, Gperf Declarations, C Code Inclusion): New
+ nodes.
+ (Keywords, Output Format, Binary Strings, Options): Mention %
+ declarations as being equivalent to the command line options.
+
+ * src/options.cc (Options::long_usage): Rename options -H, -N, -l, -G.
+ (long_options): Add --hash-function-name, --lookup-function-name,
+ --compare-lengths.
+ * doc/gperf.texi (Output Details): Rename options -H, -N, -l, -G.
+ * tests/test-6.exp: Update.
+
+ * src/options.cc (DEFAULT_DELIMITERS): Remove newline.
+ * src/options.cc (Options::long_usage): Change default --delimiters.
+ * doc/gperf.texi (Input Details): Likewise.
+ * tests/test-6.exp: Update.
+
+ * doc/gperf.texi: Move description of option -l from section
+ Algorithmic Details to section Output Details.
+ * src/options.cc (Options::long_usage): Likewise.
+ * tests/test-6.exp: Update.
+
+2002-11-12 Bruno Haible <bruno@clisp.org>
+
+ * src/options.h (Output::get_output_file_name): New method.
+ (Output::_output_file_name): New field.
+ * src/options.icc (Options::get_output_file_name): New method.
+ * src/options.cc (Options::long_usage): Document option --output-file.
+ (Options::Options): Initialize _output_file_name.
+ (long_options): Add --output-file.
+ (Options::parse_options): Handle it.
+ * src/main.cc (main): Open the output file if given by name.
+ * doc/gperf.texi (Output File): New section.
+ * tests/test-6.exp: Update.
+
+2002-11-10 Bruno Haible <bruno@clisp.org>
+
+ * src/input.cc (pretty_input_file_name): New function.
+ (read_input): Use it in all error and warning messages.
+
+ * src/keyword.h (Keyword::_lineno): New field.
+ * src/input.h (Input::_struct_decl_lineno): New field.
+ * src/input.cc (Input::read_input): Set _struct_decl_lineno. Fill
+ each keyword's _lineno field.
+ * src/main.cc (main): Pass _struct_decl_lineno from Input to Output.
+ * src/output.h (Output::Output) Add struct_decl_lineno argument.
+ (Output::_struct_decl_lineno): New field.
+ * src/output.cc (Output::Output) Add struct_decl_lineno argument.
+ (output_keyword_entry): Emit #line directive before table entry.
+ (Output::output): Emit #line directive before _struct_decl.
+
+ Fix memory leaks.
+ * src/keyword.h (empty_string): New declaration.
+ * src/keyword.cc (empty_string): New variable.
+ * src/input.h (Input::_input): Make public.
+ (Input::_input_end): New field.
+ * src/input.cc (read_input): When removing leading whitespace from
+ struct_decl, reallocate it. For rest, use empty_string instead of "".
+ Set _input_end.
+ (Input::~Input): Delete _struct_decl, _struct_tag, _return_type.
+ * src/search.cc (Search::prepare): When removing an element from
+ the keyword list, delete the list node.
+ (Search::~Search): Delete _occurrences, _asso_values.
+ * src/main.cc (main): Between Search::~Search and Input::~Input,
+ destroy the keyword list.
+
+ Rewrite the input routines.
+ * src/input.h: Don't include read-line.h.
+ (Input): Don't inherit from class Read_Line.
+ (Input::read_keys, Input::strcspn, Input::set_output_types,
+ Input::get_array_type, Input::save_include_src,
+ Input::get_special_input): Remove declarations.
+ (Input::read_input): New declaration.
+ (Input::_struct_decl): Renamed from Input::_array_type.
+ (Input::_verbatim_declarations): Renamed from Input::_include_src.
+ (Input::_verbatim_code): Replaces Input::_additional_code.
+ * src/input.cc: Completely rewritten.
+ * src/output.h (Output::Output): Update the verbatim_* arguments.
+ (Output::_struct_decl): Renamed from Output::_array_type.
+ (Output::_verbatim_declarations): Renamed from Output::_include_src.
+ (Output::_verbatim_code): Replaces Output::_additional_code.
+ * src/output.cc (Output::Output): Update the verbatim_* arguments.
+ (Output::output): Output the verbatim_* code pieces with #line.
+ * src/main.cc (main): Call Input::read_input instead of
+ Input::read_keys. Update Output::Output arguments.
+ * src/read-line.h: Remove file.
+ * src/read-line.cc, src/read-line.icc: Remove files.
+ * src/Makefile.in (OBJECTS): Remove read-line.o.
+ (READ_LINE_H): Remove variable.
+ (INPUT_H): Update.
+ (read-line.o): Remove rule.
+ * doc/gperf.texi (Declarations): Correct the example.
+ (Keywords): Mention that lines starting with % are forbidden here.
+ * tests/c-parse.exp: Update.
+ * tests/cplusplus.exp: Update.
+ * tests/gpc.exp: Update.
+ * tests/java.exp: Update.
+ * tests/objc.exp: Update.
+ * tests/test-4.exp: Update.
+
+ * src/options.h (Options::get_input_file_name): New declaration.
+ (Options::_input_file_name): New field.
+ * src/options.icc (Options::get_input_file_name): New method.
+ * src/options.cc (Options::Options): Initialize _input_file_name.
+ (Options::parse_options): Don't open input file, only store it in
+ _input_file_name.
+ * src/main.cc (main): Open input file here.
+ Print an error message upon write error on the output file.
+
+ Upgrade to autoconf-2.52.
+ * configure.in: Use AC_CONFIG_SUBDIRS instead of AC_OUTPUT_SUBDIRS.
+ * Makefile.devel (configure, lib/configure, src/configure,
+ tests/configure, doc/configure): Use autoconf-2.52.
+
+2002-11-09 Bruno Haible <bruno@clisp.org>
+
+ * doc/gperf.texi: Talk about "bytes" instead of "characters". Talk
+ about "keywords", not "keys". Talk about "input file", not "keyfile".
+ (@menu): Fix a menu entry.
+ (Contributors): Don't mention cperf.
+ (Motivation): Fix an off-by-one error in the definition of "minimal".
+ Mention GNU Java. Recommend http URL instead of anonymous ftp.
+ (Search Structures): Mention GNU Java.
+ (Output Format): Drop reference to node 'Implementation'.
+ (Output Details): Talk about "slot-name" instead of "key name".
+ (Algorithmic Details): Talk about "selected byte positons", not
+ "key positions". Upper limit is now 255. Explain a third reason
+ why duplicates can occur. Describe negative effects of
+ --occurrence-sort.
+ (Implementation): Remove chapter.
+
+2002-11-07 Bruno Haible <bruno@clisp.org>
+
+ * src/bool-array.cc (Bool_Array::~Bool_Array): Free _storage_array.
+ * src/search.cc (Search::~Search): Free _union_set, _determined.
+
+ * tests/Makefile.in (check-test): Don't redirect stderr.
+
+2002-11-05 Bruno Haible <bruno@clisp.org>
+
+ * src/keyword-list.h (mergesort_list): New declarations.
+ * src/keyword-list.cc (Keyword_Comparison): New type.
+ (merge, mergesort_list): New functions, moved here from search.cc.
+ * src/search.h (Search::merge, Search::merge_sort): Remove methods.
+ (Search::_occurrence_sort, Search::_hash_sort): Remove fields.
+ * src/search.cc (Search::merge, Search::merge_sort): Remove methods.
+ (greater_by_occurrence, less_by_hash_value): New functions.
+ (Search::reorder, Search::sort): Use mergesort_list.
+
+2002-11-04 Bruno Haible <bruno@clisp.org>
+
+ * src/options.h (Options::_asso_iterations): New field.
+ (Options::get_asso_iterations): New method declaration.
+ * src/options.icc (Options::get_asso_iterations): New method.
+ * src/options.cc (Options::short_usage): Mention j<jump> and m<num>.
+ (Options::long_usage): Document option -m.
+ (Options::Options): Initialize _asso_iterations.
+ (Options::~Options): Print _asso_iterations too.
+ (long_options): Add --multiple-iterations.
+ (Options::parse_options): Handle option -m.
+ * src/keyword-list.h (copy_list, delete_list): New declarations.
+ * src/keyword-list.cc (copy_list, delete_list): New functions.
+ * src/search.h (Search::_initial_asso_value, Search::_jump): New fields.
+ * src/search.cc (Search::prepare_asso_values): Initialize
+ _initial_asso_value and _jump here.
+ (Search::init_asso_values): Use _initial_asso_value.
+ (Search::try_asso_value): Use _jump.
+ (Search::optimize): If option -m was given, iterate over different
+ values for _initial_asso_value and _jump.
+ * doc/gperf.texi (Algorithmic Details): Document option -m.
+ * tests/test-6.exp: Update.
+
+2002-11-03 Bruno Haible <bruno@clisp.org>
+
+ Bug fix: When option -j 0 was used without option -r, the output was
+ not random.
+ * src/search.h (Search::prepare_asso_values): New method declaration.
+ * src/search.cc (Search::prepare_asso_values): New method, extracted
+ from Search::init_asso_values. Call srand also when "-j 0" was given.
+ (Search::optimize): Call prepare_asso_values().
+
+ * src/hash-table.h (Hash_Table::_ignore_length, Hash_Table::equal):
+ Declare as const.
+ * src/hash-table.cc (Hash_Table::equal): Declare as const.
+ * src/input.h (Input::_factory): Declare as const.
+ * src/keyword-list.h (Keyword_List::first, KeywordExt_List::first):
+ Declare as const.
+ * src/keyword-list.icc (Keyword_List::first, KeywordExt_List::first):
+ Declare as const.
+ * src/output.h (Output::num_hash_values, Output::output_constants,
+ Output::output_hash_function, Output::output_keylength_table,
+ Output::output_keyword_table, Output::output_lookup_array,
+ Output::output_lookup_tables, Output::output_lookup_function_body,
+ Output::output_lookup_function, Output::_array_type,
+ Output::_additional_code, Output::_include_src, Output::_total_keys,
+ Output::_total_duplicates, Output::_max_key_len, Output::_min_key_len):
+ Declare as const.
+ * src/output.cc (Output::num_hash_values, Output::output_constants,
+ Output::output_hash_function, Output::output_keylength_table,
+ Output::output_keyword_table, Output::output_lookup_array,
+ Output::output_lookup_tables, Output::output_lookup_function_body,
+ Output::output_lookup_function): Declare as const.
+ * src/search.h (Search::merge, Search::merge_sort,
+ Search::compute_occurrence, Search::already_determined,
+ Search::keyword_list_length, Search::max_key_length,
+ Search::get_max_keysig_size, Search::compute_hash,
+ Search::sort_by_occurrence): Declare as const.
+ * src/search.cc (Search::merge, Search::merge_sort,
+ Search::compute_occurrence, Search::already_determined,
+ Search::keyword_list_length, Search::max_key_length,
+ Search::get_max_keysig_size, Search::compute_hash,
+ Search::sort_by_occurrence): Declare as const.
+
+ * src/output.cc (Output::output): Set char_to_index to a cast in all
+ cases. Avoids gcc warnings on the generated code.
+
+ * src/output.cc (Output_Enum): Prepend an underscore to field names.
+ (Output_Expr1): Likewise.
+ (Output::output_hash_function): Simplify the special case for "-k 1,$".
+
+ * src/search.h (Search::init_asso_values, Search::find_asso_values):
+ New declarations.
+ (Search::try_asso_value): Renamed from Search::affects_prev.
+ (Search::change_some_asso_value): Renamed from Search::change.
+ (Search::set_asso_max, Search::get_asso_max): Remove methods.
+ (Search::_union_set): New field.
+ * src/search.cc (Search::init_asso_values): New method, extracted
+ from Search::optimize.
+ (Search::try_asso_value): Renamed from Search::affects_prev. Take the
+ iteration count as argument.
+ (Search::change_some_asso_value): Renamed from Search::change. Don't
+ make union_set static. Don't increment _fewest_collisions here.
+ (Search::find_asso_values): New method, extracted from
+ Search::optimize.
+ (Search::optimize); Update.
+
+ * src/search.h (Search::compute_hash): Renamed from Search::hash.
+ (Search::compute_disjoint_union): Remove declaration.
+ (Search::sort_by_occurrence): Renamed from Search::sort_set.
+ * src/search.cc (Search::compute_hash): Renamed from Search::hash.
+ (compute_disjoint_union): Renamed from Search::compute_disjoint_union.
+ (Search::sort_by_occurrence): Renamed from Search::sort_set.
+ (Search::change): Simplify loop.
+
+ * src/search.h (Search::clear_determined): New declaration.
+ * src/search.cc (Search::clear_determined): New method.
+ (Search::already_determined): Optimize.
+ (Search::reorder): Even when the next keyword after the current one
+ is completely determined, move all determined keywords after the
+ current one.
+
+ Compute the occurrences after removal of duplicates, not before.
+ * src/keyword.h (KeywordExt::init_selchars): Remove occurrences
+ argument.
+ * src/keyword.cc (KeywordExt::init_selchars): Likewise.
+ * src/search.cc (Search::prepare): Reorder the code. Compute the
+ occurrences after removal of duplicates.
+ (Search::merge_sort): Optimize the loop.
+ (Search::compute_occurrence): Renamed from Search::get_occurrence.
+ * src/search.h (Search::compute_occurrence): Renamed from
+ Search::get_occurrence.
+ * tests/chill.exp: Regenerated.
+
+ Bug fix: The hash table could fail to detect duplicates, between
+ keywords of different length, when option -n (option[NOLENGTH]) was
+ given.
+ * src/hash-table.h (Hash_Table::Hash_Table): Pass table size, not
+ vector and vector size as arguments.
+ (Hash_Table::_log_size): New field.
+ (Hash_Table::equal): New declaration.
+ * src/hash-table.cc (size_factor): New variable.
+ (Hash_Table::Hash_Table): Pass table size, not vector and vector size
+ as arguments. Allocate the vector here.
+ (Hash_Table::~Hash_Table): Deallocate the vector here.
+ (Hash_Table::equal): New function.
+ (Hash_Table::insert): Use it. Don't use item->_allchars_length for the
+ increment if _ignore_length is true.
+ * src/search.cc (TABLE_MULTIPLE): Remove variable.
+ (Search::prepare): Update.
+
+2002-11-02 Bruno Haible <bruno@clisp.org>
+
+ Provide documentation also in PDF format.
+ * doc/Makefile.in (pdfdir, TEXI2PDF): New variables.
+ (all): Depend on pdf.
+ (pdf, gperf.pdf): New rules.
+ (maintainer-clean): Remove the PDF file.
+
+ * src/keyword-list.icc: New file, extracted from keyword-list.h.
+ * src/keyword-list.h: Include keyword-list.icc. Move inline methods
+ to there.
+ * src/keyword-list.cc: Include keyword-list.icc.
+ * src/Makefile.in (KEYWORD_LIST_H): Add keyword-list.icc.
+
+ * lib/hashpjw.h (hashpjw): Change argument type to 'unsigned char *'.
+ * lib/hash.cc (hashpjw): Likewise.
+ * src/keyword.icc: New file.
+ * src/keyword.h: Include keyword.icc.
+ (KeywordExt::_selchars): Change type to 'unsigned char *'.
+ * src/keyword.cc: Include keyword.icc.
+ (Keyword::Keyword, KeywordExt::KeywordExt): Move to keyword.icc.
+ (sort_char_set): Change argument type to 'unsigned char *'.
+ (KeywordExt::init_selchars): Update.
+ * src/search.h (Search::compute_disjoint_union): Change argument types
+ to 'unsigned char *'.
+ (Search::sort_set): Likewise.
+ (Search::affects_prev): Change argument type to 'unsigned char'.
+ * src/search.cc (Search::prepare): Initialize _duplicate_link here.
+ (Search::get_occurrence, Search::set_determined,
+ Search::already_determined, Search::hash): Update.
+ (Search::compute_disjoint_union): Change argument types to
+ 'unsigned char *'.
+ (Search::sort_set): Likewise.
+ (Search::affects_prev): Change argument type to 'unsigned char'.
+ (Search::change): Update.
+ * src/Makefile.in (KEYWORD_H): Add keyword.icc.
+
+ * src/options.cc (Options::parse_options): Fix error message.
+
+ * src/read-line.h (Read_Line::Read_Line): Make FILE* argument
+ mandatory. Move body to read-line.icc.
+ * src/read-line.icc (Read_Line::Read_Line): New constructor.
+ * src/input.h (Input::Input): Add FILE* argument.
+ * src/input.cc (Input::Input): Likewise.
+ * src/main.cc (main): Pass stdin to Input constructor.
+
+ * src/options.h (DEFAULTCHARS): Remove.
+ (Positions::MAX_KEY_POS): Set to 255.
+ (Positions::_positions): Increase array size.
+ (PositionIterator::EOS): Set to -1.
+ (PositionIterator::_index): Change type to 'unsigned int'.
+ * src/options.icc (Positions::Positions): Don't store
+ PositionIterator::EOS.
+ (PositionIterator::next): Produce PositionIterator::EOS here.
+ * src/options.cc (Options::long_usage): Use MAX_KEY_POS, not
+ MAX_KEY_POS-1.
+ (PositionStringParser): Rename field _size to _in_range. Rename
+ field _curr_value to _range_curr_value. Rename field _upper_bound
+ to _range_upper_bound.
+ (PositionStringParser::nextPosition): Comments.
+ (Options::Options): Update.
+ (Options::~Options): Update.
+ (long_options): Use NULL, not 0.
+ (Options::parse_options): Set BAD_VALUE to -2; -1 is now EOS. Bug fix:
+ Check against array overflow when more than MAX_KEY_POS positions are
+ given. Don't store PositionIterator::EOS.
+ Check against extra arguments before opening the input file.
+ * src/output.cc (Output::output_hash_function): Change test which
+ was for option[DEFAULTCHARS].
+ * tests/test-6.exp: Update.
+
+ * src/options.h (Options::get_delimiters): Renamed from
+ Options::get_delimiter.
+ * src/options.icc (Options::get_delimiters): Renamed from
+ Options::get_delimiter.
+ * src/input.cc (Input::read_keys): Update.
+
+ Bug fix.
+ * src/options.cc (Options::print_options): Escape backquote inside
+ double-quoted strings.
+
+ Bug fix.
+ * src/keyword.cc (KeywordExt::init_selchars): Avoid comparison with
+ uninitialized member variable. Found with 'valgrind'.
+
+ * src/version.cc: Include version.h.
+ * src/Makefile.in (OBJECTS): Reorder.
+ (KEYWORD_H, KEYWORD_LIST_H, INPUT_H, SEARCH_H, OUTPUT_H): New
+ variables.
+ (HASH_TABLE_H): Update.
+ (options.o, read-line.o, keyword.o, keyword-list.o, input.o, search.o,
+ output.o, main.o): Update dependencies.
+
+ * src/vectors.h: Remove file.
+ * src/vectors.cc: Remove file.
+ * src/search.h: Don't include vectors.h.
+ (Search): Don't inherit from Vectors. New fields _alpha_size,
+ _occurrences, _asso_values.
+ (Search::_determined, Search::get_occurrence, Search::set_determined,
+ Search::already_determined, Search::hash, Search::sort_set): Make
+ nonstatic.
+ * src/search.cc (Search::Search): Initialize _alpha_size, _occurrences,
+ _asso_values, _determined.
+ (Search::optimize, Search::~Search): Update.
+ * src/output.h: Don't include vectors.h.
+ (Output): Remove field _v. New fields _alpha_size, _occurrences,
+ _asso_values.
+ (Output::Output): Replace Vectors* argument with alpha_size,
+ occurrences, asso_values.
+ * src/output.cc (Output::Output): Replace Vectors* argument with
+ alpha_size, occurrences, asso_values.
+ (Output::output_hash_function): Update.
+ * src/main.cc (main): Don't set Vectors::ALPHA_SIZE.
+ Pass _alpha_size, _occurrences, _asso_values from Search to Output.
+ * src/keyword.h: Don't include vectors.h.
+ * src/Makefile.in (OBJECTS): Remove vectors.o.
+ (VECTORS_H): Remove variable.
+ (vectors.o): Remove rule.
+
+ * src/search.h: New file, combines src/key-list.h, src/gen-perf.h.
+ * src/search,cc: New file, combines src/key-list.cc, src/gen-perf.cc.
+ * src/key-list.h: Remove file.
+ * src/key-list.cc: Remove file.
+ * src/gen-perf.h: Remove file.
+ * src/gen-perf.cc: Remove file.
+ * src/main.cc (KeywordExt_Factory): Moved here from gen-perf.cc.
+ (main): Inline some code from gen-perf.cc.
+ * src/keyword.h (KeywordExt::init_selchars): Take the occurrences
+ vector as argument.
+ * src/keyword.cc (KeywordExt::init_selchars): Take the occurrences
+ vector as argument.
+ * src/input.cc (Input::set_output_types): Initialize _array_type,
+ _return_type, _struct_tag.
+ (Input::read_keys): Initialize _additional_code.
+ * src/Makefile.in (OBJECTS): Add search.o.
+ Remove key-list.o, gen-perf.o.
+ (KEY_LIST_H, GEN_PERF_H): Remove variables.
+ (gen-perf.o, key-list.o): Remove rules.
+ (search.o): New rule.
+
+ * *, */*: Update copyright notice to GPL version 2.
+
+ * src/keyword-list.h (Keyword_List): New class.
+ (KeywordExt_List): Inherit from it.
+ * src/keyword-list.cc (Keyword_List::Keyword_List): New constructor.
+ (KeywordExt_List::KeywordExt_List): Update.
+ * src/input.h (Input::Input): Add Keyword_Factory argument.
+ (Input::_factory): New field.
+ (Input::_head): Change type to Keyword_List*.
+ (Input::parse_line): New declaration.
+ * src/input.cc (Input::Input): New constructor.
+ (Input::parse_line): Renamed from parse_line. Use the _factory.
+ (Input::read_keys): Update.
+ * src/key-list.cc (KeywordExt_Factory): New class.
+ (Key_List::read_keys): Pass a KeywordExt_Factory as Input constructor
+ argument.
+
+ Avoid g++ -Wold-style-cast warnings.
+ * src/bool-array.icc: Use new-style casts.
+ * src/gen-perf.cc: Likewise.
+ * src/input.cc: Likewise.
+ * src/key-list.cc: Likewise.
+ * src/keyword.cc: Likewise.
+ * src/options.cc: Likewise.
+ * src/output.cc: Likewise.
+ * src/hash-table.cc: Likewise. Remove (char *) cast in memset argument.
+
+ * src/keyword-list.h (KeywordExt_List): Don't inherit from KeywordExt.
+ (KeywordExt_List::KeywordExt_List): Take a KeywordExt* as argument.
+ (KeywordExt_List::_car): New field.
+ (KeywordExt_List::first): Use it.
+ * src/keyword-list.cc (KeywordExt_List::KeywordExt_List): Take a
+ KeywordExt* as argument.
+ * src/input.cc (parse_line): Create the KeywordExt separately.
+
+ Start using bool.
+ * src/bool-array.h (Bool_Array::set_bit): Change return type to bool.
+ * src/bool-array.icc (Bool_Array::set_bit): Likewise.
+ * src/gen-perf.h (Gen_Perf::affects_prev): Likewise.
+ * src/gen-perf.cc (Gen_Perf::affects_prev): Likewise.
+ * src/hash-table.h (Hash_Table::_ignore_length): Change type to bool.
+ (Hash_Table::Hash_Table): Change 3rd argument type to bool.
+ * src/hash-table.cc (Hash_Table::Hash_Table): Likewise.
+ * src/input.h (Input::_additional_code): Change type to bool.
+ * src/input.cc (Input::read_keys): Update.
+ * src/key-list.h (Key_List::_occurrence_sort, Key_List::_hash_sort,
+ Key_List::_additional_code): Change type to bool.
+ (Key_List::_determined): Change element type to bool.
+ (Key_List::already_determined): Change return type to bool.
+ * src/key-list.cc (Key_List::_determined): Change element type to bool.
+ (Key_List::set_determined): Update.
+ (Key_List::already_determined): Change return type to bool.
+ (Key_List::reorder, Key_List::sort, Key_List::Key_List): Update.
+ * src/options.h (Positions::sort): Change return type to bool.
+ (Options::operator[]): Likewise.
+ * src/options.icc (Positions::sort): Change return type to bool.
+ (Options::operator[]): Likewise.
+ * src/output.h (Output::Output): Change 5th argument type to bool.
+ (Output::_additional_code): Change type to bool.
+ * src/output.cc (Output::Output): Change 5th argument type to bool.
+
+2002-10-16 Bruno Haible <bruno@clisp.org>
+
+ * src/*.h: Align all member names at column 24.
+
+2002-10-15 Bruno Haible <bruno@clisp.org>
+
+ * src/input.h: New file.
+ * src/input.cc: New file, extracted from key-list.cc.
+ * src/key-list.h (Key_List): Don't inherit from Read_Line.
+ (Key_List::get_special_input,
+ Key_List::save_include_src, Key_List::get_array_type,
+ Key_List::strcspn, Key_List::set_output_types): Remove methods.
+ * src/key-list.cc (Key_List::get_special_input,
+ Key_List::save_include_src, Key_List::get_array_type,
+ Key_List::strcspn, Key_List::set_output_types, parse_line): Move to
+ src/input.cc.
+ (Key_List::read_keys): Use Input::read_keys.
+ (Key_List::Key_List): Update.
+ * src/gen-perf.cc: Update.
+ * src/Makefile.in (OBJECTS): Add input.o.
+ (input.o): New rule.
+
+2002-10-14 Bruno Haible <bruno@clisp.org>
+
+ * src/options.cc: Don't include "vector.h".
+ (Options::parse_options): Don't initialize Vectors::ALPHA_SIZE here.
+ * src/vectors.cc (Vectors::ALPHA_SIZE): Don't initialize here.
+ * src/gen-perf.cc (Gen_Perf::Gen_Perf): Initialize Vectors::ALPHA_SIZE.
+
+ * src/options.h (Positions): New class.
+ (PositionIterator): New class.
+ (Options::parse_options): Renamed from Options::operator().
+ (Options::get_asso_max, Options::set_asso_max): Move to class Key_List.
+ (Options::reset, Options::get): Remove, replaced by class
+ PositionIterator.
+ (Options::get_initial_asso_value): Renamed from Options::initial_value.
+ (Options::key_sort): Remove, replaced by Positions::sort.
+ (Options): Make all fields and methods non-static.
+ * src/options.icc (Positions::Positions, Positions::operator[],
+ Positions::get_size, Positions::pointer, Positions::set_size,
+ Positions::sort, PositionIterator::PositionIterator,
+ PositionIterator::next): New methods.
+ (Options::get_initial_asso_value): Renamed from Options::initial_value.
+ (Options::get_size_multiple): New method.
+ (Options::get_key_positions): New method.
+ (Options::get_max_keysig_size): Implement using _key_positions.
+ * src/options.cc (Options::long_usage): Split big string into small
+ pieces.
+ (PositionStringParser): Prefix field names with _.
+ (Options::Options): Update.
+ (Options::~Options): Fix explanation of of _size_multiple. Don't print
+ _key_positions if it is effectively ignored.
+ (Options::parse_options): Renamed from Options::operator(). Update.
+ * src/key-list.h (Key_List): New field _size. New methods get_asso_max,
+ set_asso_max, get_max_keysig_size.
+ * src/key-list.cc (Key_List::read_keys): Don't make side effects on
+ options.
+ (Key_List::dump): Use Key_List::get_max_keysig_size() instead of
+ Options::get_max_keysig_size().
+ (Key_List::get_max_keysig_size): New function.
+ * src/hash-table.cc (Hash_Table::~Hash_Table): Compute the field
+ width on the fly if option[ALLCHARS].
+ * src/gen-perf.cc (Gen_Perf::Gen_Perf): Update,
+ Use Options::get_size_multiple() instead of Options::get_asso_max().
+ Use Key_List::get_asso_max() instead of Options::get_asso_max(). Use
+ Key_List::get_max_keysig_size() instead of
+ Options::get_max_keysig_size().
+ (Gen_Perf::affects_prev): Likewise.
+ (Gen_Perf::change): Likewise.
+ * src/keyword.cc: Update.
+ * src/main.cc: Update.
+ * src/output.cc: Update.
+ * tests/test-6.exp: Update.
+
+2002-10-13 Bruno Haible <bruno@clisp.org>
+
+ * src/bool-array.*: Some polishing.
+
+ * src/options.h (Options::operator=, Options::operator!=): Remove
+ unused methods.
+ * src/options.icc (Options::operator=, Options::operator!=): Remove.
+
+ * src/*.h: Prefix all field names with _.
+ * src/*.cc, src/*.icc: Update.
+
+ * src/*: Simplify declarations of functions without arguments.
+
+2002-10-04 Bruno Haible <bruno@clisp.org>
+
+ * src/output.h: New file, extracted from key-list.h.
+ * src/output.cc: New file, extracted from key-list.cc.
+ * src/key-list.h (Key_List): Make some fields protected. Move output
+ routines to src/output.h.
+ * src/key-list.cc: Move output routines to src/output.cc.
+ * src/gen-perf.cc (Gen_Perf::doit_all): Use class Output.
+ * src/Makefile.in (OBJECTS): Add output.o.
+ (output.o): New rule.
+
+2002-10-03 Bruno Haible <bruno@clisp.org>
+
+ * src/iterator.h: Remove file.
+ * src/iterator.cc: Remove file.
+ * src/options.cc: (PositionStringParser): New class, taken from old
+ iterator.cc.
+ * src/Makefile.in (OBJECTS): Remove iterator.o.
+ (ITERATOR_H): Remove variable.
+ (iterator.o): Remove rule.
+
+ * src/keyword-list.h: New file.
+ * src/keyword-list.cc: New file.
+ * src/list-node.h: Remove file.
+ * src/list-node.cc: Remove file.
+ * src/keyword.h (KeywordExt::init_selchars): New declaration.
+ * src/keyword.cc (sort_char_set, KeywordExt::init_selchars): New, from
+ old list-node.cc.
+ * src/gen-perf.cc: Replace List_Node by KeywordExt or KeywordExt_List,
+ as appropriate.
+ * src/hash-table.h: Likewise.
+ * src/key-list.h: Likewise.
+ * src/key-list.cc: Likewise.
+ * src/Makefile.in (OBJECTS): Remove list-node.o, add keyword-list.o.
+ (LIST_NODE_H): Remove macro.
+ (list-node.o): Remove rule.
+ (keyword-list.o): New rule.
+
+ * src/keyword.h (KeywordExt): New class.
+ * src/keyword.cc (KeywordExt): New constructor.
+ * src/list-node.h (List_Node): Inherit from KeywordExt.
+ * src/list-node.cc: Update.
+ * src/gen-perf.cc: Update.
+ * src/hash-table.cc: Update.
+ * src/key-list.cc: Update.
+ (output_keyword_entry): Change argument type to KeywordExt*.
+
+ * src/keyword.h: New file.
+ * src/keyword.cc: New file.
+ * src/list-node.h (List_Node): Extend Keyword.
+ * src/list-node.cc: Update.
+ * src/gen-perf.cc: Update.
+ * src/hash-table.cc: Update.
+ * src/key-list.cc: Update.
+ * src/Makefile.in (OBJECTS): Add keyword.o.
+ (keyword.o): New rule.
+
+ * src/key-list.cc (Key_List::read_keys): Allocate the memory for the
+ hash table using 'new'.
+ (Key_List::output_lookup_array): Allocate the memory for the duplicates
+ array using 'new'.
+ * src/options.h (LARGE_STACK_ARRAYS): Remove definition.
+ * src/main.cc (main): Remove setrlimit call.
+ * src/configure.in: Don't test for unistd.h, sys/time.h,
+ sys/resource.h, getrlimit, setrlimit.
+
+ * src/bool-array.h (Bool_Array): Make all members non-static.
+ Add an argument to the constructor. Remove init(), rename reset() to
+ clear(), rename find() to set_bit().
+ * src/bool-array.icc: Move init() code into the constructor.
+ Rename reset() to clear(), rename find() to set_bit().
+ * src/gen-perf.h (Gen_Perf): Add collision_detector member.
+ * src/gen-perf.cc: Update.
+
+ * src/gen-perf.h (Gen_Perf::doit_all): Renamed from
+ Gen_Perf::operator ().
+ * src/gen-perf.cc (Gen_Perf::doit_all): Renamed from
+ Gen_Perf::operator ().
+ * src/main.cc: Update.
+
+ * src/read-line.h (Read_Line::read_next_line): Renamed from
+ Read_Line::get_line.
+ * src/read-line.icc: Likewise.
+ * src/read-line.cc: Update.
+ * src/key-list.cc: Update.
+
+ * lib/getline.h: New file.
+ * lib/getline.cc: New file.
+ * lib/Makefile.in (OBJECTS): Add getline.o.
+ (getline.o): New rule.
+ * src/read-line.h (Read_Line::readln_aux): Remove declaration.
+ * src/read-line.cc (Read_Line::readln_aux): Remove function.
+ * src/read-line.icc (Read_Line::get_line): Use ::get_line.
+ * src/options.h (LARGE_STACK): Remove macro.
+
+ * src/bool-array.h (STORAGE_TYPE): Remove type.
+ Use 'unsigned int' instead of STORAGE_TYPE.
+ * src/bool-array.cc: Likewise.
+ * src/bool-array.icc: Likewise.
+ * src/gen-perf.cc: Likewise.
+
+ * src/new.cc: Remove file.
+ * src/Makefile.in (OBJECTS): Remove new.o.
+ (new.o): Remove rule.
+ * src/configure.in: Remove test for HAVE_THROW_DECL.
+ * acconfig.h: Remove file.
+
+ * src/trace.h: Remove file.
+ * src/trace.cc: Remove file.
+ * src/Makefile.in (OBJECTS): Remove trace.o.
+ (TRACE_H): Remove variable.
+ (trace.o): Remove rule.
+ Update all dependencies.
+ * src/bool-array.h, src/bool-array.cc, src/bool-array.icc: Don't use T.
+ * src/gen-perf.cc: Likewise.
+ * src/hash-table.cc: Likewise.
+ * src/iterator.cc: Likewise.
+ * src/key-list.cc: Likewise.
+ * src/list-node.cc: Likewise.
+ * src/main.cc: Likewise.
+ * src/new.cc: Likewise.
+ * src/options.h, src/options.cc, src/options.icc: Likewise.
+ * src/read-line.h, src/read-line.cc, src/read-line.icc: Likewise.
+
+ * tests/Makefile.in: Use gperf option -I, to avoid gcc-3.x warnings.
+ * tests/test.c: Don't use gets(), to avoid warnings.
+
+2001-08-02 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
+
+ * doc/gperf.texi: Change bug report address to <bug-gnu-gperf@gnu.org>.
+ * README: Updated.
+
+2000-12-18 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
+
+ * src/configure.in: Add check for rand() in libm. Needed for BeOS.
+ * src/Makefile.in (LIBS): Use @GPERF_LIBM@ instead of hardwiring -lm.
+
+2000-11-20 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
+
+ * doc/help2man: Update to version 1.23.
+
+2000-09-26 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
+
+ * gperf-2.7.2 released.
+
+ * doc/gperf.texi: Add a second bug report address
+ <gperf-bugs@lists.sourceforge.net>.
+ * README: Updated.
+
+2000-08-28 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
+
+ * lib/getopt.h (struct option): Use "const" also when compiling in
+ C++ mode. Avoids warnings from Sun CC and HP-UX aCC.
+
+ * doc/Makefile.in (docdir): Change from $(datadir)/doc/@PACKAGE@ to
+ $(prefix)/doc/@PACKAGE@, following the newest GNU standards.
+
+2000-08-20 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
+
+ * src/version.cc: Bump version number to 2.7.2.
+ * doc/gperf.texi: Likewise.
+
+ * doc/texinfo.tex: Update to post-texinfo-4.0 version. @code in the
+ title page now chooses a larger font. The overall layout of the
+ text is denser.
+
+ * AUTHORS: New file.
+
+ * tests/Makefile.in (all): Add check-lang-utf8 and check-lang-ucs2.
+ (check-lang-utf8, check-lang-ucs2): New targets.
+ (clean): Remove lu8out and lu2out.
+ * tests/lang-utf8.gperf, tests/lang-utf8.exp: New files.
+ * tests/lang-ucs2.gperf, tests/test2.c, tests/lang-ucs2.in,
+ tests/lang-ucs2.exp: New files.
+
+ Allow the use of embedded NULs in keys.
+ * lib/hash.h (hashpjw): Add a length argument.
+ * lib/hash.cc (hashpjw): Likewise. Don't stop when encountering a NUL
+ character.
+ * src/hash-table.h (Hash_Table constructor): Add ignore_len argument.
+ (Hash_Table::ignore_length): New field.
+ (Hash_Table::insert): Renamed from Hash_Table::operator(). Remove
+ ignore_length argument.
+ * src/hash-table.cc (NIL): Remove macro.
+ (Hash_Table constructor): Add ignore_len argument. Use it to
+ initialize ignore_length.
+ (Hash_Table destructor): Specify explicit length of char_set and
+ key.
+ (Hash_Table::insert): Renamed from Hash_Table::operator(). Remove
+ ignore_length argument. Pass explicit length to hashpjw. Compare
+ char_set using memcmp, not strcmp.
+ * src/list-node.h (List_Node): Rename field length to key_length.
+ New field char_set_length.
+ (List_Node constructor): Accept key and rest, not the entire line.
+ * src/list-node.cc (List_Node constructor): Accept key and rest, not
+ the entire line. Don't NUL terminate key and char_set. Specify
+ explicit length of key. Initialize char_set_length field.
+ * src/key-list.cc: Include <ctype.h>.
+ (parse_line): New function.
+ (Key_List::read_keys): Call parse_line instead of new List_Node.
+ Pass option[NOLENGTH] to Hash_Table constructor, not
+ Hash_Table::insert. Specify explicit length of key and char_set.
+ (Key_List::get_occurrence): Use explicit length of char_set.
+ (Key_List::set_determined): Likewise.
+ (Key_List::already_determined): Likewise.
+ (output_string): Add length argument. Output unprintable characters
+ using octal escape sequence.
+ (output_keyword_entry): Use explicit length of key.
+ (Key_List::output_lookup_array): Specify explicit length of key.
+ (output_switch_case): Likewise.
+ (Key_List::dump): Likewise.
+ * src/gen-perf.h (Gen_Perf::compute_disjoint_union): Add two length
+ arguments.
+ * src/gen-perf.cc (Gen_Perf::compute_disjoint_union): Likewise. Don't
+ stop when encountering NUL characters. Don't NUL terminate the
+ result.
+ (Gen_Perf::hash): Use explicit length of char_set.
+ (Gen_Perf::change): Specify explicit length of key.
+ * doc/gperf.texi: Document it.
+
+ * doc/help2man: New file, help2man version 1.022.
+ * Makefile.devel (all): Add doc/gperf.1.
+ (doc/gperf.1): New target.
+ * doc/gperf.1: Automatically generated.
+
+ * mkinstalldirs: New file, from automake-1.4, grep-2.4.1, guile-1.4,
+ libtool-1.3.3, make-3.79.1, tar-1.13.
+ * src/Makefile.in (MKINSTALLDIRS): New variable.
+ (install, installdirs): Use it instead of mkdir.
+ * doc/Makefile.in (MKINSTALLDIRS): New variable.
+ (install, installdirs): Use it instead of mkdir.
+
+ * INSTALL: Update.
+
+2000-08-19 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
+
+ * src/key-list.cc (Output_Compare_Memcmp): New class.
+ (Key_List::output_lookup_function): When option -l is given, use
+ memcmp instead of strcmp or strncmp.
+
+ * doc/gperf.texi: The bug report address is <bug-gnu-utils@gnu.org>.
+ The download address is ftp.gnu.org. Remove mention of -a and -g
+ options (now nops). Explain effect of -c option.
+
+ * doc/configure.in (PACKAGE): New variable.
+ * doc/Makefile.in (datadir, docdir): New variables.
+ (dvidir, htmldir): Change values.
+ (install, installdirs): Update.
+
+ * src/configure.in: Rename cache variable gp_cxx_throw_decl to
+ gp_cv_cxx_throw_decl.
+
+ * src/key-list.cc (Key_List::output_hash_function): When outputting
+ __inline, take advantage of C++ compilers which have inline.
+
+ * src/key-list.cc (Output_Compare_Strncmp::output_comparison):
+ After the call to strncmp, verify that expr2 is not longer than
+ `len'.
+ Reported by Carlo Wood <carlo@runaway.xs4all.nl>.
+
+ * src/key-list.cc (Key_List::output_lookup_function_body): Avoid
+ emitting the loop for dealing with duplicates if
+ total_duplicates == 0.
+
+ * src/key-list.cc (Key_List::read_keys): Don't accept an empty key.
+
+ * src/Makefile.in (install, installdirs, uninstall): Respect
+ $(DESTDIR).
+ * doc/Makefile.in (install, installdirs, uninstall): Likewise.
+
+ * src/options.cc (Options::print_options): Escape the arguments which
+ contain special characters.
+
+ * tests/c-parse.gperf: Updated from gcc-2.95.2/gcc/c-parse.gperf.
+ * tests/objc.gperf: New file, from gcc-2.95.2/gcc/objc/objc.gperf.
+ * tests/chill.gperf: New file, from gcc-2.95.2/gcc/ch/gperf.
+ * tests/cplusplus.gperf: New file, from gcc-2.95.2/gcc/cp/gxx.gperf.
+ * tests/gplus.gperf: Remove file.
+ * tests/java.gperf: New file, from gcc-2.95.2/gcc/java/keyword.gperf.
+ * tests/Makefile: Check them all.
+ * tests/c-parse.exp: Renamed from tests/test-1.exp.
+ * tests/modula2.exp: Renamed from tests/test-2.exp.
+ * tests/cplusplus.exp: Renamed from tests/test-3.exp.
+ * tests/gpc.exp: Renamed from tests/test-5.exp.
+
+ * src/key-list.cc (output_switch_case): Add trailing semicolon to
+ lengthptr assignment line. Fixes bug with -D and -S.
+ From Reini Urban <rurban@sbox.tu-graz.ac.at>. Also reported by
+ David Hunter.
+ * tests/Makefile.in (check-lang-syntax): Perform each test with -D
+ once without and once with duplicates.
+
+ * src/key-list.cc (output_keyword_entry): Avoid outputting a struct
+ initializer of the form {"key",}.
+
+ * src/iterator.cc: Don't include <stream.h>.
+ From Michael Deutschmann <ldeutsch@mail.netshop.net>.
+
+ * tests/Makefile.in (VALIDATE, check-lang-syntax): Use $(srcdir) where
+ appropriate.
+ Reported by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
+
+ * tests/validate: Don't run -traditional tests by default.
+
+ * src/main.cc (main): Check for write error on stdout before returning.
+
+ * src/Makefile.in (LDFLAGS): New definition, to catch the value given
+ at configure time.
+
+ Make the structure initializers customizable. Based on a patch by
+ Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
+ * src/options.h (Options::get_initializer_suffix,
+ Options::initializer_suffix): New declarations.
+ * src/options.icc (Options::get_initializer_suffix): New function.
+ * src/options.cc (DEFAULT_INITIALIZER_SUFFIX): New constant.
+ (Options::initializer_suffix): New variable.
+ (Options::short_usage): Document option "-F".
+ (Options::long_usage): Document option "-F".
+ (Options constructor): Initialize initializer_suffix.
+ (Options destructor): Dump initializer_suffix.
+ (long_options): Add option "-F".
+ (Options::operator()): Accept option "-F". Sets initializer_suffix.
+ * src/key-list.cc (output_keyword_blank_entries): Output
+ initializer_suffix.
+ * doc/gperf.texi: Document option "-F".
+
+ * COPYING: Replace with GPL version 2 (with new FSF address and Y2K
+ safe year format).
+
+ * doc/gpl.texinfo: New file.
+ * doc/gperf.texi: Document it.
+ * doc/Makefile.in (gperf.info, gperf.dvi, gperf.html, gperf_toc.html):
+ Update dependencies.
+
+ * doc/Makefile.in (MAKEINFO): Unset LANG while running makeinfo.
+
+1998-05-20 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * doc/Makefile.in (gperf.dvi, clean): Remove gperf.cps.
+ (install, installdirs, uninstall): Don't install gperf.dvi. The
+ info and HTML documentations are sufficient for on-line use, and
+ users who wish to print the documentation (in PS or DVI format)
+ can do this directly off the source distribution.
+ (DVIPS): Use "-D600" instead of "-Pljfour", for portability.
+
+1998-05-20 Akim Demaille <demaille@inf.enst.fr>
+
+ * doc/gperf.texi: Many modifications:
+ (Output Format): Declare `hash' and `in_word_set' as functions.
+ (Concept Index): New section.
+ (Title page): Use standard presentation.
+ (Top): Use @top instead of @unnumbered so that automatic master
+ update works.
+ (Motivation): Avoid spaces in @var.
+ (Options): Use the standard name ``Invoking ...''.
+ (Options): Declare also the long form of the options.
+ (Options): Remove redundant @itemize when @table is used.
+
+1998-05-08 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * aclocal.m4 (CL_PROG_INSTALL): Set cl_cv_path_install, not
+ ac_cv_path_install.
+
+Sat May 2 13:20:54 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * gperf-2.7 released.
+
+Sat May 2 12:31:51 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * src/version.cc (version_string): Remove the "(C++ version)" suffix.
+ It's redundant: the early C versions of gperf are called cperf.
+ Reported by Karl Berry.
+ * src/option.cc (Options::operator()): Trim the output of "gperf -v".
+
+Thu Apr 16 13:22:16 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * lib/Makefile.in, src/Makefile.in: Don't use $(TARGET_ARCH).
+ Solaris "make" sets it to a value not understood by "cc".
+
+Wed Apr 15 23:52:14 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * lib/Makefile.in, src/Makefile.in: Don't use implicit rules. Don't
+ use $<. AIX "make" and OSF/1 "make" have problems with both.
+ * src/gen-perf.cc, src/key-list.cc: Cast free() argument to char*,
+ otherwise it doesn't compile on SunOS 4.
+ * src/key-list.h: Declare structs outside of other declarations,
+ needed for OSF/1 cxx 5.5.
+ * lib/getopt.h: Use prototypes if __STDC__ || __cplusplus.
+ Don't give a prototype for getopt(), to avoid error on SunOS 4.
+ * lib/getopt.c: Declare strncmp, to avoid warnings.
+
+Tue Apr 14 23:24:07 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * lib/GetOpt.{h,cc}: Remove files.
+ * lib/getopt.{h,c}, lib/getopt1.c: New files, from GNU libc.
+ * lib/configure.in (AC_INIT): Search for hash.cc, not GetOpt.cc.
+ * lib/Makefile.in (OBJECTS): Remove GetOpt.o, add getopt.o, getopt1.o.
+ (getopt.o, getopt1.o, hash.o): Use explicit building rules. Some
+ "make"s don't support to have both implicit rules for "%.o : %.c"
+ and "%.o : %.cc" in the same Makefile.
+ * lib/hash.{h,cc}: Remove #pragma; there are no templates here.
+ * src/option.h (Options::usage): Remove.
+ (Options::short_usage, Options::long_usage): Declare.
+ * src/option.cc (Options::usage): Remove.
+ (Options::short_usage, Options::long_usage): New functions.
+ (long_options): New array.
+ (Options::operator()): Use getopt_long instead of GetOpt::operator(),
+ change all references to GetOpt members.
+
+ * src/std-err.{h,cc}: Remove files.
+ * src/gen-perf.cc, src/key-list.cc, list-node.cc, new.cc, options.cc:
+ Call fprintf(stderr) instead of Std_Err::report_error().
+ * src/key-list.h, src/list-node.h, src/options.h: Don't use class
+ Std_Err any more.
+ * src/option.cc (program_name): New variable.
+ * src/Makefile.in: Remove STD_ERR_H.
+ (OBJECTS): Remove std-err.o.
+
+Mon Mar 23 01:03:35 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * aclocal.m4, {lib,src,tests}/configure.in: Remove CL_CC_WORKS and
+ CL_CXX_WORKS, already contained in autoconf 2.12.
+
+ * src/gen-perf.cc, src/key-list.cc: Move some code from
+ Gen_Perf::Gen_Perf() to Key_List::output().
+ * src/Makefile.in: Update dependencies.
+
+ * src/options.{h,cc}: Remove option "-p".
+ * src/key-list.cc (Key_List::set_output_types): Rewrite.
+ (default_array_type, default_return_type): Remove.
+ * src/key-list.cc: Adjust "const" handling.
+ + With option "-t" [TYPE], don't emit wrong code if there is no
+ space before the struct's opening brace.
+
+Sun Mar 22 16:59:15 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * src/key-list.{h,cc}: Completely reorganized the output routines.
+ Rewrote from scratch the output_switch() function. Use classes
+ (Output_Constants, Output_Expr, Output_Compare) for abstraction.
+ In particular:
+ + Don't emit trailing whitespace and spurious blank lines.
+ + Adjust indentation of the arrays.
+ + Don't emit commas at the end of array initializers and
+ struct initializers.
+ + With option "-l" [LENTABLE], compare the length before
+ fetching the word from memory.
+ + With option "-S" [SWITCH], emit the comparison code just once,
+ not once in every switch statement.
+ + With option "-S" [SWITCH], choose the right switch statement
+ through a binary search, not a linear search.
+ + With option "-S" [SWITCH], emit straightforward comparisons
+ instead of switch statements with just one "case" label.
+ + With options "-S -p -t" [SWITCH, POINTER, TYPE], don't emit
+ spurious empty elements at the beginning of the wordlist array.
+ + With option "-D" [DUP] and not option "-S" [SWITCH], if there
+ is no more room for duplicate entries in the lookup array,
+ don't call `assert (i != 0)'. Instead, make the array larger :-)
+ + With option "-D" [DUP], if there are no duplicates, don't
+ automatically fall back to the non-"-D" algorithm. If the user
+ wants the non-"-D" algorithm, he can just not specify "-D".
+ + With option "-D" [DUP] and either options "-p -t" [POINTER, TYPE]
+ or not option "-S" [SWITCH], don't emit spurious empty elements
+ at the beginning of the wordlist array.
+ + With option "-D" [DUP], simplify the detection and processing
+ of duplicate entries in the lookup array.
+ + With options "-D -l" [DUP, LENTABLE] and not option "-S" [SWITCH],
+ don't forget to emit the lengthtable array.
+ + With options "-D -l -S" [DUP, LENTABLE, SWITCH], don't forget to
+ compare the lengths before comparing the strings.
+
+ * src/gen-perf.cc: No need to include <assert.h>.
+ * src/options.cc: Likewise.
+
+ * src/options.cc: Don't use `errno' after freopen failed.
+ * src/std-err.cc: `report_error' doesn't call strerror(errno) any
+ more. No need to include <string.h> and <errno.h>.
+
+ * tests/Makefile.in (check-*): Any difference between .exp and .out
+ is a failure. Don't ignore whitespace differences.
+
+ * tests/Makefile.in (check-lang-syntax): Add some more checks.
+
+Fri Mar 20 00:54:54 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * tests/jscript.gperf: Renamed from tests/javascript.gperf, because
+ of Minix and SVR2 14-character filename limit.
+ * src/key-list.cc (output_string): New function.
+ (Key_List::output_switch, Key_List::output_keyword_table): Call it.
+
+ * src/options.{h,icc,cc} (get_wordlist_name): New function. Add
+ option -W.
+ * src/key-list.cc (Key_List::output_switch,
+ Key_List::output_keyword_table, Key_List::output_lookup_function):
+ Use it.
+ Patch from William Bader <wbader@CSEE.Lehigh.Edu>.
+
+ * src/version.cc: Bump version number directly from 2.5 to 2.7,
+ because Schmidt's last release from 1991 carries version number 2.6.
+
+Tue Jul 30 00:02:39 1991 Douglas C. Schmidt (schmidt at net4.ics.uci.edu)
+
+ * Fixed a small bug in the Key_List::output_keyword_table routine
+ that caused an extra newline to be printed if there where no
+ leading blank entries... (who cares, right?!)
+
+Mon Jul 29 22:05:40 1991 Douglas C. Schmidt (schmidt at net4.ics.uci.edu)
+
+ * Modified the handling of the -E (emit enums rather than
+ #defines) option in conjunction with the -G option. Now, if -G
+ and -E are given the enums are generated outside the lookup
+ function, rather than within it!
+
+Mon Apr 8 18:17:04 1991 Doug Schmidt (schmidt at net4.ics.uci.edu)
+
+ * Yucko, there was a bug in the handling of -c (and of course the
+ new -I command in key-list.cc). Apparently when I added the
+ super-duper hack that provided support for duplicate keys I
+ forgot to update the strcmp output...
+
+Mon Mar 9 02:19:04 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * Moved the documentation to doc/, put the stuff borrowed from
+ libg++ into lib/.
+ * Rewrote all Makefile.in's for better compliance with GNU standards.
+ * Autoconf based configuration. Rewrote all configure.in's. Added
+ aclocal.m4, with macros from CLISP and CLN. Added Makefile.devel.
+ * src/depend: Removed. Dependencies are now in src/Makefile.in.
+
+ * src/bool-array.icc: New file, contains inline functions, from both
+ src/bool-array.h and src/bool-array.cc.
+ * src/options.icc: New file, contains inline functions, from both
+ src/options.h and src/options.cc.
+ * src/read-line.icc: New file, contains inline functions, from both
+ src/read-line.h and src/read-line.cc.
+
+ * src/bool-array.h: Don't include <std.h>.
+ * src/bool-array.cc: Include <string.h>.
+ * src/gen-perf.cc: No need to include <ctype.h>. Don't include
+ <_G_config.h>.
+ * src/hash-table.cc: Don't include <std.h> and <builtin.h>. Include
+ <string.h> and lib/hash.h instead.
+ * src/iterator.cc: Don't include <std.h>.
+ * src/key-list.cc: Don't include <builtin.h>. Include <string.h> and
+ <stdlib.h> instead.
+ * src/list-node.cc: Don't include <std.h>. Include <stdlib.h> instead.
+ Remove `index' hack.
+ * src/main.cc: Don't include <_G_config.h>.
+ * src/new.cc: Don't include <std.h>. Include <stdlib.h> instead.
+ * src/options.cc: Don't include <builtin.h>. Include <string.h> and
+ <stdlib.h> instead.
+ * src/read-line.cc: Don't include <builtin.h>. Include <stdlib.h>
+ instead.
+ * src/std-err.cc: Don't include <std.h>. Include <string.h> (for Irix).
+ * src/vectors.h: No need to include <stdio.h>.
+ * src/version.cc: No need to include <stdio.h>.
+
+ * src/bool-array.h: Change `STORAGE_TYPE' from int to unsigned int.
+ * src/bool-array.{h,cc}: Change type of `Bool_Array::size' from int
+ to unsigned int.
+ * src/bool-array.{h,cc}: Change type of `Bool_Array::init' argument
+ from STORAGE_TYPE to unsigned int.
+ * src/gen-perf.{h,cc}: Change two `Gen_Perf::compute_disjoint_union'
+ argument types from `char *' to `const char *'.
+ * src/iterator.h: Change type of `Iterator::str' and argument of
+ `Iterator::Iterator' from `char *' to `const char *'.
+ * src/iterator.cc: Cast to `unsigned char' before calling `isdigit'.
+ * src/key-list.{h,cc}: Change type of `Key_List::array_type',
+ `Key_List::return_type', `Key_List::struct_tag',
+ `Key_List::include_src', `default_array_type', `default_return_type'
+ and return type of `Key_List::get_array_type',
+ `Key_List::get_special_input', `Key_List::save_include_src' from
+ `char *' to `const char *'.
+ * src/key-list.cc: Change "pretty gross" assignment.
+ * src/key-list.cc: Don't use `alloca', HP-UX CC lacks it.
+ * lib/GetOpt.cc: Likewise.
+ * src/key-list.cc (merge): Use iteration instead of recursion.
+ * src/list-node.{h,cc}: Change type of `List_Node::key',
+ `List_Node::rest', `List_Node::char_set' from `char *' to
+ `const char *'.
+ * src/new.cc: Don't use BUFSIZ. Conditionalize the throw() declaration.
+ * src/read-line.h: Don't use BUFSIZ.
+ * src/read-line.cc: Make CHUNK_SIZE a constant, and use allocate the
+ buffers on the stack by default. Use memcpy for copying buffers.
+ Include <string.h>.
+ * src/read-line.icc (get_line): Use iteration instead of tail recursion.
+ Don't call ungetc(EOF,stdin).
+ * src/std-err.{h,cc}: Change type of `Std_Err::program_name' and of
+ argument `Std_Err::report_error' from `char *' to `const char *'.
+ * src/std-err.cc: `report_error' doesn't call `exit' any more. All
+ callers changed to do that themselves.
+ * src/trace.h: Make constructor/destructor calls non-inline.
+
+ * src/key-list.cc (output_hash_function): If option[CPLUSPLUS],
+ always make the hash function inline.
+ (output): Declare the hash function inline, with the right name.
+ * src/options.{h,cc}, src/gen-perf.cc, src/key-list.cc: Remove
+ options -g, making it on by default. Remove option -a. Instead,
+ introduce "-L KR-C", "-L C", "-L ANSI-C", "-L C++".
+ * src/options.{h,cc}, src/key-list.cc: Add option -I.
+ * src/key-list.cc: Don't emit "const" if compiling in mode "-L KR-C".
+ * src/key-list.cc: Don't emit a comma at the end of an enum list.
+ * src/main.cc: Remove COUNT_TIME code.
+ * src/vectors.h, src/key-list.cc, src/options.cc, src/list-node.cc:
+ ALPHA_SIZE defaults to 256 now. Add option -7.
+
+ * tests/javascript.gperf: New file.
+ * tests/jstest*.gperf, tests/validate: New tests.
+
+Sat Jan 31 01:38:11 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * src/Makefile.in ($(TARGETPROG)): Add $(CFLAGS).
+
+Wed Jan 28 01:56:00 1998 Manfred Hollstein <manfred@s-direktnet.de>
+
+ * configure.in (package_makefile_rules_frag): New and
+ redirect stderr from ${srcdir}/config.shared to
+ ${package_makefile_rules_frag}.
+ * src/configure.in: Ditto.
+ * tests/configure.in: Ditto.
+
+Fri Jan 23 08:00:41 1998 H.J. Lu (hjl@gnu.org)
+
+ * gperf.texi (@ichapter): Changed to @chapter.
+
+Wed Jan 14 09:16:48 1998 H.J. Lu (hjl@gnu.org)
+
+ * src/key-list.cc, src/key-list.h (Key_List::strcspn): Don't
+ define if strcspn is defined.
+
+Fri Jan 24 13:23:47 1997 Mike Stump <mrs@cygnus.com>
+
+ * src/new.cc (operator delete): Add the exception specification.
+
+Mon Feb 5 19:29:16 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * src/read-line.cc (Read_Line::readln_aux): Handle EOF if last line
+ has a length which is an exact multiple of CHUNK_SIZE. (Used to throw
+ away the line's contents.) From Bruno Haible <haible@ilog.ilog.fr>.
+ * src/Makefile.in ($(TARGETPROG)): Add -lm to link line.
+
+Tue Jun 11 13:43:50 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * src/list-node.cc (List_Node): Reorder init of nodes to
+ match declaration order.
+ * src/hash-table.cc (Hash_Table): Likewise.
+
+Tue Oct 10 16:37:28 1995 Mike Stump <mrs@cygnus.com>
+
+ * src/new.cc: Since malloc/delete are not paired, we cannot call
+ free.
+
+Wed Jan 4 12:40:14 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * src/Makefile.in ($(TARGETPROG)): Link with $(LDFLAGS).
+ Patch from John Interrante <interran@uluru.stanford.edu>.
+
+Sat Nov 5 19:12:48 1994 Jason Merrill (jason@phydeaux.cygnus.com)
+
+ * src/Makefile.in (LIBS): Remove.
+
+Tue Oct 18 17:51:14 1994 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * src/std-err.cc: Use stderror, instead of the non-standard
+ sys_nerr and sys_errlist.
+
+Sat Sep 17 22:02:13 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * src/key-list.cc (output_hash_function):
+ Patch from William Bader <wbader@CSEE.Lehigh.Edu>.
+
+Fri Jul 15 09:38:11 1994 Per Bothner (bothner@cygnus.com)
+
+ * src/std-err.cc: #include <errno.h>, and only declare
+ extern int errno if errno is not a macro.
+
+Mon May 30 17:29:34 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * Makefile.in (src_all, install): Make sure to add '/' after
+ `pwd` in $rootme, as expected by FLAGS_TO_PASS.
+
+Wed May 11 00:47:22 1994 Jason Merrill (jason@deneb.cygnus.com)
+
+ Make libg++ build with gcc -ansi -pedantic-errors
+ * src/options.h: Lose commas at end of enumerator lists.
+
+Sun Dec 5 19:16:40 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
+
+ * src/hash-table.cc (Hash_Table::~Hash_Table): Don't pass an
+ argument to fprintf, since it's not expecting one.
+
+Fri Nov 26 19:03:18 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * src/list-node.cc: #undef index, for the sake of broken NeXT,
+
+Thu Nov 4 11:16:03 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * Makefile.in (install): Use INSTALL_DATA for gperf.1.
+
+Mon Oct 25 18:40:51 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * src/key-list.cc (Key_List::read_keys): Use POW macro
+ to increase hash table size to power of 2.
+
+ * options.h (LARGE_STACK_ARRAYS): New flag. Defaults to zero.
+ * gen-perf.cc, key-list.cc, read-line.cc:
+ Only stack-allocate large arrays if LARGE_STACK_ARRAYS is set.
+ * main.cc (main): Only call setrlimit (RLIMIT_STACK, ...)
+ if LARGE_STACK_ARRAYS.
+
+Mon Oct 4 17:45:08 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * src/gen-perf.cc: Always use ANSI rand/srand instead of BSDisms.
+
+Wed Aug 18 12:19:53 1993 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * Makefile.in (src_all): Make less verbose output.
+
+Fri May 28 14:01:18 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * src/gen-perf.cc (Gen_Perf::change): Don't use gcc-specific
+ 2-operand conditional expression.
+ * src/key-list.cc (Key_List::output_lookup_array):
+ Don't use variable-size stack arrays, unless compiled by g++.
+
+Tue May 4 14:08:44 1993 Per Bothner (bothner@cygnus.com)
+
+ Changes (mostly from Peter Schauer) to permit compilation
+ using cfront 3.0 and otherwise be ARM-conforming.
+ * src/key-list.h: class Key_List must use public derivation
+ of base class Std_Err (because Gen_Perf::operator() in gen-perf.cc
+ calls Std_Err::report_error).
+ * src/gen-perf.cc (Gen_Perf::affects_prev), src/hash-table.cc
+ (Hash_Table::operator()): Don't use gcc-specific 2-operand
+ conditional expression.
+ * src/iterator.cc (Iterator::operator()): Don't use gcc-specific
+ range construct in case label.
+ * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys),
+ src/gen-perf.cc (Gen_Perf::operator(), src/read-line.cc
+ (Read_Line::readln_aux): If not gcc, don't allocate
+ variable-sized arrays on stack.
+ * src/new.cc (operator new): Argument type should be size_t.
+ * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys),
+ new/cc (::operator new): Don't use non-standard >?= operator.
+
+Tue Apr 27 20:11:30 1993 Per Bothner (bothner@cygnus.com)
+
+ * src/Makefile.in: Define TARGETPROG, and use it.
+
+Mon Apr 19 00:29:18 1993 Per Bothner (bothner@cygnus.com)
+
+ * Makefile.in, configure.in: Re-vamped configure scheme.
+ * gperf.texinfo: Renamed to gperf.texi.
+ * src/bool-array.{h,cc}: ANSIfy bzero->memset.
+
+Sat Jan 30 20:21:28 1993 Brendan Kehoe (brendan@lisa.cygnus.com)
+
+ * tests/Makefile.in (mostlyclean): Also delete aout, cout, m3out,
+ pout, and preout.
+
+Tue Dec 29 08:58:17 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: pass $(FLAGS_TO_PASS) to all calls to make.
+ (FLAGS_TO_PASS): added INSTALL, INSTALL_DATA, INSTALL_PROGRAM.
+
+Mon Dec 21 18:46:46 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * tests/expected.* renamed to *.exp to fit in 14 chars.
+ * tests/Makefile.in: Update accordingly.
+ Also rename output.* to *.out.
+ * src/Makefile.in (clean): Remove gperf program.
+
+Wed Dec 9 14:33:34 1992 Per Bothner (bothner@cygnus.com)
+
+ * src/hash-table.cc, src/bool-array.h: ANSIfy bzero->memset.
+
+Thu Dec 3 19:34:12 1992 Per Bothner (bothner@cygnus.com)
+
+ * Makefile.in (distclean, realclean): Don't delete
+ Makefile before recursing.
+
+Fri Nov 6 13:41:49 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * key-list.{h,cc}: Remove MAX_INT (and similar) constant
+ fields from Key_List class, and use INT_MAX (etc) from limits.h.
+ * key-list.{h,cc}, options.{h,cc}, vectors.h: Removed all
+ uses of initialized const fields, as they are non-standard
+ - and their use was easy to do away with. Mostly, just
+ made the constants static non-fields in the .cc file.
+
+Mon Nov 2 13:10:11 1992 Per Bothner (bothner@cygnus.com)
+
+ * tests/Makefile.in: When generating cinset.c, don't pass -C,
+ since -C assumes an ANSI compiler. Add the -C flag (with -a)
+ when generating test.out.3 instead.
+ * tests/expected.out.3: Update accordingly.
+
+Wed Aug 12 11:47:54 1992 Per Bothner (bothner@cygnus.com)
+
+ * Makefile.in: Factor out common flags into $(FLAGS_TO_PASS).
+ * Makefile.in: 'install-info' depends on gperf.info.
+
+Mon Aug 10 11:39:52 1992 Ian Lance Taylor (ian@dumbest.cygnus.com)
+
+ * Makefile.in, src/Makefile.in: always create installation
+ directories.
+
+Mon Jul 20 15:33:21 1992 Mike Stump (mrs@cygnus.com)
+
+ * src/new.cc (operator new): Add cast from void * to char *,
+ since it is not a standard conversion.
+
+Wed Jun 17 16:25:30 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * src/gen-perf.cc: #include <_G_config.h> for _G_SYSV.
+ * src/key-list.cc: alloca() hair.
+ * src/main.cc (main): Only call getrlimit if _G_HAVE_SYS_RESOURCE.
+ * Makefile,in, {src,test}/Makefile.in: Fix *clean rules.
+
+Fri May 29 13:21:13 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * src/gen-perf.cc: Replace USG -> _G_SYSV.
+
+Thu May 14 13:58:36 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * src/Makefile.in: Don't pass obsolete flag -DUNLIMIT_STACK.
+ * tests/Makefile.in (clean): Fix.
+
+Sat Mar 7 00:03:56 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * gperf.texinfo: added menu item hook.
+
+Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in, configure.in: removed traces of namesubdir,
+ -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
+ copyrights to '92, changed some from Cygnus to FSF.
+
+Sun Jan 26 19:21:58 1992 Per Bothner (bothner at cygnus.com)
+
+ * tests/Makefile.in: Use re-directed stdin instead of file
+ name in argv. This allows us to remove the filename
+ from the output, the expected output, and hence the diffs.
+ (Note that the input file is in $(srcdir), which we cannot
+ place in the expected out files.)
+ * tests/expected.out.[1235]: Edit out input filename,
+ to match new output.
+
+Thu Jun 28 16:17:27 1990 Doug Schmidt (schmidt at brilliant)
+
+ * Wow, first fix on the new job! There was a dumb error
+ in Key_List::output_lookup_function, where I printed the
+ string "&wordlist[key]" instead of the correct "&wordlist[index]".
+
+ * Added a couple of #ifdefs for USG support.
+
+Sun Jun 3 17:16:36 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Updated the version number to 2.5 and sent to Doug Lea for release
+ with the latest GNU libg++.
+
+ * Changed the error handling when a keyword file cannot be opened
+ (now calls perror).
+
+Wed May 30 14:49:40 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Instrumented the source code with trace statements automagically
+ inserted using my new automated trace instrumentation tool!
+
+Wed May 9 11:47:41 1990 Doug Schmidt (schmidt at siam.ics.uci.edu)
+
+ * Really fixed the previous bug. Turns out that a small amount
+ of logic had to be duplicated to handle static links that occur
+ as part of dynamic link chains. What a pain!!!
+
+Tue May 8 23:11:44 1990 Doug Schmidt (schmidt at siam.ics.uci.edu)
+
+ * Fixed a stupid bug in Key_List::output_lookup_array that was
+ causing incorrect counts to be generated when there were both
+ static and dynamic links occurring for the same hash value.
+ Also simplified the code that performs the logic in this routine.
+
+Mon Apr 30 17:37:24 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Fixed stupid bug in Key_List::output_lookup_array that was
+ making the generated lookup[] array contain `chars' even
+ when the values stored in the chars are greater than 127!
+
+ * Changed the behavior of the -G (global table) option so that it
+ will output the `length[]' array in the global scope along with
+ the `word_list[]' array.
+
+ * Fixed a stupid bug in Key_List::output_lookup_function that
+ would always output the complicated `duplicate-handling' lookup
+ logic, even when there were no duplicates in the input!
+
+ * Yikes, had to modify a bunch of stuff in key-list.cc to correctly
+ handle duplicate entries. Changed the generated code so that
+ the MIN_HASH_VALUE is no longer subtracted off when calculating
+ the hash value for a keyword. This required changing some other
+ code by substituting MAX_HASH_VALUE for TOTAL_KEYS in several places.
+ Finally, this means that the generated tables may contain leading
+ null entries, but I suppose it is better to trade-off space to get
+ faster performance...
+
+Mon Mar 26 13:08:43 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Updated version number to 2.4 to reflect the latest changes.
+
+ * Changed the main program so that it always prints out gperf's
+ execution timings to the generated output file.
+
+Sun Mar 25 12:39:30 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Added the -Z option so that users can specify the name of the
+ generated class explicitly. Updated documentation to reflect
+ this change.
+
+ * Modified the generated C++ class interface so that the functions
+ are declared static (to remove the overhead of passing the `this'
+ pointer). This means that operator()() can no longer be used,
+ since it only works on non-static member functions.
+ Also changed things so that there is no constructor (why waste
+ the extra call, when it doesn't do anything, eh?)
+
+ * Modified the behavior of Key_List::output when the -L C++ option
+ is enabled. Previously the code generated use const data members
+ to record MIN_WORD_LENGTH, MIN_HASH_VALUE, etc. However, as
+ pointed out by James Clark this may result in suboptimal behavior
+ on the part of C++ compilers that can't inline these values.
+ Therefore, the new behavior is identical to what happens with
+ -L C, i.e., either #defines or function-specific enums are used.
+ Why sacrifice speed for some abstract notion of `code purity?' ;-)
+
+Tue Mar 6 18:17:42 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Added the -E option that defines constant values using an enum
+ local to the lookup function rather than with #defines. This
+ also means that different lookup functions can reside in the
+ same file. Thanks to James Clark (jjc@ai.mit.edu).
+
+Sat Mar 3 20:19:00 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Added a special case to key_list::output_switch that doesn't
+ generate extra comparisons when the `-S' is given an argument
+ of 1 (the normal case). This should speed up the generated
+ code output a tad...
+
+Fri Feb 23 14:21:28 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Renamed all instances of member function get_keysig_size
+ to get_max_keysig_size, since this is more precise...
+
+ * Changed all occurrences of charset to keysig (stands for ``key
+ signature'') to reflect the new naming convention used in the
+ USENIX paper.
+
+Thu Feb 22 11:28:36 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Changed the name of the generated associated values table from
+ asso_value to asso_values to reflect conventions in the USENIX
+ C++ paper.
+
+Thu Feb 15 23:29:03 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Updated the gperf.texinfo file to fix some formatting problems
+ that had crept in since last time.
+
+Wed Feb 14 23:27:24 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Fixed stupid bug in key-list.cc (get_special_input), wher
+ gperf replaced each '%' with the succeeding character.
+
+ * Added support for multiple target language generation. Currently
+ handled languages are C and C++, with C as the default. Updated
+ documentation and option handler to reflect the changes.
+
+ * Added a global destructor to new.cc and removed the #ifdef, since
+ the bloody thing now works with libg++.
+
+Mon Feb 14 13:00:00 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Found out that my gperf paper was accepted at the upcoming
+ USENIX C++ Conference in San Francisco. Yow!
+
+Tue Jan 30 09:00:29 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * #ifdef'd out the new.cc memory allocator, since there are
+ problems with this and the libg++ stuff.
+
+ * Changed key-list.h so that class Vectors is a public (rather
+ than private) base class for class Key_List. The previous
+ form was illegal C++, but wasn't being caught by the old
+ g++ compiler. Should work now... ;-)
+
+Sun Dec 10 14:08:23 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added several changes from rfg@ics.uci.edu. These changes
+ help to automate the build process.
+
+Wed Nov 15 15:49:33 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Removed conditional compilation for GATHER_STATISTICS. There's
+ really no good reason to avoid collecting this info at run-time,
+ since that section of code is *hardly* the bottleneck... ;-)
+
+ * Simplified the C output routines in Key_List::set_output_types
+ and Key_List::output_keyword_table a bit in order to
+ speed-up and clean up the code generation.
+
+ * Modified function Key_List::get_special_input so that it does
+ not try to `delete' a buffer that turned out to be too short.
+ This is important since the new memory management scheme
+ does not handle deletions. However, adding a small amount of
+ garbage won't hurt anything, since we generally don't do this
+ operation more than a couple times *at most*!
+
+ * Created a new file (new.cc) which includes my own overloaded
+ operator new. This function should dramatically reduce the
+ number of calls to malloc since it grabs large chunks and
+ doles them out in small pieces. As a result of this change
+ the class-specific `operator new' was removed from class List_Node.
+
+Tue Nov 14 21:45:30 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Continued to refine the great hack. The latest trick is to
+ try and replace most uses of dynamic memory (i.e., calls to
+ new) with uses of gcc dynamic arrays (i.e., an alloca solution).
+ This makes life much easier for the overall process-size, since
+ it reduces the amount of overhead for memory management. As a
+ side-effect from this change there is no reason to have the
+ Bool_Array::dispose member function, so it's outta here!
+
+ * Fixed a stupid bug that was an disaster waiting to happen...
+ Instead of making the boolean array large enough to index
+ max_hash_value it was only large enough to index max_hash_value
+ - 1. Once again, an off-by-one mistake in C/C++!!!!
+
+Mon Nov 13 19:38:27 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added the final great hack! This allows us to generate hash tables
+ for near-perfect hash functions that contain duplicates, *without*
+ having to use switch statements! Since many compilers die on large
+ switch statements this feature is essential. Furthermore, it appears
+ that the generated code is often *smaller* than that put out by
+ compilers, even though a large, sparse array must be created.
+ Here's the general idea:
+
+ a. Generate the wordlist as a contiguous block of keywords,
+ just as before when using a switch statement. This
+ wordlist *must* be sorted by hash value.
+
+ b. Generate the lookup array, which is an array of signed
+ {chars,shorts,ints}, (which ever allows full coverage of
+ the wordlist dimensions). If the value v, where v =
+ lookup[hash(str,len)], is >= 0 and < TOTAL_KEYWORDS, then we
+ simply use this result as a direct access into the wordlist
+ array to snag the keyword for comparison.
+
+ c. Otherwise, if v is < -TOTAL_KEYWORDS or > TOTAL_KEYWORDS
+ this is an indication that we'll need to search through
+ some number of duplicates hash values. Using a hash
+ linking scheme we'd then index into a different part of
+ the hash table that provides the starting index and total
+ length of the duplicate entries to find via linear search!
+
+Sun Nov 12 13:48:10 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Simplified Key_List::output_min_max considerably by recognizing
+ that since the keyword list was already sorted by hash value finding
+ the min and max values is trivial!
+
+ * Improved the debugging diagnostics considerably in classes Key_List,
+ Hash_Table, and Gen_Perf.
+
+ * Modified the `-s' option so that a negative argument is now
+ interpreted to mean `allow the maximum associated value to be
+ about x times *smaller* than the number of input keys.' This
+ should help prevent massive explosion of generated hash table
+ size for large keysets.
+
+Sat Nov 11 11:31:13 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added a field in class Key_List that counts the total number
+ of duplicate keywords, both static and dynamic.
+
+ * Added a new member function Bool_Array that deletes the dynamic
+ memory allocated to Bool_Array::storage_array. This space may
+ be needed for subsequent options, so it made sense to free it as
+ soon as possible...
+
+ * Renamed file/class Alpha_Vectors to Vectors, to avoid problems
+ with 14 character length filenames on SYSV. Also changed file
+ adapredefined.gperf to adadefs.gperf in the ./tests directory.
+
+ * Modified class Options by changing the member function
+ Options::total_positions to Options::get_charset_size and
+ Options::set_charset_size. These two routines now either return
+ the total charset size *or* the length of the largest keyword
+ if the user specifies the -k'*' (ALLCHARS) option. This change
+ cleans up client code.
+
+ * Merged all the cperf changes into gperf.
+
+ * Made sure to explicitly initialize perfect.fewest_collisions to
+ 0.
+
+ * Cleaned up some loose ends noticed by Nels Olson.
+ 1. Removed `if (collisions <= perfect.fewest_collisions)'
+ from Gen_Perf::affects_prev since it was superfluous.
+ 2. Removed the fields best_char_value and best_asso_value
+ from Gen_Perf. There were also unnecessary.
+ 3. Fixed a braino in the Bool_Array::bool_array_reset
+ function. Since iteration numbers can never be zero
+ the `if (bool_array.iteration_number++ == 0)' must be
+ `if (++bool_array.iteration_number == 0).'
+ 4. Modified Std_Err::report_error so that it correctly handles
+ "%%".
+
+ * It is important to note that -D no longer enables -S.
+ There is a good reason for this change, which will become
+ manifested in the next release... (suspense!).
+
+ * Made some subtle changes to Key_List::print_switch so that if finally
+ seems to work correctly. Needs more stress testing, however...
+
+ * Made a major change to the Key_List::print_switch function.
+ The user can now specify the number of switch statements to generate
+ via an argument to the -S option, i.e., -S1 means `generate 1
+ switch statement with all keywords in it,' -S2 means generate
+ 2 switch statements with 1/2 the elements in each one, etc.
+ Hopefully this will fix the problem with C compilers not being
+ able to generate code for giant switch statements (but don't
+ hold your breath!)
+
+ * Changed Key_List::length function to Key_List::keyword_list_length.
+
+ * Added a feature to main.c that prints out the starting wall-clock
+ time before the program begins and prints out the ending wall-clock
+ time when the program is finished.
+
+ * Added the GATHER_STATISTICS code in hash-table.c so we can
+ keep track of how well double hashing is doing. Eventually,
+ GATHER_STATISTICS will be added so that all instrumentation
+ code can be conditionally compiled in.
+
+ * Fixed a stupid bug in Key_List::print_switch routine. This
+ was necessary to make sure the generated switch statement worked
+ correctly when *both* `natural,' i.e., static links and dynamic
+ links, i.e., unresolved duplicates, hash to the same value.
+
+ * Modified Bool_Array::~Bool_Array destructor so that
+ it now frees the bool_array.storage_array when it is no longer
+ needed. Since this array is generally very large it makes sense
+ to return the memory to the freelist when it is no longer in use.
+
+ * Changed the interface to constructor Hash_Table::Hash_Table. This
+ constructor now passed a pointer to a power-of-two sized buffer that
+ serve as storage for the hash table. Although this weakens information
+ hiding a little bit it greatly reduces dynamic memory fragmentation,
+ since we can now obtain the memory via a call to alloca, rather
+ than malloc. This change modified Key_List::read_keys calling
+ interface.
+
+ * Since alloca is now being used more aggressively a conditional
+ compilation section was added in main.c. Taken from GNU GCC,
+ this code gets rid of any avoidable limit on stack size so that
+ alloca does not fail. It is only used if the -DRLIMIT_STACK
+ symbol is defined when gperf is compiled.
+
+ * Added warnings in option.c so that user's would be informed
+ that -r superceeds -i on the command-line.
+
+ * Rewrote Gen_Perf::affects_prev. First, the code structure
+ was cleaned up considerably (removing the need for a dreaded
+ goto!). Secondly, a major change occurred so that Gen_Perf::affects_prev
+ returns FALSE (success) when fewest_hits gets down to whatever
+ it was after inserting the previous key (instead of waiting for
+ it to reach 0). In other words, it stops trying if it can
+ resolve the new collisions added by a key, even if there are
+ still other old, unresolved collisions. This modification was
+ suggested by Nels Olson and seems to *greatly* increase the
+ speed of gperf for large keyfiles. Thanks Nels!
+
+ * In a similar vein, inside the Gen_Perf::change routine
+ the variable `perfect.fewest_collisions is no longer initialized
+ with the length of the keyword list. Instead it starts out at
+ 0 and is incremented by 1 every time change () is called.
+ The rationale for this behavior is that there are times when a
+ collision causes the number of duplicates (collisions) to
+ increase by a large amount when it would presumably just have
+ gone up by 1 if none of the asso_values were changed. That is,
+ at the beginning of change(), you could initialize fewest_hits
+ to 1+(previous value of fewest_hits) instead of to the number of
+ keys. Thanks again, Nels.
+
+ * Replaced alloca with new in the Gen_Perf::change function.
+ This should eliminate some overhead at the expense of a little
+ extra memory that is never reclaimed.
+
+ * Renamed Gen_Perf::merge_sets to Gen_Perf::compute_disjoint_union
+ to reflect the change in behavior.
+
+ * Added the -e option so users can supply a string containing
+ the characters used to separate keywords from their attributes.
+ The default behavior is ",\n".
+
+ * Removed the char *uniq_set field from LIST_NODE and modified
+ uses of uniq_set in perfect.c and keylist.c. Due to changes
+ to Gen_Perf::compute_disjoint_sets this field was no longer
+ necessary, and its removal makes the program smaller and
+ potentially faster.
+
+ * Added lots of changes/fixes suggested by Nels Olson
+ (umls.UUCP!olson@mis.ucsf.edu). In particular:
+ 1. Changed Bool_Array so that it would dynamically create
+ an array of unsigned shorts rather than ints if the
+ LO_CAL symbol was defined during program compilation.
+ This cuts the amount of dynamic memory usage in half,
+ which is important for large keyfile input.
+ 2. Added some additional debugging statements that print extra
+ info to stderr when the -d option is enabled.
+ 3. Fixed a really stupid bug in Key_List::print_switch
+ A right paren was placed at the wrong location, which broke
+ strlen ().
+ 4. Fixed a subtle problem with printing case values when keylinks
+ appear. The logic failed to account for the fact that there
+ can be keylinks *and* regular node info also!
+ 5. Changed the behavior of Key_List::read_keys so that it would
+ honor -D unequivocally, i.e., it doesn't try to turn off dup
+ handling if the user requests it, even if there are no
+ immediate links in the keyfile input.
+ 6. Modified the -j option so that -j 0 means `try random values
+ when searching for a way to resolve collisions.'
+ 7. Added a field `num_done' to the Gen_Perf struct. This is used
+ to report information collected when trying to resolve
+ hash collisions.
+ 8. Modified the merge_sets algorithm to perform a disjoint
+ union of two multisets. This ensures that subsequent
+ processing in Gen_Perf::affect_prev doesn't
+ waste time trying to change an associated value that is
+ shared between two conflicting keywords.
+ 9. Modified Gen_Perf::affects_prev so that it doesn't try
+ random jump values unless the -j 0 option is enabled.
+ 10. Fixed a silly bug in Gen_Perf::change. This problem caused
+ gperf to seg fault when the -k* option was given and the
+ keyfile file had long keywords.
+
+Sun Oct 29 00:18:55 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
+
+ * Modified class-specific new operations for Read_Line and
+ List_Node so they don't fail if SIZE is larger than twice
+ the previous buffer size. Note we double buffer size
+ everytime the previous buffer runs out, as a heuristic
+ to reduce future calls to malloc.
+
+Sun Oct 22 13:49:43 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Updated gperf version number to 2.0. Send to Doug Lea for
+ incorporation into the long-awaited `official' libg++ 1.36
+ release!
+
+ * Thanks to Nels Olson a silly bug in Gen_Perf::change ()
+ was fixed. This problem caused gperf to seg fault when
+ the -k* option was given and the keyfile file had long
+ keywords.
+
+ * Modified Key_List::print_hash_function so that it output
+ max_hash_value + 1 (rather than just max_hash_value) for
+ any associated value entries that don't correspond to
+ keyword charset characters. This should speed up rejection
+ of non-keyword strings a little in some cases.
+
+Sat Oct 21 19:28:36 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Fixed Key_List::print_hash_function so that it no longer output
+ things like `return 0 + ...' Although this probably gets
+ optimized away by even the worst C compilers there isn't any
+ point tempting fate... ;-)
+
+ * Fixed class List_Node's constructor so that it wouldn't a priori
+ refuse to consider trying to hash keys whose length is less
+ than the smallest user-specified key position. It turns out
+ this is not a problem unless the user also specifies the -n
+ (NOLENGTH) option, in which case such keys most likely
+ don't have a prayer of being hashed correctly!
+
+ * Changed the name of the generated lookup table from `Hash_Table'
+ to `asso_value' to be consistent with the gperf paper.
+
+Tue Oct 17 14:19:48 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added a flag GATHER_STATISTICS in the Makefile. If defined
+ during compilation this turns on certain collection facilities
+ that track the performance of gperf during its execution. In
+ particular, I want to see how many collisions occur for the
+ double hashing Hash_Table.
+
+ * Added a safety check so that we don't screw up if the total
+ number of `resets' of the Bool_Array exceeds MAX_INT. Since
+ this number is around 2^31 it is unlikely that this would ever
+ occur for most input, but why take the risk?
+
+ * Changed the behavior for the -a (ANSI) option so that the
+ generated prototypes use int rather than size_t for the LEN
+ parameter. It was too ugly having to #include <stddef.h> all
+ over the place...
+
+Mon Oct 16 11:00:35 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Continued to work on the gperf paper for the USENIX C++
+ conference. At some point this will be merged back into
+ the gperf documentation...
+
+Sat Oct 14 20:29:43 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
+
+ * Added a majorly neat hack to Bool_Array, suggested by rfg.
+ The basic idea was to throw away the Ullman array technique.
+ The Ullman array was used to remove the need to reinitialize all
+ the Bool_Array elements to zero everytime we needed to determine
+ whether there were duplicate hash values in the keyword list.
+ The current trick uses an `iteration number' scheme, which takes
+ about 1/3 the space and reduces the overall program running a
+ time by about 20 percent for large input! The hack works as
+ follows:
+
+ 1. Dynamically allocation 1 boolean array of size k.
+ 2. Initialize the boolean array to zeros, and consider the first
+ iteration to be iteration 1.
+ 2. Then on all subsequent iterations we `reset' the bool array by
+ kicking the iteration count by 1.
+ 3. When it comes time to check whether a hash value is currently
+ in the boolean array we simply check its index location. If
+ the value stored there is *not* equal to the current iteration
+ number then the item is clearly *not* in the set. In that
+ case we assign the iteration number to that array's index
+ location for future reference. Otherwise, if the item at
+ the index location *is* equal to the iteration number we've
+ found a duplicate. No muss, no fuss!
+
+Mon Oct 2 12:30:54 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Changed some consts in options.h to enumerals, since g++
+ doesn't seem to like them at the moment!
+
+Sat Sep 30 12:55:24 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Fixed a stupid bug in Key_List::print_hash_function that manifested
+ itself if the `-k$' option was given (i.e., only use the key[length]
+ character in the hash function).
+
+ * Added support for the -C option. This makes the contents of
+ all generated tables `readonly'.
+
+ * Changed the handling of generated switches so that there is
+ only one call to str[n]?cmp. This *greatly* reduces the size of
+ the generated assembly code on all compilers I've seen.
+
+ * Fixed a subtle bug that occurred when the -l and -S option
+ was given. Code produced looked something like:
+
+ if (len != key_len || !strcmp (s1, resword->name)) return resword;
+
+ which doesn't make any sense. Clearly, this should be:
+
+ if (len == key_len && !strcmp (s1, resword->name)) return resword;
+
+Tue Sep 26 10:36:50 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Changed class Read_Line's definition so that it no longer
+ needs to know about the buffering scheme used to speed up
+ dynamic memory allocation of input keywords and their
+ associated attributes. This means that operator new is no longer
+ a friend of Read_Line.
+
+Mon Sep 25 23:17:10 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Decided that Obstacks had too much overhead, so they were
+ removed in favor of super-efficient, low-overhead buffered
+ storage allocation hacks in Read_Line and List_Node.
+
+ * No longer try to inline functions that g++ complains about
+ (Key_List::Merge and Key_List::Merge_Sort).
+
+Sun Sep 24 13:11:24 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Changed classes Read_Line and List_Node to use Obstacks in order
+ to cache memory allocation for keyword strings and List_Nodes.
+
+ * Continued to experiment with inheritance schemes.
+
+ * Added a new file `alpha.h', that declares static data shared
+ (i.e., inherited) between classes List_Node and Key_List.
+
+Tue Sep 12 16:14:41 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Made numerous changes to incorporate multiple inheritance in
+ gperf.
+
+Wed Aug 16 23:04:08 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added the -DCOMPILER_FIXED flag to the ./src/Makefile. This
+ implies that people trying to compile gperf need to have a
+ working version of the new g++ compiler (1.36.0).
+
+ * Removed some extra spaces that were being added in the generated
+ C code.
+
+Mon Jul 24 17:09:46 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Fixed PRINT_HASH_FUNCTION and PRINT_LOOKUP_FUNCTION in keylist.c
+ so that the generated functions take an unsigned int length argument.
+ If -a is enabled the prototype is (const char *str, size_t len).
+
+Fri Jul 21 13:06:15 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Fixed a typo in PRINT_KEYWORD_TABLE in keylist.cc that prevented
+ the indentation from working correctly.
+
+ * Fixed a horrible typo in PRINT_KEYWORD_TABLE in keylist.cc
+ that prevented links from being printed correctly.
+
+Tue Jul 18 16:04:31 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Fixed up readline.cc and readline.h so that they work OK
+ with g++ compilers that aren't completely up-to-date.
+ If symbol COMPILER_FIXED is defined then the behavior
+ that works on my more recent version of g++ is enabled.
+
+Sun Jul 9 17:53:28 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Changed the ./tests subdirectory Makefile so that it
+ uses $(CC) instead of gcc.
+
+Sun Jul 2 21:52:15 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Fixed a number of subtle bugs that occurred when -S was
+ combined with various and sundry options.
+
+ * Added the -G option, that makes the generated keyword table
+ a global static variable, rather than hiding it inside
+ the lookup function. This allows other functions to directly
+ access the contents in this table.
+
+ * Added the "#" feature, that allows comments inside the keyword
+ list from the input file. Comment handling takes place in readline.c.
+ This simplifies the code and reduces the number of malloc calls.
+
+ * Also added the -H option (user can give the name of the hash
+ function) and the -T option (prevents the transfer of the type decl
+ to the output file, which is useful if the type is already defined
+ elsewhere).
+
+Thu Jun 22 20:39:39 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Modified many classes so that they would inherit Std_Err as
+ a base class. This makes things more abstract...
+
+Fri Jun 16 14:23:00 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Modified the -f (FAST) option. This now takes an argument.
+ The argument corresponds to the number of iterations used
+ to resolve collisions. -f 0 uses the length of the
+ keyword list (which is what -f did before). This makes
+ life much easier when dealing with large keyword files.
+
+Tue Jun 6 17:53:27 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added the -c (comparison) option. Enabling this
+ will use the strncmp function for string comparisons.
+ The default is to use strcmp.
+
+ * Fixed a typo in key_list.cc (PRINT_SWITCH). This caused
+ faulty C code to be generated when the -D, -p, and -t
+ options were all enabled.
+
+Thu May 25 14:07:21 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
+
+ * Once again, changed class Read_Line to overload global operator
+ new. Hopefully, this will work...!
+
+Sun May 21 01:51:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Modified Key_List::print_hash_function () so that it properly
+ formats the associated values in the hash table according to
+ the maximum number of digits required to represent the largest
+ value.
+
+ * Removed the named return value from class Hash_Table's
+ operator (), since this causes a seg fault when -O is enabled.
+ No sense tripping subtle g++ bugs if we don't have to.... ;-)
+
+ * Removed the operator new hack from Read_Line, since this seemed
+ to create horrible bus error problems.
+
+ * Changed many class member functions and data members to be `static',
+ if they don't manipulate this!
+
+Fri May 12 23:06:56 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Changed class Std_Err to use static member functions, a la
+ Ada or Modula 2. This eliminates the need for an explicit
+ error-handler class object.
+
+ * Added the ``named return value'' feature to Hash_Table::operator ()
+ and Bool_Array::operator [], just for the heck of it.... ;-)
+
+ * Changed the previous hack in Read_Line so that we now use
+ the overloaded global `new' instead of NEW_STRING!
+
+Wed May 3 17:36:55 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Updated to version 1.7. This reflects the recent major changes
+ and the new C port.
+
+ * Modified the GNU getopt.cc routine to have a class-based interface.
+
+ * Fixed a typo in Perfect.cc ~Perfect that prevented the actual maximum
+ hash table size from being printed (maybe the stream classes
+ weren't so bad after all.... ;-).
+
+ * Added support for the -f option. This generates the perfect
+ hash function ``fast.'' It reduces the execution time of
+ gperf, at the cost of minimizing the range of hash values.
+
+Tue May 2 16:23:29 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Added an efficiency hack to Read_Line. Instead of making
+ a call to operator NEW (a.k.a. malloc) for each input string
+ a new member function NEW_STRING stores a large buffer from
+ which new strings are carved out, growing the buffer if
+ necessary. It might be useful to add this throughout the
+ program....
+
+ * Removed all unnecessary calls to DELETE. If the program is about
+ to exit it is silly to waste time freeing memory.
+
+ * Added the GNU getopt program to the distribution. This makes
+ GPERF portable to systems that don't include getopt in libc.
+
+ * Added a strcspn member to class Key_List. This also increases
+ portability.
+
+ * Added the get_include_src function from keylist.c as a member
+ function in class Key_List. Hopefully every function is
+ now associated with a class. This aids abstraction and
+ modularity.
+
+ * Ported gperf to C. From now on both K&R C and GNU G++ versions
+ will be supported. There will be two ChangeLog files, one
+ for each version of the program.
+
+Mon May 1 16:41:45 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Fixed a bug with -k'*'. This now prints out *all* the cases
+ up to the length of the longest word in the keyword set.
+
+Sun Apr 30 12:15:25 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Removed all use of the stream classes. Too ugly, slow, and
+ not handled by the c++-mode formatter....
+
+ * Modified the handling of links (i.e., keywords that have
+ identical hash values as other keywords). This should
+ speed up hash function generation for keyword sets with
+ many duplicate entries. The trick is to treat duplicate
+ values as equivalence classes, so that each set of duplicate
+ values is represented only once in the main list processing.
+
+ * Fixed some capitialization typos and indentations mistakes in
+ Key_List::print_hash_function.
+
+Sat Apr 29 12:04:03 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Fixed a typo/logico in Key_List::print_switch that prevented
+ the last keyword in the keyword list to be print out. This
+ requires further examination.....
+
+ * Fixed a stupid bug in List_Node::List_node. If the -k'*' option
+ was enabled the KEY_SET string wasn't getting terminated with
+ '\0'!
+
+Fri Apr 28 12:38:35 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Renamed strexp.h and strexp.cc to iterator.h and iterator.cc.
+ Also changed the strexp class to iterator. Continued to work
+ on style...
+
+ * Updated the version number to 1.6. This reflects all the
+ recent changes.
+
+Thu Apr 27 00:14:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added the -D option that properly handles keyword sets that
+ contain duplicate hash values.
+
+ * Continued the stylistic changes. Added the #pragma once
+ directive to all the *.h files. Removed all #defines and
+ replaced them with static consts. Also moved the key_sort
+ routine from options.cc into the options class as a
+ member function.
+
+Mon Apr 3 13:26:55 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
+
+ * Made massive stylistic changes to bring source code into
+ conformance with GNU style guidelines.
+
+Thu Mar 30 23:28:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Fixed up the output routines so that they generate code
+ corresponding to the GNU style guidelines.
+
+Sat Mar 11 13:12:37 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Fixed Stderr constructors so that they wouldn't try to
+ use the base class initializer syntax for the static
+ class variable Program_Name. G++ 1.34 is stricter in
+ enforcing the rules!
+
+Fri Mar 10 11:24:14 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Removed -v and ``| more'' from the Makefile to keep rfg happy...
+
+Thu Mar 2 12:37:30 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Sent latest GNU gperf version 1.5 to Doug Lea for inclusion
+ into libg++ 1.34. Note that there is a small bug with
+ the new %{ ... %} source inclusion facility, since it doesn't
+ understand comments and will barf if %{ or %} appear nested
+ inside the outermost delimiters. This is too trivial of
+ a defect to fix at the moment...
+
+Tue Feb 28 11:19:58 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added the -K option, which allows the user to provide a
+ alternative name for the keyword structure component.
+ The default is still ``name.''
+
+ * Added the LEX and YACC-like ability to include arbitrary
+ text at the beginning of the generated C source code output.
+ This required two new functions Get_Special_Input,
+ Key_List::Save_Include_Src;
+
+ * Fixed memory allocation bug in Key_List::Set_Types.
+ Variable Return_Type needs 1 additional location
+ to store the "*" if the -p option is used.
+
+ * Added code to NULL terminate both Struct_Tag and Return_Type,
+ *after* the strncpy (stupid mistake).
+
+Mon Feb 27 14:39:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added a new option -N. This allows the user to specify the
+ name to be used for the generated lookup function. The
+ default name is still ``in_word_set.'' This makes it
+ possible to completely automate the perfect hash function
+ generation process!
+
+Mon Feb 20 23:33:14 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Corrected the Hash_Table::operator () function so that
+ *it* is responsible for deciding when a new key has the
+ same signature as a previously seen key. The key length
+ information is now used internally to this function to
+ decide whether to add to the hash table those keys with
+ the same key sets, but different lengths. Before, this
+ was handled by the Key_List::Read_Keys function. However,
+ this failed to work for certain duplicate keys, since
+ they weren't being entered into the hash table properly.
+
+Sun Feb 19 16:02:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Modified class Options by moving the enum Option_Type out
+ of the class. This is to satisfy the new enumeration
+ scope rules in C++.
+
+Sun Jan 15 15:12:09 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Incremented the version number upto 1.4 to reflect the new
+ options that affect the generated code. Send the new
+ distribution off to Michael for use with g++ 1.33.
+
+ * Added a fix to Key_List::Read_Keys so that it checks for links
+ properly when the -n option is used. Previously, it didn't
+ catch obvious links, which caused it to spend large amount
+ of time searching for a solution that could never occur!
+
+ * Modified the Key_List data structure to record *both* the
+ minimum and the maximum key lengths. This information
+ is now computed in Key_List::Read_Keys, and thus
+ Key_List::Print_Min_Max doesn't need to bother.
+
+ * Modifed the key position iterator scheme in options.cc to
+ eliminate the need for member function Options::Advance.
+ Now, the Options::Get function performs the advancement
+ automatically, obviating the need for an extra function call.
+
+ * Added the new function Options::Print_Options, to print out
+ the user-specified command line options to generated C
+ output file.
+
+ * Added a new function, Key_List::Print_Keylength_Table,
+ which creates a table of lengths for use in speeding
+ up the keyword search. This also meant that a new
+ option, -l (LENTABLE) is recognized. It controls
+ whether the length table is printed and the comparison
+ made in the generated function ``in_word_set.''
+
+ * Added a comment at the top of the generated C code
+ output file that tells what version of gperf was used.
+ Next, I'll also dump out the command line options
+ as a comment too. Thanks to Michael Tiemann for the
+ feedback on this.
+
+ * Fixed the -n option to make it work correctly with
+ other parts of the program (most notably the Perfect::Hash
+ function and the computation of minimum and maximum lengths.
+
+Fri Jan 13 21:25:27 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
+
+ * Realized the the need to add a test that will enable
+ optimziation of the generated C code in the ``hash'' function
+ by checking whether all the requested key positions are
+ guaranteed to exist due to the comparison in `in_word_set.''
+ I'll put this in soon....
+
+Thu Jan 12 20:09:21 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Added pascal, modula3, and modula2 tests inputs to the
+ Makefile
+
+ * Recognised that there is a bug with the -n option. However
+ I'm too busy to fix it properly, right now. The problem
+ is that the generated #define end up being 0, since that's
+ my hack to make -n work. This needs complete rethinking!
+
+Tue Jan 10 00:08:16 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Added a new option, -n, that instructs gperf to not use the
+ length of an identifier when computing the hash functions.
+ I'm not sure how useful this is!
+
+ * Retransmitted the distribution to rocky.oswego.edu. Hopefully,
+ this will work!
+
+ * Began fixing the indentation and capitalization to conform
+ to the GNU coding guidelines.
+
+Mon Jan 9 22:23:18 1989 Doug Schmidt (schmidt at pompe.ics.uci.edu)
+
+ * Fixed horrible bug in Read_Line::Readln_Aux. This was
+ a subtle and pernicous off-by-1 error, that overwrote
+ past the last character of the input string buffer. I
+ think this fault was killing the vax!
+
+ * Yow, fixed an oversight in List_Node::List_Node, where the
+ pointer field Next was uninitialized. Luckily, the new routine
+ seems to return 0 filled objects the first time through!
+
+Sun Jan 8 13:43:14 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Modified the ``key linked'' diagnostic in Key_List::Read_Keys
+ to be more helpful and easy to read.
+
+ * Fixed the List_Node::List_Node so that it would ignore trailing
+ fields if the -t option was not enabled.
+
+ * Moved the List_Node declarations out of keylist.h and
+ into a file of its own, called listnode.cc and listnode.h
+ Made Set_Sort a member function of class List_Node.
+
+ * Massively updated the documentation in the gperf.texinfo file.
+
+ * Polished off the major revision to the print functions,
+ added a few new tests in the Makefile to check for the
+ validity of the program and ftp'ed the entire distribution
+ off to Doug Lea for libg++. ( changed it to
+ 1.3 to reflect the major changes with the generated
+ C code ).
+
+ * Fixed Key_List::Print_Switch to deal with the -p and -t options.
+ This meant that the ``still-born'' function Key_List::
+ Print_Type_Switch was superflous, so I removed it.
+ Also, removed the restriction in Option that the -p and
+ -t options couldn't be used simultaneously.
+
+ * Modified List_Node::List_Node, to perform only 1 call to
+ ``new'' when dynamically allocating memory for the Key_Set
+ and the Uniq_Set.
+
+Sat Jan 7 14:10:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
+
+ * Fixed a big bug with the new policy of nesting the
+ wordlist inside of generated function ``in_word_set.''
+ I'd forgotten to declare the wordlist array as static!
+ ( arrgh ).
+
+ * Added a new function Key_List::Set_Types, that figures out
+ the return type for generated function ``in_word_set,''
+ the user-defined ``struct tag,'' if one is used, and also
+ formates the array type for the static local array.
+
+ * Changed the print routines to take advantage of the
+ new -p option.
+
+ * Began adding the hooks to allow the return of a pointer
+ to a user defined struct location from the generated
+ ``in_word_set'' function instead of the current 0 or 1
+ return value. Created function Key_List::Print_Type_Switch
+ and added option -p to class Option, allowing the user to
+ request generation of the aforementioned pointers returned
+ instead of booleans.
+
+ * Put in checks in class Option to make sure that -S and -t
+ options are not used simultaneously. This restriction
+ will be removed in subsequent releases, once I decide on
+ a clean way to implement it.
+
+ * Sent version 1.2 to Doug Lea for possible inclusion into
+ the libg++ distribution.
+
+ * Moved the static word_list array inside the generated function
+ in_word_set. This supports better data hiding.
+
+ * Added a texinfo file, gperf.texinfo
+
+ * Revised the Makefile to cleanup the droppings from texinfo
+ and changed the name of gperf.cc and gperf.h to perfect.cc
+ and perfect.h.
+
+Fri Jan 6 13:04:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
+
+ * Implemented the switch statement output format. Much better
+ for large datasets in terms of space used.
+
+ * Added new functions to break up the Key_List::Output function.
+ Functions added were Key_List::Print_Switch, Key_List::Print_Min_Max,
+ Key_List::Print_Keyword_Table, Key_List::Print_Hash_Function,
+ and Key_List::Print_Lookup_Function. This simplifies the
+ big mess in Key_List::Output considerably!
+
+ * Added switch statement option to Options, which potentially
+ trades time for space in the generated lookup code.
+
+Thu Jan 5 22:46:34 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
+
+ * Released version 1.1
+
+ * Fixed a bug with Gperf::Merge_Set, it was skipping letters shared
+ between the Set_1 and Set_2.
+
+ * Added the optimal min/max algorithm in Key_List::Output. This
+ runs in O ( 3n/2 ), rather than O ( 2n ) time.
+
+ * Changed Gperf::Sort_Set to use insertion sort, rather than
+ bubble sort.
+
+ * Added a check in Key_List::Output for the special case where
+ the keys used are 1,$. It is possible to generate more
+ efficient C code in this case.
diff --git a/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/INSTALL b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/INSTALL
new file mode 100644
index 00000000..350b32f5
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/INSTALL
@@ -0,0 +1,183 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ 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, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ 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 at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' 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. 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.
+
+ Running `configure' takes 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.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+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 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
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have 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.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' 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.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+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 host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+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.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--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.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/NEWS b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/NEWS
new file mode 100644
index 00000000..efa3ca0c
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/NEWS
@@ -0,0 +1,80 @@
+New in 3.0.1:
+
+* Bug fix.
+
+New in 3.0:
+
+* Added option --output that allows to specify the output file name.
+* Some options have been renamed:
+ --hash-fn-name=NAME --> --hash-function-name=NAME
+ --lookup-fn-name=NAME --> --lookup-function-name=NAME
+ --compare-strlen --> --compare-lengths
+ --global --> --global-table
+ The older variants are still supported for backward compatibility.
+* The following options can now be specified inside the input file:
+ %delimiters=DELIMITER-LIST
+ %struct-type
+ %ignore-case
+ %language=LANGUAGE-NAME
+ %define slot-name NAME
+ %define initializer-suffix INITIALIZERS
+ %define hash-function-name NAME
+ %define lookup-function-name NAME
+ %define class-name NAME
+ %7bit
+ %compare-lengths
+ %compare-strncmp
+ %readonly-tables
+ %enum
+ %includes
+ %global-table
+ %pic
+ %define string-pool-name NAME
+ %null-strings
+ %define word-array-name NAME
+ %switch=COUNT
+ %omit-struct-type
+* When the option -k is not given, the default key positions are now
+ computed depending on the set of keywords.
+* If the input file is given by name, the output file will now contain
+ #line directives referring to the input file.
+* Some keyword sets containing permutations, like { "xy", "yx", "xz", "zx" }
+ or { "abc", "acb", "bca", "cab" }, are now handled by gperf without
+ requiring the option -D.
+* The generated table is usually much smaller than it was with earlier
+ versions of gperf.
+* Added option -m/--multiple-iterations that allows to further reduce the
+ size of the generated table.
+* When the search for a good hash function is not immediately successful,
+ the table's size will grow as needed. Earlier versions of gperf bailed
+ out with an "Internal error, duplicate hash code value".
+* The options -f/--fast and -o/--occurrence-sort have no effect any more.
+* Added options -P/--pic and --null-strings that optimize the generated code
+ for use in shared libraries. -P/--pic does a perfect optimization but may
+ require some small code changes (see the documentation for details), whereas
+ --null-strings does only a half-hearted optimization but works without
+ needing any change to surrounding code.
+* Added option --ignore-case that produces a case independent lookup function.
+* Bug fixes.
+
+New in 2.7.2:
+
+* Keywords may now be enclosed in double quotes; this permits the use of
+ '#', ',', space or NUL inside keywords.
+* Bug fixes.
+
+New in 2.7.1:
+
+* Added option "-F" for gcc.
+
+New in 2.7:
+
+* gperf is now a stand-alone package, untied from libg++.
+* Autoconfiguring.
+* Removed the "-a" and "-g" options, extended the "-L" option instead.
+* Removed the "-p" option, it is the default.
+* Added long options ("--help", "--version" etc.).
+* 8-bit cleanliness is now the default; use "-7" to get the old behaviour.
+* Compiles with any C++ compiler.
+* Numerous small improvements.
+
diff --git a/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/README b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/README
new file mode 100644
index 00000000..26173bfc
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1-src/README
@@ -0,0 +1,28 @@
+This is GNU gperf. It is a program that generates perfect hash
+functions for sets of key words. A perfect hash function is:
+
+ A hash function and a data structure that allows
+ recognition of a key word in a set of words using
+ exactly 1 probe into the data structure.
+
+The doc/gperf.html file explains how the program works, the form of
+the input, what options are available, and hints on choosing the best
+options for particular key words set.
+
+See the file NEWS for a list of major changes in the current release.
+
+See the file INSTALL for compilation and installation instructions.
+
+Output from the GPERF program is used to recognize reserved words in
+the GNU C, GNU C++, and GNU Pascal compilers, as well as with the GNU
+indent program.
+
+For general documentation on the coding and usage standards
+this distribution follows, see the GNU standards document
+ftp://ftp.gnu.org/pub/gnu/standards.*, especially the 'Makefile
+Conventions', 'Configuration', and 'User Interfaces' sections.
+
+Mail suggestions and bug reports to <bug-gnu-gperf@gnu.org>. When
+reporting bugs, please include in the subject line the package name
+and version (output of 'gperf --version') for which you found a problem.
+
diff --git a/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1/check.log b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1/check.log
new file mode 100644
index 00000000..1e16f46d
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1/check.log
@@ -0,0 +1,156 @@
+cd lib; make check
+make[1]: Entering directory `/cygdrive/k/Devel/gperf/3.0.1/gperf-3.0.1/lib'
+make[1]: Niets te doen voor `check'.
+make[1]: Leaving directory `/cygdrive/k/Devel/gperf/3.0.1/gperf-3.0.1/lib'
+cd src; make check
+make[1]: Entering directory `/cygdrive/k/Devel/gperf/3.0.1/gperf-3.0.1/src'
+make[1]: Niets te doen voor `check'.
+make[1]: Leaving directory `/cygdrive/k/Devel/gperf/3.0.1/gperf-3.0.1/src'
+cd tests; make check
+make[1]: Entering directory `/cygdrive/k/Devel/gperf/3.0.1/gperf-3.0.1/tests'
+performing some tests of the perfect hash generator
+gcc -c -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 ../../gperf-3.0.1-src/tests/test.c
+../src/gperf -c -l -S1 -I -o ../../gperf-3.0.1-src/tests/c.gperf > cinset.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o cout cinset.c test.o
+testing ANSI C reserved words, all items should be found in the set
+./cout -v < ../../gperf-3.0.1-src/tests/c.gperf > c.out
+diff ../../gperf-3.0.1-src/tests/c.exp c.out
+../src/gperf -k1,4,'$' -I ../../gperf-3.0.1-src/tests/ada.gperf > adainset.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o aout adainset.c test.o
+testing Ada reserved words, all items should be found in the set
+./aout -v < ../../gperf-3.0.1-src/tests/ada.gperf > ada-res.out
+diff ../../gperf-3.0.1-src/tests/ada-res.exp ada-res.out
+../src/gperf -D -k1,'$' -s 2 -I -o ../../gperf-3.0.1-src/tests/adadefs.gperf > preinset.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o preout preinset.c test.o
+testing Ada predefined words, all items should be found in the set
+./preout -v < ../../gperf-3.0.1-src/tests/adadefs.gperf > ada-pred.out
+diff ../../gperf-3.0.1-src/tests/ada-pred.exp ada-pred.out
+../src/gperf -k1,2,'$' -I -o ../../gperf-3.0.1-src/tests/modula3.gperf > m3inset.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o m3out m3inset.c test.o
+testing Modula3 reserved words, all items should be found in the set
+./m3out -v < ../../gperf-3.0.1-src/tests/modula3.gperf > modula.out
+diff ../../gperf-3.0.1-src/tests/modula.exp modula.out
+../src/gperf -o -S2 -I < ../../gperf-3.0.1-src/tests/pascal.gperf > pinset.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o pout pinset.c test.o
+testing Pascal reserved words, all items should be found in the set
+./pout -v < ../../gperf-3.0.1-src/tests/pascal.gperf > pascal.out
+diff ../../gperf-3.0.1-src/tests/pascal.exp pascal.out
+../src/gperf -k1 -t -I -K foreign_name < ../../gperf-3.0.1-src/tests/lang-utf8.gperf > lu8inset.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o lu8out lu8inset.c test.o
+testing UTF-8 encoded languages, all items should be found in the set
+sed -e '1,6d' -e 's/,.*//' < ../../gperf-3.0.1-src/tests/lang-utf8.gperf | ./lu8out -v > lang-utf8.out
+diff ../../gperf-3.0.1-src/tests/lang-utf8.exp lang-utf8.out
+gcc -c -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 ../../gperf-3.0.1-src/tests/test2.c
+../src/gperf -k4 -t -l -I -K foreign_name < ../../gperf-3.0.1-src/tests/lang-ucs2.gperf > lu2inset.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o lu2out lu2inset.c test2.o
+testing UCS-2 encoded languages, all items should be found in the set
+./lu2out -v < ../../gperf-3.0.1-src/tests/lang-ucs2.in > lang-ucs2.out
+diff ../../gperf-3.0.1-src/tests/lang-ucs2.exp lang-ucs2.out
+testing SMTP keywords, case-insensitive
+../src/gperf --struct-type --readonly-table --enum --global -K field_name -N header_entry --ignore-case ../../gperf-3.0.1-src/tests/smtp.gperf > smtp.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o smtp smtp.c
+./smtp
+../src/gperf --struct-type --readonly-table --enum --global -K field_name -N header_entry --ignore-case --compare-strncmp ../../gperf-3.0.1-src/tests/smtp.gperf > smtp.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o smtp smtp.c
+./smtp
+../src/gperf --struct-type --readonly-table --enum --global -K field_name -N header_entry --ignore-case --compare-lengths ../../gperf-3.0.1-src/tests/smtp.gperf > smtp.c
+gcc -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -o smtp smtp.c
+./smtp
+../src/gperf -L C -F ', 0, 0' -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,'$' < ../../gperf-3.0.1-src/tests/c-parse.gperf > c-parse.out
+diff ../../gperf-3.0.1-src/tests/c-parse.exp c-parse.out
+2c2
+< /* Command-line: ../src/gperf -L C -F ', 0, 0' -j1 -i 1 -g -o -t -G -N is_reserved_word -k'1,3,$' */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -L C -F ', 0, 0' -j1 -i 1 -g -o -t -G -N is_reserved_word -k'1,3,$' */
+../src/gperf -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,'$' < ../../gperf-3.0.1-src/tests/objc.gperf > objc.out
+diff ../../gperf-3.0.1-src/tests/objc.exp objc.out
+2c2
+< /* Command-line: ../src/gperf -j1 -i 1 -g -o -t -N is_reserved_word -k'1,3,$' */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -j1 -i 1 -g -o -t -N is_reserved_word -k'1,3,$' */
+../src/gperf -L C -F ', 0, 0, 0' -D -E -S1 -j1 -i 1 -g -o -t -k'*' < ../../gperf-3.0.1-src/tests/chill.gperf > chill.out
+diff ../../gperf-3.0.1-src/tests/chill.exp chill.out
+2c2
+< /* Command-line: ../src/gperf -L C -F ', 0, 0, 0' -D -E -S1 -j1 -i 1 -g -o -t -k'*' */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -L C -F ', 0, 0, 0' -D -E -S1 -j1 -i 1 -g -o -t -k'*' */
+../src/gperf -L C -F ', 0, 0' -j1 -g -o -t -N is_reserved_word -k1,4,7,'$' < ../../gperf-3.0.1-src/tests/cplusplus.gperf > cplusplus.out
+diff ../../gperf-3.0.1-src/tests/cplusplus.exp cplusplus.out
+2c2
+< /* Command-line: ../src/gperf -L C -F ', 0, 0' -j1 -g -o -t -N is_reserved_word -k'1,4,7,$' */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -L C -F ', 0, 0' -j1 -g -o -t -N is_reserved_word -k'1,4,7,$' */
+../src/gperf -L C -F ', 0' -t -j1 -i 1 -g -o -N java_keyword -k1,3,'$' < ../../gperf-3.0.1-src/tests/java.gperf > java.out
+diff ../../gperf-3.0.1-src/tests/java.exp java.out
+2c2
+< /* Command-line: ../src/gperf -L C -F ', 0' -t -j1 -i 1 -g -o -N java_keyword -k'1,3,$' */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -L C -F ', 0' -t -j1 -i 1 -g -o -N java_keyword -k'1,3,$' */
+../src/gperf -n -k1-8 -l < ../../gperf-3.0.1-src/tests/modula2.gperf > modula2.out
+diff ../../gperf-3.0.1-src/tests/modula2.exp modula2.out
+2c2
+< /* Command-line: ../src/gperf -n -k1-8 -l */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -n -k1-8 -l */
+../src/gperf -D -t -k1,'$' < ../../gperf-3.0.1-src/tests/c-parse.gperf > test-4.out
+diff ../../gperf-3.0.1-src/tests/test-4.exp test-4.out
+2c2
+< /* Command-line: ../src/gperf -D -t -k'1,$' */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -D -t -k'1,$' */
+../src/gperf -g -o -j1 -t -N is_reserved_word < ../../gperf-3.0.1-src/tests/gpc.gperf > gpc.out
+diff ../../gperf-3.0.1-src/tests/gpc.exp gpc.out
+2c2
+< /* Command-line: ../src/gperf -g -o -j1 -t -N is_reserved_word */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -g -o -j1 -t -N is_reserved_word */
+../src/gperf -m5 < ../../gperf-3.0.1-src/tests/permut2.gperf > permut2.out
+diff ../../gperf-3.0.1-src/tests/permut2.exp permut2.out
+2c2
+< /* Command-line: ../src/gperf -m5 */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -m5 */
+../src/gperf -m5 < ../../gperf-3.0.1-src/tests/permut3.gperf > permut3.out
+diff ../../gperf-3.0.1-src/tests/permut3.exp permut3.out
+2c2
+< /* Command-line: ../src/gperf -m5 */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -m5 */
+../src/gperf -m5 --ignore-case < ../../gperf-3.0.1-src/tests/permutc2.gperf > permutc2.out
+diff ../../gperf-3.0.1-src/tests/permutc2.exp permutc2.out
+2c2
+< /* Command-line: ../src/gperf -m5 --ignore-case */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -m5 --ignore-case */
+../src/gperf -C -E -G -I -t < ../../gperf-3.0.1-src/tests/charsets.gperf > charsets.out
+diff ../../gperf-3.0.1-src/tests/charsets.exp charsets.out
+2c2
+< /* Command-line: ../src/gperf -C -E -G -I -t */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -C -E -G -I -t */
+../src/gperf -C -E -G -I -t < ../../gperf-3.0.1-src/tests/languages.gperf > languages.out
+diff ../../gperf-3.0.1-src/tests/languages.exp languages.out
+2c2
+< /* Command-line: ../src/gperf -C -E -G -I -t */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -C -E -G -I -t */
+../src/gperf -t < ../../gperf-3.0.1-src/tests/incomplete.gperf > incomplete.out
+diff ../../gperf-3.0.1-src/tests/incomplete.exp incomplete.out
+2c2
+< /* Command-line: ../src/gperf -t */
+---
+> /* Command-line: 'k:\\Devel\\gperf\\3.0.1\\gperf-3.0.1\\src\\gperf.exe' -t */
+../src/gperf -h > test-6.out
+diff ../../gperf-3.0.1-src/tests/test-6.exp test-6.out
+3c3
+< Usage: ../src/gperf [OPTION]... [INPUT-FILE]
+---
+> Usage: k:\Devel\gperf\3.0.1\gperf-3.0.1\src\gperf.exe [OPTION]... [INPUT-FILE]
+only if, do, for, case, goto, else, while, and return should be found
+./aout -v < ../../gperf-3.0.1-src/tests/c.gperf > test-7.out
+diff ../../gperf-3.0.1-src/tests/test-7.exp test-7.out
+make[1]: Leaving directory `/cygdrive/k/Devel/gperf/3.0.1/gperf-3.0.1/tests'
+cd doc; make check
+make[1]: Entering directory `/cygdrive/k/Devel/gperf/3.0.1/gperf-3.0.1/doc'
+make[1]: Niets te doen voor `check'.
+make[1]: Leaving directory `/cygdrive/k/Devel/gperf/3.0.1/gperf-3.0.1/doc'
diff --git a/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1/check_err.log b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1/check_err.log
new file mode 100644
index 00000000..8263f49c
--- /dev/null
+++ b/gnuwin32/contrib/gperf/3.0.1/gperf-3.0.1/check_err.log
@@ -0,0 +1,21 @@
+../../gperf-3.0.1-src/tests/test.c: In function `main':
+../../gperf-3.0.1-src/tests/test.c:25: warning: implicit declaration of function `in_word_set'
+1 input keys have identical hash values, examine output carefully...
+../../gperf-3.0.1-src/tests/test2.c: In function `main':
+../../gperf-3.0.1-src/tests/test2.c:52: warning: implicit declaration of function `in_word_set'
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+8 input keys have identical hash values, examine output carefully...
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
+make[1]: [check-test] Fout 1 (genegeerd)
diff --git a/gnuwin32/contrib/libiconv/1.9.2/depends-GnuWin32.lst b/gnuwin32/contrib/libiconv/1.9.2/depends-GnuWin32.lst
new file mode 100644
index 00000000..0c9a4ac3
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/depends-GnuWin32.lst
@@ -0,0 +1,9 @@
+advapi32.dll
+gdi32.dll
+kernel32.dll
+libintl3.dll
+msvcrt.dll
+ntdll.dll
+ole32.dll
+rpcrt4.dll
+user32.dll
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-1-GnuWin32.README b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-1-GnuWin32.README
new file mode 100644
index 00000000..fc6b8ae0
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-1-GnuWin32.README
@@ -0,0 +1,54 @@
+* LibIconv-1.9.2 for Windows *
+==============================
+
+What is it?
+-----------
+LibIconv: convert between character encodings
+
+Description
+-----------
+LibIconv converts from one character encoding to another through Unicode
+conversion (see Web page for full list of supported encodings). It has
+also limited support for transliteration, i.e. when a character cannot be
+represented in the target character set, it is approximated through one
+or several similar looking characters. It is useful if your application
+needs to support multiple character encodings, but that support lacks from
+your system.
+
+- Libiconv-1 is in Libiconv-1.7
+
+Homepage
+--------
+http://www.gnu.org/software/libiconv
+
+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>- libgw32c <http://gnuwin32.sourceforge.net/packages/libgw32c.htm> (for developing with LibIconv library)
+
+Notes
+-----
+- Bugs and questions on this MS-Windows port: gnuwin32@users.sourceforge.net
+
+Package Availability
+--------------------
+- in: http://gnuwin32.sourceforge.net
+
+Sources
+-------
+- libiconv-1.9.2-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 libiconv-1.9.2-1-GnuWin32.diffs in libiconv-1.9.2-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.
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/ABOUT-NLS b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/ABOUT-NLS
new file mode 100644
index 00000000..d79798cc
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/ABOUT-NLS
@@ -0,0 +1,477 @@
+Notes on the Free Translation Project
+*************************************
+
+ Free software is going international! The Free Translation Project
+is a way to get maintainers of free software, translators, and users all
+together, so that will gradually become able to speak many languages.
+A few packages already provide translations for their messages.
+
+ If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site. But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+ Installers will find here some useful hints. These notes also
+explain how users should proceed for getting the programs to use the
+available translations. They tell how people wanting to contribute and
+work at translations should contact the appropriate team.
+
+ When reporting bugs in the `intl/' directory or bugs which may be
+related to internationalization, you should tell about the version of
+`gettext' which is used. The information can be found in the
+`intl/VERSION' file, in internationalized packages.
+
+Quick configuration advice
+==========================
+
+ If you want to exploit the full power of internationalization, you
+should configure it using
+
+ ./configure --with-included-gettext
+
+to force usage of internationalizing routines provided within this
+package, despite the existence of internationalizing capabilities in the
+operating system where this package is being installed. So far, only
+the `gettext' implementation in the GNU C library version 2 provides as
+many features (such as locale alias, message inheritance, automatic
+charset conversion or plural form handling) as the implementation here.
+It is also not possible to offer this additional functionality on top
+of a `catgets' implementation. Future versions of GNU `gettext' will
+very likely convey even more functionality. So it might be a good idea
+to change to GNU `gettext' as soon as possible.
+
+ So you need _not_ provide this option if you are using GNU libc 2 or
+you have installed a recent copy of the GNU gettext package with the
+included `libintl'.
+
+INSTALL Matters
+===============
+
+ Some packages are "localizable" when properly installed; the
+programs they contain can be made to speak your own native language.
+Most such packages use GNU `gettext'. Other packages have their own
+ways to internationalization, predating GNU `gettext'.
+
+ By default, this package will be installed to allow translation of
+messages. It will automatically detect whether the system already
+provides the GNU `gettext' functions. If not, the GNU `gettext' own
+library will be used. This library is wholly contained within this
+package, usually in the `intl/' subdirectory, so prior installation of
+the GNU `gettext' package is _not_ required. Installers may use
+special options at configuration time for changing the default
+behaviour. The commands:
+
+ ./configure --with-included-gettext
+ ./configure --disable-nls
+
+will respectively bypass any pre-existing `gettext' to use the
+internationalizing routines provided within this package, or else,
+_totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl.a' file and
+will decide to use this. This might be not what is desirable. You
+should use the more recent version of the GNU `gettext' library. I.e.
+if the file `intl/VERSION' shows that the library which comes with this
+package is more recent, you should use
+
+ ./configure --with-included-gettext
+
+to prevent auto-detection.
+
+ The configuration process will not test for the `catgets' function
+and therefore it will not be used. The reason is that even an
+emulation of `gettext' on top of `catgets' could not provide all the
+extensions of the GNU `gettext' library.
+
+ Internationalized packages have usually many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language. Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package. However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+Using This Package
+==================
+
+ As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
+and `CC' is an ISO 3166 two-letter country code. For example, let's
+suppose that you speak German and live in Germany. At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+ You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries. For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
+country code serves to distinguish the dialects.
+
+ The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc. On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
+locales supported by your system for your country by running the command
+`locale -a | grep '^LL''.
+
+ Not all programs have translations for all languages. By default, an
+English message is shown in place of a nonexistent translation. If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries. For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+ In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect. For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+Translating Teams
+=================
+
+ For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list. The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
+area.
+
+ If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended. For example, speakers of Swedish can send a
+message to `sv-request@li.org', having this message body:
+
+ subscribe
+
+ Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around. If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `translation@iro.umontreal.ca' to reach the
+coordinator for all translator teams.
+
+ The English team is special. It works at improving and uniformizing
+the terminology in use. Proven linguistic skill are praised more than
+programming skill, here.
+
+Available Packages
+==================
+
+ Languages are not equally supported in all packages. The following
+matrix shows the current state of internationalization, as of February
+2003. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+ Ready PO files az be bg ca cs da de el en en_GB eo es et fa fi
+ +-------------------------------------------------+
+ a2ps | [] [] [] [] [] |
+ aegis | () |
+ anubis | |
+ ap-utils | |
+ bash | [] [] [] |
+ batchelor | |
+ bfd | [] [] |
+ binutils | [] [] |
+ bison | [] [] [] [] |
+ clisp | [] [] [] |
+ clisp | |
+ coreutils | [] [] [] [] |
+ cpio | [] [] [] |
+ darkstat | () [] |
+ diffutils | [] [] [] [] [] [] [] |
+ enscript | [] [] [] |
+ error | [] [] [] [] |
+ fetchmail | [] () [] [] [] |
+ fileutils | [] [] [] [] |
+ findutils | [] [] [] [] [] [] [] |
+ flex | [] [] [] [] |
+ gas | [] |
+ gawk | [] [] [] |
+ gcal | [] |
+ gcc | [] [] |
+ gettext | [] [] [] [] [] |
+ gimp-print | |
+ gliv | |
+ gnucash | [] () |
+ gnucash-glossary| [] () [] |
+ gnupg | [] [] [] [] [] [] [] |
+ gpe-todo | |
+ gphoto2 | [] [] |
+ gprof | [] [] |
+ gpsdrive | () () () () |
+ grep | [] [] [] [] [] [] [] |
+ gretl | [] |
+ hello | [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] |
+ indent | [] [] [] [] [] [] |
+ jpilot | () [] [] [] |
+ jwhois | [] |
+ kbd | [] [] [] |
+ ld | [] [] |
+ libc | [] [] [] [] [] [] [] |
+ libgpewidget | |
+ libiconv | [] [] [] [] [] [] |
+ lifelines | [] () |
+ lilypond | [] |
+ lingoteach | [] |
+ lingoteach_lessons| () () |
+ lynx | [] [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailutils | [] [] |
+ make | [] [] [] |
+ man-db | [] () [] () |
+ mysecretdiary | [] [] [] |
+ nano | [] () [] [] [] |
+ nano_1_0 | [] () [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] [] [] |
+ ptx | [] [] [] [] [] [] [] |
+ python | |
+ radius | |
+ recode | [] [] [] [] [] |
+ sed | [] [] [] [] [] [] |
+ sh-utils | [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] |
+ sketch | [] () [] |
+ soundtracker | [] [] [] |
+ sp | [] |
+ tar | [] [] [] [] [] [] |
+ texinfo | [] [] [] [] |
+ textutils | [] [] [] [] |
+ tin | () () [] |
+ util-linux | [] [] [] [] [] [] [] |
+ vorbis-tools | [] [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] [] |
+ wget | [] [] [] [] [] [] [] [] [] |
+ xchat | |
+ xpad | |
+ +-------------------------------------------------+
+ az be bg ca cs da de el en en_GB eo es et fa fi
+ 0 1 2 26 9 49 46 9 1 1 11 52 19 1 15
+
+ fr gl he hr hu id it ja ko lg lv ms nb nl
+ +-------------------------------------------+
+ a2ps | [] () () [] [] |
+ aegis | () |
+ anubis | [] [] |
+ ap-utils | [] |
+ bash | [] [] |
+ batchelor | |
+ bfd | [] [] |
+ binutils | [] [] |
+ bison | [] [] [] [] |
+ clisp | [] [] |
+ clisp | |
+ coreutils | [] [] [] |
+ cpio | [] [] [] [] [] |
+ darkstat | () [] [] [] |
+ diffutils | [] [] [] [] [] [] |
+ enscript | [] [] [] |
+ error | [] [] [] |
+ fetchmail | [] |
+ fileutils | [] [] [] [] |
+ findutils | [] [] [] [] [] [] [] [] [] |
+ flex | [] [] |
+ gas | [] |
+ gawk | [] [] |
+ gcal | [] |
+ gcc | [] |
+ gettext | [] [] [] |
+ gimp-print | |
+ gliv | () |
+ gnucash | [] [] [] |
+ gnucash-glossary| [] [] |
+ gnupg | [] [] [] [] [] |
+ gpe-todo | |
+ gphoto2 | [] [] [] |
+ gprof | [] [] |
+ gpsdrive | () [] () () |
+ grep | [] [] [] [] [] [] [] [] |
+ gretl | [] |
+ hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] |
+ indent | [] [] [] [] [] [] |
+ jpilot | [] () () |
+ jwhois | [] [] [] [] |
+ kbd | [] |
+ ld | [] |
+ libc | [] [] [] [] [] [] |
+ libgpewidget | |
+ libiconv | [] [] [] [] [] [] |
+ lifelines | () |
+ lilypond | [] [] |
+ lingoteach | [] |
+ lingoteach_lessons| |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailutils | |
+ make | [] [] [] [] [] [] [] |
+ man-db | [] () () |
+ mysecretdiary | [] [] |
+ nano | [] [] [] [] [] [] |
+ nano_1_0 | [] [] [] [] [] [] |
+ opcodes | [] [] [] |
+ parted | [] [] [] |
+ ptx | [] [] [] [] [] [] |
+ python | |
+ radius | |
+ recode | [] [] [] [] [] |
+ sed | [] [] [] [] [] |
+ sh-utils | [] [] [] [] [] |
+ sharutils | [] [] [] [] [] |
+ sketch | [] |
+ soundtracker | [] [] [] |
+ sp | [] () |
+ tar | [] [] [] [] [] [] [] [] [] |
+ texinfo | [] [] [] [] |
+ textutils | [] [] [] [] [] [] |
+ tin | |
+ util-linux | [] [] () [] [] |
+ vorbis-tools | [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] [] |
+ wget | [] [] [] [] [] [] [] |
+ xchat | |
+ xpad | |
+ +-------------------------------------------+
+ fr gl he hr hu id it ja ko lg lv ms nb nl
+ 59 23 8 10 26 20 18 26 8 0 1 8 7 24
+
+ nn no pl pt pt_BR ro ru sk sl sv tr uk zh_CN zh_TW
+ +----------------------------------------------------+
+ a2ps | () () () [] [] [] [] [] [] | 14
+ aegis | () | 0
+ anubis | [] [] | 4
+ ap-utils | () () | 1
+ bash | [] [] | 7
+ batchelor | | 0
+ bfd | [] [] | 6
+ binutils | [] [] | 6
+ bison | [] [] [] | 11
+ clisp | | 5
+ clisp | | 0
+ coreutils | [] [] [] [] [] | 12
+ cpio | [] [] [] [] [] | 13
+ darkstat | [] [] () () | 6
+ diffutils | [] [] [] [] [] [] | 19
+ enscript | [] [] [] [] | 10
+ error | [] [] [] [] | 11
+ fetchmail | () () [] | 6
+ fileutils | [] [] [] [] [] [] | 14
+ findutils | [] [] [] [] [] [] [] [] | 24
+ flex | [] [] [] [] | 10
+ gas | [] | 3
+ gawk | [] [] | 7
+ gcal | [] [] | 4
+ gcc | [] | 4
+ gettext | [] [] [] [] [] [] | 14
+ gimp-print | | 0
+ gliv | [] | 1
+ gnucash | [] [] [] [] [] | 9
+ gnucash-glossary| [] [] [] [] | 8
+ gnupg | [] [] [] [] | 16
+ gpe-todo | | 0
+ gphoto2 | [] [] | 7
+ gprof | [] [] [] | 7
+ gpsdrive | [] [] | 3
+ grep | [] [] [] [] [] | 20
+ gretl | | 2
+ hello | [] [] [] [] [] [] [] [] [] | 31
+ id-utils | [] [] [] [] | 9
+ indent | [] [] [] [] [] | 17
+ jpilot | () [] [] [] [] | 8
+ jwhois | [] () () [] [] | 8
+ kbd | [] [] | 6
+ ld | [] [] | 5
+ libc | [] [] [] [] [] [] [] | 20
+ libgpewidget | | 0
+ libiconv | [] [] [] [] [] [] | 18
+ lifelines | [] | 2
+ lilypond | [] | 4
+ lingoteach | [] [] | 4
+ lingoteach_lessons| () | 0
+ lynx | [] [] [] [] | 13
+ m4 | [] [] [] [] | 13
+ mailutils | | 2
+ make | [] [] [] [] [] | 15
+ man-db | [] | 4
+ mysecretdiary | [] [] [] | 8
+ nano | [] [] [] | 13
+ nano_1_0 | [] [] [] [] [] | 15
+ opcodes | [] [] [] | 8
+ parted | [] [] [] [] [] | 12
+ ptx | [] [] [] [] [] [] [] | 20
+ python | | 0
+ radius | | 0
+ recode | [] [] [] [] [] [] | 16
+ sed | [] [] [] [] [] | 16
+ sh-utils | [] [] [] | 12
+ sharutils | [] [] [] [] | 16
+ sketch | [] [] | 5
+ soundtracker | [] | 7
+ sp | [] | 3
+ tar | [] [] [] [] [] [] [] [] [] | 24
+ texinfo | [] [] [] [] | 12
+ textutils | [] [] [] [] [] | 15
+ tin | | 1
+ util-linux | [] [] [] | 14
+ vorbis-tools | [] | 4
+ wastesedge | | 0
+ wdiff | [] [] [] [] [] | 15
+ wget | [] [] [] [] [] [] [] [] | 24
+ xchat | | 0
+ xpad | | 0
+ +----------------------------------------------------+
+ 43 teams nn no pl pt pt_BR ro ru sk sl sv tr uk zh_CN zh_TW
+ 82 domains 3 4 14 4 34 1 29 14 13 53 46 6 9 13 723
+
+ Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect. This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+ For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer. There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+ If February 2003 seems to be old, you may fetch a more recent copy
+of this `ABOUT-NLS' file on most GNU archive sites. The most
+up-to-date matrix with full percentage details can be found at
+`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
+
+Using `gettext' in new packages
+===============================
+
+ If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package. Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library. This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+ Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project. Therefore the information given above
+applies also for every other Free Software Project. Contact
+`translation@iro.umontreal.ca' to make the `.pot' files available to
+the translation teams.
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/AUTHORS b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/AUTHORS
new file mode 100644
index 00000000..8bedd794
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/AUTHORS
@@ -0,0 +1 @@
+Bruno Haible <bruno@clisp.org>
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/ChangeLog b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/ChangeLog
new file mode 100644
index 00000000..93322059
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/ChangeLog
@@ -0,0 +1,2633 @@
+2004-01-23 Bruno Haible <bruno@clisp.org>
+
+ * tests/table-from.c: Include binary-io.h.
+ (main): Switch stdout to binary mode.
+ * tests/table-to.c: Include binary-io.h.
+ (main): Switch stdout to binary mode.
+ * tests/genutf8.c: Include binary-io.h.
+ (main): Switch stdout to binary mode.
+ * tests/Makefile.in (INCLUDES): Also look in srclib.
+ (check): Pass INCLUDES when compiling genutf8.c.
+ * tests/Makefile.os2 (INCLUDES): Also look in srclib.
+ (genutf8.exe): Pass INCLUDES when compiling genutf8.c.
+ * tests/Makefile.msvc (INCLUDES): Also look in srclib.
+ (check): Pass INCLUDES when compiling genutf8.c.
+
+2004-01-21 Bruno Haible <bruno@clisp.org>
+
+ * src/iconv.c (force_binary): Remove variable.
+ (usage): Don't document --binary any more.
+ (convert, main): Always switch to binary mode.
+ * tests/check-stateful.bat: Remove --binary option.
+ * tests/check-translit.bat: Likewise.
+ * tests/check-stateful.cmd: Likewise.
+ * tests/check-translit.cmd: Likewise.
+ * djgpp/stateful-check.sed: Remove MODE variable.
+ * djgpp/translit-check.sed: Likewise.
+
+2004-01-21 Bruno Haible <bruno@clisp.org>
+
+ * man/iconv.3: Fix description of return value in case of error.
+ Reported by Jonathan Wakely <redi@users.sf.net>.
+
+2003-09-12 Paul Eggert <eggert@twinsun.com>
+
+ * srclib/progreloc.c (get_full_program_name): Define via prototype.
+
+2003-08-15 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.devel (lib/translit.h): Add ulimit command so that the
+ gentranslit program gets the stack it needs. Many Linux distributions
+ allow only 8 MB of stack by default.
+
+2003-08-01 Bruno Haible <bruno@clisp.org>
+
+ * lib/relocatable.c (find_shared_library_fullname): Disable the code on
+ Linux/libc5.
+ * srclib/relocatable.c (find_shared_library_fullname): Likewise.
+ Reported by Alain Guibert <derogaton+bgli@oreka.com>.
+
+2003-07-02 Bruno Haible <bruno@clisp.org>
+
+ * m4/lib-ld.m4: Update from GNU gettext.
+ * m4/lib-prefix.m4: Update from GNU gettext.
+ * m4/gettext.m4: Update from GNU gettext.
+ * m4/intmax.m4: New file, from GNU gettext.
+ * m4/longdouble.m4: New file, from GNU gettext.
+ * m4/longlong.m4: New file, from GNU gettext.
+ * m4/printf-posix.m4: New file, from GNU gettext.
+ * m4/signed.m4: New file, from GNU gettext.
+ * m4/wchar_t.m4: New file, from GNU gettext.
+ * m4/wint_t.m4: New file, from GNU gettext.
+ * m4/pathmax.m4: Update from GNU gettext and gnulib.
+ * m4/ssize_t.m4: Update from GNU gettext and gnulib.
+ * m4/xreadlink.m4: Update from GNU gettext and gnulib.
+ * m4/readlink.m4: New file, from gnulib.
+ * autoconf/install-reloc: Update from GNU gettext.
+ * srclib/stdbool_.h: Renamed from srclib/stdbool.h.in.
+ * srclib/readlink.c: New file, from GNU gettext and gnulib.
+ * srclib/Makefile.am (LIBADD_SOURCE): Add readlink.c.
+ (EXTRA_DIST, stdbool.h): Use stdbool_.h instead of stdbool.h.in.
+ * configure.in: Invoke gl_FUNC_READLINK.
+
+2003-06-22 Bruno Haible <bruno@clisp.org>
+
+ * src/Makefile.in (install): Link with the already installed library.
+ This fixes a link error on Solaris.
+ Reported by Paul Eggert.
+
+2003-06-08 Bruno Haible <bruno@clisp.org>
+
+ * srclib/canonicalize.c (__getcwd) [VMS]: Pass 3 arguments to getcwd.
+
+2003-05-02 Bruno Haible <bruno@clisp.org>
+
+ Support for libtool-1.5.
+ * srclib/progname.c (set_program_name): Remove a leading
+ "<dirname>/.libs/lt-" or "<dirname>/.libs/", not only "lt-".
+
+2003-06-23 Bruno Haible <bruno@clisp.org>
+
+ Avoid compilation units that are empty after preprocessing.
+ * srclib/canonicalize.c: Add dummy declaration.
+ * srclib/strerror.c: Likewise.
+ * srclib/error.c: Include <stdio.h> even if there's nothing to be
+ compiled.
+
+2003-06-22 Bruno Haible <bruno@clisp.org>
+
+ Portability to mingw32.
+ * m4/ssize_t.m4: New file, from GNU gettext.
+ * m4/xreadlink.m4 (gl_XREADLINK): Require gt_TYPE_SSIZE_T.
+ Reported by Jeff Bonggren <jbon@cfl.rr.com>.
+
+2003-06-22 Bruno Haible <bruno@clisp.org>
+
+ Portability to mingw32.
+ * lib/relocatable.c [WIN32]: Include <windows.h>.
+ * srclib/relocatable.c: Likewise.
+ Reported by Jeff Bonggren <jbon@cfl.rr.com>.
+
+2003-06-22 Bruno Haible <bruno@clisp.org>
+
+ * lib/relocatable.c (compute_curr_prefix): Comment out this function in
+ the case when it is not used.
+ * srclib/relocatable.c (compute_curr_prefix): Likewise.
+ Reported by Pavel Roskin <proski@gnu.org>.
+
+2003-06-18 Bruno Haible <bruno@clisp.org>
+
+ * config/install-sh: Update from automake-1.7.5.
+
+2003-06-16 Bruno Haible <bruno@clisp.org>
+
+ * lib/encodings.def (ISO-8859-15): Add alias LATIN-9.
+ (ISO-8859-16): Add aliases ISO_8859-16:2001, LATIN10, L10. Remove alias
+ ISO_8859-16:2000.
+ (GBK): Add aliases MS936, WINDOWS-936.
+ Reported by Guido Flohr <guido@imperia.net>.
+
+2003-05-09 Bruno Haible <bruno@clisp.org>
+
+ * srclib/canonicalize.c: Add #ifdef around versioned_symbol. Avoids an
+ "extraneous semicolon" warning from Tru64 cc.
+
+2003-06-07 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.devel (config.h_vms): Don't define HAVE_ENVIRON_DECL.
+ * Makefile.vms (config.h): New rule.
+ (all, install): Depend on it.
+ (all, install, installdirs, uninstall, check): Fix typo.
+ (mostlyclean, clean, distclean, maintainer-clean): Likewise. Remove
+ config.h.
+ * lib/Makefile.vms (DEFS): Fix value of INSTALLDIR.
+ (OBJECTS): Use libiconv.obj instead of iconv.obj.
+ (libiconv.obj): Renamed from iconv.obj.
+ * srclib/Makefile.vms (INCLUDES): Add parent directory.
+ (OBJECTS): Remove strtoul.obj, setenv.obj, unsetenv.obj.
+ (strtoul.obj, setenv.obj, unsetenv.obj): Remove rules.
+ (alloca.h): New rule.
+ (canonicalize.obj): Depend on it.
+ (clean): Remove alloca.h.
+ * src/Makefile.vms (datadir, localedir): New variables.
+ (DEFS): Also define LOCALEDIR.
+ (iconv.obj): Add flags for relocatability,
+ (iconv.exe): Link with libicrt. Use link_options.
+ * vms/link_options.opt: New file.
+ Reported by Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+
+2003-06-07 Bruno Haible <bruno@clisp.org>
+
+ Support for relocatable data files even on Woe32.
+ * lib/Makefile.msvc (PICFLAGS): Also define PIC.
+
+2003-05-22 Bruno Haible <bruno@clisp.org>
+
+ * Version 1.9.1 released.
+
+2003-05-22 Bruno Haible <bruno@clisp.org>
+
+ * lib/genaliases.c (main): Emit %pic instead of %null-strings.
+ Change type of 'name' field to 'int'.
+ * lib/genaliases2.c (emit_encoding): Add a 'tag' argument. Emit an
+ invocation of macro S(), including the tag and a counter.
+ (main): Use the command-line argument as tag.
+ * Makefile.devel (lib/aliases_aix.h, lib/aliases_osf1.h,
+ lib/aliases_dos.h, lib/aliases_extra.h): Pass a tag to the program.
+ * lib/iconv.c (stringpool2_t): New type.
+ (stringpool2_contents): New data table.
+ (stringpool2): New macro.
+ (sysdep_aliases): Make position-independent. Move #includes out to
+ aliases2.h.
+ (aliases2_lookup): Update.
+ (nalias): New type.
+ (compare_by_index): Use 'struct nalias' instead of 'struct alias'.
+ (iconvlist): Convert 'struct alias' to 'struct nalias' while copying.
+ * lib/aliases2.h: New file, extracted from lib/iconv.c.
+
+2003-05-20 Bruno Haible <bruno@clisp.org>
+
+ * lib/iconv.c (iconvlist): Test p->name against NULL, not against "".
+ Reported by Muraoka Taro <koron@tka.att.ne.jp>.
+
+2003-05-19 Bruno Haible <bruno@clisp.org>
+
+ * windows/iconv.rc: Include <winver.h>.
+ Reported by Perry Rapp.
+
+2003-05-18 Bruno Haible <bruno@clisp.org>
+
+ * Version 1.9 released.
+
+2003-05-18 Bruno Haible <bruno@clisp.org>
+
+ * lib/Makefile.in (libiconv_plug_osf.so): Avoid using LIBTOOL_LINK.
+
+2003-05-18 Bruno Haible <bruno@clisp.org>
+
+ * lib/Makefile.msvc (DEBUGFLAGS): New variable.
+ (iconv.lib): Use it.
+ * src/Makefile.msvc (DEBUGFLAGS): New variable.
+ * tests/Makefile.msvc (DEBUGFLAGS): New variable.
+
+2003-05-17 Bruno Haible <bruno@clisp.org>
+
+ * src/Makefile.msvc (libdir, datadir, localedir): New variables.
+ (IIlibdir, IIdatadir, IIlocaledir): New variables.
+ (CFLAGS): Define LOCALEDIR.
+ (iconv_no_i18n.exe): New rule.
+ (all): Depend on it.
+ * tests/check-stateful.bat: Invoke iconv_no_i18n instead of iconv.
+ * tests/check-translit.bat: Likewise.
+
+2003-05-16 Bruno Haible <bruno@clisp.org>
+
+ * lib/genaliases.c (main): Emit declarations for gperf-3.0.
+ * Makefile.devel (lib/aliases.h): Remove gperf command line options;
+ add new option "-m 10" for gperf-3.0.
+
+2003-05-12 Bruno Haible <bruno@clisp.org>
+
+ * m4/error.m4: Update from gettext.
+
+2003-05-12 Bruno Haible <bruno@clisp.org>
+
+ * configure.in: Invoke AC_GNU_SOURCE and jm_FUNC_GLIBC_UNLOCKED_IO.
+
+2003-05-12 Bruno Haible <bruno@clisp.org>
+
+ * lib/Makefile.msvc (PICFLAGS, CFLAGS): Move BUILDING_* macros from
+ CFLAGS to PICFLAGS.
+
+2003-05-09 Bruno Haible <bruno@clisp.org>
+
+ * srclib/error.c: Update from gnulib with modifications.
+ * srclib/unlocked-io.h: New file, from gnulib.
+ * m4/strerror_r.m4: New file, from gnulib.
+ * m4/unlocked-io.m4: New file, from gnulib.
+ * Makefile.devel (aclocal.m4): Depend on them.
+
+2003-05-08 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.msvc (IIPREFIX): New variable.
+ * srclib/Makefile.msvc (INCLUDES): Add -I..\windows.
+ * src/Makefile.msvc (IIPREFIX, IIprefix, IIexec_prefix, IIbindir,
+ IIincludedir): New variables.
+ (INCLUDES): Add -I..\windows.
+ (iconv.exe): Define INSTALLPREFIX and INSTALLDIR. Link with
+ ../srclib/icrt.lib.
+ Patches by Perry Rapp.
+
+2003-05-07 Bruno Haible <bruno@clisp.org>
+
+ * README.woe32: Fix instructions for step 1.
+ * srclib/Makefile.msvc (OBJECTS): Remove strtoul.obj.
+ (strtoul.obj): Remove rule.
+ Reported by Perry Rapp.
+
+2003-05-07 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.vms: New file.
+ * lib/Makefile.vms: New file.
+ * srclib/Makefile.vms: New file.
+ * src/Makefile.vms: New file.
+ * man/Makefile.vms: New file.
+ * tests/Makefile.vms: New file.
+ * Makefile.devel (config.h_vms, lib/config.h_vms, include/iconv.h_vms):
+ New rules.
+ (all): Depend on them.
+
+2003-05-07 Bruno Haible <bruno@clisp.org>
+
+ * srclib/Makefile.msvc (OBJECTS): Remove findprog.obj.
+ (findprog.obj): Remove rule.
+ * src/Makefile.msvc (includedir): New variable.
+
+2003-05-06 Bruno Haible <bruno@clisp.org>
+
+ * lib/translit.def: Upgrade to Unicode 4.0.
+
+2003-05-06 Bruno Haible <bruno@clisp.org>
+
+ * srclib/Makefile.am (DEFS): Fix spelling of DEPENDS_ON_LIBICONV.
+ * srclib/Makefile.msvc (CFLAGS): Likewise.
+
+ * srclib/Makefile.msvc (INCLUDES): Add -I.. .
+ Reported by Perry Rapp.
+
+ * Makefile.msvc (config.h): New rule.
+ (all): Depend on it.
+ (mostlyclean, clean, distclean, maintainer-clean): Erase config.h.
+ Reported by Perry Rapp.
+
+2003-05-06 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/config.guess: Update to GNU version 2003-02-22.
+ * autoconf/config.sub: Likewise.
+
+2003-05-06 Bruno Haible <bruno@clisp.org>
+
+ * m4/lib-link.m4: Update from GNU gettext.
+ * autoconf/config.rpath: Update from GNU gettext.
+
+ * m4/libtool.m4: Update from GNU gettext, based on libtool-1.5.
+ * autoconf/ltmain.sh: Update from GNU gettext, based on libtool-1.5.
+
+ * m4/gettext.m4: Update from GNU gettext.
+ * m4/nls.m4: Update from GNU gettext.
+ * m4/po.m4: Update from GNU gettext.
+ * Makefile.devel (aclocal.m4): Depend on m4/nls.m4 and m4/po.m4.
+
+2003-04-12 Bruno Haible <bruno@clisp.org>
+
+ Support for OpenVMS 7.3.
+ * lib/iconv.c (USE_OSF1): Define also on VMS.
+
+2003-04-12 Bruno Haible <bruno@clisp.org>
+
+ Better support for FreeBSD.
+ * lib/encodings.def (ISO8859-{1,2,3,4,5,6,7,8,9,10,13,14,15,16): New
+ aliases, for compatibility with earlier FreeBSD iconv implementation
+ by Konstantin Chuguev.
+ * lib/iconv.c (iconv_open, iconv, iconv_close) [FreeBSD]: Define as
+ aliases.
+ * src/Makefile.in (install) [FreeBSD]: Avoid installation problem.
+
+2003-04-12 Bruno Haible <bruno@clisp.org>
+
+ * configure.in (mandir): Change default value.
+ * Makefile.in (datadir): New variable.
+ (install, installdirs, uninstall): Pass datadir to po and man
+ directories.
+ * Makefile.os2 (datadir): New variable.
+ (mandir): Use it instead of prefix.
+ (install, uninstall): Pass datadir to man directory.
+ * Makefile.msvc (mandir, docdir): Use datadir instead of prefix.
+ * man/Makefile.in (datadir): New variable.
+ (docdir): Use it instead of prefix.
+ (install, installdirs): Update.
+ * man/Makefile.os2 (datadir): New variable.
+ (mandir): Use it instead of prefix.
+ * man/Makefile.msvc (datadir): New variable.
+ (mandir, docdir): Use it instead of prefix.
+ (install, installdirs): Update.
+
+2003-04-06 Bruno Haible <bruno@clisp.org>
+
+ Make it possible to build with or without libintl support on Woe32.
+ * Makefile.devel (config.h.msvc): Remove ENABLE_NLS.
+ * Makefile.msvc (NO_NLS): New variable.
+ * srclib/Makefile.msvc (NO_NLS): New variable.
+ (CFLAGS, INCLUDES): Use them.
+ * src/Makefile.msvc (NO_NLS): New variable.
+ (NLSFLAGS, INCINTL, LIBINTL): New variables.
+ (CFLAGS, INCLUDES, iconv.exe): Use them.
+
+2003-04-12 Bruno Haible <bruno@clisp.org>
+
+ * lib/loop_unicode.h (unicode_transliterate): When the Hangul or
+ variants transliteration failed with RET_ILUNI, don't return
+ RET_TOOSMALL.
+ Reported by the FreeBSD porters.
+
+2003-04-06 Bruno Haible <bruno@clisp.org>
+
+ * srclib/binary-io.h: New file, from GNU gettext.
+ * src/iconv.c: Include it.
+ (O_BINARY, O_TEXT, SET_BINARY): Remove definitions.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ Support for relocatable installation.
+ * m4/alloca.m4: New file, from GNU gettext.
+ * m4/canonicalize.m4: New file, from GNU gettext.
+ * m4/error.m4: New file, from GNU gettext.
+ * m4/onceonly.m4: New file, from GNU gettext.
+ * m4/pathmax.m4: New file, from GNU gettext.
+ * m4/relocatable.m4: New file, from GNU gettext.
+ * m4/setenv.m4: New file, from GNU gettext.
+ * m4/stdbool.m4: New file, from GNU gettext.
+ * m4/strerror.m4: New file, from GNU gettext.
+ * m4/xreadlink.m4: New file, from GNU gettext.
+ * autoconf/config.libpath: New file, from GNU gettext.
+ * autoconf/install-reloc: New file, from GNU gettext.
+ * autoconf/reloc-ldflags: New file, from GNU gettext.
+ * autoconf/missing: New file, from GNU automake 1.7.3.
+ * lib/relocatable.h: New file, from GNU gettext.
+ * lib/relocatable.c: New file, from GNU gettext.
+ * srclib/alloca.c: New file, from GNU gettext.
+ * srclib/alloca_.h: New file, from GNU gettext.
+ * srclib/canonicalize.c: New file, from GNU gettext.
+ * srclib/canonicalize.h: New file, from GNU gettext.
+ * srclib/error.c: New file, from GNU gettext.
+ * srclib/error.h: New file, from GNU gettext.
+ * srclib/exit.h: New file, from GNU gettext.
+ * srclib/gettext.h: New file, from GNU gettext.
+ * srclib/memmove.c: New file, from GNU gettext.
+ * srclib/pathmax.h: New file, from GNU gettext.
+ * srclib/progname.c: New file, from GNU gettext.
+ * srclib/progname.h: New file, from GNU gettext.
+ * srclib/progreloc.c: New file, from GNU gettext.
+ * srclib/relocatable.c: New file, from GNU gettext.
+ * srclib/relocatable.h: New file, from GNU gettext.
+ * srclib/relocwrapper.c: New file, from GNU gettext.
+ * srclib/setenv.c: New file, from GNU gettext.
+ * srclib/setenv.h: New file, from GNU gettext.
+ * srclib/stdbool.h.in: New file, from GNU gettext.
+ * srclib/strerror.c: New file, from GNU gettext.
+ * srclib/unsetenv.c: New file, from GNU gettext.
+ * srclib/xmalloc.c: New file, from GNU gettext.
+ * srclib/xmalloc.h: New file, from GNU gettext.
+ * srclib/xreadlink.c: New file, from GNU gettext.
+ * srclib/xreadlink.h: New file, from GNU gettext.
+ * srclib/xstrdup.c: New file, from GNU gettext.
+ * srclib/Makefile.am: New file.
+ * srclib/Makefile.msvc: New file.
+ * windows/alloca.h: New file, from GNU gettext.
+ * windows/stdbool.h: New file, from GNU gettext.
+ * configure.in (AC_CONFIG_HEADERS): Replace src/config.h with config.h.
+ Add AC_RELOCATABLE, AC_HEADER_STDC, AC_CHECK_HEADERS(stddef.h stdlib.h
+ string.h), AC_CHECK_FUNCS(getc_unlocked), AC_REPLACE_FUNCS(memmove),
+ AM_LANGINFO_CODESET, gl_FUNC_ALLOCA, gl_CANONICALIZE,
+ gt_FUNC_ERROR_AT_LINE, gl_PATHMAX, gt_FUNC_SETENV, gt_STDBOOL_H,
+ gl_FUNC_STRERROR, gl_XREADLINK, AC_OUTPUT(srclib/Makefile).
+ * lib/config.h.in: Add HAVE_GETC_UNLOCKED, HAVE_LANGINFO_CODESET,
+ HAVE_SETLOCALE, HAVE_STDDEF_H, HAVE_STDLIB_H, HAVE_STRING_H, for
+ localcharset.c. Add ENABLE_RELOCATABLE, INSTALLPREFIX, for
+ relocatable.c.
+ * lib/Makefile.in (DEFS): New variable.
+ (SOURCES): Add localcharset.c and relocatable.c.
+ (OBJECTS): Add localcharset.lo and relocatable.lo.
+ (LIBCHARSET_OBJECTS): Remove variable.
+ (libiconv_plug_linux.so, libiconv_plug_solaris.so,
+ libiconv_plug_osf.so): Use $(DEFS). Don't use $(LIBCHARSET_OBJECTS).
+ (iconv.lo): Use $(DEFS).
+ (localcharset.lo, relocatable.lo): New rules.
+ * lib/Makefile.msvc (CFLAGS): Define HAVE_CONFIG_H, BUILDING_DLL,
+ ENABLE_RELOCATABLE, IN_LIBRARY, INSTALLDIR, NO_XMALLOC,
+ set_relocation_prefix, relocate. Remove $(PICFLAGS).
+ (INCLUDES): Simplify.
+ (SOURCES): Remove variable.
+ (OBJECTS): Add localcharset.obj and relocatable.obj.
+ (LIBCHARSET_OBJECTS): Remove variable.
+ (iconv.obj): Add $(PICFLAGS).
+ (localcharset.obj, relocatable.obj): New rules.
+ (iconv.lib): Drop $(LIBCHARSET_OBJECTS).
+ * include/iconv.h.in (libiconv_set_relocation_prefix): New declaration.
+ * src/gettext.h: Remove file.
+ * src/iconv.c: Include progname.h and relocatable.h.
+ (ICONV_CONST): Define to const if the system has no iconv.
+ (main): Invoke set_program_name. Relocate LOCALEDIR.
+ * src/Makefile.in (top_srcdir): New variable.
+ (INCLUDES): Add .. and ../srclib.
+ (iconv_no_i18n, iconv): Link with ../srclib/libicrt.a.
+ (iconv_no_i18n.@OBJEXT@, iconv.@OBJEXT@): Define INSTALLDIR.
+ (RELOCATABLE_LIBRARY_PATH, RELOCATABLE_SRC_DIR, RELOCATABLE_BUILD_DIR,
+ RELOCATABLE_CONFIG_H_DIR, @SET_RELOCATABLE@, iconv_LDFLAGS): New
+ variables.
+ (iconv): Use $(iconv_LDFLAGS).
+ (install): Use $(INSTALL_PROGRAM_ENV).
+ (distclean): Drop removing config.h.
+ * src/Makefile.msvc (INCLUDES): Add .., simplify.
+ * tests/Makefile.msvc (INCLUDES): Simplify.
+ * Makefile.devel (AUTOHEADER, AUTOMAKE): New variables.
+ (config.h.in, srclib/Makefile.in, config.h.msvc): New rules.
+ (all): Depend on them.
+ (aclocal.m4) Depend also on m4/alloca.m4, m4/canonicalize.m4,
+ m4/error.m4, m4/onceonly.m4, m4/pathmax.m4, m4/relocatable.m4,
+ m4/setenv.m4, m4/stdbool.m4, m4/strerror.m4, m4/xreadlink.m4.
+ (lib/config.h.msvc): Additional processing.
+ * Makefile.in (all, install, installdirs, uninstall, check): Recurse
+ into srclib.
+ (mostlyclean, clean, distclean, maintainerclean): Likewise. Remove
+ lib/localcharset.h.
+ (distclean, maintainerclean): Remove also config.h and some stamps.
+ * Makefile.msvc (all, install, installdirs, uninstall, check,
+ mostlyclean, clean, distclean, maintainerclean): Recurse into srclib.
+ * INSTALL.generic: Document --enable-relocatable and
+ --with-libintl-prefix. Remove the recommendation to set CPPFLAGS and
+ LDFLAGS. The lib-link.m4 macros make this unnecessary.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ * configure.in: Bump version number to 1.9.
+ * include/iconv.h.in (_LIBICONV_VERSION): Bump.
+ * windows/iconv.rc: Bump version number.
+ * lib/Makefile.in (LIBICONV_VERSION_INFO): Bump to 4:0:2.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.msvc (PREFIX): New variable.
+ (prefix): Use it.
+ (distclean, maintainer-clean): Drop Unix specific removals.
+ * lib/Makefile.msvc (PREFIX, IIPREFIX): New variables.
+ (prefix): Use it.
+ (IIprefix, IIexec_prefix, IIbindir, IIlibdir): New variables.
+ (clean): Drop Unix specific removal.
+ * src/Makefile.msvc (PREFIX): New variable.
+ (prefix): Use it.
+ (clean): Drop Unix specific removal.
+ (distclean): Likewise.
+ * tests/Makefile.msvc (clean): Drop Unix specific removal.
+ (distclean): Likewise.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ * m4/endian.m4 (CL_WORDS_LITTLEENDIAN): Use 3-argument AC_DEFINE.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ * m4/general.m4 (CL_CONFIG_SUBDIRS, CL_CANONICAL_HOST,
+ CL_CANONICAL_HOST_CPU, CL_CANONICAL_HOST_CPU_FOR_FFCALL): Remove
+ macros.
+ * m4/gettext.m4: Update from GNU gettext.
+ * m4/iconv.m4: Update from GNU gettext.
+ * m4/lcmessage.m4: Update from GNU gettext.
+ * m4/progtest.m4: Update from GNU gettext.
+ * m4/libtool.m4: Update from GNU gettext.
+ 2003-02-16 Bruno Haible <bruno@clisp.org>
+ Workaround autoconf >= 2.52 breakage.
+ * libtool.m4 (AC_LIBTOOL_ARG_WITH): New macro.
+ (_LT_AC_LTCONFIG_HACK, AC_PROG_LD): Use it.
+ * autoconf/ltmain.sh: Update from GNU gettext.
+ 2003-02-18 Bruno Haible <bruno@clisp.org>
+ Fix the 2002-09-16 fix.
+ * ltmain.sh (install): If "ln -s -f" fails (this is the case
+ with /usr/bin/ln on Solaris 2.7), fall back to "rm && ln -s".
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ Start using automake.
+ * configure.in: Add AM_INIT_AUTOMAKE invocation.
+ (PACKAGE, VERSION): Remove.
+ Use AC_CANONICAL_HOST instead of CL_CANONICAL_HOST.
+ Use AC_PROG_LN_S instead of CL_PROG_LN_S.
+ Use AC_PROG_RANLIB instead of CL_PROG_RANLIB.
+ Reorder so that AC_CANONICAL_HOST comes early but still after
+ AC_PROG_CC.
+ * m4/ranlib.m4: Remove file.
+ * m4/libtool.m4: Undo AC_ -> CL_ substitutions.
+ * Makefile.devel (CLISP_DIR): Comment out.
+ (AUTOCONF_FILES): Change to aclocal.m4.
+ (aclocal.m4): Renamed from autoconf/aclocal.m4. Update dependencies.
+ (configure.in): Drop --include option.
+
+2003-03-17 Bruno Haible <bruno@clisp.org>
+
+ Improved MSVC support.
+ * Makefile.msvc (prefix): Use less Unixy value.
+ (local_prefix): Remove variable.
+ (libdir, includedir, mandir): Use backslashes.
+ (bindir, datadir, localedir, docdir): New variables.
+ (INSTALL, INSTALL_PROGRAM, INSTALL_DATA): New variables.
+ (all): Recurse into po/ and man/.
+ (install, installdirs, uninstall): Rewritten.
+ (check, mostlyclean, clean, distclean, maintainer-clean): Recurse
+ into po/ and man/.
+ * lib/Makefile.msvc (prefix): Use less Unixy value.
+ (local_prefix): Remove variable.
+ (libdir): Use backslashes.
+ (bindir): New variable.
+ (INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Set to real values.
+ (RESOURCES): Enable iconv.res.
+ (install, installdirs, uninstall): New rules.
+ (clean): Remove config.h.
+ (distclean): Don't remove config.h here.
+ * src/Makefile.msvc (prefix, exec_prefix, bindir): New variables.
+ (INSTALL, INSTALL_PROGRAM, INSTALL_DATA): New variables.
+ (install, installdirs, uninstall): New rules.
+ * man/Makefile.msvc: New file.
+ * tests/Makefile.msvc (install, installdirs, uninstall): New rules.
+ * Makefile.devel (all): Depend on po/Makefile.msvc.
+ (po/Makefile.msvc): New rule.
+ * windows/iconv.rc: Update.
+ * README.woe32: Mention automatic installation command.
+
+ Rename libcharset.h to localcharset.h.
+ * lib/iconv.c: Include localcharset.h, not libcharset.h.
+ * Makefile.in (lib/localcharset.h): Renamed from lib/libcharset.h.
+ (all, install): Update dependencies.
+ (all): Create lib/localcharset.h, not lib/libcharset.h.
+ (mostlyclean, clean, distclean, maintainer-clean): Remove
+ lib/localcharset.h, not lib/libcharset.h.
+ * djgpp/README.in, djgpp/README: Update.
+ * djgpp/config.bat: Update.
+ * djgpp/config.sed: Update.
+ * djgpp/fnchange.in, djgpp/fnchange.lst: Update.
+
+2003-01-31 Bruno Haible <bruno@clisp.org>
+
+ * src/Makefile.in (all): Don't do the chmod if it has already been
+ done.
+
+2003-01-31 Bruno Haible <bruno@clisp.org>
+
+ * lib/loop_unicode.h (unicode_transliterate): Enable recursive
+ transliteration. Idea from Perry Rapp.
+ * lib/gentranslit.c (main): Change bound from 0x10000 to 0x110000.
+ Change element type of translit_data to 'unsigned int'.
+ * lib/translit.def: Many new transliterations, mostly taken from glibc.
+ * lib/translit.h: Regenerated.
+ * tests/Translit1.ISO-8859-1, tests/Translit1.ASCII: New files.
+ * tests/Makefile.in (check): Add Translit1 check.
+ * tests/Makefile.msvc (check): Likewise.
+ * tests/Makefile.os2 (check): Likewise.
+ * tests/TranslitFail1.ISO-8859-1: Choose a sentence which the new
+ improved transliteration cannot do.
+
+2003-02-14 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.devel (AUTOCONF): Switch to autoconf-2.57.
+ (configure): Update rule.
+
+2003-01-03 Albert Chin <libtool@thewrittenword.com>
+
+ * autoconf/ltmain.sh: Don't pass -R flags found in a .la's
+ dependency_libs variable directly down to the linker.
+ Reported by Tim Mooney <mooney@dogbert.cc.ndsu.nodak.edu>.
+
+2003-01-01 Bruno Haible <bruno@clisp.org>
+
+ * src/Makefile.in (install): Use libiconv.la in ../lib, not in
+ $(libdir), so that installing with DESTDIR works.
+ Reported by Michael Adams <michael@michaeladams.org>.
+
+2003-01-01 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.in (mkinstalldirs): New variable.
+ (install-lib, install, installdirs): Use it instead of mkdir.
+ * lib/Makefile.in (mkinstalldirs): New variable.
+ (install-lib, install, installdirs): Use it instead of mkdir.
+ * man/Makefile.in (mkinstalldirs): New variable.
+ (install, installdirs): Use it instead of mkdir.
+ * src/Makefile.in (mkinstalldirs): New variable.
+ (install, installdirs): Use it instead of mkdir.
+
+2002-09-27 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/mkinstalldirs: Upgrade to automake-1.7.2 version.
+
+2002-11-07 Bruno Haible <bruno@clisp.org>
+
+ * m4/libtool.m4: Upgrade to libtool-1.4.3.
+ * autoconf/ltmain.sh: Upgrade to libtool-1.4.3.
+
+2002-07-14 Bruno Haible <bruno@clisp.org>
+
+ * m4/libtool.m4 (_LT_AC_LTCONFIG_HACK): Add support for GNU/FreeBSD.
+
+2002-06-12 Bruno Haible <bruno@clisp.org>
+
+ * configure.in: Use new AC_* names of libtool macros. Invoke
+ AC_LIBTOOL_WIN32_DLL.
+
+2002-12-19 Bruno Haible <bruno@clisp.org>
+
+ * lib/Makefile.in (libiconv_plug_solaris.so): Change rule if using gcc.
+ Reported by Henry Nelson <henry@irm.nara.kindai.ac.jp>.
+
+2002-11-07 Bruno Haible <bruno@clisp.org>
+
+ Make "make install" without prior "make" work.
+ * Makefile.in (lib/libcharset.h): New rule.
+ (all, install): Depend on it.
+ Reported by Martin Mokrejš <mmokrejs@natur.cuni.cz>.
+
+2002-10-28 Bruno Haible <bruno@clisp.org>
+
+ * man/Makefile.in (install): Change directory back to the working
+ directory, so that install-sh (which may be a relative pathname) is
+ found in the right place.
+
+2002-09-16 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/ltmain.sh (install): Use "ln -s -f" instead of
+ "rm -f && ln -s" to make a symlink for a shared library.
+ Reported by Nelson H. F. Beebe <beebe@math.utah.edu>.
+
+2002-09-02 Bruno Haible <bruno@clisp.org>
+
+ * src/iconv.c (main): Don't call bindtextdomain if !ENABLE_NLS.
+
+2002-08-16 Bruno Haible <bruno@clisp.org>
+
+ * src/iconv.c (main): Perform fflush before testing ferror(stdout).
+
+2002-05-29 Bruno Haible <bruno@clisp.org>
+
+ * Version 1.8 released.
+
+2002-05-26 Bruno Haible <bruno@clisp.org>
+
+ * lib/c99.h: New file.
+ * lib/converters.h: Include it.
+ * lib/encodings.def (C99): New encoding.
+ * README, man/iconv_open.3: Document C99 encoding.
+
+2002-05-26 Bruno Haible <bruno@clisp.org>
+
+ * lib/java.h (java_mbtowc): Accept 12-byte sequences for non-BMP
+ characters.
+ (java_wctomb): Produce 12-byte sequences for non-BMP characters.
+
+2002-05-29 Bruno Haible <bruno@clisp.org>
+
+ Fix installation of iconv program when linked with a libintl that was
+ built against an earlier libiconv.
+ * src/iconv.c: Conditionally disable NLS.
+ * src/iconv_no_i18n.c: New file.
+ * src/Makefile.in (libdir): New variable.
+ (all): Depend on iconv_no_i18n, iconv.@OBJEXT@ but not iconv. Make
+ directory writable, so iconv executable can be created during "make
+ install".
+ (iconv): Remove rule.
+ (iconv_no_i18n, iconv_no_i18n.@OBJEXT@): New rules.
+ (install): Link iconv now, after the new libiconv.so is installed.
+ (clean): Also remove iconv_no_i18n.
+ * tests/Makefile.in: (check, check-extra-yes): Depend on iconv_no_i18n,
+ not iconv.
+ * tests/check-stateful: Use iconv_no_i18n, not iconv.
+ * tests/check-translit: LIkewise.
+ * tests/check-translitfailure: Likewise.
+
+2002-05-29 Bruno Haible <bruno@clisp.org>
+
+ * configure.in: Call AC_PROG_INSTALL instead of CL_PROG_INSTALL.
+ * m4/install.m4: Remove file.
+ * Makefile.devel (autoconf/aclocal.m4): Don't depend on m4/install.m4.
+
+2002-05-24 Bruno Haible <bruno@clisp.org>
+
+ * lib/jisx0213.h: Use 'inline' only conditionally.
+
+2002-05-18 Bruno Haible <bruno@clisp.org>
+
+ * configure.in (AC_INIT), include/iconv.h.in (_LIBICONV_VERSION),
+ README, windows/iconv.rc, djgpp/README, djgpp/fnchange.lst:
+ Bump version number.
+ * lib/Makefile.in (LIBICONV_VERSION_INFO): Define to 3:0:1.
+
+2002-02-06 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/ltmain.sh: Upgrade from libtool-1.4 to libtool-1.4.2.
+
+2002-02-02 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/ltmain.sh: Add DESTDIR support on ELF systems.
+
+2001-11-03 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/ltmain.sh: chmod 777 the .libs directory, so that
+ "make install" succeeds.
+
+2002-05-18 Bruno Haible <bruno@clisp.org>
+
+ * src/Makefile.in (iconv): Remove the -liconv dependency of -lintl
+ from the command line. Needed to ensure that the new libiconv version
+ is used on FreeBSD.
+
+2002-05-14 Bruno Haible <bruno@clisp.org>
+
+ Implement and document CP853, TDS565, RISCOS-LATIN1.
+ * tools/Makefile (ALL): Add cp853.h, tds565.h, riscos1.h.
+ (cp853.h, tds565.h, riscos1.h): New rules.
+ * lib/cp853.h: New file.
+ * lib/tds565.h: New file.
+ * lib/riscos1.h: New file.
+ * lib/converters.h: Include them.
+ * lib/encodings_dos.def (CP853): New encoding.
+ * lib/encodings_extra.def (TDS565, RISCOS-LATIN1): New encodings.
+ * README, man/iconv_open.3: Add CP853, TDS565, RISCOS-LATIN1.
+ * tests/Makefile.in (check-extra-yes): Check CP853, TDS565,
+ RISCOS-LATIN1.
+ * tests/Makefile.msvc (check): Check CP853.
+ * tests/CP853.TXT: New file.
+ * tests/TDS565.TXT: New file.
+ * tests/RISCOS-LATIN1.TXT: New file.
+
+ * lib/cp860.h (cp860_wctomb): Optimize.
+
+2002-05-12 Bruno Haible <bruno@clisp.org>
+
+ * tools/Makefile (ksc5601.h): Add two extra characters.
+ * lib/ksc5601.h: Regenerated.
+ * tests/EUC-KR.TXT: Add EURO SIGN and REGISTERED SIGN.
+ * tests/CP949.TXT: Likewise.
+ * tests/JOHAB.TXT: Likewise.
+
+2002-05-12 Bruno Haible <bruno@clisp.org>
+
+ * README: Mention extra encodings.
+ * man/iconv_open.3: Likewise. Improve formatting in text and html
+ output formats.
+
+2002-05-12 Bruno Haible <bruno@clisp.org>
+
+ * tests/SHIFT_JIS.TXT: Renamed from tests/SHIFT-JIS.TXT.
+
+2002-05-12 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.devel (AUTOCONF): New variable.
+ (AUTOCONF_FILES): Remove autoconf/autoconf.m4f.
+ (configure): Use the AUTOCONF variable.
+ * autoconf/autoconf: Remove file.
+ * autoconf/autoconf.m4: Remove file.
+ * autoconf/autoconf.m4f: Remove file.
+
+2002-05-12 Bruno Haible <bruno@clisp.org>
+
+ * tools/JISX0213.TXT: New file.
+ * tools/cjk_tab_to_h.c (do_jisx0213): New function.
+ (main): Accept "jisx0213".
+ * tools/Makefile (all): Add jisx0213.h.
+ (jisx0213.h): New rule.
+ * lib/jisx0213.h: New file, generated by cjk_tab_to_h.
+ * lib/euc_jisx0213.h: New file.
+ * lib/shift_jisx0213.h: New file.
+ * lib/iso2022_jp3.h: New file.
+ * lib/converters.h: Include them.
+ * lib/encodings_extra.def (EUC-JISX0213, SHIFT_JISX0213,
+ ISO-2022-JP-3): New encodings.
+ * tests/EUC-JISX0213.TXT: New file.
+ * tests/SHIFT_JISX0213.TXT: New file.
+ * tests/ISO-2022-JP-3-snippet: New file.
+ * tests/ISO-2022-JP-3-snippet.UTF-8: New file.
+ * tests/Makefile.in (check-extra): Also check EUC-JISX0213,
+ SHIFT_JISX0213, ISO-2022-JP-3.
+ * tests/check-stateless: Add support for encodings which contain
+ precomposed Unicode characters, by eliminating precomposed characters
+ before the comparison.
+ * tests/table-from.c (main): Fix usage message.
+ * tests/table-to.c (main): Make it work for encodings for which the
+ "to" direction is stateful.
+
+2002-05-09 Bruno Haible <bruno@clisp.org>
+
+ New configure option --enable-extra-encodings.
+ * lib/encodings_extra.def: New file.
+ * lib/converters.h: Handle USE_EXTRA.
+ * lib/genaliases2.c (main): Handle USE_EXTRA.
+ * lib/genflags.c: Define USE_EXTRA.
+ (main): Include encodings_extra.def.
+ * lib/iconv.c: Handle ENABLE_EXTRA, conditionally set USE_EXTRA.
+ Handle USE_EXTRA.
+ * lib/config.h.in (ENABLE_EXTRA): New macro.
+ * configure.in: Accept option --enable-extra-encodings.
+ * Makefile.devel (all): Depend on lib/aliases_extra.h.
+ (lib/aliases_extra.h): New rule.
+ (lib/flags.h): Depend on lib/encodings_extra.def.
+ * tests/Makefile.in (check-extra, check-extra-no, check-extra-yes):
+ New rules.
+ (check): Invoke check-extra.
+ * tests/Makefile.msvc (check): Also check the DOS encodings.
+
+ Support for testing the AIX encodings.
+ * tests/CP856.TXT: New file.
+ * tests/CP922.TXT: New file.
+ * tests/CP1046.TXT: New file.
+ * tests/CP1124.TXT: New file.
+ * tests/CP1129.TXT: New file.
+ * tests/CP1161.TXT, tests/CP1161.IRREVERSIBLE.TXT: New files.
+ * tests/CP1162.TXT: New file.
+ * tests/CP1163.TXT, tests/CP1163.IRREVERSIBLE.TXT: New files.
+
+ Support for testing the OSF/1 encodings.
+ * tests/DEC-KANJI.TXT: New file.
+ * tests/DEC-HANYU.TXT, tests/DEC-HANYU.IRREVERSIBLE.TXT: New files.
+
+ Support for testing the DOS encodings.
+ * tests/CP437.TXT: New file.
+ * tests/CP737.TXT: New file.
+ * tests/CP775.TXT: New file.
+ * tests/CP852.TXT: New file.
+ * tests/CP855.TXT: New file.
+ * tests/CP857.TXT: New file.
+ * tests/CP858.TXT: New file.
+ * tests/CP860.TXT: New file.
+ * tests/CP861.TXT: New file.
+ * tests/CP863.TXT: New file.
+ * tests/CP864.TXT: New file.
+ * tests/CP865.TXT: New file.
+ * tests/CP869.TXT: New file.
+ * tests/CP1125.TXT: New file.
+
+2002-05-09 Bruno Haible <bruno@clisp.org>
+
+ Implement more ASCII compatible DOS encodings.
+ * tools/Makefile (ALL): Add cp737.h, cp858.h, cp860.h, cp863.h.
+ (cp737.h, cp858.h, cp860.h, cp863.h): New rules.
+ * lib/cp737.h: New file.
+ * lib/cp858.h: New file.
+ * lib/cp860.h: New file.
+ * lib/cp863.h: New file.
+ * lib/converters.h: Include them.
+ * lib/encodings_dos.def (CP737, CP858, CP860, CP863): New encodings.
+
+2002-05-09 Bruno Haible <bruno@clisp.org>
+
+ Implement new ASCII compatible encodings from IBM.
+ * tools/Makefile (ALL): Add cp1161.h, cp1162.h, cp1163.h.
+ (cp1161.h, cp1162.h, cp1163.h): New rules.
+ * lib/cp1161.h: New file.
+ * lib/cp1162.h: New file.
+ * lib/cp1163.h: New file.
+ * lib/converters.h: Include them.
+ * lib/encodings_aix.def (CP1161, CP1162, CP1163): New encodings.
+
+2002-05-09 Bruno Haible <bruno@clisp.org>
+
+ Implement and document KOI8-T.
+ * tools/Makefile (ALL): Add koi8_t.h.
+ (koi8_t.h): New rule.
+ * lib/koi8_t.h: New file.
+ * lib/converters.h: Include it.
+ * lib/encodings.def (KOI8-T): New encoding.
+ * README, man/iconv_open.3: Add KOI8-T.
+ * tests/Makefile.in (tests): Check KOI8-T.
+ * tests/Makefile.os2 (tests): Likewise.
+ * tests/Makefile.msvc (tests): Likewise.
+ * tests/KOI8-T.TXT: New file.
+
+2002-05-09 Bruno Haible <bruno@clisp.org>
+
+ * tools/8bit_tab_to_h.c (main): Update copyright year.
+ * tools/cjk_variants.c (main): Likewise.
+
+2002-05-08 Bruno Haible <bruno@clisp.org>
+
+ * README.woe32: Renamed from README.win32.
+
+2002-05-08 Bruno Haible <bruno@clisp.org>
+
+ * lib/iconv.c: Enable DOS encodings also when compiling for Woe32,
+ because the Woe32 consoles use them.
+
+2002-05-04 Bruno Haible <bruno@clisp.org>
+
+ * lib/loop_unicode.h (unicode_loop_convert): When quitting the loop
+ without writing an output character, restore cd->istate to its value
+ before the xxx_mbtowc call. Otherwise we lose some characters during
+ CP1255/CP1258/TCVN to Unicode conversion.
+ (unicode_loop_reset): Likewise for the xxx_flushwc call.
+ * tests/CP1255-snippet, tests/CP1255-snippet.UTF-8: Make the test
+ files large enough to test against the bug.
+ * tests/CP1258-snippet, tests/CP1258-snippet.UTF-8: Likewise.
+ * tests/TCVN-snippet, tests/TCVN-snippet.UTF-8: Likewise.
+
+2002-04-28 Bruno Haible <bruno@clisp.org>
+
+ * tools/Makefile (armscii_8.h): Use table from glibc-2.2.90.
+ * tests/ARMSCII-8.TXT: Update to glibc-2.2.90 version.
+ * tests/ARMSCII-8.IRREVERSIBLE.TXT: Remove 0x0027.
+ * lib/armscii_8.h: Regenerated.
+
+2002-04-28 Bruno Haible <bruno@clisp.org>
+
+ * src/iconv.c: Include gettext.h.
+ (_): New macro.
+ (usage, print_version, convert, main): Internationalize.
+ (main): Call setlocale, bindtextdomain, textdomain.
+ * src/gettext.h: New file, from GNU gettext 0.11.2.
+ * src/config.h.in: New file, needed for ENABLE_NLS.
+ * src/Makefile.in (datadir, localedir): New variables.
+ (iconv): Link with @LTLIBINTL@.
+ (iconv.@OBJEXT@): Define LOCALEDIR.
+ (distclean): Remove config.h.
+ * po: New directory.
+ * Makefile.in (all, install, installdirs, uninstall, check,
+ mostlyclean, clean, distclean, maintainer-clean): Recurse into the po
+ directory.
+ * autoconf/mkinstalldirs: New file, from automake-1.5.
+ * ABOUT-NLS: New file, from GNU gettext 0.11.2.
+ * m4/codeset.m4: New file, from GNU gettext 0.11.2.
+ * m4/gettext.m4: New file, from GNU gettext 0.11.2.
+ * m4/glibc21.m4: New file, from GNU gettext 0.11.2.
+ * m4/isc-posix.m4: New file, from GNU gettext 0.11.2.
+ * m4/lcmessage.m4: New file, from GNU gettext 0.11.2.
+ * m4/progtest.m4: New file, from GNU gettext 0.11.2.
+ * configure.in: Require autoconf-2.52, needed for multiple config.h.in
+ files. Use new form of AC_INIT. Invoke AM_GNU_GETTEXT.
+ (PACKAGE, VERSION): Define, needed for po/Makefile.in.in.
+ * lib/config.h.in (HAVE_LOCALE_H, HAVE_SETLOCALE): Remove.
+
+2002-04-28 gettextize <bug-gnu-gettext@gnu.org>
+
+ * configure.in (AC_OUTPUT): Add po/Makefile.in.
+
+2002-04-28 Bruno Haible <bruno@clisp.org>
+
+ * m4/eilseq.m4: Renamed from autoconf/eilseq.m4.
+ * m4/mbstate_t.m4: Renamed from autoconf/mbstate_t.m4.
+ * m4/general.m4: New file, from GNU clisp.
+ * m4/proto.m4: New file, from GNU clisp.
+ * m4/ranlib.m4: New file, from GNU clisp.
+ * m4/install.m4: New file, from GNU clisp.
+ * m4/cp.m4: New file, from GNU clisp.
+ * m4/ln.m4: New file, from GNU clisp.
+ * m4/endian.m4: New file, from GNU clisp.
+ * m4/iconv.m4: New file, from GNU gettext 0.11.2.
+ * m4/lib-ld.m4: New file, from GNU gettext 0.11.2.
+ * m4/lib-link.m4: New file, from GNU gettext 0.11.2.
+ * m4/lib-prefix.m4: New file, from GNU gettext 0.11.2.
+ * autoconf/config.rpath: New file, from GNU gettext 0.11.2.
+ * m4/libtool.m4: New file, based on libtool-1.4.2.
+ * Makefile.devel (ACLOCAL): Remove variable.
+ (ACSELECT): Remove variable.
+ (OTHERMACROS): Remove variable.
+ (m4/*.m4): New rules.
+ (autoconf/aclocal.m4): Construct using aclocal instead of acselect.
+ * configure.in: Invoke AM_ICONV instead of CL_ICONV.
+
+2002-04-06 Bruno Haible <bruno@clisp.org>
+
+ Upgrade to Unicode 3.2.
+ * tools/cjk_tab_to_h.c (output_title): Bump copyright year.
+ (compact_large_charset2uni): Add an argument. Determine optimal shift.
+ Copy modified enc->charset2uni table.
+ (output_charset2uni): Deal with shift other than 8. Copy encoding, so
+ as to not disturb subsequent output_uni2charset[_sparse] call.
+ * lib/hkscs.h: Regenerated.
+ * tests/BIG5-HKSCS.TXT: Update.
+ * tests/BIG5-HKSCS.IRREVERSIBLE.TXT: Update.
+
+2002-04-06 Bruno Haible <bruno@clisp.org>
+
+ Upgrade to Unicode 3.2.
+ * tools/Makefile (cns11643_1.h, cns11643_2.h, cns11643_3.h,
+ cns11643_4a.h, cns11643_4b.h, cns11643_5.h, cns11643_6.h,
+ cns11643_7.h, cns11643_15.h, cns11643_inv.h): Use
+ CNS11643-Unicode32.TXT instead of CNS11643-Unicode31.TXT.
+ * lib/cns11643_3.h: Regenerated.
+ * lib/cns11643_4a.h: Regenerated.
+ * lib/cns11643_4b.h: Regenerated.
+ * lib/cns11643_5.h: Regenerated.
+ * lib/cns11643_6.h: Regenerated.
+ * lib/cns11643_7.h: Regenerated.
+ * lib/cns11643_15.h: Regenerated.
+ * lib/cns11643_inv.h: Regenerated.
+ * tests/EUC-TW.TXT: Update.
+
+2002-01-17 Bruno Haible <bruno@clisp.org>
+
+ * lib/tcvn.h (tcvn_2uni_1): Make it smaller.
+ (tcvn_mbtowc): Small optimization.
+
+2002-01-13 Bruno Haible <bruno@clisp.org>
+
+ New options -l, -c, -s.
+ * src/iconv.c (discard_unconvertible, silent): New variables.
+ (usage): Document options -l, -c, -s.
+ (print_one): New function.
+ (convert): If silent is true, don't print error messages about the
+ conversion to stderr. If discard_unconvertible is true, set the
+ iconv descriptor to DISCARD_ILSEQ the first time, but make sure to
+ return the same return code as when discard_unconvertible is false.
+ (main): Accept options -l, -c, -s. Implement option -l.
+ * man/iconv.1: Document options -l, -c, -s.
+
+2002-01-13 Bruno Haible <bruno@clisp.org>
+
+ Support for "iconv -c".
+ * include/iconv.h.in (ICONV_GET_DISCARD_ILSEQ): New macro.
+ (ICONV_SET_DISCARD_ILSEQ): Likewise.
+ * lib/converters.h (struct conv_struct): New field discard_ilseq.
+ * lib/iconv.c (iconv_open): Set discard_ilseq to true if tocode
+ has an "//IGNORE" suffix, and to false otherwise.
+ (iconvctl): Implement ICONV_GET_DISCARD_ILSEQ, ICONV_SET_DISCARD_ILSEQ.
+ * lib/loop_unicode.h (unicode_loop_convert): If discard_ilseq is
+ true, skip one input character instead of returning EILSEQ.
+ (unicode_loop_reset): Likewise.
+ * lib/loop_wchar.h (wchar_from_loop_convert): Likewise.
+ (wchar_to_loop_convert): Likewise.
+
+2002-01-13 Bruno Haible <bruno@clisp.org>
+
+ Support for "iconv -l".
+ * include/iconv.h.in (iconvlist): New declaration.
+ * Makefile.devel (lib/aliases.h): Change gperf options.
+ * lib/iconv.c (compare_by_index, compare_by_name, iconvlist): New
+ functions.
+
+2002-01-06 Bruno Haible <bruno@clisp.org>
+
+ * lib/loop_unicode.h (unicode_transliterate): If the transliteration
+ fails due to limited output encoding, return RET_ILUNI, not
+ RET_TOOSMALL. Reported by Nelson H. F. Beebe <beebe@math.utah.edu>.
+ * tests/check-translitfailure: New file.
+ * tests/TranslitFail1.ISO-8859-1: New file.
+ * tests/Makefile.in (check): Call check-translitfailure.
+
+2001-12-15 Bruno Haible <bruno@clisp.org>
+
+ * lib/euc_jp.h (euc_jp_wctomb): Add irreversible mappings for
+ Shift_JIS characters 0x5C and 0x7E.
+ * tests/EUC-JP.IRREVERSIBLE.TXT: New file.
+
+2001-12-05 Bruno Haible <bruno@clisp.org>
+
+ * lib/iconv.c (iconv_open): Recognize the empty encoding name. Avoid
+ endless loop if locale_charset() returns the empty string.
+ * README, man/iconv_open.3: Add the empty encoding name.
+
+2001-11-10 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/Makefile.in (libiconv_plug_linux.so): Allow building it with a
+ non-gcc compiler.
+
+2001-10-23 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/Makefile (cp1125.h): New target.
+ (ALL): Add it.
+ * lib/cp1125.h: New file.
+ * lib/converters.h: Include it.
+ * lib/encodings_dos.def (CP1125): New encoding.
+
+2001-09-08 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/eilseq.m4: New file.
+ * Makefile.devel (OTHERMACROS): Add it.
+ * configure.in: Call AC_EILSEQ.
+ * include/iconv.h.in (EILSEQ): Define to the autoconf determined value.
+
+2001-08-25 Bruno Haible <haible@clisp.cons.org>
+
+ Upgrade to autoconf-2.52.
+ * autoconf/autoconf: Upgrade to autoconf-2.52.
+ * autoconf/acgeneral.m4: Remove file.
+ * autoconf/acspecific.m4: Remove file.
+ * autoconf/autoconf.m4f: New file, from autoconf-2.52.
+ * autoconf/aclocal.m4: Require autoconf-2.52.
+ (CL_CANONICAL_HOST): Call AC_CANONICAL_HOST. Don't cache the result,
+ AC_CANONICAL_HOST does it itself. Add $SHELL in front of
+ $ac_config_guess and $ac_config_sub.
+ * Makefile.devel (AUTOCONF_FILES): Remove acgeneral.m4, acspecific.m4.
+ Add autoconf.m4f.
+ (configure): Use autoconf options -A, -l instead of -m.
+ * configure.in: Use AC_CONFIG_SUBDIRS, not AC_OUTPUT_SUBDIRS.
+
+2001-08-05 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/acgeneral.m4 (AC_MSG_RESULTPROTO): Remove macro.
+ (AC_LANG_EXTERN): Move to aclocal.m4.
+ * autoconf/aclocal.m4 (AC_LANG_EXTERN): Moved here from acgeneral.m4.
+ (CL_PROTO): Use AC_MSG_RESULT directly, instead of AC_MSG_RESULTPROTO.
+ (CL_SILENT): No need to pushdef AC_MSG_RESULTPROTO.
+
+2001-08-05 Bruno Haible <haible@clisp.cons.org>
+
+ Make it possible to build libiconv with CC=gcc CFLAGS="-x c++".
+ * lib/loop_wchar.h (wchar_to_loop_convert): Rename local variable
+ 'try' to 'incount'.
+ * lib/Makefile.in (libiconv_plug_linux.so): Add "-x none" option
+ between sources and libs.
+ (libiconv_plug_solaris.so) [GCC]: Likewise.
+ (libiconv_plug_osf.so) [GCC]: Likewise.
+ * src/Makefile.in (iconv.@OBJEXT@): New rule.
+ (iconv): Depend on it.
+ (clean): Erase *.@OBJEXT@, not *.o.
+ * tests/Makefile.in (table-from.@OBJEXT@): New rule.
+ (table-from): Depend on it.
+ (table-to.@OBJEXT@): New rule.
+ (table-to): Depend on it.
+ (clean): Erase *.@OBJEXT@, not *.o.
+
+2001-07-28 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/Makefile (iso8859_16.h): Generate from the unicode.org table.
+ * lib/iso8859_16.h: Regenerated.
+ * tests/ISO-8859-16.TXT: Swap the values of 0xA5 and 0xAB.
+
+2001-07-17 Bruno Haible <haible@clisp.cons.org>
+
+ * configure.in (VERSION): Define. Needed by djgpp/Makefile.maint.
+
+2001-07-03 Bruno Haible <haible@clisp.cons.org>
+
+ * configure.in: Also check for mbsinit.
+ * lib/loop_wchar.h (mbsinit): Define to 1 if not defined.
+ Needed for SCO 3.2v5.0.2.
+
+2001-06-27 Bruno Haible <haible@clisp.cons.org>
+
+ * Version 1.7 released.
+
+2001-06-27 Bruno Haible <haible@clisp.cons.org>
+
+ * INSTALL.generic (Particular Systems): Generalize section about
+ /usr/local to "most systems".
+
+ * lib/Makefile.in (all): Build @PLUGLIB@ before libiconv.la, because
+ Solaris cc destroys iconv.o and iconv.lo while building
+ libiconv_plug_solaris.so.
+ (clean): Remove so_locations, left there by the OSF/1 linker.
+
+ * lib/cp1255.h (cp1255_decomp): Use 'signed int' instead of 'int'.
+
+ * lib/vietcomb.h (viet_decomp): Use 'unsigned int' instead of
+ 'unsigned short'.
+
+ * tests/table-from.c: Include string.h.
+ * tests/table-to.c: Likewise.
+
+2001-06-26 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/Makefile (jisx0208.h): Replace U+005C with U+FF3C.
+ (jisx0212.h): Replace U+007E with U+FF5E.
+ * lib/jisx0208.h: Regenerated.
+ * lib/jisx0212.h: Regenerated.
+ * tests/EUC-JP.TXT: Map 0xA1C0 to U+FF3C. Map 0x8FA2B7 to U+FF5E.
+ * tests/EUC-JP.IRREVERSIBLE.TXT: Remove file.
+ * tests/SHIFT-JIS.TXT: Map 0x815F to U+FF3C.
+ * tests/CP932.TXT: Likewise.
+ * tests/CP932.IRREVERSIBLE.TXT: 0x815F mapping is now reversible.
+
+2001-06-25 Bruno Haible <haible@clisp.cons.org>
+
+ * src/Makefile.in (iconv): Mention $(INCLUDES) before $(CFLAGS) and
+ $(CPPFLAGS).
+ * src/Makefile.msvc (iconv.exe): Likewise.
+ * src/Makefile.os2 (iconv.exe): Likewise.
+ * lib/Makefile.in (libiconv_plug_linux.so): Likewise.
+ (libiconv_plug_solaris.so): Likewise.
+ (libiconv_plug_osf.so): Likewise.
+ (iconv.lo): Likewise.
+ * lib/Makefile.msvc (iconv.obj): Likewise.
+ * lib/Makefile.os2 (iconv.obj): Likewise.
+ * tests/Makefile.in (table-from, table-to): Likewise.
+ * tests/Makefile.msvc (table-from.exe, table-to.exe): Likewise.
+ * tests/Makefile.os2 (table-from.exe, table-to.exe): Likewise.
+ (genutf8.exe): Don't use $(INCLUDES).
+
+2001-06-25 Bruno Haible <haible@clisp.cons.org>
+
+ * include/iconv.h.in (_LIBICONV_VERSION), README, windows/iconv.rc:
+ Bump version number.
+ * lib/Makefile.in (LIBICONV_VERSION_INFO): Define to 2:4:0.
+
+2001-06-25 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.devel (OTHERMACROS): Use libtool.m4 in libcharset subdir.
+
+2001-06-25 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/encodings.def: Make SHIFT_JIS the primary name of SJIS.
+
+2001-06-08 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/ltmain.sh: Upgrade to libtool-1.4.
+ * autoconf/ltconfig: Remove file.
+
+2001-06-08 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/config.guess: Update to GNU version 2001-05-11.
+ * autoconf/config.sub: Likewise.
+
+2001-06-03 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/loop_unicode.h (unicode_loop_convert): Ignore Unicode 3.1 tag
+ characters if they cannot be converted.
+ (unicode_loop_reset): Likewise.
+ * lib/iso2022_jp2.h (STATE_TAG_NONE, STATE_TAG_LANGUAGE,
+ STATE_TAG_LANGUAGE_j, STATE_TAG_LANGUAGE_ja, STATE_TAG_LANGUAGE_k,
+ STATE_TAG_LANGUAGE_ko, STATE_TAG_LANGUAGE_z, STATE_TAG_LANGUAGE_zh):
+ New macros.
+ (SPLIT_STATE, COMBINE_STATE): Different differently for wctomb
+ direction.
+ (iso2022_jp2_wctomb): Keep track of Unicode 3.1 language tag.
+ If "ja", prefer conversion to Japanese character sets. If "zh",
+ prefer conversion to GB2312. If "ko", prefer conversion to KSC5601.
+
+ * lib/converters.h (RET_ILUNI): Change value from 0 to -1.
+ (RET_TOOSMALL): Change value from -1 to -2.
+ * lib/loop_unicode.h (unicode_transliterate): Allow xxx_wctomb to
+ return 0 written bytes.
+
+2001-06-06 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/encodings.def: Align with IANA character-set registry.
+ (US-ASCII): Add alias "ANSI_X3.4-1986".
+ (ISO-8859-14): Add alias "ISO-CELTIC".
+ (JIS_X0208): Add alias "JIS_C6226-1983".
+ (BIG5HKSCS): Add alias "BIG5-HKSCS".
+ * README, man/iconv_open.3: Rename BIG5HKSCS to BIG5-HKSCS.
+ * tests/Makefile.in (check): Likewise.
+ * tests/Makefile.os2 (check): Likewise.
+ * tests/Makefile.msvc (check): Likewise.
+ * tests/BIG5-HKSCS.TXT: Renamed from BIG5HKSCS.TXT.
+ * tests/BIG5-HKSCS.IRREVERSIBLE.TXT: Renamed from
+ BIG5HKSCS.IRREVERSIBLE.TXT.
+
+2001-06-02 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/cjk_tab_to_h.c (Encoding): Add fffd field.
+ (is_charset2uni_large, compact_large_charset2uni): New functions.
+ (find_charset2uni_pages): Use enc->fffd instead of 0xfffd.
+ (output_charset2uni): If mapping to more than the Unicode BMP,
+ use an extra indirection to keep each value in 16 bits.
+ (invert): Bump limit from U+10000 to U+30000.
+ (output_uni2charset_dense): Likewise.
+ (output_uni2charset_sparse): Likewise. If mapping to more than one
+ CJK plane, use three bytes per value instead of two bytes.
+ (byte_row_cns11643): Allow more than 3 CJK planes.
+ (do_cns11643_only_uni2charset): Increase number of rows, to include
+ plane 15. Remove plane bits hack.
+ (main): Accept names cns11643_4a,4b,5,6,7,15 as well.
+ * tools/Makefile (ALL): Add cns11643_4a.h, cns11643_4b.h, cns11643_5.h,
+ cns11643_6.h, cns11643_7.h, cns11643_15.h.
+ (cns11643_1.h, cns11643_2.h, cns11643_3.h): Use new Unicode 3.1
+ derived table.
+ (cns11643_4a.h, cns11643_4b.h, cns11643_5.h, cns11643_6.h,
+ cns11643_7.h, cns11643_15.h): New rules.
+ (cns11643_inv.h): Change title.
+ * lib/cns11643_1.h: Regenerated from Unicode 3.1 derived table.
+ * lib/cns11643_3.h: Likewise.
+ * lib/cns11643_4a.h: New file.
+ * lib/cns11643_4b.h: New file.
+ * lib/cns11643_4.h: New file.
+ * lib/cns11643_5.h: New file.
+ * lib/cns11643_6.h: New file.
+ * lib/cns11643_7.h: New file.
+ * lib/cns11643_15.h: New file.
+ * lib/cns11643_inv.h: Regenerated from Unicode 3.1 derived table.
+ (cns11643_inv_wctomb): Return 3 bytes now.
+ * lib/cns11643.h: Include cns11643_4.h, cns11643_5.h, cns11643_6.h,
+ cns11643_7.h, cns11643_15.h.
+ (cns11643_wctomb): Now a simple alias to cns11643_inv_wctomb. Return
+ plane number starting at 1, not 0.
+ * lib/dec_hanyu.h (dec_hanyu_wctomb): Update for cns11643_wctomb
+ change.
+ * lib/euc_tw.h (euc_tw_mbtowc): Accept CNS11643 planes 4,5,6,7,15 as
+ well.
+ (euc_tw_wctomb): Update for cns11643_wctomb change.
+ * lib/iso2022_cn.h (iso2022_cn_wctomb): Likewise.
+ * lib/iso2022_cnext.h (iso2022_cn_ext_mbtowc): Accept CNS11643 planes
+ 4,5,6,7 as well.
+ (iso2022_cn_ext_wctomb): Update for cns11643_wctomb change.
+ Try CNS11643 planes 4,5,6,7 as well.
+ * tests/EUC-TW.TXT: Many additions, mostly in planes 3,4,5,6,7,15.
+ * tests/EUC-TW.IRREVERSIBLE.TXT: Reflect additions to CNS11643 plane 1.
+ Add U+5344.
+
+2001-06-01 Bruno Haible <haible@clisp.cons.org>
+
+ * tests/table-from.c (bmp_only): New variable.
+ (ucs4_decode): If bmp_only, don't return characters outside Unicode
+ plane 0.
+ (main): When testing UTF-8 or GB18030, set bmp_only to 1. Don't print
+ a conversion line if ucs4_decode returns NULL.
+ * tests/table-to.c (main): When testing encodings other than UTF-8 and
+ GB18030, loop upto U+30000 instead of U+10000.
+
+2001-05-24 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/converters.h (mbtowc_funcs): Add flushwc member function.
+ * lib/flushwc.h: New file.
+ * lib/cp1255.h: Include flushwc.h.
+ (cp1255_comp_table_data, cp1255_comp_table): New arrays.
+ (cp1255_mbtowc): Compose base and combining characters.
+ (cp1255_flushwc): New macro.
+ * lib/vietcomb.h (viet_comp_table_data, viet_comp_table): New arrays.
+ * lib/cp1258.h: Include flushwc.h.
+ (cp1258_mbtowc): Compose base and combining characters.
+ (cp1258_flushwc): New macro.
+ * lib/tcvn.h: Include flushwc.h.
+ (tcvn_mbtowc): Compose base and combining characters.
+ (tcvn_flushwc): New macro.
+ * lib/loop_unicode.h: (unicode_transliterate): New function, extracted
+ from unicode_loop_convert.
+ (unicode_loop_convert): Use unicode_transliterate.
+ (unicode_loop_reset): Call xxx_flushwc and output the resulting
+ character.
+ * lib/encodings.def: Add xxx_flushwc member.
+ * lib/encodings_aix.def: Likewise.
+ * lib/encodings_dos.def: Likewise.
+ * lib/encodings_local.def: Likewise.
+ * lib/encodings_osf1.def: Likewise.
+ * lib/genaliases.c: Add an argument to the DEFENCODING macro.
+ * lib/genaliases2.c: Likewise.
+ * lib/genflags.c: Likewise.
+ * lib/iconv.c: Likewise.
+ * tests/table-from.c (try): Reset the iconv descriptor before the main
+ call, and flush it afterwards.
+ (ucs4_decode): New function.
+ (main): Allow up to 3 Unicode characters output. Call ucs4_decode.
+ * tests/CP1255-snippet: New file.
+ * tests/CP1255-snippet.UTF-8: New file.
+ * tests/CP1258-snippet: New file.
+ * tests/CP1258-snippet.UTF-8: New file.
+ * tests/TCVN-snippet: New file.
+ * tests/TCVN-snippet.UTF-8: New file.
+ * tests/Makefile.in (check): Check combining behaviour of CP1255,
+ CP1258, TCVN.
+ * tests/Makefile.msvc (check): Likewise.
+ * tests/Makefile.os2 (check): Likewise.
+
+2001-05-22 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/converters.h (RET_ILUNI): New macro.
+ (RET_ILSEQ): Change value to -1.
+ (RET_TOOFEW): Change value.
+ * lib/loop_unicode.h (unicode_loop_convert): Write RET_ILUNI instead
+ of 0. Update handling of xxx_mbtowc return value.
+ * lib/genflags.c (emit_encoding): Likewise.
+ * lib/ascii.h (ascii_wctomb): Use RET_ILUNI instead of RET_ILSEQ.
+ * lib/armscii_8.h (armscii_8_wctomb): Likewise.
+ * lib/big5.h (big5_wctomb): Likewise.
+ * lib/big5hkscs.h (big5hkscs_wctomb): Likewise.
+ * lib/ces_big5.h (ces_big5_wctomb): Likewise.
+ * lib/ces_gbk.h (ces_gbk_wctomb): Likewise.
+ * lib/cns11643.h (cns11643_wctomb): Likewise.
+ * lib/cns11643_inv.h (cns11643_inv_wctomb): Likewise.
+ * lib/cp437.h (cp437_wctomb): Likewise.
+ * lib/cp775.h (cp775_wctomb): Likewise.
+ * lib/cp850.h (cp850_wctomb): Likewise.
+ * lib/cp852.h (cp852_wctomb): Likewise.
+ * lib/cp855.h (cp855_wctomb): Likewise.
+ * lib/cp856.h (cp856_wctomb): Likewise.
+ * lib/cp857.h (cp857_wctomb): Likewise.
+ * lib/cp861.h (cp861_wctomb): Likewise.
+ * lib/cp862.h (cp862_wctomb): Likewise.
+ * lib/cp864.h (cp864_wctomb): Likewise.
+ * lib/cp865.h (cp865_wctomb): Likewise.
+ * lib/cp866.h (cp866_wctomb): Likewise.
+ * lib/cp869.h (cp869_wctomb): Likewise.
+ * lib/cp874.h (cp874_wctomb): Likewise.
+ * lib/cp922.h (cp922_wctomb): Likewise.
+ * lib/cp932ext.h (cp932ext_wctomb): Likewise.
+ * lib/cp932.h (cp932_wctomb): Likewise.
+ * lib/cp936ext.h (cp936ext_wctomb): Likewise.
+ * lib/cp949.h (cp949_wctomb): Likewise.
+ * lib/cp950ext.h (cp950ext_wctomb): Likewise.
+ * lib/cp950.h (cp950_wctomb): Likewise.
+ * lib/cp1046.h (cp1046_wctomb): Likewise.
+ * lib/cp1124.h (cp1124_wctomb): Likewise.
+ * lib/cp1129.h (cp1129_wctomb): Likewise.
+ * lib/cp1133.h (cp1133_wctomb): Likewise.
+ * lib/cp1250.h (cp1250_wctomb): Likewise.
+ * lib/cp1251.h (cp1251_wctomb): Likewise.
+ * lib/cp1252.h (cp1252_wctomb): Likewise.
+ * lib/cp1253.h (cp1253_wctomb): Likewise.
+ * lib/cp1254.h (cp1254_wctomb): Likewise.
+ * lib/cp1255.h (cp1255_wctomb): Likewise.
+ * lib/cp1256.h (cp1256_wctomb): Likewise.
+ * lib/cp1257.h (cp1257_wctomb): Likewise.
+ * lib/cp1258.h (cp1258_wctomb): Likewise.
+ * lib/dec_hanyu.h (dec_hanyu_wctomb): Likewise.
+ * lib/dec_kanji.h (dec_kanji_wctomb): Likewise.
+ * lib/euc_cn.h (euc_cn_wctomb): Likewise.
+ * lib/euc_jp.h (euc_jp_wctomb): Likewise.
+ * lib/euc_kr.h (euc_kr_wctomb): Likewise.
+ * lib/euc_tw.h (euc_tw_wctomb): Likewise.
+ * lib/gb12345ext.h (gb12345ext_wctomb): Likewise.
+ * lib/gb12345.h (gb12345_wctomb): Likewise.
+ * lib/gb18030ext.h (gb18030ext_wctomb): Likewise.
+ * lib/gb18030.h (gb18030_wctomb): Likewise.
+ * lib/gb18030uni.h (gb18030uni_wctomb): Likewise.
+ * lib/gb2312.h (gb2312_wctomb): Likewise.
+ * lib/gbkext_inv.h (gbkext_inv_wctomb): Likewise.
+ * lib/gbk.h (gbk_wctomb): Likewise.
+ * lib/georgian_academy.h (georgian_academy_wctomb): Likewise.
+ * lib/georgian_ps.h (georgian_ps_wctomb): Likewise.
+ * lib/hkscs.h (hkscs_wctomb): Likewise.
+ * lib/hp_roman8.h (hp_roman8_wctomb): Likewise.
+ * lib/hz.h (hz_wctomb): Likewise.
+ * lib/iso2022_cnext.h (iso2022_cn_ext_wctomb): Likewise.
+ * lib/iso2022_cn.h (iso2022_cn_wctomb): Likewise.
+ * lib/iso2022_jp1.h (iso2022_jp1_wctomb): Likewise.
+ * lib/iso2022_jp2.h (iso2022_jp2_wctomb): Likewise.
+ * lib/iso2022_jp.h (iso2022_jp_wctomb): Likewise.
+ * lib/iso2022_kr.h (iso2022_kr_wctomb): Likewise.
+ * lib/iso646_cn.h (iso646_cn_wctomb): Likewise.
+ * lib/iso646_jp.h (iso646_jp_wctomb): Likewise.
+ * lib/iso8859_1.h (iso8859_1_wctomb): Likewise.
+ * lib/iso8859_2.h (iso8859_2_wctomb): Likewise.
+ * lib/iso8859_3.h (iso8859_3_wctomb): Likewise.
+ * lib/iso8859_4.h (iso8859_4_wctomb): Likewise.
+ * lib/iso8859_5.h (iso8859_5_wctomb): Likewise.
+ * lib/iso8859_6.h (iso8859_6_wctomb): Likewise.
+ * lib/iso8859_7.h (iso8859_7_wctomb): Likewise.
+ * lib/iso8859_8.h (iso8859_8_wctomb): Likewise.
+ * lib/iso8859_9.h (iso8859_9_wctomb): Likewise.
+ * lib/iso8859_10.h (iso8859_10_wctomb): Likewise.
+ * lib/iso8859_13.h (iso8859_13_wctomb): Likewise.
+ * lib/iso8859_14.h (iso8859_14_wctomb): Likewise.
+ * lib/iso8859_15.h (iso8859_15_wctomb): Likewise.
+ * lib/iso8859_16.h (iso8859_16_wctomb): Likewise.
+ * lib/isoir165ext.h (isoir165ext_wctomb): Likewise.
+ * lib/isoir165.h (isoir165_wctomb): Likewise.
+ * lib/jisx0201.h (jisx0201_wctomb): Likewise.
+ * lib/jisx0208.h (jisx0208_wctomb): Likewise.
+ * lib/jisx0212.h (jisx0212_wctomb): Likewise.
+ * lib/johab.h (johab_wctomb): Likewise.
+ * lib/johab_hangul.h (johab_hangul_wctomb, johab_hangul_decompose):
+ Likewise.
+ * lib/koi8_r.h (koi8_r_wctomb): Likewise.
+ * lib/koi8_ru.h (koi8_ru_wctomb): Likewise.
+ * lib/koi8_u.h (koi8_u_wctomb): Likewise.
+ * lib/ksc5601.h (ksc5601_wctomb): Likewise.
+ * lib/mac_arabic.h (mac_arabic_wctomb): Likewise.
+ * lib/mac_centraleurope.h (mac_centraleurope_wctomb): Likewise.
+ * lib/mac_croatian.h (mac_croatian_wctomb): Likewise.
+ * lib/mac_cyrillic.h (mac_cyrillic_wctomb): Likewise.
+ * lib/mac_greek.h (mac_greek_wctomb): Likewise.
+ * lib/mac_hebrew.h (mac_hebrew_wctomb): Likewise.
+ * lib/mac_iceland.h (mac_iceland_wctomb): Likewise.
+ * lib/mac_roman.h (mac_roman_wctomb): Likewise.
+ * lib/mac_romania.h (mac_romania_wctomb): Likewise.
+ * lib/mac_thai.h (mac_thai_wctomb): Likewise.
+ * lib/mac_turkish.h (mac_turkish_wctomb): Likewise.
+ * lib/mac_ukraine.h (mac_ukraine_wctomb): Likewise.
+ * lib/mulelao.h (mulelao_wctomb): Likewise.
+ * lib/nextstep.h (nextstep_wctomb): Likewise.
+ * lib/sjis.h (sjis_wctomb): Likewise.
+ * lib/tcvn.h (tcvn_wctomb): Likewise.
+ * lib/tis620.h (tis620_wctomb): Likewise.
+ * lib/ucs2be.h (ucs2be_wctomb): Likewise.
+ * lib/ucs2.h (ucs2_wctomb): Likewise.
+ * lib/ucs2internal.h (ucs2internal_wctomb): Likewise.
+ * lib/ucs2le.h (ucs2le_wctomb): Likewise.
+ * lib/ucs2swapped.h (ucs2swapped_wctomb): Likewise.
+ * lib/ucs4.h (ucs4_wctomb): Likewise.
+ * lib/uhc_1.h (uhc_1_wctomb): Likewise.
+ * lib/uhc_2.h (uhc_2_wctomb): Likewise.
+ * lib/utf16be.h (utf16be_wctomb): Likewise.
+ * lib/utf16.h (utf16_wctomb): Likewise.
+ * lib/utf16le.h (utf16le_wctomb): Likewise.
+ * lib/utf32be.h (utf32be_wctomb): Likewise.
+ * lib/utf32.h (utf32_wctomb): Likewise.
+ * lib/utf32le.h (utf32le_wctomb): Likewise.
+ * lib/utf7.h (utf7_wctomb): Likewise.
+ * lib/utf8.h (utf8_wctomb): Likewise.
+ * lib/viscii.h (viscii_wctomb): Likewise.
+ * tools/8bit_tab_to_h.c (main): Likewise.
+ * tools/cjk_tab_to_h.c (output_uni2charset_dense,
+ output_uni2charset_sparse, do_gb18030uni): Likewise.
+
+2001-05-19 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.devel (all): Add man/{iconv.1,iconv*.3}.html.
+ (man/%.html): New rule.
+ * man/Makefile.in (docdir, htmldir): New variables.
+ (install, installdirs): Install the HTML formatted man pages in
+ $(htmldir).
+ (uninstall): Uninstall them.
+
+2001-05-20 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/cp1255.h (cp1255_decomp_table): New array.
+ (cp1255_comb_table): New array.
+ (cp1255_wctomb): Decompose Unicode characters.
+ * tests/CP1255.IRREVERSIBLE.TXT: New file.
+
+2001-05-13 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/vietcomb.h: New file.
+ * lib/cp1258.h: Include it.
+ (cp1258_comb_table): New array.
+ (cp1258_wctomb): Decompose Unicode characters.
+ * lib/tcvn.h: Include it.
+ (tcvn_comb_table): New array.
+ (tcvn_wctomb): Decompose Unicode characters.
+ * tests/CP1258.IRREVERSIBLE.TXT: New file.
+ * tests/TCVN.IRREVERSIBLE.TXT: New file.
+
+2001-05-06 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/Makefile.msvc (config.h): Allow the 'del' command to fail.
+ (iconv.lib): Likewise.
+
+2001-05-06 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/Makefile.in (CPPFLAGS, LDFLAGS): New variables.
+ (CPP): Remove variable.
+ (libiconv.la, libiconv_plug_linux.so, libiconv_plug_solaris.so,
+ libiconv_plug_osf.so): Use LDFLAGS.
+ (libiconv_plug_linux.so, libiconv_plug_solaris.so,
+ libiconv_plug_osf.so, iconv.lo): Use CPPFLAGS.
+ * lib/Makefile.msvc (CPP): Remove variable.
+ * src/Makefile.in (CPPFLAGS, LDFLAGS): New variables.
+ (CPP): Remove variable.
+ (iconv): Use CPPFLAGS and LDFLAGS.
+ * src/Makefile.msvc (CPP): Remove variable.
+ * tests/Makefile.in (CPPFLAGS, LDFLAGS): New variables.
+ (check, table-from, table-to): Use CPPFLAGS and LDFLAGS.
+ * tests/Makefile.msvc (CPP): Remove variable.
+
+2001-05-06 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/Makefile.in (libiconv_plug_solaris.so): Change rule if not using
+ gcc. Reported by Paananen Mikko <mikkopa@cs.tut.fi>.
+
+2001-04-11 Bruno Haible <haible@clisp.cons.org>
+
+ Implement and document UTF-32, UTF-32BE, UTF-32LE.
+ * src/utf32.h, src/utf32be.h, src/utf32le.h: New files.
+ * src/converters.h: Include them.
+ * src/encodings.def (UTF-32, UTF-32BE, UTF32LE): New encodings.
+ * README, man/iconv_open.3: Add UTF-32, UTF-32BE, UTF32LE.
+ * tests/Makefile.in (check): Check UTF-32, UTF-32BE, UTF32LE.
+ * tests/Makefile.os2 (check): Likewise.
+ * tests/Makefile.msvc (check): Likewise.
+ * tests/UTF-32*snippet*: New files.
+
+ * lib/ucs4.h (ucs4_mbtowc): Fix value of other-endian byte order.
+ (ucs4_wctomb): Allow any 31-bit codepoint.
+
+2001-04-11 Bruno Haible <haible@clisp.cons.org>
+
+ * tests/GB18030.TXT: Add mappings for all of U+0000..U+FFFF, including
+ unassigned code points.
+ * tests/table-from.c (main); When dumping GB18030, don't print code
+ points larger than U+FFFF.
+
+2001-03-30 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/Makefile (GB18030uni.TXT): Use a table source which includes
+ the unassigned Unicode code points.
+ * lib/gb18030uni.h: Update.
+ (gb18030uni_ranges): Remove bitmap_offset field.
+ (gb18030uni_bitmap): Remove array.
+ (gb18030uni_mbtowc): Omit gb18030uni_bitmap access.
+ (gb18030uni_wctomb): Likewise.
+ * lib/gb18030.h (gb18030_mbtowc): Handle Unicode characters >= 0x10000.
+ (gb18030_wctomb): Likewise.
+
+2001-03-21 Bruno Haible <haible@clisp.cons.org>
+
+ * INSTALL.generic (Particular Systems): Add recommendations for AIX 3.
+
+2001-03-21 Bruno Haible <haible@clisp.cons.org>
+
+ * src/iconv.c (print_version): Now called GNU libiconv.
+
+2001-03-20 Bruno Haible <haible@clisp.cons.org>
+
+ * README: This package is now called GNU libiconv.
+
+ * tools/8bit_tab_to_h.c (main): Emit copyright notice to the output
+ file.
+ * tools/cjk_tab_to_h.c (output_title): Likewise.
+ * tools/cjk_variants.c (main): Likewise.
+ * lib/gentranslit.c (main): Likewise.
+
+2001-03-19 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/aclocal.m4 (CL_CANONICAL_HOST): Always define
+ ac_config_guess and ac_config_sub. Then ignore requests for
+ AC_CONFIG_AUX_DIR_DEFAULT or AC_CANONICAL_HOST.
+
+2001-03-10 Bruno Haible <haible@clisp.cons.org>
+
+ * INSTALL.generic: New section "Particular Systems".
+
+2001-03-10 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/Makefile.in (libiconv.la): Pass flag -no-undefined. Needed on
+ platforms like BeOS.
+
+ * lib/loop_wchar.h (mbstate_t): Don't typedef if already #defined in
+ config.h.
+
+2001-03-06 Bruno Haible <haible@clisp.cons.org>
+
+ * Version 1.6 released.
+ * include/iconv.h.in (_LIBICONV_VERSION), README, windows/iconv.rc:
+ Bump version number.
+ * lib/Makefile.in (LIBICONV_VERSION_INFO): Define to 2:3:0.
+
+2001-03-05 Bruno Haible <haible@clisp.cons.org>
+
+ Provide all encodings used by OSF/1 5.1 locales.
+ * lib/dec_kanji.h: New file.
+ * lib/dec_hanyu.h: New file.
+ * lib/converters.h: Include them if USE_OSF1 is defined.
+ * lib/encodings_osf1.def: New file.
+ * lib/genflags.c (main): Include it. Define USE_OSF1.
+ * lib/genaliases2.c (main): Include it conditionally.
+ * lib/iconv.c: Define USE_OSF1 on OSF/1.
+ Include encodings_osf1.def and aliases_osf1.h.
+ * lib/Makefile.in (iconv.lo): Depend on encodings_osf1.def and
+ aliases_osf1.h.
+ * Makefile.devel (lib/aliases_osf1.h): New target.
+ (all): Depend on lib/aliases_osf1.h.
+ (lib/flags.h): Depend on lib/encodings_osf1.def.
+
+2001-03-01 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/Makefile (cp775.h): New target.
+ (ALL): Add it.
+ * lib/cp775.h: New file.
+ * lib/converters.h: Include it.
+ * lib/encodings_dos.def (CP775): New encoding.
+
+2001-02-25 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/iconv.c (iconv_open): locale_charset() doesn't return NULL any
+ more.
+
+2001-02-24 Bruno Haible <haible@clisp.cons.org>
+
+ * src/iconv.c (convert): Use ICONV_CONST.
+ * tests/table-from.c: Include config.h.
+ (try): Use ICONV_CONST.
+ * tests/table-to.c: Include config.h.
+ (main): Use ICONV_CONST.
+ * tests/Makefile.in (INCLUDES): Add -I../lib.
+ * tests/Makefile.os2 (INCLUDES): Likewise.
+ * tests/Makefile.msvc (INCLUDES): Add -I..\lib.
+
+2001-02-24 Bruno Haible <haible@clisp.cons.org>
+
+ Provide all encodings used by DOS locales.
+ * tools/Makefile (cp437.h, cp852.h, cp855.h, cp857.h, cp861.h,
+ cp864.h, cp865.h, cp869.h): New targets.
+ (ALL): Add them.
+ * lib/cp437.h: New file.
+ * lib/cp852.h: New file.
+ * lib/cp855.h: New file.
+ * lib/cp857.h: New file.
+ * lib/cp861.h: New file.
+ * lib/cp864.h: New file.
+ * lib/cp865.h: New file.
+ * lib/cp869.h: New file.
+ * lib/converters.h: Include them if USE_DOS is defined.
+ * lib/encodings_dos.def: New file.
+ * lib/genflags.c (main): Include it. Define USE_DOS.
+ * lib/genaliases2.c (main): Include it conditionally.
+ * lib/iconv.c: Define USE_DOS on DJGPP.
+ Include encodings_dos.def and aliases_dos.h.
+ * lib/Makefile.in (iconv.lo): Depend on encodings_dos.def and
+ aliases_dos.h.
+ * Makefile.devel (lib/aliases_dos.h): New target.
+ (all): Depend on lib/aliases_dos.h.
+ (lib/flags.h): Depend on lib/encodings_dos.def.
+
+2001-02-23 Bruno Haible <haible@clisp.cons.org>
+
+ * src/iconv.c [DJGPP]: Include <io.h> and <unistd.h>.
+ (SET_BINARY) [O_BINARY]: New macro.
+ (usage): Mention --binary if available.
+ (convert): Use SET_BINARY instead of setmode.
+ (main): Likewise.
+ Reported by Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>.
+
+2001-02-25 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/ltconfig:
+ sed -e 's/reload object files/produce relocatable object files/'.
+
+2001-02-20 Bruno Haible <haible@clisp.cons.org>
+
+ * src/iconv.c (usage, main): Make -f and -t options optional.
+ * man/iconv.1: Mark them as optional.
+
+2001-02-20 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/Makefile (GB18030ext.TXT, GB18030uni.TXT): Generate from
+ glibc-2.2.2 table.
+ * lib/gb18030uni.h, lib/gb18030ext.h: Add mapping 0xA989 -> U+303E,
+ 0xFE5E -> U+2E97. Shift the entire four-byte range.
+ * tests/GB18030.TXT: Regenerated.
+
+2001-02-20 Bruno Haible <haible@clisp.cons.org>
+
+ Better support for DOS/Windows platforms.
+ * autoconf/ltconfig: Upgrade to libtool-1.3.5.
+ * autoconf/ltmain.sh: Likewise.
+ * autoconf/aclocal.m4: Likewise.
+ * autoconf/install-sh: New file.
+ * configure.in: Call AC_OBJEXT and AC_EXEEXT. Call AC_CONFIG_AUX_DIR.
+
+2001-02-20 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (libdir, includedir, mandir): Use the autoconf
+ determined value, in order to respect the configure arguments.
+ * lib/Makefile.in (libdir): Likewise.
+ * src/Makefile.in (bindir): Likewise.
+ * man/Makefile.in (mandir): Likewise.
+
+2001-02-04 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/translit.def: Add all the neutral transliterations from glibc.
+ * lib/gentranslit.c (main): Allow UTF-8 replacements which are in
+ UCS-2 but not in ISO-8859-1. Generate a table of 'unsigned short'.
+ Avoid accessing data[-1].
+ * lib/loop_unicode.h (unicode_loop_convert): Change type of pointer
+ into translit_data.
+
+2001-01-05 Bruno Haible <haible@clisp.cons.org>
+
+ Implement and document CP862.
+ * tools/Makefile (ALL): Add cp862.h.
+ (cp862.h): New target.
+ * lib/cp862.h: New file.
+ * lib/converters.h: Include it.
+ * lib/encodings.def (CP862): New encoding.
+ * README, man/iconv_open.3: Add CP862.
+ * tests/Makefile.in (check): Check CP862.
+ * tests/Makefile.msvc (check): Likewise.
+ * tests/Makefile.os2 (check): Likewise.
+ * tests/CP862.TXT: New file.
+
+2000-12-18 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/mbstate_t.m4: New file, from textutils-2.0.10.
+ * Makefile.devel (OTHERMACROS): Add it.
+ * configure.in: Call AC_MBSTATE_T.
+ * lib/config.h.in (mbstate_t): New definition.
+ * lib/loop_wchar.h (mbrtowc): For BeOS, declare and define fallback.
+
+2000-12-12 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in: Use $(MAKE) instead of $(MAKE) -r. Needed with Solaris
+ "make", which doesn't set MAKE as expected by @SET_MAKE@ if -r is
+ given. Reported by Toshimitsu Fujiwara.
+
+2000-12-08 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (exec_prefix): Use configure's --exec-prefix argument.
+ * lib/Makefile.in (exec_prefix): Likewise.
+ * src/Makefile.in (exec_prefix): Likewise.
+ * man/Makefile.in (exec_prefix): Likewise.
+
+2000-12-02 Bruno Haible <haible@clisp.cons.org>
+
+ * Version 1.5 released.
+ * include/iconv.h.in (_LIBICONV_VERSION), README, windows/iconv.rc:
+ Bump version number.
+ * lib/Makefile.in (LIBICONV_VERSION_INFO): Define to 2:2:0.
+
+2000-12-02 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (mostlyclean, clean, distclean, maintainer-clean):
+ Remove files installed in lib by libcharset.
+ * Makefile.msvc (mostlyclean): Likewise.
+
+ * Makefile.in (check): Depend on target 'all'.
+ * Makefile.os2 (check): Likewise.
+ * Makefile.msvc (check): Depend on target 'force' as well.
+
+ * src/iconv.c (usage): Take an exitcode argument.
+ (print_version): New function.
+ (main): Recognize --help and --version command line options.
+
+2000-12-02 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc: Replace STATIC with its opposite flag, DLL.
+ * lib/Makefile.msvc: Likewise.
+ * src/Makefile.msvc: Likewise.
+ * tests/Makefile.msvc: Likewise.
+
+2000-12-01 Bruno Haible <haible@clisp.cons.org>
+
+ * src/iconv.c: Include <fcntl.h>. Define fallbacks for setmode, fileno.
+ (force_binary): New variable.
+ (convert): If requested, set the input O_BINARY.
+ (main): Accept --binary option. If requested, set the output O_BINARY.
+ * tests/check-stateful.bat: Pass --binary to iconv.
+ * tests/check-stateful.cmd: Likewise.
+ * tests/check-translit.bat: Likewise.
+ * tests/check-translit.cmd: Likewise.
+
+2000-12-01 Bruno Haible <haible@clisp.cons.org>
+
+ * include/iconv.h.in (_libiconv_version): New declaration.
+ * lib/iconv.c (_libiconv_version): New variable.
+
+2000-11-30 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc (all): File now named lib/libcharset.h.
+ (clean, distclean, maintainer-clean): Likewise.
+
+2000-11-23 Bruno Haible <haible@clisp.cons.org>
+
+ * lib/*: Move here all files from src/*.
+ * src/*: Move all files to lib.
+ * lib/Makefile.in (distclean): No need to remove config.status,
+ config.log, config.cache.
+ * configure.in: Require lib/iconv.c, not src/iconv.c. Create
+ lib/config.h, not src/config.h. Also create lib/Makefile.
+ * Makefile.in (all): Install libcharset into lib, not src. Recurse
+ into lib and src.
+ (install-lib): Recurse into lib, not src.
+ (install): Recurse into libcharset, lib and src.
+ (installdirs, uninstall): Likewise.
+ (check, mostlyclean, clean, distclean, maintainer-clean): Likewise.
+ * Makefile.msvc (all): Recurse into lib and src.
+ (install): Recurse into libcharset, lib and src.
+ (installdirs, uninstall): Likewise.
+ (check, mostlyclean, clean, distclean, maintainer-clean): Likewise.
+ * Makefile.os2 (all): Recurse into lib and src.
+ (install-lib): Recurse into lib, not src.
+ (install, uninstall): Recurse into lib and src.
+ (check, mostlyclean, clean, distclean, maintainer-clean): Likewise.
+ * Makefile.devel (lib/config.h.msvc): Renamed from src/config.h.msvc.
+ (lib/aliases.h): Renamed from src/aliases.h.
+ (lib/aliases.gperf): Renamed from src/aliases.gperf.
+ (lib/aliases_aix.h): Renamed from src/aliases_aix.h.
+ (lib/flags.h): Renamed from src/flags.h.
+ (lib/translit.h): Renamed from src/translit.h.
+ * src/iconv.c: Moved here from tests/iconv.c.
+ * src/Makefile.in: New file.
+ * src/Makefile.msvc: New file.
+ * src/Makefile.os2: New file.
+ * tests/Makefile.in (iconv): Remove target.
+ (../lib/libiconv.la): Renamed from ../src/libiconv.la.
+ (clean): No need to remove iconv.
+ * tests/Makefile.msvc (iconv.exe): Remove target.
+ * tests/Makefile.os2 (iconv.exe): Likewise.
+ * tests/check-stateful: iconv is in ../src.
+ * tests/check-stateful.bat: Likewise.
+ * tests/check-stateful.cmd: Likewise.
+ * tests/check-translit: iconv is in ../src.
+ * tests/check-translit.bat: Likewise.
+ * tests/check-translit.cmd: Likewise.
+ * man/iconv.1: New file.
+ * man/Makefile.in (install, installdirs, uninstall): Also install *.1
+ man pages.
+ * man/Makefile.os2 (MAN3): Renamed from MAN.
+ (MAN1): New variable.
+ (install, uninstall): Also install *.1 man pages.
+
+2000-11-21 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc (all, check, mostlyclean, clean, distclean,
+ maintainer-clean): Recurse into libcharset.
+ (clean, distclean, maintainer-clean): Remove src\libcharset.h.
+ * src/Makefile.msvc (LIBCHARSET_OBJECTS): New variable.
+ (iconv.lib): Link with $(LIBCHARSET_OBJECTS).
+
+2000-11-18 Bruno Haible <haible@clisp.cons.org>
+
+ * src/cp950.h (cp950_mbtowc, cp950_wctomb): Change implementation
+ so that it agrees with Microsoft's definition of CP950.
+ * tests/CP950.TXT: Likewise.
+ * tests/CP950.IRREVERSIBLE.TXT: Add 0xA244, 0xA2CC, 0xA2CE.
+
+2000-11-18 Bruno Haible <haible@clisp.cons.org>
+
+ Add support for locale dependent "char" and "wchar_t" encodings.
+ * libcharset: New subdirectory.
+ * src/loop_unicode.h: New file, extracted from src/iconv.c.
+ * src/loop_wchar.h: New file.
+ * src/loops.h: New file. Include loop_unicode.h and loop_wchar.h.
+ * src/encodings_local.def: New file.
+ * src/genaliases.c: Also create aliases for encodings_local.def.
+ * src/converters.h (conv_struct): Add lfuncs field.
+ * src/genflags.c: Add dummy definitions of struct loop_funcs.
+ * src/iconv.c: Include libcharset.h.
+ (loop_funcs): New structure.
+ Treat encodings_local.def like encodings.def.
+ Include loops.h.
+ (iconv_open): Move the bulk of the code to loop_unicode.h.
+ (iconv): Likewise.
+ (iconvctl): Extend determination of TRIVIALP to wchar_t conversion
+ descriptors.
+ * src/Makefile.in (PLUG_SOURCES): Remove variable.
+ (LIBCHARSET_OBJECTS): New variable.
+ (libiconv.la): Link in the LIBCHARSET_OBJECTS.
+ (libiconv_plug_linux.so, libiconv_plug_solaris.so,
+ libiconv_plug_osf.so): Link in the LIBCHARSET_OBJECTS, using
+ LIBTOOL_LINK.
+ (iconv.lo): Depend on encodings_local.def.
+ * src/Makefile.msvc (iconv.obj): Depend on encodings_local.def.
+ * src/Makefile.os2 (iconv.obj): Likewise.
+ * configure.in: Add tests for locale.h, mbrtowc, wcrtomb, setlocale.
+ Recurse into libcharset.
+ * src/config.h.in (HAVE_LOCALE_H, HAVE_MBRTOWC, HAVE_WCRTOMB,
+ HAVE_SETLOCALE): New macros.
+ * tests/iconv.c: Include config.h and locale.h.
+ (main): Call setlocale.
+ * tests/Makefile.in (iconv): Search for config.h in ../src.
+ * tests/Makefile.os2 (iconv.exe): Likewise.
+ * tests/Makefile.msvc (iconv.exe): Likewise.
+ * README, man/iconv_open.3: Document "char" and "wchar_t" encodings.
+ * Makefile.in: After "cd", use "&&" not ";".
+ (all, check, mostlyclean, clean, distclean, maintainer-clean):
+ Recurse into libcharset.
+ * Makefile.devel (all): Recurse into libcharset.
+ (src/aliases.gperf): Depend on src/encodings_local.def.
+
+2000-11-18 Bruno Haible <haible@clisp.cons.org>
+
+ * src/converters.h (ucs4_t): New type.
+ (wchar_t): Remove locally defined override.
+ (mbtowc_funcs, wctomb_funcs): Use ucs4_t instead of wchar_t.
+ * src/iconv.c (iconv): Likewise.
+ * src/genflags.c (emit_encoding): Use ucs4_t instead of wchar_t.
+ * tools/8bit_tab_to_h.c: Use "ucs4_t" instead of "wchar_t".
+ * tools/cjk_tab_to_h.c: Likewise.
+ * src/armscii_8.h: Use ucs4_t instead of wchar_t.
+ * src/ascii.h: Likewise.
+ * src/big5.h: Likewise.
+ * src/big5hkscs.h: Likewise.
+ * src/ces_big5.h: Likewise.
+ * src/ces_gbk.h: Likewise.
+ * src/cns11643.h: Likewise.
+ * src/cns11643_1.h: Likewise.
+ * src/cns11643_2.h: Likewise.
+ * src/cns11643_3.h: Likewise.
+ * src/cns11643_inv.h: Likewise.
+ * src/cp1046.h: Likewise.
+ * src/cp1124.h: Likewise.
+ * src/cp1129.h: Likewise.
+ * src/cp1133.h: Likewise.
+ * src/cp1250.h: Likewise.
+ * src/cp1251.h: Likewise.
+ * src/cp1252.h: Likewise.
+ * src/cp1253.h: Likewise.
+ * src/cp1254.h: Likewise.
+ * src/cp1255.h: Likewise.
+ * src/cp1256.h: Likewise.
+ * src/cp1257.h: Likewise.
+ * src/cp1258.h: Likewise.
+ * src/cp850.h: Likewise.
+ * src/cp856.h: Likewise.
+ * src/cp866.h: Likewise.
+ * src/cp874.h: Likewise.
+ * src/cp922.h: Likewise.
+ * src/cp932.h: Likewise.
+ * src/cp932ext.h: Likewise.
+ * src/cp936ext.h: Likewise.
+ * src/cp949.h: Likewise.
+ * src/cp950.h: Likewise.
+ * src/cp950ext.h: Likewise.
+ * src/euc_cn.h: Likewise.
+ * src/euc_jp.h: Likewise.
+ * src/euc_kr.h: Likewise.
+ * src/euc_tw.h: Likewise.
+ * src/gb12345.h: Likewise.
+ * src/gb12345ext.h: Likewise.
+ * src/gb18030.h: Likewise.
+ * src/gb18030ext.h: Likewise.
+ * src/gb18030uni.h: Likewise.
+ * src/gb2312.h: Likewise.
+ * src/gbk.h: Likewise.
+ * src/gbkext1.h: Likewise.
+ * src/gbkext2.h: Likewise.
+ * src/gbkext_inv.h: Likewise.
+ * src/georgian_academy.h: Likewise.
+ * src/georgian_ps.h: Likewise.
+ * src/hkscs.h: Likewise.
+ * src/hp_roman8.h: Likewise.
+ * src/hz.h: Likewise.
+ * src/iso2022_cn.h: Likewise.
+ * src/iso2022_cnext.h: Likewise.
+ * src/iso2022_jp.h: Likewise.
+ * src/iso2022_jp1.h: Likewise.
+ * src/iso2022_jp2.h: Likewise.
+ * src/iso2022_kr.h: Likewise.
+ * src/iso646_cn.h: Likewise.
+ * src/iso646_jp.h: Likewise.
+ * src/iso8859_1.h: Likewise.
+ * src/iso8859_10.h: Likewise.
+ * src/iso8859_13.h: Likewise.
+ * src/iso8859_14.h: Likewise.
+ * src/iso8859_15.h: Likewise.
+ * src/iso8859_16.h: Likewise.
+ * src/iso8859_2.h: Likewise.
+ * src/iso8859_3.h: Likewise.
+ * src/iso8859_4.h: Likewise.
+ * src/iso8859_5.h: Likewise.
+ * src/iso8859_6.h: Likewise.
+ * src/iso8859_7.h: Likewise.
+ * src/iso8859_8.h: Likewise.
+ * src/iso8859_9.h: Likewise.
+ * src/isoir165.h: Likewise.
+ * src/isoir165ext.h: Likewise.
+ * src/java.h: Likewise.
+ * src/jisx0201.h: Likewise.
+ * src/jisx0208.h: Likewise.
+ * src/jisx0212.h: Likewise.
+ * src/johab.h: Likewise.
+ * src/johab_hangul.h: Likewise.
+ * src/koi8_r.h: Likewise.
+ * src/koi8_ru.h: Likewise.
+ * src/koi8_u.h: Likewise.
+ * src/ksc5601.h: Likewise.
+ * src/mac_arabic.h: Likewise.
+ * src/mac_centraleurope.h: Likewise.
+ * src/mac_croatian.h: Likewise.
+ * src/mac_cyrillic.h: Likewise.
+ * src/mac_greek.h: Likewise.
+ * src/mac_hebrew.h: Likewise.
+ * src/mac_iceland.h: Likewise.
+ * src/mac_roman.h: Likewise.
+ * src/mac_romania.h: Likewise.
+ * src/mac_thai.h: Likewise.
+ * src/mac_turkish.h: Likewise.
+ * src/mac_ukraine.h: Likewise.
+ * src/mulelao.h: Likewise.
+ * src/nextstep.h: Likewise.
+ * src/sjis.h: Likewise.
+ * src/tcvn.h: Likewise.
+ * src/tis620.h: Likewise.
+ * src/ucs2.h: Likewise.
+ * src/ucs2be.h: Likewise.
+ * src/ucs2internal.h: Likewise.
+ * src/ucs2le.h: Likewise.
+ * src/ucs2swapped.h: Likewise.
+ * src/ucs4.h: Likewise.
+ * src/ucs4be.h: Likewise.
+ * src/ucs4internal.h: Likewise.
+ * src/ucs4le.h: Likewise.
+ * src/ucs4swapped.h: Likewise.
+ * src/uhc_1.h: Likewise.
+ * src/uhc_2.h: Likewise.
+ * src/utf16.h: Likewise.
+ * src/utf16be.h: Likewise.
+ * src/utf16le.h: Likewise.
+ * src/utf7.h: Likewise.
+ * src/utf8.h: Likewise.
+ * src/viscii.h: Likewise.
+
+2000-11-18 Bruno Haible <haible@clisp.cons.org>
+
+ Make transliteration optional.
+ * src/iconv.c (iconv_open): Strip off //TRANSLIT suffix from names.
+ Set transliteration on if and only if tocode ends in //TRANSLIT.
+ * README, man/iconv_open.3: Document how to enable transliteration.
+ * tests/check-translit: Add //TRANSLIT to iconv's 't' argument.
+ * tests/check-translit.bat: Likewise.
+ * tests/check-translit.cmd: Likewise.
+
+2000-11-18 Bruno Haible <haible@clisp.cons.org>
+
+ * man/iconv.3: Fix typo.
+
+2000-10-31 Bruno Haible <haible@clisp.cons.org>
+
+ * README, man/iconv_open.3: Document JOHAB again.
+
+2000-11-15 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc: Add support for MFLAGS and DEBUG parameters.
+ (STATIC): Change default from 0 to 1.
+ * src/Makefile.msvc: Likewise.
+ * tests/Makefile.msvc: Likewise.
+ * tests/check-stateless.bat: Call 'sort' with no arguments.
+
+2000-11-12 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/config.guess, autoconf/config.sub: Upgrade to newest
+ version from GNU CVS.
+
+2000-10-24 Bruno Haible <haible@clisp.cons.org>
+
+ * Version 1.4 released.
+ * include/iconv.h.in (_LIBICONV_VERSION), README, windows/iconv.rc:
+ Bump version number.
+ * src/Makefile.in (LIBICONV_VERSION_INFO): Define to 2:1:0.
+
+2000-10-23 Bruno Haible <haible@clisp.cons.org>
+
+ Implement and document GB18030 and BIG5HKSCS.
+ * tools/cjk_tab_to_h.c (row_byte_hkscs, byte_row_hkscs, do_hkscs): New
+ functions.
+ (do_gb18030uni): New function.
+ (main): Accept gb18030ext, gb18030uni, hkscs.
+ * tools/Makefile (ALL): Add gb18030ext.h, gb18030uni.h, hkscs.h.
+ (gb18030ext.h, GB18030ext.TXT, gb18030uni.h, GB18030uni.TXT,
+ hkscs.h): New targets.
+ * src/gb18030ext.h, src/gb18030uni.h, src/gb18030.h: New files.
+ * src/hkscs.h, src/big5hkscs.h: New files.
+ * src/converters.h: Include gb18030.h and big5hkscs.h.
+ * src/encodings.def (GB18030, BIG5HKSCS): New encodings.
+ * README, man/iconv_open.3: Add GB18030, BIG5HKSCS.
+ * tests/Makefile.in (check): Check GB18030, BIG5HKSCS.
+ * tests/Makefile.msvc (check): Likewise.
+ * tests/Makefile.os2 (check): Likewise.
+ * tests/GB18030.TXT: New file.
+ * tests/BIG5HKSCS.TXT, tests/BIG5HKSCS.IRREVERSIBLE.TXT: New files.
+
+2000-10-23 Bruno Haible <haible@clisp.cons.org>
+
+ * tests/table-from.c (try, main): Use UCS-4-INTERNAL instead of
+ UCS-2-INTERNAL, to avoid problems with UCS-2 surrogate handling.
+ * tests/table-to.c (main): Likewise.
+
+2000-10-22 Bruno Haible <haible@clisp.cons.org>
+
+ * src/gentranslit.c (main): Read the input in UTF-8 encoding.
+
+2000-10-09 Bruno Haible <haible@clisp.cons.org>
+
+ CPU recognition on OpenBSD.
+ * autoconf/aclocal.m4 (CL_WORDS_LITTLEENDIAN): Recognize __m68k__,
+ __mc68020__, __MIPSEB__, __MIPSEL__, __m88k__ as CPU indicators.
+
+2000-10-03 Bruno Haible <haible@clisp.cons.org>
+
+ * src/gentranslit.c (main): Don't output non-ASCII ISO-8859-1
+ character literals, use the numeric value instead.
+ Reported by Shin-Hsien Yeh <shyeh@alcatel.com.tw>.
+
+2000-09-29 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/aclocal.m4 (CL_CANONICAL_HOST): Fix bug in 2000-05-23
+ change.
+
+2000-09-25 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/aclocal.m4 (CL_WORDS_LITTLEENDIAN): Recognize __i386__
+ as equivalent to __i386. For OpenBSD.
+
+2000-09-21 Bruno Haible <haible@clisp.cons.org>
+
+ * src/utf16.h (utf16_wctomb): Reject single surrogates.
+ * src/utf16be.h (utf16be_wctomb): Likewise.
+ * src/utf16le.h (utf16le_wctomb): Likewise.
+ * src/ucs2.h (ucs2_mbtowc, ucs2_wctomb): Likewise.
+ * src/ucs2be.h (ucs2be_mbtowc, ucs2be_wctomb): Likewise.
+ * src/ucs2le.h (ucs2le_mbtowc, ucs2le_wctomb): Likewise.
+ * src/ucs2internal.h (ucs2internal_mbtowc, ucs2internal_wctomb):
+ Likewise.
+ * src/ucs2swapped.h (ucs2swapped_mbtowc, ucs2swapped_wctomb):
+ Likewise.
+
+2000-09-15 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (install, installdirs, uninstall): Support DESTDIR.
+ * src/Makefile.in (install, installdirs, uninstall): Likewise.
+ * man/Makefile.in (install, installdirs, uninstall): Likewise.
+
+2000-09-11 Bruno Haible <haible@clisp.cons.org>
+
+ * src/utf7.h (utf7_mbtowc): Fix combining of UTF-16 surrogates.
+
+2000-08-26 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/acgeneral.m4 (AC_OUTPUT): Use braces in exec_prefix default
+ value, not parens.
+
+2000-07-04 Akira Hatakeyama <akira@sra.co.jp>
+ Bruno Haible <haible@clisp.cons.org>
+
+ * os2/iconv.def, README.os2, Makefile.os2, src/Makefile.os2,
+ tests/Makefile.os2, man/Makefile.os2, tests/check-stateful.cmd,
+ tests/check-stateless.cmd, tests/check-translit.cmd: New files.
+
+2000-06-28 Bruno Haible <haible@clisp.cons.org>
+
+ * src/ucs2internal.h (ucs2internal_mbtowc): Avoid gcc warning about
+ cast.
+ * src/ucs4internal.h (ucs4internal_mbtowc): Likewise.
+ * src/ucs2swapped.h (ucs2swapped_mbtowc, ucs2swapped_wctomb): Verify
+ sizeof(unsigned short).
+ * src/ucs4swapped.h (ucs4swapped_mbtowc, ucs4swapped_mbtowc): Verify
+ sizeof(unsigned int).
+ Reported by François Pinard <pinard@iro.umontreal.ca>.
+
+2000-05-29 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/aclocal.m4 (CL_PROG_INSTALL): Fix typo.
+ Reported by Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>.
+
+2000-05-23 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/aclocal.m4 (CL_CANONICAL_HOST): Determine host_cpu,
+ host_vendor, host_os correctly if $host has more than two hyphens.
+
+2000-04-15 Bruno Haible <haible@clisp.cons.org>
+
+ * Version 1.3 released.
+ * include/iconv.h.in (_LIBICONV_VERSION), README, windows/iconv.rc:
+ Bump version number.
+ * src/Makefile.in (LIBICONV_VERSION_INFO): Define to 2:0:0.
+
+2000-04-15 Bruno Haible <haible@clisp.cons.org>
+
+ * THANKS: New file.
+ * INSTALL.generic: New file.
+
+ Implement and document UCS-2BE, UCS-2LE, UCS-4BE, UCS-4LE.
+ * src/ucs2be.h, src/ucs2le.h, src/ucs4be.h, src/ucs4le.h: New files.
+ * src/converters.h: Include them.
+ * src/ucs2swapped.h: Remove #defines for UCS-2-BE, UCS-2-LE.
+ * src/ucs4swapped.h: Remove #defines for UCS-4-BE, UCS-4-LE.
+ * src/encodings.def (UCS-2BE): Renamed from UCS-2-BE.
+ (UCS-2LE): Renamed from UCS-2-LE.
+ (UCS-4BE): Renamed from UCS-4-BE.
+ (UCS-4LE): Renamed from UCS-4-LE.
+ * Makefile.devel (src/aliases.h): Pass option "-i 1" to gperf.
+ * README, man/iconv_open.3: Add UCS-2BE, UCS-2LE, UCS-4BE, UCS-4LE.
+ * tests/Makefile.in (check): Check UCS-2BE, UCS-2LE, UCS-4BE, UCS-4LE.
+ * tests/Makefile.msvc (check): Likewise.
+ * tests/UCS-*snippet*: New files.
+
+ Allow building as a shared library on Windows.
+ Allow running the tests on Windows.
+ * Makefile.devel (include/iconv.h.msvc): Remove rule.
+ (include/iconv.h.msvc-static, include/iconv.h.msvc-shared): New
+ rules.
+ (all): Update.
+ * windows/dllexport.h: New file.
+ * include/iconv.h.msvc: Remove file.
+ * include/iconv.h.msvc-static, include/iconv.h.msvc-shared: New
+ autogenerated files.
+ * Makefile.msvc (STATIC, DEBUG): Default to 0.
+ (all): Choose either include\iconv.h.msvc-static or
+ include\iconv.h.msvc-shared.
+ (check): Depend on all.
+ (all, check, mostlyclean, clean, distclean, maintainer-clean):
+ Recurse into tests directory.
+ * src/Makefile.msvc (STATIC, DEBUG): Default to 0.
+ (WARN_CFLAGS, PICFLAGS, OPTIMFLAGS): New variables.
+ (CFLAGS): Use them. Add -MD and -DBUILDING_LIBICONV.
+ (RESOURCES): New variable.
+ (iconv.lib): Change rule when building DLL.
+ (clean, distclean): One filename per line.
+ * tests/Makefile.msvc: New file.
+ * tests/check-stateful.bat, tests/check-stateless.bat,
+ tests/check-translit.bat: New files.
+ * tests/uniq-u.c: New file, taken from GNU textutils.
+ * README.win32: Update.
+ Based on patches by Taro Muraoka <koron@tka.att.ne.jp>.
+
+2000-04-14 Bruno Haible <haible@clisp.cons.org>
+
+ Fix an OSF/1 problem.
+ * configure.in: Define GCC variable for substitution.
+ * src/Makefile.in (libiconv_plug_osf.so): Change rule if not using
+ gcc.
+
+2000-04-13 Bruno Haible <haible@clisp.cons.org>
+
+ Fix a SunOS 4 problem.
+ * include/iconv.h.in: If EILSEQ is not defined by the system, define
+ it to ENOENT, not EINVAL.
+
+2000-04-02 Bruno Haible <haible@clisp.cons.org>
+
+ Allow building on filesystems lacking symlinks and hard links.
+ * Makefile.devel (autoconf/aclocal.m4): Replace AC_PROG_LN_S with
+ CL_PROG_LN_S.
+ * configure.in: Add CL_PROG_LN, CL_PROG_LN_S.
+ * src/Makefile.in (LN): Use autoconfigured value @LN@.
+ (LN_S): Use autoconfigured value @LN_S@.
+
+2000-03-15 Bruno Haible <haible@clisp.cons.org>
+
+ * Version 1.2 released.
+ * include/iconv.h.in (_LIBICONV_VERSION): Bump version number.
+ * src/Makefile.in (LIBICONV_VERSION_INFO): Define to 1:1:1.
+
+2000-03-14 Bruno Haible <haible@clisp.cons.org>
+
+ Implement and document UTF-16BE and UTF16LE.
+ * src/utf16be.h, src/utf16le.h: New files.
+ * src/converters.h: Include them.
+ * src/encodings.def (UTF-16BE, UTF16LE): New encodings.
+ * README, man/iconv_open.3: Add UTF-16BE, UTF16LE.
+ * tests/Makefile.in (check): Check UTF-16, UTF-16BE, UTF16LE.
+ * tests/UTF-16*snippet*: New files.
+
+ * src/utf16.h (utf16_wctomb): Output a byte order mark.
+
+2000-03-13 Bruno Haible <haible@clisp.cons.org>
+
+ Provide all encodings used by AIX locales.
+ * tools/Makefile (all): Add cp856.h, cp922.h, cp1046.h, cp1124.h,
+ cp1129.h.
+ (cp856.h, cp922.h, cp1046.h, cp1124.h, cp1129.h): New targets.
+ * src/cp856.h, src/cp922.h, src/cp943.h, src/cp1046.h, src/cp1124.h,
+ src/cp1129.h: New files.
+ * src/converters.h: Include them if USE_AIX is defined.
+ * src/encodings_aix.def: New file, with CP856, CP922, CP943, CP1046,
+ CP1124, CP1129.
+ * src/genflags.c: Define USE_AIX. Include encodings_aix.def.
+ * src/genaliases2.c: New file.
+ * src/iconv.c: Define USE_AIX on AIX.
+ Include encodings_aix.def and aliases_aix.h.
+ (aliases2_lookup): New function.
+ (iconv_open): Call aliases2_lookup.
+ * src/Makefile.in (iconv.lo): Depend on encodings_aix.def and
+ aliases_aix.h.
+ * Makefile.devel (all): Add src/aliases_aix.h.
+ (src/aliases_aix.h): New rule.
+ (src/flags.h): Depend on src/encodings_aix.def.
+
+2000-02-24 Bruno Haible <haible@clisp.cons.org>
+
+ * src/iconv.c (iconv): Don't write beyond the end of the output buffer.
+ Reported by Edmund Grimley Evans <edmundo@rano.org>.
+
+2000-02-22 Bruno Haible <haible@clisp.cons.org>
+
+ * src/utf7.h (direct_tab, xdirect_tab): Treat tab like space.
+
+2000-02-15 Bruno Haible <haible@clisp.cons.org>
+
+ * src/iconv.c (iconv): Add cast in xxx_reset call.
+
+2000-02-05 Bruno Haible <haible@clisp.cons.org>
+
+ * src/tis620.h: Simplify.
+
+2000-01-27 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.devel (CLISP_DIR): Change to "..".
+
+2000-01-24 Bruno Haible <haible@clisp.cons.org>
+
+ * Version 1.1 released.
+ * include/iconv.h.in (_LIBICONV_VERSION): Bump version number.
+ * src/Makefile.in (LIBICONV_VERSION_INFO): Define to 1:0:1.
+
+2000-01-23 Bruno Haible <haible@clisp.cons.org>
+
+ * src/utf7.h (utf7_wctomb): If base64 encoding is not active, encode
+ '+' as "+-".
+
+2000-01-22 Bruno Haible <haible@clisp.cons.org>
+
+ * include/iconv.h.in (iconvctl): New declaration.
+ (ICONV_TRIVIALP, ICONV_GET_TRANSLITERATE, ICONV_SET_TRANSLITERATE):
+ New macros.
+ * src/iconv.c (iconvctl): New function.
+
+ * tests/Makefile.in: Add a rule for ../src/libiconv.la. Define $(MAKE).
+
+ Solve a build problem.
+ * include/iconv.h.in: Renamed from include/libiconv.h.in.
+ * Makefile.devel: libiconv.h -> iconv.h.
+ * Makefile.in: Likewise.
+ * configure.in: Likewise. Remove check for <iconv.h>.
+ * src/iconv.c: Include iconv.h instead of libiconv.h.
+ * tests/iconv.c, tests/table-from.c, tests/table-to.c: Likewise.
+
+ * README, man/iconv_open.3: Don't document JOHAB any more.
+
+ * man/iconv.3: Clarify return value again.
+
+2000-01-16 Bruno Haible <haible@clisp.cons.org>
+
+ Add aliases.
+ * src/encodings.def (ISO-8859-14): Add alias ISO-IR-199.
+ (ISO-8859-15): Add alias ISO-IR-203.
+ (EUC-CN): Add alias CN-GB, from RFC 1922.
+ (BIG5): Add alias CN-BIG5, from RFC 1922.
+ * Makefile.devel (src/aliases.h): Add 8th character to key set.
+
+ Drop X11 aliases.
+ * src/encodings.def (JIS_X0201): Drop JISX0201.1976-0 alias.
+ (JIS_X0208): Drop JIS_X0208.1983-0, JIS_X0208.1983-1 aliases.
+ (KSC_5601): Drop KSC5601.1987-0 alias.
+
+ Improve GB/T 12345 (not used yet).
+ * tools/Makefile (gb12345ext.h): Use GB12345-more.TXT.
+ * src/gb12345ext.h: Regenerated.
+
+ Improve and document CP949.
+ * tools/Makefile (all): Add uhc_1.h and uhc_2.h.
+ (uhc_1.h, uhc_2.h): New rules.
+ * tools/cjk_tab_to_h.c (output_charset2uni_noholes_monotonic): New
+ function.
+ (output_uni2charset_sparse): Take an additional boolean argument.
+ All callers changed.
+ (*_uhc_1, *_uhc_2): New functions.
+ (main): Treat uhc_1 and uhc_2.
+ * src/uhc_1.h, src/uhc_2.h: New files.
+ * src/cp949.h: New file, include them.
+ * src/converters.h: Include it.
+ * src/encodings.def (KSC_5601): Remove alias CP949.
+ (CP949): New encoding.
+ * README, man/iconv_open.3: Add CP949.
+ * tests/Makefile.in (check): Check CP949.
+ * tests/CP949.TXT: New file.
+
+ Document CP932.
+ * README, man/iconv_open.3: Add CP932.
+ * tests/Makefile.in (check): Check CP932.
+ * tests/CP932.TXT, tests/CP932.IRREVERSIBLE.TXT: New files.
+
+ * Makefile.devel (src/flags.h): Depend on src/converters.h.
+
+ * tests/Makefile.in (check): Check JIS_X0201.
+ * tests/JIS_X0201.TXT: New file.
+
+ * src/euc_kr.h (euc_kr_wctomb): Shrink size of buf.
+ * src/iso2022_kr.h (iso2022_kr_wctomb): Likewise.
+
+ * src/iso2022_cnext.h (iso2022_cn_ext_mbtowc): Use isoir165_mbtowc.
+ (iso2022_cn_ext_wctomb): Use isoir165_wctomb.
+
+ Add ISO-IR-165 (undocumented).
+ * tools/Makefile (all): Add isoir165ext.h.
+ (isoir165ext.h): New rule.
+ * tools/cjk_tab_to_h.c (main): Treat isoir165ext like gb2312.
+ * src/isoir165.h, src/isoir165ext.h: New files.
+ * src/converters.h: Include it.
+ * src/encodings.def: Add ISO-IR-165.
+ * tests/Makefile.in (check): Check ISO-IR-165.
+ * tests/ISO-IR-165.TXT, tests/ISO-IR-165.IRREVERSIBLE.TXT: New files.
+
+ Add ISO646-CN (undocumented).
+ * src/iso646_cn.h: New file.
+ * src/converters.h: Include it.
+ * src/encodings.def: Add ISO646-CN.
+ * tests/Makefile.in (check): Check ISO646-CN.
+ * tests/ISO646-CN.TXT: New file.
+
+ Add ISO646-JP (undocumented).
+ * src/iso646_jp.h: New file.
+ * src/converters.h: Include it.
+ * src/encodings.def: Add ISO646-JP.
+ * tests/Makefile.in (check): Check ISO646-JP.
+ * tests/ISO646-JP.TXT: New file.
+
+2000-01-05 Bruno Haible <haible@clisp.cons.org>
+
+ Add ISO-8859-16.
+ * tools/Makefile (all): Add iso8859_16.h.
+ (iso8859_16.h): New rule.
+ * src/iso8859_16.h: New file.
+ * src/converters.h: Include it.
+ * src/encodings.def: Add ISO-8859-16.
+ * README, man/iconv_open.3: Add ISO-8859-16.
+ * tests/Makefile.in (check): Check ISO-8859-16.
+ * tests/ISO-8859-16.TXT: New file.
+
+ * man/iconv.3: Clarify what happens *inbuf in case 3.
+
+ * src/iso8859_8.h: Update using newest table from ftp.unicode.org.
+ * tests/ISO-8859-8.TXT: Likewise.
+
+2000-01-04 Bruno Haible <haible@clisp.cons.org>
+
+ * Version 1.0 released.
+ * include/libiconv.h.in (_LIBICONV_VERSION): Bump version number.
+ * src/Makefile.in (LIBICONV_VERSION_INFO): Define to 0:1:0.
+ (libiconv.la): Use LIBICONV_VERSION_INFO.
+
+2000-01-03 Bruno Haible <haible@clisp.cons.org>
+
+ * tests/Makefile.in: New file.
+ tests/check-stateless, tests/table-from.c, tests/table-to.c,
+ tests/*.TXT, tests/genutf8.c: New files, checks for stateless
+ encodings.
+ tests/check-stateful, tests/iconv.c, tests/*-snippet*: New files,
+ checks for stateful encodings.
+ * Makefile.in (all, check, mostlyclean, clean, distclean,
+ maintainer-clean): Descend into tests directory.
+ * configure.in: Add tests/Makefile to AC_OUTPUT duties.
+
+ * src/gentranslit.c: New file.
+ * Makefile.devel (src/translit.h): New rule.
+ * src/translit.def, src/translit.h: New files.
+ * src/iconv.c: Include it.
+ (iconv): Transliterate using translit.h table.
+
+ * src/genflags.c: New file.
+ * Makefile.devel (src/flags.h): New rule.
+ * src/flags.h: New file.
+ * src/iconv.c: Include it.
+ (encoding): Add field 'oflags'.
+ (all_encodings): Initialize the field 'oflags'.
+ (iconv_open): Copy field 'oflags'.
+ (iconv): Transliterate quotation marks U+2018, U+2019, U+201A.
+ * src/Makefile.in (iconv.lo): Update dependencies.
+
+ * src/converters.h: New file, extracted from src/iconv.c.
+ * src/iconv.c: Include it.
+ * src/Makefile.in (iconv.lo): Update dependencies.
+
+ * tools/cjk_variants.c: New file.
+ * tools/Makefile (ALL): Add cjk_variants.h.
+ (cjk_variants.h, cjk_variants): New rules.
+ * src/cjk_variants.h: New file.
+ * src/iconv.c: Include it.
+ (iconv): Use cjk_variants for transliteration.
+
+ * man/iconv.3: Fix description of return value.
+ * euc_kr.h (euc_kr_wctomb): Remove Hangul transliteration.
+ * iso2022_kr.h (iso2022kr_wctomb): Likewise.
+ * src/iconv.c (iconv): Do Hangul transliteration here and increment
+ result once for every transliterated character.
+ * src/johab_hangul.h (johab_hangul_decompose): Change result array
+ from 'unsigned char*' to 'wchar_t*'.
+
+ * src/cp1258.h (cp1258_mbtowc): Return RET_ILSEQ instead of storing
+ 0xfffd.
+
+ * src/georgian_ps.h (georgian_ps_wctomb): Accept 0x00e6.
+
+ * src/euc_jp.h (euc_jp_wctomb): Don't treat U+005C and U+007E like
+ Katakana.
+
+ * src/euc_tw.h (euc_tw_mbtowc): Fix typo.
+
+ * src/cp950.h (cp950_mbtowc, cp950_wctomb): Exclude the range
+ 0xC6A1..0xC7FE.
+
+ * tools/cjk_tab_to_h.c (read_table_ksc5601): Some Hangul range was
+ not being excluded. Fix that.
+ * src/ksc5601.h: Regenerated.
+ * src/johab.h (johab_mbtowc): Don't accept 0xDA{A1..D3} - this is
+ valid in KSC5601/KSX1001 but not in JOHAB.
+
+ * src/iconv.c (conv_struct): Add fields iindex, oindex.
+ (iconv_open): Fill in iindex, oindex.
+
+ * src/encodings.def (UCS-2-BE): Add aliases "UNICODE-1-1" and
+ "csUnicode11", from IANA charset list.
+ (MacRoman): Add aliases "MAC" and "csMacintosh" for "MACINTOSH",
+ from IANA charset list.
+ (JIS_X0208): Add aliases "X0208", "ISO-IR-87", "csISO87JISX0208",
+ from IANA charset list.
+ (GB_2312-80): New encoding, from IANA charset list.
+
+ * README, man/iconv_open.3: Add MacIceland and MacUkraine.
+
+ * Makefile.devel: Add rules for src/aliases.h and src/aliases.gperf.
+ (all): Depend on src/aliases.h.
+ * src/Makefile.in: Remove rules for $(srcdir)/aliases.h and
+ $(srcdir)/aliases.gperf.
+ (clean): Clean up.
+
+ * src/Makefile.in (libiconv_plug_linux.so): Remove unneeded "-ldl".
+
+1999-12-31 Bruno Haible <haible@clisp.cons.org>
+
+ * Version 0.3 released.
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/DESIGN b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/DESIGN
new file mode 100644
index 00000000..9ff2ad3a
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/DESIGN
@@ -0,0 +1,64 @@
+While some other iconv(3) implementations - like FreeBSD iconv(3) - choose
+the "many small shared libraries" and dlopen(3) approach, this implementation
+packs everything into a single shared library. Here is a comparison of the
+two designs.
+
+* Run-time efficiency
+ 1. A dlopen() based approach needs a cache of loaded shared libraries.
+ Otherwise, every iconv_open() call will result in a call to dlopen()
+ and thus to file system related system calls - which is prohibitive
+ because some applications use the iconv_open/iconv/iconv_close sequence
+ for every single filename, string, or piece of text.
+ 2. In terms of virtual memory use, both approaches are on par. Being shared
+ libraries, the tables are shared between any processes that use them.
+ And because of the demand loading used by Unix systems (and because libiconv
+ does not have initialization functions), only those parts of the tables
+ which are needed (typically very few kilobytes) will be read from disk and
+ paged into main memory.
+ 3. Even with a cache of loaded shared libraries, the dlopen() based approach
+ makes more system calls, because it has to load one or two shared libraries
+ for every encoding in use.
+
+* Total size
+ In the dlopen(3) approach, every shared library has a symbol table and
+ relocation offset. All together, FreeBSD iconv installs more than 200 shared
+ libraries with a total size of 2.3 MB. Whereas libiconv installs 0.45 MB.
+
+* Extensibility
+ The dlopen(3) approach is good for guaranteeing extensibility if the iconv
+ implementation is distributed without source. (Or when, as in glibc, you
+ cannot rebuild iconv without rebuilding your libc, thus possibly
+ destabilizing your system.)
+ The libiconv package achieves extensibility through the LGPL license:
+ Every user has access to the source of the package and can extend and
+ replace just libiconv.so.
+ The places which have to be modified when a new encoding is added are as
+ follows: add an #include statement in iconv.c, add an entry in the table in
+ iconv.c, and of course, update the README and iconv_open.3 manual page.
+
+* Use within other packages
+ If you want to incorporate an iconv implementation into another package
+ (such as a mail user agent or web browser), the single library approach
+ is easier, because:
+ 1. In the shared library approach you have to provide the right directory
+ prefix which will be used at run time.
+ 2. Incorporating iconv as a static library into the executable is easy -
+ it won't need dynamic loading. (This assumes that your package is under
+ the LGPL or GPL license.)
+
+
+All conversions go through Unicode. This is possible because most of the
+world's characters have already been allocated in the Unicode standard.
+Therefore we have for each encoding two functions:
+- For conversion from the encoding to Unicode, a function called xxx_mbtowc.
+- For conversion from Unicode to the encoding, a function called xxx_wctomb,
+ and for stateful encodings, a function called xxx_reset which returns to
+ the initial shift state.
+
+
+All our functions operate on a single Unicode character at a time. This is
+obviously less efficient than operating on an entire buffer of characters at
+a time, but it makes the coding considerably easier and less bug-prone. Those
+who wish best performance should install the Real Thing (TM): GNU libc 2.1
+or newer.
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/NEWS b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/NEWS
new file mode 100644
index 00000000..1248c5a8
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/NEWS
@@ -0,0 +1,119 @@
+New in 1.9:
+* Many more transliterations.
+* New configuration option --enable-relocatable. See the INSTALL.generic file
+ for details.
+
+New in 1.8:
+* The iconv program has new options -l, -c, -s.
+* The iconv program is internationalized.
+* Added C99 converter.
+* Added KOI8-T converter.
+* New configuration option --enable-extra-encodings that enables a bunch of
+ additional encodings; see the README for details.
+* Updated the ISO-8859-16 converter.
+* Upgraded BIG5-HKSCS, EUC-TW, ISO-2022-CN, ISO-2022-CN-EXT converters to
+ Unicode 3.2.
+* Upgraded EUC-KR, CP949, JOHAB converters to include the Euro sign.
+* Changed the ARMSCII-8 converter.
+* Extended the EUC-JP encoder so that YEN SIGN characters don't cause failures
+ in Shift_JIS to EUC-JP conversion.
+* The JAVA converter now handles characters outside the Unicode BMP correctly.
+* Fixed a bug in the CP1255, CP1258, TCVN decoders: The base characters of
+ combining characters could be dropped at the end of the conversion buffer.
+* Fixed a bug in the transliteration that could lead to excessive memory
+ allocations in libintl when transliteration was needed.
+* Portability to BSD/OS and SCO 3.2.5.
+
+New in 1.7:
+* Added UTF-32, UTF-32BE, UTF-32LE converters.
+* Changed CP1255, CP1258 and TCVN converters to handle combining characters.
+* Changed EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-2, ISO-2022-JP-1
+ converters to use fullwidth Yen sign instead of halfwidth Yen sign, and
+ fullwidth tilde instead of halfwidth tilde.
+* Upgraded EUC-TW, ISO-2022-CN, ISO-2022-CN-EXT converters to Unicode 3.1.
+* Changed the GB18030 converter to not reject unassigned and private-use
+ Unicode characters.
+* Fixed a bug in the byte order mark treatment of the UCS-4 decoder.
+* The manual pages are now distributed also in HTML format.
+
+New in 1.6:
+* The iconv program's -f and -t options are now optional.
+* Many more transliterations.
+* Added CP862 converter.
+* Changed the GB18030 converter.
+* Portability to DOS with DJGPP.
+
+New in 1.5:
+* Added an iconv(1) program.
+* New locale dependent encodings "char", "wchar_t".
+* Transliteration is now off by default. Use a //TRANSLIT suffix to enable it.
+* The JOHAB encoding is documented again.
+* Changed a few mappings in the CP950 converter.
+
+New in 1.4:
+* Added GB18030, BIG5HKSCS converters.
+* Portability to OS/2 with emx+gcc.
+
+New in 1.3:
+* Added UCS-2BE, UCS-2LE, UCS-4BE, UCS-4LE converters.
+* Fixed the definition of EILSEQ on SunOS4.
+* Fixed a build problem on OSF/1.
+* Support for building as a shared library on Woe32.
+
+New in 1.2:
+* Added UTF-16BE and UTF-16LE converters.
+* Changed the UTF-16 encoder.
+* Fixed the treatment of tab characters in the UTF-7 converter.
+* Fixed an internal error when output buffer was not large enough.
+
+New in 1.1:
+* Added ISO-8859-16 converter.
+* Added CP932 converter, a variant of SHIFT_JIS.
+* Added CP949 converter, a variant of EUC-KR.
+* Improved the ISO-2022-CN-EXT converter: It now covers the ISO-IR-165 range.
+* Updated the ISO-8859-8 conversion table.
+* The JOHAB encoding is deprecated and not documented any more.
+* Fixed two build problems: 1. "make -n check" failed. 2. When libiconv was
+ already installed, "make" failed.
+
+New in 1.0:
+* Added transliteration facilities.
+* Added a test suite.
+* Fixed the iconv(3) manual page and function: the return value was not
+ described correctly.
+* Fixed a bug in the CP1258 decoder: invalid bytes now yield EILSEQ instead of
+ U+FFFD.
+* Fixed a bug in the Georgian-PS encoder: accept U+00E6.
+* Fixed a bug in the EUC-JP encoder: reject 0x8E5C and 0x8E7E.
+* Fixed a bug in the KSC5601 and JOHAB converters: they recognized some Hangul
+ characters at some invalid code positions.
+* Fixed a bug in the EUC-TW decoder; it was severely broken.
+* Fixed a bug in the CP950 converter: it recognized a dubious BIG5 range.
+
+New in 0.3:
+* Reduced the size of the tables needed for the JOHAB converter.
+* Portability to Woe32.
+
+New in 0.2:
+* Added KOI8-RU, CP850, CP866, CP874, CP950, ISO-2022-CN-EXT, GBK and
+ ISO-2022-JP-1 converters.
+* Added MACINTOSH as an alias for MAC-ROMAN.
+* Added ASMO-708 as an alias for ISO-8859-6.
+* Added ELOT_928 as an alias for ISO-8859-7.
+* Improved the EUC-TW converter: Treat CNS 11643 plane 3.
+* Improved the ISO-2022-KR and EUC-KR converters: Hangul characters are
+ decomposed into Jamo when needed.
+* Improved the CP932 converter.
+* Updated the CP1133, MULELAO-1 and ARMSCII-8 mappings.
+* The EUC-JP and SHIFT_JIS converters now cover the user-defined range.
+* Fixed a possible buffer overrun in the JOHAB converter.
+* Fixed a bug in the UTF-7, ISO-2022-*, HZ decoders: a shift sequence a the
+ end of the input no longer gives an error.
+* The HZ encoder now always terminates its output in the ASCII state.
+* Use a perfect hash table for looking up the aliases.
+
+New in 0.1:
+* Portability to Linux/glibc-2.0.x, Linux/libc5, OSF/1, FreeBSD.
+* Fixed a bug in the EUC-JP decoder. Extended the ISO-2022-JP-2 converter.
+* Made TIS-620 mapping consistent with glibc-2.1.
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/NOTES b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/NOTES
new file mode 100644
index 00000000..8f630e23
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/NOTES
@@ -0,0 +1,392 @@
+Q: Why does libiconv support encoding XXX? Why does libiconv not support
+ encoding ZZZ?
+
+A: libiconv, as an internationalization library, supports those character
+ sets and encodings which are in wide-spread use in at least one territory
+ of the world.
+
+ Hint1: On http://www.w3c.org/International/O-charset-lang.html you find a
+ page "Languages, countries, and the charsets typically used for them".
+ From this table, we can conclude that the following are in active use:
+
+ ISO-8859-1, CP1252 Afrikaans, Albanian, Basque, Catalan, Danish, Dutch,
+ English, Faroese, Finnish, French, Galician, German,
+ Icelandic, Irish, Italian, Norwegian, Portuguese,
+ Scottish, Spanish, Swedish
+ ISO-8859-2 Croatian, Czech, Hungarian, Polish, Romanian, Slovak,
+ Slovenian
+ ISO-8859-3 Esperanto, Maltese
+ ISO-8859-5 Bulgarian, Byelorussian, Macedonian, Russian,
+ Serbian, Ukrainian
+ ISO-8859-6 Arabic
+ ISO-8859-7 Greek
+ ISO-8859-8 Hebrew
+ ISO-8859-9, CP1254 Turkish
+ ISO-8859-10 Inuit, Lapp
+ ISO-8859-13 Latvian, Lithuanian
+ ISO-8859-15 Estonian
+ KOI8-R Russian
+ SHIFT_JIS Japanese
+ ISO-2022-JP Japanese
+ EUC-JP Japanese
+
+ Ordered by frequency on the web (1997):
+ ISO-8859-1, CP1252 96%
+ SHIFT_JIS 1.6%
+ ISO-2022-JP 1.2%
+ EUC-JP 0.4%
+ CP1250 0.3%
+ CP1251 0.2%
+ CP850 0.1%
+ MACINTOSH 0.1%
+ ISO-8859-5 0.1%
+ ISO-8859-2 0.0%
+
+ Hint2: The character sets mentioned in the XFree86 4.0 locale.alias file.
+
+ ISO-8859-1 Afrikaans, Basque, Breton, Catalan, Danish, Dutch,
+ English, Estonian, Faroese, Finnish, French,
+ Galician, German, Greenlandic, Icelandic,
+ Indonesian, Irish, Italian, Lithuanian, Norwegian,
+ Occitan, Portuguese, Scottish, Spanish, Swedish,
+ Walloon, Welsh
+ ISO-8859-2 Albanian, Croatian, Czech, Hungarian, Polish,
+ Romanian, Serbian, Slovak, Slovenian
+ ISO-8859-3 Esperanto
+ ISO-8859-4 Estonian, Latvian, Lithuanian
+ ISO-8859-5 Bulgarian, Byelorussian, Macedonian, Russian,
+ Serbian, Ukrainian
+ ISO-8859-6 Arabic
+ ISO-8859-7 Greek
+ ISO-8859-8 Hebrew
+ ISO-8859-9 Turkish
+ ISO-8859-14 Breton, Irish, Scottish, Welsh
+ ISO-8859-15 Basque, Breton, Catalan, Danish, Dutch, Estonian,
+ Faroese, Finnish, French, Galician, German,
+ Greenlandic, Icelandic, Irish, Italian, Lithuanian,
+ Norwegian, Occitan, Portuguese, Scottish, Spanish,
+ Swedish, Walloon, Welsh
+ KOI8-R Russian
+ KOI8-U Russian, Ukrainian
+ EUC-JP (alias eucJP) Japanese
+ ISO-2022-JP (alias JIS7) Japanese
+ SHIFT_JIS (alias SJIS) Japanese
+ U90 Japanese
+ S90 Japanese
+ EUC-CN (alias eucCN) Chinese
+ EUC-TW (alias eucTW) Chinese
+ BIG5 Chinese
+ EUC-KR (alias eucKR) Korean
+ ARMSCII-8 Armenian
+ GEORGIAN-ACADEMY Georgian
+ GEORGIAN-PS Georgian
+ TIS-620 (alias TACTIS) Thai
+ MULELAO-1 Laothian
+ IBM-CP1133 Laothian
+ VISCII Vietnamese
+ TCVN Vietnamese
+ NUNACOM-8 Inuktitut
+
+ Hint3: The character sets supported by Netscape Communicator 4.
+
+ Where is this documented? For the complete picture, I had to use
+ "strings netscape" and then a lot of guesswork. For a quick take,
+ look at the "View - Character set" menu of Netscape Communicator 4.6:
+
+ ISO-8859-{1,2,5,7,9,15}
+ WINDOWS-{1250,1251,1253}
+ KOI8-R Cyrillic
+ CP866 Cyrillic
+ Autodetect Japanese (EUC-JP, ISO-2022-JP, ISO-2022-JP-2, SJIS)
+ EUC-JP Japanese
+ SHIFT_JIS Japanese
+ GB2312 Chinese
+ BIG5 Chinese
+ EUC-TW Chinese
+ Autodetect Korean (EUC-KR, ISO-2022-KR, but not JOHAB)
+
+ UTF-8
+ UTF-7
+
+ Hint4: The character sets supported by Microsoft Internet Explorer 4.
+
+ ISO-8859-{1,2,3,4,5,6,7,8,9}
+ WINDOWS-{1250,1251,1252,1253,1254,1255,1256,1257}
+ KOI8-R Cyrillic
+ KOI8-RU Ukrainian
+ ASMO-708 Arabic
+ EUC-JP Japanese
+ ISO-2022-JP Japanese
+ SHIFT_JIS Japanese
+ GB2312 Chinese
+ HZ-GB-2312 Chinese
+ BIG5 Chinese
+ EUC-KR Korean
+ ISO-2022-KR Korean
+ WINDOWS-874 Thai
+ WINDOWS-1258 Vietnamese
+
+ UTF-8
+ UTF-7
+ UNICODE actually UNICODE-LITTLE
+ UNICODEFEFF actually UNICODE-BIG
+
+ and various DOS character sets: DOS-720, DOS-862, IBM852, CP866.
+
+ We take the union of all these four sets. The result is:
+
+ European and Semitic languages
+ * ASCII.
+ We implement this because it is occasionally useful to know or to
+ check whether some text is entirely ASCII (i.e. if the conversion
+ ISO-8859-x -> UTF-8 is trivial).
+ * ISO-8859-{1,2,3,4,5,6,7,8,9,10}
+ We implement this because they are widely used. Except ISO-8859-4
+ which appears to have been superseded by ISO-8859-13 in the baltic
+ countries. But it's an ISO standard anyway.
+ * ISO-8859-13
+ We implement this because it's a standard in Lithuania and Latvia.
+ * ISO-8859-14
+ We implement this because it's an ISO standard.
+ * ISO-8859-15
+ We implement this because it's increasingly used in Europe, because
+ of the Euro symbol.
+ * ISO-8859-16
+ We implement this because it's an ISO standard.
+ * KOI8-R, KOI8-U
+ We implement this because it appears to be the predominant encoding
+ on Unix in Russia and Ukraine, respectively.
+ * KOI8-RU
+ We implement this because MSIE4 supports it.
+ * KOI8-T
+ We implement this because it is the locale encoding in glibc's Tajik
+ locale.
+ * CP{1250,1251,1252,1253,1254,1255,1256,1257}
+ We implement these because they are the predominant Windows encodings
+ in Europe.
+ * CP850
+ We implement this because it is mentioned as occurring in the web
+ in the aforementioned statistics.
+ * CP862
+ We implement this because Ron Aaron says it is sometimes used in web
+ pages and emails.
+ * CP866
+ We implement this because Netscape Communicator does.
+ * Mac{Roman,CentralEurope,Croatian,Romania,Cyrillic,Greek,Turkish} and
+ Mac{Hebrew,Arabic}
+ We implement these because the Sun JDK does, and because Mac users
+ don't deserve to be punished.
+ * Macintosh
+ We implement this because it is mentioned as occurring in the web
+ in the aforementioned statistics.
+ Japanese
+ * EUC-JP, SHIFT_JIS, ISO-2022-JP
+ We implement these because they are widely used. EUC-JP and SHIFT_JIS
+ are more used for files, whereas ISO-2022-JP is recommended for email.
+ * CP932
+ We implement this because it is the Microsoft variant of SHIFT_JIS,
+ used on Windows.
+ * ISO-2022-JP-2
+ We implement this because it's the common way to represent mails which
+ make use of JIS X 0212 characters.
+ * ISO-2022-JP-1
+ We implement this because it's in the RFCs, but I don't think it is
+ really used.
+ * U90, S90
+ We DON'T implement this because I have no informations about what it
+ is or who uses it.
+ Simplified Chinese
+ * EUC-CN = GB2312
+ We implement this because it is the widely used representation
+ of simplified Chinese.
+ * GBK
+ We implement this because it appears to be used on Solaris and Windows.
+ * GB18030
+ We implement this because it is an official requirement in the
+ People's Republic of China.
+ * ISO-2022-CN
+ We implement this because it is in the RFCs, but I have no idea
+ whether it is really used.
+ * ISO-2022-CN-EXT
+ We implement this because it's in the RFCs, but I don't think it is
+ really used.
+ * HZ = HZ-GB-2312
+ We implement this because the RFCs recommend it for Usenet postings,
+ and because MSIE4 supports it.
+ Traditional Chinese
+ * EUC-TW
+ We implement it because it appears to be used on Unix.
+ * BIG5
+ We implement it because it is the de-facto standard for traditional
+ Chinese.
+ * CP950
+ We implement this because it is the Microsoft variant of BIG5, used
+ on Windows.
+ * BIG5+
+ We DON'T implement this because it doesn't appear to be in wide use.
+ Only the CWEX fonts use this encoding. Furthermore, the conversion
+ tables in the big5p package are not coherent: If you convert directly,
+ you get different results than when you convert via GBK.
+ * BIG5-HKSCS
+ We implement it because it is the de-facto standard for traditional
+ Chinese in Hongkong.
+ Korean
+ * EUC-KR
+ We implement these because they appear to be the widely used
+ representations for Korean.
+ * CP949
+ We implement this because it is the Microsoft variant of EUC-KR, used
+ on Windows.
+ * ISO-2022-KR
+ We implement it because it is in the RFCs and because MSIE4 supports
+ it, but I have no idea whether it's really used.
+ * JOHAB
+ We implement this because it is apparently used on Windows as a locale
+ encoding (codepage 1361).
+ * ISO-646-KR
+ We DON'T implement this because although an old ASCII variant, its
+ glyph for 0x7E is not clear: RFC 1345 and unicode.org's JOHAB.TXT
+ say it's a tilde, but Ken Lunde's "CJKV information processing" says
+ it's an overline. And it is not ISO-IR registered.
+ Armenian
+ * ARMSCII-8
+ We implement it because XFree86 supports it.
+ Georgian
+ * Georgian-Academy, Georgian-PS
+ We implement these because they appear to be both used for Georgian;
+ Xfree86 supports them.
+ Thai
+ * TIS-620
+ We implement this because it seems to be standard for Thai.
+ * CP874
+ We implement this because MSIE4 supports it.
+ * MacThai
+ We implement this because the Sun JDK does, and because Mac users
+ don't deserve to be punished.
+ Laotian
+ * MuleLao-1, CP1133
+ We implement these because XFree86 supports them. I have no idea which
+ one is used more widely.
+ Vietnamese
+ * VISCII, TCVN
+ We implement these because XFree86 supports them.
+ * CP1258
+ We implement this because MSIE4 supports it.
+ Other languages
+ * NUNACOM-8 (Inuktitut)
+ We DON'T implement this because it isn't part of Unicode yet, and
+ therefore doesn't convert to anything except itself.
+ Platform specifics
+ * HP-ROMAN8, NEXTSTEP
+ We implement these because they were the native character set on HPs
+ and NeXTs for a long time, and libiconv is intended to be usable on
+ these old machines.
+ Full Unicode
+ * UTF-8, UCS-2, UCS-4
+ We implement these. Obviously.
+ * UCS-2BE, UCS-2LE, UCS-4BE, UCS-4LE
+ We implement these because they are the preferred internal
+ representation of strings in Unicode aware applications. These are
+ non-ambiguous names, known to glibc. (glibc doesn't have
+ UCS-2-INTERNAL and UCS-4-INTERNAL.)
+ * UTF-16, UTF-16BE, UTF-16LE
+ We implement these, because UTF-16 is still the favourite encoding of
+ the president of the Unicode Consortium (for political reasons), and
+ because they appear in RFC 2781.
+ * UTF-32, UTF-32BE, UTF-32LE
+ We implement these because they are part of Unicode 3.1.
+ * UTF-7
+ We implement this because it is essential functionality for mail
+ applications.
+ * C99
+ We implement it because it's used for C and C++ programs and because
+ it's a nice encoding for debugging.
+ * JAVA
+ We implement it because it's used for Java programs and because it's
+ a nice encoding for debugging.
+ * UNICODE (big endian), UNICODEFEFF (little endian)
+ We DON'T implement these because they are stupid and not standardized.
+ Full Unicode, in terms of `uint16_t' or `uint32_t'
+ (with machine dependent endianness and alignment)
+ * UCS-2-INTERNAL, UCS-4-INTERNAL
+ We implement these because they are the preferred internal
+ representation of strings in Unicode aware applications.
+
+Q: Support encodings mentioned in RFC 1345 ?
+A: No, they are not in use any more. Supporting ISO-646 variants is pointless
+ since ISO-8859-* have been adopted.
+
+Q: Support EBCDIC ?
+A: No!
+
+Q: How do I add a new character set?
+A: 1. Explain the "why" in this file, above.
+ 2. You need to have a conversion table from/to Unicode. Transform it into
+ the format used by the mapping tables found on ftp.unicode.org: each line
+ contains the character code, in hex, with 0x prefix, then whitespace,
+ then the Unicode code point, in hex, 4 hex digits, with 0x prefix. '#'
+ counts as a comment delimiter until end of line.
+ Please also send your table to Mark Leisher <mleisher@crl.nmsu.edu> so he
+ can include it in his collection.
+ 3. If it's an 8-bit character set, use the '8bit_tab_to_h' program in the
+ tools directory to generate the C code for the conversion. You may tweak
+ the resulting C code if you are not satisfied with its quality, but this
+ is rarely needed.
+ If it's a two-dimensional character set (with rows and columns), use the
+ 'cjk_tab_to_h' program in the tools directory to generate the C code for
+ the conversion. You will need to modify the main() function to recognize
+ the new character set name, with the proper dimensions, but that shouldn't
+ be too hard. This yields the CCS. The CES you have to write by hand.
+ 4. Store the resulting C code file in the lib directory. Add a #include
+ directive to converters.h, and add an entry to the encodings.def file.
+ 5. Compile the package, and test your new encoding using a program like
+ iconv(1) or clisp(1).
+ 6. Augment the testsuite: Add a line to each of tests/Makefile.in,
+ tests/Makefile.msvc and tests/Makefile.os2. For a stateless encoding,
+ create the complete table as a TXT file. For a stateful encoding,
+ provide a text snippet encoded using your new encoding and its UTF-8
+ equivalent.
+ 7. Update the README and man/iconv_open.3, to mention the new encoding.
+ Add a note in the NEWS file.
+
+Q: What about bidirectional text? Should it be tagged or reversed when
+ converting from ISO-8859-8 or ISO-8859-6 to Unicode? Qt appears to do
+ this, see qt-2.0.1/src/tools/qrtlcodec.cpp.
+A: After reading RFC 1556: I don't think so. Support for ISO-8859-8-I and
+ ISO-8859-E remains to be implemented.
+ On the other hand, a page on www.w3c.org says that ISO-8859-8 in *email*
+ is visually encoded, ISO-8859-8 in *HTML* is logically encoded, i.e.
+ the same as ISO-8859-8-I. I'm confused.
+
+Other character sets not implemented:
+"MNEMONIC" = "csMnemonic"
+"MNEM" = "csMnem"
+"ISO-10646-UCS-Basic" = "csUnicodeASCII"
+"ISO-10646-Unicode-Latin1" = "csUnicodeLatin1" = "ISO-10646"
+"ISO-10646-J-1"
+"UNICODE-1-1" = "csUnicode11"
+"csWindows31Latin5"
+
+Other aliases not implemented (and not implemented in glibc-2.1 either):
+ From MSIE4:
+ ISO-8859-1: alias ISO8859-1
+ ISO-8859-2: alias ISO8859-2
+ KSC_5601: alias KS_C_5601
+ UTF-8: aliases UNICODE-1-1-UTF-8 UNICODE-2-0-UTF-8
+
+
+Q: How can I integrate libiconv into my package?
+A: Just copy the entire libiconv package into a subdirectory of your package.
+ At configuration time, call libiconv's configure script with the
+ appropriate --srcdir option and maybe --enable-static or --disable-shared.
+ Then "cd libiconv && make && make install-lib libdir=... includedir=...".
+ 'install-lib' is a special (not GNU standardized) target which installs
+ only the include file - in $(includedir) - and the library - in $(libdir) -
+ and does not use other directory variables. After "installing" libiconv
+ in your package's build directory, building of your package can proceed.
+
+Q: Why is the testsuite so big?
+A: Because some of the tests are very comprehensive.
+ If you don't feel like using the testsuite, you can simply remove the
+ tests/ directory.
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/PORTS b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/PORTS
new file mode 100644
index 00000000..2c4cfa03
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/PORTS
@@ -0,0 +1,46 @@
+* Linux with libc6 (glibc-2.1):
+ OK
+
+* Linux with libc6 (glibc-2.0.7):
+ OK
+
+* Linux with libc5:
+ OK
+
+* Solaris 2.7:
+ OK
+
+* Solaris 2.6:
+ OK
+
+* OSF/1 5.1:
+ OK
+
+* OSF/1 4.0d:
+ OK
+
+* Irix 6.5:
+ OK
+
+* HP-UX 10.20:
+ OK
+
+* AIX 4.2:
+ OK
+
+* SunOS 4:
+ OK when configured --enable-static --disable-shared
+ (gcc cannot create shared libraries without relocations)
+
+* FreeBSD 3.3:
+ OK
+
+* BeOS 5:
+ OK
+
+* Woe32 with MSVC 4.0:
+ OK
+
+* Woe32 with MSVC 5.0:
+ OK
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/README b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/README
new file mode 100644
index 00000000..e07ba0f0
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/README
@@ -0,0 +1,149 @@
+ GNU LIBICONV - character set conversion library
+
+This library provides an iconv() implementation, for use on systems which
+don't have one, or whose implementation cannot convert from/to Unicode.
+
+It provides support for the encodings:
+
+ European languages
+ ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16},
+ KOI8-R, KOI8-U, KOI8-RU,
+ CP{1250,1251,1252,1253,1254,1257}, CP{850,866},
+ Mac{Roman,CentralEurope,Iceland,Croatian,Romania},
+ Mac{Cyrillic,Ukraine,Greek,Turkish},
+ Macintosh
+ Semitic languages
+ ISO-8859-{6,8}, CP{1255,1256}, CP862, Mac{Hebrew,Arabic}
+ Japanese
+ EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-2, ISO-2022-JP-1
+ Chinese
+ EUC-CN, HZ, GBK, GB18030, EUC-TW, BIG5, CP950, BIG5-HKSCS,
+ ISO-2022-CN, ISO-2022-CN-EXT
+ Korean
+ EUC-KR, CP949, ISO-2022-KR, JOHAB
+ Armenian
+ ARMSCII-8
+ Georgian
+ Georgian-Academy, Georgian-PS
+ Tajik
+ KOI8-T
+ Thai
+ TIS-620, CP874, MacThai
+ Laotian
+ MuleLao-1, CP1133
+ Vietnamese
+ VISCII, TCVN, CP1258
+ Platform specifics
+ HP-ROMAN8, NEXTSTEP
+ Full Unicode
+ UTF-8
+ UCS-2, UCS-2BE, UCS-2LE
+ UCS-4, UCS-4BE, UCS-4LE
+ UTF-16, UTF-16BE, UTF-16LE
+ UTF-32, UTF-32BE, UTF-32LE
+ UTF-7
+ C99, JAVA
+ Full Unicode, in terms of `uint16_t' or `uint32_t'
+ (with machine dependent endianness and alignment)
+ UCS-2-INTERNAL, UCS-4-INTERNAL
+ Locale dependent, in terms of `char' or `wchar_t'
+ (with machine dependent endianness and alignment, and with OS and
+ locale dependent semantics)
+ char, wchar_t
+ The empty encoding name "" is equivalent to "char": it denotes the
+ locale dependent character encoding.
+
+When configured with the option --enable-extra-encodings, it also provides
+support for a few extra encodings:
+
+ European languages
+ CP{437,737,775,852,853,855,857,858,860,861,863,865,869,1125}
+ Semitic languages
+ CP864
+ Japanese
+ EUC-JISX0213, Shift_JISX0213, ISO-2022-JP-3
+ Turkmen
+ TDS565
+ Platform specifics
+ RISCOS-LATIN1
+
+It can convert from any of these encodings to any other, through Unicode
+conversion.
+
+It has also some limited support for transliteration, i.e. when a character
+cannot be represented in the target character set, it can be approximated
+through one or several similarly looking characters. Transliteration is
+activated when "//TRANSLIT" is appended to the target encoding name.
+
+libiconv is for you if your application needs to support multiple character
+encodings, but that support lacks from your system.
+
+Installation:
+
+As usual for GNU packages:
+
+ $ ./configure --prefix=/usr/local
+ $ make
+ $ make install
+
+After installing GNU libiconv for the first time, it is recommended to
+recompile and reinstall GNU gettext, so that it can take advantage of
+libiconv.
+
+On systems other than GNU/Linux, the iconv program will be internationalized
+only if GNU gettext has been built and installed before GNU libiconv. This
+means that the first time GNU libiconv is installed, we have a circular
+dependency between the GNU libiconv and GNU gettext packages, which can be
+resolved by building and installing either
+ - first libiconv, then gettext, then libiconv again,
+or (on systems supporting shared libraries, excluding AIX)
+ - first gettext, then libiconv, then gettext again.
+Recall that before building a package for the second time, you need to erase
+the traces of the first build by running "make distclean".
+
+This library can be built and installed in two variants:
+
+ - The library mode. This works on all systems, and uses a library
+ `libiconv.so' and a header file `<iconv.h>'. (Both are installed
+ through "make install".)
+
+ To use it, simply #include <iconv.h> and use the functions.
+
+ To use it in an autoconfiguring package:
+ - If you don't use automake, append m4/iconv.m4 to your aclocal.m4
+ file.
+ - If you do use automake, add m4/iconv.m4 to your m4 macro repository.
+ - Add to the link command line of libraries and executables that use
+ the functions the placeholder @LIBICONV@ (or, if using libtool for
+ the link, @LTLIBICONV@). If you use automake, the right place for
+ these additions are the *_LDADD variables.
+ Note that 'iconv.m4' is also part of the GNU gettext package, which
+ installs it in /usr/local/share/aclocal/iconv.m4.
+
+ - The libc plug/override mode. This works on GNU/Linux, Solaris and OSF/1
+ systems only. It is a way to get good iconv support without having
+ glibc-2.1.
+ It installs a library `libiconv_plug.so'. This library can be used with
+ LD_PRELOAD, to override the iconv* functions present in the C library.
+
+ On GNU/Linux and Solaris:
+ $ export LD_PRELOAD=/usr/local/lib/libiconv_plug.so
+
+ On OSF/1:
+ $ export _RLD_LIST=/usr/local/lib/libiconv_plug.so:DEFAULT
+
+ A program's source need not be modified, the program need not even be
+ recompiled. Just set the LD_PRELOAD environment variable, that's it!
+
+
+Distribution:
+ ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.2.tar.gz
+
+Homepage:
+ http://www.gnu.org/software/libiconv/
+
+Bug reports to:
+ <bug-gnu-libiconv@gnu.org>
+
+
+Bruno Haible <bruno@clisp.org>
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/THANKS b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/THANKS
new file mode 100644
index 00000000..35fc2eab
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/THANKS
@@ -0,0 +1,13 @@
+ Thanks to for
+
+Edmund Grimley Evans <edmundo@rano.org> bug reports
+
+Taro Muraoka <koron@tka.att.ne.jp> Woe32 DLL support
+
+Akira Hatakeyama <akira@sra.co.jp> OS/2 support
+
+Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>
+ DOS/DJGPP support
+
+Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> advice on EUC-JP and JISX0213
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/djgpp/README b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/djgpp/README
new file mode 100644
index 00000000..dfcc894b
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/djgpp/README
@@ -0,0 +1,122 @@
+This is a port of GNU Libiconv 1.8 to MSDOS/DJGPP.
+
+1.: DJGPP specific changes.
+ =======================
+ There are no DJGPP specific changes. This package should
+ configure and compile out-of-the-box.
+ Please read the documentation to become familiar with this
+ product.
+
+
+2.: Installing the binary package.
+ ==============================
+
+2.1.: Copy the binary distribution into the top DJGPP installation
+ directory and unzip the binary distribution running *ONE* of
+ the following commands:
+ unzip32 licv18b.zip or
+ djtarx licv18b.zip or
+ pkunzip -d licv18b.zip
+
+
+
+3.: Building the binaries from sources.
+ ===================================
+
+3.1.: To build the binaries you will need the following binary packages:
+ djdev203.zip, bsh204b.zip, gcc2952b.zip,
+ bnu210b.zip, mak3791b.zip, fil316b.zip,
+ shl112b.zip, txt20b.zip, txi40b.zip,
+ grep24b.zip and sed302b.zip
+
+
+ All this packages can be found in the v2gnu directory of any
+ Simtel.NET mirror.
+ You will need bsh204b.zip and *NOT* a prior version or the build will fail.
+ The same applies to djdev203.zip. You *MUST* use the updated versions of
+ fil316b.zip (date: 2000-05-30) and shl112b.zip (date: 2000-08-11). This
+ updated versions have been recompiled with djdev203.zip and know about
+ the "/dev/env" functionality introduced with djdev203.zip. All the other
+ packages are the ones I have used to build the binaries from this sources.
+ Previuos and/or later versions of this packages may do the job as well but
+ I have not tested this.
+
+3.2.: Create a temporary directory and copy the source package: licv18s.zip
+ into the temporary directory. If you download the source distribution
+ from one of the DJGPP archives, just unzip it preserving the directory
+ structure, runnig ONE of the following commands:
+ unzip32 licv18s.zip or
+ djtarx licv18s.zip or
+ pkunzip -d licv18s.zip
+
+ Source distributions downloaded from one of the GNU FTP sites need
+ some more work to unpack. First, you MUST use the `djtar' program to
+ unzip the package. That's because some file names in the official
+ distributions need to be changed to avoid problems on the various
+ platforms supported by DJGPP. `djtar' can rename 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 file, and then invoke `djtar' to unpack the
+ distribution. Here's how:
+
+ djtar -x -p -o libiconv-1.7/djgpp/fnchange.lst libiconv-1.7.tar.gz > lst
+ djtar -x -n lst libiconv-1.7.tar.gz
+
+ (The name of the distribution archive and the top-level directory will
+ be different for versions other than 1.7.)
+
+3.3.: The package is preconfigured for djdev203. To build the products you
+ should run the following command:
+ make
+
+ After the compilation has finished, you can check the products
+ running the command:
+ make check
+
+ To install the products run the command:
+ make install
+
+ This will install the products (iconv.exe iconv.h localcharset.h libconv.a
+ libcharset.a iconv.1 iconv.3 iconv_open.3 iconv_close.3) into your DJGPP
+ installation tree. As usual, prefix is defined as "/dev/env/DJDIR".
+ If you prefer to install into same other directory run the command:
+ make install prefix=z:/some/other/dir
+
+ Of course, you should replace "z:/some/other/dir" by an appropriate path
+ that will meet your requeriments.
+
+3.4.: If you need/want to reconfigure the package you will have to run the
+ following commands:
+ make distclean
+ djgpp\config
+
+ Please note that you *MUST* use the "distclean" option or the config.cache
+ file will *NOT* be deleted. In this case you are *NOT* reconfiguring
+ because the configuration informations is 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\libiconv.18\djgpp\config x:/src/gnu/libiconv.18
+
+ 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\libiconv.18\djgpp\config x:/src/gnu/libiconv.18
+
+ You *MUST* use forward slashes to specify the source directory.
+ After having configured the package run the folowing commands to create
+ the binaries and docs and install them:
+ make
+ make check
+ make install
+
+ Send suggestions and bug reports concerning the DJGPP port to
+ comp.os.msdos.djgpp or djgpp@delorie.com. Libiconv specific bugs
+ must be reported to Bruno Haible <haible@clisp.cons.org>.
+
+
+ Guerrero, Juan Manuel <st001906@hrz1.hrz.tu-darmstadt.de>
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/extras/ChangeLog b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/extras/ChangeLog
new file mode 100644
index 00000000..e74835b0
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/extras/ChangeLog
@@ -0,0 +1,64 @@
+2003-05-10 Bruno Haible <bruno@clisp.org>
+
+ * iconv_string.c (iconv_string): Don't return -1 just because the
+ string is longer than 4 KB.
+
+2002-02-13 Bruno Haible <bruno@clisp.org>
+
+ * iconv.m4: Remove file. Obsoleted by m4/iconv.m4.
+
+2000-06-16 Bruno Haible <haible@clisp.cons.org>
+
+ * iconv.m4: Change prefix to AM.
+
+2001-05-23 Bruno Haible <haible@clisp.cons.org>
+
+ * iconv.m4 (jm_ICONV): Accept --with-libiconv-prefix option.
+
+2001-03-23 Bruno Haible <haible@clisp.cons.org>
+
+ * iconv.m4 (jm_ICONV): Tweak printing of prototype.
+
+2001-03-20 Bruno Haible <haible@clisp.cons.org>
+
+ * iconv.m4 (jm_ICONV): Recommend GNU libiconv.
+
+2001-01-03 Bruno Haible <haible@clisp.cons.org>
+
+ * iconv.m4 (jm_ICONV): Also check whether the iconv declaration
+ has const.
+
+2000-02-02 Bruno Haible <haible@clisp.cons.org>
+
+ * iconv.m4: New file.
+
+2001-01-29 Bruno Haible <haible@clisp.cons.org>
+
+ * locale_charset.c: Remove file. Obsoleted by libcharset.
+
+2000-10-22 Bruno Haible <haible@clisp.cons.org>
+
+ * locale_charset.c (get_locale_charset): Accept french and spanish
+ names in both ISO-8859-1 and UTF-8.
+
+2000-08-24 Jim Blackson <blackson@ontrack-japan.com>
+
+ * iconv_string.c (iconv_string): Fix return value for autodetect.
+
+2000-01-24 Bruno Haible <haible@clisp.cons.org>
+
+ * iconv_string.c (iconv_string): Stop recognizing JOHAB.
+ Fix typo for EUC-JP.
+
+1999-12-18 Bruno Haible <haible@clisp.cons.org>
+
+ * locale_charset.c (get_locale_charset): Recognize more language codes:
+ "af" (afrikaans), "ca" (catalan), "eu" (basque), "fo" (faeroese),
+ "ga" (irish), "gd" (scottish), "gl" (galician), "sq" (albanian),
+ "eo" (esperanto), "mt" (maltese), "be" (byelorussian),
+ "et" (estonian), "lt" (lithuanian), "lv" (latvian), "uk" (ukrainian).
+ Recognize more aliases: "english", "slovenian", "macedonian",
+ "serbian", "arabic".
+ Change default: KOI8-R for "ru" (russian) instead of ISO-8859-5,
+ ISO-8859-5 for "sr" instead of ISO-8859-2.
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/AUTHORS b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/AUTHORS
new file mode 100644
index 00000000..8bedd794
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/AUTHORS
@@ -0,0 +1 @@
+Bruno Haible <bruno@clisp.org>
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/ChangeLog b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/ChangeLog
new file mode 100644
index 00000000..1be73272
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/ChangeLog
@@ -0,0 +1,322 @@
+2003-06-18 Bruno Haible <bruno@clisp.org>
+
+ * config/install-sh: Update from automake-1.7.5.
+
+2003-06-07 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.devel (config.h_vms): Remove INSTALLPREFIX.
+ Reported by Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+
+2003-05-19 Bruno Haible <bruno@clisp.org>
+
+ * windows/charset.rc: Include <winver.h>.
+ Reported by Perry Rapp.
+
+2003-05-07 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.vms: New file.
+ * Makefile.devel (config.h_vms): New rule.
+ (all): Depend on it.
+
+2003-05-06 Bruno Haible <bruno@clisp.org>
+
+ * m4/libtool.m4: Update from GNU gettext, based on libtool-1.5.
+
+2003-05-06 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/config.guess: Update to GNU version 2003-02-22.
+ * autoconf/config.sub: Likewise.
+
+2003-05-06 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/ltmain.sh: Update from GNU gettext, based on libtool-1.5.
+
+2003-04-12 Bruno Haible <bruno@clisp.org>
+
+ * configure.in (mandir): Change default value.
+ * Makefile.in (datadir): New variable.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ Support for relocatable installation.
+ * autoconf/config.libpath: New file, from GNU gettext.
+ * configure.in: Invoke AC_RELOCATABLE_LIBRARY.
+ * include/libcharset.h.in: New file.
+ * Makefile.devel (include/libcharset.h.msvc-shared): New rule.
+ (all): Depend on it.
+ (autoconf/aclocal.m4): Update aclocal invocation.
+ (config.h.msvc): Handle INSTALLPREFIX.
+ * Makefile.in (include/libcharset.h): New rule.
+ (all): Depend on it.
+ (install-lib, install): Also install libcharset.h.
+ (uninstall): Uninstall libcharset.h.
+ (distclean, maintainer-clean): Remove include/libcharset.h.
+ * Makefile.msvc (all): Create include/libcharset.h.
+ (install): Also install libcharset.h.
+ (uninstall): Uninstall libcharset.h.
+ (mostlyclean, clean, distclean, maintainer-clean): Remove
+ include/libcharset.h.
+ * INSTALL.generic: Document --enable-relocatable and
+ --with-libintl-prefix. Remove the recommendation to set CPPFLAGS and
+ LDFLAGS. The lib-link.m4 macros make this unnecessary.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.msvc (PREFIX): New variable.
+ (prefix): Use it.
+ (distclean, maintainer-clean): Drop Unix specific removals.
+ * man/Makefile.msvc (PREFIX): New variable.
+ (prefix): Use it.
+ (clean): Drop unnecessary removals.
+ (distclean): Drop Unix specific removal.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ * configure.in: Invoke AM_LANGINFO_CODESET, not jm_LANGINFO_CODESET.
+ * autoconf/ltmain.sh: Update from GNU gettext.
+ 2003-02-18 Bruno Haible <bruno@clisp.org>
+ Fix the 2002-09-16 fix.
+ * ltmain.sh (install): If "ln -s -f" fails (this is the case
+ with /usr/bin/ln on Solaris 2.7), fall back to "rm && ln -s".
+
+2003-03-17 Bruno Haible <bruno@clisp.org>
+
+ Improved MSVC support.
+ * windows/charset.rc: New file.
+ * Makefile.msvc (prefix): Use less Unixy value.
+ (local_prefix): Remove variable.
+ (libdir, includedir): Use backslashes.
+ (bindir): New variable.
+ (mandir): Remove variable.
+ (INSTALL, INSTALL_PROGRAM, INSTALL_DATA): New variables.
+ (mostlyclean, clean): Remove config.h and include/localcharset.h.
+ (install, installdirs, uninstall): Rewritten.
+ * README.woe32: Mention automatic installation command.
+
+ Rename libcharset.h to localcharset.h.
+ * include/localcharset.h.in: Renamed from include/libcharset.h.in.
+ * tools/locale_charset.c: Include localcharset.h, not libcharset.h.
+ * Makefile.in (include/localcharset.h): Renamed from
+ include/libcharset.h.
+ (all): Update dependency.
+ (install-lib, install, uninstall, distclean, maintainer-clean): Update.
+ * Makefile.msvc (all): Create include/localcharset.h, not
+ include/libcharset.h.
+ * Makefile.devel (include/localcharset.h.msvc-shared): Renamed from
+ include/libcharset.h.msvc-shared.
+ (all): Update dependency.
+ (config.h.in): Touch the file when done; autoheader doesn't do it.
+ (config.h.msvc): Make rule more robust.
+ * INTEGRATE: Mention localcharset.h only once.
+ * djgpp/README.in, djgpp/README: Update.
+ * djgpp/config.bat: Update.
+ * djgpp/config.sed: Update.
+ * djgpp/fnchange.in, djgpp/fnchange.lst: Update.
+ * configure.in (VERSION): Bump to 1.2.
+ * NEWS: New file.
+
+2003-02-14 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.devel (AUTOCONF): Switch to autoconf-2.57.
+ (configure, config.h.in): Update rules.
+
+2003-01-03 Albert Chin <libtool@thewrittenword.com>
+
+ * autoconf/ltmain.sh: Don't pass -R flags found in a .la's
+ dependency_libs variable directly down to the linker.
+ Reported by Tim Mooney <mooney@dogbert.cc.ndsu.nodak.edu>.
+
+2003-01-12 Bruno Haible <bruno@clisp.org>
+
+ * INTEGRATE: Mention localcharset.h.
+
+2003-01-01 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.in (mkinstalldirs): Renamed from MKINSTALLDIRS.
+ (install-lib, install, installdirs): Use it.
+
+2002-09-27 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/mkinstalldirs: Upgrade to automake-1.7.2 version.
+
+2002-11-07 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/ltmain.sh: Upgrade to libtool-1.4.3.
+
+2002-06-12 Bruno Haible <bruno@clisp.org>
+
+ * configure.in: Use new AC_* names of libtool macros. Invoke
+ AC_LIBTOOL_WIN32_DLL.
+
+2002-11-07 Bruno Haible <bruno@clisp.org>
+
+ Make "make install" without prior "make" work.
+ * Makefile.in (install): Depend on include/libcharset.h.
+ Reported by Martin Mokrejš <mmokrejs@natur.cuni.cz>.
+
+2002-05-12 Bruno Haible <bruno@clisp.org>
+
+ * tools/all-charsets: Update for change of lib/config.charset.
+
+2002-05-12 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.devel (AUTOCONF): New variable.
+ (configure): Use the AUTOCONF variable.
+
+2002-05-08 Bruno Haible <bruno@clisp.org>
+
+ * README.woe32: Renamed from README.win32.
+
+2002-02-06 Bruno Haible <bruno@clisp.org>
+
+ * m4/libtool.m4: Upgrade to libtool-1.4.2.
+ * autoconf/ltmain.sh: Likewise.
+
+2002-02-02 Bruno Haible <bruno@clisp.org>
+
+ * autoconf/ltmain.sh: Add DESTDIR support on ELF systems.
+
+2001-11-03 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/ltmain.sh: chmod 777 the .libs directory, so that
+ "make install" succeeds.
+
+2001-12-04 Bruno Haible <bruno@clisp.org>
+
+ * INTEGRATE: Change the install rule to not create $(libdir) if
+ there is no file to install in it.
+
+2001-07-17 Bruno Haible <haible@clisp.cons.org>
+
+ * configure.in (VERSION): Bump to 1.1.
+
+2001-06-08 Bruno Haible <haible@clisp.cons.org>
+
+ * m4/libtool.m4: Upgrade to libtool-1.4.
+ * autoconf/ltmain.sh: Likewise.
+ * autoconf/ltconfig: Remove file.
+
+2001-06-08 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/config.guess: Update to GNU version 2001-05-11.
+ * autoconf/config.sub: Likewise.
+
+2001-05-21 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (include/libcharset.h): New target.
+ (all): Depend on it.
+
+2001-05-11 Bruno Haible <haible@clisp.cons.org>
+
+ * INTEGRATE (Makefile.in): Fix syntax error.
+
+2001-05-06 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc (config.h): Allow the 'del' command to fail.
+
+2001-03-21 Bruno Haible <haible@clisp.cons.org>
+
+ * INSTALL.generic (Particular Systems): Add recommendations for AIX 3.
+
+2001-03-10 Bruno Haible <haible@clisp.cons.org>
+
+ * INSTALL.generic: New section "Particular Systems".
+
+2001-03-05 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/all-charsets: Update for change of lib/config.charset.
+
+2001-03-01 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/all-charsets: Update for change of lib/config.charset.
+
+2001-02-25 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/ltconfig:
+ sed -e 's/reload object files/produce relocatable object files/'.
+
+2001-02-25 Bruno Haible <haible@clisp.cons.org>
+
+ * include/libcharset.h.in (locale_charset): Return value is never
+ NULL any more.
+
+2001-02-22 Bruno Haible <haible@clisp.cons.org>
+
+ * INTEGRATE (Makefile.am): Change $@-t to t-$@. For DJGPP.
+ Patch by Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>.
+
+2001-02-20 Bruno Haible <haible@clisp.cons.org>
+
+ Better support for DOS/Windows platforms.
+ * autoconf/ltconfig: Upgrade to libtool-1.3.5.
+ * autoconf/ltmain.sh: Likewise.
+ * m4/libtool.m4: Likewise.
+ * autoconf/aclocal.m4: Likewise.
+ * configure.in: Call AC_OBJEXT and AC_EXEEXT.
+
+2001-02-20 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (libdir, includedir, mandir): Use the autoconf
+ determined value, in order to respect the configure arguments.
+ * lib/Makefile.in (libdir): Likewise.
+
+2000-12-13 Bruno Haible <haible@clisp.cons.org>
+
+ * autoconf/install-sh: Update to a newer version from fileutils.
+
+2000-12-12 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in: Use $(MAKE) instead of $(MAKE) -r. Needed with Solaris
+ "make", which doesn't set MAKE as expected by @SET_MAKE@ if -r is
+ given. Reported by Toshimitsu Fujiwara.
+
+2000-12-08 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (exec_prefix): Use configure's --exec-prefix argument.
+
+2000-12-02 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc (check): Depend on target 'force' as well.
+ (mostlyclean, clean, distclean, maintainer-clean): Fix dependency.
+
+ * Makefile.msvc: Replace STATIC with its opposite flag, DLL.
+
+2000-11-24 Bruno Haible <haible@clisp.cons.org>
+
+ * tools/all-charsets: Update for 2000-10-31 change of
+ lib/config.charset.
+
+2000-11-23 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (install-lib): Fix for builddir != srcdir.
+
+2000-11-22 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (all): Fix for builddir != srcdir.
+
+2000-11-21 Bruno Haible <haible@clisp.cons.org>
+
+ * include/libcharset.h.in: Renamed from include/libcharset.h.
+ * windows/dllexport.h: New file.
+ * Makefile.devel (all): Add config.h.msvc,
+ include/libcharset.h.msvc-shared.
+ (config.h.msvc, include/libcharset.h.msvc-shared): New targets.
+ * Makefile.msvc (MFLAGS): New variable.
+ (all): Create include\libcharset.h.
+ (distclean, maintainer-clean): Remove include\libcharset.h.
+ * Makefile.in (CP): New variable.
+ (all): Create include/libcharset.h.
+ (distclean, maintainer-clean): Remove include/libcharset.h.
+
+2000-11-18 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.devel (config.h.in): Rename from config.h.
+
+2000-11-16 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in: After "cd", use "&&" not ";".
+
+2000-10-31 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc: New file.
+ * README.win32: New file.
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/NEWS b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/NEWS
new file mode 100644
index 00000000..7e82f6c1
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/NEWS
@@ -0,0 +1,2 @@
+New in 1.2:
+* The include file is renamed from "libcharset.h" to "localcharset.h".
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/README b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/README
new file mode 100644
index 00000000..9f4cf7b4
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/README
@@ -0,0 +1,60 @@
+ LIBCHARSET - portable character set determination library
+
+This library provides a function which determines the character set / encoding
+of text in the currently selected locale (the LC_CTYPE locale facet).
+
+It is useful for portable programs which need to process text in other
+encodings and locales than the currently selected one. Possible uses:
+
+ * Use of Unicode in POSIX compliant applications.
+ * Conversion of text between the current locale's encoding and UTF-8 (or
+ any other given encoding).
+ * Mail agents.
+
+In theory, this would be very simple: The Single Unix Specification (SUSV2)
+provides the nl_langinfo function, in such a way that
+
+ nl_langinfo (CODESET)
+
+returns the encoding name. But the nl_langinfo function still does not exist
+on some systems, and on those where it exists it returns unstandardized
+variations of the encoding names, like (on Solaris) "PCK" for "Shift_JIS".
+
+This library fixes these flaws and provides a function
+
+ const char * locale_charset (void);
+
+It determines the current locale's character encoding, and canonicalizes it
+into one of the canonical names listed in config.charset. The result must
+not be freed; it is statically allocated. If the canonical name cannot be
+determined, the result is a non-canonical name.
+
+
+Installation:
+
+As usual for GNU packages:
+
+ $ ./configure --prefix=/usr/local
+ $ make
+ $ make install
+
+
+This library is used in
+ GNU sh-utils, fileutils, textutils
+ GNU gettext
+ GNU clisp
+
+
+To integrate this library into your package:
+See file INTEGRATE.
+
+
+Distribution:
+ The libcharset directory of
+ ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.8.tar.gz
+
+Homepage:
+ http://www.haible.de/bruno/packages-libcharset.html
+
+
+Bruno Haible <bruno@clisp.org>
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/djgpp/README b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/djgpp/README
new file mode 100644
index 00000000..27c44a27
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/djgpp/README
@@ -0,0 +1,123 @@
+This is a port of GNU Libiconv 1.7 to MSDOS/DJGPP.
+
+1.: DJGPP specific changes.
+ =======================
+ There are no DJGPP specific changes. This package should
+ configure and compile out-of-the-box.
+ Please read the documentation to become familiar with this
+ product.
+
+
+2.: Installing the binary package.
+ ==============================
+
+2.1.: Copy the binary distribution into the top DJGPP installation
+ directory and unzip the binary distribution running *ONE* of
+ the following commands:
+ unzip32 licv16b.zip or
+ djtarx licv16b.zip or
+ pkunzip -d licv16b.zip
+
+
+
+3.: Building the binaries from sources.
+ ===================================
+
+3.1.: To build the binaries you will need the following binary packages:
+ djdev203.zip, bsh204b.zip, gcc2952b.zip,
+ bnu210b.zip, mak3791b.zip, fil316b.zip,
+ shl112b.zip, txt20b.zip, txi40b.zip,
+ grep24b.zip and sed302b.zip
+
+
+ All this packages can be found in the v2gnu directory of any
+ Simtel.NET mirror.
+ You will need bsh204b.zip and *NOT* a prior version or the build will fail.
+ The same applies to djdev203.zip. You *MUST* use the updated versions of
+ fil316b.zip (date: 2000-05-30) and shl112b.zip (date: 2000-08-11). This
+ updated versions have been recompiled with djdev203.zip and know about
+ the "/dev/env" functionality introduced with djdev203.zip. All the other
+ packages are the ones I have used to build the binaries from this sources.
+ Previuos and/or later versions of this packages may do the job as well but
+ I have not tested this.
+
+3.2.: Create a temporary directory and copy the source package: licv16s.zip
+ into the temporary directory. If you download the source distribution
+ from one of the DJGPP archives, just unzip it preserving the directory
+ structure, runnig ONE of the following commands:
+ unzip32 licv16s.zip or
+ djtarx licv16s.zip or
+ pkunzip -d licv16s.zip
+
+ Source distributions downloaded from one of the GNU FTP sites need
+ some more work to unpack. First, you MUST use the `djtar' program to
+ unzip the package. That's because some file names in the official
+ distributions need to be changed to avoid problems on the various
+ platforms supported by DJGPP. `djtar' can rename 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 file, and then invoke `djtar' to unpack the
+ distribution. Here's how:
+
+ djtar -x -p -o libiconv-1.7/djgpp/fnchange.lst libiconv-1.7.tar.gz > lst
+ djtar -x -n lst libiconv-1.7.tar.gz
+
+ (The name of the distribution archive and the top-level directory will
+ be different for versions other than 1.7.)
+
+
+3.3.: The package is preconfigured for djdev203. To build the products you
+ should run the following command:
+ make
+
+ After the compilation has finished, you can check the products
+ running the command:
+ make check
+
+ To install the products run the command:
+ make install
+
+ This will install the products (iconv.exe iconv.h localcharset.h libconv.a
+ libcharset.a iconv.1 iconv.3 iconv_open.3 iconv_close.3) into your DJGPP
+ installation tree. As usual, prefix is defined as "/dev/env/DJDIR".
+ If you prefer to install into same other directory run the command:
+ make install prefix=z:/some/other/dir
+
+ Of course, you should replace "z:/some/other/dir" by an appropriate path
+ that will meet your requeriments.
+
+3.4.: If you need/want to reconfigure the package you will have to run the
+ following commands:
+ make distclean
+ djgpp\config
+
+ Please note that you *MUST* use the "distclean" option or the config.cache
+ file will *NOT* be deleted. In this case you are *NOT* reconfiguring
+ because the configuration informations is 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\libiconv.16\djgpp\config x:/src/gnu/libiconv.16
+
+ 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\libiconv.16\djgpp\config x:/src/gnu/libiconv.16
+
+ You *MUST* use forward slashes to specify the source directory.
+ After having configured the package run the folowing commands to create
+ the binaries and docs and install them:
+ make
+ make check
+ make install
+
+ Send suggestions and bug reports concerning the DJGPP port to
+ comp.os.msdos.djgpp or djgpp@delorie.com. Libiconv specific bugs
+ must be reported to Bruno Haible <haible@clisp.cons.org>.
+
+
+ Guerrero, Juan Manuel <st001906@hrz1.hrz.tu-darmstadt.de>
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/lib/ChangeLog b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/lib/ChangeLog
new file mode 100644
index 00000000..4cf95b4f
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/lib/ChangeLog
@@ -0,0 +1,302 @@
+2004-01-21 Bruno Haible <bruno@clisp.org>
+
+ Upgrade from gettext-0.14.
+
+ 2004-01-21 Bruno Haible <bruno@clisp.org>
+ * config.charset: Add support for MacOS X (Darwin).
+
+ 2003-12-02 Bruno Haible <bruno@clisp.org>
+ * config.charset: Treat the new country name CS like the old country
+ name YU.
+
+ 2003-08-20 Bruno Haible <bruno@clisp.org>
+ * config.charset (linux-gnulibc1*): Change hr_HR, ro_RO to ISO-8859-2.
+ Reported by Alain Guibert <derogaton+bgli@oreka.com>.
+
+ 2003-08-14 Bruno Haible <bruno@clisp.org>
+ * config.charset: Add support for Linux libc5. Based on data from
+ Alain Guibert <derogaton+bgli@oreka.com>.
+
+2003-06-27 Bruno Haible <bruno@clisp.org>
+
+ Avoid use of *_unlocked functions on Solaris 2.5.1.
+ * localcharset.c: Test HAVE_DECL_GETC_UNLOCKED, not HAVE_GETC_UNLOCKED.
+ Reported by Eric Botcazou <ebotcazou@libertysurf.fr>.
+
+2003-08-20 Bruno Haible <bruno@clisp.org>
+
+ * config.charset (linux-gnulibc1*): Change hr_HR, ro_RO to ISO-8859-2.
+ Reported by Alain Guibert <derogaton+bgli@oreka.com>.
+
+2003-08-14 Bruno Haible <bruno@clisp.org>
+
+ * config.charset: Add support for Linux libc5. Based on data from
+ Alain Guibert <derogaton+bgli@oreka.com>.
+
+2003-08-01 Bruno Haible <bruno@clisp.org>
+
+ * relocatable.c (find_shared_library_fullname): Disable the code on
+ Linux/libc5. Reported by Alain Guibert <derogaton+bgli@oreka.com>.
+
+2003-06-22 Bruno Haible <bruno@clisp.org>
+
+ Portability to mingw32.
+ * relocatable.c [WIN32]: Include <windows.h>.
+ Reported by Jeff Bonggren <jbon@cfl.rr.com>.
+
+2003-06-22 Bruno Haible <bruno@clisp.org>
+
+ * relocatable.c (compute_curr_prefix): Comment out this function in
+ the case when it is not used.
+ Reported by Pavel Roskin <proski@gnu.org>.
+
+2003-06-07 Bruno Haible <bruno@clisp.org>
+
+ Support for relocatable data files even on VMS.
+ * Makefile.vms (bindir): New variable.
+ (DEFS): Add flags for relocatability.
+ Reported by Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+
+2003-06-07 Bruno Haible <bruno@clisp.org>
+
+ Support for relocatable data files even on Woe32.
+ * Makefile.msvc (IIPREFIX, IIprefix, IIexec_prefix, IIbindir,
+ IIlibdir): New variables.
+ (PICFLAGS): Also define PIC. Define BUILDING_* flags here.
+ (CFLAGS): ... not here. Add flags for relocatability.
+
+2003-05-18 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.msvc (DEBUGFLAGS): New variable.
+ (charset.lib): Use it.
+
+2003-05-07 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.vms: New file.
+
+2003-04-12 Bruno Haible <bruno@clisp.org>
+
+ * lib/localcharset.c (get_charset_aliases): Add special case for VMS.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ Support for relocatable installation.
+ * relocatable.h: New file, from GNU gettext.
+ * relocatable.c: New file, from GNU gettext.
+ * localcharset.c: Update from GNU gettext.
+ 2003-02-28 Bruno Haible <bruno@clisp.org>
+ * localcharset.c: Include relocatable.h.
+ (get_charset_aliases): Relocate LIBDIR value.
+ * localcharset.c: Drop C linkage declaration.
+ * Makefile.in (DEFS): New variable.
+ (SOURCES): Add relocatable.c.
+ (OBJECTS): Add relocatable.lo.
+ (localcharset.lo): Use $(DEFS).
+ (relocatable.lo): New rule.
+ * Makefile.msvc (CFLAGS): Remove $(PICFLAGS).
+ (INCLUDES): Simplify.
+ (SOURCES): Remove variable.
+ (OBJECTS): Add relocatable.obj.
+ (localcharset.obj): Add $(PICFLAGS).
+ (relocatable.obj): New rule.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.msvc (PREFIX): New variable.
+ (prefix): Use it.
+ (clean): Drop Unix specific removal.
+
+2003-03-17 Bruno Haible <bruno@clisp.org>
+
+ Improved MSVC support.
+ * Makefile.msvc (prefix): Use less Unixy value.
+ (local_prefix): Remove variable.
+ (libdir): Use backslashes.
+ (bindir): New variable.
+ (INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Set to real values.
+ (RESOURCES): Enable charset.res.
+ (charset.lib): Set the target library name explicitly.
+ (charset.res): New rule.
+ (install, installdirs, uninstall): New rules.
+
+ Rename libcharset.h to localcharset.h.
+ * localcharset.c: Include localcharset.h.
+ * localcharset.h: Remove file.
+ * Makefile.in (INCLUDES): Add -I../include.
+ * Makefile.msvc (INCLUDES): Add -I../include.
+
+2003-01-29 Bruno Haible <bruno@clisp.org>
+
+ * config.charset: Add an alias for CP1251 on Solaris.
+ Reported by Hidetoshi Tajima <hidetoshi.tajima@sun.com>.
+
+2003-01-12 Bruno Haible <bruno@clisp.org>
+
+ * localcharset.h: New file.
+ * localcharset.c: Include it.
+
+2003-01-01 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.in (mkinstalldirs): Renamed from MKINSTALLDIRS.
+ (install-lib, install, installdirs): Use it.
+
+2002-05-09 Bruno Haible <bruno@clisp.org>
+
+ * config.charset: Update for newest glibc. Add canonical names
+ ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
+
+2002-05-09 Bruno Haible <bruno@clisp.org>
+
+ * localcharset.c (get_charset_aliases): Add more Windows specific
+ aliases.
+
+2002-05-08 Owen Taylor <otaylor@redhat.com>
+
+ * config.charset: A few additions for Solaris.
+
+2002-02-15 Bruno Haible <bruno@clisp.org>
+
+ * config.charset [msdosdjgpp]: For Russian, use CP866.
+
+2002-02-11 Bruno Haible <bruno@clisp.org>
+
+ * config.charset: Add support for NetBSD.
+
+2002-01-10 Andrew Zabolotny <zap@cobra.ru>
+ Bruno Haible <bruno@clisp.org>
+
+ * localcharset.c: Rework OS/2 support.
+ * config.charset: Add OS/2 support.
+
+2001-12-21 Bruno Haible <bruno@clisp.org>
+
+ * localcharset.c (ISSLASH): Provide definition for DOS-like systems.
+
+2001-12-15 Bruno Haible <bruno@clisp.org>
+
+ * localcharset.c: Add OS/2 support.
+
+2001-12-05 Bruno Haible <bruno@clisp.org>
+
+ * localcharset.c (locale_charset): Don't return an empty string.
+
+2001-10-23 Bruno Haible <haible@clisp.cons.org>
+
+ * config.charset: msdos in uk_UA uses CP1125.
+
+2001-08-05 Bruno Haible <haible@clisp.cons.org>
+
+ Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
+ * localcharset.c (locale_charset): Declare as extern "C".
+ (get_charset_aliases): Cast malloc and realloc results to 'char *'.
+
+2001-06-27 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (clean): Remove also *.o.lock, left there by libtool
+ on IRIX.
+
+2001-06-25 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (localcharset.lo): Mention $(INCLUDES) before $(CFLAGS)
+ and $(CPPFLAGS).
+ * Makefile.msvc (localcharset.obj): Likewise.
+
+2001-06-24 Bruno Haible <haible@clisp.cons.org>
+
+ * config.charset: Change canonical name of BIG5HKSCS to BIG5-HKSCS.
+ Change canonical name of SJIS to SHIFT_JIS.
+
+2001-05-06 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc (charset.lib): Allow the 'del' command to fail.
+
+2001-05-06 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (CPPFLAGS, LDFLAGS): New variables.
+ (libcharset.la): Use LDFLAGS.
+ (localcharset.lo): Use CPPFLAGS.
+
+2001-04-30 Bruno Haible <haible@clisp.cons.org>
+
+ Silence "gcc -Wall -Wwrite-strings" warnings.
+ * localcharset.c (charset_aliases): Change type to 'const char *'.
+ (get_charset_aliases): Change type of 'cp' to 'const char *'.
+
+2001-03-10 Bruno Haible <haible@clisp.cons.org>
+
+ * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
+ alias if codeset is empty.
+ * config.charset (BeOS): Use wildcard syntax.
+
+ * Makefile.in (libcharset.la): Pass flag -no-undefined. Needed on
+ platforms like BeOS.
+
+ * Makefile.in (RM): New variable.
+
+2001-01-05 Bruno Haible <haible@clisp.cons.org>
+
+ * localcharset.c (volatile): Define to empty if not using ANSI C.
+
+2001-03-05 Bruno Haible <haible@clisp.cons.org>
+
+ * config.charset: Update for OSF/1 5.1.
+
+2001-03-01 Bruno Haible <haible@clisp.cons.org>
+
+ * config.charset: For DOS/DJGPP, add CP775.
+
+2001-02-24 Bruno Haible <haible@clisp.cons.org>
+
+ * config.charset: Add support for DOS/DJGPP.
+
+2001-02-25 Bruno Haible <haible@clisp.cons.org>
+
+ * localcharset.c (locale_charset): Don't return NULL.
+
+2001-02-24 Bruno Haible <haible@clisp.cons.org>
+
+ * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
+
+2001-01-30 Bruno Haible <haible@clisp.cons.org>
+
+ * config.charset: Update for FreeBSD 4.2.
+
+2000-12-19 Jim Meyering <jim@meyering.net>
+
+ * localcharset.c: Improve WIN32 macrology.
+ (locale_charset): Increase size of buffer.
+
+2000-12-18 Bruno Haible <haible@clisp.cons.org>
+
+ * config.charset: Add support for BeOS.
+
+2000-12-12 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (ref-add.sed, ref-del.sed): Don't use $<, not understood
+ by Solaris "make". Reported by Toshimitsu Fujiwara.
+
+2000-12-08 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in (exec_prefix): Use configure's --exec-prefix argument.
+
+2000-12-02 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc: Replace STATIC with its opposite flag, DLL.
+
+2000-11-21 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc (MFLAGS): New variable.
+ (CFLAGS, charset.lib): Use it.
+ (INCLUDES): Use "..", not "..\include".
+
+2000-10-31 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.msvc: New file.
+
+2000-10-31 Bruno Haible <haible@clisp.cons.org>
+
+ * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
+ CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
+ to the list of canonical encodings. Rename EUC-CN to GB2312.
+ * localcharset.c (locale_charset): Add support for Win32.
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/m4/ChangeLog b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/m4/ChangeLog
new file mode 100644
index 00000000..236923ff
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/m4/ChangeLog
@@ -0,0 +1,18 @@
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ Support for relocatable installation.
+ * relocatable.m4: New file, from GNU gettext.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ * codeset.m4: Update from GNU gettext-0.10.40.
+ * glibc21.m4: Update from GNU gettext-0.10.40.
+
+2002-11-07 Bruno Haible <bruno@clisp.org>
+
+ * libtool.m4: Upgrade to libtool-1.4.3.
+
+2002-07-14 Bruno Haible <bruno@clisp.org>
+
+ * libtool.m4 (_LT_AC_LTCONFIG_HACK): Add support for GNU/FreeBSD.
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/tools/README b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/tools/README
new file mode 100644
index 00000000..7c5f7d73
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/libcharset/tools/README
@@ -0,0 +1,25 @@
+This directory contains tools for maintaining the config.charset file.
+
+The main script is "all-charsets". Before using it, you must configure
+this package. For all installed locales, it prints
+ - the result of the command "locale charmap",
+ - the result of "nl_langinfo (CODESET)",
+ - the result of "locale_charset ()".
+
+It uses the following auxiliary scripts and programs:
+ - all-locales
+ Prints all usable locales in the system, one per line.
+ - locale_charmap
+ Executes "locale charmap".
+ - locale_codeset.c
+ Prints nl_langinfo (CODESET).
+ - locale_charset.c
+ Prints locale_charset().
+
+A second main script is "all-charsets-X11". It also prints the X11
+encoding name. Before using it, you must tweak the X11 paths needed
+for compiling locale_x11encoding (a simple X11 program), and let your
+DISPLAY environment variable point to a running X11 screen.
+
+The other files are test results from various operating systems.
+
diff --git a/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/po/ChangeLog b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/po/ChangeLog
new file mode 100644
index 00000000..daf35ca7
--- /dev/null
+++ b/gnuwin32/contrib/libiconv/1.9.2/libiconv-1.9.2-src/po/ChangeLog
@@ -0,0 +1,148 @@
+2003-11-13 Bruno Haible <bruno@clisp.org>
+
+ * sr.po: New file, from Aleksandar Jelenak <jelenak@netlinkplus.net>.
+ * LINGUAS: Add sr.
+
+2003-10-14 Bruno Haible <bruno@clisp.org>
+
+ * pl.po: New file, from Arkadiusz Lipiec <A.Lipiec@elka.pw.edu.pl>.
+ * LINGUAS: Add pl.
+
+2003-08-22 Bruno Haible <bruno@clisp.org>
+
+ * wa.po: New file, from Pablo Saratxaga <pablo@walon.org>.
+ * LINGUAS: Add wa.
+
+2003-08-05 Bruno Haible <bruno@clisp.org>
+
+ * nl.po: Update from Elros Cyriatan <cyriatan@fastmail.fm>.
+
+2003-07-31 Bruno Haible <bruno@clisp.org>
+
+ * nl.po: New file, from Taco Witte <T.C.Witte@phys.uu.nl>.
+ * LINGUAS: Add nl.
+
+2003-06-11 Bruno Haible <bruno@clisp.org>
+
+ * et.po: New file, from Toomas Soome <Toomas.Soome@microlink.ee>.
+ * ro.po: Update from Eugen Hoanca <eugenh@urban-grafx.ro>.
+ * ru.po: Update from Dmitry S. Sivachenko <mitya@cavia.pp.ru>.
+ * zh_CN.po: New file, from Wang Jian <lark@linux.net.cn>.
+ * LINGUAS: Add et and zh_CN.
+
+2003-05-07 Bruno Haible <bruno@clisp.org>
+
+ * ga.po: Update from Kevin Patrick Scannell <scannell@slu.edu>.
+
+2003-05-06 Bruno Haible <bruno@clisp.org>
+
+ * ga.po: New file, from Kevin Patrick Scannell <scannell@slu.edu>.
+ * LINGUAS: Add it.
+
+2003-04-22 Bruno Haible <bruno@clisp.org>
+
+ * ro.po: New file, from Eugen Hoanca <eugenh@urban-grafx.ro>.
+ * LINGUAS: Add it.
+
+2003-04-05 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.msvc.sh (PREFIX): New variable.
+ (prefix): Use it.
+ (clean): Drop Unix specific removal.
+
+2003-04-09 Bruno Haible <bruno@clisp.org>
+
+ * Makevars (MSGID_BUGS_ADDRESS): New variable.
+
+2003-04-09 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.12-pre3.
+
+2003-03-17 Bruno Haible <bruno@clisp.org>
+
+ Improved MSVC support.
+ * Makefile.msvc.sh: New file.
+ * Rules-msvc: New file.
+
+2003-02-10 Bruno Haible <bruno@clisp.org>
+
+ * uk.po: New file, from Volodymyr M. Lisivka <lvm@mystery.lviv.net>.
+ * LINGUAS: Add it.
+
+2002-12-05 Bruno Haible <bruno@clisp.org>
+
+ * it.po: New file, from Marco Parrone <marc0@autistici.org>.
+ * LINGUAS: Add it.
+
+2002-11-12 Bruno Haible <bruno@clisp.org>
+
+ * da.po: New file, from Keld Simonsen <keld@dkuug.dk>.
+ * LINGUAS: Add da.
+
+2002-10-29 Bruno Haible <bruno@clisp.org>
+
+ * id.po: New file, from Tedi Heriyanto <tedi_h@gmx.net>.
+ * LINGUAS: Add id.
+
+2002-08-23 Bruno Haible <bruno@clisp.org>
+
+ * fi.po: New file, from Matti Koskimies <matti@apulanta.fi>.
+ * fr.po: New file, from Michel Robitaille <robitail@iro.umontreal.ca>.
+ * pt_BR.po: Update from
+ Alexandre Folle de Menezes <afmenez@terra.com.br>.
+ * ru.po: New file, from Dmitry S. Sivachenko <mitya@cavia.pp.ru>.
+ * sl.po: New file, from
+ Primož Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si>.
+ * tr.po: New file, from Deniz Akkus Kanca <deniz@arayan.com>.
+ * LINGUAS: Add fi, fr, ru, sl, tr.
+
+2002-06-20 Bruno Haible <bruno@clisp.org>
+
+ * es.po: New file, from Santiago Vila Doncel <sanvila@unex.es>.
+ * LINGUAS: Add es.
+
+2002-06-14 Bruno Haible <bruno@clisp.org>
+
+ * hr.po: New file, from Denis Lackovic <delacko@fly.srk.fer.hr>.
+ * LINGUAS: Add hr.
+
+2002-06-14 Bruno Haible <bruno@clisp.org>
+
+ * pt_BR.po: Update from
+ Alexandre Folle de Menezes <afmenez@terra.com.br>.
+
+2002-06-11 Bruno Haible <bruno@clisp.org>
+
+ * sv.po: New file, from Christian Rose <menthos@menthos.com>.
+ * LINGUAS: Add sv.
+
+2002-06-05 Bruno Haible <bruno@clisp.org>
+
+ * pt_BR.po: New file, from
+ Alexandre Folle de Menezes <afmenez@terra.com.br>.
+ * LINGUAS: Add pt_BR.
+
+2002-06-03 Bruno Haible <bruno@clisp.org>
+
+ * gl.po: New file, from Jacobo Tarrio <jtarrio@trasno.net>.
+ * LINGUAS: Add gl.
+
+2002-05-31 Bruno Haible <bruno@clisp.org>
+
+ * ca.po: New file, from Ivan Vilata i Balaguer <ivan@selidor.net>.
+ * eo.po: New file, from Edmund Grimley Evans <edmundo@rano.org>.
+ * hu.po: New file, from Emese Kovacs <emese@gnome.hu>.
+ * sk.po: New file, from Marcel Telka <marcel@telka.sk>.
+ * LINGUAS: Add ca, eo, hu, sk.
+
+2002-04-27 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.in.in: New file, from gettext-0.11.1.
+ * Rules-quot: New file, from gettext-0.11.1.
+ * boldquot.sed: New file, from gettext-0.11.1.
+ * en@boldquot.header: New file, from gettext-0.11.1.
+ * en@quot.header: New file, from gettext-0.11.1.
+ * insert-header.sin: New file, from gettext-0.11.1.
+ * quot.sed: New file, from gettext-0.11.1.
+ * remove-potcdate.sin: New file, from gettext-0.11.1.
+
diff --git a/gnuwin32/lib/charset.alias b/gnuwin32/lib/charset.alias
new file mode 100644
index 00000000..204ab43a
--- /dev/null
+++ b/gnuwin32/lib/charset.alias
@@ -0,0 +1,4 @@
+# This file contains a table of character encoding aliases,
+# suitable for operating system 'mingw32'.
+# It was automatically generated from config.charset.
+# Packages using this file:
diff --git a/gnuwin32/lib/libcharset.la b/gnuwin32/lib/libcharset.la
new file mode 100644
index 00000000..85ed6289
--- /dev/null
+++ b/gnuwin32/lib/libcharset.la
@@ -0,0 +1,35 @@
+# libcharset.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5 (1.1220 2003/04/05 19:32:58)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='../bin/libcharset1.dll'
+
+# Names of this library.
+library_names='libcharset.dll.a'
+
+# The name of the static archive.
+old_library=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Version information for libcharset.
+current=1
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='C:/Users/marius/DOWNLO~1/WEBKIT~1/install/lib'
diff --git a/gnuwin32/lib/libcharset.la.orig b/gnuwin32/lib/libcharset.la.orig
new file mode 100644
index 00000000..bc1e4484
--- /dev/null
+++ b/gnuwin32/lib/libcharset.la.orig
@@ -0,0 +1,35 @@
+# libcharset.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5 (1.1220 2003/04/05 19:32:58)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='../bin/libcharset1.dll'
+
+# Names of this library.
+library_names='libcharset.dll.a'
+
+# The name of the static archive.
+old_library=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Version information for libcharset.
+current=1
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='c:/progra~1/LibIconv/lib'
diff --git a/gnuwin32/lib/libiconv.la b/gnuwin32/lib/libiconv.la
new file mode 100644
index 00000000..839df51b
--- /dev/null
+++ b/gnuwin32/lib/libiconv.la
@@ -0,0 +1,35 @@
+# libiconv.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5 (1.1220 2003/04/05 19:32:58)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='../bin/libiconv2.dll'
+
+# Names of this library.
+library_names='libiconv.dll.a'
+
+# The name of the static archive.
+old_library=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Version information for libiconv.
+current=4
+age=2
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='C:/Users/marius/DOWNLO~1/WEBKIT~1/install/lib'
diff --git a/gnuwin32/lib/libiconv.la.orig b/gnuwin32/lib/libiconv.la.orig
new file mode 100644
index 00000000..b894609c
--- /dev/null
+++ b/gnuwin32/lib/libiconv.la.orig
@@ -0,0 +1,35 @@
+# libiconv.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5 (1.1220 2003/04/05 19:32:58)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='../bin/libiconv2.dll'
+
+# Names of this library.
+library_names='libiconv.dll.a'
+
+# The name of the static archive.
+old_library=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Version information for libiconv.
+current=4
+age=2
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='c:/progra~1/LibIconv/lib'
diff --git a/gnuwin32/man/cat1/bison.1.txt b/gnuwin32/man/cat1/bison.1.txt
new file mode 100644
index 00000000..2c2cbe75
--- /dev/null
+++ b/gnuwin32/man/cat1/bison.1.txt
@@ -0,0 +1,188 @@
+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)
diff --git a/gnuwin32/man/cat1/flex.1.txt b/gnuwin32/man/cat1/flex.1.txt
new file mode 100644
index 00000000..fe54aecf
--- /dev/null
+++ b/gnuwin32/man/cat1/flex.1.txt
@@ -0,0 +1,3013 @@
+FLEX(1) FLEX(1)
+
+
+
+
+
+NAME
+ flex - fast lexical analyzer generator
+
+SYNOPSIS
+ flex [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput
+ -Pprefix -Sskeleton] [--help --version] [filename ...]
+
+OVERVIEW
+ This manual describes flex, a tool for generating pro-
+ grams that perform pattern-matching on text. The manual
+ includes both tutorial and reference sections:
+
+ Description
+ a brief overview of the tool
+
+ Some Simple Examples
+
+ Format Of The Input File
+
+ Patterns
+ the extended regular expressions used by flex
+
+ How The Input Is Matched
+ the rules for determining what has been matched
+
+ Actions
+ how to specify what to do when a pattern is matched
+
+ The Generated Scanner
+ details regarding the scanner that flex produces;
+ how to control the input source
+
+ Start Conditions
+ introducing context into your scanners, and
+ managing "mini-scanners"
+
+ Multiple Input Buffers
+ how to manipulate multiple input sources; how to
+ scan from strings instead of files
+
+ End-of-file Rules
+ special rules for matching the end of the input
+
+ Miscellaneous Macros
+ a summary of macros available to the actions
+
+ Values Available To The User
+ a summary of values available to the actions
+
+ Interfacing With Yacc
+ connecting flex scanners together with yacc parsers
+
+ Options
+ flex command-line options, and the "%option"
+ directive
+
+ Performance Considerations
+ how to make your scanner go as fast as possible
+
+ Generating C++ Scanners
+ the (experimental) facility for generating C++
+ scanner classes
+
+ Incompatibilities With Lex And POSIX
+ how flex differs from AT&T lex and the POSIX lex
+ standard
+
+ Diagnostics
+ those error messages produced by flex (or scanners
+ it generates) whose meanings might not be apparent
+
+ Files
+ files used by flex
+
+ Deficiencies / Bugs
+ known problems with flex
+
+ See Also
+ other documentation, related tools
+
+ Author
+ includes contact information
+
+
+DESCRIPTION
+ flex is a tool for generating scanners: programs which
+ recognized lexical patterns in text. flex reads the
+ given input files, or its standard input if no file
+ names are given, for a description of a scanner to gen-
+ erate. The description is in the form of pairs of regu-
+ lar expressions and C code, called rules. flex generates
+ as output a C source file, lex.yy.c, which defines a
+ routine yylex(). This file is compiled and linked with
+ the -lfl library to produce an executable. When the
+ executable is run, it analyzes its input for occurrences
+ of the regular expressions. Whenever it finds one, it
+ executes the corresponding C code.
+
+SOME SIMPLE EXAMPLES
+ First some simple examples to get the flavor of how one
+ uses flex. The following flex input specifies a scanner
+ which whenever it encounters the string "username" will
+ replace it with the user's login name:
+
+ %%
+ username printf( "%s", getlogin() );
+
+ By default, any text not matched by a flex scanner is
+ copied to the output, so the net effect of this scanner
+ is to copy its input file to its output with each occur-
+ rence of "username" expanded. In this input, there is
+ just one rule. "username" is the pattern and the
+ "printf" is the action. The "%%" marks the beginning of
+ the rules.
+
+ Here's another simple example:
+
+ int num_lines = 0, num_chars = 0;
+
+ %%
+ \n ++num_lines; ++num_chars;
+ . ++num_chars;
+
+ %%
+ main()
+ {
+ yylex();
+ printf( "# of lines = %d, # of chars = %d\n",
+ num_lines, num_chars );
+ }
+
+ This scanner counts the number of characters and the
+ number of lines in its input (it produces no output
+ other than the final report on the counts). The first
+ line declares two globals, "num_lines" and "num_chars",
+ which are accessible both inside yylex() and in the
+ main() routine declared after the second "%%". There
+ are two rules, one which matches a newline ("\n") and
+ increments both the line count and the character count,
+ and one which matches any character other than a newline
+ (indicated by the "." regular expression).
+
+ A somewhat more complicated example:
+
+ /* scanner for a toy Pascal-like language */
+
+ %{
+ /* need this for the call to atof() below */
+ #include <math.h>
+ %}
+
+ DIGIT [0-9]
+ ID [a-z][a-z0-9]*
+
+ %%
+
+ {DIGIT}+ {
+ printf( "An integer: %s (%d)\n", yytext,
+ atoi( yytext ) );
+ }
+
+ {DIGIT}+"."{DIGIT}* {
+ printf( "A float: %s (%g)\n", yytext,
+ atof( yytext ) );
+ }
+
+ if|then|begin|end|procedure|function {
+ printf( "A keyword: %s\n", yytext );
+ }
+
+ {ID} printf( "An identifier: %s\n", yytext );
+
+ "+"|"-"|"*"|"/" printf( "An operator: %s\n", yytext );
+
+ "{"[^}\n]*"}" /* eat up one-line comments */
+
+ [ \t\n]+ /* eat up whitespace */
+
+ . printf( "Unrecognized character: %s\n", yytext );
+
+ %%
+
+ main( argc, argv )
+ int argc;
+ char **argv;
+ {
+ ++argv, --argc; /* skip over program name */
+ if ( argc > 0 )
+ yyin = fopen( argv[0], "r" );
+ else
+ yyin = stdin;
+
+ yylex();
+ }
+
+ This is the beginnings of a simple scanner for a lan-
+ guage like Pascal. It identifies different types of
+ tokens and reports on what it has seen.
+
+ The details of this example will be explained in the
+ following sections.
+
+FORMAT OF THE INPUT FILE
+ The flex input file consists of three sections,
+ separated by a line with just %% in it:
+
+ definitions
+ %%
+ rules
+ %%
+ user code
+
+ The definitions section contains declarations of simple
+ name definitions to simplify the scanner specification,
+ and declarations of start conditions, which are
+ explained in a later section.
+
+ Name definitions have the form:
+
+ name definition
+
+ The "name" is a word beginning with a letter or an
+ underscore ('_') followed by zero or more letters, dig-
+ its, '_', or '-' (dash). The definition is taken to
+ begin at the first non-white-space character following
+ the name and continuing to the end of the line. The
+ definition can subsequently be referred to using
+ "{name}", which will expand to "(definition)". For
+ example,
+
+ DIGIT [0-9]
+ ID [a-z][a-z0-9]*
+
+ defines "DIGIT" to be a regular expression which matches
+ a single digit, and "ID" to be a regular expression
+ which matches a letter followed by zero-or-more letters-
+ or-digits. A subsequent reference to
+
+ {DIGIT}+"."{DIGIT}*
+
+ is identical to
+
+ ([0-9])+"."([0-9])*
+
+ and matches one-or-more digits followed by a '.' fol-
+ lowed by zero-or-more digits.
+
+ The rules section of the flex input contains a series of
+ rules of the form:
+
+ pattern action
+
+ where the pattern must be unindented and the action must
+ begin on the same line.
+
+ See below for a further description of patterns and
+ actions.
+
+ Finally, the user code section is simply copied to
+ lex.yy.c verbatim. It is used for companion routines
+ which call or are called by the scanner. The presence
+ of this section is optional; if it is missing, the sec-
+ ond %% in the input file may be skipped, too.
+
+ In the definitions and rules sections, any indented text
+ or text enclosed in %{ and %} is copied verbatim to the
+ output (with the %{}'s removed). The %{}'s must appear
+ unindented on lines by themselves.
+
+ In the rules section, any indented or %{} text appearing
+ before the first rule may be used to declare variables
+ which are local to the scanning routine and (after the
+ declarations) code which is to be executed whenever the
+ scanning routine is entered. Other indented or %{} text
+ in the rule section is still copied to the output, but
+ its meaning is not well-defined and it may well cause
+ compile-time errors (this feature is present for POSIX
+ compliance; see below for other such features).
+
+ In the definitions section (but not in the rules sec-
+ tion), an unindented comment (i.e., a line beginning
+ with "/*") is also copied verbatim to the output up to
+ the next "*/".
+
+PATTERNS
+ The patterns in the input are written using an extended
+ set of regular expressions. These are:
+
+ x match the character 'x'
+ . any character (byte) except newline
+ [xyz] a "character class"; in this case, the pattern
+ matches either an 'x', a 'y', or a 'z'
+ [abj-oZ] a "character class" with a range in it; matches
+ an 'a', a 'b', any letter from 'j' through 'o',
+ or a 'Z'
+ [^A-Z] a "negated character class", i.e., any character
+ but those in the class. In this case, any
+ character EXCEPT an uppercase letter.
+ [^A-Z\n] any character EXCEPT an uppercase letter or
+ a newline
+ r* zero or more r's, where r is any regular expression
+ r+ one or more r's
+ r? zero or one r's (that is, "an optional r")
+ r{2,5} anywhere from two to five r's
+ r{2,} two or more r's
+ r{4} exactly 4 r's
+ {name} the expansion of the "name" definition
+ (see above)
+ "[xyz]\"foo"
+ the literal string: [xyz]"foo
+ \X if X is an 'a', 'b', 'f', 'n', 'r', 't', or 'v',
+ then the ANSI-C interpretation of \x.
+ Otherwise, a literal 'X' (used to escape
+ operators such as '*')
+ \0 a NUL character (ASCII code 0)
+ \123 the character with octal value 123
+ \x2a the character with hexadecimal value 2a
+ (r) match an r; parentheses are used to override
+ precedence (see below)
+
+
+ rs the regular expression r followed by the
+ regular expression s; called "concatenation"
+
+
+ r|s either an r or an s
+
+
+ r/s an r but only if it is followed by an s. The
+ text matched by s is included when determining
+ whether this rule is the "longest match",
+ but is then returned to the input before
+ the action is executed. So the action only
+ sees the text matched by r. This type
+ of pattern is called trailing context".
+ (There are some combinations of r/s that flex
+ cannot match correctly; see notes in the
+ Deficiencies / Bugs section below regarding
+ "dangerous trailing context".)
+ ^r an r, but only at the beginning of a line (i.e.,
+ which just starting to scan, or right after a
+ newline has been scanned).
+ r$ an r, but only at the end of a line (i.e., just
+ before a newline). Equivalent to "r/\n".
+
+ Note that flex's notion of "newline" is exactly
+ whatever the C compiler used to compile flex
+ interprets '\n' as; in particular, on some DOS
+ systems you must either filter out \r's in the
+ input yourself, or explicitly use r/\r\n for "r$".
+
+
+ <s>r an r, but only in start condition s (see
+ below for discussion of start conditions)
+ <s1,s2,s3>r
+ same, but in any of start conditions s1,
+ s2, or s3
+ <*>r an r in any start condition, even an exclusive one.
+
+
+ <<EOF>> an end-of-file
+ <s1,s2><<EOF>>
+ an end-of-file when in start condition s1 or s2
+
+ Note that inside of a character class, all regular
+ expression operators lose their special meaning except
+ escape ('\') and the character class operators, '-',
+ ']', and, at the beginning of the class, '^'.
+
+ The regular expressions listed above are grouped accord-
+ ing to precedence, from highest precedence at the top to
+ lowest at the bottom. Those grouped together have equal
+ precedence. For example,
+
+ foo|bar*
+
+ is the same as
+
+ (foo)|(ba(r*))
+
+ since the '*' operator has higher precedence than con-
+ catenation, and concatenation higher than alternation
+ ('|'). This pattern therefore matches either the string
+ "foo" or the string "ba" followed by zero-or-more r's.
+ To match "foo" or zero-or-more "bar"'s, use:
+
+ foo|(bar)*
+
+ and to match zero-or-more "foo"'s-or-"bar"'s:
+
+ (foo|bar)*
+
+
+ In addition to characters and ranges of characters,
+ character classes can also contain character class
+ expressions. These are expressions enclosed inside [:
+ and :] delimiters (which themselves must appear between
+ the '[' and ']' of the character class; other elements
+ may occur inside the character class, too). The valid
+ expressions are:
+
+ [:alnum:] [:alpha:] [:blank:]
+ [:cntrl:] [:digit:] [:graph:]
+ [:lower:] [:print:] [:punct:]
+ [:space:] [:upper:] [:xdigit:]
+
+ These expressions all designate a set of characters
+ equivalent to the corresponding standard C isXXX func-
+ tion. For example, [:alnum:] designates those charac-
+ ters for which isalnum() returns true - i.e., any alpha-
+ betic or numeric. Some systems don't provide isblank(),
+ so flex defines [:blank:] as a blank or a tab.
+
+ For example, the following character classes are all
+ equivalent:
+
+ [[:alnum:]]
+ [[:alpha:][:digit:]
+ [[:alpha:]0-9]
+ [a-zA-Z0-9]
+
+ If your scanner is case-insensitive (the -i flag), then
+ [:upper:] and [:lower:] are equivalent to [:alpha:].
+
+ Some notes on patterns:
+
+ - A negated character class such as the example
+ "[^A-Z]" above will match a newline unless "\n"
+ (or an equivalent escape sequence) is one of the
+ characters explicitly present in the negated
+ character class (e.g., "[^A-Z\n]"). This is
+ unlike how many other regular expression tools
+ treat negated character classes, but unfortu-
+ nately the inconsistency is historically
+ entrenched. Matching newlines means that a pat-
+ tern like [^"]* can match the entire input unless
+ there's another quote in the input.
+
+ - A rule can have at most one instance of trailing
+ context (the '/' operator or the '$' operator).
+ The start condition, '^', and "<<EOF>>" patterns
+ can only occur at the beginning of a pattern,
+ and, as well as with '/' and '$', cannot be
+ grouped inside parentheses. A '^' which does not
+ occur at the beginning of a rule or a '$' which
+ does not occur at the end of a rule loses its
+ special properties and is treated as a normal
+ character.
+
+ The following are illegal:
+
+ foo/bar$
+ <sc1>foo<sc2>bar
+
+ Note that the first of these, can be written
+ "foo/bar\n".
+
+ The following will result in '$' or '^' being
+ treated as a normal character:
+
+ foo|(bar$)
+ foo|^bar
+
+ If what's wanted is a "foo" or a bar-followed-by-
+ a-newline, the following could be used (the spe-
+ cial '|' action is explained below):
+
+ foo |
+ bar$ /* action goes here */
+
+ A similar trick will work for matching a foo or a
+ bar-at-the-beginning-of-a-line.
+
+HOW THE INPUT IS MATCHED
+ When the generated scanner is run, it analyzes its input
+ looking for strings which match any of its patterns. If
+ it finds more than one match, it takes the one matching
+ the most text (for trailing context rules, this includes
+ the length of the trailing part, even though it will
+ then be returned to the input). If it finds two or more
+ matches of the same length, the rule listed first in the
+ flex input file is chosen.
+
+ Once the match is determined, the text corresponding to
+ the match (called the token) is made available in the
+ global character pointer yytext, and its length in the
+ global integer yyleng. The action corresponding to the
+ matched pattern is then executed (a more detailed
+ description of actions follows), and then the remaining
+ input is scanned for another match.
+
+ If no match is found, then the default rule is executed:
+ the next character in the input is considered matched
+ and copied to the standard output. Thus, the simplest
+ legal flex input is:
+
+ %%
+
+ which generates a scanner that simply copies its input
+ (one character at a time) to its output.
+
+ Note that yytext can be defined in two different ways:
+ either as a character pointer or as a character array.
+ You can control which definition flex uses by including
+ one of the special directives %pointer or %array in the
+ first (definitions) section of your flex input. The
+ default is %pointer, unless you use the -l lex compati-
+ bility option, in which case yytext will be an array.
+ The advantage of using %pointer is substantially faster
+ scanning and no buffer overflow when matching very large
+ tokens (unless you run out of dynamic memory). The dis-
+ advantage is that you are restricted in how your actions
+ can modify yytext (see the next section), and calls to
+ the unput() function destroys the present contents of
+ yytext, which can be a considerable porting headache
+ when moving between different lex versions.
+
+ The advantage of %array is that you can then modify
+ yytext to your heart's content, and calls to unput() do
+ not destroy yytext (see below). Furthermore, existing
+ lex programs sometimes access yytext externally using
+ declarations of the form:
+ extern char yytext[];
+ This definition is erroneous when used with %pointer,
+ but correct for %array.
+
+ %array defines yytext to be an array of YYLMAX charac-
+ ters, which defaults to a fairly large value. You can
+ change the size by simply #define'ing YYLMAX to a dif-
+ ferent value in the first section of your flex input.
+ As mentioned above, with %pointer yytext grows dynami-
+ cally to accommodate large tokens. While this means
+ your %pointer scanner can accommodate very large tokens
+ (such as matching entire blocks of comments), bear in
+ mind that each time the scanner must resize yytext it
+ also must rescan the entire token from the beginning, so
+ matching such tokens can prove slow. yytext presently
+ does not dynamically grow if a call to unput() results
+ in too much text being pushed back; instead, a run-time
+ error results.
+
+ Also note that you cannot use %array with C++ scanner
+ classes (the c++ option; see below).
+
+ACTIONS
+ Each pattern in a rule has a corresponding action, which
+ can be any arbitrary C statement. The pattern ends at
+ the first non-escaped whitespace character; the remain-
+ der of the line is its action. If the action is empty,
+ then when the pattern is matched the input token is sim-
+ ply discarded. For example, here is the specification
+ for a program which deletes all occurrences of "zap me"
+ from its input:
+
+ %%
+ "zap me"
+
+ (It will copy all other characters in the input to the
+ output since they will be matched by the default rule.)
+
+ Here is a program which compresses multiple blanks and
+ tabs down to a single blank, and throws away whitespace
+ found at the end of a line:
+
+ %%
+ [ \t]+ putchar( ' ' );
+ [ \t]+$ /* ignore this token */
+
+
+ If the action contains a '{', then the action spans till
+ the balancing '}' is found, and the action may cross
+ multiple lines. flex knows about C strings and comments
+ and won't be fooled by braces found within them, but
+ also allows actions to begin with %{ and will consider
+ the action to be all the text up to the next %} (regard-
+ less of ordinary braces inside the action).
+
+ An action consisting solely of a vertical bar ('|')
+ means "same as the action for the next rule." See below
+ for an illustration.
+
+ Actions can include arbitrary C code, including return
+ statements to return a value to whatever routine called
+ yylex(). Each time yylex() is called it continues pro-
+ cessing tokens from where it last left off until it
+ either reaches the end of the file or executes a return.
+
+ Actions are free to modify yytext except for lengthening
+ it (adding characters to its end--these will overwrite
+ later characters in the input stream). This however
+ does not apply when using %array (see above); in that
+ case, yytext may be freely modified in any way.
+
+ Actions are free to modify yyleng except they should not
+ do so if the action also includes use of yymore() (see
+ below).
+
+ There are a number of special directives which can be
+ included within an action:
+
+ - ECHO copies yytext to the scanner's output.
+
+ - BEGIN followed by the name of a start condition
+ places the scanner in the corresponding start
+ condition (see below).
+
+ - REJECT directs the scanner to proceed on to the
+ "second best" rule which matched the input (or a
+ prefix of the input). The rule is chosen as
+ described above in "How the Input is Matched",
+ and yytext and yyleng set up appropriately. It
+ may either be one which matched as much text as
+ the originally chosen rule but came later in the
+ flex input file, or one which matched less text.
+ For example, the following will both count the
+ words in the input and call the routine special()
+ whenever "frob" is seen:
+
+ int word_count = 0;
+ %%
+
+ frob special(); REJECT;
+ [^ \t\n]+ ++word_count;
+
+ Without the REJECT, any "frob"'s in the input
+ would not be counted as words, since the scanner
+ normally executes only one action per token.
+ Multiple REJECT's are allowed, each one finding
+ the next best choice to the currently active
+ rule. For example, when the following scanner
+ scans the token "abcd", it will write "abcdab-
+ caba" to the output:
+
+ %%
+ a |
+ ab |
+ abc |
+ abcd ECHO; REJECT;
+ .|\n /* eat up any unmatched character */
+
+ (The first three rules share the fourth's action
+ since they use the special '|' action.) REJECT
+ is a particularly expensive feature in terms of
+ scanner performance; if it is used in any of the
+ scanner's actions it will slow down all of the
+ scanner's matching. Furthermore, REJECT cannot
+ be used with the -Cf or -CF options (see below).
+
+ Note also that unlike the other special actions,
+ REJECT is a branch; code immediately following it
+ in the action will not be executed.
+
+ - yymore() tells the scanner that the next time it
+ matches a rule, the corresponding token should be
+ appended onto the current value of yytext rather
+ than replacing it. For example, given the input
+ "mega-kludge" the following will write "mega-
+ mega-kludge" to the output:
+
+ %%
+ mega- ECHO; yymore();
+ kludge ECHO;
+
+ First "mega-" is matched and echoed to the out-
+ put. Then "kludge" is matched, but the previous
+ "mega-" is still hanging around at the beginning
+ of yytext so the ECHO for the "kludge" rule will
+ actually write "mega-kludge".
+
+ Two notes regarding use of yymore(). First, yymore()
+ depends on the value of yyleng correctly reflecting the
+ size of the current token, so you must not modify yyleng
+ if you are using yymore(). Second, the presence of
+ yymore() in the scanner's action entails a minor perfor-
+ mance penalty in the scanner's matching speed.
+
+ - yyless(n) returns all but the first n characters
+ of the current token back to the input stream,
+ where they will be rescanned when the scanner
+ looks for the next match. yytext and yyleng are
+ adjusted appropriately (e.g., yyleng will now be
+ equal to n ). For example, on the input "foobar"
+ the following will write out "foobarbar":
+
+ %%
+ foobar ECHO; yyless(3);
+ [a-z]+ ECHO;
+
+ An argument of 0 to yyless will cause the entire
+ current input string to be scanned again. Unless
+ you've changed how the scanner will subsequently
+ process its input (using BEGIN, for example),
+ this will result in an endless loop.
+
+ Note that yyless is a macro and can only be used in the
+ flex input file, not from other source files.
+
+ - unput(c) puts the character c back onto the input
+ stream. It will be the next character scanned.
+ The following action will take the current token
+ and cause it to be rescanned enclosed in paren-
+ theses.
+
+ {
+ int i;
+ /* Copy yytext because unput() trashes yytext */
+ char *yycopy = strdup( yytext );
+ unput( ')' );
+ for ( i = yyleng - 1; i >= 0; --i )
+ unput( yycopy[i] );
+ unput( '(' );
+ free( yycopy );
+ }
+
+ Note that since each unput() puts the given char-
+ acter back at the beginning of the input stream,
+ pushing back strings must be done back-to-front.
+
+ An important potential problem when using unput() is
+ that if you are using %pointer (the default), a call to
+ unput() destroys the contents of yytext, starting with
+ its rightmost character and devouring one character to
+ the left with each call. If you need the value of
+ yytext preserved after a call to unput() (as in the
+ above example), you must either first copy it elsewhere,
+ or build your scanner using %array instead (see How The
+ Input Is Matched).
+
+ Finally, note that you cannot put back EOF to attempt to
+ mark the input stream with an end-of-file.
+
+ - input() reads the next character from the input
+ stream. For example, the following is one way to
+ eat up C comments:
+
+ %%
+ "/*" {
+ register int c;
+
+ for ( ; ; )
+ {
+ while ( (c = input()) != '*' &&
+ c != EOF )
+ ; /* eat up text of comment */
+
+ if ( c == '*' )
+ {
+ while ( (c = input()) == '*' )
+ ;
+ if ( c == '/' )
+ break; /* found the end */
+ }
+
+ if ( c == EOF )
+ {
+ error( "EOF in comment" );
+ break;
+ }
+ }
+ }
+
+ (Note that if the scanner is compiled using C++,
+ then input() is instead referred to as yyinput(),
+ in order to avoid a name clash with the C++
+ stream by the name of input.)
+
+ - YY_FLUSH_BUFFER flushes the scanner's internal
+ buffer so that the next time the scanner attempts
+ to match a token, it will first refill the buffer
+ using YY_INPUT (see The Generated Scanner,
+ below). This action is a special case of the
+ more general yy_flush_buffer() function,
+ described below in the section Multiple Input
+ Buffers.
+
+ - yyterminate() can be used in lieu of a return
+ statement in an action. It terminates the scan-
+ ner and returns a 0 to the scanner's caller,
+ indicating "all done". By default, yyterminate()
+ is also called when an end-of-file is encoun-
+ tered. It is a macro and may be redefined.
+
+THE GENERATED SCANNER
+ The output of flex is the file lex.yy.c, which contains
+ the scanning routine yylex(), a number of tables used by
+ it for matching tokens, and a number of auxiliary rou-
+ tines and macros. By default, yylex() is declared as
+ follows:
+
+ int yylex()
+ {
+ ... various definitions and the actions in here ...
+ }
+
+ (If your environment supports function prototypes, then
+ it will be "int yylex( void )".) This definition may be
+ changed by defining the "YY_DECL" macro. For example,
+ you could use:
+
+ #define YY_DECL float lexscan( a, b ) float a, b;
+
+ to give the scanning routine the name lexscan, returning
+ a float, and taking two floats as arguments. Note that
+ if you give arguments to the scanning routine using a
+ K&R-style/non-prototyped function declaration, you must
+ terminate the definition with a semi-colon (;).
+
+ Whenever yylex() is called, it scans tokens from the
+ global input file yyin (which defaults to stdin). It
+ continues until it either reaches an end-of-file (at
+ which point it returns the value 0) or one of its
+ actions executes a return statement.
+
+ If the scanner reaches an end-of-file, subsequent calls
+ are undefined unless either yyin is pointed at a new
+ input file (in which case scanning continues from that
+ file), or yyrestart() is called. yyrestart() takes one
+ argument, a FILE * pointer (which can be nil, if you've
+ set up YY_INPUT to scan from a source other than yyin),
+ and initializes yyin for scanning from that file.
+ Essentially there is no difference between just assign-
+ ing yyin to a new input file or using yyrestart() to do
+ so; the latter is available for compatibility with pre-
+ vious versions of flex, and because it can be used to
+ switch input files in the middle of scanning. It can
+ also be used to throw away the current input buffer, by
+ calling it with an argument of yyin; but better is to
+ use YY_FLUSH_BUFFER (see above). Note that yyrestart()
+ does not reset the start condition to INITIAL (see Start
+ Conditions, below).
+
+ If yylex() stops scanning due to executing a return
+ statement in one of the actions, the scanner may then be
+ called again and it will resume scanning where it left
+ off.
+
+ By default (and for purposes of efficiency), the scanner
+ uses block-reads rather than simple getc() calls to read
+ characters from yyin. The nature of how it gets its
+ input can be controlled by defining the YY_INPUT macro.
+ YY_INPUT's calling sequence is
+ "YY_INPUT(buf,result,max_size)". Its action is to place
+ up to max_size characters in the character array buf and
+ return in the integer variable result either the number
+ of characters read or the constant YY_NULL (0 on Unix
+ systems) to indicate EOF. The default YY_INPUT reads
+ from the global file-pointer "yyin".
+
+ A sample definition of YY_INPUT (in the definitions sec-
+ tion of the input file):
+
+ %{
+ #define YY_INPUT(buf,result,max_size) \
+ { \
+ int c = getchar(); \
+ result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \
+ }
+ %}
+
+ This definition will change the input processing to
+ occur one character at a time.
+
+ When the scanner receives an end-of-file indication from
+ YY_INPUT, it then checks the yywrap() function. If
+ yywrap() returns false (zero), then it is assumed that
+ the function has gone ahead and set up yyin to point to
+ another input file, and scanning continues. If it
+ returns true (non-zero), then the scanner terminates,
+ returning 0 to its caller. Note that in either case,
+ the start condition remains unchanged; it does not
+ revert to INITIAL.
+
+ If you do not supply your own version of yywrap(), then
+ you must either use %option noyywrap (in which case the
+ scanner behaves as though yywrap() returned 1), or you
+ must link with -lfl to obtain the default version of the
+ routine, which always returns 1.
+
+ Three routines are available for scanning from in-memory
+ buffers rather than files: yy_scan_string(),
+ yy_scan_bytes(), and yy_scan_buffer(). See the discus-
+ sion of them below in the section Multiple Input
+ Buffers.
+
+ The scanner writes its ECHO output to the yyout global
+ (default, stdout), which may be redefined by the user
+ simply by assigning it to some other FILE pointer.
+
+START CONDITIONS
+ flex provides a mechanism for conditionally activating
+ rules. Any rule whose pattern is prefixed with "<sc>"
+ will only be active when the scanner is in the start
+ condition named "sc". For example,
+
+ <STRING>[^"]* { /* eat up the string body ... */
+ ...
+ }
+
+ will be active only when the scanner is in the "STRING"
+ start condition, and
+
+ <INITIAL,STRING,QUOTE>\. { /* handle an escape ... */
+ ...
+ }
+
+ will be active only when the current start condition is
+ either "INITIAL", "STRING", or "QUOTE".
+
+ Start conditions are declared in the definitions (first)
+ section of the input using unindented lines beginning
+ with either %s or %x followed by a list of names. The
+ former declares inclusive start conditions, the latter
+ exclusive start conditions. A start condition is acti-
+ vated using the BEGIN action. Until the next BEGIN
+ action is executed, rules with the given start condition
+ will be active and rules with other start conditions
+ will be inactive. If the start condition is inclusive,
+ then rules with no start conditions at all will also be
+ active. If it is exclusive, then only rules qualified
+ with the start condition will be active. A set of rules
+ contingent on the same exclusive start condition
+ describe a scanner which is independent of any of the
+ other rules in the flex input. Because of this, exclu-
+ sive start conditions make it easy to specify "mini-
+ scanners" which scan portions of the input that are syn-
+ tactically different from the rest (e.g., comments).
+
+ If the distinction between inclusive and exclusive start
+ conditions is still a little vague, here's a simple
+ example illustrating the connection between the two.
+ The set of rules:
+
+ %s example
+ %%
+
+ <example>foo do_something();
+
+ bar something_else();
+
+ is equivalent to
+
+ %x example
+ %%
+
+ <example>foo do_something();
+
+ <INITIAL,example>bar something_else();
+
+ Without the <INITIAL,example> qualifier, the bar pattern
+ in the second example wouldn't be active (i.e., couldn't
+ match) when in start condition example. If we just used
+ <example> to qualify bar, though, then it would only be
+ active in example and not in INITIAL, while in the first
+ example it's active in both, because in the first exam-
+ ple the example startion condition is an inclusive (%s)
+ start condition.
+
+ Also note that the special start-condition specifier <*>
+ matches every start condition. Thus, the above example
+ could also have been written;
+
+ %x example
+ %%
+
+ <example>foo do_something();
+
+ <*>bar something_else();
+
+
+ The default rule (to ECHO any unmatched character)
+ remains active in start conditions. It is equivalent
+ to:
+
+ <*>.|\n ECHO;
+
+
+ BEGIN(0) returns to the original state where only the
+ rules with no start conditions are active. This state
+ can also be referred to as the start-condition "INI-
+ TIAL", so BEGIN(INITIAL) is equivalent to BEGIN(0).
+ (The parentheses around the start condition name are not
+ required but are considered good style.)
+
+ BEGIN actions can also be given as indented code at the
+ beginning of the rules section. For example, the fol-
+ lowing will cause the scanner to enter the "SPECIAL"
+ start condition whenever yylex() is called and the
+ global variable enter_special is true:
+
+ int enter_special;
+
+ %x SPECIAL
+ %%
+ if ( enter_special )
+ BEGIN(SPECIAL);
+
+ <SPECIAL>blahblahblah
+ ...more rules follow...
+
+
+ To illustrate the uses of start conditions, here is a
+ scanner which provides two different interpretations of
+ a string like "123.456". By default it will treat it as
+ three tokens, the integer "123", a dot ('.'), and the
+ integer "456". But if the string is preceded earlier in
+ the line by the string "expect-floats" it will treat it
+ as a single token, the floating-point number 123.456:
+
+ %{
+ #include <math.h>
+ %}
+ %s expect
+
+ %%
+ expect-floats BEGIN(expect);
+
+ <expect>[0-9]+"."[0-9]+ {
+ printf( "found a float, = %f\n",
+ atof( yytext ) );
+ }
+ <expect>\n {
+ /* that's the end of the line, so
+ * we need another "expect-number"
+ * before we'll recognize any more
+ * numbers
+ */
+ BEGIN(INITIAL);
+ }
+
+ [0-9]+ {
+ printf( "found an integer, = %d\n",
+ atoi( yytext ) );
+ }
+
+ "." printf( "found a dot\n" );
+
+ Here is a scanner which recognizes (and discards) C com-
+ ments while maintaining a count of the current input
+ line.
+
+ %x comment
+ %%
+ int line_num = 1;
+
+ "/*" BEGIN(comment);
+
+ <comment>[^*\n]* /* eat anything that's not a '*' */
+ <comment>"*"+[^*/\n]* /* eat up '*'s not followed by '/'s */
+ <comment>\n ++line_num;
+ <comment>"*"+"/" BEGIN(INITIAL);
+
+ This scanner goes to a bit of trouble to match as much
+ text as possible with each rule. In general, when
+ attempting to write a high-speed scanner try to match as
+ much possible in each rule, as it's a big win.
+
+ Note that start-conditions names are really integer val-
+ ues and can be stored as such. Thus, the above could be
+ extended in the following fashion:
+
+ %x comment foo
+ %%
+ int line_num = 1;
+ int comment_caller;
+
+ "/*" {
+ comment_caller = INITIAL;
+ BEGIN(comment);
+ }
+
+ ...
+
+ <foo>"/*" {
+ comment_caller = foo;
+ BEGIN(comment);
+ }
+
+ <comment>[^*\n]* /* eat anything that's not a '*' */
+ <comment>"*"+[^*/\n]* /* eat up '*'s not followed by '/'s */
+ <comment>\n ++line_num;
+ <comment>"*"+"/" BEGIN(comment_caller);
+
+ Furthermore, you can access the current start condition
+ using the integer-valued YY_START macro. For example,
+ the above assignments to comment_caller could instead be
+ written
+
+ comment_caller = YY_START;
+
+ Flex provides YYSTATE as an alias for YY_START (since
+ that is what's used by AT&T lex).
+
+ Note that start conditions do not have their own name-
+ space; %s's and %x's declare names in the same fashion
+ as #define's.
+
+ Finally, here's an example of how to match C-style
+ quoted strings using exclusive start conditions, includ-
+ ing expanded escape sequences (but not including check-
+ ing for a string that's too long):
+
+ %x str
+
+ %%
+ char string_buf[MAX_STR_CONST];
+ char *string_buf_ptr;
+
+
+ \" string_buf_ptr = string_buf; BEGIN(str);
+
+ <str>\" { /* saw closing quote - all done */
+ BEGIN(INITIAL);
+ *string_buf_ptr = '\0';
+ /* return string constant token type and
+ * value to parser
+ */
+ }
+
+ <str>\n {
+ /* error - unterminated string constant */
+ /* generate error message */
+ }
+
+ <str>\\[0-7]{1,3} {
+ /* octal escape sequence */
+ int result;
+
+ (void) sscanf( yytext + 1, "%o", &result );
+
+ if ( result > 0xff )
+ /* error, constant is out-of-bounds */
+
+ *string_buf_ptr++ = result;
+ }
+
+ <str>\\[0-9]+ {
+ /* generate error - bad escape sequence; something
+ * like '\48' or '\0777777'
+ */
+ }
+
+ <str>\\n *string_buf_ptr++ = '\n';
+ <str>\\t *string_buf_ptr++ = '\t';
+ <str>\\r *string_buf_ptr++ = '\r';
+ <str>\\b *string_buf_ptr++ = '\b';
+ <str>\\f *string_buf_ptr++ = '\f';
+
+ <str>\\(.|\n) *string_buf_ptr++ = yytext[1];
+
+ <str>[^\\\n\"]+ {
+ char *yptr = yytext;
+
+ while ( *yptr )
+ *string_buf_ptr++ = *yptr++;
+ }
+
+
+ Often, such as in some of the examples above, you wind
+ up writing a whole bunch of rules all preceded by the
+ same start condition(s). Flex makes this a little eas-
+ ier and cleaner by introducing a notion of start condi-
+ tion scope. A start condition scope is begun with:
+
+ <SCs>{
+
+ where SCs is a list of one or more start conditions.
+ Inside the start condition scope, every rule automati-
+ cally has the prefix <SCs> applied to it, until a '}'
+ which matches the initial '{'. So, for example,
+
+ <ESC>{
+ "\\n" return '\n';
+ "\\r" return '\r';
+ "\\f" return '\f';
+ "\\0" return '\0';
+ }
+
+ is equivalent to:
+
+ <ESC>"\\n" return '\n';
+ <ESC>"\\r" return '\r';
+ <ESC>"\\f" return '\f';
+ <ESC>"\\0" return '\0';
+
+ Start condition scopes may be nested.
+
+ Three routines are available for manipulating stacks of
+ start conditions:
+
+ void yy_push_state(int new_state)
+ pushes the current start condition onto the top
+ of the start condition stack and switches to
+ new_state as though you had used BEGIN new_state
+ (recall that start condition names are also inte-
+ gers).
+
+ void yy_pop_state()
+ pops the top of the stack and switches to it via
+ BEGIN.
+
+ int yy_top_state()
+ returns the top of the stack without altering the
+ stack's contents.
+
+ The start condition stack grows dynamically and so has
+ no built-in size limitation. If memory is exhausted,
+ program execution aborts.
+
+ To use start condition stacks, your scanner must include
+ a %option stack directive (see Options below).
+
+MULTIPLE INPUT BUFFERS
+ Some scanners (such as those which support "include"
+ files) require reading from several input streams. As
+ flex scanners do a large amount of buffering, one cannot
+ control where the next input will be read from by simply
+ writing a YY_INPUT which is sensitive to the scanning
+ context. YY_INPUT is only called when the scanner
+ reaches the end of its buffer, which may be a long time
+ after scanning a statement such as an "include" which
+ requires switching the input source.
+
+ To negotiate these sorts of problems, flex provides a
+ mechanism for creating and switching between multiple
+ input buffers. An input buffer is created by using:
+
+ YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+
+ which takes a FILE pointer and a size and creates a
+ buffer associated with the given file and large enough
+ to hold size characters (when in doubt, use YY_BUF_SIZE
+ for the size). It returns a YY_BUFFER_STATE handle,
+ which may then be passed to other routines (see below).
+ The YY_BUFFER_STATE type is a pointer to an opaque
+ struct yy_buffer_state structure, so you may safely ini-
+ tialize YY_BUFFER_STATE variables to ((YY_BUFFER_STATE)
+ 0) if you wish, and also refer to the opaque structure
+ in order to correctly declare input buffers in source
+ files other than that of your scanner. Note that the
+ FILE pointer in the call to yy_create_buffer is only
+ used as the value of yyin seen by YY_INPUT; if you rede-
+ fine YY_INPUT so it no longer uses yyin, then you can
+ safely pass a nil FILE pointer to yy_create_buffer. You
+ select a particular buffer to scan from using:
+
+ void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+
+ switches the scanner's input buffer so subsequent tokens
+ will come from new_buffer. Note that
+ yy_switch_to_buffer() may be used by yywrap() to set
+ things up for continued scanning, instead of opening a
+ new file and pointing yyin at it. Note also that
+ switching input sources via either yy_switch_to_buffer()
+ or yywrap() does not change the start condition.
+
+ void yy_delete_buffer( YY_BUFFER_STATE buffer )
+
+ is used to reclaim the storage associated with a buffer.
+ ( buffer can be nil, in which case the routine does
+ nothing.) You can also clear the current contents of a
+ buffer using:
+
+ void yy_flush_buffer( YY_BUFFER_STATE buffer )
+
+ This function discards the buffer's contents, so the
+ next time the scanner attempts to match a token from the
+ buffer, it will first fill the buffer anew using
+ YY_INPUT.
+
+ yy_new_buffer() is an alias for yy_create_buffer(), pro-
+ vided for compatibility with the C++ use of new and
+ delete for creating and destroying dynamic objects.
+
+ Finally, the YY_CURRENT_BUFFER macro returns a
+ YY_BUFFER_STATE handle to the current buffer.
+
+ Here is an example of using these features for writing a
+ scanner which expands include files (the <<EOF>> feature
+ is discussed below):
+
+ /* the "incl" state is used for picking up the name
+ * of an include file
+ */
+ %x incl
+
+ %{
+ #define MAX_INCLUDE_DEPTH 10
+ YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
+ int include_stack_ptr = 0;
+ %}
+
+ %%
+ include BEGIN(incl);
+
+ [a-z]+ ECHO;
+ [^a-z\n]*\n? ECHO;
+
+ <incl>[ \t]* /* eat the whitespace */
+ <incl>[^ \t\n]+ { /* got the include file name */
+ if ( include_stack_ptr >= MAX_INCLUDE_DEPTH )
+ {
+ fprintf( stderr, "Includes nested too deeply" );
+ exit( 1 );
+ }
+
+ include_stack[include_stack_ptr++] =
+ YY_CURRENT_BUFFER;
+
+ yyin = fopen( yytext, "r" );
+
+ if ( ! yyin )
+ error( ... );
+
+ yy_switch_to_buffer(
+ yy_create_buffer( yyin, YY_BUF_SIZE ) );
+
+ BEGIN(INITIAL);
+ }
+
+ <<EOF>> {
+ if ( --include_stack_ptr < 0 )
+ {
+ yyterminate();
+ }
+
+ else
+ {
+ yy_delete_buffer( YY_CURRENT_BUFFER );
+ yy_switch_to_buffer(
+ include_stack[include_stack_ptr] );
+ }
+ }
+
+ Three routines are available for setting up input
+ buffers for scanning in-memory strings instead of files.
+ All of them create a new input buffer for scanning the
+ string, and return a corresponding YY_BUFFER_STATE han-
+ dle (which you should delete with yy_delete_buffer()
+ when done with it). They also switch to the new buffer
+ using yy_switch_to_buffer(), so the next call to yylex()
+ will start scanning the string.
+
+ yy_scan_string(const char *str)
+ scans a NUL-terminated string.
+
+ yy_scan_bytes(const char *bytes, int len)
+ scans len bytes (including possibly NUL's) start-
+ ing at location bytes.
+
+ Note that both of these functions create and scan a copy
+ of the string or bytes. (This may be desirable, since
+ yylex() modifies the contents of the buffer it is scan-
+ ning.) You can avoid the copy by using:
+
+ yy_scan_buffer(char *base, yy_size_t size)
+ which scans in place the buffer starting at base,
+ consisting of size bytes, the last two bytes of
+ which must be YY_END_OF_BUFFER_CHAR (ASCII NUL).
+ These last two bytes are not scanned; thus, scan-
+ ning consists of base[0] through base[size-2],
+ inclusive.
+
+ If you fail to set up base in this manner (i.e.,
+ forget the final two YY_END_OF_BUFFER_CHAR
+ bytes), then yy_scan_buffer() returns a nil
+ pointer instead of creating a new input buffer.
+
+ The type yy_size_t is an integral type to which
+ you can cast an integer expression reflecting the
+ size of the buffer.
+
+END-OF-FILE RULES
+ The special rule "<<EOF>>" indicates actions which are
+ to be taken when an end-of-file is encountered and
+ yywrap() returns non-zero (i.e., indicates no further
+ files to process). The action must finish by doing one
+ of four things:
+
+ - assigning yyin to a new input file (in previous
+ versions of flex, after doing the assignment you
+ had to call the special action YY_NEW_FILE; this
+ is no longer necessary);
+
+ - executing a return statement;
+
+ - executing the special yyterminate() action;
+
+ - or, switching to a new buffer using
+ yy_switch_to_buffer() as shown in the example
+ above.
+
+ <<EOF>> rules may not be used with other patterns; they
+ may only be qualified with a list of start conditions.
+ If an unqualified <<EOF>> rule is given, it applies to
+ all start conditions which do not already have <<EOF>>
+ actions. To specify an <<EOF>> rule for only the ini-
+ tial start condition, use
+
+ <INITIAL><<EOF>>
+
+
+ These rules are useful for catching things like unclosed
+ comments. An example:
+
+ %x quote
+ %%
+
+ ...other rules for dealing with quotes...
+
+ <quote><<EOF>> {
+ error( "unterminated quote" );
+ yyterminate();
+ }
+ <<EOF>> {
+ if ( *++filelist )
+ yyin = fopen( *filelist, "r" );
+ else
+ yyterminate();
+ }
+
+
+MISCELLANEOUS MACROS
+ The macro YY_USER_ACTION can be defined to provide an
+ action which is always executed prior to the matched
+ rule's action. For example, it could be #define'd to
+ call a routine to convert yytext to lower-case. When
+ YY_USER_ACTION is invoked, the variable yy_act gives the
+ number of the matched rule (rules are numbered starting
+ with 1). Suppose you want to profile how often each of
+ your rules is matched. The following would do the
+ trick:
+
+ #define YY_USER_ACTION ++ctr[yy_act]
+
+ where ctr is an array to hold the counts for the differ-
+ ent rules. Note that the macro YY_NUM_RULES gives the
+ total number of rules (including the default rule, even
+ if you use -s), so a correct declaration for ctr is:
+
+ int ctr[YY_NUM_RULES];
+
+
+ The macro YY_USER_INIT may be defined to provide an
+ action which is always executed before the first scan
+ (and before the scanner's internal initializations are
+ done). For example, it could be used to call a routine
+ to read in a data table or open a logging file.
+
+ The macro yy_set_interactive(is_interactive) can be used
+ to control whether the current buffer is considered
+ interactive. An interactive buffer is processed more
+ slowly, but must be used when the scanner's input source
+ is indeed interactive to avoid problems due to waiting
+ to fill buffers (see the discussion of the -I flag
+ below). A non-zero value in the macro invocation marks
+ the buffer as interactive, a zero value as non-interac-
+ tive. Note that use of this macro overrides %option
+ always-interactive or %option never-interactive (see
+ Options below). yy_set_interactive() must be invoked
+ prior to beginning to scan the buffer that is (or is
+ not) to be considered interactive.
+
+ The macro yy_set_bol(at_bol) can be used to control
+ whether the current buffer's scanning context for the
+ next token match is done as though at the beginning of a
+ line. A non-zero macro argument makes rules anchored
+ with
+
+ The macro YY_AT_BOL() returns true if the next token
+ scanned from the current buffer will have '^' rules
+ active, false otherwise.
+
+ In the generated scanner, the actions are all gathered
+ in one large switch statement and separated using
+ YY_BREAK, which may be redefined. By default, it is
+ simply a "break", to separate each rule's action from
+ the following rule's. Redefining YY_BREAK allows, for
+ example, C++ users to #define YY_BREAK to do nothing
+ (while being very careful that every rule ends with a
+ "break" or a "return"!) to avoid suffering from unreach-
+ able statement warnings where because a rule's action
+ ends with "return", the YY_BREAK is inaccessible.
+
+VALUES AVAILABLE TO THE USER
+ This section summarizes the various values available to
+ the user in the rule actions.
+
+ - char *yytext holds the text of the current token.
+ It may be modified but not lengthened (you cannot
+ append characters to the end).
+
+ If the special directive %array appears in the
+ first section of the scanner description, then
+ yytext is instead declared char yytext[YYLMAX],
+ where YYLMAX is a macro definition that you can
+ redefine in the first section if you don't like
+ the default value (generally 8KB). Using %array
+ results in somewhat slower scanners, but the
+ value of yytext becomes immune to calls to
+ input() and unput(), which potentially destroy
+ its value when yytext is a character pointer.
+ The opposite of %array is %pointer, which is the
+ default.
+
+ You cannot use %array when generating C++ scanner
+ classes (the -+ flag).
+
+ - int yyleng holds the length of the current token.
+
+ - FILE *yyin is the file which by default flex
+ reads from. It may be redefined but doing so
+ only makes sense before scanning begins or after
+ an EOF has been encountered. Changing it in the
+ midst of scanning will have unexpected results
+ since flex buffers its input; use yyrestart()
+ instead. Once scanning terminates because an
+ end-of-file has been seen, you can assign yyin at
+ the new input file and then call the scanner
+ again to continue scanning.
+
+ - void yyrestart( FILE *new_file ) may be called to
+ point yyin at the new input file. The switch-
+ over to the new file is immediate (any previously
+ buffered-up input is lost). Note that calling
+ yyrestart() with yyin as an argument thus throws
+ away the current input buffer and continues scan-
+ ning the same input file.
+
+ - FILE *yyout is the file to which ECHO actions are
+ done. It can be reassigned by the user.
+
+ - YY_CURRENT_BUFFER returns a YY_BUFFER_STATE han-
+ dle to the current buffer.
+
+ - YY_START returns an integer value corresponding
+ to the current start condition. You can subse-
+ quently use this value with BEGIN to return to
+ that start condition.
+
+INTERFACING WITH YACC
+ One of the main uses of flex is as a companion to the
+ yacc parser-generator. yacc parsers expect to call a
+ routine named yylex() to find the next input token. The
+ routine is supposed to return the type of the next token
+ as well as putting any associated value in the global
+ yylval. To use flex with yacc, one specifies the -d
+ option to yacc to instruct it to generate the file
+ y.tab.h containing definitions of all the %tokens
+ appearing in the yacc input. This file is then included
+ in the flex scanner. For example, if one of the tokens
+ is "TOK_NUMBER", part of the scanner might look like:
+
+ %{
+ #include "y.tab.h"
+ %}
+
+ %%
+
+ [0-9]+ yylval = atoi( yytext ); return TOK_NUMBER;
+
+
+OPTIONS
+ flex has the following options:
+
+ -b Generate backing-up information to lex.backup.
+ This is a list of scanner states which require
+ backing up and the input characters on which they
+ do so. By adding rules one can remove backing-up
+ states. If all backing-up states are eliminated
+ and -Cf or -CF is used, the generated scanner
+ will run faster (see the -p flag). Only users
+ who wish to squeeze every last cycle out of their
+ scanners need worry about this option. (See the
+ section on Performance Considerations below.)
+
+ -c is a do-nothing, deprecated option included for
+ POSIX compliance.
+
+ -d makes the generated scanner run in debug mode.
+ Whenever a pattern is recognized and the global
+ yy_flex_debug is non-zero (which is the default),
+ the scanner will write to stderr a line of the
+ form:
+
+ --accepting rule at line 53 ("the matched text")
+
+ The line number refers to the location of the
+ rule in the file defining the scanner (i.e., the
+ file that was fed to flex). Messages are also
+ generated when the scanner backs up, accepts the
+ default rule, reaches the end of its input buffer
+ (or encounters a NUL; at this point, the two look
+ the same as far as the scanner's concerned), or
+ reaches an end-of-file.
+
+ -f specifies fast scanner. No table compression is
+ done and stdio is bypassed. The result is large
+ but fast. This option is equivalent to -Cfr (see
+ below).
+
+ -h generates a "help" summary of flex's options to
+ stdout and then exits. -? and --help are syn-
+ onyms for -h.
+
+ -i instructs flex to generate a case-insensitive
+ scanner. The case of letters given in the flex
+ input patterns will be ignored, and tokens in the
+ input will be matched regardless of case. The
+ matched text given in yytext will have the pre-
+ served case (i.e., it will not be folded).
+
+ -l turns on maximum compatibility with the original
+ AT&T lex implementation. Note that this does not
+ mean full compatibility. Use of this option
+ costs a considerable amount of performance, and
+ it cannot be used with the -+, -f, -F, -Cf, or
+ -CF options. For details on the compatibilities
+ it provides, see the section "Incompatibilities
+ With Lex And POSIX" below. This option also
+ results in the name YY_FLEX_LEX_COMPAT being
+ #define'd in the generated scanner.
+
+ -n is another do-nothing, deprecated option included
+ only for POSIX compliance.
+
+ -p generates a performance report to stderr. The
+ report consists of comments regarding features of
+ the flex input file which will cause a serious
+ loss of performance in the resulting scanner. If
+ you give the flag twice, you will also get com-
+ ments regarding features that lead to minor per-
+ formance losses.
+
+ Note that the use of REJECT, %option yylineno,
+ and variable trailing context (see the Deficien-
+ cies / Bugs section below) entails a substantial
+ performance penalty; use of yymore(), the ^ oper-
+ ator, and the -I flag entail minor performance
+ penalties.
+
+ -s causes the default rule (that unmatched scanner
+ input is echoed to stdout) to be suppressed. If
+ the scanner encounters input that does not match
+ any of its rules, it aborts with an error. This
+ option is useful for finding holes in a scanner's
+ rule set.
+
+ -t instructs flex to write the scanner it generates
+ to standard output instead of lex.yy.c.
+
+ -v specifies that flex should write to stderr a sum-
+ mary of statistics regarding the scanner it gen-
+ erates. Most of the statistics are meaningless
+ to the casual flex user, but the first line iden-
+ tifies the version of flex (same as reported by
+ -V), and the next line the flags used when gener-
+ ating the scanner, including those that are on by
+ default.
+
+ -w suppresses warning messages.
+
+ -B instructs flex to generate a batch scanner, the
+ opposite of interactive scanners generated by -I
+ (see below). In general, you use -B when you are
+ certain that your scanner will never be used
+ interactively, and you want to squeeze a little
+ more performance out of it. If your goal is
+ instead to squeeze out a lot more performance,
+ you should be using the -Cf or -CF options (dis-
+ cussed below), which turn on -B automatically
+ anyway.
+
+ -F specifies that the fast scanner table representa-
+ tion should be used (and stdio bypassed). This
+ representation is about as fast as the full table
+ representation (-f), and for some sets of pat-
+ terns will be considerably smaller (and for oth-
+ ers, larger). In general, if the pattern set
+ contains both "keywords" and a catch-all, "iden-
+ tifier" rule, such as in the set:
+
+ "case" return TOK_CASE;
+ "switch" return TOK_SWITCH;
+ ...
+ "default" return TOK_DEFAULT;
+ [a-z]+ return TOK_ID;
+
+ then you're better off using the full table rep-
+ resentation. If only the "identifier" rule is
+ present and you then use a hash table or some
+ such to detect the keywords, you're better off
+ using -F.
+
+ This option is equivalent to -CFr (see below).
+ It cannot be used with -+.
+
+ -I instructs flex to generate an interactive scan-
+ ner. An interactive scanner is one that only
+ looks ahead to decide what token has been matched
+ if it absolutely must. It turns out that always
+ looking one extra character ahead, even if the
+ scanner has already seen enough text to disam-
+ biguate the current token, is a bit faster than
+ only looking ahead when necessary. But scanners
+ that always look ahead give dreadful interactive
+ performance; for example, when a user types a
+ newline, it is not recognized as a newline token
+ until they enter another token, which often means
+ typing in another whole line.
+
+ Flex scanners default to interactive unless you
+ use the -Cf or -CF table-compression options (see
+ below). That's because if you're looking for
+ high-performance you should be using one of these
+ options, so if you didn't, flex assumes you'd
+ rather trade off a bit of run-time performance
+ for intuitive interactive behavior. Note also
+ that you cannot use -I in conjunction with -Cf or
+ -CF. Thus, this option is not really needed; it
+ is on by default for all those cases in which it
+ is allowed.
+
+ You can force a scanner to not be interactive by
+ using -B (see above).
+
+ -L instructs flex not to generate #line directives.
+ Without this option, flex peppers the generated
+ scanner with #line directives so error messages
+ in the actions will be correctly located with
+ respect to either the original flex input file
+ (if the errors are due to code in the input
+ file), or lex.yy.c (if the errors are flex's
+ fault -- you should report these sorts of errors
+ to the email address given below).
+
+ -T makes flex run in trace mode. It will generate a
+ lot of messages to stderr concerning the form of
+ the input and the resultant non-deterministic and
+ deterministic finite automata. This option is
+ mostly for use in maintaining flex.
+
+ -V prints the version number to stdout and exits.
+ --version is a synonym for -V.
+
+ -7 instructs flex to generate a 7-bit scanner, i.e.,
+ one which can only recognized 7-bit characters in
+ its input. The advantage of using -7 is that the
+ scanner's tables can be up to half the size of
+ those generated using the -8 option (see below).
+ The disadvantage is that such scanners often hang
+ or crash if their input contains an 8-bit charac-
+ ter.
+
+ Note, however, that unless you generate your
+ scanner using the -Cf or -CF table compression
+ options, use of -7 will save only a small amount
+ of table space, and make your scanner consider-
+ ably less portable. Flex's default behavior is
+ to generate an 8-bit scanner unless you use the
+ -Cf or -CF, in which case flex defaults to gener-
+ ating 7-bit scanners unless your site was always
+ configured to generate 8-bit scanners (as will
+ often be the case with non-USA sites). You can
+ tell whether flex generated a 7-bit or an 8-bit
+ scanner by inspecting the flag summary in the -v
+ output as described above.
+
+ Note that if you use -Cfe or -CFe (those table
+ compression options, but also using equivalence
+ classes as discussed see below), flex still
+ defaults to generating an 8-bit scanner, since
+ usually with these compression options full 8-bit
+ tables are not much more expensive than 7-bit
+ tables.
+
+ -8 instructs flex to generate an 8-bit scanner,
+ i.e., one which can recognize 8-bit characters.
+ This flag is only needed for scanners generated
+ using -Cf or -CF, as otherwise flex defaults to
+ generating an 8-bit scanner anyway.
+
+ See the discussion of -7 above for flex's default
+ behavior and the tradeoffs between 7-bit and
+ 8-bit scanners.
+
+ -+ specifies that you want flex to generate a C++
+ scanner class. See the section on Generating C++
+ Scanners below for details.
+
+ -C[aefFmr]
+ controls the degree of table compression and,
+ more generally, trade-offs between small scanners
+ and fast scanners.
+
+ -Ca ("align") instructs flex to trade off larger
+ tables in the generated scanner for faster per-
+ formance because the elements of the tables are
+ better aligned for memory access and computation.
+ On some RISC architectures, fetching and manipu-
+ lating longwords is more efficient than with
+ smaller-sized units such as shortwords. This
+ option can double the size of the tables used by
+ your scanner.
+
+ -Ce directs flex to construct equivalence
+ classes, i.e., sets of characters which have
+ identical lexical properties (for example, if the
+ only appearance of digits in the flex input is in
+ the character class "[0-9]" then the digits '0',
+ '1', ..., '9' will all be put in the same equiva-
+ lence class). Equivalence classes usually give
+ dramatic reductions in the final table/object
+ file sizes (typically a factor of 2-5) and are
+ pretty cheap performance-wise (one array look-up
+ per character scanned).
+
+ -Cf specifies that the full scanner tables should
+ be generated - flex should not compress the
+ tables by taking advantages of similar transition
+ functions for different states.
+
+ -CF specifies that the alternate fast scanner
+ representation (described above under the -F
+ flag) should be used. This option cannot be used
+ with -+.
+
+ -Cm directs flex to construct meta-equivalence
+ classes, which are sets of equivalence classes
+ (or characters, if equivalence classes are not
+ being used) that are commonly used together.
+ Meta-equivalence classes are often a big win when
+ using compressed tables, but they have a moderate
+ performance impact (one or two "if" tests and one
+ array look-up per character scanned).
+
+ -Cr causes the generated scanner to bypass use of
+ the standard I/O library (stdio) for input.
+ Instead of calling fread() or getc(), the scanner
+ will use the read() system call, resulting in a
+ performance gain which varies from system to sys-
+ tem, but in general is probably negligible unless
+ you are also using -Cf or -CF. Using -Cr can
+ cause strange behavior if, for example, you read
+ from yyin using stdio prior to calling the scan-
+ ner (because the scanner will miss whatever text
+ your previous reads left in the stdio input
+ buffer).
+
+ -Cr has no effect if you define YY_INPUT (see The
+ Generated Scanner above).
+
+ A lone -C specifies that the scanner tables
+ should be compressed but neither equivalence
+ classes nor meta-equivalence classes should be
+ used.
+
+ The options -Cf or -CF and -Cm do not make sense
+ together - there is no opportunity for meta-
+ equivalence classes if the table is not being
+ compressed. Otherwise the options may be freely
+ mixed, and are cumulative.
+
+ The default setting is -Cem, which specifies that
+ flex should generate equivalence classes and
+ meta-equivalence classes. This setting provides
+ the highest degree of table compression. You can
+ trade off faster-executing scanners at the cost
+ of larger tables with the following generally
+ being true:
+
+ slowest & smallest
+ -Cem
+ -Cm
+ -Ce
+ -C
+ -C{f,F}e
+ -C{f,F}
+ -C{f,F}a
+ fastest & largest
+
+ Note that scanners with the smallest tables are
+ usually generated and compiled the quickest, so
+ during development you will usually want to use
+ the default, maximal compression.
+
+ -Cfe is often a good compromise between speed and
+ size for production scanners.
+
+ -ooutput
+ directs flex to write the scanner to the file
+ output instead of lex.yy.c. If you combine -o
+ with the -t option, then the scanner is written
+ to stdout but its #line directives (see the -L
+ option above) refer to the file output.
+
+ -Pprefix
+ changes the default yy prefix used by flex for
+ all globally-visible variable and function names
+ to instead be prefix. For example, -Pfoo changes
+ the name of yytext to footext. It also changes
+ the name of the default output file from lex.yy.c
+ to lex.foo.c. Here are all of the names
+ affected:
+
+ yy_create_buffer
+ yy_delete_buffer
+ yy_flex_debug
+ yy_init_buffer
+ yy_flush_buffer
+ yy_load_buffer_state
+ yy_switch_to_buffer
+ yyin
+ yyleng
+ yylex
+ yylineno
+ yyout
+ yyrestart
+ yytext
+ yywrap
+
+ (If you are using a C++ scanner, then only yywrap
+ and yyFlexLexer are affected.) Within your scan-
+ ner itself, you can still refer to the global
+ variables and functions using either version of
+ their name; but externally, they have the modi-
+ fied name.
+
+ This option lets you easily link together multi-
+ ple flex programs into the same executable.
+ Note, though, that using this option also renames
+ yywrap(), so you now must either provide your own
+ (appropriately-named) version of the routine for
+ your scanner, or use %option noyywrap, as linking
+ with -lfl no longer provides one for you by
+ default.
+
+ -Sskeleton_file
+ overrides the default skeleton file from which
+ flex constructs its scanners. You'll never need
+ this option unless you are doing flex maintenance
+ or development.
+
+ flex also provides a mechanism for controlling options
+ within the scanner specification itself, rather than
+ from the flex command-line. This is done by including
+ %option directives in the first section of the scanner
+ specification. You can specify multiple options with a
+ single %option directive, and multiple directives in the
+ first section of your flex input file.
+
+ Most options are given simply as names, optionally pre-
+ ceded by the word "no" (with no intervening whitespace)
+ to negate their meaning. A number are equivalent to
+ flex flags or their negation:
+
+ 7bit -7 option
+ 8bit -8 option
+ align -Ca option
+ backup -b option
+ batch -B option
+ c++ -+ option
+
+ caseful or
+ case-sensitive opposite of -i (default)
+
+ case-insensitive or
+ caseless -i option
+
+ debug -d option
+ default opposite of -s option
+ ecs -Ce option
+ fast -F option
+ full -f option
+ interactive -I option
+ lex-compat -l option
+ meta-ecs -Cm option
+ perf-report -p option
+ read -Cr option
+ stdout -t option
+ verbose -v option
+ warn opposite of -w option
+ (use "%option nowarn" for -w)
+
+ array equivalent to "%array"
+ pointer equivalent to "%pointer" (default)
+
+ Some %option's provide features otherwise not available:
+
+ always-interactive
+ instructs flex to generate a scanner which always
+ considers its input "interactive". Normally, on
+ each new input file the scanner calls isatty() in
+ an attempt to determine whether the scanner's
+ input source is interactive and thus should be
+ read a character at a time. When this option is
+ used, however, then no such call is made.
+
+ main directs flex to provide a default main() program
+ for the scanner, which simply calls yylex().
+ This option implies noyywrap (see below).
+
+ never-interactive
+ instructs flex to generate a scanner which never
+ considers its input "interactive" (again, no call
+ made to isatty()). This is the opposite of
+ always-interactive.
+
+ stack enables the use of start condition stacks (see
+ Start Conditions above).
+
+ stdinit
+ if set (i.e., %option stdinit) initializes yyin
+ and yyout to stdin and stdout, instead of the
+ default of nil. Some existing lex programs
+ depend on this behavior, even though it is not
+ compliant with ANSI C, which does not require
+ stdin and stdout to be compile-time constant.
+
+ yylineno
+ directs flex to generate a scanner that maintains
+ the number of the current line read from its
+ input in the global variable yylineno. This
+ option is implied by %option lex-compat.
+
+ yywrap if unset (i.e., %option noyywrap), makes the
+ scanner not call yywrap() upon an end-of-file,
+ but simply assume that there are no more files to
+ scan (until the user points yyin at a new file
+ and calls yylex() again).
+
+ flex scans your rule actions to determine whether you
+ use the REJECT or yymore() features. The reject and
+ yymore options are available to override its decision as
+ to whether you use the options, either by setting them
+ (e.g., %option reject) to indicate the feature is indeed
+ used, or unsetting them to indicate it actually is not
+ used (e.g., %option noyymore).
+
+ Three options take string-delimited values, offset with
+ '=':
+
+ %option outfile="ABC"
+
+ is equivalent to -oABC, and
+
+ %option prefix="XYZ"
+
+ is equivalent to -PXYZ. Finally,
+
+ %option yyclass="foo"
+
+ only applies when generating a C++ scanner ( -+ option).
+ It informs flex that you have derived foo as a subclass
+ of yyFlexLexer, so flex will place your actions in the
+ member function foo::yylex() instead of
+ yyFlexLexer::yylex(). It also generates a
+ yyFlexLexer::yylex() member function that emits a run-
+ time error (by invoking yyFlexLexer::LexerError()) if
+ called. See Generating C++ Scanners, below, for addi-
+ tional information.
+
+ A number of options are available for lint purists who
+ want to suppress the appearance of unneeded routines in
+ the generated scanner. Each of the following, if unset
+ (e.g., %option nounput ), results in the corresponding
+ routine not appearing in the generated scanner:
+
+ input, unput
+ yy_push_state, yy_pop_state, yy_top_state
+ yy_scan_buffer, yy_scan_bytes, yy_scan_string
+
+ (though yy_push_state() and friends won't appear anyway
+ unless you use %option stack).
+
+PERFORMANCE CONSIDERATIONS
+ The main design goal of flex is that it generate high-
+ performance scanners. It has been optimized for dealing
+ well with large sets of rules. Aside from the effects
+ on scanner speed of the table compression -C options
+ outlined above, there are a number of options/actions
+ which degrade performance. These are, from most expen-
+ sive to least:
+
+ REJECT
+ %option yylineno
+ arbitrary trailing context
+
+ pattern sets that require backing up
+ %array
+ %option interactive
+ %option always-interactive
+
+ '^' beginning-of-line operator
+ yymore()
+
+ with the first three all being quite expensive and the
+ last two being quite cheap. Note also that unput() is
+ implemented as a routine call that potentially does
+ quite a bit of work, while yyless() is a quite-cheap
+ macro; so if just putting back some excess text you
+ scanned, use yyless().
+
+ REJECT should be avoided at all costs when performance
+ is important. It is a particularly expensive option.
+
+ Getting rid of backing up is messy and often may be an
+ enormous amount of work for a complicated scanner. In
+ principal, one begins by using the -b flag to generate a
+ lex.backup file. For example, on the input
+
+ %%
+ foo return TOK_KEYWORD;
+ foobar return TOK_KEYWORD;
+
+ the file looks like:
+
+ State #6 is non-accepting -
+ associated rule line numbers:
+ 2 3
+ out-transitions: [ o ]
+ jam-transitions: EOF [ \001-n p-\177 ]
+
+ State #8 is non-accepting -
+ associated rule line numbers:
+ 3
+ out-transitions: [ a ]
+ jam-transitions: EOF [ \001-` b-\177 ]
+
+ State #9 is non-accepting -
+ associated rule line numbers:
+ 3
+ out-transitions: [ r ]
+ jam-transitions: EOF [ \001-q s-\177 ]
+
+ Compressed tables always back up.
+
+ The first few lines tell us that there's a scanner state
+ in which it can make a transition on an 'o' but not on
+ any other character, and that in that state the cur-
+ rently scanned text does not match any rule. The state
+ occurs when trying to match the rules found at lines 2
+ and 3 in the input file. If the scanner is in that
+ state and then reads something other than an 'o', it
+ will have to back up to find a rule which is matched.
+ With a bit of headscratching one can see that this must
+ be the state it's in when it has seen "fo". When this
+ has happened, if anything other than another 'o' is
+ seen, the scanner will have to back up to simply match
+ the 'f' (by the default rule).
+
+ The comment regarding State #8 indicates there's a prob-
+ lem when "foob" has been scanned. Indeed, on any char-
+ acter other than an 'a', the scanner will have to back
+ up to accept "foo". Similarly, the comment for State #9
+ concerns when "fooba" has been scanned and an 'r' does
+ not follow.
+
+ The final comment reminds us that there's no point going
+ to all the trouble of removing backing up from the rules
+ unless we're using -Cf or -CF, since there's no perfor-
+ mance gain doing so with compressed scanners.
+
+ The way to remove the backing up is to add "error"
+ rules:
+
+ %%
+ foo return TOK_KEYWORD;
+ foobar return TOK_KEYWORD;
+
+ fooba |
+ foob |
+ fo {
+ /* false alarm, not really a keyword */
+ return TOK_ID;
+ }
+
+
+ Eliminating backing up among a list of keywords can also
+ be done using a "catch-all" rule:
+
+ %%
+ foo return TOK_KEYWORD;
+ foobar return TOK_KEYWORD;
+
+ [a-z]+ return TOK_ID;
+
+ This is usually the best solution when appropriate.
+
+ Backing up messages tend to cascade. With a complicated
+ set of rules it's not uncommon to get hundreds of mes-
+ sages. If one can decipher them, though, it often only
+ takes a dozen or so rules to eliminate the backing up
+ (though it's easy to make a mistake and have an error
+ rule accidentally match a valid token. A possible
+ future flex feature will be to automatically add rules
+ to eliminate backing up).
+
+ It's important to keep in mind that you gain the bene-
+ fits of eliminating backing up only if you eliminate
+ every instance of backing up. Leaving just one means
+ you gain nothing.
+
+ Variable trailing context (where both the leading and
+ trailing parts do not have a fixed length) entails
+ almost the same performance loss as REJECT (i.e., sub-
+ stantial). So when possible a rule like:
+
+ %%
+ mouse|rat/(cat|dog) run();
+
+ is better written:
+
+ %%
+ mouse/cat|dog run();
+ rat/cat|dog run();
+
+ or as
+
+ %%
+ mouse|rat/cat run();
+ mouse|rat/dog run();
+
+ Note that here the special '|' action does not provide
+ any savings, and can even make things worse (see Defi-
+ ciencies / Bugs below).
+
+ Another area where the user can increase a scanner's
+ performance (and one that's easier to implement) arises
+ from the fact that the longer the tokens matched, the
+ faster the scanner will run. This is because with long
+ tokens the processing of most input characters takes
+ place in the (short) inner scanning loop, and does not
+ often have to go through the additional work of setting
+ up the scanning environment (e.g., yytext) for the
+ action. Recall the scanner for C comments:
+
+ %x comment
+ %%
+ int line_num = 1;
+
+ "/*" BEGIN(comment);
+
+ <comment>[^*\n]*
+ <comment>"*"+[^*/\n]*
+ <comment>\n ++line_num;
+ <comment>"*"+"/" BEGIN(INITIAL);
+
+ This could be sped up by writing it as:
+
+ %x comment
+ %%
+ int line_num = 1;
+
+ "/*" BEGIN(comment);
+
+ <comment>[^*\n]*
+ <comment>[^*\n]*\n ++line_num;
+ <comment>"*"+[^*/\n]*
+ <comment>"*"+[^*/\n]*\n ++line_num;
+ <comment>"*"+"/" BEGIN(INITIAL);
+
+ Now instead of each newline requiring the processing of
+ another action, recognizing the newlines is "distrib-
+ uted" over the other rules to keep the matched text as
+ long as possible. Note that adding rules does not slow
+ down the scanner! The speed of the scanner is indepen-
+ dent of the number of rules or (modulo the considera-
+ tions given at the beginning of this section) how com-
+ plicated the rules are with regard to operators such as
+ '*' and '|'.
+
+ A final example in speeding up a scanner: suppose you
+ want to scan through a file containing identifiers and
+ keywords, one per line and with no other extraneous
+ characters, and recognize all the keywords. A natural
+ first approach is:
+
+ %%
+ asm |
+ auto |
+ break |
+ ... etc ...
+ volatile |
+ while /* it's a keyword */
+
+ .|\n /* it's not a keyword */
+
+ To eliminate the back-tracking, introduce a catch-all
+ rule:
+
+ %%
+ asm |
+ auto |
+ break |
+ ... etc ...
+ volatile |
+ while /* it's a keyword */
+
+ [a-z]+ |
+ .|\n /* it's not a keyword */
+
+ Now, if it's guaranteed that there's exactly one word
+ per line, then we can reduce the total number of matches
+ by a half by merging in the recognition of newlines with
+ that of the other tokens:
+
+ %%
+ asm\n |
+ auto\n |
+ break\n |
+ ... etc ...
+ volatile\n |
+ while\n /* it's a keyword */
+
+ [a-z]+\n |
+ .|\n /* it's not a keyword */
+
+ One has to be careful here, as we have now reintroduced
+ backing up into the scanner. In particular, while we
+ know that there will never be any characters in the
+ input stream other than letters or newlines, flex can't
+ figure this out, and it will plan for possibly needing
+ to back up when it has scanned a token like "auto" and
+ then the next character is something other than a new-
+ line or a letter. Previously it would then just match
+ the "auto" rule and be done, but now it has no "auto"
+ rule, only a "auto\n" rule. To eliminate the possibil-
+ ity of backing up, we could either duplicate all rules
+ but without final newlines, or, since we never expect to
+ encounter such an input and therefore don't how it's
+ classified, we can introduce one more catch-all rule,
+ this one which doesn't include a newline:
+
+ %%
+ asm\n |
+ auto\n |
+ break\n |
+ ... etc ...
+ volatile\n |
+ while\n /* it's a keyword */
+
+ [a-z]+\n |
+ [a-z]+ |
+ .|\n /* it's not a keyword */
+
+ Compiled with -Cf, this is about as fast as one can get
+ a flex scanner to go for this particular problem.
+
+ A final note: flex is slow when matching NUL's, particu-
+ larly when a token contains multiple NUL's. It's best
+ to write rules which match short amounts of text if it's
+ anticipated that the text will often include NUL's.
+
+ Another final note regarding performance: as mentioned
+ above in the section How the Input is Matched, dynami-
+ cally resizing yytext to accommodate huge tokens is a
+ slow process because it presently requires that the
+ (huge) token be rescanned from the beginning. Thus if
+ performance is vital, you should attempt to match
+ "large" quantities of text but not "huge" quantities,
+ where the cutoff between the two is at about 8K charac-
+ ters/token.
+
+GENERATING C++ SCANNERS
+ flex provides two different ways to generate scanners
+ for use with C++. The first way is to simply compile a
+ scanner generated by flex using a C++ compiler instead
+ of a C compiler. You should not encounter any compila-
+ tions errors (please report any you find to the email
+ address given in the Author section below). You can
+ then use C++ code in your rule actions instead of C
+ code. Note that the default input source for your scan-
+ ner remains yyin, and default echoing is still done to
+ yyout. Both of these remain FILE * variables and not
+ C++ streams.
+
+ You can also use flex to generate a C++ scanner class,
+ using the -+ option (or, equivalently, %option c++),
+ which is automatically specified if the name of the flex
+ executable ends in a '+', such as flex++. When using
+ this option, flex defaults to generating the scanner to
+ the file lex.yy.cc instead of lex.yy.c. The generated
+ scanner includes the header file FlexLexer.h, which
+ defines the interface to two C++ classes.
+
+ The first class, FlexLexer, provides an abstract base
+ class defining the general scanner class interface. It
+ provides the following member functions:
+
+ const char* YYText()
+ returns the text of the most recently matched
+ token, the equivalent of yytext.
+
+ int YYLeng()
+ returns the length of the most recently matched
+ token, the equivalent of yyleng.
+
+ int lineno() const
+ returns the current input line number (see
+ %option yylineno), or 1 if %option yylineno was
+ not used.
+
+ void set_debug( int flag )
+ sets the debugging flag for the scanner, equiva-
+ lent to assigning to yy_flex_debug (see the
+ Options section above). Note that you must build
+ the scanner using %option debug to include debug-
+ ging information in it.
+
+ int debug() const
+ returns the current setting of the debugging
+ flag.
+
+ Also provided are member functions equivalent to
+ yy_switch_to_buffer(), yy_create_buffer() (though the
+ first argument is an istream* object pointer and not a
+ FILE*), yy_flush_buffer(), yy_delete_buffer(), and
+ yyrestart() (again, the first argument is a istream*
+ object pointer).
+
+ The second class defined in FlexLexer.h is yyFlexLexer,
+ which is derived from FlexLexer. It defines the follow-
+ ing additional member functions:
+
+ yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout =
+ 0 )
+ constructs a yyFlexLexer object using the given
+ streams for input and output. If not specified,
+ the streams default to cin and cout, respec-
+ tively.
+
+ virtual int yylex()
+ performs the same role is yylex() does for ordi-
+ nary flex scanners: it scans the input stream,
+ consuming tokens, until a rule's action returns a
+ value. If you derive a subclass S from
+ yyFlexLexer and want to access the member func-
+ tions and variables of S inside yylex(), then you
+ need to use %option yyclass="S" to inform flex
+ that you will be using that subclass instead of
+ yyFlexLexer. In this case, rather than generat-
+ ing yyFlexLexer::yylex(), flex generates
+ S::yylex() (and also generates a dummy
+ yyFlexLexer::yylex() that calls
+ yyFlexLexer::LexerError() if called).
+
+ virtual void switch_streams(istream* new_in = 0,
+ ostream* new_out = 0) reassigns yyin to new_in
+ (if non-nil) and yyout to new_out (ditto), delet-
+ ing the previous input buffer if yyin is reas-
+ signed.
+
+ int yylex( istream* new_in, ostream* new_out = 0 )
+ first switches the input streams via
+ switch_streams( new_in, new_out ) and then
+ returns the value of yylex().
+
+ In addition, yyFlexLexer defines the following protected
+ virtual functions which you can redefine in derived
+ classes to tailor the scanner:
+
+ virtual int LexerInput( char* buf, int max_size )
+ reads up to max_size characters into buf and
+ returns the number of characters read. To indi-
+ cate end-of-input, return 0 characters. Note
+ that "interactive" scanners (see the -B and -I
+ flags) define the macro YY_INTERACTIVE. If you
+ redefine LexerInput() and need to take different
+ actions depending on whether or not the scanner
+ might be scanning an interactive input source,
+ you can test for the presence of this name via
+ #ifdef.
+
+ virtual void LexerOutput( const char* buf, int size )
+ writes out size characters from the buffer buf,
+ which, while NUL-terminated, may also contain
+ "internal" NUL's if the scanner's rules can match
+ text with NUL's in them.
+
+ virtual void LexerError( const char* msg )
+ reports a fatal error message. The default ver-
+ sion of this function writes the message to the
+ stream cerr and exits.
+
+ Note that a yyFlexLexer object contains its entire scan-
+ ning state. Thus you can use such objects to create
+ reentrant scanners. You can instantiate multiple
+ instances of the same yyFlexLexer class, and you can
+ also combine multiple C++ scanner classes together in
+ the same program using the -P option discussed above.
+
+ Finally, note that the %array feature is not available
+ to C++ scanner classes; you must use %pointer (the
+ default).
+
+ Here is an example of a simple C++ scanner:
+
+ // An example of using the flex C++ scanner class.
+
+ %{
+ int mylineno = 0;
+ %}
+
+ string \"[^\n"]+\"
+
+ ws [ \t]+
+
+ alpha [A-Za-z]
+ dig [0-9]
+ name ({alpha}|{dig}|\$)({alpha}|{dig}|[_.\-/$])*
+ num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)?
+ num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)?
+ number {num1}|{num2}
+
+ %%
+
+ {ws} /* skip blanks and tabs */
+
+ "/*" {
+ int c;
+
+ while((c = yyinput()) != 0)
+ {
+ if(c == '\n')
+ ++mylineno;
+
+ else if(c == '*')
+ {
+ if((c = yyinput()) == '/')
+ break;
+ else
+ unput(c);
+ }
+ }
+ }
+
+ {number} cout << "number " << YYText() << '\n';
+
+ \n mylineno++;
+
+ {name} cout << "name " << YYText() << '\n';
+
+ {string} cout << "string " << YYText() << '\n';
+
+ %%
+
+ int main( int /* argc */, char** /* argv */ )
+ {
+ FlexLexer* lexer = new yyFlexLexer;
+ while(lexer->yylex() != 0)
+ ;
+ return 0;
+ }
+ If you want to create multiple (different) lexer
+ classes, you use the -P flag (or the prefix= option) to
+ rename each yyFlexLexer to some other xxFlexLexer. You
+ then can include <FlexLexer.h> in your other sources
+ once per lexer class, first renaming yyFlexLexer as fol-
+ lows:
+
+ #undef yyFlexLexer
+ #define yyFlexLexer xxFlexLexer
+ #include <FlexLexer.h>
+
+ #undef yyFlexLexer
+ #define yyFlexLexer zzFlexLexer
+ #include <FlexLexer.h>
+
+ if, for example, you used %option prefix="xx" for one of
+ your scanners and %option prefix="zz" for the other.
+
+ IMPORTANT: the present form of the scanning class is
+ experimental and may change considerably between major
+ releases.
+
+INCOMPATIBILITIES WITH LEX AND POSIX
+ flex is a rewrite of the AT&T Unix lex tool (the two
+ implementations do not share any code, though), with
+ some extensions and incompatibilities, both of which are
+ of concern to those who wish to write scanners accept-
+ able to either implementation. Flex is fully compliant
+ with the POSIX lex specification, except that when using
+ %pointer (the default), a call to unput() destroys the
+ contents of yytext, which is counter to the POSIX
+ specification.
+
+ In this section we discuss all of the known areas of
+ incompatibility between flex, AT&T lex, and the POSIX
+ specification.
+
+ flex's -l option turns on maximum compatibility with the
+ original AT&T lex implementation, at the cost of a major
+ loss in the generated scanner's performance. We note
+ below which incompatibilities can be overcome using the
+ -l option.
+
+ flex is fully compatible with lex with the following
+ exceptions:
+
+ - The undocumented lex scanner internal variable
+ yylineno is not supported unless -l or %option
+ yylineno is used.
+
+ yylineno should be maintained on a per-buffer
+ basis, rather than a per-scanner (single global
+ variable) basis.
+
+ yylineno is not part of the POSIX specification.
+
+ - The input() routine is not redefinable, though it
+ may be called to read characters following what-
+ ever has been matched by a rule. If input()
+ encounters an end-of-file the normal yywrap()
+ processing is done. A ``real'' end-of-file is
+ returned by input() as EOF.
+
+ Input is instead controlled by defining the
+ YY_INPUT macro.
+
+ The flex restriction that input() cannot be rede-
+ fined is in accordance with the POSIX specifica-
+ tion, which simply does not specify any way of
+ controlling the scanner's input other than by
+ making an initial assignment to yyin.
+
+ - The unput() routine is not redefinable. This
+ restriction is in accordance with POSIX.
+
+ - flex scanners are not as reentrant as lex scan-
+ ners. In particular, if you have an interactive
+ scanner and an interrupt handler which long-jumps
+ out of the scanner, and the scanner is subse-
+ quently called again, you may get the following
+ message:
+
+ fatal flex scanner internal error--end of buffer missed
+
+ To reenter the scanner, first use
+
+ yyrestart( yyin );
+
+ Note that this call will throw away any buffered
+ input; usually this isn't a problem with an
+ interactive scanner.
+
+ Also note that flex C++ scanner classes are reen-
+ trant, so if using C++ is an option for you, you
+ should use them instead. See "Generating C++
+ Scanners" above for details.
+
+ - output() is not supported. Output from the ECHO
+ macro is done to the file-pointer yyout (default
+ stdout).
+
+ output() is not part of the POSIX specification.
+
+ - lex does not support exclusive start conditions
+ (%x), though they are in the POSIX specification.
+
+ - When definitions are expanded, flex encloses them
+ in parentheses. With lex, the following:
+
+ NAME [A-Z][A-Z0-9]*
+ %%
+ foo{NAME}? printf( "Found it\n" );
+ %%
+
+ will not match the string "foo" because when the
+ macro is expanded the rule is equivalent to
+ "foo[A-Z][A-Z0-9]*?" and the precedence is such
+ that the '?' is associated with "[A-Z0-9]*".
+ With flex, the rule will be expanded to "foo([A-
+ Z][A-Z0-9]*)?" and so the string "foo" will
+ match.
+
+ Note that if the definition begins with ^ or ends
+ with $ then it is not expanded with parentheses,
+ to allow these operators to appear in definitions
+ without losing their special meanings. But the
+ <s>, /, and <<EOF>> operators cannot be used in a
+ flex definition.
+
+ Using -l results in the lex behavior of no paren-
+ theses around the definition.
+
+ The POSIX specification is that the definition be
+ enclosed in parentheses.
+
+ - Some implementations of lex allow a rule's action
+ to begin on a separate line, if the rule's pat-
+ tern has trailing whitespace:
+
+ %%
+ foo|bar<space here>
+ { foobar_action(); }
+
+ flex does not support this feature.
+
+ - The lex %r (generate a Ratfor scanner) option is
+ not supported. It is not part of the POSIX spec-
+ ification.
+
+ - After a call to unput(), yytext is undefined
+ until the next token is matched, unless the scan-
+ ner was built using %array. This is not the case
+ with lex or the POSIX specification. The -l
+ option does away with this incompatibility.
+
+ - The precedence of the {} (numeric range) operator
+ is different. lex interprets "abc{1,3}" as
+ "match one, two, or three occurrences of 'abc'",
+ whereas flex interprets it as "match 'ab' fol-
+ lowed by one, two, or three occurrences of 'c'".
+ The latter is in agreement with the POSIX speci-
+ fication.
+
+ - The precedence of the ^ operator is different.
+ lex interprets "^foo|bar" as "match either 'foo'
+ at the beginning of a line, or 'bar' anywhere",
+ whereas flex interprets it as "match either 'foo'
+ or 'bar' if they come at the beginning of a
+ line". The latter is in agreement with the POSIX
+ specification.
+
+ - The special table-size declarations such as %a
+ supported by lex are not required by flex scan-
+ ners; flex ignores them.
+
+ - The name FLEX_SCANNER is #define'd so scanners
+ may be written for use with either flex or lex.
+ Scanners also include YY_FLEX_MAJOR_VERSION and
+ YY_FLEX_MINOR_VERSION indicating which version of
+ flex generated the scanner (for example, for the
+ 2.5 release, these defines would be 2 and 5
+ respectively).
+
+ The following flex features are not included in lex or
+ the POSIX specification:
+
+ C++ scanners
+ %option
+ start condition scopes
+ start condition stacks
+ interactive/non-interactive scanners
+ yy_scan_string() and friends
+ yyterminate()
+ yy_set_interactive()
+ yy_set_bol()
+ YY_AT_BOL()
+ <<EOF>>
+ <*>
+ YY_DECL
+ YY_START
+ YY_USER_ACTION
+ YY_USER_INIT
+ #line directives
+ %{}'s around actions
+ multiple actions on a line
+
+ plus almost all of the flex flags. The last feature in
+ the list refers to the fact that with flex you can put
+ multiple actions on the same line, separated with semi-
+ colons, while with lex, the following
+
+ foo handle_foo(); ++num_foos_seen;
+
+ is (rather surprisingly) truncated to
+
+ foo handle_foo();
+
+ flex does not truncate the action. Actions that are not
+ enclosed in braces are simply terminated at the end of
+ the line.
+
+DIAGNOSTICS
+ warning, rule cannot be matched indicates that the given
+ rule cannot be matched because it follows other rules
+ that will always match the same text as it. For exam-
+ ple, in the following "foo" cannot be matched because it
+ comes after an identifier "catch-all" rule:
+
+ [a-z]+ got_identifier();
+ foo got_foo();
+
+ Using REJECT in a scanner suppresses this warning.
+
+ warning, -s option given but default rule can be matched
+ means that it is possible (perhaps only in a particular
+ start condition) that the default rule (match any single
+ character) is the only one that will match a particular
+ input. Since -s was given, presumably this is not
+ intended.
+
+ reject_used_but_not_detected undefined or
+ yymore_used_but_not_detected undefined - These errors
+ can occur at compile time. They indicate that the scan-
+ ner uses REJECT or yymore() but that flex failed to
+ notice the fact, meaning that flex scanned the first two
+ sections looking for occurrences of these actions and
+ failed to find any, but somehow you snuck some in (via a
+ #include file, for example). Use %option reject or
+ %option yymore to indicate to flex that you really do
+ use these features.
+
+ flex scanner jammed - a scanner compiled with -s has
+ encountered an input string which wasn't matched by any
+ of its rules. This error can also occur due to internal
+ problems.
+
+ token too large, exceeds YYLMAX - your scanner uses
+ %array and one of its rules matched a string longer than
+ the YYLMAX constant (8K bytes by default). You can
+ increase the value by #define'ing YYLMAX in the defini-
+ tions section of your flex input.
+
+ scanner requires -8 flag to use the character 'x' - Your
+ scanner specification includes recognizing the 8-bit
+ character 'x' and you did not specify the -8 flag, and
+ your scanner defaulted to 7-bit because you used the -Cf
+ or -CF table compression options. See the discussion of
+ the -7 flag for details.
+
+ flex scanner push-back overflow - you used unput() to
+ push back so much text that the scanner's buffer could
+ not hold both the pushed-back text and the current token
+ in yytext. Ideally the scanner should dynamically
+ resize the buffer in this case, but at present it does
+ not.
+
+ input buffer overflow, can't enlarge buffer because
+ scanner uses REJECT - the scanner was working on match-
+ ing an extremely large token and needed to expand the
+ input buffer. This doesn't work with scanners that use
+ REJECT.
+
+ fatal flex scanner internal error--end of buffer missed
+ - This can occur in an scanner which is reentered after
+ a long-jump has jumped out (or over) the scanner's acti-
+ vation frame. Before reentering the scanner, use:
+
+ yyrestart( yyin );
+
+ or, as noted above, switch to using the C++ scanner
+ class.
+
+ too many start conditions in <> construct! - you listed
+ more start conditions in a <> construct than exist (so
+ you must have listed at least one of them twice).
+
+FILES
+ -lfl library with which scanners must be linked.
+
+ lex.yy.c
+ generated scanner (called lexyy.c on some sys-
+ tems).
+
+ lex.yy.cc
+ generated C++ scanner class, when using -+.
+
+ <FlexLexer.h>
+ header file defining the C++ scanner base class,
+ FlexLexer, and its derived class, yyFlexLexer.
+
+ flex.skl
+ skeleton scanner. This file is only used when
+ building flex, not when flex executes.
+
+ lex.backup
+ backing-up information for -b flag (called
+ lex.bck on some systems).
+
+DEFICIENCIES / BUGS
+ Some trailing context patterns cannot be properly
+ matched and generate warning messages ("dangerous trail-
+ ing context"). These are patterns where the ending of
+ the first part of the rule matches the beginning of the
+ second part, such as "zx*/xy*", where the 'x*' matches
+ the 'x' at the beginning of the trailing context. (Note
+ that the POSIX draft states that the text matched by
+ such patterns is undefined.)
+
+ For some trailing context rules, parts which are actu-
+ ally fixed-length are not recognized as such, leading to
+ the abovementioned performance loss. In particular,
+ parts using '|' or {n} (such as "foo{3}") are always
+ considered variable-length.
+
+ Combining trailing context with the special '|' action
+ can result in fixed trailing context being turned into
+ the more expensive variable trailing context. For exam-
+ ple, in the following:
+
+ %%
+ abc |
+ xyz/def
+
+
+ Use of unput() invalidates yytext and yyleng, unless the
+ %array directive or the -l option has been used.
+
+ Pattern-matching of NUL's is substantially slower than
+ matching other characters.
+
+ Dynamic resizing of the input buffer is slow, as it
+ entails rescanning all the text matched so far by the
+ current (generally huge) token.
+
+ Due to both buffering of input and read-ahead, you can-
+ not intermix calls to <stdio.h> routines, such as, for
+ example, getchar(), with flex rules and expect it to
+ work. Call input() instead.
+
+ The total table entries listed by the -v flag excludes
+ the number of table entries needed to determine what
+ rule has been matched. The number of entries is equal
+ to the number of DFA states if the scanner does not use
+ REJECT, and somewhat greater than the number of states
+ if it does.
+
+ REJECT cannot be used with the -f or -F options.
+
+ The flex internal algorithms need documentation.
+
+SEE ALSO
+ lex(1), yacc(1), sed(1), awk(1).
+
+ John Levine, Tony Mason, and Doug Brown, Lex & Yacc,
+ O'Reilly and Associates. Be sure to get the 2nd edi-
+ tion.
+
+ M. E. Lesk and E. Schmidt, LEX - Lexical Analyzer Gener-
+ ator
+
+ Alfred Aho, Ravi Sethi and Jeffrey Ullman, Compilers:
+ Principles, Techniques and Tools, Addison-Wesley (1986).
+ Describes the pattern-matching techniques used by flex
+ (deterministic finite automata).
+
+AUTHOR
+ Vern Paxson, with the help of many ideas and much inspi-
+ ration from Van Jacobson. Original version by Jef
+ Poskanzer. The fast table representation is a partial
+ implementation of a design done by Van Jacobson. The
+ implementation was done by Kevin Gong and Vern Paxson.
+
+ Thanks to the many flex beta-testers, feedbackers, and
+ contributors, especially Francois Pinard, Casey Leedom,
+ Robert Abramovitz, Stan Adermann, Terry Allen, David
+ Barker-Plummer, John Basrai, Neal Becker, Nelson H.F.
+ Beebe, benson@odi.com, Karl Berry, Peter A. Bigot, Simon
+ Blanchard, Keith Bostic, Frederic Brehm, Ian Brockbank,
+ Kin Cho, Nick Christopher, Brian Clapper, J.T. Conklin,
+ Jason Coughlin, Bill Cox, Nick Cropper, Dave Curtis,
+ Scott David Daniels, Chris G. Demetriou, Theo Deraadt,
+ Mike Donahue, Chuck Doucette, Tom Epperly, Leo Eskin,
+ Chris Faylor, Chris Flatters, Jon Forrest, Jeffrey
+ Friedl, Joe Gayda, Kaveh R. Ghazi, Wolfgang Glunz, Eric
+ Goldman, Christopher M. Gould, Ulrich Grepel, Peer
+ Griebel, Jan Hajic, Charles Hemphill, NORO Hideo, Jarkko
+ Hietaniemi, Scott Hofmann, Jeff Honig, Dana Hudes, Eric
+ Hughes, John Interrante, Ceriel Jacobs, Michal
+ Jaegermann, Sakari Jalovaara, Jeffrey R. Jones, Henry
+ Juengst, Klaus Kaempf, Jonathan I. Kamens, Terrence O
+ Kane, Amir Katz, ken@ken.hilco.com, Kevin B. Kenny,
+ Steve Kirsch, Winfried Koenig, Marq Kole, Ronald Lam-
+ precht, Greg Lee, Rohan Lenard, Craig Leres, John
+ Levine, Steve Liddle, David Loffredo, Mike Long, Mohamed
+ el Lozy, Brian Madsen, Malte, Joe Marshall, Bengt
+ Martensson, Chris Metcalf, Luke Mewburn, Jim Meyering,
+ R. Alexander Milowski, Erik Naggum, G.T. Nicol, Landon
+ Noll, James Nordby, Marc Nozell, Richard Ohnemus,
+ Karsten Pahnke, Sven Panne, Roland Pesch, Walter Pelis-
+ sero, Gaumond Pierre, Esmond Pitt, Jef Poskanzer, Joe
+ Rahmeh, Jarmo Raiha, Frederic Raimbault, Pat Rankin,
+ Rick Richardson, Kevin Rodgers, Kai Uwe Rommel, Jim
+ Roskind, Alberto Santini, Andreas Scherer, Darrell
+ Schiebel, Raf Schietekat, Doug Schmidt, Philippe Schnoe-
+ belen, Andreas Schwab, Larry Schwimmer, Alex Siegel,
+ Eckehard Stolz, Jan-Erik Strvmquist, Mike Stump, Paul
+ Stuart, Dave Tallman, Ian Lance Taylor, Chris Thewalt,
+ Richard M. Timoney, Jodi Tsai, Paul Tuinenga, Gary Weik,
+ Frank Whaley, Gerhard Wilhelms, Kent Williams, Ken Yap,
+ Ron Zellar, Nathan Zelle, David Zuhn, and those whose
+ names have slipped my marginal mail-archiving skills but
+ whose contributions are appreciated all the same.
+
+ Thanks to Keith Bostic, Jon Forrest, Noah Friedman, John
+ Gilmore, Craig Leres, John Levine, Bob Mulcahy, G.T.
+ Nicol, Francois Pinard, Rich Salz, and Richard Stallman
+ for help with various distribution headaches.
+
+ Thanks to Esmond Pitt and Earle Horton for 8-bit charac-
+ ter support; to Benson Margulies and Fred Burke for C++
+ support; to Kent Williams and Tom Epperly for C++ class
+ support; to Ove Ewerlid for support of NUL's; and to
+ Eric Hughes for support of multiple buffers.
+
+ This work was primarily done when I was with the Real
+ Time Systems Group at the Lawrence Berkeley Laboratory
+ in Berkeley, CA. Many thanks to all there for the sup-
+ port I received.
+
+ Send comments to vern@ee.lbl.gov.
+
+
+
+Version 2.5 April 1995 FLEX(1)
diff --git a/gnuwin32/man/cat1/gperf.1.txt b/gnuwin32/man/cat1/gperf.1.txt
new file mode 100644
index 00000000..d9e128c7
--- /dev/null
+++ b/gnuwin32/man/cat1/gperf.1.txt
@@ -0,0 +1,226 @@
+GPERF(1) FSF GPERF(1)
+
+
+
+
+
+NAME
+ gperf - generate a perfect hash function from a key set
+
+SYNOPSIS
+ gperf [OPTION]... [INPUT-FILE]
+
+DESCRIPTION
+ GNU 'gperf' generates perfect hash functions.
+
+ If a long option shows an argument as mandatory, then it
+ is mandatory for the equivalent short option also.
+
+ Output file location:
+ --output-file=FILE Write output to specified file.
+
+ The results are written to standard output if no output
+ file is specified or if it is -.
+
+ Input file interpretation:
+ -e, --delimiters=DELIMITER-LIST
+ Allow user to provide a string containing delim-
+ iters used to separate keywords from their
+ attributes. Default is ",".
+
+ -t, --struct-type
+ Allows the user to include a structured type dec-
+ laration for generated code. Any text before %%
+ is considered part of the type declaration. Key
+ words and additional fields may follow this, one
+ group of fields per line.
+
+ --ignore-case
+ Consider upper and lower case ASCII characters as
+ equivalent. Note that locale dependent case map-
+ pings are ignored.
+
+ Language for the output code:
+ -L, --language=LANGUAGE-NAME
+ Generates code in the specified language. Lan-
+ guages handled are currently C++, ANSI-C, C, and
+ KR-C. The default is C.
+
+ Details in the output code:
+ -K, --slot-name=NAME
+ Select name of the keyword component in the key-
+ word structure.
+
+ -F, --initializer-suffix=INITIALIZERS
+ Initializers for additional components in the
+ keyword structure.
+
+ -H, --hash-function-name=NAME
+ Specify name of generated hash function. Default
+ is 'hash'.
+
+ -N, --lookup-function-name=NAME
+ Specify name of generated lookup function.
+ Default name is 'in_word_set'.
+
+ -Z, --class-name=NAME
+ Specify name of generated C++ class. Default name
+ is 'Perfect_Hash'.
+
+ -7, --seven-bit
+ Assume 7-bit characters.
+
+ -l, --compare-lengths
+ Compare key lengths before trying a string com-
+ parison. This is necessary if the keywords con-
+ tain NUL bytes. It also helps cut down on the
+ number of string comparisons made during the
+ lookup.
+
+ -c, --compare-strncmp
+ Generate comparison code using strncmp rather
+ than strcmp.
+
+ -C, --readonly-tables
+ Make the contents of generated lookup tables con-
+ stant, i.e., readonly.
+
+ -E, --enum
+ Define constant values using an enum local to the
+ lookup function rather than with defines.
+
+ -I, --includes
+ Include the necessary system include file
+ <string.h> at the beginning of the code.
+
+ -G, --global-table
+ Generate the static table of keywords as a static
+ global variable, rather than hiding it inside of
+ the lookup function (which is the default behav-
+ ior).
+
+ -P, --pic
+ Optimize the generated table for inclusion in
+ shared libraries. This reduces the startup time
+ of programs using a shared library containing the
+ generated code.
+
+ -Q, --string-pool-name=NAME
+ Specify name of string pool generated by option
+ --pic. Default name is 'stringpool'.
+
+ --null-strings
+ Use NULL strings instead of empty strings for
+ empty keyword table entries.
+
+ -W, --word-array-name=NAME
+ Specify name of word list array. Default name is
+ 'wordlist'.
+
+ -S, --switch=COUNT
+ Causes the generated C code to use a switch
+ statement scheme, rather than an array lookup ta-
+ ble. This can lead to a reduction in both time
+ and space requirements for some keyfiles. The
+ COUNT argument determines how many switch state-
+ ments are generated. A value of 1 generates 1
+ switch containing all the elements, a value of 2
+ generates 2 tables with 1/2 the elements in each
+ table, etc. If COUNT is very large, say 1000000,
+ the generated C code does a binary search.
+
+ -T, --omit-struct-type
+ Prevents the transfer of the type declaration to
+ the output file. Use this option if the type is
+ already defined elsewhere.
+
+ Algorithm employed by gperf:
+ -k, --key-positions=KEYS
+ Select the key positions used in the hash func-
+ tion. The allowable choices range between 1-255,
+ inclusive. The positions are separated by com-
+ mas, ranges may be used, and key positions may
+ occur in any order. Also, the meta-character '*'
+ causes the generated hash function to consider
+ ALL key positions, and $ indicates the "final
+ character" of a key, e.g., $,1,2,4,6-10.
+
+ -D, --duplicates
+ Handle keywords that hash to duplicate values.
+ This is useful for certain highly redundant key-
+ word sets.
+
+ -m, --multiple-iterations=ITERATIONS
+ Perform multiple choices of the -i and -j values,
+ and choose the best results. This increases the
+ running time by a factor of ITERATIONS but does a
+ good job minimizing the generated table size.
+
+ -i, --initial-asso=N
+ Provide an initial value for the associate values
+ array. Default is 0. Setting this value larger
+ helps inflate the size of the final table.
+
+ -j, --jump=JUMP-VALUE
+ Affects the "jump value", i.e., how far to
+ advance the associated character value upon col-
+ lisions. Must be an odd number, default is 5.
+
+ -n, --no-strlen
+ Do not include the length of the keyword when
+ computing the hash function.
+
+ -r, --random
+ Utilizes randomness to initialize the associated
+ values table.
+
+ -s, --size-multiple=N
+ Affects the size of the generated hash table. The
+ numeric argument N indicates "how many times
+ larger or smaller" the associated value range
+ should be, in relationship to the number of keys,
+ e.g. a value of 3 means "allow the maximum asso-
+ ciated value to be about 3 times larger than the
+ number of input keys". Conversely, a value of 1/3
+ means "make the maximum associated value about 3
+ times smaller than the number of input keys". A
+ larger table should decrease the time required
+ for an unsuccessful search, at the expense of
+ extra table space. Default value is 1.
+
+ Informative output:
+ -h, --help
+ Print this message.
+
+ -v, --version
+ Print the gperf version number.
+
+ -d, --debug
+ Enables the debugging option (produces verbose
+ output to the standard error).
+
+AUTHOR
+ Written by Douglas C. Schmidt and Bruno Haible.
+
+REPORTING BUGS
+ Report bugs to <bug-gnu-gperf@gnu.org>.
+
+COPYRIGHT
+ Copyright (C) 1989-1998, 2000-2003 Free Software Founda-
+ tion, Inc.
+ This is free software; see the source for copying condi-
+ tions. There is NO warranty; not even for MERCHANTABIL-
+ ITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+SEE ALSO
+ The full documentation for gperf is maintained as a Tex-
+ info manual. If the info and gperf programs are prop-
+ erly installed at your site, the command
+
+ info gperf
+
+ should give you access to the complete manual.
+
+
+
+GNU gperf 3.0.1 June 2003 GPERF(1)
diff --git a/gnuwin32/man/cat1/iconv.1.txt b/gnuwin32/man/cat1/iconv.1.txt
new file mode 100644
index 00000000..2089d32e
--- /dev/null
+++ b/gnuwin32/man/cat1/iconv.1.txt
@@ -0,0 +1,48 @@
+ICONV(1) Linux Programmer's Manual ICONV(1)
+
+
+
+
+
+NAME
+ iconv - character set conversion
+
+SYNOPSIS
+ iconv [-c] [-s] [-f encoding] [-t encoding] [inputfile ...]
+ iconv -l
+
+DESCRIPTION
+ The iconv program converts text from one encoding to
+ another encoding. More precisely, it converts from the
+ encoding given for the -f option to the encoding given
+ for the -t option. Either of these encodings defaults to
+ the encoding of the current locale. All the inputfiles
+ are read and converted in turn; if no inputfile is
+ given, the standard input is used. The converted text is
+ printed to standard output.
+
+ When option -c is given, characters that cannot be con-
+ verted are silently discarded, instead of leading to a
+ conversion error.
+
+ When option -s is given, error messages about invalid or
+ unconvertible characters are omitted, but the actual
+ converted text is unaffected.
+
+ The encodings permitted are system dependent. For the
+ libiconv implementation, they are listed in the
+ iconv_open(3) manual page.
+
+ The iconv -l command lists the names of the supported
+ encodings, in a system dependent format. For the libi-
+ conv implementation, the names are printed in upper
+ case, separated by whitespace, and alias names of an
+ encoding are listed on the same line as the encoding
+ itself.
+
+SEE ALSO
+ iconv_open(3), locale(7)
+
+
+
+GNU January 13, 2002 ICONV(1)
diff --git a/gnuwin32/man/cat1/yacc.1.txt b/gnuwin32/man/cat1/yacc.1.txt
new file mode 100644
index 00000000..ada6a5c1
--- /dev/null
+++ b/gnuwin32/man/cat1/yacc.1.txt
@@ -0,0 +1,42 @@
+YACC(1) User Commands YACC(1)
+
+
+
+NAME
+ yacc - GNU Project parser generator
+
+SYNOPSIS
+ yacc [OPTION]... FILE
+
+DESCRIPTION
+ Yacc (Yet Another Compiler Compiler) is a parser genera-
+ tor. This version is a simple wrapper around bison(1).
+ It passes option -y, --yacc to activate the upward com-
+ patibility mode. See bison(1) for more information.
+
+AUTHOR
+ Written by Paul Eggert.
+
+REPORTING BUGS
+ Report bugs to <bug-bison@gnu.org>.
+
+COPYRIGHT
+ Copyright © 2008 Free Software Foundation, Inc.
+ This is free software; see the source for copying condi-
+ tions. There is NO warranty; not even for MERCHANTABIL-
+ ITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+SEE ALSO
+ lex(1), flex(1), bison(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.
+
+
+
+GNU Bison 2.4.1 November 2007 YACC(1)
diff --git a/gnuwin32/man/cat1p/yacc.1p.txt b/gnuwin32/man/cat1p/yacc.1p.txt
new file mode 100644
index 00000000..cab30089
--- /dev/null
+++ b/gnuwin32/man/cat1p/yacc.1p.txt
@@ -0,0 +1,1269 @@
+YACC(1P) POSIX Programmer's Manual YACC(1P)
+
+
+
+PROLOG
+ This manual page is part of the POSIX Programmer's Man-
+ ual. The Linux implementation of this interface may
+ differ (consult the corresponding Linux manual page for
+ details of Linux behavior), or the interface may not be
+ implemented on Linux.
+
+NAME
+ yacc - yet another compiler compiler (DEVELOPMENT)
+
+SYNOPSIS
+ yacc [-dltv][-b file_prefix][-p sym_prefix] grammar
+
+DESCRIPTION
+ The yacc utility shall read a description of a context-
+ free grammar in grammar and write C source code, con-
+ forming to the ISO C standard, to a code file, and
+ optionally header information into a header file, in the
+ current directory. The C code shall define a function
+ and related routines and macros for an automaton that
+ executes a parsing algorithm meeting the requirements in
+ Algorithms .
+
+ The form and meaning of the grammar are described in the
+ EXTENDED DESCRIPTION section.
+
+ The C source code and header file shall be produced in a
+ form suitable as input for the C compiler (see c99 ).
+
+OPTIONS
+ The yacc utility shall conform to the Base Definitions
+ volume of IEEE Std 1003.1-2001, Section 12.2, Utility
+ Syntax Guidelines.
+
+ The following options shall be supported:
+
+ -b file_prefix
+ Use file_prefix instead of y as the prefix for
+ all output filenames. The code file y.tab.c, the
+ header file y.tab.h (created when -d is speci-
+ fied), and the description file y.output (created
+ when -v is specified), shall be changed to
+ file_prefix .tab.c, file_prefix .tab.h, and
+ file_prefix .output, respectively.
+
+ -d Write the header file; by default only the code
+ file is written. The #define statements associate
+ the token codes assigned by yacc with the user-
+ declared token names. This allows source files
+ other than y.tab.c to access the token codes.
+
+ -l Produce a code file that does not contain any
+ #line constructs. If this option is not present,
+ it is unspecified whether the code file or header
+ file contains #line directives. This should only
+ be used after the grammar and the associated
+ actions are fully debugged.
+
+ -p sym_prefix
+
+ Use sym_prefix instead of yy as the prefix for
+ all external names produced by yacc. The names
+ affected shall include the functions yyparse(),
+ yylex(), and yyerror(), and the variables yylval,
+ yychar, and yydebug. (In the remainder of this
+ section, the six symbols cited are referenced
+ using their default names only as a notational
+ convenience.) Local names may also be affected by
+ the -p option; however, the -p option shall not
+ affect #define symbols generated by yacc.
+
+ -t Modify conditional compilation directives to per-
+ mit compilation of debugging code in the code
+ file. Runtime debugging statements shall always
+ be contained in the code file, but by default
+ conditional compilation directives prevent their
+ compilation.
+
+ -v Write a file containing a description of the
+ parser and a report of conflicts generated by
+ ambiguities in the grammar.
+
+
+OPERANDS
+ The following operand is required:
+
+ grammar
+ A pathname of a file containing instructions,
+ hereafter called grammar, for which a parser is
+ to be created. The format for the grammar is
+ described in the EXTENDED DESCRIPTION section.
+
+
+STDIN
+ Not used.
+
+INPUT FILES
+ The file grammar shall be a text file formatted as spec-
+ ified in the EXTENDED DESCRIPTION section.
+
+ENVIRONMENT VARIABLES
+ The following environment variables shall affect the
+ execution of yacc:
+
+ LANG Provide a default value for the internationaliza-
+ tion variables that are unset or null. (See the
+ Base Definitions volume of IEEE Std 1003.1-2001,
+ Section 8.2, Internationalization Variables for
+ the precedence of internationalization variables
+ used to determine the values of locale cate-
+ gories.)
+
+ LC_ALL If set to a non-empty string value, override the
+ values of all the other internationalization
+ variables.
+
+ LC_CTYPE
+ Determine the locale for the interpretation of
+ sequences of bytes of text data as characters
+ (for example, single-byte as opposed to multi-
+ byte characters in arguments and input files).
+
+ LC_MESSAGES
+ Determine the locale that should be used to
+ affect the format and contents of diagnostic mes-
+ sages written to standard error.
+
+ NLSPATH
+ Determine the location of message catalogs for
+ the processing of LC_MESSAGES .
+
+
+ The LANG and LC_* variables affect the execution of the
+ yacc utility as stated. The main() function defined in
+ Yacc Library shall call:
+
+
+ setlocale(LC_ALL, "")
+
+ and thus the program generated by yacc shall also be
+ affected by the contents of these variables at runtime.
+
+ASYNCHRONOUS EVENTS
+ Default.
+
+STDOUT
+ Not used.
+
+STDERR
+ If shift/reduce or reduce/reduce conflicts are detected
+ in grammar, yacc shall write a report of those conflicts
+ to the standard error in an unspecified format.
+
+ Standard error shall also be used for diagnostic mes-
+ sages.
+
+OUTPUT FILES
+ The code file, the header file, and the description file
+ shall be text files. All are described in the following
+ sections.
+
+ Code File
+ This file shall contain the C source code for the
+ yyparse() function. It shall contain code for the vari-
+ ous semantic actions with macro substitution performed
+ on them as described in the EXTENDED DESCRIPTION sec-
+ tion. It also shall contain a copy of the #define state-
+ ments in the header file. If a %union declaration is
+ used, the declaration for YYSTYPE shall also be included
+ in this file.
+
+ Header File
+ The header file shall contain #define statements that
+ associate the token numbers with the token names. This
+ allows source files other than the code file to access
+ the token codes. If a %union declaration is used, the
+ declaration for YYSTYPE and an extern YYSTYPE yylval
+ declaration shall also be included in this file.
+
+ Description File
+ The description file shall be a text file containing a
+ description of the state machine corresponding to the
+ parser, using an unspecified format. Limits for internal
+ tables (see Limits ) shall also be reported, in an
+ implementation-defined manner. (Some implementations may
+ use dynamic allocation techniques and have no specific
+ limit values to report.)
+
+EXTENDED DESCRIPTION
+ The yacc command accepts a language that is used to
+ define a grammar for a target language to be parsed by
+ the tables and code generated by yacc. The language
+ accepted by yacc as a grammar for the target language is
+ described below using the yacc input language itself.
+
+ The input grammar includes rules describing the input
+ structure of the target language and code to be invoked
+ when these rules are recognized to provide the associ-
+ ated semantic action. The code to be executed shall
+ appear as bodies of text that are intended to be C-lan-
+ guage code. The C-language inclusions are presumed to
+ form a correct function when processed by yacc into its
+ output files. The code included in this way shall be
+ executed during the recognition of the target language.
+
+ Given a grammar, the yacc utility generates the files
+ described in the OUTPUT FILES section. The code file can
+ be compiled and linked using c99. If the declaration and
+ programs sections of the grammar file did not include
+ definitions of main(), yylex(), and yyerror(), the com-
+ piled output requires linking with externally supplied
+ versions of those functions. Default versions of main()
+ and yyerror() are supplied in the yacc library and can
+ be linked in by using the -l y operand to c99. The yacc
+ library interfaces need not support interfaces with
+ other than the default yy symbol prefix. The application
+ provides the lexical analyzer function, yylex(); the lex
+ utility is specifically designed to generate such a rou-
+ tine.
+
+ Input Language
+ The application shall ensure that every specification
+ file consists of three sections in order: declarations,
+ grammar rules, and programs, separated by double percent
+ signs ( "%%" ). The declarations and programs sections
+ can be empty. If the latter is empty, the preceding "%%"
+ mark separating it from the rules section can be omit-
+ ted.
+
+ The input is free form text following the structure of
+ the grammar defined below.
+
+ Lexical Structure of the Grammar
+ The <blank>s, <newline>s, and <form-feed>s shall be
+ ignored, except that the application shall ensure that
+ they do not appear in names or multi-character reserved
+ symbols. Comments shall be enclosed in "/* ... */", and
+ can appear wherever a name is valid.
+
+ Names are of arbitrary length, made up of letters, peri-
+ ods ( '.' ), underscores ( '_' ), and non-initial dig-
+ its. Uppercase and lowercase letters are distinct. Con-
+ forming applications shall not use names beginning in yy
+ or YY since the yacc parser uses such names. Many of the
+ names appear in the final output of yacc, and thus they
+ should be chosen to conform with any additional rules
+ created by the C compiler to be used. In particular they
+ appear in #define statements.
+
+ A literal shall consist of a single character enclosed
+ in single-quotes ( '" ). All of the escape sequences
+ supported for character constants by the ISO C standard
+ shall be supported by yacc.
+
+ The relationship with the lexical analyzer is discussed
+ in detail below.
+
+ The application shall ensure that the NUL character is
+ not used in grammar rules or literals.
+
+ Declarations Section
+ The declarations section is used to define the symbols
+ used to define the target language and their relation-
+ ship with each other. In particular, much of the addi-
+ tional information required to resolve ambiguities in
+ the context-free grammar for the target language is pro-
+ vided here.
+
+ Usually yacc assigns the relationship between the sym-
+ bolic names it generates and their underlying numeric
+ value. The declarations section makes it possible to
+ control the assignment of these values.
+
+ It is also possible to keep semantic information associ-
+ ated with the tokens currently on the parse stack in a
+ user-defined C-language union, if the members of the
+ union are associated with the various names in the gram-
+ mar. The declarations section provides for this as well.
+
+ The first group of declarators below all take a list of
+ names as arguments. That list can optionally be pre-
+ ceded by the name of a C union member (called a tag
+ below) appearing within '<' and '>' . (As an exception
+ to the typographical conventions of the rest of this
+ volume of IEEE Std 1003.1-2001, in this case <tag> does
+ not represent a metavariable, but the literal angle
+ bracket characters surrounding a symbol.) The use of tag
+ specifies that the tokens named on this line shall be of
+ the same C type as the union member referenced by tag.
+ This is discussed in more detail below.
+
+ For lists used to define tokens, the first appearance of
+ a given token can be followed by a positive integer (as
+ a string of decimal digits). If this is done, the under-
+ lying value assigned to it for lexical purposes shall be
+ taken to be that number.
+
+ The following declares name to be a token:
+
+
+ %token [<tag>] name [number][name [number]]...
+
+ If tag is present, the C type for all tokens on this
+ line shall be declared to be the type referenced by tag.
+ If a positive integer, number, follows a name, that
+ value shall be assigned to the token.
+
+ The following declares name to be a token, and assigns
+ precedence to it:
+
+
+ %left [<tag>] name [number][name [number]]...
+ %right [<tag>] name [number][name [number]]...
+
+ One or more lines, each beginning with one of these sym-
+ bols, can appear in this section. All tokens on the same
+ line have the same precedence level and associativity;
+ the lines are in order of increasing precedence or bind-
+ ing strength. %left denotes that the operators on that
+ line are left associative, and %right similarly denotes
+ right associative operators. If tag is present, it shall
+ declare a C type for names as described for %token.
+
+ The following declares name to be a token, and indicates
+ that this cannot be used associatively:
+
+
+ %nonassoc [<tag>] name [number][name [number]]...
+
+ If the parser encounters associative use of this token
+ it reports an error. If tag is present, it shall declare
+ a C type for names as described for %token.
+
+ The following declares that union member names are non-
+ terminals, and thus it is required to have a tag field
+ at its beginning:
+
+
+ %type <tag> name...
+
+ Because it deals with non-terminals only, assigning a
+ token number or using a literal is also prohibited. If
+ this construct is present, yacc shall perform type
+ checking; if this construct is not present, the parse
+ stack shall hold only the int type.
+
+ Every name used in grammar not defined by a %token,
+ %left, %right, or %nonassoc declaration is assumed to
+ represent a non-terminal symbol. The yacc utility shall
+ report an error for any non-terminal symbol that does
+ not appear on the left side of at least one grammar
+ rule.
+
+ Once the type, precedence, or token number of a name is
+ specified, it shall not be changed. If the first decla-
+ ration of a token does not assign a token number, yacc
+ shall assign a token number. Once this assignment is
+ made, the token number shall not be changed by explicit
+ assignment.
+
+ The following declarators do not follow the previous
+ pattern.
+
+ The following declares the non-terminal name to be the
+ start symbol, which represents the largest, most general
+ structure described by the grammar rules:
+
+
+ %start name
+
+ By default, it is the left-hand side of the first gram-
+ mar rule; this default can be overridden with this dec-
+ laration.
+
+ The following declares the yacc value stack to be a
+ union of the various types of values desired:
+
+
+ %union { body of union (in C) }
+
+ By default, the values returned by actions (see below)
+ and the lexical analyzer shall be of type int. The yacc
+ utility keeps track of types, and it shall insert corre-
+ sponding union member names in order to perform strict
+ type checking of the resulting parser.
+
+ Alternatively, given that at least one <tag> construct
+ is used, the union can be declared in a header file
+ (which shall be included in the declarations section by
+ using a #include construct within %{ and %}), and a
+ typedef used to define the symbol YYSTYPE to represent
+ this union. The effect of %union is to provide the dec-
+ laration of YYSTYPE directly from the yacc input.
+
+ C-language declarations and definitions can appear in
+ the declarations section, enclosed by the following
+ marks:
+
+
+ %{ ... %}
+
+ These statements shall be copied into the code file, and
+ have global scope within it so that they can be used in
+ the rules and program sections.
+
+ The application shall ensure that the declarations sec-
+ tion is terminated by the token %%.
+
+ Grammar Rules in yacc
+ The rules section defines the context-free grammar to be
+ accepted by the function yacc generates, and associates
+ with those rules C-language actions and additional
+ precedence information. The grammar is described below,
+ and a formal definition follows.
+
+ The rules section is comprised of one or more grammar
+ rules. A grammar rule has the form:
+
+
+ A : BODY ;
+
+ The symbol A represents a non-terminal name, and BODY
+ represents a sequence of zero or more names, literals,
+ and semantic actions that can then be followed by
+ optional precedence rules. Only the names and literals
+ participate in the formation of the grammar; the seman-
+ tic actions and precedence rules are used in other ways.
+ The colon and the semicolon are yacc punctuation. If
+ there are several successive grammar rules with the same
+ left-hand side, the vertical bar '|' can be used to
+ avoid rewriting the left-hand side; in this case the
+ semicolon appears only after the last rule. The BODY
+ part can be empty (or empty of names and literals) to
+ indicate that the non-terminal symbol matches the empty
+ string.
+
+ The yacc utility assigns a unique number to each rule.
+ Rules using the vertical bar notation are distinct
+ rules. The number assigned to the rule appears in the
+ description file.
+
+ The elements comprising a BODY are:
+
+ name, literal
+ These form the rules of the grammar: name is
+ either a token or a non-terminal; literal stands
+ for itself (less the lexically required quotation
+ marks).
+
+ semantic action
+
+ With each grammar rule, the user can associate
+ actions to be performed each time the rule is
+ recognized in the input process. (Note that the
+ word "action" can also refer to the actions of
+ the parser-shift, reduce, and so on.)
+
+ These actions can return values and can obtain the val-
+ ues returned by previous actions. These values are kept
+ in objects of type YYSTYPE (see %union). The result
+ value of the action shall be kept on the parse stack
+ with the left-hand side of the rule, to be accessed by
+ other reductions as part of their right-hand side. By
+ using the <tag> information provided in the declarations
+ section, the code generated by yacc can be strictly type
+ checked and contain arbitrary information. In addition,
+ the lexical analyzer can provide the same kinds of val-
+ ues for tokens, if desired.
+
+ An action is an arbitrary C statement and as such can do
+ input or output, call subprograms, and alter external
+ variables. An action is one or more C statements
+ enclosed in curly braces '{' and '}' .
+
+ Certain pseudo-variables can be used in the action.
+ These are macros for access to data structures known
+ internally to yacc.
+
+ $$
+ The value of the action can be set by assigning
+ it to $$. If type checking is enabled and the
+ type of the value to be assigned cannot be deter-
+ mined, a diagnostic message may be generated.
+
+ $number
+ This refers to the value returned by the compo-
+ nent specified by the token number in the right
+ side of a rule, reading from left to right; num-
+ ber can be zero or negative. If number is zero or
+ negative, it refers to the data associated with
+ the name on the parser's stack preceding the
+ leftmost symbol of the current rule. (That is,
+ "$0" refers to the name immediately preceding the
+ leftmost name in the current rule to be found on
+ the parser's stack and "$-1" refers to the symbol
+ to its left.) If number refers to an element past
+ the current point in the rule, or beyond the bot-
+ tom of the stack, the result is undefined. If
+ type checking is enabled and the type of the
+ value to be assigned cannot be determined, a
+ diagnostic message may be generated.
+
+ $<tag>number
+
+ These correspond exactly to the corresponding
+ symbols without the tag inclusion, but allow for
+ strict type checking (and preclude unwanted type
+ conversions). The effect is that the macro is
+ expanded to use tag to select an element from the
+ YYSTYPE union (using dataname.tag). This is par-
+ ticularly useful if number is not positive.
+
+ $<tag>$
+ This imposes on the reference the type of the
+ union member referenced by tag. This construction
+ is applicable when a reference to a left context
+ value occurs in the grammar, and provides yacc
+ with a means for selecting a type.
+
+
+ Actions can occur anywhere in a rule (not just at the
+ end); an action can access values returned by actions to
+ its left, and in turn the value it returns can be
+ accessed by actions to its right. An action appearing
+ in the middle of a rule shall be equivalent to replacing
+ the action with a new non-terminal symbol and adding an
+ empty rule with that non-terminal symbol on the left-
+ hand side. The semantic action associated with the new
+ rule shall be equivalent to the original action. The use
+ of actions within rules might introduce conflicts that
+ would not otherwise exist.
+
+ By default, the value of a rule shall be the value of
+ the first element in it. If the first element does not
+ have a type (particularly in the case of a literal) and
+ type checking is turned on by %type, an error message
+ shall result.
+
+ precedence
+ The keyword %prec can be used to change the
+ precedence level associated with a particular
+ grammar rule. Examples of this are in cases where
+ a unary and binary operator have the same sym-
+ bolic representation, but need to be given dif-
+ ferent precedences, or where the handling of an
+ ambiguous if-else construction is necessary. The
+ reserved symbol %prec can appear immediately
+ after the body of the grammar rule and can be
+ followed by a token name or a literal. It shall
+ cause the precedence of the grammar rule to
+ become that of the following token name or lit-
+ eral. The action for the rule as a whole can fol-
+ low %prec.
+
+
+ If a program section follows, the application shall
+ ensure that the grammar rules are terminated by %%.
+
+ Programs Section
+ The programs section can include the definition of the
+ lexical analyzer yylex(), and any other functions; for
+ example, those used in the actions specified in the
+ grammar rules. It is unspecified whether the programs
+ section precedes or follows the semantic actions in the
+ output file; therefore, if the application contains any
+ macro definitions and declarations intended to apply to
+ the code in the semantic actions, it shall place them
+ within "%{ ... %}" in the declarations section.
+
+ Input Grammar
+ The following input to yacc yields a parser for the
+ input to yacc. This formal syntax takes precedence over
+ the preceding text syntax description.
+
+ The lexical structure is defined less precisely; Lexical
+ Structure of the Grammar defines most terms. The corre-
+ spondence between the previous terms and the tokens
+ below is as follows.
+
+ IDENTIFIER
+ This corresponds to the concept of name, given
+ previously. It also includes literals as defined
+ previously.
+
+ C_IDENTIFIER
+ This is a name, and additionally it is known to
+ be followed by a colon. A literal cannot yield
+ this token.
+
+ NUMBER A string of digits (a non-negative decimal inte-
+ ger).
+
+ TYPE, LEFT, MARK, LCURL, RCURL
+
+ These correspond directly to %type, %left, %%,
+ %{, and %}.
+
+ { ... }
+ This indicates C-language source code, with the
+ possible inclusion of '$' macros as discussed
+ previously.
+
+
+
+ /* Grammar for the input to yacc. */
+ /* Basic entries. */
+ /* The following are recognized by the lexical analyzer. */
+
+
+ %token IDENTIFIER /* Includes identifiers and literals */
+ %token C_IDENTIFIER /* identifier (but not literal)
+ followed by a :. */
+ %token NUMBER /* [0-9][0-9]* */
+
+
+ /* Reserved words : %type=>TYPE %left=>LEFT, and so on */
+
+
+ %token LEFT RIGHT NONASSOC TOKEN PREC TYPE START UNION
+
+
+ %token MARK /* The %% mark. */
+ %token LCURL /* The %{ mark. */
+ %token RCURL /* The %} mark. */
+
+
+ /* 8-bit character literals stand for themselves; */
+ /* tokens have to be defined for multi-byte characters. */
+
+
+ %start spec
+
+
+ %%
+
+
+ spec : defs MARK rules tail
+ ;
+ tail : MARK
+ {
+ /* In this action, set up the rest of the file. */
+ }
+ | /* Empty; the second MARK is optional. */
+ ;
+ defs : /* Empty. */
+ | defs def
+ ;
+ def : START IDENTIFIER
+ | UNION
+ {
+ /* Copy union definition to output. */
+ }
+ | LCURL
+ {
+ /* Copy C code to output file. */
+ }
+ RCURL
+ | rword tag nlist
+ ;
+ rword : TOKEN
+ | LEFT
+ | RIGHT
+ | NONASSOC
+ | TYPE
+ ;
+ tag : /* Empty: union tag ID optional. */
+ | '<' IDENTIFIER '>'
+ ;
+ nlist : nmno
+ | nlist nmno
+ ;
+ nmno : IDENTIFIER /* Note: literal invalid with % type. */
+ | IDENTIFIER NUMBER /* Note: invalid with % type. */
+ ;
+
+
+ /* Rule section */
+
+
+ rules : C_IDENTIFIER rbody prec
+ | rules rule
+ ;
+ rule : C_IDENTIFIER rbody prec
+ | '|' rbody prec
+ ;
+ rbody : /* empty */
+ | rbody IDENTIFIER
+ | rbody act
+ ;
+ act : '{'
+ {
+ /* Copy action, translate $$, and so on. */
+ }
+ '}'
+ ;
+ prec : /* Empty */
+ | PREC IDENTIFIER
+ | PREC IDENTIFIER act
+ | prec ';'
+ ;
+
+ Conflicts
+ The parser produced for an input grammar may contain
+ states in which conflicts occur. The conflicts occur
+ because the grammar is not LALR(1). An ambiguous grammar
+ always contains at least one LALR(1) conflict. The yacc
+ utility shall resolve all conflicts, using either
+ default rules or user-specified precedence rules.
+
+ Conflicts are either shift/reduce conflicts or
+ reduce/reduce conflicts. A shift/reduce conflict is
+ where, for a given state and lookahead symbol, both a
+ shift action and a reduce action are possible. A
+ reduce/reduce conflict is where, for a given state and
+ lookahead symbol, reductions by two different rules are
+ possible.
+
+ The rules below describe how to specify what actions to
+ take when a conflict occurs. Not all shift/reduce con-
+ flicts can be successfully resolved this way because the
+ conflict may be due to something other than ambiguity,
+ so incautious use of these facilities can cause the lan-
+ guage accepted by the parser to be much different from
+ that which was intended. The description file shall con-
+ tain sufficient information to understand the cause of
+ the conflict. Where ambiguity is the reason either the
+ default or explicit rules should be adequate to produce
+ a working parser.
+
+ The declared precedences and associativities (see Decla-
+ rations Section ) are used to resolve parsing conflicts
+ as follows:
+
+ 1. A precedence and associativity is associated with
+ each grammar rule; it is the precedence and associa-
+ tivity of the last token or literal in the body of
+ the rule. If the %prec keyword is used, it overrides
+ this default. Some grammar rules might not have both
+ precedence and associativity.
+
+
+ 2. If there is a shift/reduce conflict, and both the
+ grammar rule and the input symbol have precedence
+ and associativity associated with them, then the
+ conflict is resolved in favor of the action (shift
+ or reduce) associated with the higher precedence. If
+ the precedences are the same, then the associativity
+ is used; left associative implies reduce, right
+ associative implies shift, and non-associative
+ implies an error in the string being parsed.
+
+
+ 3. When there is a shift/reduce conflict that cannot be
+ resolved by rule 2, the shift is done. Conflicts
+ resolved this way are counted in the diagnostic out-
+ put described in Error Handling .
+
+
+ 4. When there is a reduce/reduce conflict, a reduction
+ is done by the grammar rule that occurs earlier in
+ the input sequence. Conflicts resolved this way are
+ counted in the diagnostic output described in Error
+ Handling .
+
+
+ Conflicts resolved by precedence or associativity shall
+ not be counted in the shift/reduce and reduce/reduce
+ conflicts reported by yacc on either standard error or
+ in the description file.
+
+ Error Handling
+ The token error shall be reserved for error handling.
+ The name error can be used in grammar rules. It indi-
+ cates places where the parser can recover from a syntax
+ error. The default value of error shall be 256. Its
+ value can be changed using a %token declaration. The
+ lexical analyzer should not return the value of error.
+
+ The parser shall detect a syntax error when it is in a
+ state where the action associated with the lookahead
+ symbol is error. A semantic action can cause the parser
+ to initiate error handling by executing the macro YYER-
+ ROR. When YYERROR is executed, the semantic action
+ passes control back to the parser. YYERROR cannot be
+ used outside of semantic actions.
+
+ When the parser detects a syntax error, it normally
+ calls yyerror() with the character string "syntax error"
+ as its argument. The call shall not be made if the
+ parser is still recovering from a previous error when
+ the error is detected. The parser is considered to be
+ recovering from a previous error until the parser has
+ shifted over at least three normal input symbols since
+ the last error was detected or a semantic action has
+ executed the macro yyerrok. The parser shall not call
+ yyerror() when YYERROR is executed.
+
+ The macro function YYRECOVERING shall return 1 if a syn-
+ tax error has been detected and the parser has not yet
+ fully recovered from it. Otherwise, zero shall be
+ returned.
+
+ When a syntax error is detected by the parser, the
+ parser shall check if a previous syntax error has been
+ detected. If a previous error was detected, and if no
+ normal input symbols have been shifted since the preced-
+ ing error was detected, the parser checks if the looka-
+ head symbol is an endmarker (see Interface to the Lexi-
+ cal Analyzer ). If it is, the parser shall return with a
+ non-zero value. Otherwise, the lookahead symbol shall be
+ discarded and normal parsing shall resume.
+
+ When YYERROR is executed or when the parser detects a
+ syntax error and no previous error has been detected, or
+ at least one normal input symbol has been shifted since
+ the previous error was detected, the parser shall pop
+ back one state at a time until the parse stack is empty
+ or the current state allows a shift over error. If the
+ parser empties the parse stack, it shall return with a
+ non-zero value. Otherwise, it shall shift over error and
+ then resume normal parsing. If the parser reads a looka-
+ head symbol before the error was detected, that symbol
+ shall still be the lookahead symbol when parsing is
+ resumed.
+
+ The macro yyerrok in a semantic action shall cause the
+ parser to act as if it has fully recovered from any pre-
+ vious errors. The macro yyclearin shall cause the parser
+ to discard the current lookahead token. If the current
+ lookahead token has not yet been read, yyclearin shall
+ have no effect.
+
+ The macro YYACCEPT shall cause the parser to return with
+ the value zero. The macro YYABORT shall cause the parser
+ to return with a non-zero value.
+
+ Interface to the Lexical Analyzer
+ The yylex() function is an integer-valued function that
+ returns a token number representing the kind of token
+ read. If there is a value associated with the token
+ returned by yylex() (see the discussion of tag above),
+ it shall be assigned to the external variable yylval.
+
+ If the parser and yylex() do not agree on these token
+ numbers, reliable communication between them cannot
+ occur. For (single-byte character) literals, the token
+ is simply the numeric value of the character in the cur-
+ rent character set. The numbers for other tokens can
+ either be chosen by yacc, or chosen by the user. In
+ either case, the #define construct of C is used to allow
+ yylex() to return these numbers symbolically. The
+ #define statements are put into the code file, and the
+ header file if that file is requested. The set of char-
+ acters permitted by yacc in an identifier is larger than
+ that permitted by C. Token names found to contain such
+ characters shall not be included in the #define declara-
+ tions.
+
+ If the token numbers are chosen by yacc, the tokens
+ other than literals shall be assigned numbers greater
+ than 256, although no order is implied. A token can be
+ explicitly assigned a number by following its first
+ appearance in the declarations section with a number.
+ Names and literals not defined this way retain their
+ default definition. All token numbers assigned by yacc
+ shall be unique and distinct from the token numbers used
+ for literals and user-assigned tokens. If duplicate
+ token numbers cause conflicts in parser generation, yacc
+ shall report an error; otherwise, it is unspecified
+ whether the token assignment is accepted or an error is
+ reported.
+
+ The end of the input is marked by a special token called
+ the endmarker, which has a token number that is zero or
+ negative. (These values are invalid for any other
+ token.) All lexical analyzers shall return zero or nega-
+ tive as a token number upon reaching the end of their
+ input. If the tokens up to, but excluding, the endmarker
+ form a structure that matches the start symbol, the
+ parser shall accept the input. If the endmarker is seen
+ in any other context, it shall be considered an error.
+
+ Completing the Program
+ In addition to yyparse() and yylex(), the functions
+ yyerror() and main() are required to make a complete
+ program. The application can supply main() and yyer-
+ ror(), or those routines can be obtained from the yacc
+ library.
+
+ Yacc Library
+ The following functions shall appear only in the yacc
+ library accessible through the -l y operand to c99; they
+ can therefore be redefined by a conforming application:
+
+ int main(void)
+
+ This function shall call yyparse() and exit with
+ an unspecified value. Other actions within this
+ function are unspecified.
+
+ int yyerror(const char *s)
+
+ This function shall write the NUL-terminated
+ argument to standard error, followed by a <new-
+ line>.
+
+
+ The order of the -l y and -l l operands given to c99 is
+ significant; the application shall either provide its
+ own main() function or ensure that -l y precedes -l l.
+
+ Debugging the Parser
+ The parser generated by yacc shall have diagnostic
+ facilities in it that can be optionally enabled at
+ either compile time or at runtime (if enabled at compile
+ time). The compilation of the runtime debugging code is
+ under the control of YYDEBUG, a preprocessor symbol. If
+ YYDEBUG has a non-zero value, the debugging code shall
+ be included. If its value is zero, the code shall not be
+ included.
+
+ In parsers where the debugging code has been included,
+ the external int yydebug can be used to turn debugging
+ on (with a non-zero value) and off (zero value) at run-
+ time. The initial value of yydebug shall be zero.
+
+ When -t is specified, the code file shall be built such
+ that, if YYDEBUG is not already defined at compilation
+ time (using the c99 -D YYDEBUG option, for example),
+ YYDEBUG shall be set explicitly to 1. When -t is not
+ specified, the code file shall be built such that, if
+ YYDEBUG is not already defined, it shall be set explic-
+ itly to zero.
+
+ The format of the debugging output is unspecified but
+ includes at least enough information to determine the
+ shift and reduce actions, and the input symbols. It also
+ provides information about error recovery.
+
+ Algorithms
+ The parser constructed by yacc implements an LALR(1)
+ parsing algorithm as documented in the literature. It is
+ unspecified whether the parser is table-driven or
+ direct-coded.
+
+ A parser generated by yacc shall never request an input
+ symbol from yylex() while in a state where the only
+ actions other than the error action are reductions by a
+ single rule.
+
+ The literature of parsing theory defines these concepts.
+
+ Limits
+ The yacc utility may have several internal tables. The
+ minimum maximums for these tables are shown in the fol-
+ lowing table. The exact meaning of these values is
+ implementation-defined. The implementation shall define
+ the relationship between these values and between them
+ and any error messages that the implementation may gen-
+ erate should it run out of space for any internal struc-
+ ture. An implementation may combine groups of these
+ resources into a single pool as long as the total avail-
+ able to the user does not fall below the sum of the
+ sizes specified by this section.
+
+ Table: Internal Limits in yacc
+
+ Minimum
+ Limit Maximum Description
+ {NTERMS} 126 Number of tokens.
+ {NNONTERM} 200 Number of non-terminals.
+ {NPROD} 300 Number of rules.
+ {NSTATES} 600 Number of states.
+ {MEMSIZE} 5200 Length of rules. The total length, in
+ names (tokens and non-terminals), of all
+ the rules of the grammar. The left-hand
+ side is counted for each rule, even if
+ it is not explicitly repeated, as speci-
+ fied in Grammar Rules in yacc .
+ {ACTSIZE} 4000 Number of actions. "Actions" here (and
+ in the description file) refer to parser
+ actions (shift, reduce, and so on) not
+ to semantic actions defined in Grammar
+ Rules in yacc .
+
+EXIT STATUS
+ The following exit values shall be returned:
+
+ 0 Successful completion.
+
+ >0 An error occurred.
+
+
+CONSEQUENCES OF ERRORS
+ If any errors are encountered, the run is aborted and
+ yacc exits with a non-zero status. Partial code files
+ and header files may be produced. The summary informa-
+ tion in the description file shall always be produced if
+ the -v flag is present.
+
+ The following sections are informative.
+
+APPLICATION USAGE
+ Historical implementations experience name conflicts on
+ the names yacc.tmp, yacc.acts, yacc.debug, y.tab.c,
+ y.tab.h, and y.output if more than one copy of yacc is
+ running in a single directory at one time. The -b option
+ was added to overcome this problem. The related problem
+ of allowing multiple yacc parsers to be placed in the
+ same file was addressed by adding a -p option to over-
+ ride the previously hard-coded yy variable prefix.
+
+ The description of the -p option specifies the minimal
+ set of function and variable names that cause conflict
+ when multiple parsers are linked together. YYSTYPE does
+ not need to be changed. Instead, the programmer can use
+ -b to give the header files for different parsers dif-
+ ferent names, and then the file with the yylex() for a
+ given parser can include the header for that parser.
+ Names such as yyclearerr do not need to be changed
+ because they are used only in the actions; they do not
+ have linkage. It is possible that an implementation has
+ other names, either internal ones for implementing
+ things such as yyclearerr, or providing non-standard
+ features that it wants to change with -p.
+
+ Unary operators that are the same token as a binary
+ operator in general need their precedence adjusted. This
+ is handled by the %prec advisory symbol associated with
+ the particular grammar rule defining that unary opera-
+ tor. (See Grammar Rules in yacc .) Applications are not
+ required to use this operator for unary operators, but
+ the grammars that do not require it are rare.
+
+EXAMPLES
+ Access to the yacc library is obtained with library
+ search operands to c99. To use the yacc library main():
+
+
+ c99 y.tab.c -l y
+
+ Both the lex library and the yacc library contain
+ main(). To access the yacc main():
+
+
+ c99 y.tab.c lex.yy.c -l y -l l
+
+ This ensures that the yacc library is searched first, so
+ that its main() is used.
+
+ The historical yacc libraries have contained two simple
+ functions that are normally coded by the application
+ programmer. These functions are similar to the follow-
+ ing code:
+
+
+ #include <locale.h>
+ int main(void)
+ {
+ extern int yyparse();
+
+
+ setlocale(LC_ALL, "");
+
+
+ /* If the following parser is one created by lex, the
+ application must be careful to ensure that LC_CTYPE
+ and LC_COLLATE are set to the POSIX locale. */
+ (void) yyparse();
+ return (0);
+ }
+
+
+ #include <stdio.h>
+
+
+ int yyerror(const char *msg)
+ {
+ (void) fprintf(stderr, "%s\n", msg);
+ return (0);
+ }
+
+RATIONALE
+ The references in may be helpful in constructing the
+ parser generator. The referenced DeRemer and Pennello
+ article (along with the works it references) describes a
+ technique to generate parsers that conform to this vol-
+ ume of IEEE Std 1003.1-2001. Work in this area contin-
+ ues to be done, so implementors should consult current
+ literature before doing any new implementations. The
+ original Knuth article is the theoretical basis for this
+ kind of parser, but the tables it generates are imprac-
+ tically large for reasonable grammars and should not be
+ used. The "equivalent to" wording is intentional to
+ assure that the best tables that are LALR(1) can be gen-
+ erated.
+
+ There has been confusion between the class of grammars,
+ the algorithms needed to generate parsers, and the algo-
+ rithms needed to parse the languages. They are all rea-
+ sonably orthogonal. In particular, a parser generator
+ that accepts the full range of LR(1) grammars need not
+ generate a table any more complex than one that accepts
+ SLR(1) (a relatively weak class of LR grammars) for a
+ grammar that happens to be SLR(1). Such an implementa-
+ tion need not recognize the case, either; table compres-
+ sion can yield the SLR(1) table (or one even smaller
+ than that) without recognizing that the grammar is
+ SLR(1). The speed of an LR(1) parser for any class is
+ dependent more upon the table representation and com-
+ pression (or the code generation if a direct parser is
+ generated) than upon the class of grammar that the table
+ generator handles.
+
+ The speed of the parser generator is somewhat dependent
+ upon the class of grammar it handles. However, the orig-
+ inal Knuth article algorithms for constructing LR
+ parsers were judged by its author to be impractically
+ slow at that time. Although full LR is more complex than
+ LALR(1), as computer speeds and algorithms improve, the
+ difference (in terms of acceptable wall-clock execution
+ time) is becoming less significant.
+
+ Potential authors are cautioned that the referenced
+ DeRemer and Pennello article previously cited identifies
+ a bug (an over-simplification of the computation of
+ LALR(1) lookahead sets) in some of the LALR(1) algorithm
+ statements that preceded it to publication. They should
+ take the time to seek out that paper, as well as current
+ relevant work, particularly Aho's.
+
+ The -b option was added to provide a portable method for
+ permitting yacc to work on multiple separate parsers in
+ the same directory. If a directory contains more than
+ one yacc grammar, and both grammars are constructed at
+ the same time (by, for example, a parallel make pro-
+ gram), conflict results. While the solution is not his-
+ torical practice, it corrects a known deficiency in his-
+ torical implementations. Corresponding changes were made
+ to all sections that referenced the filenames y.tab.c
+ (now "the code file"), y.tab.h (now "the header file"),
+ and y.output (now "the description file").
+
+ The grammar for yacc input is based on System V documen-
+ tation. The textual description shows there that the
+ ';' is required at the end of the rule. The grammar and
+ the implementation do not require this. (The use of
+ C_IDENTIFIER causes a reduce to occur in the right
+ place.)
+
+ Also, in that implementation, the constructs such as
+ %token can be terminated by a semicolon, but this is not
+ permitted by the grammar. The keywords such as %token
+ can also appear in uppercase, which is again not dis-
+ cussed. In most places where '%' is used, '\' can be
+ substituted, and there are alternate spellings for some
+ of the symbols (for example, %LEFT can be "%<" or even
+ "\<" ).
+
+ Historically, <tag> can contain any characters except
+ '>', including white space, in the implementation. How-
+ ever, since the tag must reference an ISO C standard
+ union member, in practice conforming implementations
+ need to support only the set of characters for ISO C
+ standard identifiers in this context.
+
+ Some historical implementations are known to accept
+ actions that are terminated by a period. Historical
+ implementations often allow '$' in names. A conforming
+ implementation does not need to support either of these
+ behaviors.
+
+ Deciding when to use %prec illustrates the difficulty in
+ specifying the behavior of yacc. There may be situations
+ in which the grammar is not, strictly speaking, in
+ error, and yet yacc cannot interpret it unambiguously.
+ The resolution of ambiguities in the grammar can in many
+ instances be resolved by providing additional informa-
+ tion, such as using %type or %union declarations. It is
+ often easier and it usually yields a smaller parser to
+ take this alternative when it is appropriate.
+
+ The size and execution time of a program produced with-
+ out the runtime debugging code is usually smaller and
+ slightly faster in historical implementations.
+
+ Statistics messages from several historical implementa-
+ tions include the following types of information:
+
+
+ n/512 terminals, n/300 non-terminals
+ n/600 grammar rules, n/1500 states
+ n shift/reduce, n reduce/reduce conflicts reported
+ n/350 working sets used
+ Memory: states, etc. n/15000, parser n/15000
+ n/600 distinct lookahead sets
+ n extra closures
+ n shift entries, n exceptions
+ n goto entries
+ n entries saved by goto default
+ Optimizer space used: input n/15000, output n/15000
+ n table entries, n zero
+ Maximum spread: n, Maximum offset: n
+
+ The report of internal tables in the description file is
+ left implementation-defined because all aspects of these
+ limits are also implementation-defined. Some implementa-
+ tions may use dynamic allocation techniques and have no
+ specific limit values to report.
+
+ The format of the y.output file is not given because
+ specification of the format was not seen to enhance
+ applications portability. The listing is primarily
+ intended to help human users understand and debug the
+ parser; use of y.output by a conforming application
+ script would be unusual. Furthermore, implementations
+ have not produced consistent output and no popular for-
+ mat was apparent. The format selected by the implementa-
+ tion should be human-readable, in addition to the
+ requirement that it be a text file.
+
+ Standard error reports are not specifically described
+ because they are seldom of use to conforming applica-
+ tions and there was no reason to restrict implementa-
+ tions.
+
+ Some implementations recognize "={" as equivalent to '{'
+ because it appears in historical documentation. This
+ construction was recognized and documented as obsolete
+ as long ago as 1978, in the referenced Yacc: Yet Another
+ Compiler-Compiler. This volume of IEEE Std 1003.1-2001
+ chose to leave it as obsolete and omit it.
+
+ Multi-byte characters should be recognized by the lexi-
+ cal analyzer and returned as tokens. They should not be
+ returned as multi-byte character literals. The token
+ error that is used for error recovery is normally
+ assigned the value 256 in the historical implementation.
+ Thus, the token value 256, which is used in many multi-
+ byte character sets, is not available for use as the
+ value of a user-defined token.
+
+FUTURE DIRECTIONS
+ None.
+
+SEE ALSO
+ c99, lex
+
+COPYRIGHT
+ Portions of this text are reprinted and reproduced in
+ electronic form from IEEE Std 1003.1, 2003 Edition,
+ Standard for Information Technology -- Portable Operat-
+ ing System Interface (POSIX), The Open Group Base Speci-
+ fications Issue 6, Copyright (C) 2001-2003 by the Insti-
+ tute of Electrical and Electronics Engineers, Inc and
+ The Open Group. In the event of any discrepancy between
+ this version and the original IEEE and The Open Group
+ Standard, the original IEEE and The Open Group Standard
+ is the referee document. The original Standard can be
+ obtained online at http://www.open-
+ group.org/unix/online.html .
+
+
+
+IEEE/The Open Group 2003 YACC(1P)
diff --git a/gnuwin32/man/cat3/iconv.3.txt b/gnuwin32/man/cat3/iconv.3.txt
new file mode 100644
index 00000000..1feacab2
--- /dev/null
+++ b/gnuwin32/man/cat3/iconv.3.txt
@@ -0,0 +1,97 @@
+ICONV(3) Linux Programmer's Manual ICONV(3)
+
+
+
+
+
+NAME
+ iconv - perform character set conversion
+
+SYNOPSIS
+ #include <iconv.h>
+
+ size_t iconv (iconv_t cd,
+ const char* * inbuf, size_t * inbytesleft,
+ char* * outbuf, size_t * outbytesleft);
+
+DESCRIPTION
+ The argument cd must be a conversion descriptor created
+ using the function iconv_open.
+
+ The main case is when inbuf is not NULL and *inbuf is
+ not NULL. In this case, the iconv function converts the
+ multibyte sequence starting at *inbuf to a multibyte
+ sequence starting at *outbuf. At most *inbytesleft
+ bytes, starting at *inbuf, will be read. At most *out-
+ bytesleft bytes, starting at *outbuf, will be written.
+
+ The iconv function converts one multibyte character at a
+ time, and for each character conversion it increments
+ *inbuf and decrements *inbytesleft by the number of con-
+ verted input bytes, it increments *outbuf and decrements
+ *outbytesleft by the number of converted output bytes,
+ and it updates the conversion state contained in cd.
+ The conversion can stop for four reasons:
+
+ 1. An invalid multibyte sequence is encountered in the
+ input. In this case it sets errno to EILSEQ and returns
+ (size_t)(-1). *inbuf is left pointing to the beginning
+ of the invalid multibyte sequence.
+
+ 2. The input byte sequence has been entirely converted,
+ i.e. *inbytesleft has gone down to 0. In this case iconv
+ returns the number of non-reversible conversions per-
+ formed during this call.
+
+ 3. An incomplete multibyte sequence is encountered in
+ the input, and the input byte sequence terminates after
+ it. In this case it sets errno to EINVAL and returns
+ (size_t)(-1). *inbuf is left pointing to the beginning
+ of the incomplete multibyte sequence.
+
+ 4. The output buffer has no more room for the next con-
+ verted character. In this case it sets errno to E2BIG
+ and returns (size_t)(-1).
+
+ A different case is when inbuf is NULL or *inbuf is
+ NULL, but outbuf is not NULL and *outbuf is not NULL. In
+ this case, the iconv function attempts to set cd's con-
+ version state to the initial state and store a corre-
+ sponding shift sequence at *outbuf. At most *out-
+ bytesleft bytes, starting at *outbuf, will be written.
+ If the output buffer has no more room for this reset
+ sequence, it sets errno to E2BIG and returns
+ (size_t)(-1). Otherwise it increments *outbuf and decre-
+ ments *outbytesleft by the number of bytes written.
+
+ A third case is when inbuf is NULL or *inbuf is NULL,
+ and outbuf is NULL or *outbuf is NULL. In this case, the
+ iconv function sets cd's conversion state to the initial
+ state.
+
+RETURN VALUE
+ The iconv function returns the number of characters con-
+ verted in a non-reversible way during this call;
+ reversible conversions are not counted. In case of
+ error, it sets errno and returns (size_t)(-1).
+
+ERRORS
+ The following errors can occur, among others:
+
+ E2BIG There is not sufficient room at *outbuf.
+
+ EILSEQ An invalid multibyte sequence has been encoun-
+ tered in the input.
+
+ EINVAL An incomplete multibyte sequence has been encoun-
+ tered in the input.
+
+CONFORMING TO
+ UNIX98
+
+SEE ALSO
+ iconv_open(3), iconv_close(3)
+
+
+
+GNU January 21, 2004 ICONV(3)
diff --git a/gnuwin32/man/cat3/iconv_close.3.txt b/gnuwin32/man/cat3/iconv_close.3.txt
new file mode 100644
index 00000000..f7aa1aae
--- /dev/null
+++ b/gnuwin32/man/cat3/iconv_close.3.txt
@@ -0,0 +1,32 @@
+ICONV_CLOSE(3) Linux Programmer's Manual ICONV_CLOSE(3)
+
+
+
+
+
+NAME
+ iconv_close - deallocate descriptor for character set
+ conversion
+
+SYNOPSIS
+ #include <iconv.h>
+
+ int iconv_close (iconv_t cd);
+
+DESCRIPTION
+ The iconv_close function deallocates a conversion
+ descriptor cd previously allocated using iconv_open.
+
+RETURN VALUE
+ When successful, the iconv_close function returns 0. In
+ case of error, it sets errno and returns -1.
+
+CONFORMING TO
+ UNIX98
+
+SEE ALSO
+ iconv_open(3), iconv(3)
+
+
+
+GNU November 27, 1999 ICONV_CLOSE(3)
diff --git a/gnuwin32/man/cat3/iconv_open.3.txt b/gnuwin32/man/cat3/iconv_open.3.txt
new file mode 100644
index 00000000..6f07c463
--- /dev/null
+++ b/gnuwin32/man/cat3/iconv_open.3.txt
@@ -0,0 +1,152 @@
+ICONV_OPEN(3) Linux Programmer's Manual ICONV_OPEN(3)
+
+
+
+
+
+NAME
+ iconv_open - allocate descriptor for character set con-
+ version
+
+SYNOPSIS
+ #include <iconv.h>
+
+ iconv_t iconv_open (const char* tocode, const char* fromcode);
+
+DESCRIPTION
+ The iconv_open function allocates a conversion descrip-
+ tor suitable for converting byte sequences from charac-
+ ter encoding fromcode to character encoding tocode.
+
+ The values permitted for fromcode and tocode and the
+ supported combinations are system dependent. For the
+ libiconv library, the following encodings are supported,
+ in all combinations.
+
+ European languages
+ ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16},
+ KOI8-R, KOI8-U, KOI8-RU,
+ CP{1250,1251,1252,1253,1254,1257}, CP{850,866},
+ Mac{Roman,CentralEurope,Iceland,Croatian,Roma-
+ nia}, Mac{Cyrillic,Ukraine,Greek,Turkish}, Macin-
+ tosh
+
+ Semitic languages
+ ISO-8859-{6,8}, CP{1255,1256}, CP862,
+ Mac{Hebrew,Arabic}
+
+ Japanese
+ EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP,
+ ISO-2022-JP-2, ISO-2022-JP-1
+
+ Chinese
+ EUC-CN, HZ, GBK, GB18030, EUC-TW, BIG5, CP950,
+ BIG5-HKSCS, ISO-2022-CN, ISO-2022-CN-EXT
+
+ Korean
+ EUC-KR, CP949, ISO-2022-KR, JOHAB
+
+ Armenian
+ ARMSCII-8
+
+ Georgian
+ Georgian-Academy, Georgian-PS
+
+ Tajik
+ KOI8-T
+
+ Thai
+ TIS-620, CP874, MacThai
+
+ Laotian
+ MuleLao-1, CP1133
+
+ Vietnamese
+ VISCII, TCVN, CP1258
+
+ Platform specifics
+ HP-ROMAN8, NEXTSTEP
+
+ Full Unicode
+ UTF-8
+ UCS-2, UCS-2BE, UCS-2LE
+ UCS-4, UCS-4BE, UCS-4LE
+ UTF-16, UTF-16BE, UTF-16LE
+ UTF-32, UTF-32BE, UTF-32LE
+ UTF-7
+ C99, JAVA
+
+ Full Unicode, in terms of uint16_t or uint32_t
+ (with machine dependent endianness and alignment)
+ UCS-2-INTERNAL, UCS-4-INTERNAL
+
+ Locale dependent, in terms of char or wchar_t
+ (with machine dependent endianness and alignment,
+ and with semantics depending on the OS and the
+ current LC_CTYPE locale facet)
+ char, wchar_t
+
+ When configured with the option --enable-extra-encod-
+ ings, it also provides support for a few extra encod-
+ ings:
+
+ European languages
+ CP{437,737,775,852,853,855,857,858,860,861,863,865,869,1125}
+
+ Semitic languages
+ CP864
+
+ Japanese
+ EUC-JISX0213, Shift_JISX0213, ISO-2022-JP-3
+
+ Turkmen
+ TDS565
+
+ Platform specifics
+ RISCOS-LATIN1
+
+ The empty encoding name "" is equivalent to "char": it
+ denotes the locale dependent character encoding.
+
+ When the string "//TRANSLIT" is appended to tocode,
+ transliteration is activated. This means that when a
+ character cannot be represented in the target character
+ set, it can be approximated through one or several simi-
+ larly looking characters.
+
+ When the string "//IGNORE" is appended to tocode, char-
+ acters that cannot be represented in the target charac-
+ ter set will be silently discarded.
+
+ The resulting conversion descriptor can be used with
+ iconv any number of times. It remains valid until deal-
+ located using iconv_close.
+
+ A conversion descriptor contains a conversion state.
+ After creation using iconv_open, the state is in the
+ initial state. Using iconv modifies the descriptor's
+ conversion state. (This implies that a conversion
+ descriptor can not be used in multiple threads simulta-
+ neously.) To bring the state back to the initial state,
+ use iconv with NULL as inbuf argument.
+
+RETURN VALUE
+ The iconv_open function returns a freshly allocated con-
+ version descriptor. In case of error, it sets errno and
+ returns (iconv_t)(-1).
+
+ERRORS
+ The following error can occur, among others:
+
+ EINVAL The conversion from fromcode to tocode is not
+ supported by the implementation.
+
+CONFORMING TO
+ UNIX98
+
+SEE ALSO
+ iconv(3), iconv_close(3)
+
+
+
+GNU May 26, 2002 ICONV_OPEN(3)
diff --git a/gnuwin32/manifest/bison-2.4.1-bin.mft b/gnuwin32/manifest/bison-2.4.1-bin.mft
new file mode 100644
index 00000000..41cc483b
--- /dev/null
+++ b/gnuwin32/manifest/bison-2.4.1-bin.mft
@@ -0,0 +1,98 @@
+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
diff --git a/gnuwin32/manifest/bison-2.4.1-bin.ver b/gnuwin32/manifest/bison-2.4.1-bin.ver
new file mode 100644
index 00000000..d09d850a
--- /dev/null
+++ b/gnuwin32/manifest/bison-2.4.1-bin.ver
@@ -0,0 +1 @@
+Bison-2.4.1 (Yacc-compatible parser generator): Binaries
diff --git a/gnuwin32/manifest/bison-2.4.1-dep.mft b/gnuwin32/manifest/bison-2.4.1-dep.mft
new file mode 100644
index 00000000..fb54cc84
--- /dev/null
+++ b/gnuwin32/manifest/bison-2.4.1-dep.mft
@@ -0,0 +1,5 @@
+bin/libiconv2.dll
+bin/libintl3.dll
+bin/regex2.dll
+manifest/bison-2.4.1-dep.mft
+manifest/bison-2.4.1-dep.ver bb151d843339f90abdc34f5eb49bff0e
diff --git a/gnuwin32/manifest/bison-2.4.1-dep.ver b/gnuwin32/manifest/bison-2.4.1-dep.ver
new file mode 100644
index 00000000..9f228fb8
--- /dev/null
+++ b/gnuwin32/manifest/bison-2.4.1-dep.ver
@@ -0,0 +1 @@
+Bison-2.4.1 (Yacc-compatible parser generator): Dependencies
diff --git a/gnuwin32/manifest/flex-2.5.4a-1-bin.mft b/gnuwin32/manifest/flex-2.5.4a-1-bin.mft
new file mode 100644
index 00000000..2be3f4a7
--- /dev/null
+++ b/gnuwin32/manifest/flex-2.5.4a-1-bin.mft
@@ -0,0 +1,15 @@
+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
diff --git a/gnuwin32/manifest/flex-2.5.4a-1-bin.ver b/gnuwin32/manifest/flex-2.5.4a-1-bin.ver
new file mode 100644
index 00000000..f4ba6ac4
--- /dev/null
+++ b/gnuwin32/manifest/flex-2.5.4a-1-bin.ver
@@ -0,0 +1,2 @@
+Flex 2.5.4a: Binaries
+Flex: fast lexical analyzer generator \ No newline at end of file
diff --git a/gnuwin32/manifest/gperf-3.0.1-bin.mft b/gnuwin32/manifest/gperf-3.0.1-bin.mft
new file mode 100644
index 00000000..836d20fe
--- /dev/null
+++ b/gnuwin32/manifest/gperf-3.0.1-bin.mft
@@ -0,0 +1,14 @@
+bin/gperf.exe
+contrib/gperf/3.0.1/depends-GnuWin32.lst
+contrib/gperf/3.0.1/gperf-3.0.1-GnuWin32.README
+contrib/gperf/3.0.1/gperf-3.0.1-src/AUTHORS
+contrib/gperf/3.0.1/gperf-3.0.1-src/ChangeLog
+contrib/gperf/3.0.1/gperf-3.0.1-src/COPYING
+contrib/gperf/3.0.1/gperf-3.0.1-src/INSTALL
+contrib/gperf/3.0.1/gperf-3.0.1-src/NEWS
+contrib/gperf/3.0.1/gperf-3.0.1-src/README
+contrib/gperf/3.0.1/gperf-3.0.1/check.log
+contrib/gperf/3.0.1/gperf-3.0.1/check_err.log
+man/cat1/gperf.1.txt
+manifest/gperf-3.0.1-bin.mft
+manifest/gperf-3.0.1-bin.ver
diff --git a/gnuwin32/manifest/gperf-3.0.1-bin.ver b/gnuwin32/manifest/gperf-3.0.1-bin.ver
new file mode 100644
index 00000000..380dbbc7
--- /dev/null
+++ b/gnuwin32/manifest/gperf-3.0.1-bin.ver
@@ -0,0 +1,2 @@
+Gperf 3.0.1: Binaries
+Gperf: generate a perfect hash function from a key set \ No newline at end of file
diff --git a/gnuwin32/manifest/libiconv-1.9.2-1-bin.mft b/gnuwin32/manifest/libiconv-1.9.2-1-bin.mft
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/gnuwin32/manifest/libiconv-1.9.2-1-bin.mft
diff --git a/gnuwin32/manifest/libiconv-1.9.2-1-bin.ver b/gnuwin32/manifest/libiconv-1.9.2-1-bin.ver
new file mode 100644
index 00000000..9ba63656
--- /dev/null
+++ b/gnuwin32/manifest/libiconv-1.9.2-1-bin.ver
@@ -0,0 +1,2 @@
+LibIconv 1.9.2: Binaries
+LibIconv: convert between character encodings \ No newline at end of file
diff --git a/gnuwin32/manifest/libiconv-1.9.2-1-dep.mft b/gnuwin32/manifest/libiconv-1.9.2-1-dep.mft
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/gnuwin32/manifest/libiconv-1.9.2-1-dep.mft
diff --git a/gnuwin32/manifest/libiconv-1.9.2-1-dep.ver b/gnuwin32/manifest/libiconv-1.9.2-1-dep.ver
new file mode 100644
index 00000000..3ca20388
--- /dev/null
+++ b/gnuwin32/manifest/libiconv-1.9.2-1-dep.ver
@@ -0,0 +1,2 @@
+LibIconv 1.9.2: Dependencies
+LibIconv: convert between character encodings \ No newline at end of file
diff --git a/gnuwin32/share/aclocal/bison-i18n.m4 b/gnuwin32/share/aclocal/bison-i18n.m4
new file mode 100644
index 00000000..75717127
--- /dev/null
+++ b/gnuwin32/share/aclocal/bison-i18n.m4
@@ -0,0 +1,48 @@
+# bison-i18n.m4 serial 2
+dnl Copyright (C) 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Support for internationalization of bison-generated parsers.
+
+dnl BISON_I18N
+dnl should be used in configure.ac, after AM_GNU_GETTEXT. If USE_NLS is yes, it
+dnl sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files
+dnl and defines YYENABLE_NLS if there are bison-runtime.mo files at all.
+AC_DEFUN([BISON_I18N],
+[
+ if test -z "$USE_NLS"; then
+ echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2
+ exit 1
+ fi
+ BISON_LOCALEDIR=
+ BISON_USE_NLS=no
+ if test "$USE_NLS" = yes; then
+ dnl Determine bison's localedir.
+ dnl AC_PROG_YACC sets the YACC variable; other macros set the BISON variable.
+ dnl But even is YACC is called "yacc", it may be a script that invokes bison
+ dnl and accepts the --print-localedir option.
+ dnl YACC's default value is empty; BISON's default value is :.
+ if (${YACC-${BISON-:}} --print-localedir) >/dev/null 2>&1; then
+ BISON_LOCALEDIR=`${YACC-${BISON-:}} --print-localedir`
+ fi
+ AC_SUBST([BISON_LOCALEDIR])
+ if test -n "$BISON_LOCALEDIR"; then
+ dnl There is no need to enable internationalization if the user doesn't
+ dnl want message catalogs. So look at the language/locale names for
+ dnl which the user wants message catalogs. This is $LINGUAS. If unset
+ dnl or empty, he wants all of them.
+ USER_LINGUAS="${LINGUAS-%UNSET%}"
+ if test -n "$USER_LINGUAS"; then
+ BISON_USE_NLS=yes
+ fi
+ fi
+ fi
+ if test $BISON_USE_NLS = yes; then
+ AC_DEFINE([YYENABLE_NLS], 1,
+ [Define to 1 to internationalize bison runtime messages.])
+ fi
+])
diff --git a/gnuwin32/share/bison/README b/gnuwin32/share/bison/README
new file mode 100644
index 00000000..18e025c1
--- /dev/null
+++ b/gnuwin32/share/bison/README
@@ -0,0 +1,70 @@
+-*- 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/>.
diff --git a/gnuwin32/share/bison/bison.m4 b/gnuwin32/share/bison/bison.m4
new file mode 100644
index 00000000..bad62963
--- /dev/null
+++ b/gnuwin32/share/bison/bison.m4
@@ -0,0 +1,556 @@
+ -*- 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]])
+])
diff --git a/gnuwin32/share/bison/c++-skel.m4 b/gnuwin32/share/bison/c++-skel.m4
new file mode 100644
index 00000000..b8089ff8
--- /dev/null
+++ b/gnuwin32/share/bison/c++-skel.m4
@@ -0,0 +1,25 @@
+ -*- Autoconf -*-
+
+# C++ skeleton dispatching for Bison.
+# Copyright (C) 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/>.
+
+b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])])
+b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])])
+
+m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.cc]])
+m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
+
+m4_include(b4_used_skeleton)
diff --git a/gnuwin32/share/bison/c++.m4 b/gnuwin32/share/bison/c++.m4
new file mode 100644
index 00000000..593390d6
--- /dev/null
+++ b/gnuwin32/share/bison/c++.m4
@@ -0,0 +1,170 @@
+ -*- 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;])
diff --git a/gnuwin32/share/bison/c-skel.m4 b/gnuwin32/share/bison/c-skel.m4
new file mode 100644
index 00000000..91f3c205
--- /dev/null
+++ b/gnuwin32/share/bison/c-skel.m4
@@ -0,0 +1,25 @@
+ -*- Autoconf -*-
+
+# C skeleton dispatching for Bison.
+# Copyright (C) 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/>.
+
+b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])])
+b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])])
+
+m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[yacc.c]])
+m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
+
+m4_include(b4_used_skeleton)
diff --git a/gnuwin32/share/bison/c.m4 b/gnuwin32/share/bison/c.m4
new file mode 100644
index 00000000..1fe4bc56
--- /dev/null
+++ b/gnuwin32/share/bison/c.m4
@@ -0,0 +1,477 @@
+ -*- 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
+])
diff --git a/gnuwin32/share/bison/glr.c b/gnuwin32/share/bison/glr.c
new file mode 100644
index 00000000..84637e0e
--- /dev/null
+++ b/gnuwin32/share/bison/glr.c
@@ -0,0 +1,2653 @@
+ -*- C -*-
+
+# GLR 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. ##
+## ---------------- ##
+
+# Stack parameters.
+m4_define_default([b4_stack_depth_max], [10000])
+m4_define_default([b4_stack_depth_init], [200])
+
+
+
+## ------------------------ ##
+## Pure/impure interfaces. ##
+## ------------------------ ##
+
+b4_define_flag_if([pure])
+# If glr.cc is including this file and thus has already set b4_pure_flag, don't
+# change the value of b4_pure_flag, and don't record a use of api.pure.
+m4_ifndef([b4_pure_flag],
+[b4_percent_define_default([[api.pure]], [[false]])
+ m4_define([b4_pure_flag],
+ [b4_percent_define_flag_if([[api.pure]], [[1]], [[0]])])])
+
+# b4_user_formals
+# ---------------
+# The possible parse-params formal arguments preceded by a comma.
+#
+# This is not shared with yacc.c in c.m4 because GLR relies on ISO C
+# formal argument declarations.
+m4_define([b4_user_formals],
+[m4_ifset([b4_parse_param], [, b4_c_ansi_formals(b4_parse_param)])])
+
+
+# b4_lex_param
+# ------------
+# Accumule in b4_lex_param all the yylex arguments.
+# Yes, this is quite ugly...
+m4_define([b4_lex_param],
+m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl
+b4_locations_if([, [[YYLTYPE *], [&yylloc]]])])dnl
+m4_ifdef([b4_lex_param], [, ]b4_lex_param)))
+
+
+# b4_yyerror_args
+# ---------------
+# Optional effective arguments passed to yyerror: user args plus yylloc, and
+# a trailing comma.
+m4_define([b4_yyerror_args],
+[b4_pure_if([b4_locations_if([yylocp, ])])dnl
+m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])])
+
+
+# b4_lyyerror_args
+# ----------------
+# Same as above, but on the lookahead, hence &yylloc instead of yylocp.
+m4_define([b4_lyyerror_args],
+[b4_pure_if([b4_locations_if([&yylloc, ])])dnl
+m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])])
+
+
+# b4_pure_args
+# ------------
+# Same as b4_yyerror_args, but with a leading comma.
+m4_define([b4_pure_args],
+[b4_pure_if([b4_locations_if([, yylocp])])[]b4_user_args])
+
+
+# b4_lpure_args
+# -------------
+# Same as above, but on the lookahead, hence &yylloc instead of yylocp.
+m4_define([b4_lpure_args],
+[b4_pure_if([b4_locations_if([, &yylloc])])[]b4_user_args])
+
+
+# b4_pure_formals
+# ---------------
+# Arguments passed to yyerror: user formals plus yylocp.
+m4_define([b4_pure_formals],
+[b4_pure_if([b4_locations_if([, YYLTYPE *yylocp])])[]b4_user_formals])
+
+
+## ----------------- ##
+## Semantic Values. ##
+## ----------------- ##
+
+
+# b4_lhs_value([TYPE])
+# --------------------
+# Expansion of $<TYPE>$.
+m4_define([b4_lhs_value],
+[((*yyvalp)[]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],
+[(((yyGLRStackItem const *)yyvsp)@{YYFILL (($2) - ($1))@}.yystate.yysemantics.yysval[]m4_ifval([$3], [.$3]))])
+
+
+
+## ----------- ##
+## Locations. ##
+## ----------- ##
+
+# b4_lhs_location()
+# -----------------
+# Expansion of @$.
+m4_define([b4_lhs_location],
+[(*yylocp)])
+
+
+# b4_rhs_location(RULE-LENGTH, NUM)
+# ---------------------------------
+# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
+# on RHS.
+m4_define([b4_rhs_location],
+[(((yyGLRStackItem const *)yyvsp)@{YYFILL (($2) - ($1))@}.yystate.yyloc)])
+
+
+
+## -------------- ##
+## Output files. ##
+## -------------- ##
+
+# We do want M4 expansion after # for CPP macros.
+m4_changecom()
+m4_divert_push(0)dnl
+@output(b4_parser_file_name@)
+b4_copyright([Skeleton implementation for Bison GLR parsers in C],
+ [2002, 2003, 2004, 2005, 2006])
+[
+/* C GLR parser skeleton written by Paul Hilfinger. */
+
+]b4_identification
+
+b4_percent_code_get([[top]])[]dnl
+m4_if(b4_prefix, [yy], [],
+[/* Substitute the variable and function names. */
+#define yyparse b4_prefix[]parse
+#define yylex b4_prefix[]lex
+#define yyerror b4_prefix[]error
+#define yylval b4_prefix[]lval
+#define yychar b4_prefix[]char
+#define yydebug b4_prefix[]debug
+#define yynerrs b4_prefix[]nerrs
+#define yylloc b4_prefix[]lloc])[
+
+/* Copy the first part of user declarations. */
+]b4_user_pre_prologue
+
+dnl # b4_shared_declarations
+dnl # ----------------------
+dnl # Declaration that might either go into the header (if --defines)
+dnl # or open coded in the parser body.
+m4_define([b4_shared_declarations],
+[b4_percent_code_get([[requires]])[]dnl
+
+b4_token_enums(b4_tokens)
+
+[#ifndef YYSTYPE
+]m4_ifdef([b4_stype],
+[[typedef union ]b4_union_name[
+{
+]b4_user_stype[
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1]],
+[m4_if(b4_tag_seen_flag, 0,
+[[typedef int YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1]])])[
+#endif
+
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+typedef struct YYLTYPE
+{
+]b4_locations_if([
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+],[
+ char yydummy;
+])[
+} YYLTYPE;
+# define YYLTYPE_IS_DECLARED 1
+# define YYLTYPE_IS_TRIVIAL 1
+#endif
+
+]b4_percent_code_get([[provides]])[]dnl
+])
+
+b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
+ [b4_shared_declarations])[
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG ]b4_debug_flag[
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE ]b4_error_verbose_flag[
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE ]b4_token_table[
+#endif
+
+/* Default (constant) value used for initialization for null
+ right-hand sides. Unlike the standard yacc.c template,
+ here we set the default value of $$ to a zeroed-out value.
+ Since the default value is undefined, this behavior is
+ technically correct. */
+static YYSTYPE yyval_default;
+
+/* Copy the second part of user declarations. */
+]b4_user_post_prologue
+b4_percent_code_get[]dnl
+
+[#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef YY_
+# if YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# endif
+# endif
+# ifndef YY_
+# define YY_(msgid) msgid
+# 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
+
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(n) (n)
+#else
+]b4_c_function_def([YYID], [static int], [[int i], [i]])[
+{
+ return i;
+}
+#endif
+
+#ifndef YYFREE
+# define YYFREE free
+#endif
+#ifndef YYMALLOC
+# define YYMALLOC malloc
+#endif
+#ifndef YYREALLOC
+# define YYREALLOC realloc
+#endif
+
+#define YYSIZEMAX ((size_t) -1)
+
+#ifdef __cplusplus
+ typedef bool yybool;
+#else
+ typedef unsigned char yybool;
+#endif
+#define yytrue 1
+#define yyfalse 0
+
+#ifndef YYSETJMP
+# include <setjmp.h>
+# define YYJMP_BUF jmp_buf
+# define YYSETJMP(env) setjmp (env)
+# define YYLONGJMP(env, val) longjmp (env, val)
+#endif
+
+/*-----------------.
+| GCC extensions. |
+`-----------------*/
+
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later. */
+# if (! defined __GNUC__ || __GNUC__ < 2 \
+ || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
+# define __attribute__(Spec) /* empty */
+# endif
+#endif
+
+]b4_locations_if([#define YYOPTIONAL_LOC(Name) Name],[
+#ifdef __cplusplus
+# define YYOPTIONAL_LOC(Name) /* empty */
+#else
+# define YYOPTIONAL_LOC(Name) Name __attribute__ ((__unused__))
+#endif])[
+
+#ifndef YYASSERT
+# define YYASSERT(condition) ((void) ((condition) || (abort (), 0)))
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL ]b4_final_state_number[
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST ]b4_last[
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS ]b4_tokens_number[
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS ]b4_nterms_number[
+/* YYNRULES -- Number of rules. */
+#define YYNRULES ]b4_rules_number[
+/* YYNRULES -- Number of states. */
+#define YYNSTATES ]b4_states_number[
+/* YYMAXRHS -- Maximum number of symbols on right-hand side of rule. */
+#define YYMAXRHS ]b4_r2_max[
+/* YYMAXLEFT -- Maximum number of symbols to the left of a handle
+ accessed by $0, $-1, etc., in any rule. */
+#define YYMAXLEFT ]b4_max_left_semantic_context[
+
+/* YYTRANSLATE(X) -- Bison symbol number corresponding to X. */
+#define YYUNDEFTOK ]b4_undef_token_number[
+#define YYMAXUTOK ]b4_user_token_number_max[
+
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
+{
+ ]b4_translate[
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+static const ]b4_int_type_for([b4_prhs])[ yyprhs[] =
+{
+ ]b4_prhs[
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const ]b4_int_type_for([b4_rhs])[ yyrhs[] =
+{
+ ]b4_rhs[
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const ]b4_int_type_for([b4_rline])[ yyrline[] =
+{
+ ]b4_rline[
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ ]b4_tname[
+};
+#endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const ]b4_int_type_for([b4_r1])[ yyr1[] =
+{
+ ]b4_r1[
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const ]b4_int_type_for([b4_r2])[ yyr2[] =
+{
+ ]b4_r2[
+};
+
+/* YYDPREC[RULE-NUM] -- Dynamic precedence of rule #RULE-NUM (0 if none). */
+static const ]b4_int_type_for([b4_dprec])[ yydprec[] =
+{
+ ]b4_dprec[
+};
+
+/* YYMERGER[RULE-NUM] -- Index of merging function for rule #RULE-NUM. */
+static const ]b4_int_type_for([b4_merger])[ yymerger[] =
+{
+ ]b4_merger[
+};
+
+/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
+ doesn't specify something else to do. Zero means the default is an
+ error. */
+static const ]b4_int_type_for([b4_defact])[ yydefact[] =
+{
+ ]b4_defact[
+};
+
+/* YYPDEFGOTO[NTERM-NUM]. */
+static const ]b4_int_type_for([b4_defgoto])[ yydefgoto[] =
+{
+ ]b4_defgoto[
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF ]b4_pact_ninf[
+static const ]b4_int_type_for([b4_pact])[ yypact[] =
+{
+ ]b4_pact[
+};
+
+/* YYPGOTO[NTERM-NUM]. */
+static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] =
+{
+ ]b4_pgoto[
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
+#define YYTABLE_NINF ]b4_table_ninf[
+static const ]b4_int_type_for([b4_table])[ yytable[] =
+{
+ ]b4_table[
+};
+
+/* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of
+ list of conflicting reductions corresponding to action entry for
+ state STATE-NUM in yytable. 0 means no conflicts. The list in
+ yyconfl is terminated by a rule number of 0. */
+static const ]b4_int_type_for([b4_conflict_list_heads])[ yyconflp[] =
+{
+ ]b4_conflict_list_heads[
+};
+
+/* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by
+ 0, pointed into by YYCONFLP. */
+]dnl Do not use b4_int_type_for here, since there are places where
+dnl pointers onto yyconfl are taken, which type is "short int *".
+dnl We probably ought to introduce a type for confl.
+[static const short int yyconfl[] =
+{
+ ]b4_conflicting_rules[
+};
+
+static const ]b4_int_type_for([b4_check])[ yycheck[] =
+{
+ ]b4_check[
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const ]b4_int_type_for([b4_stos])[ yystos[] =
+{
+ ]b4_stos[
+};
+
+
+/* Prevent warning if -Wmissing-prototypes. */
+]b4_c_ansi_function_decl([yyparse], [int], b4_parse_param)[
+
+/* Error token number */
+#define YYTERROR 1
+
+/* 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). */
+
+]b4_locations_if([[
+#define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (YYID (N)) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
+ while (YYID (0))
+
+/* 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. */
+
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+#endif
+]],[
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) ((void) 0)
+#endif
+])[
+
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+#define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[
+
+]b4_pure_if(
+[
+#undef yynerrs
+#define yynerrs (yystackp->yyerrcnt)
+#undef yychar
+#define yychar (yystackp->yyrawchar)
+#undef yylval
+#define yylval (yystackp->yyval)
+#undef yylloc
+#define yylloc (yystackp->yyloc)
+m4_if(b4_prefix[], [yy], [],
+[#define b4_prefix[]nerrs yynerrs
+#define b4_prefix[]char yychar
+#define b4_prefix[]lval yylval
+#define b4_prefix[]lloc yylloc])],
+[YYSTYPE yylval;
+
+YYLTYPE yylloc;
+
+int yynerrs;
+int yychar;])[
+
+static const int YYEOF = 0;
+static const int YYEMPTY = -2;
+
+typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
+
+#define YYCHK(YYE) \
+ do { YYRESULTTAG yyflag = YYE; if (yyflag != yyok) return yyflag; } \
+ while (YYID (0))
+
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (YYID (0))
+
+]b4_yy_symbol_print_generate([b4_c_ansi_function_def])[
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, Type, \
+ Value]b4_locations_if([, Location])[]b4_user_args[); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (YYID (0))
+
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+
+#else /* !YYDEBUG */
+
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+
+#endif /* !YYDEBUG */
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH ]b4_stack_depth_init[
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ SIZE_MAX < YYMAXDEPTH * sizeof (GLRStackItem)
+ evaluated with infinite-precision integer arithmetic. */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH ]b4_stack_depth_max[
+#endif
+
+/* Minimum number of free items on the stack allowed after an
+ allocation. This is to allow allocation and initialization
+ to be completed by functions that call yyexpandGLRStack before the
+ stack is expanded, thus insuring that all necessary pointers get
+ properly redirected to new data. */
+#define YYHEADROOM 2
+
+#ifndef YYSTACKEXPANDABLE
+# if (! defined __cplusplus \
+ || (]b4_locations_if([[defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+ && ]])[defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))
+# define YYSTACKEXPANDABLE 1
+# else
+# define YYSTACKEXPANDABLE 0
+# endif
+#endif
+
+#if YYSTACKEXPANDABLE
+# define YY_RESERVE_GLRSTACK(Yystack) \
+ do { \
+ if (Yystack->yyspaceLeft < YYHEADROOM) \
+ yyexpandGLRStack (Yystack); \
+ } while (YYID (0))
+#else
+# define YY_RESERVE_GLRSTACK(Yystack) \
+ do { \
+ if (Yystack->yyspaceLeft < YYHEADROOM) \
+ yyMemoryExhausted (Yystack); \
+ } while (YYID (0))
+#endif
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystpcpy
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+{
+ char *yyd = yydest;
+ const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of 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. If YYRES is
+ null, do not copy; instead, return the length of what the result
+ would have been. */
+static size_t
+yytnamerr (char *yyres, const char *yystr)
+{
+ if (*yystr == '"')
+ {
+ size_t yyn = 0;
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
+ do_not_strip_quotes: ;
+ }
+
+ if (! yyres)
+ return strlen (yystr);
+
+ return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+/** State numbers, as in LALR(1) machine */
+typedef int yyStateNum;
+
+/** Rule numbers, as in LALR(1) machine */
+typedef int yyRuleNum;
+
+/** Grammar symbol */
+typedef short int yySymbol;
+
+/** Item references, as in LALR(1) machine */
+typedef short int yyItemNum;
+
+typedef struct yyGLRState yyGLRState;
+typedef struct yyGLRStateSet yyGLRStateSet;
+typedef struct yySemanticOption yySemanticOption;
+typedef union yyGLRStackItem yyGLRStackItem;
+typedef struct yyGLRStack yyGLRStack;
+
+struct yyGLRState {
+ /** Type tag: always true. */
+ yybool yyisState;
+ /** Type tag for yysemantics. If true, yysval applies, otherwise
+ * yyfirstVal applies. */
+ yybool yyresolved;
+ /** Number of corresponding LALR(1) machine state. */
+ yyStateNum yylrState;
+ /** Preceding state in this stack */
+ yyGLRState* yypred;
+ /** Source position of the first token produced by my symbol */
+ size_t yyposn;
+ union {
+ /** First in a chain of alternative reductions producing the
+ * non-terminal corresponding to this state, threaded through
+ * yynext. */
+ yySemanticOption* yyfirstVal;
+ /** Semantic value for this state. */
+ YYSTYPE yysval;
+ } yysemantics;
+ /** Source location for this state. */
+ YYLTYPE yyloc;
+};
+
+struct yyGLRStateSet {
+ yyGLRState** yystates;
+ /** During nondeterministic operation, yylookaheadNeeds tracks which
+ * stacks have actually needed the current lookahead. During deterministic
+ * operation, yylookaheadNeeds[0] is not maintained since it would merely
+ * duplicate yychar != YYEMPTY. */
+ yybool* yylookaheadNeeds;
+ size_t yysize, yycapacity;
+};
+
+struct yySemanticOption {
+ /** Type tag: always false. */
+ yybool yyisState;
+ /** Rule number for this reduction */
+ yyRuleNum yyrule;
+ /** The last RHS state in the list of states to be reduced. */
+ yyGLRState* yystate;
+ /** The lookahead for this reduction. */
+ int yyrawchar;
+ YYSTYPE yyval;
+ YYLTYPE yyloc;
+ /** Next sibling in chain of options. To facilitate merging,
+ * options are chained in decreasing order by address. */
+ yySemanticOption* yynext;
+};
+
+/** Type of the items in the GLR stack. The yyisState field
+ * indicates which item of the union is valid. */
+union yyGLRStackItem {
+ yyGLRState yystate;
+ yySemanticOption yyoption;
+};
+
+struct yyGLRStack {
+ int yyerrState;
+]b4_locations_if([[ /* To compute the location of the error token. */
+ yyGLRStackItem yyerror_range[3];]])[
+]b4_pure_if(
+[
+ int yyerrcnt;
+ int yyrawchar;
+ YYSTYPE yyval;
+ YYLTYPE yyloc;
+])[
+ YYJMP_BUF yyexception_buffer;
+ yyGLRStackItem* yyitems;
+ yyGLRStackItem* yynextFree;
+ size_t yyspaceLeft;
+ yyGLRState* yysplitPoint;
+ yyGLRState* yylastDeleted;
+ yyGLRStateSet yytops;
+};
+
+#if YYSTACKEXPANDABLE
+static void yyexpandGLRStack (yyGLRStack* yystackp);
+#endif
+
+static void yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
+ __attribute__ ((__noreturn__));
+static void
+yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
+{
+ if (yymsg != NULL)
+ yyerror (]b4_yyerror_args[yymsg);
+ YYLONGJMP (yystackp->yyexception_buffer, 1);
+}
+
+static void yyMemoryExhausted (yyGLRStack* yystackp)
+ __attribute__ ((__noreturn__));
+static void
+yyMemoryExhausted (yyGLRStack* yystackp)
+{
+ YYLONGJMP (yystackp->yyexception_buffer, 2);
+}
+
+#if YYDEBUG || YYERROR_VERBOSE
+/** A printable representation of TOKEN. */
+static inline const char*
+yytokenName (yySymbol yytoken)
+{
+ if (yytoken == YYEMPTY)
+ return "";
+
+ return yytname[yytoken];
+}
+#endif
+
+/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting
+ * at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred
+ * containing the pointer to the next state in the chain. */
+static void yyfillin (yyGLRStackItem *, int, int) __attribute__ ((__unused__));
+static void
+yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
+{
+ yyGLRState* s;
+ int i;
+ s = yyvsp[yylow0].yystate.yypred;
+ for (i = yylow0-1; i >= yylow1; i -= 1)
+ {
+ YYASSERT (s->yyresolved);
+ yyvsp[i].yystate.yyresolved = yytrue;
+ yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;
+ yyvsp[i].yystate.yyloc = s->yyloc;
+ s = yyvsp[i].yystate.yypred = s->yypred;
+ }
+}
+
+/* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1. Otherwise, fill in
+ * YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
+ * For convenience, always return YYLOW1. */
+static inline int yyfill (yyGLRStackItem *, int *, int, yybool)
+ __attribute__ ((__unused__));
+static inline int
+yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal)
+{
+ if (!yynormal && yylow1 < *yylow)
+ {
+ yyfillin (yyvsp, *yylow, yylow1);
+ *yylow = yylow1;
+ }
+ return yylow1;
+}
+
+/** Perform user action for rule number YYN, with RHS length YYRHSLEN,
+ * and top stack item YYVSP. YYLVALP points to place to put semantic
+ * value ($$), and yylocp points to place for location information
+ * (@@$). Returns yyok for normal return, yyaccept for YYACCEPT,
+ * yyerr for YYERROR, yyabort for YYABORT. */
+/*ARGSUSED*/ static YYRESULTTAG
+yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
+ YYSTYPE* yyvalp,
+ YYLTYPE* YYOPTIONAL_LOC (yylocp),
+ yyGLRStack* yystackp
+ ]b4_user_formals[)
+{
+ yybool yynormal __attribute__ ((__unused__)) =
+ (yystackp->yysplitPoint == NULL);
+ int yylow;
+]b4_parse_param_use[]dnl
+[# undef yyerrok
+# define yyerrok (yystackp->yyerrState = 0)
+# undef YYACCEPT
+# define YYACCEPT return yyaccept
+# undef YYABORT
+# define YYABORT return yyabort
+# undef YYERROR
+# define YYERROR return yyerrok, yyerr
+# undef YYRECOVERING
+# define YYRECOVERING() (yystackp->yyerrState != 0)
+# undef yyclearin
+# define yyclearin (yychar = YYEMPTY)
+# undef YYFILL
+# define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
+# undef YYBACKUP
+# define YYBACKUP(Token, Value) \
+ return yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")), \
+ yyerrok, yyerr
+
+ yylow = 1;
+ if (yyrhslen == 0)
+ *yyvalp = yyval_default;
+ else
+ *yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
+ YYLLOC_DEFAULT ((*yylocp), (yyvsp - yyrhslen), yyrhslen);
+]b4_locations_if([[ yystackp->yyerror_range[1].yystate.yyloc = *yylocp;
+]])[
+ switch (yyn)
+ {
+ ]b4_user_actions[
+ default: break;
+ }
+
+ return yyok;
+# undef yyerrok
+# undef YYABORT
+# undef YYACCEPT
+# undef YYERROR
+# undef YYBACKUP
+# undef yyclearin
+# undef YYRECOVERING
+}
+
+
+/*ARGSUSED*/ static void
+yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1)
+{
+ YYUSE (yy0);
+ YYUSE (yy1);
+
+ switch (yyn)
+ {
+ ]b4_mergers[
+ default: break;
+ }
+}
+
+ /* Bison grammar-table manipulation. */
+
+]b4_yydestruct_generate([b4_c_ansi_function_def])[
+
+/** Number of symbols composing the right hand side of rule #RULE. */
+static inline int
+yyrhsLength (yyRuleNum yyrule)
+{
+ return yyr2[yyrule];
+}
+
+static void
+yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[)
+{
+ if (yys->yyresolved)
+ yydestruct (yymsg, yystos[yys->yylrState],
+ &yys->yysemantics.yysval]b4_locations_if([, &yys->yyloc])[]b4_user_args[);
+ else
+ {
+#if YYDEBUG
+ if (yydebug)
+ {
+ if (yys->yysemantics.yyfirstVal)
+ YYFPRINTF (stderr, "%s unresolved ", yymsg);
+ else
+ YYFPRINTF (stderr, "%s incomplete ", yymsg);
+ yy_symbol_print (stderr, yystos[yys->yylrState],
+ NULL]b4_locations_if([, &yys->yyloc])[]b4_user_args[);
+ YYFPRINTF (stderr, "\n");
+ }
+#endif
+
+ if (yys->yysemantics.yyfirstVal)
+ {
+ yySemanticOption *yyoption = yys->yysemantics.yyfirstVal;
+ yyGLRState *yyrh;
+ int yyn;
+ for (yyrh = yyoption->yystate, yyn = yyrhsLength (yyoption->yyrule);
+ yyn > 0;
+ yyrh = yyrh->yypred, yyn -= 1)
+ yydestroyGLRState (yymsg, yyrh]b4_user_args[);
+ }
+ }
+}
+
+/** Left-hand-side symbol for rule #RULE. */
+static inline yySymbol
+yylhsNonterm (yyRuleNum yyrule)
+{
+ return yyr1[yyrule];
+}
+
+#define yyis_pact_ninf(yystate) \
+ ]m4_if(m4_eval(b4_pact_ninf < b4_pact_min), [1],
+ [0],
+ [((yystate) == YYPACT_NINF)])[
+
+/** True iff LR state STATE has only a default reduction (regardless
+ * of token). */
+static inline yybool
+yyisDefaultedState (yyStateNum yystate)
+{
+ return yyis_pact_ninf (yypact[yystate]);
+}
+
+/** The default reduction for STATE, assuming it has one. */
+static inline yyRuleNum
+yydefaultAction (yyStateNum yystate)
+{
+ return yydefact[yystate];
+}
+
+#define yyis_table_ninf(yytable_value) \
+ ]m4_if(m4_eval(b4_table_ninf < b4_table_min), [1],
+ [YYID (0)],
+ [((yytable_value) == YYTABLE_NINF)])[
+
+/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
+ * Result R means
+ * R < 0: Reduce on rule -R.
+ * R = 0: Error.
+ * R > 0: Shift to state R.
+ * Set *CONFLICTS to a pointer into yyconfl to 0-terminated list of
+ * conflicting reductions.
+ */
+static inline void
+yygetLRActions (yyStateNum yystate, int yytoken,
+ int* yyaction, const short int** yyconflicts)
+{
+ int yyindex = yypact[yystate] + yytoken;
+ if (yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
+ {
+ *yyaction = -yydefact[yystate];
+ *yyconflicts = yyconfl;
+ }
+ else if (! yyis_table_ninf (yytable[yyindex]))
+ {
+ *yyaction = yytable[yyindex];
+ *yyconflicts = yyconfl + yyconflp[yyindex];
+ }
+ else
+ {
+ *yyaction = 0;
+ *yyconflicts = yyconfl + yyconflp[yyindex];
+ }
+}
+
+static inline yyStateNum
+yyLRgotoState (yyStateNum yystate, yySymbol yylhs)
+{
+ int yyr;
+ yyr = yypgoto[yylhs - YYNTOKENS] + yystate;
+ if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate)
+ return yytable[yyr];
+ else
+ return yydefgoto[yylhs - YYNTOKENS];
+}
+
+static inline yybool
+yyisShiftAction (int yyaction)
+{
+ return 0 < yyaction;
+}
+
+static inline yybool
+yyisErrorAction (int yyaction)
+{
+ return yyaction == 0;
+}
+
+ /* GLRStates */
+
+/** Return a fresh GLRStackItem. Callers should call
+ * YY_RESERVE_GLRSTACK afterwards to make sure there is sufficient
+ * headroom. */
+
+static inline yyGLRStackItem*
+yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState)
+{
+ yyGLRStackItem* yynewItem = yystackp->yynextFree;
+ yystackp->yyspaceLeft -= 1;
+ yystackp->yynextFree += 1;
+ yynewItem->yystate.yyisState = yyisState;
+ return yynewItem;
+}
+
+/** Add a new semantic action that will execute the action for rule
+ * RULENUM on the semantic values in RHS to the list of
+ * alternative actions for STATE. Assumes that RHS comes from
+ * stack #K of *STACKP. */
+static void
+yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
+ yyGLRState* rhs, yyRuleNum yyrule)
+{
+ yySemanticOption* yynewOption =
+ &yynewGLRStackItem (yystackp, yyfalse)->yyoption;
+ yynewOption->yystate = rhs;
+ yynewOption->yyrule = yyrule;
+ if (yystackp->yytops.yylookaheadNeeds[yyk])
+ {
+ yynewOption->yyrawchar = yychar;
+ yynewOption->yyval = yylval;
+ yynewOption->yyloc = yylloc;
+ }
+ else
+ yynewOption->yyrawchar = YYEMPTY;
+ yynewOption->yynext = yystate->yysemantics.yyfirstVal;
+ yystate->yysemantics.yyfirstVal = yynewOption;
+
+ YY_RESERVE_GLRSTACK (yystackp);
+}
+
+ /* GLRStacks */
+
+/** Initialize SET to a singleton set containing an empty stack. */
+static yybool
+yyinitStateSet (yyGLRStateSet* yyset)
+{
+ yyset->yysize = 1;
+ yyset->yycapacity = 16;
+ yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
+ if (! yyset->yystates)
+ return yyfalse;
+ yyset->yystates[0] = NULL;
+ yyset->yylookaheadNeeds =
+ (yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
+ if (! yyset->yylookaheadNeeds)
+ {
+ YYFREE (yyset->yystates);
+ return yyfalse;
+ }
+ return yytrue;
+}
+
+static void yyfreeStateSet (yyGLRStateSet* yyset)
+{
+ YYFREE (yyset->yystates);
+ YYFREE (yyset->yylookaheadNeeds);
+}
+
+/** Initialize STACK to a single empty stack, with total maximum
+ * capacity for all stacks of SIZE. */
+static yybool
+yyinitGLRStack (yyGLRStack* yystackp, size_t yysize)
+{
+ yystackp->yyerrState = 0;
+ yynerrs = 0;
+ yystackp->yyspaceLeft = yysize;
+ yystackp->yyitems =
+ (yyGLRStackItem*) YYMALLOC (yysize * sizeof yystackp->yynextFree[0]);
+ if (!yystackp->yyitems)
+ return yyfalse;
+ yystackp->yynextFree = yystackp->yyitems;
+ yystackp->yysplitPoint = NULL;
+ yystackp->yylastDeleted = NULL;
+ return yyinitStateSet (&yystackp->yytops);
+}
+
+
+#if YYSTACKEXPANDABLE
+# define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \
+ &((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE
+
+/** If STACK is expandable, extend it. WARNING: Pointers into the
+ stack from outside should be considered invalid after this call.
+ We always expand when there are 1 or fewer items left AFTER an
+ allocation, so that we can avoid having external pointers exist
+ across an allocation. */
+static void
+yyexpandGLRStack (yyGLRStack* yystackp)
+{
+ yyGLRStackItem* yynewItems;
+ yyGLRStackItem* yyp0, *yyp1;
+ size_t yysize, yynewSize;
+ size_t yyn;
+ yysize = yystackp->yynextFree - yystackp->yyitems;
+ if (YYMAXDEPTH - YYHEADROOM < yysize)
+ yyMemoryExhausted (yystackp);
+ yynewSize = 2*yysize;
+ if (YYMAXDEPTH < yynewSize)
+ yynewSize = YYMAXDEPTH;
+ yynewItems = (yyGLRStackItem*) YYMALLOC (yynewSize * sizeof yynewItems[0]);
+ if (! yynewItems)
+ yyMemoryExhausted (yystackp);
+ for (yyp0 = yystackp->yyitems, yyp1 = yynewItems, yyn = yysize;
+ 0 < yyn;
+ yyn -= 1, yyp0 += 1, yyp1 += 1)
+ {
+ *yyp1 = *yyp0;
+ if (*(yybool *) yyp0)
+ {
+ yyGLRState* yys0 = &yyp0->yystate;
+ yyGLRState* yys1 = &yyp1->yystate;
+ if (yys0->yypred != NULL)
+ yys1->yypred =
+ YYRELOC (yyp0, yyp1, yys0->yypred, yystate);
+ if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != NULL)
+ yys1->yysemantics.yyfirstVal =
+ YYRELOC(yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption);
+ }
+ else
+ {
+ yySemanticOption* yyv0 = &yyp0->yyoption;
+ yySemanticOption* yyv1 = &yyp1->yyoption;
+ if (yyv0->yystate != NULL)
+ yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate);
+ if (yyv0->yynext != NULL)
+ yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption);
+ }
+ }
+ if (yystackp->yysplitPoint != NULL)
+ yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems,
+ yystackp->yysplitPoint, yystate);
+
+ for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1)
+ if (yystackp->yytops.yystates[yyn] != NULL)
+ yystackp->yytops.yystates[yyn] =
+ YYRELOC (yystackp->yyitems, yynewItems,
+ yystackp->yytops.yystates[yyn], yystate);
+ YYFREE (yystackp->yyitems);
+ yystackp->yyitems = yynewItems;
+ yystackp->yynextFree = yynewItems + yysize;
+ yystackp->yyspaceLeft = yynewSize - yysize;
+}
+#endif
+
+static void
+yyfreeGLRStack (yyGLRStack* yystackp)
+{
+ YYFREE (yystackp->yyitems);
+ yyfreeStateSet (&yystackp->yytops);
+}
+
+/** Assuming that S is a GLRState somewhere on STACK, update the
+ * splitpoint of STACK, if needed, so that it is at least as deep as
+ * S. */
+static inline void
+yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
+{
+ if (yystackp->yysplitPoint != NULL && yystackp->yysplitPoint > yys)
+ yystackp->yysplitPoint = yys;
+}
+
+/** Invalidate stack #K in STACK. */
+static inline void
+yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
+{
+ if (yystackp->yytops.yystates[yyk] != NULL)
+ yystackp->yylastDeleted = yystackp->yytops.yystates[yyk];
+ yystackp->yytops.yystates[yyk] = NULL;
+}
+
+/** Undelete the last stack that was marked as deleted. Can only be
+ done once after a deletion, and only when all other stacks have
+ been deleted. */
+static void
+yyundeleteLastStack (yyGLRStack* yystackp)
+{
+ if (yystackp->yylastDeleted == NULL || yystackp->yytops.yysize != 0)
+ return;
+ yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
+ yystackp->yytops.yysize = 1;
+ YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
+ yystackp->yylastDeleted = NULL;
+}
+
+static inline void
+yyremoveDeletes (yyGLRStack* yystackp)
+{
+ size_t yyi, yyj;
+ yyi = yyj = 0;
+ while (yyj < yystackp->yytops.yysize)
+ {
+ if (yystackp->yytops.yystates[yyi] == NULL)
+ {
+ if (yyi == yyj)
+ {
+ YYDPRINTF ((stderr, "Removing dead stacks.\n"));
+ }
+ yystackp->yytops.yysize -= 1;
+ }
+ else
+ {
+ yystackp->yytops.yystates[yyj] = yystackp->yytops.yystates[yyi];
+ /* In the current implementation, it's unnecessary to copy
+ yystackp->yytops.yylookaheadNeeds[yyi] since, after
+ yyremoveDeletes returns, the parser immediately either enters
+ deterministic operation or shifts a token. However, it doesn't
+ hurt, and the code might evolve to need it. */
+ yystackp->yytops.yylookaheadNeeds[yyj] =
+ yystackp->yytops.yylookaheadNeeds[yyi];
+ if (yyj != yyi)
+ {
+ YYDPRINTF ((stderr, "Rename stack %lu -> %lu.\n",
+ (unsigned long int) yyi, (unsigned long int) yyj));
+ }
+ yyj += 1;
+ }
+ yyi += 1;
+ }
+}
+
+/** Shift to a new state on stack #K of STACK, corresponding to LR state
+ * LRSTATE, at input position POSN, with (resolved) semantic value SVAL. */
+static inline void
+yyglrShift (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
+ size_t yyposn,
+ YYSTYPE* yyvalp, YYLTYPE* yylocp)
+{
+ yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
+
+ yynewState->yylrState = yylrState;
+ yynewState->yyposn = yyposn;
+ yynewState->yyresolved = yytrue;
+ yynewState->yypred = yystackp->yytops.yystates[yyk];
+ yynewState->yysemantics.yysval = *yyvalp;
+ yynewState->yyloc = *yylocp;
+ yystackp->yytops.yystates[yyk] = yynewState;
+
+ YY_RESERVE_GLRSTACK (yystackp);
+}
+
+/** Shift stack #K of YYSTACK, to a new state corresponding to LR
+ * state YYLRSTATE, at input position YYPOSN, with the (unresolved)
+ * semantic value of YYRHS under the action for YYRULE. */
+static inline void
+yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
+ size_t yyposn, yyGLRState* rhs, yyRuleNum yyrule)
+{
+ yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
+
+ yynewState->yylrState = yylrState;
+ yynewState->yyposn = yyposn;
+ yynewState->yyresolved = yyfalse;
+ yynewState->yypred = yystackp->yytops.yystates[yyk];
+ yynewState->yysemantics.yyfirstVal = NULL;
+ yystackp->yytops.yystates[yyk] = yynewState;
+
+ /* Invokes YY_RESERVE_GLRSTACK. */
+ yyaddDeferredAction (yystackp, yyk, yynewState, rhs, yyrule);
+}
+
+/** Pop the symbols consumed by reduction #RULE from the top of stack
+ * #K of STACK, and perform the appropriate semantic action on their
+ * semantic values. Assumes that all ambiguities in semantic values
+ * have been previously resolved. Set *VALP to the resulting value,
+ * and *LOCP to the computed location (if any). Return value is as
+ * for userAction. */
+static inline YYRESULTTAG
+yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
+ YYSTYPE* yyvalp, YYLTYPE* yylocp]b4_user_formals[)
+{
+ int yynrhs = yyrhsLength (yyrule);
+
+ if (yystackp->yysplitPoint == NULL)
+ {
+ /* Standard special case: single stack. */
+ yyGLRStackItem* rhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
+ YYASSERT (yyk == 0);
+ yystackp->yynextFree -= yynrhs;
+ yystackp->yyspaceLeft += yynrhs;
+ yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate;
+ return yyuserAction (yyrule, yynrhs, rhs,
+ yyvalp, yylocp, yystackp]b4_user_args[);
+ }
+ else
+ {
+ /* At present, doAction is never called in nondeterministic
+ * mode, so this branch is never taken. It is here in
+ * anticipation of a future feature that will allow immediate
+ * evaluation of selected actions in nondeterministic mode. */
+ int yyi;
+ yyGLRState* yys;
+ yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
+ yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred
+ = yystackp->yytops.yystates[yyk];]b4_locations_if([[
+ if (yynrhs == 0)
+ /* Set default location. */
+ yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yys->yyloc;]])[
+ for (yyi = 0; yyi < yynrhs; yyi += 1)
+ {
+ yys = yys->yypred;
+ YYASSERT (yys);
+ }
+ yyupdateSplit (yystackp, yys);
+ yystackp->yytops.yystates[yyk] = yys;
+ return yyuserAction (yyrule, yynrhs, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
+ yyvalp, yylocp, yystackp]b4_user_args[);
+ }
+}
+
+#if !YYDEBUG
+# define YY_REDUCE_PRINT(Args)
+#else
+# define YY_REDUCE_PRINT(Args) \
+do { \
+ if (yydebug) \
+ yy_reduce_print Args; \
+} while (YYID (0))
+
+/*----------------------------------------------------------.
+| Report that the RULE is going to be reduced on stack #K. |
+`----------------------------------------------------------*/
+
+/*ARGSUSED*/ static inline void
+yy_reduce_print (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
+ YYSTYPE* yyvalp, YYLTYPE* yylocp]b4_user_formals[)
+{
+ int yynrhs = yyrhsLength (yyrule);
+ yybool yynormal __attribute__ ((__unused__)) =
+ (yystackp->yysplitPoint == NULL);
+ yyGLRStackItem* yyvsp = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
+ int yylow = 1;
+ int yyi;
+ YYUSE (yyvalp);
+ YYUSE (yylocp);
+]b4_parse_param_use[]dnl
+[ YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n",
+ (unsigned long int) yyk, yyrule - 1,
+ (unsigned long int) yyrline[yyrule]);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+ &]b4_rhs_value(yynrhs, yyi + 1)[
+ ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
+ b4_user_args[);
+ YYFPRINTF (stderr, "\n");
+ }
+}
+#endif
+
+/** Pop items off stack #K of STACK according to grammar rule RULE,
+ * and push back on the resulting nonterminal symbol. Perform the
+ * semantic action associated with RULE and store its value with the
+ * newly pushed state, if FORCEEVAL or if STACK is currently
+ * unambiguous. Otherwise, store the deferred semantic action with
+ * the new state. If the new state would have an identical input
+ * position, LR state, and predecessor to an existing state on the stack,
+ * it is identified with that existing state, eliminating stack #K from
+ * the STACK. In this case, the (necessarily deferred) semantic value is
+ * added to the options for the existing state's semantic value.
+ */
+static inline YYRESULTTAG
+yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
+ yybool yyforceEval]b4_user_formals[)
+{
+ size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn;
+
+ if (yyforceEval || yystackp->yysplitPoint == NULL)
+ {
+ YYSTYPE yysval;
+ YYLTYPE yyloc;
+
+ YY_REDUCE_PRINT ((yystackp, yyk, yyrule, &yysval, &yyloc]b4_user_args[));
+ YYCHK (yydoAction (yystackp, yyk, yyrule, &yysval,
+ &yyloc]b4_user_args[));
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc);
+ yyglrShift (yystackp, yyk,
+ yyLRgotoState (yystackp->yytops.yystates[yyk]->yylrState,
+ yylhsNonterm (yyrule)),
+ yyposn, &yysval, &yyloc);
+ }
+ else
+ {
+ size_t yyi;
+ int yyn;
+ yyGLRState* yys, *yys0 = yystackp->yytops.yystates[yyk];
+ yyStateNum yynewLRState;
+
+ for (yys = yystackp->yytops.yystates[yyk], yyn = yyrhsLength (yyrule);
+ 0 < yyn; yyn -= 1)
+ {
+ yys = yys->yypred;
+ YYASSERT (yys);
+ }
+ yyupdateSplit (yystackp, yys);
+ yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
+ YYDPRINTF ((stderr,
+ "Reduced stack %lu by rule #%d; action deferred. Now in state %d.\n",
+ (unsigned long int) yyk, yyrule - 1, yynewLRState));
+ for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
+ if (yyi != yyk && yystackp->yytops.yystates[yyi] != NULL)
+ {
+ yyGLRState* yyp, *yysplit = yystackp->yysplitPoint;
+ yyp = yystackp->yytops.yystates[yyi];
+ while (yyp != yys && yyp != yysplit && yyp->yyposn >= yyposn)
+ {
+ if (yyp->yylrState == yynewLRState && yyp->yypred == yys)
+ {
+ yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule);
+ yymarkStackDeleted (yystackp, yyk);
+ YYDPRINTF ((stderr, "Merging stack %lu into stack %lu.\n",
+ (unsigned long int) yyk,
+ (unsigned long int) yyi));
+ return yyok;
+ }
+ yyp = yyp->yypred;
+ }
+ }
+ yystackp->yytops.yystates[yyk] = yys;
+ yyglrShiftDefer (yystackp, yyk, yynewLRState, yyposn, yys0, yyrule);
+ }
+ return yyok;
+}
+
+static size_t
+yysplitStack (yyGLRStack* yystackp, size_t yyk)
+{
+ if (yystackp->yysplitPoint == NULL)
+ {
+ YYASSERT (yyk == 0);
+ yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
+ }
+ if (yystackp->yytops.yysize >= yystackp->yytops.yycapacity)
+ {
+ yyGLRState** yynewStates;
+ yybool* yynewLookaheadNeeds;
+
+ yynewStates = NULL;
+
+ if (yystackp->yytops.yycapacity
+ > (YYSIZEMAX / (2 * sizeof yynewStates[0])))
+ yyMemoryExhausted (yystackp);
+ yystackp->yytops.yycapacity *= 2;
+
+ yynewStates =
+ (yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
+ (yystackp->yytops.yycapacity
+ * sizeof yynewStates[0]));
+ if (yynewStates == NULL)
+ yyMemoryExhausted (yystackp);
+ yystackp->yytops.yystates = yynewStates;
+
+ yynewLookaheadNeeds =
+ (yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds,
+ (yystackp->yytops.yycapacity
+ * sizeof yynewLookaheadNeeds[0]));
+ if (yynewLookaheadNeeds == NULL)
+ yyMemoryExhausted (yystackp);
+ yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
+ }
+ yystackp->yytops.yystates[yystackp->yytops.yysize]
+ = yystackp->yytops.yystates[yyk];
+ yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize]
+ = yystackp->yytops.yylookaheadNeeds[yyk];
+ yystackp->yytops.yysize += 1;
+ return yystackp->yytops.yysize-1;
+}
+
+/** True iff Y0 and Y1 represent identical options at the top level.
+ * That is, they represent the same rule applied to RHS symbols
+ * that produce the same terminal symbols. */
+static yybool
+yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1)
+{
+ if (yyy0->yyrule == yyy1->yyrule)
+ {
+ yyGLRState *yys0, *yys1;
+ int yyn;
+ for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
+ yyn = yyrhsLength (yyy0->yyrule);
+ yyn > 0;
+ yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
+ if (yys0->yyposn != yys1->yyposn)
+ return yyfalse;
+ return yytrue;
+ }
+ else
+ return yyfalse;
+}
+
+/** Assuming identicalOptions (Y0,Y1), destructively merge the
+ * alternative semantic values for the RHS-symbols of Y1 and Y0. */
+static void
+yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
+{
+ yyGLRState *yys0, *yys1;
+ int yyn;
+ for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
+ yyn = yyrhsLength (yyy0->yyrule);
+ yyn > 0;
+ yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
+ {
+ if (yys0 == yys1)
+ break;
+ else if (yys0->yyresolved)
+ {
+ yys1->yyresolved = yytrue;
+ yys1->yysemantics.yysval = yys0->yysemantics.yysval;
+ }
+ else if (yys1->yyresolved)
+ {
+ yys0->yyresolved = yytrue;
+ yys0->yysemantics.yysval = yys1->yysemantics.yysval;
+ }
+ else
+ {
+ yySemanticOption** yyz0p;
+ yySemanticOption* yyz1;
+ yyz0p = &yys0->yysemantics.yyfirstVal;
+ yyz1 = yys1->yysemantics.yyfirstVal;
+ while (YYID (yytrue))
+ {
+ if (yyz1 == *yyz0p || yyz1 == NULL)
+ break;
+ else if (*yyz0p == NULL)
+ {
+ *yyz0p = yyz1;
+ break;
+ }
+ else if (*yyz0p < yyz1)
+ {
+ yySemanticOption* yyz = *yyz0p;
+ *yyz0p = yyz1;
+ yyz1 = yyz1->yynext;
+ (*yyz0p)->yynext = yyz;
+ }
+ yyz0p = &(*yyz0p)->yynext;
+ }
+ yys1->yysemantics.yyfirstVal = yys0->yysemantics.yyfirstVal;
+ }
+ }
+}
+
+/** Y0 and Y1 represent two possible actions to take in a given
+ * parsing state; return 0 if no combination is possible,
+ * 1 if user-mergeable, 2 if Y0 is preferred, 3 if Y1 is preferred. */
+static int
+yypreference (yySemanticOption* y0, yySemanticOption* y1)
+{
+ yyRuleNum r0 = y0->yyrule, r1 = y1->yyrule;
+ int p0 = yydprec[r0], p1 = yydprec[r1];
+
+ if (p0 == p1)
+ {
+ if (yymerger[r0] == 0 || yymerger[r0] != yymerger[r1])
+ return 0;
+ else
+ return 1;
+ }
+ if (p0 == 0 || p1 == 0)
+ return 0;
+ if (p0 < p1)
+ return 3;
+ if (p1 < p0)
+ return 2;
+ return 0;
+}
+
+static YYRESULTTAG yyresolveValue (yyGLRState* yys,
+ yyGLRStack* yystackp]b4_user_formals[);
+
+
+/** Resolve the previous N states starting at and including state S. If result
+ * != yyok, some states may have been left unresolved possibly with empty
+ * semantic option chains. Regardless of whether result = yyok, each state
+ * has been left with consistent data so that yydestroyGLRState can be invoked
+ * if necessary. */
+static YYRESULTTAG
+yyresolveStates (yyGLRState* yys, int yyn,
+ yyGLRStack* yystackp]b4_user_formals[)
+{
+ if (0 < yyn)
+ {
+ YYASSERT (yys->yypred);
+ YYCHK (yyresolveStates (yys->yypred, yyn-1, yystackp]b4_user_args[));
+ if (! yys->yyresolved)
+ YYCHK (yyresolveValue (yys, yystackp]b4_user_args[));
+ }
+ return yyok;
+}
+
+/** Resolve the states for the RHS of OPT, perform its user action, and return
+ * the semantic value and location. Regardless of whether result = yyok, all
+ * RHS states have been destroyed (assuming the user action destroys all RHS
+ * semantic values if invoked). */
+static YYRESULTTAG
+yyresolveAction (yySemanticOption* yyopt, yyGLRStack* yystackp,
+ YYSTYPE* yyvalp, YYLTYPE* yylocp]b4_user_formals[)
+{
+ yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
+ int yynrhs;
+ int yychar_current;
+ YYSTYPE yylval_current;
+ YYLTYPE yylloc_current;
+ YYRESULTTAG yyflag;
+
+ yynrhs = yyrhsLength (yyopt->yyrule);
+ yyflag = yyresolveStates (yyopt->yystate, yynrhs, yystackp]b4_user_args[);
+ if (yyflag != yyok)
+ {
+ yyGLRState *yys;
+ for (yys = yyopt->yystate; yynrhs > 0; yys = yys->yypred, yynrhs -= 1)
+ yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[);
+ return yyflag;
+ }
+
+ yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred = yyopt->yystate;]b4_locations_if([[
+ if (yynrhs == 0)
+ /* Set default location. */
+ yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yyopt->yystate->yyloc;]])[
+ yychar_current = yychar;
+ yylval_current = yylval;
+ yylloc_current = yylloc;
+ yychar = yyopt->yyrawchar;
+ yylval = yyopt->yyval;
+ yylloc = yyopt->yyloc;
+ yyflag = yyuserAction (yyopt->yyrule, yynrhs,
+ yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
+ yyvalp, yylocp, yystackp]b4_user_args[);
+ yychar = yychar_current;
+ yylval = yylval_current;
+ yylloc = yylloc_current;
+ return yyflag;
+}
+
+#if YYDEBUG
+static void
+yyreportTree (yySemanticOption* yyx, int yyindent)
+{
+ int yynrhs = yyrhsLength (yyx->yyrule);
+ int yyi;
+ yyGLRState* yys;
+ yyGLRState* yystates[1 + YYMAXRHS];
+ yyGLRState yyleftmost_state;
+
+ for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
+ yystates[yyi] = yys;
+ if (yys == NULL)
+ {
+ yyleftmost_state.yyposn = 0;
+ yystates[0] = &yyleftmost_state;
+ }
+ else
+ yystates[0] = yys;
+
+ if (yyx->yystate->yyposn < yys->yyposn + 1)
+ YYFPRINTF (stderr, "%*s%s -> <Rule %d, empty>\n",
+ yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
+ yyx->yyrule - 1);
+ else
+ YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n",
+ yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
+ yyx->yyrule - 1, (unsigned long int) (yys->yyposn + 1),
+ (unsigned long int) yyx->yystate->yyposn);
+ for (yyi = 1; yyi <= yynrhs; yyi += 1)
+ {
+ if (yystates[yyi]->yyresolved)
+ {
+ if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
+ YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
+ yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]));
+ else
+ YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
+ yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]),
+ (unsigned long int) (yystates[yyi - 1]->yyposn + 1),
+ (unsigned long int) yystates[yyi]->yyposn);
+ }
+ else
+ yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);
+ }
+}
+#endif
+
+/*ARGSUSED*/ static YYRESULTTAG
+yyreportAmbiguity (yySemanticOption* yyx0,
+ yySemanticOption* yyx1]b4_pure_formals[)
+{
+ YYUSE (yyx0);
+ YYUSE (yyx1);
+
+#if YYDEBUG
+ YYFPRINTF (stderr, "Ambiguity detected.\n");
+ YYFPRINTF (stderr, "Option 1,\n");
+ yyreportTree (yyx0, 2);
+ YYFPRINTF (stderr, "\nOption 2,\n");
+ yyreportTree (yyx1, 2);
+ YYFPRINTF (stderr, "\n");
+#endif
+
+ yyerror (]b4_yyerror_args[YY_("syntax is ambiguous"));
+ return yyabort;
+}
+
+/** Starting at and including state S1, resolve the location for each of the
+ * previous N1 states that is unresolved. The first semantic option of a state
+ * is always chosen. */
+static void
+yyresolveLocations (yyGLRState* yys1, int yyn1,
+ yyGLRStack *yystackp]b4_user_formals[)
+{
+ if (0 < yyn1)
+ {
+ yyresolveLocations (yys1->yypred, yyn1 - 1, yystackp]b4_user_args[);
+ if (!yys1->yyresolved)
+ {
+ yySemanticOption *yyoption;
+ yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
+ int yynrhs;
+ int yychar_current;
+ YYSTYPE yylval_current;
+ YYLTYPE yylloc_current;
+ yyoption = yys1->yysemantics.yyfirstVal;
+ YYASSERT (yyoption != NULL);
+ yynrhs = yyrhsLength (yyoption->yyrule);
+ if (yynrhs > 0)
+ {
+ yyGLRState *yys;
+ int yyn;
+ yyresolveLocations (yyoption->yystate, yynrhs,
+ yystackp]b4_user_args[);
+ for (yys = yyoption->yystate, yyn = yynrhs;
+ yyn > 0;
+ yys = yys->yypred, yyn -= 1)
+ yyrhsloc[yyn].yystate.yyloc = yys->yyloc;
+ }
+ else
+ {
+ /* Both yyresolveAction and yyresolveLocations traverse the GSS
+ in reverse rightmost order. It is only necessary to invoke
+ yyresolveLocations on a subforest for which yyresolveAction
+ would have been invoked next had an ambiguity not been
+ detected. Thus the location of the previous state (but not
+ necessarily the previous state itself) is guaranteed to be
+ resolved already. */
+ yyGLRState *yyprevious = yyoption->yystate;
+ yyrhsloc[0].yystate.yyloc = yyprevious->yyloc;
+ }
+ yychar_current = yychar;
+ yylval_current = yylval;
+ yylloc_current = yylloc;
+ yychar = yyoption->yyrawchar;
+ yylval = yyoption->yyval;
+ yylloc = yyoption->yyloc;
+ YYLLOC_DEFAULT ((yys1->yyloc), yyrhsloc, yynrhs);
+ yychar = yychar_current;
+ yylval = yylval_current;
+ yylloc = yylloc_current;
+ }
+ }
+}
+
+/** Resolve the ambiguity represented in state S, perform the indicated
+ * actions, and set the semantic value of S. If result != yyok, the chain of
+ * semantic options in S has been cleared instead or it has been left
+ * unmodified except that redundant options may have been removed. Regardless
+ * of whether result = yyok, S has been left with consistent data so that
+ * yydestroyGLRState can be invoked if necessary. */
+static YYRESULTTAG
+yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
+{
+ yySemanticOption* yyoptionList = yys->yysemantics.yyfirstVal;
+ yySemanticOption* yybest;
+ yySemanticOption** yypp;
+ yybool yymerge;
+ YYSTYPE yysval;
+ YYRESULTTAG yyflag;
+ YYLTYPE *yylocp = &yys->yyloc;
+
+ yybest = yyoptionList;
+ yymerge = yyfalse;
+ for (yypp = &yyoptionList->yynext; *yypp != NULL; )
+ {
+ yySemanticOption* yyp = *yypp;
+
+ if (yyidenticalOptions (yybest, yyp))
+ {
+ yymergeOptionSets (yybest, yyp);
+ *yypp = yyp->yynext;
+ }
+ else
+ {
+ switch (yypreference (yybest, yyp))
+ {
+ case 0:
+ yyresolveLocations (yys, 1, yystackp]b4_user_args[);
+ return yyreportAmbiguity (yybest, yyp]b4_pure_args[);
+ break;
+ case 1:
+ yymerge = yytrue;
+ break;
+ case 2:
+ break;
+ case 3:
+ yybest = yyp;
+ yymerge = yyfalse;
+ break;
+ default:
+ /* This cannot happen so it is not worth a YYASSERT (yyfalse),
+ but some compilers complain if the default case is
+ omitted. */
+ break;
+ }
+ yypp = &yyp->yynext;
+ }
+ }
+
+ if (yymerge)
+ {
+ yySemanticOption* yyp;
+ int yyprec = yydprec[yybest->yyrule];
+ yyflag = yyresolveAction (yybest, yystackp, &yysval,
+ yylocp]b4_user_args[);
+ if (yyflag == yyok)
+ for (yyp = yybest->yynext; yyp != NULL; yyp = yyp->yynext)
+ {
+ if (yyprec == yydprec[yyp->yyrule])
+ {
+ YYSTYPE yysval_other;
+ YYLTYPE yydummy;
+ yyflag = yyresolveAction (yyp, yystackp, &yysval_other,
+ &yydummy]b4_user_args[);
+ if (yyflag != yyok)
+ {
+ yydestruct ("Cleanup: discarding incompletely merged value for",
+ yystos[yys->yylrState],
+ &yysval]b4_locations_if([, yylocp])[]b4_user_args[);
+ break;
+ }
+ yyuserMerge (yymerger[yyp->yyrule], &yysval, &yysval_other);
+ }
+ }
+ }
+ else
+ yyflag = yyresolveAction (yybest, yystackp, &yysval, yylocp]b4_user_args[);
+
+ if (yyflag == yyok)
+ {
+ yys->yyresolved = yytrue;
+ yys->yysemantics.yysval = yysval;
+ }
+ else
+ yys->yysemantics.yyfirstVal = NULL;
+ return yyflag;
+}
+
+static YYRESULTTAG
+yyresolveStack (yyGLRStack* yystackp]b4_user_formals[)
+{
+ if (yystackp->yysplitPoint != NULL)
+ {
+ yyGLRState* yys;
+ int yyn;
+
+ for (yyn = 0, yys = yystackp->yytops.yystates[0];
+ yys != yystackp->yysplitPoint;
+ yys = yys->yypred, yyn += 1)
+ continue;
+ YYCHK (yyresolveStates (yystackp->yytops.yystates[0], yyn, yystackp
+ ]b4_user_args[));
+ }
+ return yyok;
+}
+
+static void
+yycompressStack (yyGLRStack* yystackp)
+{
+ yyGLRState* yyp, *yyq, *yyr;
+
+ if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == NULL)
+ return;
+
+ for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = NULL;
+ yyp != yystackp->yysplitPoint;
+ yyr = yyp, yyp = yyq, yyq = yyp->yypred)
+ yyp->yypred = yyr;
+
+ yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
+ yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1;
+ yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
+ yystackp->yysplitPoint = NULL;
+ yystackp->yylastDeleted = NULL;
+
+ while (yyr != NULL)
+ {
+ yystackp->yynextFree->yystate = *yyr;
+ yyr = yyr->yypred;
+ yystackp->yynextFree->yystate.yypred = &yystackp->yynextFree[-1].yystate;
+ yystackp->yytops.yystates[0] = &yystackp->yynextFree->yystate;
+ yystackp->yynextFree += 1;
+ yystackp->yyspaceLeft -= 1;
+ }
+}
+
+static YYRESULTTAG
+yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
+ size_t yyposn]b4_pure_formals[)
+{
+ int yyaction;
+ const short int* yyconflicts;
+ yyRuleNum yyrule;
+
+ while (yystackp->yytops.yystates[yyk] != NULL)
+ {
+ yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
+ YYDPRINTF ((stderr, "Stack %lu Entering state %d\n",
+ (unsigned long int) yyk, yystate));
+
+ YYASSERT (yystate != YYFINAL);
+
+ if (yyisDefaultedState (yystate))
+ {
+ yyrule = yydefaultAction (yystate);
+ if (yyrule == 0)
+ {
+ YYDPRINTF ((stderr, "Stack %lu dies.\n",
+ (unsigned long int) yyk));
+ yymarkStackDeleted (yystackp, yyk);
+ return yyok;
+ }
+ YYCHK (yyglrReduce (yystackp, yyk, yyrule, yyfalse]b4_user_args[));
+ }
+ else
+ {
+ yySymbol yytoken;
+ yystackp->yytops.yylookaheadNeeds[yyk] = yytrue;
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
+
+ while (*yyconflicts != 0)
+ {
+ size_t yynewStack = yysplitStack (yystackp, yyk);
+ YYDPRINTF ((stderr, "Splitting off stack %lu from %lu.\n",
+ (unsigned long int) yynewStack,
+ (unsigned long int) yyk));
+ YYCHK (yyglrReduce (yystackp, yynewStack,
+ *yyconflicts, yyfalse]b4_user_args[));
+ YYCHK (yyprocessOneStack (yystackp, yynewStack,
+ yyposn]b4_pure_args[));
+ yyconflicts += 1;
+ }
+
+ if (yyisShiftAction (yyaction))
+ break;
+ else if (yyisErrorAction (yyaction))
+ {
+ YYDPRINTF ((stderr, "Stack %lu dies.\n",
+ (unsigned long int) yyk));
+ yymarkStackDeleted (yystackp, yyk);
+ break;
+ }
+ else
+ YYCHK (yyglrReduce (yystackp, yyk, -yyaction,
+ yyfalse]b4_user_args[));
+ }
+ }
+ return yyok;
+}
+
+/*ARGSUSED*/ static void
+yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
+{
+ if (yystackp->yyerrState == 0)
+ {
+#if YYERROR_VERBOSE
+ int yyn;
+ yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
+ if (YYPACT_NINF < yyn && yyn <= YYLAST)
+ {
+ yySymbol yytoken = YYTRANSLATE (yychar);
+ size_t yysize0 = yytnamerr (NULL, yytokenName (yytoken));
+ size_t yysize = yysize0;
+ size_t yysize1;
+ yybool yysize_overflow = yyfalse;
+ char* yymsg = NULL;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytokenName (yytoken);
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytokenName (yyx);
+ yysize1 = yysize + yytnamerr (NULL, yytokenName (yyx));
+ yysize_overflow |= yysize1 < yysize;
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
+
+ yyf = YY_(yyformat);
+ yysize1 = yysize + strlen (yyf);
+ yysize_overflow |= yysize1 < yysize;
+ yysize = yysize1;
+
+ if (!yysize_overflow)
+ yymsg = (char *) YYMALLOC (yysize);
+
+ if (yymsg)
+ {
+ char *yyp = yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyf))
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ yyerror (]b4_lyyerror_args[yymsg);
+ YYFREE (yymsg);
+ }
+ else
+ {
+ yyerror (]b4_lyyerror_args[YY_("syntax error"));
+ yyMemoryExhausted (yystackp);
+ }
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror (]b4_lyyerror_args[YY_("syntax error"));
+ yynerrs += 1;
+ }
+}
+
+/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
+ yylval, and yylloc are the syntactic category, semantic value, and location
+ of the lookahead. */
+/*ARGSUSED*/ static void
+yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
+{
+ size_t yyk;
+ int yyj;
+
+ if (yystackp->yyerrState == 3)
+ /* We just shifted the error token and (perhaps) took some
+ reductions. Skip tokens until we can proceed. */
+ while (YYID (yytrue))
+ {
+ yySymbol yytoken;
+ if (yychar == YYEOF)
+ yyFail (yystackp][]b4_lpure_args[, NULL);
+ if (yychar != YYEMPTY)
+ {]b4_locations_if([[
+ /* We throw away the lookahead, but the error range
+ of the shifted error token must take it into account. */
+ yyGLRState *yys = yystackp->yytops.yystates[0];
+ yyGLRStackItem yyerror_range[3];
+ yyerror_range[1].yystate.yyloc = yys->yyloc;
+ yyerror_range[2].yystate.yyloc = yylloc;
+ YYLLOC_DEFAULT ((yys->yyloc), yyerror_range, 2);]])[
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Error: discarding",
+ yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);
+ }
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
+ yyj = yypact[yystackp->yytops.yystates[0]->yylrState];
+ if (yyis_pact_ninf (yyj))
+ return;
+ yyj += yytoken;
+ if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken)
+ {
+ if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0)
+ return;
+ }
+ else if (yytable[yyj] != 0 && ! yyis_table_ninf (yytable[yyj]))
+ return;
+ }
+
+ /* Reduce to one stack. */
+ for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
+ if (yystackp->yytops.yystates[yyk] != NULL)
+ break;
+ if (yyk >= yystackp->yytops.yysize)
+ yyFail (yystackp][]b4_lpure_args[, NULL);
+ for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
+ yymarkStackDeleted (yystackp, yyk);
+ yyremoveDeletes (yystackp);
+ yycompressStack (yystackp);
+
+ /* Now pop stack until we find a state that shifts the error token. */
+ yystackp->yyerrState = 3;
+ while (yystackp->yytops.yystates[0] != NULL)
+ {
+ yyGLRState *yys = yystackp->yytops.yystates[0];
+ yyj = yypact[yys->yylrState];
+ if (! yyis_pact_ninf (yyj))
+ {
+ yyj += YYTERROR;
+ if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR
+ && yyisShiftAction (yytable[yyj]))
+ {
+ /* Shift the error token having adjusted its location. */
+ YYLTYPE yyerrloc;]b4_locations_if([[
+ yystackp->yyerror_range[2].yystate.yyloc = yylloc;
+ YYLLOC_DEFAULT (yyerrloc, (yystackp->yyerror_range), 2);]])[
+ YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]],
+ &yylval, &yyerrloc);
+ yyglrShift (yystackp, 0, yytable[yyj],
+ yys->yyposn, &yylval, &yyerrloc);
+ yys = yystackp->yytops.yystates[0];
+ break;
+ }
+ }
+]b4_locations_if([[ yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;]])[
+ if (yys->yypred != NULL)
+ yydestroyGLRState ("Error: popping", yys]b4_user_args[);
+ yystackp->yytops.yystates[0] = yys->yypred;
+ yystackp->yynextFree -= 1;
+ yystackp->yyspaceLeft += 1;
+ }
+ if (yystackp->yytops.yystates[0] == NULL)
+ yyFail (yystackp][]b4_lpure_args[, NULL);
+}
+
+#define YYCHK1(YYE) \
+ do { \
+ switch (YYE) { \
+ case yyok: \
+ break; \
+ case yyabort: \
+ goto yyabortlab; \
+ case yyaccept: \
+ goto yyacceptlab; \
+ case yyerr: \
+ goto yyuser_error; \
+ default: \
+ goto yybuglab; \
+ } \
+ } while (YYID (0))
+
+
+/*----------.
+| yyparse. |
+`----------*/
+
+]b4_c_ansi_function_def([yyparse], [int], b4_parse_param)[
+{
+ int yyresult;
+ yyGLRStack yystack;
+ yyGLRStack* const yystackp = &yystack;
+ size_t yyposn;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yychar = YYEMPTY;
+ yylval = yyval_default;
+]b4_locations_if([
+#if YYLTYPE_IS_TRIVIAL
+ yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
+ yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
+#endif
+])
+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
+[
+ if (! yyinitGLRStack (yystackp, YYINITDEPTH))
+ goto yyexhaustedlab;
+ switch (YYSETJMP (yystack.yyexception_buffer))
+ {
+ case 0: break;
+ case 1: goto yyabortlab;
+ case 2: goto yyexhaustedlab;
+ default: goto yybuglab;
+ }
+ yyglrShift (&yystack, 0, 0, 0, &yylval, &yylloc);
+ yyposn = 0;
+
+ while (YYID (yytrue))
+ {
+ /* For efficiency, we have two loops, the first of which is
+ specialized to deterministic operation (single stack, no
+ potential ambiguity). */
+ /* Standard mode */
+ while (YYID (yytrue))
+ {
+ yyRuleNum yyrule;
+ int yyaction;
+ const short int* yyconflicts;
+
+ yyStateNum yystate = yystack.yytops.yystates[0]->yylrState;
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ if (yystate == YYFINAL)
+ goto yyacceptlab;
+ if (yyisDefaultedState (yystate))
+ {
+ yyrule = yydefaultAction (yystate);
+ if (yyrule == 0)
+ {
+]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[
+ yyreportSyntaxError (&yystack]b4_user_args[);
+ goto yyuser_error;
+ }
+ YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue]b4_user_args[));
+ }
+ else
+ {
+ yySymbol yytoken;
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
+ if (*yyconflicts != 0)
+ break;
+ if (yyisShiftAction (yyaction))
+ {
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+ yychar = YYEMPTY;
+ yyposn += 1;
+ yyglrShift (&yystack, 0, yyaction, yyposn, &yylval, &yylloc);
+ if (0 < yystack.yyerrState)
+ yystack.yyerrState -= 1;
+ }
+ else if (yyisErrorAction (yyaction))
+ {
+]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[
+ yyreportSyntaxError (&yystack]b4_user_args[);
+ goto yyuser_error;
+ }
+ else
+ YYCHK1 (yyglrReduce (&yystack, 0, -yyaction, yytrue]b4_user_args[));
+ }
+ }
+
+ while (YYID (yytrue))
+ {
+ yySymbol yytoken_to_shift;
+ size_t yys;
+
+ for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
+ yystackp->yytops.yylookaheadNeeds[yys] = yychar != YYEMPTY;
+
+ /* yyprocessOneStack returns one of three things:
+
+ - An error flag. If the caller is yyprocessOneStack, it
+ immediately returns as well. When the caller is finally
+ yyparse, it jumps to an error label via YYCHK1.
+
+ - yyok, but yyprocessOneStack has invoked yymarkStackDeleted
+ (&yystack, yys), which sets the top state of yys to NULL. Thus,
+ yyparse's following invocation of yyremoveDeletes will remove
+ the stack.
+
+ - yyok, when ready to shift a token.
+
+ Except in the first case, yyparse will invoke yyremoveDeletes and
+ then shift the next token onto all remaining stacks. This
+ synchronization of the shift (that is, after all preceding
+ reductions on all stacks) helps prevent double destructor calls
+ on yylval in the event of memory exhaustion. */
+
+ for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
+ YYCHK1 (yyprocessOneStack (&yystack, yys, yyposn]b4_lpure_args[));
+ yyremoveDeletes (&yystack);
+ if (yystack.yytops.yysize == 0)
+ {
+ yyundeleteLastStack (&yystack);
+ if (yystack.yytops.yysize == 0)
+ yyFail (&yystack][]b4_lpure_args[, YY_("syntax error"));
+ YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
+ YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
+]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[
+ yyreportSyntaxError (&yystack]b4_user_args[);
+ goto yyuser_error;
+ }
+
+ /* If any yyglrShift call fails, it will fail after shifting. Thus,
+ a copy of yylval will already be on stack 0 in the event of a
+ failure in the following loop. Thus, yychar is set to YYEMPTY
+ before the loop to make sure the user destructor for yylval isn't
+ called twice. */
+ yytoken_to_shift = YYTRANSLATE (yychar);
+ yychar = YYEMPTY;
+ yyposn += 1;
+ for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
+ {
+ int yyaction;
+ const short int* yyconflicts;
+ yyStateNum yystate = yystack.yytops.yystates[yys]->yylrState;
+ yygetLRActions (yystate, yytoken_to_shift, &yyaction,
+ &yyconflicts);
+ /* Note that yyconflicts were handled by yyprocessOneStack. */
+ YYDPRINTF ((stderr, "On stack %lu, ", (unsigned long int) yys));
+ YY_SYMBOL_PRINT ("shifting", yytoken_to_shift, &yylval, &yylloc);
+ yyglrShift (&yystack, yys, yyaction, yyposn,
+ &yylval, &yylloc);
+ YYDPRINTF ((stderr, "Stack %lu now in state #%d\n",
+ (unsigned long int) yys,
+ yystack.yytops.yystates[yys]->yylrState));
+ }
+
+ if (yystack.yytops.yysize == 1)
+ {
+ YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
+ YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
+ yycompressStack (&yystack);
+ break;
+ }
+ }
+ continue;
+ yyuser_error:
+ yyrecoverSyntaxError (&yystack]b4_user_args[);
+ yyposn = yystack.yytops.yystates[0]->yyposn;
+ }
+
+ yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+ yybuglab:
+ YYASSERT (yyfalse);
+ goto yyabortlab;
+
+ yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+ yyexhaustedlab:
+ yyerror (]b4_lyyerror_args[YY_("memory exhausted"));
+ yyresult = 2;
+ goto yyreturn;
+
+ yyreturn:
+ if (yychar != YYEMPTY)
+ yydestruct ("Cleanup: discarding lookahead",
+ YYTRANSLATE (yychar),
+ &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);
+
+ /* If the stack is well-formed, pop the stack until it is empty,
+ destroying its entries as we go. But free the stack regardless
+ of whether it is well-formed. */
+ if (yystack.yyitems)
+ {
+ yyGLRState** yystates = yystack.yytops.yystates;
+ if (yystates)
+ {
+ size_t yysize = yystack.yytops.yysize;
+ size_t yyk;
+ for (yyk = 0; yyk < yysize; yyk += 1)
+ if (yystates[yyk])
+ {
+ while (yystates[yyk])
+ {
+ yyGLRState *yys = yystates[yyk];
+]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]]
+)[ if (yys->yypred != NULL)
+ yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[);
+ yystates[yyk] = yys->yypred;
+ yystack.yynextFree -= 1;
+ yystack.yyspaceLeft += 1;
+ }
+ break;
+ }
+ }
+ yyfreeGLRStack (&yystack);
+ }
+
+ /* Make sure YYID is used. */
+ return YYID (yyresult);
+}
+
+/* DEBUGGING ONLY */
+#if YYDEBUG
+static void yypstack (yyGLRStack* yystackp, size_t yyk)
+ __attribute__ ((__unused__));
+static void yypdumpstack (yyGLRStack* yystackp) __attribute__ ((__unused__));
+
+static void
+yy_yypstack (yyGLRState* yys)
+{
+ if (yys->yypred)
+ {
+ yy_yypstack (yys->yypred);
+ YYFPRINTF (stderr, " -> ");
+ }
+ YYFPRINTF (stderr, "%d@@%lu", yys->yylrState,
+ (unsigned long int) yys->yyposn);
+}
+
+static void
+yypstates (yyGLRState* yyst)
+{
+ if (yyst == NULL)
+ YYFPRINTF (stderr, "<null>");
+ else
+ yy_yypstack (yyst);
+ YYFPRINTF (stderr, "\n");
+}
+
+static void
+yypstack (yyGLRStack* yystackp, size_t yyk)
+{
+ yypstates (yystackp->yytops.yystates[yyk]);
+}
+
+#define YYINDEX(YYX) \
+ ((YYX) == NULL ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
+
+
+static void
+yypdumpstack (yyGLRStack* yystackp)
+{
+ yyGLRStackItem* yyp;
+ size_t yyi;
+ for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1)
+ {
+ YYFPRINTF (stderr, "%3lu. ",
+ (unsigned long int) (yyp - yystackp->yyitems));
+ if (*(yybool *) yyp)
+ {
+ YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
+ yyp->yystate.yyresolved, yyp->yystate.yylrState,
+ (unsigned long int) yyp->yystate.yyposn,
+ (long int) YYINDEX (yyp->yystate.yypred));
+ if (! yyp->yystate.yyresolved)
+ YYFPRINTF (stderr, ", firstVal: %ld",
+ (long int) YYINDEX (yyp->yystate
+ .yysemantics.yyfirstVal));
+ }
+ else
+ {
+ YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
+ yyp->yyoption.yyrule - 1,
+ (long int) YYINDEX (yyp->yyoption.yystate),
+ (long int) YYINDEX (yyp->yyoption.yynext));
+ }
+ YYFPRINTF (stderr, "\n");
+ }
+ YYFPRINTF (stderr, "Tops:");
+ for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
+ YYFPRINTF (stderr, "%lu: %ld; ", (unsigned long int) yyi,
+ (long int) YYINDEX (yystackp->yytops.yystates[yyi]));
+ YYFPRINTF (stderr, "\n");
+}
+#endif
+]
+
+b4_epilogue
+dnl
+dnl glr.cc produces its own header.
+dnl
+m4_if(b4_skeleton, ["glr.c"],
+[b4_defines_if(
+[@output(b4_spec_defines_file@)
+b4_copyright([Skeleton interface for Bison GLR parsers in C],
+ [2002, 2003, 2004, 2005, 2006])
+
+b4_shared_declarations
+
+b4_pure_if([],
+[[extern YYSTYPE ]b4_prefix[lval;]])
+
+b4_locations_if([b4_pure_if([],
+[extern YYLTYPE ]b4_prefix[lloc;])
+])
+])])
+m4_divert_pop(0)
diff --git a/gnuwin32/share/bison/glr.cc b/gnuwin32/share/bison/glr.cc
new file mode 100644
index 00000000..ea04b28d
--- /dev/null
+++ b/gnuwin32/share/bison/glr.cc
@@ -0,0 +1,377 @@
+ -*- 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)
diff --git a/gnuwin32/share/bison/java-skel.m4 b/gnuwin32/share/bison/java-skel.m4
new file mode 100644
index 00000000..7c4aa109
--- /dev/null
+++ b/gnuwin32/share/bison/java-skel.m4
@@ -0,0 +1,25 @@
+ -*- Autoconf -*-
+
+# Java skeleton dispatching for Bison.
+# Copyright (C) 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/>.
+
+b4_glr_if( [b4_complain([%%glr-parser not supported for Java])])
+b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for Java])])
+
+m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.java]])
+m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
+
+m4_include(b4_used_skeleton)
diff --git a/gnuwin32/share/bison/java.m4 b/gnuwin32/share/bison/java.m4
new file mode 100644
index 00000000..b3dbd3b3
--- /dev/null
+++ b/gnuwin32/share/bison/java.m4
@@ -0,0 +1,303 @@
+ -*- Autoconf -*-
+
+# Java language support for Bison
+
+# 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/>.
+
+
+# b4_comment(TEXT)
+# ----------------
+m4_define([b4_comment], [/* m4_bpatsubst([$1], [
+], [
+ ]) */])
+
+
+# b4_list2(LIST1, LIST2)
+# --------------------------
+# Join two lists with a comma if necessary.
+m4_define([b4_list2],
+ [$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
+
+
+# b4_percent_define_get3(DEF, PRE, POST, NOT)
+# -------------------------------------------
+# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed,
+# otherwise NOT.
+m4_define([b4_percent_define_get3],
+ [m4_ifval(m4_quote(b4_percent_define_get([$1])),
+ [$2[]b4_percent_define_get([$1])[]$3], [$4])])
+
+
+
+# b4_flag_value(BOOLEAN-FLAG)
+# ---------------------------
+m4_define([b4_flag_value], [b4_flag_if([$1], [true], [false])])
+
+
+# b4_public_if(TRUE, FALSE)
+# -------------------------
+b4_percent_define_default([[public]], [[false]])
+m4_define([b4_public_if],
+[b4_percent_define_flag_if([public], [$1], [$2])])
+
+
+# b4_abstract_if(TRUE, FALSE)
+# ---------------------------
+b4_percent_define_default([[abstract]], [[false]])
+m4_define([b4_abstract_if],
+[b4_percent_define_flag_if([abstract], [$1], [$2])])
+
+
+# b4_final_if(TRUE, FALSE)
+# ---------------------------
+b4_percent_define_default([[final]], [[false]])
+m4_define([b4_final_if],
+[b4_percent_define_flag_if([final], [$1], [$2])])
+
+
+# b4_strictfp_if(TRUE, FALSE)
+# ---------------------------
+b4_percent_define_default([[strictfp]], [[false]])
+m4_define([b4_strictfp_if],
+[b4_percent_define_flag_if([strictfp], [$1], [$2])])
+
+
+# b4_lexer_if(TRUE, FALSE)
+# ------------------------
+m4_define([b4_lexer_if],
+[b4_percent_code_ifdef([[lexer]], [$1], [$2])])
+
+
+# b4_identification
+# -----------------
+m4_define([b4_identification],
+[ /** Version number for the Bison executable that generated this parser. */
+ public static final String bisonVersion = "b4_version";
+
+ /** Name of the skeleton that generated this parser. */
+ public static final String bisonSkeleton = b4_skeleton;
+])
+
+
+## ------------ ##
+## Data types. ##
+## ------------ ##
+
+# b4_int_type(MIN, MAX)
+# ---------------------
+# Return the smallest int type able to handle numbers ranging from
+# MIN to MAX (included).
+m4_define([b4_int_type],
+[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
+ b4_ints_in($@, [-32768], [32767]), [1], [short],
+ [int])])
+
+# b4_int_type_for(NAME)
+# ---------------------
+# Return the smallest int type able to handle numbers ranging from
+# `NAME_min' to `NAME_max' (included).
+m4_define([b4_int_type_for],
+[b4_int_type($1_min, $1_max)])
+
+# b4_null
+# -------
+m4_define([b4_null], [null])
+
+
+## ------------------------- ##
+## Assigning token numbers. ##
+## ------------------------- ##
+
+# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
+# ---------------------------------------
+# Output the definition of this token as an enum.
+m4_define([b4_token_enum],
+[ /** Token number, to be returned by the scanner. */
+ public static final int $1 = $2;
+])
+
+
+# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
+# -----------------------------------------------------
+# Output the definition of the tokens (if there are) as enums.
+m4_define([b4_token_enums],
+[m4_if([$#$1], [1], [],
+[/* Tokens. */
+m4_map([b4_token_enum], [$@])])
+])
+
+# b4-case(ID, CODE)
+# -----------------
+# We need to fool Java's stupid unreachable code detection.
+m4_define([b4_case], [ case $1:
+ if (yyn == $1)
+ $2;
+ break;
+ ])
+
+
+## ---------------- ##
+## Default values. ##
+## ---------------- ##
+
+m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
+b4_percent_define_default([[stype]], [[Object]])])
+
+# %name-prefix
+m4_define_default([b4_prefix], [[YY]])
+
+b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])])
+m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])])
+
+b4_percent_define_default([[lex_throws]], [[java.io.IOException]])])
+m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
+
+b4_percent_define_default([[throws]], [])])
+m4_define([b4_throws], [b4_percent_define_get([[throws]])])
+
+b4_percent_define_default([[location_type]], [Location])])
+m4_define([b4_location_type], [b4_percent_define_get([[location_type]])])
+
+b4_percent_define_default([[position_type]], [Position])])
+m4_define([b4_position_type], [b4_percent_define_get([[position_type]])])
+
+
+## ----------------- ##
+## Semantic Values. ##
+## ----------------- ##
+
+
+# b4_lhs_value([TYPE])
+# --------------------
+# Expansion of $<TYPE>$.
+m4_define([b4_lhs_value], [yyval])
+
+
+# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
+# --------------------------------------
+# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
+# symbols on RHS.
+#
+# In this simple implementation, %token and %type have class names
+# between the angle brackets.
+m4_define([b4_rhs_value],
+[(m4_ifval($3, [($3)])[](yystack.valueAt ($1-($2))))])
+
+# b4_lhs_location()
+# -----------------
+# Expansion of @$.
+m4_define([b4_lhs_location],
+[(yyloc)])
+
+
+# b4_rhs_location(RULE-LENGTH, NUM)
+# ---------------------------------
+# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
+# on RHS.
+m4_define([b4_rhs_location],
+[yystack.locationAt ($1-($2))])
+
+
+# b4_lex_param
+# b4_parse_param
+# --------------
+# If defined, b4_lex_param arrives double quoted, but below we prefer
+# it to be single quoted. Same for b4_parse_param.
+
+# TODO: should be in bison.m4
+m4_define_default([b4_lex_param], [[]]))
+m4_define([b4_lex_param], b4_lex_param))
+m4_define([b4_parse_param], b4_parse_param))
+
+# b4_lex_param_decl
+# -------------------
+# Extra formal arguments of the constructor.
+m4_define([b4_lex_param_decl],
+[m4_ifset([b4_lex_param],
+ [b4_remove_comma([$1],
+ b4_param_decls(b4_lex_param))],
+ [$1])])
+
+m4_define([b4_param_decls],
+ [m4_map([b4_param_decl], [$@])])
+m4_define([b4_param_decl], [, $1])
+
+m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
+
+
+
+# b4_parse_param_decl
+# -------------------
+# Extra formal arguments of the constructor.
+m4_define([b4_parse_param_decl],
+[m4_ifset([b4_parse_param],
+ [b4_remove_comma([$1],
+ b4_param_decls(b4_parse_param))],
+ [$1])])
+
+
+
+# b4_lex_param_call
+# -------------------
+# Delegating the lexer parameters to the lexer constructor.
+m4_define([b4_lex_param_call],
+ [m4_ifset([b4_lex_param],
+ [b4_remove_comma([$1],
+ b4_param_calls(b4_lex_param))],
+ [$1])])
+m4_define([b4_param_calls],
+ [m4_map([b4_param_call], [$@])])
+m4_define([b4_param_call], [, $2])
+
+
+
+# b4_parse_param_cons
+# -------------------
+# Extra initialisations of the constructor.
+m4_define([b4_parse_param_cons],
+ [m4_ifset([b4_parse_param],
+ [b4_constructor_calls(b4_parse_param)])])
+
+m4_define([b4_constructor_calls],
+ [m4_map([b4_constructor_call], [$@])])
+m4_define([b4_constructor_call],
+ [this.$2 = $2;
+ ])
+
+
+
+# b4_parse_param_vars
+# -------------------
+# Extra instance variables.
+m4_define([b4_parse_param_vars],
+ [m4_ifset([b4_parse_param],
+ [
+ /* User arguments. */
+b4_var_decls(b4_parse_param)])])
+
+m4_define([b4_var_decls],
+ [m4_map_sep([b4_var_decl], [
+], [$@])])
+m4_define([b4_var_decl],
+ [ protected final $1;])
+
+
+
+# b4_maybe_throws(THROWS)
+# -----------------------
+# Expand to either an empty string or "throws THROWS".
+m4_define([b4_maybe_throws],
+ [m4_ifval($1, [throws $1])])
diff --git a/gnuwin32/share/bison/lalr1.cc b/gnuwin32/share/bison/lalr1.cc
new file mode 100644
index 00000000..ca1dfccd
--- /dev/null
+++ b/gnuwin32/share/bison/lalr1.cc
@@ -0,0 +1,1157 @@
+# 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])
+
+m4_define([b4_parser_class_name],
+ [b4_percent_define_get([[parser_class_name]])])
+
+# The header is mandatory.
+b4_defines_if([],
+ [b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
+
+# Backward compatibility.
+m4_define([b4_location_constructors])
+m4_include(b4_pkgdatadir/[location.cc])
+
+# We do want M4 expansion after # for CPP macros.
+m4_changecom()
+m4_divert_push(0)dnl
+b4_defines_if(
+[@output(b4_spec_defines_file@)
+b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
+ [2002, 2003, 2004, 2005, 2006, 2007, 2008])
+dnl FIXME: This is wrong, we want computed header guards.
+[
+/* C++ LALR(1) parser skeleton written by Akim Demaille. */
+
+#ifndef PARSER_HEADER_H
+# define PARSER_HEADER_H
+
+]b4_percent_code_get([[requires]])[
+
+#include <string>
+#include <iostream>
+#include "stack.hh"
+
+]b4_namespace_open[
+ class position;
+ class location;
+]b4_namespace_close[
+
+#include "location.hh"
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG ]b4_debug_flag[
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE ]b4_error_verbose_flag[
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE ]b4_token_table[
+#endif
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+do { \
+ if (N) \
+ { \
+ (Current).begin = (Rhs)[1].begin; \
+ (Current).end = (Rhs)[N].end; \
+ } \
+ else \
+ { \
+ (Current).begin = (Current).end = (Rhs)[0].end; \
+ } \
+} while (false)
+#endif
+
+]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 ();
+
+#if YYDEBUG
+ /// 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);
+#endif
+
+ private:
+ /// 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);
+
+ /// Generate an error message.
+ /// \param state the state where the error occurred.
+ /// \param tok the lookahead token.
+ virtual std::string yysyntax_error_ (int yystate]dnl
+b4_error_verbose_if([, int tok])[);
+
+#if YYDEBUG
+ /// \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);
+#endif
+
+
+ /// State numbers.
+ typedef int state_type;
+ /// State stack type.
+ typedef stack<state_type> state_stack_type;
+ /// Semantic value stack type.
+ typedef stack<semantic_type> semantic_stack_type;
+ /// location stack type.
+ typedef stack<location_type> location_stack_type;
+
+ /// The state stack.
+ state_stack_type yystate_stack_;
+ /// The semantic value stack.
+ semantic_stack_type yysemantic_stack_;
+ /// The location stack.
+ location_stack_type yylocation_stack_;
+
+ /// Internal symbol numbers.
+ typedef ]b4_int_type_for([b4_translate])[ token_number_type;
+ /* Tables. */
+ /// For a state, the index in \a yytable_ of its portion.
+ static const ]b4_int_type_for([b4_pact])[ yypact_[];
+ static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_;
+
+ /// For a state, default rule to reduce.
+ /// Unless\a yytable_ specifies something else to do.
+ /// Zero means the default is an error.
+ static const ]b4_int_type_for([b4_defact])[ yydefact_[];
+
+ static const ]b4_int_type_for([b4_pgoto])[ yypgoto_[];
+ static const ]b4_int_type_for([b4_defgoto])[ yydefgoto_[];
+
+ /// What to do in a state.
+ /// \a yytable_[yypact_[s]]: what to do in state \a s.
+ /// - if positive, shift that token.
+ /// - if negative, reduce the rule which number is the opposite.
+ /// - if zero, do what YYDEFACT says.
+ static const ]b4_int_type_for([b4_table])[ yytable_[];
+ static const ]b4_int_type(b4_table_ninf, b4_table_ninf)[ yytable_ninf_;
+
+ static const ]b4_int_type_for([b4_check])[ yycheck_[];
+
+ /// For a state, its accessing symbol.
+ static const ]b4_int_type_for([b4_stos])[ yystos_[];
+
+ /// For a rule, its LHS.
+ static const ]b4_int_type_for([b4_r1])[ yyr1_[];
+ /// For a rule, its RHS length.
+ static const ]b4_int_type_for([b4_r2])[ yyr2_[];
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+ /// For a symbol, its name in clear.
+ static const char* const yytname_[];
+#endif
+
+#if YYERROR_VERBOSE
+ /// Convert the symbol name \a n to a form suitable for a diagnostic.
+ virtual std::string yytnamerr_ (const char *n);
+#endif
+
+#if YYDEBUG
+ /// A type to store symbol numbers and -1.
+ typedef ]b4_int_type_for([b4_rhs])[ rhs_number_type;
+ /// A `-1'-separated list of the rules' RHS.
+ static const rhs_number_type yyrhs_[];
+ /// For each rule, the index of the first RHS symbol in \a yyrhs_.
+ static const ]b4_int_type_for([b4_prhs])[ yyprhs_[];
+ /// For each rule, its source line number.
+ static const ]b4_int_type_for([b4_rline])[ yyrline_[];
+ /// For each scanner token number, its symbol number.
+ static const ]b4_int_type_for([b4_toknum])[ yytoken_number_[];
+ /// Report on the debug stream that the rule \a r is going to be reduced.
+ virtual void yy_reduce_print_ (int r);
+ /// Print the state stack on the debug stream.
+ virtual void yystack_print_ ();
+
+ /* Debugging. */
+ int yydebug_;
+ std::ostream* yycdebug_;
+#endif
+
+ /// Convert a scanner token number \a t to a symbol number.
+ token_number_type yytranslate_ (int t);
+
+ /// \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);
+
+ /// Pop \a n symbols the three stacks.
+ inline void yypop_ (unsigned int n = 1);
+
+ /* Constants. */
+ static const int yyeof_;
+ /* LAST_ -- Last index in TABLE_. */
+ static const int yylast_;
+ static const int yynnts_;
+ static const int yyempty_;
+ static const int yyfinal_;
+ static const int yyterror_;
+ static const int yyerrcode_;
+ static const int yyntokens_;
+ static const unsigned int yyuser_token_number_max_;
+ static const token_number_type yyundef_token_;
+]b4_parse_param_vars[
+ };
+]b4_namespace_close[
+
+]b4_percent_define_flag_if([[global_tokens_and_yystype]],
+[b4_token_defines(b4_tokens)
+
+#ifndef YYSTYPE
+ /* Redirection for backward compatibility. */
+# define YYSTYPE b4_namespace_ref::b4_parser_class_name::semantic_type
+#endif
+])
+b4_percent_code_get([[provides]])[]dnl
+
+[#endif /* ! defined PARSER_HEADER_H */]
+])dnl
+@output(b4_parser_file_name@)
+b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
+ [2002, 2003, 2004, 2005, 2006, 2007, 2008])
+b4_percent_code_get([[top]])[]dnl
+m4_if(b4_prefix, [yy], [],
+[
+// Take the name prefix into account.
+#define yylex b4_prefix[]lex])[
+
+/* First part of user declarations. */
+]b4_user_pre_prologue
+
+b4_defines_if([[
+#include "@basename(]b4_spec_defines_file[@)"]])[
+
+/* User implementation prologue. */
+]b4_user_post_prologue
+b4_percent_code_get[]dnl
+
+[#ifndef YY_
+# if YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# endif
+# endif
+# ifndef YY_
+# define YY_(msgid) msgid
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E. */
+#define YYUSE(e) ((void) (e))
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+/* A pseudo ostream that takes yydebug_ into account. */
+# define YYCDEBUG if (yydebug_) (*yycdebug_)
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug_) \
+ { \
+ *yycdebug_ << Title << ' '; \
+ yy_symbol_print_ ((Type), (Value), (Location)); \
+ *yycdebug_ << std::endl; \
+ } \
+} while (false)
+
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug_) \
+ yy_reduce_print_ (Rule); \
+} while (false)
+
+# define YY_STACK_PRINT() \
+do { \
+ if (yydebug_) \
+ yystack_print_ (); \
+} while (false)
+
+#else /* !YYDEBUG */
+
+# define YYCDEBUG if (false) std::cerr
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_REDUCE_PRINT(Rule)
+# define YY_STACK_PRINT()
+
+#endif /* !YYDEBUG */
+
+#define yyerrok (yyerrstatus_ = 0)
+#define yyclearin (yychar = yyempty_)
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+#define YYRECOVERING() (!!yyerrstatus_)
+
+]b4_namespace_open[
+#if YYERROR_VERBOSE
+
+ /* 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. */
+ std::string
+ ]b4_parser_class_name[::yytnamerr_ (const char *yystr)
+ {
+ if (*yystr == '"')
+ {
+ std::string yyr = "";
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ yyr += *yyp;
+ break;
+
+ case '"':
+ return yyr;
+ }
+ do_not_strip_quotes: ;
+ }
+
+ return yystr;
+ }
+
+#endif
+
+ /// 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[ ()
+ {
+ }
+
+#if YYDEBUG
+ /*--------------------------------.
+ | Print this symbol on YYOUTPUT. |
+ `--------------------------------*/
+
+ inline void
+ ]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
+ const semantic_type* yyvaluep, const location_type* yylocationp)
+ {
+ YYUSE (yylocationp);
+ YYUSE (yyvaluep);
+ 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_ << ')';
+ }
+#endif
+
+ void
+ ]b4_parser_class_name[::yydestruct_ (const char* yymsg,
+ int yytype, semantic_type* yyvaluep, location_type* yylocationp)
+ {
+ YYUSE (yylocationp);
+ YYUSE (yymsg);
+ YYUSE (yyvaluep);
+
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+ switch (yytype)
+ {
+ ]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
+ default:
+ break;
+ }
+ }
+
+ void
+ ]b4_parser_class_name[::yypop_ (unsigned int n)
+ {
+ yystate_stack_.pop (n);
+ yysemantic_stack_.pop (n);
+ yylocation_stack_.pop (n);
+ }
+
+#if YYDEBUG
+ 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
+
+ int
+ ]b4_parser_class_name[::parse ()
+ {
+ /// Lookahead and lookahead in internal form.
+ int yychar = yyempty_;
+ int yytoken = 0;
+
+ /* State. */
+ int yyn;
+ int yylen = 0;
+ int yystate = 0;
+
+ /* Error handling. */
+ int yynerrs_ = 0;
+ int yyerrstatus_ = 0;
+
+ /// Semantic value of the lookahead.
+ semantic_type yylval;
+ /// Location of the lookahead.
+ location_type yylloc;
+ /// The locations where the error started and ended.
+ location_type yyerror_range[2];
+
+ /// $$.
+ semantic_type yyval;
+ /// @@$.
+ location_type yyloc;
+
+ int yyresult;
+
+ YYCDEBUG << "Starting parse" << std::endl;
+
+]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 stacks. The initial state will be pushed in
+ yynewstate, since the latter expects the semantical and the
+ location values to have been already stored, initialize these
+ stacks with a primary value. */
+ yystate_stack_ = state_stack_type (0);
+ yysemantic_stack_ = semantic_stack_type (0);
+ yylocation_stack_ = location_stack_type (0);
+ yysemantic_stack_.push (yylval);
+ yylocation_stack_.push (yylloc);
+
+ /* New state. */
+ yynewstate:
+ yystate_stack_.push (yystate);
+ YYCDEBUG << "Entering state " << yystate << std::endl;
+
+ /* Accept? */
+ if (yystate == yyfinal_)
+ goto yyacceptlab;
+
+ goto yybackup;
+
+ /* Backup. */
+ yybackup:
+
+ /* Try to take a decision without lookahead. */
+ yyn = yypact_[yystate];
+ if (yyn == yypact_ninf_)
+ goto yydefault;
+
+ /* Read a lookahead token. */
+ if (yychar == yyempty_)
+ {
+ YYCDEBUG << "Reading a token: ";
+ yychar = ]b4_c_function_call([yylex], [int],
+ [[YYSTYPE*], [&yylval]][]dnl
+b4_locations_if([, [[location*], [&yylloc]]])dnl
+m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
+ }
+
+
+ /* Convert token to internal form. */
+ if (yychar <= yyeof_)
+ {
+ yychar = yytoken = yyeof_;
+ YYCDEBUG << "Now at end of input." << std::endl;
+ }
+ else
+ {
+ yytoken = yytranslate_ (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &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)
+ goto yydefault;
+
+ /* Reduce or error. */
+ yyn = yytable_[yyn];
+ if (yyn <= 0)
+ {
+ if (yyn == 0 || yyn == yytable_ninf_)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ /* Shift the lookahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the token being shifted. */
+ yychar = yyempty_;
+
+ yysemantic_stack_.push (yylval);
+ yylocation_stack_.push (yylloc);
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus_)
+ --yyerrstatus_;
+
+ yystate = yyn;
+ goto yynewstate;
+
+ /*-----------------------------------------------------------.
+ | yydefault -- do the default action for the current state. |
+ `-----------------------------------------------------------*/
+ yydefault:
+ yyn = yydefact_[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+ /*-----------------------------.
+ | yyreduce -- Do a reduction. |
+ `-----------------------------*/
+ yyreduce:
+ yylen = yyr2_[yyn];
+ /* 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)
+ yyval = yysemantic_stack_[yylen - 1];
+ else
+ yyval = yysemantic_stack_[0];
+
+ {
+ slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);
+ YYLLOC_DEFAULT (yyloc, slice, yylen);
+ }
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ ]b4_user_actions[
+ default:
+ break;
+ }
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
+
+ yypop_ (yylen);
+ yylen = 0;
+ YY_STACK_PRINT ();
+
+ yysemantic_stack_.push (yyval);
+ yylocation_stack_.push (yyloc);
+
+ /* Shift the result of the reduction. */
+ yyn = yyr1_[yyn];
+ yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
+ if (0 <= yystate && yystate <= yylast_
+ && yycheck_[yystate] == yystate_stack_[0])
+ yystate = yytable_[yystate];
+ else
+ yystate = yydefgoto_[yyn - yyntokens_];
+ goto yynewstate;
+
+ /*------------------------------------.
+ | yyerrlab -- here on detecting error |
+ `------------------------------------*/
+ yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus_)
+ {
+ ++yynerrs_;
+ error (yylloc, yysyntax_error_ (yystate]dnl
+b4_error_verbose_if([, yytoken])[));
+ }
+
+ yyerror_range[0] = yylloc;
+ if (yyerrstatus_ == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ if (yychar <= yyeof_)
+ {
+ /* Return failure if at end of input. */
+ if (yychar == yyeof_)
+ YYABORT;
+ }
+ else
+ {
+ yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
+ yychar = yyempty_;
+ }
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+ goto yyerrlab1;
+
+
+ /*---------------------------------------------------.
+ | yyerrorlab -- error raised explicitly by YYERROR. |
+ `---------------------------------------------------*/
+ yyerrorlab:
+
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (false)
+ goto yyerrorlab;
+
+ yyerror_range[0] = yylocation_stack_[yylen - 1];
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYERROR. */
+ yypop_ (yylen);
+ yylen = 0;
+ yystate = yystate_stack_[0];
+ goto yyerrlab1;
+
+ /*-------------------------------------------------------------.
+ | yyerrlab1 -- common code for both syntax error and YYERROR. |
+ `-------------------------------------------------------------*/
+ 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 (yystate_stack_.height () == 1)
+ YYABORT;
+
+ yyerror_range[0] = yylocation_stack_[0];
+ yydestruct_ ("Error: popping",
+ yystos_[yystate],
+ &yysemantic_stack_[0], &yylocation_stack_[0]);
+ yypop_ ();
+ yystate = yystate_stack_[0];
+ YY_STACK_PRINT ();
+ }
+
+ yyerror_range[1] = yylloc;
+ // Using YYLLOC is tempting, but would change the location of
+ // the lookahead. YYLOC is available though.
+ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+ yysemantic_stack_.push (yylval);
+ yylocation_stack_.push (yyloc);
+
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
+ &yysemantic_stack_[0], &yylocation_stack_[0]);
+
+ yystate = yyn;
+ goto yynewstate;
+
+ /* Accept. */
+ yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+ /* Abort. */
+ yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+ yyreturn:
+ if (yychar != yyempty_)
+ yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
+
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYABORT or YYACCEPT. */
+ yypop_ (yylen);
+ while (yystate_stack_.height () != 1)
+ {
+ yydestruct_ ("Cleanup: popping",
+ yystos_[yystate_stack_[0]],
+ &yysemantic_stack_[0],
+ &yylocation_stack_[0]);
+ yypop_ ();
+ }
+
+ return yyresult;
+ }
+
+ // Generate an error message.
+ std::string
+ ]b4_parser_class_name[::yysyntax_error_ (int yystate]dnl
+b4_error_verbose_if([, int tok])[)
+ {
+ std::string res;
+ YYUSE (yystate);
+#if YYERROR_VERBOSE
+ int yyn = yypact_[yystate];
+ if (yypact_ninf_ < yyn && yyn <= yylast_)
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = yylast_ - yyn + 1;
+ int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
+ int count = 0;
+ for (int x = yyxbegin; x < yyxend; ++x)
+ if (yycheck_[x + yyn] == x && x != yyterror_)
+ ++count;
+
+ // FIXME: This method of building the message is not compatible
+ // with internationalization. It should work like yacc.c does it.
+ // That is, first build a string that looks like this:
+ // "syntax error, unexpected %s or %s or %s"
+ // Then, invoke YY_ on this string.
+ // Finally, use the string as a format to output
+ // yytname_[tok], etc.
+ // Until this gets fixed, this message appears in English only.
+ res = "syntax error, unexpected ";
+ res += yytnamerr_ (yytname_[tok]);
+ if (count < 5)
+ {
+ count = 0;
+ for (int x = yyxbegin; x < yyxend; ++x)
+ if (yycheck_[x + yyn] == x && x != yyterror_)
+ {
+ res += (!count++) ? ", expecting " : " or ";
+ res += yytnamerr_ (yytname_[x]);
+ }
+ }
+ }
+ else
+#endif
+ res = YY_("syntax error");
+ return res;
+ }
+
+
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+ const ]b4_int_type(b4_pact_ninf, b4_pact_ninf) b4_parser_class_name::yypact_ninf_ = b4_pact_ninf[;
+ const ]b4_int_type_for([b4_pact])[
+ ]b4_parser_class_name[::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. */
+ const ]b4_int_type_for([b4_defact])[
+ ]b4_parser_class_name[::yydefact_[] =
+ {
+ ]b4_defact[
+ };
+
+ /* YYPGOTO[NTERM-NUM]. */
+ const ]b4_int_type_for([b4_pgoto])[
+ ]b4_parser_class_name[::yypgoto_[] =
+ {
+ ]b4_pgoto[
+ };
+
+ /* YYDEFGOTO[NTERM-NUM]. */
+ const ]b4_int_type_for([b4_defgoto])[
+ ]b4_parser_class_name[::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. */
+ const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[;
+ const ]b4_int_type_for([b4_table])[
+ ]b4_parser_class_name[::yytable_[] =
+ {
+ ]b4_table[
+ };
+
+ /* YYCHECK. */
+ const ]b4_int_type_for([b4_check])[
+ ]b4_parser_class_name[::yycheck_[] =
+ {
+ ]b4_check[
+ };
+
+ /* STOS_[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+ const ]b4_int_type_for([b4_stos])[
+ ]b4_parser_class_name[::yystos_[] =
+ {
+ ]b4_stos[
+ };
+
+#if YYDEBUG
+ /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
+ to YYLEX-NUM. */
+ const ]b4_int_type_for([b4_toknum])[
+ ]b4_parser_class_name[::yytoken_number_[] =
+ {
+ ]b4_toknum[
+ };
+#endif
+
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+ const ]b4_int_type_for([b4_r1])[
+ ]b4_parser_class_name[::yyr1_[] =
+ {
+ ]b4_r1[
+ };
+
+ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+ const ]b4_int_type_for([b4_r2])[
+ ]b4_parser_class_name[::yyr2_[] =
+ {
+ ]b4_r2[
+ };
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+ /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at \a yyntokens_, nonterminals. */
+ const char*
+ const ]b4_parser_class_name[::yytname_[] =
+ {
+ ]b4_tname[
+ };
+#endif
+
+#if YYDEBUG
+ /* YYRHS -- A `-1'-separated list of the rules' RHS. */
+ const ]b4_parser_class_name[::rhs_number_type
+ ]b4_parser_class_name[::yyrhs_[] =
+ {
+ ]b4_rhs[
+ };
+
+ /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+ const ]b4_int_type_for([b4_prhs])[
+ ]b4_parser_class_name[::yyprhs_[] =
+ {
+ ]b4_prhs[
+ };
+
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+ const ]b4_int_type_for([b4_rline])[
+ ]b4_parser_class_name[::yyrline_[] =
+ {
+ ]b4_rline[
+ };
+
+ // Print the state stack on the debug stream.
+ void
+ ]b4_parser_class_name[::yystack_print_ ()
+ {
+ *yycdebug_ << "Stack now";
+ for (state_stack_type::const_iterator i = yystate_stack_.begin ();
+ i != yystate_stack_.end (); ++i)
+ *yycdebug_ << ' ' << *i;
+ *yycdebug_ << std::endl;
+ }
+
+ // Report on the debug stream that the rule \a yyrule is going to be reduced.
+ void
+ ]b4_parser_class_name[::yy_reduce_print_ (int yyrule)
+ {
+ unsigned 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 << "):" << std::endl;
+ /* 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_rhs_location(yynrhs, yyi + 1)[);
+ }
+#endif // YYDEBUG
+
+ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+ ]b4_parser_class_name[::token_number_type
+ ]b4_parser_class_name[::yytranslate_ (int t)
+ {
+ static
+ const token_number_type
+ translate_table[] =
+ {
+ ]b4_translate[
+ };
+ if ((unsigned int) t <= yyuser_token_number_max_)
+ return translate_table[t];
+ else
+ return yyundef_token_;
+ }
+
+ const int ]b4_parser_class_name[::yyeof_ = 0;
+ const int ]b4_parser_class_name[::yylast_ = ]b4_last[;
+ const int ]b4_parser_class_name[::yynnts_ = ]b4_nterms_number[;
+ const int ]b4_parser_class_name[::yyempty_ = -2;
+ const int ]b4_parser_class_name[::yyfinal_ = ]b4_final_state_number[;
+ const int ]b4_parser_class_name[::yyterror_ = 1;
+ const int ]b4_parser_class_name[::yyerrcode_ = 256;
+ const int ]b4_parser_class_name[::yyntokens_ = ]b4_tokens_number[;
+
+ const unsigned int ]b4_parser_class_name[::yyuser_token_number_max_ = ]b4_user_token_number_max[;
+ const ]b4_parser_class_name[::token_number_type ]b4_parser_class_name[::yyundef_token_ = ]b4_undef_token_number[;
+
+]b4_namespace_close[
+
+]b4_epilogue
+dnl
+@output(b4_dir_prefix[]stack.hh@)
+b4_copyright([Stack handling for Bison parsers in C++],
+ [2002, 2003, 2004, 2005, 2006, 2007, 2008])[
+
+#ifndef BISON_STACK_HH
+# define BISON_STACK_HH
+
+#include <deque>
+
+]b4_namespace_open[
+ template <class T, class S = std::deque<T> >
+ class stack
+ {
+ public:
+
+ // Hide our reversed order.
+ typedef typename S::reverse_iterator iterator;
+ typedef typename S::const_reverse_iterator const_iterator;
+
+ stack () : seq_ ()
+ {
+ }
+
+ stack (unsigned int n) : seq_ (n)
+ {
+ }
+
+ inline
+ T&
+ operator [] (unsigned int i)
+ {
+ return seq_[i];
+ }
+
+ inline
+ const T&
+ operator [] (unsigned int i) const
+ {
+ return seq_[i];
+ }
+
+ inline
+ void
+ push (const T& t)
+ {
+ seq_.push_front (t);
+ }
+
+ inline
+ void
+ pop (unsigned int n = 1)
+ {
+ for (; n; --n)
+ seq_.pop_front ();
+ }
+
+ inline
+ unsigned int
+ height () const
+ {
+ return seq_.size ();
+ }
+
+ inline const_iterator begin () const { return seq_.rbegin (); }
+ inline const_iterator end () const { return seq_.rend (); }
+
+ private:
+
+ S seq_;
+ };
+
+ /// Present a slice of the top of a stack.
+ template <class T, class S = stack<T> >
+ class slice
+ {
+ public:
+
+ slice (const S& stack,
+ unsigned int range) : stack_ (stack),
+ range_ (range)
+ {
+ }
+
+ inline
+ const T&
+ operator [] (unsigned int i) const
+ {
+ return stack_[range_ - i];
+ }
+
+ private:
+
+ const S& stack_;
+ unsigned int range_;
+ };
+]b4_namespace_close[
+
+#endif // not BISON_STACK_HH[]dnl
+]
+m4_divert_pop(0)
diff --git a/gnuwin32/share/bison/lalr1.java b/gnuwin32/share/bison/lalr1.java
new file mode 100644
index 00000000..7e220d98
--- /dev/null
+++ b/gnuwin32/share/bison/lalr1.java
@@ -0,0 +1,880 @@
+# 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
diff --git a/gnuwin32/share/bison/location.cc b/gnuwin32/share/bison/location.cc
new file mode 100644
index 00000000..4b79069f
--- /dev/null
+++ b/gnuwin32/share/bison/location.cc
@@ -0,0 +1,275 @@
+# 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([#])
diff --git a/gnuwin32/share/bison/m4sugar/foreach.m4 b/gnuwin32/share/bison/m4sugar/foreach.m4
new file mode 100644
index 00000000..cd4d1fc8
--- /dev/null
+++ b/gnuwin32/share/bison/m4sugar/foreach.m4
@@ -0,0 +1,400 @@
+# -*- Autoconf -*-
+# This file is part of Autoconf.
+# foreach-based replacements for recursive functions.
+# 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
+# (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/>.
+
+# 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
+# iteration will scan n * (n + 1) / 2 arguments, for O(n^2) time. In
+# M4 1.6, this was fixed so that $@ is only scanned once, then
+# back-references are made to information stored about the scan.
+# Thus, n iterations need only scan n arguments, for O(n) time.
+# Additionally, in M4 1.4.x, recursive algorithms did not clean up
+# memory very well, requiring O(n^2) memory rather than O(n) for n
+# iterations.
+#
+# This file is designed to overcome the quadratic nature of $@
+# recursion by writing a variant of m4_foreach that uses m4_for rather
+# than $@ recursion to operate on the list. This involves more macro
+# expansions, but avoids the need to rescan a quadratic number of
+# arguments, making these replacements very attractive for M4 1.4.x.
+# On the other hand, in any version of M4, expanding additional macros
+# costs additional time; therefore, in M4 1.6, where $@ recursion uses
+# fewer macros, these replacements actually pessimize performance.
+# Additionally, the use of $10 to mean the tenth argument violates
+# POSIX; although all versions of m4 1.4.x support this meaning, a
+# future m4 version may switch to take it as the first argument
+# concatenated with a literal 0, so the implementations in this file
+# are not future-proof. Thus, this file is conditionally included as
+# part of m4_init(), only when it is detected that M4 probably has
+# quadratic behavior (ie. it lacks the macro __m4_version__).
+#
+# 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.
+#
+# 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)])])
+
+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_define([_m4_foreach_],
+[[m4_define([$$1], [$$3])$$2[]]])
+
+# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT)
+# -----------------------------------------------------------
+# Find the first VAL that SWITCH matches, and expand the corresponding
+# IF-VAL. If there are no matches, expand DEFAULT.
+#
+# Use m4_for to create a temporary macro in terms of a boilerplate
+# m4_if with final cleanup. If $# is even, we have DEFAULT; if it is
+# odd, then rounding the last $# up in the temporary macro is
+# harmless. For example, both m4_case(1,2,3,4,5) and
+# m4_case(1,2,3,4,5,6) result in the intermediate _m4_case being
+# 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(
+ [_$0])]m4_dquote($m4_eval([($# + 1) & ~1]))[)])_$0($@)])])
+
+m4_define([_m4_case_],
+[[[$$1],[$$2],[$$3],]])
+
+# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
+# -----------------------------------------------------
+# m4 equivalent of
+#
+# if (SWITCH =~ RE1)
+# VAL1;
+# elif (SWITCH =~ RE2)
+# VAL2;
+# elif ...
+# ...
+# else
+# DEFAULT
+#
+# We build the temporary macro _m4_b:
+# m4_define([_m4_b], _m4_defn([_m4_bmatch]))_m4_b([$1], [$2], [$3])...
+# _m4_b([$1], [$m-1], [$m])_m4_b([], [], [$m+1]_m4_popdef([_m4_b]))
+# then invoke m4_unquote(_m4_b($@)), for concatenation with later text.
+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_define([_m4_bmatch],
+[m4_if(m4_bregexp([$1], [$2]), [-1], [], [[$3]m4_define([$0])])])
+
+m4_define([_m4_bmatch_],
+[[_m4_b([$$1], [$$2], [$$3])]])
+
+
+# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT])
+# -------------------------------------------------------------------
+# Similar to m4_if, except that each TEST is expanded when encountered.
+# If the expansion of TESTn matches the string VALn, the result is IF-VALn.
+# The result is DEFAULT if no tests passed. This macro allows
+# short-circuiting of expensive tests, where it pays to arrange quick
+# filter tests to run first.
+#
+# m4_cond already guarantees either 3*n or 3*n + 1 arguments, 1 <= n.
+# We only have to speed up _m4_cond, by building the temporary _m4_c:
+# m4_define([_m4_c], _m4_defn([m4_unquote]))_m4_c([m4_if(($1), [($2)],
+# [[$3]m4_define([_m4_c])])])_m4_c([m4_if(($4), [($5)],
+# [[$6]m4_define([_m4_c])])])..._m4_c([m4_if(($m-2), [($m-1)],
+# [[$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_eval([$# / 3 * 3 + 1])))[_m4_popdef([_m4_c]))])m4_unquote(_m4_c($@))])
+
+m4_define([_m4_cond_],
+[[_m4_c([m4_if(($$1), [($$2)], [[$$3]m4_define([_m4_c])])])]])
+
+# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
+# ----------------------------------------------------
+# m4 equivalent of
+#
+# $_ = STRING;
+# s/RE1/SUBST1/g;
+# s/RE2/SUBST2/g;
+# ...
+#
+# m4_bpatsubsts already validated an odd number of arguments; we only
+# need to speed up _m4_bpatsubsts. To avoid nesting, we build the
+# temporary _m4_p:
+# m4_define([_m4_p], [$1])m4_define([_m4_p],
+# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$2], [$3]))m4_define([_m4_p],
+# m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$4], [$5]))m4_define([_m4_p],...
+# 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_define([_m4_bpatsubsts_],
+[[m4_define([_m4_p],
+m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$$1], [$$2]))]])
+
+# m4_shiftn(N, ...)
+# -----------------
+# Returns ... shifted N times. Useful for recursive "varargs" constructs.
+#
+# m4_shiftn already validated arguments; we only need to speed up
+# _m4_shiftn. If N is 3, then we build the temporary _m4_s, defined as
+# ,[$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_do(STRING, ...)
+# ------------------
+# This macro invokes all its arguments (in sequence, of course). It is
+# useful for making your macros more structured and readable by dropping
+# unnecessary dnl's and have the macros indented properly.
+#
+# Here, we use the temporary macro _m4_do, defined as
+# $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_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_define([m4_dquote_elt],
+[m4_shift(m4_foreach([_m4_elt], [$@], [,m4_dquote(_m4_defn([_m4_elt]))]))])
+
+# m4_reverse(ARGS)
+# ----------------
+# Output ARGS in reverse order.
+#
+# Invoke _m4_r($@) with the temporary _m4_r built as
+# [$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_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...)
+# --------------------------------------------------------------
+# 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])
+# 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],
+[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(
+ [1], [2], [$#])[_m4_popdef([_$0])])_$0($@)])])
+
+m4_define([_m4_transform_pair_],
+[[$$1([$$2], [$$3])[]]])
+
+m4_define([_m4_transform_pair_end],
+[m4_if(m4_eval([$3 & 1]), [1], [[m4_default([$$2], [$$1])([$$3])[]]])])
+
+# m4_join(SEP, ARG1, ARG2...)
+# ---------------------------
+# Produce ARG1SEPARG2...SEPARGn. Avoid back-to-back SEP when a given ARG
+# is the empty string. No expansion is performed on SEP or ARGs.
+#
+# 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.
+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_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.
+m4_define([m4_joinall],
+[[$2]m4_if(m4_eval([$# <= 2]), [1], [],
+ [m4_foreach([_m4_arg], [m4_shift2($@)],
+ [[$1]_m4_defn([_m4_arg])])])])
+
+# m4_list_cmp(A, B)
+# -----------------
+# Compare the two lists of integer expressions A and B.
+#
+# m4_list_cmp takes care of any side effects; we only override
+# _m4_list_cmp_raw, where we can safely expand lists multiple times.
+# First, insert padding so that both lists are the same length; the
+# trailing +0 is necessary to handle a missing list. Next, create a
+# temporary macro to perform pairwise comparisons until an inequality
+# 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])
+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_define([_m4_list_pad],
+[m4_if(m4_eval($1 < $2), [1],
+ [_m4_for([_m4_size], 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_define([_m4_list_cmp_],
+[[m4_eval([($$1) != ($$2)]), [1], [m4_cmp([$$1], [$$2])],
+]])
+
+# m4_max(EXPR, ...)
+# m4_min(EXPR, ...)
+# -----------------
+# 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,
+# 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_best[]_m4_popdef([_m4_best])])
+
+# m4_set_add_all(SET, VALUE...)
+# -----------------------------
+# 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_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]))-])]])))))])])
diff --git a/gnuwin32/share/bison/m4sugar/m4sugar.m4 b/gnuwin32/share/bison/m4sugar/m4sugar.m4
new file mode 100644
index 00000000..6fbd3431
--- /dev/null
+++ b/gnuwin32/share/bison/m4sugar/m4sugar.m4
@@ -0,0 +1,2789 @@
+divert(-1)# -*- Autoconf -*-
+# This file is part of Autoconf.
+# Base M4 layer.
+# Requires GNU M4.
+#
+# Copyright (C) 1999, 2000, 2001, 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/>.
+
+# 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 Akim Demaille.
+#
+
+# Set the quotes, whatever the current quoting system.
+changequote()
+changequote([, ])
+
+# Some old m4's don't support m4exit. But they provide
+# equivalent functionality by core dumping because of the
+# long macros we define.
+ifdef([__gnu__], ,
+[errprint(M4sugar requires GNU M4. Install it before installing M4sugar or
+set the M4 environment variable to its absolute file name.)
+m4exit(2)])
+
+
+## ------------------------------- ##
+## 1. Simulate --prefix-builtins. ##
+## ------------------------------- ##
+
+# m4_define
+# m4_defn
+# m4_undefine
+define([m4_define], defn([define]))
+define([m4_defn], defn([defn]))
+define([m4_undefine], defn([undefine]))
+
+m4_undefine([define])
+m4_undefine([defn])
+m4_undefine([undefine])
+
+
+# m4_copy(SRC, DST)
+# -----------------
+# Define DST as the definition of SRC.
+# What's the difference between:
+# 1. m4_copy([from], [to])
+# 2. m4_define([to], [from($@)])
+# Well, obviously 1 is more expensive in space. Maybe 2 is more expensive
+# in time, but because of the space cost of 1, it's not that obvious.
+# Nevertheless, one huge difference is the handling of `$0'. If `from'
+# uses `$0', then with 1, `to''s `$0' is `to', while it is `from' in 2.
+# The user would certainly prefer to see `to'.
+m4_define([m4_copy],
+[m4_define([$2], m4_defn([$1]))])
+
+
+# m4_rename(SRC, DST)
+# -------------------
+# Rename the macro SRC to DST.
+m4_define([m4_rename],
+[m4_copy([$1], [$2])m4_undefine([$1])])
+
+
+# m4_rename_m4(MACRO-NAME)
+# ------------------------
+# Rename MACRO-NAME to m4_MACRO-NAME.
+m4_define([m4_rename_m4],
+[m4_rename([$1], [m4_$1])])
+
+
+# m4_copy_unm4(m4_MACRO-NAME)
+# ---------------------------
+# Copy m4_MACRO-NAME to MACRO-NAME.
+m4_define([m4_copy_unm4],
+[m4_copy([$1], m4_bpatsubst([$1], [^m4_\(.*\)], [[\1]]))])
+
+
+# Some m4 internals have names colliding with tokens we might use.
+# Rename them a` la `m4 --prefix-builtins'. Conditionals first, since
+# some subsequent renames are conditional.
+m4_rename_m4([ifdef])
+m4_rename([ifelse], [m4_if])
+
+m4_rename_m4([builtin])
+m4_rename_m4([changecom])
+m4_rename_m4([changequote])
+m4_ifdef([changeword],dnl conditionally available in 1.4.x
+[m4_undefine([changeword])])
+m4_rename_m4([debugfile])
+m4_rename_m4([debugmode])
+m4_rename_m4([decr])
+m4_undefine([divert])
+m4_rename_m4([divnum])
+m4_rename_m4([dumpdef])
+m4_rename_m4([errprint])
+m4_rename_m4([esyscmd])
+m4_rename_m4([eval])
+m4_rename_m4([format])
+m4_undefine([include])
+m4_rename_m4([incr])
+m4_rename_m4([index])
+m4_rename_m4([indir])
+m4_rename_m4([len])
+m4_rename([m4exit], [m4_exit])
+m4_undefine([m4wrap])
+m4_ifdef([mkstemp],dnl added in M4 1.4.8
+[m4_rename_m4([mkstemp])
+m4_copy([m4_mkstemp], [m4_maketemp])
+m4_undefine([maketemp])],
+[m4_rename_m4([maketemp])
+m4_copy([m4_maketemp], [m4_mkstemp])])
+m4_rename([patsubst], [m4_bpatsubst])
+m4_rename_m4([popdef])
+m4_rename_m4([pushdef])
+m4_rename([regexp], [m4_bregexp])
+m4_rename_m4([shift])
+m4_undefine([sinclude])
+m4_rename_m4([substr])
+m4_ifdef([symbols],dnl present only in alpha-quality 1.4o
+[m4_rename_m4([symbols])])
+m4_rename_m4([syscmd])
+m4_rename_m4([sysval])
+m4_rename_m4([traceoff])
+m4_rename_m4([traceon])
+m4_rename_m4([translit])
+m4_undefine([undivert])
+
+
+## ------------------- ##
+## 2. Error messages. ##
+## ------------------- ##
+
+
+# m4_location
+# -----------
+m4_define([m4_location],
+[__file__:__line__])
+
+
+# m4_errprintn(MSG)
+# -----------------
+# Same as `errprint', but with the missing end of line.
+m4_define([m4_errprintn],
+[m4_errprint([$1
+])])
+
+
+# m4_warning(MSG)
+# ---------------
+# Warn the user.
+m4_define([m4_warning],
+[m4_errprintn(m4_location[: warning: $1])])
+
+
+# m4_fatal(MSG, [EXIT-STATUS])
+# ----------------------------
+# Fatal the user. :)
+m4_define([m4_fatal],
+[m4_errprintn(m4_location[: error: $1])dnl
+m4_expansion_stack_dump()dnl
+m4_exit(m4_if([$2],, 1, [$2]))])
+
+
+# m4_assert(EXPRESSION, [EXIT-STATUS = 1])
+# ----------------------------------------
+# This macro ensures that EXPRESSION evaluates to true, and exits if
+# EXPRESSION evaluates to false.
+m4_define([m4_assert],
+[m4_if(m4_eval([$1]), 0,
+ [m4_fatal([assert failed: $1], [$2])])])
+
+
+
+## ------------- ##
+## 3. Warnings. ##
+## ------------- ##
+
+
+# _m4_warn(CATEGORY, MESSAGE, STACK-TRACE)
+# ----------------------------------------
+# Report a MESSAGE to the user if the CATEGORY of warnings is enabled.
+# This is for traces only.
+# The STACK-TRACE is a \n-separated list of "LOCATION: MESSAGE".
+#
+# Within m4, the macro is a no-op. This macro really matters
+# when autom4te post-processes the trace output.
+m4_define([_m4_warn], [])
+
+
+# m4_warn(CATEGORY, MESSAGE)
+# --------------------------
+# Report a MESSAGE to the user if the CATEGORY of warnings is enabled.
+m4_define([m4_warn],
+[_m4_warn([$1], [$2],
+m4_ifdef([m4_expansion_stack],
+ [_m4_defn([m4_expansion_stack])
+m4_location[: the top level]]))dnl
+])
+
+
+
+## ------------------- ##
+## 4. File inclusion. ##
+## ------------------- ##
+
+
+# We also want to neutralize include (and sinclude for symmetry),
+# but we want to extend them slightly: warn when a file is included
+# several times. This is, in general, a dangerous operation, because
+# too many people forget to quote the first argument of m4_define.
+#
+# For instance in the following case:
+# m4_define(foo, [bar])
+# then a second reading will turn into
+# m4_define(bar, [bar])
+# which is certainly not what was meant.
+
+# m4_include_unique(FILE)
+# -----------------------
+# Declare that the FILE was loading; and warn if it has already
+# been included.
+m4_define([m4_include_unique],
+[m4_ifdef([m4_include($1)],
+ [m4_warn([syntax], [file `$1' included several times])])dnl
+m4_define([m4_include($1)])])
+
+
+# m4_include(FILE)
+# ----------------
+# Like the builtin include, but warns against multiple inclusions.
+m4_define([m4_include],
+[m4_include_unique([$1])dnl
+m4_builtin([include], [$1])])
+
+
+# m4_sinclude(FILE)
+# -----------------
+# Like the builtin sinclude, but warns against multiple inclusions.
+m4_define([m4_sinclude],
+[m4_include_unique([$1])dnl
+m4_builtin([sinclude], [$1])])
+
+
+
+## ------------------------------------ ##
+## 5. Additional branching constructs. ##
+## ------------------------------------ ##
+
+# Both `m4_ifval' and `m4_ifset' tests against the empty string. The
+# difference is that `m4_ifset' is specialized on macros.
+#
+# In case of arguments of macros, eg. $1, it makes little difference.
+# In the case of a macro `FOO', you don't want to check `m4_ifval(FOO,
+# TRUE)', because if `FOO' expands with commas, there is a shifting of
+# the arguments. So you want to run `m4_ifval([FOO])', but then you just
+# compare the *string* `FOO' against `', which, of course fails.
+#
+# So you want the variation `m4_ifset' that expects a macro name as $1.
+# If this macro is both defined and defined to a non empty value, then
+# it runs TRUE, etc.
+
+
+# m4_ifval(COND, [IF-TRUE], [IF-FALSE])
+# -------------------------------------
+# If COND is not the empty string, expand IF-TRUE, otherwise IF-FALSE.
+# Comparable to m4_ifdef.
+m4_define([m4_ifval],
+[m4_if([$1], [], [$3], [$2])])
+
+
+# m4_n(TEXT)
+# ----------
+# If TEXT is not empty, return TEXT and a new line, otherwise nothing.
+m4_define([m4_n],
+[m4_if([$1],
+ [], [],
+ [$1
+])])
+
+
+# m4_ifvaln(COND, [IF-TRUE], [IF-FALSE])
+# --------------------------------------
+# Same as `m4_ifval', but add an extra newline to IF-TRUE or IF-FALSE
+# unless that argument is empty.
+m4_define([m4_ifvaln],
+[m4_if([$1],
+ [], [m4_n([$3])],
+ [m4_n([$2])])])
+
+
+# m4_ifset(MACRO, [IF-TRUE], [IF-FALSE])
+# --------------------------------------
+# If MACRO has no definition, or of its definition is the empty string,
+# expand IF-FALSE, otherwise IF-TRUE.
+m4_define([m4_ifset],
+[m4_ifdef([$1],
+ [m4_ifval(_m4_defn([$1]), [$2], [$3])],
+ [$3])])
+
+
+# m4_ifndef(NAME, [IF-NOT-DEFINED], [IF-DEFINED])
+# -----------------------------------------------
+m4_define([m4_ifndef],
+[m4_ifdef([$1], [$3], [$2])])
+
+
+# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT)
+# -----------------------------------------------------------
+# m4 equivalent of
+# switch (SWITCH)
+# {
+# case VAL1:
+# IF-VAL1;
+# break;
+# case VAL2:
+# IF-VAL2;
+# break;
+# ...
+# default:
+# DEFAULT;
+# break;
+# }.
+# All the values are optional, and the macro is robust to active
+# symbols properly quoted.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_case],
+[m4_if([$#], 0, [],
+ [$#], 1, [],
+ [$#], 2, [$2],
+ [$1], [$2], [$3],
+ [$0([$1], m4_shift3($@))])])
+
+
+# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
+# -----------------------------------------------------
+# m4 equivalent of
+#
+# if (SWITCH =~ RE1)
+# VAL1;
+# elif (SWITCH =~ RE2)
+# VAL2;
+# elif ...
+# ...
+# else
+# DEFAULT
+#
+# All the values are optional, and the macro is robust to active symbols
+# properly quoted.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_bmatch],
+[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
+ [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
+ [$#], 2, [$2],
+ [m4_if(m4_bregexp([$1], [$2]), -1, [$0([$1], m4_shift3($@))],
+ [$3])])])
+
+
+# m4_car(LIST)
+# m4_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+m4_define([m4_car], [[$1]])
+m4_define([m4_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+
+# _m4_cdr(LIST)
+# -------------
+# Like m4_cdr, except include a leading comma unless only one element
+# remains. Why? Because comparing a large list against [] is more
+# expensive in expansion time than comparing the number of arguments; so
+# _m4_cdr can be used to reduce the number of arguments when it is time
+# to end recursion.
+m4_define([_m4_cdr],
+[m4_if([$#], 1, [],
+ [, m4_dquote(m4_shift($@))])])
+
+
+
+# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT])
+# -------------------------------------------------------------------
+# Similar to m4_if, except that each TEST is expanded when encountered.
+# If the expansion of TESTn matches the string VALn, the result is IF-VALn.
+# The result is DEFAULT if no tests passed. This macro allows
+# short-circuiting of expensive tests, where it pays to arrange quick
+# filter tests to run first.
+#
+# For an example, consider a previous implementation of _AS_QUOTE_IFELSE:
+#
+# m4_if(m4_index([$1], [\]), [-1], [$2],
+# m4_eval(m4_index([$1], [\\]) >= 0), [1], [$2],
+# m4_eval(m4_index([$1], [\$]) >= 0), [1], [$2],
+# m4_eval(m4_index([$1], [\`]) >= 0), [1], [$3],
+# m4_eval(m4_index([$1], [\"]) >= 0), [1], [$3],
+# [$2])
+#
+# Here, m4_index is computed 5 times, and m4_eval 4, even if $1 contains
+# no backslash. It is more efficient to do:
+#
+# m4_cond([m4_index([$1], [\])], [-1], [$2],
+# [m4_eval(m4_index([$1], [\\]) >= 0)], [1], [$2],
+# [m4_eval(m4_index([$1], [\$]) >= 0)], [1], [$2],
+# [m4_eval(m4_index([$1], [\`]) >= 0)], [1], [$3],
+# [m4_eval(m4_index([$1], [\"]) >= 0)], [1], [$3],
+# [$2])
+#
+# In the common case of $1 with no backslash, only one m4_index expansion
+# occurs, and m4_eval is avoided altogether.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_cond],
+[m4_if([$#], [0], [m4_fatal([$0: cannot be called without arguments])],
+ [$#], [1], [$1],
+ m4_eval([$# % 3]), [2], [m4_fatal([$0: missing an argument])],
+ [_$0($@)])])
+
+m4_define([_m4_cond],
+[m4_if(($1), [($2)], [$3],
+ [$#], [3], [],
+ [$#], [4], [$4],
+ [$0(m4_shift3($@))])])
+
+
+## ---------------------------------------- ##
+## 6. Enhanced version of some primitives. ##
+## ---------------------------------------- ##
+
+# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
+# ----------------------------------------------------
+# m4 equivalent of
+#
+# $_ = STRING;
+# s/RE1/SUBST1/g;
+# s/RE2/SUBST2/g;
+# ...
+#
+# All the values are optional, and the macro is robust to active symbols
+# properly quoted.
+#
+# I would have liked to name this macro `m4_bpatsubst', unfortunately,
+# due to quotation problems, I need to double quote $1 below, therefore
+# the anchors are broken :( I can't let users be trapped by that.
+#
+# Recall that m4_shift3 always results in an argument. Hence, we need
+# to distinguish between a final deletion vs. ending recursion.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_bpatsubsts],
+[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
+ [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
+ [$#], 2, [m4_unquote(m4_builtin([patsubst], [[$1]], [$2]))],
+ [$#], 3, [m4_unquote(m4_builtin([patsubst], [[$1]], [$2], [$3]))],
+ [_$0($@m4_if(m4_eval($# & 1), 0, [,]))])])
+m4_define([_m4_bpatsubsts],
+[m4_if([$#], 2, [$1],
+ [$0(m4_builtin([patsubst], [[$1]], [$2], [$3]),
+ m4_shift3($@))])])
+
+
+# m4_define_default(MACRO, VALUE)
+# -------------------------------
+# If MACRO is undefined, set it to VALUE.
+m4_define([m4_define_default],
+[m4_ifndef([$1], [m4_define($@)])])
+
+
+# m4_default(EXP1, EXP2)
+# ----------------------
+# Returns EXP1 if non empty, otherwise EXP2.
+#
+# This macro is called on hot paths, so inline the contents of m4_ifval,
+# for one less round of expansion.
+m4_define([m4_default],
+[m4_if([$1], [], [$2], [$1])])
+
+
+# m4_defn(NAME)
+# -------------
+# Like the original, except guarantee a warning when using something which is
+# undefined (unlike M4 1.4.x). This replacement is not a full-featured
+# replacement: if any of the defined macros contain unbalanced quoting, but
+# when pasted together result in a well-quoted string, then only native m4
+# support is able to get it correct. But that's where quadrigraphs come in
+# handy, if you really need unbalanced quotes inside your macros.
+#
+# This macro is called frequently, so minimize the amount of additional
+# expansions by skipping m4_ifndef. Better yet, if __m4_version__ exists,
+# (added in M4 1.6), then let m4 do the job for us (see m4_init).
+#
+# _m4_defn is for internal use only - it bypasses the wrapper, so it
+# must only be used on one argument at a time, and only on macros
+# known to be defined. Make sure this still works if the user renames
+# m4_defn but not _m4_defn.
+m4_copy([m4_defn], [_m4_defn])
+m4_define([m4_defn],
+[m4_if([$#], [0], [[$0]],
+ [$#], [1], [m4_ifdef([$1], [_m4_defn([$1])],
+ [m4_fatal([$0: undefined macro: $1])])],
+ [m4_foreach([_m4_macro], [$@], [$0(_m4_defn([_m4_macro]))])])])
+
+
+# _m4_dumpdefs_up(NAME)
+# ---------------------
+m4_define([_m4_dumpdefs_up],
+[m4_ifdef([$1],
+ [m4_pushdef([_m4_dumpdefs], _m4_defn([$1]))dnl
+m4_dumpdef([$1])dnl
+_m4_popdef([$1])dnl
+_m4_dumpdefs_up([$1])])])
+
+
+# _m4_dumpdefs_down(NAME)
+# -----------------------
+m4_define([_m4_dumpdefs_down],
+[m4_ifdef([_m4_dumpdefs],
+ [m4_pushdef([$1], _m4_defn([_m4_dumpdefs]))dnl
+_m4_popdef([_m4_dumpdefs])dnl
+_m4_dumpdefs_down([$1])])])
+
+
+# m4_dumpdefs(NAME)
+# -----------------
+# Similar to `m4_dumpdef(NAME)', but if NAME was m4_pushdef'ed, display its
+# value stack (most recent displayed first).
+m4_define([m4_dumpdefs],
+[_m4_dumpdefs_up([$1])dnl
+_m4_dumpdefs_down([$1])])
+
+
+# m4_popdef(NAME)
+# ---------------
+# Like the original, except guarantee a warning when using something which is
+# undefined (unlike M4 1.4.x).
+#
+# This macro is called frequently, so minimize the amount of additional
+# expansions by skipping m4_ifndef. Better yet, if __m4_version__ exists,
+# (added in M4 1.6), then let m4 do the job for us (see m4_init).
+#
+# _m4_popdef is for internal use only - it bypasses the wrapper, so it
+# must only be used on macros known to be defined. Make sure this
+# still works if the user renames m4_popdef but not _m4_popdef.
+m4_copy([m4_popdef], [_m4_popdef])
+m4_define([m4_popdef],
+[m4_if([$#], [0], [[$0]],
+ [$#], [1], [m4_ifdef([$1], [_m4_popdef([$1])],
+ [m4_fatal([$0: undefined macro: $1])])],
+ [m4_foreach([_m4_macro], [$@], [$0(_m4_defn([_m4_macro]))])])])
+
+
+# m4_shiftn(N, ...)
+# -----------------
+# Returns ... shifted N times. Useful for recursive "varargs" constructs.
+#
+# Autoconf does not use this macro, because it is inherently slower than
+# calling the common cases of m4_shift2 or m4_shift3 directly. But it
+# might as well be fast for other clients, such as Libtool. One way to
+# do this is to expand $@ only once in _m4_shiftn (otherwise, for long
+# lists, the expansion of m4_if takes twice as much memory as what the
+# list itself occupies, only to throw away the unused branch). The end
+# result is strictly equivalent to
+# m4_if([$1], 1, [m4_shift(,m4_shift(m4_shift($@)))],
+# [_m4_shiftn(m4_decr([$1]), m4_shift(m4_shift($@)))])
+# but with the final `m4_shift(m4_shift($@)))' shared between the two
+# paths. The first leg uses a no-op m4_shift(,$@) to balance out the ().
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_shiftn],
+[m4_assert(0 < $1 && $1 < $#)_$0($@)])
+
+m4_define([_m4_shiftn],
+[m4_if([$1], 1, [m4_shift(],
+ [$0(m4_decr([$1])]), m4_shift(m4_shift($@)))])
+
+# m4_shift2(...)
+# m4_shift3(...)
+# -----------------
+# Returns ... shifted twice, and three times. Faster than m4_shiftn.
+m4_define([m4_shift2], [m4_shift(m4_shift($@))])
+m4_define([m4_shift3], [m4_shift(m4_shift(m4_shift($@)))])
+
+# _m4_shift2(...)
+# _m4_shift3(...)
+# ---------------
+# Like m4_shift2 or m4_shift3, except include a leading comma unless shifting
+# consumes all arguments. Why? Because in recursion, it is nice to
+# distinguish between 1 element left and 0 elements left, based on how many
+# arguments this shift expands to.
+m4_define([_m4_shift2],
+[m4_if([$#], [2], [],
+ [, m4_shift(m4_shift($@))])])
+m4_define([_m4_shift3],
+[m4_if([$#], [3], [],
+ [, m4_shift(m4_shift(m4_shift($@)))])])
+
+
+# m4_undefine(NAME)
+# -----------------
+# Like the original, except guarantee a warning when using something which is
+# undefined (unlike M4 1.4.x).
+#
+# This macro is called frequently, so minimize the amount of additional
+# expansions by skipping m4_ifndef. Better yet, if __m4_version__ exists,
+# (added in M4 1.6), then let m4 do the job for us (see m4_init).
+#
+# _m4_undefine is for internal use only - it bypasses the wrapper, so
+# it must only be used on macros known to be defined. Make sure this
+# still works if the user renames m4_undefine but not _m4_undefine.
+m4_copy([m4_undefine], [_m4_undefine])
+m4_define([m4_undefine],
+[m4_if([$#], [0], [[$0]],
+ [$#], [1], [m4_ifdef([$1], [_m4_undefine([$1])],
+ [m4_fatal([$0: undefined macro: $1])])],
+ [m4_foreach([_m4_macro], [$@], [$0(_m4_defn([_m4_macro]))])])])
+
+# _m4_wrap(PRE, POST)
+# -------------------
+# Helper macro for m4_wrap and m4_wrap_lifo. Allows nested calls to
+# m4_wrap within wrapped text. Use _m4_defn and _m4_popdef for speed.
+m4_define([_m4_wrap],
+[m4_ifdef([$0_text],
+ [m4_define([$0_text], [$1]_m4_defn([$0_text])[$2])],
+ [m4_builtin([m4wrap], [m4_unquote(
+ _m4_defn([$0_text])_m4_popdef([$0_text]))])m4_define([$0_text], [$1$2])])])
+
+# m4_wrap(TEXT)
+# -------------
+# Append TEXT to the list of hooks to be executed at the end of input.
+# Whereas the order of the original may be LIFO in the underlying m4,
+# this version is always FIFO.
+m4_define([m4_wrap],
+[_m4_wrap([], [$1[]])])
+
+# m4_wrap_lifo(TEXT)
+# ------------------
+# Prepend TEXT to the list of hooks to be executed at the end of input.
+# Whereas the order of m4_wrap may be FIFO in the underlying m4, this
+# version is always LIFO.
+m4_define([m4_wrap_lifo],
+[_m4_wrap([$1[]])])
+
+## ------------------------- ##
+## 7. Quoting manipulation. ##
+## ------------------------- ##
+
+
+# m4_apply(MACRO, LIST)
+# ---------------------
+# Invoke MACRO, with arguments provided from the quoted list of
+# comma-separated quoted arguments. If LIST is empty, invoke MACRO
+# without arguments. The expansion will not be concatenated with
+# subsequent text.
+m4_define([m4_apply],
+[m4_if([$2], [], [$1], [$1($2)])[]])
+
+# _m4_apply(MACRO, LIST)
+# ----------------------
+# Like m4_apply, except do nothing if LIST is empty.
+m4_define([_m4_apply],
+[m4_if([$2], [], [], [$1($2)[]])])
+
+
+# m4_count(ARGS)
+# --------------
+# Return a count of how many ARGS are present.
+m4_define([m4_count], [$#])
+
+
+# m4_do(STRING, ...)
+# ------------------
+# This macro invokes all its arguments (in sequence, of course). It is
+# useful for making your macros more structured and readable by dropping
+# unnecessary dnl's and have the macros indented properly. No concatenation
+# occurs after a STRING; use m4_unquote(m4_join(,STRING)) for that.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_do],
+[m4_if([$#], 0, [],
+ [$#], 1, [$1[]],
+ [$1[]$0(m4_shift($@))])])
+
+
+# m4_dquote(ARGS)
+# ---------------
+# Return ARGS as a quoted list of quoted arguments.
+m4_define([m4_dquote], [[$@]])
+
+
+# m4_dquote_elt(ARGS)
+# -------------------
+# Return ARGS as an unquoted list of double-quoted arguments.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_dquote_elt],
+[m4_if([$#], [0], [],
+ [$#], [1], [[[$1]]],
+ [[[$1]],$0(m4_shift($@))])])
+
+
+# m4_echo(ARGS)
+# -------------
+# Return the ARGS, with the same level of quoting. Whitespace after
+# unquoted commas are consumed.
+m4_define([m4_echo], [$@])
+
+
+# m4_expand(ARG)
+# --------------
+# Return the expansion of ARG as a single string. Unlike m4_quote($1), this
+# correctly preserves whitespace following single-quoted commas that appeared
+# within ARG.
+#
+# m4_define([active], [ACT, IVE])
+# m4_define([active2], [[ACT, IVE]])
+# m4_quote(active, active2)
+# => ACT,IVE,ACT, IVE
+# m4_expand([active, active2])
+# => ACT, IVE, ACT, IVE
+#
+# Unfortunately, due to limitations in m4, ARG must expand to something
+# with balanced quotes (use quadrigraphs to get around this). The input
+# is not likely to have unbalanced -=<{(/)}>=- quotes, and it is possible
+# to have unbalanced (), provided it was specified with proper [] quotes.
+#
+# Exploit that extra () will group unquoted commas and the following
+# whitespace, then convert () to []. m4_bpatsubst can't handle newlines
+# inside $1, and m4_substr strips quoting. So we (ab)use m4_changequote.
+m4_define([m4_expand], [_$0(-=<{($1)}>=-)])
+m4_define([_m4_expand],
+[m4_changequote([-=<{(], [)}>=-])$1m4_changequote([, ])])
+
+
+# m4_ignore(ARGS)
+# ---------------
+# Expands to nothing. Useful for conditionally ignoring an arbitrary
+# number of arguments (see _m4_list_cmp for an example).
+m4_define([m4_ignore])
+
+
+# m4_make_list(ARGS)
+# ------------------
+# Similar to m4_dquote, this creates a quoted list of quoted ARGS. This
+# version is less efficient than m4_dquote, but separates each argument
+# with a comma and newline, rather than just comma, for readability.
+# When developing an m4sugar algorithm, you could temporarily use
+# m4_pushdef([m4_dquote],m4_defn([m4_make_list]))
+# around your code to make debugging easier.
+m4_define([m4_make_list], [m4_join([,
+], m4_dquote_elt($@))])
+
+
+# m4_noquote(STRING)
+# ------------------
+# Return the result of ignoring all quotes in STRING and invoking the
+# macros it contains. Amongst other things, this is useful for enabling
+# macro invocations inside strings with [] blocks (for instance regexps
+# and help-strings). On the other hand, since all quotes are disabled,
+# any macro expanded during this time that relies on nested [] quoting
+# will likely crash and burn. This macro is seldom useful; consider
+# m4_unquote or m4_expand instead.
+m4_define([m4_noquote],
+[m4_changequote([-=<{(],[)}>=-])$1-=<{()}>=-m4_changequote([,])])
+
+
+# m4_quote(ARGS)
+# --------------
+# Return ARGS as a single argument. Any whitespace after unquoted commas
+# is stripped. There is always output, even when there were no arguments.
+#
+# It is important to realize the difference between `m4_quote(exp)' and
+# `[exp]': in the first case you obtain the quoted *result* of the
+# expansion of EXP, while in the latter you just obtain the string
+# `exp'.
+m4_define([m4_quote], [[$*]])
+
+
+# _m4_quote(ARGS)
+# ---------------
+# Like m4_quote, except that when there are no arguments, there is no
+# output. For conditional scenarios (such as passing _m4_quote as the
+# macro name in m4_mapall), this feature can be used to distinguish between
+# one argument of the empty string vs. no arguments. However, in the
+# normal case with arguments present, this is less efficient than m4_quote.
+m4_define([_m4_quote],
+[m4_if([$#], [0], [], [[$*]])])
+
+
+# m4_reverse(ARGS)
+# ----------------
+# Output ARGS in reverse order.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_reverse],
+[m4_if([$#], [0], [], [$#], [1], [[$1]],
+ [$0(m4_shift($@)), [$1]])])
+
+
+# m4_unquote(ARGS)
+# ----------------
+# Remove one layer of quotes from each ARG, performing one level of
+# expansion. For one argument, m4_unquote([arg]) is more efficient than
+# m4_do([arg]), but for multiple arguments, the difference is that
+# m4_unquote separates arguments with commas while m4_do concatenates.
+# Follow this macro with [] if concatenation with subsequent text is
+# undesired.
+m4_define([m4_unquote], [$*])
+
+
+## -------------------------- ##
+## 8. Implementing m4 loops. ##
+## -------------------------- ##
+
+
+# m4_for(VARIABLE, FIRST, LAST, [STEP = +/-1], EXPRESSION)
+# --------------------------------------------------------
+# Expand EXPRESSION defining VARIABLE to FROM, FROM + 1, ..., TO with
+# increments of STEP. Both limits are included, and bounds are
+# checked for consistency. The algorithm is robust to indirect
+# VARIABLE names. Changing VARIABLE inside EXPRESSION will not impact
+# the number of iterations.
+#
+# Uses _m4_defn for speed, and avoid dnl in the macro body.
+m4_define([m4_for],
+[m4_pushdef([$1], m4_eval([$2]))]dnl
+[m4_cond([m4_eval(([$3]) > ([$2]))], 1,
+ [m4_pushdef([_m4_step], m4_eval(m4_default([$4],
+ 1)))m4_assert(_m4_step > 0)_$0([$1], _m4_defn([$1]),
+ m4_eval((([$3]) - ([$2])) / _m4_step * _m4_step + ([$2])),
+ _m4_step, [$5])],
+ [m4_eval(([$3]) < ([$2]))], 1,
+ [m4_pushdef([_m4_step], m4_eval(m4_default([$4],
+ -1)))m4_assert(_m4_step < 0)_$0([$1], _m4_defn([$1]),
+ m4_eval((([$2]) - ([$3])) / -(_m4_step) * _m4_step + ([$2])),
+ _m4_step, [$5])],
+ [m4_pushdef([_m4_step])$5])[]]dnl
+[m4_popdef([_m4_step], [$1])])
+
+
+# _m4_for(VARIABLE, COUNT, LAST, STEP, EXPRESSION)
+# ------------------------------------------------
+# Core of the loop, no consistency checks, all arguments are plain
+# numbers. Define VARIABLE to COUNT, expand EXPRESSION, then alter
+# COUNT by STEP and iterate if COUNT is not LAST.
+m4_define([_m4_for],
+[m4_define([$1], [$2])$5[]m4_if([$2], [$3], [],
+ [$0([$1], m4_eval([$2 + $4]), [$3], [$4], [$5])])])
+
+
+# Implementing `foreach' loops in m4 is much more tricky than it may
+# seem. For example, the old M4 1.4.4 manual had an incorrect example,
+# which looked like this (when translated to m4sugar):
+#
+# | # foreach(VAR, (LIST), STMT)
+# | m4_define([foreach],
+# | [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])
+# | m4_define([_arg1], [$1])
+# | m4_define([_foreach],
+# | [m4_if([$2], [()], ,
+# | [m4_define([$1], _arg1$2)$3[]_foreach([$1], (m4_shift$2), [$3])])])
+#
+# But then if you run
+#
+# | m4_define(a, 1)
+# | m4_define(b, 2)
+# | m4_define(c, 3)
+# | foreach([f], [([a], [(b], [c)])], [echo f
+# | ])
+#
+# it gives
+#
+# => echo 1
+# => echo (2,3)
+#
+# which is not what is expected.
+#
+# Of course the problem is that many quotes are missing. So you add
+# plenty of quotes at random places, until you reach the expected
+# result. Alternatively, if you are a quoting wizard, you directly
+# reach the following implementation (but if you really did, then
+# apply to the maintenance of m4sugar!).
+#
+# | # foreach(VAR, (LIST), STMT)
+# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
+# | m4_define([_arg1], [[$1]])
+# | m4_define([_foreach],
+# | [m4_if($2, [()], ,
+# | [m4_define([$1], [_arg1$2])$3[]_foreach([$1], [(m4_shift$2)], [$3])])])
+#
+# which this time answers
+#
+# => echo a
+# => echo (b
+# => echo c)
+#
+# Bingo!
+#
+# Well, not quite.
+#
+# With a better look, you realize that the parens are more a pain than
+# a help: since anyway you need to quote properly the list, you end up
+# with always using an outermost pair of parens and an outermost pair
+# of quotes. Rejecting the parens both eases the implementation, and
+# simplifies the use:
+#
+# | # foreach(VAR, (LIST), STMT)
+# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
+# | m4_define([_arg1], [$1])
+# | m4_define([_foreach],
+# | [m4_if($2, [], ,
+# | [m4_define([$1], [_arg1($2)])$3[]_foreach([$1], [m4_shift($2)], [$3])])])
+#
+#
+# Now, just replace the `$2' with `m4_quote($2)' in the outer `m4_if'
+# to improve robustness, and you come up with a nice implementation
+# that doesn't require extra parentheses in the user's LIST.
+#
+# But wait - now the algorithm is quadratic, because every recursion of
+# the algorithm keeps the entire LIST and merely adds another m4_shift to
+# the quoted text. If the user has a lot of elements in LIST, you can
+# bring the system to its knees with the memory m4 then requires, or trip
+# the m4 --nesting-limit recursion factor. The only way to avoid
+# quadratic growth is ensure m4_shift is expanded prior to the recursion.
+# Hence the design below.
+#
+# The M4 manual now includes a chapter devoted to this issue, with
+# the lessons learned from m4sugar. And still, this design is only
+# optimal for M4 1.6; see foreach.m4 for yet more comments on why
+# M4 1.4.x uses yet another implementation.
+
+
+# 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.
+#
+# This macro is robust to active symbols:
+# | m4_define(active, [ACT, IVE])
+# | m4_foreach(Var, [active, active], [-Var-])
+# => -ACT--IVE--ACT--IVE-
+#
+# | m4_foreach(Var, [[active], [active]], [-Var-])
+# => -ACT, IVE--ACT, IVE-
+#
+# | m4_foreach(Var, [[[active]], [[active]]], [-Var-])
+# => -active--active-
+#
+# This macro is called frequently, so avoid extra expansions such as
+# m4_ifval and dnl. Also, since $2 might be quite large, try to use it
+# as little as possible in _m4_foreach; each extra use requires that much
+# more memory for expansion. So, rather than directly compare $2 against
+# [] and use m4_car/m4_cdr for recursion, we instead unbox the list (which
+# requires swapping the argument order in the helper), insert an ignored
+# third argument, and use m4_shift3 to detect when recursion is complete.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_foreach],
+[m4_if([$2], [], [],
+ [m4_pushdef([$1])_$0([$1], [$3], [], $2)m4_popdef([$1])])])
+
+m4_define([_m4_foreach],
+[m4_if([$#], [3], [],
+ [m4_define([$1], [$4])$2[]$0([$1], [$2], m4_shift3($@))])])
+
+
+# m4_foreach_w(VARIABLE, LIST, EXPRESSION)
+# ----------------------------------------
+#
+# Like m4_foreach, but the list is whitespace separated.
+#
+# This macro is robust to active symbols:
+# m4_foreach_w([Var], [ active
+# b act\
+# ive ], [-Var-])end
+# => -active--b--active-end
+#
+m4_define([m4_foreach_w],
+[m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])
+
+
+# m4_map(MACRO, LIST)
+# m4_mapall(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.
+# If LIST contains an empty sublist, m4_map skips the expansion of
+# MACRO, while m4_mapall expands MACRO with no arguments.
+#
+# Since LIST may be quite large, we want to minimize how often it
+# appears in the expansion. Rather than use m4_car/m4_cdr iteration,
+# we unbox the list, ignore the second argument, and use m4_shift2 to
+# detect the end of recursion. The mismatch in () is intentional; see
+# _m4_map. For m4_map, an empty list behaves like an empty sublist
+# and gets ignored; for m4_mapall, we must special-case the empty
+# list.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_map],
+[_m4_map([_m4_apply([$1]], [], $2)])
+
+m4_define([m4_mapall],
+[m4_if([$2], [], [],
+ [_m4_map([m4_apply([$1]], [], $2)])])
+
+
+# m4_map_sep(MACRO, SEPARATOR, LIST)
+# m4_mapall_sep(MACRO, SEPARATOR, LIST)
+# -------------------------------------
+# Invoke MACRO($1), SEPARATOR, MACRO($2), ..., MACRO($N) where $1,
+# $2... $N are the elements of LIST, and are in turn lists appropriate
+# for m4_apply. SEPARATOR is expanded, in order to allow the creation
+# of a list of arguments by using a single-quoted comma as the
+# separator. For each empty sublist, m4_map_sep skips the expansion
+# of MACRO and SEPARATOR, while m4_mapall_sep expands MACRO with no
+# arguments.
+#
+# For m4_mapall_sep, merely expand the first iteration without the
+# separator, then include separator as part of subsequent recursion;
+# but avoid extra expansion of LIST's side-effects via a helper macro.
+# For m4_map_sep, things are trickier - we don't know if the first
+# list element is an empty sublist, so we must define a self-modifying
+# helper macro and use that as the separator instead.
+m4_define([m4_map_sep],
+[m4_pushdef([m4_Sep], [m4_define([m4_Sep], _m4_defn([m4_unquote]))])]dnl
+[_m4_map([_m4_apply([m4_Sep([$2])[]$1]], [], $3)m4_popdef([m4_Sep])])
+
+m4_define([m4_mapall_sep],
+[m4_if([$3], [], [], [_$0([$1], [$2], $3)])])
+
+m4_define([_m4_mapall_sep],
+[m4_apply([$1], [$3])_m4_map([m4_apply([$2[]$1]], m4_shift2($@))])
+
+# _m4_map(PREFIX, IGNORED, SUBLIST, ...)
+# --------------------------------------
+# Common implementation for all four m4_map variants. The mismatch in
+# the number of () is intentional. PREFIX must supply a form of
+# m4_apply, the open `(', and the MACRO to be applied. Each iteration
+# then appends `,', the current SUBLIST and the closing `)', then
+# recurses to the next SUBLIST. IGNORED is an aid to ending recursion
+# efficiently.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([_m4_map],
+[m4_if([$#], [2], [],
+ [$1, [$3])$0([$1], m4_shift2($@))])])
+
+# m4_transform(EXPRESSION, ARG...)
+# --------------------------------
+# Expand EXPRESSION([ARG]) for each argument. More efficient than
+# m4_foreach([var], [ARG...], [EXPRESSION(m4_defn([var]))])
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_transform],
+[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
+ [$#], [1], [],
+ [$#], [2], [$1([$2])[]],
+ [$1([$2])[]$0([$1], m4_shift2($@))])])
+
+
+# m4_transform_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]).
+#
+# For example:
+# m4_define([show], [($*)m4_newline])dnl
+# m4_transform_pair([show], [], [a], [b], [c], [d], [e])dnl
+# => (a,b)
+# => (c,d)
+# => (e)
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_transform_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])[]],
+ [$#], [4], [$1([$3], [$4])[]],
+ [$1([$3], [$4])[]$0([$1], [$2], m4_shift(m4_shift3($@)))])])
+
+
+## --------------------------- ##
+## 9. More diversion support. ##
+## --------------------------- ##
+
+
+# _m4_divert(DIVERSION-NAME or NUMBER)
+# ------------------------------------
+# If DIVERSION-NAME is the name of a diversion, return its number,
+# otherwise if it is a NUMBER return it.
+m4_define([_m4_divert],
+[m4_ifdef([_m4_divert($1)],
+ [m4_indir([_m4_divert($1)])],
+ [$1])])
+
+# KILL is only used to suppress output.
+m4_define([_m4_divert(KILL)], -1)
+
+# The empty diversion name is a synonym for 0.
+m4_define([_m4_divert()], 0)
+
+
+# _m4_divert_n_stack
+# ------------------
+# Print m4_divert_stack with newline prepended, if it's nonempty.
+m4_define([_m4_divert_n_stack],
+[m4_ifdef([m4_divert_stack], [
+_m4_defn([m4_divert_stack])])])
+
+
+# m4_divert(DIVERSION-NAME)
+# -------------------------
+# Change the diversion stream to DIVERSION-NAME.
+m4_define([m4_divert],
+[m4_define([m4_divert_stack], m4_location[: $0: $1]_m4_divert_n_stack)]dnl
+[m4_builtin([divert], _m4_divert([$1]))])
+
+
+# m4_divert_push(DIVERSION-NAME)
+# ------------------------------
+# Change the diversion stream to DIVERSION-NAME, while stacking old values.
+m4_define([m4_divert_push],
+[m4_pushdef([m4_divert_stack], m4_location[: $0: $1]_m4_divert_n_stack)]dnl
+[m4_pushdef([_m4_divert_diversion], [$1])]dnl
+[m4_builtin([divert], _m4_divert([$1]))])
+
+
+# m4_divert_pop([DIVERSION-NAME])
+# -------------------------------
+# Change the diversion stream to its previous value, unstacking it.
+# If specified, verify we left DIVERSION-NAME.
+# When we pop the last value from the stack, we divert to -1.
+m4_define([m4_divert_pop],
+[m4_ifndef([_m4_divert_diversion],
+ [m4_fatal([too many m4_divert_pop])])]dnl
+[m4_if([$1], [], [],
+ [$1], _m4_defn([_m4_divert_diversion]), [],
+ [m4_fatal([$0($1): diversion mismatch: ]_m4_divert_n_stack)])]dnl
+[_m4_popdef([m4_divert_stack], [_m4_divert_diversion])]dnl
+[m4_builtin([divert],
+ m4_ifdef([_m4_divert_diversion],
+ [_m4_divert(_m4_defn([_m4_divert_diversion]))],
+ -1))])
+
+
+# m4_divert_text(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
+# Output CONTENT into DIVERSION-NAME (which may be a number actually).
+# An end of line is appended for free to CONTENT.
+m4_define([m4_divert_text],
+[m4_divert_push([$1])$2
+m4_divert_pop([$1])])
+
+
+# m4_divert_once(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
+# Output CONTENT into DIVERSION-NAME once, if not already there.
+# An end of line is appended for free to CONTENT.
+m4_define([m4_divert_once],
+[m4_expand_once([m4_divert_text([$1], [$2])])])
+
+
+# m4_undivert(DIVERSION-NAME)
+# ---------------------------
+# Undivert DIVERSION-NAME. Unlike the M4 version, this only takes a single
+# diversion identifier, and should not be used to undivert files.
+m4_define([m4_undivert],
+[m4_builtin([undivert], _m4_divert([$1]))])
+
+
+## --------------------------------------------- ##
+## 10. Defining macros with bells and whistles. ##
+## --------------------------------------------- ##
+
+# `m4_defun' is basically `m4_define' but it equips the macro with the
+# needed machinery for `m4_require'. A macro must be m4_defun'd if
+# either it is m4_require'd, or it m4_require's.
+#
+# Two things deserve attention and are detailed below:
+# 1. Implementation of m4_require
+# 2. Keeping track of the expansion stack
+#
+# 1. Implementation of m4_require
+# ===============================
+#
+# Of course m4_defun AC_PROVIDE's the macro, so that a macro which has
+# been expanded is not expanded again when m4_require'd, but the
+# difficult part is the proper expansion of macros when they are
+# m4_require'd.
+#
+# The implementation is based on two ideas, (i) using diversions to
+# prepare the expansion of the macro and its dependencies (by Franc,ois
+# Pinard), and (ii) expand the most recently m4_require'd macros _after_
+# the previous macros (by Axel Thimm).
+#
+#
+# The first idea: why use diversions?
+# -----------------------------------
+#
+# When a macro requires another, the other macro is expanded in new
+# diversion, GROW. When the outer macro is fully expanded, we first
+# undivert the most nested diversions (GROW - 1...), and finally
+# undivert GROW. To understand why we need several diversions,
+# consider the following example:
+#
+# | m4_defun([TEST1], [Test...REQUIRE([TEST2])1])
+# | m4_defun([TEST2], [Test...REQUIRE([TEST3])2])
+# | m4_defun([TEST3], [Test...3])
+#
+# Because m4_require is not required to be first in the outer macros, we
+# must keep the expansions of the various levels of m4_require separated.
+# Right before executing the epilogue of TEST1, we have:
+#
+# GROW - 2: Test...3
+# GROW - 1: Test...2
+# GROW: Test...1
+# BODY:
+#
+# Finally the epilogue of TEST1 undiverts GROW - 2, GROW - 1, and
+# GROW into the regular flow, BODY.
+#
+# GROW - 2:
+# GROW - 1:
+# GROW:
+# BODY: Test...3; Test...2; Test...1
+#
+# (The semicolons are here for clarification, but of course are not
+# emitted.) This is what Autoconf 2.0 (I think) to 2.13 (I'm sure)
+# implement.
+#
+#
+# The second idea: first required first out
+# -----------------------------------------
+#
+# The natural implementation of the idea above is buggy and produces
+# very surprising results in some situations. Let's consider the
+# following example to explain the bug:
+#
+# | m4_defun([TEST1], [REQUIRE([TEST2a])REQUIRE([TEST2b])])
+# | m4_defun([TEST2a], [])
+# | m4_defun([TEST2b], [REQUIRE([TEST3])])
+# | m4_defun([TEST3], [REQUIRE([TEST2a])])
+# |
+# | AC_INIT
+# | TEST1
+#
+# The dependencies between the macros are:
+#
+# 3 --- 2b
+# / \ is m4_require'd by
+# / \ left -------------------- right
+# 2a ------------ 1
+#
+# If you strictly apply the rules given in the previous section you get:
+#
+# GROW - 2: TEST3
+# GROW - 1: TEST2a; TEST2b
+# GROW: TEST1
+# BODY:
+#
+# (TEST2a, although required by TEST3 is not expanded in GROW - 3
+# because is has already been expanded before in GROW - 1, so it has
+# been AC_PROVIDE'd, so it is not expanded again) so when you undivert
+# the stack of diversions, you get:
+#
+# GROW - 2:
+# GROW - 1:
+# GROW:
+# BODY: TEST3; TEST2a; TEST2b; TEST1
+#
+# i.e., TEST2a is expanded after TEST3 although the latter required the
+# former.
+#
+# Starting from 2.50, we use an implementation provided by Axel Thimm.
+# The idea is simple: the order in which macros are emitted must be the
+# same as the one in which macros are expanded. (The bug above can
+# indeed be described as: a macro has been AC_PROVIDE'd before its
+# dependent, but it is emitted after: the lack of correlation between
+# emission and expansion order is guilty).
+#
+# How to do that? You keep the stack of diversions to elaborate the
+# macros, but each time a macro is fully expanded, emit it immediately.
+#
+# In the example above, when TEST2a is expanded, but it's epilogue is
+# not run yet, you have:
+#
+# GROW - 2:
+# GROW - 1: TEST2a
+# GROW: Elaboration of TEST1
+# BODY:
+#
+# The epilogue of TEST2a emits it immediately:
+#
+# GROW - 2:
+# GROW - 1:
+# GROW: Elaboration of TEST1
+# BODY: TEST2a
+#
+# TEST2b then requires TEST3, so right before the epilogue of TEST3, you
+# have:
+#
+# GROW - 2: TEST3
+# GROW - 1: Elaboration of TEST2b
+# GROW: Elaboration of TEST1
+# BODY: TEST2a
+#
+# The epilogue of TEST3 emits it:
+#
+# GROW - 2:
+# GROW - 1: Elaboration of TEST2b
+# GROW: Elaboration of TEST1
+# BODY: TEST2a; TEST3
+#
+# TEST2b is now completely expanded, and emitted:
+#
+# GROW - 2:
+# GROW - 1:
+# GROW: Elaboration of TEST1
+# BODY: TEST2a; TEST3; TEST2b
+#
+# and finally, TEST1 is finished and emitted:
+#
+# GROW - 2:
+# GROW - 1:
+# GROW:
+# BODY: TEST2a; TEST3; TEST2b: TEST1
+#
+# The idea is simple, but the implementation is a bit evolved. If you
+# are like me, you will want to see the actual functioning of this
+# implementation to be convinced. The next section gives the full
+# details.
+#
+#
+# The Axel Thimm implementation at work
+# -------------------------------------
+#
+# We consider the macros above, and this configure.ac:
+#
+# AC_INIT
+# TEST1
+#
+# You should keep the definitions of _m4_defun_pro, _m4_defun_epi, and
+# m4_require at hand to follow the steps.
+#
+# This implements tries not to assume that the current diversion is
+# BODY, so as soon as a macro (m4_defun'd) is expanded, we first
+# record the current diversion under the name _m4_divert_dump (denoted
+# DUMP below for short). This introduces an important difference with
+# the previous versions of Autoconf: you cannot use m4_require if you
+# are not inside an m4_defun'd macro, and especially, you cannot
+# m4_require directly from the top level.
+#
+# We have not tried to simulate the old behavior (better yet, we
+# diagnose it), because it is too dangerous: a macro m4_require'd from
+# the top level is expanded before the body of `configure', i.e., before
+# any other test was run. I let you imagine the result of requiring
+# AC_STDC_HEADERS for instance, before AC_PROG_CC was actually run....
+#
+# After AC_INIT was run, the current diversion is BODY.
+# * AC_INIT was run
+# DUMP: undefined
+# diversion stack: BODY |-
+#
+# * TEST1 is expanded
+# The prologue of TEST1 sets _m4_divert_dump, which is the diversion
+# where the current elaboration will be dumped, to the current
+# diversion. It also m4_divert_push to GROW, where the full
+# expansion of TEST1 and its dependencies will be elaborated.
+# DUMP: BODY
+# BODY: empty
+# diversions: GROW, BODY |-
+#
+# * TEST1 requires TEST2a
+# _m4_require_call m4_divert_pushes another temporary diversion,
+# GROW - 1, and expands TEST2a in there.
+# DUMP: BODY
+# BODY: empty
+# GROW - 1: TEST2a
+# diversions: GROW - 1, GROW, BODY |-
+# Than the content of the temporary diversion is moved to DUMP and the
+# temporary diversion is popped.
+# DUMP: BODY
+# BODY: TEST2a
+# diversions: GROW, BODY |-
+#
+# * TEST1 requires TEST2b
+# Again, _m4_require_call pushes GROW - 1 and heads to expand TEST2b.
+# DUMP: BODY
+# BODY: TEST2a
+# diversions: GROW - 1, GROW, BODY |-
+#
+# * TEST2b requires TEST3
+# _m4_require_call pushes GROW - 2 and expands TEST3 here.
+# (TEST3 requires TEST2a, but TEST2a has already been m4_provide'd, so
+# nothing happens.)
+# DUMP: BODY
+# BODY: TEST2a
+# GROW - 2: TEST3
+# diversions: GROW - 2, GROW - 1, GROW, BODY |-
+# Than the diversion is appended to DUMP, and popped.
+# DUMP: BODY
+# BODY: TEST2a; TEST3
+# diversions: GROW - 1, GROW, BODY |-
+#
+# * TEST1 requires TEST2b (contd.)
+# The content of TEST2b is expanded...
+# DUMP: BODY
+# BODY: TEST2a; TEST3
+# GROW - 1: TEST2b,
+# diversions: GROW - 1, GROW, BODY |-
+# ... and moved to DUMP.
+# DUMP: BODY
+# BODY: TEST2a; TEST3; TEST2b
+# diversions: GROW, BODY |-
+#
+# * TEST1 is expanded: epilogue
+# TEST1's own content is in GROW...
+# DUMP: BODY
+# BODY: TEST2a; TEST3; TEST2b
+# GROW: TEST1
+# diversions: BODY |-
+# ... and it's epilogue moves it to DUMP and then undefines DUMP.
+# DUMP: undefined
+# BODY: TEST2a; TEST3; TEST2b; TEST1
+# diversions: BODY |-
+#
+#
+# 2. Keeping track of the expansion stack
+# =======================================
+#
+# When M4 expansion goes wrong it is often extremely hard to find the
+# path amongst macros that drove to the failure. What is needed is
+# the stack of macro `calls'. One could imagine that GNU M4 would
+# maintain a stack of macro expansions, unfortunately it doesn't, so
+# we do it by hand. This is of course extremely costly, but the help
+# this stack provides is worth it. Nevertheless to limit the
+# performance penalty this is implemented only for m4_defun'd macros,
+# not for define'd macros.
+#
+# The scheme is simplistic: each time we enter an m4_defun'd macros,
+# we prepend its name in m4_expansion_stack, and when we exit the
+# macro, we remove it (thanks to pushdef/popdef).
+#
+# In addition, we want to detect circular m4_require dependencies.
+# Each time we expand a macro FOO we define _m4_expanding(FOO); and
+# m4_require(BAR) simply checks whether _m4_expanding(BAR) is defined.
+
+
+# m4_expansion_stack_push(TEXT)
+# -----------------------------
+m4_define([m4_expansion_stack_push],
+[m4_pushdef([m4_expansion_stack],
+ [$1]m4_ifdef([m4_expansion_stack], [
+_m4_defn([m4_expansion_stack])]))])
+
+
+# m4_expansion_stack_pop
+# ----------------------
+m4_define([m4_expansion_stack_pop],
+[m4_popdef([m4_expansion_stack])])
+
+
+# m4_expansion_stack_dump
+# -----------------------
+# Dump the expansion stack.
+m4_define([m4_expansion_stack_dump],
+[m4_ifdef([m4_expansion_stack],
+ [m4_errprintn(_m4_defn([m4_expansion_stack]))])dnl
+m4_errprintn(m4_location[: the top level])])
+
+
+# _m4_divert(GROW)
+# ----------------
+# This diversion is used by the m4_defun/m4_require machinery. It is
+# important to keep room before GROW because for each nested
+# AC_REQUIRE we use an additional diversion (i.e., two m4_require's
+# will use GROW - 2. More than 3 levels has never seemed to be
+# needed.)
+#
+# ...
+# - GROW - 2
+# m4_require'd code, 2 level deep
+# - GROW - 1
+# m4_require'd code, 1 level deep
+# - GROW
+# m4_defun'd macros are elaborated here.
+
+m4_define([_m4_divert(GROW)], 10000)
+
+
+# _m4_defun_pro(MACRO-NAME)
+# -------------------------
+# The prologue for Autoconf macros.
+#
+# This is called frequently, so minimize the number of macro invocations
+# by avoiding dnl and m4_defn overhead.
+m4_define([_m4_defun_pro],
+m4_do([[m4_ifdef([m4_expansion_stack], [], [_m4_defun_pro_outer[]])]],
+ [[m4_expansion_stack_push(_m4_defn(
+ [m4_location($1)])[: $1 is expanded from...])]],
+ [[m4_pushdef([_m4_expanding($1)])]]))
+
+m4_define([_m4_defun_pro_outer],
+[m4_copy([_m4_divert_diversion], [_m4_divert_dump])m4_divert_push([GROW])])
+
+# _m4_defun_epi(MACRO-NAME)
+# -------------------------
+# The Epilogue for Autoconf macros. MACRO-NAME only helps tracing
+# the PRO/EPI pairs.
+#
+# This is called frequently, so minimize the number of macro invocations
+# by avoiding dnl and m4_popdef overhead.
+m4_define([_m4_defun_epi],
+m4_do([[_m4_popdef([_m4_expanding($1)])]],
+ [[m4_expansion_stack_pop()]],
+ [[m4_ifdef([m4_expansion_stack], [], [_m4_defun_epi_outer[]])]],
+ [[m4_provide([$1])]]))
+
+m4_define([_m4_defun_epi_outer],
+[_m4_undefine([_m4_divert_dump])m4_divert_pop([GROW])m4_undivert([GROW])])
+
+
+# m4_defun(NAME, EXPANSION)
+# -------------------------
+# Define a macro which automatically provides itself. Add machinery
+# so the macro automatically switches expansion to the diversion
+# stack if it is not already using it. In this case, once finished,
+# it will bring back all the code accumulated in the diversion stack.
+# This, combined with m4_require, achieves the topological ordering of
+# macros. We don't use this macro to define some frequently called
+# macros that are not involved in ordering constraints, to save m4
+# processing.
+m4_define([m4_defun],
+[m4_define([m4_location($1)], m4_location)dnl
+m4_define([$1],
+ [_m4_defun_pro([$1])$2[]_m4_defun_epi([$1])])])
+
+
+# m4_defun_once(NAME, EXPANSION)
+# ------------------------------
+# As m4_defun, but issues the EXPANSION only once, and warns if used
+# several times.
+m4_define([m4_defun_once],
+[m4_define([m4_location($1)], m4_location)dnl
+m4_define([$1],
+ [m4_provide_if([$1],
+ [m4_warn([syntax], [$1 invoked multiple times])],
+ [_m4_defun_pro([$1])$2[]_m4_defun_epi([$1])])])])
+
+
+# m4_pattern_forbid(ERE, [WHY])
+# -----------------------------
+# Declare that no token matching the forbidden extended regular
+# expression ERE should be seen in the output unless...
+m4_define([m4_pattern_forbid], [])
+
+
+# m4_pattern_allow(ERE)
+# ---------------------
+# ... that token also matches the allowed extended regular expression ERE.
+# Both used via traces.
+m4_define([m4_pattern_allow], [])
+
+
+## --------------------------------- ##
+## 11. Dependencies between macros. ##
+## --------------------------------- ##
+
+
+# m4_before(THIS-MACRO-NAME, CALLED-MACRO-NAME)
+# ---------------------------------------------
+# Issue a warning if CALLED-MACRO-NAME was called before THIS-MACRO-NAME.
+m4_define([m4_before],
+[m4_provide_if([$2],
+ [m4_warn([syntax], [$2 was called before $1])])])
+
+
+# m4_require(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK])
+# -----------------------------------------------------------
+# If NAME-TO-CHECK has never been expanded (actually, if it is not
+# m4_provide'd), expand BODY-TO-EXPAND *before* the current macro
+# expansion. Once expanded, emit it in _m4_divert_dump. Keep track
+# of the m4_require chain in m4_expansion_stack.
+#
+# The normal cases are:
+#
+# - NAME-TO-CHECK == BODY-TO-EXPAND
+# Which you can use for regular macros with or without arguments, e.g.,
+# m4_require([AC_PROG_CC], [AC_PROG_CC])
+# m4_require([AC_CHECK_HEADERS(limits.h)], [AC_CHECK_HEADERS(limits.h)])
+# which is just the same as
+# m4_require([AC_PROG_CC])
+# m4_require([AC_CHECK_HEADERS(limits.h)])
+#
+# - BODY-TO-EXPAND == m4_indir([NAME-TO-CHECK])
+# In the case of macros with irregular names. For instance:
+# m4_require([AC_LANG_COMPILER(C)], [indir([AC_LANG_COMPILER(C)])])
+# which means `if the macro named `AC_LANG_COMPILER(C)' (the parens are
+# part of the name, it is not an argument) has not been run, then
+# call it.'
+# Had you used
+# m4_require([AC_LANG_COMPILER(C)], [AC_LANG_COMPILER(C)])
+# then m4_require would have tried to expand `AC_LANG_COMPILER(C)', i.e.,
+# call the macro `AC_LANG_COMPILER' with `C' as argument.
+#
+# You could argue that `AC_LANG_COMPILER', when it receives an argument
+# such as `C' should dispatch the call to `AC_LANG_COMPILER(C)'. But this
+# `extension' prevents `AC_LANG_COMPILER' from having actual arguments that
+# it passes to `AC_LANG_COMPILER(C)'.
+#
+# This is called frequently, so minimize the number of macro invocations
+# by avoiding dnl and other overhead on the common path.
+m4_define([m4_require],
+m4_do([[m4_ifdef([_m4_expanding($1)],
+ [m4_fatal([$0: circular dependency of $1])])]],
+ [[m4_ifdef([_m4_divert_dump], [],
+ [m4_fatal([$0($1): cannot be used outside of an ]dnl
+m4_bmatch([$0], [^AC_], [[AC_DEFUN]], [[m4_defun]])['d macro])])]],
+ [[m4_provide_if([$1],
+ [],
+ [_m4_require_call([$1], [$2])])]]))
+
+
+# _m4_require_call(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK])
+# -----------------------------------------------------------------
+# If m4_require decides to expand the body, it calls this macro.
+#
+# This is called frequently, so minimize the number of macro invocations
+# by avoiding dnl and other overhead on the common path.
+m4_define([_m4_require_call],
+m4_do([[m4_define([_m4_divert_grow], m4_decr(_m4_divert_grow))]],
+ [[m4_divert_push(_m4_divert_grow)]],
+ [[m4_default([$2], [$1])
+m4_provide_if([$1],
+ [],
+ [m4_warn([syntax],
+ [$1 is m4_require'd but not m4_defun'd])])]],
+ [[m4_divert(_m4_defn([_m4_divert_dump]))]],
+ [[m4_undivert(_m4_divert_grow)]],
+ [[m4_divert_pop(_m4_divert_grow)]],
+ [[m4_define([_m4_divert_grow], m4_incr(_m4_divert_grow))]]))
+
+
+# _m4_divert_grow
+# ---------------
+# The counter for _m4_require_call.
+m4_define([_m4_divert_grow], _m4_divert([GROW]))
+
+
+# m4_expand_once(TEXT, [WITNESS = TEXT])
+# --------------------------------------
+# If TEXT has never been expanded, expand it *here*. Use WITNESS as
+# as a memory that TEXT has already been expanded.
+m4_define([m4_expand_once],
+[m4_provide_if(m4_ifval([$2], [[$2]], [[$1]]),
+ [],
+ [m4_provide(m4_ifval([$2], [[$2]], [[$1]]))[]$1])])
+
+
+# m4_provide(MACRO-NAME)
+# ----------------------
+m4_define([m4_provide],
+[m4_define([m4_provide($1)])])
+
+
+# m4_provide_if(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -------------------------------------------------------
+# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
+# The purpose of this macro is to provide the user with a means to
+# check macros which are provided without letting her know how the
+# information is coded.
+m4_define([m4_provide_if],
+[m4_ifdef([m4_provide($1)],
+ [$2], [$3])])
+
+
+## --------------------- ##
+## 12. Text processing. ##
+## --------------------- ##
+
+
+# m4_cr_letters
+# m4_cr_LETTERS
+# m4_cr_Letters
+# -------------
+m4_define([m4_cr_letters], [abcdefghijklmnopqrstuvwxyz])
+m4_define([m4_cr_LETTERS], [ABCDEFGHIJKLMNOPQRSTUVWXYZ])
+m4_define([m4_cr_Letters],
+m4_defn([m4_cr_letters])dnl
+m4_defn([m4_cr_LETTERS])dnl
+)
+
+
+# m4_cr_digits
+# ------------
+m4_define([m4_cr_digits], [0123456789])
+
+
+# m4_cr_alnum
+# -----------
+m4_define([m4_cr_alnum],
+m4_defn([m4_cr_Letters])dnl
+m4_defn([m4_cr_digits])dnl
+)
+
+
+# m4_cr_symbols1
+# m4_cr_symbols2
+# -------------------------------
+m4_define([m4_cr_symbols1],
+m4_defn([m4_cr_Letters])dnl
+_)
+
+m4_define([m4_cr_symbols2],
+m4_defn([m4_cr_symbols1])dnl
+m4_defn([m4_cr_digits])dnl
+)
+
+# m4_cr_all
+# ---------
+# The character range representing everything, with `-' as the last
+# character, since it is special to m4_translit. Use with care, because
+# it contains characters special to M4 (fortunately, both ASCII and EBCDIC
+# have [] in order, so m4_defn([m4_cr_all]) remains a valid string). It
+# also contains characters special to terminals, so it should never be
+# displayed in an error message. Also, attempts to map [ and ] to other
+# characters via m4_translit must deal with the fact that m4_translit does
+# not add quotes to the output.
+#
+# It is mainly useful in generating inverted character range maps, for use
+# in places where m4_translit is faster than an equivalent m4_bpatsubst;
+# the regex `[^a-z]' is equivalent to:
+# m4_translit(m4_dquote(m4_defn([m4_cr_all])), [a-z])
+m4_define([m4_cr_all],
+m4_translit(m4_dquote(m4_format(m4_dquote(m4_for(
+ ,1,255,,[[%c]]))m4_for([i],1,255,,[,i]))), [-])-)
+
+
+# _m4_define_cr_not(CATEGORY)
+# ---------------------------
+# Define m4_cr_not_CATEGORY as the inverse of m4_cr_CATEGORY.
+m4_define([_m4_define_cr_not],
+[m4_define([m4_cr_not_$1],
+ m4_translit(m4_dquote(m4_defn([m4_cr_all])),
+ m4_defn([m4_cr_$1])))])
+
+
+# m4_cr_not_letters
+# m4_cr_not_LETTERS
+# m4_cr_not_Letters
+# m4_cr_not_digits
+# m4_cr_not_alnum
+# m4_cr_not_symbols1
+# m4_cr_not_symbols2
+# ------------------
+# Inverse character sets
+_m4_define_cr_not([letters])
+_m4_define_cr_not([LETTERS])
+_m4_define_cr_not([Letters])
+_m4_define_cr_not([digits])
+_m4_define_cr_not([alnum])
+_m4_define_cr_not([symbols1])
+_m4_define_cr_not([symbols2])
+
+
+# m4_newline
+# ----------
+# Expands to a newline. Exists for formatting reasons.
+m4_define([m4_newline], [
+])
+
+
+# m4_re_escape(STRING)
+# --------------------
+# Escape RE active characters in STRING.
+m4_define([m4_re_escape],
+[m4_bpatsubst([$1],
+ [[][*+.?\^$]], [\\\&])])
+
+
+# m4_re_string
+# ------------
+# Regexp for `[a-zA-Z_0-9]*'
+# m4_dquote provides literal [] for the character class.
+m4_define([m4_re_string],
+m4_dquote(m4_defn([m4_cr_symbols2]))dnl
+[*]dnl
+)
+
+
+# m4_re_word
+# ----------
+# Regexp for `[a-zA-Z_][a-zA-Z_0-9]*'
+m4_define([m4_re_word],
+m4_dquote(m4_defn([m4_cr_symbols1]))dnl
+m4_defn([m4_re_string])dnl
+)
+
+
+# m4_tolower(STRING)
+# m4_toupper(STRING)
+# ------------------
+# These macros convert STRING to lowercase or uppercase.
+#
+# Rather than expand the m4_defn each time, we inline them up front.
+m4_define([m4_tolower],
+[m4_translit([$1], ]m4_dquote(m4_defn([m4_cr_LETTERS]))[,
+ ]m4_dquote(m4_defn([m4_cr_letters]))[)])
+m4_define([m4_toupper],
+[m4_translit([$1], ]m4_dquote(m4_defn([m4_cr_letters]))[,
+ ]m4_dquote(m4_defn([m4_cr_LETTERS]))[)])
+
+
+# m4_split(STRING, [REGEXP])
+# --------------------------
+#
+# Split STRING into an m4 list of quoted elements. The elements are
+# quoted with [ and ]. Beginning spaces and end spaces *are kept*.
+# Use m4_strip to remove them.
+#
+# REGEXP specifies where to split. Default is [\t ]+.
+#
+# If STRING is empty, the result is an empty list.
+#
+# Pay attention to the m4_changequotes. When m4 reads the definition of
+# m4_split, it still has quotes set to [ and ]. Luckily, these are matched
+# in the macro body, so the definition is stored correctly. Use the same
+# alternate quotes as m4_noquote; it must be unlikely to appear in $1.
+#
+# Also, notice that $1 is quoted twice, since we want the result to
+# be quoted. Then you should understand that the argument of
+# patsubst is -=<{(STRING)}>=- (i.e., with additional -=<{( and )}>=-).
+#
+# This macro is safe on active symbols, i.e.:
+# m4_define(active, ACTIVE)
+# m4_split([active active ])end
+# => [active], [active], []end
+#
+# Optimize on regex of ` ' (space), since m4_foreach_w already guarantees
+# that the list contains single space separators, and a common case is
+# splitting a single-element list. This macro is called frequently,
+# so avoid unnecessary dnl inside the definition.
+m4_define([m4_split],
+[m4_if([$1], [], [],
+ [$2], [ ], [m4_if(m4_index([$1], [ ]), [-1], [[[$1]]], [_$0($@)])],
+ [$2], [], [_$0([$1], [[ ]+])],
+ [_$0($@)])])
+
+m4_define([_m4_split],
+[m4_changequote([-=<{(],[)}>=-])]dnl
+[[m4_bpatsubst(-=<{(-=<{($1)}>=-)}>=-, -=<{($2)}>=-,
+ -=<{(], [)}>=-)]m4_changequote([, ])])
+
+
+
+# m4_flatten(STRING)
+# ------------------
+# If STRING contains end of lines, replace them with spaces. If there
+# are backslashed end of lines, remove them. This macro is safe with
+# active symbols.
+# m4_define(active, ACTIVE)
+# m4_flatten([active
+# act\
+# ive])end
+# => active activeend
+#
+# In m4, m4_bpatsubst is expensive, so first check for a newline.
+m4_define([m4_flatten],
+[m4_if(m4_index([$1], [
+]), [-1], [[$1]],
+ [m4_translit(m4_bpatsubst([[[$1]]], [\\
+]), [
+], [ ])])])
+
+
+# m4_strip(STRING)
+# ----------------
+# Expands into STRING with tabs and spaces singled out into a single
+# space, and removing leading and trailing spaces.
+#
+# This macro is robust to active symbols.
+# m4_define(active, ACTIVE)
+# m4_strip([ active <tab> <tab>active ])end
+# => active activeend
+#
+# First, notice that we guarantee trailing space. Why? Because regular
+# expressions are greedy, and `.* ?' would always group the space into the
+# .* portion. The algorithm is simpler by avoiding `?' at the end. The
+# algorithm correctly strips everything if STRING is just ` '.
+#
+# Then notice the second pattern: it is in charge of removing the
+# leading/trailing spaces. Why not just `[^ ]'? Because they are
+# applied to over-quoted strings, i.e. more or less [STRING], due
+# to the limitations of m4_bpatsubsts. So the leading space in STRING
+# is the *second* character; equally for the trailing space.
+m4_define([m4_strip],
+[m4_bpatsubsts([$1 ],
+ [[ ]+], [ ],
+ [^. ?\(.*\) .$], [[[\1]]])])
+
+
+# m4_normalize(STRING)
+# --------------------
+# Apply m4_flatten and m4_strip to STRING.
+#
+# The argument is quoted, so that the macro is robust to active symbols:
+#
+# m4_define(active, ACTIVE)
+# m4_normalize([ act\
+# ive
+# active ])end
+# => active activeend
+
+m4_define([m4_normalize],
+[m4_strip(m4_flatten([$1]))])
+
+
+
+# m4_join(SEP, ARG1, ARG2...)
+# ---------------------------
+# Produce ARG1SEPARG2...SEPARGn. Avoid back-to-back SEP when a given ARG
+# is the empty string. No expansion is performed on SEP or ARGs.
+#
+# Since the number of arguments to join can be arbitrarily long, we
+# want to avoid having more than one $@ in the macro definition;
+# otherwise, the expansion would require twice the memory of the already
+# long list. Hence, m4_join merely looks for the first non-empty element,
+# and outputs just that element; while _m4_join looks for all non-empty
+# elements, and outputs them following a separator. The final trick to
+# note is that we decide between recursing with $0 or _$0 based on the
+# nested m4_if ending with `_'.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift2($@))])])
+m4_define([_m4_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift2($@))])])
+
+# 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.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_joinall], [[$2]_$0([$1], m4_shift($@))])
+m4_define([_m4_joinall],
+[m4_if([$#], [2], [], [[$1$3]$0([$1], m4_shift2($@))])])
+
+# m4_combine([SEPARATOR], PREFIX-LIST, [INFIX], SUFFIX...)
+# --------------------------------------------------------
+# Produce the pairwise combination of every element in the quoted,
+# comma-separated PREFIX-LIST with every element from the SUFFIX arguments.
+# Each pair is joined with INFIX, and pairs are separated by SEPARATOR.
+# No expansion occurs on SEPARATOR, INFIX, or elements of either list.
+#
+# For example:
+# m4_combine([, ], [[a], [b], [c]], [-], [1], [2], [3])
+# => a-1, a-2, a-3, b-1, b-2, b-3, c-1, c-2, c-3
+#
+# In order to have the correct number of SEPARATORs, we use a temporary
+# variable that redefines itself after the first use. We must use defn
+# rather than overquoting in case PREFIX or SUFFIX contains $1, but use
+# _m4_defn for speed. Likewise, we compute the m4_shift3 only once,
+# rather than in each iteration of the outer m4_foreach.
+m4_define([m4_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([m4_Separator], [m4_define([m4_Separator],
+ _m4_defn([m4_echo]))])]]dnl
+[[m4_foreach([m4_Prefix], [$2],
+ [m4_foreach([m4_Suffix], ]m4_dquote(m4_dquote(m4_shift3($@)))[,
+ [m4_Separator([$1])[]_m4_defn([m4_Prefix])[$3]_m4_defn(
+ [m4_Suffix])])])]]dnl
+[[_m4_popdef([m4_Separator])])])
+
+
+# m4_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR`'STRING'
+# at the end. It is valid to use this macro with MACRO-NAME undefined,
+# in which case no SEPARATOR is added. Be aware that the criterion is
+# `not being defined', and not `not being empty'.
+#
+# Note that neither STRING nor SEPARATOR are expanded here; rather, when
+# you expand MACRO-NAME, they will be expanded at that point in time.
+#
+# This macro is robust to active symbols. It can be used to grow
+# strings.
+#
+# | m4_define(active, ACTIVE)dnl
+# | m4_append([sentence], [This is an])dnl
+# | m4_append([sentence], [ active ])dnl
+# | m4_append([sentence], [symbol.])dnl
+# | sentence
+# | m4_undefine([active])dnl
+# | sentence
+# => This is an ACTIVE symbol.
+# => This is an active symbol.
+#
+# It can be used to define hooks.
+#
+# | m4_define(active, ACTIVE)dnl
+# | m4_append([hooks], [m4_define([act1], [act2])])dnl
+# | m4_append([hooks], [m4_define([act2], [active])])dnl
+# | m4_undefine([active])dnl
+# | act1
+# | hooks
+# | act1
+# => act1
+# =>
+# => active
+#
+# It can also be used to create lists, although this particular usage was
+# broken prior to autoconf 2.62.
+# | m4_append([list], [one], [, ])dnl
+# | m4_append([list], [two], [, ])dnl
+# | m4_append([list], [three], [, ])dnl
+# | list
+# | m4_dquote(list)
+# => one, two, three
+# => [one],[two],[three]
+#
+# Note that m4_append can benefit from amortized O(n) m4 behavior, if
+# the underlying m4 implementation is smart enough to avoid copying existing
+# contents when enlarging a macro's definition into any pre-allocated storage
+# (m4 1.4.x unfortunately does not implement this optimization). We do
+# not implement m4_prepend, since it is inherently O(n^2) (pre-allocated
+# storage only occurs at the end of a macro, so the existing contents must
+# always be moved).
+#
+# Use _m4_defn for speed.
+m4_define([m4_append],
+[m4_define([$1], m4_ifdef([$1], [_m4_defn([$1])[$3]])[$2])])
+
+
+# m4_append_uniq(MACRO-NAME, STRING, [SEPARATOR], [IF-UNIQ], [IF-DUP])
+# --------------------------------------------------------------------
+# Like `m4_append', but append only if not yet present. Additionally,
+# expand IF-UNIQ if STRING was appended, or IF-DUP if STRING was already
+# present. Also, warn if SEPARATOR is not empty and occurs within STRING,
+# as the algorithm no longer guarantees uniqueness.
+#
+# Note that while m4_append can be O(n) (depending on the quality of the
+# underlying M4 implementation), m4_append_uniq is inherently O(n^2)
+# because each append operation searches the entire string.
+m4_define([m4_append_uniq],
+[m4_ifval([$3], [m4_if(m4_index([$2], [$3]), [-1], [],
+ [m4_warn([syntax],
+ [$0: `$2' contains `$3'])])])_$0($@)])
+m4_define([_m4_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]_m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [m4_append([$1], [$2], [$3])$4], [$5])],
+ [m4_define([$1], [$2])$4])])
+
+# m4_append_uniq_w(MACRO-NAME, STRINGS)
+# -------------------------------------
+# For each of the words in the whitespace separated list STRINGS, append
+# only the unique strings to the definition of MACRO-NAME.
+#
+# Use _m4_defn for speed.
+m4_define([m4_append_uniq_w],
+[m4_foreach_w([m4_Word], [$2],
+ [_m4_append_uniq([$1], _m4_defn([m4_Word]), [ ])])])
+
+
+# m4_text_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH])
+# -------------------------------------------------------
+# Expands into STRING wrapped to hold in WIDTH columns (default = 79).
+# If PREFIX is given, each line is prefixed with it. If FIRST-PREFIX is
+# specified, then the first line is prefixed with it. As a special case,
+# if the length of FIRST-PREFIX is greater than that of PREFIX, then
+# FIRST-PREFIX will be left alone on the first line.
+#
+# No expansion occurs on the contents STRING, PREFIX, or FIRST-PREFIX,
+# although quadrigraphs are correctly recognized.
+#
+# Typical outputs are:
+#
+# m4_text_wrap([Short string */], [ ], [/* ], 20)
+# => /* Short string */
+#
+# m4_text_wrap([Much longer string */], [ ], [/* ], 20)
+# => /* Much longer
+# => string */
+#
+# m4_text_wrap([Short doc.], [ ], [ --short ], 30)
+# => --short Short doc.
+#
+# m4_text_wrap([Short doc.], [ ], [ --too-wide ], 30)
+# => --too-wide
+# => Short doc.
+#
+# m4_text_wrap([Super long documentation.], [ ], [ --too-wide ], 30)
+# => --too-wide
+# => Super long
+# => documentation.
+#
+# FIXME: there is no checking of a longer PREFIX than WIDTH, but do
+# we really want to bother with people trying each single corner
+# of a software?
+#
+# This macro does not leave a trailing space behind the last word of a line,
+# which complicates it a bit. The algorithm is otherwise stupid and simple:
+# all the words are preceded by m4_Separator which is defined to empty for
+# the first word, and then ` ' (single space) for all the others.
+#
+# The algorithm uses a helper that uses $2 through $4 directly, rather than
+# using local variables, to avoid m4_defn overhead, or expansion swallowing
+# any $. It also bypasses m4_popdef overhead with _m4_popdef since no user
+# macro expansion occurs in the meantime. Also, the definition is written
+# with m4_do, to avoid time wasted on dnl during expansion (since this is
+# already a time-consuming macro).
+m4_define([m4_text_wrap],
+[_$0([$1], [$2], m4_if([$3], [], [[$2]], [[$3]]),
+ m4_if([$4], [], [79], [[$4]]))])
+m4_define([_m4_text_wrap],
+m4_do(dnl set up local variables, to avoid repeated calculations
+[[m4_pushdef([m4_Indent], m4_qlen([$2]))]],
+[[m4_pushdef([m4_Cursor], m4_qlen([$3]))]],
+[[m4_pushdef([m4_Separator], [m4_define([m4_Separator], [ ])])]],
+dnl expand the first prefix, then check its length vs. regular prefix
+dnl same length: nothing special
+dnl prefix1 longer: output on line by itself, and reset cursor
+dnl prefix1 shorter: pad to length of prefix, and reset cursor
+[[[$3]m4_cond([m4_Cursor], m4_Indent, [],
+ [m4_eval(m4_Cursor > m4_Indent)], [1], [
+[$2]m4_define([m4_Cursor], m4_Indent)],
+ [m4_format([%*s], m4_max([0],
+ m4_eval(m4_Indent - m4_Cursor)), [])m4_define([m4_Cursor], m4_Indent)])]],
+dnl now, for each word, compute the curser after the word is output, then
+dnl check if the cursor would exceed the wrap column
+dnl if so, reset cursor, and insert newline and prefix
+dnl if not, insert the separator (usually a space)
+dnl either way, insert the word
+[[m4_foreach_w([m4_Word], [$1],
+ [m4_define([m4_Cursor],
+ m4_eval(m4_Cursor + m4_qlen(_m4_defn([m4_Word]))
+ + 1))m4_if(m4_eval(m4_Cursor > ([$4])),
+ [1], [m4_define([m4_Cursor],
+ m4_eval(m4_Indent + m4_qlen(_m4_defn([m4_Word])) + 1))
+[$2]],
+ [m4_Separator[]])_m4_defn([m4_Word])])]],
+dnl finally, clean up the local variabls
+[[_m4_popdef([m4_Separator], [m4_Cursor], [m4_Indent])]]))
+
+
+# m4_text_box(MESSAGE, [FRAME-CHARACTER = `-'])
+# ---------------------------------------------
+# Turn MESSAGE into:
+# ## ------- ##
+# ## MESSAGE ##
+# ## ------- ##
+# using FRAME-CHARACTER in the border.
+m4_define([m4_text_box],
+[m4_pushdef([m4_Border],
+ m4_translit(m4_format([%*s], m4_qlen(m4_expand([$1])), []),
+ [ ], m4_if([$2], [], [[-]], [[$2]])))dnl
+@%:@@%:@ m4_Border @%:@@%:@
+@%:@@%:@ $1 @%:@@%:@
+@%:@@%:@ m4_Border @%:@@%:@_m4_popdef([m4_Border])dnl
+])
+
+
+# m4_qlen(STRING)
+# ---------------
+# Expands to the length of STRING after autom4te converts all quadrigraphs.
+#
+# Avoid bpatsubsts for the common case of no quadrigraphs.
+m4_define([m4_qlen],
+[m4_if(m4_index([$1], [@]), [-1], [m4_len([$1])],
+ [m4_len(m4_bpatsubst([[$1]],
+ [@\(\(<:\|:>\|S|\|%:\|\{:\|:\}\)\(@\)\|&t@\)],
+ [\3]))])])
+
+
+# m4_qdelta(STRING)
+# -----------------
+# Expands to the net change in the length of STRING from autom4te converting the
+# quadrigraphs in STRING. This number is always negative or zero.
+m4_define([m4_qdelta],
+[m4_eval(m4_qlen([$1]) - m4_len([$1]))])
+
+
+
+## ----------------------- ##
+## 13. Number processing. ##
+## ----------------------- ##
+
+# m4_cmp(A, B)
+# ------------
+# Compare two integer expressions.
+# A < B -> -1
+# A = B -> 0
+# A > B -> 1
+m4_define([m4_cmp],
+[m4_eval((([$1]) > ([$2])) - (([$1]) < ([$2])))])
+
+
+# m4_list_cmp(A, B)
+# -----------------
+#
+# Compare the two lists of integer expressions A and B. For instance:
+# m4_list_cmp([1, 0], [1]) -> 0
+# m4_list_cmp([1, 0], [1, 0]) -> 0
+# m4_list_cmp([1, 2], [1, 0]) -> 1
+# m4_list_cmp([1, 2, 3], [1, 2]) -> 1
+# m4_list_cmp([1, 2, -3], [1, 2]) -> -1
+# m4_list_cmp([1, 0], [1, 2]) -> -1
+# m4_list_cmp([1], [1, 2]) -> -1
+# m4_define([xa], [oops])dnl
+# m4_list_cmp([[0xa]], [5+5]) -> 0
+#
+# Rather than face the overhead of m4_case, we use a helper function whose
+# expansion includes the name of the macro to invoke on the tail, either
+# m4_ignore or m4_unquote. This is particularly useful when comparing
+# long lists, since less text is being expanded for deciding when to end
+# recursion. The recursion is between a pair of macros that alternate
+# which list is trimmed by one element; this is more efficient than
+# calling m4_cdr on both lists from a single macro. Guarantee exactly
+# one expansion of both lists' side effects.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_list_cmp],
+[_$0_raw(m4_dquote($1), m4_dquote($2))])
+
+m4_define([_m4_list_cmp_raw],
+[m4_if([$1], [$2], [0], [_m4_list_cmp_1([$1], $2)])])
+
+m4_define([_m4_list_cmp],
+[m4_if([$1], [], [0m4_ignore], [$2], [0], [m4_unquote], [$2m4_ignore])])
+
+m4_define([_m4_list_cmp_1],
+[_m4_list_cmp_2([$2], [m4_shift2($@)], $1)])
+
+m4_define([_m4_list_cmp_2],
+[_m4_list_cmp([$1$3], m4_cmp([$3+0], [$1+0]))(
+ [_m4_list_cmp_1(m4_dquote(m4_shift3($@)), $2)])])
+
+# m4_max(EXPR, ...)
+# m4_min(EXPR, ...)
+# -----------------
+# Return the decimal value of the maximum (or minimum) in a series of
+# integer expressions.
+#
+# M4 1.4.x doesn't provide ?:. Hence this huge m4_eval. Avoid m4_eval
+# if both arguments are identical, but be aware of m4_max(0xa, 10) (hence
+# the use of <=, not just <, in the second multiply).
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_max],
+[m4_if([$#], [0], [m4_fatal([too few arguments to $0])],
+ [$#], [1], [m4_eval([$1])],
+ [$#$1], [2$2], [m4_eval([$1])],
+ [$#], [2], [_$0($@)],
+ [_m4_minmax([_$0], $@)])])
+
+m4_define([_m4_max],
+[m4_eval((([$1]) > ([$2])) * ([$1]) + (([$1]) <= ([$2])) * ([$2]))])
+
+m4_define([m4_min],
+[m4_if([$#], [0], [m4_fatal([too few arguments to $0])],
+ [$#], [1], [m4_eval([$1])],
+ [$#$1], [2$2], [m4_eval([$1])],
+ [$#], [2], [_$0($@)],
+ [_m4_minmax([_$0], $@)])])
+
+m4_define([_m4_min],
+[m4_eval((([$1]) < ([$2])) * ([$1]) + (([$1]) >= ([$2])) * ([$2]))])
+
+# _m4_minmax(METHOD, ARG1, ARG2...)
+# ---------------------------------
+# Common recursion code for m4_max and m4_min. METHOD must be _m4_max
+# or _m4_min, and there must be at least two arguments to combine.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([_m4_minmax],
+[m4_if([$#], [3], [$1([$2], [$3])],
+ [$0([$1], $1([$2], [$3]), m4_shift3($@))])])
+
+
+# m4_sign(A)
+# ----------
+# The sign of the integer expression A.
+m4_define([m4_sign],
+[m4_eval((([$1]) > 0) - (([$1]) < 0))])
+
+
+
+## ------------------------ ##
+## 14. Version processing. ##
+## ------------------------ ##
+
+
+# m4_version_unletter(VERSION)
+# ----------------------------
+# Normalize beta version numbers with letters to numeric expressions, which
+# can then be handed to m4_eval for the purpose of comparison.
+#
+# Nl -> (N+1).-1.(l#)
+#
+# for example:
+# [2.14a] -> [2.14+1.-1.[0r36:a]] -> 2.15.-1.10
+# [2.14b] -> [2.15+1.-1.[0r36:b]] -> 2.15.-1.11
+# [2.61aa.b] -> [2.61+1.-1.[0r36:aa],+1.-1.[0r36:b]] -> 2.62.-1.370.1.-1.11
+#
+# This macro expects reasonable version numbers, but can handle double
+# letters and does not expand any macros. Original version strings can
+# use both `.' and `-' separators.
+#
+# Inline constant expansions, to avoid m4_defn overhead.
+# _m4_version_unletter is the real workhorse used by m4_version_compare,
+# but since [0r36:a] is less readable than 10, we provide a wrapper for
+# human use.
+m4_define([m4_version_unletter],
+[m4_map_sep([m4_eval], [.],
+ m4_dquote(m4_dquote_elt(m4_unquote(_$0([$1])))))])
+m4_define([_m4_version_unletter],
+[m4_bpatsubst(m4_translit([[[$1]]], [.-], [,,]),]dnl
+m4_dquote(m4_dquote(m4_defn([m4_cr_Letters])))[[+],
+ [+1,-1,[0r36:\&]])])
+
+
+# m4_version_compare(VERSION-1, VERSION-2)
+# ----------------------------------------
+# Compare the two version numbers and expand into
+# -1 if VERSION-1 < VERSION-2
+# 0 if =
+# 1 if >
+#
+# Since _m4_version_unletter does not output side effects, we can
+# safely bypass the overhead of m4_version_cmp.
+m4_define([m4_version_compare],
+[_m4_list_cmp_raw(_m4_version_unletter([$1]), _m4_version_unletter([$2]))])
+
+
+# m4_PACKAGE_NAME
+# m4_PACKAGE_TARNAME
+# m4_PACKAGE_VERSION
+# m4_PACKAGE_STRING
+# m4_PACKAGE_BUGREPORT
+# --------------------
+# If m4sugar/version.m4 is present, then define version strings. This
+# file is optional, provided by Autoconf but absent in Bison.
+m4_sinclude([m4sugar/version.m4])
+
+
+# m4_version_prereq(VERSION, [IF-OK], [IF-NOT = FAIL])
+# ----------------------------------------------------
+# Check this Autoconf version against VERSION.
+m4_define([m4_version_prereq],
+m4_ifdef([m4_PACKAGE_VERSION],
+[[m4_if(m4_version_compare(]m4_dquote(m4_defn([m4_PACKAGE_VERSION]))[, [$1]),
+ [-1],
+ [m4_default([$3],
+ [m4_fatal([Autoconf version $1 or higher is required],
+ [63])])],
+ [$2])]],
+[[m4_fatal([m4sugar/version.m4 not found])]]))
+
+
+## ------------------ ##
+## 15. Set handling. ##
+## ------------------ ##
+
+# Autoconf likes to create arbitrarily large sets; for example, as of
+# this writing, the configure.ac for coreutils tracks a set of more
+# than 400 AC_SUBST. How do we track all of these set members,
+# without introducing duplicates? We could use m4_append_uniq, with
+# the set NAME residing in the contents of the macro NAME.
+# Unfortunately, m4_append_uniq is quadratic for set creation, because
+# it costs O(n) to search the string for each of O(n) insertions; not
+# to mention that with m4 1.4.x, even using m4_append is slow, costing
+# O(n) rather than O(1) per insertion. Other set operations, not used
+# by Autoconf but still possible by manipulation of the definition
+# tracked in macro NAME, include O(n) deletion of one element and O(n)
+# computation of set size. Because the set is exposed to the user via
+# the definition of a single macro, we cannot cache any data about the
+# set without risking the cache being invalidated by the user
+# redefining NAME.
+#
+# Can we do better? Yes, because m4 gives us an O(1) search function
+# for free: ifdef. Additionally, even m4 1.4.x gives us an O(1)
+# insert operation for free: pushdef. But to use these, we must
+# represent the set via a group of macros; to keep the set consistent,
+# we must hide the set so that the user can only manipulate it through
+# accessor macros. The contents of the set are maintained through two
+# access points; _m4_set([name]) is a pushdef stack of values in the
+# set, useful for O(n) traversal of the set contents; while the
+# existence of _m4_set([name],value) with no particular value is
+# useful for O(1) querying of set membership. And since the user
+# cannot externally manipulate the set, we are free to add additional
+# caching macros for other performance improvements. Deletion can be
+# O(1) per element rather than O(n), by reworking the definition of
+# _m4_set([name],value) to be 0 or 1 based on current membership, and
+# adding _m4_set_cleanup(name) to defer the O(n) cleanup of
+# _m4_set([name]) until we have another reason to do an O(n)
+# traversal. The existence of _m4_set_cleanup(name) can then be used
+# elsewhere to determine if we must dereference _m4_set([name],value),
+# or assume that definition implies set membership. Finally, size can
+# be tracked in an O(1) fashion with _m4_set_size(name).
+#
+# The quoting in _m4_set([name],value) is chosen so that there is no
+# ambiguity with a set whose name contains a comma, and so that we can
+# supply the value via _m4_defn([_m4_set([name])]) without needing any
+# quote manipulation.
+
+# m4_set_add(SET, VALUE, [IF-UNIQ], [IF-DUP])
+# -------------------------------------------
+# Add VALUE as an element of SET. Expand IF-UNIQ on the first
+# addition, and IF-DUP if it is already in the set. Addition of one
+# element is O(1), such that overall set creation is O(n).
+#
+# We do not want to add a duplicate for a previously deleted but
+# unpruned element, but it is just as easy to check existence directly
+# as it is to query _m4_set_cleanup($1).
+m4_define([m4_set_add],
+[m4_ifdef([_m4_set([$1],$2)],
+ [m4_if(m4_indir([_m4_set([$1],$2)]), [0],
+ [m4_define([_m4_set([$1],$2)],
+ [1])_m4_set_size([$1], [m4_incr])$3], [$4])],
+ [m4_define([_m4_set([$1],$2)],
+ [1])m4_pushdef([_m4_set([$1])],
+ [$2])_m4_set_size([$1], [m4_incr])$3])])
+
+# m4_set_add_all(SET, VALUE...)
+# -----------------------------
+# 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.
+#
+# Implement two recursion helpers; the check variant is slower but
+# handles the case where an element has previously been removed but
+# not pruned. The recursion helpers ignore their second argument, so
+# that we can use the faster m4_shift2 and 2 arguments, rather than
+# _m4_shift2 and one argument, as the signal to end recursion.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_set_add_all],
+[m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1])
+ + m4_len(m4_ifdef([_m4_set_cleanup($1)], [_$0_check], [_$0])([$1], $@))))])
+
+m4_define([_m4_set_add_all],
+[m4_if([$#], [2], [],
+ [m4_ifdef([_m4_set([$1],$3)], [],
+ [m4_define([_m4_set([$1],$3)], [1])m4_pushdef([_m4_set([$1])],
+ [$3])-])$0([$1], m4_shift2($@))])])
+
+m4_define([_m4_set_add_all_check],
+[m4_if([$#], [2], [],
+ [m4_set_add([$1], [$3])$0([$1], m4_shift2($@))])])
+
+# m4_set_contains(SET, VALUE, [IF-PRESENT], [IF-ABSENT])
+# ------------------------------------------------------
+# Expand IF-PRESENT if SET contains VALUE, otherwise expand IF-ABSENT.
+# This is always O(1).
+m4_define([m4_set_contains],
+[m4_ifdef([_m4_set_cleanup($1)],
+ [m4_if(m4_ifdef([_m4_set([$1],$2)],
+ [m4_indir([_m4_set([$1],$2)])], [0]), [1], [$3], [$4])],
+ [m4_ifdef([_m4_set([$1],$2)], [$3], [$4])])])
+
+# m4_set_contents(SET, [SEP])
+# ---------------------------
+# Expand to a single string containing all the elements in SET,
+# separated by SEP, without modifying SET. No provision is made for
+# disambiguating set elements that contain non-empty SEP as a
+# sub-string, or for recognizing a set that contains only the empty
+# string. Order of the output is not guaranteed. If any elements
+# have been previously removed from the set, this action will prune
+# the unused memory. This is O(n) in the size of the set before
+# pruning.
+#
+# Use _m4_popdef for speed. The existence of _m4_set_cleanup($1)
+# determines which version of _1 helper we use.
+m4_define([m4_set_contents],
+[m4_ifdef([_m4_set_cleanup($1)], [_$0_1c], [_$0_1])([$1])_$0_2([$1],
+ [_m4_defn([_m4_set_($1)])], [[$2]])])
+
+# _m4_set_contents_1(SET)
+# _m4_set_contents_1c(SET)
+# _m4_set_contents_2(SET, SEP, PREP)
+# ----------------------------------
+# Expand to a list of quoted elements currently in the set, separated
+# by SEP, and moving PREP in front of SEP on recursion. To avoid
+# nesting limit restrictions, the algorithm must be broken into two
+# parts; _1 destructively copies the stack in reverse into
+# _m4_set_($1), producing no output; then _2 destructively copies
+# _m4_set_($1) back into the stack in reverse. SEP is expanded while
+# _m4_set_($1) contains the current element, so a SEP containing
+# _m4_defn([_m4_set_($1)]) can produce output in the order the set was
+# created. Behavior is undefined if SEP tries to recursively list or
+# modify SET in any way other than calling m4_set_remove on the
+# current element. Use _1 if all entries in the stack are guaranteed
+# to be in the set, and _1c to prune removed entries. Uses _m4_defn
+# and _m4_popdef for speed.
+m4_define([_m4_set_contents_1],
+[m4_ifdef([_m4_set([$1])], [m4_pushdef([_m4_set_($1)],
+ _m4_defn([_m4_set([$1])]))_m4_popdef([_m4_set([$1])])$0([$1])])])
+
+m4_define([_m4_set_contents_1c],
+[m4_ifdef([_m4_set([$1])],
+ [m4_set_contains([$1], _m4_defn([_m4_set([$1])]),
+ [m4_pushdef([_m4_set_($1)], _m4_defn([_m4_set([$1])]))],
+ [_m4_popdef([_m4_set([$1],]_m4_defn(
+ [_m4_set([$1])])[)])])_m4_popdef([_m4_set([$1])])$0([$1])],
+ [_m4_popdef([_m4_set_cleanup($1)])])])
+
+m4_define([_m4_set_contents_2],
+[m4_ifdef([_m4_set_($1)], [m4_pushdef([_m4_set([$1])],
+ _m4_defn([_m4_set_($1)]))$2[]_m4_popdef([_m4_set_($1)])$0([$1], [$3$2])])])
+
+# m4_set_delete(SET)
+# ------------------
+# Delete all elements in SET, and reclaim any memory occupied by the
+# set. This is O(n) in the set size.
+#
+# Use _m4_defn and _m4_popdef for speed.
+m4_define([m4_set_delete],
+[m4_ifdef([_m4_set([$1])],
+ [_m4_popdef([_m4_set([$1],]_m4_defn([_m4_set([$1])])[)],
+ [_m4_set([$1])])$0([$1])],
+ [m4_ifdef([_m4_set_cleanup($1)],
+ [_m4_popdef([_m4_set_cleanup($1)])])m4_ifdef(
+ [_m4_set_size($1)],
+ [_m4_popdef([_m4_set_size($1)])])])])
+
+# m4_set_difference(SET1, SET2)
+# -----------------------------
+# Produce a LIST of quoted elements that occur in SET1 but not SET2.
+# Output a comma prior to any elements, to distinguish the empty
+# string from no elements. This can be directly used as a series of
+# arguments, such as for m4_join, or wrapped inside quotes for use in
+# m4_foreach. Order of the output is not guaranteed.
+#
+# Short-circuit the idempotence relation. Use _m4_defn for speed.
+m4_define([m4_set_difference],
+[m4_if([$1], [$2], [],
+ [m4_set_foreach([$1], [_m4_element],
+ [m4_set_contains([$2], _m4_defn([_m4_element]), [],
+ [,_m4_defn([_m4_element])])])])])
+
+# m4_set_dump(SET, [SEP])
+# -----------------------
+# Expand to a single string containing all the elements in SET,
+# separated by SEP, then delete SET. In general, if you only need to
+# list the contents once, this is faster than m4_set_contents. No
+# provision is made for disambiguating set elements that contain
+# non-empty SEP as a sub-string. Order of the output is not
+# guaranteed. This is O(n) in the size of the set before pruning.
+#
+# Use _m4_popdef for speed. Use existence of _m4_set_cleanup($1) to
+# decide if more expensive recursion is needed.
+m4_define([m4_set_dump],
+[m4_ifdef([_m4_set_size($1)],
+ [_m4_popdef([_m4_set_size($1)])])m4_ifdef([_m4_set_cleanup($1)],
+ [_$0_check], [_$0])([$1], [], [$2])])
+
+# _m4_set_dump(SET, SEP, PREP)
+# _m4_set_dump_check(SET, SEP, PREP)
+# ----------------------------------
+# Print SEP and the current element, then delete the element and
+# recurse with empty SEP changed to PREP. The check variant checks
+# whether the element has been previously removed. Use _m4_defn and
+# _m4_popdef for speed.
+m4_define([_m4_set_dump],
+[m4_ifdef([_m4_set([$1])],
+ [[$2]_m4_defn([_m4_set([$1])])_m4_popdef([_m4_set([$1],]_m4_defn(
+ [_m4_set([$1])])[)], [_m4_set([$1])])$0([$1], [$2$3])])])
+
+m4_define([_m4_set_dump_check],
+[m4_ifdef([_m4_set([$1])],
+ [m4_set_contains([$1], _m4_defn([_m4_set([$1])]),
+ [[$2]_m4_defn([_m4_set([$1])])])_m4_popdef(
+ [_m4_set([$1],]_m4_defn([_m4_set([$1])])[)],
+ [_m4_set([$1])])$0([$1], [$2$3])],
+ [_m4_popdef([_m4_set_cleanup($1)])])])
+
+# m4_set_empty(SET, [IF-EMPTY], [IF-ELEMENTS])
+# --------------------------------------------
+# Expand IF-EMPTY if SET has no elements, otherwise IF-ELEMENTS.
+m4_define([m4_set_empty],
+[m4_ifdef([_m4_set_size($1)],
+ [m4_if(m4_indir([_m4_set_size($1)]), [0], [$2], [$3])], [$2])])
+
+# m4_set_foreach(SET, VAR, ACTION)
+# --------------------------------
+# For each element of SET, define VAR to the element and expand
+# ACTION. ACTION should not recursively list SET's contents, add
+# elements to SET, nor delete any element from SET except the one
+# currently in VAR. The order that the elements are visited in is not
+# guaranteed. This is faster than the corresponding m4_foreach([VAR],
+# m4_indir([m4_dquote]m4_set_listc([SET])), [ACTION])
+m4_define([m4_set_foreach],
+[m4_pushdef([$2])m4_ifdef([_m4_set_cleanup($1)],
+ [_m4_set_contents_1c], [_m4_set_contents_1])([$1])_m4_set_contents_2([$1],
+ [m4_define([$2], _m4_defn([_m4_set_($1)]))$3[]])m4_popdef([$2])])
+
+# m4_set_intersection(SET1, SET2)
+# -------------------------------
+# Produce a LIST of quoted elements that occur in both SET1 or SET2.
+# Output a comma prior to any elements, to distinguish the empty
+# string from no elements. This can be directly used as a series of
+# arguments, such as for m4_join, or wrapped inside quotes for use in
+# m4_foreach. Order of the output is not guaranteed.
+#
+# Iterate over the smaller set, and short-circuit the idempotence
+# relation. Use _m4_defn for speed.
+m4_define([m4_set_intersection],
+[m4_if([$1], [$2], [m4_set_listc([$1])],
+ m4_eval(m4_set_size([$2]) < m4_set_size([$1])), [1], [$0([$2], [$1])],
+ [m4_set_foreach([$1], [_m4_element],
+ [m4_set_contains([$2], _m4_defn([_m4_element]),
+ [,_m4_defn([_m4_element])])])])])
+
+# m4_set_list(SET)
+# m4_set_listc(SET)
+# -----------------
+# Produce a LIST of quoted elements of SET. This can be directly used
+# as a series of arguments, such as for m4_join or m4_set_add_all, or
+# wrapped inside quotes for use in m4_foreach or m4_map. With
+# m4_set_list, there is no way to distinguish an empty set from a set
+# containing only the empty string; with m4_set_listc, a leading comma
+# is output if there are any elements.
+m4_define([m4_set_list],
+[m4_ifdef([_m4_set_cleanup($1)], [_m4_set_contents_1c],
+ [_m4_set_contents_1])([$1])_m4_set_contents_2([$1],
+ [_m4_defn([_m4_set_($1)])], [,])])
+
+m4_define([m4_set_listc],
+[m4_ifdef([_m4_set_cleanup($1)], [_m4_set_contents_1c],
+ [_m4_set_contents_1])([$1])_m4_set_contents_2([$1],
+ [,_m4_defn([_m4_set_($1)])])])
+
+# m4_set_remove(SET, VALUE, [IF-PRESENT], [IF-ABSENT])
+# ----------------------------------------------------
+# If VALUE is an element of SET, delete it and expand IF-PRESENT.
+# Otherwise expand IF-ABSENT. Deleting a single value is O(1),
+# although it leaves memory occupied until the next O(n) traversal of
+# the set which will compact the set.
+#
+# Optimize if the element being removed is the most recently added,
+# since defining _m4_set_cleanup($1) slows down so many other macros.
+# In particular, this plays well with m4_set_foreach.
+m4_define([m4_set_remove],
+[m4_set_contains([$1], [$2], [_m4_set_size([$1],
+ [m4_decr])m4_if(_m4_defn([_m4_set([$1])]), [$2],
+ [_m4_popdef([_m4_set([$1],$2)], [_m4_set([$1])])],
+ [m4_define([_m4_set_cleanup($1)])m4_define(
+ [_m4_set([$1],$2)], [0])])$3], [$4])])
+
+# m4_set_size(SET)
+# ----------------
+# Expand to the number of elements currently in SET. This operation
+# is O(1), and thus more efficient than m4_count(m4_set_list([SET])).
+m4_define([m4_set_size],
+[m4_ifdef([_m4_set_size($1)], [m4_indir([_m4_set_size($1)])], [0])])
+
+# _m4_set_size(SET, ACTION)
+# -------------------------
+# ACTION must be either m4_incr or m4_decr, and the size of SET is
+# changed accordingly. If the set is empty, ACTION must not be
+# m4_decr.
+m4_define([_m4_set_size],
+[m4_define([_m4_set_size($1)],
+ m4_ifdef([_m4_set_size($1)], [$2(m4_indir([_m4_set_size($1)]))],
+ [1]))])
+
+# m4_set_union(SET1, SET2)
+# ------------------------
+# Produce a LIST of double quoted elements that occur in either SET1
+# or SET2, without duplicates. Output a comma prior to any elements,
+# to distinguish the empty string from no elements. This can be
+# directly used as a series of arguments, such as for m4_join, or
+# wrapped inside quotes for use in m4_foreach. Order of the output is
+# not guaranteed.
+#
+# We can rely on the fact that m4_set_listc prunes SET1, so we don't
+# need to check _m4_set([$1],element) for 0. Use _m4_defn for speed.
+# Short-circuit the idempotence relation.
+m4_define([m4_set_union],
+[m4_set_listc([$1])m4_if([$1], [$2], [], [m4_set_foreach([$2], [_m4_element],
+ [m4_ifdef([_m4_set([$1],]_m4_defn([_m4_element])[)], [],
+ [,_m4_defn([_m4_element])])])])])
+
+
+## ------------------- ##
+## 16. File handling. ##
+## ------------------- ##
+
+
+# It is a real pity that M4 comes with no macros to bind a diversion
+# to a file. So we have to deal without, which makes us a lot more
+# fragile than we should.
+
+
+# m4_file_append(FILE-NAME, CONTENT)
+# ----------------------------------
+m4_define([m4_file_append],
+[m4_syscmd([cat >>$1 <<_m4eof
+$2
+_m4eof
+])
+m4_if(m4_sysval, [0], [],
+ [m4_fatal([$0: cannot write: $1])])])
+
+
+
+## ------------------------ ##
+## 17. Setting M4sugar up. ##
+## ------------------------ ##
+
+
+# m4_init
+# -------
+# Initialize the m4sugar language.
+m4_define([m4_init],
+[# All the M4sugar macros start with `m4_', except `dnl' kept as is
+# for sake of simplicity.
+m4_pattern_forbid([^_?m4_])
+m4_pattern_forbid([^dnl$])
+
+# If __m4_version__ is defined, we assume that we are being run by M4
+# 1.6 or newer, and thus that $@ recursion is linear and debugmode(d)
+# is available for faster checks of dereferencing undefined macros.
+# But if it is missing, we assume we are being run by M4 1.4.x, that
+# $@ recursion is quadratic, and that we need foreach-based
+# replacement macros. Use the raw builtin to avoid tripping up
+# include tracing.
+m4_ifdef([__m4_version__],
+[m4_debugmode([+d])
+m4_copy([_m4_defn], [m4_defn])
+m4_copy([_m4_popdef], [m4_popdef])
+m4_copy([_m4_undefine], [m4_undefine])],
+[m4_builtin([include], [m4sugar/foreach.m4])])
+
+# _m4_divert_diversion should be defined:
+m4_divert_push([KILL])
+
+# Check the divert push/pop perfect balance.
+m4_wrap([m4_divert_pop([])
+ m4_ifdef([_m4_divert_diversion],
+ [m4_fatal([$0: unbalanced m4_divert_push:]_m4_divert_n_stack)])[]])
+])
diff --git a/gnuwin32/share/bison/xslt/bison.xsl b/gnuwin32/share/bison/xslt/bison.xsl
new file mode 100644
index 00000000..9a6ce8a4
--- /dev/null
+++ b/gnuwin32/share/bison/xslt/bison.xsl
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ bison.xsl - common templates for Bison XSLT.
+
+ 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/>.
+ -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:bison="http://www.gnu.org/software/bison/">
+
+<xsl:key
+ name="bison:symbolByName"
+ match="/bison-xml-report/grammar/nonterminals/nonterminal"
+ use="@name"
+/>
+<xsl:key
+ name="bison:symbolByName"
+ match="/bison-xml-report/grammar/terminals/terminal"
+ use="@name"
+/>
+<xsl:key
+ name="bison:ruleByNumber"
+ match="/bison-xml-report/grammar/rules/rule"
+ use="@number"
+/>
+<xsl:key
+ name="bison:ruleByLhs"
+ match="/bison-xml-report/grammar/rules/rule[
+ @usefulness != 'useless-in-grammar']"
+ use="lhs"
+/>
+<xsl:key
+ name="bison:ruleByRhs"
+ match="/bison-xml-report/grammar/rules/rule[
+ @usefulness != 'useless-in-grammar']"
+ use="rhs/symbol"
+/>
+
+<!-- For the specified state, output: #sr-conflicts,#rr-conflicts -->
+<xsl:template match="state" mode="bison:count-conflicts">
+ <xsl:variable name="transitions" select="actions/transitions"/>
+ <xsl:variable name="reductions" select="actions/reductions"/>
+ <xsl:variable
+ name="terminals"
+ select="
+ $transitions/transition[@type='shift']/@symbol
+ | $reductions/reduction/@symbol
+ "
+ />
+ <xsl:variable name="conflict-data">
+ <xsl:for-each select="$terminals">
+ <xsl:variable name="name" select="."/>
+ <xsl:if test="generate-id($terminals[. = $name][1]) = generate-id(.)">
+ <xsl:variable
+ name="shift-count"
+ select="count($transitions/transition[@symbol=$name])"
+ />
+ <xsl:variable
+ name="reduce-count"
+ select="count($reductions/reduction[@symbol=$name])"
+ />
+ <xsl:if test="$shift-count > 0 and $reduce-count > 0">
+ <xsl:text>s</xsl:text>
+ </xsl:if>
+ <xsl:if test="$reduce-count > 1">
+ <xsl:text>r</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="string-length(translate($conflict-data, 'r', ''))"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="string-length(translate($conflict-data, 's', ''))"/>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/gnuwin32/share/bison/xslt/xml2dot.xsl b/gnuwin32/share/bison/xslt/xml2dot.xsl
new file mode 100644
index 00000000..130692e3
--- /dev/null
+++ b/gnuwin32/share/bison/xslt/xml2dot.xsl
@@ -0,0 +1,206 @@
+<?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>
diff --git a/gnuwin32/share/bison/xslt/xml2text.xsl b/gnuwin32/share/bison/xslt/xml2text.xsl
new file mode 100644
index 00000000..a7835129
--- /dev/null
+++ b/gnuwin32/share/bison/xslt/xml2text.xsl
@@ -0,0 +1,581 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ xml2text.xsl - transform Bison XML Report into plain text.
+
+ 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="grammar" mode="reductions"/>
+ <xsl:apply-templates select="grammar" mode="useless-in-parser"/>
+ <xsl:apply-templates select="automaton" mode="conflicts"/>
+ <xsl:apply-templates select="grammar"/>
+ <xsl:apply-templates select="automaton"/>
+</xsl:template>
+
+<xsl:template match="grammar" mode="reductions">
+ <xsl:apply-templates select="nonterminals" mode="useless-in-grammar"/>
+ <xsl:apply-templates select="terminals" mode="unused-in-grammar"/>
+ <xsl:apply-templates select="rules" mode="useless-in-grammar"/>
+</xsl:template>
+
+<xsl:template match="nonterminals" mode="useless-in-grammar">
+ <xsl:if test="nonterminal[@usefulness='useless-in-grammar']">
+ <xsl:text>Nonterminals useless in grammar&#10;&#10;</xsl:text>
+ <xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:for-each>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="terminals" mode="unused-in-grammar">
+ <xsl:if test="terminal[@usefulness='unused-in-grammar']">
+ <xsl:text>Terminals unused in grammar&#10;&#10;</xsl:text>
+ <xsl:for-each select="terminal[@usefulness='unused-in-grammar']">
+ <xsl:sort select="@symbol-number" data-type="number"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:for-each>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="rules" mode="useless-in-grammar">
+ <xsl:variable name="set" select="rule[@usefulness='useless-in-grammar']"/>
+ <xsl:if test="$set">
+ <xsl:text>Rules useless in grammar&#10;</xsl:text>
+ <xsl:call-template name="style-rule-set">
+ <xsl:with-param name="rule-set" select="$set"/>
+ </xsl:call-template>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="grammar" mode="useless-in-parser">
+ <xsl:variable
+ name="set" select="rules/rule[@usefulness='useless-in-parser']"
+ />
+ <xsl:if test="$set">
+ <xsl:text>Rules useless in parser due to conflicts&#10;</xsl:text>
+ <xsl:call-template name="style-rule-set">
+ <xsl:with-param name="rule-set" select="$set"/>
+ </xsl:call-template>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="grammar">
+ <xsl:text>Grammar&#10;</xsl:text>
+ <xsl:call-template name="style-rule-set">
+ <xsl:with-param
+ name="rule-set" select="rules/rule[@usefulness!='useless-in-grammar']"
+ />
+ </xsl:call-template>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <xsl:apply-templates select="terminals"/>
+ <xsl:apply-templates select="nonterminals"/>
+</xsl:template>
+
+<xsl:template name="style-rule-set">
+ <xsl:param name="rule-set"/>
+ <xsl:for-each select="$rule-set">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="pad" select="'3'"/>
+ <xsl:with-param name="prev-lhs">
+ <xsl:if test="position()>1">
+ <xsl:variable name="position" select="position()"/>
+ <xsl:value-of select="$rule-set[$position - 1]/lhs"/>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="grammar/terminals">
+ <xsl:text>Terminals, with rules where they appear&#10;&#10;</xsl:text>
+ <xsl:apply-templates select="terminal"/>
+ <xsl:text>&#10;&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="grammar/nonterminals">
+ <xsl:text>Nonterminals, with rules where they appear&#10;&#10;</xsl:text>
+ <xsl:apply-templates select="nonterminal[@usefulness!='useless-in-grammar']"/>
+</xsl:template>
+
+<xsl:template match="terminal">
+ <xsl:value-of select="@name"/>
+ <xsl:call-template name="line-wrap">
+ <xsl:with-param name="first-line-length">
+ <xsl:choose>
+ <xsl:when test="string-length(@name) &gt; 66">0</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="66 - string-length(@name)" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="line-length" select="66" />
+ <xsl:with-param name="text">
+ <xsl:value-of select="concat(' (', @token-number, ')')"/>
+ <xsl:for-each select="key('bison:ruleByRhs', @name)">
+ <xsl:value-of select="concat(' ', @number)"/>
+ </xsl:for-each>
+ </xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="nonterminal">
+ <xsl:value-of select="@name"/>
+ <xsl:value-of select="concat(' (', @symbol-number, ')')"/>
+ <xsl:text>&#10;</xsl:text>
+ <xsl:variable name="output">
+ <xsl:call-template name="line-wrap">
+ <xsl:with-param name="line-length" select="66" />
+ <xsl:with-param name="text">
+ <xsl:text> </xsl:text>
+ <xsl:if test="key('bison:ruleByLhs', @name)">
+ <xsl:text>on@left:</xsl:text>
+ <xsl:for-each select="key('bison:ruleByLhs', @name)">
+ <xsl:value-of select="concat(' ', @number)"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="key('bison:ruleByRhs', @name)">
+ <xsl:if test="key('bison:ruleByLhs', @name)">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:text>on@right:</xsl:text>
+ <xsl:for-each select="key('bison:ruleByRhs', @name)">
+ <xsl:value-of select="concat(' ', @number)"/>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="translate($output, '@', ' ')" />
+</xsl:template>
+
+<xsl:template match="automaton" mode="conflicts">
+ <xsl:variable name="conflict-report">
+ <xsl:apply-templates select="state" mode="conflicts"/>
+ </xsl:variable>
+ <xsl:if test="string-length($conflict-report) != 0">
+ <xsl:value-of select="$conflict-report"/>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="state" mode="conflicts">
+ <xsl:variable name="conflict-counts">
+ <xsl:apply-templates select="." mode="bison:count-conflicts" />
+ </xsl:variable>
+ <xsl:variable
+ name="sr-count" select="substring-before($conflict-counts, ',')"
+ />
+ <xsl:variable
+ name="rr-count" select="substring-after($conflict-counts, ',')"
+ />
+ <xsl:if test="$sr-count > 0 or $rr-count > 0">
+ <xsl:value-of select="concat('State ', @number, ' conflicts:')"/>
+ <xsl:if test="$sr-count > 0">
+ <xsl:value-of select="concat(' ', $sr-count, ' shift/reduce')"/>
+ <xsl:if test="$rr-count > 0">
+ <xsl:value-of select="(',')"/>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="$rr-count > 0">
+ <xsl:value-of select="concat(' ', $rr-count, ' reduce/reduce')"/>
+ </xsl:if>
+ <xsl:value-of select="'&#10;'"/>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="automaton">
+ <xsl:apply-templates select="state">
+ <xsl:with-param name="pad" select="'3'"/>
+ </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="automaton/state">
+ <xsl:param name="pad"/>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <xsl:text>state </xsl:text>
+ <xsl:value-of select="@number"/>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <xsl:apply-templates select="itemset/item">
+ <xsl:with-param name="pad" select="$pad"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="actions/transitions">
+ <xsl:with-param name="type" select="'shift'"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="actions/errors"/>
+ <xsl:apply-templates select="actions/reductions"/>
+ <xsl:apply-templates select="actions/transitions">
+ <xsl:with-param name="type" select="'goto'"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="solved-conflicts"/>
+</xsl:template>
+
+<xsl:template match="actions/transitions">
+ <xsl:param name="type"/>
+ <xsl:if test="transition[@type = $type]">
+ <xsl:text>&#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:with-param>
+ </xsl:apply-templates>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="actions/errors">
+ <xsl:if test="error">
+ <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:with-param>
+ </xsl:apply-templates>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="actions/reductions">
+ <xsl:if test="reduction">
+ <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:with-param>
+ </xsl:apply-templates>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="item">
+ <xsl:param name="pad"/>
+ <xsl:param name="prev-rule-number"
+ select="preceding-sibling::item[1]/@rule-number"/>
+ <xsl:apply-templates
+ select="key('bison:ruleByNumber', current()/@rule-number)"
+ >
+ <xsl:with-param name="itemset" select="'true'"/>
+ <xsl:with-param name="pad" select="$pad"/>
+ <xsl:with-param
+ name="prev-lhs"
+ select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]"
+ />
+ <xsl:with-param name="point" select="@point"/>
+ <xsl:with-param name="lookaheads">
+ <xsl:apply-templates select="lookaheads"/>
+ </xsl:with-param>
+ </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="rule">
+ <xsl:param name="itemset"/>
+ <xsl:param name="pad"/>
+ <xsl:param name="prev-lhs"/>
+ <xsl:param name="point"/>
+ <xsl:param name="lookaheads"/>
+
+ <xsl:if test="$itemset != 'true' and not($prev-lhs = lhs[text()])">
+ <xsl:text>&#10;</xsl:text>
+ </xsl:if>
+
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="lpad">
+ <xsl:with-param name="str" select="string(@number)"/>
+ <xsl:with-param name="pad" select="number($pad)"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+
+ <!-- LHS -->
+ <xsl:choose>
+ <xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
+ <xsl:call-template name="lpad">
+ <xsl:with-param name="str" select="'|'"/>
+ <xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
+ <xsl:call-template name="lpad">
+ <xsl:with-param name="str" select="'|'"/>
+ <xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="lhs"/>
+ <xsl:text>:</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- RHS -->
+ <xsl:for-each select="rhs/*">
+ <xsl:if test="position() = $point + 1">
+ <xsl:text> .</xsl:text>
+ </xsl:if>
+ <xsl:if test="$itemset = 'true' and name(.) != 'empty'">
+ <xsl:apply-templates select="."/>
+ </xsl:if>
+ <xsl:if test="$itemset != 'true'">
+ <xsl:apply-templates select="."/>
+ </xsl:if>
+ <xsl:if test="position() = last() and position() = $point">
+ <xsl:text> .</xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="$lookaheads">
+ <xsl:value-of select="$lookaheads"/>
+ </xsl:if>
+
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="symbol">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="."/>
+</xsl:template>
+
+<xsl:template match="empty">
+ <xsl:text> /* empty */</xsl:text>
+</xsl:template>
+
+<xsl:template match="lookaheads">
+ <xsl:text> [</xsl:text>
+ <xsl:apply-templates select="symbol"/>
+ <xsl:text>]</xsl:text>
+</xsl:template>
+
+<xsl:template match="lookaheads/symbol">
+ <xsl:value-of select="."/>
+ <xsl:if test="position() != last()">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="transition">
+ <xsl:param name="pad"/>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="rpad">
+ <xsl:with-param name="str" select="string(@symbol)"/>
+ <xsl:with-param name="pad" select="number($pad) + 2"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="@type = 'shift'">
+ <xsl:text>shift, and go to state </xsl:text>
+ <xsl:value-of select="@state"/>
+ </xsl:when>
+ <xsl:when test="@type = 'goto'">
+ <xsl:text>go to state </xsl:text>
+ <xsl:value-of select="@state"/>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="error">
+ <xsl:param name="pad"/>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="rpad">
+ <xsl:with-param name="str" select="string(@symbol)"/>
+ <xsl:with-param name="pad" select="number($pad) + 2"/>
+ </xsl:call-template>
+ <xsl:text>error</xsl:text>
+ <xsl:text> (</xsl:text>
+ <xsl:value-of select="text()"/>
+ <xsl:text>)</xsl:text>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="reduction">
+ <xsl:param name="pad"/>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="rpad">
+ <xsl:with-param name="str" select="string(@symbol)"/>
+ <xsl:with-param name="pad" select="number($pad) + 2"/>
+ </xsl:call-template>
+ <xsl:if test="@enabled = 'false'">
+ <xsl:text>[</xsl:text>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="@rule = 'accept'">
+ <xsl:text>accept</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>reduce using rule </xsl:text>
+ <xsl:value-of select="@rule"/>
+ <xsl:text> (</xsl:text>
+ <xsl:value-of
+ select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"/>
+ <xsl:text>)</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@enabled = 'false'">
+ <xsl:text>]</xsl:text>
+ </xsl:if>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="solved-conflicts">
+ <xsl:if test="resolution">
+ <xsl:text>&#10;</xsl:text>
+ <xsl:apply-templates select="resolution"/>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="resolution">
+ <xsl:text> Conflict between rule </xsl:text>
+ <xsl:value-of select="@rule"/>
+ <xsl:text> and token </xsl:text>
+ <xsl:value-of select="@symbol"/>
+ <xsl:text> resolved as </xsl:text>
+ <xsl:if test="@type = 'error'">
+ <xsl:text>an </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="@type"/>
+ <xsl:text> (</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>).&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template name="max-width-symbol">
+ <xsl:param name="node"/>
+ <xsl:variable name="longest">
+ <xsl:for-each select="$node">
+ <xsl:sort data-type="number" select="string-length(@symbol)"
+ order="descending"/>
+ <xsl:if test="position() = 1">
+ <xsl:value-of select="string-length(@symbol)"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="$longest"/>
+</xsl:template>
+
+<xsl:template name="lpad">
+ <xsl:param name="str" select="''"/>
+ <xsl:param name="pad" select="0"/>
+ <xsl:variable name="diff" select="$pad - string-length($str)" />
+ <xsl:choose>
+ <xsl:when test="$diff &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:template name="rpad">
+ <xsl:param name="str" select="''"/>
+ <xsl:param name="pad" select="0"/>
+ <xsl:variable name="diff" select="$pad - string-length($str)"/>
+ <xsl:choose>
+ <xsl:when test="$diff &lt; 0">
+ <xsl:value-of select="$str"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$str"/>
+ <xsl:call-template name="space">
+ <xsl:with-param name="repeat" select="$diff"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="space">
+ <xsl:param name="repeat">0</xsl:param>
+ <xsl:param name="fill" select="' '"/>
+ <xsl:if test="number($repeat) &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"/>
+ <xsl:param name="text"/> <!-- required -->
+ <xsl:choose>
+ <xsl:when test="normalize-space($text) = ''" />
+ <xsl:when test="string-length($text) &lt;= $first-line-length">
+ <xsl:value-of select="concat($text, '&#10;')" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="break-pos">
+ <xsl:call-template name="ws-search">
+ <xsl:with-param name="text" select="$text" />
+ <xsl:with-param name="start" select="$first-line-length+1" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="substring($text, 1, $break-pos - 1)" />
+ <xsl:text>&#10;</xsl:text>
+ <xsl:call-template name="line-wrap">
+ <xsl:with-param name="line-length" select="$line-length" />
+ <xsl:with-param
+ name="text" select="concat(' ', substring($text, $break-pos+1))"
+ />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="ws-search">
+ <xsl:param name="text"/> <!-- required -->
+ <xsl:param name="start"/> <!-- required -->
+ <xsl:variable name="search-text" select="substring($text, $start)" />
+ <xsl:choose>
+ <xsl:when test="not(contains($search-text, ' '))">
+ <xsl:value-of select="string-length($text)+1" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
+ select="$start + string-length(substring-before($search-text, ' '))"
+ />
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/gnuwin32/share/bison/xslt/xml2xhtml.xsl b/gnuwin32/share/bison/xslt/xml2xhtml.xsl
new file mode 100644
index 00000000..91dc6300
--- /dev/null
+++ b/gnuwin32/share/bison/xslt/xml2xhtml.xsl
@@ -0,0 +1,745 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ xml2html.xsl - transform Bison XML Report into XHTML.
+
+ 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="http://www.w3.org/1999/xhtml"
+ xmlns:bison="http://www.gnu.org/software/bison/">
+
+<xsl:import href="bison.xsl"/>
+
+<xsl:output method="xml" encoding="UTF-8"
+ doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+ indent="yes"/>
+
+<xsl:template match="/">
+ <html>
+ <head>
+ <title>
+ <xsl:value-of select="bison-xml-report/filename"/>
+ <xsl:text> - GNU Bison XML Automaton Report</xsl:text>
+ </title>
+ <style type="text/css"><![CDATA[
+ body {
+ font-family: "Nimbus Sans L", Arial, sans-serif;
+ font-size: 9pt;
+ }
+ a:link {
+ color: #1f00ff;
+ text-decoration: none;
+ }
+ a:visited {
+ color: #1f00ff;
+ text-decoration: none;
+ }
+ a:hover {
+ color: red;
+ }
+ #menu a {
+ text-decoration: underline;
+ }
+ .i {
+ font-style: italic;
+ }
+ .pre {
+ font-family: monospace;
+ white-space: pre;
+ }
+ ol.decimal {
+ list-style-type: decimal;
+ }
+ ol.lower-alpha {
+ list-style-type: lower-alpha;
+ }
+ .point {
+ color: #cc0000;
+ }
+ #footer {
+ margin-top: 3.5em;
+ font-size: 7pt;
+ }
+ ]]></style>
+ </head>
+ <body>
+ <xsl:apply-templates select="bison-xml-report"/>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <div id="footer"><hr />This document was generated using
+ <a href="http://www.gnu.org/software/bison/" title="GNU Bison">
+ GNU Bison <xsl:value-of select="/bison-xml-report/@version"/></a>
+ XML Automaton Report.<br />
+ <!-- default copying notice -->
+ Verbatim copying and distribution of this entire page is
+ permitted in any medium, provided this notice is preserved.</div>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="bison-xml-report">
+ <h1>GNU Bison XML Automaton Report</h1>
+ <p>
+ input grammar: <span class="i"><xsl:value-of select="filename"/></span>
+ </p>
+
+ <xsl:text>&#10;&#10;</xsl:text>
+ <h3>Table of Contents</h3>
+ <ul id="menu">
+ <li>
+ <a href="#reductions">Reductions</a>
+ <ul class="lower-alpha">
+ <li><a href="#nonterminals_useless_in_grammar">Nonterminals useless in grammar</a></li>
+ <li><a href="#terminals_unused_in_grammar">Terminals unused in grammar</a></li>
+ <li><a href="#rules_useless_in_grammar">Rules useless in grammar</a></li>
+ <xsl:if test="grammar/rules/rule[@usefulness='useless-in-parser']">
+ <li><a href="#rules_useless_in_parser">Rules useless in parser due to conflicts</a></li>
+ </xsl:if>
+ </ul>
+ </li>
+ <li><a href="#conflicts">Conflicts</a></li>
+ <li>
+ <a href="#grammar">Grammar</a>
+ <ul class="lower-alpha">
+ <li><a href="#grammar">Itemset</a></li>
+ <li><a href="#terminals">Terminal symbols</a></li>
+ <li><a href="#nonterminals">Nonterminal symbols</a></li>
+ </ul>
+ </li>
+ <li><a href="#automaton">Automaton</a></li>
+ </ul>
+ <xsl:apply-templates select="grammar" mode="reductions"/>
+ <xsl:apply-templates select="grammar" mode="useless-in-parser"/>
+ <xsl:apply-templates select="automaton" mode="conflicts"/>
+ <xsl:apply-templates select="grammar"/>
+ <xsl:apply-templates select="automaton"/>
+</xsl:template>
+
+<xsl:template match="grammar" mode="reductions">
+ <h2>
+ <a name="reductions"/>
+ <xsl:text> Reductions</xsl:text>
+ </h2>
+ <xsl:apply-templates select="nonterminals" mode="useless-in-grammar"/>
+ <xsl:apply-templates select="terminals" mode="unused-in-grammar"/>
+ <xsl:apply-templates select="rules" mode="useless-in-grammar"/>
+</xsl:template>
+
+<xsl:template match="nonterminals" mode="useless-in-grammar">
+ <h3>
+ <a name="nonterminals_useless_in_grammar"/>
+ <xsl:text> Nonterminals useless in grammar</xsl:text>
+ </h3>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <xsl:if test="nonterminal[@usefulness='useless-in-grammar']">
+ <p class="pre">
+ <xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:for-each>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </p>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="terminals" mode="unused-in-grammar">
+ <h3>
+ <a name="terminals_unused_in_grammar"/>
+ <xsl:text> Terminals unused in grammar</xsl:text>
+ </h3>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <xsl:if test="terminal[@usefulness='unused-in-grammar']">
+ <p class="pre">
+ <xsl:for-each select="terminal[@usefulness='unused-in-grammar']">
+ <xsl:sort select="@symbol-number" data-type="number"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:for-each>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </p>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="rules" mode="useless-in-grammar">
+ <h3>
+ <a name="rules_useless_in_grammar"/>
+ <xsl:text> Rules useless in grammar</xsl:text>
+ </h3>
+ <xsl:text>&#10;</xsl:text>
+ <xsl:variable name="set" select="rule[@usefulness='useless-in-grammar']"/>
+ <xsl:if test="$set">
+ <p class="pre">
+ <xsl:call-template name="style-rule-set">
+ <xsl:with-param name="rule-set" select="$set"/>
+ </xsl:call-template>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </p>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="grammar" mode="useless-in-parser">
+ <xsl:variable
+ name="set" select="rules/rule[@usefulness='useless-in-parser']"
+ />
+ <xsl:if test="$set">
+ <h2>
+ <a name="rules_useless_in_parser"/>
+ <xsl:text> Rules useless in parser due to conflicts</xsl:text>
+ </h2>
+ <xsl:text>&#10;</xsl:text>
+ <p class="pre">
+ <xsl:call-template name="style-rule-set">
+ <xsl:with-param name="rule-set" select="$set"/>
+ </xsl:call-template>
+ </p>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="grammar">
+ <h2>
+ <a name="grammar"/>
+ <xsl:text> Grammar</xsl:text>
+ </h2>
+ <xsl:text>&#10;</xsl:text>
+ <p class="pre">
+ <xsl:call-template name="style-rule-set">
+ <xsl:with-param
+ name="rule-set" select="rules/rule[@usefulness!='useless-in-grammar']"
+ />
+ </xsl:call-template>
+ </p>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <xsl:apply-templates select="terminals"/>
+ <xsl:apply-templates select="nonterminals"/>
+</xsl:template>
+
+<xsl:template name="style-rule-set">
+ <xsl:param name="rule-set"/>
+ <xsl:for-each select="$rule-set">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="pad" select="'3'"/>
+ <xsl:with-param name="prev-lhs">
+ <xsl:if test="position()>1">
+ <xsl:variable name="position" select="position()"/>
+ <xsl:value-of select="$rule-set[$position - 1]/lhs"/>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="automaton" mode="conflicts">
+ <h2>
+ <a name="conflicts"/>
+ <xsl:text> Conflicts</xsl:text>
+ </h2>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <xsl:variable name="conflict-report">
+ <xsl:apply-templates select="state" mode="conflicts"/>
+ </xsl:variable>
+ <xsl:if test="string-length($conflict-report) != 0">
+ <p class="pre">
+ <xsl:copy-of select="$conflict-report"/>
+ <xsl:text>&#10;&#10;</xsl:text>
+ </p>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="state" mode="conflicts">
+ <xsl:variable name="conflict-counts">
+ <xsl:apply-templates select="." mode="bison:count-conflicts" />
+ </xsl:variable>
+ <xsl:variable
+ name="sr-count" select="substring-before($conflict-counts, ',')"
+ />
+ <xsl:variable
+ name="rr-count" select="substring-after($conflict-counts, ',')"
+ />
+ <xsl:if test="$sr-count > 0 or $rr-count > 0">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#state_', @number)"/>
+ </xsl:attribute>
+ <xsl:value-of select="concat('State ', @number)"/>
+ </a>
+ <xsl:text> conflicts:</xsl:text>
+ <xsl:if test="$sr-count > 0">
+ <xsl:value-of select="concat(' ', $sr-count, ' shift/reduce')"/>
+ <xsl:if test="$rr-count > 0">
+ <xsl:value-of select="(',')"/>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="$rr-count > 0">
+ <xsl:value-of select="concat(' ', $rr-count, ' reduce/reduce')"/>
+ </xsl:if>
+ <xsl:value-of select="'&#10;'"/>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="grammar/terminals">
+ <h3>
+ <a name="terminals"/>
+ <xsl:text> Terminals, with rules where they appear</xsl:text>
+ </h3>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <p class="pre">
+ <xsl:apply-templates select="terminal"/>
+ </p>
+ <xsl:text>&#10;&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="grammar/nonterminals">
+ <h3>
+ <a name="nonterminals"/>
+ <xsl:text> Nonterminals, with rules where they appear</xsl:text>
+ </h3>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <p class="pre">
+ <xsl:apply-templates
+ select="nonterminal[@usefulness!='useless-in-grammar']"
+ />
+ </p>
+</xsl:template>
+
+<xsl:template match="terminal">
+ <b><xsl:value-of select="@name"/></b>
+ <xsl:value-of select="concat(' (', @token-number, ')')"/>
+ <xsl:for-each select="key('bison:ruleByRhs', @name)">
+ <xsl:apply-templates select="." mode="number-link"/>
+ </xsl:for-each>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="nonterminal">
+ <b><xsl:value-of select="@name"/></b>
+ <xsl:value-of select="concat(' (', @symbol-number, ')')"/>
+ <xsl:text>&#10; </xsl:text>
+ <xsl:if test="key('bison:ruleByLhs', @name)">
+ <xsl:text>on left:</xsl:text>
+ <xsl:for-each select="key('bison:ruleByLhs', @name)">
+ <xsl:apply-templates select="." mode="number-link"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="key('bison:ruleByRhs', @name)">
+ <xsl:if test="key('bison:ruleByLhs', @name)">
+ <xsl:text>&#10; </xsl:text>
+ </xsl:if>
+ <xsl:text>on right:</xsl:text>
+ <xsl:for-each select="key('bison:ruleByRhs', @name)">
+ <xsl:apply-templates select="." mode="number-link"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="rule" mode="number-link">
+ <xsl:text> </xsl:text>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#rule_', @number)"/>
+ </xsl:attribute>
+ <xsl:value-of select="@number"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="automaton">
+ <h2>
+ <a name="automaton"/>
+ <xsl:text> Automaton</xsl:text>
+ </h2>
+ <xsl:apply-templates select="state">
+ <xsl:with-param name="pad" select="'3'"/>
+ </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="automaton/state">
+ <xsl:param name="pad"/>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <h3>
+ <a>
+ <xsl:attribute name="name">
+ <xsl:value-of select="concat('state_', @number)"/>
+ </xsl:attribute>
+ </a>
+ <xsl:text>state </xsl:text>
+ <xsl:value-of select="@number"/>
+ </h3>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <p class="pre">
+ <xsl:apply-templates select="itemset/item">
+ <xsl:with-param name="pad" select="$pad"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="actions/transitions">
+ <xsl:with-param name="type" select="'shift'"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="actions/errors"/>
+ <xsl:apply-templates select="actions/reductions"/>
+ <xsl:apply-templates select="actions/transitions">
+ <xsl:with-param name="type" select="'goto'"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="solved-conflicts"/>
+ </p>
+</xsl:template>
+
+<xsl:template match="actions/transitions">
+ <xsl:param name="type"/>
+ <xsl:if test="transition[@type = $type]">
+ <xsl:text>&#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:with-param>
+ </xsl:apply-templates>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="actions/errors">
+ <xsl:if test="error">
+ <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:with-param>
+ </xsl:apply-templates>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="actions/reductions">
+ <xsl:if test="reduction">
+ <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:with-param>
+ </xsl:apply-templates>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="item">
+ <xsl:param name="pad"/>
+ <xsl:param name="prev-rule-number"
+ select="preceding-sibling::item[1]/@rule-number"/>
+ <xsl:apply-templates
+ select="key('bison:ruleByNumber', current()/@rule-number)"
+ >
+ <xsl:with-param name="itemset" select="'true'"/>
+ <xsl:with-param name="pad" select="$pad"/>
+ <xsl:with-param name="prev-lhs"
+ select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]"
+ />
+ <xsl:with-param name="point" select="@point"/>
+ <xsl:with-param name="lookaheads">
+ <xsl:apply-templates select="lookaheads"/>
+ </xsl:with-param>
+ </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="rule">
+ <xsl:param name="itemset"/>
+ <xsl:param name="pad"/>
+ <xsl:param name="prev-lhs"/>
+ <xsl:param name="point"/>
+ <xsl:param name="lookaheads"/>
+
+ <xsl:if test="$itemset != 'true' and not($prev-lhs = lhs[text()])">
+ <xsl:text>&#10;</xsl:text>
+ </xsl:if>
+
+ <xsl:if test="$itemset != 'true'">
+ <a>
+ <xsl:attribute name="name">
+ <xsl:value-of select="concat('rule_', @number)"/>
+ </xsl:attribute>
+ </a>
+ </xsl:if>
+ <xsl:text> </xsl:text>
+
+ <xsl:choose>
+ <xsl:when test="$itemset = 'true'">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#rule_', @number)"/>
+ </xsl:attribute>
+ <xsl:call-template name="lpad">
+ <xsl:with-param name="str" select="string(@number)"/>
+ <xsl:with-param name="pad" select="number($pad)"/>
+ </xsl:call-template>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="lpad">
+ <xsl:with-param name="str" select="string(@number)"/>
+ <xsl:with-param name="pad" select="number($pad)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+
+ <!-- LHS -->
+ <xsl:choose>
+ <xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
+ <xsl:call-template name="lpad">
+ <xsl:with-param name="str" select="'|'"/>
+ <xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
+ <xsl:call-template name="lpad">
+ <xsl:with-param name="str" select="'|'"/>
+ <xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <span class="i">
+ <xsl:value-of select="lhs"/>
+ </span>
+ <xsl:text> &#8594;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- RHS -->
+ <xsl:for-each select="rhs/*">
+ <xsl:if test="position() = $point + 1">
+ <xsl:text> </xsl:text>
+ <span class="point">.</span>
+ </xsl:if>
+ <xsl:if test="$itemset = 'true' and name(.) != 'empty'">
+ <xsl:apply-templates select="."/>
+ </xsl:if>
+ <xsl:if test="$itemset != 'true'">
+ <xsl:apply-templates select="."/>
+ </xsl:if>
+ <xsl:if test="position() = last() and position() = $point">
+ <xsl:text> </xsl:text>
+ <span class="point">.</span>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="$lookaheads">
+ <xsl:value-of select="$lookaheads"/>
+ </xsl:if>
+
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="symbol">
+ <xsl:text> </xsl:text>
+ <xsl:choose>
+ <xsl:when test="name(key('bison:symbolByName', .)) = 'nonterminal'">
+ <span class="i"><xsl:value-of select="."/></span>
+ </xsl:when>
+ <xsl:otherwise>
+ <b><xsl:value-of select="."/></b>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="empty">
+ <xsl:text> &#949;</xsl:text>
+</xsl:template>
+
+<xsl:template match="lookaheads">
+ <xsl:text> [</xsl:text>
+ <xsl:apply-templates select="symbol"/>
+ <xsl:text>]</xsl:text>
+</xsl:template>
+
+<xsl:template match="lookaheads/symbol">
+ <xsl:value-of select="."/>
+ <xsl:if test="position() != last()">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="transition">
+ <xsl:param name="pad"/>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="rpad">
+ <xsl:with-param name="str" select="string(@symbol)"/>
+ <xsl:with-param name="pad" select="number($pad) + 2"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="@type = 'shift'">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#state_', @state)"/>
+ </xsl:attribute>
+ <xsl:value-of select="concat('shift, and go to state ', @state)"/>
+ </a>
+ </xsl:when>
+ <xsl:when test="@type = 'goto'">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#state_', @state)"/>
+ </xsl:attribute>
+ <xsl:value-of select="concat('go to state ', @state)"/>
+ </a>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="error">
+ <xsl:param name="pad"/>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="rpad">
+ <xsl:with-param name="str" select="string(@symbol)"/>
+ <xsl:with-param name="pad" select="number($pad) + 2"/>
+ </xsl:call-template>
+ <xsl:text>error</xsl:text>
+ <xsl:text> (</xsl:text>
+ <xsl:value-of select="text()"/>
+ <xsl:text>)</xsl:text>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="reduction">
+ <xsl:param name="pad"/>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="rpad">
+ <xsl:with-param name="str" select="string(@symbol)"/>
+ <xsl:with-param name="pad" select="number($pad) + 2"/>
+ </xsl:call-template>
+ <xsl:if test="@enabled = 'false'">
+ <xsl:text>[</xsl:text>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="@rule = 'accept'">
+ <xsl:text>accept</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#rule_', @rule)"/>
+ </xsl:attribute>
+ <xsl:value-of select="concat('reduce using rule ', @rule)"/>
+ </a>
+ <xsl:text> (</xsl:text>
+ <xsl:value-of
+ select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"
+ />
+ <xsl:text>)</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@enabled = 'false'">
+ <xsl:text>]</xsl:text>
+ </xsl:if>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="solved-conflicts">
+ <xsl:if test="resolution">
+ <xsl:text>&#10;</xsl:text>
+ <xsl:apply-templates select="resolution"/>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="resolution">
+ <xsl:text> Conflict between </xsl:text>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#rule_', @rule)"/>
+ </xsl:attribute>
+ <xsl:value-of select="concat('rule ',@rule)"/>
+ </a>
+ <xsl:text> and token </xsl:text>
+ <xsl:value-of select="@symbol"/>
+ <xsl:text> resolved as </xsl:text>
+ <xsl:if test="@type = 'error'">
+ <xsl:text>an </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="@type"/>
+ <xsl:text> (</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>).&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template name="max-width-symbol">
+ <xsl:param name="node"/>
+ <xsl:variable name="longest">
+ <xsl:for-each select="$node">
+ <xsl:sort data-type="number" select="string-length(@symbol)"
+ order="descending"/>
+ <xsl:if test="position() = 1">
+ <xsl:value-of select="string-length(@symbol)"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="$longest"/>
+</xsl:template>
+
+<xsl:template name="lpad">
+ <xsl:param name="str" select="''"/>
+ <xsl:param name="pad" select="0"/>
+ <xsl:variable name="diff" select="$pad - string-length($str)" />
+ <xsl:choose>
+ <xsl:when test="$diff &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:template name="rpad">
+ <xsl:param name="str" select="''"/>
+ <xsl:param name="pad" select="0"/>
+ <xsl:variable name="diff" select="$pad - string-length($str)"/>
+ <xsl:choose>
+ <xsl:when test="$diff &lt; 0">
+ <xsl:value-of select="$str"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$str"/>
+ <xsl:call-template name="space">
+ <xsl:with-param name="repeat" select="$diff"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="space">
+ <xsl:param name="repeat">0</xsl:param>
+ <xsl:param name="fill" select="' '"/>
+ <xsl:if test="number($repeat) &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>
diff --git a/gnuwin32/share/bison/yacc.c b/gnuwin32/share/bison/yacc.c
new file mode 100644
index 00000000..19f77a5f
--- /dev/null
+++ b/gnuwin32/share/bison/yacc.c
@@ -0,0 +1,1741 @@
+ -*- C -*-
+
+# Yacc compatible skeleton for Bison
+
+# Copyright (C) 1984, 1989, 1990, 2000, 2001, 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/>.
+
+# Check the value of %define api.push_pull.
+b4_percent_define_default([[api.push_pull]], [[pull]])
+b4_percent_define_check_values([[[[api.push_pull]],
+ [[pull]], [[push]], [[both]]]])
+b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]])
+b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]])
+m4_case(b4_percent_define_get([[api.push_pull]]),
+ [pull], [m4_define([b4_push_flag], [[0]])],
+ [push], [m4_define([b4_pull_flag], [[0]])])
+
+# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing
+# tests function as written, don't let BISON_USE_PUSH_FOR_PULL modify Bison's
+# behavior at all when push parsing is already requested.
+b4_define_flag_if([use_push_for_pull])
+b4_use_push_for_pull_if([
+ b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])],
+ [m4_define([b4_push_flag], [[1]])])])
+
+m4_include(b4_pkgdatadir/[c.m4])
+
+## ---------------- ##
+## Default values. ##
+## ---------------- ##
+
+# Stack parameters.
+m4_define_default([b4_stack_depth_max], [10000])
+m4_define_default([b4_stack_depth_init], [200])
+
+
+## ------------------------ ##
+## Pure/impure interfaces. ##
+## ------------------------ ##
+
+b4_percent_define_default([[api.pure]], [[false]])
+b4_define_flag_if([pure])
+m4_define([b4_pure_flag],
+ [b4_percent_define_flag_if([[api.pure]], [[1]], [[0]])])
+
+# b4_yacc_pure_if(IF-TRUE, IF-FALSE)
+# ----------------------------------
+# Expand IF-TRUE, if %pure-parser and %parse-param, IF-FALSE otherwise.
+m4_define([b4_yacc_pure_if],
+[b4_pure_if([m4_ifset([b4_parse_param],
+ [$1], [$2])],
+ [$2])])
+
+
+# b4_yyerror_args
+# ---------------
+# Arguments passed to yyerror: user args plus yylloc.
+m4_define([b4_yyerror_args],
+[b4_yacc_pure_if([b4_locations_if([&yylloc, ])])dnl
+m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])])
+
+
+# b4_lex_param
+# ------------
+# Accumulate in b4_lex_param all the yylex arguments.
+# b4_lex_param arrives quoted twice, but we want to keep only one level.
+m4_define([b4_lex_param],
+m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl
+b4_locations_if([, [[YYLTYPE *], [&yylloc]]])m4_ifdef([b4_lex_param], [, ])])dnl
+m4_ifdef([b4_lex_param], b4_lex_param)))
+
+
+## ------------ ##
+## Data Types. ##
+## ------------ ##
+
+# b4_int_type(MIN, MAX)
+# ---------------------
+# Return the smallest int type able to handle numbers ranging from
+# MIN to MAX (included). Overwrite the version from c.m4, which
+# uses only C89 types, so that the user can override the shorter
+# types, and so that pre-C89 compilers are handled correctly.
+m4_define([b4_int_type],
+[m4_if(b4_ints_in($@, [0], [255]), [1], [yytype_uint8],
+ b4_ints_in($@, [-128], [127]), [1], [yytype_int8],
+
+ b4_ints_in($@, [0], [65535]), [1], [yytype_uint16],
+ b4_ints_in($@, [-32768], [32767]), [1], [yytype_int16],
+
+ m4_eval([0 <= $1]), [1], [unsigned int],
+
+ [int])])
+
+
+## ----------------- ##
+## 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],
+[(yyvsp@{($2) - ($1)@}m4_ifval([$3], [.$3]))])
+
+
+
+## ----------- ##
+## Locations. ##
+## ----------- ##
+
+# 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],
+[(yylsp@{($2) - ($1)@})])
+
+
+
+## --------------------------------------------------------- ##
+## Defining symbol actions, e.g., printers and destructors. ##
+## --------------------------------------------------------- ##
+
+# We do want M4 expansion after # for CPP macros.
+m4_changecom()
+m4_divert_push(0)dnl
+@output(b4_parser_file_name@)
+b4_copyright([Skeleton implementation for Bison's Yacc-like parsers in C],dnl '
+ [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006])[
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+]b4_identification
+b4_percent_code_get([[top]])[]dnl
+m4_if(b4_prefix, [yy], [],
+[[/* Substitute the variable and function names. */
+]b4_pull_if([[#define yyparse ]b4_prefix[parse
+]])b4_push_if([[#define yypush_parse ]b4_prefix[push_parse
+]b4_pull_if([[#define yypull_parse ]b4_prefix[pull_parse
+]])[#define yypstate_new ]b4_prefix[pstate_new
+#define yypstate_delete ]b4_prefix[pstate_delete
+#define yypstate ]b4_prefix[pstate
+]])[#define yylex ]b4_prefix[lex
+#define yyerror ]b4_prefix[error
+#define yylval ]b4_prefix[lval
+#define yychar ]b4_prefix[char
+#define yydebug ]b4_prefix[debug
+#define yynerrs ]b4_prefix[nerrs
+]b4_locations_if([[#define yylloc ]b4_prefix[lloc]])])[
+
+/* Copy the first part of user declarations. */
+]b4_user_pre_prologue[
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG ]b4_debug_flag[
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE ]b4_error_verbose_flag[
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE ]b4_token_table[
+#endif
+
+]b4_percent_code_get([[requires]])[]dnl
+
+b4_token_enums_defines(b4_tokens)[
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+]m4_ifdef([b4_stype],
+[[typedef union ]b4_union_name[
+{
+]b4_user_stype[
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1]],
+[m4_if(b4_tag_seen_flag, 0,
+[[typedef int YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1]])])[
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+#endif]b4_locations_if([[
+
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+typedef struct YYLTYPE
+{
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+} YYLTYPE;
+# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+# define YYLTYPE_IS_DECLARED 1
+# define YYLTYPE_IS_TRIVIAL 1
+#endif]])b4_push_if([[
+
+#ifndef YYPUSH_DECLS
+# define YYPUSH_DECLS
+struct yypstate;
+typedef struct yypstate yypstate;
+enum { YYPUSH_MORE = 4 };
+
+]b4_pull_if([b4_c_function_decl([[yyparse]], [[int]], b4_parse_param)
+])b4_c_function_decl([[yypush_parse]], [[int]],
+ [[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
+ [[[int yypushed_char]], [[yypushed_char]]],
+ [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
+ [[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
+ b4_parse_param]))
+b4_pull_if([b4_c_function_decl([[yypull_parse]], [[int]],
+ [[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
+ b4_parse_param]))])
+b4_c_function_decl([[yypstate_new]], [[yypstate *]], [[[void]], []])
+b4_c_function_decl([[yypstate_delete]], [[void]],
+ [[[yypstate *yyps]], [[yyps]]])[
+#endif]])
+
+b4_percent_code_get([[provides]])[]dnl
+
+[/* Copy the second part of user declarations. */
+]b4_user_post_prologue
+b4_percent_code_get[]dnl
+
+[#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif ]b4_c_modern[
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && ]b4_c_modern[
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# endif
+# endif
+# ifndef YY_
+# define YY_(msgid) msgid
+# 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
+
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(n) (n)
+#else
+]b4_c_function_def([YYID], [static int], [[int yyi], [yyi]])[
+{
+ return yyi;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+]b4_push_if([],
+[[/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+# ifdef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
+# else
+# define YYSTACK_ALLOC alloca
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && ]b4_c_modern[
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
+# endif
+# endif
+# endif
+# endif
+# endif
+
+]])dnl
+[# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+# ifndef YYSTACK_ALLOC_MAXIMUM
+ /* The OS might guarantee only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+ to allow for a few compiler-allocated temporary stack slots. */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+# endif
+# else
+# define YYSTACK_ALLOC YYMALLOC
+# define YYSTACK_FREE YYFREE
+# ifndef YYSTACK_ALLOC_MAXIMUM
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+# endif
+# if (defined __cplusplus && ! defined _STDLIB_H \
+ && ! ((defined YYMALLOC || defined malloc) \
+ && (defined YYFREE || defined free)))
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
+# endif
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# if ! defined malloc && ! defined _STDLIB_H && ]b4_c_modern[
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# ifndef YYFREE
+# define YYFREE free
+# if ! defined free && ! defined _STDLIB_H && ]b4_c_modern[
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (]b4_locations_if([[defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+ && ]])[defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;]b4_locations_if([
+ YYLTYPE yyls_alloc;])[
+};
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+]b4_locations_if(
+[# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ + 2 * YYSTACK_GAP_MAXIMUM)],
+[# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAXIMUM)])[
+
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (YYID (0))
+# endif
+# endif
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (YYID (0))
+
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL ]b4_final_state_number[
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST ]b4_last[
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS ]b4_tokens_number[
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS ]b4_nterms_number[
+/* YYNRULES -- Number of rules. */
+#define YYNRULES ]b4_rules_number[
+/* YYNRULES -- Number of states. */
+#define YYNSTATES ]b4_states_number[
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+#define YYUNDEFTOK ]b4_undef_token_number[
+#define YYMAXUTOK ]b4_user_token_number_max[
+
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
+{
+ ]b4_translate[
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+static const ]b4_int_type_for([b4_prhs])[ yyprhs[] =
+{
+ ]b4_prhs[
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const ]b4_int_type_for([b4_rhs])[ yyrhs[] =
+{
+ ]b4_rhs[
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const ]b4_int_type_for([b4_rline])[ yyrline[] =
+{
+ ]b4_rline[
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ ]b4_tname[
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+ token YYLEX-NUM. */
+static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
+{
+ ]b4_toknum[
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const ]b4_int_type_for([b4_r1])[ yyr1[] =
+{
+ ]b4_r1[
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const ]b4_int_type_for([b4_r2])[ yyr2[] =
+{
+ ]b4_r2[
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+ means the default is an error. */
+static const ]b4_int_type_for([b4_defact])[ yydefact[] =
+{
+ ]b4_defact[
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const ]b4_int_type_for([b4_defgoto])[ yydefgoto[] =
+{
+ ]b4_defgoto[
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF ]b4_pact_ninf[
+static const ]b4_int_type_for([b4_pact])[ yypact[] =
+{
+ ]b4_pact[
+};
+
+/* YYPGOTO[NTERM-NUM]. */
+static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] =
+{
+ ]b4_pgoto[
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
+#define YYTABLE_NINF ]b4_table_ninf[
+static const ]b4_int_type_for([b4_table])[ yytable[] =
+{
+ ]b4_table[
+};
+
+static const ]b4_int_type_for([b4_check])[ yycheck[] =
+{
+ ]b4_check[
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const ]b4_int_type_for([b4_stos])[ yystos[] =
+{
+ ]b4_stos[
+};
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+
+#define YYFAIL goto yyerrlab
+
+#define YYRECOVERING() (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK (1); \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+while (YYID (0))
+
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (YYID (N)) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
+ while (YYID (0))
+#endif
+
+
+/* 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 YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (]b4_pure_if([&yylval[]b4_locations_if([, &yylloc]), ])[YYLEX_PARAM)
+#else
+# define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[
+#endif
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (YYID (0))
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value]b4_locations_if([, Location])[]b4_user_args[); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (YYID (0))
+
+]b4_yy_symbol_print_generate([b4_c_function_def])[
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included). |
+`------------------------------------------------------------------*/
+
+]b4_c_function_def([yy_stack_print], [static void],
+ [[yytype_int16 *yybottom], [yybottom]],
+ [[yytype_int16 *yytop], [yytop]])[
+{
+ YYFPRINTF (stderr, "Stack now");
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
+ YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (YYID (0))
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced. |
+`------------------------------------------------*/
+
+]b4_c_function_def([yy_reduce_print], [static void],
+ [[YYSTYPE *yyvsp], [yyvsp]],
+ b4_locations_if([[[YYLTYPE *yylsp], [yylsp]],
+ ])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,
+ b4_parse_param]))[
+{
+ int yynrhs = yyr2[yyrule];
+ int yyi;
+ unsigned long int yylno = yyrline[yyrule];
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ yyrule - 1, yylno);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+ &]b4_rhs_value(yynrhs, yyi + 1)[
+ ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
+ b4_user_args[);
+ YYFPRINTF (stderr, "\n");
+ }
+}
+
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyvsp, ]b4_locations_if([yylsp, ])[Rule]b4_user_args[); \
+} while (YYID (0))
+
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH ]b4_stack_depth_init[
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH ]b4_stack_depth_max[
+#endif
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined __GLIBC__ && defined _STRING_H
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+]b4_c_function_def([yystrlen], [static YYSIZE_T],
+ [[const char *yystr], [yystr]])[
+{
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
+ continue;
+ return yylen;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+]b4_c_function_def([yystpcpy], [static char *],
+ [[char *yydest], [yydest]], [[const char *yysrc], [yysrc]])[
+{
+ char *yyd = yydest;
+ const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of 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. If YYRES is
+ null, do not copy; instead, return the length of what the result
+ would have been. */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+ if (*yystr == '"')
+ {
+ YYSIZE_T yyn = 0;
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
+ do_not_strip_quotes: ;
+ }
+
+ if (! yyres)
+ return yystrlen (yystr);
+
+ return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+ int yyn = yypact[yystate];
+
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
+ else
+ {
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+
+# if 0
+ /* This is so xgettext sees the translatable formats that are
+ constructed on the fly. */
+ YY_("syntax error, unexpected %s");
+ YY_("syntax error, unexpected %s, expecting %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
+
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
+
+ if (yyresult)
+ {
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ char *yyp = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
+ }
+}
+#endif /* YYERROR_VERBOSE */
+
+
+]b4_yydestruct_generate([b4_c_function_def])[
+
+]b4_push_if([],
+[[/* Prevent warnings from -Wmissing-prototypes. */
+#ifdef YYPARSE_PARAM
+]b4_c_function_decl([yyparse], [int],
+ [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[
+#else /* ! YYPARSE_PARAM */
+]b4_c_function_decl([yyparse], [int], b4_parse_param)[
+#endif /* ! YYPARSE_PARAM */]])
+
+m4_divert_push([KILL])# ======================== M4 code.
+# b4_declare_scanner_communication_variables
+# ------------------------------------------
+# Declare the variables that are global, or local to YYPARSE if
+# pure-parser.
+m4_define([b4_declare_scanner_communication_variables],
+[[/* The lookahead symbol. */
+int yychar;
+
+/* The semantic value of the lookahead symbol. */
+YYSTYPE yylval;
+]b4_locations_if([[
+/* Location data for the lookahead symbol. */
+YYLTYPE yylloc;
+]])b4_pure_if([], [[
+/* Number of syntax errors so far. */
+int yynerrs;
+]])])
+
+# b4_declare_parser_state_variables
+# ---------------------------------
+# Declare all the variables that are needed to maintain the parser state
+# between calls to yypush_parse.
+m4_define([b4_declare_parser_state_variables],
+[b4_pure_if([[ /* Number of syntax errors so far. */
+ int yynerrs;
+]])[
+ int yystate;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+
+ /* The stacks and their tools:
+ `yyss': related to states.
+ `yyvs': related to semantic values.]b4_locations_if([[
+ `yyls': related to locations.]])[
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss;
+ yytype_int16 *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs;
+ YYSTYPE *yyvsp;
+]b4_locations_if([[
+ /* The location stack. */
+ YYLTYPE yylsa[YYINITDEPTH];
+ YYLTYPE *yyls;
+ YYLTYPE *yylsp;
+
+ /* The locations where the error started and ended. */
+ YYLTYPE yyerror_range[2];
+]])[
+ YYSIZE_T yystacksize;
+]])
+
+m4_divert_pop([KILL])dnl# ====================== End of M4 code.
+
+b4_pure_if([], [b4_declare_scanner_communication_variables])
+
+b4_push_if(
+[[struct yypstate
+ {
+ ]b4_declare_parser_state_variables[
+ /* Used to determine if this is the first time this instance has
+ been used. */
+ int yynew;
+ };]b4_pure_if([], [[
+
+static char yypstate_allocated = 0;]])b4_pull_if([
+
+b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
+{
+ return yypull_parse (0]m4_ifset([b4_parse_param],
+ [[, ]b4_c_args(b4_parse_param)])[);
+}
+
+]b4_c_function_def([[yypull_parse]], [[int]],
+ [[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
+ b4_parse_param]))[
+{
+ int yystatus;
+ yypstate *yyps_local;]b4_pure_if([[
+ int yychar;
+ YYSTYPE yylval;]b4_locations_if([[
+ YYLTYPE yylloc;]])])[
+ if (yyps == 0)
+ {
+ yyps_local = yypstate_new ();
+ if (!yyps_local)
+ {]b4_pure_if([[
+ yyerror (]b4_yyerror_args[YY_("memory exhausted"));]], [[
+ if (!yypstate_allocated)
+ yyerror (]b4_yyerror_args[YY_("memory exhausted"));]])[
+ return 2;
+ }
+ }
+ else
+ yyps_local = yyps;
+ do {
+ yychar = YYLEX;
+ yystatus =
+ yypush_parse (yyps_local]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])[);
+ } while (yystatus == YYPUSH_MORE);
+ if (yyps == 0)
+ yypstate_delete (yyps_local);
+ return yystatus;
+}]])[
+
+/* Initialize the parser data structure. */
+]b4_c_function_def([[yypstate_new]], [[yypstate *]])[
+{
+ yypstate *yyps;]b4_pure_if([], [[
+ if (yypstate_allocated)
+ return 0;]])[
+ yyps = (yypstate *) malloc (sizeof *yyps);
+ if (!yyps)
+ return 0;
+ yyps->yynew = 1;]b4_pure_if([], [[
+ yypstate_allocated = 1;]])[
+ return yyps;
+}
+
+]b4_c_function_def([[yypstate_delete]], [[void]],
+ [[[yypstate *yyps]], [[yyps]]])[
+{
+#ifndef yyoverflow
+ /* If the stack was reallocated but the parse did not complete, then the
+ stack still needs to be freed. */
+ if (!yyps->yynew && yyps->yyss != yyps->yyssa)
+ YYSTACK_FREE (yyps->yyss);
+#endif
+ free (yyps);]b4_pure_if([], [[
+ yypstate_allocated = 0;]])[
+}
+
+]b4_pure_if([[#define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs
+]])[#define yystate yyps->yystate
+#define yyerrstatus yyps->yyerrstatus
+#define yyssa yyps->yyssa
+#define yyss yyps->yyss
+#define yyssp yyps->yyssp
+#define yyvsa yyps->yyvsa
+#define yyvs yyps->yyvs
+#define yyvsp yyps->yyvsp
+]b4_locations_if([[#define yylsa yyps->yylsa
+#define yyls yyps->yyls
+#define yylsp yyps->yylsp
+#define yyerror_range yyps->yyerror_range
+]])[#define yystacksize yyps->yystacksize
+]])[
+/*-------------------------.
+| yyparse or yypush_parse. |
+`-------------------------*/
+]b4_push_if([
+b4_c_function_def([[yypush_parse]], [[int]],
+ [[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
+ [[[int yypushed_char]], [[yypushed_char]]],
+ [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
+ [[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
+ b4_parse_param]))], [
+#ifdef YYPARSE_PARAM
+b4_c_function_def([yyparse], [int], [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])
+#else /* ! YYPARSE_PARAM */
+b4_c_function_def([yyparse], [int], b4_parse_param)
+#endif])[
+{
+]b4_pure_if([b4_declare_scanner_communication_variables])
+b4_push_if([b4_pure_if([], [[ int yypushed_char = yychar;
+ YYSTYPE yypushed_val = yylval;
+ ]b4_locations_if([[YYLTYPE yypushed_loc = yylloc;
+]])])],
+ [b4_declare_parser_state_variables])[
+ int yyn;
+ int yyresult;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken;
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;]b4_locations_if([[
+ YYLTYPE yyloc;]])[
+
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)]b4_locations_if([, yylsp -= (N)])[)
+
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;]b4_push_if([[
+
+ if (!yyps->yynew)
+ {
+ yyn = yypact[yystate];
+ goto yyread_pushed_token;
+ }]])[
+
+ yytoken = 0;
+ yyss = yyssa;
+ yyvs = yyvsa;]b4_locations_if([[
+ yyls = yylsa;]])[
+ yystacksize = YYINITDEPTH;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+ yyssp = yyss;
+ yyvsp = yyvs;]b4_locations_if([[
+ yylsp = yyls;
+
+#if YYLTYPE_IS_TRIVIAL
+ /* Initialize the default location before parsing starts. */
+ yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
+ yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
+#endif]])
+m4_ifdef([b4_initial_action],[
+m4_pushdef([b4_at_dollar], [m4_define([b4_at_dollar_used])yylloc])dnl
+m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl
+/* User initialization code. */
+b4_user_initial_action
+m4_popdef([b4_dollar_dollar])dnl
+m4_popdef([b4_at_dollar])])dnl
+m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
+]])dnl
+m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
+]])[
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. So pushing a state here evens the stacks. */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ yytype_int16 *yyss1 = yyss;]b4_locations_if([
+ YYLTYPE *yyls1 = yyls;])[
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([
+ &yyls1, yysize * sizeof (*yylsp),])[
+ &yystacksize);
+]b4_locations_if([
+ yyls = yyls1;])[
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+# else
+ /* Extend the stack our own way. */
+ if (YYMAXDEPTH <= yystacksize)
+ goto yyexhaustedlab;
+ yystacksize *= 2;
+ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ yytype_int16 *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_locations_if([
+ YYSTACK_RELOCATE (yyls_alloc, yyls);])[
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;]b4_locations_if([
+ yylsp = yyls + yysize - 1;])[
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ if (yystate == YYFINAL)
+ YYACCEPT;
+
+ goto yybackup;
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+ /* Do appropriate processing given the current state. Read a
+ lookahead token if we need one and don't already have one. */
+
+ /* First try to decide what to do without reference to lookahead token. */
+ yyn = yypact[yystate];
+ if (yyn == YYPACT_NINF)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ if (yychar == YYEMPTY)
+ {]b4_push_if([[
+ if (!yyps->yynew)
+ {]b4_use_push_for_pull_if([], [[
+ YYDPRINTF ((stderr, "Return for a new token:\n"));]])[
+ yyresult = YYPUSH_MORE;
+ goto yypushreturn;
+ }
+ yyps->yynew = 0;]b4_pure_if([], [[
+ /* Restoring the pushed token is only necessary for the first
+ yypush_parse invocation since subsequent invocations don't overwrite
+ it before jumping to yyread_pushed_token. */
+ yychar = yypushed_char;
+ yylval = yypushed_val;]b4_locations_if([[
+ yylloc = yypushed_loc;]])])[
+yyread_pushed_token:]])[
+ YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[
+ yychar = yypushed_char;
+ if (yypushed_val)
+ yylval = *yypushed_val;]b4_locations_if([[
+ if (yypushed_loc)
+ yylloc = *yypushed_loc;]])])], [[
+ yychar = YYLEX;]])[
+ }
+
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ /* 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)
+ goto yydefault;
+ yyn = yytable[yyn];
+ if (yyn <= 0)
+ {
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ /* Shift the lookahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
+
+ yystate = yyn;
+ *++yyvsp = yylval;
+]b4_locations_if([ *++yylsp = yylloc;])[
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+]b4_locations_if(
+[[ /* Default location. */
+ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);]])[
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ ]b4_user_actions[
+ default: break;
+ }
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;]b4_locations_if([
+ *++yylsp = yyloc;])[
+
+ /* Now `shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+#if ! YYERROR_VERBOSE
+ yyerror (]b4_yyerror_args[YY_("syntax error"));
+#else
+ {
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ }
+ }
+
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (]b4_yyerror_args[yymsg);
+ }
+ else
+ {
+ yyerror (]b4_yyerror_args[YY_("syntax error"));
+ if (yysize != 0)
+ goto yyexhaustedlab;
+ }
+ }
+#endif
+ }
+
+]b4_locations_if([[ yyerror_range[0] = yylloc;]])[
+
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ if (yychar <= YYEOF)
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
+ else
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);
+ yychar = YYEMPTY;
+ }
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+ goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR. |
+`---------------------------------------------------*/
+yyerrorlab:
+
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (/*CONSTCOND*/ 0)
+ goto yyerrorlab;
+
+]b4_locations_if([[ yyerror_range[0] = yylsp[1-yylen];
+]])[ /* Do not reclaim the symbols of the rule which action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
+ yystate = *yyssp;
+ goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR. |
+`-------------------------------------------------------------*/
+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 (yyssp == yyss)
+ YYABORT;
+
+]b4_locations_if([[ yyerror_range[0] = *yylsp;]])[
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);
+ YYPOPSTACK (1);
+ yystate = *yyssp;
+ YY_STACK_PRINT (yyss, yyssp);
+ }
+
+ *++yyvsp = yylval;
+]b4_locations_if([[
+ yyerror_range[1] = yylloc;
+ /* Using YYLLOC is tempting, but would change the location of
+ the lookahead. YYLOC is available though. */
+ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+ *++yylsp = yyloc;]])[
+
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+#if !defined(yyoverflow) || YYERROR_VERBOSE
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here. |
+`-------------------------------------------------*/
+yyexhaustedlab:
+ yyerror (]b4_yyerror_args[YY_("memory exhausted"));
+ yyresult = 2;
+ /* Fall through. */
+#endif
+
+yyreturn:
+ if (yychar != YYEMPTY)
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYABORT or YYACCEPT. */
+ YYPOPSTACK (yylen);
+ YY_STACK_PRINT (yyss, yyssp);
+ while (yyssp != yyss)
+ {
+ yydestruct ("Cleanup: popping",
+ yystos[*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);
+ YYPOPSTACK (1);
+ }
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+]b4_push_if([[ yyps->yynew = 1;
+
+yypushreturn:
+]])[#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
+ /* Make sure YYID is used. */
+ return YYID (yyresult);
+}
+
+
+]b4_epilogue
+b4_defines_if(
+[@output(b4_spec_defines_file@)
+b4_copyright([Skeleton interface for Bison's Yacc-like parsers in C],dnl '
+ [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006])
+
+b4_percent_code_get([[requires]])[]dnl
+
+b4_token_enums_defines(b4_tokens)
+
+[#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+]m4_ifdef([b4_stype],
+[[typedef union ]b4_union_name[
+{
+]b4_user_stype[
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1]],
+[m4_if(b4_tag_seen_flag, 0,
+[[typedef int YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1]])])[
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+]b4_pure_if([], [[extern YYSTYPE ]b4_prefix[lval;]])
+
+b4_locations_if(
+[#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+typedef struct YYLTYPE
+{
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+} YYLTYPE;
+# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+# define YYLTYPE_IS_DECLARED 1
+# define YYLTYPE_IS_TRIVIAL 1
+#endif
+
+]b4_pure_if([], [[extern YYLTYPE ]b4_prefix[lloc;]])
+)dnl b4_locations_if
+b4_push_if([[
+#ifndef YYPUSH_DECLS
+# define YYPUSH_DECLS
+struct ]b4_prefix[pstate;
+typedef struct ]b4_prefix[pstate ]b4_prefix[pstate;
+enum { YYPUSH_MORE = 4 };
+]b4_pull_if([b4_c_function_decl([b4_prefix[parse]], [[int]], b4_parse_param)
+])b4_c_function_decl([b4_prefix[push_parse]], [[int]],
+ [[b4_prefix[pstate *yyps]], [[yyps]]]b4_pure_if([,
+ [[[int yypushed_char]], [[yypushed_char]]],
+ [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
+ [[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
+ b4_parse_param]))
+b4_pull_if([b4_c_function_decl([b4_prefix[pull_parse]], [[int]],
+ [[b4_prefix[pstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
+ b4_parse_param]))])
+b4_c_function_decl([b4_prefix[pstate_new]], [b4_prefix[pstate *]],
+ [[[void]], []])
+b4_c_function_decl([b4_prefix[pstate_delete]], [[void]],
+ [[b4_prefix[pstate *yyps]], [[yyps]]])[
+#endif
+]])
+b4_percent_code_get([[provides]])[]dnl
+])dnl b4_defines_if
+m4_divert_pop(0)
diff --git a/gnuwin32/share/locale/ca/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/ca/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..6ba6490e
--- /dev/null
+++ b/gnuwin32/share/locale/ca/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/da/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/da/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..03bb961a
--- /dev/null
+++ b/gnuwin32/share/locale/da/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/da/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/da/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..e62a7842
--- /dev/null
+++ b/gnuwin32/share/locale/da/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/da/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/da/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..244b4db4
--- /dev/null
+++ b/gnuwin32/share/locale/da/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/de/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/de/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..178fc682
--- /dev/null
+++ b/gnuwin32/share/locale/de/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/de/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/de/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..c1783d00
--- /dev/null
+++ b/gnuwin32/share/locale/de/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/de/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/de/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..9c037912
--- /dev/null
+++ b/gnuwin32/share/locale/de/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/el/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/el/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..912b59be
--- /dev/null
+++ b/gnuwin32/share/locale/el/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/el/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/el/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..0ba96cc4
--- /dev/null
+++ b/gnuwin32/share/locale/el/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/eo/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/eo/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..5cb53e72
--- /dev/null
+++ b/gnuwin32/share/locale/eo/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/es/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/es/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..5723878d
--- /dev/null
+++ b/gnuwin32/share/locale/es/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/es/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/es/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..f85ef2c7
--- /dev/null
+++ b/gnuwin32/share/locale/es/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/es/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/es/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..9ddb3318
--- /dev/null
+++ b/gnuwin32/share/locale/es/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/et/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/et/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..cb358763
--- /dev/null
+++ b/gnuwin32/share/locale/et/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/et/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/et/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..a3c20bad
--- /dev/null
+++ b/gnuwin32/share/locale/et/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/et/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/et/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..3ffae1c8
--- /dev/null
+++ b/gnuwin32/share/locale/et/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/fi/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/fi/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..c5ea804e
--- /dev/null
+++ b/gnuwin32/share/locale/fi/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/fi/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/fi/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..e62add45
--- /dev/null
+++ b/gnuwin32/share/locale/fi/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/fr/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/fr/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..11c009e2
--- /dev/null
+++ b/gnuwin32/share/locale/fr/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/fr/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/fr/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..91019338
--- /dev/null
+++ b/gnuwin32/share/locale/fr/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/fr/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/fr/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..487b2129
--- /dev/null
+++ b/gnuwin32/share/locale/fr/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ga/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/ga/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..6b4fec2f
--- /dev/null
+++ b/gnuwin32/share/locale/ga/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ga/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/ga/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..6d8783c2
--- /dev/null
+++ b/gnuwin32/share/locale/ga/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ga/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/ga/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..d8ec0523
--- /dev/null
+++ b/gnuwin32/share/locale/ga/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/gl/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/gl/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..d450db0f
--- /dev/null
+++ b/gnuwin32/share/locale/gl/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/hr/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/hr/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..bf3cf01b
--- /dev/null
+++ b/gnuwin32/share/locale/hr/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/hr/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/hr/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..f01f2d78
--- /dev/null
+++ b/gnuwin32/share/locale/hr/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/hr/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/hr/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..3f84da1f
--- /dev/null
+++ b/gnuwin32/share/locale/hr/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/hu/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/hu/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..15648b10
--- /dev/null
+++ b/gnuwin32/share/locale/hu/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/id/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/id/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..649f2d9a
--- /dev/null
+++ b/gnuwin32/share/locale/id/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/id/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/id/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..54f14384
--- /dev/null
+++ b/gnuwin32/share/locale/id/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/id/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/id/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..ee08af5d
--- /dev/null
+++ b/gnuwin32/share/locale/id/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/it/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/it/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..463e2913
--- /dev/null
+++ b/gnuwin32/share/locale/it/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/it/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/it/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..09771eb9
--- /dev/null
+++ b/gnuwin32/share/locale/it/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/it/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/it/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..d2c40dc9
--- /dev/null
+++ b/gnuwin32/share/locale/it/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ja/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/ja/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..d11de405
--- /dev/null
+++ b/gnuwin32/share/locale/ja/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ja/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/ja/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..c28966a8
--- /dev/null
+++ b/gnuwin32/share/locale/ja/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ky/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/ky/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..4185d053
--- /dev/null
+++ b/gnuwin32/share/locale/ky/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/lt/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/lt/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..16ac4d10
--- /dev/null
+++ b/gnuwin32/share/locale/lt/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ms/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/ms/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..87905ba0
--- /dev/null
+++ b/gnuwin32/share/locale/ms/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ms/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/ms/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..ed59d886
--- /dev/null
+++ b/gnuwin32/share/locale/ms/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/nb/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/nb/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..cff7d776
--- /dev/null
+++ b/gnuwin32/share/locale/nb/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/nb/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/nb/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..3bcf6492
--- /dev/null
+++ b/gnuwin32/share/locale/nb/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/nl/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/nl/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..7b2f24c1
--- /dev/null
+++ b/gnuwin32/share/locale/nl/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/nl/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/nl/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..da4de8ed
--- /dev/null
+++ b/gnuwin32/share/locale/nl/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/nl/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/nl/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..f985ea28
--- /dev/null
+++ b/gnuwin32/share/locale/nl/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/pl/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/pl/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..30822a53
--- /dev/null
+++ b/gnuwin32/share/locale/pl/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/pl/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/pl/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..7b6fae2c
--- /dev/null
+++ b/gnuwin32/share/locale/pl/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/pl/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/pl/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..bb5c4e93
--- /dev/null
+++ b/gnuwin32/share/locale/pl/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/pt_BR/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/pt_BR/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..1e72485c
--- /dev/null
+++ b/gnuwin32/share/locale/pt_BR/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/pt_BR/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/pt_BR/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..b579bbb9
--- /dev/null
+++ b/gnuwin32/share/locale/pt_BR/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/pt_BR/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/pt_BR/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..72b522bd
--- /dev/null
+++ b/gnuwin32/share/locale/pt_BR/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ro/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/ro/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..aaff454b
--- /dev/null
+++ b/gnuwin32/share/locale/ro/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ro/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/ro/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..76d6c871
--- /dev/null
+++ b/gnuwin32/share/locale/ro/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ro/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/ro/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..7515f60c
--- /dev/null
+++ b/gnuwin32/share/locale/ro/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ru/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/ru/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..189d7dd9
--- /dev/null
+++ b/gnuwin32/share/locale/ru/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ru/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/ru/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..7e16fad6
--- /dev/null
+++ b/gnuwin32/share/locale/ru/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/ru/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/ru/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..8f44eb50
--- /dev/null
+++ b/gnuwin32/share/locale/ru/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/sk/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/sk/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..1cd1dbbb
--- /dev/null
+++ b/gnuwin32/share/locale/sk/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/sl/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/sl/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..fd1b5d24
--- /dev/null
+++ b/gnuwin32/share/locale/sl/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/sl/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/sl/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..3d79f017
--- /dev/null
+++ b/gnuwin32/share/locale/sl/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/sr/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/sr/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..53da354f
--- /dev/null
+++ b/gnuwin32/share/locale/sr/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/sv/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/sv/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..51d4b157
--- /dev/null
+++ b/gnuwin32/share/locale/sv/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/sv/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/sv/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..d00a9e22
--- /dev/null
+++ b/gnuwin32/share/locale/sv/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/sv/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/sv/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..1ed0bfc2
--- /dev/null
+++ b/gnuwin32/share/locale/sv/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/th/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/th/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..537a09b3
--- /dev/null
+++ b/gnuwin32/share/locale/th/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/tr/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/tr/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..e3389128
--- /dev/null
+++ b/gnuwin32/share/locale/tr/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/tr/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/tr/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..17e87fe3
--- /dev/null
+++ b/gnuwin32/share/locale/tr/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/tr/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/tr/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..1a9c9bb9
--- /dev/null
+++ b/gnuwin32/share/locale/tr/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/uk/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/uk/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..a0323a5d
--- /dev/null
+++ b/gnuwin32/share/locale/uk/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/uk/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/uk/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..b41d6f32
--- /dev/null
+++ b/gnuwin32/share/locale/uk/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/uk/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/uk/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..feb85cce
--- /dev/null
+++ b/gnuwin32/share/locale/uk/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/vi/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/vi/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..7e650d74
--- /dev/null
+++ b/gnuwin32/share/locale/vi/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/vi/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/vi/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..d41ee574
--- /dev/null
+++ b/gnuwin32/share/locale/vi/LC_MESSAGES/bison.mo
Binary files differ
diff --git a/gnuwin32/share/locale/wa/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/wa/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..dc26f4e6
--- /dev/null
+++ b/gnuwin32/share/locale/wa/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/zh_CN/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/zh_CN/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..b0998380
--- /dev/null
+++ b/gnuwin32/share/locale/zh_CN/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/zh_CN/LC_MESSAGES/libiconv.mo b/gnuwin32/share/locale/zh_CN/LC_MESSAGES/libiconv.mo
new file mode 100644
index 00000000..0f7080c6
--- /dev/null
+++ b/gnuwin32/share/locale/zh_CN/LC_MESSAGES/libiconv.mo
Binary files differ
diff --git a/gnuwin32/share/locale/zh_TW/LC_MESSAGES/bison-runtime.mo b/gnuwin32/share/locale/zh_TW/LC_MESSAGES/bison-runtime.mo
new file mode 100644
index 00000000..243f5aa0
--- /dev/null
+++ b/gnuwin32/share/locale/zh_TW/LC_MESSAGES/bison-runtime.mo
Binary files differ
diff --git a/gnuwin32/share/locale/zh_TW/LC_MESSAGES/bison.mo b/gnuwin32/share/locale/zh_TW/LC_MESSAGES/bison.mo
new file mode 100644
index 00000000..9c01484c
--- /dev/null
+++ b/gnuwin32/share/locale/zh_TW/LC_MESSAGES/bison.mo
Binary files differ