summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2016-01-22 13:42:01 -0800
committerManoj Srivastava <srivasta@debian.org>2016-01-22 13:42:01 -0800
commita646b6cd438dc4bd957c6c6afd89b5e8e59468fe (patch)
treefea00d61d8b525da028cbe906ac44bbdf5674d90 /doc
parent426e91fa66c2a2341d46f977ee351bd24ef3331c (diff)
Imported Upstream version 2.6.0
Diffstat (limited to 'doc')
-rw-r--r--doc/.gitignore27
-rw-r--r--doc/Makefile.in237
-rw-r--r--doc/flex.123
-rw-r--r--doc/flex.info485
-rw-r--r--doc/flex.info-14340
-rw-r--r--doc/flex.info-2bin52182 -> 26966 bytes
-rw-r--r--doc/flex.pdfbin553361 -> 553358 bytes
-rw-r--r--doc/flex.texi646
-rwxr-xr-xdoc/mdate-sh225
-rw-r--r--doc/stamp-vti8
-rw-r--r--doc/texinfo.tex9977
-rw-r--r--doc/version.texi8
12 files changed, 3060 insertions, 12916 deletions
diff --git a/doc/.gitignore b/doc/.gitignore
deleted file mode 100644
index 83b0108..0000000
--- a/doc/.gitignore
+++ /dev/null
@@ -1,27 +0,0 @@
-flex.aux
-flex.cp
-flex.cps
-flex.dvi
-flex.fn
-flex.fns
-flex.hk
-flex.hks
-flex.info*
-flex.ky
-flex.log
-flex.op
-flex.ops
-flex.pg
-flex.toc
-flex.tp
-flex.tps
-flex.vr
-flex.vrs
-Makefile
-Makefile.in
-flex.1
-flex.pdf
-flex.ps
-version.texi
-flex.html
-flex.t2p
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 7022db7..69a8eb0 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,23 +15,61 @@
@SET_MAKE@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -52,9 +89,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
-DIST_COMMON = $(dist_doc_DATA) $(dist_man_MANS) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/stamp-vti \
- $(srcdir)/version.texi mdate-sh texinfo.tex
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
@@ -66,14 +100,57 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
+ $(srcdir)/stamp-vti $(dist_doc_DATA) $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
SOURCES =
DIST_SOURCES =
+AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
+am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
+am__v_DVIPS_0 = @echo " DVIPS " $@;
+am__v_DVIPS_1 =
+AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
+am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
+am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
+am__v_MAKEINFO_1 =
+AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
+am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
+am__v_INFOHTML_0 = @echo " INFOHTML" $@;
+am__v_INFOHTML_1 =
+AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
+am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
+am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
+am__v_TEXI2DVI_1 =
+AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
+am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
+am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
+am__v_TEXI2PDF_1 =
+AM_V_texinfo = $(am__v_texinfo_@AM_V@)
+am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
+am__v_texinfo_0 = -q
+am__v_texinfo_1 =
+AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
+am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
+am__v_texidevnull_0 = > /dev/null
+am__v_texidevnull_1 =
INFO_DEPS = $(srcdir)/flex.info
-am__TEXINFO_TEX_DIR = $(srcdir)
+TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
+am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
DVIS = flex.dvi
PDFS = flex.pdf
PSS = flex.ps
@@ -122,10 +199,15 @@ man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(dist_man_MANS)
DATA = $(dist_doc_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/mdate-sh \
+ $(top_srcdir)/build-aux/texinfo.tex
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -181,6 +263,7 @@ LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
M4 = @M4@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -308,7 +391,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -334,7 +416,7 @@ clean-libtool:
-rm -rf .libs _libs
.texi.info:
- restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+ $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
am__cwd=`pwd` && $(am__cd) $(srcdir) && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
@@ -356,27 +438,25 @@ clean-libtool:
rm -rf $$backupdir; exit $$rc
.texi.dvi:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2DVI) $<
+ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
+ $<
.texi.pdf:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2PDF) $<
+ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
+ $<
.texi.html:
- rm -rf $(@:.html=.htp)
- if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
+ $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $(@:.html=.htp) $<; \
then \
- rm -rf $@; \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
+ rm -rf $@ && mv $(@:.html=.htp) $@; \
else \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
- exit 1; \
+ rm -rf $(@:.html=.htp); exit 1; \
fi
$(srcdir)/flex.info: flex.texi $(srcdir)/version.texi
flex.dvi: flex.texi $(srcdir)/version.texi
@@ -385,25 +465,26 @@ flex.html: flex.texi $(srcdir)/version.texi
$(srcdir)/version.texi: $(srcdir)/stamp-vti
$(srcdir)/stamp-vti: flex.texi $(top_srcdir)/configure
@(dir=.; test -f ./flex.texi || dir=$(srcdir); \
- set `$(SHELL) $(srcdir)/mdate-sh $$dir/flex.texi`; \
+ set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/flex.texi`; \
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
echo "@set EDITION $(VERSION)"; \
- echo "@set VERSION $(VERSION)") > vti.tmp
- @cmp -s vti.tmp $(srcdir)/version.texi \
- || (echo "Updating $(srcdir)/version.texi"; \
- cp vti.tmp $(srcdir)/version.texi)
- -@rm -f vti.tmp
+ echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
+ (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \
+ || (echo "Updating $(srcdir)/version.texi" && \
+ cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \
+ mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \
+ rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$
@cp $(srcdir)/version.texi $@
mostlyclean-vti:
- -rm -f vti.tmp
+ -rm -f vti.tmp* $(srcdir)/version.texi.tmp*
maintainer-clean-vti:
-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
.dvi.ps:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- $(DVIPS) -o $@ $<
+ $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(DVIPS) $(AM_V_texinfo) -o $@ $<
uninstall-dvi-am:
@$(NORMAL_UNINSTALL)
@@ -482,9 +563,7 @@ dist-info: $(INFO_DEPS)
done
mostlyclean-aminfo:
- -rm -rf flex.aux flex.cp flex.cps flex.fn flex.fns flex.hk flex.hks flex.ky \
- flex.kys flex.log flex.op flex.ops flex.pg flex.pgs flex.tmp \
- flex.toc flex.tp flex.tps flex.vr flex.vrs
+ -rm -rf flex.t2d flex.t2p
clean-aminfo:
-test -z "flex.dvi flex.pdf flex.ps flex.html" \
@@ -560,27 +639,14 @@ uninstall-dist_docDATA:
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
-tags: TAGS
-TAGS:
+tags TAGS:
-ctags: CTAGS
-CTAGS:
+ctags CTAGS:
+
+cscope cscopelist:
distdir: $(DISTFILES)
- @list='$(MANS)'; if test -n "$$list"; then \
- list=`for p in $$list; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
- if test -n "$$list" && \
- grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
- echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
- grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
- echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
- echo " typically \`make maintainer-clean' will remove them" >&2; \
- exit 1; \
- else :; fi; \
- else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -817,27 +883,30 @@ uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
- clean-libtool dist-info distclean distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-dist_docDATA install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-man1 install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-aminfo maintainer-clean-generic \
- maintainer-clean-vti mostlyclean mostlyclean-aminfo \
- mostlyclean-generic mostlyclean-libtool mostlyclean-vti pdf \
- pdf-am ps ps-am uninstall uninstall-am uninstall-dist_docDATA \
- uninstall-dvi-am uninstall-html-am uninstall-info-am \
- uninstall-man uninstall-man1 uninstall-pdf-am uninstall-ps-am
-
-
-$(dist_man_MANS): $(top_srcdir)/main.c
+ clean-libtool cscopelist-am ctags-am dist-info distclean \
+ distclean-generic distclean-libtool distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dist_docDATA install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-man1 install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-aminfo \
+ maintainer-clean-generic maintainer-clean-vti mostlyclean \
+ mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-vti pdf pdf-am ps ps-am tags-am uninstall \
+ uninstall-am uninstall-dist_docDATA uninstall-dvi-am \
+ uninstall-html-am uninstall-info-am uninstall-man \
+ uninstall-man1 uninstall-pdf-am uninstall-ps-am
+
+.PRECIOUS: Makefile
+
+
+$(dist_man_MANS): $(top_srcdir)/configure.ac $(top_srcdir)/src/flex.skl $(top_srcdir)/src/options.c $(top_srcdir)/src/options.h
for i in $(dist_man_MANS) ; do \
$(help2man) --name='$(PACKAGE_NAME)' \
--section=`echo $$i | sed -e 's/.*\.\([^.]*\)$$/\1/'` \
- ../flex$(EXEEXT) > $$i || rm -f $$i ; \
+ $(top_srcdir)/src/flex$(EXEEXT) > $$i || rm -f $$i ; \
done
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/doc/flex.1 b/doc/flex.1
index 50bd7a1..ae8d062 100644
--- a/doc/flex.1
+++ b/doc/flex.1
@@ -1,10 +1,10 @@
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.11.
-.TH FLEX "1" "March 2014" "flex 2.5.39" "User Commands"
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.1.
+.TH FLEX "1" "November 2015" "flex 2.6.0" "User Commands"
.SH NAME
flex \- the fast lexical analyser generator
.SH SYNOPSIS
.B flex
-[\fIOPTIONS\fR] [\fIFILE\fR]...
+[\fI\,OPTIONS\/\fR] [\fI\,FILE\/\fR]...
.SH DESCRIPTION
Generates programs that perform pattern\-matching on text.
.SS "Table Compression:"
@@ -57,24 +57,27 @@ do not generate warnings
.TP
\fB\-v\fR, \fB\-\-verbose\fR
write summary of scanner statistics to stdout
+.TP
+\fB\-\-hex\fR
+use hexadecimal numbers instead of octal in debug outputs
.SH FILES
.TP
-\fB\-o\fR, \fB\-\-outfile\fR=\fIFILE\fR
+\fB\-o\fR, \fB\-\-outfile\fR=\fI\,FILE\/\fR
specify output filename
.TP
-\fB\-S\fR, \fB\-\-skel\fR=\fIFILE\fR
+\fB\-S\fR, \fB\-\-skel\fR=\fI\,FILE\/\fR
specify skeleton file
.TP
\fB\-t\fR, \fB\-\-stdout\fR
write scanner on stdout instead of lex.yy.c
.TP
-\fB\-\-yyclass\fR=\fINAME\fR
+\fB\-\-yyclass\fR=\fI\,NAME\/\fR
name of C++ class
.TP
-\fB\-\-header\-file\fR=\fIFILE\fR
+\fB\-\-header\-file\fR=\fI\,FILE\/\fR
create a C header file in addition to the scanner
.HP
-\fB\-\-tables\-file\fR[=\fIFILE\fR] write tables to FILE
+\fB\-\-tables\-file\fR[=\fI\,FILE\/\fR] write tables to FILE
.SS "Scanner behavior:"
.TP
\fB\-7\fR, \fB\-\-7bit\fR
@@ -105,13 +108,13 @@ track line count in yylineno
\-+, \fB\-\-c\fR++
generate C++ scanner class
.TP
-\fB\-Dmacro\fR[=\fIdefn\fR]
+\fB\-Dmacro\fR[=\fI\,defn\/\fR]
#define macro defn (default defn is '1')
.TP
\fB\-L\fR, \fB\-\-noline\fR
suppress #line directives in scanner
.TP
-\fB\-P\fR, \fB\-\-prefix\fR=\fISTRING\fR
+\fB\-P\fR, \fB\-\-prefix\fR=\fI\,STRING\/\fR
use STRING as prefix instead of "yy"
.TP
\fB\-R\fR, \fB\-\-reentrant\fR
diff --git a/doc/flex.info b/doc/flex.info
index 62ff3e0..1faf9cb 100644
--- a/doc/flex.info
+++ b/doc/flex.info
@@ -1,15 +1,10 @@
-This is flex.info, produced by makeinfo version 4.13 from flex.texi.
+This is flex.info, produced by makeinfo version 6.0 from flex.texi.
-INFO-DIR-SECTION Programming
-START-INFO-DIR-ENTRY
-* flex: (flex). Fast lexical analyzer generator (lex replacement).
-END-INFO-DIR-ENTRY
-
- The flex manual is placed under the same licensing conditions as the
+The flex manual is placed under the same licensing conditions as the
rest of flex:
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 The
-Flex Project.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 The Flex
+Project.
Copyright (C) 1990, 1997 The Regents of the University of California.
All rights reserved.
@@ -18,14 +13,14 @@ All rights reserved.
Paxson.
The United States Government has rights in this work pursuant to
-contract no. DE-AC03-76SF00098 between the United States Department of
+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 the following conditions are
met:
- 1. Redistributions of source code must retain the above copyright
+ 1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
@@ -40,243 +35,247 @@ 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.
+INFO-DIR-SECTION Programming
+START-INFO-DIR-ENTRY
+* flex: (flex). Fast lexical analyzer generator (lex replacement).
+END-INFO-DIR-ENTRY

Indirect:
-flex.info-1: 1627
-flex.info-2: 288420
+flex.info-1: 1622
+flex.info-2: 319164

Tag Table:
(Indirect)
-Node: Top1627
-Node: Copyright7695
-Node: Reporting Bugs9214
-Node: Introduction9519
-Node: Simple Examples10347
-Node: Format13634
-Node: Definitions Section14047
-Ref: Definitions Section-Footnote-116305
-Node: Rules Section16373
-Node: User Code Section17530
-Node: Comments in the Input17968
-Node: Patterns19335
-Ref: case and character ranges26159
-Node: Matching30170
-Node: Actions33454
-Node: Generated Scanner42423
-Node: Start Conditions47438
-Node: Multiple Input Buffers57975
-Ref: Scanning Strings64511
-Node: EOF66141
-Node: Misc Macros67727
-Node: User Values70579
-Node: Yacc72910
-Node: Scanner Options73805
-Node: Options for Specifying Filenames76561
-Ref: option-header76787
-Ref: option-outfile77499
-Ref: option-stdout77824
-Node: Options Affecting Scanner Behavior78806
-Ref: option-case-insensitive79047
-Ref: option-lex-compat79480
-Ref: option-batch80012
-Ref: option-interactive80536
-Ref: option-7bit81890
-Ref: option-8bit83194
-Ref: option-default83606
-Ref: option-always-interactive83670
-Ref: option-posix84274
-Ref: option-stack85421
-Ref: option-stdinit85529
-Ref: option-yylineno86007
-Ref: option-yywrap86450
-Node: Code-Level And API Options86718
-Ref: option-ansi-definitions86945
-Ref: option-ansi-prototypes87197
-Ref: option-bison-bridge87444
-Ref: option-bison-locations87783
-Ref: option-noline88043
-Ref: option-reentrant88557
-Ref: option-c++89168
-Ref: option-array89294
-Ref: option-pointer89392
-Ref: option-prefix89520
-Ref: option-main91048
-Ref: option-nounistd91232
-Ref: option-yyclass91740
-Node: Options for Scanner Speed and Size92226
-Ref: option-align92775
-Ref: option-ecs93276
-Ref: option-meta-ecs94312
-Ref: option-read94799
-Ref: option-full96681
-Ref: option-fast96876
-Node: Debugging Options97801
-Ref: option-backup97988
-Ref: option-debug98533
-Ref: option-perf-report99255
-Ref: option-nodefault99881
-Ref: option-trace100199
-Ref: option-nowarn100490
-Ref: option-verbose100558
-Ref: option-warn100987
-Node: Miscellaneous Options101206
-Node: Performance101663
-Node: Cxx111905
-Node: Reentrant119507
-Node: Reentrant Uses120184
-Node: Reentrant Overview121745
-Node: Reentrant Example122544
-Node: Reentrant Detail123318
-Node: Specify Reentrant123751
-Node: Extra Reentrant Argument124398
-Node: Global Replacement125649
-Node: Init and Destroy Functions126877
-Node: Accessor Methods129394
-Node: Extra Data130736
-Node: About yyscan_t133001
-Node: Reentrant Functions133396
-Ref: bison-functions134878
-Node: Lex and Posix135617
-Node: Memory Management142988
-Ref: memory-management143134
-Node: The Default Memory Management143362
-Ref: The Default Memory Management-Footnote-1147168
-Node: Overriding The Default Memory Management147321
-Ref: Overriding The Default Memory Management-Footnote-1149718
-Node: A Note About yytext And Memory149882
-Node: Serialized Tables151115
-Ref: serialization151259
-Node: Creating Serialized Tables152024
-Node: Loading and Unloading Serialized Tables153632
-Node: Tables File Format155400
-Node: Diagnostics162414
-Node: Limitations165823
-Node: Bibliography167771
-Node: FAQ168444
-Node: When was flex born?172684
-Node: How do I expand backslash-escape sequences in C-style quoted strings?173061
-Node: Why do flex scanners call fileno if it is not ANSI compatible?174365
-Node: Does flex support recursive pattern definitions?175160
-Node: How do I skip huge chunks of input (tens of megabytes) while using flex?176006
-Node: Flex is not matching my patterns in the same order that I defined them.176473
-Node: My actions are executing out of order or sometimes not at all.178218
-Node: How can I have multiple input sources feed into the same scanner at the same time?178991
-Node: Can I build nested parsers that work with the same input file?180979
-Node: How can I match text only at the end of a file?181985
-Node: How can I make REJECT cascade across start condition boundaries?182789
-Node: Why cant I use fast or full tables with interactive mode?183803
-Node: How much faster is -F or -f than -C?185061
-Node: If I have a simple grammar cant I just parse it with flex?185373
-Node: Why doesn't yyrestart() set the start state back to INITIAL?185854
-Node: How can I match C-style comments?186481
-Node: The period isn't working the way I expected.187291
-Node: Can I get the flex manual in another format?188538
-Node: Does there exist a "faster" NDFA->DFA algorithm?189027
-Node: How does flex compile the DFA so quickly?189537
-Node: How can I use more than 8192 rules?190504
-Node: How do I abandon a file in the middle of a scan and switch to a new file?191914
-Node: How do I execute code only during initialization (only before the first scan)?192467
-Node: How do I execute code at termination?193244
-Node: Where else can I find help?193570
-Node: Can I include comments in the "rules" section of the file?193943
-Node: I get an error about undefined yywrap().194322
-Node: How can I change the matching pattern at run time?194798
-Node: How can I expand macros in the input?195160
-Node: How can I build a two-pass scanner?196192
-Node: How do I match any string not matched in the preceding rules?197108
-Node: I am trying to port code from AT&T lex that uses yysptr and yysbuf.198017
-Node: Is there a way to make flex treat NULL like a regular character?198812
-Node: Whenever flex can not match the input it says "flex scanner jammed".199333
-Node: Why doesn't flex have non-greedy operators like perl does?199976
-Node: Memory leak - 16386 bytes allocated by malloc.201329
-Ref: faq-memory-leak201627
-Node: How do I track the byte offset for lseek()?202594
-Node: How do I use my own I/O classes in a C++ scanner?204103
-Node: How do I skip as many chars as possible?204946
-Node: deleteme00206020
-Node: Are certain equivalent patterns faster than others?206460
-Node: Is backing up a big deal?209878
-Node: Can I fake multi-byte character support?211784
-Node: deleteme01213225
-Node: Can you discuss some flex internals?214334
-Node: unput() messes up yy_at_bol216578
-Node: The | operator is not doing what I want217680
-Node: Why can't flex understand this variable trailing context pattern?219226
-Node: The ^ operator isn't working220475
-Node: Trailing context is getting confused with trailing optional patterns221710
-Node: Is flex GNU or not?222953
-Node: ERASEME53224626
-Node: I need to scan if-then-else blocks and while loops225396
-Node: ERASEME55226595
-Node: ERASEME56227693
-Node: ERASEME57229051
-Node: Is there a repository for flex scanners?230049
-Node: How can I conditionally compile or preprocess my flex input file?230364
-Node: Where can I find grammars for lex and yacc?230837
-Node: I get an end-of-buffer message for each character scanned.231184
-Node: unnamed-faq-62231779
-Node: unnamed-faq-63232797
-Node: unnamed-faq-64234094
-Node: unnamed-faq-65235060
-Node: unnamed-faq-66235846
-Node: unnamed-faq-67236961
-Node: unnamed-faq-68237948
-Node: unnamed-faq-69239090
-Node: unnamed-faq-70239803
-Node: unnamed-faq-71240564
-Node: unnamed-faq-72241773
-Node: unnamed-faq-73242816
-Node: unnamed-faq-74243740
-Node: unnamed-faq-75244685
-Node: unnamed-faq-76245817
-Node: unnamed-faq-77246523
-Node: unnamed-faq-78247416
-Node: unnamed-faq-79248414
-Node: unnamed-faq-80250114
-Node: unnamed-faq-81251432
-Node: unnamed-faq-82254232
-Node: unnamed-faq-83255189
-Node: unnamed-faq-84256969
-Node: unnamed-faq-85258072
-Node: unnamed-faq-86259079
-Node: unnamed-faq-87260017
-Node: unnamed-faq-88260663
-Node: unnamed-faq-90261494
-Node: unnamed-faq-91262757
-Node: unnamed-faq-92265185
-Node: unnamed-faq-93265684
-Node: unnamed-faq-94266611
-Node: unnamed-faq-95268023
-Node: unnamed-faq-96269541
-Node: unnamed-faq-97270300
-Node: unnamed-faq-98270967
-Node: unnamed-faq-99271632
-Node: unnamed-faq-100272561
-Node: unnamed-faq-101273271
-Node: What is the difference between YYLEX_PARAM and YY_DECL?274084
-Node: Why do I get "conflicting types for yylex" error?274605
-Node: How do I access the values set in a Flex action from within a Bison action?275135
-Node: Appendices275566
-Node: Makefiles and Flex275775
-Ref: Makefiles and Flex-Footnote-1278971
-Ref: Makefiles and Flex-Footnote-2279088
-Ref: Makefiles and Flex-Footnote-3279274
-Node: Bison Bridge279325
-Ref: Bison Bridge-Footnote-1281990
-Node: M4 Dependency282182
-Ref: M4 Dependency-Footnote-1283587
-Node: Common Patterns283722
-Node: Numbers284013
-Node: Identifiers284990
-Node: Quoted Constructs285817
-Node: Addresses286869
-Node: Indices288182
-Node: Concept Index288420
-Node: Index of Functions and Macros313703
-Node: Index of Variables318599
-Node: Index of Data Types320265
-Node: Index of Hooks321153
-Node: Index of Scanner Options321721
+Node: Top1622
+Node: Copyright9420
+Node: Reporting Bugs10939
+Node: Introduction11244
+Node: Simple Examples12073
+Node: Format15361
+Node: Definitions Section15816
+Ref: Definitions Section-Footnote-118074
+Node: Rules Section18142
+Node: User Code Section19300
+Node: Comments in the Input19738
+Node: Patterns21108
+Ref: case and character ranges27940
+Node: Matching31943
+Node: Actions35228
+Node: Generated Scanner44190
+Node: Start Conditions49209
+Node: Multiple Input Buffers59751
+Ref: Scanning Strings66292
+Node: EOF67921
+Node: Misc Macros69507
+Node: User Values72361
+Node: Yacc74686
+Node: Scanner Options75581
+Node: Options for Specifying Filenames78370
+Ref: option-header78596
+Ref: option-outfile79310
+Ref: option-stdout79635
+Node: Options Affecting Scanner Behavior80618
+Ref: option-case-insensitive80859
+Ref: option-lex-compat81292
+Ref: option-batch81824
+Ref: option-interactive82343
+Ref: option-7bit83697
+Ref: option-8bit85001
+Ref: option-default85413
+Ref: option-always-interactive85477
+Ref: option-posix86081
+Ref: option-stack87228
+Ref: option-stdinit87336
+Ref: option-yylineno87815
+Ref: option-yywrap88258
+Node: Code-Level And API Options88525
+Ref: option-ansi-definitions88752
+Ref: option-ansi-prototypes89000
+Ref: option-bison-bridge89248
+Ref: option-bison-locations89589
+Ref: option-noline89849
+Ref: option-reentrant90363
+Ref: option-c++90975
+Ref: option-array91101
+Ref: option-pointer91199
+Ref: option-prefix91326
+Ref: option-main92854
+Ref: option-nounistd93038
+Ref: option-yyclass93549
+Node: Options for Scanner Speed and Size94033
+Ref: option-align94583
+Ref: option-ecs95085
+Ref: option-meta-ecs96124
+Ref: option-read96612
+Ref: option-full98495
+Ref: option-fast98690
+Node: Debugging Options99614
+Ref: option-backup99801
+Ref: option-debug100346
+Ref: option-perf-report101068
+Ref: option-nodefault101694
+Ref: option-trace102012
+Ref: option-nowarn102303
+Ref: option-verbose102371
+Ref: option-warn102800
+Node: Miscellaneous Options103019
+Node: Performance103475
+Node: Cxx113722
+Node: Reentrant121814
+Node: Reentrant Uses122548
+Node: Reentrant Overview124110
+Node: Reentrant Example124910
+Node: Reentrant Detail125683
+Node: Specify Reentrant126187
+Node: Extra Reentrant Argument126837
+Node: Global Replacement128089
+Node: Init and Destroy Functions129324
+Node: Accessor Methods131845
+Node: Extra Data133192
+Node: About yyscan_t135459
+Node: Reentrant Functions135856
+Ref: bison-functions137340
+Node: Lex and Posix138079
+Node: Memory Management145426
+Ref: memory-management145572
+Node: The Default Memory Management145806
+Ref: The Default Memory Management-Footnote-1149626
+Node: Overriding The Default Memory Management149779
+Ref: Overriding The Default Memory Management-Footnote-1152193
+Node: A Note About yytext And Memory152357
+Node: Serialized Tables153597
+Ref: serialization153741
+Node: Creating Serialized Tables154521
+Node: Loading and Unloading Serialized Tables156136
+Node: Tables File Format157909
+Node: Diagnostics164934
+Node: Limitations168343
+Node: Bibliography170291
+Node: FAQ170961
+Node: When was flex born?176124
+Node: How do I expand backslash-escape sequences in C-style quoted strings?176501
+Node: Why do flex scanners call fileno if it is not ANSI compatible?177804
+Node: Does flex support recursive pattern definitions?178601
+Node: How do I skip huge chunks of input (tens of megabytes) while using flex?179448
+Node: Flex is not matching my patterns in the same order that I defined them.179915
+Node: My actions are executing out of order or sometimes not at all.181661
+Node: How can I have multiple input sources feed into the same scanner at the same time?182434
+Node: Can I build nested parsers that work with the same input file?184419
+Node: How can I match text only at the end of a file?185426
+Node: How can I make REJECT cascade across start condition boundaries?186230
+Node: Why cant I use fast or full tables with interactive mode?187244
+Node: How much faster is -F or -f than -C?188501
+Node: If I have a simple grammar cant I just parse it with flex?188813
+Node: Why doesn't yyrestart() set the start state back to INITIAL?189295
+Node: How can I match C-style comments?189922
+Node: The period isn't working the way I expected.190732
+Node: Can I get the flex manual in another format?191977
+Node: Does there exist a "faster" NDFA->DFA algorithm?192467
+Node: How does flex compile the DFA so quickly?192977
+Node: How can I use more than 8192 rules?193943
+Node: How do I abandon a file in the middle of a scan and switch to a new file?195353
+Node: How do I execute code only during initialization (only before the first scan)?195907
+Node: How do I execute code at termination?196684
+Node: Where else can I find help?197010
+Node: Can I include comments in the "rules" section of the file?197384
+Node: I get an error about undefined yywrap().197764
+Node: How can I change the matching pattern at run time?198240
+Node: How can I expand macros in the input?198602
+Node: How can I build a two-pass scanner?199634
+Node: How do I match any string not matched in the preceding rules?200552
+Node: I am trying to port code from AT&T lex that uses yysptr and yysbuf.201461
+Node: Is there a way to make flex treat NULL like a regular character?202256
+Node: Whenever flex can not match the input it says "flex scanner jammed".202776
+Node: Why doesn't flex have non-greedy operators like perl does?203419
+Node: Memory leak - 16386 bytes allocated by malloc.204772
+Ref: faq-memory-leak205070
+Node: How do I track the byte offset for lseek()?206041
+Node: How do I use my own I/O classes in a C++ scanner?207550
+Node: How do I skip as many chars as possible?208393
+Node: deleteme00209468
+Node: Are certain equivalent patterns faster than others?209908
+Node: Is backing up a big deal?213326
+Node: Can I fake multi-byte character support?215232
+Node: deleteme01216673
+Node: Can you discuss some flex internals?217782
+Node: unput() messes up yy_at_bol220026
+Node: The | operator is not doing what I want221128
+Node: Why can't flex understand this variable trailing context pattern?222674
+Node: The ^ operator isn't working223923
+Node: Trailing context is getting confused with trailing optional patterns225158
+Node: Is flex GNU or not?226401
+Node: ERASEME53228074
+Node: I need to scan if-then-else blocks and while loops228844
+Node: ERASEME55230043
+Node: ERASEME56231141
+Node: ERASEME57232499
+Node: Is there a repository for flex scanners?233497
+Node: How can I conditionally compile or preprocess my flex input file?233813
+Node: Where can I find grammars for lex and yacc?234286
+Node: I get an end-of-buffer message for each character scanned.234633
+Node: unnamed-faq-62235228
+Node: unnamed-faq-63236246
+Node: unnamed-faq-64237543
+Node: unnamed-faq-65238509
+Node: unnamed-faq-66239295
+Node: unnamed-faq-67240410
+Node: unnamed-faq-68241397
+Node: unnamed-faq-69242539
+Node: unnamed-faq-70243252
+Node: unnamed-faq-71244013
+Node: unnamed-faq-72245222
+Node: unnamed-faq-73246265
+Node: unnamed-faq-74247189
+Node: unnamed-faq-75248134
+Node: unnamed-faq-76249266
+Node: unnamed-faq-77249972
+Node: unnamed-faq-78250865
+Node: unnamed-faq-79251863
+Node: unnamed-faq-80253563
+Node: unnamed-faq-81254881
+Node: unnamed-faq-82257681
+Node: unnamed-faq-83258638
+Node: unnamed-faq-84260418
+Node: unnamed-faq-85261521
+Node: unnamed-faq-86262528
+Node: unnamed-faq-87263466
+Node: unnamed-faq-88264112
+Node: unnamed-faq-90264943
+Node: unnamed-faq-91266206
+Node: unnamed-faq-92268634
+Node: unnamed-faq-93269133
+Node: unnamed-faq-94270060
+Node: unnamed-faq-95271472
+Node: unnamed-faq-96272990
+Node: unnamed-faq-97273749
+Node: unnamed-faq-98274416
+Node: unnamed-faq-99275081
+Node: unnamed-faq-100276010
+Node: unnamed-faq-101276720
+Node: What is the difference between YYLEX_PARAM and YY_DECL?277533
+Node: Why do I get "conflicting types for yylex" error?278057
+Node: How do I access the values set in a Flex action from within a Bison action?278587
+Node: Appendices279016
+Node: Makefiles and Flex279281
+Ref: Makefiles and Flex-Footnote-1282483
+Ref: Makefiles and Flex-Footnote-2282600
+Ref: Makefiles and Flex-Footnote-3282787
+Node: Bison Bridge282838
+Ref: Bison Bridge-Footnote-1285505
+Node: M4 Dependency285697
+Ref: M4 Dependency-Footnote-1287111
+Node: Common Patterns287247
+Node: Numbers287570
+Node: Identifiers288546
+Node: Quoted Constructs289373
+Node: Addresses290427
+Node: Indices291739
+Node: Concept Index292031
+Node: Index of Functions and Macros319164
+Node: Index of Variables324133
+Node: Index of Data Types325799
+Node: Index of Hooks326687
+Node: Index of Scanner Options327255

End Tag Table
diff --git a/doc/flex.info-1 b/doc/flex.info-1
index 67314bd..b352758 100644
--- a/doc/flex.info-1
+++ b/doc/flex.info-1
@@ -1,15 +1,10 @@
-This is flex.info, produced by makeinfo version 4.13 from flex.texi.
+This is flex.info, produced by makeinfo version 6.0 from flex.texi.
-INFO-DIR-SECTION Programming
-START-INFO-DIR-ENTRY
-* flex: (flex). Fast lexical analyzer generator (lex replacement).
-END-INFO-DIR-ENTRY
-
- The flex manual is placed under the same licensing conditions as the
+The flex manual is placed under the same licensing conditions as the
rest of flex:
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 The
-Flex Project.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 The Flex
+Project.
Copyright (C) 1990, 1997 The Regents of the University of California.
All rights reserved.
@@ -18,14 +13,14 @@ All rights reserved.
Paxson.
The United States Government has rights in this work pursuant to
-contract no. DE-AC03-76SF00098 between the United States Department of
+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 the following conditions are
met:
- 1. Redistributions of source code must retain the above copyright
+ 1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
@@ -40,6 +35,10 @@ 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.
+INFO-DIR-SECTION Programming
+START-INFO-DIR-ENTRY
+* flex: (flex). Fast lexical analyzer generator (lex replacement).
+END-INFO-DIR-ENTRY

File: flex.info, Node: Top, Next: Copyright, Prev: (dir), Up: (dir)
@@ -47,214 +46,215 @@ File: flex.info, Node: Top, Next: Copyright, Prev: (dir), Up: (dir)
flex
****
-This manual describes `flex', a tool for generating programs that
+This manual describes 'flex', a tool for generating programs that
perform pattern-matching on text. The manual includes both tutorial and
reference sections.
- This edition of `The flex Manual' documents `flex' version 2.5.39.
-It was last updated on 6 December 2012.
+ This edition of 'The flex Manual' documents 'flex' version 2.6.0. It
+was last updated on 10 November 2015.
This manual was written by Vern Paxson, Will Estes and John Millaway.
* Menu:
-* Copyright::
-* Reporting Bugs::
-* Introduction::
-* Simple Examples::
-* Format::
-* Patterns::
-* Matching::
-* Actions::
-* Generated Scanner::
-* Start Conditions::
-* Multiple Input Buffers::
-* EOF::
-* Misc Macros::
-* User Values::
-* Yacc::
-* Scanner Options::
-* Performance::
-* Cxx::
-* Reentrant::
-* Lex and Posix::
-* Memory Management::
-* Serialized Tables::
-* Diagnostics::
-* Limitations::
-* Bibliography::
-* FAQ::
-* Appendices::
-* Indices::
-
- --- The Detailed Node Listing ---
+* Copyright::
+* Reporting Bugs::
+* Introduction::
+* Simple Examples::
+* Format::
+* Patterns::
+* Matching::
+* Actions::
+* Generated Scanner::
+* Start Conditions::
+* Multiple Input Buffers::
+* EOF::
+* Misc Macros::
+* User Values::
+* Yacc::
+* Scanner Options::
+* Performance::
+* Cxx::
+* Reentrant::
+* Lex and Posix::
+* Memory Management::
+* Serialized Tables::
+* Diagnostics::
+* Limitations::
+* Bibliography::
+* FAQ::
+* Appendices::
+* Indices::
+
+ -- The Detailed Node Listing --
Format of the Input File
-* Definitions Section::
-* Rules Section::
-* User Code Section::
-* Comments in the Input::
+* Definitions Section::
+* Rules Section::
+* User Code Section::
+* Comments in the Input::
Scanner Options
-* Options for Specifying Filenames::
-* Options Affecting Scanner Behavior::
-* Code-Level And API Options::
-* Options for Scanner Speed and Size::
-* Debugging Options::
-* Miscellaneous Options::
+* Options for Specifying Filenames::
+* Options Affecting Scanner Behavior::
+* Code-Level And API Options::
+* Options for Scanner Speed and Size::
+* Debugging Options::
+* Miscellaneous Options::
Reentrant C Scanners
-* Reentrant Uses::
-* Reentrant Overview::
-* Reentrant Example::
-* Reentrant Detail::
-* Reentrant Functions::
+* Reentrant Uses::
+* Reentrant Overview::
+* Reentrant Example::
+* Reentrant Detail::
+* Reentrant Functions::
The Reentrant API in Detail
-* Specify Reentrant::
-* Extra Reentrant Argument::
-* Global Replacement::
-* Init and Destroy Functions::
-* Accessor Methods::
-* Extra Data::
-* About yyscan_t::
+* Specify Reentrant::
+* Extra Reentrant Argument::
+* Global Replacement::
+* Init and Destroy Functions::
+* Accessor Methods::
+* Extra Data::
+* About yyscan_t::
Memory Management
-* The Default Memory Management::
-* Overriding The Default Memory Management::
-* A Note About yytext And Memory::
+* The Default Memory Management::
+* Overriding The Default Memory Management::
+* A Note About yytext And Memory::
Serialized Tables
-* Creating Serialized Tables::
-* Loading and Unloading Serialized Tables::
-* Tables File Format::
+* Creating Serialized Tables::
+* Loading and Unloading Serialized Tables::
+* Tables File Format::
FAQ
-* When was flex born?::
-* How do I expand backslash-escape sequences in C-style quoted strings?::
-* Why do flex scanners call fileno if it is not ANSI compatible?::
-* Does flex support recursive pattern definitions?::
-* How do I skip huge chunks of input (tens of megabytes) while using flex?::
-* Flex is not matching my patterns in the same order that I defined them.::
-* My actions are executing out of order or sometimes not at all.::
-* How can I have multiple input sources feed into the same scanner at the same time?::
-* Can I build nested parsers that work with the same input file?::
-* How can I match text only at the end of a file?::
-* How can I make REJECT cascade across start condition boundaries?::
-* Why cant I use fast or full tables with interactive mode?::
-* How much faster is -F or -f than -C?::
-* If I have a simple grammar cant I just parse it with flex?::
-* Why doesn't yyrestart() set the start state back to INITIAL?::
-* How can I match C-style comments?::
-* The period isn't working the way I expected.::
-* Can I get the flex manual in another format?::
-* Does there exist a "faster" NDFA->DFA algorithm?::
-* How does flex compile the DFA so quickly?::
-* How can I use more than 8192 rules?::
-* How do I abandon a file in the middle of a scan and switch to a new file?::
-* How do I execute code only during initialization (only before the first scan)?::
-* How do I execute code at termination?::
-* Where else can I find help?::
-* Can I include comments in the "rules" section of the file?::
-* I get an error about undefined yywrap().::
-* How can I change the matching pattern at run time?::
-* How can I expand macros in the input?::
-* How can I build a two-pass scanner?::
-* How do I match any string not matched in the preceding rules?::
-* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
-* Is there a way to make flex treat NULL like a regular character?::
-* Whenever flex can not match the input it says "flex scanner jammed".::
-* Why doesn't flex have non-greedy operators like perl does?::
-* Memory leak - 16386 bytes allocated by malloc.::
-* How do I track the byte offset for lseek()?::
-* How do I use my own I/O classes in a C++ scanner?::
-* How do I skip as many chars as possible?::
-* deleteme00::
-* Are certain equivalent patterns faster than others?::
-* Is backing up a big deal?::
-* Can I fake multi-byte character support?::
-* deleteme01::
-* Can you discuss some flex internals?::
-* unput() messes up yy_at_bol::
-* The | operator is not doing what I want::
-* Why can't flex understand this variable trailing context pattern?::
-* The ^ operator isn't working::
-* Trailing context is getting confused with trailing optional patterns::
-* Is flex GNU or not?::
-* ERASEME53::
-* I need to scan if-then-else blocks and while loops::
-* ERASEME55::
-* ERASEME56::
-* ERASEME57::
-* Is there a repository for flex scanners?::
-* How can I conditionally compile or preprocess my flex input file?::
-* Where can I find grammars for lex and yacc?::
-* I get an end-of-buffer message for each character scanned.::
-* unnamed-faq-62::
-* unnamed-faq-63::
-* unnamed-faq-64::
-* unnamed-faq-65::
-* unnamed-faq-66::
-* unnamed-faq-67::
-* unnamed-faq-68::
-* unnamed-faq-69::
-* unnamed-faq-70::
-* unnamed-faq-71::
-* unnamed-faq-72::
-* unnamed-faq-73::
-* unnamed-faq-74::
-* unnamed-faq-75::
-* unnamed-faq-76::
-* unnamed-faq-77::
-* unnamed-faq-78::
-* unnamed-faq-79::
-* unnamed-faq-80::
-* unnamed-faq-81::
-* unnamed-faq-82::
-* unnamed-faq-83::
-* unnamed-faq-84::
-* unnamed-faq-85::
-* unnamed-faq-86::
-* unnamed-faq-87::
-* unnamed-faq-88::
-* unnamed-faq-90::
-* unnamed-faq-91::
-* unnamed-faq-92::
-* unnamed-faq-93::
-* unnamed-faq-94::
-* unnamed-faq-95::
-* unnamed-faq-96::
-* unnamed-faq-97::
-* unnamed-faq-98::
-* unnamed-faq-99::
-* unnamed-faq-100::
-* unnamed-faq-101::
+* When was flex born?::
+* How do I expand backslash-escape sequences in C-style quoted strings?::
+* Why do flex scanners call fileno if it is not ANSI compatible?::
+* Does flex support recursive pattern definitions?::
+* How do I skip huge chunks of input (tens of megabytes) while using flex?::
+* Flex is not matching my patterns in the same order that I defined them.::
+* My actions are executing out of order or sometimes not at all.::
+* How can I have multiple input sources feed into the same scanner at the same time?::
+* Can I build nested parsers that work with the same input file?::
+* How can I match text only at the end of a file?::
+* How can I make REJECT cascade across start condition boundaries?::
+* Why cant I use fast or full tables with interactive mode?::
+* How much faster is -F or -f than -C?::
+* If I have a simple grammar cant I just parse it with flex?::
+* Why doesn't yyrestart() set the start state back to INITIAL?::
+* How can I match C-style comments?::
+* The period isn't working the way I expected.::
+* Can I get the flex manual in another format?::
+* Does there exist a "faster" NDFA->DFA algorithm?::
+* How does flex compile the DFA so quickly?::
+* How can I use more than 8192 rules?::
+* How do I abandon a file in the middle of a scan and switch to a new file?::
+* How do I execute code only during initialization (only before the first scan)?::
+* How do I execute code at termination?::
+* Where else can I find help?::
+* Can I include comments in the "rules" section of the file?::
+* I get an error about undefined yywrap().::
+* How can I change the matching pattern at run time?::
+* How can I expand macros in the input?::
+* How can I build a two-pass scanner?::
+* How do I match any string not matched in the preceding rules?::
+* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
+* Is there a way to make flex treat NULL like a regular character?::
+* Whenever flex can not match the input it says "flex scanner jammed".::
+* Why doesn't flex have non-greedy operators like perl does?::
+* Memory leak - 16386 bytes allocated by malloc.::
+* How do I track the byte offset for lseek()?::
+* How do I use my own I/O classes in a C++ scanner?::
+* How do I skip as many chars as possible?::
+* deleteme00::
+* Are certain equivalent patterns faster than others?::
+* Is backing up a big deal?::
+* Can I fake multi-byte character support?::
+* deleteme01::
+* Can you discuss some flex internals?::
+* unput() messes up yy_at_bol::
+* The | operator is not doing what I want::
+* Why can't flex understand this variable trailing context pattern?::
+* The ^ operator isn't working::
+* Trailing context is getting confused with trailing optional patterns::
+* Is flex GNU or not?::
+* ERASEME53::
+* I need to scan if-then-else blocks and while loops::
+* ERASEME55::
+* ERASEME56::
+* ERASEME57::
+* Is there a repository for flex scanners?::
+* How can I conditionally compile or preprocess my flex input file?::
+* Where can I find grammars for lex and yacc?::
+* I get an end-of-buffer message for each character scanned.::
+* unnamed-faq-62::
+* unnamed-faq-63::
+* unnamed-faq-64::
+* unnamed-faq-65::
+* unnamed-faq-66::
+* unnamed-faq-67::
+* unnamed-faq-68::
+* unnamed-faq-69::
+* unnamed-faq-70::
+* unnamed-faq-71::
+* unnamed-faq-72::
+* unnamed-faq-73::
+* unnamed-faq-74::
+* unnamed-faq-75::
+* unnamed-faq-76::
+* unnamed-faq-77::
+* unnamed-faq-78::
+* unnamed-faq-79::
+* unnamed-faq-80::
+* unnamed-faq-81::
+* unnamed-faq-82::
+* unnamed-faq-83::
+* unnamed-faq-84::
+* unnamed-faq-85::
+* unnamed-faq-86::
+* unnamed-faq-87::
+* unnamed-faq-88::
+* unnamed-faq-90::
+* unnamed-faq-91::
+* unnamed-faq-92::
+* unnamed-faq-93::
+* unnamed-faq-94::
+* unnamed-faq-95::
+* unnamed-faq-96::
+* unnamed-faq-97::
+* unnamed-faq-98::
+* unnamed-faq-99::
+* unnamed-faq-100::
+* unnamed-faq-101::
* What is the difference between YYLEX_PARAM and YY_DECL?::
* Why do I get "conflicting types for yylex" error?::
* How do I access the values set in a Flex action from within a Bison action?::
Appendices
-* Makefiles and Flex::
-* Bison Bridge::
-* M4 Dependency::
-* Common Patterns::
+* Makefiles and Flex::
+* Bison Bridge::
+* M4 Dependency::
+* Common Patterns::
Indices
-* Concept Index::
-* Index of Functions and Macros::
-* Index of Variables::
-* Index of Data Types::
-* Index of Hooks::
-* Index of Scanner Options::
+* Concept Index::
+* Index of Functions and Macros::
+* Index of Variables::
+* Index of Data Types::
+* Index of Hooks::
+* Index of Scanner Options::
+

File: flex.info, Node: Copyright, Next: Reporting Bugs, Prev: Top, Up: Top
@@ -265,8 +265,8 @@ File: flex.info, Node: Copyright, Next: Reporting Bugs, Prev: Top, Up: Top
The flex manual is placed under the same licensing conditions as the
rest of flex:
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 The
-Flex Project.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2012 The Flex
+Project.
Copyright (C) 1990, 1997 The Regents of the University of California.
All rights reserved.
@@ -275,14 +275,14 @@ All rights reserved.
Paxson.
The United States Government has rights in this work pursuant to
-contract no. DE-AC03-76SF00098 between the United States Department of
+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 the following conditions are
met:
- 1. Redistributions of source code must retain the above copyright
+ 1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
@@ -304,7 +304,7 @@ File: flex.info, Node: Reporting Bugs, Next: Introduction, Prev: Copyright,
2 Reporting Bugs
****************
-If you find a bug in `flex', please report it using the SourceForge Bug
+If you find a bug in 'flex', please report it using the SourceForge Bug
Tracking facilities which can be found on flex's SourceForge Page
(http://sourceforge.net/projects/flex).
@@ -314,17 +314,17 @@ File: flex.info, Node: Introduction, Next: Simple Examples, Prev: Reporting B
3 Introduction
**************
-`flex' is a tool for generating "scanners". A scanner is a program
-which recognizes lexical patterns in text. The `flex' program reads
-the given input files, or its standard input if no file names are
-given, for a description of a scanner to generate. The description is
-in the form of pairs of regular expressions and C code, called "rules".
-`flex' generates as output a C source file, `lex.yy.c' by default,
-which defines a routine `yylex()'. This file can be compiled and
-linked with the flex runtime 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.
+'flex' is a tool for generating "scanners". A scanner is a program
+which recognizes lexical patterns in text. The 'flex' program reads the
+given input files, or its standard input if no file names are given, for
+a description of a scanner to generate. The description is in the form
+of pairs of regular expressions and C code, called "rules". 'flex'
+generates as output a C source file, 'lex.yy.c' by default, which
+defines a routine 'yylex()'. This file can be compiled and linked with
+the flex runtime 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.

File: flex.info, Node: Simple Examples, Next: Format, Prev: Introduction, Up: Top
@@ -332,21 +332,20 @@ File: flex.info, Node: Simple Examples, Next: Format, Prev: Introduction, Up
4 Some Simple Examples
**********************
-First some simple examples to get the flavor of how one uses `flex'.
+First some simple examples to get the flavor of how one uses 'flex'.
- The following `flex' input specifies a scanner which, when it
-encounters the string `username' will replace it with the user's login
+ The following 'flex' input specifies a scanner which, when 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 occurrence of `username' expanded. In this
-input, there is just one rule. `username' is the "pattern" and the
-`printf' is the "action". The `%%' symbol marks the beginning of the
-rules.
+ 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 occurrence of 'username' expanded. In this input,
+there is just one rule. 'username' is the "pattern" and the 'printf' is
+the "action". The '%%' symbol marks the beginning of the rules.
Here's another simple example:
@@ -366,13 +365,13 @@ rules.
}
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
+in its input. It produces no output other than the final report on the
character and line 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
+'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).
+other than a newline (indicated by the '.' regular expression).
A somewhat more complicated example:
@@ -438,8 +437,8 @@ File: flex.info, Node: Format, Next: Patterns, Prev: Simple Examples, Up: To
5 Format of the Input File
**************************
-The `flex' input file consists of three sections, separated by a line
-containing only `%%'.
+The 'flex' input file consists of three sections, separated by a line
+containing only '%%'.
definitions
%%
@@ -449,10 +448,10 @@ containing only `%%'.
* Menu:
-* Definitions Section::
-* Rules Section::
-* User Code Section::
-* Comments in the Input::
+* Definitions Section::
+* Rules Section::
+* User Code Section::
+* Comments in the Input::

File: flex.info, Node: Definitions Section, Next: Rules Section, Prev: Format, Up: Format
@@ -468,18 +467,18 @@ definitions to simplify the scanner specification, and declarations of
name definition
- The `name' is a word beginning with a letter or an underscore (`_')
-followed by zero or more letters, digits, `_', or `-' (dash). The
+ The 'name' is a word beginning with a letter or an underscore ('_')
+followed by zero or more letters, digits, '_', or '-' (dash). The
definition is taken to begin at the first non-whitespace 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,
+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
+ 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}*
@@ -488,22 +487,22 @@ followed by zero-or-more letters-or-digits. A subsequent reference to
([0-9])+"."([0-9])*
- and matches one-or-more digits followed by a `.' followed by
+ and matches one-or-more digits followed by a '.' followed by
zero-or-more digits.
- An unindented comment (i.e., a line beginning with `/*') is copied
-verbatim to the output up to the next `*/'.
+ An unindented comment (i.e., a line beginning with '/*') is copied
+verbatim to the output up to the next '*/'.
- Any _indented_ text or text enclosed in `%{' and `%}' is also copied
-verbatim to the output (with the %{ and %} symbols removed). The %{
-and %} symbols must appear unindented on lines by themselves.
+ Any _indented_ text or text enclosed in '%{' and '%}' is also copied
+verbatim to the output (with the %{ and %} symbols removed). The %{ and
+%} symbols must appear unindented on lines by themselves.
- A `%top' block is similar to a `%{' ... `%}' block, except that the
-code in a `%top' block is relocated to the _top_ of the generated file,
-before any flex definitions (1). The `%top' block is useful when you
+ A '%top' block is similar to a '%{' ... '%}' block, except that the
+code in a '%top' block is relocated to the _top_ of the generated file,
+before any flex definitions (1). The '%top' block is useful when you
want certain preprocessor macros to be defined or certain files to be
-included before the generated code. The single characters, `{' and
-`}' are used to delimit the `%top' block, as show in the example below:
+included before the generated code. The single characters, '{' and '}'
+are used to delimit the '%top' block, as show in the example below:
%top{
/* This code goes at the "top" of the generated file. */
@@ -511,11 +510,11 @@ included before the generated code. The single characters, `{' and
#include <inttypes.h>
}
- Multiple `%top' blocks are allowed, and their order is preserved.
+ Multiple '%top' blocks are allowed, and their order is preserved.
---------- Footnotes ----------
- (1) Actually, `yyIN_HEADER' is defined before the `%top' block.
+ (1) Actually, 'yyIN_HEADER' is defined before the '%top' block.

File: flex.info, Node: Rules Section, Next: User Code Section, Prev: Definitions Section, Up: Format
@@ -523,27 +522,27 @@ File: flex.info, Node: Rules Section, Next: User Code Section, Prev: Definiti
5.2 Format of the Rules Section
===============================
-The "rules" section of the `flex' input contains a series of rules of
+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. *Note Patterns::, for a further description of patterns
-and actions.
+ where the pattern must be unindented and the action must begin on the
+same line. *Note Patterns::, for a further description of patterns and
+actions.
In the rules section, any indented or %{ %} enclosed 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
+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. *Note Lex and Posix::,
+(this feature is present for POSIX compliance. *Note Lex and Posix::,
for other such features).
- Any _indented_ text or text enclosed in `%{' and `%}' is copied
-verbatim to the output (with the %{ and %} symbols removed). The %{
-and %} symbols must appear unindented on lines by themselves.
+ Any _indented_ text or text enclosed in '%{' and '%}' is copied
+verbatim to the output (with the %{ and %} symbols removed). The %{ and
+%} symbols must appear unindented on lines by themselves.

File: flex.info, Node: User Code Section, Next: Comments in the Input, Prev: Rules Section, Up: Format
@@ -551,10 +550,10 @@ File: flex.info, Node: User Code Section, Next: Comments in the Input, Prev:
5.3 Format of the User Code Section
===================================
-The user code section is simply copied to `lex.yy.c' verbatim. It is
+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 second
-`%%' in the input file may be skipped, too.
+'%%' in the input file may be skipped, too.

File: flex.info, Node: Comments in the Input, Prev: User Code Section, Up: Format
@@ -562,22 +561,21 @@ File: flex.info, Node: Comments in the Input, Prev: User Code Section, Up: Fo
5.4 Comments in the Input
=========================
-Flex supports C-style comments, that is, anything between `/*' and `*/'
-is considered a comment. Whenever flex encounters a comment, it copies
-the entire comment verbatim to the generated source code. Comments may
+Flex supports C-style comments, that is, anything between '/*' and '*/'
+is considered a comment. Whenever flex encounters a comment, it copies
+the entire comment verbatim to the generated source code. Comments may
appear just about anywhere, but with the following exceptions:
* Comments may not appear in the Rules Section wherever flex is
- expecting a regular expression. This means comments may not appear
+ expecting a regular expression. This means comments may not appear
at the beginning of a line, or immediately following a list of
scanner states.
-
- * Comments may not appear on an `%option' line in the Definitions
+ * Comments may not appear on an '%option' line in the Definitions
Section.
If you want to follow a simple rule, then always begin a comment on a
new line, with one or more whitespace characters before the initial
-`/*'). This rule will work anywhere in the input file.
+'/*'). This rule will work anywhere in the input file.
All the comments in the following example are valid:
@@ -602,6 +600,7 @@ new line, with one or more whitespace characters before the initial
%%
/* User Code Section */
+

File: flex.info, Node: Patterns, Next: Matching, Prev: Format, Up: Top
@@ -611,84 +610,84 @@ File: flex.info, Node: Patterns, Next: Matching, Prev: Format, Up: Top
The patterns in the input (see *note Rules Section::) are written using
an extended set of regular expressions. These are:
-`x'
+'x'
match the character 'x'
-`.'
+'.'
any character (byte) except newline
-`[xyz]'
+'[xyz]'
a "character class"; in this case, the pattern matches either an
'x', a 'y', or a 'z'
-`[abj-oZ]'
+'[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-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]'
+'[^A-Z\n]'
any character EXCEPT an uppercase letter or a newline
-`[a-z]{-}[aeiou]'
+'[a-z]{-}[aeiou]'
the lowercase consonants
-`r*'
+'r*'
zero or more r's, where r is any regular expression
-`r+'
+'r+'
one or more r's
-`r?'
+'r?'
zero or one r's (that is, "an optional r")
-`r{2,5}'
+'r{2,5}'
anywhere from two to five r's
-`r{2,}'
+'r{2,}'
two or more r's
-`r{4}'
+'r{4}'
exactly 4 r's
-`{name}'
- the expansion of the `name' definition (*note Format::).
+'{name}'
+ the expansion of the 'name' definition (*note Format::).
-`"[xyz]\"foo"'
- the literal string: `[xyz]"foo'
+'"[xyz]\"foo"'
+ the literal string: '[xyz]"foo'
-`\X'
- if X is `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 `*')
+'\X'
+ if X is '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'
+'\0'
a NUL character (ASCII code 0)
-`\123'
+'\123'
the character with octal value 123
-`\x2a'
+'\x2a'
the character with hexadecimal value 2a
-`(r)'
- match an `r'; parentheses are used to override precedence (see
+'(r)'
+ match an 'r'; parentheses are used to override precedence (see
below)
-`(?r-s:pattern)'
- apply option `r' and omit option `s' while interpreting pattern.
- Options may be zero or more of the characters `i', `s', or `x'.
+'(?r-s:pattern)'
+ apply option 'r' and omit option 's' while interpreting pattern.
+ Options may be zero or more of the characters 'i', 's', or 'x'.
- `i' means case-insensitive. `-i' means case-sensitive.
+ 'i' means case-insensitive. '-i' means case-sensitive.
- `s' alters the meaning of the `.' syntax to match any single byte
- whatsoever. `-s' alters the meaning of `.' to match any byte
- except `\n'.
+ 's' alters the meaning of the '.' syntax to match any single byte
+ whatsoever. '-s' alters the meaning of '.' to match any byte
+ except '\n'.
- `x' ignores comments and whitespace in patterns. Whitespace is
- ignored unless it is backslash-escaped, contained within `""'s, or
+ 'x' ignores comments and whitespace in patterns. Whitespace is
+ ignored unless it is backslash-escaped, contained within '""'s, or
appears inside a character class.
The following are all valid:
@@ -708,66 +707,66 @@ an extended set of regular expressions. These are:
b
c) same as (abc)
-`(?# comment )'
- omit everything within `()'. The first `)' character encountered
- ends the pattern. It is not possible to for the comment to contain
- a `)' character. The comment may span lines.
+'(?# comment )'
+ omit everything within '()'. The first ')' character encountered
+ ends the pattern. It is not possible to for the comment to contain
+ a ')' character. The comment may span lines.
-`rs'
- the regular expression `r' followed by the regular expression `s';
+'rs'
+ the regular expression 'r' followed by the regular expression 's';
called "concatenation"
-`r|s'
- either an `r' or an `s'
+'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
+'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
+ 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. *Note
+ combinations of 'r/s' that flex cannot match correctly. *Note
Limitations::, regarding dangerous trailing context.)
-`^r'
- an `r', but only at the beginning of a line (i.e., when just
+'^r'
+ an 'r', but only at the beginning of a line (i.e., when 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'.
+'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$'.
+ 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 *note Start
+'<s>r'
+ an 'r', but only in start condition 's' (see *note Start
Conditions:: for discussion of start conditions).
-`<s1,s2,s3>r'
- same, but in any of start conditions `s1', `s2', or `s3'.
+'<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.
+'<*>r'
+ an 'r' in any start condition, even an exclusive one.
-`<<EOF>>'
+'<<EOF>>'
an end-of-file.
-`<s1,s2><<EOF>>'
- an end-of-file when in start condition `s1' or `s2'
+'<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, `^'.
+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 according to
precedence, from highest precedence at the top to lowest at the bottom.
Those grouped together have equal precedence (see special note on the
-precedence of the repeat operator, `{}', under the documentation for
-the `--posix' POSIX compliance option). For example,
+precedence of the repeat operator, '{}', under the documentation for the
+'--posix' POSIX compliance option). For example,
foo|bar*
@@ -775,23 +774,23 @@ the `--posix' POSIX compliance option). For example,
(foo)|(ba(r*))
- since the `*' operator has higher precedence than concatenation, 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 repetitions of the
-string `bar', use:
+ since the '*' operator has higher precedence than concatenation, 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 repetitions of the
+string 'bar', use:
foo|(bar)*
- And to match a sequence of zero or more repetitions of `foo' and
-`bar':
+ And to match a sequence of zero or more repetitions of 'foo' and
+'bar':
(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
+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:]
@@ -800,10 +799,10 @@ occur inside the character class, too). The valid expressions are:
[:space:] [:upper:] [:xdigit:]
These expressions all designate a set of characters equivalent to the
-corresponding standard C `isXXX' function. For example, `[:alnum:]'
-designates those characters for which `isalnum()' returns true - i.e.,
+corresponding standard C 'isXXX' function. For example, '[:alnum:]'
+designates those characters for which 'isalnum()' returns true - i.e.,
any alphabetic or numeric character. Some systems don't provide
-`isblank()', so flex defines `[:blank:]' as a blank or a tab.
+'isblank()', so flex defines '[:blank:]' as a blank or a tab.
For example, the following character classes are all equivalent:
@@ -812,76 +811,77 @@ any alphabetic or numeric character. Some systems don't provide
[[:alpha:][0-9]]
[a-zA-Z0-9]
- A word of caution. Character classes are expanded immediately when
-seen in the `flex' input. This means the character classes are
-sensitive to the locale in which `flex' is executed, and the resulting
+ A word of caution. Character classes are expanded immediately when
+seen in the 'flex' input. This means the character classes are
+sensitive to the locale in which 'flex' is executed, and the resulting
scanner will not be sensitive to the runtime locale. This may or may
not be desirable.
- * If your scanner is case-insensitive (the `-i' flag), then
- `[:upper:]' and `[:lower:]' are equivalent to `[:alpha:]'.
+ * If your scanner is case-insensitive (the '-i' flag), then
+ '[:upper:]' and '[:lower:]' are equivalent to '[:alpha:]'.
- * Character classes with ranges, such as `[a-Z]', should be used with
+ * Character classes with ranges, such as '[a-Z]', should be used with
caution in a case-insensitive scanner if the range spans upper or
- lowercase characters. Flex does not know if you want to fold all
- upper and lowercase characters together, or if you want the
- literal numeric range specified (with no case folding). When in
- doubt, flex will assume that you meant the literal numeric range,
- and will issue a warning. The exception to this rule is a
- character range such as `[a-z]' or `[S-W]' where it is obvious
- that you want case-folding to occur. Here are some examples with
- the `-i' flag enabled:
+ lowercase characters. Flex does not know if you want to fold all
+ upper and lowercase characters together, or if you want the literal
+ numeric range specified (with no case folding). When in doubt,
+ flex will assume that you meant the literal numeric range, and will
+ issue a warning. The exception to this rule is a character range
+ such as '[a-z]' or '[S-W]' where it is obvious that you want
+ case-folding to occur. Here are some examples with the '-i' flag
+ enabled:
Range Result Literal Range Alternate Range
- `[a-t]' ok `[a-tA-T]'
- `[A-T]' ok `[a-tA-T]'
- `[A-t]' ambiguous `[A-Z\[\\\]_`a-t]' `[a-tA-T]'
- `[_-{]' ambiguous `[_`a-z{]' `[_`a-zA-Z{]'
- `[@-C]' ambiguous `[@ABC]' `[@A-Z\[\\\]_`abc]'
-
- * 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 unfortunately the inconsistency is historically
- entrenched. Matching newlines means that a pattern like `[^"]*'
- can match the entire input unless there's another quote in the
- input.
+ '[a-t]' ok '[a-tA-T]'
+ '[A-T]' ok '[a-tA-T]'
+ '[A-t]' ambiguous '[A-Z\[\\\]_`a-t]' '[a-tA-T]'
+ '[_-{]' ambiguous '[_`a-z{]' '[_`a-zA-Z{]'
+ '[@-C]' ambiguous '[@ABC]' '[@A-Z\[\\\]_`abc]'
+
+ * 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 unfortunately
+ the inconsistency is historically entrenched. Matching newlines
+ means that a pattern like '[^"]*' can match the entire input unless
+ there's another quote in the input.
Flex allows negation of character class expressions by prepending
- `^' to the POSIX character class name.
+ '^' to the POSIX character class name.
[:^alnum:] [:^alpha:] [:^blank:]
[:^cntrl:] [:^digit:] [:^graph:]
[:^lower:] [:^print:] [:^punct:]
[:^space:] [:^upper:] [:^xdigit:]
- Flex will issue a warning if the expressions `[:^upper:]' and
- `[:^lower:]' appear in a case-insensitive scanner, since their
- meaning is unclear. The current behavior is to skip them entirely,
+ Flex will issue a warning if the expressions '[:^upper:]' and
+ '[:^lower:]' appear in a case-insensitive scanner, since their
+ meaning is unclear. The current behavior is to skip them entirely,
but this may change without notice in future revisions of flex.
- * The `{-}' operator computes the difference of two character
- classes. For example, `[a-c]{-}[b-z]' represents all the
- characters in the class `[a-c]' that are not in the class `[b-z]'
- (which in this case, is just the single character `a'). The `{-}'
- operator is left associative, so `[abc]{-}[b]{-}[c]' is the same
- as `[a]'. Be careful not to accidentally create an empty set,
- which will never match.
-
- * The `{+}' operator computes the union of two character classes.
- For example, `[a-z]{+}[0-9]' is the same as `[a-z0-9]'. This
+ *
+ The '{-}' operator computes the difference of two character
+ classes. For example, '[a-c]{-}[b-z]' represents all the
+ characters in the class '[a-c]' that are not in the class '[b-z]'
+ (which in this case, is just the single character 'a'). The '{-}'
+ operator is left associative, so '[abc]{-}[b]{-}[c]' is the same as
+ '[a]'. Be careful not to accidentally create an empty set, which
+ will never match.
+
+ *
+ The '{+}' operator computes the union of two character classes.
+ For example, '[a-z]{+}[0-9]' is the same as '[a-z0-9]'. This
operator is useful when preceded by the result of a difference
- operation, as in, `[[:alpha:]]{-}[[:lower:]]{+}[q]', which is
- equivalent to `[A-Zq]' in the "C" locale.
-
- * 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
+ operation, as in, '[[:alpha:]]{-}[[:lower:]]{+}[q]', which is
+ equivalent to '[A-Zq]' in the "C" locale.
+
+ * 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 invalid:
@@ -889,23 +889,23 @@ not be desirable.
foo/bar$
<sc1>foo<sc2>bar
- Note that the first of these can be written `foo/bar\n'.
+ Note that the first of these can be written 'foo/bar\n'.
- * The following will result in `$' or `^' being treated as a normal
+ * The following will result in '$' or '^' being treated as a normal
character:
foo|(bar$)
foo|^bar
- If the desired meaning is a `foo' or a
- `bar'-followed-by-a-newline, the following could be used (the
- special `|' action is explained below, *note Actions::):
+ If the desired meaning is a 'foo' or a 'bar'-followed-by-a-newline,
+ the following could be used (the special '|' action is explained
+ below, *note Actions::):
foo |
bar$ /* action goes here */
- A similar trick will work for matching a `foo' or a
- `bar'-at-the-beginning-of-a-line.
+ A similar trick will work for matching a 'foo' or a
+ 'bar'-at-the-beginning-of-a-line.

File: flex.info, Node: Matching, Next: Actions, Prev: Patterns, Up: Top
@@ -918,61 +918,61 @@ 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
+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 (*note
-Actions::), and then the remaining input is scanned for another match.
+'yytext', and its length in the global integer 'yyleng'. The "action"
+corresponding to the matched pattern is then executed (*note Actions::),
+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 valid `flex' input is:
+output. Thus, the simplest valid 'flex' input is:
%%
- which generates a scanner that simply copies its input (one
-character at a time) to its output.
+ 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
-compatibility option, in which case `yytext' will be an array. The
-advantage of using `%pointer' is substantially faster scanning and no
+ 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
+compatibility 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 disadvantage is that you are restricted in how
-your actions can modify `yytext' (*note Actions::), and calls to the
-`unput()' function destroys the present contents of `yytext', which can
-be a considerable porting headache when moving between different `lex'
+your actions can modify 'yytext' (*note Actions::), 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'
-(*note Actions::). Furthermore, existing `lex' programs sometimes
-access `yytext' externally using declarations of the form:
+ The advantage of '%array' is that you can then modify 'yytext' to
+your heart's content, and calls to 'unput()' do not destroy 'yytext'
+(*note Actions::). 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'.
+ This definition is erroneous when used with '%pointer', but correct
+for '%array'.
- The `%array' declaration defines `yytext' to be an array of `YYLMAX'
+ The '%array' declaration defines 'yytext' to be an array of 'YYLMAX'
characters, which defaults to a fairly large value. You can change the
-size by simply #define'ing `YYLMAX' to a different value in the first
-section of your `flex' input. As mentioned above, with `%pointer'
+size by simply #define'ing 'YYLMAX' to a different value in the first
+section of your 'flex' input. As mentioned above, with '%pointer'
yytext grows dynamically to accommodate large tokens. While this means
-your `%pointer' scanner can accommodate very large tokens (such as
+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
+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
+ Also note that you cannot use '%array' with C++ scanner classes
(*note Cxx::).

@@ -986,7 +986,7 @@ arbitrary C statement. The pattern ends at the first non-escaped
whitespace character; the remainder of the line is its action. If the
action is empty, then when the pattern is matched the input token is
simply discarded. For example, here is the specification for a program
-which deletes all occurrences of `zap me' from its input:
+which deletes all occurrences of 'zap me' from its input:
%%
"zap me"
@@ -1001,50 +1001,49 @@ 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 `%}' (regardless
+ 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 '%}' (regardless
of ordinary braces inside the action).
- An action consisting solely of a vertical bar (`|') means "same as
+ 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 processing tokens from where it last
+ 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 processing 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'
-(*note Matching::). In that case, `yytext' may be freely modified in
-any way.
+ 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' (*note
+Matching::). 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).
+ 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:
+ There are a number of special directives which can be included within
+an action:
-`ECHO'
+'ECHO'
copies yytext to the scanner's output.
-`BEGIN'
+'BEGIN'
followed by the name of a start condition places the scanner in the
corresponding start condition (see below).
-`REJECT'
+'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 *note Matching::, and `yytext' and `yyleng'
+ as described above in *note Matching::, 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'
+ 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:
+ routine 'special()' whenever 'frob' is seen:
int word_count = 0;
%%
@@ -1052,12 +1051,12 @@ within an action:
frob special(); REJECT;
[^ \t\n]+ ++word_count;
- Without the `REJECT', any occurrences of `frob' in the input would
+ Without the 'REJECT', any occurrences of 'frob' in the input would
not be counted as words, since the scanner normally executes only
- one action per token. Multiple uses of `REJECT' are allowed, each
+ one action per token. Multiple uses of 'REJECT' 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 `abcdabcaba' to the output:
+ example, when the following scanner scans the token 'abcd', it will
+ write 'abcdabcaba' to the output:
%%
a |
@@ -1067,59 +1066,59 @@ within an action:
.|\n /* eat up any unmatched character */
The first three rules share the fourth's action since they use the
- special `|' action.
+ special '|' action.
- `REJECT' is a particularly expensive feature in terms of scanner
+ '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 (*note
+ 'REJECT' cannot be used with the '-Cf' or '-CF' options (*note
Scanner Options::).
- Note also that unlike the other special actions, `REJECT' is a
+ Note also that unlike the other special actions, 'REJECT' is a
_branch_. Code immediately following it in the action will _not_
be executed.
-`yymore()'
+'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
+ '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 output. 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'.
+ First 'mega-' is matched and echoed to the output. 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
+ 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 performance penalty in the scanner's matching speed.
- `yyless(n)' returns all but the first `n' characters of the current
+ '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':
+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
+ 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
+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
+ 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
+ '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 parentheses.
@@ -1134,27 +1133,27 @@ current token and cause it to be rescanned enclosed in parentheses.
free( yycopy );
}
- Note that since each `unput()' puts the given character back at the
+ Note that since each 'unput()' puts the given character 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
+ 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 (*note Matching::).
+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 (*note Matching::).
- Finally, note that you cannot put back `EOF' to attempt to mark the
+ 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
+ 'input()' reads the next character from the input stream. For
example, the following is one way to eat up C comments:
%%
"/*" {
- register int c;
+ int c;
for ( ; ; )
{
@@ -1178,19 +1177,19 @@ example, the following is one way to eat up C comments:
}
}
- (Note that if the scanner is compiled using `C++', then `input()' is
+ (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'.)
+the 'C++' stream by the name of 'input'.)
- `YY_FLUSH_BUFFER;' flushes the scanner's internal buffer so that the
+ '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()' (*note Generated Scanner::). This action
-is a special case of the more general `yy_flush_buffer;' function,
+the buffer using 'YY_INPUT()' (*note Generated Scanner::). This action
+is a special case of the more general 'yy_flush_buffer;' function,
described below (*note Multiple Input Buffers::)
- `yyterminate()' can be used in lieu of a return statement in an
+ 'yyterminate()' can be used in lieu of a return statement in an
action. It terminates the scanner and returns a 0 to the scanner's
-caller, indicating "all done". By default, `yyterminate()' is also
+caller, indicating "all done". By default, 'yyterminate()' is also
called when an end-of-file is encountered. It is a macro and may be
redefined.
@@ -1200,10 +1199,10 @@ File: flex.info, Node: Generated Scanner, Next: Start Conditions, Prev: Actio
9 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 routines and macros. By default,
-`yylex()' is declared as follows:
+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 routines and macros. By default, 'yylex()' is
+declared as follows:
int yylex()
{
@@ -1211,62 +1210,62 @@ tokens, and a number of auxiliary routines and macros. By default,
}
(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:
+'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,
+ 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 (;).
- `flex' generates `C99' function definitions by default. However flex
-does have the ability to generate obsolete, er, `traditional', function
-definitions. This is to support bootstrapping gcc on old systems.
+ 'flex' generates 'C99' function definitions by default. However flex
+does have the ability to generate obsolete, er, 'traditional', function
+definitions. This is to support bootstrapping gcc on old systems.
Unfortunately, traditional definitions prevent us from using any
standard data types smaller than int (such as short, char, or bool) as
-function arguments. For this reason, future versions of `flex' may
+function arguments. For this reason, future versions of 'flex' may
generate standard C99 code only, leaving K&R-style functions to the
-historians. Currently, if you do *not* want `C99' definitions, then
-you must use `%option noansi-definitions'.
+historians. Currently, if you do *not* want 'C99' definitions, then you
+must use '%option noansi-definitions'.
- 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.
+ 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
-NULL, 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 assigning `yyin' to a
-new input file or using `yyrestart()' to do so; the latter is available
-for compatibility with previous 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 it would be better to use `YY_FLUSH_BUFFER'
-(*note Actions::). Note that `yyrestart()' does _not_ reset the start
-condition to `INITIAL' (*note Start Conditions::).
-
- If `yylex()' stops scanning due to executing a `return' statement in
+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 NULL,
+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 assigning 'yyin' to a new input file or
+using 'yyrestart()' to do so; the latter is available for compatibility
+with previous 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 it would be better to use 'YY_FLUSH_BUFFER' (*note Actions::). Note
+that 'yyrestart()' does _not_ reset the start condition to 'INITIAL'
+(*note Start Conditions::).
+
+ 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. The calling sequence for `YY_INPUT()'
-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'.
-
- Here is a sample definition of `YY_INPUT' (in the definitions
-section of the input file):
+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. The calling sequence for 'YY_INPUT()' 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'.
+
+ Here is a sample definition of 'YY_INPUT' (in the definitions section
+of the input file):
%{
#define YY_INPUT(buf,result,max_size) \
@@ -1280,24 +1279,24 @@ section of the input file):
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
+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
+'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.
For scanning from in-memory buffers (e.g., scanning strings), see
-*note Scanning Strings::. *Note Multiple Input Buffers::.
+*note Scanning Strings::. *Note 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.
+ 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.

File: flex.info, Node: Start Conditions, Next: Multiple Input Buffers, Prev: Generated Scanner, Up: Top
@@ -1305,15 +1304,15 @@ File: flex.info, Node: Start Conditions, Next: Multiple Input Buffers, Prev:
10 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,
+'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
+ will be active only when the scanner is in the 'STRING' start
condition, and
<INITIAL,STRING,QUOTE>\. { /* handle an escape ... */
@@ -1321,23 +1320,23 @@ condition, and
}
will be active only when the current start condition is either
-`INITIAL', `STRING', or `QUOTE'.
+'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'
+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 activated 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,
-exclusive start conditions make it easy to specify "mini-scanners"
-which scan portions of the input that are syntactically different from
-the rest (e.g., comments).
+is activated 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, exclusive
+start conditions make it easy to specify "mini-scanners" which scan
+portions of the input that are syntactically 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
@@ -1359,15 +1358,15 @@ connection between the two. The set of rules:
<INITIAL,example>bar something_else();
- Without the `<INITIAL,example>' qualifier, the `bar' pattern in the
+ 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',
+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
-example the `example' start condition is an inclusive `(%s)' start
+example the 'example' start condition is an inclusive '(%s)' start
condition.
- Also note that the special start-condition specifier `<*>' matches
+ Also note that the special start-condition specifier '<*>' matches
every start condition. Thus, the above example could also have been
written:
@@ -1378,21 +1377,21 @@ written:
<*>bar something_else();
- The default rule (to `ECHO' any unmatched character) remains active
+ 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 `INITIAL', so `BEGIN(INITIAL)' is equivalent to
-`BEGIN(0)'. (The parentheses around the start condition name are not
+ '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 'INITIAL', 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
+ 'BEGIN' actions can also be given as indented code at the beginning
of the rules section. For example, the following will cause the scanner
-to enter the `SPECIAL' start condition whenever `yylex()' is called and
-the global variable `enter_special' is true:
+to enter the 'SPECIAL' start condition whenever 'yylex()' is called and
+the global variable 'enter_special' is true:
int enter_special;
@@ -1405,11 +1404,11 @@ the global variable `enter_special' is true:
...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':
+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>
@@ -1455,11 +1454,11 @@ maintaining a count of the current input line.
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.
+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 values and can
-be stored as such. Thus, the above could be extended in the following
+ Note that start-conditions names are really integer values and can be
+stored as such. Thus, the above could be extended in the following
fashion:
%x comment foo
@@ -1485,18 +1484,18 @@ fashion:
<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
+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').
+ Flex provides 'YYSTATE' as an alias for 'YY_START' (since that is
+what's used by AT&T 'lex').
For historical reasons, start conditions do not have their own
-name-space within the generated scanner. The start condition names are
+name-space within the generated scanner. The start condition names are
unmodified in the generated scanner and generated header. *Note
-option-header::. *Note option-prefix::.
+option-header::. *Note option-prefix::.
Finally, here's an example of how to match C-style quoted strings
using exclusive start conditions, including expanded escape sequences
@@ -1564,9 +1563,9 @@ condition "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 automatically has the prefix `SCs>'
-applied to it, until a `}' which matches the initial `{'. So, for
+ 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>{
@@ -1585,17 +1584,17 @@ example,
Start condition scopes may be nested.
- The following routines are available for manipulating stacks of
-start conditions:
+ The following routines are available for manipulating stacks of start
+conditions:
- -- Function: void yy_push_state ( int `new_state' )
+ -- Function: 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
+ condition stack and switches to 'new_state' as though you had used
+ 'BEGIN new_state' (recall that start condition names are also
integers).
-- Function: void yy_pop_state ()
- pops the top of the stack and switches to it via `BEGIN'.
+ pops the top of the stack and switches to it via 'BEGIN'.
-- Function: int yy_top_state ()
returns the top of the stack without altering the stack's contents.
@@ -1603,7 +1602,7 @@ start conditions:
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
+ To use start condition stacks, your scanner must include a '%option
stack' directive (*note Scanner Options::).

@@ -1613,82 +1612,82 @@ File: flex.info, Node: Multiple Input Buffers, Next: EOF, Prev: Start Conditi
*************************
Some scanners (such as those which support "include" files) require
-reading from several input streams. As `flex' scanners do a large
+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
+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' statement which requires switching the
+statement such as an 'include' statement 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:
+ 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:
-- Function: 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 initialize
-`YY_BUFFER_STATE' variables to `((YY_BUFFER_STATE) 0)' if you wish, and
+ 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 initialize
+'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 redefine `YY_INPUT()' so it
-no longer uses `yyin', then you can safely pass a NULL `FILE' pointer to
-`yy_create_buffer'. You select a particular buffer to scan from using:
+'FILE' pointer in the call to 'yy_create_buffer' is only used as the
+value of 'yyin' seen by 'YY_INPUT'. If you redefine 'YY_INPUT()' so it
+no longer uses 'yyin', then you can safely pass a NULL 'FILE' pointer to
+'yy_create_buffer'. You select a particular buffer to scan from using:
-- Function: void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer )
The above function 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. If you are
+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. If you are
looking for a stack of input buffers, then you want to use
-`yypush_buffer_state()' instead of this function. Note also that
-switching input sources via either `yy_switch_to_buffer()' or
-`yywrap()' does _not_ change the start condition.
+'yypush_buffer_state()' instead of this function. Note also that
+switching input sources via either 'yy_switch_to_buffer()' or 'yywrap()'
+does _not_ change the start condition.
-- Function: void yy_delete_buffer ( YY_BUFFER_STATE buffer )
- is used to reclaim the storage associated with a buffer. (`buffer'
+ is used to reclaim the storage associated with a buffer. ('buffer'
can be NULL, in which case the routine does nothing.) You can also
clear the current contents of a buffer using:
-- Function: void yypush_buffer_state ( YY_BUFFER_STATE buffer )
This function pushes the new buffer state onto an internal stack.
-The pushed state becomes the new current state. The stack is maintained
-by flex and will grow as required. This function is intended to be used
-instead of `yy_switch_to_buffer', when you want to change states, but
+The pushed state becomes the new current state. The stack is maintained
+by flex and will grow as required. This function is intended to be used
+instead of 'yy_switch_to_buffer', when you want to change states, but
preserve the current state for later use.
-- Function: void yypop_buffer_state ( )
This function removes the current state from the top of the stack,
-and deletes it by calling `yy_delete_buffer'. The next state on the
+and deletes it by calling 'yy_delete_buffer'. The next state on the
stack, if any, becomes the new current state.
-- Function: 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()'.
+the buffer anew using 'YY_INPUT()'.
-- Function: YY_BUFFER_STATE yy_new_buffer ( FILE *file, int size )
- is an alias for `yy_create_buffer()', provided for compatibility
-with the C++ use of `new' and `delete' for creating and destroying
-dynamic objects.
+ is an alias for 'yy_create_buffer()', provided for compatibility with
+the C++ use of 'new' and 'delete' for creating and destroying dynamic
+objects.
- `YY_CURRENT_BUFFER' macro returns a `YY_BUFFER_STATE' handle to the
-current buffer. It should not be used as an lvalue.
+ 'YY_CURRENT_BUFFER' macro returns a 'YY_BUFFER_STATE' handle to the
+current buffer. It should not be used as an lvalue.
Here are two examples of using these features for writing a scanner
-which expands include files (the `<<EOF>>' feature is discussed below).
+which expands include files (the '<<EOF>>' feature is discussed below).
This first example uses yypush_buffer_state and yypop_buffer_state.
Flex maintains the stack internally.
@@ -1725,8 +1724,8 @@ Flex maintains the stack internally.
}
The second example, below, does the same thing as the previous
-example did, but manages its own input buffer stack manually (instead
-of letting flex do it).
+example did, but manages its own input buffer stack manually (instead of
+letting flex do it).
/* the "incl" state is used for picking up the name
* of an include file
@@ -1784,34 +1783,34 @@ of letting flex do it).
The following 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' handle (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_BUFFER_STATE' handle (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.
-- Function: YY_BUFFER_STATE yy_scan_string ( const char *str )
scans a NUL-terminated string.
- -- Function: YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int
- len )
- scans `len' bytes (including possibly `NUL's) starting at location
- `bytes'.
+ -- Function: YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len
+ )
+ scans 'len' bytes (including possibly 'NUL's) starting 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
+string or bytes. (This may be desirable, since 'yylex()' modifies the
contents of the buffer it is scanning.) You can avoid the copy by
using:
-- Function: 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' (ASCII NUL). These last two 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 (i.e., forget the final
-two `YY_END_OF_BUFFER_CHAR' bytes), then `yy_scan_buffer()' returns a
+ 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, scanning 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
NULL pointer instead of creating a new input buffer.
-- Data type: yy_size_t
@@ -1824,27 +1823,27 @@ File: flex.info, Node: EOF, Next: Misc Macros, Prev: Multiple Input Buffers,
12 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 the following things:
+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 the following 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.)
+ * 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 a 'return' statement;
- * executing the special `yyterminate()' action.
+ * executing the special 'yyterminate()' action.
- * or, switching to a new buffer using `yy_switch_to_buffer()' as
+ * 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
-initial start condition, use:
+rule is given, it applies to _all_ start conditions which do not already
+have <<EOF>> actions. To specify an <<EOF>> rule for only the initial
+start condition, use:
<INITIAL><<EOF>>
@@ -1873,57 +1872,57 @@ File: flex.info, Node: Misc Macros, Next: User Values, Prev: EOF, Up: Top
13 Miscellaneous Macros
***********************
-The macro `YY_USER_ACTION' can be defined to provide an action which is
+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:
+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 different 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:
+ where 'ctr' is an array to hold the counts for the different 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 in *note
-Scanner Options::). 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' (*note Scanner Options::). `yy_set_interactive()'
+ 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 in *note Scanner
+Options::). 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' (*note Scanner Options::). '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
+ 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 `^' active, while a zero argument makes `^' rules
+rules anchored with '^' active, while a zero argument makes '^' rules
inactive.
- The macro `YY_AT_BOL()' returns true if the next token scanned from
-the current buffer will have `^' rules active, false otherwise.
+ 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 unreachable statement warnings where because a rule's
-action ends with `return', the `YY_BREAK' is inaccessible.
+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
+unreachable statement warnings where because a rule's action ends with
+'return', the 'YY_BREAK' is inaccessible.

File: flex.info, Node: User Values, Next: Yacc, Prev: Misc Macros, Up: Top
@@ -1934,53 +1933,52 @@ File: flex.info, Node: User Values, Next: Yacc, Prev: Misc Macros, Up: Top
This chapter summarizes the various values available to the user in the
rule actions.
-`char *yytext'
+'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
+ 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
- `unput()', which potentially destroy its value when `yytext' is a
- character pointer. The opposite of `%array' is `%pointer', which
+ (generally 8KB). Using '%array' results in somewhat slower
+ scanners, but the value of 'yytext' becomes immune to calls to
+ '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).
+ You cannot use '%array' when generating C++ scanner classes (the
+ '-+' flag).
-`int yyleng'
+'int yyleng'
holds the length of the current token.
-`FILE *yyin'
- is the file which by default `flex' reads from. It may be
+'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
+ 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 scanning the same input file.
+ buffered-up input is lost). Note that calling 'yyrestart()' with
+ 'yyin' as an argument thus throws away the current input buffer and
+ continues scanning the same input file.
-`FILE *yyout'
- is the file to which `ECHO' actions are done. It can be reassigned
+'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' handle to the current buffer.
+'YY_CURRENT_BUFFER'
+ returns a 'YY_BUFFER_STATE' handle to the current buffer.
-`YY_START'
+'YY_START'
returns an integer value corresponding to the current start
- condition. You can subsequently use this value with `BEGIN' to
+ condition. You can subsequently use this value with 'BEGIN' to
return to that start condition.

@@ -1989,15 +1987,15 @@ File: flex.info, Node: Yacc, Next: Scanner Options, Prev: User Values, Up: T
15 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
+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
+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:
%{
@@ -2014,18 +2012,18 @@ File: flex.info, Node: Scanner Options, Next: Performance, Prev: Yacc, Up: T
16 Scanner Options
******************
-The various `flex' options are categorized by function in the following
-menu. If you want to lookup a particular option by name, *Note Index of
+The various 'flex' options are categorized by function in the following
+menu. If you want to lookup a particular option by name, *Note Index of
Scanner Options::.
* Menu:
-* Options for Specifying Filenames::
-* Options Affecting Scanner Behavior::
-* Code-Level And API Options::
-* Options for Scanner Speed and Size::
-* Debugging Options::
-* Miscellaneous Options::
+* Options for Specifying Filenames::
+* Options Affecting Scanner Behavior::
+* Code-Level And API Options::
+* Options for Scanner Speed and Size::
+* Debugging Options::
+* Miscellaneous Options::
Even though there are many scanner options, a typical scanner might
only specify the following options:
@@ -2035,34 +2033,34 @@ only specify the following options:
%option yylineno
%option outfile="scanner.c" header-file="scanner.h"
- The first line specifies the general type of scanner we want. The
-second line specifies that we are being careful. The third line asks
-flex to track line numbers. The last line tells flex what to name the
-files. (The options can be specified in any order. We just divided
+ The first line specifies the general type of scanner we want. The
+second line specifies that we are being careful. The third line asks
+flex to track line numbers. The last line tells flex what to name the
+files. (The options can be specified in any order. We just divided
them.)
- `flex' also provides a mechanism for controlling options within the
+ '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
+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.
+single '%option' directive, and multiple directives in the first section
+of your flex input file.
Most options are given simply as names, optionally preceded by the
-word `no' (with no intervening whitespace) to negate their meaning.
-The names are the same as their long-option equivalents (but without the
-leading `--' ).
+word 'no' (with no intervening whitespace) to negate their meaning. The
+names are the same as their long-option equivalents (but without the
+leading '--' ).
- `flex' scans your rule actions to determine whether you use the
-`REJECT' or `yymore()' features. The `REJECT' and `yymore' options are
+ '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
+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)'.
+(e.g., '%option noyymore)'.
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
+Each of the following, if unset (e.g., '%option nounput'), results in
the corresponding routine not appearing in the generated scanner:
input, unput
@@ -2074,8 +2072,8 @@ the corresponding routine not appearing in the generated scanner:
yyget_out, yyset_out, yyget_lval, yyset_lval,
yyget_lloc, yyset_lloc, yyget_debug, yyset_debug
- (though `yy_push_state()' and friends won't appear anyway unless you
-use `%option stack)'.
+ (though 'yy_push_state()' and friends won't appear anyway unless you
+use '%option stack)'.

File: flex.info, Node: Options for Specifying Filenames, Next: Options Affecting Scanner Behavior, Prev: Scanner Options, Up: Scanner Options
@@ -2083,86 +2081,84 @@ File: flex.info, Node: Options for Specifying Filenames, Next: Options Affecti
16.1 Options for Specifying Filenames
=====================================
-`--header-file=FILE, `%option header-file="FILE"''
- instructs flex to write a C header to `FILE'. This file contains
+'--header-file=FILE, '%option header-file="FILE"''
+ instructs flex to write a C header to 'FILE'. This file contains
function prototypes, extern variables, and types used by the
scanner. Only the external API is exported by the header file.
Many macros that are usable from within scanner actions are not
- exported to the header file. This is due to namespace problems and
+ exported to the header file. This is due to namespace problems and
the goal of a clean external API.
- While in the header, the macro `yyIN_HEADER' is defined, where `yy'
+ While in the header, the macro 'yyIN_HEADER' is defined, where 'yy'
is substituted with the appropriate prefix.
- The `--header-file' option is not compatible with the `--c++'
+ The '--header-file' option is not compatible with the '--c++'
option, since the C++ scanner provides its own header in
- `yyFlexLexer.h'.
+ 'yyFlexLexer.h'.
-`-oFILE, --outfile=FILE, `%option outfile="FILE"''
- directs flex to write the scanner to the file `FILE' instead of
- `lex.yy.c'. If you combine `--outfile' with the `--stdout' option,
- then the scanner is written to `stdout' but its `#line' directives
- (see the `-l' option above) refer to the file `FILE'.
+'-oFILE, --outfile=FILE, '%option outfile="FILE"''
+ directs flex to write the scanner to the file 'FILE' instead of
+ 'lex.yy.c'. If you combine '--outfile' with the '--stdout' option,
+ then the scanner is written to 'stdout' but its '#line' directives
+ (see the '-l' option above) refer to the file 'FILE'.
-`-t, --stdout, `%option stdout''
- instructs `flex' to write the scanner it generates to standard
- output instead of `lex.yy.c'.
+'-t, --stdout, '%option stdout''
+ instructs 'flex' to write the scanner it generates to standard
+ output instead of 'lex.yy.c'.
-`-SFILE, --skel=FILE'
- overrides the default skeleton file from which `flex' constructs
+'-SFILE, --skel=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' maintenance or development.
-`--tables-file=FILE'
+'--tables-file=FILE'
Write serialized scanner dfa tables to FILE. The generated scanner
will not contain the tables, and requires them to be loaded at
runtime. *Note serialization::.
-`--tables-verify'
- This option is for flex development. We document it here in case
+'--tables-verify'
+ This option is for flex development. We document it here in case
you stumble upon it by accident or in case you suspect some
inconsistency in the serialized tables. Flex will serialize the
scanner dfa tables but will also generate the in-code tables as it
- normally does. At runtime, the scanner will verify that the
+ normally does. At runtime, the scanner will verify that the
serialized tables match the in-code tables, instead of loading
them.
-

File: flex.info, Node: Options Affecting Scanner Behavior, Next: Code-Level And API Options, Prev: Options for Specifying Filenames, Up: Scanner Options
16.2 Options Affecting Scanner Behavior
=======================================
-`-i, --case-insensitive, `%option case-insensitive''
- instructs `flex' to generate a "case-insensitive" scanner. The
- case of letters given in the `flex' input patterns will be ignored,
+'-i, --case-insensitive, '%option case-insensitive''
+ 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 preserved case (i.e.,
+ matched text given in 'yytext' will have the preserved case (i.e.,
it will not be folded). For tricky behavior, see *note case and
character ranges::.
-`-l, --lex-compat, `%option lex-compat''
- turns on maximum compatibility with the original AT&T `lex'
+'-l, --lex-compat, '%option lex-compat''
+ 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 `--c++', `--full', `--fast', `-Cf', or
- `-CF' options. For details on the compatibilities it provides, see
+ it cannot be used with the '--c++', '--full', '--fast', '-Cf', or
+ '-CF' options. For details on the compatibilities it provides, see
*note Lex and Posix::. This option also results in the name
- `YY_FLEX_LEX_COMPAT' being `#define''d in the generated scanner.
+ 'YY_FLEX_LEX_COMPAT' being '#define''d in the generated scanner.
-`-B, --batch, `%option batch''
- instructs `flex' to generate a "batch" scanner, the opposite of
- _interactive_ scanners generated by `--interactive' (see below).
- In general, you use `-B' when you are _certain_ that your scanner
+'-B, --batch, '%option batch''
+ instructs 'flex' to generate a "batch" scanner, the opposite of
+ _interactive_ scanners generated by '--interactive' (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, which turn on `--batch' automatically
- anyway.
+ squeeze out a _lot_ more performance, you should be using the '-Cf'
+ or '-CF' options, which turn on '--batch' automatically anyway.
-`-I, --interactive, `%option interactive''
- instructs `flex' to generate an interactive scanner. An
+'-I, --interactive, '%option interactive''
+ instructs 'flex' to generate an interactive scanner. 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
@@ -2173,113 +2169,112 @@ File: flex.info, Node: Options Affecting Scanner Behavior, Next: Code-Level An
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 (*note Performance::). That's
+ 'flex' scanners default to 'interactive' unless you use the '-Cf'
+ or '-CF' table-compression options (*note Performance::). 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
- `--interactive' 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.
+ 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 '--interactive' 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 `--batch'
+ You can force a scanner to _not_ be interactive by using '--batch'
-`-7, --7bit, `%option 7bit''
- instructs `flex' to generate a 7-bit scanner, i.e., one which can
+'-7, --7bit, '%option 7bit''
+ instructs 'flex' to generate a 7-bit scanner, i.e., one which can
only recognize 7-bit characters in its input. The advantage of
- using `--7bit' is that the scanner's tables can be up to half the
- size of those generated using the `--8bit'. The disadvantage is
+ using '--7bit' is that the scanner's tables can be up to half the
+ size of those generated using the '--8bit'. The disadvantage is
that such scanners often hang or crash if their input contains an
8-bit character.
Note, however, that unless you generate your scanner using the
- `-Cf' or `-CF' table compression options, use of `--7bit' will
- save only a small amount of table space, and make your scanner
- considerably 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 generating 7-bit scanners unless
- your site was always configured to generate 8-bit scanners (as will
+ '-Cf' or '-CF' table compression options, use of '--7bit' will save
+ only a small amount of table space, and make your scanner
+ considerably 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 generating 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 `--verbose' output as described above.
+ summary in the '--verbose' output as described above.
- Note that if you use `-Cfe' or `-CFe' `flex' still defaults to
+ Note that if you use '-Cfe' or '-CFe' '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, --8bit, `%option 8bit''
- instructs `flex' to generate an 8-bit scanner, i.e., one which can
+'-8, --8bit, '%option 8bit''
+ 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
+ generated using '-Cf' or '-CF', as otherwise flex defaults to
generating an 8-bit scanner anyway.
- See the discussion of `--7bit' above for `flex''s default behavior
+ See the discussion of '--7bit' above for 'flex''s default behavior
and the tradeoffs between 7-bit and 8-bit scanners.
-`--default, `%option default''
+'--default, '%option default''
generate the default rule.
-`--always-interactive, `%option always-interactive''
+'--always-interactive, '%option 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
+ 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.
-`--never-interactive, `--never-interactive''
+'--never-interactive, '--never-interactive''
instructs flex to generate a scanner which never considers its
- input interactive. This is the opposite of `always-interactive'.
+ input interactive. This is the opposite of 'always-interactive'.
-`-X, --posix, `%option posix''
+'-X, --posix, '%option posix''
turns on maximum compatibility with the POSIX 1003.2-1992
- definition of `lex'. Since `flex' was originally designed to
- implement the POSIX definition of `lex' this generally involves
+ definition of 'lex'. Since 'flex' was originally designed to
+ implement the POSIX definition of 'lex' this generally involves
very few changes in behavior. At the current writing the known
- differences between `flex' and the POSIX standard are:
+ differences between 'flex' and the POSIX standard are:
- * In POSIX and AT&T `lex', the repeat operator, `{}', has lower
- precedence than concatenation (thus `ab{3}' yields `ababab').
+ * In POSIX and AT&T 'lex', the repeat operator, '{}', has lower
+ precedence than concatenation (thus 'ab{3}' yields 'ababab').
Most POSIX utilities use an Extended Regular Expression (ERE)
precedence that has the precedence of the repeat operator
- higher than concatenation (which causes `ab{3}' to yield
- `abbb'). By default, `flex' places the precedence of the
+ higher than concatenation (which causes 'ab{3}' to yield
+ 'abbb'). By default, 'flex' places the precedence of the
repeat operator higher than concatenation which matches the
ERE processing of other POSIX utilities. When either
- `--posix' or `-l' are specified, `flex' will use the
- traditional AT&T and POSIX-compliant precedence for the
- repeat operator where concatenation has higher precedence
- than the repeat operator.
+ '--posix' or '-l' are specified, 'flex' will use the
+ traditional AT&T and POSIX-compliant precedence for the repeat
+ operator where concatenation has higher precedence than the
+ repeat operator.
-`--stack, `%option stack''
+'--stack, '%option stack''
enables the use of start condition stacks (*note Start
Conditions::).
-`--stdinit, `%option stdinit''
- if set (i.e., %option stdinit) initializes `yyin' and `yyout' to
- `stdin' and `stdout', instead of the default of `NULL'. 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. In a reentrant scanner,
- however, this is not a problem since initialization is performed
- in `yylex_init' at runtime.
-
-`--yylineno, `%option yylineno''
- directs `flex' to generate a scanner that maintains the number of
+'--stdinit, '%option stdinit''
+ if set (i.e., %option stdinit) initializes 'yyin' and 'yyout' to
+ 'stdin' and 'stdout', instead of the default of 'NULL'. 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. In a reentrant scanner,
+ however, this is not a problem since initialization is performed in
+ 'yylex_init' at runtime.
+
+'--yylineno, '%option 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'. In a
- reentrant C scanner, the macro `yylineno' is accessible regardless
- of the value of `%option yylineno', however, its value is not
- modified by `flex' unless `%option yylineno' is enabled.
-
-`--yywrap, `%option yywrap''
- if unset (i.e., `--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).
+ 'yylineno'. This option is implied by '%option lex-compat'. In a
+ reentrant C scanner, the macro 'yylineno' is accessible regardless
+ of the value of '%option yylineno', however, its value is not
+ modified by 'flex' unless '%option yylineno' is enabled.
+'--yywrap, '%option yywrap''
+ if unset (i.e., '--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).

File: flex.info, Node: Code-Level And API Options, Next: Options for Scanner Speed and Size, Prev: Options Affecting Scanner Behavior, Up: Scanner Options
@@ -2287,68 +2282,67 @@ File: flex.info, Node: Code-Level And API Options, Next: Options for Scanner S
16.3 Code-Level And API Options
===============================
-`--ansi-definitions, `%option ansi-definitions''
- instruct flex to generate ANSI C99 definitions for functions.
- This option is enabled by default. If `%option
- noansi-definitions' is specified, then the obsolete style is
- generated.
+'--ansi-definitions, '%option ansi-definitions''
+ instruct flex to generate ANSI C99 definitions for functions. This
+ option is enabled by default. If '%option noansi-definitions' is
+ specified, then the obsolete style is generated.
-`--ansi-prototypes, `%option ansi-prototypes''
- instructs flex to generate ANSI C99 prototypes for functions.
- This option is enabled by default. If `noansi-prototypes' is
- specified, then prototypes will have empty parameter lists.
+'--ansi-prototypes, '%option ansi-prototypes''
+ instructs flex to generate ANSI C99 prototypes for functions. This
+ option is enabled by default. If 'noansi-prototypes' is specified,
+ then prototypes will have empty parameter lists.
-`--bison-bridge, `%option bison-bridge''
+'--bison-bridge, '%option bison-bridge''
instructs flex to generate a C scanner that is meant to be called
- by a `GNU bison' parser. The scanner has minor API changes for
- `bison' compatibility. In particular, the declaration of `yylex'
- is modified to take an additional parameter, `yylval'. *Note
- Bison Bridge::.
-
-`--bison-locations, `%option bison-locations''
- instruct flex that `GNU bison' `%locations' are being used. This
- means `yylex' will be passed an additional parameter, `yylloc'.
- This option implies `%option bison-bridge'. *Note Bison Bridge::.
-
-`-L, --noline, `%option noline''
- instructs `flex' not to generate `#line' directives. Without this
- option, `flex' peppers the generated scanner with `#line'
+ by a 'GNU bison' parser. The scanner has minor API changes for
+ 'bison' compatibility. In particular, the declaration of 'yylex'
+ is modified to take an additional parameter, 'yylval'. *Note Bison
+ Bridge::.
+
+'--bison-locations, '%option bison-locations''
+ instruct flex that 'GNU bison' '%locations' are being used. This
+ means 'yylex' will be passed an additional parameter, 'yylloc'.
+ This option implies '%option bison-bridge'. *Note Bison Bridge::.
+
+'-L, --noline, '%option noline''
+ 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
+ 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 in *note Reporting Bugs::).
-`-R, --reentrant, `%option reentrant''
+'-R, --reentrant, '%option reentrant''
instructs flex to generate a reentrant C scanner. The generated
- scanner may safely be used in a multi-threaded environment. The
+ scanner may safely be used in a multi-threaded environment. The
API for a reentrant scanner is different than for a non-reentrant
scanner *note Reentrant::). Because of the API difference between
- reentrant and non-reentrant `flex' scanners, non-reentrant flex
+ reentrant and non-reentrant 'flex' scanners, non-reentrant flex
code must be modified before it is suitable for use with this
- option. This option is not compatible with the `--c++' option.
+ option. This option is not compatible with the '--c++' option.
- The option `--reentrant' does not affect the performance of the
+ The option '--reentrant' does not affect the performance of the
scanner.
-`-+, --c++, `%option c++''
+'-+, --c++, '%option c++''
specifies that you want flex to generate a C++ scanner class.
*Note Cxx::, for details.
-`--array, `%option array''
+'--array, '%option array''
specifies that you want yytext to be an array instead of a char*
-`--pointer, `%option pointer''
- specify that `yytext' should be a `char *', not an array. This
- default is `char *'.
+'--pointer, '%option pointer''
+ specify that 'yytext' should be a 'char *', not an array. This
+ default is 'char *'.
-`-PPREFIX, --prefix=PREFIX, `%option prefix="PREFIX"''
- changes the default `yy' prefix used by `flex' for all
+'-PPREFIX, --prefix=PREFIX, '%option prefix="PREFIX"''
+ changes the default 'yy' prefix used by 'flex' for all
globally-visible variable and function names to instead be
- `PREFIX'. For example, `--prefix=foo' 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 is a partial
- list of the names affected:
+ 'PREFIX'. For example, '--prefix=foo' 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 is a partial list of the
+ names affected:
yy_create_buffer
yy_delete_buffer
@@ -2369,41 +2363,40 @@ File: flex.info, Node: Code-Level And API Options, Next: Options for Scanner S
yyrealloc
yyfree
- (If you are using a C++ scanner, then only `yywrap' and
- `yyFlexLexer' are affected.) Within your scanner itself, you can
+ (If you are using a C++ scanner, then only 'yywrap' and
+ 'yyFlexLexer' are affected.) Within your scanner itself, you can
still refer to the global variables and functions using either
version of their name; but externally, they have the modified name.
- This option lets you easily link together multiple `flex' programs
+ This option lets you easily link together multiple 'flex' programs
into the same executable. Note, though, that using this option
- also renames `yywrap()', so you now _must_ either provide your own
+ 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
+ use '%option noyywrap', as linking with '-lfl' no longer provides
one for you by default.
-`--main, `%option main''
- directs flex to provide a default `main()' program for the
- scanner, which simply calls `yylex()'. This option implies
- `noyywrap' (see below).
-
-`--nounistd, `%option nounistd''
- suppresses inclusion of the non-ANSI header file `unistd.h'. This
- option is meant to target environments in which `unistd.h' does
- not exist. Be aware that certain options may cause flex to
- generate code that relies on functions normally found in
- `unistd.h', (e.g. `isatty()', `read()'.) If you wish to use these
- functions, you will have to inform your compiler where to find
- them. *Note option-always-interactive::. *Note option-read::.
-
-`--yyclass=NAME, `%option yyclass="NAME"''
- only applies when generating a C++ scanner (the `--c++' option).
- It informs `flex' that you have derived `NAME' 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. *Note Cxx::.
-
+'--main, '%option main''
+ directs flex to provide a default 'main()' program for the scanner,
+ which simply calls 'yylex()'. This option implies 'noyywrap' (see
+ below).
+
+'--nounistd, '%option nounistd''
+ suppresses inclusion of the non-ANSI header file 'unistd.h'. This
+ option is meant to target environments in which 'unistd.h' does not
+ exist. Be aware that certain options may cause flex to generate
+ code that relies on functions normally found in 'unistd.h', (e.g.
+ 'isatty()', 'read()'.) If you wish to use these functions, you
+ will have to inform your compiler where to find them. *Note
+ option-always-interactive::. *Note option-read::.
+
+'--yyclass=NAME, '%option yyclass="NAME"''
+ only applies when generating a C++ scanner (the '--c++' option).
+ It informs 'flex' that you have derived 'NAME' 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.
+ *Note Cxx::.

File: flex.info, Node: Options for Scanner Speed and Size, Next: Debugging Options, Prev: Code-Level And API Options, Up: Scanner Options
@@ -2411,16 +2404,16 @@ File: flex.info, Node: Options for Scanner Speed and Size, Next: Debugging Opt
16.4 Options for Scanner Speed and Size
=======================================
-`-C[aefFmr]'
+'-C[aefFmr]'
controls the degree of table compression and, more generally,
trade-offs between small scanners and fast scanners.
- `-C'
- A lone `-C' specifies that the scanner tables should be
+ '-C'
+ A lone '-C' specifies that the scanner tables should be
compressed but neither equivalence classes nor
meta-equivalence classes should be used.
- `-Ca, --align, `%option align''
+ '-Ca, --align, '%option align''
("align") instructs flex to trade off larger tables in the
generated scanner for faster performance because the elements
of the tables are better aligned for memory access and
@@ -2429,10 +2422,10 @@ File: flex.info, Node: Options for Scanner Speed and Size, Next: Debugging Opt
smaller-sized units such as shortwords. This option can
quadruple the size of the tables used by your scanner.
- `-Ce, --ecs, `%option ecs''
- directs `flex' to construct "equivalence classes", i.e., sets
+ '-Ce, --ecs, '%option ecs''
+ 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
+ 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 equivalence class).
Equivalence classes usually give dramatic reductions in the
@@ -2440,44 +2433,44 @@ File: flex.info, Node: Options for Scanner Speed and Size, Next: Debugging Opt
are pretty cheap performance-wise (one array look-up per
character scanned).
- `-Cf'
+ '-Cf'
specifies that the "full" scanner tables should be generated -
- `flex' should not compress the tables by taking advantages of
+ 'flex' should not compress the tables by taking advantages of
similar transition functions for different states.
- `-CF'
+ '-CF'
specifies that the alternate fast scanner representation
- (described above under the `--fast' flag) should be used.
- This option cannot be used with `--c++'.
+ (described above under the '--fast' flag) should be used.
+ This option cannot be used with '--c++'.
- `-Cm, --meta-ecs, `%option meta-ecs''
- directs `flex' to construct "meta-equivalence classes", which
+ '-Cm, --meta-ecs, '%option meta-ecs''
+ 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).
+ compressed tables, but they have a moderate performance impact
+ (one or two 'if' tests and one array look-up per character
+ scanned).
- `-Cr, --read, `%option read''
+ '-Cr, --read, '%option read''
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 system, 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 scanner (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()' (*note Generated Scanner::).
-
- The options `-Cf' or `-CF' and `-Cm' do not make sense together -
+ 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
+ system, 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 scanner (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()'
+ (*note Generated Scanner::).
+
+ 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
+ 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
@@ -2497,18 +2490,18 @@ File: flex.info, Node: Options for Scanner Speed and Size, Next: Debugging Opt
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
+ '-Cfe' is often a good compromise between speed and size for
production scanners.
-`-f, --full, `%option full''
- specifies "fast scanner". No table compression is done and
- `stdio' is bypassed. The result is large but fast. This option
- is equivalent to `--Cfr'
+'-f, --full, '%option full''
+ specifies "fast scanner". No table compression is done and 'stdio'
+ is bypassed. The result is large but fast. This option is
+ equivalent to '--Cfr'
-`-F, --fast, `%option fast''
+'-F, --fast, '%option fast''
specifies that the _fast_ scanner table representation should be
- used (and `stdio' bypassed). This representation is about as fast
- as the full table representation `--full', and for some sets of
+ used (and 'stdio' bypassed). This representation is about as fast
+ as the full table representation '--full', and for some sets of
patterns will be considerably smaller (and for others, larger). In
general, if the pattern set contains both _keywords_ and a
catch-all, _identifier_ rule, such as in the set:
@@ -2520,13 +2513,12 @@ File: flex.info, Node: Options for Scanner Speed and Size, Next: Debugging Opt
[a-z]+ return TOK_ID;
then you're better off using the full table representation. 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
- `--fast'.
-
- This option is equivalent to `-CFr'. It cannot be used with
- `--c++'.
+ 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
+ '--fast'.
+ This option is equivalent to '-CFr'. It cannot be used with
+ '--c++'.

File: flex.info, Node: Debugging Options, Next: Miscellaneous Options, Prev: Options for Scanner Speed and Size, Up: Scanner Options
@@ -2534,21 +2526,21 @@ File: flex.info, Node: Debugging Options, Next: Miscellaneous Options, Prev:
16.5 Debugging Options
======================
-`-b, --backup, `%option backup''
- Generate backing-up information to `lex.backup'. This is a list of
+'-b, --backup, '%option backup''
+ 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
- `--perf-report' flag). Only users who wish to squeeze every last
+ states. If _all_ backing-up states are eliminated and '-Cf' or
+ '-CF' is used, the generated scanner will run faster (see the
+ '--perf-report' flag). Only users who wish to squeeze every last
cycle out of their scanners need worry about this option. (*note
Performance::).
-`-d, --debug, `%option debug''
+'-d, --debug, '%option debug''
makes the generated scanner run in "debug" mode. Whenever a
- pattern is recognized and the global variable `yy_flex_debug' is
- non-zero (which is the default), the scanner will write to
- `stderr' a line of the form:
+ pattern is recognized and the global variable '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")
@@ -2559,66 +2551,64 @@ File: flex.info, Node: Debugging Options, Next: Miscellaneous Options, Prev:
NUL; at this point, the two look the same as far as the scanner's
concerned), or reaches an end-of-file.
-`-p, --perf-report, `%option perf-report''
- generates a performance report to `stderr'. The report consists of
- comments regarding features of the `flex' input file which will
+'-p, --perf-report, '%option perf-report''
+ 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 comments regarding
features that lead to minor performance losses.
- Note that the use of `REJECT', and variable trailing context
- (*note Limitations::) entails a substantial performance penalty;
- use of `yymore()', the `^' operator, and the `--interactive' flag
- entail minor performance penalties.
+ Note that the use of 'REJECT', and variable trailing context (*note
+ Limitations::) entails a substantial performance penalty; use of
+ 'yymore()', the '^' operator, and the '--interactive' flag entail
+ minor performance penalties.
-`-s, --nodefault, `%option nodefault''
+'-s, --nodefault, '%option nodefault''
causes the _default rule_ (that unmatched scanner input is echoed
- to `stdout)' to be suppressed. If the scanner encounters input
+ 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, --trace, `%option trace''
- makes `flex' run in "trace" mode. It will generate a lot of
- messages to `stderr' concerning the form of the input and the
+'-T, --trace, '%option trace''
+ 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'.
+ This option is mostly for use in maintaining 'flex'.
-`-w, --nowarn, `%option nowarn''
+'-w, --nowarn, '%option nowarn''
suppresses warning messages.
-`-v, --verbose, `%option verbose''
- specifies that `flex' should write to `stderr' a summary of
+'-v, --verbose, '%option verbose''
+ specifies that 'flex' should write to 'stderr' a summary of
statistics regarding the scanner it generates. Most of the
- statistics are meaningless to the casual `flex' user, but the
- first line identifies the version of `flex' (same as reported by
- `--version'), and the next line the flags used when generating the
+ statistics are meaningless to the casual 'flex' user, but the first
+ line identifies the version of 'flex' (same as reported by
+ '--version'), and the next line the flags used when generating the
scanner, including those that are on by default.
-`--warn, `%option warn''
- warn about certain things. In particular, if the default rule can
+'--warn, '%option warn''
+ warn about certain things. In particular, if the default rule can
be matched but no default rule has been given, the flex will warn
you. We recommend using this option always.
-

File: flex.info, Node: Miscellaneous Options, Prev: Debugging Options, Up: Scanner Options
16.6 Miscellaneous Options
==========================
-`-c'
+'-c'
A do-nothing option included for POSIX compliance.
-`-h, -?, --help'
- generates a "help" summary of `flex''s options to `stdout' and
- then exits.
+'-h, -?, --help'
+ generates a "help" summary of 'flex''s options to 'stdout' and then
+ exits.
-`-n'
+'-n'
Another do-nothing option included for POSIX compliance.
-`-V, --version'
- prints the version number to `stdout' and exits.
-
+'-V, --version'
+ prints the version number to 'stdout' and exits.

File: flex.info, Node: Performance, Next: Cxx, Prev: Scanner Options, Up: Top
@@ -2626,11 +2616,11 @@ File: flex.info, Node: Performance, Next: Cxx, Prev: Scanner Options, Up: To
17 Performance Considerations
*****************************
-The main design goal of `flex' is that it generate high-performance
+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 expensive to least:
+'-C' options outlined above, there are a number of options/actions which
+degrade performance. These are, from most expensive to least:
REJECT
arbitrary trailing context
@@ -2646,21 +2636,21 @@ which degrade performance. These are, from most expensive to least:
yymore()
with the first two 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 you are just putting back some excess text you
-scanned, use `yyless()'.
+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 you are just putting back some excess text you
+scanned, use 'yyless()'.
- `REJECT' should be avoided at all costs when performance is
+ 'REJECT' should be avoided at all costs when performance is
important. It is a particularly expensive option.
- There is one case when `%option yylineno' can be expensive. That is
+ There is one case when '%option yylineno' can be expensive. That is
when your patterns match long tokens that could _possibly_ contain a
-newline character. There is no performance penalty for rules that can
+newline character. There is no performance penalty for rules that can
not possibly match newlines, since flex does not need to check them for
-newlines. In general, you should avoid rules such as `[^f]+', which
+newlines. In general, you should avoid rules such as '[^f]+', which
match very long tokens, including newlines, and may possibly match your
-entire file! A better approach is to separate `[^f]+' into two rules:
+entire file! A better approach is to separate '[^f]+' into two rules:
%option yylineno
%%
@@ -2671,7 +2661,7 @@ entire file! A better approach is to separate `[^f]+' into two rules:
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
+using the '-b' flag to generate a 'lex.backup' file. For example, on
the input:
%%
@@ -2701,25 +2691,25 @@ the input:
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 currently 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
+can make a transition on an 'o' but not on any other character, and that
+in that state the currently 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).
+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 problem when
-`foob' has been scanned. Indeed, on any character other than an `a',
+'foob' has been scanned. Indeed, on any character 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'
+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 performance gain doing so with compressed
+trouble of removing backing up from the rules unless we're using '-Cf'
+or '-CF', since there's no performance gain doing so with compressed
scanners.
The way to remove the backing up is to add "error" rules:
@@ -2750,16 +2740,16 @@ using a "catch-all" rule:
it's not uncommon to get hundreds of messages. 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).
+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 benefits of
-eliminating backing up only if you eliminate _every_ instance of
-backing up. Leaving just one means you gain nothing.
+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., substantial). So when possible a rule like:
+loss as 'REJECT' (i.e., substantial). So when possible a rule like:
%%
mouse|rat/(cat|dog) run();
@@ -2776,15 +2766,15 @@ loss as `REJECT' (i.e., substantial). So when possible a rule like:
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 (*note Limitations::).
+ Note that here the special '|' action does _not_ provide any savings,
+and can even make things worse (*note Limitations::).
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')
+additional work of setting up the scanning environment (e.g., 'yytext')
for the action. Recall the scanner for C comments:
%x comment
@@ -2818,7 +2808,7 @@ keep the matched text as long as possible. Note that _adding_ rules
does _not_ slow down the scanner! The speed of the scanner is
independent of the number of rules or (modulo the considerations given
at the beginning of this section) how complicated the rules are with
-regard to operators such as `*' and `|'.
+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
@@ -2866,15 +2856,15 @@ recognition of newlines with that of the other tokens:
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
+'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 newline 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 possibility of
+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 possibility 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:
+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 |
@@ -2888,16 +2878,16 @@ catch-all rule, this one which doesn't include a newline:
[a-z]+ |
.|\n /* it's not a keyword */
- Compiled with `-Cf', this is about as fast as one can get a `flex'
+ 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, particularly when
-a token contains multiple `NUL's. It's best to write rules which match
+ A final note: 'flex' is slow when matching 'NUL's, particularly 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.
+include 'NUL's.
Another final note regarding performance: as mentioned in *note
-Matching::, dynamically resizing `yytext' to accommodate huge tokens is
+Matching::, dynamically 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,
@@ -2912,116 +2902,122 @@ File: flex.info, Node: Cxx, Next: Reentrant, Prev: Performance, Up: Top
*IMPORTANT*: the present form of the scanning class is _experimental_
and may change considerably between major releases.
- `flex' provides two different ways to generate scanners for use with
-C++. The first way is to simply compile a scanner generated by `flex'
+ '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 compilation errors (*note Reporting Bugs::). You can then use C++
code in your rule actions instead of C code. Note that the default
-input source for your scanner remains `yyin', and default echoing is
-still done to `yyout'. Both of these remain `FILE *' variables and not
+input source for your scanner 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
+ 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:
+ The first class in 'FlexLexer.h', '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'.
+'const char* YYText()'
+ returns the text of the most recently matched token, the equivalent
+ of 'yytext'.
-`int YYLeng()'
+'int YYLeng()'
returns the length of the most recently matched token, the
- equivalent of `yyleng'.
+ equivalent of 'yyleng'.
-`int lineno() const'
- returns the current input line number (see `%option yylineno)', or
- `1' if `%option yylineno' was not used.
+'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 )'
+'void set_debug( int flag )'
sets the debugging flag for the scanner, equivalent to assigning to
- `yy_flex_debug' (*note Scanner Options::). Note that you must
- build the scanner using `%option debug' to include debugging
+ 'yy_flex_debug' (*note Scanner Options::). Note that you must
+ build the scanner using '%option debug' to include debugging
information in it.
-`int debug() const'
+'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).
+'yy_switch_to_buffer()', 'yy_create_buffer()' (though the first argument
+is an 'istream&' object reference and not a 'FILE*)',
+'yy_flush_buffer()', 'yy_delete_buffer()', and 'yyrestart()' (again, the
+first argument is a 'istream&' object reference).
- The second class defined in `FlexLexer.h' is `yyFlexLexer', which is
-derived from `FlexLexer'. It defines the following additional member
+ The second class defined in 'FlexLexer.h' is 'yyFlexLexer', which is
+derived from 'FlexLexer'. It defines the following 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', respectively.
-
-`virtual int yylex()'
- performs the same role is `yylex()' does for ordinary `flex'
+'yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 )'
+'yyFlexLexer( istream& arg_yyin, ostream& arg_yyout )'
+ constructs a 'yyFlexLexer' object using the given streams for input
+ and output. If not specified, the streams default to 'cin' and
+ 'cout', respectively. 'yyFlexLexer' does not take ownership of its
+ stream arguments. It's up to the user to ensure the streams
+ pointed to remain alive at least as long as the 'yyFlexLexer'
+ instance.
+
+'virtual int yylex()'
+ performs the same role is 'yylex()' does for ordinary '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 functions 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 generating
- `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-null) and `yyout' to
- `new_out' (if non-null), deleting the previous input buffer if
- `yyin' is reassigned.
-
-`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
+ rule's action returns a value. If you derive a subclass 'S' from
+ 'yyFlexLexer' and want to access the member functions 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 generating
+ '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)'
+'virtual void switch_streams(istream& new_in, ostream& new_out)'
+ reassigns 'yyin' to 'new_in' (if non-null) and 'yyout' to 'new_out'
+ (if non-null), deleting the previous input buffer if 'yyin' is
+ reassigned.
+
+'int yylex( istream* new_in, ostream* new_out = 0 )'
+'int yylex( istream& new_in, ostream& new_out )'
+ 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 indicate end-of-input, return 0
- characters. Note that `interactive' scanners (see the `-B' and
- `-I' flags in *note Scanner Options::) 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' statements.
-
-`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 )'
+'virtual int LexerInput( char* buf, int max_size )'
+ reads up to 'max_size' characters into 'buf' and returns the number
+ of characters read. To indicate end-of-input, return 0 characters.
+ Note that 'interactive' scanners (see the '-B' and '-I' flags in
+ *note Scanner Options::) 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' statements.
+
+'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 version of this
- function writes the message to the stream `cerr' and exits.
+ function writes the message to the stream 'cerr' and exits.
- Note that a `yyFlexLexer' object contains its _entire_ scanning
+ Note that a 'yyFlexLexer' object contains its _entire_ scanning
state. Thus you can use such objects to create reentrant scanners, but
see also *note Reentrant::. 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
+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).
+ 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:
@@ -3033,7 +3029,7 @@ scanner classes; you must use `%pointer' (the default).
int mylineno = 0;
%}
- %option noyywrap
+ %option noyywrap c++
string \"[^\n"]+\"
@@ -3078,6 +3074,9 @@ scanner classes; you must use `%pointer' (the default).
%%
+ // This include is required if main() is an another source file.
+ //#include <FlexLexer.h>
+
int main( int /* argc */, char** /* argv */ )
{
FlexLexer* lexer = new yyFlexLexer;
@@ -3087,10 +3086,9 @@ scanner classes; you must use `%pointer' (the default).
}
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
-follows:
+'-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 follows:
#undef yyFlexLexer
#define yyFlexLexer xxFlexLexer
@@ -3100,8 +3098,8 @@ follows:
#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.
+ if, for example, you used '%option prefix="xx"' for one of your
+scanners and '%option prefix="zz"' for the other.

File: flex.info, Node: Reentrant, Next: Lex and Posix, Prev: Cxx, Up: Top
@@ -3109,21 +3107,21 @@ File: flex.info, Node: Reentrant, Next: Lex and Posix, Prev: Cxx, Up: Top
19 Reentrant C Scanners
***********************
-`flex' has the ability to generate a reentrant C scanner. This is
-accomplished by specifying `%option reentrant' (`-R') The generated
+'flex' has the ability to generate a reentrant C scanner. This is
+accomplished by specifying '%option reentrant' ('-R') The generated
scanner is both portable, and safe to use in one or more separate
threads of control. The most common use for reentrant scanners is from
-within multi-threaded applications. Any thread may create and execute
-a reentrant `flex' scanner without the need for synchronization with
-other threads.
+within multi-threaded applications. Any thread may create and execute a
+reentrant 'flex' scanner without the need for synchronization with other
+threads.
* Menu:
-* Reentrant Uses::
-* Reentrant Overview::
-* Reentrant Example::
-* Reentrant Detail::
-* Reentrant Functions::
+* Reentrant Uses::
+* Reentrant Overview::
+* Reentrant Example::
+* Reentrant Detail::
+* Reentrant Functions::

File: flex.info, Node: Reentrant Uses, Next: Reentrant Overview, Prev: Reentrant, Up: Reentrant
@@ -3132,8 +3130,8 @@ File: flex.info, Node: Reentrant Uses, Next: Reentrant Overview, Prev: Reentr
================================
However, there are other uses for a reentrant scanner. For example, you
-could scan two or more files simultaneously to implement a `diff' at
-the token level (i.e., instead of at the character level):
+could scan two or more files simultaneously to implement a 'diff' at the
+token level (i.e., instead of at the character level):
/* Example of maintaining more than one active scanner. */
@@ -3150,9 +3148,9 @@ the token level (i.e., instead of at the character level):
Another use for a reentrant scanner is recursion. (Note that a
recursive scanner can also be created using a non-reentrant scanner and
-buffer states. *Note Multiple Input Buffers::.)
+buffer states. *Note Multiple Input Buffers::.)
- The following crude scanner supports the `eval' command by invoking
+ The following crude scanner supports the 'eval' command by invoking
another instance of itself.
/* Example of recursive invocation. */
@@ -3183,22 +3181,22 @@ File: flex.info, Node: Reentrant Overview, Next: Reentrant Example, Prev: Ree
=====================================
The API for reentrant scanners is different than for non-reentrant
-scanners. Here is a quick overview of the API:
+scanners. Here is a quick overview of the API:
- `%option reentrant' must be specified.
+ '%option reentrant' must be specified.
- * All functions take one additional argument: `yyscanner'
+ * All functions take one additional argument: 'yyscanner'
* All global variables are replaced by their macro equivalents. (We
tell you this because it may be important to you during debugging.)
- * `yylex_init' and `yylex_destroy' must be called before and after
- `yylex', respectively.
+ * 'yylex_init' and 'yylex_destroy' must be called before and after
+ 'yylex', respectively.
* Accessor methods (get/set functions) provide access to common
- `flex' variables.
+ 'flex' variables.
- * User-specific data can be stored in `yyextra'.
+ * User-specific data can be stored in 'yyextra'.

File: flex.info, Node: Reentrant Example, Next: Reentrant Detail, Prev: Reentrant Overview, Up: Reentrant
@@ -3206,7 +3204,7 @@ File: flex.info, Node: Reentrant Example, Next: Reentrant Detail, Prev: Reent
19.3 Reentrant Example
======================
-First, an example of a reentrant scanner:
+First, an example of a reentrant scanner:
/* This scanner prints "//" comments. */
%option reentrant stack noyywrap
@@ -3239,17 +3237,17 @@ File: flex.info, Node: Reentrant Detail, Next: Reentrant Functions, Prev: Ree
================================
Here are the things you need to do or know to use the reentrant C API of
-`flex'.
+'flex'.
* Menu:
-* Specify Reentrant::
-* Extra Reentrant Argument::
-* Global Replacement::
-* Init and Destroy Functions::
-* Accessor Methods::
-* Extra Data::
-* About yyscan_t::
+* Specify Reentrant::
+* Extra Reentrant Argument::
+* Global Replacement::
+* Init and Destroy Functions::
+* Accessor Methods::
+* Extra Data::
+* About yyscan_t::

File: flex.info, Node: Specify Reentrant, Next: Extra Reentrant Argument, Prev: Reentrant Detail, Up: Reentrant Detail
@@ -3259,11 +3257,11 @@ File: flex.info, Node: Specify Reentrant, Next: Extra Reentrant Argument, Pre
%option reentrant (-reentrant) must be specified.
- Notice that `%option reentrant' is specified in the above example
-(*note Reentrant Example::. Had this option not been specified, `flex'
+ Notice that '%option reentrant' is specified in the above example
+(*note Reentrant Example::. Had this option not been specified, 'flex'
would have happily generated a non-reentrant scanner without
-complaining. You may explicitly specify `%option noreentrant', if you
-do _not_ want a reentrant scanner, although it is not necessary. The
+complaining. You may explicitly specify '%option noreentrant', if you
+do _not_ want a reentrant scanner, although it is not necessary. The
default is to generate a non-reentrant scanner.

@@ -3272,25 +3270,25 @@ File: flex.info, Node: Extra Reentrant Argument, Next: Global Replacement, Pr
19.4.2 The Extra Argument
-------------------------
-All functions take one additional argument: `yyscanner'.
+All functions take one additional argument: 'yyscanner'.
- Notice that the calls to `yy_push_state' and `yy_pop_state' both
-have an argument, `yyscanner' , that is not present in a non-reentrant
-scanner. Here are the declarations of `yy_push_state' and
-`yy_pop_state' in the reentrant scanner:
+ Notice that the calls to 'yy_push_state' and 'yy_pop_state' both have
+an argument, 'yyscanner' , that is not present in a non-reentrant
+scanner. Here are the declarations of 'yy_push_state' and
+'yy_pop_state' in the reentrant scanner:
static void yy_push_state ( int new_state , yyscan_t yyscanner ) ;
static void yy_pop_state ( yyscan_t yyscanner ) ;
- Notice that the argument `yyscanner' appears in the declaration of
-both functions. In fact, all `flex' functions in a reentrant scanner
+ Notice that the argument 'yyscanner' appears in the declaration of
+both functions. In fact, all 'flex' functions in a reentrant scanner
have this additional argument. It is always the last argument in the
-argument list, it is always of type `yyscan_t' (which is typedef'd to
-`void *') and it is always named `yyscanner'. As you may have guessed,
-`yyscanner' is a pointer to an opaque data structure encapsulating the
+argument list, it is always of type 'yyscan_t' (which is typedef'd to
+'void *') and it is always named 'yyscanner'. As you may have guessed,
+'yyscanner' is a pointer to an opaque data structure encapsulating the
current state of the scanner. For a list of function declarations, see
-*note Reentrant Functions::. Note that preprocessor macros, such as
-`BEGIN', `ECHO', and `REJECT', do not take this additional argument.
+*note Reentrant Functions::. Note that preprocessor macros, such as
+'BEGIN', 'ECHO', and 'REJECT', do not take this additional argument.

File: flex.info, Node: Global Replacement, Next: Init and Destroy Functions, Prev: Extra Reentrant Argument, Up: Reentrant Detail
@@ -3301,22 +3299,22 @@ File: flex.info, Node: Global Replacement, Next: Init and Destroy Functions,
All global variables in traditional flex have been replaced by macro
equivalents.
- Note that in the above example, `yyout' and `yytext' are not plain
-variables. These are macros that will expand to their equivalent lvalue.
-All of the familiar `flex' globals have been replaced by their macro
-equivalents. In particular, `yytext', `yyleng', `yylineno', `yyin',
-`yyout', `yyextra', `yylval', and `yylloc' are macros. You may safely
-use these macros in actions as if they were plain variables. We only
-tell you this so you don't expect to link to these variables
-externally. Currently, each macro expands to a member of an internal
+ Note that in the above example, 'yyout' and 'yytext' are not plain
+variables. These are macros that will expand to their equivalent
+lvalue. All of the familiar 'flex' globals have been replaced by their
+macro equivalents. In particular, 'yytext', 'yyleng', 'yylineno',
+'yyin', 'yyout', 'yyextra', 'yylval', and 'yylloc' are macros. You may
+safely use these macros in actions as if they were plain variables. We
+only tell you this so you don't expect to link to these variables
+externally. Currently, each macro expands to a member of an internal
struct, e.g.,
#define yytext (((struct yyguts_t*)yyscanner)->yytext_r)
- One important thing to remember about `yytext' and friends is that
-`yytext' is not a global variable in a reentrant scanner, you can not
-access it directly from outside an action or from other functions. You
-must use an accessor method, e.g., `yyget_text', to accomplish this.
+ One important thing to remember about 'yytext' and friends is that
+'yytext' is not a global variable in a reentrant scanner, you can not
+access it directly from outside an action or from other functions. You
+must use an accessor method, e.g., 'yyget_text', to accomplish this.
(See below).

@@ -3325,45 +3323,44 @@ File: flex.info, Node: Init and Destroy Functions, Next: Accessor Methods, Pr
19.4.4 Init and Destroy Functions
---------------------------------
-`yylex_init' and `yylex_destroy' must be called before and after
-`yylex', respectively.
+'yylex_init' and 'yylex_destroy' must be called before and after
+'yylex', respectively.
int yylex_init ( yyscan_t * ptr_yy_globals ) ;
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t * ptr_yy_globals ) ;
int yylex ( yyscan_t yyscanner ) ;
int yylex_destroy ( yyscan_t yyscanner ) ;
- The function `yylex_init' must be called before calling any other
-function. The argument to `yylex_init' is the address of an
-uninitialized pointer to be filled in by `yylex_init', overwriting any
-previous contents. The function `yylex_init_extra' may be used instead,
-taking as its first argument a variable of type `YY_EXTRA_TYPE'. See
+ The function 'yylex_init' must be called before calling any other
+function. The argument to 'yylex_init' is the address of an
+uninitialized pointer to be filled in by 'yylex_init', overwriting any
+previous contents. The function 'yylex_init_extra' may be used instead,
+taking as its first argument a variable of type 'YY_EXTRA_TYPE'. See
the section on yyextra, below, for more details.
- The value stored in `ptr_yy_globals' should thereafter be passed to
-`yylex' and `yylex_destroy'. Flex does not save the argument passed to
-`yylex_init', so it is safe to pass the address of a local pointer to
-`yylex_init' so long as it remains in scope for the duration of all
-calls to the scanner, up to and including the call to `yylex_destroy'.
+ The value stored in 'ptr_yy_globals' should thereafter be passed to
+'yylex' and 'yylex_destroy'. Flex does not save the argument passed to
+'yylex_init', so it is safe to pass the address of a local pointer to
+'yylex_init' so long as it remains in scope for the duration of all
+calls to the scanner, up to and including the call to 'yylex_destroy'.
- The function `yylex' should be familiar to you by now. The reentrant
+ The function 'yylex' should be familiar to you by now. The reentrant
version takes one argument, which is the value returned (via an
-argument) by `yylex_init'. Otherwise, it behaves the same as the
-non-reentrant version of `yylex'.
+argument) by 'yylex_init'. Otherwise, it behaves the same as the
+non-reentrant version of 'yylex'.
- Both `yylex_init' and `yylex_init_extra' returns 0 (zero) on success,
+ Both 'yylex_init' and 'yylex_init_extra' returns 0 (zero) on success,
or non-zero on failure, in which case errno is set to one of the
following values:
- * ENOMEM Memory allocation error. *Note memory-management::.
-
+ * ENOMEM Memory allocation error. *Note memory-management::.
* EINVAL Invalid argument.
- The function `yylex_destroy' should be called to free resources used
-by the scanner. After `yylex_destroy' is called, the contents of
-`yyscanner' should not be used. Of course, there is no need to destroy
-a scanner if you plan to reuse it. A `flex' scanner (both reentrant
-and non-reentrant) may be restarted by calling `yyrestart'.
+ The function 'yylex_destroy' should be called to free resources used
+by the scanner. After 'yylex_destroy' is called, the contents of
+'yyscanner' should not be used. Of course, there is no need to destroy
+a scanner if you plan to reuse it. A 'flex' scanner (both reentrant and
+non-reentrant) may be restarted by calling 'yyrestart'.
Below is an example of a program that creates a scanner, uses it,
then destroys it when done:
@@ -3388,17 +3385,17 @@ File: flex.info, Node: Accessor Methods, Next: Extra Data, Prev: Init and Des
19.4.5 Accessing Variables with Reentrant Scanners
--------------------------------------------------
-Accessor methods (get/set functions) provide access to common `flex'
+Accessor methods (get/set functions) provide access to common 'flex'
variables.
Many scanners that you build will be part of a larger project.
-Portions of your project will need access to `flex' values, such as
-`yytext'. In a non-reentrant scanner, these values are global, so
-there is no problem accessing them. However, in a reentrant scanner,
-there are no global `flex' values. You can not access them directly.
-Instead, you must access `flex' values using accessor methods (get/set
-functions). Each accessor method is named `yyget_NAME' or `yyset_NAME',
-where `NAME' is the name of the `flex' variable you want. For example:
+Portions of your project will need access to 'flex' values, such as
+'yytext'. In a non-reentrant scanner, these values are global, so there
+is no problem accessing them. However, in a reentrant scanner, there
+are no global 'flex' values. You can not access them directly.
+Instead, you must access 'flex' values using accessor methods (get/set
+functions). Each accessor method is named 'yyget_NAME' or 'yyset_NAME',
+where 'NAME' is the name of the 'flex' variable you want. For example:
/* Set the last character of yytext to NULL. */
void chop ( yyscan_t scanner )
@@ -3412,8 +3409,8 @@ where `NAME' is the name of the `flex' variable you want. For example:
%%
.+\n { chop( yyscanner );}
- You may find that `%option header-file' is particularly useful for
-generating prototypes of all the accessor functions. *Note
+ You may find that '%option header-file' is particularly useful for
+generating prototypes of all the accessor functions. *Note
option-header::.

@@ -3422,7 +3419,7 @@ File: flex.info, Node: Extra Data, Next: About yyscan_t, Prev: Accessor Metho
19.4.6 Extra Data
-----------------
-User-specific data can be stored in `yyextra'.
+User-specific data can be stored in 'yyextra'.
In a reentrant scanner, it is unwise to use global variables to
communicate with or maintain state between different pieces of your
@@ -3430,23 +3427,23 @@ program. However, you may need access to external data or invoke
external functions from within the scanner actions. Likewise, you may
need to pass information to your scanner (e.g., open file descriptors,
or database connections). In a non-reentrant scanner, the only way to
-do this would be through the use of global variables. `Flex' allows
-you to store arbitrary, "extra" data in a scanner. This data is
-accessible through the accessor methods `yyget_extra' and `yyset_extra'
-from outside the scanner, and through the shortcut macro `yyextra' from
-within the scanner itself. They are defined as follows:
+do this would be through the use of global variables. 'Flex' allows you
+to store arbitrary, "extra" data in a scanner. This data is accessible
+through the accessor methods 'yyget_extra' and 'yyset_extra' from
+outside the scanner, and through the shortcut macro 'yyextra' from
+within the scanner itself. They are defined as follows:
#define YY_EXTRA_TYPE void*
YY_EXTRA_TYPE yyget_extra ( yyscan_t scanner );
void yyset_extra ( YY_EXTRA_TYPE arbitrary_data , yyscan_t scanner);
- In addition, an extra form of `yylex_init' is provided,
-`yylex_init_extra'. This function is provided so that the yyextra value
-can be accessed from within the very first yyalloc, used to allocate
-the scanner itself.
+ In addition, an extra form of 'yylex_init' is provided,
+'yylex_init_extra'. This function is provided so that the yyextra value
+can be accessed from within the very first yyalloc, used to allocate the
+scanner itself.
- By default, `YY_EXTRA_TYPE' is defined as type `void *'. You may
-redefine this type using `%option extra-type="your_type"' in the
+ By default, 'YY_EXTRA_TYPE' is defined as type 'void *'. You may
+redefine this type using '%option extra-type="your_type"' in the
scanner:
/* An example of overriding YY_EXTRA_TYPE. */
@@ -3484,13 +3481,13 @@ File: flex.info, Node: About yyscan_t, Prev: Extra Data, Up: Reentrant Detail
19.4.7 About yyscan_t
---------------------
-`yyscan_t' is defined as:
+'yyscan_t' is defined as:
typedef void* yyscan_t;
- It is initialized by `yylex_init()' to point to an internal
-structure. You should never access this value directly. In particular,
-you should never attempt to free it (use `yylex_destroy()' instead.)
+ It is initialized by 'yylex_init()' to point to an internal
+structure. You should never access this value directly. In particular,
+you should never attempt to free it (use 'yylex_destroy()' instead.)

File: flex.info, Node: Reentrant Functions, Prev: Reentrant Detail, Up: Reentrant
@@ -3514,7 +3511,7 @@ The following Functions are available in a reentrant scanner:
void yyset_lineno ( int line_number , yyscan_t scanner );
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t scanner );
- There are no "set" functions for yytext and yyleng. This is
+ There are no "set" functions for yytext and yyleng. This is
intentional.
The following Macro shortcuts are available in actions in a reentrant
@@ -3530,27 +3527,27 @@ scanner:
In a reentrant C scanner, support for yylineno is always present
(i.e., you may access yylineno), but the value is never modified by
-`flex' unless `%option yylineno' is enabled. This is to allow the user
-to maintain the line count independently of `flex'.
+'flex' unless '%option yylineno' is enabled. This is to allow the user
+to maintain the line count independently of 'flex'.
- The following functions and macros are made available when `%option
-bison-bridge' (`--bison-bridge') is specified:
+ The following functions and macros are made available when '%option
+bison-bridge' ('--bison-bridge') is specified:
YYSTYPE * yyget_lval ( yyscan_t scanner );
void yyset_lval ( YYSTYPE * yylvalp , yyscan_t scanner );
yylval
- The following functions and macros are made available when `%option
-bison-locations' (`--bison-locations') is specified:
+ The following functions and macros are made available when '%option
+bison-locations' ('--bison-locations') is specified:
YYLTYPE *yyget_lloc ( yyscan_t scanner );
void yyset_lloc ( YYLTYPE * yyllocp , yyscan_t scanner );
yylloc
- Support for yylval assumes that `YYSTYPE' is a valid type. Support
-for yylloc assumes that `YYSLYPE' is a valid type. Typically, these
-types are generated by `bison', and are included in section 1 of the
-`flex' input.
+ Support for yylval assumes that 'YYSTYPE' is a valid type. Support
+for yylloc assumes that 'YYSLYPE' is a valid type. Typically, these
+types are generated by 'bison', and are included in section 1 of the
+'flex' input.

File: flex.info, Node: Lex and Posix, Next: Memory Management, Prev: Reentrant, Up: Top
@@ -3558,46 +3555,46 @@ File: flex.info, Node: Lex and Posix, Next: Memory Management, Prev: Reentran
20 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
+'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 acceptable to both implementations. `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
+write scanners acceptable to both implementations. '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
+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.
+ * 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
+ * '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.
+ * 'yylineno' is not part of the POSIX specification.
- * The `input()' routine is not redefinable, though it may be called
+ * The 'input()' routine is not redefinable, though it may be called
to read characters following whatever 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'.
+ 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.
+ * Input is instead controlled by defining the 'YY_INPUT()' macro.
- * The `flex' restriction that `input()' cannot be redefined is in
+ * The 'flex' restriction that 'input()' cannot be redefined is in
accordance with the POSIX specification, which simply does not
specify any way of controlling the scanner's input other than by
- making an initial assignment to `yyin'.
+ making an initial assignment to 'yyin'.
- * The `unput()' routine is not redefinable. This restriction is in
+ * The 'unput()' routine is not redefinable. This restriction is in
accordance with POSIX.
- * `flex' scanners are not as reentrant as `lex' scanners. In
+ * 'flex' scanners are not as reentrant as 'lex' scanners. In
particular, if you have an interactive scanner and an interrupt
handler which long-jumps out of the scanner, and the scanner is
subsequently called again, you may get the following message:
@@ -3609,139 +3606,118 @@ exceptions:
yyrestart( yyin );
Note that this call will throw away any buffered input; usually
- this isn't a problem with an interactive scanner. *Note
- Reentrant::, for `flex''s reentrant API.
+ this isn't a problem with an interactive scanner. *Note
+ Reentrant::, for 'flex''s reentrant API.
- * Also note that `flex' C++ scanner classes _are_ reentrant, so if
- using C++ is an option for you, you should use them instead.
- *Note Cxx::, and *note Reentrant:: for details.
+ * Also note that 'flex' C++ scanner classes _are_ reentrant, so if
+ using C++ is an option for you, you should use them instead. *Note
+ Cxx::, and *note Reentrant:: for details.
- * `output()' is not supported. Output from the ECHO macro is done
- to the file-pointer `yyout' (default `stdout)'.
+ * '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.
+ * 'output()' is not part of the POSIX specification.
- * `lex' does not support exclusive start conditions (%x), though they
+ * '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:
+ * 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.
+ 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
+ * 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'
+ the '<s>', '/', and '<<EOF>>' operators cannot be used in a 'flex'
definition.
- * Using `-l' results in the `lex' behavior of no parentheses around
+ * Using '-l' results in the 'lex' behavior of no parentheses 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
+ * Some implementations of 'lex' allow a rule's action to begin on a
separate line, if the rule's pattern has trailing whitespace:
%%
foo|bar<space here>
{ foobar_action();}
- `flex' does not support this feature.
+ 'flex' does not support this feature.
- * The `lex' `%r' (generate a Ratfor scanner) option is not
- supported. It is not part of the POSIX specification.
+ * The 'lex' '%r' (generate a Ratfor scanner) option is not supported.
+ It is not part of the POSIX specification.
- * After a call to `unput()', _yytext_ is undefined until the next
- token is matched, unless the scanner was built using `%array'.
- This is not the case with `lex' or the POSIX specification. The
- `-l' option does away with this incompatibility.
+ * After a call to 'unput()', _yytext_ is undefined until the next
+ token is matched, unless the scanner 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.
- The AT&T and POSIX specifications of `lex' interpret `abc{1,3}' as
- match one, two, or three occurrences of `abc'", whereas `flex'
- interprets it as "match `ab' followed by one, two, or three
- occurrences of `c'". The `-l' and `--posix' options do away with
+ * The precedence of the '{,}' (numeric range) operator is different.
+ The AT&T and POSIX specifications of 'lex' interpret 'abc{1,3}' as
+ match one, two, or three occurrences of 'abc'", whereas 'flex'
+ interprets it as "match 'ab' followed by one, two, or three
+ occurrences of 'c'". The '-l' and '--posix' options do away with
this incompatibility.
- * 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
+ * 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' scanners.. `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', `YY_FLEX_MINOR_VERSION' and
- `YY_FLEX_SUBMINOR_VERSION' indicating which version of `flex'
- generated the scanner. For example, for the 2.5.22 release, these
- defines would be 2, 5 and 22 respectively. If the version of
- `flex' being used is a beta version, then the symbol `FLEX_BETA'
- is defined.
-
- * The symbols `[[' and `]]' in the code sections of the input may
- conflict with the m4 delimiters. *Note M4 Dependency::.
-
-
- The following `flex' features are not included in `lex' or the POSIX
+ * The special table-size declarations such as '%a' supported by 'lex'
+ are not required by 'flex' scanners.. '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', 'YY_FLEX_MINOR_VERSION' and
+ 'YY_FLEX_SUBMINOR_VERSION' indicating which version of 'flex'
+ generated the scanner. For example, for the 2.5.22 release, these
+ defines would be 2, 5 and 22 respectively. If the version of
+ 'flex' being used is a beta version, then the symbol 'FLEX_BETA' is
+ defined.
+
+ * The symbols '[[' and ']]' in the code sections of the input may
+ conflict with the m4 delimiters. *Note M4 Dependency::.
+
+ 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_AT_BOL() <<EOF>>
* <*>
-
* YY_DECL
-
* YY_START
-
* YY_USER_ACTION
-
* YY_USER_INIT
-
* #line directives
-
* %{}'s around actions
-
* reentrant C API
-
* multiple actions on a line
+ * almost all of the 'flex' command-line options
- * almost all of the `flex' command-line options
-
- The feature "multiple actions on a line" 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:
+ The feature "multiple actions on a line" 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;
@@ -3749,7 +3725,7 @@ with semi-colons, while with `lex', the following:
foo handle_foo();
- `flex' does not truncate the action. Actions that are not enclosed
+ 'flex' does not truncate the action. Actions that are not enclosed
in braces are simply terminated at the end of the line.

@@ -3763,9 +3739,9 @@ override the default behavior.
* Menu:
-* The Default Memory Management::
-* Overriding The Default Memory Management::
-* A Note About yytext And Memory::
+* The Default Memory Management::
+* Overriding The Default Memory Management::
+* A Note About yytext And Memory::

File: flex.info, Node: The Default Memory Management, Next: Overriding The Default Memory Management, Prev: Memory Management, Up: Memory Management
@@ -3773,74 +3749,73 @@ File: flex.info, Node: The Default Memory Management, Next: Overriding The Def
21.1 The Default Memory Management
==================================
-Flex allocates dynamic memory during initialization, and once in a
-while from within a call to yylex(). Initialization takes place during
-the first call to yylex(). Thereafter, flex may reallocate more memory
-if it needs to enlarge a buffer. As of version 2.5.9 Flex will clean up
-all memory when you call `yylex_destroy' *Note faq-memory-leak::.
+Flex allocates dynamic memory during initialization, and once in a while
+from within a call to yylex(). Initialization takes place during the
+first call to yylex(). Thereafter, flex may reallocate more memory if
+it needs to enlarge a buffer. As of version 2.5.9 Flex will clean up
+all memory when you call 'yylex_destroy' *Note faq-memory-leak::.
Flex allocates dynamic memory for four purposes, listed below (1)
16kB for the input buffer.
Flex allocates memory for the character buffer used to perform
pattern matching. Flex must read ahead from the input stream and
- store it in a large character buffer. This buffer is typically
- the largest chunk of dynamic memory flex consumes. This buffer
- will grow if necessary, doubling the size each time. Flex frees
- this memory when you call yylex_destroy(). The default size of
- this buffer (16384 bytes) is almost always too large. The ideal
- size for this buffer is the length of the longest token expected,
- in bytes, plus a little more. Flex will allocate a few extra
- bytes for housekeeping. Currently, to override the size of the
- input buffer you must `#define YY_BUF_SIZE' to whatever number of
- bytes you want. We don't plan to change this in the near future,
- but we reserve the right to do so if we ever add a more robust
- memory management API.
+ store it in a large character buffer. This buffer is typically the
+ largest chunk of dynamic memory flex consumes. This buffer will
+ grow if necessary, doubling the size each time. Flex frees this
+ memory when you call yylex_destroy(). The default size of this
+ buffer (16384 bytes) is almost always too large. The ideal size
+ for this buffer is the length of the longest token expected, in
+ bytes, plus a little more. Flex will allocate a few extra bytes
+ for housekeeping. Currently, to override the size of the input
+ buffer you must '#define YY_BUF_SIZE' to whatever number of bytes
+ you want. We don't plan to change this in the near future, but we
+ reserve the right to do so if we ever add a more robust memory
+ management API.
64kb for the REJECT state. This will only be allocated if you use REJECT.
- The size is large enough to hold the same number of states as
- characters in the input buffer. If you override the size of the
- input buffer (via `YY_BUF_SIZE'), then you automatically override
+ The size is large enough to hold the same number of states as
+ characters in the input buffer. If you override the size of the
+ input buffer (via 'YY_BUF_SIZE'), then you automatically override
the size of this buffer as well.
100 bytes for the start condition stack.
- Flex allocates memory for the start condition stack. This is the
+ Flex allocates memory for the start condition stack. This is the
stack used for pushing start states, i.e., with yy_push_state().
It will grow if necessary. Since the states are simply integers,
this stack doesn't consume much memory. This stack is not present
- if `%option stack' is not specified. You will rarely need to tune
- this buffer. The ideal size for this stack is the maximum depth
+ if '%option stack' is not specified. You will rarely need to tune
+ this buffer. The ideal size for this stack is the maximum depth
expected. The memory for this stack is automatically destroyed
- when you call yylex_destroy(). *Note option-stack::.
+ when you call yylex_destroy(). *Note option-stack::.
40 bytes for each YY_BUFFER_STATE.
Flex allocates memory for each YY_BUFFER_STATE. The buffer state
- itself is about 40 bytes, plus an additional large character
- buffer (described above.) The initial buffer state is created
- during initialization, and with each call to yy_create_buffer().
- You can't tune the size of this, but you can tune the character
- buffer as described above. Any buffer state that you explicitly
- create by calling yy_create_buffer() is _NOT_ destroyed
- automatically. You must call yy_delete_buffer() to free the
- memory. The exception to this rule is that flex will delete the
- current buffer automatically when you call yylex_destroy(). If you
- delete the current buffer, be sure to set it to NULL. That way,
- flex will not try to delete the buffer a second time (possibly
- crashing your program!) At the time of this writing, flex does not
- provide a growable stack for the buffer states. You have to
- manage that yourself. *Note Multiple Input Buffers::.
+ itself is about 40 bytes, plus an additional large character buffer
+ (described above.) The initial buffer state is created during
+ initialization, and with each call to yy_create_buffer(). You
+ can't tune the size of this, but you can tune the character buffer
+ as described above. Any buffer state that you explicitly create by
+ calling yy_create_buffer() is _NOT_ destroyed automatically. You
+ must call yy_delete_buffer() to free the memory. The exception to
+ this rule is that flex will delete the current buffer automatically
+ when you call yylex_destroy(). If you delete the current buffer,
+ be sure to set it to NULL. That way, flex will not try to delete
+ the buffer a second time (possibly crashing your program!) At the
+ time of this writing, flex does not provide a growable stack for
+ the buffer states. You have to manage that yourself. *Note
+ Multiple Input Buffers::.
84 bytes for the reentrant scanner guts
Flex allocates about 84 bytes for the reentrant scanner structure
- when you call yylex_init(). It is destroyed when the user calls
+ when you call yylex_init(). It is destroyed when the user calls
yylex_destroy().
-
---------- Footnotes ----------
(1) The quantities given here are approximate, and may vary due to
-host architecture, compiler configuration, or due to future
-enhancements to flex.
+host architecture, compiler configuration, or due to future enhancements
+to flex.

File: flex.info, Node: Overriding The Default Memory Management, Next: A Note About yytext And Memory, Prev: The Default Memory Management, Up: Memory Management
@@ -3848,10 +3823,10 @@ File: flex.info, Node: Overriding The Default Memory Management, Next: A Note
21.2 Overriding The Default Memory Management
=============================================
-Flex calls the functions `yyalloc', `yyrealloc', and `yyfree' when it
-needs to allocate or free memory. By default, these functions are
-wrappers around the standard C functions, `malloc', `realloc', and
-`free', respectively. You can override the default implementations by
+Flex calls the functions 'yyalloc', 'yyrealloc', and 'yyfree' when it
+needs to allocate or free memory. By default, these functions are
+wrappers around the standard C functions, 'malloc', 'realloc', and
+'free', respectively. You can override the default implementations by
telling flex that you will provide your own implementations.
To override the default implementations, you must do two things:
@@ -3859,11 +3834,9 @@ telling flex that you will provide your own implementations.
1. Suppress the default implementations by specifying one or more of
the following options:
- * `%option noyyalloc'
-
- * `%option noyyrealloc'
-
- * `%option noyyfree'.
+ * '%option noyyalloc'
+ * '%option noyyrealloc'
+ * '%option noyyfree'.
2. Provide your own implementation of the following functions: (1)
@@ -3877,12 +3850,10 @@ telling flex that you will provide your own implementations.
void * yyrealloc (void * ptr, size_t bytes, void * yyscanner);
void yyfree (void * ptr, void * yyscanner);
-
- In the following example, we will override all three memory
-routines. We assume that there is a custom allocator with garbage
-collection. In order to make this example interesting, we will use a
-reentrant scanner, passing a pointer to the custom allocator through
-`yyextra'.
+ In the following example, we will override all three memory routines.
+We assume that there is a custom allocator with garbage collection. In
+order to make this example interesting, we will use a reentrant scanner,
+passing a pointer to the custom allocator through 'yyextra'.
%{
#include "some_allocator.h"
@@ -3893,8 +3864,10 @@ reentrant scanner, passing a pointer to the custom allocator through
%option reentrant
/* Initialize the allocator. */
+ %{
#define YY_EXTRA_TYPE struct allocator*
#define YY_USER_INIT yyextra = allocator_create();
+ %}
%%
.|\n ;
@@ -3913,11 +3886,12 @@ reentrant scanner, passing a pointer to the custom allocator through
/* Do nothing -- we leave it to the garbage collector. */
}
+
---------- Footnotes ----------
(1) It is not necessary to override all (or any) of the memory
-management routines. You may, for example, override `yyrealloc', but
-not `yyfree' or `yyalloc'.
+management routines. You may, for example, override 'yyrealloc', but
+not 'yyfree' or 'yyalloc'.

File: flex.info, Node: A Note About yytext And Memory, Prev: Overriding The Default Memory Management, Up: Memory Management
@@ -3925,24 +3899,24 @@ File: flex.info, Node: A Note About yytext And Memory, Prev: Overriding The De
21.3 A Note About yytext And Memory
===================================
-When flex finds a match, `yytext' points to the first character of the
-match in the input buffer. The string itself is part of the input
-buffer, and is _NOT_ allocated separately. The value of yytext will be
-overwritten the next time yylex() is called. In short, the value of
+When flex finds a match, 'yytext' points to the first character of the
+match in the input buffer. The string itself is part of the input
+buffer, and is _NOT_ allocated separately. The value of yytext will be
+overwritten the next time yylex() is called. In short, the value of
yytext is only valid from within the matched rule's action.
Often, you want the value of yytext to persist for later processing,
-i.e., by a parser with non-zero lookahead. In order to preserve yytext,
-you will have to copy it with strdup() or a similar function. But this
+i.e., by a parser with non-zero lookahead. In order to preserve yytext,
+you will have to copy it with strdup() or a similar function. But this
introduces some headache because your parser is now responsible for
-freeing the copy of yytext. If you use a yacc or bison parser,
+freeing the copy of yytext. If you use a yacc or bison parser,
(commonly used with flex), you will discover that the error recovery
mechanisms can cause memory to be leaked.
To prevent memory leaks from strdup'd yytext, you will have to track
-the memory somehow. Our experience has shown that a garbage collection
-mechanism or a pooled memory mechanism will save you a lot of grief
-when writing parsers.
+the memory somehow. Our experience has shown that a garbage collection
+mechanism or a pooled memory mechanism will save you a lot of grief when
+writing parsers.

File: flex.info, Node: Serialized Tables, Next: Diagnostics, Prev: Memory Management, Up: Top
@@ -3950,24 +3924,24 @@ File: flex.info, Node: Serialized Tables, Next: Diagnostics, Prev: Memory Man
22 Serialized Tables
********************
-A `flex' scanner has the ability to save the DFA tables to a file, and
-load them at runtime when needed. The motivation for this feature is
-to reduce the runtime memory footprint. Traditionally, these tables
-have been compiled into the scanner as C arrays, and are sometimes
-quite large. Since the tables are compiled into the scanner, the
-memory used by the tables can never be freed. This is a waste of
-memory, especially if an application uses several scanners, but none of
-them at the same time.
+A 'flex' scanner has the ability to save the DFA tables to a file, and
+load them at runtime when needed. The motivation for this feature is to
+reduce the runtime memory footprint. Traditionally, these tables have
+been compiled into the scanner as C arrays, and are sometimes quite
+large. Since the tables are compiled into the scanner, the memory used
+by the tables can never be freed. This is a waste of memory, especially
+if an application uses several scanners, but none of them at the same
+time.
The serialization feature allows the tables to be loaded at runtime,
-before scanning begins. The tables may be discarded when scanning is
+before scanning begins. The tables may be discarded when scanning is
finished.
* Menu:
-* Creating Serialized Tables::
-* Loading and Unloading Serialized Tables::
-* Tables File Format::
+* Creating Serialized Tables::
+* Loading and Unloading Serialized Tables::
+* Tables File Format::

File: flex.info, Node: Creating Serialized Tables, Next: Loading and Unloading Serialized Tables, Prev: Serialized Tables, Up: Serialized Tables
@@ -3982,29 +3956,29 @@ You may create a scanner with serialized tables by specifying:
--tables-file=FILE
These options instruct flex to save the DFA tables to the file FILE.
-The tables will _not_ be embedded in the generated scanner. The scanner
-will not function on its own. The scanner will be dependent upon the
-serialized tables. You must load the tables from this file at runtime
+The tables will _not_ be embedded in the generated scanner. The scanner
+will not function on its own. The scanner will be dependent upon the
+serialized tables. You must load the tables from this file at runtime
before you can scan anything.
- If you do not specify a filename to `--tables-file', the tables will
-be saved to `lex.yy.tables', where `yy' is the appropriate prefix.
+ If you do not specify a filename to '--tables-file', the tables will
+be saved to 'lex.yy.tables', where 'yy' is the appropriate prefix.
If your project uses several different scanners, you can concatenate
the serialized tables into one file, and flex will find the correct set
-of tables, using the scanner prefix as part of the lookup key. An
+of tables, using the scanner prefix as part of the lookup key. An
example follows:
$ flex --tables-file --prefix=cpp cpp.l
$ flex --tables-file --prefix=c c.l
$ cat lex.cpp.tables lex.c.tables > all.tables
- The above example created two scanners, `cpp', and `c'. Since we did
-not specify a filename, the tables were serialized to `lex.c.tables' and
-`lex.cpp.tables', respectively. Then, we concatenated the two files
-together into `all.tables', which we will distribute with our project.
+ The above example created two scanners, 'cpp', and 'c'. Since we did
+not specify a filename, the tables were serialized to 'lex.c.tables' and
+'lex.cpp.tables', respectively. Then, we concatenated the two files
+together into 'all.tables', which we will distribute with our project.
At runtime, we will open the file and tell flex to load the tables from
-it. Flex will find the correct tables automatically. (See next
+it. Flex will find the correct tables automatically. (See next
section).

@@ -4013,33 +3987,33 @@ File: flex.info, Node: Loading and Unloading Serialized Tables, Next: Tables F
22.2 Loading and Unloading Serialized Tables
============================================
-If you've built your scanner with `%option tables-file', then you must
-load the scanner tables at runtime. This can be accomplished with the
+If you've built your scanner with '%option tables-file', then you must
+load the scanner tables at runtime. This can be accomplished with the
following function:
-- Function: int yytables_fload (FILE* FP [, yyscan_t SCANNER])
Locates scanner tables in the stream pointed to by FP and loads
- them. Memory for the tables is allocated via `yyalloc'. You must
- call this function before the first call to `yylex'. The argument
+ them. Memory for the tables is allocated via 'yyalloc'. You must
+ call this function before the first call to 'yylex'. The argument
SCANNER only appears in the reentrant scanner. This function
- returns `0' (zero) on success, or non-zero on error.
+ returns '0' (zero) on success, or non-zero on error.
The loaded tables are *not* automatically destroyed (unloaded) when
-you call `yylex_destroy'. The reason is that you may create several
+you call 'yylex_destroy'. The reason is that you may create several
scanners of the same type (in a reentrant scanner), each of which needs
-access to these tables. To avoid a nasty memory leak, you must call
-the following function:
+access to these tables. To avoid a nasty memory leak, you must call the
+following function:
-- Function: int yytables_destroy ([yyscan_t SCANNER])
- Unloads the scanner tables. The tables must be loaded again before
+ Unloads the scanner tables. The tables must be loaded again before
you can scan any more data. The argument SCANNER only appears in
- the reentrant scanner. This function returns `0' (zero) on
+ the reentrant scanner. This function returns '0' (zero) on
success, or non-zero on error.
- *The functions `yytables_fload' and `yytables_destroy' are not
-thread-safe.* You must ensure that these functions are called exactly
+ *The functions 'yytables_fload' and 'yytables_destroy' are not
+thread-safe.* You must ensure that these functions are called exactly
once (for each scanner type) in a threaded program, before any thread
-calls `yylex'. After the tables are loaded, they are never written to,
+calls 'yylex'. After the tables are loaded, they are never written to,
and no thread protection is required thereafter - until you destroy
them.
@@ -4049,11 +4023,11 @@ File: flex.info, Node: Tables File Format, Prev: Loading and Unloading Seriali
22.3 Tables File Format
=======================
-This section defines the file format of serialized `flex' tables.
+This section defines the file format of serialized 'flex' tables.
The tables format allows for one or more sets of tables to be
-specified, where each set corresponds to a given scanner. Scanners are
-indexed by name, as described below. The file format is as follows:
+specified, where each set corresponds to a given scanner. Scanners are
+indexed by name, as described below. The file format is as follows:
TABLE SET 1
+-------------------------------+
@@ -4086,147 +4060,131 @@ indexed by name, as described below. The file format is as follows:
TABLE SET N
The above diagram shows that a complete set of tables consists of a
-header followed by multiple individual tables. Furthermore, multiple
+header followed by multiple individual tables. Furthermore, multiple
complete sets may be present in the same file, each set with its own
-header and tables. The sets are contiguous in the file. The only way to
-know if another set follows is to check the next four bytes for the
+header and tables. The sets are contiguous in the file. The only way
+to know if another set follows is to check the next four bytes for the
magic number (or check for EOF). The header and tables sections are
-padded to 64-bit boundaries. Below we describe each field in detail.
-This format does not specify how the scanner will expand the given
-data, i.e., data may be serialized as int8, but expanded to an int32
-array at runtime. This is to reduce the size of the serialized data
-where possible. Remember, _all integer values are in network byte
-order_.
+padded to 64-bit boundaries. Below we describe each field in detail.
+This format does not specify how the scanner will expand the given data,
+i.e., data may be serialized as int8, but expanded to an int32 array at
+runtime. This is to reduce the size of the serialized data where
+possible. Remember, _all integer values are in network byte order_.
Fields of a table header:
-`th_magic'
+'th_magic'
Magic number, always 0xF13C57B1.
-`th_hsize'
- Size of this entire header, in bytes, including all fields plus
- any padding.
+'th_hsize'
+ Size of this entire header, in bytes, including all fields plus any
+ padding.
-`th_ssize'
+'th_ssize'
Size of this entire set, in bytes, including the header, all
tables, plus any padding.
-`th_flags'
- Bit flags for this table set. Currently unused.
+'th_flags'
+ Bit flags for this table set. Currently unused.
-`th_version[]'
- Flex version in NULL-terminated string format. e.g., `2.5.13a'.
+'th_version[]'
+ Flex version in NULL-terminated string format. e.g., '2.5.13a'.
This is the version of flex that was used to create the serialized
tables.
-`th_name[]'
- Contains the name of this table set. The default is `yytables',
- and is prefixed accordingly, e.g., `footables'. Must be
+'th_name[]'
+ Contains the name of this table set. The default is 'yytables',
+ and is prefixed accordingly, e.g., 'footables'. Must be
NULL-terminated.
-`th_pad64[]'
+'th_pad64[]'
Zero or more NULL bytes, padding the entire header to the next
64-bit boundary as calculated from the beginning of the header.
Fields of a table:
-`td_id'
- Specifies the table identifier. Possible values are:
- `YYTD_ID_ACCEPT (0x01)'
- `yy_accept'
-
- `YYTD_ID_BASE (0x02)'
- `yy_base'
-
- `YYTD_ID_CHK (0x03)'
- `yy_chk'
-
- `YYTD_ID_DEF (0x04)'
- `yy_def'
-
- `YYTD_ID_EC (0x05)'
- `yy_ec '
-
- `YYTD_ID_META (0x06)'
- `yy_meta'
-
- `YYTD_ID_NUL_TRANS (0x07)'
- `yy_NUL_trans'
-
- `YYTD_ID_NXT (0x08)'
- `yy_nxt'. This array may be two dimensional. See the
- `td_hilen' field below.
-
- `YYTD_ID_RULE_CAN_MATCH_EOL (0x09)'
- `yy_rule_can_match_eol'
-
- `YYTD_ID_START_STATE_LIST (0x0A)'
- `yy_start_state_list'. This array is handled specially
- because it is an array of pointers to structs. See the
- `td_flags' field below.
-
- `YYTD_ID_TRANSITION (0x0B)'
- `yy_transition'. This array is handled specially because it
- is an array of structs. See the `td_lolen' field below.
-
- `YYTD_ID_ACCLIST (0x0C)'
- `yy_acclist'
-
-`td_flags'
- Bit flags describing how to interpret the data in `td_data'. The
+'td_id'
+ Specifies the table identifier. Possible values are:
+ 'YYTD_ID_ACCEPT (0x01)'
+ 'yy_accept'
+ 'YYTD_ID_BASE (0x02)'
+ 'yy_base'
+ 'YYTD_ID_CHK (0x03)'
+ 'yy_chk'
+ 'YYTD_ID_DEF (0x04)'
+ 'yy_def'
+ 'YYTD_ID_EC (0x05)'
+ 'yy_ec '
+ 'YYTD_ID_META (0x06)'
+ 'yy_meta'
+ 'YYTD_ID_NUL_TRANS (0x07)'
+ 'yy_NUL_trans'
+ 'YYTD_ID_NXT (0x08)'
+ 'yy_nxt'. This array may be two dimensional. See the
+ 'td_hilen' field below.
+ 'YYTD_ID_RULE_CAN_MATCH_EOL (0x09)'
+ 'yy_rule_can_match_eol'
+ 'YYTD_ID_START_STATE_LIST (0x0A)'
+ 'yy_start_state_list'. This array is handled specially
+ because it is an array of pointers to structs. See the
+ 'td_flags' field below.
+ 'YYTD_ID_TRANSITION (0x0B)'
+ 'yy_transition'. This array is handled specially because it
+ is an array of structs. See the 'td_lolen' field below.
+ 'YYTD_ID_ACCLIST (0x0C)'
+ 'yy_acclist'
+
+'td_flags'
+ Bit flags describing how to interpret the data in 'td_data'. The
data arrays are one-dimensional by default, but may be two
- dimensional as specified in the `td_hilen' field.
+ dimensional as specified in the 'td_hilen' field.
- `YYTD_DATA8 (0x01)'
+ 'YYTD_DATA8 (0x01)'
The data is serialized as an array of type int8.
-
- `YYTD_DATA16 (0x02)'
+ 'YYTD_DATA16 (0x02)'
The data is serialized as an array of type int16.
-
- `YYTD_DATA32 (0x04)'
+ 'YYTD_DATA32 (0x04)'
The data is serialized as an array of type int32.
-
- `YYTD_PTRANS (0x08)'
+ 'YYTD_PTRANS (0x08)'
The data is a list of indexes of entries in the expanded
- `yy_transition' array. Each index should be expanded to a
- pointer to the corresponding entry in the `yy_transition'
- array. We count on the fact that the `yy_transition' array
+ 'yy_transition' array. Each index should be expanded to a
+ pointer to the corresponding entry in the 'yy_transition'
+ array. We count on the fact that the 'yy_transition' array
has already been seen.
-
- `YYTD_STRUCT (0x10)'
+ 'YYTD_STRUCT (0x10)'
The data is a list of yy_trans_info structs, each of which
- consists of two integers. There is no padding between struct
+ consists of two integers. There is no padding between struct
elements or between structs. The type of each member is
- determined by the `YYTD_DATA*' bits.
+ determined by the 'YYTD_DATA*' bits.
-`td_hilen'
- If `td_hilen' is non-zero, then the data is a two-dimensional
- array. Otherwise, the data is a one-dimensional array. `td_hilen'
+'td_hilen'
+ If 'td_hilen' is non-zero, then the data is a two-dimensional
+ array. Otherwise, the data is a one-dimensional array. 'td_hilen'
contains the number of elements in the higher dimensional array,
- and `td_lolen' contains the number of elements in the lowest
+ and 'td_lolen' contains the number of elements in the lowest
dimension.
- Conceptually, `td_data' is either `sometype td_data[td_lolen]', or
- `sometype td_data[td_hilen][td_lolen]', where `sometype' is
- specified by the `td_flags' field. It is possible for both
- `td_lolen' and `td_hilen' to be zero, in which case `td_data' is a
+ Conceptually, 'td_data' is either 'sometype td_data[td_lolen]', or
+ 'sometype td_data[td_hilen][td_lolen]', where 'sometype' is
+ specified by the 'td_flags' field. It is possible for both
+ 'td_lolen' and 'td_hilen' to be zero, in which case 'td_data' is a
zero length array, and no data is loaded, i.e., this table is
- simply skipped. Flex does not currently generate tables of zero
+ simply skipped. Flex does not currently generate tables of zero
length.
-`td_lolen'
- Specifies the number of elements in the lowest dimension array. If
+'td_lolen'
+ Specifies the number of elements in the lowest dimension array. If
this is a one-dimensional array, then it is simply the number of
elements in this array. The element size is determined by the
- `td_flags' field.
+ 'td_flags' field.
-`td_data[]'
- The table data. This array may be a one- or two-dimensional array,
- of type `int8', `int16', `int32', `struct yy_trans_info', or
- `struct yy_trans_info*', depending upon the values in the
- `td_flags', `td_hilen', and `td_lolen' fields.
+'td_data[]'
+ The table data. This array may be a one- or two-dimensional array,
+ of type 'int8', 'int16', 'int32', 'struct yy_trans_info', or
+ 'struct yy_trans_info*', depending upon the values in the
+ 'td_flags', 'td_hilen', and 'td_lolen' fields.
-`td_pad64[]'
+'td_pad64[]'
Zero or more NULL bytes, padding the entire table to the next
64-bit boundary as calculated from the beginning of this table.
@@ -4236,71 +4194,70 @@ File: flex.info, Node: Diagnostics, Next: Limitations, Prev: Serialized Table
23 Diagnostics
**************
-The following is a list of `flex' diagnostic messages:
+The following is a list of 'flex' diagnostic messages:
- * `warning, rule cannot be matched' indicates that the given rule
+ * '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 example, in the following `foo'
+ match the same text as it. For example, 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.
+ Using 'REJECT' in a scanner suppresses this warning.
- * `warning, -s option given but default rule can be matched' means
+ * '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,
+ 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 scanner uses `REJECT' or
- `yymore()' but that `flex' failed to notice the fact, meaning that
- `flex' scanned the first two sections looking for occurrences of
+ * 'reject_used_but_not_detected undefined' or
+ 'yymore_used_but_not_detected undefined'. These errors can occur
+ at compile time. They indicate that the scanner 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.
+ (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
+ * '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 definitions section of your `flex'
- input.
+ * '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 definitions 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
+ * '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, *note Scanner
+ 7-bit because you used the '-Cf' or '-CF' table compression
+ options. See the discussion of the '-7' flag, *note Scanner
Options::, for details.
- * `flex scanner push-back overflow'. you used `unput()' to push back
+ * '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
+ 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
+ * 'input buffer overflow, can't enlarge buffer because scanner uses
REJECT'. the scanner was working on matching an extremely large
token and needed to expand the input buffer. This doesn't work
- with scanners that use `REJECT'.
+ with scanners that use 'REJECT'.
- * `fatal flex scanner internal error--end of buffer missed'. This can
- occur in a scanner which is reentered after a long-jump has jumped
- out (or over) the scanner's activation frame. Before reentering
- the scanner, use:
+ * 'fatal flex scanner internal error--end of buffer missed'. This
+ can occur in a scanner which is reentered after a long-jump has
+ jumped out (or over) the scanner's activation 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
+ * '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).
@@ -4311,38 +4268,38 @@ File: flex.info, Node: Limitations, Next: Bibliography, Prev: Diagnostics, U
**************
Some trailing context patterns cannot be properly matched and generate
-warning messages (`dangerous trailing context'). These are patterns
+warning messages ('dangerous trailing 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 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 actually 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 example, in
-the following:
+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 example, 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
+ 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 cannot intermix calls to
-`<stdio.h>' routines, such as, 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
+'<stdio.h>' routines, such as, 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.
+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.
+ The 'flex' internal algorithms need documentation.

File: flex.info, Node: Bibliography, Next: FAQ, Prev: Limitations, Up: Top
@@ -4352,11 +4309,8 @@ File: flex.info, Node: Bibliography, Next: FAQ, Prev: Limitations, Up: Top
You may wish to read more about the following programs:
* lex
-
* yacc
-
* sed
-
* awk
The following books may contain material of interest:
@@ -4368,7 +4322,7 @@ Associates. Be sure to get the 2nd edition.
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
+pattern-matching techniques used by 'flex' (deterministic finite
automata).

@@ -4377,111 +4331,111 @@ File: flex.info, Node: FAQ, Next: Appendices, Prev: Bibliography, Up: Top
FAQ
***
-From time to time, the `flex' maintainer receives certain questions.
+From time to time, the 'flex' maintainer receives certain questions.
Rather than repeat answers to well-understood problems, we publish them
here.
* Menu:
-* When was flex born?::
-* How do I expand backslash-escape sequences in C-style quoted strings?::
-* Why do flex scanners call fileno if it is not ANSI compatible?::
-* Does flex support recursive pattern definitions?::
-* How do I skip huge chunks of input (tens of megabytes) while using flex?::
-* Flex is not matching my patterns in the same order that I defined them.::
-* My actions are executing out of order or sometimes not at all.::
-* How can I have multiple input sources feed into the same scanner at the same time?::
-* Can I build nested parsers that work with the same input file?::
-* How can I match text only at the end of a file?::
-* How can I make REJECT cascade across start condition boundaries?::
-* Why cant I use fast or full tables with interactive mode?::
-* How much faster is -F or -f than -C?::
-* If I have a simple grammar cant I just parse it with flex?::
-* Why doesn't yyrestart() set the start state back to INITIAL?::
-* How can I match C-style comments?::
-* The period isn't working the way I expected.::
-* Can I get the flex manual in another format?::
-* Does there exist a "faster" NDFA->DFA algorithm?::
-* How does flex compile the DFA so quickly?::
-* How can I use more than 8192 rules?::
-* How do I abandon a file in the middle of a scan and switch to a new file?::
-* How do I execute code only during initialization (only before the first scan)?::
-* How do I execute code at termination?::
-* Where else can I find help?::
-* Can I include comments in the "rules" section of the file?::
-* I get an error about undefined yywrap().::
-* How can I change the matching pattern at run time?::
-* How can I expand macros in the input?::
-* How can I build a two-pass scanner?::
-* How do I match any string not matched in the preceding rules?::
-* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
-* Is there a way to make flex treat NULL like a regular character?::
-* Whenever flex can not match the input it says "flex scanner jammed".::
-* Why doesn't flex have non-greedy operators like perl does?::
-* Memory leak - 16386 bytes allocated by malloc.::
-* How do I track the byte offset for lseek()?::
-* How do I use my own I/O classes in a C++ scanner?::
-* How do I skip as many chars as possible?::
-* deleteme00::
-* Are certain equivalent patterns faster than others?::
-* Is backing up a big deal?::
-* Can I fake multi-byte character support?::
-* deleteme01::
-* Can you discuss some flex internals?::
-* unput() messes up yy_at_bol::
-* The | operator is not doing what I want::
-* Why can't flex understand this variable trailing context pattern?::
-* The ^ operator isn't working::
-* Trailing context is getting confused with trailing optional patterns::
-* Is flex GNU or not?::
-* ERASEME53::
-* I need to scan if-then-else blocks and while loops::
-* ERASEME55::
-* ERASEME56::
-* ERASEME57::
-* Is there a repository for flex scanners?::
-* How can I conditionally compile or preprocess my flex input file?::
-* Where can I find grammars for lex and yacc?::
-* I get an end-of-buffer message for each character scanned.::
-* unnamed-faq-62::
-* unnamed-faq-63::
-* unnamed-faq-64::
-* unnamed-faq-65::
-* unnamed-faq-66::
-* unnamed-faq-67::
-* unnamed-faq-68::
-* unnamed-faq-69::
-* unnamed-faq-70::
-* unnamed-faq-71::
-* unnamed-faq-72::
-* unnamed-faq-73::
-* unnamed-faq-74::
-* unnamed-faq-75::
-* unnamed-faq-76::
-* unnamed-faq-77::
-* unnamed-faq-78::
-* unnamed-faq-79::
-* unnamed-faq-80::
-* unnamed-faq-81::
-* unnamed-faq-82::
-* unnamed-faq-83::
-* unnamed-faq-84::
-* unnamed-faq-85::
-* unnamed-faq-86::
-* unnamed-faq-87::
-* unnamed-faq-88::
-* unnamed-faq-90::
-* unnamed-faq-91::
-* unnamed-faq-92::
-* unnamed-faq-93::
-* unnamed-faq-94::
-* unnamed-faq-95::
-* unnamed-faq-96::
-* unnamed-faq-97::
-* unnamed-faq-98::
-* unnamed-faq-99::
-* unnamed-faq-100::
-* unnamed-faq-101::
+* When was flex born?::
+* How do I expand backslash-escape sequences in C-style quoted strings?::
+* Why do flex scanners call fileno if it is not ANSI compatible?::
+* Does flex support recursive pattern definitions?::
+* How do I skip huge chunks of input (tens of megabytes) while using flex?::
+* Flex is not matching my patterns in the same order that I defined them.::
+* My actions are executing out of order or sometimes not at all.::
+* How can I have multiple input sources feed into the same scanner at the same time?::
+* Can I build nested parsers that work with the same input file?::
+* How can I match text only at the end of a file?::
+* How can I make REJECT cascade across start condition boundaries?::
+* Why cant I use fast or full tables with interactive mode?::
+* How much faster is -F or -f than -C?::
+* If I have a simple grammar cant I just parse it with flex?::
+* Why doesn't yyrestart() set the start state back to INITIAL?::
+* How can I match C-style comments?::
+* The period isn't working the way I expected.::
+* Can I get the flex manual in another format?::
+* Does there exist a "faster" NDFA->DFA algorithm?::
+* How does flex compile the DFA so quickly?::
+* How can I use more than 8192 rules?::
+* How do I abandon a file in the middle of a scan and switch to a new file?::
+* How do I execute code only during initialization (only before the first scan)?::
+* How do I execute code at termination?::
+* Where else can I find help?::
+* Can I include comments in the "rules" section of the file?::
+* I get an error about undefined yywrap().::
+* How can I change the matching pattern at run time?::
+* How can I expand macros in the input?::
+* How can I build a two-pass scanner?::
+* How do I match any string not matched in the preceding rules?::
+* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
+* Is there a way to make flex treat NULL like a regular character?::
+* Whenever flex can not match the input it says "flex scanner jammed".::
+* Why doesn't flex have non-greedy operators like perl does?::
+* Memory leak - 16386 bytes allocated by malloc.::
+* How do I track the byte offset for lseek()?::
+* How do I use my own I/O classes in a C++ scanner?::
+* How do I skip as many chars as possible?::
+* deleteme00::
+* Are certain equivalent patterns faster than others?::
+* Is backing up a big deal?::
+* Can I fake multi-byte character support?::
+* deleteme01::
+* Can you discuss some flex internals?::
+* unput() messes up yy_at_bol::
+* The | operator is not doing what I want::
+* Why can't flex understand this variable trailing context pattern?::
+* The ^ operator isn't working::
+* Trailing context is getting confused with trailing optional patterns::
+* Is flex GNU or not?::
+* ERASEME53::
+* I need to scan if-then-else blocks and while loops::
+* ERASEME55::
+* ERASEME56::
+* ERASEME57::
+* Is there a repository for flex scanners?::
+* How can I conditionally compile or preprocess my flex input file?::
+* Where can I find grammars for lex and yacc?::
+* I get an end-of-buffer message for each character scanned.::
+* unnamed-faq-62::
+* unnamed-faq-63::
+* unnamed-faq-64::
+* unnamed-faq-65::
+* unnamed-faq-66::
+* unnamed-faq-67::
+* unnamed-faq-68::
+* unnamed-faq-69::
+* unnamed-faq-70::
+* unnamed-faq-71::
+* unnamed-faq-72::
+* unnamed-faq-73::
+* unnamed-faq-74::
+* unnamed-faq-75::
+* unnamed-faq-76::
+* unnamed-faq-77::
+* unnamed-faq-78::
+* unnamed-faq-79::
+* unnamed-faq-80::
+* unnamed-faq-81::
+* unnamed-faq-82::
+* unnamed-faq-83::
+* unnamed-faq-84::
+* unnamed-faq-85::
+* unnamed-faq-86::
+* unnamed-faq-87::
+* unnamed-faq-88::
+* unnamed-faq-90::
+* unnamed-faq-91::
+* unnamed-faq-92::
+* unnamed-faq-93::
+* unnamed-faq-94::
+* unnamed-faq-95::
+* unnamed-faq-96::
+* unnamed-faq-97::
+* unnamed-faq-98::
+* unnamed-faq-99::
+* unnamed-faq-100::
+* unnamed-faq-101::
* What is the difference between YYLEX_PARAM and YY_DECL?::
* Why do I get "conflicting types for yylex" error?::
* How do I access the values set in a Flex action from within a Bison action?::
@@ -4492,9 +4446,9 @@ File: flex.info, Node: When was flex born?, Next: How do I expand backslash-es
When was flex born?
===================
-Vern Paxson took over the `Software Tools' lex project from Jef
-Poskanzer in 1982. At that point it was written in Ratfor. Around
-1987 or so, Paxson translated it into C, and a legend was born :-).
+Vern Paxson took over the 'Software Tools' lex project from Jef
+Poskanzer in 1982. At that point it was written in Ratfor. Around 1987
+or so, Paxson translated it into C, and a legend was born :-).

File: flex.info, Node: How do I expand backslash-escape sequences in C-style quoted strings?, Next: Why do flex scanners call fileno if it is not ANSI compatible?, Prev: When was flex born?, Up: FAQ
@@ -4504,19 +4458,19 @@ How do I expand backslash-escape sequences in C-style quoted strings?
A key point when scanning quoted strings is that you cannot (easily)
write a single rule that will precisely match the string if you allow
-things like embedded escape sequences and newlines. If you try to
-match strings with a single rule then you'll wind up having to rescan
-the string anyway to find any escape sequences.
+things like embedded escape sequences and newlines. If you try to match
+strings with a single rule then you'll wind up having to rescan the
+string anyway to find any escape sequences.
Instead you can use exclusive start conditions and a set of rules,
-one for matching non-escaped text, one for matching a single escape,
-one for matching an embedded newline, and one for recognizing the end
-of the string. Each of these rules is then faced with the question of
-where to put its intermediary results. The best solution is for the
-rules to append their local value of `yytext' to the end of a "string
-literal" buffer. A rule like the escape-matcher will append to the
-buffer the meaning of the escape sequence rather than the literal text
-in `yytext'. In this way, `yytext' does not need to be modified at all.
+one for matching non-escaped text, one for matching a single escape, one
+for matching an embedded newline, and one for recognizing the end of the
+string. Each of these rules is then faced with the question of where to
+put its intermediary results. The best solution is for the rules to
+append their local value of 'yytext' to the end of a "string literal"
+buffer. A rule like the escape-matcher will append to the buffer the
+meaning of the escape sequence rather than the literal text in 'yytext'.
+In this way, 'yytext' does not need to be modified at all.

File: flex.info, Node: Why do flex scanners call fileno if it is not ANSI compatible?, Next: Does flex support recursive pattern definitions?, Prev: How do I expand backslash-escape sequences in C-style quoted strings?, Up: FAQ
@@ -4524,13 +4478,13 @@ File: flex.info, Node: Why do flex scanners call fileno if it is not ANSI compa
Why do flex scanners call fileno if it is not ANSI compatible?
==============================================================
-Flex scanners call `fileno()' in order to get the file descriptor
-corresponding to `yyin'. The file descriptor may be passed to
-`isatty()' or `read()', depending upon which `%options' you specified.
-If your system does not have `fileno()' support, to get rid of the
-`read()' call, do not specify `%option read'. To get rid of the
-`isatty()' call, you must specify one of `%option always-interactive' or
-`%option never-interactive'.
+Flex scanners call 'fileno()' in order to get the file descriptor
+corresponding to 'yyin'. The file descriptor may be passed to
+'isatty()' or 'read()', depending upon which '%options' you specified.
+If your system does not have 'fileno()' support, to get rid of the
+'read()' call, do not specify '%option read'. To get rid of the
+'isatty()' call, you must specify one of '%option always-interactive' or
+'%option never-interactive'.

File: flex.info, Node: Does flex support recursive pattern definitions?, Next: How do I skip huge chunks of input (tens of megabytes) while using flex?, Prev: Why do flex scanners call fileno if it is not ANSI compatible?, Up: FAQ
@@ -4543,13 +4497,13 @@ e.g.,
%%
block "{"({block}|{statement})*"}"
- No. You cannot have recursive definitions. The pattern-matching
+ No. You cannot have recursive definitions. The pattern-matching
power of regular expressions in general (and therefore flex scanners,
too) is limited. In particular, regular expressions cannot "balance"
parentheses to an arbitrary degree. For example, it's impossible to
write a regular expression that matches all strings containing the same
number of '{'s as '}'s. For more powerful pattern matching, you need a
-parser, such as `GNU bison'.
+parser, such as 'GNU bison'.

File: flex.info, Node: How do I skip huge chunks of input (tens of megabytes) while using flex?, Next: Flex is not matching my patterns in the same order that I defined them., Prev: Does flex support recursive pattern definitions?, Up: FAQ
@@ -4557,7 +4511,7 @@ File: flex.info, Node: How do I skip huge chunks of input (tens of megabytes) w
How do I skip huge chunks of input (tens of megabytes) while using flex?
========================================================================
-Use `fseek()' (or `lseek()') to position yyin, then call `yyrestart()'.
+Use 'fseek()' (or 'lseek()') to position yyin, then call 'yyrestart()'.

File: flex.info, Node: Flex is not matching my patterns in the same order that I defined them., Next: My actions are executing out of order or sometimes not at all., Prev: How do I skip huge chunks of input (tens of megabytes) while using flex?, Up: FAQ
@@ -4565,32 +4519,32 @@ File: flex.info, Node: Flex is not matching my patterns in the same order that
Flex is not matching my patterns in the same order that I defined them.
=======================================================================
-`flex' picks the rule that matches the most text (i.e., the longest
-possible input string). This is because `flex' uses an entirely
+'flex' picks the rule that matches the most text (i.e., the longest
+possible input string). This is because 'flex' uses an entirely
different matching technique ("deterministic finite automata") that
actually does all of the matching simultaneously, in parallel. (Seems
impossible, but it's actually a fairly simple technique once you
understand the principles.)
A side-effect of this parallel matching is that when the input
-matches more than one rule, `flex' scanners pick the rule that matched
-the _most_ text. This is explained further in the manual, in the
+matches more than one rule, 'flex' scanners pick the rule that matched
+the _most_ text. This is explained further in the manual, in the
section *Note Matching::.
- If you want `flex' to choose a shorter match, then you can work
+ If you want 'flex' to choose a shorter match, then you can work
around this behavior by expanding your short rule to match more text,
then put back the extra:
data_.* yyless( 5 ); BEGIN BLOCKIDSTATE;
Another fix would be to make the second rule active only during the
-`<BLOCKIDSTATE>' start condition, and make that start condition
-exclusive by declaring it with `%x' instead of `%s'.
+'<BLOCKIDSTATE>' start condition, and make that start condition
+exclusive by declaring it with '%x' instead of '%s'.
A final fix is to change the input language so that the ambiguity for
-`data_' is removed, by adding characters to it that don't match the
-identifier rule, or by removing characters (such as `_') from the
-identifier rule so it no longer matches `data_'. (Of course, you might
+'data_' is removed, by adding characters to it that don't match the
+identifier rule, or by removing characters (such as '_') from the
+identifier rule so it no longer matches 'data_'. (Of course, you might
also not have the option of changing the input language.)

@@ -4599,7 +4553,7 @@ File: flex.info, Node: My actions are executing out of order or sometimes not a
My actions are executing out of order or sometimes not at all.
==============================================================
-Most likely, you have (in error) placed the opening `{' of the action
+Most likely, you have (in error) placed the opening '{' of the action
block on a different line than the rule, e.g.,
^(foo|bar)
@@ -4607,9 +4561,9 @@ block on a different line than the rule, e.g.,
}
- `flex' requires that the opening `{' of an action associated with a
-rule begin on the same line as does the rule. You need instead to
-write your rules as follows:
+ 'flex' requires that the opening '{' of an action associated with a
+rule begin on the same line as does the rule. You need instead to write
+your rules as follows:
^(foo|bar) { // CORRECT!
@@ -4622,36 +4576,34 @@ How can I have multiple input sources feed into the same scanner at the same tim
==================================================================================
If ...
- * your scanner is free of backtracking (verified using `flex''s `-b'
+ * your scanner is free of backtracking (verified using 'flex''s '-b'
flag),
-
- * AND you run your scanner interactively (`-I' option; default
- unless using special table compression options),
-
- * AND you feed it one character at a time by redefining `YY_INPUT'
- to do so,
+ * AND you run your scanner interactively ('-I' option; default unless
+ using special table compression options),
+ * AND you feed it one character at a time by redefining 'YY_INPUT' to
+ do so,
then every time it matches a token, it will have exhausted its input
buffer (because the scanner is free of backtracking). This means you
-can safely use `select()' at the point and only call `yylex()' for
-another token if `select()' indicates there's data available.
+can safely use 'select()' at the point and only call 'yylex()' for
+another token if 'select()' indicates there's data available.
- That is, move the `select()' out from the input function to a point
-where it determines whether `yylex()' gets called for the next token.
+ That is, move the 'select()' out from the input function to a point
+where it determines whether 'yylex()' gets called for the next token.
With this approach, you will still have problems if your input can
-arrive piecemeal; `select()' could inform you that the beginning of a
-token is available, you call `yylex()' to get it, but it winds up
+arrive piecemeal; 'select()' could inform you that the beginning of a
+token is available, you call 'yylex()' to get it, but it winds up
blocking waiting for the later characters in the token.
- Here's another way: Move your input multiplexing inside of
-`YY_INPUT'. That is, whenever `YY_INPUT' is called, it `select()''s to
-see where input is available. If input is available for the scanner,
-it reads and returns the next byte. If input is available from another
+ Here's another way: Move your input multiplexing inside of
+'YY_INPUT'. That is, whenever 'YY_INPUT' is called, it 'select()''s to
+see where input is available. If input is available for the scanner, it
+reads and returns the next byte. If input is available from another
source, it calls whatever function is responsible for reading from that
source. (If no input is available, it blocks until some input is
available.) I've used this technique in an interpreter I wrote that
-both reads keyboard input using a `flex' scanner and IPC traffic from
+both reads keyboard input using a 'flex' scanner and IPC traffic from
sockets, and it works fine.

@@ -4661,14 +4613,14 @@ Can I build nested parsers that work with the same input file?
==============================================================
This is not going to work without some additional effort. The reason is
-that `flex' block-buffers the input it reads from `yyin'. This means
-that the "outermost" `yylex()', when called, will automatically slurp
-up the first 8K of input available on yyin, and subsequent calls to
-other `yylex()''s won't see that input. You might be tempted to work
-around this problem by redefining `YY_INPUT' to only return a small
-amount of text, but it turns out that that approach is quite difficult.
-Instead, the best solution is to combine all of your scanners into one
-large scanner, using a different exclusive start condition for each.
+that 'flex' block-buffers the input it reads from 'yyin'. This means
+that the "outermost" 'yylex()', when called, will automatically slurp up
+the first 8K of input available on yyin, and subsequent calls to other
+'yylex()''s won't see that input. You might be tempted to work around
+this problem by redefining 'YY_INPUT' to only return a small amount of
+text, but it turns out that that approach is quite difficult. Instead,
+the best solution is to combine all of your scanners into one large
+scanner, using a different exclusive start condition for each.

File: flex.info, Node: How can I match text only at the end of a file?, Next: How can I make REJECT cascade across start condition boundaries?, Prev: Can I build nested parsers that work with the same input file?, Up: FAQ
@@ -4679,9 +4631,9 @@ How can I match text only at the end of a file?
There is no way to write a rule which is "match this text, but only if
it comes at the end of the file". You can fake it, though, if you
happen to have a character lying around that you don't allow in your
-input. Then you redefine `YY_INPUT' to call your own routine which, if
-it sees an `EOF', returns the magic character first (and remembers to
-return a real `EOF' next time it's called). Then you could write:
+input. Then you redefine 'YY_INPUT' to call your own routine which, if
+it sees an 'EOF', returns the magic character first (and remembers to
+return a real 'EOF' next time it's called). Then you could write:
<COMMENT>(.|\n)*{EOF_CHAR} /* saw comment at EOF */
@@ -4691,9 +4643,9 @@ File: flex.info, Node: How can I make REJECT cascade across start condition bou
How can I make REJECT cascade across start condition boundaries?
================================================================
-You can do this as follows. Suppose you have a start condition `A', and
-after exhausting all of the possible matches in `<A>', you want to try
-matches in `<INITIAL>'. Then you could use the following:
+You can do this as follows. Suppose you have a start condition 'A', and
+after exhausting all of the possible matches in '<A>', you want to try
+matches in '<INITIAL>'. Then you could use the following:
%x A
%%
@@ -4729,10 +4681,10 @@ end-of-token test is much simpler, basically a compare with 0, so no
memory bus cycles. Since the test occurs in the innermost scanning
loop, one would like to make it go as fast as possible.
- Still, it seems reasonable to allow the user to choose to trade off
-a bit of performance in this area to gain the corresponding
-flexibility. There might be another reason, though, why fast scanners
-don't support the interactive option.
+ Still, it seems reasonable to allow the user to choose to trade off a
+bit of performance in this area to gain the corresponding flexibility.
+There might be another reason, though, why fast scanners don't support
+the interactive option.

File: flex.info, Node: How much faster is -F or -f than -C?, Next: If I have a simple grammar cant I just parse it with flex?, Prev: Why cant I use fast or full tables with interactive mode?, Up: FAQ
@@ -4748,7 +4700,7 @@ File: flex.info, Node: If I have a simple grammar cant I just parse it with fle
If I have a simple grammar can't I just parse it with flex?
===========================================================
-Is your grammar recursive? That's almost always a sign that you're
+Is your grammar recursive? That's almost always a sign that you're
better off using a parser/scanner rather than just trying to use a
scanner alone.
@@ -4759,8 +4711,8 @@ Why doesn't yyrestart() set the start state back to INITIAL?
============================================================
There are two reasons. The first is that there might be programs that
-rely on the start state not changing across file changes. The second
-is that beginning with `flex' version 2.4, use of `yyrestart()' is no
+rely on the start state not changing across file changes. The second is
+that beginning with 'flex' version 2.4, use of 'yyrestart()' is no
longer required, so fixing the problem there doesn't solve the more
general problem.
@@ -4800,29 +4752,26 @@ File: flex.info, Node: The period isn't working the way I expected., Next: Can
The '.' isn't working the way I expected.
=========================================
-Here are some tips for using `.':
+Here are some tips for using '.':
* A common mistake is to place the grouping parenthesis AFTER an
- operator, when you really meant to place the parenthesis BEFORE
- the operator, e.g., you probably want this `(foo|bar)+' and NOT
- this `(foo|bar+)'.
-
- The first pattern matches the words `foo' or `bar' any number of
- times, e.g., it matches the text `barfoofoobarfoo'. The second
- pattern matches a single instance of `foo' or a single instance of
- `bar' followed by one or more `r's, e.g., it matches the text
- `barrrr' .
-
- * A `.' inside `[]''s just means a literal`.' (period), and NOT "any
+ operator, when you really meant to place the parenthesis BEFORE the
+ operator, e.g., you probably want this '(foo|bar)+' and NOT this
+ '(foo|bar+)'.
+
+ The first pattern matches the words 'foo' or 'bar' any number of
+ times, e.g., it matches the text 'barfoofoobarfoo'. The second
+ pattern matches a single instance of 'foo' or a single instance of
+ 'bar' followed by one or more 'r's, e.g., it matches the text
+ 'barrrr' .
+ * A '.' inside '[]''s just means a literal'.' (period), and NOT "any
character except newline".
-
- * Remember that `.' matches any character EXCEPT `\n' (and `EOF').
- If you really want to match ANY character, including newlines,
- then use `(.|\n)' Beware that the regex `(.|\n)+' will match your
- entire input!
-
- * Finally, if you want to match a literal `.' (a period), then use
- `[.]' or `"."'
+ * Remember that '.' matches any character EXCEPT '\n' (and 'EOF').
+ If you really want to match ANY character, including newlines, then
+ use '(.|\n)' Beware that the regex '(.|\n)+' will match your entire
+ input!
+ * Finally, if you want to match a literal '.' (a period), then use
+ '[.]' or '"."'

File: flex.info, Node: Can I get the flex manual in another format?, Next: Does there exist a "faster" NDFA->DFA algorithm?, Prev: The period isn't working the way I expected., Up: FAQ
@@ -4830,8 +4779,8 @@ File: flex.info, Node: Can I get the flex manual in another format?, Next: Doe
Can I get the flex manual in another format?
============================================
-The `flex' source distribution includes a texinfo manual. You are free
-to convert that texinfo into whatever format you desire. The `texinfo'
+The 'flex' source distribution includes a texinfo manual. You are free
+to convert that texinfo into whatever format you desire. The 'texinfo'
package includes tools for conversion to a number of formats.

@@ -4851,7 +4800,7 @@ File: flex.info, Node: How does flex compile the DFA so quickly?, Next: How ca
How does flex compile the DFA so quickly?
=========================================
-There are two big speed wins that `flex' uses:
+There are two big speed wins that 'flex' uses:
1. It analyzes the input rules to construct equivalence classes for
those characters that always make the same transitions. It then
@@ -4859,7 +4808,6 @@ There are two big speed wins that `flex' uses:
of characters. This cuts down the NFA->DFA computation time
dramatically, to the point where, for uncompressed DFA tables, the
DFA generation is often I/O bound in writing out the tables.
-
2. It maintains hash values for previously computed DFA states, so
testing whether a newly constructed DFA state is equivalent to a
previously constructed state can be done very quickly, by first
@@ -4871,9 +4819,9 @@ File: flex.info, Node: How can I use more than 8192 rules?, Next: How do I aba
How can I use more than 8192 rules?
===================================
-`Flex' is compiled with an upper limit of 8192 rules per scanner. If
+'Flex' is compiled with an upper limit of 8192 rules per scanner. If
you need more than 8192 rules in your scanner, you'll have to recompile
-`flex' with the following changes in `flexdef.h':
+'flex' with the following changes in 'flexdef.h':
< #define YY_TRAILING_MASK 0x2000
< #define YY_TRAILING_HEAD_MASK 0x4000
@@ -4906,9 +4854,9 @@ File: flex.info, Node: How do I abandon a file in the middle of a scan and swit
How do I abandon a file in the middle of a scan and switch to a new file?
=========================================================================
-Just call `yyrestart(newfile)'. Be sure to reset the start state if you
-want a "fresh start, since `yyrestart' does NOT reset the start state
-back to `INITIAL'.
+Just call 'yyrestart(newfile)'. Be sure to reset the start state if you
+want a "fresh start, since 'yyrestart' does NOT reset the start state
+back to 'INITIAL'.

File: flex.info, Node: How do I execute code only during initialization (only before the first scan)?, Next: How do I execute code at termination?, Prev: How do I abandon a file in the middle of a scan and switch to a new file?, Up: FAQ
@@ -4916,9 +4864,9 @@ File: flex.info, Node: How do I execute code only during initialization (only b
How do I execute code only during initialization (only before the first scan)?
==============================================================================
-You can specify an initial action by defining the macro `YY_USER_INIT'
-(though note that `yyout' may not be available at the time this macro
-is executed). Or you can add to the beginning of your rules section:
+You can specify an initial action by defining the macro 'YY_USER_INIT'
+(though note that 'yyout' may not be available at the time this macro is
+executed). Or you can add to the beginning of your rules section:
%%
/* Must be indented! */
@@ -4935,7 +4883,7 @@ File: flex.info, Node: How do I execute code at termination?, Next: Where else
How do I execute code at termination?
=====================================
-You can specify an action for the `<<EOF>>' rule.
+You can specify an action for the '<<EOF>>' rule.

File: flex.info, Node: Where else can I find help?, Next: Can I include comments in the "rules" section of the file?, Prev: How do I execute code at termination?, Up: FAQ
@@ -4944,7 +4892,7 @@ Where else can I find help?
===========================
You can find the flex homepage on the web at
-`http://flex.sourceforge.net/'. See that page for details about flex
+<http://flex.sourceforge.net/>. See that page for details about flex
mailing lists as well.

@@ -4953,7 +4901,7 @@ File: flex.info, Node: Can I include comments in the "rules" section of the fil
Can I include comments in the "rules" section of the file?
==========================================================
-Yes, just about anywhere you want to. See the manual for the specific
+Yes, just about anywhere you want to. See the manual for the specific
syntax.

@@ -4962,12 +4910,12 @@ File: flex.info, Node: I get an error about undefined yywrap()., Next: How can
I get an error about undefined yywrap().
========================================
-You must supply a `yywrap()' function of your own, or link to `libfl.a'
+You must supply a 'yywrap()' function of your own, or link to 'libfl.a'
(which provides one), or use
%option noyywrap
- in your source to say you don't want a `yywrap()' function.
+ in your source to say you don't want a 'yywrap()' function.

File: flex.info, Node: How can I change the matching pattern at run time?, Next: How can I expand macros in the input?, Prev: I get an error about undefined yywrap()., Up: FAQ
@@ -4984,8 +4932,8 @@ File: flex.info, Node: How can I expand macros in the input?, Next: How can I
How can I expand macros in the input?
=====================================
-The best way to approach this problem is at a higher level, e.g., in
-the parser.
+The best way to approach this problem is at a higher level, e.g., in the
+parser.
However, you can do this using multiple input buffers.
@@ -5020,13 +4968,13 @@ How can I build a two-pass scanner?
===================================
One way to do it is to filter the first pass to a temporary file, then
-process the temporary file on the second pass. You will probably see a
+process the temporary file on the second pass. You will probably see a
performance hit, due to all the disk I/O.
When you need to look ahead far forward like this, it almost always
means that the right solution is to build a parse tree of the entire
-input, then walk it after the parse in order to generate the output.
-In a sense, this is a two-pass approach, once through the text and once
+input, then walk it after the parse in order to generate the output. In
+a sense, this is a two-pass approach, once through the text and once
through the parse tree, but the performance hit for the latter is
usually an order of magnitude smaller, since everything is already
classified, in binary format, and residing in memory.
@@ -5037,18 +4985,18 @@ File: flex.info, Node: How do I match any string not matched in the preceding r
How do I match any string not matched in the preceding rules?
=============================================================
-One way to assign precedence, is to place the more specific rules
-first. If two rules would match the same input (same sequence of
-characters) then the first rule listed in the `flex' input wins, e.g.,
+One way to assign precedence, is to place the more specific rules first.
+If two rules would match the same input (same sequence of characters)
+then the first rule listed in the 'flex' input wins, e.g.,
%%
foo[a-zA-Z_]+ return FOO_ID;
bar[a-zA-Z_]+ return BAR_ID;
[a-zA-Z_]+ return GENERIC_ID;
- Note that the rule `[a-zA-Z_]+' must come *after* the others. It
+ Note that the rule '[a-zA-Z_]+' must come *after* the others. It
will match the same amount of text as the more specific rules, and in
-that case the `flex' scanner will pick the first rule listed in your
+that case the 'flex' scanner will pick the first rule listed in your
scanner as the one to match.

@@ -5059,10 +5007,10 @@ I am trying to port code from AT&T lex that uses yysptr and yysbuf.
Those are internal variables pointing into the AT&T scanner's input
buffer. I imagine they're being manipulated in user versions of the
-`input()' and `unput()' functions. If so, what you need to do is
+'input()' and 'unput()' functions. If so, what you need to do is
analyze those functions to figure out what they're doing, and then
-replace `input()' with an appropriate definition of `YY_INPUT'. You
-shouldn't need to (and must not) replace `flex''s `unput()' function.
+replace 'input()' with an appropriate definition of 'YY_INPUT'. You
+shouldn't need to (and must not) replace 'flex''s 'unput()' function.

File: flex.info, Node: Is there a way to make flex treat NULL like a regular character?, Next: Whenever flex can not match the input it says "flex scanner jammed"., Prev: I am trying to port code from AT&T lex that uses yysptr and yysbuf., Up: FAQ
@@ -5070,8 +5018,8 @@ File: flex.info, Node: Is there a way to make flex treat NULL like a regular ch
Is there a way to make flex treat NULL like a regular character?
================================================================
-Yes, `\0' and `\x00' should both do the trick. Perhaps you have an
-ancient version of `flex'. The latest release is version 2.5.39.
+Yes, '\0' and '\x00' should both do the trick. Perhaps you have an
+ancient version of 'flex'. The latest release is version 2.6.0.

File: flex.info, Node: Whenever flex can not match the input it says "flex scanner jammed"., Next: Why doesn't flex have non-greedy operators like perl does?, Prev: Is there a way to make flex treat NULL like a regular character?, Up: FAQ
@@ -5087,7 +5035,7 @@ You need to add a rule that matches the otherwise-unmatched text, e.g.,
. printf("bad input character '%s' at line %d\n", yytext, yylineno);
- See `%option default' for more information.
+ See '%option default' for more information.

File: flex.info, Node: Why doesn't flex have non-greedy operators like perl does?, Next: Memory leak - 16386 bytes allocated by malloc., Prev: Whenever flex can not match the input it says "flex scanner jammed"., Up: FAQ
@@ -5108,9 +5056,9 @@ decent job. Better is to either introduce a separate parser, or to
split the scanner into multiple scanners using (exclusive) start
conditions.
- You might have a separate start state once you've seen the `BEGIN'.
-In that state, you might then have a regex that will match `END' (to
-kick you out of the state), and perhaps `(.|\n)' to get a single
+ You might have a separate start state once you've seen the 'BEGIN'.
+In that state, you might then have a regex that will match 'END' (to
+kick you out of the state), and perhaps '(.|\n)' to get a single
character within the chunk ...
This approach also has much better error-reporting properties.
@@ -5121,18 +5069,18 @@ File: flex.info, Node: Memory leak - 16386 bytes allocated by malloc., Next: H
Memory leak - 16386 bytes allocated by malloc.
==============================================
-UPDATED 2002-07-10: As of `flex' version 2.5.9, this leak means that
-you did not call `yylex_destroy()'. If you are using an earlier version
-of `flex', then read on.
+UPDATED 2002-07-10: As of 'flex' version 2.5.9, this leak means that you
+did not call 'yylex_destroy()'. If you are using an earlier version of
+'flex', then read on.
The leak is about 16426 bytes. That is, (8192 * 2 + 2) for the
-read-buffer, and about 40 for `struct yy_buffer_state' (depending upon
-alignment). The leak is in the non-reentrant C scanner only (NOT in the
-reentrant scanner, NOT in the C++ scanner). Since `flex' doesn't know
+read-buffer, and about 40 for 'struct yy_buffer_state' (depending upon
+alignment). The leak is in the non-reentrant C scanner only (NOT in the
+reentrant scanner, NOT in the C++ scanner). Since 'flex' doesn't know
when you are done, the buffer is never freed.
- However, the leak won't multiply since the buffer is reused no
-matter how many times you call `yylex()'.
+ However, the leak won't multiply since the buffer is reused no matter
+how many times you call 'yylex()'.
If you want to reclaim the memory when you are completely done
scanning, then you might try this:
@@ -5141,8 +5089,8 @@ scanning, then you might try this:
yy_delete_buffer(YY_CURRENT_BUFFER);
yy_init = 1;
- Note: `yy_init' is an "internal variable", and hasn't been tested in
-this situation. It is possible that some other globals may need
+ Note: 'yy_init' is an "internal variable", and hasn't been tested in
+this situation. It is possible that some other globals may need
resetting as well.

@@ -5157,24 +5105,24 @@ How do I track the byte offset for lseek()?
> seek_position = (no_buffers)*YY_READ_BUF_SIZE + yy_c_buf_p - YY_CURRENT_BUFFER->yy_ch_buf
While this is the right idea, it has two problems. The first is that
-it's possible that `flex' will request less than `YY_READ_BUF_SIZE'
-during an invocation of `YY_INPUT' (or that your input source will
-return less even though `YY_READ_BUF_SIZE' bytes were requested). The
-second problem is that when refilling its internal buffer, `flex' keeps
+it's possible that 'flex' will request less than 'YY_READ_BUF_SIZE'
+during an invocation of 'YY_INPUT' (or that your input source will
+return less even though 'YY_READ_BUF_SIZE' bytes were requested). The
+second problem is that when refilling its internal buffer, 'flex' keeps
some characters from the previous buffer (because usually it's in the
-middle of a match, and needs those characters to construct `yytext' for
-the match once it's done). Because of this, `yy_c_buf_p -
+middle of a match, and needs those characters to construct 'yytext' for
+the match once it's done). Because of this, 'yy_c_buf_p -
YY_CURRENT_BUFFER->yy_ch_buf' won't be exactly the number of characters
already read from the current buffer.
An alternative solution is to count the number of characters you've
matched since starting to scan. This can be done by using
-`YY_USER_ACTION'. For example,
+'YY_USER_ACTION'. For example,
#define YY_USER_ACTION num_chars += yyleng;
(You need to be careful to update your bookkeeping if you use
-`yymore('), `yyless()', `unput()', or `input()'.)
+'yymore('), 'yyless()', 'unput()', or 'input()'.)

File: flex.info, Node: How do I use my own I/O classes in a C++ scanner?, Next: How do I skip as many chars as possible?, Prev: How do I track the byte offset for lseek()?, Up: FAQ
@@ -5182,16 +5130,16 @@ File: flex.info, Node: How do I use my own I/O classes in a C++ scanner?, Next
How do I use my own I/O classes in a C++ scanner?
=================================================
-When the flex C++ scanning class rewrite finally happens, then this
-sort of thing should become much easier.
+When the flex C++ scanning class rewrite finally happens, then this sort
+of thing should become much easier.
You can do this by passing the various functions (such as
-`LexerInput()' and `LexerOutput()') NULL `iostream*''s, and then
-dealing with your own I/O classes surreptitiously (i.e., stashing them
-in special member variables). This works because the only assumption
-about the lexer regarding what's done with the iostream's is that
-they're ultimately passed to `LexerInput()' and `LexerOutput', which
-then do whatever is necessary with them.
+'LexerInput()' and 'LexerOutput()') NULL 'iostream*''s, and then dealing
+with your own I/O classes surreptitiously (i.e., stashing them in
+special member variables). This works because the only assumption about
+the lexer regarding what's done with the iostream's is that they're
+ultimately passed to 'LexerInput()' and 'LexerOutput', which then do
+whatever is necessary with them.

File: flex.info, Node: How do I skip as many chars as possible?, Next: deleteme00, Prev: How do I use my own I/O classes in a C++ scanner?, Up: FAQ
@@ -5203,7 +5151,7 @@ How do I skip as many chars as possible - without interfering with the
other patterns?
In the example below, we want to skip over characters until we see
-the phrase "endskip". The following will _NOT_ work correctly (do you
+the phrase "endskip". The following will _NOT_ work correctly (do you
see why not?)
/* INCORRECT SCANNER */
@@ -5220,8 +5168,8 @@ The simplest (but slow) fix is:
<SKIP>"endskip" BEGIN(INITIAL);
<SKIP>. ;
- The fix involves making the second rule match more, without making
-it match "endskip" plus something else. So for example:
+ The fix involves making the second rule match more, without making it
+match "endskip" plus something else. So for example:
<SKIP>"endskip" BEGIN(INITIAL);
<SKIP>[^e]+ ;
@@ -5846,7 +5794,7 @@ File: flex.info, Node: Is there a repository for flex scanners?, Next: How can
Is there a repository for flex scanners?
========================================
-Not that we know of. You might try asking on comp.compilers.
+Not that we know of. You might try asking on comp.compilers.

File: flex.info, Node: How can I conditionally compile or preprocess my flex input file?, Next: Where can I find grammars for lex and yacc?, Prev: Is there a repository for flex scanners?, Up: FAQ
@@ -5873,8 +5821,8 @@ I get an end-of-buffer message for each character scanned.
This will happen if your LexerInput() function returns only one
character at a time, which can happen either if you're scanner is
-"interactive", or if the streams library on your platform always
-returns 1 for yyin->gcount().
+"interactive", or if the streams library on your platform always returns
+1 for yyin->gcount().
Solution: override LexerInput() with a version that returns whole
buffers.
@@ -7082,10 +7030,10 @@ File: flex.info, Node: What is the difference between YYLEX_PARAM and YY_DECL?,
What is the difference between YYLEX_PARAM and YY_DECL?
=======================================================
-YYLEX_PARAM is not a flex symbol. It is for Bison. It tells Bison to
+YYLEX_PARAM is not a flex symbol. It is for Bison. It tells Bison to
pass extra params when it calls yylex() from the parser.
- YY_DECL is the Flex declaration of yylex. The default is similar to
+ YY_DECL is the Flex declaration of yylex. The default is similar to
this:
#define int yy_lex ()
@@ -7106,8 +7054,8 @@ File: flex.info, Node: How do I access the values set in a Flex action from wit
How do I access the values set in a Flex action from within a Bison action?
===========================================================================
-With $1, $2, $3, etc. These are called "Semantic Values" in the Bison
-manual. See *note Top: (bison)Top.
+With $1, $2, $3, etc. These are called "Semantic Values" in the Bison
+manual. See *note (bison)Top::.

File: flex.info, Node: Appendices, Next: Indices, Prev: FAQ, Up: Top
@@ -7117,10 +7065,10 @@ Appendix A Appendices
* Menu:
-* Makefiles and Flex::
-* Bison Bridge::
-* M4 Dependency::
-* Common Patterns::
+* Makefiles and Flex::
+* Bison Bridge::
+* M4 Dependency::
+* Common Patterns::

File: flex.info, Node: Makefiles and Flex, Next: Bison Bridge, Prev: Appendices, Up: Appendices
@@ -7131,17 +7079,17 @@ A.1 Makefiles and Flex
In this appendix, we provide tips for writing Makefiles to build your
scanners.
- In a traditional build environment, we say that the `.c' files are
-the sources, and the `.o' files are the intermediate files. When using
-`flex', however, the `.l' files are the sources, and the generated `.c'
-files (along with the `.o' files) are the intermediate files. This
+ In a traditional build environment, we say that the '.c' files are
+the sources, and the '.o' files are the intermediate files. When using
+'flex', however, the '.l' files are the sources, and the generated '.c'
+files (along with the '.o' files) are the intermediate files. This
requires you to carefully plan your Makefile.
- Modern `make' programs understand that `foo.l' is intended to
-generate `lex.yy.c' or `foo.c', and will behave accordingly(1)(2). The
-following Makefile does not explicitly instruct `make' how to build
-`foo.c' from `foo.l'. Instead, it relies on the implicit rules of the
-`make' program to build the intermediate file, `scan.c':
+ Modern 'make' programs understand that 'foo.l' is intended to
+generate 'lex.yy.c' or 'foo.c', and will behave accordingly(1)(2). The
+following Makefile does not explicitly instruct 'make' how to build
+'foo.c' from 'foo.l'. Instead, it relies on the implicit rules of the
+'make' program to build the intermediate file, 'scan.c':
# Basic Makefile -- relies on implicit rules
# Creates "myprogram" from "scan.l" and "myprogram.c"
@@ -7150,8 +7098,9 @@ following Makefile does not explicitly instruct `make' how to build
myprogram: scan.o myprogram.o
scan.o: scan.l
- For simple cases, the above may be sufficient. For other cases, you
-may have to explicitly instruct `make' how to build your scanner. The
+
+ For simple cases, the above may be sufficient. For other cases, you
+may have to explicitly instruct 'make' how to build your scanner. The
following is an example of a Makefile containing explicit rules:
# Basic Makefile -- provides explicit rules
@@ -7173,16 +7122,17 @@ following is an example of a Makefile containing explicit rules:
clean:
$(RM) *.o scan.c
- Notice in the above example that `scan.c' is in the `clean' target.
-This is because we consider the file `scan.c' to be an intermediate
+
+ Notice in the above example that 'scan.c' is in the 'clean' target.
+This is because we consider the file 'scan.c' to be an intermediate
file.
- Finally, we provide a realistic example of a `flex' scanner used
-with a `bison' parser(3). There is a tricky problem we have to deal
-with. Since a `flex' scanner will typically include a header file
-(e.g., `y.tab.h') generated by the parser, we need to be sure that the
-header file is generated BEFORE the scanner is compiled. We handle this
-case in the following example:
+ Finally, we provide a realistic example of a 'flex' scanner used with
+a 'bison' parser(3). There is a tricky problem we have to deal with.
+Since a 'flex' scanner will typically include a header file (e.g.,
+'y.tab.h') generated by the parser, we need to be sure that the header
+file is generated BEFORE the scanner is compiled. We handle this case
+in the following example:
# Makefile example -- scanner and parser.
# Creates "myprogram" from "scan.l", "parse.y", and "myprogram.c"
@@ -7197,25 +7147,26 @@ case in the following example:
parse.o: parse.y
myprogram.o: myprogram.c
+
In the above example, notice the line,
scan.o: scan.l parse.c
- , which lists the file `parse.c' (the generated parser) as a
-dependency of `scan.o'. We want to ensure that the parser is created
+ , which lists the file 'parse.c' (the generated parser) as a
+dependency of 'scan.o'. We want to ensure that the parser is created
before the scanner is compiled, and the above line seems to do the
-trick. Feel free to experiment with your specific implementation of
-`make'.
+trick. Feel free to experiment with your specific implementation of
+'make'.
- For more details on writing Makefiles, see *note Top: (make)Top.
+ For more details on writing Makefiles, see *note (make)Top::.
---------- Footnotes ----------
- (1) GNU `make' and GNU `automake' are two such programs that provide
+ (1) GNU 'make' and GNU 'automake' are two such programs that provide
implicit rules for flex-generated scanners.
- (2) GNU `automake' may generate code to execute flex in
-lex-compatible mode, or to stdout. If this is not what you want, then
+ (2) GNU 'automake' may generate code to execute flex in
+lex-compatible mode, or to stdout. If this is not what you want, then
you should provide an explicit rule in your Makefile.am
(3) This example also applies to yacc parsers.
@@ -7226,34 +7177,33 @@ File: flex.info, Node: Bison Bridge, Next: M4 Dependency, Prev: Makefiles and
A.2 C Scanners with Bison Parsers
=================================
-This section describes the `flex' features useful when integrating
-`flex' with `GNU bison'(1). Skip this section if you are not using
-`bison' with your scanner. Here we discuss only the `flex' half of the
-`flex' and `bison' pair. We do not discuss `bison' in any detail. For
-more information about generating `bison' parsers, see *note Top:
-(bison)Top.
-
- A compatible `bison' scanner is generated by declaring `%option
-bison-bridge' or by supplying `--bison-bridge' when invoking `flex'
-from the command line. This instructs `flex' that the macro `yylval'
-may be used. The data type for `yylval', `YYSTYPE', is typically
-defined in a header file, included in section 1 of the `flex' input
-file. For a list of functions and macros available, *Note
-bison-functions::.
+This section describes the 'flex' features useful when integrating
+'flex' with 'GNU bison'(1). Skip this section if you are not using
+'bison' with your scanner. Here we discuss only the 'flex' half of the
+'flex' and 'bison' pair. We do not discuss 'bison' in any detail. For
+more information about generating 'bison' parsers, see *note
+(bison)Top::.
+
+ A compatible 'bison' scanner is generated by declaring '%option
+bison-bridge' or by supplying '--bison-bridge' when invoking 'flex' from
+the command line. This instructs 'flex' that the macro 'yylval' may be
+used. The data type for 'yylval', 'YYSTYPE', is typically defined in a
+header file, included in section 1 of the 'flex' input file. For a list
+of functions and macros available, *Note bison-functions::.
The declaration of yylex becomes,
int yylex ( YYSTYPE * lvalp, yyscan_t scanner );
- If `%option bison-locations' is specified, then the declaration
+ If '%option bison-locations' is specified, then the declaration
becomes,
int yylex ( YYSTYPE * lvalp, YYLTYPE * llocp, yyscan_t scanner );
- Note that the macros `yylval' and `yylloc' evaluate to pointers.
-Support for `yylloc' is optional in `bison', so it is optional in
-`flex' as well. The following is an example of a `flex' scanner that is
-compatible with `bison'.
+ Note that the macros 'yylval' and 'yylloc' evaluate to pointers.
+Support for 'yylloc' is optional in 'bison', so it is optional in 'flex'
+as well. The following is an example of a 'flex' scanner that is
+compatible with 'bison'.
/* Scanner for "C" assignment statements... sort of. */
%{
@@ -7269,10 +7219,10 @@ compatible with `bison'.
. {}
%
- As you can see, there really is no magic here. We just use `yylval'
-as we would any other variable. The data type of `yylval' is generated
-by `bison', and included in the file `y.tab.h'. Here is the
-corresponding `bison' parser:
+ As you can see, there really is no magic here. We just use 'yylval'
+as we would any other variable. The data type of 'yylval' is generated
+by 'bison', and included in the file 'y.tab.h'. Here is the
+corresponding 'bison' parser:
/* Parser to convert "C" assignments to lisp. */
%{
@@ -7307,34 +7257,33 @@ File: flex.info, Node: M4 Dependency, Next: Common Patterns, Prev: Bison Brid
A.3 M4 Dependency
=================
-The macro processor `m4'(1) must be installed wherever flex is
-installed. `flex' invokes `m4', found by searching the directories in
-the `PATH' environment variable. Any code you place in section 1 or in
-the actions will be sent through m4. Please follow these rules to
-protect your code from unwanted `m4' processing.
+The macro processor 'm4'(1) must be installed wherever flex is
+installed. 'flex' invokes 'm4', found by searching the directories in
+the 'PATH' environment variable. Any code you place in section 1 or in
+the actions will be sent through m4. Please follow these rules to
+protect your code from unwanted 'm4' processing.
- * Do not use symbols that begin with, `m4_', such as, `m4_define',
- or `m4_include', since those are reserved for `m4' macro names. If
+ * Do not use symbols that begin with, 'm4_', such as, 'm4_define', or
+ 'm4_include', since those are reserved for 'm4' macro names. If
for some reason you need m4_ as a prefix, use a preprocessor
#define to get your symbol past m4 unmangled.
- * Do not use the strings `[[' or `]]' anywhere in your code. The
+ * Do not use the strings '[[' or ']]' anywhere in your code. The
former is not valid in C, except within comments and strings, but
- the latter is valid in code such as `x[y[z]]'. The solution is
- simple. To get the literal string `"]]"', use `"]""]"'. To get the
- array notation `x[y[z]]', use `x[y[z] ]'. Flex will attempt to
- detect these sequences in user code, and escape them. However,
- it's best to avoid this complexity where possible, by removing
- such sequences from your code.
-
+ the latter is valid in code such as 'x[y[z]]'. The solution is
+ simple. To get the literal string '"]]"', use '"]""]"'. To get
+ the array notation 'x[y[z]]', use 'x[y[z] ]'. Flex will attempt to
+ detect these sequences in user code, and escape them. However,
+ it's best to avoid this complexity where possible, by removing such
+ sequences from your code.
- `m4' is only required at the time you run `flex'. The generated
-scanner is ordinary C or C++, and does _not_ require `m4'.
+ 'm4' is only required at the time you run 'flex'. The generated
+scanner is ordinary C or C++, and does _not_ require 'm4'.
---------- Footnotes ----------
(1) The use of m4 is subject to change in future revisions of flex.
-It is not part of the public API of flex. Do not depend on it.
+It is not part of the public API of flex. Do not depend on it.

File: flex.info, Node: Common Patterns, Prev: M4 Dependency, Up: Appendices
@@ -7347,10 +7296,10 @@ use in your scanner.
* Menu:
-* Numbers::
-* Identifiers::
-* Quoted Constructs::
-* Addresses::
+* Numbers::
+* Identifiers::
+* Quoted Constructs::
+* Addresses::

File: flex.info, Node: Numbers, Next: Identifiers, Up: Common Patterns
@@ -7359,13 +7308,13 @@ A.4.1 Numbers
-------------
C99 decimal constant
- `([[:digit:]]{-}[0])[[:digit:]]*'
+ '([[:digit:]]{-}[0])[[:digit:]]*'
C99 hexadecimal constant
- `0[xX][[:xdigit:]]+'
+ '0[xX][[:xdigit:]]+'
C99 octal constant
- `0[01234567]*'
+ '0[01234567]*'
C99 floating point constant
{dseq} ([[:digit:]]+)
@@ -7387,7 +7336,6 @@ C99 floating point constant
See C99 section 6.4.4.2 for the gory details.
-

File: flex.info, Node: Identifiers, Next: Quoted Constructs, Prev: Numbers, Up: Common Patterns
@@ -7401,13 +7349,12 @@ C99 Identifier
Technically, the above pattern does not encompass all possible C99
identifiers, since C99 allows for "implementation-defined"
- characters. In practice, C compilers follow the above pattern,
- with the addition of the `$' character.
+ characters. In practice, C compilers follow the above pattern,
+ with the addition of the '$' character.
UTF-8 Encoded Unicode Code Point
[\x09\x0A\x0D\x20-\x7E]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF]([\x80-\xBF]{2})|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF]([\x80-\xBF]{2})|[\xF1-\xF3]([\x80-\xBF]{3})|\xF4[\x80-\x8F]([\x80-\xBF]{2})
-

File: flex.info, Node: Quoted Constructs, Next: Addresses, Prev: Identifiers, Up: Common Patterns
@@ -7415,20 +7362,20 @@ A.4.3 Quoted Constructs
-----------------------
C99 String Literal
- `L?\"([^\"\\\n]|(\\['\"?\\abfnrtv])|(\\([0123456]{1,3}))|(\\x[[:xdigit:]]+)|(\\u([[:xdigit:]]{4}))|(\\U([[:xdigit:]]{8})))*\"'
+ 'L?\"([^\"\\\n]|(\\['\"?\\abfnrtv])|(\\([0123456]{1,3}))|(\\x[[:xdigit:]]+)|(\\u([[:xdigit:]]{4}))|(\\U([[:xdigit:]]{8})))*\"'
C99 Comment
- `("/*"([^*]|"*"[^/])*"*/")|("/"(\\\n)*"/"[^\n]*)'
+ '("/*"([^*]|"*"[^/])*"*/")|("/"(\\\n)*"/"[^\n]*)'
- Note that in C99, a `//'-style comment may be split across lines,
- and, contrary to popular belief, does not include the trailing
- `\n' character.
+ Note that in C99, a '//'-style comment may be split across lines,
+ and, contrary to popular belief, does not include the trailing '\n'
+ character.
- A better way to scan `/* */' comments is by line, rather than
- matching possibly huge comments all at once. This will allow you
- to scan comments of unlimited length, as long as line breaks
- appear at sane intervals. This is also more efficient when used
- with automatic line number processing. *Note option-yylineno::.
+ A better way to scan '/* */' comments is by line, rather than
+ matching possibly huge comments all at once. This will allow you
+ to scan comments of unlimited length, as long as line breaks appear
+ at sane intervals. This is also more efficient when used with
+ automatic line number processing. *Note option-yylineno::.
<INITIAL>{
"/*" BEGIN(COMMENT);
@@ -7440,7 +7387,6 @@ C99 Comment
\n ;
}
-

File: flex.info, Node: Addresses, Prev: Quoted Constructs, Up: Common Patterns
@@ -7465,17 +7411,16 @@ IPv6 Address
(({h16}:){0,6}{h16})?::
See RFC 2373 (http://www.ietf.org/rfc/rfc2373.txt) for details.
- Note that you have to fold the definition of `IPv6address' into one
+ Note that you have to fold the definition of 'IPv6address' into one
line and that it also matches the "unspecified address" "::".
URI
- `(([^:/?#]+):)?("//"([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?'
+ '(([^:/?#]+):)?("//"([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?'
This pattern is nearly useless, since it allows just about any
character to appear in a URI, including spaces and control
- characters. See RFC 2396 (http://www.ietf.org/rfc/rfc2396.txt)
- for details.
-
+ characters. See RFC 2396 (http://www.ietf.org/rfc/rfc2396.txt) for
+ details.

File: flex.info, Node: Indices, Prev: Appendices, Up: Top
@@ -7485,10 +7430,367 @@ Indices
* Menu:
-* Concept Index::
-* Index of Functions and Macros::
-* Index of Variables::
-* Index of Data Types::
-* Index of Hooks::
-* Index of Scanner Options::
+* Concept Index::
+* Index of Functions and Macros::
+* Index of Variables::
+* Index of Data Types::
+* Index of Hooks::
+* Index of Scanner Options::
+
+
+File: flex.info, Node: Concept Index, Next: Index of Functions and Macros, Prev: Indices, Up: Indices
+
+Concept Index
+=============
+
+
+* Menu:
+
+* $ as normal character in patterns: Patterns. (line 275)
+* %array, advantages of: Matching. (line 43)
+* %array, use of: Matching. (line 29)
+* %array, with C++: Matching. (line 65)
+* %option noyywrapp: Generated Scanner. (line 93)
+* %pointer, and unput(): Actions. (line 162)
+* %pointer, use of: Matching. (line 29)
+* %top: Definitions Section. (line 44)
+* %{ and %}, in Definitions Section: Definitions Section. (line 40)
+* %{ and %}, in Rules Section: Actions. (line 26)
+* <<EOF>>, use of: EOF. (line 33)
+* [] in patterns: Patterns. (line 15)
+* ^ as non-special character in patterns: Patterns. (line 275)
+* |, in actions: Actions. (line 33)
+* |, use of: Actions. (line 83)
+* accessor functions, use of: Accessor Methods. (line 18)
+* actions: Actions. (line 6)
+* actions, embedded C strings: Actions. (line 26)
+* actions, redefining YY_BREAK: Misc Macros. (line 49)
+* actions, use of { and }: Actions. (line 26)
+* aliases, how to define: Definitions Section. (line 10)
+* arguments, command-line: Scanner Options. (line 6)
+* array, default size for yytext: User Values. (line 13)
+* backing up, eliminating: Performance. (line 54)
+* backing up, eliminating by adding error rules: Performance. (line 104)
+* backing up, eliminating with catch-all rule: Performance. (line 118)
+* backing up, example of eliminating: Performance. (line 49)
+* BEGIN: Actions. (line 57)
+* BEGIN, explanation: Start Conditions. (line 84)
+* beginning of line, in patterns: Patterns. (line 127)
+* bison, bridging with flex: Bison Bridge. (line 6)
+* bison, parser: Bison Bridge. (line 53)
+* bison, scanner to be called from bison: Bison Bridge. (line 34)
+* BOL, checking the BOL flag: Misc Macros. (line 46)
+* BOL, in patterns: Patterns. (line 127)
+* BOL, setting it: Misc Macros. (line 40)
+* braces in patterns: Patterns. (line 42)
+* bugs, reporting: Reporting Bugs. (line 6)
+* C code in flex input: Definitions Section. (line 40)
+* C++: Cxx. (line 9)
+* C++ and %array: User Values. (line 23)
+* C++ I/O, customizing: How do I use my own I/O classes in a C++ scanner?.
+ (line 9)
+* C++ scanners, including multiple scanners: Cxx. (line 197)
+* C++ scanners, use of: Cxx. (line 128)
+* c++, experimental form of scanner class: Cxx. (line 6)
+* C++, multiple different scanners: Cxx. (line 192)
+* C-strings, in actions: Actions. (line 26)
+* case-insensitive, effect on character classes: Patterns. (line 216)
+* character classes in patterns: Patterns. (line 186)
+* character classes in patterns, syntax of: Patterns. (line 15)
+* character classes, equivalence of: Patterns. (line 205)
+* clearing an input buffer: Multiple Input Buffers.
+ (line 66)
+* command-line options: Scanner Options. (line 6)
+* comments in flex input: Definitions Section. (line 37)
+* comments in the input: Comments in the Input.
+ (line 24)
+* comments, discarding: Actions. (line 176)
+* comments, example of scanning C comments: Start Conditions. (line 140)
+* comments, in actions: Actions. (line 26)
+* comments, in rules section: Comments in the Input.
+ (line 11)
+* comments, syntax of: Comments in the Input.
+ (line 6)
+* comments, valid uses of: Comments in the Input.
+ (line 24)
+* compressing whitespace: Actions. (line 22)
+* concatenation, in patterns: Patterns. (line 111)
+* copyright of flex: Copyright. (line 6)
+* counting characters and lines: Simple Examples. (line 23)
+* customizing I/O in C++ scanners: How do I use my own I/O classes in a C++ scanner?.
+ (line 9)
+* default rule: Simple Examples. (line 15)
+* default rule <1>: Matching. (line 20)
+* defining pattern aliases: Definitions Section. (line 21)
+* Definitions, in flex input: Definitions Section. (line 6)
+* deleting lines from input: Actions. (line 13)
+* discarding C comments: Actions. (line 176)
+* distributing flex: Copyright. (line 6)
+* ECHO: Actions. (line 54)
+* ECHO, and yyout: Generated Scanner. (line 101)
+* embedding C code in flex input: Definitions Section. (line 40)
+* end of file, in patterns: Patterns. (line 150)
+* end of line, in negated character classes: Patterns. (line 237)
+* end of line, in patterns: Patterns. (line 131)
+* end-of-file, and yyrestart(): Generated Scanner. (line 42)
+* EOF and yyrestart(): Generated Scanner. (line 42)
+* EOF in patterns, syntax of: Patterns. (line 150)
+* EOF, example using multiple input buffers: Multiple Input Buffers.
+ (line 81)
+* EOF, explanation: EOF. (line 6)
+* EOF, pushing back: Actions. (line 170)
+* EOL, in negated character classes: Patterns. (line 237)
+* EOL, in patterns: Patterns. (line 131)
+* error messages, end of buffer missed: Lex and Posix. (line 50)
+* error reporting, diagnostic messages: Diagnostics. (line 6)
+* error reporting, in C++: Cxx. (line 112)
+* error rules, to eliminate backing up: Performance. (line 102)
+* escape sequences in patterns, syntax of: Patterns. (line 57)
+* exiting with yyterminate(): Actions. (line 212)
+* experimental form of c++ scanner class: Cxx. (line 6)
+* extended scope of start conditions: Start Conditions. (line 270)
+* file format: Format. (line 6)
+* file format, serialized tables: Tables File Format. (line 6)
+* flushing an input buffer: Multiple Input Buffers.
+ (line 66)
+* flushing the internal buffer: Actions. (line 206)
+* format of flex input: Format. (line 6)
+* format of input file: Format. (line 9)
+* freeing tables: Loading and Unloading Serialized Tables.
+ (line 6)
+* getting current start state with YY_START: Start Conditions.
+ (line 189)
+* halting with yyterminate(): Actions. (line 212)
+* handling include files with multiple input buffers: Multiple Input Buffers.
+ (line 87)
+* handling include files with multiple input buffers <1>: Multiple Input Buffers.
+ (line 122)
+* header files, with C++: Cxx. (line 197)
+* include files, with C++: Cxx. (line 197)
+* input file, Definitions section: Definitions Section. (line 6)
+* input file, Rules Section: Rules Section. (line 6)
+* input file, user code Section: User Code Section. (line 6)
+* input(): Actions. (line 173)
+* input(), and C++: Actions. (line 202)
+* input, format of: Format. (line 6)
+* input, matching: Matching. (line 6)
+* keywords, for performance: Performance. (line 200)
+* lex (traditional) and POSIX: Lex and Posix. (line 6)
+* LexerInput, overriding: How do I use my own I/O classes in a C++ scanner?.
+ (line 9)
+* LexerOutput, overriding: How do I use my own I/O classes in a C++ scanner?.
+ (line 9)
+* limitations of flex: Limitations. (line 6)
+* literal text in patterns, syntax of: Patterns. (line 54)
+* loading tables at runtime: Loading and Unloading Serialized Tables.
+ (line 6)
+* m4: M4 Dependency. (line 6)
+* Makefile, example of implicit rules: Makefiles and Flex. (line 21)
+* Makefile, explicit example: Makefiles and Flex. (line 33)
+* Makefile, syntax: Makefiles and Flex. (line 6)
+* matching C-style double-quoted strings: Start Conditions. (line 203)
+* matching, and trailing context: Matching. (line 6)
+* matching, length of: Matching. (line 6)
+* matching, multiple matches: Matching. (line 6)
+* member functions, C++: Cxx. (line 9)
+* memory management: Memory Management. (line 6)
+* memory, allocating input buffers: Multiple Input Buffers.
+ (line 19)
+* memory, considerations for reentrant scanners: Init and Destroy Functions.
+ (line 6)
+* memory, deleting input buffers: Multiple Input Buffers.
+ (line 46)
+* memory, for start condition stacks: Start Conditions. (line 301)
+* memory, serialized tables: Serialized Tables. (line 6)
+* memory, serialized tables <1>: Loading and Unloading Serialized Tables.
+ (line 6)
+* methods, c++: Cxx. (line 9)
+* minimal scanner: Matching. (line 24)
+* multiple input streams: Multiple Input Buffers.
+ (line 6)
+* name definitions, not POSIX: Lex and Posix. (line 75)
+* negating ranges in patterns: Patterns. (line 23)
+* newline, matching in patterns: Patterns. (line 135)
+* non-POSIX features of flex: Lex and Posix. (line 142)
+* noyywrap, %option: Generated Scanner. (line 93)
+* NULL character in patterns, syntax of: Patterns. (line 62)
+* octal characters in patterns: Patterns. (line 65)
+* options, command-line: Scanner Options. (line 6)
+* overriding LexerInput: How do I use my own I/O classes in a C++ scanner?.
+ (line 9)
+* overriding LexerOutput: How do I use my own I/O classes in a C++ scanner?.
+ (line 9)
+* overriding the memory routines: Overriding The Default Memory Management.
+ (line 38)
+* Pascal-like language: Simple Examples. (line 49)
+* pattern aliases, defining: Definitions Section. (line 21)
+* pattern aliases, expansion of: Patterns. (line 51)
+* pattern aliases, how to define: Definitions Section. (line 10)
+* pattern aliases, use of: Definitions Section. (line 28)
+* patterns and actions on different lines: Lex and Posix. (line 101)
+* patterns, character class equivalence: Patterns. (line 205)
+* patterns, common: Common Patterns. (line 6)
+* patterns, end of line: Patterns. (line 300)
+* patterns, grouping and precedence: Patterns. (line 167)
+* patterns, in rules section: Patterns. (line 6)
+* patterns, invalid trailing context: Patterns. (line 285)
+* patterns, matching: Matching. (line 6)
+* patterns, precedence of operators: Patterns. (line 161)
+* patterns, repetitions with grouping: Patterns. (line 184)
+* patterns, special characters treated as non-special: Patterns.
+ (line 293)
+* patterns, syntax: Patterns. (line 9)
+* patterns, syntax <1>: Patterns. (line 9)
+* patterns, tuning for performance: Performance. (line 49)
+* patterns, valid character classes: Patterns. (line 192)
+* performance optimization, matching longer tokens: Performance.
+ (line 167)
+* performance optimization, recognizing keywords: Performance.
+ (line 205)
+* performance, backing up: Performance. (line 49)
+* performance, considerations: Performance. (line 6)
+* performance, using keywords: Performance. (line 200)
+* popping an input buffer: Multiple Input Buffers.
+ (line 60)
+* POSIX and lex: Lex and Posix. (line 6)
+* POSIX comp;compliance: Lex and Posix. (line 142)
+* POSIX, character classes in patterns, syntax of: Patterns. (line 15)
+* preprocessor macros, for use in actions: Actions. (line 50)
+* pushing an input buffer: Multiple Input Buffers.
+ (line 52)
+* pushing back characters with unput: Actions. (line 143)
+* pushing back characters with unput(): Actions. (line 147)
+* pushing back characters with yyless: Actions. (line 131)
+* pushing back EOF: Actions. (line 170)
+* ranges in patterns: Patterns. (line 19)
+* ranges in patterns, negating: Patterns. (line 23)
+* recognizing C comments: Start Conditions. (line 143)
+* reentrant scanners, multiple interleaved scanners: Reentrant Uses.
+ (line 10)
+* reentrant scanners, recursive invocation: Reentrant Uses. (line 30)
+* reentrant, accessing flex variables: Global Replacement. (line 6)
+* reentrant, accessor functions: Accessor Methods. (line 6)
+* reentrant, API explanation: Reentrant Overview. (line 6)
+* reentrant, calling functions: Extra Reentrant Argument.
+ (line 6)
+* reentrant, example of: Reentrant Example. (line 6)
+* reentrant, explanation: Reentrant. (line 6)
+* reentrant, extra data: Extra Data. (line 6)
+* reentrant, initialization: Init and Destroy Functions.
+ (line 6)
+* regular expressions, in patterns: Patterns. (line 6)
+* REJECT: Actions. (line 61)
+* REJECT, calling multiple times: Actions. (line 83)
+* REJECT, performance costs: Performance. (line 12)
+* reporting bugs: Reporting Bugs. (line 6)
+* restarting the scanner: Lex and Posix. (line 54)
+* RETURN, within actions: Generated Scanner. (line 57)
+* rules, default: Simple Examples. (line 15)
+* rules, in flex input: Rules Section. (line 6)
+* scanner, definition of: Introduction. (line 6)
+* sections of flex input: Format. (line 6)
+* serialization: Serialized Tables. (line 6)
+* serialization of tables: Creating Serialized Tables.
+ (line 6)
+* serialized tables, multiple scanners: Creating Serialized Tables.
+ (line 26)
+* stack, input buffer pop: Multiple Input Buffers.
+ (line 60)
+* stack, input buffer push: Multiple Input Buffers.
+ (line 52)
+* stacks, routines for manipulating: Start Conditions. (line 286)
+* start condition, applying to multiple patterns: Start Conditions.
+ (line 258)
+* start conditions: Start Conditions. (line 6)
+* start conditions, behavior of default rule: Start Conditions.
+ (line 82)
+* start conditions, exclusive: Start Conditions. (line 53)
+* start conditions, for different interpretations of same input: Start Conditions.
+ (line 112)
+* start conditions, in patterns: Patterns. (line 140)
+* start conditions, inclusive: Start Conditions. (line 44)
+* start conditions, inclusive v.s. exclusive: Start Conditions.
+ (line 24)
+* start conditions, integer values: Start Conditions. (line 163)
+* start conditions, multiple: Start Conditions. (line 17)
+* start conditions, special wildcard condition: Start Conditions.
+ (line 68)
+* start conditions, use of a stack: Start Conditions. (line 286)
+* start conditions, use of wildcard condition (<*>): Start Conditions.
+ (line 72)
+* start conditions, using BEGIN: Start Conditions. (line 95)
+* stdin, default for yyin: Generated Scanner. (line 37)
+* stdout, as default for yyout: Generated Scanner. (line 101)
+* strings, scanning strings instead of files: Multiple Input Buffers.
+ (line 175)
+* tables, creating serialized: Creating Serialized Tables.
+ (line 6)
+* tables, file format: Tables File Format. (line 6)
+* tables, freeing: Loading and Unloading Serialized Tables.
+ (line 6)
+* tables, loading and unloading: Loading and Unloading Serialized Tables.
+ (line 6)
+* terminating with yyterminate(): Actions. (line 212)
+* token: Matching. (line 14)
+* trailing context, in patterns: Patterns. (line 118)
+* trailing context, limits of: Patterns. (line 275)
+* trailing context, matching: Matching. (line 6)
+* trailing context, performance costs: Performance. (line 12)
+* trailing context, variable length: Performance. (line 141)
+* unput(): Actions. (line 143)
+* unput(), and %pointer: Actions. (line 162)
+* unput(), pushing back characters: Actions. (line 147)
+* user code, in flex input: User Code Section. (line 6)
+* username expansion: Simple Examples. (line 8)
+* using integer values of start condition names: Start Conditions.
+ (line 163)
+* verbatim text in patterns, syntax of: Patterns. (line 54)
+* warning, dangerous trailing context: Limitations. (line 20)
+* warning, rule cannot be matched: Diagnostics. (line 14)
+* warnings, diagnostic messages: Diagnostics. (line 6)
+* whitespace, compressing: Actions. (line 22)
+* yacc interface: Yacc. (line 17)
+* yacc, interface: Yacc. (line 6)
+* yyalloc, overriding: Overriding The Default Memory Management.
+ (line 6)
+* yyfree, overriding: Overriding The Default Memory Management.
+ (line 6)
+* yyin: Generated Scanner. (line 37)
+* yyinput(): Actions. (line 202)
+* yyleng: Matching. (line 14)
+* yyleng, modification of: Actions. (line 47)
+* yyless(): Actions. (line 125)
+* yyless(), pushing back characters: Actions. (line 131)
+* yylex(), in generated scanner: Generated Scanner. (line 6)
+* yylex(), overriding: Generated Scanner. (line 16)
+* yylex, overriding the prototype of: Generated Scanner. (line 20)
+* yylineno, in a reentrant scanner: Reentrant Functions. (line 36)
+* yylineno, performance costs: Performance. (line 12)
+* yymore(): Actions. (line 104)
+* yymore() to append token to previous token: Actions. (line 110)
+* yymore(), mega-kludge: Actions. (line 110)
+* yymore, and yyleng: Actions. (line 47)
+* yymore, performance penalty of: Actions. (line 119)
+* yyout: Generated Scanner. (line 101)
+* yyrealloc, overriding: Overriding The Default Memory Management.
+ (line 6)
+* yyrestart(): Generated Scanner. (line 42)
+* yyterminate(): Actions. (line 212)
+* yytext: Matching. (line 14)
+* yytext, default array size: User Values. (line 13)
+* yytext, memory considerations: A Note About yytext And Memory.
+ (line 6)
+* yytext, modification of: Actions. (line 42)
+* yytext, two types of: Matching. (line 29)
+* yywrap(): Generated Scanner. (line 85)
+* yywrap, default for: Generated Scanner. (line 93)
+* YY_CURRENT_BUFFER, and multiple buffers Finally, the macro: Multiple Input Buffers.
+ (line 78)
+* YY_EXTRA_TYPE, defining your own type: Extra Data. (line 33)
+* YY_FLUSH_BUFFER: Actions. (line 206)
+* YY_INPUT: Generated Scanner. (line 61)
+* YY_INPUT, overriding: Generated Scanner. (line 71)
+* YY_START, example: Start Conditions. (line 185)
+* YY_USER_ACTION to track each time a rule is matched: Misc Macros.
+ (line 14)
diff --git a/doc/flex.info-2 b/doc/flex.info-2
index 31a4826..d494d70 100644
--- a/doc/flex.info-2
+++ b/doc/flex.info-2
Binary files differ
diff --git a/doc/flex.pdf b/doc/flex.pdf
index f538ef7..1bc9a03 100644
--- a/doc/flex.pdf
+++ b/doc/flex.pdf
Binary files differ
diff --git a/doc/flex.texi b/doc/flex.texi
index 6bca1c8..9b7d83f 100644
--- a/doc/flex.texi
+++ b/doc/flex.texi
@@ -80,204 +80,204 @@ This edition of @cite{The flex Manual} documents @code{flex} version
This manual was written by @value{authors}.
@menu
-* Copyright::
-* Reporting Bugs::
-* Introduction::
-* Simple Examples::
-* Format::
-* Patterns::
-* Matching::
-* Actions::
-* Generated Scanner::
-* Start Conditions::
-* Multiple Input Buffers::
-* EOF::
-* Misc Macros::
-* User Values::
-* Yacc::
-* Scanner Options::
-* Performance::
-* Cxx::
-* Reentrant::
-* Lex and Posix::
-* Memory Management::
-* Serialized Tables::
-* Diagnostics::
-* Limitations::
-* Bibliography::
-* FAQ::
-* Appendices::
-* Indices::
+* Copyright::
+* Reporting Bugs::
+* Introduction::
+* Simple Examples::
+* Format::
+* Patterns::
+* Matching::
+* Actions::
+* Generated Scanner::
+* Start Conditions::
+* Multiple Input Buffers::
+* EOF::
+* Misc Macros::
+* User Values::
+* Yacc::
+* Scanner Options::
+* Performance::
+* Cxx::
+* Reentrant::
+* Lex and Posix::
+* Memory Management::
+* Serialized Tables::
+* Diagnostics::
+* Limitations::
+* Bibliography::
+* FAQ::
+* Appendices::
+* Indices::
@detailmenu
--- The Detailed Node Listing ---
Format of the Input File
-* Definitions Section::
-* Rules Section::
-* User Code Section::
-* Comments in the Input::
+* Definitions Section::
+* Rules Section::
+* User Code Section::
+* Comments in the Input::
Scanner Options
-* Options for Specifying Filenames::
-* Options Affecting Scanner Behavior::
-* Code-Level And API Options::
-* Options for Scanner Speed and Size::
-* Debugging Options::
-* Miscellaneous Options::
+* Options for Specifying Filenames::
+* Options Affecting Scanner Behavior::
+* Code-Level And API Options::
+* Options for Scanner Speed and Size::
+* Debugging Options::
+* Miscellaneous Options::
Reentrant C Scanners
-* Reentrant Uses::
-* Reentrant Overview::
-* Reentrant Example::
-* Reentrant Detail::
-* Reentrant Functions::
+* Reentrant Uses::
+* Reentrant Overview::
+* Reentrant Example::
+* Reentrant Detail::
+* Reentrant Functions::
The Reentrant API in Detail
-* Specify Reentrant::
-* Extra Reentrant Argument::
-* Global Replacement::
-* Init and Destroy Functions::
-* Accessor Methods::
-* Extra Data::
-* About yyscan_t::
+* Specify Reentrant::
+* Extra Reentrant Argument::
+* Global Replacement::
+* Init and Destroy Functions::
+* Accessor Methods::
+* Extra Data::
+* About yyscan_t::
Memory Management
-* The Default Memory Management::
-* Overriding The Default Memory Management::
-* A Note About yytext And Memory::
+* The Default Memory Management::
+* Overriding The Default Memory Management::
+* A Note About yytext And Memory::
Serialized Tables
-* Creating Serialized Tables::
-* Loading and Unloading Serialized Tables::
-* Tables File Format::
+* Creating Serialized Tables::
+* Loading and Unloading Serialized Tables::
+* Tables File Format::
FAQ
-* When was flex born?::
-* How do I expand backslash-escape sequences in C-style quoted strings?::
-* Why do flex scanners call fileno if it is not ANSI compatible?::
-* Does flex support recursive pattern definitions?::
-* How do I skip huge chunks of input (tens of megabytes) while using flex?::
-* Flex is not matching my patterns in the same order that I defined them.::
-* My actions are executing out of order or sometimes not at all.::
-* How can I have multiple input sources feed into the same scanner at the same time?::
-* Can I build nested parsers that work with the same input file?::
-* How can I match text only at the end of a file?::
-* How can I make REJECT cascade across start condition boundaries?::
-* Why cant I use fast or full tables with interactive mode?::
-* How much faster is -F or -f than -C?::
-* If I have a simple grammar cant I just parse it with flex?::
-* Why doesn't yyrestart() set the start state back to INITIAL?::
-* How can I match C-style comments?::
-* The period isn't working the way I expected.::
-* Can I get the flex manual in another format?::
-* Does there exist a "faster" NDFA->DFA algorithm?::
-* How does flex compile the DFA so quickly?::
-* How can I use more than 8192 rules?::
-* How do I abandon a file in the middle of a scan and switch to a new file?::
-* How do I execute code only during initialization (only before the first scan)?::
-* How do I execute code at termination?::
-* Where else can I find help?::
-* Can I include comments in the "rules" section of the file?::
-* I get an error about undefined yywrap().::
-* How can I change the matching pattern at run time?::
-* How can I expand macros in the input?::
-* How can I build a two-pass scanner?::
-* How do I match any string not matched in the preceding rules?::
-* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
-* Is there a way to make flex treat NULL like a regular character?::
-* Whenever flex can not match the input it says "flex scanner jammed".::
-* Why doesn't flex have non-greedy operators like perl does?::
-* Memory leak - 16386 bytes allocated by malloc.::
-* How do I track the byte offset for lseek()?::
-* How do I use my own I/O classes in a C++ scanner?::
-* How do I skip as many chars as possible?::
-* deleteme00::
-* Are certain equivalent patterns faster than others?::
-* Is backing up a big deal?::
-* Can I fake multi-byte character support?::
-* deleteme01::
-* Can you discuss some flex internals?::
-* unput() messes up yy_at_bol::
-* The | operator is not doing what I want::
-* Why can't flex understand this variable trailing context pattern?::
-* The ^ operator isn't working::
-* Trailing context is getting confused with trailing optional patterns::
-* Is flex GNU or not?::
-* ERASEME53::
-* I need to scan if-then-else blocks and while loops::
-* ERASEME55::
-* ERASEME56::
-* ERASEME57::
-* Is there a repository for flex scanners?::
-* How can I conditionally compile or preprocess my flex input file?::
-* Where can I find grammars for lex and yacc?::
-* I get an end-of-buffer message for each character scanned.::
-* unnamed-faq-62::
-* unnamed-faq-63::
-* unnamed-faq-64::
-* unnamed-faq-65::
-* unnamed-faq-66::
-* unnamed-faq-67::
-* unnamed-faq-68::
-* unnamed-faq-69::
-* unnamed-faq-70::
-* unnamed-faq-71::
-* unnamed-faq-72::
-* unnamed-faq-73::
-* unnamed-faq-74::
-* unnamed-faq-75::
-* unnamed-faq-76::
-* unnamed-faq-77::
-* unnamed-faq-78::
-* unnamed-faq-79::
-* unnamed-faq-80::
-* unnamed-faq-81::
-* unnamed-faq-82::
-* unnamed-faq-83::
-* unnamed-faq-84::
-* unnamed-faq-85::
-* unnamed-faq-86::
-* unnamed-faq-87::
-* unnamed-faq-88::
-* unnamed-faq-90::
-* unnamed-faq-91::
-* unnamed-faq-92::
-* unnamed-faq-93::
-* unnamed-faq-94::
-* unnamed-faq-95::
-* unnamed-faq-96::
-* unnamed-faq-97::
-* unnamed-faq-98::
-* unnamed-faq-99::
-* unnamed-faq-100::
-* unnamed-faq-101::
+* When was flex born?::
+* How do I expand backslash-escape sequences in C-style quoted strings?::
+* Why do flex scanners call fileno if it is not ANSI compatible?::
+* Does flex support recursive pattern definitions?::
+* How do I skip huge chunks of input (tens of megabytes) while using flex?::
+* Flex is not matching my patterns in the same order that I defined them.::
+* My actions are executing out of order or sometimes not at all.::
+* How can I have multiple input sources feed into the same scanner at the same time?::
+* Can I build nested parsers that work with the same input file?::
+* How can I match text only at the end of a file?::
+* How can I make REJECT cascade across start condition boundaries?::
+* Why cant I use fast or full tables with interactive mode?::
+* How much faster is -F or -f than -C?::
+* If I have a simple grammar cant I just parse it with flex?::
+* Why doesn't yyrestart() set the start state back to INITIAL?::
+* How can I match C-style comments?::
+* The period isn't working the way I expected.::
+* Can I get the flex manual in another format?::
+* Does there exist a "faster" NDFA->DFA algorithm?::
+* How does flex compile the DFA so quickly?::
+* How can I use more than 8192 rules?::
+* How do I abandon a file in the middle of a scan and switch to a new file?::
+* How do I execute code only during initialization (only before the first scan)?::
+* How do I execute code at termination?::
+* Where else can I find help?::
+* Can I include comments in the "rules" section of the file?::
+* I get an error about undefined yywrap().::
+* How can I change the matching pattern at run time?::
+* How can I expand macros in the input?::
+* How can I build a two-pass scanner?::
+* How do I match any string not matched in the preceding rules?::
+* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
+* Is there a way to make flex treat NULL like a regular character?::
+* Whenever flex can not match the input it says "flex scanner jammed".::
+* Why doesn't flex have non-greedy operators like perl does?::
+* Memory leak - 16386 bytes allocated by malloc.::
+* How do I track the byte offset for lseek()?::
+* How do I use my own I/O classes in a C++ scanner?::
+* How do I skip as many chars as possible?::
+* deleteme00::
+* Are certain equivalent patterns faster than others?::
+* Is backing up a big deal?::
+* Can I fake multi-byte character support?::
+* deleteme01::
+* Can you discuss some flex internals?::
+* unput() messes up yy_at_bol::
+* The | operator is not doing what I want::
+* Why can't flex understand this variable trailing context pattern?::
+* The ^ operator isn't working::
+* Trailing context is getting confused with trailing optional patterns::
+* Is flex GNU or not?::
+* ERASEME53::
+* I need to scan if-then-else blocks and while loops::
+* ERASEME55::
+* ERASEME56::
+* ERASEME57::
+* Is there a repository for flex scanners?::
+* How can I conditionally compile or preprocess my flex input file?::
+* Where can I find grammars for lex and yacc?::
+* I get an end-of-buffer message for each character scanned.::
+* unnamed-faq-62::
+* unnamed-faq-63::
+* unnamed-faq-64::
+* unnamed-faq-65::
+* unnamed-faq-66::
+* unnamed-faq-67::
+* unnamed-faq-68::
+* unnamed-faq-69::
+* unnamed-faq-70::
+* unnamed-faq-71::
+* unnamed-faq-72::
+* unnamed-faq-73::
+* unnamed-faq-74::
+* unnamed-faq-75::
+* unnamed-faq-76::
+* unnamed-faq-77::
+* unnamed-faq-78::
+* unnamed-faq-79::
+* unnamed-faq-80::
+* unnamed-faq-81::
+* unnamed-faq-82::
+* unnamed-faq-83::
+* unnamed-faq-84::
+* unnamed-faq-85::
+* unnamed-faq-86::
+* unnamed-faq-87::
+* unnamed-faq-88::
+* unnamed-faq-90::
+* unnamed-faq-91::
+* unnamed-faq-92::
+* unnamed-faq-93::
+* unnamed-faq-94::
+* unnamed-faq-95::
+* unnamed-faq-96::
+* unnamed-faq-97::
+* unnamed-faq-98::
+* unnamed-faq-99::
+* unnamed-faq-100::
+* unnamed-faq-101::
* What is the difference between YYLEX_PARAM and YY_DECL?::
* Why do I get "conflicting types for yylex" error?::
* How do I access the values set in a Flex action from within a Bison action?::
Appendices
-* Makefiles and Flex::
-* Bison Bridge::
-* M4 Dependency::
-* Common Patterns::
+* Makefiles and Flex::
+* Bison Bridge::
+* M4 Dependency::
+* Common Patterns::
Indices
-* Concept Index::
-* Index of Functions and Macros::
-* Index of Variables::
-* Index of Data Types::
-* Index of Hooks::
-* Index of Scanner Options::
+* Concept Index::
+* Index of Functions and Macros::
+* Index of Variables::
+* Index of Data Types::
+* Index of Hooks::
+* Index of Scanner Options::
@end detailmenu
@end menu
@@ -461,10 +461,10 @@ line containing only @samp{%%}.
@end example
@menu
-* Definitions Section::
-* Rules Section::
-* User Code Section::
-* Comments in the Input::
+* Definitions Section::
+* Rules Section::
+* User Code Section::
+* Comments in the Input::
@end menu
@node Definitions Section, Rules Section, Format, Format
@@ -542,7 +542,7 @@ themselves.
A @code{%top} block is similar to a @samp{%@{} ... @samp{%@}} block, except
that the code in a @code{%top} block is relocated to the @emph{top} of the
generated file, before any flex definitions @footnote{Actually,
-@code{yyIN_HEADER} is defined before the @samp{%top} block.}.
+@code{yyIN_HEADER} is defined before the @samp{%top} block.}.
The @code{%top} block is useful when you want certain preprocessor macros to be
defined or certain files to be included before the generated code.
The single characters, @samp{@{} and @samp{@}} are used to delimit the
@@ -759,7 +759,7 @@ Options may be zero or more of the characters @samp{i}, @samp{s}, or @samp{x}.
@samp{-s} alters the meaning of @samp{.} to match any byte except @samp{\n}.
@samp{x} ignores comments and whitespace in patterns. Whitespace is ignored unless
-it is backslash-escaped, contained within @samp{""}s, or appears inside a
+it is backslash-escaped, contained within @samp{""}s, or appears inside a
character class.
The following are all valid:
@@ -930,7 +930,7 @@ For example, the following character classes are all equivalent:
@end verbatim
@end example
-A word of caution. Character classes are expanded immediately when seen in the @code{flex} input.
+A word of caution. Character classes are expanded immediately when seen in the @code{flex} input.
This means the character classes are sensitive to the locale in which @code{flex}
is executed, and the resulting scanner will not be sensitive to the runtime locale.
This may or may not be desirable.
@@ -1499,7 +1499,7 @@ definitions prevent us from using any standard data types smaller than
int (such as short, char, or bool) as function arguments. For this
reason, future versions of @code{flex} may generate standard C99 code
only, leaving K&R-style functions to the historians. Currently, if you
-do @strong{not} want @samp{C99} definitions, then you must use
+do @strong{not} want @samp{C99} definitions, then you must use
@code{%option noansi-definitions}.
@cindex stdin, default for yyin
@@ -2061,7 +2061,7 @@ This function pushes the new buffer state onto an internal stack. The pushed
state becomes the new current state. The stack is maintained by flex and will
grow as required. This function is intended to be used instead of
@code{yy_switch_to_buffer}, when you want to change states, but preserve the
-current state for later use.
+current state for later use.
@cindex popping an input buffer
@cindex stack, input buffer pop
@@ -2488,12 +2488,12 @@ The various @code{flex} options are categorized by function in the following
menu. If you want to lookup a particular option by name, @xref{Index of Scanner Options}.
@menu
-* Options for Specifying Filenames::
-* Options Affecting Scanner Behavior::
-* Code-Level And API Options::
-* Options for Scanner Speed and Size::
-* Debugging Options::
-* Miscellaneous Options::
+* Options for Specifying Filenames::
+* Options Affecting Scanner Behavior::
+* Code-Level And API Options::
+* Options for Scanner Speed and Size::
+* Debugging Options::
+* Miscellaneous Options::
@end menu
Even though there are many scanner options, a typical scanner might only
@@ -2623,7 +2623,7 @@ This option is for flex development. We document it here in case you stumble
upon it by accident or in case you suspect some inconsistency in the serialized
tables. Flex will serialize the scanner dfa tables but will also generate the
in-code tables as it normally does. At runtime, the scanner will verify that
-the serialized tables match the in-code tables, instead of loading them.
+the serialized tables match the in-code tables, instead of loading them.
@end table
@@ -2870,7 +2870,7 @@ is generated.
@opindex ---option-ansi-prototypes
@opindex ansi-prototypes
@item --ansi-prototypes, @code{%option ansi-prototypes}
-instructs flex to generate ANSI C99 prototypes for functions.
+instructs flex to generate ANSI C99 prototypes for functions.
This option is enabled by default.
If @code{noansi-prototypes} is specified, then
prototypes will have empty parameter lists.
@@ -2894,7 +2894,7 @@ is modified to take an additional parameter,
@opindex ---bison-locations
@opindex bison-locations
@item --bison-locations, @code{%option bison-locations}
-instruct flex that
+instruct flex that
@code{GNU bison} @code{%locations} are being used.
This means @code{yylex} will be passed
an additional parameter, @code{yylloc}. This option
@@ -3992,11 +3992,11 @@ multi-threaded applications. Any thread may create and execute a reentrant
@code{flex} scanner without the need for synchronization with other threads.
@menu
-* Reentrant Uses::
-* Reentrant Overview::
-* Reentrant Example::
-* Reentrant Detail::
-* Reentrant Functions::
+* Reentrant Uses::
+* Reentrant Overview::
+* Reentrant Example::
+* Reentrant Detail::
+* Reentrant Functions::
@end menu
@node Reentrant Uses, Reentrant Overview, Reentrant, Reentrant
@@ -4127,13 +4127,13 @@ Here are the things you need to do or know to use the reentrant C API of
@code{flex}.
@menu
-* Specify Reentrant::
-* Extra Reentrant Argument::
-* Global Replacement::
-* Init and Destroy Functions::
-* Accessor Methods::
-* Extra Data::
-* About yyscan_t::
+* Specify Reentrant::
+* Extra Reentrant Argument::
+* Global Replacement::
+* Init and Destroy Functions::
+* Accessor Methods::
+* Extra Data::
+* About yyscan_t::
@end menu
@node Specify Reentrant, Extra Reentrant Argument, Reentrant Detail, Reentrant Detail
@@ -4369,7 +4369,7 @@ be accessed from within the very first yyalloc, used to allocate
the scanner itself.
By default, @code{YY_EXTRA_TYPE} is defined as type @code{void *}. You
-may redefine this type using @code{%option extra-type="your_type"} in
+may redefine this type using @code{%option extra-type="your_type"} in
the scanner:
@cindex YY_EXTRA_TYPE, defining your own type
@@ -4784,9 +4784,9 @@ This chapter describes how flex handles dynamic memory, and how you can
override the default behavior.
@menu
-* The Default Memory Management::
-* Overriding The Default Memory Management::
-* A Note About yytext And Memory::
+* The Default Memory Management::
+* Overriding The Default Memory Management::
+* A Note About yytext And Memory::
@end menu
@node The Default Memory Management, Overriding The Default Memory Management, Memory Management, Memory Management
@@ -4800,7 +4800,7 @@ buffer. As of version 2.5.9 Flex will clean up all memory when you call @code{yy
Flex allocates dynamic memory for four purposes, listed below @footnote{The
quantities given here are approximate, and may vary due to host architecture,
-compiler configuration, or due to future enhancements to flex.}
+compiler configuration, or due to future enhancements to flex.}
@table @asis
@@ -4815,7 +4815,7 @@ buffer is the length of the longest token expected, in bytes, plus a little more
extra bytes for housekeeping. Currently, to override the size of the input buffer
you must @code{#define YY_BUF_SIZE} to whatever number of bytes you want. We don't plan
to change this in the near future, but we reserve the right to do so if we ever add a more robust memory management
-API.
+API.
@item 64kb for the REJECT state. This will only be allocated if you use REJECT.
The size is large enough to hold the same number of states as characters in the input buffer. If you override the size of the
@@ -4917,7 +4917,7 @@ custom allocator through @code{yyextra}.
%option reentrant
/* Initialize the allocator. */
-n%{
+%{
#define YY_EXTRA_TYPE struct allocator*
#define YY_USER_INIT yyextra = allocator_create();
%}
@@ -4935,7 +4935,7 @@ void * yyrealloc (void * ptr, size_t bytes, void* yyscanner) {
return allocator_realloc (yyextra, bytes);
}
-void yyfree (void * ptr, void * yyscanner) {
+void yyfree (void * ptr, void * yyscanner) {
/* Do nothing -- we leave it to the garbage collector. */
}
@@ -4983,9 +4983,9 @@ The serialization feature allows the tables to be loaded at runtime, before
scanning begins. The tables may be discarded when scanning is finished.
@menu
-* Creating Serialized Tables::
-* Loading and Unloading Serialized Tables::
-* Tables File Format::
+* Creating Serialized Tables::
+* Loading and Unloading Serialized Tables::
+* Tables File Format::
@end menu
@node Creating Serialized Tables, Loading and Unloading Serialized Tables, Serialized Tables, Serialized Tables
@@ -5006,7 +5006,7 @@ or
These options instruct flex to save the DFA tables to the file @var{FILE}. The tables
will @emph{not} be embedded in the generated scanner. The scanner will not
function on its own. The scanner will be dependent upon the serialized tables. You must
-load the tables from this file at runtime before you can scan anything.
+load the tables from this file at runtime before you can scan anything.
If you do not specify a filename to @code{--tables-file}, the tables will be
saved to @file{lex.yy.tables}, where @samp{yy} is the appropriate prefix.
@@ -5123,7 +5123,7 @@ and tables sections are padded to 64-bit boundaries. Below we describe each
field in detail. This format does not specify how the scanner will expand the
given data, i.e., data may be serialized as int8, but expanded to an int32
array at runtime. This is to reduce the size of the serialized data where
-possible. Remember, @emph{all integer values are in network byte order}.
+possible. Remember, @emph{all integer values are in network byte order}.
@noindent
Fields of a table header:
@@ -5415,105 +5415,105 @@ questions. Rather than repeat answers to well-understood problems, we
publish them here.
@menu
-* When was flex born?::
-* How do I expand backslash-escape sequences in C-style quoted strings?::
-* Why do flex scanners call fileno if it is not ANSI compatible?::
-* Does flex support recursive pattern definitions?::
-* How do I skip huge chunks of input (tens of megabytes) while using flex?::
-* Flex is not matching my patterns in the same order that I defined them.::
-* My actions are executing out of order or sometimes not at all.::
-* How can I have multiple input sources feed into the same scanner at the same time?::
-* Can I build nested parsers that work with the same input file?::
-* How can I match text only at the end of a file?::
-* How can I make REJECT cascade across start condition boundaries?::
-* Why cant I use fast or full tables with interactive mode?::
-* How much faster is -F or -f than -C?::
-* If I have a simple grammar cant I just parse it with flex?::
-* Why doesn't yyrestart() set the start state back to INITIAL?::
-* How can I match C-style comments?::
-* The period isn't working the way I expected.::
-* Can I get the flex manual in another format?::
-* Does there exist a "faster" NDFA->DFA algorithm?::
-* How does flex compile the DFA so quickly?::
-* How can I use more than 8192 rules?::
-* How do I abandon a file in the middle of a scan and switch to a new file?::
-* How do I execute code only during initialization (only before the first scan)?::
-* How do I execute code at termination?::
-* Where else can I find help?::
-* Can I include comments in the "rules" section of the file?::
-* I get an error about undefined yywrap().::
-* How can I change the matching pattern at run time?::
-* How can I expand macros in the input?::
-* How can I build a two-pass scanner?::
-* How do I match any string not matched in the preceding rules?::
-* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
-* Is there a way to make flex treat NULL like a regular character?::
-* Whenever flex can not match the input it says "flex scanner jammed".::
-* Why doesn't flex have non-greedy operators like perl does?::
-* Memory leak - 16386 bytes allocated by malloc.::
-* How do I track the byte offset for lseek()?::
-* How do I use my own I/O classes in a C++ scanner?::
-* How do I skip as many chars as possible?::
-* deleteme00::
-* Are certain equivalent patterns faster than others?::
-* Is backing up a big deal?::
-* Can I fake multi-byte character support?::
-* deleteme01::
-* Can you discuss some flex internals?::
-* unput() messes up yy_at_bol::
-* The | operator is not doing what I want::
-* Why can't flex understand this variable trailing context pattern?::
-* The ^ operator isn't working::
-* Trailing context is getting confused with trailing optional patterns::
-* Is flex GNU or not?::
-* ERASEME53::
-* I need to scan if-then-else blocks and while loops::
-* ERASEME55::
-* ERASEME56::
-* ERASEME57::
-* Is there a repository for flex scanners?::
-* How can I conditionally compile or preprocess my flex input file?::
-* Where can I find grammars for lex and yacc?::
-* I get an end-of-buffer message for each character scanned.::
-* unnamed-faq-62::
-* unnamed-faq-63::
-* unnamed-faq-64::
-* unnamed-faq-65::
-* unnamed-faq-66::
-* unnamed-faq-67::
-* unnamed-faq-68::
-* unnamed-faq-69::
-* unnamed-faq-70::
-* unnamed-faq-71::
-* unnamed-faq-72::
-* unnamed-faq-73::
-* unnamed-faq-74::
-* unnamed-faq-75::
-* unnamed-faq-76::
-* unnamed-faq-77::
-* unnamed-faq-78::
-* unnamed-faq-79::
-* unnamed-faq-80::
-* unnamed-faq-81::
-* unnamed-faq-82::
-* unnamed-faq-83::
-* unnamed-faq-84::
-* unnamed-faq-85::
-* unnamed-faq-86::
-* unnamed-faq-87::
-* unnamed-faq-88::
-* unnamed-faq-90::
-* unnamed-faq-91::
-* unnamed-faq-92::
-* unnamed-faq-93::
-* unnamed-faq-94::
-* unnamed-faq-95::
-* unnamed-faq-96::
-* unnamed-faq-97::
-* unnamed-faq-98::
-* unnamed-faq-99::
-* unnamed-faq-100::
-* unnamed-faq-101::
+* When was flex born?::
+* How do I expand backslash-escape sequences in C-style quoted strings?::
+* Why do flex scanners call fileno if it is not ANSI compatible?::
+* Does flex support recursive pattern definitions?::
+* How do I skip huge chunks of input (tens of megabytes) while using flex?::
+* Flex is not matching my patterns in the same order that I defined them.::
+* My actions are executing out of order or sometimes not at all.::
+* How can I have multiple input sources feed into the same scanner at the same time?::
+* Can I build nested parsers that work with the same input file?::
+* How can I match text only at the end of a file?::
+* How can I make REJECT cascade across start condition boundaries?::
+* Why cant I use fast or full tables with interactive mode?::
+* How much faster is -F or -f than -C?::
+* If I have a simple grammar cant I just parse it with flex?::
+* Why doesn't yyrestart() set the start state back to INITIAL?::
+* How can I match C-style comments?::
+* The period isn't working the way I expected.::
+* Can I get the flex manual in another format?::
+* Does there exist a "faster" NDFA->DFA algorithm?::
+* How does flex compile the DFA so quickly?::
+* How can I use more than 8192 rules?::
+* How do I abandon a file in the middle of a scan and switch to a new file?::
+* How do I execute code only during initialization (only before the first scan)?::
+* How do I execute code at termination?::
+* Where else can I find help?::
+* Can I include comments in the "rules" section of the file?::
+* I get an error about undefined yywrap().::
+* How can I change the matching pattern at run time?::
+* How can I expand macros in the input?::
+* How can I build a two-pass scanner?::
+* How do I match any string not matched in the preceding rules?::
+* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
+* Is there a way to make flex treat NULL like a regular character?::
+* Whenever flex can not match the input it says "flex scanner jammed".::
+* Why doesn't flex have non-greedy operators like perl does?::
+* Memory leak - 16386 bytes allocated by malloc.::
+* How do I track the byte offset for lseek()?::
+* How do I use my own I/O classes in a C++ scanner?::
+* How do I skip as many chars as possible?::
+* deleteme00::
+* Are certain equivalent patterns faster than others?::
+* Is backing up a big deal?::
+* Can I fake multi-byte character support?::
+* deleteme01::
+* Can you discuss some flex internals?::
+* unput() messes up yy_at_bol::
+* The | operator is not doing what I want::
+* Why can't flex understand this variable trailing context pattern?::
+* The ^ operator isn't working::
+* Trailing context is getting confused with trailing optional patterns::
+* Is flex GNU or not?::
+* ERASEME53::
+* I need to scan if-then-else blocks and while loops::
+* ERASEME55::
+* ERASEME56::
+* ERASEME57::
+* Is there a repository for flex scanners?::
+* How can I conditionally compile or preprocess my flex input file?::
+* Where can I find grammars for lex and yacc?::
+* I get an end-of-buffer message for each character scanned.::
+* unnamed-faq-62::
+* unnamed-faq-63::
+* unnamed-faq-64::
+* unnamed-faq-65::
+* unnamed-faq-66::
+* unnamed-faq-67::
+* unnamed-faq-68::
+* unnamed-faq-69::
+* unnamed-faq-70::
+* unnamed-faq-71::
+* unnamed-faq-72::
+* unnamed-faq-73::
+* unnamed-faq-74::
+* unnamed-faq-75::
+* unnamed-faq-76::
+* unnamed-faq-77::
+* unnamed-faq-78::
+* unnamed-faq-79::
+* unnamed-faq-80::
+* unnamed-faq-81::
+* unnamed-faq-82::
+* unnamed-faq-83::
+* unnamed-faq-84::
+* unnamed-faq-85::
+* unnamed-faq-86::
+* unnamed-faq-87::
+* unnamed-faq-88::
+* unnamed-faq-90::
+* unnamed-faq-91::
+* unnamed-faq-92::
+* unnamed-faq-93::
+* unnamed-faq-94::
+* unnamed-faq-95::
+* unnamed-faq-96::
+* unnamed-faq-97::
+* unnamed-faq-98::
+* unnamed-faq-99::
+* unnamed-faq-100::
+* unnamed-faq-101::
* What is the difference between YYLEX_PARAM and YY_DECL?::
* Why do I get "conflicting types for yylex" error?::
* How do I access the values set in a Flex action from within a Bison action?::
@@ -8162,10 +8162,10 @@ See @ref{Top, , , bison, the GNU Bison Manual}.
@appendix Appendices
@menu
-* Makefiles and Flex::
-* Bison Bridge::
-* M4 Dependency::
-* Common Patterns::
+* Makefiles and Flex::
+* Bison Bridge::
+* M4 Dependency::
+* Common Patterns::
@end menu
@node Makefiles and Flex, Bison Bridge, Appendices, Appendices
@@ -8395,13 +8395,13 @@ code from unwanted @code{m4} processing.
@itemize
@item Do not use symbols that begin with, @samp{m4_}, such as, @samp{m4_define},
-or @samp{m4_include}, since those are reserved for @code{m4} macro names. If for
+or @samp{m4_include}, since those are reserved for @code{m4} macro names. If for
some reason you need m4_ as a prefix, use a preprocessor #define to get your
symbol past m4 unmangled.
@item Do not use the strings @samp{[[} or @samp{]]} anywhere in your code. The
former is not valid in C, except within comments and strings, but the latter is valid in
-code such as @code{x[y[z]]}. The solution is simple. To get the literal string
+code such as @code{x[y[z]]}. The solution is simple. To get the literal string
@code{"]]"}, use @code{"]""]"}. To get the array notation @code{x[y[z]]},
use @code{x[y[z] ]}. Flex will attempt to detect these sequences in user code, and
escape them. However, it's best to avoid this complexity where possible, by
@@ -8420,10 +8420,10 @@ This appendix provides examples of common regular expressions you might use
in your scanner.
@menu
-* Numbers::
-* Identifiers::
-* Quoted Constructs::
-* Addresses::
+* Numbers::
+* Identifiers::
+* Quoted Constructs::
+* Addresses::
@end menu
@@ -8564,12 +8564,12 @@ to appear in a URI, including spaces and control characters. See
@unnumbered Indices
@menu
-* Concept Index::
-* Index of Functions and Macros::
-* Index of Variables::
-* Index of Data Types::
-* Index of Hooks::
-* Index of Scanner Options::
+* Concept Index::
+* Index of Functions and Macros::
+* Index of Variables::
+* Index of Data Types::
+* Index of Hooks::
+* Index of Scanner Options::
@end menu
@node Concept Index, Index of Functions and Macros, Indices, Indices
diff --git a/doc/mdate-sh b/doc/mdate-sh
deleted file mode 100755
index 60dc485..0000000
--- a/doc/mdate-sh
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# Get modification time of a file or directory and pretty-print it.
-
-scriptversion=2010-08-21.06; # UTC
-
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009, 2010
-# Free Software Foundation, Inc.
-# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-fi
-
-case $1 in
- '')
- echo "$0: No file. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: mdate-sh [--help] [--version] FILE
-
-Pretty-print the modification day of FILE, in the format:
-1 January 1970
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "mdate-sh $scriptversion"
- exit $?
- ;;
-esac
-
-error ()
-{
- echo "$0: $1" >&2
- exit 1
-}
-
-
-# Prevent date giving response in another language.
-LANG=C
-export LANG
-LC_ALL=C
-export LC_ALL
-LC_TIME=C
-export LC_TIME
-
-# GNU ls changes its time format in response to the TIME_STYLE
-# variable. Since we cannot assume `unset' works, revert this
-# variable to its documented default.
-if test "${TIME_STYLE+set}" = set; then
- TIME_STYLE=posix-long-iso
- export TIME_STYLE
-fi
-
-save_arg1=$1
-
-# Find out how to get the extended ls output of a file or directory.
-if ls -L /dev/null 1>/dev/null 2>&1; then
- ls_command='ls -L -l -d'
-else
- ls_command='ls -l -d'
-fi
-# Avoid user/group names that might have spaces, when possible.
-if ls -n /dev/null 1>/dev/null 2>&1; then
- ls_command="$ls_command -n"
-fi
-
-# A `ls -l' line looks as follows on OS/2.
-# drwxrwx--- 0 Aug 11 2001 foo
-# This differs from Unix, which adds ownership information.
-# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
-#
-# To find the date, we split the line on spaces and iterate on words
-# until we find a month. This cannot work with files whose owner is a
-# user named `Jan', or `Feb', etc. However, it's unlikely that `/'
-# will be owned by a user whose name is a month. So we first look at
-# the extended ls output of the root directory to decide how many
-# words should be skipped to get the date.
-
-# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
-set x`$ls_command /`
-
-# Find which argument is the month.
-month=
-command=
-until test $month
-do
- test $# -gt 0 || error "failed parsing \`$ls_command /' output"
- shift
- # Add another shift to the command.
- command="$command shift;"
- case $1 in
- Jan) month=January; nummonth=1;;
- Feb) month=February; nummonth=2;;
- Mar) month=March; nummonth=3;;
- Apr) month=April; nummonth=4;;
- May) month=May; nummonth=5;;
- Jun) month=June; nummonth=6;;
- Jul) month=July; nummonth=7;;
- Aug) month=August; nummonth=8;;
- Sep) month=September; nummonth=9;;
- Oct) month=October; nummonth=10;;
- Nov) month=November; nummonth=11;;
- Dec) month=December; nummonth=12;;
- esac
-done
-
-test -n "$month" || error "failed parsing \`$ls_command /' output"
-
-# Get the extended ls output of the file or directory.
-set dummy x`eval "$ls_command \"\\\$save_arg1\""`
-
-# Remove all preceding arguments
-eval $command
-
-# Because of the dummy argument above, month is in $2.
-#
-# On a POSIX system, we should have
-#
-# $# = 5
-# $1 = file size
-# $2 = month
-# $3 = day
-# $4 = year or time
-# $5 = filename
-#
-# On Darwin 7.7.0 and 7.6.0, we have
-#
-# $# = 4
-# $1 = day
-# $2 = month
-# $3 = year or time
-# $4 = filename
-
-# Get the month.
-case $2 in
- Jan) month=January; nummonth=1;;
- Feb) month=February; nummonth=2;;
- Mar) month=March; nummonth=3;;
- Apr) month=April; nummonth=4;;
- May) month=May; nummonth=5;;
- Jun) month=June; nummonth=6;;
- Jul) month=July; nummonth=7;;
- Aug) month=August; nummonth=8;;
- Sep) month=September; nummonth=9;;
- Oct) month=October; nummonth=10;;
- Nov) month=November; nummonth=11;;
- Dec) month=December; nummonth=12;;
-esac
-
-case $3 in
- ???*) day=$1;;
- *) day=$3; shift;;
-esac
-
-# Here we have to deal with the problem that the ls output gives either
-# the time of day or the year.
-case $3 in
- *:*) set `date`; eval year=\$$#
- case $2 in
- Jan) nummonthtod=1;;
- Feb) nummonthtod=2;;
- Mar) nummonthtod=3;;
- Apr) nummonthtod=4;;
- May) nummonthtod=5;;
- Jun) nummonthtod=6;;
- Jul) nummonthtod=7;;
- Aug) nummonthtod=8;;
- Sep) nummonthtod=9;;
- Oct) nummonthtod=10;;
- Nov) nummonthtod=11;;
- Dec) nummonthtod=12;;
- esac
- # For the first six month of the year the time notation can also
- # be used for files modified in the last year.
- if (expr $nummonth \> $nummonthtod) > /dev/null;
- then
- year=`expr $year - 1`
- fi;;
- *) year=$3;;
-esac
-
-# The result.
-echo $day $month $year
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/doc/stamp-vti b/doc/stamp-vti
index 1a495a7..cc91319 100644
--- a/doc/stamp-vti
+++ b/doc/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 6 December 2012
-@set UPDATED-MONTH December 2012
-@set EDITION 2.5.39
-@set VERSION 2.5.39
+@set UPDATED 10 November 2015
+@set UPDATED-MONTH November 2015
+@set EDITION 2.6.0
+@set VERSION 2.6.0
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
deleted file mode 100644
index 85b68e7..0000000
--- a/doc/texinfo.tex
+++ /dev/null
@@ -1,9977 +0,0 @@
-% texinfo.tex -- TeX macros to handle Texinfo files.
-%
-% Load plain if necessary, i.e., if running under initex.
-\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
-%
-\def\texinfoversion{2012-03-11.15}
-%
-% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
-% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
-%
-% This texinfo.tex file 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 texinfo.tex file 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, when this file is read by TeX when processing
-% a Texinfo source document, you may use the result without
-% restriction. (This has been our intent since Texinfo was invented.)
-%
-% Please try the latest version of texinfo.tex before submitting bug
-% reports; you can get the latest version from:
-% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
-% ftp://tug.org/tex/texinfo.tex
-% (and all CTAN mirrors, see http://www.ctan.org).
-% The texinfo.tex in any given distribution could well be out
-% of date, so if that's what you're using, please check.
-%
-% Send bug reports to bug-texinfo@gnu.org. Please include including a
-% complete document in each bug report with which we can reproduce the
-% problem. Patches are, of course, greatly appreciated.
-%
-% To process a Texinfo manual with TeX, it's most reliable to use the
-% texi2dvi shell script that comes with the distribution. For a simple
-% manual foo.texi, however, you can get away with this:
-% tex foo.texi
-% texindex foo.??
-% tex foo.texi
-% tex foo.texi
-% dvips foo.dvi -o # or whatever; this makes foo.ps.
-% The extra TeX runs get the cross-reference information correct.
-% Sometimes one run after texindex suffices, and sometimes you need more
-% than two; texi2dvi does it as many times as necessary.
-%
-% It is possible to adapt texinfo.tex for other languages, to some
-% extent. You can get the existing language-specific files from the
-% full Texinfo distribution.
-%
-% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
-
-
-\message{Loading texinfo [version \texinfoversion]:}
-
-% If in a .fmt file, print the version number
-% and turn on active characters that we couldn't do earlier because
-% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}%
- \catcode`+=\active \catcode`\_=\active}
-
-\chardef\other=12
-
-% We never want plain's \outer definition of \+ in Texinfo.
-% For @tex, we can use \tabalign.
-\let\+ = \relax
-
-% Save some plain tex macros whose names we will redefine.
-\let\ptexb=\b
-\let\ptexbullet=\bullet
-\let\ptexc=\c
-\let\ptexcomma=\,
-\let\ptexdot=\.
-\let\ptexdots=\dots
-\let\ptexend=\end
-\let\ptexequiv=\equiv
-\let\ptexexclam=\!
-\let\ptexfootnote=\footnote
-\let\ptexgtr=>
-\let\ptexhat=^
-\let\ptexi=\i
-\let\ptexindent=\indent
-\let\ptexinsert=\insert
-\let\ptexlbrace=\{
-\let\ptexless=<
-\let\ptexnewwrite\newwrite
-\let\ptexnoindent=\noindent
-\let\ptexplus=+
-\let\ptexraggedright=\raggedright
-\let\ptexrbrace=\}
-\let\ptexslash=\/
-\let\ptexstar=\*
-\let\ptext=\t
-\let\ptextop=\top
-{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
-
-% If this character appears in an error message or help string, it
-% starts a new line in the output.
-\newlinechar = `^^J
-
-% Use TeX 3.0's \inputlineno to get the line number, for better error
-% messages, but if we're using an old version of TeX, don't do anything.
-%
-\ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Pre-3.0.
-\else
- \def\linenumber{l.\the\inputlineno:\space}
-\fi
-
-% Set up fixed words for English if not already set.
-\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
-\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
-\ifx\putworderror\undefined \gdef\putworderror{error}\fi
-\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
-\ifx\putwordin\undefined \gdef\putwordin{in}\fi
-\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
-\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
-\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
-\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
-\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
-\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
-\ifx\putwordof\undefined \gdef\putwordof{of}\fi
-\ifx\putwordon\undefined \gdef\putwordon{on}\fi
-\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
-\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
-\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
-\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
-\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
-\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
-\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
-%
-\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
-\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
-\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
-\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
-\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
-\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
-\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
-\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
-\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
-\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
-\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
-\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
-%
-\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
-\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
-\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
-\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
-\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
-
-% Since the category of space is not known, we have to be careful.
-\chardef\spacecat = 10
-\def\spaceisspace{\catcode`\ =\spacecat}
-
-% sometimes characters are active, so we need control sequences.
-\chardef\ampChar = `\&
-\chardef\colonChar = `\:
-\chardef\commaChar = `\,
-\chardef\dashChar = `\-
-\chardef\dotChar = `\.
-\chardef\exclamChar= `\!
-\chardef\hashChar = `\#
-\chardef\lquoteChar= `\`
-\chardef\questChar = `\?
-\chardef\rquoteChar= `\'
-\chardef\semiChar = `\;
-\chardef\slashChar = `\/
-\chardef\underChar = `\_
-
-% Ignore a token.
-%
-\def\gobble#1{}
-
-% The following is used inside several \edef's.
-\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
-
-% Hyphenation fixes.
-\hyphenation{
- Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
- ap-pen-dix bit-map bit-maps
- data-base data-bases eshell fall-ing half-way long-est man-u-script
- man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
- par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
- spell-ing spell-ings
- stand-alone strong-est time-stamp time-stamps which-ever white-space
- wide-spread wrap-around
-}
-
-% Margin to add to right of even pages, to left of odd pages.
-\newdimen\bindingoffset
-\newdimen\normaloffset
-\newdimen\pagewidth \newdimen\pageheight
-
-% For a final copy, take out the rectangles
-% that mark overfull boxes (in case you have decided
-% that the text looks ok even though it passes the margin).
-%
-\def\finalout{\overfullrule=0pt }
-
-% Sometimes it is convenient to have everything in the transcript file
-% and nothing on the terminal. We don't just call \tracingall here,
-% since that produces some useless output on the terminal. We also make
-% some effort to order the tracing commands to reduce output in the log
-% file; cf. trace.sty in LaTeX.
-%
-\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
-\def\loggingall{%
- \tracingstats2
- \tracingpages1
- \tracinglostchars2 % 2 gives us more in etex
- \tracingparagraphs1
- \tracingoutput1
- \tracingmacros2
- \tracingrestores1
- \showboxbreadth\maxdimen \showboxdepth\maxdimen
- \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
- \tracingscantokens1
- \tracingifs1
- \tracinggroups1
- \tracingnesting2
- \tracingassigns1
- \fi
- \tracingcommands3 % 3 gives us more in etex
- \errorcontextlines16
-}%
-
-% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
-% aren't perfect, it's not the end of the world, being an error message,
-% after all.
-%
-\def\errormsg{\begingroup \indexnofonts \doerrormsg}
-\def\doerrormsg#1{\errmessage{#1}}
-
-% add check for \lastpenalty to plain's definitions. If the last thing
-% we did was a \nobreak, we don't want to insert more space.
-%
-\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
- \removelastskip\penalty-50\smallskip\fi\fi}
-\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
- \removelastskip\penalty-100\medskip\fi\fi}
-\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
- \removelastskip\penalty-200\bigskip\fi\fi}
-
-% Do @cropmarks to get crop marks.
-%
-\newif\ifcropmarks
-\let\cropmarks = \cropmarkstrue
-%
-% Dimensions to add cropmarks at corners.
-% Added by P. A. MacKay, 12 Nov. 1986
-%
-\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
-\newdimen\cornerlong \cornerlong=1pc
-\newdimen\cornerthick \cornerthick=.3pt
-\newdimen\topandbottommargin \topandbottommargin=.75in
-
-% Output a mark which sets \thischapter, \thissection and \thiscolor.
-% We dump everything together because we only have one kind of mark.
-% This works because we only use \botmark / \topmark, not \firstmark.
-%
-% A mark contains a subexpression of the \ifcase ... \fi construct.
-% \get*marks macros below extract the needed part using \ifcase.
-%
-% Another complication is to let the user choose whether \thischapter
-% (\thissection) refers to the chapter (section) in effect at the top
-% of a page, or that at the bottom of a page. The solution is
-% described on page 260 of The TeXbook. It involves outputting two
-% marks for the sectioning macros, one before the section break, and
-% one after. I won't pretend I can describe this better than DEK...
-\def\domark{%
- \toks0=\expandafter{\lastchapterdefs}%
- \toks2=\expandafter{\lastsectiondefs}%
- \toks4=\expandafter{\prevchapterdefs}%
- \toks6=\expandafter{\prevsectiondefs}%
- \toks8=\expandafter{\lastcolordefs}%
- \mark{%
- \the\toks0 \the\toks2
- \noexpand\or \the\toks4 \the\toks6
- \noexpand\else \the\toks8
- }%
-}
-% \topmark doesn't work for the very first chapter (after the title
-% page or the contents), so we use \firstmark there -- this gets us
-% the mark with the chapter defs, unless the user sneaks in, e.g.,
-% @setcolor (or @url, or @link, etc.) between @contents and the very
-% first @chapter.
-\def\gettopheadingmarks{%
- \ifcase0\topmark\fi
- \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
-}
-\def\getbottomheadingmarks{\ifcase1\botmark\fi}
-\def\getcolormarks{\ifcase2\topmark\fi}
-
-% Avoid "undefined control sequence" errors.
-\def\lastchapterdefs{}
-\def\lastsectiondefs{}
-\def\prevchapterdefs{}
-\def\prevsectiondefs{}
-\def\lastcolordefs{}
-
-% Main output routine.
-\chardef\PAGE = 255
-\output = {\onepageout{\pagecontents\PAGE}}
-
-\newbox\headlinebox
-\newbox\footlinebox
-
-% \onepageout takes a vbox as an argument. Note that \pagecontents
-% does insertions, but you have to call it yourself.
-\def\onepageout#1{%
- \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
- %
- \ifodd\pageno \advance\hoffset by \bindingoffset
- \else \advance\hoffset by -\bindingoffset\fi
- %
- % Do this outside of the \shipout so @code etc. will be expanded in
- % the headline as they should be, not taken literally (outputting ''code).
- \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
- \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
- \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
- \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
- %
- {%
- % Have to do this stuff outside the \shipout because we want it to
- % take effect in \write's, yet the group defined by the \vbox ends
- % before the \shipout runs.
- %
- \indexdummies % don't expand commands in the output.
- \normalturnoffactive % \ in index entries must not stay \, e.g., if
- % the page break happens to be in the middle of an example.
- % We don't want .vr (or whatever) entries like this:
- % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
- % "\acronym" won't work when it's read back in;
- % it needs to be
- % {\code {{\tt \backslashcurfont }acronym}
- \shipout\vbox{%
- % Do this early so pdf references go to the beginning of the page.
- \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
- %
- \ifcropmarks \vbox to \outervsize\bgroup
- \hsize = \outerhsize
- \vskip-\topandbottommargin
- \vtop to0pt{%
- \line{\ewtop\hfil\ewtop}%
- \nointerlineskip
- \line{%
- \vbox{\moveleft\cornerthick\nstop}%
- \hfill
- \vbox{\moveright\cornerthick\nstop}%
- }%
- \vss}%
- \vskip\topandbottommargin
- \line\bgroup
- \hfil % center the page within the outer (page) hsize.
- \ifodd\pageno\hskip\bindingoffset\fi
- \vbox\bgroup
- \fi
- %
- \unvbox\headlinebox
- \pagebody{#1}%
- \ifdim\ht\footlinebox > 0pt
- % Only leave this space if the footline is nonempty.
- % (We lessened \vsize for it in \oddfootingyyy.)
- % The \baselineskip=24pt in plain's \makefootline has no effect.
- \vskip 24pt
- \unvbox\footlinebox
- \fi
- %
- \ifcropmarks
- \egroup % end of \vbox\bgroup
- \hfil\egroup % end of (centering) \line\bgroup
- \vskip\topandbottommargin plus1fill minus1fill
- \boxmaxdepth = \cornerthick
- \vbox to0pt{\vss
- \line{%
- \vbox{\moveleft\cornerthick\nsbot}%
- \hfill
- \vbox{\moveright\cornerthick\nsbot}%
- }%
- \nointerlineskip
- \line{\ewbot\hfil\ewbot}%
- }%
- \egroup % \vbox from first cropmarks clause
- \fi
- }% end of \shipout\vbox
- }% end of group with \indexdummies
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi
-}
-
-\newinsert\margin \dimen\margin=\maxdimen
-
-\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
-{\catcode`\@ =11
-\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
-% marginal hacks, juha@viisa.uucp (Juha Takala)
-\ifvoid\margin\else % marginal info is present
- \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
-\dimen@=\dp#1\relax \unvbox#1\relax
-\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
-\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
-}
-
-% Here are the rules for the cropmarks. Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
- {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
- {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
-% Parse an argument, then pass it to #1. The argument is the rest of
-% the input line (except we remove a trailing comment). #1 should be a
-% macro which expects an ordinary undelimited TeX argument.
-%
-\def\parsearg{\parseargusing{}}
-\def\parseargusing#1#2{%
- \def\argtorun{#2}%
- \begingroup
- \obeylines
- \spaceisspace
- #1%
- \parseargline\empty% Insert the \empty token, see \finishparsearg below.
-}
-
-{\obeylines %
- \gdef\parseargline#1^^M{%
- \endgroup % End of the group started in \parsearg.
- \argremovecomment #1\comment\ArgTerm%
- }%
-}
-
-% First remove any @comment, then any @c comment.
-\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
-\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
-
-% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
-%
-% \argremovec might leave us with trailing space, e.g.,
-% @end itemize @c foo
-% This space token undergoes the same procedure and is eventually removed
-% by \finishparsearg.
-%
-\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
-\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
-\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
- \def\temp{#3}%
- \ifx\temp\empty
- % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
- \let\temp\finishparsearg
- \else
- \let\temp\argcheckspaces
- \fi
- % Put the space token in:
- \temp#1 #3\ArgTerm
-}
-
-% If a _delimited_ argument is enclosed in braces, they get stripped; so
-% to get _exactly_ the rest of the line, we had to prevent such situation.
-% We prepended an \empty token at the very beginning and we expand it now,
-% just before passing the control to \argtorun.
-% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
-% either the null string, or it ends with \^^M---thus there is no danger
-% that a pair of braces would be stripped.
-%
-% But first, we have to remove the trailing space token.
-%
-\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
-
-% \parseargdef\foo{...}
-% is roughly equivalent to
-% \def\foo{\parsearg\Xfoo}
-% \def\Xfoo#1{...}
-%
-% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
-% favourite TeX trick. --kasal, 16nov03
-
-\def\parseargdef#1{%
- \expandafter \doparseargdef \csname\string#1\endcsname #1%
-}
-\def\doparseargdef#1#2{%
- \def#2{\parsearg#1}%
- \def#1##1%
-}
-
-% Several utility definitions with active space:
-{
- \obeyspaces
- \gdef\obeyedspace{ }
-
- % Make each space character in the input produce a normal interword
- % space in the output. Don't allow a line break at this space, as this
- % is used only in environments like @example, where each line of input
- % should produce a line of output anyway.
- %
- \gdef\sepspaces{\obeyspaces\let =\tie}
-
- % If an index command is used in an @example environment, any spaces
- % therein should become regular spaces in the raw index file, not the
- % expansion of \tie (\leavevmode \penalty \@M \ ).
- \gdef\unsepspaces{\let =\space}
-}
-
-
-\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
-
-% Define the framework for environments in texinfo.tex. It's used like this:
-%
-% \envdef\foo{...}
-% \def\Efoo{...}
-%
-% It's the responsibility of \envdef to insert \begingroup before the
-% actual body; @end closes the group after calling \Efoo. \envdef also
-% defines \thisenv, so the current environment is known; @end checks
-% whether the environment name matches. The \checkenv macro can also be
-% used to check whether the current environment is the one expected.
-%
-% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
-% are not treated as environments; they don't open a group. (The
-% implementation of @end takes care not to call \endgroup in this
-% special case.)
-
-
-% At run-time, environments start with this:
-\def\startenvironment#1{\begingroup\def\thisenv{#1}}
-% initialize
-\let\thisenv\empty
-
-% ... but they get defined via ``\envdef\foo{...}'':
-\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
-\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
-
-% Check whether we're in the right environment:
-\def\checkenv#1{%
- \def\temp{#1}%
- \ifx\thisenv\temp
- \else
- \badenverr
- \fi
-}
-
-% Environment mismatch, #1 expected:
-\def\badenverr{%
- \errhelp = \EMsimple
- \errmessage{This command can appear only \inenvironment\temp,
- not \inenvironment\thisenv}%
-}
-\def\inenvironment#1{%
- \ifx#1\empty
- outside of any environment%
- \else
- in environment \expandafter\string#1%
- \fi
-}
-
-% @end foo executes the definition of \Efoo.
-% But first, it executes a specialized version of \checkenv
-%
-\parseargdef\end{%
- \if 1\csname iscond.#1\endcsname
- \else
- % The general wording of \badenverr may not be ideal.
- \expandafter\checkenv\csname#1\endcsname
- \csname E#1\endcsname
- \endgroup
- \fi
-}
-
-\newhelp\EMsimple{Press RETURN to continue.}
-
-
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-
-% @: forces normal size whitespace following.
-\def\:{\spacefactor=1000 }
-
-% @* forces a line break.
-\def\*{\hfil\break\hbox{}\ignorespaces}
-
-% @/ allows a line break.
-\let\/=\allowbreak
-
-% @. is an end-of-sentence period.
-\def\.{.\spacefactor=\endofsentencespacefactor\space}
-
-% @! is an end-of-sentence bang.
-\def\!{!\spacefactor=\endofsentencespacefactor\space}
-
-% @? is an end-of-sentence query.
-\def\?{?\spacefactor=\endofsentencespacefactor\space}
-
-% @frenchspacing on|off says whether to put extra space after punctuation.
-%
-\def\onword{on}
-\def\offword{off}
-%
-\parseargdef\frenchspacing{%
- \def\temp{#1}%
- \ifx\temp\onword \plainfrenchspacing
- \else\ifx\temp\offword \plainnonfrenchspacing
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
- \fi\fi
-}
-
-% @w prevents a word break. Without the \leavevmode, @w at the
-% beginning of a paragraph, when TeX is still in vertical mode, would
-% produce a whole line of output instead of starting the paragraph.
-\def\w#1{\leavevmode\hbox{#1}}
-
-% @group ... @end group forces ... to be all on one page, by enclosing
-% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
-% to keep its height that of a normal line. According to the rules for
-% \topskip (p.114 of the TeXbook), the glue inserted is
-% max (\topskip - \ht (first item), 0). If that height is large,
-% therefore, no glue is inserted, and the space between the headline and
-% the text is small, which looks bad.
-%
-% Another complication is that the group might be very large. This can
-% cause the glue on the previous page to be unduly stretched, because it
-% does not have much material. In this case, it's better to add an
-% explicit \vfill so that the extra space is at the bottom. The
-% threshold for doing this is if the group is more than \vfilllimit
-% percent of a page (\vfilllimit can be changed inside of @tex).
-%
-\newbox\groupbox
-\def\vfilllimit{0.7}
-%
-\envdef\group{%
- \ifnum\catcode`\^^M=\active \else
- \errhelp = \groupinvalidhelp
- \errmessage{@group invalid in context where filling is enabled}%
- \fi
- \startsavinginserts
- %
- \setbox\groupbox = \vtop\bgroup
- % Do @comment since we are called inside an environment such as
- % @example, where each end-of-line in the input causes an
- % end-of-line in the output. We don't want the end-of-line after
- % the `@group' to put extra space in the output. Since @group
- % should appear on a line by itself (according to the Texinfo
- % manual), we don't worry about eating any user text.
- \comment
-}
-%
-% The \vtop produces a box with normal height and large depth; thus, TeX puts
-% \baselineskip glue before it, and (when the next line of text is done)
-% \lineskip glue after it. Thus, space below is not quite equal to space
-% above. But it's pretty close.
-\def\Egroup{%
- % To get correct interline space between the last line of the group
- % and the first line afterwards, we have to propagate \prevdepth.
- \endgraf % Not \par, as it may have been set to \lisppar.
- \global\dimen1 = \prevdepth
- \egroup % End the \vtop.
- % \dimen0 is the vertical size of the group's box.
- \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
- % \dimen2 is how much space is left on the page (more or less).
- \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
- % if the group doesn't fit on the current page, and it's a big big
- % group, force a page break.
- \ifdim \dimen0 > \dimen2
- \ifdim \pagetotal < \vfilllimit\pageheight
- \page
- \fi
- \fi
- \box\groupbox
- \prevdepth = \dimen1
- \checkinserts
-}
-%
-% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
-% message, so this ends up printing `@group can only ...'.
-%
-\newhelp\groupinvalidhelp{%
-group can only be used in environments such as @example,^^J%
-where each line of input produces a line of output.}
-
-% @need space-in-mils
-% forces a page break if there is not space-in-mils remaining.
-
-\newdimen\mil \mil=0.001in
-
-\parseargdef\need{%
- % Ensure vertical mode, so we don't make a big box in the middle of a
- % paragraph.
- \par
- %
- % If the @need value is less than one line space, it's useless.
- \dimen0 = #1\mil
- \dimen2 = \ht\strutbox
- \advance\dimen2 by \dp\strutbox
- \ifdim\dimen0 > \dimen2
- %
- % Do a \strut just to make the height of this box be normal, so the
- % normal leading is inserted relative to the preceding line.
- % And a page break here is fine.
- \vtop to #1\mil{\strut\vfil}%
- %
- % TeX does not even consider page breaks if a penalty added to the
- % main vertical list is 10000 or more. But in order to see if the
- % empty box we just added fits on the page, we must make it consider
- % page breaks. On the other hand, we don't want to actually break the
- % page after the empty box. So we use a penalty of 9999.
- %
- % There is an extremely small chance that TeX will actually break the
- % page at this \penalty, if there are no other feasible breakpoints in
- % sight. (If the user is using lots of big @group commands, which
- % almost-but-not-quite fill up a page, TeX will have a hard time doing
- % good page breaking, for example.) However, I could not construct an
- % example where a page broke at this \penalty; if it happens in a real
- % document, then we can reconsider our strategy.
- \penalty9999
- %
- % Back up by the size of the box, whether we did a page break or not.
- \kern -#1\mil
- %
- % Do not allow a page break right after this kern.
- \nobreak
- \fi
-}
-
-% @br forces paragraph break (and is undocumented).
-
-\let\br = \par
-
-% @page forces the start of a new page.
-%
-\def\page{\par\vfill\supereject}
-
-% @exdent text....
-% outputs text on separate line in roman font, starting at standard page margin
-
-% This records the amount of indent in the innermost environment.
-% That's how much \exdent should take out.
-\newskip\exdentamount
-
-% This defn is used inside fill environments such as @defun.
-\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
-
-% This defn is used inside nofill environments such as @example.
-\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
- \leftline{\hskip\leftskip{\rm#1}}}}
-
-% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
-% paragraph. For more general purposes, use the \margin insertion
-% class. WHICH is `l' or `r'. Not documented, written for gawk manual.
-%
-\newskip\inmarginspacing \inmarginspacing=1cm
-\def\strutdepth{\dp\strutbox}
-%
-\def\doinmargin#1#2{\strut\vadjust{%
- \nobreak
- \kern-\strutdepth
- \vtop to \strutdepth{%
- \baselineskip=\strutdepth
- \vss
- % if you have multiple lines of stuff to put here, you'll need to
- % make the vbox yourself of the appropriate size.
- \ifx#1l%
- \llap{\ignorespaces #2\hskip\inmarginspacing}%
- \else
- \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
- \fi
- \null
- }%
-}}
-\def\inleftmargin{\doinmargin l}
-\def\inrightmargin{\doinmargin r}
-%
-% @inmargin{TEXT [, RIGHT-TEXT]}
-% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
-% else use TEXT for both).
-%
-\def\inmargin#1{\parseinmargin #1,,\finish}
-\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt
- \def\lefttext{#1}% have both texts
- \def\righttext{#2}%
- \else
- \def\lefttext{#1}% have only one text
- \def\righttext{#1}%
- \fi
- %
- \ifodd\pageno
- \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
- \else
- \def\temp{\inleftmargin\lefttext}%
- \fi
- \temp
-}
-
-% @| inserts a changebar to the left of the current line. It should
-% surround any changed text. This approach does *not* work if the
-% change spans more than two lines of output. To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change). This command
-% is not documented, not supported, and doesn't work.
-%
-\def\|{%
- % \vadjust can only be used in horizontal mode.
- \leavevmode
- %
- % Append this vertical mode material after the current line in the output.
- \vadjust{%
- % We want to insert a rule with the height and depth of the current
- % leading; that is exactly what \strutbox is supposed to record.
- \vskip-\baselineskip
- %
- % \vadjust-items are inserted at the left edge of the type. So
- % the \llap here moves out into the left-hand margin.
- \llap{%
- %
- % For a thicker or thinner bar, change the `1pt'.
- \vrule height\baselineskip width1pt
- %
- % This is the space between the bar and the text.
- \hskip 12pt
- }%
- }%
-}
-
-% @include FILE -- \input text of FILE.
-%
-\def\include{\parseargusing\filenamecatcodes\includezzz}
-\def\includezzz#1{%
- \pushthisfilestack
- \def\thisfile{#1}%
- {%
- \makevalueexpandable % we want to expand any @value in FILE.
- \turnoffactive % and allow special characters in the expansion
- \indexnofonts % Allow `@@' and other weird things in file names.
- \wlog{texinfo.tex: doing @include of #1^^J}%
- \edef\temp{\noexpand\input #1 }%
- %
- % This trickery is to read FILE outside of a group, in case it makes
- % definitions, etc.
- \expandafter
- }\temp
- \popthisfilestack
-}
-\def\filenamecatcodes{%
- \catcode`\\=\other
- \catcode`~=\other
- \catcode`^=\other
- \catcode`_=\other
- \catcode`|=\other
- \catcode`<=\other
- \catcode`>=\other
- \catcode`+=\other
- \catcode`-=\other
- \catcode`\`=\other
- \catcode`\'=\other
-}
-
-\def\pushthisfilestack{%
- \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
-}
-\def\pushthisfilestackX{%
- \expandafter\pushthisfilestackY\thisfile\StackTerm
-}
-\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
- \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
-}
-
-\def\popthisfilestack{\errthisfilestackempty}
-\def\errthisfilestackempty{\errmessage{Internal error:
- the stack of filenames is empty.}}
-%
-\def\thisfile{}
-
-% @center line
-% outputs that line, centered.
-%
-\parseargdef\center{%
- \ifhmode
- \let\centersub\centerH
- \else
- \let\centersub\centerV
- \fi
- \centersub{\hfil \ignorespaces#1\unskip \hfil}%
- \let\centersub\relax % don't let the definition persist, just in case
-}
-\def\centerH#1{{%
- \hfil\break
- \advance\hsize by -\leftskip
- \advance\hsize by -\rightskip
- \line{#1}%
- \break
-}}
-%
-\newcount\centerpenalty
-\def\centerV#1{%
- % The idea here is the same as in \startdefun, \cartouche, etc.: if
- % @center is the first thing after a section heading, we need to wipe
- % out the negative parskip inserted by \sectionheading, but still
- % prevent a page break here.
- \centerpenalty = \lastpenalty
- \ifnum\centerpenalty>10000 \vskip\parskip \fi
- \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
- \line{\kern\leftskip #1\kern\rightskip}%
-}
-
-% @sp n outputs n lines of vertical space
-%
-\parseargdef\sp{\vskip #1\baselineskip}
-
-% @comment ...line which is ignored...
-% @c is the same as @comment
-% @ignore ... @end ignore is another way to write a comment
-%
-\def\comment{\begingroup \catcode`\^^M=\other%
-\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
-\commentxxx}
-{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
-%
-\let\c=\comment
-
-% @paragraphindent NCHARS
-% We'll use ems for NCHARS, close enough.
-% NCHARS can also be the word `asis' or `none'.
-% We cannot feasibly implement @paragraphindent asis, though.
-%
-\def\asisword{asis} % no translation, these are keywords
-\def\noneword{none}
-%
-\parseargdef\paragraphindent{%
- \def\temp{#1}%
- \ifx\temp\asisword
- \else
- \ifx\temp\noneword
- \defaultparindent = 0pt
- \else
- \defaultparindent = #1em
- \fi
- \fi
- \parindent = \defaultparindent
-}
-
-% @exampleindent NCHARS
-% We'll use ems for NCHARS like @paragraphindent.
-% It seems @exampleindent asis isn't necessary, but
-% I preserve it to make it similar to @paragraphindent.
-\parseargdef\exampleindent{%
- \def\temp{#1}%
- \ifx\temp\asisword
- \else
- \ifx\temp\noneword
- \lispnarrowing = 0pt
- \else
- \lispnarrowing = #1em
- \fi
- \fi
-}
-
-% @firstparagraphindent WORD
-% If WORD is `none', then suppress indentation of the first paragraph
-% after a section heading. If WORD is `insert', then do indent at such
-% paragraphs.
-%
-% The paragraph indentation is suppressed or not by calling
-% \suppressfirstparagraphindent, which the sectioning commands do.
-% We switch the definition of this back and forth according to WORD.
-% By default, we suppress indentation.
-%
-\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
-\def\insertword{insert}
-%
-\parseargdef\firstparagraphindent{%
- \def\temp{#1}%
- \ifx\temp\noneword
- \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
- \else\ifx\temp\insertword
- \let\suppressfirstparagraphindent = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @firstparagraphindent option `\temp'}%
- \fi\fi
-}
-
-% Here is how we actually suppress indentation. Redefine \everypar to
-% \kern backwards by \parindent, and then reset itself to empty.
-%
-% We also make \indent itself not actually do anything until the next
-% paragraph.
-%
-\gdef\dosuppressfirstparagraphindent{%
- \gdef\indent{%
- \restorefirstparagraphindent
- \indent
- }%
- \gdef\noindent{%
- \restorefirstparagraphindent
- \noindent
- }%
- \global\everypar = {%
- \kern -\parindent
- \restorefirstparagraphindent
- }%
-}
-
-\gdef\restorefirstparagraphindent{%
- \global \let \indent = \ptexindent
- \global \let \noindent = \ptexnoindent
- \global \everypar = {}%
-}
-
-
-% @refill is a no-op.
-\let\refill=\relax
-
-% If working on a large document in chapters, it is convenient to
-% be able to disable indexing, cross-referencing, and contents, for test runs.
-% This is done with @novalidate (before @setfilename).
-%
-\newif\iflinks \linkstrue % by default we want the aux files.
-\let\novalidate = \linksfalse
-
-% @setfilename is done at the beginning of every texinfo file.
-% So open here the files we need to have open while reading the input.
-% This makes it possible to make a .fmt file for texinfo.
-\def\setfilename{%
- \fixbackslash % Turn off hack to swallow `\input texinfo'.
- \iflinks
- \tryauxfile
- % Open the new aux file. TeX will close it automatically at exit.
- \immediate\openout\auxfile=\jobname.aux
- \fi % \openindices needs to do some work in any case.
- \openindices
- \let\setfilename=\comment % Ignore extra @setfilename cmds.
- %
- % If texinfo.cnf is present on the system, read it.
- % Useful for site-wide @afourpaper, etc.
- \openin 1 texinfo.cnf
- \ifeof 1 \else \input texinfo.cnf \fi
- \closein 1
- %
- \comment % Ignore the actual filename.
-}
-
-% Called from \setfilename.
-%
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
-}
-
-% @bye.
-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-
-
-\message{pdf,}
-% adobe `portable' document format
-\newcount\tempnum
-\newcount\lnkcount
-\newtoks\filename
-\newcount\filenamelength
-\newcount\pgn
-\newtoks\toksA
-\newtoks\toksB
-\newtoks\toksC
-\newtoks\toksD
-\newbox\boxA
-\newcount\countA
-\newif\ifpdf
-\newif\ifpdfmakepagedest
-
-% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
-% can be set). So we test for \relax and 0 as well as being undefined.
-\ifx\pdfoutput\thisisundefined
-\else
- \ifx\pdfoutput\relax
- \else
- \ifcase\pdfoutput
- \else
- \pdftrue
- \fi
- \fi
-\fi
-
-% PDF uses PostScript string constants for the names of xref targets,
-% for display in the outlines, and in other places. Thus, we have to
-% double any backslashes. Otherwise, a name like "\node" will be
-% interpreted as a newline (\n), followed by o, d, e. Not good.
-%
-% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
-% related messages. The final outcome is that it is up to the TeX user
-% to double the backslashes and otherwise make the string valid, so
-% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
-% do this reliably, so we use it.
-
-% #1 is a control sequence in which to do the replacements,
-% which we \xdef.
-\def\txiescapepdf#1{%
- \ifx\pdfescapestring\relax
- % No primitive available; should we give a warning or log?
- % Many times it won't matter.
- \else
- % The expandable \pdfescapestring primitive escapes parentheses,
- % backslashes, and other special chars.
- \xdef#1{\pdfescapestring{#1}}%
- \fi
-}
-
-\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
-with PDF output, and none of those formats could be found. (.eps cannot
-be supported due to the design of the PDF format; use regular TeX (DVI
-output) for that.)}
-
-\ifpdf
- %
- % Color manipulation macros based on pdfcolor.tex,
- % except using rgb instead of cmyk; the latter is said to render as a
- % very dark gray on-screen and a very dark halftone in print, instead
- % of actual black.
- \def\rgbDarkRed{0.50 0.09 0.12}
- \def\rgbBlack{0 0 0}
- %
- % k sets the color for filling (usual text, etc.);
- % K sets the color for stroking (thin rules, e.g., normal _'s).
- \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
- %
- % Set color, and create a mark which defines \thiscolor accordingly,
- % so that \makeheadline knows which color to restore.
- \def\setcolor#1{%
- \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
- \domark
- \pdfsetcolor{#1}%
- }
- %
- \def\maincolor{\rgbBlack}
- \pdfsetcolor{\maincolor}
- \edef\thiscolor{\maincolor}
- \def\lastcolordefs{}
- %
- \def\makefootline{%
- \baselineskip24pt
- \line{\pdfsetcolor{\maincolor}\the\footline}%
- }
- %
- \def\makeheadline{%
- \vbox to 0pt{%
- \vskip-22.5pt
- \line{%
- \vbox to8.5pt{}%
- % Extract \thiscolor definition from the marks.
- \getcolormarks
- % Typeset the headline with \maincolor, then restore the color.
- \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
- }%
- \vss
- }%
- \nointerlineskip
- }
- %
- %
- \pdfcatalog{/PageMode /UseOutlines}
- %
- % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
- \def\dopdfimage#1#2#3{%
- \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
- \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
- %
- % pdftex (and the PDF format) support .pdf, .png, .jpg (among
- % others). Let's try in that order, PDF first since if
- % someone has a scalable image, presumably better to use that than a
- % bitmap.
- \let\pdfimgext=\empty
- \begingroup
- \openin 1 #1.pdf \ifeof 1
- \openin 1 #1.PDF \ifeof 1
- \openin 1 #1.png \ifeof 1
- \openin 1 #1.jpg \ifeof 1
- \openin 1 #1.jpeg \ifeof 1
- \openin 1 #1.JPG \ifeof 1
- \errhelp = \nopdfimagehelp
- \errmessage{Could not find image file #1 for pdf}%
- \else \gdef\pdfimgext{JPG}%
- \fi
- \else \gdef\pdfimgext{jpeg}%
- \fi
- \else \gdef\pdfimgext{jpg}%
- \fi
- \else \gdef\pdfimgext{png}%
- \fi
- \else \gdef\pdfimgext{PDF}%
- \fi
- \else \gdef\pdfimgext{pdf}%
- \fi
- \closein 1
- \endgroup
- %
- % without \immediate, ancient pdftex seg faults when the same image is
- % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
- \ifnum\pdftexversion < 14
- \immediate\pdfimage
- \else
- \immediate\pdfximage
- \fi
- \ifdim \wd0 >0pt width \pdfimagewidth \fi
- \ifdim \wd2 >0pt height \pdfimageheight \fi
- \ifnum\pdftexversion<13
- #1.\pdfimgext
- \else
- {#1.\pdfimgext}%
- \fi
- \ifnum\pdftexversion < 14 \else
- \pdfrefximage \pdflastximage
- \fi}
- %
- \def\pdfmkdest#1{{%
- % We have to set dummies so commands such as @code, and characters
- % such as \, aren't expanded when present in a section title.
- \indexnofonts
- \turnoffactive
- \makevalueexpandable
- \def\pdfdestname{#1}%
- \txiescapepdf\pdfdestname
- \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
- }}
- %
- % used to mark target names; must be expandable.
- \def\pdfmkpgn#1{#1}
- %
- % by default, use a color that is dark enough to print on paper as
- % nearly black, but still distinguishable for online viewing.
- \def\urlcolor{\rgbDarkRed}
- \def\linkcolor{\rgbDarkRed}
- \def\endlink{\setcolor{\maincolor}\pdfendlink}
- %
- % Adding outlines to PDF; macros for calculating structure of outlines
- % come from Petr Olsak
- \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
- \else \csname#1\endcsname \fi}
- \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
- \advance\tempnum by 1
- \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
- %
- % #1 is the section text, which is what will be displayed in the
- % outline by the pdf viewer. #2 is the pdf expression for the number
- % of subentries (or empty, for subsubsections). #3 is the node text,
- % which might be empty if this toc entry had no corresponding node.
- % #4 is the page number
- %
- \def\dopdfoutline#1#2#3#4{%
- % Generate a link to the node text if that exists; else, use the
- % page number. We could generate a destination for the section
- % text in the case where a section has no node, but it doesn't
- % seem worth the trouble, since most documents are normally structured.
- \edef\pdfoutlinedest{#3}%
- \ifx\pdfoutlinedest\empty
- \def\pdfoutlinedest{#4}%
- \else
- \txiescapepdf\pdfoutlinedest
- \fi
- %
- % Also escape PDF chars in the display string.
- \edef\pdfoutlinetext{#1}%
- \txiescapepdf\pdfoutlinetext
- %
- \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
- }
- %
- \def\pdfmakeoutlines{%
- \begingroup
- % Read toc silently, to get counts of subentries for \pdfoutline.
- \def\partentry##1##2##3##4{}% ignore parts in the outlines
- \def\numchapentry##1##2##3##4{%
- \def\thischapnum{##2}%
- \def\thissecnum{0}%
- \def\thissubsecnum{0}%
- }%
- \def\numsecentry##1##2##3##4{%
- \advancenumber{chap\thischapnum}%
- \def\thissecnum{##2}%
- \def\thissubsecnum{0}%
- }%
- \def\numsubsecentry##1##2##3##4{%
- \advancenumber{sec\thissecnum}%
- \def\thissubsecnum{##2}%
- }%
- \def\numsubsubsecentry##1##2##3##4{%
- \advancenumber{subsec\thissubsecnum}%
- }%
- \def\thischapnum{0}%
- \def\thissecnum{0}%
- \def\thissubsecnum{0}%
- %
- % use \def rather than \let here because we redefine \chapentry et
- % al. a second time, below.
- \def\appentry{\numchapentry}%
- \def\appsecentry{\numsecentry}%
- \def\appsubsecentry{\numsubsecentry}%
- \def\appsubsubsecentry{\numsubsubsecentry}%
- \def\unnchapentry{\numchapentry}%
- \def\unnsecentry{\numsecentry}%
- \def\unnsubsecentry{\numsubsecentry}%
- \def\unnsubsubsecentry{\numsubsubsecentry}%
- \readdatafile{toc}%
- %
- % Read toc second time, this time actually producing the outlines.
- % The `-' means take the \expnumber as the absolute number of
- % subentries, which we calculated on our first read of the .toc above.
- %
- % We use the node names as the destinations.
- \def\numchapentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
- \def\numsecentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
- \def\numsubsecentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
- \def\numsubsubsecentry##1##2##3##4{% count is always zero
- \dopdfoutline{##1}{}{##3}{##4}}%
- %
- % PDF outlines are displayed using system fonts, instead of
- % document fonts. Therefore we cannot use special characters,
- % since the encoding is unknown. For example, the eogonek from
- % Latin 2 (0xea) gets translated to a | character. Info from
- % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
- %
- % TODO this right, we have to translate 8-bit characters to
- % their "best" equivalent, based on the @documentencoding. Too
- % much work for too little return. Just use the ASCII equivalents
- % we use for the index sort strings.
- %
- \indexnofonts
- \setupdatafile
- % We can have normal brace characters in the PDF outlines, unlike
- % Texinfo index files. So set that up.
- \def\{{\lbracecharliteral}%
- \def\}{\rbracecharliteral}%
- \catcode`\\=\active \otherbackslash
- \input \tocreadfilename
- \endgroup
- }
- {\catcode`[=1 \catcode`]=2
- \catcode`{=\other \catcode`}=\other
- \gdef\lbracecharliteral[{]%
- \gdef\rbracecharliteral[}]%
- ]
- %
- \def\skipspaces#1{\def\PP{#1}\def\D{|}%
- \ifx\PP\D\let\nextsp\relax
- \else\let\nextsp\skipspaces
- \ifx\p\space\else\addtokens{\filename}{\PP}%
- \advance\filenamelength by 1
- \fi
- \fi
- \nextsp}
- \def\getfilename#1{%
- \filenamelength=0
- % If we don't expand the argument now, \skipspaces will get
- % snagged on things like "@value{foo}".
- \edef\temp{#1}%
- \expandafter\skipspaces\temp|\relax
- }
- \ifnum\pdftexversion < 14
- \let \startlink \pdfannotlink
- \else
- \let \startlink \pdfstartlink
- \fi
- % make a live url in pdf output.
- \def\pdfurl#1{%
- \begingroup
- % it seems we really need yet another set of dummies; have not
- % tried to figure out what each command should do in the context
- % of @url. for now, just make @/ a no-op, that's the only one
- % people have actually reported a problem with.
- %
- \normalturnoffactive
- \def\@{@}%
- \let\/=\empty
- \makevalueexpandable
- % do we want to go so far as to use \indexnofonts instead of just
- % special-casing \var here?
- \def\var##1{##1}%
- %
- \leavevmode\setcolor{\urlcolor}%
- \startlink attr{/Border [0 0 0]}%
- user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
- \endgroup}
- \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
- \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
- \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
- \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
- \def\maketoks{%
- \expandafter\poptoks\the\toksA|ENDTOKS|\relax
- \ifx\first0\adn0
- \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
- \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
- \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
- \else
- \ifnum0=\countA\else\makelink\fi
- \ifx\first.\let\next=\done\else
- \let\next=\maketoks
- \addtokens{\toksB}{\the\toksD}
- \ifx\first,\addtokens{\toksB}{\space}\fi
- \fi
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \next}
- \def\makelink{\addtokens{\toksB}%
- {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
- \def\pdflink#1{%
- \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
- \setcolor{\linkcolor}#1\endlink}
- \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
-\else
- % non-pdf mode
- \let\pdfmkdest = \gobble
- \let\pdfurl = \gobble
- \let\endlink = \relax
- \let\setcolor = \gobble
- \let\pdfsetcolor = \gobble
- \let\pdfmakeoutlines = \relax
-\fi % \ifx\pdfoutput
-
-
-\message{fonts,}
-
-% Change the current font style to #1, remembering it in \curfontstyle.
-% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
-% italics, not bold italics.
-%
-\def\setfontstyle#1{%
- \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
- \csname ten#1\endcsname % change the current font
-}
-
-% Select #1 fonts with the current style.
-%
-\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
-
-\def\rm{\fam=0 \setfontstyle{rm}}
-\def\it{\fam=\itfam \setfontstyle{it}}
-\def\sl{\fam=\slfam \setfontstyle{sl}}
-\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
-\def\tt{\fam=\ttfam \setfontstyle{tt}}
-
-% Unfortunately, we have to override this for titles and the like, since
-% in those cases "rm" is bold. Sigh.
-\def\rmisbold{\rm\def\curfontstyle{bf}}
-
-% Texinfo sort of supports the sans serif font style, which plain TeX does not.
-% So we set up a \sf.
-\newfam\sffam
-\def\sf{\fam=\sffam \setfontstyle{sf}}
-\let\li = \sf % Sometimes we call it \li, not \sf.
-
-% We don't need math for this font style.
-\def\ttsl{\setfontstyle{ttsl}}
-
-
-% Default leading.
-\newdimen\textleading \textleading = 13.2pt
-
-% Set the baselineskip to #1, and the lineskip and strut size
-% correspondingly. There is no deep meaning behind these magic numbers
-% used as factors; they just match (closely enough) what Knuth defined.
-%
-\def\lineskipfactor{.08333}
-\def\strutheightpercent{.70833}
-\def\strutdepthpercent {.29167}
-%
-% can get a sort of poor man's double spacing by redefining this.
-\def\baselinefactor{1}
-%
-\def\setleading#1{%
- \dimen0 = #1\relax
- \normalbaselineskip = \baselinefactor\dimen0
- \normallineskip = \lineskipfactor\normalbaselineskip
- \normalbaselines
- \setbox\strutbox =\hbox{%
- \vrule width0pt height\strutheightpercent\baselineskip
- depth \strutdepthpercent \baselineskip
- }%
-}
-
-% PDF CMaps. See also LaTeX's t1.cmap.
-%
-% do nothing with this by default.
-\expandafter\let\csname cmapOT1\endcsname\gobble
-\expandafter\let\csname cmapOT1IT\endcsname\gobble
-\expandafter\let\csname cmapOT1TT\endcsname\gobble
-
-% if we are producing pdf, and we have \pdffontattr, then define cmaps.
-% (\pdffontattr was introduced many years ago, but people still run
-% older pdftex's; it's easy to conditionalize, so we do.)
-\ifpdf \ifx\pdffontattr\thisisundefined \else
- \begingroup
- \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
- \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
-%%DocumentNeededResources: ProcSet (CIDInit)
-%%IncludeResource: ProcSet (CIDInit)
-%%BeginResource: CMap (TeX-OT1-0)
-%%Title: (TeX-OT1-0 TeX OT1 0)
-%%Version: 1.000
-%%EndComments
-/CIDInit /ProcSet findresource begin
-12 dict begin
-begincmap
-/CIDSystemInfo
-<< /Registry (TeX)
-/Ordering (OT1)
-/Supplement 0
->> def
-/CMapName /TeX-OT1-0 def
-/CMapType 2 def
-1 begincodespacerange
-<00> <7F>
-endcodespacerange
-8 beginbfrange
-<00> <01> <0393>
-<09> <0A> <03A8>
-<23> <26> <0023>
-<28> <3B> <0028>
-<3F> <5B> <003F>
-<5D> <5E> <005D>
-<61> <7A> <0061>
-<7B> <7C> <2013>
-endbfrange
-40 beginbfchar
-<02> <0398>
-<03> <039B>
-<04> <039E>
-<05> <03A0>
-<06> <03A3>
-<07> <03D2>
-<08> <03A6>
-<0B> <00660066>
-<0C> <00660069>
-<0D> <0066006C>
-<0E> <006600660069>
-<0F> <00660066006C>
-<10> <0131>
-<11> <0237>
-<12> <0060>
-<13> <00B4>
-<14> <02C7>
-<15> <02D8>
-<16> <00AF>
-<17> <02DA>
-<18> <00B8>
-<19> <00DF>
-<1A> <00E6>
-<1B> <0153>
-<1C> <00F8>
-<1D> <00C6>
-<1E> <0152>
-<1F> <00D8>
-<21> <0021>
-<22> <201D>
-<27> <2019>
-<3C> <00A1>
-<3D> <003D>
-<3E> <00BF>
-<5C> <201C>
-<5F> <02D9>
-<60> <2018>
-<7D> <02DD>
-<7E> <007E>
-<7F> <00A8>
-endbfchar
-endcmap
-CMapName currentdict /CMap defineresource pop
-end
-end
-%%EndResource
-%%EOF
- }\endgroup
- \expandafter\edef\csname cmapOT1\endcsname#1{%
- \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
- }%
-%
-% \cmapOT1IT
- \begingroup
- \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
- \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
-%%DocumentNeededResources: ProcSet (CIDInit)
-%%IncludeResource: ProcSet (CIDInit)
-%%BeginResource: CMap (TeX-OT1IT-0)
-%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
-%%Version: 1.000
-%%EndComments
-/CIDInit /ProcSet findresource begin
-12 dict begin
-begincmap
-/CIDSystemInfo
-<< /Registry (TeX)
-/Ordering (OT1IT)
-/Supplement 0
->> def
-/CMapName /TeX-OT1IT-0 def
-/CMapType 2 def
-1 begincodespacerange
-<00> <7F>
-endcodespacerange
-8 beginbfrange
-<00> <01> <0393>
-<09> <0A> <03A8>
-<25> <26> <0025>
-<28> <3B> <0028>
-<3F> <5B> <003F>
-<5D> <5E> <005D>
-<61> <7A> <0061>
-<7B> <7C> <2013>
-endbfrange
-42 beginbfchar
-<02> <0398>
-<03> <039B>
-<04> <039E>
-<05> <03A0>
-<06> <03A3>
-<07> <03D2>
-<08> <03A6>
-<0B> <00660066>
-<0C> <00660069>
-<0D> <0066006C>
-<0E> <006600660069>
-<0F> <00660066006C>
-<10> <0131>
-<11> <0237>
-<12> <0060>
-<13> <00B4>
-<14> <02C7>
-<15> <02D8>
-<16> <00AF>
-<17> <02DA>
-<18> <00B8>
-<19> <00DF>
-<1A> <00E6>
-<1B> <0153>
-<1C> <00F8>
-<1D> <00C6>
-<1E> <0152>
-<1F> <00D8>
-<21> <0021>
-<22> <201D>
-<23> <0023>
-<24> <00A3>
-<27> <2019>
-<3C> <00A1>
-<3D> <003D>
-<3E> <00BF>
-<5C> <201C>
-<5F> <02D9>
-<60> <2018>
-<7D> <02DD>
-<7E> <007E>
-<7F> <00A8>
-endbfchar
-endcmap
-CMapName currentdict /CMap defineresource pop
-end
-end
-%%EndResource
-%%EOF
- }\endgroup
- \expandafter\edef\csname cmapOT1IT\endcsname#1{%
- \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
- }%
-%
-% \cmapOT1TT
- \begingroup
- \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
- \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
-%%DocumentNeededResources: ProcSet (CIDInit)
-%%IncludeResource: ProcSet (CIDInit)
-%%BeginResource: CMap (TeX-OT1TT-0)
-%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
-%%Version: 1.000
-%%EndComments
-/CIDInit /ProcSet findresource begin
-12 dict begin
-begincmap
-/CIDSystemInfo
-<< /Registry (TeX)
-/Ordering (OT1TT)
-/Supplement 0
->> def
-/CMapName /TeX-OT1TT-0 def
-/CMapType 2 def
-1 begincodespacerange
-<00> <7F>
-endcodespacerange
-5 beginbfrange
-<00> <01> <0393>
-<09> <0A> <03A8>
-<21> <26> <0021>
-<28> <5F> <0028>
-<61> <7E> <0061>
-endbfrange
-32 beginbfchar
-<02> <0398>
-<03> <039B>
-<04> <039E>
-<05> <03A0>
-<06> <03A3>
-<07> <03D2>
-<08> <03A6>
-<0B> <2191>
-<0C> <2193>
-<0D> <0027>
-<0E> <00A1>
-<0F> <00BF>
-<10> <0131>
-<11> <0237>
-<12> <0060>
-<13> <00B4>
-<14> <02C7>
-<15> <02D8>
-<16> <00AF>
-<17> <02DA>
-<18> <00B8>
-<19> <00DF>
-<1A> <00E6>
-<1B> <0153>
-<1C> <00F8>
-<1D> <00C6>
-<1E> <0152>
-<1F> <00D8>
-<20> <2423>
-<27> <2019>
-<60> <2018>
-<7F> <00A8>
-endbfchar
-endcmap
-CMapName currentdict /CMap defineresource pop
-end
-end
-%%EndResource
-%%EOF
- }\endgroup
- \expandafter\edef\csname cmapOT1TT\endcsname#1{%
- \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
- }%
-\fi\fi
-
-
-% Set the font macro #1 to the font named #2, adding on the
-% specified font prefix (normally `cm').
-% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
-% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
-% empty to omit).
-\def\setfont#1#2#3#4#5{%
- \font#1=\fontprefix#2#3 scaled #4
- \csname cmap#5\endcsname#1%
-}
-% This is what gets called when #5 of \setfont is empty.
-\let\cmap\gobble
-% emacs-page end of cmaps
-
-% Use cm as the default font prefix.
-% To specify the font prefix, you must define \fontprefix
-% before you read in texinfo.tex.
-\ifx\fontprefix\thisisundefined
-\def\fontprefix{cm}
-\fi
-% Support font families that don't use the same naming scheme as CM.
-\def\rmshape{r}
-\def\rmbshape{bx} %where the normal face is bold
-\def\bfshape{b}
-\def\bxshape{bx}
-\def\ttshape{tt}
-\def\ttbshape{tt}
-\def\ttslshape{sltt}
-\def\itshape{ti}
-\def\itbshape{bxti}
-\def\slshape{sl}
-\def\slbshape{bxsl}
-\def\sfshape{ss}
-\def\sfbshape{ss}
-\def\scshape{csc}
-\def\scbshape{csc}
-
-% Definitions for a main text size of 11pt. This is the default in
-% Texinfo.
-%
-\def\definetextfontsizexi{%
-% Text fonts (11.2pt, magstep1).
-\def\textnominalsize{11pt}
-\edef\mainmagstep{\magstephalf}
-\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
-\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
-\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
-\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
-\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
-\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
-\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
-\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-\def\textecsize{1095}
-
-% A few fonts for @defun names and args.
-\setfont\defbf\bfshape{10}{\magstep1}{OT1}
-\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
-\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
-
-% Fonts for indices, footnotes, small examples (9pt).
-\def\smallnominalsize{9pt}
-\setfont\smallrm\rmshape{9}{1000}{OT1}
-\setfont\smalltt\ttshape{9}{1000}{OT1TT}
-\setfont\smallbf\bfshape{10}{900}{OT1}
-\setfont\smallit\itshape{9}{1000}{OT1IT}
-\setfont\smallsl\slshape{9}{1000}{OT1}
-\setfont\smallsf\sfshape{9}{1000}{OT1}
-\setfont\smallsc\scshape{10}{900}{OT1}
-\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
-\font\smalli=cmmi9
-\font\smallsy=cmsy9
-\def\smallecsize{0900}
-
-% Fonts for small examples (8pt).
-\def\smallernominalsize{8pt}
-\setfont\smallerrm\rmshape{8}{1000}{OT1}
-\setfont\smallertt\ttshape{8}{1000}{OT1TT}
-\setfont\smallerbf\bfshape{10}{800}{OT1}
-\setfont\smallerit\itshape{8}{1000}{OT1IT}
-\setfont\smallersl\slshape{8}{1000}{OT1}
-\setfont\smallersf\sfshape{8}{1000}{OT1}
-\setfont\smallersc\scshape{10}{800}{OT1}
-\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
-\font\smalleri=cmmi8
-\font\smallersy=cmsy8
-\def\smallerecsize{0800}
-
-% Fonts for title page (20.4pt):
-\def\titlenominalsize{20pt}
-\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
-\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
-\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
-\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
-\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
-\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
-\let\titlebf=\titlerm
-\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
-\font\titlei=cmmi12 scaled \magstep3
-\font\titlesy=cmsy10 scaled \magstep4
-\def\titleecsize{2074}
-
-% Chapter (and unnumbered) fonts (17.28pt).
-\def\chapnominalsize{17pt}
-\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
-\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
-\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
-\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
-\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
-\setfont\chapsf\sfbshape{17}{1000}{OT1}
-\let\chapbf=\chaprm
-\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
-\font\chapi=cmmi12 scaled \magstep2
-\font\chapsy=cmsy10 scaled \magstep3
-\def\chapecsize{1728}
-
-% Section fonts (14.4pt).
-\def\secnominalsize{14pt}
-\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
-\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
-\setfont\secsl\slbshape{10}{\magstep2}{OT1}
-\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
-\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
-\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
-\let\secbf\secrm
-\setfont\secsc\scbshape{10}{\magstep2}{OT1}
-\font\seci=cmmi12 scaled \magstep1
-\font\secsy=cmsy10 scaled \magstep2
-\def\sececsize{1440}
-
-% Subsection fonts (13.15pt).
-\def\ssecnominalsize{13pt}
-\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
-\setfont\ssecit\itbshape{10}{1315}{OT1IT}
-\setfont\ssecsl\slbshape{10}{1315}{OT1}
-\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
-\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
-\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
-\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{1315}{OT1}
-\font\sseci=cmmi12 scaled \magstephalf
-\font\ssecsy=cmsy10 scaled 1315
-\def\ssececsize{1200}
-
-% Reduced fonts for @acro in text (10pt).
-\def\reducednominalsize{10pt}
-\setfont\reducedrm\rmshape{10}{1000}{OT1}
-\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
-\setfont\reducedbf\bfshape{10}{1000}{OT1}
-\setfont\reducedit\itshape{10}{1000}{OT1IT}
-\setfont\reducedsl\slshape{10}{1000}{OT1}
-\setfont\reducedsf\sfshape{10}{1000}{OT1}
-\setfont\reducedsc\scshape{10}{1000}{OT1}
-\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
-\font\reducedi=cmmi10
-\font\reducedsy=cmsy10
-\def\reducedecsize{1000}
-
-\textleading = 13.2pt % line spacing for 11pt CM
-\textfonts % reset the current fonts
-\rm
-} % end of 11pt text font size definitions
-
-
-% Definitions to make the main text be 10pt Computer Modern, with
-% section, chapter, etc., sizes following suit. This is for the GNU
-% Press printing of the Emacs 22 manual. Maybe other manuals in the
-% future. Used with @smallbook, which sets the leading to 12pt.
-%
-\def\definetextfontsizex{%
-% Text fonts (10pt).
-\def\textnominalsize{10pt}
-\edef\mainmagstep{1000}
-\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
-\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
-\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
-\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
-\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
-\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
-\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
-\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-\def\textecsize{1000}
-
-% A few fonts for @defun names and args.
-\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
-\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
-\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
-
-% Fonts for indices, footnotes, small examples (9pt).
-\def\smallnominalsize{9pt}
-\setfont\smallrm\rmshape{9}{1000}{OT1}
-\setfont\smalltt\ttshape{9}{1000}{OT1TT}
-\setfont\smallbf\bfshape{10}{900}{OT1}
-\setfont\smallit\itshape{9}{1000}{OT1IT}
-\setfont\smallsl\slshape{9}{1000}{OT1}
-\setfont\smallsf\sfshape{9}{1000}{OT1}
-\setfont\smallsc\scshape{10}{900}{OT1}
-\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
-\font\smalli=cmmi9
-\font\smallsy=cmsy9
-\def\smallecsize{0900}
-
-% Fonts for small examples (8pt).
-\def\smallernominalsize{8pt}
-\setfont\smallerrm\rmshape{8}{1000}{OT1}
-\setfont\smallertt\ttshape{8}{1000}{OT1TT}
-\setfont\smallerbf\bfshape{10}{800}{OT1}
-\setfont\smallerit\itshape{8}{1000}{OT1IT}
-\setfont\smallersl\slshape{8}{1000}{OT1}
-\setfont\smallersf\sfshape{8}{1000}{OT1}
-\setfont\smallersc\scshape{10}{800}{OT1}
-\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
-\font\smalleri=cmmi8
-\font\smallersy=cmsy8
-\def\smallerecsize{0800}
-
-% Fonts for title page (20.4pt):
-\def\titlenominalsize{20pt}
-\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
-\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
-\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
-\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
-\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
-\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
-\let\titlebf=\titlerm
-\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
-\font\titlei=cmmi12 scaled \magstep3
-\font\titlesy=cmsy10 scaled \magstep4
-\def\titleecsize{2074}
-
-% Chapter fonts (14.4pt).
-\def\chapnominalsize{14pt}
-\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
-\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
-\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
-\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
-\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
-\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
-\let\chapbf\chaprm
-\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
-\font\chapi=cmmi12 scaled \magstep1
-\font\chapsy=cmsy10 scaled \magstep2
-\def\chapecsize{1440}
-
-% Section fonts (12pt).
-\def\secnominalsize{12pt}
-\setfont\secrm\rmbshape{12}{1000}{OT1}
-\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
-\setfont\secsl\slbshape{10}{\magstep1}{OT1}
-\setfont\sectt\ttbshape{12}{1000}{OT1TT}
-\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
-\setfont\secsf\sfbshape{12}{1000}{OT1}
-\let\secbf\secrm
-\setfont\secsc\scbshape{10}{\magstep1}{OT1}
-\font\seci=cmmi12
-\font\secsy=cmsy10 scaled \magstep1
-\def\sececsize{1200}
-
-% Subsection fonts (10pt).
-\def\ssecnominalsize{10pt}
-\setfont\ssecrm\rmbshape{10}{1000}{OT1}
-\setfont\ssecit\itbshape{10}{1000}{OT1IT}
-\setfont\ssecsl\slbshape{10}{1000}{OT1}
-\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
-\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
-\setfont\ssecsf\sfbshape{10}{1000}{OT1}
-\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{1000}{OT1}
-\font\sseci=cmmi10
-\font\ssecsy=cmsy10
-\def\ssececsize{1000}
-
-% Reduced fonts for @acro in text (9pt).
-\def\reducednominalsize{9pt}
-\setfont\reducedrm\rmshape{9}{1000}{OT1}
-\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
-\setfont\reducedbf\bfshape{10}{900}{OT1}
-\setfont\reducedit\itshape{9}{1000}{OT1IT}
-\setfont\reducedsl\slshape{9}{1000}{OT1}
-\setfont\reducedsf\sfshape{9}{1000}{OT1}
-\setfont\reducedsc\scshape{10}{900}{OT1}
-\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
-\font\reducedi=cmmi9
-\font\reducedsy=cmsy9
-\def\reducedecsize{0900}
-
-\divide\parskip by 2 % reduce space between paragraphs
-\textleading = 12pt % line spacing for 10pt CM
-\textfonts % reset the current fonts
-\rm
-} % end of 10pt text font size definitions
-
-
-% We provide the user-level command
-% @fonttextsize 10
-% (or 11) to redefine the text font size. pt is assumed.
-%
-\def\xiword{11}
-\def\xword{10}
-\def\xwordpt{10pt}
-%
-\parseargdef\fonttextsize{%
- \def\textsizearg{#1}%
- %\wlog{doing @fonttextsize \textsizearg}%
- %
- % Set \globaldefs so that documents can use this inside @tex, since
- % makeinfo 4.8 does not support it, but we need it nonetheless.
- %
- \begingroup \globaldefs=1
- \ifx\textsizearg\xword \definetextfontsizex
- \else \ifx\textsizearg\xiword \definetextfontsizexi
- \else
- \errhelp=\EMsimple
- \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
- \fi\fi
- \endgroup
-}
-
-
-% In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families. Since
-% texinfo doesn't allow for producing subscripts and superscripts except
-% in the main text, we don't bother to reset \scriptfont and
-% \scriptscriptfont (which would also require loading a lot more fonts).
-%
-\def\resetmathfonts{%
- \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
- \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
- \textfont\ttfam=\tentt \textfont\sffam=\tensf
-}
-
-% The font-changing commands redefine the meanings of \tenSTYLE, instead
-% of just \STYLE. We do this because \STYLE needs to also set the
-% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
-% \tenSTYLE to set the current font.
-%
-% Each font-changing command also sets the names \lsize (one size lower)
-% and \lllsize (three sizes lower). These relative commands are used in
-% the LaTeX logo and acronyms.
-%
-% This all needs generalizing, badly.
-%
-\def\textfonts{%
- \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
- \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
- \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
- \let\tenttsl=\textttsl
- \def\curfontsize{text}%
- \def\lsize{reduced}\def\lllsize{smaller}%
- \resetmathfonts \setleading{\textleading}}
-\def\titlefonts{%
- \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
- \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
- \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
- \let\tenttsl=\titlettsl
- \def\curfontsize{title}%
- \def\lsize{chap}\def\lllsize{subsec}%
- \resetmathfonts \setleading{27pt}}
-\def\titlefont#1{{\titlefonts\rmisbold #1}}
-\def\chapfonts{%
- \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
- \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
- \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
- \let\tenttsl=\chapttsl
- \def\curfontsize{chap}%
- \def\lsize{sec}\def\lllsize{text}%
- \resetmathfonts \setleading{19pt}}
-\def\secfonts{%
- \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
- \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
- \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
- \let\tenttsl=\secttsl
- \def\curfontsize{sec}%
- \def\lsize{subsec}\def\lllsize{reduced}%
- \resetmathfonts \setleading{16pt}}
-\def\subsecfonts{%
- \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
- \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
- \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
- \let\tenttsl=\ssecttsl
- \def\curfontsize{ssec}%
- \def\lsize{text}\def\lllsize{small}%
- \resetmathfonts \setleading{15pt}}
-\let\subsubsecfonts = \subsecfonts
-\def\reducedfonts{%
- \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
- \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
- \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
- \let\tenttsl=\reducedttsl
- \def\curfontsize{reduced}%
- \def\lsize{small}\def\lllsize{smaller}%
- \resetmathfonts \setleading{10.5pt}}
-\def\smallfonts{%
- \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
- \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
- \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
- \let\tenttsl=\smallttsl
- \def\curfontsize{small}%
- \def\lsize{smaller}\def\lllsize{smaller}%
- \resetmathfonts \setleading{10.5pt}}
-\def\smallerfonts{%
- \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
- \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
- \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
- \let\tenttsl=\smallerttsl
- \def\curfontsize{smaller}%
- \def\lsize{smaller}\def\lllsize{smaller}%
- \resetmathfonts \setleading{9.5pt}}
-
-% Fonts for short table of contents.
-\setfont\shortcontrm\rmshape{12}{1000}{OT1}
-\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
-\setfont\shortcontsl\slshape{12}{1000}{OT1}
-\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
-
-% Define these just so they can be easily changed for other fonts.
-\def\angleleft{$\langle$}
-\def\angleright{$\rangle$}
-
-% Set the fonts to use with the @small... environments.
-\let\smallexamplefonts = \smallfonts
-
-% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
-% can fit this many characters:
-% 8.5x11=86 smallbook=72 a4=90 a5=69
-% If we use \scriptfonts (8pt), then we can fit this many characters:
-% 8.5x11=90+ smallbook=80 a4=90+ a5=77
-% For me, subjectively, the few extra characters that fit aren't worth
-% the additional smallness of 8pt. So I'm making the default 9pt.
-%
-% By the way, for comparison, here's what fits with @example (10pt):
-% 8.5x11=71 smallbook=60 a4=75 a5=58
-% --karl, 24jan03.
-
-% Set up the default fonts, so we can use them for creating boxes.
-%
-\definetextfontsizexi
-
-
-\message{markup,}
-
-% Check if we are currently using a typewriter font. Since all the
-% Computer Modern typewriter fonts have zero interword stretch (and
-% shrink), and it is reasonable to expect all typewriter fonts to have
-% this property, we can check that font parameter.
-%
-\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
-
-% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
-% define and register \INITMACRO to be called on markup style changes.
-% \INITMACRO can check \currentmarkupstyle for the innermost
-% style and the set of \ifmarkupSTYLE switches for all styles
-% currently in effect.
-\newif\ifmarkupvar
-\newif\ifmarkupsamp
-\newif\ifmarkupkey
-%\newif\ifmarkupfile % @file == @samp.
-%\newif\ifmarkupoption % @option == @samp.
-\newif\ifmarkupcode
-\newif\ifmarkupkbd
-%\newif\ifmarkupenv % @env == @code.
-%\newif\ifmarkupcommand % @command == @code.
-\newif\ifmarkuptex % @tex (and part of @math, for now).
-\newif\ifmarkupexample
-\newif\ifmarkupverb
-\newif\ifmarkupverbatim
-
-\let\currentmarkupstyle\empty
-
-\def\setupmarkupstyle#1{%
- \csname markup#1true\endcsname
- \def\currentmarkupstyle{#1}%
- \markupstylesetup
-}
-
-\let\markupstylesetup\empty
-
-\def\defmarkupstylesetup#1{%
- \expandafter\def\expandafter\markupstylesetup
- \expandafter{\markupstylesetup #1}%
- \def#1%
-}
-
-% Markup style setup for left and right quotes.
-\defmarkupstylesetup\markupsetuplq{%
- \expandafter\let\expandafter \temp
- \csname markupsetuplq\currentmarkupstyle\endcsname
- \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
-}
-
-\defmarkupstylesetup\markupsetuprq{%
- \expandafter\let\expandafter \temp
- \csname markupsetuprq\currentmarkupstyle\endcsname
- \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
-}
-
-{
-\catcode`\'=\active
-\catcode`\`=\active
-
-\gdef\markupsetuplqdefault{\let`\lq}
-\gdef\markupsetuprqdefault{\let'\rq}
-
-\gdef\markupsetcodequoteleft{\let`\codequoteleft}
-\gdef\markupsetcodequoteright{\let'\codequoteright}
-
-\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
-}
-
-\let\markupsetuplqcode \markupsetcodequoteleft
-\let\markupsetuprqcode \markupsetcodequoteright
-%
-\let\markupsetuplqexample \markupsetcodequoteleft
-\let\markupsetuprqexample \markupsetcodequoteright
-%
-\let\markupsetuplqsamp \markupsetcodequoteleft
-\let\markupsetuprqsamp \markupsetcodequoteright
-%
-\let\markupsetuplqverb \markupsetcodequoteleft
-\let\markupsetuprqverb \markupsetcodequoteright
-%
-\let\markupsetuplqverbatim \markupsetcodequoteleft
-\let\markupsetuprqverbatim \markupsetcodequoteright
-
-\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
-
-% Allow an option to not use regular directed right quote/apostrophe
-% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
-% The undirected quote is ugly, so don't make it the default, but it
-% works for pasting with more pdf viewers (at least evince), the
-% lilypond developers report. xpdf does work with the regular 0x27.
-%
-\def\codequoteright{%
- \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
- \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
- '%
- \else \char'15 \fi
- \else \char'15 \fi
-}
-%
-% and a similar option for the left quote char vs. a grave accent.
-% Modern fonts display ASCII 0x60 as a grave accent, so some people like
-% the code environments to do likewise.
-%
-\def\codequoteleft{%
- \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
- \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
- % [Knuth] pp. 380,381,391
- % \relax disables Spanish ligatures ?` and !` of \tt font.
- \relax`%
- \else \char'22 \fi
- \else \char'22 \fi
-}
-
-% Commands to set the quote options.
-%
-\parseargdef\codequoteundirected{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETtxicodequoteundirected\endcsname
- = t%
- \else\ifx\temp\offword
- \expandafter\let\csname SETtxicodequoteundirected\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
- \fi\fi
-}
-%
-\parseargdef\codequotebacktick{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETtxicodequotebacktick\endcsname
- = t%
- \else\ifx\temp\offword
- \expandafter\let\csname SETtxicodequotebacktick\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
- \fi\fi
-}
-
-% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
-\def\noligaturesquoteleft{\relax\lq}
-
-% Count depth in font-changes, for error checks
-\newcount\fontdepth \fontdepth=0
-
-% Font commands.
-
-% #1 is the font command (\sl or \it), #2 is the text to slant.
-% If we are in a monospaced environment, however, 1) always use \ttsl,
-% and 2) do not add an italic correction.
-\def\dosmartslant#1#2{%
- \ifusingtt
- {{\ttsl #2}\let\next=\relax}%
- {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
- \next
-}
-\def\smartslanted{\dosmartslant\sl}
-\def\smartitalic{\dosmartslant\it}
-
-% Output an italic correction unless \next (presumed to be the following
-% character) is such as not to need one.
-\def\smartitaliccorrection{%
- \ifx\next,%
- \else\ifx\next-%
- \else\ifx\next.%
- \else\ptexslash
- \fi\fi\fi
- \aftersmartic
-}
-
-% like \smartslanted except unconditionally uses \ttsl, and no ic.
-% @var is set to this for defun arguments.
-\def\ttslanted#1{{\ttsl #1}}
-
-% @cite is like \smartslanted except unconditionally use \sl. We never want
-% ttsl for book titles, do we?
-\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
-
-\def\aftersmartic{}
-\def\var#1{%
- \let\saveaftersmartic = \aftersmartic
- \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
- \smartslanted{#1}%
-}
-
-\let\i=\smartitalic
-\let\slanted=\smartslanted
-\let\dfn=\smartslanted
-\let\emph=\smartitalic
-
-% Explicit font changes: @r, @sc, undocumented @ii.
-\def\r#1{{\rm #1}} % roman font
-\def\sc#1{{\smallcaps#1}} % smallcaps font
-\def\ii#1{{\it #1}} % italic font
-
-% @b, explicit bold. Also @strong.
-\def\b#1{{\bf #1}}
-\let\strong=\b
-
-% @sansserif, explicit sans.
-\def\sansserif#1{{\sf #1}}
-
-% We can't just use \exhyphenpenalty, because that only has effect at
-% the end of a paragraph. Restore normal hyphenation at the end of the
-% group within which \nohyphenation is presumably called.
-%
-\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
-\def\restorehyphenation{\hyphenchar\font = `- }
-
-% Set sfcode to normal for the chars that usually have another value.
-% Can't use plain's \frenchspacing because it uses the `\x notation, and
-% sometimes \x has an active definition that messes things up.
-%
-\catcode`@=11
- \def\plainfrenchspacing{%
- \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
- \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
- \def\endofsentencespacefactor{1000}% for @. and friends
- }
- \def\plainnonfrenchspacing{%
- \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
- \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
- \def\endofsentencespacefactor{3000}% for @. and friends
- }
-\catcode`@=\other
-\def\endofsentencespacefactor{3000}% default
-
-% @t, explicit typewriter.
-\def\t#1{%
- {\tt \rawbackslash \plainfrenchspacing #1}%
- \null
-}
-
-% @samp.
-\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
-
-% definition of @key that produces a lozenge. Doesn't adjust to text size.
-%\setfont\keyrm\rmshape{8}{1000}{OT1}
-%\font\keysy=cmsy9
-%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
-% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
-% \vbox{\hrule\kern-0.4pt
-% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
-% \kern-0.4pt\hrule}%
-% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
-
-% definition of @key with no lozenge. If the current font is already
-% monospace, don't change it; that way, we respect @kbdinputstyle. But
-% if it isn't monospace, then use \tt.
-%
-\def\key#1{{\setupmarkupstyle{key}%
- \nohyphenation
- \ifmonospace\else\tt\fi
- #1}\null}
-
-% ctrl is no longer a Texinfo command.
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-% @file, @option are the same as @samp.
-\let\file=\samp
-\let\option=\samp
-
-% @code is a modification of @t,
-% which makes spaces the same size as normal in the surrounding text.
-\def\tclose#1{%
- {%
- % Change normal interword space to be same as for the current font.
- \spaceskip = \fontdimen2\font
- %
- % Switch to typewriter.
- \tt
- %
- % But `\ ' produces the large typewriter interword space.
- \def\ {{\spaceskip = 0pt{} }}%
- %
- % Turn off hyphenation.
- \nohyphenation
- %
- \rawbackslash
- \plainfrenchspacing
- #1%
- }%
- \null % reset spacefactor to 1000
-}
-
-% We *must* turn on hyphenation at `-' and `_' in @code.
-% Otherwise, it is too hard to avoid overfull hboxes
-% in the Emacs manual, the Library manual, etc.
-
-% Unfortunately, TeX uses one parameter (\hyphenchar) to control
-% both hyphenation at - and hyphenation within words.
-% We must therefore turn them both off (\tclose does that)
-% and arrange explicitly to hyphenate at a dash.
-% -- rms.
-{
- \catcode`\-=\active \catcode`\_=\active
- \catcode`\'=\active \catcode`\`=\active
- \global\let'=\rq \global\let`=\lq % default definitions
- %
- \global\def\code{\begingroup
- \setupmarkupstyle{code}%
- % The following should really be moved into \setupmarkupstyle handlers.
- \catcode\dashChar=\active \catcode\underChar=\active
- \ifallowcodebreaks
- \let-\codedash
- \let_\codeunder
- \else
- \let-\realdash
- \let_\realunder
- \fi
- \codex
- }
-}
-
-\def\codex #1{\tclose{#1}\endgroup}
-
-\def\realdash{-}
-\def\codedash{-\discretionary{}{}{}}
-\def\codeunder{%
- % this is all so @math{@code{var_name}+1} can work. In math mode, _
- % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
- % will therefore expand the active definition of _, which is us
- % (inside @code that is), therefore an endless loop.
- \ifusingtt{\ifmmode
- \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
- \else\normalunderscore \fi
- \discretionary{}{}{}}%
- {\_}%
-}
-
-% An additional complication: the above will allow breaks after, e.g.,
-% each of the four underscores in __typeof__. This is undesirable in
-% some manuals, especially if they don't have long identifiers in
-% general. @allowcodebreaks provides a way to control this.
-%
-\newif\ifallowcodebreaks \allowcodebreakstrue
-
-\def\keywordtrue{true}
-\def\keywordfalse{false}
-
-\parseargdef\allowcodebreaks{%
- \def\txiarg{#1}%
- \ifx\txiarg\keywordtrue
- \allowcodebreakstrue
- \else\ifx\txiarg\keywordfalse
- \allowcodebreaksfalse
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
- \fi\fi
-}
-
-% @uref (abbreviation for `urlref') takes an optional (comma-separated)
-% second argument specifying the text to display and an optional third
-% arg as text to display instead of (rather than in addition to) the url
-% itself. First (mandatory) arg is the url.
-% (This \urefnobreak definition isn't used now, leaving it for a while
-% for comparison.)
-\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
-\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
- \unsepspaces
- \pdfurl{#1}%
- \setbox0 = \hbox{\ignorespaces #3}%
- \ifdim\wd0 > 0pt
- \unhbox0 % third arg given, show only that
- \else
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt
- \ifpdf
- \unhbox0 % PDF: 2nd arg given, show only it
- \else
- \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
- \fi
- \else
- \code{#1}% only url given, so show it
- \fi
- \fi
- \endlink
-\endgroup}
-
-% This \urefbreak definition is the active one.
-\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
-\let\uref=\urefbreak
-\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
-\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
- \unsepspaces
- \pdfurl{#1}%
- \setbox0 = \hbox{\ignorespaces #3}%
- \ifdim\wd0 > 0pt
- \unhbox0 % third arg given, show only that
- \else
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt
- \ifpdf
- \unhbox0 % PDF: 2nd arg given, show only it
- \else
- \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
- \fi
- \else
- \urefcode{#1}% only url given, so show it
- \fi
- \fi
- \endlink
-\endgroup}
-
-% Allow line breaks around only a few characters (only).
-\def\urefcatcodes{%
- \catcode\ampChar=\active \catcode\dotChar=\active
- \catcode\hashChar=\active \catcode\questChar=\active
- \catcode\slashChar=\active
-}
-{
- \urefcatcodes
- %
- \global\def\urefcode{\begingroup
- \setupmarkupstyle{code}%
- \urefcatcodes
- \let&\urefcodeamp
- \let.\urefcodedot
- \let#\urefcodehash
- \let?\urefcodequest
- \let/\urefcodeslash
- \codex
- }
- %
- % By default, they are just regular characters.
- \global\def&{\normalamp}
- \global\def.{\normaldot}
- \global\def#{\normalhash}
- \global\def?{\normalquest}
- \global\def/{\normalslash}
-}
-
-% we put a little stretch before and after the breakable chars, to help
-% line breaking of long url's. The unequal skips make look better in
-% cmtt at least, especially for dots.
-\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
-\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
-%
-\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
-\def\urefcodedot{\urefprestretch .\urefpoststretch}
-\def\urefcodehash{\urefprestretch \#\urefpoststretch}
-\def\urefcodequest{\urefprestretch ?\urefpoststretch}
-\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
-{
- \catcode`\/=\active
- \global\def\urefcodeslashfinish{%
- \urefprestretch \slashChar
- % Allow line break only after the final / in a sequence of
- % slashes, to avoid line break between the slashes in http://.
- \ifx\next/\else \urefpoststretch \fi
- }
-}
-
-% One more complication: by default we'll break after the special
-% characters, but some people like to break before the special chars, so
-% allow that. Also allow no breaking at all, for manual control.
-%
-\parseargdef\urefbreakstyle{%
- \def\txiarg{#1}%
- \ifx\txiarg\wordnone
- \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
- \else\ifx\txiarg\wordbefore
- \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
- \else\ifx\txiarg\wordafter
- \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
- \fi\fi\fi
-}
-\def\wordafter{after}
-\def\wordbefore{before}
-\def\wordnone{none}
-
-\urefbreakstyle after
-
-% @url synonym for @uref, since that's how everyone uses it.
-%
-\let\url=\uref
-
-% rms does not like angle brackets --karl, 17may97.
-% So now @email is just like @uref, unless we are pdf.
-%
-%\def\email#1{\angleleft{\tt #1}\angleright}
-\ifpdf
- \def\email#1{\doemail#1,,\finish}
- \def\doemail#1,#2,#3\finish{\begingroup
- \unsepspaces
- \pdfurl{mailto:#1}%
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
- \endlink
- \endgroup}
-\else
- \let\email=\uref
-\fi
-
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
-
-% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
-% `example' (@kbd uses ttsl only inside of @example and friends),
-% or `code' (@kbd uses normal tty font always).
-\parseargdef\kbdinputstyle{%
- \def\txiarg{#1}%
- \ifx\txiarg\worddistinct
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
- \else\ifx\txiarg\wordexample
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
- \else\ifx\txiarg\wordcode
- \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
- \fi\fi\fi
-}
-\def\worddistinct{distinct}
-\def\wordexample{example}
-\def\wordcode{code}
-
-% Default is `distinct'.
-\kbdinputstyle distinct
-
-\def\xkey{\key}
-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
-\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
-
-% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
-\let\indicateurl=\code
-\let\env=\code
-\let\command=\code
-
-% @clicksequence{File @click{} Open ...}
-\def\clicksequence#1{\begingroup #1\endgroup}
-
-% @clickstyle @arrow (by default)
-\parseargdef\clickstyle{\def\click{#1}}
-\def\click{\arrow}
-
-% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
-%
-\def\dmn#1{\thinspace #1}
-
-% @l was never documented to mean ``switch to the Lisp font'',
-% and it is not used as such in any manual I can find. We need it for
-% Polish suppressed-l. --karl, 22sep96.
-%\def\l#1{{\li #1}\null}
-
-% @acronym for "FBI", "NATO", and the like.
-% We print this one point size smaller, since it's intended for
-% all-uppercase.
-%
-\def\acronym#1{\doacronym #1,,\finish}
-\def\doacronym#1,#2,#3\finish{%
- {\selectfonts\lsize #1}%
- \def\temp{#2}%
- \ifx\temp\empty \else
- \space ({\unsepspaces \ignorespaces \temp \unskip})%
- \fi
- \null % reset \spacefactor=1000
-}
-
-% @abbr for "Comput. J." and the like.
-% No font change, but don't do end-of-sentence spacing.
-%
-\def\abbr#1{\doabbr #1,,\finish}
-\def\doabbr#1,#2,#3\finish{%
- {\plainfrenchspacing #1}%
- \def\temp{#2}%
- \ifx\temp\empty \else
- \space ({\unsepspaces \ignorespaces \temp \unskip})%
- \fi
- \null % reset \spacefactor=1000
-}
-
-% @asis just yields its argument. Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math outputs its argument in math mode.
-%
-% One complication: _ usually means subscripts, but it could also mean
-% an actual _ character, as in @math{@var{some_variable} + 1}. So make
-% _ active, and distinguish by seeing if the current family is \slfam,
-% which is what @var uses.
-{
- \catcode`\_ = \active
- \gdef\mathunderscore{%
- \catcode`\_=\active
- \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
- }
-}
-% Another complication: we want \\ (and @\) to output a math (or tt) \.
-% FYI, plain.tex uses \\ as a temporary control sequence (for no
-% particular reason), but this is not advertised and we don't care.
-%
-% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
-\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
-%
-\def\math{%
- \tex
- \mathunderscore
- \let\\ = \mathbackslash
- \mathactive
- % make the texinfo accent commands work in math mode
- \let\"=\ddot
- \let\'=\acute
- \let\==\bar
- \let\^=\hat
- \let\`=\grave
- \let\u=\breve
- \let\v=\check
- \let\~=\tilde
- \let\dotaccent=\dot
- $\finishmath
-}
-\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
-
-% Some active characters (such as <) are spaced differently in math.
-% We have to reset their definitions in case the @math was an argument
-% to a command which sets the catcodes (such as @item or @section).
-%
-{
- \catcode`^ = \active
- \catcode`< = \active
- \catcode`> = \active
- \catcode`+ = \active
- \catcode`' = \active
- \gdef\mathactive{%
- \let^ = \ptexhat
- \let< = \ptexless
- \let> = \ptexgtr
- \let+ = \ptexplus
- \let' = \ptexquoteright
- }
-}
-
-% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
-% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
-% except specified as a normal braced arg, so no newlines to worry about.
-%
-\def\outfmtnametex{tex}
-%
-\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
-\long\def\doinlinefmt#1,#2,\finish{%
- \def\inlinefmtname{#1}%
- \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
-}
-% For raw, must switch into @tex before parsing the argument, to avoid
-% setting catcodes prematurely. Doing it this way means that, for
-% example, @inlineraw{html, foo{bar} gets a parse error instead of being
-% ignored. But this isn't important because if people want a literal
-% *right* brace they would have to use a command anyway, so they may as
-% well use a command to get a left brace too. We could re-use the
-% delimiter character idea from \verb, but it seems like overkill.
-%
-\long\def\inlineraw{\tex \doinlineraw}
-\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
-\def\doinlinerawtwo#1,#2,\finish{%
- \def\inlinerawname{#1}%
- \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
- \endgroup % close group opened by \tex.
-}
-
-
-\message{glyphs,}
-% and logos.
-
-% @@ prints an @, as does @atchar{}.
-\def\@{\char64 }
-\let\atchar=\@
-
-% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
-% Unless we're in typewriter, use \ecfont because the CM text fonts do
-% not have braces, and we don't want to switch into math.
-\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
-\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
-\let\{=\mylbrace \let\lbracechar=\{
-\let\}=\myrbrace \let\rbracechar=\}
-\begingroup
- % Definitions to produce \{ and \} commands for indices,
- % and @{ and @} for the aux/toc files.
- \catcode`\{ = \other \catcode`\} = \other
- \catcode`\[ = 1 \catcode`\] = 2
- \catcode`\! = 0 \catcode`\\ = \other
- !gdef!lbracecmd[\{]%
- !gdef!rbracecmd[\}]%
- !gdef!lbraceatcmd[@{]%
- !gdef!rbraceatcmd[@}]%
-!endgroup
-
-% @comma{} to avoid , parsing problems.
-\let\comma = ,
-
-% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
-\let\, = \ptexc
-\let\dotaccent = \ptexdot
-\def\ringaccent#1{{\accent23 #1}}
-\let\tieaccent = \ptext
-\let\ubaraccent = \ptexb
-\let\udotaccent = \d
-
-% Other special characters: @questiondown @exclamdown @ordf @ordm
-% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
-\def\questiondown{?`}
-\def\exclamdown{!`}
-\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
-\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
-
-% Dotless i and dotless j, used for accents.
-\def\imacro{i}
-\def\jmacro{j}
-\def\dotless#1{%
- \def\temp{#1}%
- \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
- \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
- \else \errmessage{@dotless can be used only with i or j}%
- \fi\fi
-}
-
-% The \TeX{} logo, as in plain, but resetting the spacing so that a
-% period following counts as ending a sentence. (Idea found in latex.)
-%
-\edef\TeX{\TeX \spacefactor=1000 }
-
-% @LaTeX{} logo. Not quite the same results as the definition in
-% latex.ltx, since we use a different font for the raised A; it's most
-% convenient for us to use an explicitly smaller font, rather than using
-% the \scriptstyle font (since we don't reset \scriptstyle and
-% \scriptscriptstyle).
-%
-\def\LaTeX{%
- L\kern-.36em
- {\setbox0=\hbox{T}%
- \vbox to \ht0{\hbox{%
- \ifx\textnominalsize\xwordpt
- % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
- % Revert to plain's \scriptsize, which is 7pt.
- \count255=\the\fam $\fam\count255 \scriptstyle A$%
- \else
- % For 11pt, we can use our lllsize.
- \selectfonts\lllsize A%
- \fi
- }%
- \vss
- }}%
- \kern-.15em
- \TeX
-}
-
-% Some math mode symbols.
-\def\bullet{$\ptexbullet$}
-\def\geq{\ifmmode \ge\else $\ge$\fi}
-\def\leq{\ifmmode \le\else $\le$\fi}
-\def\minus{\ifmmode -\else $-$\fi}
-
-% @dots{} outputs an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in the cm
-% typewriter fonts as three actual period characters; on the other hand,
-% in other typewriter fonts three periods are wider than 1.5em. So do
-% whichever is larger.
-%
-\def\dots{%
- \leavevmode
- \setbox0=\hbox{...}% get width of three periods
- \ifdim\wd0 > 1.5em
- \dimen0 = \wd0
- \else
- \dimen0 = 1.5em
- \fi
- \hbox to \dimen0{%
- \hskip 0pt plus.25fil
- .\hskip 0pt plus1fil
- .\hskip 0pt plus1fil
- .\hskip 0pt plus.5fil
- }%
-}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
- \dots
- \spacefactor=\endofsentencespacefactor
-}
-
-% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
-%
-% Since these characters are used in examples, they should be an even number of
-% \tt widths. Each \tt character is 1en, so two makes it 1em.
-%
-\def\point{$\star$}
-\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
-\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
-\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
-\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
-\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
-
-% The @error{} command.
-% Adapted from the TeXbook's \boxit.
-%
-\newbox\errorbox
-%
-{\tentt \global\dimen0 = 3em}% Width of the box.
-\dimen2 = .55pt % Thickness of rules
-% The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
-%
-\setbox\errorbox=\hbox to \dimen0{\hfil
- \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
- \advance\hsize by -2\dimen2 % Rules.
- \vbox{%
- \hrule height\dimen2
- \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
- \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
- \kern3pt\vrule width\dimen2}% Space to right.
- \hrule height\dimen2}
- \hfil}
-%
-\def\error{\leavevmode\lower.7ex\copy\errorbox}
-
-% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
-%
-\def\pounds{{\it\$}}
-
-% @euro{} comes from a separate font, depending on the current style.
-% We use the free feym* fonts from the eurosym package by Henrik
-% Theiling, which support regular, slanted, bold and bold slanted (and
-% "outlined" (blackboard board, sort of) versions, which we don't need).
-% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
-%
-% Although only regular is the truly official Euro symbol, we ignore
-% that. The Euro is designed to be slightly taller than the regular
-% font height.
-%
-% feymr - regular
-% feymo - slanted
-% feybr - bold
-% feybo - bold slanted
-%
-% There is no good (free) typewriter version, to my knowledge.
-% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
-% Hmm.
-%
-% Also doesn't work in math. Do we need to do math with euro symbols?
-% Hope not.
-%
-%
-\def\euro{{\eurofont e}}
-\def\eurofont{%
- % We set the font at each command, rather than predefining it in
- % \textfonts and the other font-switching commands, so that
- % installations which never need the symbol don't have to have the
- % font installed.
- %
- % There is only one designed size (nominal 10pt), so we always scale
- % that to the current nominal size.
- %
- % By the way, simply using "at 1em" works for cmr10 and the like, but
- % does not work for cmbx10 and other extended/shrunken fonts.
- %
- \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
- %
- \ifx\curfontstyle\bfstylename
- % bold:
- \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
- \else
- % regular:
- \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
- \fi
- \thiseurofont
-}
-
-% Glyphs from the EC fonts. We don't use \let for the aliases, because
-% sometimes we redefine the original macro, and the alias should reflect
-% the redefinition.
-%
-% Use LaTeX names for the Icelandic letters.
-\def\DH{{\ecfont \char"D0}} % Eth
-\def\dh{{\ecfont \char"F0}} % eth
-\def\TH{{\ecfont \char"DE}} % Thorn
-\def\th{{\ecfont \char"FE}} % thorn
-%
-\def\guillemetleft{{\ecfont \char"13}}
-\def\guillemotleft{\guillemetleft}
-\def\guillemetright{{\ecfont \char"14}}
-\def\guillemotright{\guillemetright}
-\def\guilsinglleft{{\ecfont \char"0E}}
-\def\guilsinglright{{\ecfont \char"0F}}
-\def\quotedblbase{{\ecfont \char"12}}
-\def\quotesinglbase{{\ecfont \char"0D}}
-%
-% This positioning is not perfect (see the ogonek LaTeX package), but
-% we have the precomposed glyphs for the most common cases. We put the
-% tests to use those glyphs in the single \ogonek macro so we have fewer
-% dummy definitions to worry about for index entries, etc.
-%
-% ogonek is also used with other letters in Lithuanian (IOU), but using
-% the precomposed glyphs for those is not so easy since they aren't in
-% the same EC font.
-\def\ogonek#1{{%
- \def\temp{#1}%
- \ifx\temp\macrocharA\Aogonek
- \else\ifx\temp\macrochara\aogonek
- \else\ifx\temp\macrocharE\Eogonek
- \else\ifx\temp\macrochare\eogonek
- \else
- \ecfont \setbox0=\hbox{#1}%
- \ifdim\ht0=1ex\accent"0C #1%
- \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
- \fi
- \fi\fi\fi\fi
- }%
-}
-\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
-\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
-\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
-\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
-%
-% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
-\def\ecfont{%
- % We can't distinguish serif/sans and italic/slanted, but this
- % is used for crude hacks anyway (like adding French and German
- % quotes to documents typeset with CM, where we lose kerning), so
- % hopefully nobody will notice/care.
- \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
- \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
- \ifx\curfontstyle\bfstylename
- % bold:
- \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
- \else
- % regular:
- \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
- \fi
- \thisecfont
-}
-
-% @registeredsymbol - R in a circle. The font for the R should really
-% be smaller yet, but lllsize is the best we can do for now.
-% Adapted from the plain.tex definition of \copyright.
-%
-\def\registeredsymbol{%
- $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
- \hfil\crcr\Orb}}%
- }$%
-}
-
-% @textdegree - the normal degrees sign.
-%
-\def\textdegree{$^\circ$}
-
-% Laurent Siebenmann reports \Orb undefined with:
-% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
-% so we'll define it if necessary.
-%
-\ifx\Orb\thisisundefined
-\def\Orb{\mathhexbox20D}
-\fi
-
-% Quotes.
-\chardef\quotedblleft="5C
-\chardef\quotedblright=`\"
-\chardef\quoteleft=`\`
-\chardef\quoteright=`\'
-
-
-\message{page headings,}
-
-\newskip\titlepagetopglue \titlepagetopglue = 1.5in
-\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
-
-% First the title page. Must do @settitle before @titlepage.
-\newif\ifseenauthor
-\newif\iffinishedtitlepage
-
-% Do an implicit @contents or @shortcontents after @end titlepage if the
-% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
-%
-\newif\ifsetcontentsaftertitlepage
- \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
-\newif\ifsetshortcontentsaftertitlepage
- \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
-
-\parseargdef\shorttitlepage{%
- \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
- \endgroup\page\hbox{}\page}
-
-\envdef\titlepage{%
- % Open one extra group, as we want to close it in the middle of \Etitlepage.
- \begingroup
- \parindent=0pt \textfonts
- % Leave some space at the very top of the page.
- \vglue\titlepagetopglue
- % No rule at page bottom unless we print one at the top with @title.
- \finishedtitlepagetrue
- %
- % Most title ``pages'' are actually two pages long, with space
- % at the top of the second. We don't want the ragged left on the second.
- \let\oldpage = \page
- \def\page{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- \let\page = \oldpage
- \page
- \null
- }%
-}
-
-\def\Etitlepage{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- % It is important to do the page break before ending the group,
- % because the headline and footline are only empty inside the group.
- % If we use the new definition of \page, we always get a blank page
- % after the title page, which we certainly don't want.
- \oldpage
- \endgroup
- %
- % Need this before the \...aftertitlepage checks so that if they are
- % in effect the toc pages will come out with page numbers.
- \HEADINGSon
- %
- % If they want short, they certainly want long too.
- \ifsetshortcontentsaftertitlepage
- \shortcontents
- \contents
- \global\let\shortcontents = \relax
- \global\let\contents = \relax
- \fi
- %
- \ifsetcontentsaftertitlepage
- \contents
- \global\let\contents = \relax
- \global\let\shortcontents = \relax
- \fi
-}
-
-\def\finishtitlepage{%
- \vskip4pt \hrule height 2pt width \hsize
- \vskip\titlepagebottomglue
- \finishedtitlepagetrue
-}
-
-% Macros to be used within @titlepage:
-
-\let\subtitlerm=\tenrm
-\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
-
-\parseargdef\title{%
- \checkenv\titlepage
- \leftline{\titlefonts\rmisbold #1}
- % print a rule at the page bottom also.
- \finishedtitlepagefalse
- \vskip4pt \hrule height 4pt width \hsize \vskip4pt
-}
-
-\parseargdef\subtitle{%
- \checkenv\titlepage
- {\subtitlefont \rightline{#1}}%
-}
-
-% @author should come last, but may come many times.
-% It can also be used inside @quotation.
-%
-\parseargdef\author{%
- \def\temp{\quotation}%
- \ifx\thisenv\temp
- \def\quotationauthor{#1}% printed in \Equotation.
- \else
- \checkenv\titlepage
- \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
- {\secfonts\rmisbold \leftline{#1}}%
- \fi
-}
-
-
-% Set up page headings and footings.
-
-\let\thispage=\folio
-
-\newtoks\evenheadline % headline on even pages
-\newtoks\oddheadline % headline on odd pages
-\newtoks\evenfootline % footline on even pages
-\newtoks\oddfootline % footline on odd pages
-
-% Now make TeX use those variables
-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
- \else \the\evenheadline \fi}}
-\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
- \else \the\evenfootline \fi}\HEADINGShook}
-\let\HEADINGShook=\relax
-
-% Commands to set those variables.
-% For example, this is what @headings on does
-% @evenheading @thistitle|@thispage|@thischapter
-% @oddheading @thischapter|@thispage|@thistitle
-% @evenfooting @thisfile||
-% @oddfooting ||@thisfile
-
-
-\def\evenheading{\parsearg\evenheadingxxx}
-\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
-\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\def\oddheading{\parsearg\oddheadingxxx}
-\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
-\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
-
-\def\evenfooting{\parsearg\evenfootingxxx}
-\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
-\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\def\oddfooting{\parsearg\oddfootingxxx}
-\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
-\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
- \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
- %
- % Leave some space for the footline. Hopefully ok to assume
- % @evenfooting will not be used by itself.
- \global\advance\pageheight by -12pt
- \global\advance\vsize by -12pt
-}
-
-\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
-
-% @evenheadingmarks top \thischapter <- chapter at the top of a page
-% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
-%
-% The same set of arguments for:
-%
-% @oddheadingmarks
-% @evenfootingmarks
-% @oddfootingmarks
-% @everyheadingmarks
-% @everyfootingmarks
-
-\def\evenheadingmarks{\headingmarks{even}{heading}}
-\def\oddheadingmarks{\headingmarks{odd}{heading}}
-\def\evenfootingmarks{\headingmarks{even}{footing}}
-\def\oddfootingmarks{\headingmarks{odd}{footing}}
-\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
- \headingmarks{odd}{heading}{#1} }
-\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
- \headingmarks{odd}{footing}{#1} }
-% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
-\def\headingmarks#1#2#3 {%
- \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
- \global\expandafter\let\csname get#1#2marks\endcsname \temp
-}
-
-\everyheadingmarks bottom
-\everyfootingmarks bottom
-
-% @headings double turns headings on for double-sided printing.
-% @headings single turns headings on for single-sided printing.
-% @headings off turns them off.
-% @headings on same as @headings double, retained for compatibility.
-% @headings after turns on double-sided headings after this page.
-% @headings doubleafter turns on double-sided headings after this page.
-% @headings singleafter turns on single-sided headings after this page.
-% By default, they are off at the start of a document,
-% and turned `on' after @end titlepage.
-
-\def\headings #1 {\csname HEADINGS#1\endcsname}
-
-\def\headingsoff{% non-global headings elimination
- \evenheadline={\hfil}\evenfootline={\hfil}%
- \oddheadline={\hfil}\oddfootline={\hfil}%
-}
-
-\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
-\HEADINGSoff % it's the default
-
-% When we turn headings on, set the page number to 1.
-% For double-sided printing, put current file name in lower left corner,
-% chapter name on inside top of right hand pages, document
-% title on inside top of left hand pages, and page numbers on outside top
-% edge of all pages.
-\def\HEADINGSdouble{%
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-\let\contentsalignmacro = \chappager
-
-% For single-sided printing, chapter title goes across top left of page,
-% page number on top right.
-\def\HEADINGSsingle{%
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-\def\HEADINGSon{\HEADINGSdouble}
-
-\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
-\let\HEADINGSdoubleafter=\HEADINGSafter
-\def\HEADINGSdoublex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-
-\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
-\def\HEADINGSsinglex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-
-% Subroutines used in generating headings
-% This produces Day Month Year style of output.
-% Only define if not already defined, in case a txi-??.tex file has set
-% up a different format (e.g., txi-cs.tex does this).
-\ifx\today\thisisundefined
-\def\today{%
- \number\day\space
- \ifcase\month
- \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
- \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
- \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
- \fi
- \space\number\year}
-\fi
-
-% @settitle line... specifies the title of the document, for headings.
-% It generates no output of its own.
-\def\thistitle{\putwordNoTitle}
-\def\settitle{\parsearg{\gdef\thistitle}}
-
-
-\message{tables,}
-% Tables -- @table, @ftable, @vtable, @item(x).
-
-% default indentation of table text
-\newdimen\tableindent \tableindent=.8in
-% default indentation of @itemize and @enumerate text
-\newdimen\itemindent \itemindent=.3in
-% margin between end of table item and start of table text.
-\newdimen\itemmargin \itemmargin=.1in
-
-% used internally for \itemindent minus \itemmargin
-\newdimen\itemmax
-
-% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
-% these defs.
-% They also define \itemindex
-% to index the item name in whatever manner is desired (perhaps none).
-
-\newif\ifitemxneedsnegativevskip
-
-\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
-
-\def\internalBitem{\smallbreak \parsearg\itemzzz}
-\def\internalBitemx{\itemxpar \parsearg\itemzzz}
-
-\def\itemzzz #1{\begingroup %
- \advance\hsize by -\rightskip
- \advance\hsize by -\tableindent
- \setbox0=\hbox{\itemindicate{#1}}%
- \itemindex{#1}%
- \nobreak % This prevents a break before @itemx.
- %
- % If the item text does not fit in the space we have, put it on a line
- % by itself, and do not allow a page break either before or after that
- % line. We do not start a paragraph here because then if the next
- % command is, e.g., @kindex, the whatsit would get put into the
- % horizontal list on a line by itself, resulting in extra blank space.
- \ifdim \wd0>\itemmax
- %
- % Make this a paragraph so we get the \parskip glue and wrapping,
- % but leave it ragged-right.
- \begingroup
- \advance\leftskip by-\tableindent
- \advance\hsize by\tableindent
- \advance\rightskip by0pt plus1fil\relax
- \leavevmode\unhbox0\par
- \endgroup
- %
- % We're going to be starting a paragraph, but we don't want the
- % \parskip glue -- logically it's part of the @item we just started.
- \nobreak \vskip-\parskip
- %
- % Stop a page break at the \parskip glue coming up. However, if
- % what follows is an environment such as @example, there will be no
- % \parskip glue; then the negative vskip we just inserted would
- % cause the example and the item to crash together. So we use this
- % bizarre value of 10001 as a signal to \aboveenvbreak to insert
- % \parskip glue after all. Section titles are handled this way also.
- %
- \penalty 10001
- \endgroup
- \itemxneedsnegativevskipfalse
- \else
- % The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line.
- \noindent
- % Do this with kerns and \unhbox so that if there is a footnote in
- % the item text, it can migrate to the main vertical list and
- % eventually be printed.
- \nobreak\kern-\tableindent
- \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
- \unhbox0
- \nobreak\kern\dimen0
- \endgroup
- \itemxneedsnegativevskiptrue
- \fi
-}
-
-\def\item{\errmessage{@item while not in a list environment}}
-\def\itemx{\errmessage{@itemx while not in a list environment}}
-
-% @table, @ftable, @vtable.
-\envdef\table{%
- \let\itemindex\gobble
- \tablecheck{table}%
-}
-\envdef\ftable{%
- \def\itemindex ##1{\doind {fn}{\code{##1}}}%
- \tablecheck{ftable}%
-}
-\envdef\vtable{%
- \def\itemindex ##1{\doind {vr}{\code{##1}}}%
- \tablecheck{vtable}%
-}
-\def\tablecheck#1{%
- \ifnum \the\catcode`\^^M=\active
- \endgroup
- \errmessage{This command won't work in this context; perhaps the problem is
- that we are \inenvironment\thisenv}%
- \def\next{\doignore{#1}}%
- \else
- \let\next\tablex
- \fi
- \next
-}
-\def\tablex#1{%
- \def\itemindicate{#1}%
- \parsearg\tabley
-}
-\def\tabley#1{%
- {%
- \makevalueexpandable
- \edef\temp{\noexpand\tablez #1\space\space\space}%
- \expandafter
- }\temp \endtablez
-}
-\def\tablez #1 #2 #3 #4\endtablez{%
- \aboveenvbreak
- \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
- \ifnum 0#2>0 \tableindent=#2\mil \fi
- \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
- \itemmax=\tableindent
- \advance \itemmax by -\itemmargin
- \advance \leftskip by \tableindent
- \exdentamount=\tableindent
- \parindent = 0pt
- \parskip = \smallskipamount
- \ifdim \parskip=0pt \parskip=2pt \fi
- \let\item = \internalBitem
- \let\itemx = \internalBitemx
-}
-\def\Etable{\endgraf\afterenvbreak}
-\let\Eftable\Etable
-\let\Evtable\Etable
-\let\Eitemize\Etable
-\let\Eenumerate\Etable
-
-% This is the counter used by @enumerate, which is really @itemize
-
-\newcount \itemno
-
-\envdef\itemize{\parsearg\doitemize}
-
-\def\doitemize#1{%
- \aboveenvbreak
- \itemmax=\itemindent
- \advance\itemmax by -\itemmargin
- \advance\leftskip by \itemindent
- \exdentamount=\itemindent
- \parindent=0pt
- \parskip=\smallskipamount
- \ifdim\parskip=0pt \parskip=2pt \fi
- %
- % Try typesetting the item mark that if the document erroneously says
- % something like @itemize @samp (intending @table), there's an error
- % right away at the @itemize. It's not the best error message in the
- % world, but it's better than leaving it to the @item. This means if
- % the user wants an empty mark, they have to say @w{} not just @w.
- \def\itemcontents{#1}%
- \setbox0 = \hbox{\itemcontents}%
- %
- % @itemize with no arg is equivalent to @itemize @bullet.
- \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
- %
- \let\item=\itemizeitem
-}
-
-% Definition of @item while inside @itemize and @enumerate.
-%
-\def\itemizeitem{%
- \advance\itemno by 1 % for enumerations
- {\let\par=\endgraf \smallbreak}% reasonable place to break
- {%
- % If the document has an @itemize directly after a section title, a
- % \nobreak will be last on the list, and \sectionheading will have
- % done a \vskip-\parskip. In that case, we don't want to zero
- % parskip, or the item text will crash with the heading. On the
- % other hand, when there is normal text preceding the item (as there
- % usually is), we do want to zero parskip, or there would be too much
- % space. In that case, we won't have a \nobreak before. At least
- % that's the theory.
- \ifnum\lastpenalty<10000 \parskip=0in \fi
- \noindent
- \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
- %
- \vadjust{\penalty 1200}}% not good to break after first line of item.
- \flushcr
-}
-
-% \splitoff TOKENS\endmark defines \first to be the first token in
-% TOKENS, and \rest to be the remainder.
-%
-\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
-
-% Allow an optional argument of an uppercase letter, lowercase letter,
-% or number, to specify the first label in the enumerated list. No
-% argument is the same as `1'.
-%
-\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
-\def\enumeratey #1 #2\endenumeratey{%
- % If we were given no argument, pretend we were given `1'.
- \def\thearg{#1}%
- \ifx\thearg\empty \def\thearg{1}\fi
- %
- % Detect if the argument is a single token. If so, it might be a
- % letter. Otherwise, the only valid thing it can be is a number.
- % (We will always have one token, because of the test we just made.
- % This is a good thing, since \splitoff doesn't work given nothing at
- % all -- the first parameter is undelimited.)
- \expandafter\splitoff\thearg\endmark
- \ifx\rest\empty
- % Only one token in the argument. It could still be anything.
- % A ``lowercase letter'' is one whose \lccode is nonzero.
- % An ``uppercase letter'' is one whose \lccode is both nonzero, and
- % not equal to itself.
- % Otherwise, we assume it's a number.
- %
- % We need the \relax at the end of the \ifnum lines to stop TeX from
- % continuing to look for a <number>.
- %
- \ifnum\lccode\expandafter`\thearg=0\relax
- \numericenumerate % a number (we hope)
- \else
- % It's a letter.
- \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
- \lowercaseenumerate % lowercase letter
- \else
- \uppercaseenumerate % uppercase letter
- \fi
- \fi
- \else
- % Multiple tokens in the argument. We hope it's a number.
- \numericenumerate
- \fi
-}
-
-% An @enumerate whose labels are integers. The starting integer is
-% given in \thearg.
-%
-\def\numericenumerate{%
- \itemno = \thearg
- \startenumeration{\the\itemno}%
-}
-
-% The starting (lowercase) letter is in \thearg.
-\def\lowercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more lowercase letters in @enumerate; get a bigger
- alphabet}%
- \fi
- \char\lccode\itemno
- }%
-}
-
-% The starting (uppercase) letter is in \thearg.
-\def\uppercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more uppercase letters in @enumerate; get a bigger
- alphabet}
- \fi
- \char\uccode\itemno
- }%
-}
-
-% Call \doitemize, adding a period to the first argument and supplying the
-% common last two arguments. Also subtract one from the initial value in
-% \itemno, since @item increments \itemno.
-%
-\def\startenumeration#1{%
- \advance\itemno by -1
- \doitemize{#1.}\flushcr
-}
-
-% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
-% to @enumerate.
-%
-\def\alphaenumerate{\enumerate{a}}
-\def\capsenumerate{\enumerate{A}}
-\def\Ealphaenumerate{\Eenumerate}
-\def\Ecapsenumerate{\Eenumerate}
-
-
-% @multitable macros
-% Amy Hendrickson, 8/18/94, 3/6/96
-%
-% @multitable ... @end multitable will make as many columns as desired.
-% Contents of each column will wrap at width given in preamble. Width
-% can be specified either with sample text given in a template line,
-% or in percent of \hsize, the current width of text on page.
-
-% Table can continue over pages but will only break between lines.
-
-% To make preamble:
-%
-% Either define widths of columns in terms of percent of \hsize:
-% @multitable @columnfractions .25 .3 .45
-% @item ...
-%
-% Numbers following @columnfractions are the percent of the total
-% current hsize to be used for each column. You may use as many
-% columns as desired.
-
-
-% Or use a template:
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item ...
-% using the widest term desired in each column.
-
-% Each new table line starts with @item, each subsequent new column
-% starts with @tab. Empty columns may be produced by supplying @tab's
-% with nothing between them for as many times as empty columns are needed,
-% ie, @tab@tab@tab will produce two empty columns.
-
-% @item, @tab do not need to be on their own lines, but it will not hurt
-% if they are.
-
-% Sample multitable:
-
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item first col stuff @tab second col stuff @tab third col
-% @item
-% first col stuff
-% @tab
-% second col stuff
-% @tab
-% third col
-% @item first col stuff @tab second col stuff
-% @tab Many paragraphs of text may be used in any column.
-%
-% They will wrap at the width determined by the template.
-% @item@tab@tab This will be in third column.
-% @end multitable
-
-% Default dimensions may be reset by user.
-% @multitableparskip is vertical space between paragraphs in table.
-% @multitableparindent is paragraph indent in table.
-% @multitablecolmargin is horizontal space to be left between columns.
-% @multitablelinespace is space to leave between table items, baseline
-% to baseline.
-% 0pt means it depends on current normal line spacing.
-%
-\newskip\multitableparskip
-\newskip\multitableparindent
-\newdimen\multitablecolspace
-\newskip\multitablelinespace
-\multitableparskip=0pt
-\multitableparindent=6pt
-\multitablecolspace=12pt
-\multitablelinespace=0pt
-
-% Macros used to set up halign preamble:
-%
-\let\endsetuptable\relax
-\def\xendsetuptable{\endsetuptable}
-\let\columnfractions\relax
-\def\xcolumnfractions{\columnfractions}
-\newif\ifsetpercent
-
-% #1 is the @columnfraction, usually a decimal number like .5, but might
-% be just 1. We just use it, whatever it is.
-%
-\def\pickupwholefraction#1 {%
- \global\advance\colcount by 1
- \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
- \setuptable
-}
-
-\newcount\colcount
-\def\setuptable#1{%
- \def\firstarg{#1}%
- \ifx\firstarg\xendsetuptable
- \let\go = \relax
- \else
- \ifx\firstarg\xcolumnfractions
- \global\setpercenttrue
- \else
- \ifsetpercent
- \let\go\pickupwholefraction
- \else
- \global\advance\colcount by 1
- \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
- % separator; typically that is always in the input, anyway.
- \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
- \fi
- \fi
- \ifx\go\pickupwholefraction
- % Put the argument back for the \pickupwholefraction call, so
- % we'll always have a period there to be parsed.
- \def\go{\pickupwholefraction#1}%
- \else
- \let\go = \setuptable
- \fi%
- \fi
- \go
-}
-
-% multitable-only commands.
-%
-% @headitem starts a heading row, which we typeset in bold.
-% Assignments have to be global since we are inside the implicit group
-% of an alignment entry. \everycr resets \everytab so we don't have to
-% undo it ourselves.
-\def\headitemfont{\b}% for people to use in the template row; not changeable
-\def\headitem{%
- \checkenv\multitable
- \crcr
- \global\everytab={\bf}% can't use \headitemfont since the parsing differs
- \the\everytab % for the first item
-}%
-%
-% A \tab used to include \hskip1sp. But then the space in a template
-% line is not enough. That is bad. So let's go back to just `&' until
-% we again encounter the problem the 1sp was intended to solve.
-% --karl, nathan@acm.org, 20apr99.
-\def\tab{\checkenv\multitable &\the\everytab}%
-
-% @multitable ... @end multitable definitions:
-%
-\newtoks\everytab % insert after every tab.
-%
-\envdef\multitable{%
- \vskip\parskip
- \startsavinginserts
- %
- % @item within a multitable starts a normal row.
- % We use \def instead of \let so that if one of the multitable entries
- % contains an @itemize, we don't choke on the \item (seen as \crcr aka
- % \endtemplate) expanding \doitemize.
- \def\item{\crcr}%
- %
- \tolerance=9500
- \hbadness=9500
- \setmultitablespacing
- \parskip=\multitableparskip
- \parindent=\multitableparindent
- \overfullrule=0pt
- \global\colcount=0
- %
- \everycr = {%
- \noalign{%
- \global\everytab={}%
- \global\colcount=0 % Reset the column counter.
- % Check for saved footnotes, etc.
- \checkinserts
- % Keeps underfull box messages off when table breaks over pages.
- %\filbreak
- % Maybe so, but it also creates really weird page breaks when the
- % table breaks over pages. Wouldn't \vfil be better? Wait until the
- % problem manifests itself, so it can be fixed for real --karl.
- }%
- }%
- %
- \parsearg\domultitable
-}
-\def\domultitable#1{%
- % To parse everything between @multitable and @item:
- \setuptable#1 \endsetuptable
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
- \halign\bgroup &%
- \global\advance\colcount by 1
- \multistrut
- \vtop{%
- % Use the current \colcount to find the correct column width:
- \hsize=\expandafter\csname col\the\colcount\endcsname
- %
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- %
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- %
- % If the user has set preamble in terms of percent of \hsize we will
- % use that dimension as the width of the column, and the \leftskip
- % will keep entries from bumping into each other. Table will start at
- % left margin and final column will justify at right margin.
- %
- % Make sure we don't inherit \rightskip from the outer environment.
- \rightskip=0pt
- \ifnum\colcount=1
- % The first column will be indented with the surrounding text.
- \advance\hsize by\leftskip
- \else
- \ifsetpercent \else
- % If user has not set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace.
- \advance\hsize by \multitablecolspace
- \fi
- % In either case we will make \leftskip=\multitablecolspace:
- \leftskip=\multitablecolspace
- \fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighting sequences respectively
- % marking characters.
- \noindent\ignorespaces##\unskip\multistrut
- }\cr
-}
-\def\Emultitable{%
- \crcr
- \egroup % end the \halign
- \global\setpercentfalse
-}
-
-\def\setmultitablespacing{%
- \def\multistrut{\strut}% just use the standard line spacing
- %
- % Compute \multitablelinespace (if not defined by user) for use in
- % \multitableparskip calculation. We used define \multistrut based on
- % this, but (ironically) that caused the spacing to be off.
- % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
-\ifdim\multitablelinespace=0pt
-\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
-\global\advance\multitablelinespace by-\ht0
-\fi
-% Test to see if parskip is larger than space between lines of
-% table. If not, do nothing.
-% If so, set to same dimension as multitablelinespace.
-\ifdim\multitableparskip>\multitablelinespace
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
- % than skip between lines in the table.
-\fi%
-\ifdim\multitableparskip=0pt
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
- % than skip between lines in the table.
-\fi}
-
-
-\message{conditionals,}
-
-% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
-% @ifnotxml always succeed. They currently do nothing; we don't
-% attempt to check whether the conditionals are properly nested. But we
-% have to remember that they are conditionals, so that @end doesn't
-% attempt to close an environment group.
-%
-\def\makecond#1{%
- \expandafter\let\csname #1\endcsname = \relax
- \expandafter\let\csname iscond.#1\endcsname = 1
-}
-\makecond{iftex}
-\makecond{ifnotdocbook}
-\makecond{ifnothtml}
-\makecond{ifnotinfo}
-\makecond{ifnotplaintext}
-\makecond{ifnotxml}
-
-% Ignore @ignore, @ifhtml, @ifinfo, and the like.
-%
-\def\direntry{\doignore{direntry}}
-\def\documentdescription{\doignore{documentdescription}}
-\def\docbook{\doignore{docbook}}
-\def\html{\doignore{html}}
-\def\ifdocbook{\doignore{ifdocbook}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\ifinfo{\doignore{ifinfo}}
-\def\ifnottex{\doignore{ifnottex}}
-\def\ifplaintext{\doignore{ifplaintext}}
-\def\ifxml{\doignore{ifxml}}
-\def\ignore{\doignore{ignore}}
-\def\menu{\doignore{menu}}
-\def\xml{\doignore{xml}}
-
-% Ignore text until a line `@end #1', keeping track of nested conditionals.
-%
-% A count to remember the depth of nesting.
-\newcount\doignorecount
-
-\def\doignore#1{\begingroup
- % Scan in ``verbatim'' mode:
- \obeylines
- \catcode`\@ = \other
- \catcode`\{ = \other
- \catcode`\} = \other
- %
- % Make sure that spaces turn into tokens that match what \doignoretext wants.
- \spaceisspace
- %
- % Count number of #1's that we've seen.
- \doignorecount = 0
- %
- % Swallow text until we reach the matching `@end #1'.
- \dodoignore{#1}%
-}
-
-{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
- \obeylines %
- %
- \gdef\dodoignore#1{%
- % #1 contains the command name as a string, e.g., `ifinfo'.
- %
- % Define a command to find the next `@end #1'.
- \long\def\doignoretext##1^^M@end #1{%
- \doignoretextyyy##1^^M@#1\_STOP_}%
- %
- % And this command to find another #1 command, at the beginning of a
- % line. (Otherwise, we would consider a line `@c @ifset', for
- % example, to count as an @ifset for nesting.)
- \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
- %
- % And now expand that command.
- \doignoretext ^^M%
- }%
-}
-
-\def\doignoreyyy#1{%
- \def\temp{#1}%
- \ifx\temp\empty % Nothing found.
- \let\next\doignoretextzzz
- \else % Found a nested condition, ...
- \advance\doignorecount by 1
- \let\next\doignoretextyyy % ..., look for another.
- % If we're here, #1 ends with ^^M\ifinfo (for example).
- \fi
- \next #1% the token \_STOP_ is present just after this macro.
-}
-
-% We have to swallow the remaining "\_STOP_".
-%
-\def\doignoretextzzz#1{%
- \ifnum\doignorecount = 0 % We have just found the outermost @end.
- \let\next\enddoignore
- \else % Still inside a nested condition.
- \advance\doignorecount by -1
- \let\next\doignoretext % Look for the next @end.
- \fi
- \next
-}
-
-% Finish off ignored text.
-{ \obeylines%
- % Ignore anything after the last `@end #1'; this matters in verbatim
- % environments, where otherwise the newline after an ignored conditional
- % would result in a blank line in the output.
- \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
-}
-
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it.
-% We rely on the fact that \parsearg sets \catcode`\ =10.
-%
-\parseargdef\set{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
- {%
- \makevalueexpandable
- \def\temp{#2}%
- \edef\next{\gdef\makecsname{SET#1}}%
- \ifx\temp\empty
- \next{}%
- \else
- \setzzz#2\endsetzzz
- \fi
- }%
-}
-% Remove the trailing space \setxxx inserted.
-\def\setzzz#1 \endsetzzz{\next{#1}}
-
-% @clear VAR clears (i.e., unsets) the variable VAR.
-%
-\parseargdef\clear{%
- {%
- \makevalueexpandable
- \global\expandafter\let\csname SET#1\endcsname=\relax
- }%
-}
-
-% @value{foo} gets the text saved in variable foo.
-\def\value{\begingroup\makevalueexpandable\valuexxx}
-\def\valuexxx#1{\expandablevalue{#1}\endgroup}
-{
- \catcode`\- = \active \catcode`\_ = \active
- %
- \gdef\makevalueexpandable{%
- \let\value = \expandablevalue
- % We don't want these characters active, ...
- \catcode`\-=\other \catcode`\_=\other
- % ..., but we might end up with active ones in the argument if
- % we're called from @code, as @code{@value{foo-bar_}}, though.
- % So \let them to their normal equivalents.
- \let-\realdash \let_\normalunderscore
- }
-}
-
-% We have this subroutine so that we can handle at least some @value's
-% properly in indexes (we call \makevalueexpandable in \indexdummies).
-% The command has to be fully expandable (if the variable is set), since
-% the result winds up in the index file. This means that if the
-% variable's value contains other Texinfo commands, it's almost certain
-% it will fail (although perhaps we could fix that with sufficient work
-% to do a one-level expansion on the result, instead of complete).
-%
-\def\expandablevalue#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- {[No value for ``#1'']}%
- \message{Variable `#1', used in @value, is not set.}%
- \else
- \csname SET#1\endcsname
- \fi
-}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
-%
-% To get special treatment of `@end ifset,' call \makeond and the redefine.
-%
-\makecond{ifset}
-\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
-\def\doifset#1#2{%
- {%
- \makevalueexpandable
- \let\next=\empty
- \expandafter\ifx\csname SET#2\endcsname\relax
- #1% If not set, redefine \next.
- \fi
- \expandafter
- }\next
-}
-\def\ifsetfail{\doignore{ifset}}
-
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
-%
-% The `\else' inside the `\doifset' parameter is a trick to reuse the
-% above code: if the variable is not set, do nothing, if it is set,
-% then redefine \next to \ifclearfail.
-%
-\makecond{ifclear}
-\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
-\def\ifclearfail{\doignore{ifclear}}
-
-% @dircategory CATEGORY -- specify a category of the dir file
-% which this file should belong to. Ignore this in TeX.
-\let\dircategory=\comment
-
-% @defininfoenclose.
-\let\definfoenclose=\comment
-
-
-\message{indexing,}
-% Index generation facilities
-
-% Define \newwrite to be identical to plain tex's \newwrite
-% except not \outer, so it can be used within macros and \if's.
-\edef\newwrite{\makecsname{ptexnewwrite}}
-
-% \newindex {foo} defines an index named foo.
-% It automatically defines \fooindex such that
-% \fooindex ...rest of line... puts an entry in the index foo.
-% It also defines \fooindfile to be the number of the output channel for
-% the file that accumulates this index. The file's extension is foo.
-% The name of an index should be no more than 2 characters long
-% for the sake of vms.
-%
-\def\newindex#1{%
- \iflinks
- \expandafter\newwrite \csname#1indfile\endcsname
- \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
- \fi
- \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
- \noexpand\doindex{#1}}
-}
-
-% @defindex foo == \newindex{foo}
-%
-\def\defindex{\parsearg\newindex}
-
-% Define @defcodeindex, like @defindex except put all entries in @code.
-%
-\def\defcodeindex{\parsearg\newcodeindex}
-%
-\def\newcodeindex#1{%
- \iflinks
- \expandafter\newwrite \csname#1indfile\endcsname
- \openout \csname#1indfile\endcsname \jobname.#1
- \fi
- \expandafter\xdef\csname#1index\endcsname{%
- \noexpand\docodeindex{#1}}%
-}
-
-
-% @synindex foo bar makes index foo feed into index bar.
-% Do this instead of @defindex foo if you don't want it as a separate index.
-%
-% @syncodeindex foo bar similar, but put all entries made for index foo
-% inside @code.
-%
-\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
-\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
-
-% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
-% #3 the target index (bar).
-\def\dosynindex#1#2#3{%
- % Only do \closeout if we haven't already done it, else we'll end up
- % closing the target index.
- \expandafter \ifx\csname donesynindex#2\endcsname \relax
- % The \closeout helps reduce unnecessary open files; the limit on the
- % Acorn RISC OS is a mere 16 files.
- \expandafter\closeout\csname#2indfile\endcsname
- \expandafter\let\csname donesynindex#2\endcsname = 1
- \fi
- % redefine \fooindfile:
- \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
- \expandafter\let\csname#2indfile\endcsname=\temp
- % redefine \fooindex:
- \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
-}
-
-% Define \doindex, the driver for all \fooindex macros.
-% Argument #1 is generated by the calling \fooindex macro,
-% and it is "foo", the name of the index.
-
-% \doindex just uses \parsearg; it calls \doind for the actual work.
-% This is because \doind is more useful to call from other macros.
-
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-
-\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
-\def\singleindexer #1{\doind{\indexname}{#1}}
-
-% like the previous two, but they put @code around the argument.
-\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
-\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
-
-% Take care of Texinfo commands that can appear in an index entry.
-% Since there are some commands we want to expand, and others we don't,
-% we have to laboriously prevent expansion for those that we don't.
-%
-\def\indexdummies{%
- \escapechar = `\\ % use backslash in output files.
- \def\@{@}% change to @@ when we switch to @ as escape char in index files.
- \def\ {\realbackslash\space }%
- %
- % Need these unexpandable (because we define \tt as a dummy)
- % definitions when @{ or @} appear in index entry text. Also, more
- % complicated, when \tex is in effect and \{ is a \delimiter again.
- % We can't use \lbracecmd and \rbracecmd because texindex assumes
- % braces and backslashes are used only as delimiters. Perhaps we
- % should define @lbrace and @rbrace commands a la @comma.
- \def\{{{\tt\char123}}%
- \def\}{{\tt\char125}}%
- %
- % I don't entirely understand this, but when an index entry is
- % generated from a macro call, the \endinput which \scanmacro inserts
- % causes processing to be prematurely terminated. This is,
- % apparently, because \indexsorttmp is fully expanded, and \endinput
- % is an expandable command. The redefinition below makes \endinput
- % disappear altogether for that purpose -- although logging shows that
- % processing continues to some further point. On the other hand, it
- % seems \endinput does not hurt in the printed index arg, since that
- % is still getting written without apparent harm.
- %
- % Sample source (mac-idx3.tex, reported by Graham Percival to
- % help-texinfo, 22may06):
- % @macro funindex {WORD}
- % @findex xyz
- % @end macro
- % ...
- % @funindex commtest
- %
- % The above is not enough to reproduce the bug, but it gives the flavor.
- %
- % Sample whatsit resulting:
- % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
- %
- % So:
- \let\endinput = \empty
- %
- % Do the redefinitions.
- \commondummies
-}
-
-% For the aux and toc files, @ is the escape character. So we want to
-% redefine everything using @ as the escape character (instead of
-% \realbackslash, still used for index files). When everything uses @,
-% this will be simpler.
-%
-\def\atdummies{%
- \def\@{@@}%
- \def\ {@ }%
- \let\{ = \lbraceatcmd
- \let\} = \rbraceatcmd
- %
- % Do the redefinitions.
- \commondummies
- \otherbackslash
-}
-
-% Called from \indexdummies and \atdummies.
-%
-\def\commondummies{%
- %
- % \definedummyword defines \#1 as \string\#1\space, thus effectively
- % preventing its expansion. This is used only for control words,
- % not control letters, because the \space would be incorrect for
- % control characters, but is needed to separate the control word
- % from whatever follows.
- %
- % For control letters, we have \definedummyletter, which omits the
- % space.
- %
- % These can be used both for control words that take an argument and
- % those that do not. If it is followed by {arg} in the input, then
- % that will dutifully get written to the index (or wherever).
- %
- \def\definedummyword ##1{\def##1{\string##1\space}}%
- \def\definedummyletter##1{\def##1{\string##1}}%
- \let\definedummyaccent\definedummyletter
- %
- \commondummiesnofonts
- %
- \definedummyletter\_%
- \definedummyletter\-%
- %
- % Non-English letters.
- \definedummyword\AA
- \definedummyword\AE
- \definedummyword\DH
- \definedummyword\L
- \definedummyword\O
- \definedummyword\OE
- \definedummyword\TH
- \definedummyword\aa
- \definedummyword\ae
- \definedummyword\dh
- \definedummyword\exclamdown
- \definedummyword\l
- \definedummyword\o
- \definedummyword\oe
- \definedummyword\ordf
- \definedummyword\ordm
- \definedummyword\questiondown
- \definedummyword\ss
- \definedummyword\th
- %
- % Although these internal commands shouldn't show up, sometimes they do.
- \definedummyword\bf
- \definedummyword\gtr
- \definedummyword\hat
- \definedummyword\less
- \definedummyword\sf
- \definedummyword\sl
- \definedummyword\tclose
- \definedummyword\tt
- %
- \definedummyword\LaTeX
- \definedummyword\TeX
- %
- % Assorted special characters.
- \definedummyword\arrow
- \definedummyword\bullet
- \definedummyword\comma
- \definedummyword\copyright
- \definedummyword\registeredsymbol
- \definedummyword\dots
- \definedummyword\enddots
- \definedummyword\entrybreak
- \definedummyword\equiv
- \definedummyword\error
- \definedummyword\euro
- \definedummyword\expansion
- \definedummyword\geq
- \definedummyword\guillemetleft
- \definedummyword\guillemetright
- \definedummyword\guilsinglleft
- \definedummyword\guilsinglright
- \definedummyword\leq
- \definedummyword\minus
- \definedummyword\ogonek
- \definedummyword\pounds
- \definedummyword\point
- \definedummyword\print
- \definedummyword\quotedblbase
- \definedummyword\quotedblleft
- \definedummyword\quotedblright
- \definedummyword\quoteleft
- \definedummyword\quoteright
- \definedummyword\quotesinglbase
- \definedummyword\result
- \definedummyword\textdegree
- %
- % We want to disable all macros so that they are not expanded by \write.
- \macrolist
- %
- \normalturnoffactive
- %
- % Handle some cases of @value -- where it does not contain any
- % (non-fully-expandable) commands.
- \makevalueexpandable
-}
-
-% \commondummiesnofonts: common to \commondummies and \indexnofonts.
-%
-\def\commondummiesnofonts{%
- % Control letters and accents.
- \definedummyletter\!%
- \definedummyaccent\"%
- \definedummyaccent\'%
- \definedummyletter\*%
- \definedummyaccent\,%
- \definedummyletter\.%
- \definedummyletter\/%
- \definedummyletter\:%
- \definedummyaccent\=%
- \definedummyletter\?%
- \definedummyaccent\^%
- \definedummyaccent\`%
- \definedummyaccent\~%
- \definedummyword\u
- \definedummyword\v
- \definedummyword\H
- \definedummyword\dotaccent
- \definedummyword\ogonek
- \definedummyword\ringaccent
- \definedummyword\tieaccent
- \definedummyword\ubaraccent
- \definedummyword\udotaccent
- \definedummyword\dotless
- %
- % Texinfo font commands.
- \definedummyword\b
- \definedummyword\i
- \definedummyword\r
- \definedummyword\sansserif
- \definedummyword\sc
- \definedummyword\slanted
- \definedummyword\t
- %
- % Commands that take arguments.
- \definedummyword\acronym
- \definedummyword\anchor
- \definedummyword\cite
- \definedummyword\code
- \definedummyword\command
- \definedummyword\dfn
- \definedummyword\dmn
- \definedummyword\email
- \definedummyword\emph
- \definedummyword\env
- \definedummyword\file
- \definedummyword\indicateurl
- \definedummyword\kbd
- \definedummyword\key
- \definedummyword\math
- \definedummyword\option
- \definedummyword\pxref
- \definedummyword\ref
- \definedummyword\samp
- \definedummyword\strong
- \definedummyword\tie
- \definedummyword\uref
- \definedummyword\url
- \definedummyword\var
- \definedummyword\verb
- \definedummyword\w
- \definedummyword\xref
-}
-
-% \indexnofonts is used when outputting the strings to sort the index
-% by, and when constructing control sequence names. It eliminates all
-% control sequences and just writes whatever the best ASCII sort string
-% would be for a given command (usually its argument).
-%
-\def\indexnofonts{%
- % Accent commands should become @asis.
- \def\definedummyaccent##1{\let##1\asis}%
- % We can just ignore other control letters.
- \def\definedummyletter##1{\let##1\empty}%
- % All control words become @asis by default; overrides below.
- \let\definedummyword\definedummyaccent
- %
- \commondummiesnofonts
- %
- % Don't no-op \tt, since it isn't a user-level command
- % and is used in the definitions of the active chars like <, >, |, etc.
- % Likewise with the other plain tex font commands.
- %\let\tt=\asis
- %
- \def\ { }%
- \def\@{@}%
- \def\_{\normalunderscore}%
- \def\-{}% @- shouldn't affect sorting
- %
- % Unfortunately, texindex is not prepared to handle braces in the
- % content at all. So for index sorting, we map @{ and @} to strings
- % starting with |, since that ASCII character is between ASCII { and }.
- \def\{{|a}%
- \def\}{|b}%
- %
- % Non-English letters.
- \def\AA{AA}%
- \def\AE{AE}%
- \def\DH{DZZ}%
- \def\L{L}%
- \def\OE{OE}%
- \def\O{O}%
- \def\TH{ZZZ}%
- \def\aa{aa}%
- \def\ae{ae}%
- \def\dh{dzz}%
- \def\exclamdown{!}%
- \def\l{l}%
- \def\oe{oe}%
- \def\ordf{a}%
- \def\ordm{o}%
- \def\o{o}%
- \def\questiondown{?}%
- \def\ss{ss}%
- \def\th{zzz}%
- %
- \def\LaTeX{LaTeX}%
- \def\TeX{TeX}%
- %
- % Assorted special characters.
- % (The following {} will end up in the sort string, but that's ok.)
- \def\arrow{->}%
- \def\bullet{bullet}%
- \def\comma{,}%
- \def\copyright{copyright}%
- \def\dots{...}%
- \def\enddots{...}%
- \def\equiv{==}%
- \def\error{error}%
- \def\euro{euro}%
- \def\expansion{==>}%
- \def\geq{>=}%
- \def\guillemetleft{<<}%
- \def\guillemetright{>>}%
- \def\guilsinglleft{<}%
- \def\guilsinglright{>}%
- \def\leq{<=}%
- \def\minus{-}%
- \def\point{.}%
- \def\pounds{pounds}%
- \def\print{-|}%
- \def\quotedblbase{"}%
- \def\quotedblleft{"}%
- \def\quotedblright{"}%
- \def\quoteleft{`}%
- \def\quoteright{'}%
- \def\quotesinglbase{,}%
- \def\registeredsymbol{R}%
- \def\result{=>}%
- \def\textdegree{o}%
- %
- \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
- \else \indexlquoteignore \fi
- %
- % We need to get rid of all macros, leaving only the arguments (if present).
- % Of course this is not nearly correct, but it is the best we can do for now.
- % makeinfo does not expand macros in the argument to @deffn, which ends up
- % writing an index entry, and texindex isn't prepared for an index sort entry
- % that starts with \.
- %
- % Since macro invocations are followed by braces, we can just redefine them
- % to take a single TeX argument. The case of a macro invocation that
- % goes to end-of-line is not handled.
- %
- \macrolist
-}
-
-% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
-% ignore left quotes in the sort term.
-{\catcode`\`=\active
- \gdef\indexlquoteignore{\let`=\empty}}
-
-\let\indexbackslash=0 %overridden during \printindex.
-\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
-
-% Most index entries go through here, but \dosubind is the general case.
-% #1 is the index name, #2 is the entry text.
-\def\doind#1#2{\dosubind{#1}{#2}{}}
-
-% Workhorse for all \fooindexes.
-% #1 is name of index, #2 is stuff to put there, #3 is subentry --
-% empty if called from \doind, as we usually are (the main exception
-% is with most defuns, which call us directly).
-%
-\def\dosubind#1#2#3{%
- \iflinks
- {%
- % Store the main index entry text (including the third arg).
- \toks0 = {#2}%
- % If third arg is present, precede it with a space.
- \def\thirdarg{#3}%
- \ifx\thirdarg\empty \else
- \toks0 = \expandafter{\the\toks0 \space #3}%
- \fi
- %
- \edef\writeto{\csname#1indfile\endcsname}%
- %
- \safewhatsit\dosubindwrite
- }%
- \fi
-}
-
-% Write the entry in \toks0 to the index file:
-%
-\def\dosubindwrite{%
- % Put the index entry in the margin if desired.
- \ifx\SETmarginindex\relax\else
- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
- \fi
- %
- % Remember, we are within a group.
- \indexdummies % Must do this here, since \bf, etc expand at this stage
- \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
- % so it will be output as is; and it will print as backslash.
- %
- % Process the index entry with all font commands turned off, to
- % get the string to sort by.
- {\indexnofonts
- \edef\temp{\the\toks0}% need full expansion
- \xdef\indexsorttmp{\temp}%
- }%
- %
- % Set up the complete index entry, with both the sort key and
- % the original text, including any font commands. We write
- % three arguments to \entry to the .?? file (four in the
- % subentry case), texindex reduces to two when writing the .??s
- % sorted result.
- \edef\temp{%
- \write\writeto{%
- \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
- }%
- \temp
-}
-
-% Take care of unwanted page breaks/skips around a whatsit:
-%
-% If a skip is the last thing on the list now, preserve it
-% by backing up by \lastskip, doing the \write, then inserting
-% the skip again. Otherwise, the whatsit generated by the
-% \write or \pdfdest will make \lastskip zero. The result is that
-% sequences like this:
-% @end defun
-% @tindex whatever
-% @defun ...
-% will have extra space inserted, because the \medbreak in the
-% start of the @defun won't see the skip inserted by the @end of
-% the previous defun.
-%
-% But don't do any of this if we're not in vertical mode. We
-% don't want to do a \vskip and prematurely end a paragraph.
-%
-% Avoid page breaks due to these extra skips, too.
-%
-% But wait, there is a catch there:
-% We'll have to check whether \lastskip is zero skip. \ifdim is not
-% sufficient for this purpose, as it ignores stretch and shrink parts
-% of the skip. The only way seems to be to check the textual
-% representation of the skip.
-%
-% The following is almost like \def\zeroskipmacro{0.0pt} except that
-% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
-%
-\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
-%
-\newskip\whatsitskip
-\newcount\whatsitpenalty
-%
-% ..., ready, GO:
-%
-\def\safewhatsit#1{\ifhmode
- #1%
- \else
- % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
- \whatsitskip = \lastskip
- \edef\lastskipmacro{\the\lastskip}%
- \whatsitpenalty = \lastpenalty
- %
- % If \lastskip is nonzero, that means the last item was a
- % skip. And since a skip is discardable, that means this
- % -\whatsitskip glue we're inserting is preceded by a
- % non-discardable item, therefore it is not a potential
- % breakpoint, therefore no \nobreak needed.
- \ifx\lastskipmacro\zeroskipmacro
- \else
- \vskip-\whatsitskip
- \fi
- %
- #1%
- %
- \ifx\lastskipmacro\zeroskipmacro
- % If \lastskip was zero, perhaps the last item was a penalty, and
- % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
- % to re-insert the same penalty (values >10000 are used for various
- % signals); since we just inserted a non-discardable item, any
- % following glue (such as a \parskip) would be a breakpoint. For example:
- % @deffn deffn-whatever
- % @vindex index-whatever
- % Description.
- % would allow a break between the index-whatever whatsit
- % and the "Description." paragraph.
- \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
- \else
- % On the other hand, if we had a nonzero \lastskip,
- % this make-up glue would be preceded by a non-discardable item
- % (the whatsit from the \write), so we must insert a \nobreak.
- \nobreak\vskip\whatsitskip
- \fi
-\fi}
-
-% The index entry written in the file actually looks like
-% \entry {sortstring}{page}{topic}
-% or
-% \entry {sortstring}{page}{topic}{subtopic}
-% The texindex program reads in these files and writes files
-% containing these kinds of lines:
-% \initial {c}
-% before the first topic whose initial is c
-% \entry {topic}{pagelist}
-% for a topic that is used without subtopics
-% \primary {topic}
-% for the beginning of a topic that is used with subtopics
-% \secondary {subtopic}{pagelist}
-% for each subtopic.
-
-% Define the user-accessible indexing commands
-% @findex, @vindex, @kindex, @cindex.
-
-\def\findex {\fnindex}
-\def\kindex {\kyindex}
-\def\cindex {\cpindex}
-\def\vindex {\vrindex}
-\def\tindex {\tpindex}
-\def\pindex {\pgindex}
-
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
-% Define the macros used in formatting output of the sorted index material.
-
-% @printindex causes a particular index (the ??s file) to get printed.
-% It does not print any chapter heading (usually an @unnumbered).
-%
-\parseargdef\printindex{\begingroup
- \dobreak \chapheadingskip{10000}%
- %
- \smallfonts \rm
- \tolerance = 9500
- \plainfrenchspacing
- \everypar = {}% don't want the \kern\-parindent from indentation suppression.
- %
- % See if the index file exists and is nonempty.
- % Change catcode of @ here so that if the index file contains
- % \initial {@}
- % as its first line, TeX doesn't complain about mismatched braces
- % (because it thinks @} is a control sequence).
- \catcode`\@ = 11
- \openin 1 \jobname.#1s
- \ifeof 1
- % \enddoublecolumns gets confused if there is no text in the index,
- % and it loses the chapter title and the aux file entries for the
- % index. The easiest way to prevent this problem is to make sure
- % there is some text.
- \putwordIndexNonexistent
- \else
- %
- % If the index file exists but is empty, then \openin leaves \ifeof
- % false. We have to make TeX try to read something from the file, so
- % it can discover if there is anything in it.
- \read 1 to \temp
- \ifeof 1
- \putwordIndexIsEmpty
- \else
- % Index files are almost Texinfo source, but we use \ as the escape
- % character. It would be better to use @, but that's too big a change
- % to make right now.
- \def\indexbackslash{\backslashcurfont}%
- \catcode`\\ = 0
- \escapechar = `\\
- \begindoublecolumns
- \input \jobname.#1s
- \enddoublecolumns
- \fi
- \fi
- \closein 1
-\endgroup}
-
-% These macros are used by the sorted index file itself.
-% Change them to control the appearance of the index.
-
-\def\initial#1{{%
- % Some minor font changes for the special characters.
- \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
- %
- % Remove any glue we may have, we'll be inserting our own.
- \removelastskip
- %
- % We like breaks before the index initials, so insert a bonus.
- \nobreak
- \vskip 0pt plus 3\baselineskip
- \penalty 0
- \vskip 0pt plus -3\baselineskip
- %
- % Typeset the initial. Making this add up to a whole number of
- % baselineskips increases the chance of the dots lining up from column
- % to column. It still won't often be perfect, because of the stretch
- % we need before each entry, but it's better.
- %
- % No shrink because it confuses \balancecolumns.
- \vskip 1.67\baselineskip plus .5\baselineskip
- \leftline{\secbf #1}%
- % Do our best not to break after the initial.
- \nobreak
- \vskip .33\baselineskip plus .1\baselineskip
-}}
-
-% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
-% then page number (#2) flushed to the right margin. It is used for index
-% and table of contents entries. The paragraph is indented by \leftskip.
-%
-% A straightforward implementation would start like this:
-% \def\entry#1#2{...
-% But this freezes the catcodes in the argument, and can cause problems to
-% @code, which sets - active. This problem was fixed by a kludge---
-% ``-'' was active throughout whole index, but this isn't really right.
-% The right solution is to prevent \entry from swallowing the whole text.
-% --kasal, 21nov03
-\def\entry{%
- \begingroup
- %
- % Start a new paragraph if necessary, so our assignments below can't
- % affect previous text.
- \par
- %
- % Do not fill out the last line with white space.
- \parfillskip = 0in
- %
- % No extra space above this paragraph.
- \parskip = 0in
- %
- % Do not prefer a separate line ending with a hyphen to fewer lines.
- \finalhyphendemerits = 0
- %
- % \hangindent is only relevant when the entry text and page number
- % don't both fit on one line. In that case, bob suggests starting the
- % dots pretty far over on the line. Unfortunately, a large
- % indentation looks wrong when the entry text itself is broken across
- % lines. So we use a small indentation and put up with long leaders.
- %
- % \hangafter is reset to 1 (which is the value we want) at the start
- % of each paragraph, so we need not do anything with that.
- \hangindent = 2em
- %
- % When the entry text needs to be broken, just fill out the first line
- % with blank space.
- \rightskip = 0pt plus1fil
- %
- % A bit of stretch before each entry for the benefit of balancing
- % columns.
- \vskip 0pt plus1pt
- %
- % When reading the text of entry, convert explicit line breaks
- % from @* into spaces. The user might give these in long section
- % titles, for instance.
- \def\*{\unskip\space\ignorespaces}%
- \def\entrybreak{\hfil\break}%
- %
- % Swallow the left brace of the text (first parameter):
- \afterassignment\doentry
- \let\temp =
-}
-\def\entrybreak{\unskip\space\ignorespaces}%
-\def\doentry{%
- \bgroup % Instead of the swallowed brace.
- \noindent
- \aftergroup\finishentry
- % And now comes the text of the entry.
-}
-\def\finishentry#1{%
- % #1 is the page number.
- %
- % The following is kludged to not output a line of dots in the index if
- % there are no page numbers. The next person who breaks this will be
- % cursed by a Unix daemon.
- \setbox\boxA = \hbox{#1}%
- \ifdim\wd\boxA = 0pt
- \ %
- \else
- %
- % If we must, put the page number on a line of its own, and fill out
- % this line with blank space. (The \hfil is overwhelmed with the
- % fill leaders glue in \indexdotfill if the page number does fit.)
- \hfil\penalty50
- \null\nobreak\indexdotfill % Have leaders before the page number.
- %
- % The `\ ' here is removed by the implicit \unskip that TeX does as
- % part of (the primitive) \par. Without it, a spurious underfull
- % \hbox ensues.
- \ifpdf
- \pdfgettoks#1.%
- \ \the\toksA
- \else
- \ #1%
- \fi
- \fi
- \par
- \endgroup
-}
-
-% Like plain.tex's \dotfill, except uses up at least 1 em.
-\def\indexdotfill{\cleaders
- \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
-
-\def\primary #1{\line{#1\hfil}}
-
-\newskip\secondaryindent \secondaryindent=0.5cm
-\def\secondary#1#2{{%
- \parfillskip=0in
- \parskip=0in
- \hangindent=1in
- \hangafter=1
- \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
- \ifpdf
- \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
- \else
- #2
- \fi
- \par
-}}
-
-% Define two-column mode, which we use to typeset indexes.
-% Adapted from the TeXbook, page 416, which is to say,
-% the manmac.tex format used to print the TeXbook itself.
-\catcode`\@=11
-
-\newbox\partialpage
-\newdimen\doublecolumnhsize
-
-\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
- % Grab any single-column material above us.
- \output = {%
- %
- % Here is a possibility not foreseen in manmac: if we accumulate a
- % whole lot of material, we might end up calling this \output
- % routine twice in a row (see the doublecol-lose test, which is
- % essentially a couple of indexes with @setchapternewpage off). In
- % that case we just ship out what is in \partialpage with the normal
- % output routine. Generally, \partialpage will be empty when this
- % runs and this will be a no-op. See the indexspread.tex test case.
- \ifvoid\partialpage \else
- \onepageout{\pagecontents\partialpage}%
- \fi
- %
- \global\setbox\partialpage = \vbox{%
- % Unvbox the main output page.
- \unvbox\PAGE
- \kern-\topskip \kern\baselineskip
- }%
- }%
- \eject % run that output routine to set \partialpage
- %
- % Use the double-column output routine for subsequent pages.
- \output = {\doublecolumnout}%
- %
- % Change the page size parameters. We could do this once outside this
- % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
- % format, but then we repeat the same computation. Repeating a couple
- % of assignments once per index is clearly meaningless for the
- % execution time, so we may as well do it in one place.
- %
- % First we halve the line length, less a little for the gutter between
- % the columns. We compute the gutter based on the line length, so it
- % changes automatically with the paper format. The magic constant
- % below is chosen so that the gutter has the same value (well, +-<1pt)
- % as it did when we hard-coded it.
- %
- % We put the result in a separate register, \doublecolumhsize, so we
- % can restore it in \pagesofar, after \hsize itself has (potentially)
- % been clobbered.
- %
- \doublecolumnhsize = \hsize
- \advance\doublecolumnhsize by -.04154\hsize
- \divide\doublecolumnhsize by 2
- \hsize = \doublecolumnhsize
- %
- % Double the \vsize as well. (We don't need a separate register here,
- % since nobody clobbers \vsize.)
- \vsize = 2\vsize
-}
-
-% The double-column output routine for all double-column pages except
-% the last.
-%
-\def\doublecolumnout{%
- \splittopskip=\topskip \splitmaxdepth=\maxdepth
- % Get the available space for the double columns -- the normal
- % (undoubled) page height minus any material left over from the
- % previous page.
- \dimen@ = \vsize
- \divide\dimen@ by 2
- \advance\dimen@ by -\ht\partialpage
- %
- % box0 will be the left-hand column, box2 the right.
- \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
- \onepageout\pagesofar
- \unvbox255
- \penalty\outputpenalty
-}
-%
-% Re-output the contents of the output page -- any previous material,
-% followed by the two boxes we just split, in box0 and box2.
-\def\pagesofar{%
- \unvbox\partialpage
- %
- \hsize = \doublecolumnhsize
- \wd0=\hsize \wd2=\hsize
- \hbox to\pagewidth{\box0\hfil\box2}%
-}
-%
-% All done with double columns.
-\def\enddoublecolumns{%
- % The following penalty ensures that the page builder is exercised
- % _before_ we change the output routine. This is necessary in the
- % following situation:
- %
- % The last section of the index consists only of a single entry.
- % Before this section, \pagetotal is less than \pagegoal, so no
- % break occurs before the last section starts. However, the last
- % section, consisting of \initial and the single \entry, does not
- % fit on the page and has to be broken off. Without the following
- % penalty the page builder will not be exercised until \eject
- % below, and by that time we'll already have changed the output
- % routine to the \balancecolumns version, so the next-to-last
- % double-column page will be processed with \balancecolumns, which
- % is wrong: The two columns will go to the main vertical list, with
- % the broken-off section in the recent contributions. As soon as
- % the output routine finishes, TeX starts reconsidering the page
- % break. The two columns and the broken-off section both fit on the
- % page, because the two columns now take up only half of the page
- % goal. When TeX sees \eject from below which follows the final
- % section, it invokes the new output routine that we've set after
- % \balancecolumns below; \onepageout will try to fit the two columns
- % and the final section into the vbox of \pageheight (see
- % \pagebody), causing an overfull box.
- %
- % Note that glue won't work here, because glue does not exercise the
- % page builder, unlike penalties (see The TeXbook, pp. 280-281).
- \penalty0
- %
- \output = {%
- % Split the last of the double-column material. Leave it on the
- % current page, no automatic page break.
- \balancecolumns
- %
- % If we end up splitting too much material for the current page,
- % though, there will be another page break right after this \output
- % invocation ends. Having called \balancecolumns once, we do not
- % want to call it again. Therefore, reset \output to its normal
- % definition right away. (We hope \balancecolumns will never be
- % called on to balance too much material, but if it is, this makes
- % the output somewhat more palatable.)
- \global\output = {\onepageout{\pagecontents\PAGE}}%
- }%
- \eject
- \endgroup % started in \begindoublecolumns
- %
- % \pagegoal was set to the doubled \vsize above, since we restarted
- % the current page. We're now back to normal single-column
- % typesetting, so reset \pagegoal to the normal \vsize (after the
- % \endgroup where \vsize got restored).
- \pagegoal = \vsize
-}
-%
-% Called at the end of the double column material.
-\def\balancecolumns{%
- \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
- \dimen@ = \ht0
- \advance\dimen@ by \topskip
- \advance\dimen@ by-\baselineskip
- \divide\dimen@ by 2 % target to split to
- %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
- \splittopskip = \topskip
- % Loop until we get a decent breakpoint.
- {%
- \vbadness = 10000
- \loop
- \global\setbox3 = \copy0
- \global\setbox1 = \vsplit3 to \dimen@
- \ifdim\ht3>\dimen@
- \global\advance\dimen@ by 1pt
- \repeat
- }%
- %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
- \setbox0=\vbox to\dimen@{\unvbox1}%
- \setbox2=\vbox to\dimen@{\unvbox3}%
- %
- \pagesofar
-}
-\catcode`\@ = \other
-
-
-\message{sectioning,}
-% Chapters, sections, etc.
-
-% Let's start with @part.
-\outer\parseargdef\part{\partzzz{#1}}
-\def\partzzz#1{%
- \chapoddpage
- \null
- \vskip.3\vsize % move it down on the page a bit
- \begingroup
- \noindent \titlefonts\rmisbold #1\par % the text
- \let\lastnode=\empty % no node to associate with
- \writetocentry{part}{#1}{}% but put it in the toc
- \headingsoff % no headline or footline on the part page
- \chapoddpage
- \endgroup
-}
-
-% \unnumberedno is an oxymoron. But we count the unnumbered
-% sections so that we can refer to them unambiguously in the pdf
-% outlines by their "section number". We avoid collisions with chapter
-% numbers by starting them at 10000. (If a document ever has 10000
-% chapters, we're in trouble anyway, I'm sure.)
-\newcount\unnumberedno \unnumberedno = 10000
-\newcount\chapno
-\newcount\secno \secno=0
-\newcount\subsecno \subsecno=0
-\newcount\subsubsecno \subsubsecno=0
-
-% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount\appendixno \appendixno = `\@
-%
-% \def\appendixletter{\char\the\appendixno}
-% We do the following ugly conditional instead of the above simple
-% construct for the sake of pdftex, which needs the actual
-% letter in the expansion, not just typeset.
-%
-\def\appendixletter{%
- \ifnum\appendixno=`A A%
- \else\ifnum\appendixno=`B B%
- \else\ifnum\appendixno=`C C%
- \else\ifnum\appendixno=`D D%
- \else\ifnum\appendixno=`E E%
- \else\ifnum\appendixno=`F F%
- \else\ifnum\appendixno=`G G%
- \else\ifnum\appendixno=`H H%
- \else\ifnum\appendixno=`I I%
- \else\ifnum\appendixno=`J J%
- \else\ifnum\appendixno=`K K%
- \else\ifnum\appendixno=`L L%
- \else\ifnum\appendixno=`M M%
- \else\ifnum\appendixno=`N N%
- \else\ifnum\appendixno=`O O%
- \else\ifnum\appendixno=`P P%
- \else\ifnum\appendixno=`Q Q%
- \else\ifnum\appendixno=`R R%
- \else\ifnum\appendixno=`S S%
- \else\ifnum\appendixno=`T T%
- \else\ifnum\appendixno=`U U%
- \else\ifnum\appendixno=`V V%
- \else\ifnum\appendixno=`W W%
- \else\ifnum\appendixno=`X X%
- \else\ifnum\appendixno=`Y Y%
- \else\ifnum\appendixno=`Z Z%
- % The \the is necessary, despite appearances, because \appendixletter is
- % expanded while writing the .toc file. \char\appendixno is not
- % expandable, thus it is written literally, thus all appendixes come out
- % with the same letter (or @) in the toc without it.
- \else\char\the\appendixno
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
-% Each @chapter defines these (using marks) as the number+name, number
-% and name of the chapter. Page headings and footings can use
-% these. @section does likewise.
-\def\thischapter{}
-\def\thischapternum{}
-\def\thischaptername{}
-\def\thissection{}
-\def\thissectionnum{}
-\def\thissectionname{}
-
-\newcount\absseclevel % used to calculate proper heading level
-\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
-
-% @raisesections: treat @section as chapter, @subsection as section, etc.
-\def\raisesections{\global\advance\secbase by -1}
-\let\up=\raisesections % original BFox name
-
-% @lowersections: treat @chapter as section, @section as subsection, etc.
-\def\lowersections{\global\advance\secbase by 1}
-\let\down=\lowersections % original BFox name
-
-% we only have subsub.
-\chardef\maxseclevel = 3
-%
-% A numbered section within an unnumbered changes to unnumbered too.
-% To achieve this, remember the "biggest" unnum. sec. we are currently in:
-\chardef\unnlevel = \maxseclevel
-%
-% Trace whether the current chapter is an appendix or not:
-% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
-\def\chapheadtype{N}
-
-% Choose a heading macro
-% #1 is heading type
-% #2 is heading level
-% #3 is text for heading
-\def\genhead#1#2#3{%
- % Compute the abs. sec. level:
- \absseclevel=#2
- \advance\absseclevel by \secbase
- % Make sure \absseclevel doesn't fall outside the range:
- \ifnum \absseclevel < 0
- \absseclevel = 0
- \else
- \ifnum \absseclevel > 3
- \absseclevel = 3
- \fi
- \fi
- % The heading type:
- \def\headtype{#1}%
- \if \headtype U%
- \ifnum \absseclevel < \unnlevel
- \chardef\unnlevel = \absseclevel
- \fi
- \else
- % Check for appendix sections:
- \ifnum \absseclevel = 0
- \edef\chapheadtype{\headtype}%
- \else
- \if \headtype A\if \chapheadtype N%
- \errmessage{@appendix... within a non-appendix chapter}%
- \fi\fi
- \fi
- % Check for numbered within unnumbered:
- \ifnum \absseclevel > \unnlevel
- \def\headtype{U}%
- \else
- \chardef\unnlevel = 3
- \fi
- \fi
- % Now print the heading:
- \if \headtype U%
- \ifcase\absseclevel
- \unnumberedzzz{#3}%
- \or \unnumberedseczzz{#3}%
- \or \unnumberedsubseczzz{#3}%
- \or \unnumberedsubsubseczzz{#3}%
- \fi
- \else
- \if \headtype A%
- \ifcase\absseclevel
- \appendixzzz{#3}%
- \or \appendixsectionzzz{#3}%
- \or \appendixsubseczzz{#3}%
- \or \appendixsubsubseczzz{#3}%
- \fi
- \else
- \ifcase\absseclevel
- \chapterzzz{#3}%
- \or \seczzz{#3}%
- \or \numberedsubseczzz{#3}%
- \or \numberedsubsubseczzz{#3}%
- \fi
- \fi
- \fi
- \suppressfirstparagraphindent
-}
-
-% an interface:
-\def\numhead{\genhead N}
-\def\apphead{\genhead A}
-\def\unnmhead{\genhead U}
-
-% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
-% all lower-level sectioning counters to zero.
-%
-% Also set \chaplevelprefix, which we prepend to @float sequence numbers
-% (e.g., figures), q.v. By default (before any chapter), that is empty.
-\let\chaplevelprefix = \empty
-%
-\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz#1{%
- % section resetting is \global in case the chapter is in a group, such
- % as an @include file.
- \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
- \global\advance\chapno by 1
- %
- % Used for \float.
- \gdef\chaplevelprefix{\the\chapno.}%
- \resetallfloatnos
- %
- % \putwordChapter can contain complex things in translations.
- \toks0=\expandafter{\putwordChapter}%
- \message{\the\toks0 \space \the\chapno}%
- %
- % Write the actual heading.
- \chapmacro{#1}{Ynumbered}{\the\chapno}%
- %
- % So @section and the like are numbered underneath this chapter.
- \global\let\section = \numberedsec
- \global\let\subsection = \numberedsubsec
- \global\let\subsubsection = \numberedsubsubsec
-}
-
-\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
-%
-\def\appendixzzz#1{%
- \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
- \global\advance\appendixno by 1
- \gdef\chaplevelprefix{\appendixletter.}%
- \resetallfloatnos
- %
- % \putwordAppendix can contain complex things in translations.
- \toks0=\expandafter{\putwordAppendix}%
- \message{\the\toks0 \space \appendixletter}%
- %
- \chapmacro{#1}{Yappendix}{\appendixletter}%
- %
- \global\let\section = \appendixsec
- \global\let\subsection = \appendixsubsec
- \global\let\subsubsection = \appendixsubsubsec
-}
-
-% normally unnmhead0 calls unnumberedzzz:
-\outer\parseargdef\unnumbered{\unnmhead0{#1}}
-\def\unnumberedzzz#1{%
- \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
- \global\advance\unnumberedno by 1
- %
- % Since an unnumbered has no number, no prefix for figures.
- \global\let\chaplevelprefix = \empty
- \resetallfloatnos
- %
- % This used to be simply \message{#1}, but TeX fully expands the
- % argument to \message. Therefore, if #1 contained @-commands, TeX
- % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
- % expanded @cite (which turns out to cause errors because \cite is meant
- % to be executed, not expanded).
- %
- % Anyway, we don't want the fully-expanded definition of @cite to appear
- % as a result of the \message, we just want `@cite' itself. We use
- % \the<toks register> to achieve this: TeX expands \the<toks> only once,
- % simply yielding the contents of <toks register>. (We also do this for
- % the toc entries.)
- \toks0 = {#1}%
- \message{(\the\toks0)}%
- %
- \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
- %
- \global\let\section = \unnumberedsec
- \global\let\subsection = \unnumberedsubsec
- \global\let\subsubsection = \unnumberedsubsubsec
-}
-
-% @centerchap is like @unnumbered, but the heading is centered.
-\outer\parseargdef\centerchap{%
- % Well, we could do the following in a group, but that would break
- % an assumption that \chapmacro is called at the outermost level.
- % Thus we are safer this way: --kasal, 24feb04
- \let\centerparametersmaybe = \centerparameters
- \unnmhead0{#1}%
- \let\centerparametersmaybe = \relax
-}
-
-% @top is like @unnumbered.
-\let\top\unnumbered
-
-% Sections.
-%
-\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
-\def\seczzz#1{%
- \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
- \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
-}
-
-% normally calls appendixsectionzzz:
-\outer\parseargdef\appendixsection{\apphead1{#1}}
-\def\appendixsectionzzz#1{%
- \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
- \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
-}
-\let\appendixsec\appendixsection
-
-% normally calls unnumberedseczzz:
-\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
-\def\unnumberedseczzz#1{%
- \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
- \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
-}
-
-% Subsections.
-%
-% normally calls numberedsubseczzz:
-\outer\parseargdef\numberedsubsec{\numhead2{#1}}
-\def\numberedsubseczzz#1{%
- \global\subsubsecno=0 \global\advance\subsecno by 1
- \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
-}
-
-% normally calls appendixsubseczzz:
-\outer\parseargdef\appendixsubsec{\apphead2{#1}}
-\def\appendixsubseczzz#1{%
- \global\subsubsecno=0 \global\advance\subsecno by 1
- \sectionheading{#1}{subsec}{Yappendix}%
- {\appendixletter.\the\secno.\the\subsecno}%
-}
-
-% normally calls unnumberedsubseczzz:
-\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
-\def\unnumberedsubseczzz#1{%
- \global\subsubsecno=0 \global\advance\subsecno by 1
- \sectionheading{#1}{subsec}{Ynothing}%
- {\the\unnumberedno.\the\secno.\the\subsecno}%
-}
-
-% Subsubsections.
-%
-% normally numberedsubsubseczzz:
-\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
-\def\numberedsubsubseczzz#1{%
- \global\advance\subsubsecno by 1
- \sectionheading{#1}{subsubsec}{Ynumbered}%
- {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-% normally appendixsubsubseczzz:
-\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
-\def\appendixsubsubseczzz#1{%
- \global\advance\subsubsecno by 1
- \sectionheading{#1}{subsubsec}{Yappendix}%
- {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-% normally unnumberedsubsubseczzz:
-\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
-\def\unnumberedsubsubseczzz#1{%
- \global\advance\subsubsecno by 1
- \sectionheading{#1}{subsubsec}{Ynothing}%
- {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-% These macros control what the section commands do, according
-% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
-% Define them by default for a numbered chapter.
-\let\section = \numberedsec
-\let\subsection = \numberedsubsec
-\let\subsubsection = \numberedsubsubsec
-
-% Define @majorheading, @heading and @subheading
-
-% NOTE on use of \vbox for chapter headings, section headings, and such:
-% 1) We use \vbox rather than the earlier \line to permit
-% overlong headings to fold.
-% 2) \hyphenpenalty is set to 10000 because hyphenation in a
-% heading is obnoxious; this forbids it.
-% 3) Likewise, headings look best if no \parindent is used, and
-% if justification is not attempted. Hence \raggedright.
-
-\def\majorheading{%
- {\advance\chapheadingskip by 10pt \chapbreak }%
- \parsearg\chapheadingzzz
-}
-
-\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
-\def\chapheadingzzz#1{%
- {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\ptexraggedright
- \rmisbold #1\hfill}}%
- \bigskip \par\penalty 200\relax
- \suppressfirstparagraphindent
-}
-
-% @heading, @subheading, @subsubheading.
-\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
- \suppressfirstparagraphindent}
-\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
- \suppressfirstparagraphindent}
-\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
- \suppressfirstparagraphindent}
-
-% These macros generate a chapter, section, etc. heading only
-% (including whitespace, linebreaking, etc. around it),
-% given all the information in convenient, parsed form.
-
-% Args are the skip and penalty (usually negative)
-\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
-
-% Parameter controlling skip before chapter headings (if needed)
-\newskip\chapheadingskip
-
-% Define plain chapter starts, and page on/off switching for it.
-\def\chapbreak{\dobreak \chapheadingskip {-4000}}
-\def\chappager{\par\vfill\supereject}
-% Because \domark is called before \chapoddpage, the filler page will
-% get the headings for the next chapter, which is wrong. But we don't
-% care -- we just disable all headings on the filler page.
-\def\chapoddpage{%
- \chappager
- \ifodd\pageno \else
- \begingroup
- \headingsoff
- \null
- \chappager
- \endgroup
- \fi
-}
-
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-
-\def\CHAPPAGoff{%
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chapbreak
-\global\let\pagealignmacro=\chappager}
-
-\def\CHAPPAGon{%
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chappager
-\global\let\pagealignmacro=\chappager
-\global\def\HEADINGSon{\HEADINGSsingle}}
-
-\def\CHAPPAGodd{%
-\global\let\contentsalignmacro = \chapoddpage
-\global\let\pchapsepmacro=\chapoddpage
-\global\let\pagealignmacro=\chapoddpage
-\global\def\HEADINGSon{\HEADINGSdouble}}
-
-\CHAPPAGon
-
-% Chapter opening.
-%
-% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
-% Yappendix, Yomitfromtoc), #3 the chapter number.
-%
-% To test against our argument.
-\def\Ynothingkeyword{Ynothing}
-\def\Yomitfromtockeyword{Yomitfromtoc}
-\def\Yappendixkeyword{Yappendix}
-%
-\def\chapmacro#1#2#3{%
- % Insert the first mark before the heading break (see notes for \domark).
- \let\prevchapterdefs=\lastchapterdefs
- \let\prevsectiondefs=\lastsectiondefs
- \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
- \gdef\thissection{}}%
- %
- \def\temptype{#2}%
- \ifx\temptype\Ynothingkeyword
- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
- \gdef\thischapter{\thischaptername}}%
- \else\ifx\temptype\Yomitfromtockeyword
- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
- \gdef\thischapter{}}%
- \else\ifx\temptype\Yappendixkeyword
- \toks0={#1}%
- \xdef\lastchapterdefs{%
- \gdef\noexpand\thischaptername{\the\toks0}%
- \gdef\noexpand\thischapternum{\appendixletter}%
- % \noexpand\putwordAppendix avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
- \noexpand\thischapternum:
- \noexpand\thischaptername}%
- }%
- \else
- \toks0={#1}%
- \xdef\lastchapterdefs{%
- \gdef\noexpand\thischaptername{\the\toks0}%
- \gdef\noexpand\thischapternum{\the\chapno}%
- % \noexpand\putwordChapter avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
- \noexpand\thischapternum:
- \noexpand\thischaptername}%
- }%
- \fi\fi\fi
- %
- % Output the mark. Pass it through \safewhatsit, to take care of
- % the preceding space.
- \safewhatsit\domark
- %
- % Insert the chapter heading break.
- \pchapsepmacro
- %
- % Now the second mark, after the heading break. No break points
- % between here and the heading.
- \let\prevchapterdefs=\lastchapterdefs
- \let\prevsectiondefs=\lastsectiondefs
- \domark
- %
- {%
- \chapfonts \rmisbold
- %
- % Have to define \lastsection before calling \donoderef, because the
- % xref code eventually uses it. On the other hand, it has to be called
- % after \pchapsepmacro, or the headline will change too soon.
- \gdef\lastsection{#1}%
- %
- % Only insert the separating space if we have a chapter/appendix
- % number, and don't print the unnumbered ``number''.
- \ifx\temptype\Ynothingkeyword
- \setbox0 = \hbox{}%
- \def\toctype{unnchap}%
- \else\ifx\temptype\Yomitfromtockeyword
- \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
- \def\toctype{omit}%
- \else\ifx\temptype\Yappendixkeyword
- \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
- \def\toctype{app}%
- \else
- \setbox0 = \hbox{#3\enspace}%
- \def\toctype{numchap}%
- \fi\fi\fi
- %
- % Write the toc entry for this chapter. Must come before the
- % \donoderef, because we include the current node name in the toc
- % entry, and \donoderef resets it to empty.
- \writetocentry{\toctype}{#1}{#3}%
- %
- % For pdftex, we have to write out the node definition (aka, make
- % the pdfdest) after any page break, but before the actual text has
- % been typeset. If the destination for the pdf outline is after the
- % text, then jumping from the outline may wind up with the text not
- % being visible, for instance under high magnification.
- \donoderef{#2}%
- %
- % Typeset the actual heading.
- \nobreak % Avoid page breaks at the interline glue.
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
- \hangindent=\wd0 \centerparametersmaybe
- \unhbox0 #1\par}%
- }%
- \nobreak\bigskip % no page break after a chapter title
- \nobreak
-}
-
-% @centerchap -- centered and unnumbered.
-\let\centerparametersmaybe = \relax
-\def\centerparameters{%
- \advance\rightskip by 3\rightskip
- \leftskip = \rightskip
- \parfillskip = 0pt
-}
-
-
-% I don't think this chapter style is supported any more, so I'm not
-% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
-%
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
-%
-\def\unnchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\ptexraggedright
- \rmisbold #1\hfill}}\bigskip \par\nobreak
-}
-\def\chfopen #1#2{\chapoddpage {\chapfonts
-\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
-\par\penalty 5000 %
-}
-\def\centerchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt
- \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
-}
-\def\CHAPFopen{%
- \global\let\chapmacro=\chfopen
- \global\let\centerchapmacro=\centerchfopen}
-
-
-% Section titles. These macros combine the section number parts and
-% call the generic \sectionheading to do the printing.
-%
-\newskip\secheadingskip
-\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
-
-% Subsection titles.
-\newskip\subsecheadingskip
-\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
-
-% Subsubsection titles.
-\def\subsubsecheadingskip{\subsecheadingskip}
-\def\subsubsecheadingbreak{\subsecheadingbreak}
-
-
-% Print any size, any type, section title.
-%
-% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
-% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
-% section number.
-%
-\def\seckeyword{sec}
-%
-\def\sectionheading#1#2#3#4{%
- {%
- \checkenv{}% should not be in an environment.
- %
- % Switch to the right set of fonts.
- \csname #2fonts\endcsname \rmisbold
- %
- \def\sectionlevel{#2}%
- \def\temptype{#3}%
- %
- % Insert first mark before the heading break (see notes for \domark).
- \let\prevsectiondefs=\lastsectiondefs
- \ifx\temptype\Ynothingkeyword
- \ifx\sectionlevel\seckeyword
- \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
- \gdef\thissection{\thissectionname}}%
- \fi
- \else\ifx\temptype\Yomitfromtockeyword
- % Don't redefine \thissection.
- \else\ifx\temptype\Yappendixkeyword
- \ifx\sectionlevel\seckeyword
- \toks0={#1}%
- \xdef\lastsectiondefs{%
- \gdef\noexpand\thissectionname{\the\toks0}%
- \gdef\noexpand\thissectionnum{#4}%
- % \noexpand\putwordSection avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thissection{\noexpand\putwordSection{}
- \noexpand\thissectionnum:
- \noexpand\thissectionname}%
- }%
- \fi
- \else
- \ifx\sectionlevel\seckeyword
- \toks0={#1}%
- \xdef\lastsectiondefs{%
- \gdef\noexpand\thissectionname{\the\toks0}%
- \gdef\noexpand\thissectionnum{#4}%
- % \noexpand\putwordSection avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thissection{\noexpand\putwordSection{}
- \noexpand\thissectionnum:
- \noexpand\thissectionname}%
- }%
- \fi
- \fi\fi\fi
- %
- % Go into vertical mode. Usually we'll already be there, but we
- % don't want the following whatsit to end up in a preceding paragraph
- % if the document didn't happen to have a blank line.
- \par
- %
- % Output the mark. Pass it through \safewhatsit, to take care of
- % the preceding space.
- \safewhatsit\domark
- %
- % Insert space above the heading.
- \csname #2headingbreak\endcsname
- %
- % Now the second mark, after the heading break. No break points
- % between here and the heading.
- \let\prevsectiondefs=\lastsectiondefs
- \domark
- %
- % Only insert the space after the number if we have a section number.
- \ifx\temptype\Ynothingkeyword
- \setbox0 = \hbox{}%
- \def\toctype{unn}%
- \gdef\lastsection{#1}%
- \else\ifx\temptype\Yomitfromtockeyword
- % for @headings -- no section number, don't include in toc,
- % and don't redefine \lastsection.
- \setbox0 = \hbox{}%
- \def\toctype{omit}%
- \let\sectionlevel=\empty
- \else\ifx\temptype\Yappendixkeyword
- \setbox0 = \hbox{#4\enspace}%
- \def\toctype{app}%
- \gdef\lastsection{#1}%
- \else
- \setbox0 = \hbox{#4\enspace}%
- \def\toctype{num}%
- \gdef\lastsection{#1}%
- \fi\fi\fi
- %
- % Write the toc entry (before \donoderef). See comments in \chapmacro.
- \writetocentry{\toctype\sectionlevel}{#1}{#4}%
- %
- % Write the node reference (= pdf destination for pdftex).
- % Again, see comments in \chapmacro.
- \donoderef{#3}%
- %
- % Interline glue will be inserted when the vbox is completed.
- % That glue will be a valid breakpoint for the page, since it'll be
- % preceded by a whatsit (usually from the \donoderef, or from the
- % \writetocentry if there was no node). We don't want to allow that
- % break, since then the whatsits could end up on page n while the
- % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
- \nobreak
- %
- % Output the actual section heading.
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
- \hangindent=\wd0 % zero if no section number
- \unhbox0 #1}%
- }%
- % Add extra space after the heading -- half of whatever came above it.
- % Don't allow stretch, though.
- \kern .5 \csname #2headingskip\endcsname
- %
- % Do not let the kern be a potential breakpoint, as it would be if it
- % was followed by glue.
- \nobreak
- %
- % We'll almost certainly start a paragraph next, so don't let that
- % glue accumulate. (Not a breakpoint because it's preceded by a
- % discardable item.) However, when a paragraph is not started next
- % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
- % or the negative glue will cause weirdly wrong output, typically
- % obscuring the section heading with something else.
- \vskip-\parskip
- %
- % This is so the last item on the main vertical list is a known
- % \penalty > 10000, so \startdefun, etc., can recognize the situation
- % and do the needful.
- \penalty 10001
-}
-
-
-\message{toc,}
-% Table of contents.
-\newwrite\tocfile
-
-% Write an entry to the toc file, opening it if necessary.
-% Called from @chapter, etc.
-%
-% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
-% We append the current node name (if any) and page number as additional
-% arguments for the \{chap,sec,...}entry macros which will eventually
-% read this. The node name is used in the pdf outlines as the
-% destination to jump to.
-%
-% We open the .toc file for writing here instead of at @setfilename (or
-% any other fixed time) so that @contents can be anywhere in the document.
-% But if #1 is `omit', then we don't do anything. This is used for the
-% table of contents chapter openings themselves.
-%
-\newif\iftocfileopened
-\def\omitkeyword{omit}%
-%
-\def\writetocentry#1#2#3{%
- \edef\writetoctype{#1}%
- \ifx\writetoctype\omitkeyword \else
- \iftocfileopened\else
- \immediate\openout\tocfile = \jobname.toc
- \global\tocfileopenedtrue
- \fi
- %
- \iflinks
- {\atdummies
- \edef\temp{%
- \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
- \temp
- }%
- \fi
- \fi
- %
- % Tell \shipout to create a pdf destination on each page, if we're
- % writing pdf. These are used in the table of contents. We can't
- % just write one on every page because the title pages are numbered
- % 1 and 2 (the page numbers aren't printed), and so are the first
- % two pages of the document. Thus, we'd have two destinations named
- % `1', and two named `2'.
- \ifpdf \global\pdfmakepagedesttrue \fi
-}
-
-
-% These characters do not print properly in the Computer Modern roman
-% fonts, so we must take special care. This is more or less redundant
-% with the Texinfo input format setup at the end of this file.
-%
-\def\activecatcodes{%
- \catcode`\"=\active
- \catcode`\$=\active
- \catcode`\<=\active
- \catcode`\>=\active
- \catcode`\\=\active
- \catcode`\^=\active
- \catcode`\_=\active
- \catcode`\|=\active
- \catcode`\~=\active
-}
-
-
-% Read the toc file, which is essentially Texinfo input.
-\def\readtocfile{%
- \setupdatafile
- \activecatcodes
- \input \tocreadfilename
-}
-
-\newskip\contentsrightmargin \contentsrightmargin=1in
-\newcount\savepageno
-\newcount\lastnegativepageno \lastnegativepageno = -1
-
-% Prepare to read what we've written to \tocfile.
-%
-\def\startcontents#1{%
- % If @setchapternewpage on, and @headings double, the contents should
- % start on an odd page, unlike chapters. Thus, we maintain
- % \contentsalignmacro in parallel with \pagealignmacro.
- % From: Torbjorn Granlund <tege@matematik.su.se>
- \contentsalignmacro
- \immediate\closeout\tocfile
- %
- % Don't need to put `Contents' or `Short Contents' in the headline.
- % It is abundantly clear what they are.
- \chapmacro{#1}{Yomitfromtoc}{}%
- %
- \savepageno = \pageno
- \begingroup % Set up to handle contents files properly.
- \raggedbottom % Worry more about breakpoints than the bottom.
- \advance\hsize by -\contentsrightmargin % Don't use the full line length.
- %
- % Roman numerals for page numbers.
- \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
-}
-
-% redefined for the two-volume lispref. We always output on
-% \jobname.toc even if this is redefined.
-%
-\def\tocreadfilename{\jobname.toc}
-
-% Normal (long) toc.
-%
-\def\contents{%
- \startcontents{\putwordTOC}%
- \openin 1 \tocreadfilename\space
- \ifeof 1 \else
- \readtocfile
- \fi
- \vfill \eject
- \contentsalignmacro % in case @setchapternewpage odd is in effect
- \ifeof 1 \else
- \pdfmakeoutlines
- \fi
- \closein 1
- \endgroup
- \lastnegativepageno = \pageno
- \global\pageno = \savepageno
-}
-
-% And just the chapters.
-\def\summarycontents{%
- \startcontents{\putwordShortTOC}%
- %
- \let\partentry = \shortpartentry
- \let\numchapentry = \shortchapentry
- \let\appentry = \shortchapentry
- \let\unnchapentry = \shortunnchapentry
- % We want a true roman here for the page numbers.
- \secfonts
- \let\rm=\shortcontrm \let\bf=\shortcontbf
- \let\sl=\shortcontsl \let\tt=\shortconttt
- \rm
- \hyphenpenalty = 10000
- \advance\baselineskip by 1pt % Open it up a little.
- \def\numsecentry##1##2##3##4{}
- \let\appsecentry = \numsecentry
- \let\unnsecentry = \numsecentry
- \let\numsubsecentry = \numsecentry
- \let\appsubsecentry = \numsecentry
- \let\unnsubsecentry = \numsecentry
- \let\numsubsubsecentry = \numsecentry
- \let\appsubsubsecentry = \numsecentry
- \let\unnsubsubsecentry = \numsecentry
- \openin 1 \tocreadfilename\space
- \ifeof 1 \else
- \readtocfile
- \fi
- \closein 1
- \vfill \eject
- \contentsalignmacro % in case @setchapternewpage odd is in effect
- \endgroup
- \lastnegativepageno = \pageno
- \global\pageno = \savepageno
-}
-\let\shortcontents = \summarycontents
-
-% Typeset the label for a chapter or appendix for the short contents.
-% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
-%
-\def\shortchaplabel#1{%
- % This space should be enough, since a single number is .5em, and the
- % widest letter (M) is 1em, at least in the Computer Modern fonts.
- % But use \hss just in case.
- % (This space doesn't include the extra space that gets added after
- % the label; that gets put in by \shortchapentry above.)
- %
- % We'd like to right-justify chapter numbers, but that looks strange
- % with appendix letters. And right-justifying numbers and
- % left-justifying letters looks strange when there is less than 10
- % chapters. Have to read the whole toc once to know how many chapters
- % there are before deciding ...
- \hbox to 1em{#1\hss}%
-}
-
-% These macros generate individual entries in the table of contents.
-% The first argument is the chapter or section name.
-% The last argument is the page number.
-% The arguments in between are the chapter number, section number, ...
-
-% Parts, in the main contents. Replace the part number, which doesn't
-% exist, with an empty box. Let's hope all the numbers have the same width.
-% Also ignore the page number, which is conventionally not printed.
-\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
-\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
-%
-% Parts, in the short toc.
-\def\shortpartentry#1#2#3#4{%
- \penalty-300
- \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
- \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
-}
-
-% Chapters, in the main contents.
-\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
-%
-% Chapters, in the short toc.
-% See comments in \dochapentry re vbox and related settings.
-\def\shortchapentry#1#2#3#4{%
- \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
-}
-
-% Appendices, in the main contents.
-% Need the word Appendix, and a fixed-size box.
-%
-\def\appendixbox#1{%
- % We use M since it's probably the widest letter.
- \setbox0 = \hbox{\putwordAppendix{} M}%
- \hbox to \wd0{\putwordAppendix{} #1\hss}}
-%
-\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
-
-% Unnumbered chapters.
-\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
-\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
-
-% Sections.
-\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
-\let\appsecentry=\numsecentry
-\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
-
-% Subsections.
-\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
-\let\appsubsecentry=\numsubsecentry
-\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
-
-% And subsubsections.
-\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
-\let\appsubsubsecentry=\numsubsubsecentry
-\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
-
-% This parameter controls the indentation of the various levels.
-% Same as \defaultparindent.
-\newdimen\tocindent \tocindent = 15pt
-
-% Now for the actual typesetting. In all these, #1 is the text and #2 is the
-% page number.
-%
-% If the toc has to be broken over pages, we want it to be at chapters
-% if at all possible; hence the \penalty.
-\def\dochapentry#1#2{%
- \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
- \begingroup
- \chapentryfonts
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
- \endgroup
- \nobreak\vskip .25\baselineskip plus.1\baselineskip
-}
-
-\def\dosecentry#1#2{\begingroup
- \secentryfonts \leftskip=\tocindent
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-\endgroup}
-
-\def\dosubsecentry#1#2{\begingroup
- \subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-\endgroup}
-
-\def\dosubsubsecentry#1#2{\begingroup
- \subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-\endgroup}
-
-% We use the same \entry macro as for the index entries.
-\let\tocentry = \entry
-
-% Space between chapter (or whatever) number and the title.
-\def\labelspace{\hskip1em \relax}
-
-\def\dopageno#1{{\rm #1}}
-\def\doshortpageno#1{{\rm #1}}
-
-\def\chapentryfonts{\secfonts \rm}
-\def\secentryfonts{\textfonts}
-\def\subsecentryfonts{\textfonts}
-\def\subsubsecentryfonts{\textfonts}
-
-
-\message{environments,}
-% @foo ... @end foo.
-
-% @tex ... @end tex escapes into raw TeX temporarily.
-% One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain @ character.
-
-\envdef\tex{%
- \setupmarkupstyle{tex}%
- \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
- \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
- \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
- \catcode `\%=14
- \catcode `\+=\other
- \catcode `\"=\other
- \catcode `\|=\other
- \catcode `\<=\other
- \catcode `\>=\other
- \catcode`\`=\other
- \catcode`\'=\other
- \escapechar=`\\
- %
- % ' is active in math mode (mathcode"8000). So reset it, and all our
- % other math active characters (just in case), to plain's definitions.
- \mathactive
- %
- \let\b=\ptexb
- \let\bullet=\ptexbullet
- \let\c=\ptexc
- \let\,=\ptexcomma
- \let\.=\ptexdot
- \let\dots=\ptexdots
- \let\equiv=\ptexequiv
- \let\!=\ptexexclam
- \let\i=\ptexi
- \let\indent=\ptexindent
- \let\noindent=\ptexnoindent
- \let\{=\ptexlbrace
- \let\+=\tabalign
- \let\}=\ptexrbrace
- \let\/=\ptexslash
- \let\*=\ptexstar
- \let\t=\ptext
- \expandafter \let\csname top\endcsname=\ptextop % outer
- \let\frenchspacing=\plainfrenchspacing
- %
- \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
- \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
- \def\@{@}%
-}
-% There is no need to define \Etex.
-
-% Define @lisp ... @end lisp.
-% @lisp environment forms a group so it can rebind things,
-% including the definition of @end lisp (which normally is erroneous).
-
-% Amount to narrow the margins by for @lisp.
-\newskip\lispnarrowing \lispnarrowing=0.4in
-
-% This is the definition that ^^M gets inside @lisp, @example, and other
-% such environments. \null is better than a space, since it doesn't
-% have any width.
-\def\lisppar{\null\endgraf}
-
-% This space is always present above and below environments.
-\newskip\envskipamount \envskipamount = 0pt
-
-% Make spacing and below environment symmetrical. We use \parskip here
-% to help in doing that, since in @example-like environments \parskip
-% is reset to zero; thus the \afterenvbreak inserts no space -- but the
-% start of the next paragraph will insert \parskip.
-%
-\def\aboveenvbreak{{%
- % =10000 instead of <10000 because of a special case in \itemzzz and
- % \sectionheading, q.v.
- \ifnum \lastpenalty=10000 \else
- \advance\envskipamount by \parskip
- \endgraf
- \ifdim\lastskip<\envskipamount
- \removelastskip
- % it's not a good place to break if the last penalty was \nobreak
- % or better ...
- \ifnum\lastpenalty<10000 \penalty-50 \fi
- \vskip\envskipamount
- \fi
- \fi
-}}
-
-\let\afterenvbreak = \aboveenvbreak
-
-% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
-% also clear it, so that its embedded environments do the narrowing again.
-\let\nonarrowing=\relax
-
-% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
-% environment contents.
-\font\circle=lcircle10
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-\circthick=\fontdimen8\circle
-%
-\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
-\def\ctr{{\hskip 6pt\circle\char'010}}
-\def\cbl{{\circle\char'012\hskip -6pt}}
-\def\cbr{{\hskip 6pt\circle\char'011}}
-\def\carttop{\hbox to \cartouter{\hskip\lskip
- \ctl\leaders\hrule height\circthick\hfil\ctr
- \hskip\rskip}}
-\def\cartbot{\hbox to \cartouter{\hskip\lskip
- \cbl\leaders\hrule height\circthick\hfil\cbr
- \hskip\rskip}}
-%
-\newskip\lskip\newskip\rskip
-
-\envdef\cartouche{%
- \ifhmode\par\fi % can't be in the midst of a paragraph.
- \startsavinginserts
- \lskip=\leftskip \rskip=\rightskip
- \leftskip=0pt\rightskip=0pt % we want these *outside*.
- \cartinner=\hsize \advance\cartinner by-\lskip
- \advance\cartinner by-\rskip
- \cartouter=\hsize
- \advance\cartouter by 18.4pt % allow for 3pt kerns on either
- % side, and for 6pt waste from
- % each corner char, and rule thickness
- \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
- % Flag to tell @lisp, etc., not to narrow margin.
- \let\nonarrowing = t%
- %
- % If this cartouche directly follows a sectioning command, we need the
- % \parskip glue (backspaced over by default) or the cartouche can
- % collide with the section heading.
- \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
- %
- \vbox\bgroup
- \baselineskip=0pt\parskip=0pt\lineskip=0pt
- \carttop
- \hbox\bgroup
- \hskip\lskip
- \vrule\kern3pt
- \vbox\bgroup
- \kern3pt
- \hsize=\cartinner
- \baselineskip=\normbskip
- \lineskip=\normlskip
- \parskip=\normpskip
- \vskip -\parskip
- \comment % For explanation, see the end of def\group.
-}
-\def\Ecartouche{%
- \ifhmode\par\fi
- \kern3pt
- \egroup
- \kern3pt\vrule
- \hskip\rskip
- \egroup
- \cartbot
- \egroup
- \checkinserts
-}
-
-
-% This macro is called at the beginning of all the @example variants,
-% inside a group.
-\newdimen\nonfillparindent
-\def\nonfillstart{%
- \aboveenvbreak
- \hfuzz = 12pt % Don't be fussy
- \sepspaces % Make spaces be word-separators rather than space tokens.
- \let\par = \lisppar % don't ignore blank lines
- \obeylines % each line of input is a line of output
- \parskip = 0pt
- % Turn off paragraph indentation but redefine \indent to emulate
- % the normal \indent.
- \nonfillparindent=\parindent
- \parindent = 0pt
- \let\indent\nonfillindent
- %
- \emergencystretch = 0pt % don't try to avoid overfull boxes
- \ifx\nonarrowing\relax
- \advance \leftskip by \lispnarrowing
- \exdentamount=\lispnarrowing
- \else
- \let\nonarrowing = \relax
- \fi
- \let\exdent=\nofillexdent
-}
-
-\begingroup
-\obeyspaces
-% We want to swallow spaces (but not other tokens) after the fake
-% @indent in our nonfill-environments, where spaces are normally
-% active and set to @tie, resulting in them not being ignored after
-% @indent.
-\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
-\gdef\nonfillindentcheck{%
-\ifx\temp %
-\expandafter\nonfillindentgobble%
-\else%
-\leavevmode\nonfillindentbox%
-\fi%
-}%
-\endgroup
-\def\nonfillindentgobble#1{\nonfillindent}
-\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
-
-% If you want all examples etc. small: @set dispenvsize small.
-% If you want even small examples the full size: @set dispenvsize nosmall.
-% This affects the following displayed environments:
-% @example, @display, @format, @lisp
-%
-\def\smallword{small}
-\def\nosmallword{nosmall}
-\let\SETdispenvsize\relax
-\def\setnormaldispenv{%
- \ifx\SETdispenvsize\smallword
- % end paragraph for sake of leading, in case document has no blank
- % line. This is redundant with what happens in \aboveenvbreak, but
- % we need to do it before changing the fonts, and it's inconvenient
- % to change the fonts afterward.
- \ifnum \lastpenalty=10000 \else \endgraf \fi
- \smallexamplefonts \rm
- \fi
-}
-\def\setsmalldispenv{%
- \ifx\SETdispenvsize\nosmallword
- \else
- \ifnum \lastpenalty=10000 \else \endgraf \fi
- \smallexamplefonts \rm
- \fi
-}
-
-% We often define two environments, @foo and @smallfoo.
-% Let's do it in one command. #1 is the env name, #2 the definition.
-\def\makedispenvdef#1#2{%
- \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
- \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
- \expandafter\let\csname E#1\endcsname \afterenvbreak
- \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
-}
-
-% Define two environment synonyms (#1 and #2) for an environment.
-\def\maketwodispenvdef#1#2#3{%
- \makedispenvdef{#1}{#3}%
- \makedispenvdef{#2}{#3}%
-}
-%
-% @lisp: indented, narrowed, typewriter font;
-% @example: same as @lisp.
-%
-% @smallexample and @smalllisp: use smaller fonts.
-% Originally contributed by Pavel@xerox.
-%
-\maketwodispenvdef{lisp}{example}{%
- \nonfillstart
- \tt\setupmarkupstyle{example}%
- \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
- \gobble % eat return
-}
-% @display/@smalldisplay: same as @lisp except keep current font.
-%
-\makedispenvdef{display}{%
- \nonfillstart
- \gobble
-}
-
-% @format/@smallformat: same as @display except don't narrow margins.
-%
-\makedispenvdef{format}{%
- \let\nonarrowing = t%
- \nonfillstart
- \gobble
-}
-
-% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
-\envdef\flushleft{%
- \let\nonarrowing = t%
- \nonfillstart
- \gobble
-}
-\let\Eflushleft = \afterenvbreak
-
-% @flushright.
-%
-\envdef\flushright{%
- \let\nonarrowing = t%
- \nonfillstart
- \advance\leftskip by 0pt plus 1fill\relax
- \gobble
-}
-\let\Eflushright = \afterenvbreak
-
-
-% @raggedright does more-or-less normal line breaking but no right
-% justification. From plain.tex.
-\envdef\raggedright{%
- \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
-}
-\let\Eraggedright\par
-
-\envdef\raggedleft{%
- \parindent=0pt \leftskip0pt plus2em
- \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
- \hbadness=10000 % Last line will usually be underfull, so turn off
- % badness reporting.
-}
-\let\Eraggedleft\par
-
-\envdef\raggedcenter{%
- \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
- \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
- \hbadness=10000 % Last line will usually be underfull, so turn off
- % badness reporting.
-}
-\let\Eraggedcenter\par
-
-
-% @quotation does normal linebreaking (hence we can't use \nonfillstart)
-% and narrows the margins. We keep \parskip nonzero in general, since
-% we're doing normal filling. So, when using \aboveenvbreak and
-% \afterenvbreak, temporarily make \parskip 0.
-%
-\makedispenvdef{quotation}{\quotationstart}
-%
-\def\quotationstart{%
- {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
- \parindent=0pt
- %
- % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
- \ifx\nonarrowing\relax
- \advance\leftskip by \lispnarrowing
- \advance\rightskip by \lispnarrowing
- \exdentamount = \lispnarrowing
- \else
- \let\nonarrowing = \relax
- \fi
- \parsearg\quotationlabel
-}
-
-% We have retained a nonzero parskip for the environment, since we're
-% doing normal filling.
-%
-\def\Equotation{%
- \par
- \ifx\quotationauthor\thisisundefined\else
- % indent a bit.
- \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
- \fi
- {\parskip=0pt \afterenvbreak}%
-}
-\def\Esmallquotation{\Equotation}
-
-% If we're given an argument, typeset it in bold with a colon after.
-\def\quotationlabel#1{%
- \def\temp{#1}%
- \ifx\temp\empty \else
- {\bf #1: }%
- \fi
-}
-
-
-% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
-% If we want to allow any <char> as delimiter,
-% we need the curly braces so that makeinfo sees the @verb command, eg:
-% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
-%
-% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
-%
-% [Knuth] p.344; only we need to do the other characters Texinfo sets
-% active too. Otherwise, they get lost as the first character on a
-% verbatim line.
-\def\dospecials{%
- \do\ \do\\\do\{\do\}\do\$\do\&%
- \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
- \do\<\do\>\do\|\do\@\do+\do\"%
- % Don't do the quotes -- if we do, @set txicodequoteundirected and
- % @set txicodequotebacktick will not have effect on @verb and
- % @verbatim, and ?` and !` ligatures won't get disabled.
- %\do\`\do\'%
-}
-%
-% [Knuth] p. 380
-\def\uncatcodespecials{%
- \def\do##1{\catcode`##1=\other}\dospecials}
-%
-% Setup for the @verb command.
-%
-% Eight spaces for a tab
-\begingroup
- \catcode`\^^I=\active
- \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
-\endgroup
-%
-\def\setupverb{%
- \tt % easiest (and conventionally used) font for verbatim
- \def\par{\leavevmode\endgraf}%
- \setupmarkupstyle{verb}%
- \tabeightspaces
- % Respect line breaks,
- % print special symbols as themselves, and
- % make each space count
- % must do in this order:
- \obeylines \uncatcodespecials \sepspaces
-}
-
-% Setup for the @verbatim environment
-%
-% Real tab expansion.
-\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
-%
-% We typeset each line of the verbatim in an \hbox, so we can handle
-% tabs. The \global is in case the verbatim line starts with an accent,
-% or some other command that starts with a begin-group. Otherwise, the
-% entire \verbbox would disappear at the corresponding end-group, before
-% it is typeset. Meanwhile, we can't have nested verbatim commands
-% (can we?), so the \global won't be overwriting itself.
-\newbox\verbbox
-\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
-%
-\begingroup
- \catcode`\^^I=\active
- \gdef\tabexpand{%
- \catcode`\^^I=\active
- \def^^I{\leavevmode\egroup
- \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
- \divide\dimen\verbbox by\tabw
- \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
- \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
- \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
- }%
- }
-\endgroup
-
-% start the verbatim environment.
-\def\setupverbatim{%
- \let\nonarrowing = t%
- \nonfillstart
- \tt % easiest (and conventionally used) font for verbatim
- % The \leavevmode here is for blank lines. Otherwise, we would
- % never \starttabox and the \egroup would end verbatim mode.
- \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
- \tabexpand
- \setupmarkupstyle{verbatim}%
- % Respect line breaks,
- % print special symbols as themselves, and
- % make each space count.
- % Must do in this order:
- \obeylines \uncatcodespecials \sepspaces
- \everypar{\starttabbox}%
-}
-
-% Do the @verb magic: verbatim text is quoted by unique
-% delimiter characters. Before first delimiter expect a
-% right brace, after last delimiter expect closing brace:
-%
-% \def\doverb'{'<char>#1<char>'}'{#1}
-%
-% [Knuth] p. 382; only eat outer {}
-\begingroup
- \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
- \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
-\endgroup
-%
-\def\verb{\begingroup\setupverb\doverb}
-%
-%
-% Do the @verbatim magic: define the macro \doverbatim so that
-% the (first) argument ends when '@end verbatim' is reached, ie:
-%
-% \def\doverbatim#1@end verbatim{#1}
-%
-% For Texinfo it's a lot easier than for LaTeX,
-% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
-% we need not redefine '\', '{' and '}'.
-%
-% Inspired by LaTeX's verbatim command set [latex.ltx]
-%
-\begingroup
- \catcode`\ =\active
- \obeylines %
- % ignore everything up to the first ^^M, that's the newline at the end
- % of the @verbatim input line itself. Otherwise we get an extra blank
- % line in the output.
- \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
- % We really want {...\end verbatim} in the body of the macro, but
- % without the active space; thus we have to use \xdef and \gobble.
-\endgroup
-%
-\envdef\verbatim{%
- \setupverbatim\doverbatim
-}
-\let\Everbatim = \afterenvbreak
-
-
-% @verbatiminclude FILE - insert text of file in verbatim environment.
-%
-\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
-%
-\def\doverbatiminclude#1{%
- {%
- \makevalueexpandable
- \setupverbatim
- \indexnofonts % Allow `@@' and other weird things in file names.
- \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
- \input #1
- \afterenvbreak
- }%
-}
-
-% @copying ... @end copying.
-% Save the text away for @insertcopying later.
-%
-% We save the uninterpreted tokens, rather than creating a box.
-% Saving the text in a box would be much easier, but then all the
-% typesetting commands (@smallbook, font changes, etc.) have to be done
-% beforehand -- and a) we want @copying to be done first in the source
-% file; b) letting users define the frontmatter in as flexible order as
-% possible is very desirable.
-%
-\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
-\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
-%
-\def\insertcopying{%
- \begingroup
- \parindent = 0pt % paragraph indentation looks wrong on title page
- \scanexp\copyingtext
- \endgroup
-}
-
-
-\message{defuns,}
-% @defun etc.
-
-\newskip\defbodyindent \defbodyindent=.4in
-\newskip\defargsindent \defargsindent=50pt
-\newskip\deflastargmargin \deflastargmargin=18pt
-\newcount\defunpenalty
-
-% Start the processing of @deffn:
-\def\startdefun{%
- \ifnum\lastpenalty<10000
- \medbreak
- \defunpenalty=10003 % Will keep this @deffn together with the
- % following @def command, see below.
- \else
- % If there are two @def commands in a row, we'll have a \nobreak,
- % which is there to keep the function description together with its
- % header. But if there's nothing but headers, we need to allow a
- % break somewhere. Check specifically for penalty 10002, inserted
- % by \printdefunline, instead of 10000, since the sectioning
- % commands also insert a nobreak penalty, and we don't want to allow
- % a break between a section heading and a defun.
- %
- % As a further refinement, we avoid "club" headers by signalling
- % with penalty of 10003 after the very first @deffn in the
- % sequence (see above), and penalty of 10002 after any following
- % @def command.
- \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
- %
- % Similarly, after a section heading, do not allow a break.
- % But do insert the glue.
- \medskip % preceded by discardable penalty, so not a breakpoint
- \fi
- %
- \parindent=0in
- \advance\leftskip by \defbodyindent
- \exdentamount=\defbodyindent
-}
-
-\def\dodefunx#1{%
- % First, check whether we are in the right environment:
- \checkenv#1%
- %
- % As above, allow line break if we have multiple x headers in a row.
- % It's not a great place, though.
- \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
- %
- % And now, it's time to reuse the body of the original defun:
- \expandafter\gobbledefun#1%
-}
-\def\gobbledefun#1\startdefun{}
-
-% \printdefunline \deffnheader{text}
-%
-\def\printdefunline#1#2{%
- \begingroup
- % call \deffnheader:
- #1#2 \endheader
- % common ending:
- \interlinepenalty = 10000
- \advance\rightskip by 0pt plus 1fil\relax
- \endgraf
- \nobreak\vskip -\parskip
- \penalty\defunpenalty % signal to \startdefun and \dodefunx
- % Some of the @defun-type tags do not enable magic parentheses,
- % rendering the following check redundant. But we don't optimize.
- \checkparencounts
- \endgroup
-}
-
-\def\Edefun{\endgraf\medbreak}
-
-% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
-% the only thing remaining is to define \deffnheader.
-%
-\def\makedefun#1{%
- \expandafter\let\csname E#1\endcsname = \Edefun
- \edef\temp{\noexpand\domakedefun
- \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
- \temp
-}
-
-% \domakedefun \deffn \deffnx \deffnheader
-%
-% Define \deffn and \deffnx, without parameters.
-% \deffnheader has to be defined explicitly.
-%
-\def\domakedefun#1#2#3{%
- \envdef#1{%
- \startdefun
- \doingtypefnfalse % distinguish typed functions from all else
- \parseargusing\activeparens{\printdefunline#3}%
- }%
- \def#2{\dodefunx#1}%
- \def#3%
-}
-
-\newif\ifdoingtypefn % doing typed function?
-\newif\ifrettypeownline % typeset return type on its own line?
-
-% @deftypefnnewline on|off says whether the return type of typed functions
-% are printed on their own line. This affects @deftypefn, @deftypefun,
-% @deftypeop, and @deftypemethod.
-%
-\parseargdef\deftypefnnewline{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETtxideftypefnnl\endcsname
- = \empty
- \else\ifx\temp\offword
- \expandafter\let\csname SETtxideftypefnnl\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @txideftypefnnl value `\temp',
- must be on|off}%
- \fi\fi
-}
-
-% Untyped functions:
-
-% @deffn category name args
-\makedefun{deffn}{\deffngeneral{}}
-
-% @deffn category class name args
-\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
-
-% \defopon {category on}class name args
-\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
-
-% \deffngeneral {subind}category name args
-%
-\def\deffngeneral#1#2 #3 #4\endheader{%
- % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
- \dosubind{fn}{\code{#3}}{#1}%
- \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
-}
-
-% Typed functions:
-
-% @deftypefn category type name args
-\makedefun{deftypefn}{\deftypefngeneral{}}
-
-% @deftypeop category class type name args
-\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
-
-% \deftypeopon {category on}class type name args
-\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
-
-% \deftypefngeneral {subind}category type name args
-%
-\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
- \dosubind{fn}{\code{#4}}{#1}%
- \doingtypefntrue
- \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
-}
-
-% Typed variables:
-
-% @deftypevr category type var args
-\makedefun{deftypevr}{\deftypecvgeneral{}}
-
-% @deftypecv category class type var args
-\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
-
-% \deftypecvof {category of}class type var args
-\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
-
-% \deftypecvgeneral {subind}category type var args
-%
-\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
- \dosubind{vr}{\code{#4}}{#1}%
- \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
-}
-
-% Untyped variables:
-
-% @defvr category var args
-\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
-
-% @defcv category class var args
-\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
-
-% \defcvof {category of}class var args
-\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
-
-% Types:
-
-% @deftp category name args
-\makedefun{deftp}#1 #2 #3\endheader{%
- \doind{tp}{\code{#2}}%
- \defname{#1}{}{#2}\defunargs{#3\unskip}%
-}
-
-% Remaining @defun-like shortcuts:
-\makedefun{defun}{\deffnheader{\putwordDeffunc} }
-\makedefun{defmac}{\deffnheader{\putwordDefmac} }
-\makedefun{defspec}{\deffnheader{\putwordDefspec} }
-\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
-\makedefun{defvar}{\defvrheader{\putwordDefvar} }
-\makedefun{defopt}{\defvrheader{\putwordDefopt} }
-\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
-\makedefun{defmethod}{\defopon\putwordMethodon}
-\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
-\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
-\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
-
-% \defname, which formats the name of the @def (not the args).
-% #1 is the category, such as "Function".
-% #2 is the return type, if any.
-% #3 is the function name.
-%
-% We are followed by (but not passed) the arguments, if any.
-%
-\def\defname#1#2#3{%
- \par
- % Get the values of \leftskip and \rightskip as they were outside the @def...
- \advance\leftskip by -\defbodyindent
- %
- % Determine if we are typesetting the return type of a typed function
- % on a line by itself.
- \rettypeownlinefalse
- \ifdoingtypefn % doing a typed function specifically?
- % then check user option for putting return type on its own line:
- \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
- \rettypeownlinetrue
- \fi
- \fi
- %
- % How we'll format the category name. Putting it in brackets helps
- % distinguish it from the body text that may end up on the next line
- % just below it.
- \def\temp{#1}%
- \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
- %
- % Figure out line sizes for the paragraph shape. We'll always have at
- % least two.
- \tempnum = 2
- %
- % The first line needs space for \box0; but if \rightskip is nonzero,
- % we need only space for the part of \box0 which exceeds it:
- \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
- %
- % If doing a return type on its own line, we'll have another line.
- \ifrettypeownline
- \advance\tempnum by 1
- \def\maybeshapeline{0in \hsize}%
- \else
- \def\maybeshapeline{}%
- \fi
- %
- % The continuations:
- \dimen2=\hsize \advance\dimen2 by -\defargsindent
- %
- % The final paragraph shape:
- \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
- %
- % Put the category name at the right margin.
- \noindent
- \hbox to 0pt{%
- \hfil\box0 \kern-\hsize
- % \hsize has to be shortened this way:
- \kern\leftskip
- % Intentionally do not respect \rightskip, since we need the space.
- }%
- %
- % Allow all lines to be underfull without complaint:
- \tolerance=10000 \hbadness=10000
- \exdentamount=\defbodyindent
- {%
- % defun fonts. We use typewriter by default (used to be bold) because:
- % . we're printing identifiers, they should be in tt in principle.
- % . in languages with many accents, such as Czech or French, it's
- % common to leave accents off identifiers. The result looks ok in
- % tt, but exceedingly strange in rm.
- % . we don't want -- and --- to be treated as ligatures.
- % . this still does not fix the ?` and !` ligatures, but so far no
- % one has made identifiers using them :).
- \df \tt
- \def\temp{#2}% text of the return type
- \ifx\temp\empty\else
- \tclose{\temp}% typeset the return type
- \ifrettypeownline
- % put return type on its own line; prohibit line break following:
- \hfil\vadjust{\nobreak}\break
- \else
- \space % type on same line, so just followed by a space
- \fi
- \fi % no return type
- #3% output function name
- }%
- {\rm\enskip}% hskip 0.5 em of \tenrm
- %
- \boldbrax
- % arguments will be output next, if any.
-}
-
-% Print arguments in slanted roman (not ttsl), inconsistently with using
-% tt for the name. This is because literal text is sometimes needed in
-% the argument list (groff manual), and ttsl and tt are not very
-% distinguishable. Prevent hyphenation at `-' chars.
-%
-\def\defunargs#1{%
- % use sl by default (not ttsl),
- % tt for the names.
- \df \sl \hyphenchar\font=0
- %
- % On the other hand, if an argument has two dashes (for instance), we
- % want a way to get ttsl. Let's try @var for that.
- \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
- #1%
- \sl\hyphenchar\font=45
-}
-
-% We want ()&[] to print specially on the defun line.
-%
-\def\activeparens{%
- \catcode`\(=\active \catcode`\)=\active
- \catcode`\[=\active \catcode`\]=\active
- \catcode`\&=\active
-}
-
-% Make control sequences which act like normal parenthesis chars.
-\let\lparen = ( \let\rparen = )
-
-% Be sure that we always have a definition for `(', etc. For example,
-% if the fn name has parens in it, \boldbrax will not be in effect yet,
-% so TeX would otherwise complain about undefined control sequence.
-{
- \activeparens
- \global\let(=\lparen \global\let)=\rparen
- \global\let[=\lbrack \global\let]=\rbrack
- \global\let& = \&
-
- \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
- \gdef\magicamp{\let&=\amprm}
-}
-
-\newcount\parencount
-
-% If we encounter &foo, then turn on ()-hacking afterwards
-\newif\ifampseen
-\def\amprm#1 {\ampseentrue{\bf\&#1 }}
-
-\def\parenfont{%
- \ifampseen
- % At the first level, print parens in roman,
- % otherwise use the default font.
- \ifnum \parencount=1 \rm \fi
- \else
- % The \sf parens (in \boldbrax) actually are a little bolder than
- % the contained text. This is especially needed for [ and ] .
- \sf
- \fi
-}
-\def\infirstlevel#1{%
- \ifampseen
- \ifnum\parencount=1
- #1%
- \fi
- \fi
-}
-\def\bfafterword#1 {#1 \bf}
-
-\def\opnr{%
- \global\advance\parencount by 1
- {\parenfont(}%
- \infirstlevel \bfafterword
-}
-\def\clnr{%
- {\parenfont)}%
- \infirstlevel \sl
- \global\advance\parencount by -1
-}
-
-\newcount\brackcount
-\def\lbrb{%
- \global\advance\brackcount by 1
- {\bf[}%
-}
-\def\rbrb{%
- {\bf]}%
- \global\advance\brackcount by -1
-}
-
-\def\checkparencounts{%
- \ifnum\parencount=0 \else \badparencount \fi
- \ifnum\brackcount=0 \else \badbrackcount \fi
-}
-% these should not use \errmessage; the glibc manual, at least, actually
-% has such constructs (when documenting function pointers).
-\def\badparencount{%
- \message{Warning: unbalanced parentheses in @def...}%
- \global\parencount=0
-}
-\def\badbrackcount{%
- \message{Warning: unbalanced square brackets in @def...}%
- \global\brackcount=0
-}
-
-
-\message{macros,}
-% @macro.
-
-% To do this right we need a feature of e-TeX, \scantokens,
-% which we arrange to emulate with a temporary file in ordinary TeX.
-\ifx\eTeXversion\thisisundefined
- \newwrite\macscribble
- \def\scantokens#1{%
- \toks0={#1}%
- \immediate\openout\macscribble=\jobname.tmp
- \immediate\write\macscribble{\the\toks0}%
- \immediate\closeout\macscribble
- \input \jobname.tmp
- }
-\fi
-
-\def\scanmacro#1{\begingroup
- \newlinechar`\^^M
- \let\xeatspaces\eatspaces
- %
- % Undo catcode changes of \startcontents and \doprintindex
- % When called from @insertcopying or (short)caption, we need active
- % backslash to get it printed correctly. Previously, we had
- % \catcode`\\=\other instead. We'll see whether a problem appears
- % with macro expansion. --kasal, 19aug04
- \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
- %
- % ... and for \example:
- \spaceisspace
- %
- % The \empty here causes a following catcode 5 newline to be eaten as
- % part of reading whitespace after a control sequence. It does not
- % eat a catcode 13 newline. There's no good way to handle the two
- % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
- % would then have different behavior). See the Macro Details node in
- % the manual for the workaround we recommend for macros and
- % line-oriented commands.
- %
- \scantokens{#1\empty}%
-\endgroup}
-
-\def\scanexp#1{%
- \edef\temp{\noexpand\scanmacro{#1}}%
- \temp
-}
-
-\newcount\paramno % Count of parameters
-\newtoks\macname % Macro name
-\newif\ifrecursive % Is it recursive?
-
-% List of all defined macros in the form
-% \definedummyword\macro1\definedummyword\macro2...
-% Currently is also contains all @aliases; the list can be split
-% if there is a need.
-\def\macrolist{}
-
-% Add the macro to \macrolist
-\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
-\def\addtomacrolistxxx#1{%
- \toks0 = \expandafter{\macrolist\definedummyword#1}%
- \xdef\macrolist{\the\toks0}%
-}
-
-% Utility routines.
-% This does \let #1 = #2, with \csnames; that is,
-% \let \csname#1\endcsname = \csname#2\endcsname
-% (except of course we have to play expansion games).
-%
-\def\cslet#1#2{%
- \expandafter\let
- \csname#1\expandafter\endcsname
- \csname#2\endcsname
-}
-
-% Trim leading and trailing spaces off a string.
-% Concepts from aro-bend problem 15 (see CTAN).
-{\catcode`\@=11
-\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
-\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
-\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
-\def\unbrace#1{#1}
-\unbrace{\gdef\trim@@@ #1 } #2@{#1}
-}
-
-% Trim a single trailing ^^M off a string.
-{\catcode`\^^M=\other \catcode`\Q=3%
-\gdef\eatcr #1{\eatcra #1Q^^MQ}%
-\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
-\gdef\eatcrb#1Q#2Q{#1}%
-}
-
-% Macro bodies are absorbed as an argument in a context where
-% all characters are catcode 10, 11 or 12, except \ which is active
-% (as in normal texinfo). It is necessary to change the definition of \
-% to recognize macro arguments; this is the job of \mbodybackslash.
-%
-% Non-ASCII encodings make 8-bit characters active, so un-activate
-% them to avoid their expansion. Must do this non-globally, to
-% confine the change to the current group.
-%
-% It's necessary to have hard CRs when the macro is executed. This is
-% done by making ^^M (\endlinechar) catcode 12 when reading the macro
-% body, and then making it the \newlinechar in \scanmacro.
-%
-\def\scanctxt{% used as subroutine
- \catcode`\"=\other
- \catcode`\+=\other
- \catcode`\<=\other
- \catcode`\>=\other
- \catcode`\@=\other
- \catcode`\^=\other
- \catcode`\_=\other
- \catcode`\|=\other
- \catcode`\~=\other
- \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
-}
-
-\def\scanargctxt{% used for copying and captions, not macros.
- \scanctxt
- \catcode`\\=\other
- \catcode`\^^M=\other
-}
-
-\def\macrobodyctxt{% used for @macro definitions
- \scanctxt
- \catcode`\{=\other
- \catcode`\}=\other
- \catcode`\^^M=\other
- \usembodybackslash
-}
-
-\def\macroargctxt{% used when scanning invocations
- \scanctxt
- \catcode`\\=0
-}
-% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
-% for the single characters \ { }. Thus, we end up with the "commands"
-% that would be written @\ @{ @} in a Texinfo document.
-%
-% We already have @{ and @}. For @\, we define it here, and only for
-% this purpose, to produce a typewriter backslash (so, the @\ that we
-% define for @math can't be used with @macro calls):
-%
-\def\\{\normalbackslash}%
-%
-% We would like to do this for \, too, since that is what makeinfo does.
-% But it is not possible, because Texinfo already has a command @, for a
-% cedilla accent. Documents must use @comma{} instead.
-%
-% \anythingelse will almost certainly be an error of some kind.
-
-
-% \mbodybackslash is the definition of \ in @macro bodies.
-% It maps \foo\ => \csname macarg.foo\endcsname => #N
-% where N is the macro parameter number.
-% We define \csname macarg.\endcsname to be \realbackslash, so
-% \\ in macro replacement text gets you a backslash.
-%
-{\catcode`@=0 @catcode`@\=@active
- @gdef@usembodybackslash{@let\=@mbodybackslash}
- @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
-}
-\expandafter\def\csname macarg.\endcsname{\realbackslash}
-
-\def\margbackslash#1{\char`\#1 }
-
-\def\macro{\recursivefalse\parsearg\macroxxx}
-\def\rmacro{\recursivetrue\parsearg\macroxxx}
-
-\def\macroxxx#1{%
- \getargs{#1}% now \macname is the macname and \argl the arglist
- \ifx\argl\empty % no arguments
- \paramno=0\relax
- \else
- \expandafter\parsemargdef \argl;%
- \if\paramno>256\relax
- \ifx\eTeXversion\thisisundefined
- \errhelp = \EMsimple
- \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
- \fi
- \fi
- \fi
- \if1\csname ismacro.\the\macname\endcsname
- \message{Warning: redefining \the\macname}%
- \else
- \expandafter\ifx\csname \the\macname\endcsname \relax
- \else \errmessage{Macro name \the\macname\space already defined}\fi
- \global\cslet{macsave.\the\macname}{\the\macname}%
- \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
- \addtomacrolist{\the\macname}%
- \fi
- \begingroup \macrobodyctxt
- \ifrecursive \expandafter\parsermacbody
- \else \expandafter\parsemacbody
- \fi}
-
-\parseargdef\unmacro{%
- \if1\csname ismacro.#1\endcsname
- \global\cslet{#1}{macsave.#1}%
- \global\expandafter\let \csname ismacro.#1\endcsname=0%
- % Remove the macro name from \macrolist:
- \begingroup
- \expandafter\let\csname#1\endcsname \relax
- \let\definedummyword\unmacrodo
- \xdef\macrolist{\macrolist}%
- \endgroup
- \else
- \errmessage{Macro #1 not defined}%
- \fi
-}
-
-% Called by \do from \dounmacro on each macro. The idea is to omit any
-% macro definitions that have been changed to \relax.
-%
-\def\unmacrodo#1{%
- \ifx #1\relax
- % remove this
- \else
- \noexpand\definedummyword \noexpand#1%
- \fi
-}
-
-% This makes use of the obscure feature that if the last token of a
-% <parameter list> is #, then the preceding argument is delimited by
-% an opening brace, and that opening brace is not consumed.
-\def\getargs#1{\getargsxxx#1{}}
-\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
-\def\getmacname#1 #2\relax{\macname={#1}}
-\def\getmacargs#1{\def\argl{#1}}
-
-% For macro processing make @ a letter so that we can make Texinfo private macro names.
-\edef\texiatcatcode{\the\catcode`\@}
-\catcode `@=11\relax
-
-% Parse the optional {params} list. Set up \paramno and \paramlist
-% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
-% in the params list to some hook where the argument si to be expanded. If
-% there are less than 10 arguments that hook is to be replaced by ##N where N
-% is the position in that list, that is to say the macro arguments are to be
-% defined `a la TeX in the macro body.
-%
-% That gets used by \mbodybackslash (above).
-%
-% We need to get `macro parameter char #' into several definitions.
-% The technique used is stolen from LaTeX: let \hash be something
-% unexpandable, insert that wherever you need a #, and then redefine
-% it to # just before using the token list produced.
-%
-% The same technique is used to protect \eatspaces till just before
-% the macro is used.
-%
-% If there are 10 or more arguments, a different technique is used, where the
-% hook remains in the body, and when macro is to be expanded the body is
-% processed again to replace the arguments.
-%
-% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
-% argument N value and then \edef the body (nothing else will expand because of
-% the catcode regime underwhich the body was input).
-%
-% If you compile with TeX (not eTeX), and you have macros with 10 or more
-% arguments, you need that no macro has more than 256 arguments, otherwise an
-% error is produced.
-\def\parsemargdef#1;{%
- \paramno=0\def\paramlist{}%
- \let\hash\relax
- \let\xeatspaces\relax
- \parsemargdefxxx#1,;,%
- % In case that there are 10 or more arguments we parse again the arguments
- % list to set new definitions for the \macarg.BLAH macros corresponding to
- % each BLAH argument. It was anyhow needed to parse already once this list
- % in order to count the arguments, and as macros with at most 9 arguments
- % are by far more frequent than macro with 10 or more arguments, defining
- % twice the \macarg.BLAH macros does not cost too much processing power.
- \ifnum\paramno<10\relax\else
- \paramno0\relax
- \parsemmanyargdef@@#1,;,% 10 or more arguments
- \fi
-}
-\def\parsemargdefxxx#1,{%
- \if#1;\let\next=\relax
- \else \let\next=\parsemargdefxxx
- \advance\paramno by 1
- \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
- {\xeatspaces{\hash\the\paramno}}%
- \edef\paramlist{\paramlist\hash\the\paramno,}%
- \fi\next}
-
-\def\parsemmanyargdef@@#1,{%
- \if#1;\let\next=\relax
- \else
- \let\next=\parsemmanyargdef@@
- \edef\tempb{\eatspaces{#1}}%
- \expandafter\def\expandafter\tempa
- \expandafter{\csname macarg.\tempb\endcsname}%
- % Note that we need some extra \noexpand\noexpand, this is because we
- % don't want \the to be expanded in the \parsermacbody as it uses an
- % \xdef .
- \expandafter\edef\tempa
- {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
- \advance\paramno by 1\relax
- \fi\next}
-
-% These two commands read recursive and nonrecursive macro bodies.
-% (They're different since rec and nonrec macros end differently.)
-%
-
-\catcode `\@\texiatcatcode
-\long\def\parsemacbody#1@end macro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
-\long\def\parsermacbody#1@end rmacro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
-\catcode `\@=11\relax
-
-\let\endargs@\relax
-\let\nil@\relax
-\def\nilm@{\nil@}%
-\long\def\nillm@{\nil@}%
-
-% This macro is expanded during the Texinfo macro expansion, not during its
-% definition. It gets all the arguments values and assigns them to macros
-% macarg.ARGNAME
-%
-% #1 is the macro name
-% #2 is the list of argument names
-% #3 is the list of argument values
-\def\getargvals@#1#2#3{%
- \def\macargdeflist@{}%
- \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
- \def\paramlist{#2,\nil@}%
- \def\macroname{#1}%
- \begingroup
- \macroargctxt
- \def\argvaluelist{#3,\nil@}%
- \def\@tempa{#3}%
- \ifx\@tempa\empty
- \setemptyargvalues@
- \else
- \getargvals@@
- \fi
-}
-
-%
-\def\getargvals@@{%
- \ifx\paramlist\nilm@
- % Some sanity check needed here that \argvaluelist is also empty.
- \ifx\argvaluelist\nillm@
- \else
- \errhelp = \EMsimple
- \errmessage{Too many arguments in macro `\macroname'!}%
- \fi
- \let\next\macargexpandinbody@
- \else
- \ifx\argvaluelist\nillm@
- % No more arguments values passed to macro. Set remaining named-arg
- % macros to empty.
- \let\next\setemptyargvalues@
- \else
- % pop current arg name into \@tempb
- \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
- \expandafter\@tempa\expandafter{\paramlist}%
- % pop current argument value into \@tempc
- \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
- \expandafter\@tempa\expandafter{\argvaluelist}%
- % Here \@tempb is the current arg name and \@tempc is the current arg value.
- % First place the new argument macro definition into \@tempd
- \expandafter\macname\expandafter{\@tempc}%
- \expandafter\let\csname macarg.\@tempb\endcsname\relax
- \expandafter\def\expandafter\@tempe\expandafter{%
- \csname macarg.\@tempb\endcsname}%
- \edef\@tempd{\long\def\@tempe{\the\macname}}%
- \push@\@tempd\macargdeflist@
- \let\next\getargvals@@
- \fi
- \fi
- \next
-}
-
-\def\push@#1#2{%
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter#2%
- \expandafter\expandafter\expandafter{%
- \expandafter#1#2}%
-}
-
-% Replace arguments by their values in the macro body, and place the result
-% in macro \@tempa
-\def\macvalstoargs@{%
- % To do this we use the property that token registers that are \the'ed
- % within an \edef expand only once. So we are going to place all argument
- % values into respective token registers.
- %
- % First we save the token context, and initialize argument numbering.
- \begingroup
- \paramno0\relax
- % Then, for each argument number #N, we place the corresponding argument
- % value into a new token list register \toks#N
- \expandafter\putargsintokens@\saveparamlist@,;,%
- % Then, we expand the body so that argument are replaced by their
- % values. The trick for values not to be expanded themselves is that they
- % are within tokens and that tokens expand only once in an \edef .
- \edef\@tempc{\csname mac.\macroname .body\endcsname}%
- % Now we restore the token stack pointer to free the token list registers
- % which we have used, but we make sure that expanded body is saved after
- % group.
- \expandafter
- \endgroup
- \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
- }
-
-\def\macargexpandinbody@{%
- %% Define the named-macro outside of this group and then close this group.
- \expandafter
- \endgroup
- \macargdeflist@
- % First the replace in body the macro arguments by their values, the result
- % is in \@tempa .
- \macvalstoargs@
- % Then we point at the \norecurse or \gobble (for recursive) macro value
- % with \@tempb .
- \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
- % Depending on whether it is recursive or not, we need some tailing
- % \egroup .
- \ifx\@tempb\gobble
- \let\@tempc\relax
- \else
- \let\@tempc\egroup
- \fi
- % And now we do the real job:
- \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
- \@tempd
-}
-
-\def\putargsintokens@#1,{%
- \if#1;\let\next\relax
- \else
- \let\next\putargsintokens@
- % First we allocate the new token list register, and give it a temporary
- % alias \@tempb .
- \toksdef\@tempb\the\paramno
- % Then we place the argument value into that token list register.
- \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
- \expandafter\@tempb\expandafter{\@tempa}%
- \advance\paramno by 1\relax
- \fi
- \next
-}
-
-% Save the token stack pointer into macro #1
-\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
-% Restore the token stack pointer from number in macro #1
-\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
-% newtoks that can be used non \outer .
-\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
-
-% Tailing missing arguments are set to empty
-\def\setemptyargvalues@{%
- \ifx\paramlist\nilm@
- \let\next\macargexpandinbody@
- \else
- \expandafter\setemptyargvaluesparser@\paramlist\endargs@
- \let\next\setemptyargvalues@
- \fi
- \next
-}
-
-\def\setemptyargvaluesparser@#1,#2\endargs@{%
- \expandafter\def\expandafter\@tempa\expandafter{%
- \expandafter\def\csname macarg.#1\endcsname{}}%
- \push@\@tempa\macargdeflist@
- \def\paramlist{#2}%
-}
-
-% #1 is the element target macro
-% #2 is the list macro
-% #3,#4\endargs@ is the list value
-\def\pop@#1#2#3,#4\endargs@{%
- \def#1{#3}%
- \def#2{#4}%
-}
-\long\def\longpop@#1#2#3,#4\endargs@{%
- \long\def#1{#3}%
- \long\def#2{#4}%
-}
-
-% This defines a Texinfo @macro. There are eight cases: recursive and
-% nonrecursive macros of zero, one, up to nine, and many arguments.
-% Much magic with \expandafter here.
-% \xdef is used so that macro definitions will survive the file
-% they're defined in; @include reads the file inside a group.
-%
-\def\defmacro{%
- \let\hash=##% convert placeholders to macro parameter chars
- \ifrecursive
- \ifcase\paramno
- % 0
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\scanmacro{\temp}}%
- \or % 1
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\braceorline
- \expandafter\noexpand\csname\the\macname xxx\endcsname}%
- \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
- \egroup\noexpand\scanmacro{\temp}}%
- \else
- \ifnum\paramno<10\relax % at most 9
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\csname\the\macname xx\endcsname}%
- \expandafter\xdef\csname\the\macname xx\endcsname##1{%
- \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname xxx\endcsname
- \paramlist{\egroup\noexpand\scanmacro{\temp}}%
- \else % 10 or more
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\getargvals@{\the\macname}{\argl}%
- }%
- \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
- \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
- \fi
- \fi
- \else
- \ifcase\paramno
- % 0
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
- \or % 1
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\braceorline
- \expandafter\noexpand\csname\the\macname xxx\endcsname}%
- \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
- \egroup
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
- \else % at most 9
- \ifnum\paramno<10\relax
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \expandafter\noexpand\csname\the\macname xx\endcsname}%
- \expandafter\xdef\csname\the\macname xx\endcsname##1{%
- \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname xxx\endcsname
- \paramlist{%
- \egroup
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
- \else % 10 or more:
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\getargvals@{\the\macname}{\argl}%
- }%
- \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
- \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
- \fi
- \fi
- \fi}
-
-\catcode `\@\texiatcatcode\relax
-
-\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
-
-% \braceorline decides whether the next nonwhitespace character is a
-% {. If so it reads up to the closing }, if not, it reads the whole
-% line. Whatever was read is then fed to the next control sequence
-% as an argument (by \parsebrace or \parsearg).
-%
-\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
-\def\braceorlinexxx{%
- \ifx\nchar\bgroup\else
- \expandafter\parsearg
- \fi \macnamexxx}
-
-
-% @alias.
-% We need some trickery to remove the optional spaces around the equal
-% sign. Make them active and then expand them all to nothing.
-%
-\def\alias{\parseargusing\obeyspaces\aliasxxx}
-\def\aliasxxx #1{\aliasyyy#1\relax}
-\def\aliasyyy #1=#2\relax{%
- {%
- \expandafter\let\obeyedspace=\empty
- \addtomacrolist{#1}%
- \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
- }%
- \next
-}
-
-
-\message{cross references,}
-
-\newwrite\auxfile
-\newif\ifhavexrefs % True if xref values are known.
-\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-
-% @inforef is relatively simple.
-\def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{%
- \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
- node \samp{\ignorespaces#1{}}}
-
-% @node's only job in TeX is to define \lastnode, which is used in
-% cross-references. The @node line might or might not have commas, and
-% might or might not have spaces before the first comma, like:
-% @node foo , bar , ...
-% We don't want such trailing spaces in the node name.
-%
-\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
-%
-% also remove a trailing comma, in case of something like this:
-% @node Help-Cross, , , Cross-refs
-\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
-\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
-
-\let\nwnode=\node
-\let\lastnode=\empty
-
-% Write a cross-reference definition for the current node. #1 is the
-% type (Ynumbered, Yappendix, Ynothing).
-%
-\def\donoderef#1{%
- \ifx\lastnode\empty\else
- \setref{\lastnode}{#1}%
- \global\let\lastnode=\empty
- \fi
-}
-
-% @anchor{NAME} -- define xref target at arbitrary point.
-%
-\newcount\savesfregister
-%
-\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
-\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
-\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
-
-% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
-% anchor), which consists of three parts:
-% 1) NAME-title - the current sectioning name taken from \lastsection,
-% or the anchor name.
-% 2) NAME-snt - section number and type, passed as the SNT arg, or
-% empty for anchors.
-% 3) NAME-pg - the page number.
-%
-% This is called from \donoderef, \anchor, and \dofloat. In the case of
-% floats, there is an additional part, which is not written here:
-% 4) NAME-lof - the text as it should appear in a @listoffloats.
-%
-\def\setref#1#2{%
- \pdfmkdest{#1}%
- \iflinks
- {%
- \atdummies % preserve commands, but don't expand them
- \edef\writexrdef##1##2{%
- \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
- ##1}{##2}}% these are parameters of \writexrdef
- }%
- \toks0 = \expandafter{\lastsection}%
- \immediate \writexrdef{title}{\the\toks0 }%
- \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
- \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
- }%
- \fi
-}
-
-% @xrefautosectiontitle on|off says whether @section(ing) names are used
-% automatically in xrefs, if the third arg is not explicitly specified.
-% This was provided as a "secret" @set xref-automatic-section-title
-% variable, now it's official.
-%
-\parseargdef\xrefautomaticsectiontitle{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETxref-automatic-section-title\endcsname
- = \empty
- \else\ifx\temp\offword
- \expandafter\let\csname SETxref-automatic-section-title\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
- must be on|off}%
- \fi\fi
-}
-
-
-% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
-% the node name, #2 the name of the Info cross-reference, #3 the printed
-% node name, #4 the name of the Info file, #5 the name of the printed
-% manual. All but the node name can be omitted.
-%
-\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
-\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
-\def\ref#1{\xrefX[#1,,,,,,,]}
-%
-\newbox\topbox
-\newbox\printedrefnamebox
-\newbox\printedmanualbox
-%
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
- \unsepspaces
- %
- \def\printedrefname{\ignorespaces #3}%
- \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
- %
- \def\printedmanual{\ignorespaces #5}%
- \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
- %
- % If the printed reference name (arg #3) was not explicitly given in
- % the @xref, figure out what we want to use.
- \ifdim \wd\printedrefnamebox = 0pt
- % No printed node name was explicitly given.
- \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
- % Not auto section-title: use node name inside the square brackets.
- \def\printedrefname{\ignorespaces #1}%
- \else
- % Auto section-title: use chapter/section title inside
- % the square brackets if we have it.
- \ifdim \wd\printedmanualbox > 0pt
- % It is in another manual, so we don't have it; use node name.
- \def\printedrefname{\ignorespaces #1}%
- \else
- \ifhavexrefs
- % We (should) know the real title if we have the xref values.
- \def\printedrefname{\refx{#1-title}{}}%
- \else
- % Otherwise just copy the Info node name.
- \def\printedrefname{\ignorespaces #1}%
- \fi%
- \fi
- \fi
- \fi
- %
- % Make link in pdf output.
- \ifpdf
- {\indexnofonts
- \turnoffactive
- \makevalueexpandable
- % This expands tokens, so do it after making catcode changes, so _
- % etc. don't get their TeX definitions.
- \getfilename{#4}%
- %
- \edef\pdfxrefdest{#1}%
- \txiescapepdf\pdfxrefdest
- %
- \leavevmode
- \startlink attr{/Border [0 0 0]}%
- \ifnum\filenamelength>0
- goto file{\the\filename.pdf} name{\pdfxrefdest}%
- \else
- goto name{\pdfmkpgn{\pdfxrefdest}}%
- \fi
- }%
- \setcolor{\linkcolor}%
- \fi
- %
- % Float references are printed completely differently: "Figure 1.2"
- % instead of "[somenode], p.3". We distinguish them by the
- % LABEL-title being set to a magic string.
- {%
- % Have to otherify everything special to allow the \csname to
- % include an _ in the xref name, etc.
- \indexnofonts
- \turnoffactive
- \expandafter\global\expandafter\let\expandafter\Xthisreftitle
- \csname XR#1-title\endcsname
- }%
- \iffloat\Xthisreftitle
- % If the user specified the print name (third arg) to the ref,
- % print it instead of our usual "Figure 1.2".
- \ifdim\wd\printedrefnamebox = 0pt
- \refx{#1-snt}{}%
- \else
- \printedrefname
- \fi
- %
- % if the user also gave the printed manual name (fifth arg), append
- % "in MANUALNAME".
- \ifdim \wd\printedmanualbox > 0pt
- \space \putwordin{} \cite{\printedmanual}%
- \fi
- \else
- % node/anchor (non-float) references.
- %
- % If we use \unhbox to print the node names, TeX does not insert
- % empty discretionaries after hyphens, which means that it will not
- % find a line break at a hyphen in a node names. Since some manuals
- % are best written with fairly long node names, containing hyphens,
- % this is a loss. Therefore, we give the text of the node name
- % again, so it is as if TeX is seeing it for the first time.
- %
- % Cross-manual reference. Only include the "Section ``foo'' in" if
- % the foo is neither missing or Top. Thus, @xref{,,,foo,The Foo Manual}
- % outputs simply "see The Foo Manual".
- \ifdim \wd\printedmanualbox > 0pt
- % What is the 7sp about? The idea is that we also want to omit
- % the Section part if we would be printing "Top", since they are
- % clearly trying to refer to the whole manual. But, this being
- % TeX, we can't easily compare strings while ignoring the possible
- % spaces before and after in the input. By adding the arbitrary
- % 7sp, we make it much less likely that a real node name would
- % happen to have the same width as "Top" (e.g., in a monospaced font).
- % I hope it will never happen in practice.
- %
- % For the same basic reason, we retypeset the "Top" at every
- % reference, since the current font is indeterminate.
- %
- \setbox\topbox = \hbox{Top\kern7sp}%
- \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
- \ifdim \wd2 > 7sp
- \ifdim \wd2 = \wd\topbox \else
- \putwordSection{} ``\printedrefname'' \putwordin{}\space
- \fi
- \fi
- \cite{\printedmanual}%
- \else
- % Reference in this manual.
- %
- % _ (for example) has to be the character _ for the purposes of the
- % control sequence corresponding to the node, but it has to expand
- % into the usual \leavevmode...\vrule stuff for purposes of
- % printing. So we \turnoffactive for the \refx-snt, back on for the
- % printing, back off for the \refx-pg.
- {\turnoffactive
- % Only output a following space if the -snt ref is nonempty; for
- % @unnumbered and @anchor, it won't be.
- \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
- \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
- }%
- % output the `[mynode]' via the macro below so it can be overridden.
- \xrefprintnodename\printedrefname
- %
- % But we always want a comma and a space:
- ,\space
- %
- % output the `page 3'.
- \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
- \fi
- \fi
- \endlink
-\endgroup}
-
-% This macro is called from \xrefX for the `[nodename]' part of xref
-% output. It's a separate macro only so it can be changed more easily,
-% since square brackets don't work well in some documents. Particularly
-% one that Bob is working on :).
-%
-\def\xrefprintnodename#1{[#1]}
-
-% Things referred to by \setref.
-%
-\def\Ynothing{}
-\def\Yomitfromtoc{}
-\def\Ynumbered{%
- \ifnum\secno=0
- \putwordChapter@tie \the\chapno
- \else \ifnum\subsecno=0
- \putwordSection@tie \the\chapno.\the\secno
- \else \ifnum\subsubsecno=0
- \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
- \else
- \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
- \fi\fi\fi
-}
-\def\Yappendix{%
- \ifnum\secno=0
- \putwordAppendix@tie @char\the\appendixno{}%
- \else \ifnum\subsecno=0
- \putwordSection@tie @char\the\appendixno.\the\secno
- \else \ifnum\subsubsecno=0
- \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
- \else
- \putwordSection@tie
- @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
- \fi\fi\fi
-}
-
-% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
-% If its value is nonempty, SUFFIX is output afterward.
-%
-\def\refx#1#2{%
- {%
- \indexnofonts
- \otherbackslash
- \expandafter\global\expandafter\let\expandafter\thisrefX
- \csname XR#1\endcsname
- }%
- \ifx\thisrefX\relax
- % If not defined, say something at least.
- \angleleft un\-de\-fined\angleright
- \iflinks
- \ifhavexrefs
- {\toks0 = {#1}% avoid expansion of possibly-complex value
- \message{\linenumber Undefined cross reference `\the\toks0'.}}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
- \fi
- \fi
- \fi
- \else
- % It's defined, so just use it.
- \thisrefX
- \fi
- #2% Output the suffix in any case.
-}
-
-% This is the macro invoked by entries in the aux file. Usually it's
-% just a \def (we prepend XR to the control sequence name to avoid
-% collisions). But if this is a float type, we have more work to do.
-%
-\def\xrdef#1#2{%
- {% The node name might contain 8-bit characters, which in our current
- % implementation are changed to commands like @'e. Don't let these
- % mess up the control sequence name.
- \indexnofonts
- \turnoffactive
- \xdef\safexrefname{#1}%
- }%
- %
- \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
- %
- % Was that xref control sequence that we just defined for a float?
- \expandafter\iffloat\csname XR\safexrefname\endcsname
- % it was a float, and we have the (safe) float type in \iffloattype.
- \expandafter\let\expandafter\floatlist
- \csname floatlist\iffloattype\endcsname
- %
- % Is this the first time we've seen this float type?
- \expandafter\ifx\floatlist\relax
- \toks0 = {\do}% yes, so just \do
- \else
- % had it before, so preserve previous elements in list.
- \toks0 = \expandafter{\floatlist\do}%
- \fi
- %
- % Remember this xref in the control sequence \floatlistFLOATTYPE,
- % for later use in \listoffloats.
- \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
- {\safexrefname}}%
- \fi
-}
-
-% Read the last existing aux file, if any. No error if none exists.
-%
-\def\tryauxfile{%
- \openin 1 \jobname.aux
- \ifeof 1 \else
- \readdatafile{aux}%
- \global\havexrefstrue
- \fi
- \closein 1
-}
-
-\def\setupdatafile{%
- \catcode`\^^@=\other
- \catcode`\^^A=\other
- \catcode`\^^B=\other
- \catcode`\^^C=\other
- \catcode`\^^D=\other
- \catcode`\^^E=\other
- \catcode`\^^F=\other
- \catcode`\^^G=\other
- \catcode`\^^H=\other
- \catcode`\^^K=\other
- \catcode`\^^L=\other
- \catcode`\^^N=\other
- \catcode`\^^P=\other
- \catcode`\^^Q=\other
- \catcode`\^^R=\other
- \catcode`\^^S=\other
- \catcode`\^^T=\other
- \catcode`\^^U=\other
- \catcode`\^^V=\other
- \catcode`\^^W=\other
- \catcode`\^^X=\other
- \catcode`\^^Z=\other
- \catcode`\^^[=\other
- \catcode`\^^\=\other
- \catcode`\^^]=\other
- \catcode`\^^^=\other
- \catcode`\^^_=\other
- % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
- % in xref tags, i.e., node names. But since ^^e4 notation isn't
- % supported in the main text, it doesn't seem desirable. Furthermore,
- % that is not enough: for node names that actually contain a ^
- % character, we would end up writing a line like this: 'xrdef {'hat
- % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
- % argument, and \hat is not an expandable control sequence. It could
- % all be worked out, but why? Either we support ^^ or we don't.
- %
- % The other change necessary for this was to define \auxhat:
- % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
- % and then to call \auxhat in \setq.
- %
- \catcode`\^=\other
- %
- % Special characters. Should be turned off anyway, but...
- \catcode`\~=\other
- \catcode`\[=\other
- \catcode`\]=\other
- \catcode`\"=\other
- \catcode`\_=\other
- \catcode`\|=\other
- \catcode`\<=\other
- \catcode`\>=\other
- \catcode`\$=\other
- \catcode`\#=\other
- \catcode`\&=\other
- \catcode`\%=\other
- \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
- %
- % This is to support \ in node names and titles, since the \
- % characters end up in a \csname. It's easier than
- % leaving it active and making its active definition an actual \
- % character. What I don't understand is why it works in the *value*
- % of the xrdef. Seems like it should be a catcode12 \, and that
- % should not typeset properly. But it works, so I'm moving on for
- % now. --karl, 15jan04.
- \catcode`\\=\other
- %
- % Make the characters 128-255 be printing characters.
- {%
- \count1=128
- \def\loop{%
- \catcode\count1=\other
- \advance\count1 by 1
- \ifnum \count1<256 \loop \fi
- }%
- }%
- %
- % @ is our escape character in .aux files, and we need braces.
- \catcode`\{=1
- \catcode`\}=2
- \catcode`\@=0
-}
-
-\def\readdatafile#1{%
-\begingroup
- \setupdatafile
- \input\jobname.#1
-\endgroup}
-
-
-\message{insertions,}
-% including footnotes.
-
-\newcount \footnoteno
-
-% The trailing space in the following definition for supereject is
-% vital for proper filling; pages come out unaligned when you do a
-% pagealignmacro call if that space before the closing brace is
-% removed. (Generally, numeric constants should always be followed by a
-% space to prevent strange expansion errors.)
-\def\supereject{\par\penalty -20000\footnoteno =0 }
-
-% @footnotestyle is meaningful for Info output only.
-\let\footnotestyle=\comment
-
-{\catcode `\@=11
-%
-% Auto-number footnotes. Otherwise like plain.
-\gdef\footnote{%
- \let\indent=\ptexindent
- \let\noindent=\ptexnoindent
- \global\advance\footnoteno by \@ne
- \edef\thisfootno{$^{\the\footnoteno}$}%
- %
- % In case the footnote comes at the end of a sentence, preserve the
- % extra spacing after we do the footnote number.
- \let\@sf\empty
- \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
- %
- % Remove inadvertent blank space before typesetting the footnote number.
- \unskip
- \thisfootno\@sf
- \dofootnote
-}%
-
-% Don't bother with the trickery in plain.tex to not require the
-% footnote text as a parameter. Our footnotes don't need to be so general.
-%
-% Oh yes, they do; otherwise, @ifset (and anything else that uses
-% \parseargline) fails inside footnotes because the tokens are fixed when
-% the footnote is read. --karl, 16nov96.
-%
-\gdef\dofootnote{%
- \insert\footins\bgroup
- % We want to typeset this text as a normal paragraph, even if the
- % footnote reference occurs in (for example) a display environment.
- % So reset some parameters.
- \hsize=\pagewidth
- \interlinepenalty\interfootnotelinepenalty
- \splittopskip\ht\strutbox % top baseline for broken footnotes
- \splitmaxdepth\dp\strutbox
- \floatingpenalty\@MM
- \leftskip\z@skip
- \rightskip\z@skip
- \spaceskip\z@skip
- \xspaceskip\z@skip
- \parindent\defaultparindent
- %
- \smallfonts \rm
- %
- % Because we use hanging indentation in footnotes, a @noindent appears
- % to exdent this text, so make it be a no-op. makeinfo does not use
- % hanging indentation so @noindent can still be needed within footnote
- % text after an @example or the like (not that this is good style).
- \let\noindent = \relax
- %
- % Hang the footnote text off the number. Use \everypar in case the
- % footnote extends for more than one paragraph.
- \everypar = {\hang}%
- \textindent{\thisfootno}%
- %
- % Don't crash into the line above the footnote text. Since this
- % expands into a box, it must come within the paragraph, lest it
- % provide a place where TeX can split the footnote.
- \footstrut
- %
- % Invoke rest of plain TeX footnote routine.
- \futurelet\next\fo@t
-}
-}%end \catcode `\@=11
-
-% In case a @footnote appears in a vbox, save the footnote text and create
-% the real \insert just after the vbox finished. Otherwise, the insertion
-% would be lost.
-% Similarly, if a @footnote appears inside an alignment, save the footnote
-% text to a box and make the \insert when a row of the table is finished.
-% And the same can be done for other insert classes. --kasal, 16nov03.
-
-% Replace the \insert primitive by a cheating macro.
-% Deeper inside, just make sure that the saved insertions are not spilled
-% out prematurely.
-%
-\def\startsavinginserts{%
- \ifx \insert\ptexinsert
- \let\insert\saveinsert
- \else
- \let\checkinserts\relax
- \fi
-}
-
-% This \insert replacement works for both \insert\footins{foo} and
-% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
-%
-\def\saveinsert#1{%
- \edef\next{\noexpand\savetobox \makeSAVEname#1}%
- \afterassignment\next
- % swallow the left brace
- \let\temp =
-}
-\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
-\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
-
-\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
-
-\def\placesaveins#1{%
- \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
- {\box#1}%
-}
-
-% eat @SAVE -- beware, all of them have catcode \other:
-{
- \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
- \gdef\gobblesave @SAVE{}
-}
-
-% initialization:
-\def\newsaveins #1{%
- \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
- \next
-}
-\def\newsaveinsX #1{%
- \csname newbox\endcsname #1%
- \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
- \checksaveins #1}%
-}
-
-% initialize:
-\let\checkinserts\empty
-\newsaveins\footins
-\newsaveins\margin
-
-
-% @image. We use the macros from epsf.tex to support this.
-% If epsf.tex is not installed and @image is used, we complain.
-%
-% Check for and read epsf.tex up front. If we read it only at @image
-% time, we might be inside a group, and then its definitions would get
-% undone and the next image would fail.
-\openin 1 = epsf.tex
-\ifeof 1 \else
- % Do not bother showing banner with epsf.tex v2.7k (available in
- % doc/epsf.tex and on ctan).
- \def\epsfannounce{\toks0 = }%
- \input epsf.tex
-\fi
-\closein 1
-%
-% We will only complain once about lack of epsf.tex.
-\newif\ifwarnednoepsf
-\newhelp\noepsfhelp{epsf.tex must be installed for images to
- work. It is also included in the Texinfo distribution, or you can get
- it from ftp://tug.org/tex/epsf.tex.}
-%
-\def\image#1{%
- \ifx\epsfbox\thisisundefined
- \ifwarnednoepsf \else
- \errhelp = \noepsfhelp
- \errmessage{epsf.tex not found, images will be ignored}%
- \global\warnednoepsftrue
- \fi
- \else
- \imagexxx #1,,,,,\finish
- \fi
-}
-%
-% Arguments to @image:
-% #1 is (mandatory) image filename; we tack on .eps extension.
-% #2 is (optional) width, #3 is (optional) height.
-% #4 is (ignored optional) html alt text.
-% #5 is (ignored optional) extension.
-% #6 is just the usual extra ignored arg for parsing stuff.
-\newif\ifimagevmode
-\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
- \catcode`\^^M = 5 % in case we're inside an example
- \normalturnoffactive % allow _ et al. in names
- % If the image is by itself, center it.
- \ifvmode
- \imagevmodetrue
- \else \ifx\centersub\centerV
- % for @center @image, we need a vbox so we can have our vertical space
- \imagevmodetrue
- \vbox\bgroup % vbox has better behavior than vtop herev
- \fi\fi
- %
- \ifimagevmode
- \nobreak\medskip
- % Usually we'll have text after the image which will insert
- % \parskip glue, so insert it here too to equalize the space
- % above and below.
- \nobreak\vskip\parskip
- \nobreak
- \fi
- %
- % Leave vertical mode so that indentation from an enclosing
- % environment such as @quotation is respected.
- % However, if we're at the top level, we don't want the
- % normal paragraph indentation.
- % On the other hand, if we are in the case of @center @image, we don't
- % want to start a paragraph, which will create a hsize-width box and
- % eradicate the centering.
- \ifx\centersub\centerV\else \noindent \fi
- %
- % Output the image.
- \ifpdf
- \dopdfimage{#1}{#2}{#3}%
- \else
- % \epsfbox itself resets \epsf?size at each figure.
- \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
- \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
- \epsfbox{#1.eps}%
- \fi
- %
- \ifimagevmode
- \medskip % space after a standalone image
- \fi
- \ifx\centersub\centerV \egroup \fi
-\endgroup}
-
-
-% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
-% etc. We don't actually implement floating yet, we always include the
-% float "here". But it seemed the best name for the future.
-%
-\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
-
-% There may be a space before second and/or third parameter; delete it.
-\def\eatcommaspace#1, {#1,}
-
-% #1 is the optional FLOATTYPE, the text label for this float, typically
-% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
-% this float will not be numbered and cannot be referred to.
-%
-% #2 is the optional xref label. Also must be present for the float to
-% be referable.
-%
-% #3 is the optional positioning argument; for now, it is ignored. It
-% will somehow specify the positions allowed to float to (here, top, bottom).
-%
-% We keep a separate counter for each FLOATTYPE, which we reset at each
-% chapter-level command.
-\let\resetallfloatnos=\empty
-%
-\def\dofloat#1,#2,#3,#4\finish{%
- \let\thiscaption=\empty
- \let\thisshortcaption=\empty
- %
- % don't lose footnotes inside @float.
- %
- % BEWARE: when the floats start float, we have to issue warning whenever an
- % insert appears inside a float which could possibly float. --kasal, 26may04
- %
- \startsavinginserts
- %
- % We can't be used inside a paragraph.
- \par
- %
- \vtop\bgroup
- \def\floattype{#1}%
- \def\floatlabel{#2}%
- \def\floatloc{#3}% we do nothing with this yet.
- %
- \ifx\floattype\empty
- \let\safefloattype=\empty
- \else
- {%
- % the floattype might have accents or other special characters,
- % but we need to use it in a control sequence name.
- \indexnofonts
- \turnoffactive
- \xdef\safefloattype{\floattype}%
- }%
- \fi
- %
- % If label is given but no type, we handle that as the empty type.
- \ifx\floatlabel\empty \else
- % We want each FLOATTYPE to be numbered separately (Figure 1,
- % Table 1, Figure 2, ...). (And if no label, no number.)
- %
- \expandafter\getfloatno\csname\safefloattype floatno\endcsname
- \global\advance\floatno by 1
- %
- {%
- % This magic value for \lastsection is output by \setref as the
- % XREFLABEL-title value. \xrefX uses it to distinguish float
- % labels (which have a completely different output format) from
- % node and anchor labels. And \xrdef uses it to construct the
- % lists of floats.
- %
- \edef\lastsection{\floatmagic=\safefloattype}%
- \setref{\floatlabel}{Yfloat}%
- }%
- \fi
- %
- % start with \parskip glue, I guess.
- \vskip\parskip
- %
- % Don't suppress indentation if a float happens to start a section.
- \restorefirstparagraphindent
-}
-
-% we have these possibilities:
-% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
-% @float Foo,lbl & no caption: Foo 1.1
-% @float Foo & @caption{Cap}: Foo: Cap
-% @float Foo & no caption: Foo
-% @float ,lbl & Caption{Cap}: 1.1: Cap
-% @float ,lbl & no caption: 1.1
-% @float & @caption{Cap}: Cap
-% @float & no caption:
-%
-\def\Efloat{%
- \let\floatident = \empty
- %
- % In all cases, if we have a float type, it comes first.
- \ifx\floattype\empty \else \def\floatident{\floattype}\fi
- %
- % If we have an xref label, the number comes next.
- \ifx\floatlabel\empty \else
- \ifx\floattype\empty \else % if also had float type, need tie first.
- \appendtomacro\floatident{\tie}%
- \fi
- % the number.
- \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
- \fi
- %
- % Start the printed caption with what we've constructed in
- % \floatident, but keep it separate; we need \floatident again.
- \let\captionline = \floatident
- %
- \ifx\thiscaption\empty \else
- \ifx\floatident\empty \else
- \appendtomacro\captionline{: }% had ident, so need a colon between
- \fi
- %
- % caption text.
- \appendtomacro\captionline{\scanexp\thiscaption}%
- \fi
- %
- % If we have anything to print, print it, with space before.
- % Eventually this needs to become an \insert.
- \ifx\captionline\empty \else
- \vskip.5\parskip
- \captionline
- %
- % Space below caption.
- \vskip\parskip
- \fi
- %
- % If have an xref label, write the list of floats info. Do this
- % after the caption, to avoid chance of it being a breakpoint.
- \ifx\floatlabel\empty \else
- % Write the text that goes in the lof to the aux file as
- % \floatlabel-lof. Besides \floatident, we include the short
- % caption if specified, else the full caption if specified, else nothing.
- {%
- \atdummies
- %
- % since we read the caption text in the macro world, where ^^M
- % is turned into a normal character, we have to scan it back, so
- % we don't write the literal three characters "^^M" into the aux file.
- \scanexp{%
- \xdef\noexpand\gtemp{%
- \ifx\thisshortcaption\empty
- \thiscaption
- \else
- \thisshortcaption
- \fi
- }%
- }%
- \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
- \ifx\gtemp\empty \else : \gtemp \fi}}%
- }%
- \fi
- \egroup % end of \vtop
- %
- % place the captured inserts
- %
- % BEWARE: when the floats start floating, we have to issue warning
- % whenever an insert appears inside a float which could possibly
- % float. --kasal, 26may04
- %
- \checkinserts
-}
-
-% Append the tokens #2 to the definition of macro #1, not expanding either.
-%
-\def\appendtomacro#1#2{%
- \expandafter\def\expandafter#1\expandafter{#1#2}%
-}
-
-% @caption, @shortcaption
-%
-\def\caption{\docaption\thiscaption}
-\def\shortcaption{\docaption\thisshortcaption}
-\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
-\def\defcaption#1#2{\egroup \def#1{#2}}
-
-% The parameter is the control sequence identifying the counter we are
-% going to use. Create it if it doesn't exist and assign it to \floatno.
-\def\getfloatno#1{%
- \ifx#1\relax
- % Haven't seen this figure type before.
- \csname newcount\endcsname #1%
- %
- % Remember to reset this floatno at the next chap.
- \expandafter\gdef\expandafter\resetallfloatnos
- \expandafter{\resetallfloatnos #1=0 }%
- \fi
- \let\floatno#1%
-}
-
-% \setref calls this to get the XREFLABEL-snt value. We want an @xref
-% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
-% first read the @float command.
-%
-\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
-
-% Magic string used for the XREFLABEL-title value, so \xrefX can
-% distinguish floats from other xref types.
-\def\floatmagic{!!float!!}
-
-% #1 is the control sequence we are passed; we expand into a conditional
-% which is true if #1 represents a float ref. That is, the magic
-% \lastsection value which we \setref above.
-%
-\def\iffloat#1{\expandafter\doiffloat#1==\finish}
-%
-% #1 is (maybe) the \floatmagic string. If so, #2 will be the
-% (safe) float type for this float. We set \iffloattype to #2.
-%
-\def\doiffloat#1=#2=#3\finish{%
- \def\temp{#1}%
- \def\iffloattype{#2}%
- \ifx\temp\floatmagic
-}
-
-% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
-%
-\parseargdef\listoffloats{%
- \def\floattype{#1}% floattype
- {%
- % the floattype might have accents or other special characters,
- % but we need to use it in a control sequence name.
- \indexnofonts
- \turnoffactive
- \xdef\safefloattype{\floattype}%
- }%
- %
- % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
- \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
- \ifhavexrefs
- % if the user said @listoffloats foo but never @float foo.
- \message{\linenumber No `\safefloattype' floats to list.}%
- \fi
- \else
- \begingroup
- \leftskip=\tocindent % indent these entries like a toc
- \let\do=\listoffloatsdo
- \csname floatlist\safefloattype\endcsname
- \endgroup
- \fi
-}
-
-% This is called on each entry in a list of floats. We're passed the
-% xref label, in the form LABEL-title, which is how we save it in the
-% aux file. We strip off the -title and look up \XRLABEL-lof, which
-% has the text we're supposed to typeset here.
-%
-% Figures without xref labels will not be included in the list (since
-% they won't appear in the aux file).
-%
-\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
-\def\listoffloatsdoentry#1-title\finish{{%
- % Can't fully expand XR#1-lof because it can contain anything. Just
- % pass the control sequence. On the other hand, XR#1-pg is just the
- % page number, and we want to fully expand that so we can get a link
- % in pdf output.
- \toksA = \expandafter{\csname XR#1-lof\endcsname}%
- %
- % use the same \entry macro we use to generate the TOC and index.
- \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
- \writeentry
-}}
-
-
-\message{localization,}
-
-% For single-language documents, @documentlanguage is usually given very
-% early, just after @documentencoding. Single argument is the language
-% (de) or locale (de_DE) abbreviation.
-%
-{
- \catcode`\_ = \active
- \globaldefs=1
-\parseargdef\documentlanguage{\begingroup
- \let_=\normalunderscore % normal _ character for filenames
- \tex % read txi-??.tex file in plain TeX.
- % Read the file by the name they passed if it exists.
- \openin 1 txi-#1.tex
- \ifeof 1
- \documentlanguagetrywithoutunderscore{#1_\finish}%
- \else
- \globaldefs = 1 % everything in the txi-LL files needs to persist
- \input txi-#1.tex
- \fi
- \closein 1
- \endgroup % end raw TeX
-\endgroup}
-%
-% If they passed de_DE, and txi-de_DE.tex doesn't exist,
-% try txi-de.tex.
-%
-\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
- \openin 1 txi-#1.tex
- \ifeof 1
- \errhelp = \nolanghelp
- \errmessage{Cannot read language file txi-#1.tex}%
- \else
- \globaldefs = 1 % everything in the txi-LL files needs to persist
- \input txi-#1.tex
- \fi
- \closein 1
-}
-}% end of special _ catcode
-%
-\newhelp\nolanghelp{The given language definition file cannot be found or
-is empty. Maybe you need to install it? Putting it in the current
-directory should work if nowhere else does.}
-
-% This macro is called from txi-??.tex files; the first argument is the
-% \language name to set (without the "\lang@" prefix), the second and
-% third args are \{left,right}hyphenmin.
-%
-% The language names to pass are determined when the format is built.
-% See the etex.log file created at that time, e.g.,
-% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
-%
-% With TeX Live 2008, etex now includes hyphenation patterns for all
-% available languages. This means we can support hyphenation in
-% Texinfo, at least to some extent. (This still doesn't solve the
-% accented characters problem.)
-%
-\catcode`@=11
-\def\txisetlanguage#1#2#3{%
- % do not set the language if the name is undefined in the current TeX.
- \expandafter\ifx\csname lang@#1\endcsname \relax
- \message{no patterns for #1}%
- \else
- \global\language = \csname lang@#1\endcsname
- \fi
- % but there is no harm in adjusting the hyphenmin values regardless.
- \global\lefthyphenmin = #2\relax
- \global\righthyphenmin = #3\relax
-}
-
-% Helpers for encodings.
-% Set the catcode of characters 128 through 255 to the specified number.
-%
-\def\setnonasciicharscatcode#1{%
- \count255=128
- \loop\ifnum\count255<256
- \global\catcode\count255=#1\relax
- \advance\count255 by 1
- \repeat
-}
-
-\def\setnonasciicharscatcodenonglobal#1{%
- \count255=128
- \loop\ifnum\count255<256
- \catcode\count255=#1\relax
- \advance\count255 by 1
- \repeat
-}
-
-% @documentencoding sets the definition of non-ASCII characters
-% according to the specified encoding.
-%
-\parseargdef\documentencoding{%
- % Encoding being declared for the document.
- \def\declaredencoding{\csname #1.enc\endcsname}%
- %
- % Supported encodings: names converted to tokens in order to be able
- % to compare them with \ifx.
- \def\ascii{\csname US-ASCII.enc\endcsname}%
- \def\latnine{\csname ISO-8859-15.enc\endcsname}%
- \def\latone{\csname ISO-8859-1.enc\endcsname}%
- \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
- \def\utfeight{\csname UTF-8.enc\endcsname}%
- %
- \ifx \declaredencoding \ascii
- \asciichardefs
- %
- \else \ifx \declaredencoding \lattwo
- \setnonasciicharscatcode\active
- \lattwochardefs
- %
- \else \ifx \declaredencoding \latone
- \setnonasciicharscatcode\active
- \latonechardefs
- %
- \else \ifx \declaredencoding \latnine
- \setnonasciicharscatcode\active
- \latninechardefs
- %
- \else \ifx \declaredencoding \utfeight
- \setnonasciicharscatcode\active
- \utfeightchardefs
- %
- \else
- \message{Unknown document encoding #1, ignoring.}%
- %
- \fi % utfeight
- \fi % latnine
- \fi % latone
- \fi % lattwo
- \fi % ascii
-}
-
-% A message to be logged when using a character that isn't available
-% the default font encoding (OT1).
-%
-\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
-
-% Take account of \c (plain) vs. \, (Texinfo) difference.
-\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
-
-% First, make active non-ASCII characters in order for them to be
-% correctly categorized when TeX reads the replacement text of
-% macros containing the character definitions.
-\setnonasciicharscatcode\active
-%
-% Latin1 (ISO-8859-1) character definitions.
-\def\latonechardefs{%
- \gdef^^a0{\tie}
- \gdef^^a1{\exclamdown}
- \gdef^^a2{\missingcharmsg{CENT SIGN}}
- \gdef^^a3{{\pounds}}
- \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
- \gdef^^a5{\missingcharmsg{YEN SIGN}}
- \gdef^^a6{\missingcharmsg{BROKEN BAR}}
- \gdef^^a7{\S}
- \gdef^^a8{\"{}}
- \gdef^^a9{\copyright}
- \gdef^^aa{\ordf}
- \gdef^^ab{\guillemetleft}
- \gdef^^ac{$\lnot$}
- \gdef^^ad{\-}
- \gdef^^ae{\registeredsymbol}
- \gdef^^af{\={}}
- %
- \gdef^^b0{\textdegree}
- \gdef^^b1{$\pm$}
- \gdef^^b2{$^2$}
- \gdef^^b3{$^3$}
- \gdef^^b4{\'{}}
- \gdef^^b5{$\mu$}
- \gdef^^b6{\P}
- %
- \gdef^^b7{$^.$}
- \gdef^^b8{\cedilla\ }
- \gdef^^b9{$^1$}
- \gdef^^ba{\ordm}
- %
- \gdef^^bb{\guillemetright}
- \gdef^^bc{$1\over4$}
- \gdef^^bd{$1\over2$}
- \gdef^^be{$3\over4$}
- \gdef^^bf{\questiondown}
- %
- \gdef^^c0{\`A}
- \gdef^^c1{\'A}
- \gdef^^c2{\^A}
- \gdef^^c3{\~A}
- \gdef^^c4{\"A}
- \gdef^^c5{\ringaccent A}
- \gdef^^c6{\AE}
- \gdef^^c7{\cedilla C}
- \gdef^^c8{\`E}
- \gdef^^c9{\'E}
- \gdef^^ca{\^E}
- \gdef^^cb{\"E}
- \gdef^^cc{\`I}
- \gdef^^cd{\'I}
- \gdef^^ce{\^I}
- \gdef^^cf{\"I}
- %
- \gdef^^d0{\DH}
- \gdef^^d1{\~N}
- \gdef^^d2{\`O}
- \gdef^^d3{\'O}
- \gdef^^d4{\^O}
- \gdef^^d5{\~O}
- \gdef^^d6{\"O}
- \gdef^^d7{$\times$}
- \gdef^^d8{\O}
- \gdef^^d9{\`U}
- \gdef^^da{\'U}
- \gdef^^db{\^U}
- \gdef^^dc{\"U}
- \gdef^^dd{\'Y}
- \gdef^^de{\TH}
- \gdef^^df{\ss}
- %
- \gdef^^e0{\`a}
- \gdef^^e1{\'a}
- \gdef^^e2{\^a}
- \gdef^^e3{\~a}
- \gdef^^e4{\"a}
- \gdef^^e5{\ringaccent a}
- \gdef^^e6{\ae}
- \gdef^^e7{\cedilla c}
- \gdef^^e8{\`e}
- \gdef^^e9{\'e}
- \gdef^^ea{\^e}
- \gdef^^eb{\"e}
- \gdef^^ec{\`{\dotless i}}
- \gdef^^ed{\'{\dotless i}}
- \gdef^^ee{\^{\dotless i}}
- \gdef^^ef{\"{\dotless i}}
- %
- \gdef^^f0{\dh}
- \gdef^^f1{\~n}
- \gdef^^f2{\`o}
- \gdef^^f3{\'o}
- \gdef^^f4{\^o}
- \gdef^^f5{\~o}
- \gdef^^f6{\"o}
- \gdef^^f7{$\div$}
- \gdef^^f8{\o}
- \gdef^^f9{\`u}
- \gdef^^fa{\'u}
- \gdef^^fb{\^u}
- \gdef^^fc{\"u}
- \gdef^^fd{\'y}
- \gdef^^fe{\th}
- \gdef^^ff{\"y}
-}
-
-% Latin9 (ISO-8859-15) encoding character definitions.
-\def\latninechardefs{%
- % Encoding is almost identical to Latin1.
- \latonechardefs
- %
- \gdef^^a4{\euro}
- \gdef^^a6{\v S}
- \gdef^^a8{\v s}
- \gdef^^b4{\v Z}
- \gdef^^b8{\v z}
- \gdef^^bc{\OE}
- \gdef^^bd{\oe}
- \gdef^^be{\"Y}
-}
-
-% Latin2 (ISO-8859-2) character definitions.
-\def\lattwochardefs{%
- \gdef^^a0{\tie}
- \gdef^^a1{\ogonek{A}}
- \gdef^^a2{\u{}}
- \gdef^^a3{\L}
- \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
- \gdef^^a5{\v L}
- \gdef^^a6{\'S}
- \gdef^^a7{\S}
- \gdef^^a8{\"{}}
- \gdef^^a9{\v S}
- \gdef^^aa{\cedilla S}
- \gdef^^ab{\v T}
- \gdef^^ac{\'Z}
- \gdef^^ad{\-}
- \gdef^^ae{\v Z}
- \gdef^^af{\dotaccent Z}
- %
- \gdef^^b0{\textdegree}
- \gdef^^b1{\ogonek{a}}
- \gdef^^b2{\ogonek{ }}
- \gdef^^b3{\l}
- \gdef^^b4{\'{}}
- \gdef^^b5{\v l}
- \gdef^^b6{\'s}
- \gdef^^b7{\v{}}
- \gdef^^b8{\cedilla\ }
- \gdef^^b9{\v s}
- \gdef^^ba{\cedilla s}
- \gdef^^bb{\v t}
- \gdef^^bc{\'z}
- \gdef^^bd{\H{}}
- \gdef^^be{\v z}
- \gdef^^bf{\dotaccent z}
- %
- \gdef^^c0{\'R}
- \gdef^^c1{\'A}
- \gdef^^c2{\^A}
- \gdef^^c3{\u A}
- \gdef^^c4{\"A}
- \gdef^^c5{\'L}
- \gdef^^c6{\'C}
- \gdef^^c7{\cedilla C}
- \gdef^^c8{\v C}
- \gdef^^c9{\'E}
- \gdef^^ca{\ogonek{E}}
- \gdef^^cb{\"E}
- \gdef^^cc{\v E}
- \gdef^^cd{\'I}
- \gdef^^ce{\^I}
- \gdef^^cf{\v D}
- %
- \gdef^^d0{\DH}
- \gdef^^d1{\'N}
- \gdef^^d2{\v N}
- \gdef^^d3{\'O}
- \gdef^^d4{\^O}
- \gdef^^d5{\H O}
- \gdef^^d6{\"O}
- \gdef^^d7{$\times$}
- \gdef^^d8{\v R}
- \gdef^^d9{\ringaccent U}
- \gdef^^da{\'U}
- \gdef^^db{\H U}
- \gdef^^dc{\"U}
- \gdef^^dd{\'Y}
- \gdef^^de{\cedilla T}
- \gdef^^df{\ss}
- %
- \gdef^^e0{\'r}
- \gdef^^e1{\'a}
- \gdef^^e2{\^a}
- \gdef^^e3{\u a}
- \gdef^^e4{\"a}
- \gdef^^e5{\'l}
- \gdef^^e6{\'c}
- \gdef^^e7{\cedilla c}
- \gdef^^e8{\v c}
- \gdef^^e9{\'e}
- \gdef^^ea{\ogonek{e}}
- \gdef^^eb{\"e}
- \gdef^^ec{\v e}
- \gdef^^ed{\'{\dotless{i}}}
- \gdef^^ee{\^{\dotless{i}}}
- \gdef^^ef{\v d}
- %
- \gdef^^f0{\dh}
- \gdef^^f1{\'n}
- \gdef^^f2{\v n}
- \gdef^^f3{\'o}
- \gdef^^f4{\^o}
- \gdef^^f5{\H o}
- \gdef^^f6{\"o}
- \gdef^^f7{$\div$}
- \gdef^^f8{\v r}
- \gdef^^f9{\ringaccent u}
- \gdef^^fa{\'u}
- \gdef^^fb{\H u}
- \gdef^^fc{\"u}
- \gdef^^fd{\'y}
- \gdef^^fe{\cedilla t}
- \gdef^^ff{\dotaccent{}}
-}
-
-% UTF-8 character definitions.
-%
-% This code to support UTF-8 is based on LaTeX's utf8.def, with some
-% changes for Texinfo conventions. It is included here under the GPL by
-% permission from Frank Mittelbach and the LaTeX team.
-%
-\newcount\countUTFx
-\newcount\countUTFy
-\newcount\countUTFz
-
-\gdef\UTFviiiTwoOctets#1#2{\expandafter
- \UTFviiiDefined\csname u8:#1\string #2\endcsname}
-%
-\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
- \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
-%
-\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
- \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
-
-\gdef\UTFviiiDefined#1{%
- \ifx #1\relax
- \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
- \else
- \expandafter #1%
- \fi
-}
-
-\begingroup
- \catcode`\~13
- \catcode`\"12
-
- \def\UTFviiiLoop{%
- \global\catcode\countUTFx\active
- \uccode`\~\countUTFx
- \uppercase\expandafter{\UTFviiiTmp}%
- \advance\countUTFx by 1
- \ifnum\countUTFx < \countUTFy
- \expandafter\UTFviiiLoop
- \fi}
-
- \countUTFx = "C2
- \countUTFy = "E0
- \def\UTFviiiTmp{%
- \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
- \UTFviiiLoop
-
- \countUTFx = "E0
- \countUTFy = "F0
- \def\UTFviiiTmp{%
- \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
- \UTFviiiLoop
-
- \countUTFx = "F0
- \countUTFy = "F4
- \def\UTFviiiTmp{%
- \xdef~{\noexpand\UTFviiiFourOctets\string~}}
- \UTFviiiLoop
-\endgroup
-
-\begingroup
- \catcode`\"=12
- \catcode`\<=12
- \catcode`\.=12
- \catcode`\,=12
- \catcode`\;=12
- \catcode`\!=12
- \catcode`\~=13
-
- \gdef\DeclareUnicodeCharacter#1#2{%
- \countUTFz = "#1\relax
- %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
- \begingroup
- \parseXMLCharref
- \def\UTFviiiTwoOctets##1##2{%
- \csname u8:##1\string ##2\endcsname}%
- \def\UTFviiiThreeOctets##1##2##3{%
- \csname u8:##1\string ##2\string ##3\endcsname}%
- \def\UTFviiiFourOctets##1##2##3##4{%
- \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
- \expandafter\expandafter\expandafter\expandafter
- \expandafter\expandafter\expandafter
- \gdef\UTFviiiTmp{#2}%
- \endgroup}
-
- \gdef\parseXMLCharref{%
- \ifnum\countUTFz < "A0\relax
- \errhelp = \EMsimple
- \errmessage{Cannot define Unicode char value < 00A0}%
- \else\ifnum\countUTFz < "800\relax
- \parseUTFviiiA,%
- \parseUTFviiiB C\UTFviiiTwoOctets.,%
- \else\ifnum\countUTFz < "10000\relax
- \parseUTFviiiA;%
- \parseUTFviiiA,%
- \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
- \else
- \parseUTFviiiA;%
- \parseUTFviiiA,%
- \parseUTFviiiA!%
- \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
- \fi\fi\fi
- }
-
- \gdef\parseUTFviiiA#1{%
- \countUTFx = \countUTFz
- \divide\countUTFz by 64
- \countUTFy = \countUTFz
- \multiply\countUTFz by 64
- \advance\countUTFx by -\countUTFz
- \advance\countUTFx by 128
- \uccode `#1\countUTFx
- \countUTFz = \countUTFy}
-
- \gdef\parseUTFviiiB#1#2#3#4{%
- \advance\countUTFz by "#10\relax
- \uccode `#3\countUTFz
- \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
-\endgroup
-
-\def\utfeightchardefs{%
- \DeclareUnicodeCharacter{00A0}{\tie}
- \DeclareUnicodeCharacter{00A1}{\exclamdown}
- \DeclareUnicodeCharacter{00A3}{\pounds}
- \DeclareUnicodeCharacter{00A8}{\"{ }}
- \DeclareUnicodeCharacter{00A9}{\copyright}
- \DeclareUnicodeCharacter{00AA}{\ordf}
- \DeclareUnicodeCharacter{00AB}{\guillemetleft}
- \DeclareUnicodeCharacter{00AD}{\-}
- \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
- \DeclareUnicodeCharacter{00AF}{\={ }}
-
- \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
- \DeclareUnicodeCharacter{00B4}{\'{ }}
- \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
- \DeclareUnicodeCharacter{00BA}{\ordm}
- \DeclareUnicodeCharacter{00BB}{\guillemetright}
- \DeclareUnicodeCharacter{00BF}{\questiondown}
-
- \DeclareUnicodeCharacter{00C0}{\`A}
- \DeclareUnicodeCharacter{00C1}{\'A}
- \DeclareUnicodeCharacter{00C2}{\^A}
- \DeclareUnicodeCharacter{00C3}{\~A}
- \DeclareUnicodeCharacter{00C4}{\"A}
- \DeclareUnicodeCharacter{00C5}{\AA}
- \DeclareUnicodeCharacter{00C6}{\AE}
- \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
- \DeclareUnicodeCharacter{00C8}{\`E}
- \DeclareUnicodeCharacter{00C9}{\'E}
- \DeclareUnicodeCharacter{00CA}{\^E}
- \DeclareUnicodeCharacter{00CB}{\"E}
- \DeclareUnicodeCharacter{00CC}{\`I}
- \DeclareUnicodeCharacter{00CD}{\'I}
- \DeclareUnicodeCharacter{00CE}{\^I}
- \DeclareUnicodeCharacter{00CF}{\"I}
-
- \DeclareUnicodeCharacter{00D0}{\DH}
- \DeclareUnicodeCharacter{00D1}{\~N}
- \DeclareUnicodeCharacter{00D2}{\`O}
- \DeclareUnicodeCharacter{00D3}{\'O}
- \DeclareUnicodeCharacter{00D4}{\^O}
- \DeclareUnicodeCharacter{00D5}{\~O}
- \DeclareUnicodeCharacter{00D6}{\"O}
- \DeclareUnicodeCharacter{00D8}{\O}
- \DeclareUnicodeCharacter{00D9}{\`U}
- \DeclareUnicodeCharacter{00DA}{\'U}
- \DeclareUnicodeCharacter{00DB}{\^U}
- \DeclareUnicodeCharacter{00DC}{\"U}
- \DeclareUnicodeCharacter{00DD}{\'Y}
- \DeclareUnicodeCharacter{00DE}{\TH}
- \DeclareUnicodeCharacter{00DF}{\ss}
-
- \DeclareUnicodeCharacter{00E0}{\`a}
- \DeclareUnicodeCharacter{00E1}{\'a}
- \DeclareUnicodeCharacter{00E2}{\^a}
- \DeclareUnicodeCharacter{00E3}{\~a}
- \DeclareUnicodeCharacter{00E4}{\"a}
- \DeclareUnicodeCharacter{00E5}{\aa}
- \DeclareUnicodeCharacter{00E6}{\ae}
- \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
- \DeclareUnicodeCharacter{00E8}{\`e}
- \DeclareUnicodeCharacter{00E9}{\'e}
- \DeclareUnicodeCharacter{00EA}{\^e}
- \DeclareUnicodeCharacter{00EB}{\"e}
- \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
- \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
- \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
- \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
-
- \DeclareUnicodeCharacter{00F0}{\dh}
- \DeclareUnicodeCharacter{00F1}{\~n}
- \DeclareUnicodeCharacter{00F2}{\`o}
- \DeclareUnicodeCharacter{00F3}{\'o}
- \DeclareUnicodeCharacter{00F4}{\^o}
- \DeclareUnicodeCharacter{00F5}{\~o}
- \DeclareUnicodeCharacter{00F6}{\"o}
- \DeclareUnicodeCharacter{00F8}{\o}
- \DeclareUnicodeCharacter{00F9}{\`u}
- \DeclareUnicodeCharacter{00FA}{\'u}
- \DeclareUnicodeCharacter{00FB}{\^u}
- \DeclareUnicodeCharacter{00FC}{\"u}
- \DeclareUnicodeCharacter{00FD}{\'y}
- \DeclareUnicodeCharacter{00FE}{\th}
- \DeclareUnicodeCharacter{00FF}{\"y}
-
- \DeclareUnicodeCharacter{0100}{\=A}
- \DeclareUnicodeCharacter{0101}{\=a}
- \DeclareUnicodeCharacter{0102}{\u{A}}
- \DeclareUnicodeCharacter{0103}{\u{a}}
- \DeclareUnicodeCharacter{0104}{\ogonek{A}}
- \DeclareUnicodeCharacter{0105}{\ogonek{a}}
- \DeclareUnicodeCharacter{0106}{\'C}
- \DeclareUnicodeCharacter{0107}{\'c}
- \DeclareUnicodeCharacter{0108}{\^C}
- \DeclareUnicodeCharacter{0109}{\^c}
- \DeclareUnicodeCharacter{0118}{\ogonek{E}}
- \DeclareUnicodeCharacter{0119}{\ogonek{e}}
- \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
- \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
- \DeclareUnicodeCharacter{010C}{\v{C}}
- \DeclareUnicodeCharacter{010D}{\v{c}}
- \DeclareUnicodeCharacter{010E}{\v{D}}
-
- \DeclareUnicodeCharacter{0112}{\=E}
- \DeclareUnicodeCharacter{0113}{\=e}
- \DeclareUnicodeCharacter{0114}{\u{E}}
- \DeclareUnicodeCharacter{0115}{\u{e}}
- \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
- \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
- \DeclareUnicodeCharacter{011A}{\v{E}}
- \DeclareUnicodeCharacter{011B}{\v{e}}
- \DeclareUnicodeCharacter{011C}{\^G}
- \DeclareUnicodeCharacter{011D}{\^g}
- \DeclareUnicodeCharacter{011E}{\u{G}}
- \DeclareUnicodeCharacter{011F}{\u{g}}
-
- \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
- \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
- \DeclareUnicodeCharacter{0124}{\^H}
- \DeclareUnicodeCharacter{0125}{\^h}
- \DeclareUnicodeCharacter{0128}{\~I}
- \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
- \DeclareUnicodeCharacter{012A}{\=I}
- \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
- \DeclareUnicodeCharacter{012C}{\u{I}}
- \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
-
- \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
- \DeclareUnicodeCharacter{0131}{\dotless{i}}
- \DeclareUnicodeCharacter{0132}{IJ}
- \DeclareUnicodeCharacter{0133}{ij}
- \DeclareUnicodeCharacter{0134}{\^J}
- \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
- \DeclareUnicodeCharacter{0139}{\'L}
- \DeclareUnicodeCharacter{013A}{\'l}
-
- \DeclareUnicodeCharacter{0141}{\L}
- \DeclareUnicodeCharacter{0142}{\l}
- \DeclareUnicodeCharacter{0143}{\'N}
- \DeclareUnicodeCharacter{0144}{\'n}
- \DeclareUnicodeCharacter{0147}{\v{N}}
- \DeclareUnicodeCharacter{0148}{\v{n}}
- \DeclareUnicodeCharacter{014C}{\=O}
- \DeclareUnicodeCharacter{014D}{\=o}
- \DeclareUnicodeCharacter{014E}{\u{O}}
- \DeclareUnicodeCharacter{014F}{\u{o}}
-
- \DeclareUnicodeCharacter{0150}{\H{O}}
- \DeclareUnicodeCharacter{0151}{\H{o}}
- \DeclareUnicodeCharacter{0152}{\OE}
- \DeclareUnicodeCharacter{0153}{\oe}
- \DeclareUnicodeCharacter{0154}{\'R}
- \DeclareUnicodeCharacter{0155}{\'r}
- \DeclareUnicodeCharacter{0158}{\v{R}}
- \DeclareUnicodeCharacter{0159}{\v{r}}
- \DeclareUnicodeCharacter{015A}{\'S}
- \DeclareUnicodeCharacter{015B}{\'s}
- \DeclareUnicodeCharacter{015C}{\^S}
- \DeclareUnicodeCharacter{015D}{\^s}
- \DeclareUnicodeCharacter{015E}{\cedilla{S}}
- \DeclareUnicodeCharacter{015F}{\cedilla{s}}
-
- \DeclareUnicodeCharacter{0160}{\v{S}}
- \DeclareUnicodeCharacter{0161}{\v{s}}
- \DeclareUnicodeCharacter{0162}{\cedilla{t}}
- \DeclareUnicodeCharacter{0163}{\cedilla{T}}
- \DeclareUnicodeCharacter{0164}{\v{T}}
-
- \DeclareUnicodeCharacter{0168}{\~U}
- \DeclareUnicodeCharacter{0169}{\~u}
- \DeclareUnicodeCharacter{016A}{\=U}
- \DeclareUnicodeCharacter{016B}{\=u}
- \DeclareUnicodeCharacter{016C}{\u{U}}
- \DeclareUnicodeCharacter{016D}{\u{u}}
- \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
- \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
-
- \DeclareUnicodeCharacter{0170}{\H{U}}
- \DeclareUnicodeCharacter{0171}{\H{u}}
- \DeclareUnicodeCharacter{0174}{\^W}
- \DeclareUnicodeCharacter{0175}{\^w}
- \DeclareUnicodeCharacter{0176}{\^Y}
- \DeclareUnicodeCharacter{0177}{\^y}
- \DeclareUnicodeCharacter{0178}{\"Y}
- \DeclareUnicodeCharacter{0179}{\'Z}
- \DeclareUnicodeCharacter{017A}{\'z}
- \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
- \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
- \DeclareUnicodeCharacter{017D}{\v{Z}}
- \DeclareUnicodeCharacter{017E}{\v{z}}
-
- \DeclareUnicodeCharacter{01C4}{D\v{Z}}
- \DeclareUnicodeCharacter{01C5}{D\v{z}}
- \DeclareUnicodeCharacter{01C6}{d\v{z}}
- \DeclareUnicodeCharacter{01C7}{LJ}
- \DeclareUnicodeCharacter{01C8}{Lj}
- \DeclareUnicodeCharacter{01C9}{lj}
- \DeclareUnicodeCharacter{01CA}{NJ}
- \DeclareUnicodeCharacter{01CB}{Nj}
- \DeclareUnicodeCharacter{01CC}{nj}
- \DeclareUnicodeCharacter{01CD}{\v{A}}
- \DeclareUnicodeCharacter{01CE}{\v{a}}
- \DeclareUnicodeCharacter{01CF}{\v{I}}
-
- \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
- \DeclareUnicodeCharacter{01D1}{\v{O}}
- \DeclareUnicodeCharacter{01D2}{\v{o}}
- \DeclareUnicodeCharacter{01D3}{\v{U}}
- \DeclareUnicodeCharacter{01D4}{\v{u}}
-
- \DeclareUnicodeCharacter{01E2}{\={\AE}}
- \DeclareUnicodeCharacter{01E3}{\={\ae}}
- \DeclareUnicodeCharacter{01E6}{\v{G}}
- \DeclareUnicodeCharacter{01E7}{\v{g}}
- \DeclareUnicodeCharacter{01E8}{\v{K}}
- \DeclareUnicodeCharacter{01E9}{\v{k}}
-
- \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
- \DeclareUnicodeCharacter{01F1}{DZ}
- \DeclareUnicodeCharacter{01F2}{Dz}
- \DeclareUnicodeCharacter{01F3}{dz}
- \DeclareUnicodeCharacter{01F4}{\'G}
- \DeclareUnicodeCharacter{01F5}{\'g}
- \DeclareUnicodeCharacter{01F8}{\`N}
- \DeclareUnicodeCharacter{01F9}{\`n}
- \DeclareUnicodeCharacter{01FC}{\'{\AE}}
- \DeclareUnicodeCharacter{01FD}{\'{\ae}}
- \DeclareUnicodeCharacter{01FE}{\'{\O}}
- \DeclareUnicodeCharacter{01FF}{\'{\o}}
-
- \DeclareUnicodeCharacter{021E}{\v{H}}
- \DeclareUnicodeCharacter{021F}{\v{h}}
-
- \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
- \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
- \DeclareUnicodeCharacter{0228}{\cedilla{E}}
- \DeclareUnicodeCharacter{0229}{\cedilla{e}}
- \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
- \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
-
- \DeclareUnicodeCharacter{0232}{\=Y}
- \DeclareUnicodeCharacter{0233}{\=y}
- \DeclareUnicodeCharacter{0237}{\dotless{j}}
-
- \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
-
- \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
- \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
- \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
- \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
- \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
- \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
- \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
- \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
- \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
- \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
- \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
- \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
-
- \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
- \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
-
- \DeclareUnicodeCharacter{1E20}{\=G}
- \DeclareUnicodeCharacter{1E21}{\=g}
- \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
- \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
- \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
- \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
- \DeclareUnicodeCharacter{1E26}{\"H}
- \DeclareUnicodeCharacter{1E27}{\"h}
-
- \DeclareUnicodeCharacter{1E30}{\'K}
- \DeclareUnicodeCharacter{1E31}{\'k}
- \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
- \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
- \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
- \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
- \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
- \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
- \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
- \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
- \DeclareUnicodeCharacter{1E3E}{\'M}
- \DeclareUnicodeCharacter{1E3F}{\'m}
-
- \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
- \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
- \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
- \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
- \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
- \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
- \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
- \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
- \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
- \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
-
- \DeclareUnicodeCharacter{1E54}{\'P}
- \DeclareUnicodeCharacter{1E55}{\'p}
- \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
- \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
- \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
- \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
- \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
- \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
- \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
- \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
-
- \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
- \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
- \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
- \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
- \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
- \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
- \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
- \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
- \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
- \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
-
- \DeclareUnicodeCharacter{1E7C}{\~V}
- \DeclareUnicodeCharacter{1E7D}{\~v}
- \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
- \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
-
- \DeclareUnicodeCharacter{1E80}{\`W}
- \DeclareUnicodeCharacter{1E81}{\`w}
- \DeclareUnicodeCharacter{1E82}{\'W}
- \DeclareUnicodeCharacter{1E83}{\'w}
- \DeclareUnicodeCharacter{1E84}{\"W}
- \DeclareUnicodeCharacter{1E85}{\"w}
- \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
- \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
- \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
- \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
- \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
- \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
- \DeclareUnicodeCharacter{1E8C}{\"X}
- \DeclareUnicodeCharacter{1E8D}{\"x}
- \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
- \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
-
- \DeclareUnicodeCharacter{1E90}{\^Z}
- \DeclareUnicodeCharacter{1E91}{\^z}
- \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
- \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
- \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
- \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
- \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
- \DeclareUnicodeCharacter{1E97}{\"t}
- \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
- \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
-
- \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
- \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
-
- \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
- \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
- \DeclareUnicodeCharacter{1EBC}{\~E}
- \DeclareUnicodeCharacter{1EBD}{\~e}
-
- \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
- \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
- \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
- \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
-
- \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
- \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
-
- \DeclareUnicodeCharacter{1EF2}{\`Y}
- \DeclareUnicodeCharacter{1EF3}{\`y}
- \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
-
- \DeclareUnicodeCharacter{1EF8}{\~Y}
- \DeclareUnicodeCharacter{1EF9}{\~y}
-
- \DeclareUnicodeCharacter{2013}{--}
- \DeclareUnicodeCharacter{2014}{---}
- \DeclareUnicodeCharacter{2018}{\quoteleft}
- \DeclareUnicodeCharacter{2019}{\quoteright}
- \DeclareUnicodeCharacter{201A}{\quotesinglbase}
- \DeclareUnicodeCharacter{201C}{\quotedblleft}
- \DeclareUnicodeCharacter{201D}{\quotedblright}
- \DeclareUnicodeCharacter{201E}{\quotedblbase}
- \DeclareUnicodeCharacter{2022}{\bullet}
- \DeclareUnicodeCharacter{2026}{\dots}
- \DeclareUnicodeCharacter{2039}{\guilsinglleft}
- \DeclareUnicodeCharacter{203A}{\guilsinglright}
- \DeclareUnicodeCharacter{20AC}{\euro}
-
- \DeclareUnicodeCharacter{2192}{\expansion}
- \DeclareUnicodeCharacter{21D2}{\result}
-
- \DeclareUnicodeCharacter{2212}{\minus}
- \DeclareUnicodeCharacter{2217}{\point}
- \DeclareUnicodeCharacter{2261}{\equiv}
-}% end of \utfeightchardefs
-
-
-% US-ASCII character definitions.
-\def\asciichardefs{% nothing need be done
- \relax
-}
-
-% Make non-ASCII characters printable again for compatibility with
-% existing Texinfo documents that may use them, even without declaring a
-% document encoding.
-%
-\setnonasciicharscatcode \other
-
-
-\message{formatting,}
-
-\newdimen\defaultparindent \defaultparindent = 15pt
-
-\chapheadingskip = 15pt plus 4pt minus 2pt
-\secheadingskip = 12pt plus 3pt minus 2pt
-\subsecheadingskip = 9pt plus 2pt minus 2pt
-
-% Prevent underfull vbox error messages.
-\vbadness = 10000
-
-% Don't be very finicky about underfull hboxes, either.
-\hbadness = 6666
-
-% Following George Bush, get rid of widows and orphans.
-\widowpenalty=10000
-\clubpenalty=10000
-
-% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
-% using an old version of TeX, don't do anything. We want the amount of
-% stretch added to depend on the line length, hence the dependence on
-% \hsize. We call this whenever the paper size is set.
-%
-\def\setemergencystretch{%
- \ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
- \else
- \emergencystretch = .15\hsize
- \fi
-}
-
-% Parameters in order: 1) textheight; 2) textwidth;
-% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
-% 7) physical page height; 8) physical page width.
-%
-% We also call \setleading{\textleading}, so the caller should define
-% \textleading. The caller should also set \parskip.
-%
-\def\internalpagesizes#1#2#3#4#5#6#7#8{%
- \voffset = #3\relax
- \topskip = #6\relax
- \splittopskip = \topskip
- %
- \vsize = #1\relax
- \advance\vsize by \topskip
- \outervsize = \vsize
- \advance\outervsize by 2\topandbottommargin
- \pageheight = \vsize
- %
- \hsize = #2\relax
- \outerhsize = \hsize
- \advance\outerhsize by 0.5in
- \pagewidth = \hsize
- %
- \normaloffset = #4\relax
- \bindingoffset = #5\relax
- %
- \ifpdf
- \pdfpageheight #7\relax
- \pdfpagewidth #8\relax
- % if we don't reset these, they will remain at "1 true in" of
- % whatever layout pdftex was dumped with.
- \pdfhorigin = 1 true in
- \pdfvorigin = 1 true in
- \fi
- %
- \setleading{\textleading}
- %
- \parindent = \defaultparindent
- \setemergencystretch
-}
-
-% @letterpaper (the default).
-\def\letterpaper{{\globaldefs = 1
- \parskip = 3pt plus 2pt minus 1pt
- \textleading = 13.2pt
- %
- % If page is nothing but text, make it come out even.
- \internalpagesizes{607.2pt}{6in}% that's 46 lines
- {\voffset}{.25in}%
- {\bindingoffset}{36pt}%
- {11in}{8.5in}%
-}}
-
-% Use @smallbook to reset parameters for 7x9.25 trim size.
-\def\smallbook{{\globaldefs = 1
- \parskip = 2pt plus 1pt
- \textleading = 12pt
- %
- \internalpagesizes{7.5in}{5in}%
- {-.2in}{0in}%
- {\bindingoffset}{16pt}%
- {9.25in}{7in}%
- %
- \lispnarrowing = 0.3in
- \tolerance = 700
- \hfuzz = 1pt
- \contentsrightmargin = 0pt
- \defbodyindent = .5cm
-}}
-
-% Use @smallerbook to reset parameters for 6x9 trim size.
-% (Just testing, parameters still in flux.)
-\def\smallerbook{{\globaldefs = 1
- \parskip = 1.5pt plus 1pt
- \textleading = 12pt
- %
- \internalpagesizes{7.4in}{4.8in}%
- {-.2in}{-.4in}%
- {0pt}{14pt}%
- {9in}{6in}%
- %
- \lispnarrowing = 0.25in
- \tolerance = 700
- \hfuzz = 1pt
- \contentsrightmargin = 0pt
- \defbodyindent = .4cm
-}}
-
-% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{{\globaldefs = 1
- \parskip = 3pt plus 2pt minus 1pt
- \textleading = 13.2pt
- %
- % Double-side printing via postscript on Laserjet 4050
- % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
- % To change the settings for a different printer or situation, adjust
- % \normaloffset until the front-side and back-side texts align. Then
- % do the same for \bindingoffset. You can set these for testing in
- % your texinfo source file like this:
- % @tex
- % \global\normaloffset = -6mm
- % \global\bindingoffset = 10mm
- % @end tex
- \internalpagesizes{673.2pt}{160mm}% that's 51 lines
- {\voffset}{\hoffset}%
- {\bindingoffset}{44pt}%
- {297mm}{210mm}%
- %
- \tolerance = 700
- \hfuzz = 1pt
- \contentsrightmargin = 0pt
- \defbodyindent = 5mm
-}}
-
-% Use @afivepaper to print on European A5 paper.
-% From romildo@urano.iceb.ufop.br, 2 July 2000.
-% He also recommends making @example and @lisp be small.
-\def\afivepaper{{\globaldefs = 1
- \parskip = 2pt plus 1pt minus 0.1pt
- \textleading = 12.5pt
- %
- \internalpagesizes{160mm}{120mm}%
- {\voffset}{\hoffset}%
- {\bindingoffset}{8pt}%
- {210mm}{148mm}%
- %
- \lispnarrowing = 0.2in
- \tolerance = 800
- \hfuzz = 1.2pt
- \contentsrightmargin = 0pt
- \defbodyindent = 2mm
- \tableindent = 12mm
-}}
-
-% A specific text layout, 24x15cm overall, intended for A4 paper.
-\def\afourlatex{{\globaldefs = 1
- \afourpaper
- \internalpagesizes{237mm}{150mm}%
- {\voffset}{4.6mm}%
- {\bindingoffset}{7mm}%
- {297mm}{210mm}%
- %
- % Must explicitly reset to 0 because we call \afourpaper.
- \globaldefs = 0
-}}
-
-% Use @afourwide to print on A4 paper in landscape format.
-\def\afourwide{{\globaldefs = 1
- \afourpaper
- \internalpagesizes{241mm}{165mm}%
- {\voffset}{-2.95mm}%
- {\bindingoffset}{7mm}%
- {297mm}{210mm}%
- \globaldefs = 0
-}}
-
-% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
-% Perhaps we should allow setting the margins, \topskip, \parskip,
-% and/or leading, also. Or perhaps we should compute them somehow.
-%
-\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
-\def\pagesizesyyy#1,#2,#3\finish{{%
- \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
- \globaldefs = 1
- %
- \parskip = 3pt plus 2pt minus 1pt
- \setleading{\textleading}%
- %
- \dimen0 = #1\relax
- \advance\dimen0 by \voffset
- %
- \dimen2 = \hsize
- \advance\dimen2 by \normaloffset
- %
- \internalpagesizes{#1}{\hsize}%
- {\voffset}{\normaloffset}%
- {\bindingoffset}{44pt}%
- {\dimen0}{\dimen2}%
-}}
-
-% Set default to letter.
-%
-\letterpaper
-
-
-\message{and turning on texinfo input format.}
-
-\def^^L{\par} % remove \outer, so ^L can appear in an @comment
-
-% DEL is a comment character, in case @c does not suffice.
-\catcode`\^^? = 14
-
-% Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other \def\normaldoublequote{"}
-\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
-\catcode`\+=\other \def\normalplus{+}
-\catcode`\<=\other \def\normalless{<}
-\catcode`\>=\other \def\normalgreater{>}
-\catcode`\^=\other \def\normalcaret{^}
-\catcode`\_=\other \def\normalunderscore{_}
-\catcode`\|=\other \def\normalverticalbar{|}
-\catcode`\~=\other \def\normaltilde{~}
-
-% This macro is used to make a character print one way in \tt
-% (where it can probably be output as-is), and another way in other fonts,
-% where something hairier probably needs to be done.
-%
-% #1 is what to print if we are indeed using \tt; #2 is what to print
-% otherwise. Since all the Computer Modern typewriter fonts have zero
-% interword stretch (and shrink), and it is reasonable to expect all
-% typewriter fonts to have this, we can check that font parameter.
-%
-\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
-
-% Same as above, but check for italic font. Actually this also catches
-% non-italic slanted fonts since it is impossible to distinguish them from
-% italic fonts. But since this is only used by $ and it uses \sl anyway
-% this is not a problem.
-\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
-
-% Turn off all special characters except @
-% (and those which the user can use as if they were ordinary).
-% Most of these we simply print from the \tt font, but for some, we can
-% use math or other variants that look better in normal text.
-
-\catcode`\"=\active
-\def\activedoublequote{{\tt\char34}}
-\let"=\activedoublequote
-\catcode`\~=\active
-\def~{{\tt\char126}}
-\chardef\hat=`\^
-\catcode`\^=\active
-\def^{{\tt \hat}}
-
-\catcode`\_=\active
-\def_{\ifusingtt\normalunderscore\_}
-\let\realunder=_
-% Subroutine for the previous macro.
-\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
-
-\catcode`\|=\active
-\def|{{\tt\char124}}
-\chardef \less=`\<
-\catcode`\<=\active
-\def<{{\tt \less}}
-\chardef \gtr=`\>
-\catcode`\>=\active
-\def>{{\tt \gtr}}
-\catcode`\+=\active
-\def+{{\tt \char 43}}
-\catcode`\$=\active
-\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
-
-% If a .fmt file is being used, characters that might appear in a file
-% name cannot be active until we have parsed the command line.
-% So turn them off again, and have \everyjob (or @setfilename) turn them on.
-% \otherifyactive is called near the end of this file.
-\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
-
-% Used sometimes to turn off (effectively) the active characters even after
-% parsing them.
-\def\turnoffactive{%
- \normalturnoffactive
- \otherbackslash
-}
-
-\catcode`\@=0
-
-% \backslashcurfont outputs one backslash character in current font,
-% as in \char`\\.
-\global\chardef\backslashcurfont=`\\
-\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
-
-% \realbackslash is an actual character `\' with catcode other, and
-% \doublebackslash is two of them (for the pdf outlines).
-{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
-
-% In texinfo, backslash is an active character; it prints the backslash
-% in fixed width font.
-\catcode`\\=\active % @ for escape char from now on.
-
-% The story here is that in math mode, the \char of \backslashcurfont
-% ends up printing the roman \ from the math symbol font (because \char
-% in math mode uses the \mathcode, and plain.tex sets
-% \mathcode`\\="026E). It seems better for @backslashchar{} to always
-% print a typewriter backslash, hence we use an explicit \mathchar,
-% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
-% ignored family value; char position "5C). We can't use " for the
-% usual hex value because it has already been made active.
-@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
-@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
-
-% On startup, @fixbackslash assigns:
-% @let \ = @normalbackslash
-% \rawbackslash defines an active \ to do \backslashcurfont.
-% \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other. We switch back and forth between these.
-@gdef@rawbackslash{@let\=@backslashcurfont}
-@gdef@otherbackslash{@let\=@realbackslash}
-
-% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'.
-%
-@def@normalturnoffactive{%
- @let"=@normaldoublequote
- @let$=@normaldollar %$ font-lock fix
- @let+=@normalplus
- @let<=@normalless
- @let>=@normalgreater
- @let\=@normalbackslash
- @let^=@normalcaret
- @let_=@normalunderscore
- @let|=@normalverticalbar
- @let~=@normaltilde
- @markupsetuplqdefault
- @markupsetuprqdefault
- @unsepspaces
-}
-
-% Make _ and + \other characters, temporarily.
-% This is canceled by @fixbackslash.
-@otherifyactive
-
-% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
-% That is what \eatinput is for; after that, the `\' should revert to printing
-% a backslash.
-%
-@gdef@eatinput input texinfo{@fixbackslash}
-@global@let\ = @eatinput
-
-% On the other hand, perhaps the file did not have a `\input texinfo'. Then
-% the first `\' in the file would cause an error. This macro tries to fix
-% that, assuming it is called before the first `\' could plausibly occur.
-% Also turn back on active characters that might appear in the input
-% file name, in case not using a pre-dumped format.
-%
-@gdef@fixbackslash{%
- @ifx\@eatinput @let\ = @normalbackslash @fi
- @catcode`+=@active
- @catcode`@_=@active
-}
-
-% Say @foo, not \foo, in error messages.
-@escapechar = `@@
-
-% These (along with & and #) are made active for url-breaking, so need
-% active definitions as the normal characters.
-@def@normaldot{.}
-@def@normalquest{?}
-@def@normalslash{/}
-
-% These look ok in all fonts, so just make them not special.
-% @hashchar{} gets its own user-level command, because of #line.
-@catcode`@& = @other @def@normalamp{&}
-@catcode`@# = @other @def@normalhash{#}
-@catcode`@% = @other @def@normalpercent{%}
-
-@let @hashchar = @normalhash
-
-@c Finally, make ` and ' active, so that txicodequoteundirected and
-@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
-@c don't make ` and ' active, @code will not get them as active chars.
-@c Do this last of all since we use ` in the previous @catcode assignments.
-@catcode`@'=@active
-@catcode`@`=@active
-@markupsetuplqdefault
-@markupsetuprqdefault
-
-@c Local variables:
-@c eval: (add-hook 'write-file-hooks 'time-stamp)
-@c page-delimiter: "^\\\\message"
-@c time-stamp-start: "def\\\\texinfoversion{"
-@c time-stamp-format: "%:y-%02m-%02d.%02H"
-@c time-stamp-end: "}"
-@c End:
-
-@c vim:sw=2:
-
-@ignore
- arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
-@end ignore
diff --git a/doc/version.texi b/doc/version.texi
index 1a495a7..cc91319 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,4 +1,4 @@
-@set UPDATED 6 December 2012
-@set UPDATED-MONTH December 2012
-@set EDITION 2.5.39
-@set VERSION 2.5.39
+@set UPDATED 10 November 2015
+@set UPDATED-MONTH November 2015
+@set EDITION 2.6.0
+@set VERSION 2.6.0