summaryrefslogtreecommitdiff
path: root/support/splint
diff options
context:
space:
mode:
Diffstat (limited to 'support/splint')
-rw-r--r--support/splint/INSTALL10
-rw-r--r--support/splint/Makefile33
-rw-r--r--support/splint/README7
-rw-r--r--support/splint/TODO22
-rw-r--r--support/splint/VERSION2
-rw-r--r--support/splint/cweb/Makefile131
-rw-r--r--support/splint/cweb/bo.w582
-rw-r--r--support/splint/cweb/bs.w60
-rw-r--r--support/splint/cweb/checklists.w2
-rw-r--r--support/splint/cweb/common.w38
-rw-r--r--support/splint/cweb/fk.w4
-rw-r--r--support/splint/cweb/fo.w185
-rw-r--r--support/splint/cweb/lo.w100
-rw-r--r--support/splint/cweb/mkeparser.w8
-rw-r--r--support/splint/cweb/mkscanner.w2
-rw-r--r--support/splint/cweb/np.w34
-rw-r--r--support/splint/cweb/philosophy.w37
-rw-r--r--support/splint/cweb/references.w2
-rw-r--r--support/splint/cweb/so.w133
-rw-r--r--support/splint/cweb/splint.w258
-rw-r--r--support/splint/cweb/ssffo.w123
-rw-r--r--support/splint/doc/ldman.pdfbin718042 -> 745685 bytes
-rw-r--r--support/splint/doc/splint.pdfbin1141608 -> 1157534 bytes
-rw-r--r--support/splint/examples/count/count.sty2
-rw-r--r--support/splint/examples/expression/Makefile4
-rw-r--r--support/splint/examples/expression/etoks.sty2
-rw-r--r--support/splint/examples/expression/expression.sty2
-rw-r--r--support/splint/examples/expression/expression.w18
-rw-r--r--support/splint/examples/ld/Makefile47
-rw-r--r--support/splint/examples/ld/ldexample.hw16
-rw-r--r--support/splint/examples/ld/ldgram.w108
-rw-r--r--support/splint/examples/ld/ldgramo.w9
-rw-r--r--support/splint/examples/ld/ldint.sty9
-rw-r--r--support/splint/examples/ld/ldlex.w519
-rw-r--r--support/splint/examples/ld/ldlexo.w14
-rw-r--r--support/splint/examples/ld/ldman.w297
-rw-r--r--support/splint/examples/ld/ldnp.w49
-rw-r--r--support/splint/examples/ld/ldnump.w10
-rw-r--r--support/splint/examples/ld/ldtexlex.sty4
-rw-r--r--support/splint/examples/ld/ldunion.sty242
-rw-r--r--support/splint/examples/ld/lstokenset.sty2
-rw-r--r--support/splint/examples/ld/ltokenset.sty2
-rw-r--r--support/splint/examples/symbols/Makefile8
-rw-r--r--support/splint/examples/symbols/slimbo.sty2
-rw-r--r--support/splint/examples/symbols/symbols.w46
-rw-r--r--support/splint/examples/symbols/symfm.sty2
-rw-r--r--support/splint/examples/symbols/symmap.sty5
-rw-r--r--support/splint/examples/symbols/symtoks.sty2
-rw-r--r--support/splint/examples/symbols/symtricks.sty2
-rw-r--r--support/splint/examples/types/Makefile2
-rw-r--r--support/splint/examples/types/basic.sty2
-rw-r--r--support/splint/examples/types/test.sty2
-rw-r--r--support/splint/examples/types/tree.sty2
-rw-r--r--support/splint/examples/xxpression/Makefile8
-rw-r--r--support/splint/examples/xxpression/xtoks.sty3
-rw-r--r--support/splint/examples/xxpression/xxpression.sty2
-rw-r--r--support/splint/examples/xxpression/xxpression.w39
-rw-r--r--support/splint/examples/xxpression/xymmap.sty5
-rw-r--r--support/splint/makefile.inc60
-rw-r--r--support/splint/other/texmf/macros/protcode.tex (renamed from support/splint/extras/texmf/macros/protcode.tex)0
-rwxr-xr-xsupport/splint/scripts/bindx.pl30
-rwxr-xr-xsupport/splint/scripts/brack.pl213
-rwxr-xr-xsupport/splint/scripts/cslist.pl2
-rwxr-xr-xsupport/splint/scripts/misccw.pl2
-rwxr-xr-xsupport/splint/scripts/unline.pl21
-rw-r--r--support/splint/tex/btokenset.sty8
-rw-r--r--support/splint/tex/dcols.sty454
-rw-r--r--support/splint/tex/flex.sty124
-rw-r--r--support/splint/tex/fonts/idssbx10.vpl911
-rw-r--r--support/splint/tex/fonts/idssbx12.vpl908
-rw-r--r--support/splint/tex/fonts/idssbx5.vpl908
-rw-r--r--support/splint/tex/fonts/idssbx6.tfmbin0 -> 1280 bytes
-rw-r--r--support/splint/tex/fonts/idssbx6.vfbin0 -> 828 bytes
-rw-r--r--support/splint/tex/fonts/idssbx6.vpl1310
-rw-r--r--support/splint/tex/fonts/idssbx7.tfmbin0 -> 1296 bytes
-rw-r--r--support/splint/tex/fonts/idssbx7.vfbin0 -> 828 bytes
-rw-r--r--support/splint/tex/fonts/idssbx7.vpl913
-rw-r--r--support/splint/tex/fonts/idssbx8.tfmbin0 -> 1280 bytes
-rw-r--r--support/splint/tex/fonts/idssbx8.vfbin0 -> 828 bytes
-rw-r--r--support/splint/tex/fonts/idssbx8.vpl1310
-rw-r--r--support/splint/tex/fonts/idssbx9.tfmbin0 -> 1296 bytes
-rw-r--r--support/splint/tex/fonts/idssbx9.vfbin0 -> 828 bytes
-rw-r--r--support/splint/tex/fonts/idssbx9.vpl1310
-rw-r--r--support/splint/tex/fretokenset.sty2
-rw-r--r--support/splint/tex/ftokenset.sty3
-rw-r--r--support/splint/tex/gindex.sty164
-rw-r--r--support/splint/tex/grabstates.sty16
-rw-r--r--support/splint/tex/hext.sty16
-rw-r--r--support/splint/tex/limbo.sty454
-rw-r--r--support/splint/tex/noweb.sty186
-rw-r--r--support/splint/tex/stokenset.sty3
-rw-r--r--support/splint/tex/trt1.sty4
-rw-r--r--support/splint/tex/xarithm.sty4
-rw-r--r--support/splint/tex/yxunion.sty33
-rw-r--r--support/splint/tex/yy.sty26
-rw-r--r--support/splint/tex/yybootstrap.sty7
-rw-r--r--support/splint/tex/yycommon.sty716
-rw-r--r--support/splint/tex/yydebug.sty18
-rw-r--r--support/splint/tex/yyfaststack.sty94
-rw-r--r--support/splint/tex/yyinit.sty520
-rw-r--r--support/splint/tex/yyinput.sty219
-rw-r--r--support/splint/tex/yymisc.sty435
-rw-r--r--support/splint/tex/yynested.sty2
-rw-r--r--support/splint/tex/yyparse.sty78
-rw-r--r--support/splint/tex/yypretty.sty7
-rw-r--r--support/splint/tex/yystype.sty5
-rw-r--r--support/splint/tex/yytexlex.sty208
-rw-r--r--support/splint/tex/yyunion.sty1314
108 files changed, 13040 insertions, 3239 deletions
diff --git a/support/splint/INSTALL b/support/splint/INSTALL
index 033877aba0..a8a1634b55 100644
--- a/support/splint/INSTALL
+++ b/support/splint/INSTALL
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -40,7 +40,13 @@ compiled and used. For this purpose, make variables BISON_ROOT and
FLEX_ROOT can be set to the appropriate locations in makefile.loc. The
appropriate versions of bison and flex can be downloaded from
http://ftp.gnu.org/gnu/bison/ and http://flex.sourceforge.net/,
-respectively. The installation instructions in those packages are easy
+respectively. Due to the changes in glibc, the bison that comes with the
+distribution (bison-2.7) needs to be patched first. Uncompress the archive
+(bison-2.7.tar.gz) in some directory, copy bison_patch1 to it and run
+
+ # patch -p0 < bison_patch1
+
+The installation instructions in those packages are easy
to follow (the standard ./configure --prefix=<local bin directory> &&\
make && cp src/bison <local bin directory> && cp -a data/* \
<local bin directory>/share/bison should work).
diff --git a/support/splint/Makefile b/support/splint/Makefile
index b7f0269350..e122cfb363 100644
--- a/support/splint/Makefile
+++ b/support/splint/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2024, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -13,11 +13,16 @@
#
# You should have received a copy of the GNU General Public License
# along with SPLinT. If not, see <http://www.gnu.org/licenses/>.
+SPLINT_EXAMPLES_BASE = expression ld
+SPLINT_EXAMPLES_EXTRA = symbols xxpression
+SPLINT_EXAMPLE_OTHER = $(if $BISON_IS_CRIPPLED,,$SPLINT_EXAMPLES_EXTRA)
-SPLINT_EXAMPLE_OTHER = $(if $BISON_IS_CRIPPLED,,symbols xxpression)
+SPLINT_EXAMPLES_DIRS = ${SPLINT_EXAMPLES_BASE} ${SPLINT_EXAMPLE_OTHER}
+SPLINT_EXAMPLES_DIRS_ALL = ${SPLINT_EXAMPLES_BASE} ${SPLINT_EXAMPLES_EXTRA}
-SPLINT_EXAMPLES_DIRS = expression ld ${SPLINT_EXAMPLE_OTHER}
-SPLINT_EXAMPLES_DIRS_ALL = expression ld symbols xxpression
+# the install directory; should be replaced by the appropriate local directory
+# in makefile.loc
+SPLINT_INSTALL_DIR = /tmp
DO_SUBMAKE = for dir in ${SPLINT_EXAMPLES_DIRS}; do cd ${SPLINT_ROOT}examples/$$dir && ${MAKE} $(1); done
CLEAN_SUBMAKE = for dir in ${SPLINT_EXAMPLES_DIRS_ALL}; do cd ${SPLINT_ROOT}examples/$$dir && ${MAKE} $(1); done
@@ -31,12 +36,28 @@ lists: tex/*.sty
perl scripts/cslist.pl $^ > cseqs.lst
manual:
- cd ${SPLINT_ROOT}cweb && ${MAKE} splint.pdf
+ cd ${SPLINT_ROOT}cweb && ${MAKE} docs
docs:
- cd ${SPLINT_ROOT}cweb && ${MAKE} splint.pdf && ${MAKE} ssffo.pdf
+ cd ${SPLINT_ROOT}cweb && ${MAKE} docs
$(call DO_SUBMAKE,docs)
+# install a stand alone version of all the parsers in the package
+
+install: all
+ @cp ${SPLINT_ROOT}tex/*.sty ${SPLINT_INSTALL_DIR}/tex/
+ @cp ${SPLINT_ROOT}cweb/*.tok ${SPLINT_INSTALL_DIR}/cweb/
+ @cp -a ${SPLINT_ROOT}other/ ${SPLINT_INSTALL_DIR}/other/
+ @cp ${SPLINT_XPTABLES} ${SPLINT_INSTALL_DIR}/cweb/
+ @cp ${SPLINT_XLTABLES} ${SPLINT_INSTALL_DIR}/cweb/
+ @cd ${SPLINT_ROOT}examples/ld && ${MAKE} install
+
+uninstall:
+ @cd ${SPLINT_ROOT}examples/ld && ${MAKE} uninstall
+ @rm -f ${SPLINT_INSTALL_DIR}/tex/*
+ @rm -f ${SPLINT_INSTALL_DIR}/cweb/*
+ @rm -rf ${SPLINT_INSTALL_DIR}/other/texmf/
+
# clean will erase all automatically generated files in the current directory
clean: clean_core
diff --git a/support/splint/README b/support/splint/README
index 9665ca2e7c..56e01e55d4 100644
--- a/support/splint/README
+++ b/support/splint/README
@@ -1,6 +1,6 @@
To make the licensing part clear, SPLinT is GPL v.~3:
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -38,7 +38,6 @@ cweb/* - executables and documentation:
fo.w - parser for the flex grammar
so.w - lexer for the flex grammar
np.w - scanner and parser for token names
- ssffo.w - lexer for state grabbing
mkeparser.w - parser output `driver'
mkscanner.w - lexer output `driver'
splint.w - documentation
@@ -51,7 +50,7 @@ tex/* - \TeX\ macros
xarithm.sty - expandable arithmetic for parsing macros
grabstates.sty - macros for state grabbing
*tokenset.sty - token typesetting definitions
- gindex.sty -generic indexing macros
+ gindex.sty - generic indexing macros
dcols.sty - multiple column output
noweb.sty - noweb style references (local within a page)
limbo.sty - limbo section macros
@@ -85,4 +84,4 @@ VERSION - the current version
The most recent version of this software can be downloaded at
- math.tntech.edu/alex/splint.tar.bz2
+ www.shibakov.org/splint/archive/splint.tar.bz2
diff --git a/support/splint/TODO b/support/splint/TODO
index 95e44e9459..ad8473cb6d 100644
--- a/support/splint/TODO
+++ b/support/splint/TODO
@@ -4,22 +4,32 @@ o Typo and style fixes
... sometime in the future
-o Change generic macro names (such as \table, \symstream, etc) to something more specific
+* Add an `install_macros' (or the like) to makefile.loc to automate macro installation
+ for the parser generated by this package (the parsers and lexers are not separated
+ into different directories, the new targets are `install' and `uninstall')
+* Fix the double column output macros to correctly process the \mark commands (every time
+ an output routine runs it resets the \topmark; this needs to be corrected)
+* Change generic macro names (such as \table) to something more specific (\table will stay
+ but most macro names are unique enough)
+* Add a macro to index arbitrary strings in an arbitrary domain (store the string in a
+ global array and pass the pointer to the indexing macros)
+* Reimplement the action for the bison parser using lists
* Add \bgrulealign and \egrulealign macros to align rules across sections (a simple way to
implement this is given as an example in the included package, a more flexible method would
have to wait)
* Rewrite yytexlex.sty for better \TeX\ pretty printing macros (* the new macros are still
not ideal but are very unlikely to change in the near future)
- o Change the name of the namespace (currently 'index') used by the \TeXx macros to avoid
- confusion with the special '[index]' namespace used by the parser for inserted symbols
- (like an empty right hand side and implicit terms)
+ * Change the name of the namespace (currently `index') used by the \TeXx macros to avoid
+ confusion with the special `[index]' namespace used by the parser for inserted symbols
+ (like an empty right hand side and implicit terms) (`index' has been changed to `index:tex')
o Develop a 'loose' parsing scheme for \TeX\ macros by requiring some macros to
follow stricter rules
* Rewrite limbo.sty to provide a more logical structure (* several changes have been implemented)
* Add indexing features to \TeXx macros (* there is a mechanism to do this)
+o Optimize \yyinput to minimize expansion in the most common cases
o Change CWEB macros so that \pdfoutput=0 does not cause conflicts (this is a bug in cwebmac.tex)
-o Change the support for named references so that the driver generates references while outputting
- the 'action switch' (using code like stack_depth = $$ - $[name])
+* Change the support for named references so that the driver generates references while outputting
+ the 'action switch' (using code like stack_depth = $$ - $[name];* done using `lazy' postprocessing)
... very remote future
diff --git a/support/splint/VERSION b/support/splint/VERSION
index 9084fa2f71..f0bb29e763 100644
--- a/support/splint/VERSION
+++ b/support/splint/VERSION
@@ -1 +1 @@
-1.1.0
+1.3.0
diff --git a/support/splint/cweb/Makefile b/support/splint/cweb/Makefile
index 1c3b4d6bc3..f80b6b5886 100644
--- a/support/splint/cweb/Makefile
+++ b/support/splint/cweb/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2024, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -13,17 +13,30 @@
#
# You should have received a copy of the GNU General Public License
# along with SPLinT. If not, see <http://www.gnu.org/licenses/>.
+docs: splint.pdf
include ../makefile.inc
-all: ${SPLINT_PTABLES} ${SPLINT_LTABLES}
+tables: ${SPLINT_PTABLES} ${SPLINT_LTABLES}
-b%out: mkeparser.c b%.c
- ${CC} ${BISON_STATE} -DPARSER_FILE=\"$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
+bdout bbout bgout \
+bfout:b%out: mkeparser.c b%.c
+ ${CC} ${BISON_STATE} -DPARSER_FILE=\"$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
-b%.yy: bo.x
+bd.yy bg.yy \
+bb.yy bf.yy:b%.yy: bo.u bo.m
${CTANGLE} $<
+bd.yx bg.yx \
+bb.yx bf.yx:%.yx: %.yy
+ ${BRACK} --replace-only --bison-link=bo.m $*.yy $*.yx
+
+bd.y bg.y \
+bb.y bf.y:%.y: %.yx
+ cp -f $^ $@
+
+byytab.tex gyytab.tex \
+dyytab.tex fyytab.tex:\
%yytab.tex: b%out
${SPLINT_DRIVER_DIR}/$< --optimize-actions $@
@@ -33,15 +46,13 @@ ltab.tex: ltout
ltout: mkscanner.c lo_states.h lo.c
${CC} -DLEXER_FILE=\"$(lastword $^)\" -o $@ $<
-ssffo.ll lo.ll: \
-%.ll: %.x
+lo.ll: %.ll: %.x
${CTANGLE} $< && rm $(patsubst %.x, %.c, $^)
fil.ll: so.x
${CTANGLE} $< && rm $(patsubst %.x, %.c, $^)
-fip.yy rep.yy rap.yy \
-ddp.yy: fo.x
+fip.yy rep.yy rap.yy ddp.yy: fo.x
${CTANGLE} $< && rm $(patsubst %.x, %.c, $^)
# flex parser
@@ -52,19 +63,21 @@ fil.c: fil.l
fil_out: mkscanner.c fil_states.h fil.c
${CC} -DLEXER_FILE=\"$(lastword $^)\" -o $@ $<
-fil_states.h: so.tex lstab.tex byytab.tex
- ${PDFTEX} $<
-
filtab.tex: fil_out
${SPLINT_DRIVER_DIR}/$< --optimize-actions --optimize-tables $@
-fip.c rep.c rap.c \
-ddp.c:%.c: %.y
+# state parsing for the \flex\ input scanner
+
+fil_states.h: so.tex ssfstab.tex ddptab.tex ${SPLINT_ROOT}tex/grabstates.sty
+ @echo "Generating state list for the flex lexer ..."
+ @${PDFTEX} $<
+
+fip.c rep.c rap.c ddp.c:%.c: %.y
${BISON} -o $@ $<
fip_out rap_out \
-ddp_out rep_out:%_out: mkeparser.c %.c
- ${CC} ${BISON_STATE} -DPARSER_FILE=\"$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
+ddp_out rep_out:%_out: mkeparser.c %.c
+ ${CC} ${BISON_STATE} -DPARSER_FILE=\"$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
fiptab.tex raptab.tex \
ddptab.tex reptab.tex:%tab.tex: %_out
@@ -74,10 +87,11 @@ so.tex: so.x
${CWEAVE} $<
fo.tex: fo.x
- ${CWEAVE} $<
+ -${CWEAVE} $<
-fo.tok: fo.tex ltab.tex byytab.tex
- ${TEX} ${MODEBOOTSTRAP} \\input $<
+fo.tok: fo.tex ltab.tex dyytab.tex bo.tok
+ @echo "Generating token equivalences for flex input parser ..."
+ @${TEX} ${MODEBOOTSTRAP} \\input $<
lo.c: lo.l
${FLEX} -o $@ $<
@@ -86,10 +100,24 @@ mkscanner.c mkeparser.c: \
%.c: %.w
${CTANGLE} $<
+# bootstrap flex parser
+
+ssfs.ll: so.x
+ ${CTANGLE} $< && rm $(patsubst %.x, %.c, $^)
+
+ssfs.c: ssfs.l
+ ${FLEX} -o $@ $<
+
+ssfs_out: mkscanner.c ssfs.c
+ ${CC} -DLEXER_FILE=\"$(lastword $^)\" -o $@ $<
+
+ssfstab.tex: ssfs_out
+ ${SPLINT_DRIVER_DIR}/$< --optimize-actions --optimize-tables $@
+
# name parser
-smallp_out: mkeparser.c small_parser.c
- ${CC} ${BISON_STATE} -DPARSER_FILE=\"$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
+smallp_out: mkeparser.c small_parser.c
+ ${CC} ${BISON_STATE} -DPARSER_FILE=\"$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
smalll_out: mkscanner.c small_lexer.c
${CC} -DLEXER_FILE=\"$(lastword $^)\" -o $@ $<
@@ -105,71 +133,56 @@ small_lexer.ll: np.x
@${CTANGLE} $<
bo.tex: bo.x
- -${CWEAVE} -x $<
+ -${CWEAVE} -x $< 1>/dev/null
splint.tex \
splint.idx \
splint.scn: splint.x bo.x lo.x fo.x so.x np.x common.w bs.w \
fk.w philosophy.w checklists.w references.w alphas.hx
- -${CWEAVE} $<
+ -${CWEAVE} $< 1>/dev/null
alphas.hx:
- ${MISCCW} --alpha-list --alpha-length=1 $@
-
-ssffo.tex \
-ssffo.idx ssffo.scn: ssffo.x
- ${CWEAVE} $<
+ @${MISCCW} --alpha-list --alpha-length=1 $@
bo.tok: bo.tex ltab.tex byytab.tex
- ${TEX} ${MODEBOOTSTRAP} \\input $<
-
-ssffo.pdf: %.pdf: ${SPLINT_DOC_PREREQS_XREF}
- ${PDFTEX} $*.tex
-
-ssffo.dvi: %.dvi: ${SPLINT_DOC_PREREQS_XREF}
- ${TEX} $*.tex
+ @echo "Making token equivalence tables for the bison parser ..."
+ @${TEX} ${MODEBOOTSTRAP} \\input $< #1>/dev/null
-splint.gdx: %.gdx: ${SPLINT_DOC_PREREQS_XREF}
+splint.gdx splint.aux: ${SPLINT_DOC_PREREQS_XREF}
@echo "Making the bison and TeX indices ..."
- ${PDFTEX} $*.tex
+ @${PDFTEX} splint.tex #1>/dev/null
+
+# remove the implicit rule before building the main index
%.gdy: %.gdx
splint.gdy: splint.gdx
${BINDX} --fine $^ $@
-splint.xxr: %.xxr: ${SPLINT_DOC_PREREQS_XREF}
- @echo "Generating the cross references ..."
- ${PDFTEX} $*.tex
-
-splint.pdf: %.pdf: ${SPLINT_DOC_PREREQS_XREF} %.gdy %.xxr
- ${PDFTEX} \\input $*.tex && touch $*.gdy && touch $*.pdf
+splint.pdf: %.pdf: ${SPLINT_DOC_PREREQS_XREF} %.gdy %.aux
+ @echo "Generating SPLinT documentation (splint.pdf) ..."
+ while test "`diff --new-file splint.pdf /tmp/splint.pdf`"; do \
+ echo "Files differ" && mv splint.pdf /tmp/; \
+ ${PDFTEX} \\input $*.tex && touch $*.gdy && touch $*.pdf; \
+ done
splint.dvi: %.dvi: ${SPLINT_DOC_PREREQS_XREF} %.gdy
- ${TEX} $*.tex && touch $*.gdy && touch $*.dvi && rm $*.xxr && rm $*.ftn
-
-${SPLINT_ROOT}tex/btokenset.sty: # stupid make weirdness
- @
+ @${TEX} $*.tex && touch $*.gdy && touch $*.dvi && rm $*.ftn
# state parsing
-lstabout: mkscanner.c ssffo.c
- ${CC} -DLEXER_FILE=\"$(lastword $^)\" -o $@ $<
-
-lstab.tex: lstabout
- ${SPLINT_DRIVER_DIR}/$< --optimize-actions $@
-
lo.tex: lo.x
${CWEAVE} $<
-lo_states.h: lo.tex lstab.tex byytab.tex
- ${PDFTEX} $<
+lo_states.h: lo.tex ssfstab.tex ddptab.tex ${SPLINT_ROOT}tex/grabstates.sty
+ @echo "Generating state list for the bison lexer ..."
+ @${PDFTEX} $<
# clean will erase all automatically generated files in the current directory
clean: clean_core
- -rm -f ctablesout b?out ltout smallp_out \
- smalll_out lstabout fil_out fip_out rep_out rap_out ddp_out
+ -rm -f ctablesout b?out ltout smallp_out /tmp/splint.pdf \
+ smalll_out ssfs_out fil_out fip_out rep_out rap_out ddp_out
include ${SPLINT_ROOT}makefile.loc
@@ -178,9 +191,9 @@ include ${SPLINT_ROOT}makefile.loc
# of bo.tok, lo.tex, eventually leading to remaking of splint.pdf;
# the special target below tells make to treat bg.yy as if it were not an intermediate file
-.PRECIOUS: %.yy bo.tok fo.tok %.ll b%.y splint.gdx splint.xxr
+.PRECIOUS: %.yy bo.tok fo.tok %.ll b%.y splint.gdx
# the files below appear as targets but are really intermediaries for other files
-.INTERMEDIATE: smallp_out smalll_out lstabout ltout fil_out \
+.INTERMEDIATE: smallp_out smalll_out ssfs_out ltout fil_out \
fip_out rep_out rap_out ddp_out splint.gdx
diff --git a/support/splint/cweb/bo.w b/support/splint/cweb/bo.w
index fe7bf59f52..630602559e 100644
--- a/support/splint/cweb/bo.w
+++ b/support/splint/cweb/bo.w
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% Copyright 2002-2014 Free Software Foundation, Inc.
% This file is part of SPLinT
%
@@ -24,6 +24,20 @@
\fi
@**The \eatone{bison}\bison\ parser stack.
+{%
+\newdimen\halfhsize
+\newdimen\preskip
+\halfhsize=\hsize
+\divide\halfhsize by2
+\def\mypar{%
+\parshape 6
+0pt \hsize
+0pt \hsize
+0pt \hsize
+0pt \hsize
+0pt \hsize
+\halfhsize \halfhsize
+}%
The input language for \bison\ loosely follows the {\sc BNF} notation, with
a few enhancements, such as the syntax for {\em actions}, to implement
the syntax-directed translation@^syntax-directed translation@>, as
@@ -33,8 +47,8 @@ On the one hand, the language is relatively easy to handle, is
nearly whitespace agnostic, on the other, a primitive parser is
required for some basic setup even at a very early stage, so the
design must be carefully thought out. This {\em
-bootstrapping\/}@^bootstrapping@> step is discussed in more details
-later on.
+bootstrapping\/}@^bootstrapping@> step is discussed in more detail
+further down.
The path chosen here is by no means optimal. What it lacks in
efficiency, though, it may amply gain in practicality, as we reuse the
@@ -47,13 +61,13 @@ As was described in the
stacks \endlink\fi@^parser stack@> above, to pretty print a variety
of grammar fragments, one may employ
a {\em parser stack\/} derived from the original grammar. The most
-natural and common unit of a \bison\ grammar is a set of
+common unit of a \bison\ grammar is a set of
productions. It is thus natural to begin our discussion of the parsers
in the \bison\ stack with the parser responsible for processing
individual rules.
-One should note that the productions below are not concerned with the
-typesetting of the grammar. Instead this task is delegated to the
+One should note that the productions below are not directly concerned with the
+typesetting of the grammar. Instead, this task is delegated to the
macros in \.{yyunion.sty} and its companions. The first pass of the
parser merely constructs an `executable abstract syntax tree' (or
\EAST\footnote{One may argue that \EAST\ is still merely a syntactic
@@ -61,7 +75,11 @@ construct requiring a proper macro framework for its execution and
should be called a `weak executable syntax tree' or \WEST. This
acronym extravagnza is heading south so we shall stop here.}) which
can serve very diverse purposes: from collecting token declarations in
-the boostrapping pass to typesetting the grammar rules.
+the boostrapping pass to typesetting the grammar rules. This allows for a
+great deal of flexibility in where and when the parsing results are
+used. A clear divide between the parsing step and the typesetting step
+provides for better debugging facilities, as well as more reliable
+macro design.
It would be impossible to completely avoid the question of the visual
presentation of the \bison\ input, however. It has already been
@@ -72,14 +90,23 @@ variety of typographic devices that take advantage of the meaningful
positioning of text on the page: skips, indents, etc. Therefore, the
macros for \bison\ pretty printing trade a number of \bison\ syntax
elements (such as \.{\yl}, \.{;}, action braces, etc.) for the careful
-placement of each fragment of the input on the page.
+placement of each fragment of the input on the page. The syntax tree
+generated by the parsers in the \bison\ stack is not fully {\em faithful\/} in
+that it does not preserve every syntactic element from the original input.
+Thus, e.g.\ optional semicolons (\prodstyle{semi.opt}) never find their way into
+the tree and their original position is lost\footnote{The opposite is true about
+the {\em whitespace\/} the parser sees (or {\em stash\/} as it is called
+in this document): all of it is carefully packaged into streams, as was described
+\locallink{parser.streams}earlier\endlink.}.
Let's take a short break for a broad overview of the input file.
The basic structure is that of an ordinary \bison\ file that produces
plain \Cee\ output. The \Cee\ actions, however, are programmed to output \TeX.
The \bison\ sections (separated by \.{\%\%} (shown (pretty printed)
as \prodstyle{\%\%} below)) appear between the successive dotted lines.
-
+A number of sections are empty, since the generated \Cee\ is rather trivial.
+}%
+%\checktabletrue
@(bg.yy@>=
@G Switch to generic mode.
%{@> @<Grammar parser \Cee\ preamble@> @=%}
@@ -94,11 +121,13 @@ as \prodstyle{\%\%} below)) appear between the successive dotted lines.
%%
@g
-@ Bootstrap\namedspot{bootstrapping}@^bootstrapping@> mode is next.
-The reason for a separate bootstrap parser is to
-collect the minimal amount of information to `spool up' the `production'
-parsers. To understand the mechanics and the reasons behind it, consider what happens
-following a declaration such as \.{\%token TOKEN "token"}
+@*1 Bootstrapping.
+%\checktablefalse
+Bootstrap\namedspot{bootstrapping}@^bootstrapping@> parser is
+defined next. The purpose of the bootstrapping parser is to
+collect a minimal amount of information to `spool up' the `production'
+parsers. To understand its inner workings and the reasons behind it,
+consider what happens following a declaration such as \.{\%token TOKEN "token"}
(or, as it would be typeset by the macros in this package
`\prodstyle{\%token} \.{TOKEN} \.{token}'; see the index entries for
more details)%
@@ -119,8 +148,8 @@ equivalences or find some other means to find out the numerical values
of the tokens.
One approach is to parse the file containing the {\it declarations\/}
-and extract the equivalences between the names from it. This is the
-function of the bootstrap parser. Since the lexer is reused, some
+and extract the equivalences between the names from it. This is
+precisely the function of the bootstrap parser. Since the lexer is reused, some
token values need to be known in advance (and the rest either ignored
or replaced by some `made up' values). These tokens are `hard coded'
into the parser file generated by \bison\ and output using a special
@@ -145,25 +174,43 @@ which it would need a parser for a subset of \bison\ syntax $\ldots$
it is a genuine `chicken and egg' problem). Hence the need for
`bootstrap'. Once a functional parser for a large enough subset of the
\bison\ input grammar is operational, {\it it\/} can be used to pair
-up the token names.
-
-The second function of the bootstrap parser is to collect information
-about the scanner's states. The mechanism is slightly different for
-states. While the token equivalences are collected purely in
-`\TeX\ mode', the bootstrap parser collects all the state names into a
+up the token names. The bootstrap parser is not strictly minimal in that
+it is also capable of parsing the \prodstyle{\%nterm} declarations.
+This ability is not utilized by the parsers in \splint, however (nor
+is the accompanying bootstrap lexer designed to output the
+\prodstyle{\%nterm} tokens), and was added for the scenarios other
+than bootstrapping.
+
+The second, perhaps even more important function of the bootstrap process
+is to collect information about the scanner's states. The mechanism
+is slightly different from that for token definition gathering.
+While the token equivalences are collected purely in
+`\TeX\ mode', the bootstrap mode parser collects all the state names into a
special \Cee\ header file. The reason is simple: unlike the token
values, the numerical values of the scanner states are not passed to
-the `driver' program in any data structure and are instead defined as
-ordinary macros. The header file is the information the `driver' file
-needs to output the state values.
-
-An additional subtlety in the case of the state value output is that the
-main lexer for the \bison\ grammar utilizes states extensively and thus
-cannot be easily used with the bootstrap parser before the state
-values are known. The solution is to substitute a very simple scanner barely
-capable of lexing state declarations. Such a scanner is implemented
-in \.{ssffo.w} (the somewhat cryptic name stands for `{\bf s}imple {\bf s}canner
-{\bf f}or {\bf f}lex {\bf o}ptions').
+the `driver' program in any data structure (the |yytname| array) and are instead defined as
+ordinary (\Cee) macros. The header file is the information the `driver' file
+needs to output the state values for the use by the lexer.
+
+Naturally, to accomplish their task, the lexer and the parser emplyed in
+state gathering need the state and token information, as well. Fortunately,
+the parser is a subset of the \flex\ input parser that does not define
+any `string' names for it tokens. Similarly, the lexer collects all the necessary
+tokens in the \flexsnstyle{INITIAL} state\footnote{An additional subtlety is
+the necessity to gracefully handle (and, in some cases, cause) the multiple
+possible {\em failures\/} for which the lexer redefines \inlineTeXx{/yyBEGIN}\
+to fail immediately when attempting to switch states. Note that the bootstrap
+mode parser looks at sections other than those where the declarations reside
+and must fail quickly and quietly in such cases.}.
+
+To reiterate a point made in the middle of this section, the bootstrapping
+process described here is necessary to `spool up' the \bison\ and \flex\ input parsers.
+A simpler procedure may be followed while designing other custom parsers where
+the programmer uses, say the full \bison\ parser to collect information about
+the token equivalences (whether such information is needed to make the parser operational
+or just to facilitate the typesetting of the token names). By adding custom
+`bootstrapping' macros to the ones defined in \.{yyunion.sty}, a number of different
+preprocessing tasks can be accomplished.
@(bb.yy@>=
@G Switch to generic mode.
%{
@@ -177,13 +224,11 @@ in \.{ssffo.w} (the somewhat cryptic name stands for `{\bf s}imple {\bf s}canner
%%
@> @<Fake start symbol for bootstrap grammar@> @=
@> @<Parser bootstrap productions@> @=
- @> @<\flex\ options parser productions@> @=
- @> @<List of symbols@> @=
- @> @<Definition of \prodstyle{symbol}@> @=
%%
@g
-@ The prologue parser is responsible for parsing various grammar
+@*1 Prologue and full parsers.
+The prologue parser is responsible for parsing various grammar
declarations as well as parser options.
@(bd.yy@>=
@G Switch to generic mode.
@@ -201,7 +246,12 @@ declarations as well as parser options.
@ The full \bison\ input parser is used when a complete \bison\ file is
expected. It is also capable of parsing a `skeleton' of such a file,
-similar to the one that follows this paragraph.
+similar to the one that follows this paragraph. As a stopgap measure,
+the skeleton of a \flex\ scanner is also parsed by this parser, as they have
+an almost identical structure. This is not a perfect arrangement, however, since
+it precludes one from putting the constructs that this parser does not
+recognize into the outline. To give an example, one cannot put \flex\ specific
+options into such `skeleton'.
@(bf.yy@>=
@G Switch to generic mode.
%{@> @<Grammar parser \Cee\ preamble@> @=%}
@@ -227,7 +277,7 @@ parsing algorithm to be used (provided the supplied grammar is in the
appropriate class): {\sc LALR}($n$), {\sc LR}($n$), {\sc GLR}, etc.
The default is to use the {\sc LALR}($1$) algorithm (with the
corresponding assumption about the grammar) which can also be set
-explicitly by putting
+explicitly by putting\gtextidx{\bison\ options example}{bison options example}{\bisonidxdomain}%
\medskip
\beginprod
\%define lr.type canonical-lr
@@ -259,7 +309,6 @@ special bootstrapping parser as explained earlier.
\iffalse
\checktrailingstashtrue % see what is left at the end
\checktabletrue % display the table
- \let\stashnext\stashnextwithnothing % collect the stash expanded
\fi
@<Tokens and types for the grammar parser@>=
@G
@@ -289,7 +338,6 @@ the original parser.
\iffalse
\checktrailingstashfalse
\checktablefalse
- \let\stashnext\stashnextwithnothingnx
\fi
@<Global Declarations@>=
@G
@@ -339,17 +387,6 @@ the original parser.
%token <param> PERCENT_PARAM "%param";
@g
-@ \namedspot{flex.options}Extra tokens for typesetting \flex\ state
-declarations and options are declared in addition to the ones that a
-standard \bison\ parser recognizes. This extension of the original
-grammar has become unnecessary with the addition of the \flex\ input
-parser(s) but is left as part of the extended grammar for convenience and
-`historical' reasons.
-@<Tokens and...@>=
-@G
-%token FLEX_OPTION FLEX_STATE_X FLEX_STATE_S
-@g
-
@*1 Grammar productions.
We are ready to describe the top levels of the parse tree. The first
`sub parser' we consider is a `full' parser, that is the parser that
@@ -373,10 +410,15 @@ parser on the stack.
@t}\vb{\inline}{@>
input:
prologue_declarations
- "%%" grammar epilogue.opt {@> TeX_( "/getsecond{/yy(3)}/to/table" ); @=}
+ "%%" grammar epilogue.opt {@> @<Extract the grammar from a full file@> @=}
;
@g
+@ @<Extract the grammar from a full file@>=
+ @[TeX_( "/finishlist{/expandafter/yyfirstoftwo/the/yy(3)}" );@]@; /* complete the list */
+ @[TeX_( "/table/expandafter{/romannumeral0" );@]@;
+ @[TeX_( " /executelistat{/expandafter/yyfirstoftwo/the/yy(3)}{0}}" );@]@;
+
@ Another subgrammar deals with the syntax of isolated \bison\ rules. This is
the most commonly used `subparser' since a rules cluster is the most
natural `unit' to include in a \CWEB\ file.
@@ -384,10 +426,15 @@ natural `unit' to include in a \CWEB\ file.
@G
@t}\vb{\inline}{@>
input:
- grammar epilogue.opt {@> TeX_( "/getsecond{/yy(1)}/to/table" ); @=}
+ grammar epilogue.opt {@> @<Save the grammar@> @=}
;
@g
+@ @<Save the grammar@>=
+ @[TeX_( "/finishlist{/expandafter/yyfirstoftwo/the/yy(1)}" );@]@; /* complete the list */
+ @[TeX_( "/table/expandafter{/romannumeral0" );@]@;
+ @[TeX_( " /executelistat{/expandafter/yyfirstoftwo/the/yy(1)}{0}}" );@]@;
+
@ The bootstrap parser has a very narrow set of goals: it is concerned
with \prodstyle{\%token} declarations only in
order to supply the token information to the lexer (since, as noted
@@ -395,7 +442,7 @@ above, such information is not kept in the |yytname| array).
The parser can also parse \prodstyle{\%nterm} declarations but the
bootstrap lexer ignores the \prodstyle{\%nterm} token, since the
\bison\ grammar does not use one.
-It also extends the syntax of a \prodstyle{grammar\_declaration} by allowing a
+It also extends the syntax of a \prodstyle{grammar_declaration} by allowing a
declaration with or without a semicolon at the end (the latter is only
allowed in the prologue). This works since the token declarations have
been carefully separated from the rest of the grammar in different
@@ -410,11 +457,8 @@ input:
@t}\vb{\resetf}{@>
grammar_declarations:
symbol_declaration semi.opt {@> @<Carry on@> @=}
-| flex_declaration semi.opt {@> @<Carry on@> @=}
| grammar_declarations
symbol_declaration semi.opt {@> TeX_( "/yy0{/the/yy(1)/the/yy(2)}" ); @=}
-| grammar_declarations
- flex_declaration semi.opt {@> TeX_( "/yy0{/the/yy(1)/the/yy(2)}" ); @=}
;
@t}\vb{\inline\flatten}{@>
semi.opt: {} | ";" {};
@@ -429,35 +473,42 @@ is undocumented so we supply an explicit action in each case.
@ Next comes a subgrammar for processing prologue declarations. Finer
differentiation is possible but the `subparsers' described here work
pretty well and impose a mild style on the grammar writer. Note that
-these roles are not part of the official \bison\ input grammar and are
+these rules are not part of the official \bison\ input grammar and are
added to make the typesetting of `file outlines' (e.g.~|@(bb.yy@>|
above) possible.
@<Fake start symbol for prologue grammar@>=
@G
@t}\vb{\inline}{@>
input:
- prologue_declarations epilogue.opt {@> TeX_( "/getsecond{/yy(1)}/to/table" ); @=}
+ prologue_declarations epilogue.opt {@> @<Save the declarations@> @=}
| prologue_declarations
- "%%" "%%" EPILOGUE {@> TeX_( "/getsecond{/yy(1)}/to/table" ); @=}
+ "%%" "%%" EPILOGUE {@> @<Save the declarations@> @=}
| prologue_declarations
- "%%" "%%" {@> TeX_( "/getsecond{/yy(1)}/to/table" ); @=}
+ "%%" "%%" {@> @<Save the declarations@> @=}
;
@g
+@ @<Save the declarations@>=
+ @[TeX_( "/finishlist{/expandafter/yyfirstoftwo/the/yy(1)}" );@]@; /* complete the list */
+ @[TeX_( "/table/expandafter{/romannumeral0" );@]@;
+ @[TeX_( " /executelistat{/expandafter/yyfirstoftwo/the/yy(1)}{0}}" );@]@;
+
@ {\it Declarations: before the first \prodstyle{\%\%}}. We are now
-ready to deal with the specifics of the declarations themselves. The
-\.{\\grammar} macro is a `structure', whose first `field' is the
-grammar itself, whereas the second carries the type of the last
-declaration added to the grammar.
+ready to deal with the specifics of the declarations themselves.
@<Parser prologue productions@>=
@G
prologue_declarations:
- {@> TeX_( "/yy0{/nx/grammar{}{/nx/empty}}" ); @=}
+ {@> @<Start with an empty list of declarations@> @=}
| prologue_declarations
prologue_declaration {@> @<Attach a prologue declaration@> @=}
;
@g
+@ @<Start with an empty list of declarations@>=
+ @[TeX_( "/initlist{/prologuedeclarationsprefix prologue_declarations}" );@]@;
+ @[TeX_( "/yy0{{/prologuedeclarationsprefix prologue_declarations}{/nx/empty}}" );@]@;
+ @[TeX_( "/edef/prologuedeclarationsprefix{./prologuedeclarationsprefix}" );@]@;
+
@ @<Attach a prologue declaration@>=
@<Attach a productions cluster@>@;
@@ -466,6 +517,7 @@ prologue. The scanner returns the `stream pointers' for all the
keywords so the declaration `structures' pass on those pointers to the
grammar list. The original syntax has been left intact even though for
the purposes of this parser some of the inline rules are unnecessary.
+\eraselocalformattrue
@<Parser prologue productions@>=
@G
prologue_declaration:
@@ -474,10 +526,13 @@ prologue_declaration:
| "%<flag>" {@> TeX_( "/yy0{/nx/optionflag/the/yy(1)}" ); @=}
| "%define" variable value {@> TeX_( "/yy0{/nx/vardef{/the/yy(2)}{/the/yy(3)}/the/yy(1)}" ); @=}
| "%defines" {@> TeX_( "/yy0{/nx/optionflag{defines}{}/the/yy(1)}" ); @=}
-| "%defines" STRING {@> @[TeX_( "/toksa{defines}" );@]@+@<Prepare one parametric option@> @=}
+| "%defines" STRING {@> @t}\vb{\stashed{\Xmark prologue.decls:\Xmark}}{@> @=
+ @> @[TeX_( "/toksa{defines}" );@]@+@<Prepare one parametric option@> @=}
| "%error-verbose" {@> TeX_( "/yy0{/nx/optionflag{error verbose}{}/the/yy(1)}" ); @=}
-| "%expect" INT {@> @[TeX_( "/toksa{expect}" );@]@+@<Prepare a generic one parametric option@> @=}
-| "%expect-rr" INT {@> @[TeX_( "/toksa{expect-rr}" );@]@+@<Prepare a generic one parametric option@> @=}
+| "%expect" INT {@> @t}\vb{\stashed{\Xmark prologue.decls(g):\Xmark}}{@> @=
+ @> @[TeX_( "/toksa{expect}" );@]@+@<Prepare a generic one parametric option@> @=}
+| "%expect-rr" INT {@> @t}\vb{\stashed{\Xmark prologue.decls(g):\Xmark}}{@> @=
+ @> @[TeX_( "/toksa{expect-rr}" );@]@+@<Prepare a generic one parametric option@> @=}
| "%file-prefix" STRING {@> @[TeX_( "/toksa{file prefix}" );@]@+@<Prepare one parametric option@> @=}
| "%glr-parser" {@> TeX_( "/yy0{/nx/optionflag{glr parser}{}/the/yy(1)}" ); @=}
| "%initial-action" "{...}" {@> TeX_( "/yy0{/nx/initaction/the/yy(2)}" ); @=}
@@ -485,12 +540,14 @@ prologue_declaration:
| "%name-prefix" STRING {@> @[TeX_( "/toksa{name prefix}" );@]@+@<Prepare one parametric option@> @=}
| "%no-lines" {@> TeX_( "/yy0{/nx/optionflag{no lines}{}/the/yy(1)}" ); @=}
| "%nondeterministic-parser" {@> TeX_( "/yy0{/nx/optionflag{nondet. parser}{}/the/yy(1)}" ); @=}
-| "%output" STRING {@> @[TeX_( "/toksa{output}" );@]@+@<Prepare one parametric option@> @=}
+| "%output" STRING {@> @t}\vb{\stashed{\Xmark prologue.decls:\Xmark}}{@> @=
+ @> @[TeX_( "/toksa{output}" );@]@+@<Prepare one parametric option@> @=}
@t}\vb{\flatten}{@>
-| "%param" {}
+| "%param" {@> @t}\vb{\stashed{\rm (we simply return pointers below)}}{@> @=}
params {@> TeX_( "/yy0{/nx/paramdef{/the/yy(3)}/the/yy(1)}" ); @=}
@t}\vb{\fold}{@>
-| "%require" STRING {@> @[TeX_( "/toksa{require}" );@]@+@<Prepare one parametric option@> @=}
+| "%require" STRING {@> @t}\vb{\stashed{\Xmark prologue.decls:\Xmark}}{@> @=
+ @> @[TeX_( "/toksa{require}" );@]@+@<Prepare one parametric option@> @=}
| "%skeleton" STRING {@> @[TeX_( "/toksa{skeleton}" );@]@+@<Prepare one parametric option@> @=}
| "%token-table" {@> TeX_( "/yy0{/nx/optionflag{token table}{}/the/yy(1)}" ); @=}
| "%verbose" {@> TeX_( "/yy0{/nx/optionflag{verbose}{}/the/yy(1)}" ); @=}
@@ -507,69 +564,22 @@ params:
@ This is a typical parser action: encapsulate the `type' of the
construct just parsed and attach some auxiliary info, in this case the
stream pointers.
+\eraselocalformatfalse
+\smallskip
+\rulereferencex{\showlastactionfalse}{\nx\inline\nx\flatten}{prologue.decls}
+\smallskip
+\noindent The productions above are typical examples.
@<Prepare one parametric option@>=
@[TeX_( "/yy0{/nx/oneparametricoption{/the/toksa}{/nx/stringify/the/yy(2)}/the/yy(1)}" );@]@;
-@ @<Prepare a generic one parametric option@>=
+@ A variation on the theme above where the parameter is not a \prodstyle{STRING}.
+\smallskip
+\rulereferencex{\showlastactionfalse}{\nx\inline\nx\flatten}{prologue.decls(g)}
+\smallskip
+\noindent A sample of the rules to which the code below applies are given above.
+@<Prepare a generic one parametric option@>=
@[TeX_( "/yy0{/nx/oneparametricoption{/the/toksa}{/the/yy(2)}/the/yy(1)}" );@]@;
-@ These rules handle extra declarations to typeset \flex\ options and
-declarations. These are not part of the \bison\ syntax but their
-structure is similar enough that they can be included in the
-grammar. As was pointed out \locallink{flex.options}earlier \endlink
-the addition of the \flex\ input parser to \splint\ made this
-extension of the original \bison\ grammar obsolete but it was kept as
-part of the extended grammar for convenience and `historical'
-reasons. The convenience results from simplifying the bootstrap
-procedure by using a single parser.
-@<Parser prologue productions@>=
-@G
-prologue_declaration:
- flex_declaration {@> @<Carry on@> @=}
-;
-@g
-@<\flex\ options parser productions@>@;
-
-@ The syntax of \flex\ options was extracted from \flex\ documentation
-so it is not guaranteed to be correct.
-@<\flex\ options parser productions@>=
-@G
-flex_declaration:
- FLEX_OPTION flex_option_list {@> @<Define \flex\ option list@> @=}
-| flex_state symbols.1 {@> @<Define \flex\ states@> @=}
-;
-
-flex_state:
- FLEX_STATE_X {@> TeX_( "/yy0{/nx/flexxstatedecls/the/yy(1)}" ); @=}
-| FLEX_STATE_S {@> TeX_( "/yy0{/nx/flexsstatedecls/the/yy(1)}" ); @=}
-;
-
-flex_option_list:
- flex_option {@> @<Carry on@> @=}
-| flex_option_list flex_option {@> @<Add a \flex\ option@> @=}
-;
-
-flex_option:
- ID {@> TeX_( "/yy0{/nx/flexoptionpair{/nx/idit/the/yy(1)}{}}" ); @=}
-| ID "=" symbol {@> TeX_( "/yy0{/nx/flexoptionpair{/nx/idit/the/yy(1)}{/the/yy(3)}}" ); @=}
-;
-@g
-
-@ @<Define \flex\ option list@>=
- @[TeX_( "/yy0{/nx/flexoptiondecls{/the/yy(2)}/the/yy(1)}" );@]@;
-
-@ @<Define \flex\ states@>=
- @[TeX_( "/getfirst{/yy(1)}/to/toksa" );@]@;
- @[TeX_( "/getsecond{/yy(1)}/to/toksb" );@]@;
- @[TeX_( "/getthird{/yy(1)}/to/toksc" );@]@;
- @[TeX_( "/yy0{/the/toksa{/the/yy(2)}{/the/toksb}{/the/toksc}}" );@]@;
-
-@ @<Add a \flex\ option@>=
- @[TeX_( "/getsecond{/yy(2)}/to/toksa" );@]@; /* the identifier */
- @[TeX_( "/getfourth{/toksa}/to/toksb" );@]@; /* the format pointer */
- @[TeX_( "/getfifth{/toksa}/to/toksc" );@]@; /* the stash pointer */
- @[TeX_( "/yy0{/the/yy(1)/nx/hspace{/the/toksb}{/the/toksc}/the/yy(2)}" );@]@;
-
@ {\it Grammar declarations}. These declarations can appear in both
the prologue and the rules sections. Their treatment is very similar to
the prologue-only options.
@@ -578,7 +588,8 @@ the prologue-only options.
grammar_declaration:
precedence_declaration {@> @<Carry on@> @=}
| symbol_declaration {@> @<Carry on@> @=}
-| "%start" symbol {@> @[TeX_( "/toksa{start}" );@]@+@<Prepare a generic one parametric option@> @=}
+| "%start" symbol {@> @t}\vb{\stashed{\Xmark prologue.decls(g):\Xmark}}{@> @=
+ @> @[TeX_( "/toksa{start}" );@]@+@<Prepare a generic one parametric option@> @=}
| code_props_type "{...}" generic_symlist {@> @<Assign a code fragment to symbols@> @=}
| "%default-prec" {@> TeX_( "/yy0{/nx/optionflag{default prec.}{}/the/yy(1)}" ); @=}
| "%no-default-prec" {@> TeX_( "/yy0{/nx/optionflag{no default prec.}{}/the/yy(1)}" ); @=}
@@ -617,7 +628,6 @@ union_name:
grammar_declaration:
"%union" union_name "{...}" {@> @<Prepare union definition@> @=}
;
-
symbol_declaration:
"%type" TAG symbols.1 {@> @<Define symbol types@> @=}
;
@@ -637,6 +647,7 @@ tag.opt:
{@> TeX_( "/yy0{}" ); @=}
| TAG {@> @<Prepare a \prodstyle{TAG}@> @=}
;
+@t}\vb{\insertraw{\beginfoldedsections}}{@>
@g
@ @<Prepare union definition@>=
@@ -644,6 +655,7 @@ tag.opt:
@ @<Define symbol types@>=
@[TeX_( "/yy0{/nx/typedecls{/nx/tagit/the/yy(2)}{/the/yy(3)}/the/yy(1)}" );@]@;
+@t}\endfoldedsections{@>
@ @<Define symbol precedences@>=
@[TeX_( "/getthird{/yy(1)}/to/toksa" );@]@; /* format pointer */
@@ -677,7 +689,9 @@ symbol_declaration:
@ {\it Just like \prodstyle{symbols.1} but accept \prodstyle{INT} for
the sake of \POSIX}. Perhaps the only point worth mentioning here is
-the inserted separator (\.{\\hspace\{}$p_0$\.{\}\{}$p_1$\.{\}},
+the inserted separator (%
+\texrefx{/hspace}{other}%
+\.{\{}$p_0$\.{\}\{}$p_1$\.{\}},
typeset as
|TeXa("/hspace"); TeXao(@t\TeXlit"\{\hbox{$p_0$}\}\{\hbox{$p_1$}\}\hbox{$\!$}"@>);|).
@q A string "..." is a syntactic unit in \CWEB\ so it is impossible@>
@@ -700,22 +714,16 @@ symbol.prec:
;
@g
-@ {\it One or more symbols to be \prodstyle{\%type}'d}. The |@<List of
-symbols@>| rules below are reused in the boostrap parser and are put
-in a separate section for this reason.
+@ {\it One or more symbols to be \prodstyle{\%type}'d}.
@<Parser common productions@>=
- @<List of symbols@>@;
-
-@ @<List of symbols@>=
@G
+%type <intval> symbols.1 symbol;
+
symbols.1:
symbol {@> @<Carry on@> @=}
-| symbols.1 symbol {@> TeX_( "/yy0{/the/yy(1)/nx/hspace{0}{0}/the/yy(2)}" ); @=}
+| symbols.1 symbol {@> TeX_( "/yy0{/the/yy(1)/nx/hspace{0}{0}/the$[symbol]}" ); @=}
;
-@g
-@ @<Parser common productions@>=
-@G
generic_symlist:
generic_symlist_item {@> @<Carry on @> @=}
| generic_symlist generic_symlist_item {@> TeX_( "/yy0{/the/yy(1)/nx/hspace{0}{0}/the/yy(2)}" ); @=}
@@ -772,42 +780,50 @@ grammar:
;
@g
-@ {\it As a \bison\ extension, one can use the grammar declarations in the
+@*2 Rules syntax. {\it As a \bison\ extension, one can use the grammar declarations in the
body of the grammar}. What follows is the syntax of the right hand
-side of a grammar rule.
+side of a grammar rule. The type declarations for various non-terminals are used exclusively
+by the postprocessor whenever the `native' \bison\ term references are used (see elsewhere
+for details).
@<Parser grammar productions@>=
@G
+%type <intval> rhs id_colon named_ref.opt rhses.1 "|";
+
rules_or_grammar_declaration:
- rules {@> @<Add a productions cluster@> @=}
+ rules {@> @<Form a productions cluster@> @=}
| grammar_declaration ";" {@> @<Carry on@> @=}
| error ";" {@> TeX_( "/errmessage{parsing error!}" ); @=}
;
@t}\vb{\flatten\inline}{@>
rules:
- id_colon named_ref.opt {@> TeX_( "/relax" ); @=}
+ id_colon named_ref.opt {@> @t}\vb{\stashed{\rm (we simply return pointers below)}}{@> @=}
rhses.1 {@> @<Complete a production@> @=}
;
@t}\vb{\resetf}{@>
rhses.1[o]:
rhs {@> @<Start the right hand side@> @=}
-| rhses.1[a] "|"[b] {@> @<Insert local formatting@> @=}[c]
+| rhses.1[rhses] "|"[mid] {@> @<Insert local formatting@> @=}[c]
rhs[d] {@> @<Add a right hand side to a production@> @=}
-| rhses.1 ";" {@> @<Add an optional semicolon@> @=}
+| rhses.1 ";" {@> @<Carry on@> @=}
;
@g
@ The next few actions describe what happens when a left hand side is
attached to a rule.
@<Start with a production cluster@>=
- @[TeX_( "/getfirst{/yy(1)}/to/toksa" );@]@;
- @[TeX_( "/yy0{/nx/grammar{/the/yy(1)}{/the/toksa}}" );@]@;
+ @[TeX_( "/initlist{/grammarprefix grammar}" );@]@;
+ @[TeX_( "/getfirst{/yy(1)}/to/toksa" );@]@; /* type of the last addition */
+ @[TeX_( "/yy0{{/grammarprefix grammar}{/the/toksa}}" );@]@;
+ @[TeX_( "/appendtolistx{/grammarprefix grammar}{/the/yy(1)}" );@]@;
+ @[TeX_( "/edef/grammarprefix{./grammarprefix}" );@]@;
@ @<Attach a productions cluster@>=
- @[TeX_( "/getthird{/yy(1)}/to/toksa" );@]@; /* type of the last rule */
- @[TeX_( "/getsecond{/yy(1)}/to/toksc" );@]@; /* accumulated rules */
+ @[TeX_( "/getsecond{/yy(1)}/to/toksa" );@]@; /* type of the last rule */
+ @[TeX_( "/getfirst{/yy(1)}/to/toksc" );@]@; /* pointer to the accumulated rules */
@[TeX_( "/getfirst{/yy(2)}/to/toksb" );@]@; /* type of the new rule */
@[TeX_( "/let/default/positionswitchdefault" );@]@;
@[TeX_( "/switchon{/the/toksb}/in/positionswitch" );@]@; /* determine the position of the first token in the group */
+ @; /* determine the spacing between sections */
@[TeX_( "/edef/next{/the/toksa}" );@]@;
@[TeX_( "/edef/default{/the/toksb}" );@]@; /* reuse \.{\\default} */
@[TeX_( "/ifx/next/default" );@]@;
@@ -818,9 +834,10 @@ attached to a rule.
@[TeX_( " /let/default/separatorswitchdefaultneq" );@]@;
@[TeX_( " /switchon{/the/toksa}/in/separatorswitchneq" );@]@;
@[TeX_( "/fi" );@]@;
- @[TeX_( "/yy0{/nx/grammar{/the/toksc/the/postoks/the/toksd/the/yy(2)}{/the/toksb}}" );@]@;
+ @[TeX_( "/appendtolistx{/the/toksc}{/the/postoks/the/toksd/the/yy(2)}" );@]@;
+ @[TeX_( "/yy0{{/the/toksc}{/the/toksb}}" );@]@;
-@ @<Add a productions cluster@>=
+@ @<Form a productions cluster@>=
@[TeX_( "/getsecond{/yy(1)}/to/toksa" );@]@; /* \.{\\prodheader} */
@[TeX_( "/getsecond{/toksa}/to/toksb" );@]@; /* \.{\\idit} */
@[TeX_( "/getfourth{/toksb}/to/toksc" );@]@; /* format stream pointer */
@@ -828,90 +845,152 @@ attached to a rule.
@[TeX_( "/getthird{/yy(1)}/to/toksb" );@]@; /* \.{\\rules} */
@[TeX_( "/yy0{/nx/oneproduction{/the/toksa/the/toksb}{/the/toksc}{/the/toksd}}" );@]@;
-@ @<Complete a production@>=
- @[TeX_( "/getfourth{/yy(1)}/to/toksa" );@]@; /* format stream pointer */
- @[TeX_( "/getfifth{/yy(1)}/to/toksb" );@]@; /* stash stream pointer */
- @[TeXb( "/yy0{/nx/pcluster{/nx/prodheader{/the/yy(1)}{/the/yy(2)}" );@]@;
- @[TeXao( "{/the/toksa}{/the/toksb}}{/the/yy(4)}}" );@]@;
+@ Several productions for a given nonterminal are collected in a `production cluster':
+\smallskip
+\thisrulereference{}%
+\smallskip
+\noindent The inline action does nothing at the moment and is omitted in the main text.
+@<Complete a production@>=
+ @[TeX_( "/getfourth{$[id_colon]}/to/toksa" );@]@; /* format stream pointer */
+ @[TeX_( "/getfifth{$[id_colon]}/to/toksb" );@]@; /* stash stream pointer */
+ @[TeX_( "/finishlist{/the$[rhses.1]}" );@]@; /* complete the list of rules */
+ @[TeXb_( "/yy0{/nx/pcluster{/nx/prodheader{/the$[id_colon]}{/the$[named_ref.opt]}" );@]@;
+ @[TeXfo_( " {/the/toksa}{/the/toksb}}{/nx/rules{/nx/executelist{/the$[rhses.1]}}}}" );@]@;
@ It is important to format the right hand side properly, since we
would like to indicate that an action is inlined by an
-indentation. The `format' of the \.{\\rhs} `structure' includes the
-stash pointers and a `boolean' to indicate whether the right hand side ends
-with an action. Since the action can be implicit, this decision has to
-be postponed until, say, a semicolon is seen.
-No formatting or stash pointers are added for implicit actions.
+indentation.
+\smallskip
+\thisrulereference{\nx\inline\nx\flatten}
+\smallskip
+\noindent The `layout' of the \texref{/rhs} `structure' includes
+a `boolean' to indicate whether the right hand side ends with an action. Since
+the action can be implicit, this decision has to be postponed until, say,
+a semicolon is seen. No formatting or stash pointers are added for implicit actions.
@<Start the right hand side@>=
- @[TeX_( "/rhsbool{/yy(1)}/to/toksa /the/toksa" );@]@;
- @[TeX_( "/getthird{/yy(1)}/to/toksb" );@]@; /* the format pointer */
- @[TeX_( "/getfourth{/yy(1)}/to/toksc" );@]@; /* the stash pointer */
+ @[TeX_( "/initlist{/rhsesoneprefix rhses1}" );@]@;
+ @[TeX_( "/yy0{/rhsesoneprefix rhses1}" );@]@;
+ @[TeX_( "/edef/rhsesoneprefix{./rhsesoneprefix}" );@]@;
+ @[TeX_( "/rhsbool{$[rhs]}/to/toksa /the/toksa" );@]@;
@[TeX_( "/ifrhsfull" );@]@;
- @[TeX_( " /yy0{/nx/rules{/the/yy(1)}{/the/toksb}{/the/toksc}}" );@]@;
- @[TeX_( "/else" );@]@; /* it does not end with an action, fake one */
- @[TeX_( " /rhscont{/yy(1)}/to/toksa" );@]@; /* rules */
- @[TeX_( " /edef/next{/the/toksa}" );@]@;
- @[TeX_( " /ifx/next/empty" );@]@;
- @[TeX_( " /toksa{/emptyterm}" );@]@;
- @[TeX_( " /fi" );@]@;
- @[TeXb( " /yy0{/nx/rules{/nx/rhs{/the/toksa/nx/rarhssep{0}{0}" );@]@;
- @[TeXfo( " /nx/actbraces{}{}{0}{0}/nx/bdend}{}{/nx/rhsfulltrue}}{/the/toksb}{/the/toksc}}" );@]@;
+ @[TeX_( " /appendtolistx{/the/yyval}{/the$[rhs]}" );@]@;
+ @[TeX_( "/else" );@]@; /* right hand side does not end with an action, fake one */
+ @[TeX_( " /rhscont{$[rhs]}/to/toksa" );@]@; /* rules */
+ @[TeX_( " /yytoksempty/toksa{/toksa{/emptyterm}}{}" );@]@;
+ @[TeXb( " /appendtolistx{/the/yyval}{/nx/rhs{/the/toksa/nx/rarhssep{0}{0}" );@]@;
+ @[TeXfo( " /nx/actbraces{}{}{0}{0}/nx/bdend}{}{/nx/rhsfulltrue}}" );@]@;
@[TeX_( "/fi" );@]@;
@ Using standard notation, here is what the middle action
-does.
+does. The part of the rule this action applies to is given below for
+reference. This action may have been omitted altogether but it serves
+as a good illustration of how `inline actions' work.
+\smallskip
+\rulereference{\nx\inline\nx\flatten}{|@<Insert local formatting@>|}%
+\smallskip
+\noindent The terms are counted from left (deeper in the value stack) to right
+(on top of the value stack) although \texref{/yy(0)}
+(which is the same as \texref{/yyval}) is the {\it right\/}most term,
+i.e.\ the implicit action itself.
+
+What the parser sees at this point
+are the first two terms on the stack (i.e.\ \prodstyle{rhses.1} and
+{\toksa\expandafter{\expandafter'\vl'}\expandafter\prodtstyle\expandafter{\the\toksa}})
+and is ready to make a reduction which will push
+the value of the term corresponding to the inline action (i.e.\ |@<Insert
+local formatting@>|) on the stack.
+
+The way \bison\ does this is by
+introducing a new grammar term (named \prodstyle{bogus_inline} for some integer
+$n$) for each inline action and adding a new rule that reduces an
+empty sequence of terms to \prodstyle{bogus_inline}. The action for this rule is
+the inline action. In our case this would read as
+\begingroup
+\medskip
+\def\skipalltoks#1\par{}
+\def\preparsefallbacktext#1{%
+ \let\postparse\relax
+ \message{#1}%
+ \skipalltoks
+}
+
+\extendswitch\multicharswitch\at\stashed\by\PB\to\multicharswitchadjust
+\let\multicharswitch\multicharswitchadjust
+\def\textproductionsetup{%
+ \rulereftextproductionsetup
+ \let\acharswitch\texcharadjust
+ \let\onecharswitch\texcsadjust
+}%
+\beginprod
+\inline\flatten
+ bogus_inline:
+ \{|@<Insert local formatting@>|\}
+\endprod
+\medskip
+\endgroup
+\noindent$\ldots$except the parser knows what the state of the stack is at this
+point and thus the code inside |@<Insert local formatting@>| can now refer
+to the terms on the stack as described above.
@<Old `Insert local formatting'@>=
- @[TeX_( "/rhscont{/yy(1)}/to{/yy(0)}" );@]@;
- @[TeX_( "/yy0{/the/yy(0)/nx/midf/the/yy(2)}" );@]@;
+ @[TeX_( "/appendtolistx{/the/yy(1)}{/nx/midf/the/yy(2)}" );@]@;
@ However, if the length of the rule preceding the inline action
-is not known a different way of accessing the stack is necessary.
-@<Insert local formatting@>=
+is not known to the parser in advance (as is the case for the parsers
+\splint\ generates using any version of \bison\ that is $\geq3.0$)
+a different way of accessing the stack is necessary. This notation is also more
+natural as it counts the terms from right to left, i.e.\ `into the depths
+of the stack' (for example \texref{/bb2\{\}} is the register holding the value
+of~\prodstyle{rhses1}). It is worth noting that in this case
+\texref{/yy(0)} and \texref{/yyval} are still the same
+register, the one that holds the value of the term corresponding to
+the inline action itself.
+@<Newer `Insert local formatting'@>=
@[TeX_( "/bb2{/toksa}/bb1{/toksb}" );@]@;
- @[TeX_( "/rhscont{/toksa}/to{/yy(0)}" );@]@;
- @[TeX_( "/yy0{/the/yy(0)/nx/midf/the/toksb}" );@]@;
-
-@ @<Old `Add a right hand side to a production'@>=
- @[TeX_( "/rhsbool{/yy(4)}/to/toksa /the/toksa" );@]@;
- @[TeX_( "/ifrhsfull" );@]@;
- @[TeX_( " /yy0{/nx/rules{/the/yy(3)/nx/rrhssep/the/yy(2)/the/yy(4)}/the/yy(2)}" );@]@;
- @[TeX_( "/else" );@]@;
- @[TeX_( " /rhscont{/yy(4)}/to/toksa" );@]@;
- @[TeX_( " /edef/next{/the/toksa}" );@]@;
- @[TeX_( " /ifx/next/empty" );@]@;
- @[TeX_( " /toksa{/emptyterm}" );@]@;
- @[TeX_( " /fi" );@]@;
- @[TeXb( " /yy0{/nx/rules{/the/yy(3)/nx/rrhssep/the/yy(2)" );@]@;
- @[TeXf( " /nx/rhs{/the/toksa/nx/rarhssep{0}{0}" );@]@; /* streams have already been grabbed */
- @[TeXfo( " /nx/actbraces{}{}{0}{0}/nx/bdend}{}{/nx/rhsfulltrue}}/the/yy(2)}" );@]@;
- @[TeX_( "/fi" );@]@;
+ @[TeX_( "/appendtolistx{/the/toksa}{/nx/midf/the/toksb}" );@]@;
-@ No pointers are provided for an {\it implicit\/} action. Processing a set of rules involves a large number of
-reexpansions. This seems to be a good place to use an array to store {\sc AST} nodes ({\let\writetexidxentry\writetextxtidxentry
-\def\texnspace{texline}\def\texispace{index}\inlineTeXx{/astarray}}). While
+@ Finally, using the `native' way of referring to term values results
+in the most natural code. In this case, one can mix numeric and
+symbolic references for both implicit and explicit rules.
+@<Insert local formatting@>=
+ @[TeX_( "/appendtolistx{/the$[rhses]}{/nx/midf/the$[mid]}" );@]@;
+
+@ Productions are collected in a `productions cluster' (not an official term) by the
+following action:
+\smallskip
+\thisrulereference{\nx\inline\nx\flatten}
+\smallskip\noindent
+As can be seen in the code below, no pointers are provided for an {\it implicit\/}
+action (since there are no tokens associated with it).
+
+Processing a set of rules involves a large number of
+reexpansions. This seems to be a good place to use a list to store the nodes
+(see \.{yycommon.sty} for details on list macros). While
providing a noticeable speed up, this technique significantly
complicates the debugging of the grammar. In particular, inspecting a
-parsed table supplies very little information if the {\sc AST} nodes are not
+parsed table supplies very little information if the list not
expanded. The macros in \.{yyunion.sty} provide a special debugging
namespace where the expansion of the parser produced control sequences
may be modified to safely expand the generated table.
+
+The code below relies on the inline action |@<Insert local formatting@>| above
+to store the relevant information from \texref{/yy(1)} (corresponding to
+\prodstyle{rhses1}) in \texref{/yy(3)} (which is
+the inline action `term' \inlineactionsymbol\ in the production above).
+@q Note that one cannot use \prodstyle{...} above to display \inlineactionsymbol@>
+@q since the \prodstyle{...} macro relies on the name parser. See yyunion.sty @>
+@q for further details about the special terms like this. @>
@<Add a right hand side to a production@>=
@[TeX_( "/rhsbool{/yy(4)}/to/toksa /the/toksa" );@]@;
@[TeX_( "/ifrhsfull" );@]@;
- @[TeX_( " /yypushx{/the/yy(3)/nx/rrhssep/the/yy(2)/the/yy(4)}/on/astarray" );@]@;
+ @[TeX_( " /appendtolistx{/the/yy(1)}{/nx/rrhssep/the/yy(2)/the/yy(4)}" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /rhscont{/yy(4)}/to/toksa" );@]@;
- @[TeX_( " /edef/next{/the/toksa}" );@]@;
- @[TeX_( " /ifx/next/empty" );@]@;
- @[TeX_( " /toksa{/emptyterm}" );@]@;
- @[TeX_( " /fi" );@]@;
- @[TeXb( " /yypushx{/the/yy(3)/nx/rrhssep/the/yy(2)" );@]@;
+ @[TeX_( " /yytoksempty/toksa{/toksa{/emptyterm}}{}" );@]@;
+ @[TeXb( " /appendtolistx{/the/yy(1)}{/nx/rrhssep/the/yy(2)" );@]@;
@[TeXf( " /nx/rhs{/the/toksa/nx/rarhssep{0}{0}" );@]@; /* streams have already been grabbed */
- @[TeXfo( " /nx/actbraces{}{}{0}{0}/nx/bdend}{}{/nx/rhsfulltrue}}/on/astarray" );@]@;
+ @[TeXfo( " /nx/actbraces{}{}{0}{0}/nx/bdend}{}{/nx/rhsfulltrue}}" );@]@;
@[TeX_( "/fi" );@]@;
- @[TeX_( "/yy0{/nx/rules{/astarraylastcs}/the/yy(2)}" );@]@;
-
-@ @<Add an optional semicolon@>=
- @<Carry on@>@;
+ @[TeX_( "/yy0{/the/yy(1)}" );@]@;
@ @<Tokens and types...@>=
@G
@@ -942,33 +1021,46 @@ named_ref.opt:
;
@g
-@ \saveparseoutputfalse
+@ The simplest form of the right hand side is an empty rule. In this case the parser
+must make a reduction based on the lookahead only (or the current state), i.e.\ no
+tokens are consumed from the input.
+\saveparseoutputfalse
@<Make an empty right hand side@>=
@[TeX_( "/yy0{/nx/rhs{}{}{/nx/rhsfullfalse}}" );@]@;
-@ @<Add a term to the right hand side@>=
+@ Adding a \bison\ term to the right hand side involves collecting of several pieces of information.
+One of them is the (optional) symbolic named that can be used by the action code to refer to
+the place on the value stack that is allocated for this term.
+\smallskip
+\thisrulereference{\nx\inline\nx\flatten}%
+\smallskip
+\noindent The space between the term and the preceeding part of the rule may depend on the
+type of rule element that appears at the end of the rule parsed so far.
+@<Add a term to the right hand side@>=
@[TeX_( "/rhscont{/yy(1)}/to/toksa" );@]@;
@[TeX_( "/rhscnct{/yy(1)}/to/toksb" );@]@;
- @[TeX_( "/edef/next{/the/toksb}" );@]@;
- @[TeX_( "/ifx/next/empty" );@]@;
- @[TeX_( "/else" );@]@;
+ @[TeX_( "/yytoksempty/toksb{}{" );@]@;
@[TeX_( " /getfourth{/yy(2)}/to/toksc" );@]@;
@[TeX_( " /getfifth{/yy(2)}/to/toksd" );@]@;
@[TeX_( " /appendr/toksb{{/the/toksc}{/the/toksd}}" );@]@;
- @[TeX_( "/fi" );@]@;
+ @[TeX_( "}" );@]@;
@[TeXb( "/yy0{/nx/rhs{/the/toksa/the/toksb" );@]@;
@[TeXao( "/nx/termname{/the/yy(2)}{/the/yy(3)}}{/nx/hspace}{/nx/rhsfullfalse}}" );@]@;
-@ @<Add an action to the right hand side@>=
+@ Action processing is somewhat complicated since the action can be either inline or terminal,
+affecting the typesetting.
+\smallskip
+\thisrulereference{\nx\inline\nx\flatten}%
+\smallskip
+\noindent Additionally, an action may follow an empty rule in which case a special term
+must be added to aid the reader.
+@<Add an action to the right hand side@>=
@[TeX_( "/rhscont{/yy(1)}/to/toksa" );@]@;
@[TeX_( "/rhsbool{/yy(1)}/to/toksb /the/toksb" );@]@;
@[TeX_( "/ifrhsfull" );@]@; /* the first half ends with an action */
@[TeX_( " /appendr/toksa{/nx/arhssep{0}{0}/nx/emptyterm}" );@]@; /* no pointers to streams */
@[TeX_( "/fi" );@]@;
- @[TeX_( "/edef/next{/the/toksa}" );@]@;
- @[TeX_( "/ifx/next/empty" );@]@;
- @[TeX_( " /toksa{/emptyterm}" );@]@;
- @[TeX_( "/fi" );@]@;
+ @[TeX_( "/yytoksempty/toksa{/toksa{/emptyterm}}{}" );@]@;
@[TeX_( "/getfirst{/yy(2)}/to/toksb" );@]@; /* the contents of the braced code */
@[TeX_( "/getsecond{/yy(2)}/to/toksc" );@]@; /* the format stream pointer */
@[TeX_( "/getthird{/yy(2)}/to/toksd" );@]@; /* the stash stream pointer */
@@ -982,10 +1074,7 @@ named_ref.opt:
@[TeX_( "/ifrhsfull" );@]@; /* the first half ends with an action */
@[TeX_( " /appendr/toksa{/nx/arhssep{0}{0}/nx/emptyterm}" );@]@; /* no pointers to streams */
@[TeX_( "/fi" );@]@;
- @[TeX_( "/edef/next{/the/toksa}" );@]@;
- @[TeX_( "/ifx/next/empty" );@]@;
- @[TeX_( " /toksa{/emptyterm}" );@]@;
- @[TeX_( "/fi" );@]@;
+ @[TeX_( "/yytoksempty/toksa{/toksa{/emptyterm}}{}" );@]@;
@[TeX_( "/getfirst{/yy(2)}/to/toksb" );@]@; /* the contents of the braced code */
@[TeX_( "/getsecond{/yy(2)}/to/toksc" );@]@; /* the format stream pointer */
@[TeX_( "/getthird{/yy(2)}/to/toksd" );@]@; /* the stash stream pointer */
@@ -993,16 +1082,17 @@ named_ref.opt:
@[TeXf( " /nx/bpredicate{/the/toksb}{}{/the/toksc}{/the/toksd}/nx/bdend}" );@]@;
@[TeXao( "{/nx/arhssep}{/nx/rhsfulltrue}}" );@]@;
-@ @<Add \prodstyle{\%empty} to the right hand side@>=
+@ An empty right hand side may be specified explicitly by using \prodstyle{\%empty} as
+the sole token in the production. This will increase the readability of the grammar by
+making the programmer's intentions more transparent.
+@<Add \prodstyle{\%empty} to the right hand side@>=
@[TeX_( "/rhscont{/yy(1)}/to/toksa" );@]@;
@[TeX_( "/rhscnct{/yy(1)}/to/toksb" );@]@;
- @[TeX_( "/edef/next{/the/toksb}" );@]@;
- @[TeX_( "/ifx/next/empty" );@]@;
- @[TeX_( "/else" );@]@;
+ @[TeX_( "/yytoksempty/toksb{}{" );@]@;
@[TeX_( " /getfourth{/yy(2)}/to/toksc" );@]@;
@[TeX_( " /getfifth{/yy(2)}/to/toksd" );@]@;
@[TeX_( " /appendr/toksb{{/the/toksc}{/the/toksd}}" );@]@;
- @[TeX_( "/fi" );@]@;
+ @[TeX_( "}" );@]@;
@[TeXb( "/yy0{/nx/rhs{/the/toksa/the/toksb" );@]@;
@[TeXao( "/nx/emptyterm}{/nx/hspace}{/nx/rhsfullfalse}}" );@]@;
@@ -1045,13 +1135,17 @@ named_ref.opt:
@[TeXao( "/nx/mergeop{/nx/tagit/the/yy(3)}/the/yy(2)}{/the/toksb}{/nx/rhsfullfalse}}" );@]@;
@[TeX_( "/fi" );@]@;
+ @t}\beginfoldedsections{@>
+
@ @<Create an empty named reference@>=
@[TeX_( "/yy0{}" );@]@;
@ @<Create a named reference@>=
@<Turn an identifier into a term@>@;
-@ Identifiers.
+ @t}\endfoldedsections{@>
+
+@*2 Identifiers and other symbols.
{\it Identifiers are returned as |uniqstr| values by the scanner.
Depending on their use, we may need to make them genuine symbols}. We,
on the other hand, simply copy the values returned by the scanner.
@@ -1095,6 +1189,7 @@ string_as_id:
placeholders for the appropriate actions in case the parser gains some
sophistication in processing low level types (or starts expecting
different types from the scanner).
+\beginfoldedsectionshere
@<Turn an identifier into a term@>=
@[TeX_( "/yy0{/nx/idit/the/yy(1)}" );@]@;
@@ -1113,6 +1208,8 @@ different types from the scanner).
@ @<Prepare a string for use@>=
@[TeX_( "/yy0{/nx/stringify/the/yy(1)}" );@]@;
+@t}\endfoldedsections{@>
+
@ {\it Variable and value.
The \prodstyle{STRING} form of variable is deprecated and is not \.{M4}-friendly.
For example, \.{M4} fails for \.{\%define "[" "value"}.}
@@ -1151,8 +1248,6 @@ as they have to be inserted in a place that is aware of the internal definitions
definitions are used.
@<Grammar parser \Cee\ postamble@>=
-#define YYPRINT(file, type, value) @[yyprint (file, type, value)@]
- static void yyprint (FILE *file, int type, YYSTYPE value){}
@ @<Bootstrap parser \Cee\ postamble@>=
@<Grammar parser \Cee\ postamble@>@;
@@ -1183,8 +1278,15 @@ token information from the grammar.
@q _register_token_d(SEMICOLON) /* can be omitted in prologue */ @>
@q _register_token_d(TAG) /* only encountered in the definition of PERCENT_PARAM */ @>
-@ Union of types. This section of the \bison\ input lists the types
+@*1 Union of types. This section of the \bison\ input lists the types
that may appear on the value stack. Since \TeX\ does not provide any
mechanism for type checking (nor is it clear how to translate a \Cee\
-|union| into any data structure usable in \TeX), this section is left empty.
+|union| into any data structure usable in \TeX), this section is left (nearly)
+empty. The reason for the lonely type below is the postprocessor that facilitates
+the use of \bison\ `native' term references (see elsewhere). In order to
+translate such references into appropriate \TeX\ code, the postprocessor
+must let \bison\ calculate offsets into the value stack, which requires
+assigning types to various terminals and non-terminals. The specific type
+has no significance.
@<Union of grammar parser types@>=
+ int intval; \ No newline at end of file
diff --git a/support/splint/cweb/bs.w b/support/splint/cweb/bs.w
index adefd23f8b..8b32617ef3 100644
--- a/support/splint/cweb/bs.w
+++ b/support/splint/cweb/bs.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2024, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
@@ -31,7 +31,6 @@ be done here.
_register_table_d(yypgoto)@;
_register_table_d(yytable)@;
_register_table_d(yycheck)@;
- _register_table_d(yytoknum)@;
_register_table_d(yystos)@;
_register_table_d(yytname)@;
_register_table_d(yyprhs)@;
@@ -46,8 +45,13 @@ with version~\.{3.0}) does not generate |yyprhs| and |yyrhs| or any
other arrays that contain similar information, so we fake them here if
such a crippled version of \bison\ is used.
+The |yyrimplicit| array will be used by the table output code, together with
+the postprocessor to output right hand side lengths for the term references that
+require them in the case when the `native' \bison\ references are
+used.
@<Variables and types local to the parser@>=
unsigned int yyrthree[YYNRULES + 1] = { 0 };
+ int yyrimplicit[YYNRULES + 1] = { 0 };
#ifdef BISON_IS_CRIPPLED
unsigned int yyrhs[YYNRULES + 1] = { -1 };
unsigned int yyprhs[YYNRULES + 1] = { 0 };
@@ -102,6 +106,23 @@ such a crippled version of \bison\ is used.
@<Parser table names@>=
_register_table_d(yyrthree)@;
+@ We list some macros that are used to assist the post
+processor and take advantage of the |yyrimlicit| array. As at this
+time the size of the array is unknown (the preamble is included before
+the parser file by \.{mkeparser.w} so the number of rules is unknown
+at this point), we declare the array as a pointer.
+@d BZ( term, anchor ) ( ((YYSTYPE *)&(term)) - ((YYSTYPE *)&(anchor)) + 1 )
+@d BZZ( term, anchor ) (
+ (yyrimplicit_p[yyn] = ((yyrimplicit_p[yyn] < 0) ?
+ yyrimplicit_p[yyn] : ((YYSTYPE *)&(term)) - ((YYSTYPE *)&(anchor)) + 1)),
+ ((YYSTYPE *)&(term)) - ((YYSTYPE *)&(anchor)) + 1
+)
+@<\Cee\ setup code specific to \bison@>=
+ int *yyrimplicit_p;
+
+@ @<Output parser semantic actions@>=
+ yyrimplicit_p = yyrimplicit;
+
@*2Actions. There are several ways of making |yyparse()| execute all portions of
the action code. The one chosen here makes sure that none of the
tables gets written past its last element. To see how it works, it
@@ -154,6 +175,7 @@ change affects the generated parser.
yyr1[i] = YYNTOKENS;
yydefact[0] = i;
+ yyrimplicit[i] = -yyr2[i];
yyr2[i] = 0;
yyparse(YYPARSE_PARAMETERS);
@@ -173,18 +195,32 @@ change affects the generated parser.
}
+ for ( int i = 1; i < YYNRULES + 1; i++ ) {
+
+ if ( yyrimplicit[i] > 0 ) {
+ fprintf( tables_out, "\\yyimplicitlengthset{%d}{%d}%%\n", i, yyrimplicit[i] );
+ }
+
+ }
+
@*2Constants. A generic list of constants to be used later in different contexts is defined below.
As before, the appropriate macro will be defined generically to do what is required with these
names (for example, we can turn each name into a string for reporting purposes).
@<Parser constants@>=
_register_const_d(YYEMPTY)@;
_register_const_d(YYPACT_NINF)@;
- _register_const_d(YYEOF)@;
_register_const_d(YYLAST)@;
_register_const_d(YYNTOKENS)@;
_register_const_d(YYNRULES)@;
_register_const_d(YYNSTATES)@;
_register_const_d(YYFINAL)@;
+#ifndef YYEOF
+ _register_const_d(YYSYMBOL_YYEOF)@;
+#endif
+
+@ Constants defined to maintain compatibility with the older versions of \bison.
+@<Parser virtual constants@>=
+ _register_const_d(YYSYMBOL_YYEOF, YYEOF)@;
@*2Tokens.
Similar techniques are employed in token output. Tokens are parser
@@ -582,20 +618,32 @@ rules are not output if a crippled \bison\ is used.
@ \TeX\ constant output is another place where the techniques described above are applied.
As before, the macro handles the repetitive work of initialization, declaration, etc in
-each place where the corresponding constant is mentioned. The one exception is \.{YYPACT\_NINF},
-which has to be handled separately because the underscore in its name makes it difficult to
-use it as a command sequence name.
+each place where the corresponding constant is mentioned. The exceptions are \.{YYPACT\_NINF}
+and \.{YYSYMBOL\_YYEOF} that have to be handled separately because the
+underscore in its name makes it difficult to use it as a command sequence name.
\def\YYPACTxNINFxdesc{\.{YYPACT\_NINF\_}\\{desc}}
+\def\YYSYMBOLxYYEOFxdesc{\.{YYSYMBOL\_YYEOF\_}\\{desc}}
@s YYPACT_NINF_desc TeX
+@s YYSYMBOL_YYEOF_desc TeX
@<Prepare \TeX\ format for parser constants@>=
#define _register_const_d(c_name) @[c_name##_desc.format = "\\constset{%s}{%d}%%\n"; \
c_name##_desc.name = #c_name; \
+ c_name##_desc.value = c_name; \
output_desc.output_##c_name = 1;@]
@<Parser constants@>@;
#undef _register_const_d
+#ifdef YYEOF /* other values have already been set correctly */
+#define _register_const_d(c_name,vvalue) @[c_name##_desc.format = "\\constset{%s}{%d}%%\n"; \
+ c_name##_desc.name = #c_name; \
+ c_name##_desc.value = vvalue; \
+ output_desc.output_##c_name = 1;@]
+ @<Parser virtual constants@>@;
+#undef _register_const_d
+#endif
YYPACT_NINF_desc.name = "YYPACTNINF";
+YYSYMBOL_YYEOF_desc.name = "YYSYMBOLxYYEOF";
@ Token definitions round off the \TeX\ output mode.
diff --git a/support/splint/cweb/checklists.w b/support/splint/cweb/checklists.w
index 754855d747..446bc46b96 100644
--- a/support/splint/cweb/checklists.w
+++ b/support/splint/cweb/checklists.w
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% Copyright 2002-2014 Free Software Foundation, Inc.
% This file is part of SPLinT
%
diff --git a/support/splint/cweb/common.w b/support/splint/cweb/common.w
index 0f50fdcabd..5112fb5414 100644
--- a/support/splint/cweb/common.w
+++ b/support/splint/cweb/common.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2024, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
@@ -454,6 +454,19 @@ code easier to look at. Further explanation is given in the grammar
file. If the parser is doing its job, this is the only place where one
would actually see these as functions (or, rather, macros).
+In case one wishes to use the `native' \bison\ way of referencing
+terms (i.e.\ something along the lines of~\.{\\the\char`\$[term]})
+these macros should be used with a trailing underscore (say, \.{TeXa\_})
+to let the postprocessor know that the code inside should be
+postprocessed. The postprocessor will then create three files: one,
+destined for \CWEAVE, will use the same macro withough the underscore
+(i.e.\ \.{TeXa} to continue our example, and have the native \bison\
+terms replaced wih the appropriate \TeX\ commands. Another file is
+intended for \CTANGLE, where the whole macro will be replaced first
+with a special identifier, which in turn, after \CTANGLE\ finishes,
+will be replaced by an appropriately constructed call to \.{TeX\_\_}. The
+third file will contain the substitutions.
+
In compliance with paragraph 6.10.8(2)\footnote{[$\ldots$] {\it Any
other predefined macro names shall begin with a leading underscore
followed by an uppercase letter or a second underscore.}} of the \ISO\
@@ -482,7 +495,7 @@ macros which produces undesirable typesetting artefacts.}.
@q \CWEB\ is not aware of variadic macros, so this has to be done the old way@>
@<\Cee\ preamble@>=
-#define TeX__( string, ... ) @[fprintf( tables_out, " " string "%s\n", __VA_ARGS__, "%" )@]
+#define TeX__( string, ... ) @[fprintf( tables_out, " " string "%%\n", __VA_ARGS__ )@]
@ If a full parser is not needed, the lexing mechanism is not required. To satisfy the compiler
and the linker, the lexer and other functions still have to be declared and defined, since these functions
@@ -524,27 +537,32 @@ values. When the names are concatenated with other tokens, however,
the \Cee\ preprocessor postpones the macro expansion until the
concatenation is complete (see clauses 6.10.3.1, 6.10.3.2, and
6.10.3.3 of the \ISO\ \Cee\ Standard, \cite[ISO/C11]). Unless the result of the
-concatenation is still expandable, the expansion will halt.
+concatenation is still expandable, the expansion will halt\footnote{Another trick
+to halt expansion is to use {\it function macros} which will expand only when
+they are followed by parentheses. Since we do not have control over how
+constants are defined by \bison, we cannot take advantage of this feature of the
+\Cee\ preprocessor.}.
@<Global variables and types@>=
struct const_d {
char *format;
char *name;
+ int value;
};
@ @<Local variable and type declarations@>=
-#define _register_const_d(c_name) @[struct const_d c_name##_desc;@]
+#define _register_const_d(c_name,...) @[struct const_d c_name##_desc;@]
@<Constant names@>@;
#undef _register_const_d
@ @<Output descriptor fields@>=
-#define _register_const_d(c_name) @[bool output_##c_name:1;@]
+#define _register_const_d(c_name,...) @[bool output_##c_name:1;@]
@<Constant names@>@;
#undef _register_const_d
@ @<Default outputs@>=
-#define _register_const_d(c_name) @[@[@].output_##c_name = 0,@[@]@]
+#define _register_const_d(c_name,...) @[@[@].output_##c_name = 0,@[@]@]
@<Constant names@>@;
#undef _register_const_d
@@ -556,10 +574,10 @@ concatenation is still expandable, the expansion will halt.
{
int any_constants = 0;
-#define _register_const_d(c_name) \
+#define _register_const_d(c_name,...) \
\
if ( output_desc.output_##c_name ) { \
- const_out( tables_out, c_name##_desc, c_name)@; \
+ const_out( tables_out, c_name##_desc)@; \
any_constants = 1; \
}
@@ -575,7 +593,7 @@ concatenation is still expandable, the expansion will halt.
@<Constant names@>=
@ A macro to help with constant output.
-@d const_out(stream, c_desc, c_name) fprintf(stream, c_desc.format, c_desc.name, c_name);
+@d const_out(stream, c_desc) fprintf(stream, c_desc.format, c_desc.name, c_desc.value);
@ Action switch output routines modify the automata tables and
therefore have to be output last. Since action output is highly
@@ -728,7 +746,7 @@ specific cases are added to in the course of adding new features.
FOREVER {
- c = getopt_long (argc, argv, ( char [] ){':'@t, @>@<Short option list@>}, long_options, &option_index);
+ c = getopt_long (argc, argv, ( char [] )@[{':'@t, @>@<Short option list@>}@], long_options, &option_index);
if (c == -1) break;
diff --git a/support/splint/cweb/fk.w b/support/splint/cweb/fk.w
index fc0c5d2e14..c25a7e8cc2 100644
--- a/support/splint/cweb/fk.w
+++ b/support/splint/cweb/fk.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2022, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
@@ -330,6 +330,7 @@ known to the \flex\ generated scanner.
}
@*2Constants.
+The few hard coded constants needed for the lexer to work are listed here.
@<Scanner constants@>=
_register_const_d(YY_END_OF_BUFFER_CHAR)@;
_register_const_d(YY_NUM_RULES)@;
@@ -427,6 +428,7 @@ are handled separately, because they contain underscores.
@<Prepare \TeX\ format for scanner constants@>=
#define _register_const_d(c_name) @[c_name##_desc.format = "\\constset{%s}{%d}%%\n"; \
c_name##_desc.name = #c_name; \
+ c_name##_desc.value = c_name; \
output_desc.output_##c_name = 1;@]
@<Scanner constants@>@;
#undef _register_const_d
diff --git a/support/splint/cweb/fo.w b/support/splint/cweb/fo.w
index 81694024c3..d34ca57d96 100644
--- a/support/splint/cweb/fo.w
+++ b/support/splint/cweb/fo.w
@@ -30,14 +30,23 @@
@q PURPOSE. @>
@**The \ifbootstrapmode flex \else\flex\ \fi parser stack.
-\ifbootstrapmode % this is a bootstrap run to generate the tables
+\ifbootstrapmode % this is a bootstrap run to generate the token references
\input limbo.sty
\def\optimization{5}
\input yy.sty
+ \def\bstrapparser{dyytab.tex}% use the full prologue parser
+ \def\bstraptokens{bo.tok}% for which we will need token equivalences
\modebootstrap
\else % otherwise set up the pretty printing of tokens
\let\hostparsernamespace\flexnamespace
\fi
+% we can get away with the setup above because the minimal lexer
+% used for bootstrapping does not know about the \prodstyle{\%left}
+% token so in the declarations list below, the two tokens,
+% \prodstyle{CCL_OP_DIFF} and \prodstyle{CCL_OP_UNION} become
+% part of the previous \prodstyle{\%token} declaration which is a
+% legal declaration syntax; see ldman.w and ldlex.w and ldgram.w for
+% a more elaborate setup;
The scanner generator, \flex, uses \bison\ to produce a parser for its
input language. Its lexer is output by \flex\ itself so both are
reused to generate the parser and the scanner for pretty printing
@@ -69,7 +78,7 @@ any custom adjustments to the lexer state to operate correctly.
@g
@ The selection of options for \bison\ parsers suitable for \splint\
-have been discussed
+has been discussed
\ifbootstrapmode\else\locallink{bison.options}earlier \endlink\fi so we
list them here without further comments.
@<Options for \flex\ parser@>=
@@ -157,7 +166,7 @@ point of recognition, while the typesetting parser needs to be aware of them.
@G
%token TOP_OP POINTER_OP ARRAY_OP DEF_OP RE_DEF OPT_OTHER OPT_DEPRECATED
-@ {\em \POSIX\ and \.{AT\&T} \lex\ place the
+@ \namedspot{flex braces}{\em \POSIX\ and \.{AT\&T} \lex\ place the
precedence of the repeat operator, \.{\{\}}, below that of concatenation.
Thus, \.{ab\{3\}} is\/ \.{ababab}. Most other \POSIX\ utilities use an {\rm Extended
Regular Expression (ERE)} precedence that has the repeat operator
@@ -166,8 +175,8 @@ higher than concatenation. This causes \.{ab\{3\}} to yield\/ \.{abbb}.
In order to support the \POSIX\ and \.{AT\&T} precedence and the \flex\
precedence we define two token sets for the begin and end tokens of
the repeat operator, \prodstyle{BEGIN_REPEAT_POSIX} and\/ \prodstyle{END_REPEAT_POSIX}. The lexical scanner chooses
-which tokens to return based on whether {\let\it\itbold\prodstyle{posix\_compat} or \prodstyle{lex\_compat}
-are specified. Specifying either \prodstyle{posix\_compat} or \prodstyle{lex\_compat}} will
+which tokens to return based on whether {\let\it\itbold\prodstyle{posix_compat} or \prodstyle{lex_compat}
+are specified. Specifying either \prodstyle{posix_compat} or \prodstyle{lex_compat}} will
cause \flex\ to parse scanner files as per the \.{AT\&T} and \POSIX-mandated behavior.}
@<Token definitions for \flex\ input parser@>=
@G
@@ -186,6 +195,7 @@ explanation). We can nevertheless get away with an empty \Cee\ preamble.
@ @<Productions for \flex\ parser@>=
@G
+@t}\vb{\insertraw{\beginfoldedsections}}{@>
@t}\vb{\inline\flatten}{@>
goal:
initlex sect1 sect1end
@@ -202,12 +212,15 @@ initlex:
@g
@ @<Assemble a \flex\ input file@>=
- @[TeX_( "/yy0{/the/yy(2)/the/yy(4)}" );@]@;
+ @[TeX_( "/finishlist{/the/yy(4)}" );@]@;
+ @[TeX_( "/yy0{/the/yy(2)/nx/executelist{/the/yy(4)}}" );@]@;
@ @<Productions for \flex\ parser@>=
@<Productions for \flex\ section~1 parser@>@;
@<Productions for \flex\ section~2 parser@>@;
+@t}\endfoldedsections{@>
+
@ @<Exclusive productions for \flex\ section~1 parser@>=
@G
@t}\vb{\inline\flatten}{@>
@@ -220,6 +233,7 @@ goal:
@ @<Productions for \flex\ section~1 parser@>=
@G
+@t}\vb{\insertraw{\beginfoldedsections}}{@>
sect1:
sect1 startconddecl namelist1 {@> @<Add start condition declarations@> @=}
| sect1 options {@> @<Add options to section~1@> @=}
@@ -266,8 +280,11 @@ namelist1:
@ @<Report an error in \prodstylens{namelist1}{\flexnamespace} and quit@>=
@[TeX_( "/yyerror" );@]@;
+@t}\endfoldedsections{@>
+
@ @<Productions for \flex\ section~1 parser@>=
@G
+@t}\vb{\insertraw{\beginfoldedsections}}{@>
options:
OPTION_OP optionlist {@> @<Start an options list@> @=}
| POINTER_OP {@> @<Add a pointer option@> @=}
@@ -338,15 +355,19 @@ option:
@ @<Output a deprecated option@>=
@[TeX_( "/yy0{/nx/flopt{deprecated}/the/yy(1)}" );@]@;
+@t}\endfoldedsections{@>
+
@ @<Special \flex\ section~2 parser productions@>=
@G
+@t}\vb{\inline\flatten}{@>
goal:
sect2 {@> @<Output section~2@> @=}
;
@g
@ @<Output section~2@>=
- @[TeX_( "/table/yy(1)" );@]@;
+ @[TeX_( "/finishlist{/the/yy(1)}" );@]@;
+ @[TeX_( "/table/expandafter{/expandafter/executelist/expandafter{/the/yy(1)}}" );@]@;
@ This portion of the grammar was changed to make it possible to read the
action code.
@@ -364,25 +385,54 @@ initforrule:
;
@g
-@ @<Add a rule to section~2@>=
+@ The production below describes the most typical way a regular expression is
+assigned an action. The redundant term \prodstyle{initforrule} is a standard
+\bison\ trick to make sure that the appropriate initializations happen at
+the right time.
+\smallskip
+\thisrulereference{\nx\inline\nx\flatten}
+\smallskip\noindent
+The original production has been modified so that the pretty printing parser has a chance
+to consume the action code. The second \prodstyle{'\\n'} is output by the action
+processing code.
+@<Add a rule to section~2@>=
@[TeX_( "/ifflcontinued@@action" );@]@;
@[TeX_( " /toksb{/flactionc}" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /toksb{/flaction}" );@]@;
@[TeX_( "/fi" );@]@;
@[TeX_( "/toksa/expandafter{/astformat@@flaction}" );@]@; /* capture the formatting action */
- @[TeX_( "/yypushx{/the/yy(1)/the/toksb{/the/yy(2)}{/the/yy(4)}/the/yy(5)/the/yy(6){/the/toksa}}/on/astarray" );@]@;
- @[TeX_( "/yy0{/astarraylastcs}" );@]@;
+ @[TeX_( "/yy0{/the/yy(1)}" );@]@;
+ @[TeX_( "/appendtolistx{/the/yy(1)}{/the/toksb{/the/yy(2)}{/the/yy(4)}/the/yy(5)/the/yy(6){/the/toksa}}" );@]@;
@[TeX_( "/let/astformat@@flaction/empty" );@]@; /* reset the format */
-@ @<Add a group of rules to section~2@>=
- @[TeX_( "/yy0{/the/yy(1)/nx/flactiongroup{/the/yy(2)}/the/yy(3){/the/yy(4)}/the/yy(5)}" );@]@;
+@ For convenience, rules that are active in the same set of states may be grouped together.
+This pattern is the subject of the next production.
+\smallskip
+\thisrulereference{\nx\inline\nx\flatten}
+\smallskip\noindent
+The original parser ignores the braces while the pretty printing parser
+uses the pointers associated with the braces to collect and process the accumulated
+stash. This is how comments and \CWEB\ section references are typeset.
+@<Add a group of rules to section~2@>=
+ @[TeX_( "/yy0{/the/yy(1)}" );@]@;
+ @[TeX_( "/finishlist{/the/yy(4)}" );@]@;
+ @[TeX_( "/appendtolistx{/the/yy(1)}{/nx/flactiongroup{/the/yy(2)}/the/yy(3){/nx/executelist{/the/yy(4)}}/the/yy(5)}" );@]@;
-@ @<Start an empty section~2@>=
- @[TeX_( "/yy0{}" );@]@;
+@ Simple left recursive terms like~\prodstyle{sect2} are very suitable for being implemented as a list
+(see the macros in \.{yycommon.sty} for the details on the list implementation). The `type' of~\prodstyle{sect2}
+is a (symbolic pointer to a) list of items built up from an empty initial list. This production initializes
+the list (with the name identical to the terminal on the left hand side of the production)
+and updates the list name (rather the name's prefix) for future invocations of this action.
+
+@<Start an empty section~2@>=
+ @[TeX_( "/initlist{/secttwoprefix sect2}" );@]@;
+ @[TeX_( "/yy0{/secttwoprefix sect2}" );@]@;
+ @[TeX_( "/edef/secttwoprefix{/secttwoprefix.}" );@]@;
@ @<Add a bare action@>=
- @[TeX_( "/yy0{/the/yy(1)/nx/flbareaction/the/yy(2)}" );@]@;
+ @[TeX_( "/yy0{/the/yy(1)}" );@]@;
+ @[TeX_( "/appendtolistx{/the/yy(1)}{/nx/flbareaction/the/yy(2)}" );@]@;
@ @<Productions for \flex\ section~2 parser@>=
@G
@@ -400,14 +450,23 @@ scon:
namelist2:
namelist2 ',' sconname {@> @<Add a start condition to a list@> @=}
| sconname {@> @<Start a list with a start condition name@> @=}
- | error {@> @<Report an error compiling a start condition list@> @=}
+ | error {@> @<Report an error in a start condition list@> @=}
;
@t}\vb{\inline\flatten}{@>
sconname:
NAME {@> @<Make a \prodstylens{NAME}{\flexnamespace} into a start condition@> @=}
;
-@ @<Create a list of start conditions@>=
+@ Start conditions are just names. The data structure that is output has
+location pointers for the streams to enable interaction with \CWEB. These
+pointers are in turn the values of the angle bracket tokens that enclose the
+list of start conditions.
+
+Start condition lists may be collected in their own sections, while the list itself
+may be followed by a comment. The pointers mentioned above are used to typeset the comments
+and section references.
+\beginfoldedsectionshere
+@<Create a list of start conditions@>=
@[TeX_( "/yy0{/nx/flsconlist{/the/yy(1)}{/the/yy(3)}{/the/yy(4)}}" );@]@;
@ @<Create a universal start condition@>=
@@ -422,17 +481,24 @@ sconname:
@ @<Start a list with a start condition name@>=
@<Copy the value@>@;
-@ @<Report an error compiling a start condition list@>=
+@ @<Report an error in a start condition list@>=
@[TeX_( "/yyerror" );@]@;
@ @<Make a \prodstylens{NAME}{\flexnamespace} into a start condition@>=
@[TeX_( "/yy0{/nx/flname/the/yy(1)}" );@]@;
-@ @<Productions for \flex\ section~2 parser@>=
+@t}\endfoldedsections{@>
+
+@*1 The syntax of regular expressions. The productions in this section define the
+syntax of \flex\ regular expressions in detail. The same productions are used for
+parsing isolated regular expressions (e.g.\ to present example code). A few of these
+productions have been modified to suit the needs of the pretty printing parser.
+@<Productions for \flex\ section~2 parser@>=
@<Rules for \flex\ regular expressions@>@;
@ @<Special productions for regular expressions@>=
@G
+@t}\vb{\inline\flatten}{@>
goal:
flexrule {@> @<Output a regular expression@> @=}
;
@@ -446,33 +512,48 @@ ensures that all the changes are local to the parsing macro.
@<Output a regular expression@>=
@[TeX_( "/table/yy(1)" );@]@;
-@ @<Rules for \flex\ regular expressions@>=
+@ Regular expressions are parsed using the following productions. There are
+two major cases: rules active only at the beginning of the line, and the rest. From the
+typesetting parser's point of view, there is not much difference between the two
+(certainly not enough to justify singling out the rules at the beginning of the line into
+their own production) but it was decided to keep the original grammar rules
+for consistency.
+@<Rules for \flex\ regular expressions@>=
@G
+@t}\vb{\insertraw{\beginfoldedsections}}{@>
flexrule:
- '^' rule {@> @<Match a rule at the beginning of the line@> @=}
+ '^' rule {@> @<Match a rule at the start of the line@> @=}
| rule {@> @<Match an ordinary rule@> @=}
| EOF_OP {@> @<Match an end of file@> @=}
| error {@> @<Report an error and quit@> @=}
;
-@ @<Match a rule at the beginning of the line@>=
+@ @<Match a rule at the start of the line@>=
@[TeX_( "/toksa/expandafter{/astformat@@flrule}" );@]@;
@[TeX_( "/let/astformat@@flrule/empty" );@]@;
@[TeX_( "/yy0{/nx/flbolrule{/the/yy(2)}{/the/toksa}}" );@]@;
+@ @<Match an end of file@>=
+ @[TeX_( "/yy0{/nx/fleof/the/yy(1)}" );@]@;
+
@ @<Match an ordinary rule@>=
@[TeX_( "/toksa/expandafter{/astformat@@flrule}" );@]@;
@[TeX_( "/let/astformat@@flrule/empty" );@]@;
@[TeX_( "/yy0{/nx/flrule{/the/yy(1)}{/the/toksa}}" );@]@;
-@ @<Match an end of file@>=
- @[TeX_( "/yy0{/nx/fleof/the/yy(1)}" );@]@;
-
@ @<Report an error and quit@>=
@[TeX_( "/yyerror" );@]@;
-
-@ @<Rules for \flex\ regular expressions@>=
+
+@t}\endfoldedsections{@>
+
+@ Another broad overview of regular expression types before diving into the details
+of various operations. Note that the only trailing context that \splint\ output
+lexer can process is the end of line (\prodstyle{'\$'}) due to the way the
+scanner routine is written. It does not affect its ability to pretty print the appropriate
+rules (for a lexer that is produced by \flex\ itself, for example).
+@<Rules for \flex\ regular expressions@>=
@G
+@t}\vb{\insertraw{\beginfoldedsections}}{@>
rule:
re2 re {@> @<Match a regular expression with a trailing context@> @=}
| re2 re '$' {@> @<Disallow a repeated trailing context@> @=}
@@ -511,9 +592,22 @@ re2:
@ @<Prepare to match a trailing context@>=
@[TeX_( "/yy0{/nx/fltrail{/the/yy(1)}{/the/yy(2)}}" );@]@;
+
+ @t}\endfoldedsections{@>
-@ @<Rules for \flex\ regular expressions@>=
+@*2 Atoms. Every regular expression is assembled of atomic subexpressions, each
+of which may be modified by an repetition operator that establishes how many
+times a given pattern can repeat to stay part of the original atom. New atomic expressions
+(or \prodstyle{singleton}s as they are called below) can be formed the usual way, by
+enclosing a regular expression in parentheses.
+
+As explained \locallink{flex braces}above\endlink, braced repetition operators may
+have different binding strengths, depending on the options supplied to \flex. The pretty
+printing in both cases is identical as only the application scopes of the operator differ, and not
+its meaning.
+@<Rules for \flex\ regular expressions@>=
@G
+@t}\vb{\insertraw{\beginfoldedsections}}{@>
series:
series singleton {@> @<Extend a series by a singleton@> @=}
| singleton {@> @<Match a singleton@> @=}
@@ -540,9 +634,12 @@ series:
@ @<Match a series of exact length@>=
@<Create a series of exact length@>@;
-
+
+@t}\endfoldedsections{@>
+
@ @<Rules for \flex\ regular expressions@>=
@G
+@t}\vb{\insertraw{\beginfoldedsections}}{@>
singleton:
singleton '*' {@> @<Create a lazy series match@> @=}
| singleton '+' {@> @<Create a nonempty series match@> @=}
@@ -600,8 +697,15 @@ singleton:
@ @<Match a specific character@>=
@[TeX_( "/yy0{/nx/flchar/the/yy(1)}" );@]@;
-@ @<Rules for \flex\ regular expressions@>=
+@t}\endfoldedsections{@>
+
+@*2 Characters. Several facilities are available to specify sets of characters, including
+built-in characters classes such as {\em whitespace}, {\em printable characters},
+{\em alphanumerics}, etc. Some simple boolean operaions are also supported to make specifying
+character classes more efficient.
+@<Rules for \flex\ regular expressions@>=
@G
+@t}\vb{\insertraw{\beginfoldedsections}}{@>
fullccl:
fullccl CCL_OP_DIFF braceccl {@> @<Subtract a character class@> @=}
| fullccl CCL_OP_UNION braceccl {@> @<Create a union of character classes@> @=}
@@ -610,7 +714,7 @@ fullccl:
braceccl:
'[' ccl ']' {@> @<Create a character class@> @=}
- | '[' '^' ccl ']' {@> @<Create a complementary character class@> @=}
+ | '[' '^' ccl ']' {@> @<Complement a character class@> @=}
;
ccl:
@@ -633,11 +737,13 @@ ccl:
@ @<Create a character class@>=
@[TeX_( "/yy0{/nx/flbraceccl{/the/yy(1)}{/the/yy(2)}{/the/yy(3)}}" );@]@;
-@ @<Create a complementary character class@>=
- @[TeX_( "/yy0{/nx/flbracecclneg{/the/yy(1)}{/the/yy(3)}{/the/yy(4)}}" );@]@;
+@ @<Complement a character class@>=
+ @[TeXb( "/yy0{/nx/flbracecclneg" );@]@;
+ @[TeXfo( " {/the/yy(1)}{/the/yy(3)}{/the/yy(4)}}" );@]@;
@ @<Add a range to a character class@>=
- @[TeX_( "/yy0{/the/yy(1)/nx/flcclrnge{/nx/flchar/the/yy(2)}{/nx/flchar/the/yy(4)}}" );@]@;
+ @[TeXb( "/yy0{/the/yy(1)/nx/flcclrnge" );@]@;
+ @[TeXfo( " {/nx/flchar/the/yy(2)}{/nx/flchar/the/yy(4)}}" );@]@;
@ @<Add a character to a character class@>=
@[TeX_( "/yy0{/the/yy(1)/nx/flchar/the/yy(2)}" );@]@;
@@ -648,7 +754,12 @@ ccl:
@ @<Create an empty character class@>=
@[TeX_( "/yy0{}" );@]@;
-@ @<Rules for \flex\ regular expressions@>=
+@t}\endfoldedsections{@>
+
+@*3 Special character classes. Various character classes are predefined in \flex.
+These include alphabetic and alphanumeric characters, digits, blank characters, upper and lower
+case characters, etc.
+@<Rules for \flex\ regular expressions@>=
@G
ccl_expr:
@t}\vb{\flatten}{@>
@@ -696,7 +807,5 @@ string:
@ @<Make an empty regular expression string@>=
@[TeX_( "/yy0{}" );@]@;
-@ This is needed to get the |yytoknum| array. A trivial declaration suffices.
+@ The postamble is empty for now.
@<Postamble for \flex\ parser@>=
-#define YYPRINT(file, type, value) @[yyprint (file, type, value)@]
- static void yyprint (FILE *file, int type, YYSTYPE value){}
diff --git a/support/splint/cweb/lo.w b/support/splint/cweb/lo.w
index 68ef1b6595..c2461787a9 100644
--- a/support/splint/cweb/lo.w
+++ b/support/splint/cweb/lo.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020 Alexander Shibakov@>
+@q Copyright 2012-2024 Alexander Shibakov@>
@q Copyright 2002-2014 Free Software Foundation, Inc.@>
@q This file is part of SPLinT@>
@@ -18,6 +18,7 @@
@**The scanner for \ifx\bison\UNDEFINED\.{bison}\else\bison\fi\ syntax.
\ifx\bison\UNDEFINED
\input limbo.sty
+ \input yystype.sty
\input grabstates.sty
\immediate\openout\stlist=lo_states.h
\fi
@@ -95,7 +96,7 @@ output it in the form of a header file for the `real' lexer output
@ {\it A \Cee-like comment in directives/rules}.
@<Grammar lexer states@>=
-@G
+@G(fs1)
%x SC_YACC_COMMENT
@g
@@ -106,22 +107,26 @@ output it in the form of a header file for the `real' lexer output
%\tracerulestrue
%\traceactionstrue
%\tracebadcharstrue
+%\traceparseresultstrue
+%\traceparserstatestrue
%\prodstyle{\%\%}%
-\traceparserstatesfalse
-\tracestacksfalse
-\tracerulesfalse
-\traceactionsfalse
-\tracebadcharsfalse
-\yyflexdebugfalse
@<Grammar lexer states@>=
-@G
+@G(fs1)
%x SC_ESCAPED_STRING SC_ESCAPED_CHARACTER
@g
@ {\it A identifier was just read in directives/rules. Special state
to capture the sequence `\.{identifier:}'}.
+\traceparserstatesfalse
+\tracestacksfalse
+\tracerulesfalse
+\traceactionsfalse
+\tracebadcharsfalse
+\yyflexdebugfalse
+\traceparseresultsfalse
+\traceparserstatesfalse
@<Grammar lexer states@>=
-@G
+@G(fs1)
%x SC_AFTER_IDENTIFIER
@g
@@ -131,7 +136,7 @@ disallow \prodstyle{NUL}, as this simplifies our implementation. We match
angle brackets in nested pairs: several languages use them for
generics/template types}.
@<Grammar lexer states@>=
-@G
+@G(fs1)
%x SC_TAG
@g
@@ -150,25 +155,25 @@ Four types of user code:
\aterm predicate (code between \.{\%?\{} and \.{\}} in middle section);
}%
@<Grammar lexer states@>=
-@G
+@G(fs1)
%x SC_PROLOGUE SC_BRACED_CODE SC_EPILOGUE SC_PREDICATE
@g
@ {\it \Cee\ and \Ceepp\ comments in code}.
@<Grammar lexer states@>=
-@G
+@G(fs1)
%x SC_COMMENT SC_LINE_COMMENT
@g
@ {\it Strings and characters in code}.
@<Grammar lexer states@>=
-@G
+@G(fs1)
%x SC_STRING SC_CHARACTER
@g
@ Bracketed identifiers support.
@<Grammar lexer states@>=
-@G
+@G(fs1)
%x SC_BRACKETED_ID SC_RETURN_BRACKETED_ID
@g
@@ -179,9 +184,9 @@ Four types of user code:
@ The code for the generated scanner is highly dependent on the options
supplied. Most of the options below are essential for the scheme
-adopted in this package to work.
+adopted in this package to work.\gtextidx{\flex\ options example}{flex options example}{\flexidxdomain}%
@<Grammar lexer options@>=
-@G
+@G(fs1)
%option bison-bridge
%option noyywrap nounput noinput reentrant
%option noyy_top_state
@@ -194,7 +199,6 @@ adopted in this package to work.
Here is a full list of regular expressions recognized by the \bison\ scanner.
@<Grammar token regular expressions@>=
@<Scan grammar white space@>@;
- @<Scan \flex\ directives and options@>@;
@<Scan \bison\ directives@>@;
@<Do not support zero characters@>@;
@<Scan after an identifier, check whether a colon is next@>@;
@@ -340,23 +344,11 @@ returns a pair of pointers as the value.
}
@g
-@ Some additional constructs needed to typeset simple \flex\
-declarations. This is not part of the original \bison\ scanner.
-@<Scan \flex\ directives and options@>=
-@G(fs2)
-<INITIAL>
-{
- "%option" {@> @[TeX_( "/yylexreturnptr{FLEX_OPTION}" );@]@=}
- "%x" {@> @[TeX_( "/yylexreturnptr{FLEX_STATE_X}" );@]@=}
- "%s" {@> @[TeX_( "/yylexreturnptr{FLEX_STATE_S}" );@]@=}
-}
-@g
-
@ We present the `bad character' code first, before going into the details
of the character matching by the rest of the lexer.
@<Process a bad character@>=
- @[TeX_( "/edef/next{/nx/csname lexspecial[/the/yytextpure]/nx/endcsname}" );@]@;
- @[TeX_( "/expandafter/expandafter/expandafter/ifx/next/relax" );@]@;
+ @[TeX_( "/expandafter/let/expandafter/next/csname lexspecial[/the/yytextpure]/endcsname" );@]@;
+ @[TeX_( "/ifx/next/relax" );@]@;
@[TeX_( " /iftracebadchars" );@]@;
@[TeX_( " /yyfatal{invalid character(s): /the/yytext}" );@]@;
@[TeX_( " /fi" );@]@;
@@ -436,13 +428,12 @@ later, after the context is known.
@ @<Process the bracketed part of an identifier@>=
@[TeX_( "/ifx/bracketedidstr/empty" );@]@;
@[TeX_( " /bracketedidcontextstate/YYSTART /yyBEGIN{SC_BRACKETED_ID}" );@]@;
- @[TeX_( " /let/next=/yylexnext" );@]@;
+ @[TeX_( " /yybreak/yylexnext" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /ROLLBACKCURRENTTOKEN" );@]@;
@[TeX_( " /yyBEGIN{SC_RETURN_BRACKETED_ID}" );@]@;
- @[TeX_( " /def/next{/yylexreturn{ID}}" );@]@;
- @[TeX_( "/fi" );@]@;
- @[TeX_( "/next" );@]@;
+ @[TeX_( " /yybreak{/yylexreturn{ID}}" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Process a colon after an identifier@>=
@[TeX_( "/ifx/bracketedidstr/empty" );@]@;
@@ -485,27 +476,25 @@ later, after the context is known.
@[TeX_( "/ifx/bracketedidstr/empty" );@]@;
@[TeX_( " /edef/bracketedidstr{{/the/yytextpure}{/the/yytext}" );@]@;
@[TeX_( " {/the/yyfmark}{/the/yysmark}}" );@]@;
- @[TeX_( " /let/next=/yylexnext" );@]@;
+ @[TeX_( " /yybreak/yylexnext" );@]@;
@[TeX_( "/else" );@]@;
- @[TeX_( " /def/next{/yywarn{unexpected identifier " );@]@;
+ @[TeX_( " /yybreak{/yywarn{unexpected identifier " );@]@;
@[TeX_( " in bracketed name: /the/yytext}}" );@]@;
- @[TeX_( "/fi" );@]@;
- @[TeX_( "/next" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Finish processing bracketed identifier@>=
@[TeX_( "/yyBEGINr/bracketedidcontextstate" );@]@;
@[TeX_( "/ifx/bracketedidstr/empty" );@]@;
- @[TeX_( " /def/next{/yywarn{an identifier expected}}" );@]@;
+ @[TeX_( " /yybreak{/yywarn{an identifier expected}}" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /ifnum/bracketedidcontextstate=/yylexstate{INITIAL}/relax" );@]@;
@[TeX_( " /expandafter/yylval/expandafter{/bracketedidstr}" );@]@;
@[TeX_( " /let/bracketedidstr=/empty" );@]@;
- @[TeX_( " /def/next{/yylexreturn{BRACKETED_ID}}" );@]@;
+ @[TeX_( " /yybreak@@{/yylexreturn{BRACKETED_ID}}" );@]@;
@[TeX_( " /else" );@]@;
- @[TeX_( " /let/next=/yylexnext" );@]@;
+ @[TeX_( " /yybreak@@/yylexnext" );@]@;
@[TeX_( " /fi" );@]@;
- @[TeX_( "/fi" );@]@;
- @[TeX_( "/next" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Complain about improper identifier characters@>=
@[TeX_( "/yyfatal{invalid character(s) in bracketed name: /the/yytext}" );@]@;
@@ -621,11 +610,10 @@ The initial quote is already eaten}.
@[TeX_( " {/the/yyfmark}{/the/yysmark}}}/next" );@]@;
@[TeX_( " /STRINGFREE" );@]@;
@[TeX_( " /yyBEGIN{INITIAL}" );@]@;
- @[TeX_( " /def/next{/yylexreturn{TAG}}" );@]@;
+ @[TeX_( " /yybreak{/yylexreturn{TAG}}" );@]@;
@[TeX_( "/else" );@]@;
- @[TeX_( " /STRINGGROW/let/next=/yylexnext" );@]@;
- @[TeX_( "/fi" );@]@;
- @[TeX_( "/next" );@]@;
+ @[TeX_( " /STRINGGROW/yybreak/yylexnext" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ This is a slightly different rule from the original scanner. We do not perform |yyleng| computations,
so it makes sense to raise the nesting level one by one.
@@ -722,13 +710,12 @@ braced code.
@[TeX_( "/ifnum/lonesting</z@@" );@]@;
@[TeX_( " /STRINGFINISH" );@]@;
@[TeX_( " /edef/next{/yylval{{/the/laststring}{/the/yyfmark}{/the/yysmark}}}/next" );@]@;
- @[TeX_( " /def/next{/yylexreturn{BRACED_CODE}}" );@]@;
@[TeX_( " /yyBEGIN{INITIAL}" );@]@;
+ @[TeX_( " /yybreak{/yylexreturn{BRACED_CODE}}" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /STRINGGROW" );@]@;
- @[TeX_( " /let/next=/yylexnext" );@]@;
- @[TeX_( "/fi" );@]@;
- @[TeX_( "/next" );@]@;
+ @[TeX_( " /yybreak/yylexnext" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Add closing brace to a predicate@>=
@[TeX_( "/advance/lonesting/m@@ne" );@]@;
@@ -736,12 +723,11 @@ braced code.
@[TeX_( " /STRINGFINISH" );@]@;
@[TeX_( " /edef/next{/yylval{{/the/laststring}{/the/yyfmark}{/the/yysmark}}}/next" );@]@;
@[TeX_( " /yyBEGIN{INITIAL}" );@]@;
- @[TeX_( " /def/next{/yylexreturn{BRACED_PREDICATE}}" );@]@;
+ @[TeX_( " /yybreak{/yylexreturn{BRACED_PREDICATE}}" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /STRINGGROW" );@]@;
- @[TeX_( " /let/next=/yylexnext" );@]@;
- @[TeX_( "/fi" );@]@;
- @[TeX_( "/next" );@]@;
+ @[TeX_( " /yybreak/yylexnext" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ {\it Scanning some prologue: from \.{\%\{} (already scanned) to \.{\%\}}}.
@<Scan prologue@>=
diff --git a/support/splint/cweb/mkeparser.w b/support/splint/cweb/mkeparser.w
index f60ccf5d64..79505b3be4 100644
--- a/support/splint/cweb/mkeparser.w
+++ b/support/splint/cweb/mkeparser.w
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -24,7 +24,7 @@ Sourcer(er?) (\.{bs.w}) which will be included as soon as this paragraph is
over. Since the main function of this code is to {\it dump\/} tables
produced by \bison, and a {\it bison\/} is a large buffalo like
animal, {\it and\/} the only reason it has to be done like this is due
-to the less than optimal choices of a few developers, feel free to
+to a less than optimal choices of a few developers, feel free to
interpret the acronym as something easier to remember.
@ @<Table names@>=
@@ -32,6 +32,9 @@ interpret the acronym as something easier to remember.
@ @<Constant names@>=
@<Parser constants@>@;
+#ifdef YYEOF
+ @<Parser virtual constants@>@;
+#endif
@ @<Local variable and type declarations@>=
@<Variables and types local to the parser@>@;
@@ -83,6 +86,7 @@ interpret the acronym as something easier to remember.
@ @<\Cee\ preamble@>=
@<Common code for \Cee\ preamble@>@;
+ @<\Cee\ setup code specific to \bison@>@;
@i common.w
@i bs.w
diff --git a/support/splint/cweb/mkscanner.w b/support/splint/cweb/mkscanner.w
index e847428199..05f22bd6e3 100644
--- a/support/splint/cweb/mkscanner.w
+++ b/support/splint/cweb/mkscanner.w
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/cweb/np.w b/support/splint/cweb/np.w
index 58379649a5..a4216ee058 100644
--- a/support/splint/cweb/np.w
+++ b/support/splint/cweb/np.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2024, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
@@ -18,7 +18,11 @@
name processing. This approach (i.e. using a `full blown' parser/scanner
combination) is probably not the best way to implement such machinery
but its main purpose is to demonstrate a way to create a separate
-parser for local purposes.
+parser for local purposes. The name parser is what allows one to
+automatically typeset term names such as \.{example1}
+and \.{\%option\_name} as \prodstyle{example1} and \prodstyle{\%option_name}.
+@q The reference to \prodstyle{example1} above serves a dual role of correcting@>
+@q an owerfull \vbox in the index.@>
% We include the macros here since this file is intended to be
% included by the documentation `aggregator' so putting bare \TeX\
% at the beginning of the file runs the risk of producing and error
@@ -61,7 +65,7 @@ parser for local purposes.
@G
full_name:
identifier_string suffixes.opt {@> @<Compose the full name@> @=}
-| META_IDENTIFIER {@> @<Turn a \prodstylens{META\_IDENTIFIER}{\smallnamespace} into a full name@> @=}
+| META_IDENTIFIER {@> @<Turn a \prodstylens{META_IDENTIFIER}{\smallnamespace} into a full name@> @=}
| quoted_name suffixes.opt {@> @<Compose the full name@> @=}
;
@@ -123,7 +127,7 @@ qualifier:
@ @<Compose the full name@>=
@[TeX_( "/yy0{/the/yy(1)/the/yy(2)}/namechars/yyval" );@]@;
-@ @<Turn a \prodstylens{META\_IDENTIFIER}{\smallnamespace} into a full name@>=
+@ @<Turn a \prodstylens{META_IDENTIFIER}{\smallnamespace} into a full name@>=
@[TeX_( "/getfirst{/yy(1)}/to/toksa" );@]@;
@[TeX_( "/getsecond{/yy(1)}/to/toksb" );@]@;
@[TeX_( "/yy0{/nx/idstr{/the/toksa}{/the/toksb}}/namechars/yyval" );@]@;
@@ -138,7 +142,9 @@ qualifier:
@[TeX_( "/getsecond{/yy(1)}/to/toksb" );@]@;
@[TeX_( "/yy0{/nx/idstr{/the/toksa}{/the/toksb}}" );@]@;
-@ @<Start with a tag@>=
+@ Tags are recognized as a separate syntax element although no special
+processing is performed by the name parser or the associated macros.
+@<Start with a tag@>=
@[TeX_( "/getfirst{/yy(2)}/to/toksa" );@]@;
@[TeX_( "/getsecond{/yy(2)}/to/toksb" );@]@;
@[TeX_( "/yy0{/nx/idstr{</the/toksa>}{</the/toksb>}}" );@]@;
@@ -193,14 +199,15 @@ qualifier:
@ An integer at the end of an identifier (such as |id1|) is
interpreted as a suffix (similar to the way \MF\ treats identifiers,
-and \mft\ typesets them\footnote{This allows, for example, names like
-|$[term0]| while leaving |$[char2int]| in its `natural' form.}) to
+and \mft\ typesets them,\footnote{This allows, for example, names like
+|$[term0]| while leaving |$[char2int]| in its `natural' form.} as \prodstyle{id1}) to
mitigate a well-intentioned but surprisingly inconvenient feature of
\CTANGLE, namely outputting something like \.{id.1} as \.{id\ .1} in an
attempt to make sure that integers do not interfere with structure
dereferences. For this to produce meaningful results, a stricter
interpretation of \prodstyle{IDENTIFIER} syntax is required,
-represented by the \.{id\_strict} syntax below.
+represented by the \flexrenstyle{id\_strict} syntax
+\locallink{id_strict definition}below\endlink.
@<Attach an integer@>=
@[TeX_( "/yy0{/the/yy(1)/nx/dotsp/nx/sfxi/the/yy(2)}" );@]@;
@@ -251,8 +258,6 @@ as they have to be inserted in a place that is aware of the internal definitions
definitions are used.
@<Name parser \Cee\ postamble@>=
-#define YYPRINT(file, type, value) @[yyprint (file, type, value)@]
- static void yyprint (FILE *file, int type, YYSTYPE value){}
@ Union of types.
@@ -281,7 +286,10 @@ void define_all_states( void ) {
@o
@g
-@ @<Lexer definitions@>=
+@ \namedspot{id_strict definition}The tokens consumed by the name parser must
+represent a relatively fine classification of various identifier substrings to be able to
+detect various suffixes.
+@<Lexer definitions@>=
@<Lexer states@>@;
@G(fs1)
letter [_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]
@@ -300,7 +308,7 @@ int [0-9]+
@ Strings and characters in directives/rules.
@<Lexer states@>=
-@G
+@G(fs1)
%x SC_ESCAPED_STRING SC_ESCAPED_CHARACTER
@g
@@ -310,7 +318,7 @@ int [0-9]+
#include <stdbool.h>
@ @<Lexer options@>=
-@G
+@G(fs1)
%option bison-bridge
%option noyywrap nounput noinput reentrant
%option noyy_top_state
diff --git a/support/splint/cweb/philosophy.w b/support/splint/cweb/philosophy.w
index 7b173f5d2f..1f5c4a3dfc 100644
--- a/support/splint/cweb/philosophy.w
+++ b/support/splint/cweb/philosophy.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2022, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
@@ -64,6 +64,12 @@ they set a special reading rhythm, which is an added bonus in many
cases, although their presense openly violates
the `universally gray pages are a must' dogma.
+One final remark concerns the abundance of footnotes in this manual. I confess,
+there is almost no reason for it $\ldots$ except {\em I like footnotes\/}!
+They help introduce the air of mystery and adventure to an otherwise boring
+text. They are akin to the author wispering a secret in the reader's
+ear\footnote{Breaking convention by making the pages even less uniform is an added bonus.}.
+
@*1 Why GPL.
Selecting the license for this project involves more than the
availability of the source code. \TeX, by its very nature is an
@@ -191,12 +197,19 @@ the language. `Make it object-oriented' is neither a good reason nor a
clearly defined one, however.
@*1 Why not $*$\TeX.
-Simple. I never use it and have no idea of how packages, classes,
+Simple. I rarely, if ever\footnote{In some cases, a publisher would only accept
+a \LaTeX\ document, sadly. Better than most alternatives though.},
+use it and have no idea of how packages, classes,
etc., are designed. I have heard it has impressive mechanisms for
dealing with various problems commonly encountered in \TeX. Sadly, my
-knowledge of $*$\TeX\ machinery is almost nonexistent. This may change
-but right now I have tried to make the macros as generic as possible,
-hopefully making $*$\TeX\ adaptation easy.
+knowledge of $*$\TeX\ machinery is almost nonexistent\footnote{I am well familiar
+with the programming that went into \LaTeX, which is of highest quality. I do not
+share the design philosophy though and try to use only the most standard features}.
+This may change but right now I have tried to make the macros as generic as possible,
+hopefully making $*$\TeX\ adaptation easy\footnote{Unfortunately some redesign would
+be certainly necessary. Thus, \splint\ relies on the way plain \TeX\ allocates token
+registers so if the corresponding scheme in \LaTeX\ is drastically different, this
+portion of the macros would have to be rewritten.}.
The following quote from \cite[Ho] makes me feel particularly uneasy
about the current state of development of various \TeX\ variants:
@@ -205,7 +218,7 @@ and even more important is that the general impression is that of a finished boo
sometimes it seems like\/ \.{WEB} actively discourages development. This is
a subjective point, but nevertheless a quite important one.}''
-{\it Discouraging development\/} seems like a good thing to
+{\it Discouraging development\/} seems like a good feature to
me. Otherwise we are one step away from encouraging writing poor
software with inadequate tools merely `to encourage development'.
@@ -300,7 +313,7 @@ inserts \.{\\hbox\{\}}$\,$\TeX\ stuff$\,$\.{\{\}} into \CWEAVE's output. The
cost of this hack (aside from looking and feeling rather ugly on the
editor screen, not to mention disrupting the editor's brace
accounting) is a superfluous \.{\\hbox\{\}} left behind {\em before\/}
-the `\TeX\ stuff'. The programmer's provided \TeX\ code is unable to
+the `\TeX\ stuff'. The programmer provided \TeX\ code is unable to
remove this box (at the macro level, i.e.~in \TeX's `mouth' using
D.~Knuth's terminology, one may still succeed with the \.{\\lastbox}
approach unless the \.{\\hbox} was inserted in the main vertical mode)
@@ -312,6 +325,16 @@ cases such side-effects are indeed desirable, and save the programmer some
typing but it seems that the \.{@@t} facility was not well thought
out in its entirety.}.
+Continuing with the theme of inserting \TeX\ material into \CWEAVE\ output,
+another one of \CWEB's inflexibilities is the lack of means of inserting
+\TeX\ {\em between\/} sections. While inserting pure text may be arranged by
+putting a codeless section after the one with the code (appropriate macros
+can be written to suppress the generation of a reference to such a section),
+inserting command sequences that affect, say, the typesetting style
+of the consequent sections is not so easy. The trick with a `fake' section below
+will be quite visible in the final output which is almost always undesirable.
+Using the \.{@@t} mechanism is also far from ideal.
+
In general, the lack of structure in \CWEAVE's generated \TeX\ seems
to hinder even seemingly legitimate uses of \.{cwebmac.tex}
macros. Even such a natural desire as to use a different type size for
diff --git a/support/splint/cweb/references.w b/support/splint/cweb/references.w
index 83397c93bb..3824972d65 100644
--- a/support/splint/cweb/references.w
+++ b/support/splint/cweb/references.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2022, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
diff --git a/support/splint/cweb/so.w b/support/splint/cweb/so.w
index d7a7696b8c..944f2cb82f 100644
--- a/support/splint/cweb/so.w
+++ b/support/splint/cweb/so.w
@@ -32,6 +32,7 @@
@**The lexer for \ifx\flex\UNDEFINED\.{flex}\else\flex\ \fi syntax.
\ifx\flex\UNDEFINED
\input limbo.sty
+ \input yystype.sty
\input grabstates.sty
\immediate\openout\stlist=fil_states.h
\fi
@@ -43,16 +44,31 @@ to replace them with ordinary patterns and use |yyless()| in the actions.
@G
%{@> @<Preamble for \flex\ lexer@> @=%}
@> @<Options for \flex\ input lexer@> @=
- @> @<Additional options for \flex\ input lexer@> @=
+ @> @<Output file for \flex\ input lexer@> @=
@> @<State definitions for \flex\ input lexer@> @=
@> @<Definitions for \flex\ input lexer@> @=
%%
@> @<Postamble for \flex\ input lexer@> @=
+ @> @<Common patterns for \flex\ lexer@> @=
@> @<Patterns for \flex\ lexer@> @=
%%
@> @<Auxilary code for \flex\ lexer@> @=
@g
+@ Bootstrap lexer.
+@(ssfs.ll@>=
+@G
+%{@> @<Preamble for \flex\ lexer@> @=%}
+ @> @<Options for \flex\ input lexer@> @=
+ @> @<Output file for the bootstrap \flex\ lexer@> @=
+ @> @<Definitions for \flex\ input lexer@> @=
+%%
+ @> @<Common patterns for \flex\ lexer@> @=
+ @> @<Catchall rule for the bootstrap lexer@> @=
+%%
+ @> @<Auxilary code for the bootstrap \flex\ lexer@> @=
+@g
+
@ @<Preamble for \flex\ lexer@>=
@ There are a few options that are necessary to ensure that the lexer
@@ -60,27 +76,31 @@ functions properly. Some of them (like \.{caseless}) directly
affect the behavior of the scanner, others (e.g.~\.{noyy\_top\_state})
prevent generation of unnecessary code.
@<Options for \flex\ input lexer@>=
-@G
+@G(fs1)
%option caseless nodefault stack noyy_top_state
%option nostdinit
-@g
-
-@ @<Additional options for \flex\ input lexer@>=
-@G
%option bison-bridge
%option noyywrap nounput noinput reentrant
%option debug
%option stack
+
+@ @<Output file for \flex\ input lexer@>=
+@G(fs1)
%option outfile="fil.c"
@g
+@ @<Output file for the bootstrap \flex\ lexer@>=
+@G(fs1)
+%option outfile="ssfs.c"
+@g
+
@*1 Regular expression and state definitions.
The lexer uses a large number of states to control its operation. Both
section~1 and section~2 rules rely on the scanner being in the
appropriate state. Otherwise (see \.{symbols.sty} example) the lexer
may parse the same fragment in a wrong context.
@<State definitions for \flex\ input lexer@>=
-@G
+@G(fs1)
%x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE
%x FIRSTCCL CCL ACTION RECOVER COMMENT ACTION_STRING PERCENT_BRACE_ACTION
%x OPTION LINEDIR CODEBLOCK_MATCH_BRACE
@@ -132,7 +152,7 @@ M4QEND "]]"
@*1 Regular expressions for \flex\ input scanner.
The code below treats \prodstyle{\%pointer} and \prodstyle{\%array} the same way it treats
\prodstyle{\%option} while typesetting.
-@<Patterns for \flex\ lexer@>=
+@<Common patterns for \flex\ lexer@>=
@G(fs2)
<INITIAL>{
^{WS} {@> @[TeX_( "/flindented@@codetrue/yyBEGIN{CODEBLOCK}/yylexnext" );@]@=}
@@ -211,7 +231,7 @@ The code below treats \prodstyle{\%pointer} and \prodstyle{\%array} the same way
<LINEDIR>{
\n {@> @[TeX_( "/yypopstate/yylexnext" );@]@=}
- [[:digit:]]+ {@> @[TeX_( "/fllinenum=/number/yytext/yylexnext" );@]@=}
+ [[:digit:]]+ {@> @[TeX_( "/fllinenum=/number/the/yytext/yylexnext" );@]@=}
\"[^"\n]*\" {@> @[TeX_( "/yylexnext" );@] /* ignore the file name in the line directives */ @=}
. {@> @[TeX_( "/yylexnext" );@] /* ignore spurious characters */ @=}
}
@@ -257,10 +277,10 @@ The code below treats \prodstyle{\%pointer} and \prodstyle{\%array} the same way
@ @<Complain if not inside a definition, continue otherwise@>=
@[TeX_( "/iffldidadef" );@]@;
@[TeX_( " /yylval/expandafter{/flnmdef}" );@]@;
- @[TeX_( " /def/next{/flinc@@linenum/yyBEGIN{INITIAL}/yylexreturn{RE_DEF}}" );@]@;
+ @[TeX_( " /yybreak{/flinc@@linenum/yyBEGIN{INITIAL}/yylexreturn{RE_DEF}}" );@]@;
@[TeX_( "/else" );@]@;
- @[TeX_( " /def/next{/yyfatal{incomplete name definition}}" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( " /yybreak{/yyfatal{incomplete name definition}}" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Patterns for \flex\ lexer@>=
@G(fs2)
@@ -390,7 +410,6 @@ The code below treats \prodstyle{\%pointer} and \prodstyle{\%array} the same way
<RECOVER>.*{NL} {@> @[TeX_( "/flinc@@linenum/yyBEGIN{INITIAL}/yylexnext" );@] @=}
@ Like \bison, \flex\ allows insertion of \Cee\ code in the middle of the input file.
-\saveparseoutputtrue
@<Patterns for \flex\ lexer@>=
@G(fs2)
<SECT2PROLOG>{
@@ -407,7 +426,6 @@ The code below treats \prodstyle{\%pointer} and \prodstyle{\%array} the same way
}
@ All the code inside is ignored.
-\saveparseoutputfalse
@<Consume the brace and increment the brace level@>=
@[TeX_( "/flinc/flbracelevel/yyless{2}/yylexnext" );@]@;
@@ -416,13 +434,16 @@ The code below treats \prodstyle{\%pointer} and \prodstyle{\%array} the same way
@ @<Begin section 2, prepare to reread, or ignore braced code@>=
@[TeX_( "/ifnum/flbracelevel>/z@@" );@]@;
- @[TeX_( " /let/next/yylexnext" );@]@;
+ @[TeX_( " /yybreak/yylexnext" );@]@;
@[TeX_( "/else" );@]@;
- @[TeX_( " /def/next{/yysetbol{/@@ne}/yyBEGIN{SECT2}/yyless{0}/yylexnext}" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( " /yybreak{/yysetbol{/@@ne}/yyBEGIN{SECT2}/yyless{0}/yylexnext}" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ A pattern below (for the character class processing) had to be broken into two lines.
-A symbol ($\odot$@^$\odot$ separator, \flex@>) was inserted to indicate that a break had occured. The macros for \flex\
+A special symbol ($\odot$\gtextidx{$\odot$ separator, \flex}{0. separator, flex}{\flexidxdomain})
+has been inserted to indicate that a break had occured.
+
+The macros for \flex\
typesetting use a different mechanism from that of \bison\ macros and allow typographic
corrections to be applied to sections of the \flex\ code represented by various nonterminals.
These corrections can also be delayed. For the details, an interested reader may consult
@@ -477,14 +498,14 @@ These corrections can also be delayed. For the details, an interested reader may
@ @<Process a repeat pattern@>=
@[TeX_( "/yyless{1}/yyBEGIN{NUM}" );@]@;
@[TeX_( "/iffllex@@compat" );@]@;
- @[TeX_( " /def/next{/yylexreturn{BEGIN_REPEAT_POSIX}}" );@]@;
+ @[TeX_( " /yybreak{/yylexreturn{BEGIN_REPEAT_POSIX}}" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /ifflposix@@compat" );@]@;
- @[TeX_( " /def/next{/yylexreturn{BEGIN_REPEAT_POSIX}}" );@]@;
+ @[TeX_( " /yybreak@@{/yylexreturn{BEGIN_REPEAT_POSIX}}" );@]@;
@[TeX_( " /else" );@]@;
- @[TeX_( " /def/next{/yylexreturn{BEGIN_REPEAT_FLEX}}" );@]@;
+ @[TeX_( " /yybreak@@{/yylexreturn{BEGIN_REPEAT_FLEX}}" );@]@;
@[TeX_( " /fi" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Process braced code in the middle of section 2@>=
@[TeX_( "/def/flbracelevel{1}" );@]@;
@@ -492,17 +513,17 @@ These corrections can also be delayed. For the details, an interested reader may
@[TeX_( "/ifflin@@rule" );@]@;
@[TeX_( " /fldoing@@rule@@actiontrue" );@]@;
@[TeX_( " /flin@@rulefalse" );@]@;
- @[TeX_( " /def/next{/yylexreturnxchar/n}" );@]@;
+ @[TeX_( " /yybreak{/yylexreturnxchar/n}" );@]@;
@[TeX_( "/else" );@]@;
- @[TeX_( " /let/next/yylexnext" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( " /yybreak/yylexnext" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ This action has been changed to accomodate the new grammar. The separator (\.{\yl})
is treated as an ordinary (empty) action.
@<Process a deferred action@>=
@[TeX_( "/ifflsf@@skip@@ws" );@]@;/* whitespace ignored, still inside a pattern */
@[TeX_( " /yylessafter{|}" );@]@;
- @[TeX_( " /let/next/yylexnext" );@]@;
+ @[TeX_( " /yybreak/yylexnext" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /flinc@@linenum" );@]@;
@[TeX_( " /fldoing@@rule@@actiontrue" );@]@;
@@ -510,8 +531,8 @@ is treated as an ordinary (empty) action.
@[TeX_( " /flcontinued@@actiontrue" );@]@;
@[TeX_( " /unput{/n}" );@]@;
@[TeX_( " /yyBEGIN{ACTION}" );@]@;
- @[TeX_( " /edef/next{/nx/yylexreturnxchar/n}" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( " /yybreak{/yylexreturnxchar/n}" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Process a comment inside a pattern@>=
@[TeX_( "/ifflsf@@skip@@ws" );@]@;
@@ -525,7 +546,7 @@ is treated as an ordinary (empty) action.
@ @<Decide whether to start an action or skip whitespace inside a rule@>=
@[TeX_( "/ifflsf@@skip@@ws" );@]@;
- @[TeX_( " /let/next/yylexnext" );@]@;
+ @[TeX_( " /yybreak/yylexnext" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /def/flbracelevel{0}" );@]@;
@[TeX_( " /flcontinued@@actionfalse" );@]@;
@@ -533,16 +554,16 @@ is treated as an ordinary (empty) action.
@[TeX_( " /ifflin@@rule" );@]@;
@[TeX_( " /fldoing@@rule@@actiontrue" );@]@;
@[TeX_( " /flin@@rulefalse" );@]@;
- @[TeX_( " /def/next{/yylexreturnxchar/n}" );@]@;
+ @[TeX_( " /yybreak@@{/yylexreturnxchar/n}" );@]@;
@[TeX_( " /else" );@]@;
- @[TeX_( " /let/next/yylexnext" );@]@;
+ @[TeX_( " /yybreak@@/yylexnext" );@]@;
@[TeX_( " /fi" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Finish the line and/or action@>=
@[TeX_( "/ifflsf@@skip@@ws" );@]@;
@[TeX_( " /flinc@@linenum" );@]@;
- @[TeX_( " /let/next/yylexnext" );@]@;
+ @[TeX_( " /yybreak/yylexnext" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /def/flbracelevel{0}" );@]@;
@[TeX_( " /flcontinued@@actionfalse" );@]@;
@@ -551,11 +572,11 @@ is treated as an ordinary (empty) action.
@[TeX_( " /ifflin@@rule" );@]@;
@[TeX_( " /fldoing@@rule@@actiontrue" );@]@;
@[TeX_( " /flin@@rulefalse" );@]@;
- @[TeX_( " /def/next{/yylexreturnxchar/n}" );@]@;
+ @[TeX_( " /yybreak@@{/yylexreturnxchar/n}" );@]@;
@[TeX_( " /else" );@]@;
- @[TeX_( " /let/next/yylexnext" );@]@;
+ @[TeX_( " /yybreak@@/yylexnext" );@]@;
@[TeX_( " /fi" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Start section 3@>=
@[TeX_( "/def/flsectnum{3}" );@]@;
@@ -596,26 +617,26 @@ The braces and the possible trailing whitespace will be dealt with by the typese
@ @<Determine if this is extended syntax or return a parenthesis@>=
@[TeX_( "/iffllex@@compat" );@]@;
- @[TeX_( " /def/next{/yyless{1}/flsf@@push/yylexreturnraw(}" );@]@;
+ @[TeX_( " /yybreak{/yyless{1}/flsf@@push/yylexreturnraw(}" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /ifflposix@@compat" );@]@;
- @[TeX_( " /def/next{/yyless{1}/flsf@@push/yylexreturnraw(}" );@]@;
+ @[TeX_( " /yybreak@@{/yyless{1}/flsf@@push/yylexreturnraw(}" );@]@;
@[TeX_( " /else" );@]@;
- @[TeX_( " /def/next{/yypushstate{EXTENDED_COMMENT}}" );@]@;
+ @[TeX_( " /yybreak@@{/yypushstate{EXTENDED_COMMENT}}" );@]@;
@[TeX_( " /fi" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Determine if this is a parametric group or return a parenthesis@>=
@[TeX_( "/flsf@@push" );@]@;
@[TeX_( "/iffllex@@compat" );@]@;
- @[TeX_( " /def/next{/yyless{1}}" );@]@;
+ @[TeX_( " /yybreak{/yyless{1}}" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /ifflposix@@compat" );@]@;
- @[TeX_( " /def/next{/yyless{1}}" );@]@;
+ @[TeX_( " /yybreak@@{/yyless{1}}" );@]@;
@[TeX_( " /else" );@]@;
- @[TeX_( " /def/next{/yyBEGIN{GROUP_WITH_PARAMS}}" );@]@;
+ @[TeX_( " /yybreak@@{/yyBEGIN{GROUP_WITH_PARAMS}}" );@]@;
@[TeX_( " /fi" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@[TeX_( "/yylexreturnraw(" );@]@;
@ @<Patterns for \flex\ lexer@>=
@@ -708,14 +729,14 @@ The braces and the possible trailing whitespace will be dealt with by the typese
@ @<Finish the repeat pattern@>=
@[TeX_( "/yyBEGIN{SECT2}" );@]@;
@[TeX_( "/iffllex@@compat" );@]@;
- @[TeX_( " /def/next{/yylexreturn{END_REPEAT_POSIX}}" );@]@;
+ @[TeX_( " /yybreak{/yylexreturn{END_REPEAT_POSIX}}" );@]@;
@[TeX_( "/else" );@]@;
@[TeX_( " /ifflposix@@compat" );@]@;
- @[TeX_( " /def/next{/yylexreturn{END_REPEAT_POSIX}}" );@]@;
+ @[TeX_( " /yybreak@@{/yylexreturn{END_REPEAT_POSIX}}" );@]@;
@[TeX_( " /else" );@]@;
- @[TeX_( " /def/next{/yylexreturn{END_REPEAT_FLEX}}" );@]@;
+ @[TeX_( " /yybreak@@{/yylexreturn{END_REPEAT_FLEX}}" );@]@;
@[TeX_( " /fi" );@]@;
- @[TeX_( "/fi/next" );@]@;
+ @[TeX_( "/yycontinue" );@]@;
@ @<Patterns for \flex\ lexer@>=
@@ -833,3 +854,19 @@ void define_all_states( void ) {
#include "fil_states.h"
#undef _register_name
+@ @<Catchall rule for the bootstrap lexer@>=
+@G(fs2)
+<*>. {@> @[TeX_( "/yyerrterminate" );@] @=}
+
+@ The drive expects this function to be defined but the bootstrap
+lexer has no need for it. We leave it in to appease the compiler.
+@<Auxilary code for the bootstrap \flex\ lexer@>=
+void define_all_states( void ) {
+ @<Collect state definitions for the bootstrap \flex\ lexer@>@;
+}
+
+@ @<Collect state definitions for the bootstrap \flex\ lexer@>=
+#define _register_name( name ) @[Define_State( #name, name )@]
+ /* The \flexsnstyle{INITIAL} state is generated automatically */
+#undef _register_name
+
diff --git a/support/splint/cweb/splint.w b/support/splint/cweb/splint.w
index e50e090c32..4bf32953ff 100644
--- a/support/splint/cweb/splint.w
+++ b/support/splint/cweb/splint.w
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -13,19 +13,12 @@
%
% You should have received a copy of the GNU General Public License
% along with SPLinT. If not, see <http://www.gnu.org/licenses/>.
-%
-\newwrite\gindex % index entries generated by the various parsers, \prodstyle{...} commands, etc.
-%
+
\input limbo.sty
\input frontmatter.sty
\def\optimization{5}
\input yy.sty
\modenormal
-\input noweb.sty
- \xreflocaltrue
- \readlxrefs % read the reference file if exists before any sections appear
- \newwrite\xrefstream % references for noweb like style of sectioning.
- \immediate\openout\xrefstream=\jobname.xxr
% multi-column output
\input dcols.sty
\topskip=9pt % this is a purely aesthetic choice, also negating the \raggedbottom
@@ -71,9 +64,9 @@
\defreserved{Y}{\.{Y}}
\showlastactiontrue
+\initauxstream
@**Introduction.
-\setupfootnotes
\splint\footnote{I was tempted to call the package {\tt ParLALRgram}
which stands for Parsing {\sc LALR} Grammars or {\tt PinT} for
`Parsing in \TeX' but both sounded too generic.} (Simple Parsing and
@@ -117,9 +110,9 @@ output is some very rudimentary post- and pre-processing.
Our main concern is thus \CWEAVE\ that not only pretty prints the
program but also creates an index, cross-references all the
sections, etc. Getting \CWEAVE\ to pretty print a language other than
-\Cee\ requires some additional attention. A true digital warrior would
+\Cee\ requires some additional effort. A true digital warrior would
probably try to decipher \CWEAVE's output `in the raw' but, alas, my
-WebFu is not that strong. The loophole comes in the form of a rarely
+(C)WebFu is not that strong. The loophole comes in the form of a rarely
(for a good reason) used \CWEB\ command: the verbatim (\.{@@=...@@>})
output. The material to be output by this construct undergoes minimal
processing and is put inside \.{\\vb\{}$\ldots$\.{\}}. All that is
@@ -134,9 +127,9 @@ merely a brief overview of the approach.
Every \CWEB\ document is split into {\em sections}, each divided into
three parts (any one of which can be empty): the \TeX\ part, the middle part, and
-the \Cee\ part (which should more appropriately be called the {\em code
-part\/}). The code part of each\footnote{With the exception of the nameless \.{@@c}
-sections.} section carries a name for cross referencing
+the \Cee\ part (which should more appropriately be called the {\em code\/} or
+the {\em program\/} part). The \Cee\ part of each\footnote{With the exception of the
+nameless \.{@@c} (or \.{@@p}) sections.} section carries a name for cross referencing
purposes. The sections themselves are automatically numbered by \CWEAVE\ and
their code parts may be referenced from other sections, as well
as included in other sections' code parts using \CWEB's cross referencing
@@ -151,7 +144,7 @@ The original \CWEB\ macros (from \.{cwebmac.tex}) used the numbers
generated by \CWEAVE\ to refer to specific sections. This was true
for the table of contents, as well as the index entries. The macros
used by \splint\ adopt a different convention, proposed by N.~Ramsey
-for his literate programming software, \noweb. In the new system
+for his literate programming software \noweb. In the new system
(which will be referred to as the \noweb\ style of cross referencing),
each section is labelled by the page number where it starts and an
alphabetic character that indicates the order of appearance of the
@@ -163,10 +156,13 @@ section.
The top level (\.{@@**}) sections, introducing
major portions of the code have also been given more prominent
-appearance and carry a chapter number in addition to the the \noweb\
-style section number (the latter is used for cross references, as the
-chapter number gives no indication as to where the said chapter is
-located).
+appearance. They display the chapter number using a large typeface
+and omit the marginal section reference. References to such sections
+are typeset as {\it cnnn\/} where {\it nnn\/} represents the chapter
+number. While such references obscure the page number, hopefully one keeps
+the number of chapters, as well as such references, small. This
+modification improves the appearance of the first chapter pages.
+
\CWEB\ also generates an {\em index\/} of all the identifiers (with
some exceptions, such as single letter names) appearing in the
@@ -247,7 +243,7 @@ important application.
@*1 Parsing and parsers.
At an abstract level, a {\em parser@^parser@>\/} is just a routine
-that transforms text. Naturally, not every possible tranformation is
+that transforms text. Naturally, not every possible transformation is
beneficial, so, informally, the value of a parser lies in its ability
to expose some {\em meaning\/} in the text. If valid texts are reduced
to a small finite set (while each text can be arbitrarily long) one
@@ -342,7 +338,7 @@ longer strings.
Computing $m$ and $n$ above now reduces to incrementing an appropriate
variable upon exiting the corresponding function. More important,
-however, is the observation that this parsing algorithm can be
+however, is the observation that this parser specification can be
extracted from the grammar in a very straightforward fashion. To
better illustrate the r\^ole of the grammar in the choice of the
parsing algorithm, consider the following syntax for the same
@@ -364,10 +360,10 @@ astring:
\noindent While the language is unchanged, so the algorithm
above still works, the lookahead tokens are not {\em immediately\/}
apparent upon looking at the productions. Some preprocessing must take
-place before one can decide on the choice of parser states and the
-appropriate lookahead tokens. Such algorithms indeed exist and result
-in what is known as an {\sc LR} parser for the fragment above
-(actually, a simpler {\sc LALR} parser may be built for this
+place before one can decide on the choice of the parser states and the
+appropriate lookahead tokens. Such parser generating algorithms
+indeed exist and will produce what is known as an {\sc LR} parser
+for the fragment above (actually, a simpler {\sc LALR} parser may be built for this
grammar\footnote{Both of these algorithms will use the parser stack
more efficiently, effectively resolving the `call stack depth' issue
mentioned earlier.}). One can see that some grammar types may make
@@ -411,11 +407,12 @@ non_terminal:
@g
@ $\ldots$ if the syntax is correct.
-In case it is a bit off (note the missing colon after \.{whoops}), the parser will give up and
+In case it is a bit off (note the missing colon after \.{whoops} below), the parser will give up and
you will see a different result. The code in the fragment below is easily
recognizable, and some parts of it (all of \Cee\ code, in fact) are
still pretty printed by \CWEAVE. Only the verbatim portion is left
-unprocessed.
+unprocessed. The layout of the original code is reproduced unchanged, including the braces and production separators (i.e.\
+\.{\yl}) normally removed by the parser for presentation purposes.
@<A silly example@>=
@G
whoops
@@ -478,7 +475,7 @@ automatically from the \CWEB\ source file by the
\CWEAVE\ processing stage. All of these definitions can be
overwritten to get the desired output (say, one might want to typeset
\.{ID} in a roman font, as `identifier'; all that needs to be done to
-make this possible is a macro that says \.{\\prettywordpair\{ID\}\{\{\\rm
+make this possible is to provide a macro that says \.{\\prettywordpair\{ID\}\{\{\\rm
identifier\}\}} in an appropriate namespace (usually
\.{\\hostparternamespace})). The file \.{btokenset.sty} input above
contains a number of such definitions.
@@ -567,11 +564,11 @@ the file below.
@*1 On debugging. This concludes a short introduction to the \bison\
grammar pretty printing using this macro collection. It would be
-incomplete, however, without a short reference to debugging\footnote{Here
-we are talking about debugging the output produced by \CWEAVE\ when
+incomplete, however, without a short reference to debugging\footnote{At
+the moment we are discussing debugging the output produced by \CWEAVE\ when
the included \bison\ parser is used, {\it not\/} debugging parsers
written with the help of this software: the latter topic is covered in more
-detail later on}. There is a
+detail later on.}. There is a
fair amount of debugging information that the macros can output,
unfortunately, very little of it is tailored to the {\em use\/} of the
macros in the \bison\ parser. Most of it is designed to help build a
@@ -653,7 +650,7 @@ identifier determines its association with the appropriate set.}.
a collection of parsers, usually derived from a common set of
productions, and sharing a common lexer. As the name suggests, the
parsers in the collection are tried in order until the input is parsed
-successfully or every parser has been tried. This terminology may be the
+successfully or every parser has been tried. This terminology may become a
source of some confusion, since each parsing algorithm used by \bison\
maintains several stacks. We will always refer to them by naming a specific
task the stack is used for (such as the {\em value stack\/} or the
@@ -687,7 +684,7 @@ productions.
\aterm{term} in a narrow sense, an `element' of a grammar. Instead of
a long winded definition, an example, such as \prodstyle{ID} should
suffice. Terms are further classified into {\it terminals\/} (tokens)
-and {\it nonterminals\/} (which can be intuitively thought of as
+and {\it nonterminals\/} (which may be intuitively thought of as
composite terms).
\aterm{token} in short, an element of a set. Usually encoded as an
@@ -734,7 +731,7 @@ some attention, as well. There are a number of excellent programs
written to automate this step in much the same fashion as \bison\
automates the generation of parsers. One such tool, \flex, though
(in the opinion of this author) slightly lacking in the simplicity and
-elegance as compared to \bison, was used to implement the lexer for
+elegance when compared to \bison, was used to implement the lexer for
this software suite. Lexing in \TeX\ will be discussed in considerable
detail later in this manual.
@@ -750,7 +747,7 @@ syntax-directed translation} (which requires an appropriate
abstraction to represent \bison's actions inside \TeX). We shall
begin by discussing the parsing process itself.
-@*1 Arrays, stacks and the parser.
+@*1 Arrays, stacks, and the parser.
Let us briefly examine the programming environment offered by \TeX.
Designed for typesetting, \TeX's remarkable language
provides a layer of macro processing atop of a set of commands that
@@ -826,7 +823,9 @@ implementation). Since stacks pop up and disappear frequently (what
else are stacks to do?), list macros are usually used to store
them. The optimized parser uses a separate \.{\\count} register to
keep track of the top of the stack in the corresponding associative
-array.
+array\footnote{Which means, unfortunately, that making such fully optimized
+parser {\em reentrant\/} would take an extraordinary amount of effort. Hence,
+if reentrancy is a requirement, stacks are better kept inside list macros.}.
Let us now switch our attention
to the code that implements the parser and scanner {\it functions\/}.
@@ -1175,8 +1174,10 @@ token and move on but what if this was a control sequence? After all,
just as easily as \.{\\string} makes a sequence into characters,
\.{\\csname}$\,\ldots\,$\.{\\endcsname} pair will make any sequence of
characters into a control sequence so determining the end the character
-sequence produced by \.{\\string} may prove impossible. Huh~$\ldots$
-
+sequence produced by \.{\\string} may prove impossible.
+$$
+\hbox{Huh~$\ldots$}
+$$
What we need is a backup mechanism: keeping a copy of the
token sequence ahead, one can use \.{\\string} to see whether
the next token is a real
@@ -1233,7 +1234,7 @@ or even {\it tokener}), discussed in the next section.
@*1 Lexing in \TeX. In a typical system that uses a parser to process
text, the parsing pass is usually split into several stages: the raw
input, the lexical analysis (or simply {\it lexing}), and the parsing
-proper. The {\it lexing\/} (also called {\it scanning}, we use these
+proper. The {\it lexing\/} pass (also called {\it scanning}, we use these
terms interchangeably) clumps various sequences of characters into
{\it tokens\/} to facilitate the parsing stage. The reasons for this
particular hierarchy are largely pragmatic and are partially historic
@@ -1242,7 +1243,7 @@ phases, as well, although it usually isn't).
If one recalls a few basic facts from the formal language theory, it
becomes obvious that a lexer, that parses {\it regular\/} languages,
-can (theoretically) be replaced by an {\sc LALR} parser, that parses {\it
+can be (in theory) replaced by an {\sc LALR} parser, that parses {\it
context-free\/} ones (or some subset thereof, which is
still a super set of all regular languages). A common justification given for
creating specialized lexers is efficiency and speed. The
@@ -1266,7 +1267,10 @@ matching input is accepted. The only straightforward way to do this
with a traditional parser is to parse longer and longer inputs again
and again. While this process can be optimized to a certain degree,
the fact that a parser has a {\it stack\/} to maintain limits its
-ability to back up.
+ability to back up\footnote{It should be also mentioned that the fact that
+the lexing pass takes place prior to the parser consuming the resulting tokens
+allows one to process some grammars that are not context free. See, for example
+the {\em parser hack\/} used to process |typedef|s in \Cee.}.
As an aside, the mechanism by which \CWEB\ assembles its `scraps'
into chunks of recognized code is essentially iterative lexing,
@@ -1450,7 +1454,7 @@ altering the grammar mentioned above apply in this case, as well, only
at the `lexical analysis level'. At a minimum, the set of tokens
matched by the scanner would have to be altered.
-A much more satisfying approach involves inserting the hints at the input stage and
+A much more satisfying approach, however, involves inserting the hints at the input stage and
passing this information to the scanner and the parser as part of the token
`values'. The hints themselves can masquerade as characters ignored by the scanner
(white space\footnote{Or even the `intercharacter space', to make the
@@ -1482,7 +1486,8 @@ This is exactly what the scanner produced by the tools in this package
does: along with the main stream of tokens meant for the parser, it
produces two\footnote{There would be no difficulty in splitting either
of these streams into multiple `substreams' by modifying the stream
-extraction macros accordingly.} hidden streams (called the \.{\\yyformat} stream and
+extraction macros accordingly.} hidden streams\namedspot{parser.streams}
+(called the \.{\\yyformat} stream and
the \.{\\yystash} stream) and provides the parser with two
strings (currently only strings of digits are used although arbitrary
sequences of \TeX\ tokens can be used as pointers) with the promise
@@ -1490,10 +1495,13 @@ that {\it all the `hints' between the beginning of the corresponding
stream and the point labeled by the current stream pointer appeared
among the characters up to and, possibly, including the ones matched
as the current token}. The macros to extract the relevant parts of the
-streams (\.{\\yyreadfifo} and its cousins) are provided for the
+streams (\.{\\consumelistupto} and its cousins) are provided for the
convenience of the parser designer.
-The \.{\\yystash} stream collects all the typesetting commands inserted by
+What the parser does with these pointers and the information they provide, is
+up to the parser designer (the parsers for \flex\ and \bison\ syntax
+in this package use somewhat different strategies).
+The \.{\\yystash} stream currently collects all the typesetting commands inserted by
\CWEB\ to be possibly used in displaying the action code in \bison\
productions, for example. Because of this, it may appear in somewhat
unexpected places, introducing spaces where the programmer did not
@@ -1505,10 +1513,10 @@ The interested reader can consult the input routine macros in
\.{yyinput.sty} for the
details of the internal representation of the streams.
-In the interest of full disclosure, let me point out that this simple
+In the interest of full disclosure, it should be pointed out that this simple
technique introduces a significant strain on \TeX's
computational resources: the lowest level macros, the ones that handle
-character input and are thus executed (sometimes multiple times), for
+character input and are thus executed (in some cases multiple times), for
{\it every\/} character in the input stream are rather complicated and
therefore, slow. Whenever the use of such streams is not desired a simpler
input routine can be written to speed up the process (see
@@ -1517,9 +1525,13 @@ input routine can be written to speed up the process (see
Finally, while probably not directly related to the present
discussion, this approach has one more interesting feature: after the
parser is finished, the parser output and the streams exist
-`statically', fully available for any last minute preprocessing or for
+`statically', fully available for any last minute postprocessing or for
debugging purposes, if necessary\footnote{One may think of the parser output
-as an {\it executable abstract syntax tree (AST)}.}. Under most circumstances, the parser
+as an {\it executable abstract syntax tree\/} (\AST\ or \EAST\ if one
+likes cute abbreviations, or even e\AST\ for an extra touch of modernity).
+This parser feature is used to implement the facility that allows easy referencing of
+productions in the section that implements the action code for one. See \.{yyunion.sty}
+and the source of this file (\.{splint.w}) for details.}. Under most circumstances, the parser
output is `executed' and the macros in the output are the ones reading
the various streams using the pointers supplied at the parsing stage
(at least, this is the case for all the parsers supplied with the
@@ -1532,7 +1544,9 @@ how the tables produced by \bison\ get converted into \TeX\ {\it macros\/}
that drive the parser in {\it \TeX}.
The tables that drive the \bison\ input parsers
-are collected in \.{\{b,d,f,g,n\}yytab.tex} and \.{small\_tab.tex}. Each
+are collected in \.{\{b,d,f,g,n\}yytab.tex}, \.{small\_tab.tex} and other similarly named
+files\footnote{Incidentally, one of the names above is not used anymore. See the \.{cweb}
+directory after a successful build to find out which. Aren't footnotes great?!}. Each
one of these files contains the tables that implement a specific parser
used during different stages of processing.
Their exact function is well explained
@@ -1584,30 +1598,34 @@ it after \.{\\classexpand} (such sequences are usually prepared by the
\bison\ from your grammar).
You can give a case a readable label (say, \.{brackets}) and enclose
-this label in \.{\\raw}$\ldots$\.{\\raw}. A word of caution: an `\.{a}'
-inside of \.{\\raw}$\ldots$\.{\\raw} (which is most likely an
-\.{a}$_{11}$ unless you played with the category codes before loading the
-\.{\\switchon} macros) and the one outside it are two different
+this label in \.{\\raw}$\ldots$\.{\\raw}. A word of caution: an
+`\.{a}' inside of \.{\\raw}$\ldots$\.{\\raw} (which is most likely an
+\.{a}$_{11}$ unless you played with the category codes before loading
+the \.{\\switchon} macros) and the one outside it are two different
characters, as one is no longer a letter (category 11) in the eyes of
\TeX\ whereas the other one still is. For this reason one should not
-use characters other than letters in h\.{\{}is\.{,}er\.{\}} state
-{\em names}: the way a state picks an action does not distinguish between,
+use characters other than letters in h\.{\{}is\.{,}er\.{\}} state {\em
+names\/} if such characters can form tokens by themselves:
+the way a state picks an action does not distinguish between,
say, a `\.{(}' in `\.{(letter)}' and a stand alone `\.{(}' and may
pick an action that you did not intend\footnote{One way to mitigate
this is by putting such named states at the end of the switch, {\em
-after\/} the actions labelled by the standalone characters.}.
-This applies even if `\.{(}'
-is not among the characters explicitly inserted in the state macro: if
-an action for a given character is not found in the state macro, the
-\.{\\switchon} macro will insert a current \.{\\default} action
-instead, which most often you would want to be \.{\\yylex} or
-\.{\\yyinput} (i.e.\ skip this token). If a single `\.{(}' or `\.{)}' matches
-the braced group that follows `\.{(letter)}' chaos may ensue (most
-likely \TeX\ will keep reading past the \.{\\end} or \.{\\yyeof} that
-should have terminated the input). Make the names of character
-categories as unique as possible: the \.{\\switchon} is simply a
-string matching mechanism, with the added differentiation between
-characters of different categories.
+after\/} the actions labelled by the standalone characters. There is nothing
+special about non-letter characters, of course. To continue the \.{letter}
+example, placing a state named \.{let} {\em after\/} the \.{letter} one
+will make it essentially invisible to the switch macros for the reasons
+explained before this footnote.}. This applies even if `\.{(}' is not among
+the characters explicitly
+inserted in the state macro: if an action for a given character is not
+found in the state macro, the \.{\\switchon} macro will insert a
+current \.{\\default} action instead, which most often you would want
+to be \.{\\yylex} or \.{\\yyinput} (i.e.\ skip this token). If a
+single `\.{(}' or `\.{)}' matches the braced group that follows
+`\.{(letter)}' chaos may ensue (most likely \TeX\ will keep reading
+past the \.{\\end} or \.{\\yyeof} that should have terminated the
+input). Make the names of character categories as unique as possible:
+the \.{\\switchon} is simply a string matching mechanism, with the
+added differentiation between characters of different categories.
Finally, the construct \.{\\statecomment}{\it
anything\/}\.{\\statecomment} allows you to insert comments in the
@@ -1620,15 +1638,14 @@ makes the debugging information difficult to decipher). The debugging
mode for the lexer implemented with these macros is activated by
\.{\\tracedfatrue}.
-The functionality of the \.{\\switchon} (as well as the \.{\\switchonwithtype}, which
-is capable of some rudimentary type checking) macros (for `historical'
-reasons, one can also use \.{\\action} as a synonym for the latter) has been
-implemented in a number of other macro packages (see \cite[Fi] that
-discusses the well-known and widely used \.{\\CASE} and \.{\\FIND}
-macros). The macros in this collection have the additional property
-that the only assignments that persist after the \.{\\switchon}
-completes are the ones performed by the user code inside the selected
-case.
+The functionality of the \.{\\switchon} (as well as the
+\.{\\switchonwithtype}, which is capable of some rudimentary type
+checking) macros has been implemented in a number of other macro
+packages (see \cite[Fi] that discusses the well-known and widely used
+\.{\\CASE} and \.{\\FIND} macros). The macros in this collection have
+the additional property that the only assignments that persist after
+the \.{\\switchon} completes are the ones performed by the user code
+inside the selected case.
This last property of the switch macros is implemented using another
mechanism that is part of this macro suite: the `subroutine-like'
@@ -1662,7 +1679,10 @@ be able to write parsers of arbitrary sophistication:
value of the $n$-th term of the rule's right hand side, $n>0$. The left
hand side of a production is accessed through \.{\\yyval}. A
convenient shortcut is \.{\\yy0\{{\rm \TeX\space material}\}} which
-will expand (as in \.{\\edef}) the `\TeX\ material' inside the braces. Thus, a simple way
+will expand (as in \.{\\edef}) the `\TeX\ material' inside the braces and store the result
+in \.{\\yyval} (note that this only works if a sequence of \.{0}s, possibly followed or preceeded
+by spaces are the only tokens between \.{\\yy} and the opening braces; see the discussion of
+\.{\\bb} macros below for a description of what happens in other cases). Thus, a simple way
to concatenate the values of the first two production terms is
\.{\\yy0\{\\the\\yy(1)\\the\\yy(2)\}}. The included \bison\
parser can also be used to provide support for `symbolic names',
@@ -1673,8 +1693,9 @@ however.
There is also a \.{\\bb$\,n$} macro, that has no analogue in the
`real' \bison\ parsers, and provides access to the term
-values in the `natural order' (e.g.~\.{\\bb1} is the last term read). Its
-intended use is with the `inline' rules (see the main parser for
+values in the `natural order' (e.g.~\.{\\bb1} is the last term in the part of
+the production preceeding the action). Its intended use is with the `inline'
+rules (see the main parser for
such examples). As of version \.{3.0} \bison\ no longer outputs
|yyrhs| and |yyprhs|, which makes it impossible to produce the
|yyrthree| array necessary for processing such rules in the `left to right'
@@ -1682,13 +1703,41 @@ order. One might also note that the new notation is better suited for
the inline rules since the value that is pushed on the stack is that
of \.{\\bb0}, i.e.~the term implicitly inserted by \bison. Be aware
that there are no \.{\\bb[$\cdot$]} or \.{\\bb($\cdot$)} versions of
-these macros, for obvious reasons. A less obvious feature of this
+these macros, for obvious reasons\footnote{The obvious reason is the mechanism
+used by \.{\\yy[$\cdot$]} and \.{\\yy($\cdot$)} to make them expandable.
+These macros are basically references to the appropriate token registers. Since
+the \.{\\bb} macros were designed for the environment where \.{\\yylen} is unknown,
+establishing such references before the action is executed is not possible. A
+less obvious reason is the author's lazy approach.}. A less obvious feature of this
macro is its `nonexpandable' nature. This means they cannot be used
-inside \.{\\edef}. Thus, the most common use pattern is
-\.{\\bb$\,n$\{\\toks$\,m$\}} with a subsequent expansion of
-\.{\\toks$\,m$}. Making these macros expandable is certainly possible
+inside \.{\\edef} (just like its \.{\\yy$\,n$} counterpart, it makes several
+assignments which will not be executed by \.{\\edef}).
+Thus, the most common use pattern is \.{\\bb$\,n$\{\\toks$\,m$\}} (where $n>0$)
+with a subsequent expansion of \.{\\toks$\,m$}\footnote{Similar to how \.{\\yy$\,n$} macros
+work, whenever $n>0$, this pattern simply puts the contents of the braced group
+that follows in front of a (braced) single expansion of the appropriate
+value on the stack. If, as in the example above, the contents of the
+braced group are \.{\\toks$\,m$}, this effectively stores the value of the braced group in
+the token register. In the case $n=0$ the meaning is different:
+the stack value {\em corresponding to the implicit term\/} becomes the expanded (by \.{\\edef})
+contents of the braced group following \.{\\bb$\,n$}.}.
+Making these macros expandable is certainly possible
but does not seem crucial for the intended limited use pattern.
+Finally, the scripts included with \splint\ include a postprocessor
+(see the appropriate~\.{Makefile} for further details) that allows the
+use of the `native' \bison\ term references (i.e.\ of the form
+\.{\char`\$}$\ldots$) to access the value stack\footnote{Incidentally,
+\bison\ itself uses a preprocessor (\.{M4}) to turn its term references
+into valid \Cee.}. Utilizing the postprocessor allows any syntax for
+term references used by \bison\ to be used inside \.{TeX}$\ldots$ \Cee\ macros.
+In this case a typical
+idiom is \.{\\the\char`\$[term\_name]} to get the value of
+\prodstyle{term_name}. While storing a new value for the term (i.e.\
+modifying the value stack) is also possible, it is not very
+straightforward and thus not recommended. This applies to all forms of
+term references discussed above.
+
Naturally, a parser writer may need a number of other data
abstractions to complete the task. Since these are highly dependent on
the nature of the processing the parser is supposed to provide, we
@@ -1703,7 +1752,8 @@ most importantly, to create `reentrant' parsers that can, e.g.\ call
{\it themselves\/} recursively.
@*1 `Optimization'.
-\namedspot{optimization}By default, the generated parser and scanner keep all of their tables
+\namedspot{optimization}By default, the generated parser and scanner
+keep all of their tables
in separate token registers. Each stack is kept in a single macro (this
description is further complicated by the support for parser {\it
namespaces\/} that exists even for unoptimized parsers but this
@@ -1806,7 +1856,8 @@ appropriate terms in a production. If mathematics pays your bills, use
\let\hostparsernamespace\mainnamespace % to typeset examples in the text
% properly
-@**Index. This section is, perhaps, the most valuable product of
+@**Index. \global\let\secrangedisplay\empty% do not show the current section range anymore
+This section is, perhaps, the most valuable product of
\CWEB's labors. It lists references to definitions (set in {\it
italic}) as well as uses for each \Cee\ identifier used in the
source. Special facilities have been added to extend the indexing to
@@ -1845,7 +1896,7 @@ appeared on the left hand side of a production. A production:
}%
\beginmprod
left_hand_side:
- term.1 term.2 term.3 \{\stashed{|TeX_("/do/something/yy(1)");|}\}
+ term.1 term.2 term.3 \{\stashed{|TeX_("/do/something/with/yy(1)");|}\}
\endmprod
inside the \TeX\ part of a \CWEB\ section will generate several
index entries, as well, including the entries for any
@@ -1865,20 +1916,18 @@ available, thus avoiding referencing the same token twice).
\TeX\ control sequences are listed following the index of all \bison\ and \flex\
entries. The different sections of the index are separated by a {\it dinkus\/}
-(\dinkus). Since it is nearly impossible to determine at what point a
+(\dinkus)@^dinkus (\dinkus)@>. Since it is nearly impossible to determine at what point a
\TeX\ macro is defined (and most of them are defined outside of the
\CWEB\ sources), only their uses are listed (to be more precise, {\it
every\/} appearance of a macro is assumed to be its use). In a few cases, a
`graphic' representation for a control sequence appears in the index (for
-example, {\let\writetexidxentry\writetextxtidxentry
-\def\texnspace{texline}\def\texispace{index}\inlineTeXx{/getfirst}} represents
+example, \texref{/getfirst} represents
{\let\writetexidxentry\writetextxtidxentry
\def\texnspace{other}\def\texispace{other}\inlineTeXx{/getfirst}$\!$}).
The index entries are ordered alphabetically. The
latter may not be entirely obvious in the cases when the `graphical
representation' of the corresponding token manifests a significant
-departure from its string version (such as
-{\let\writetexidxentry\writetextxtidxentry|TeX_("/yy(1)");|}
+departure from its string version (such as \texref{/yy(1)}
instead of {\def\texnspace{other}\def\texispace{other}%
\let\writetexidxentry\writetextxtidxentry
|TeX_("/yy(1)");|$\!$}). Incidentally, for the examples on this page
@@ -1886,11 +1935,8 @@ instead of {\def\texnspace{other}\def\texispace{other}%
the `graphic' as well as `text' versions of the control sequence are
indexed. It is instructive to verify that their location in the index
corresponds to the `spelling' of their visual representation (thus,
-{\let\writetexidxentry\writetextxtidxentry
-\def\texnspace{texline}\def\texispace{index}\inlineTeXx{/getfirst}}
-appears under `p'). One should also be aware that the indexing of some terms has
-been suppressed, since they appear too often.
-\unsetfootnotes % this way the footnote stream is not affected by the extra index pages
+\texref{/getfirst} appears under `p'). One should also be aware that
+the indexing of some terms has been suppressed, since they appear too often.
% TODO: explain the visibility system. Note the anomalous order of \prodstyle{term.1}
% vs.~\prodstyle{term0} due to the dot in \.{term.1}, which is otherwise invisible. Underscore the
% importance of following a consistent naming scheme, including the `stringized' versions
@@ -1899,15 +1945,5 @@ been suppressed, since they appear too often.
@q the lack of control over the generation of \CWEB's index; the correct order @>
@q of index entries depends on the placement of this inclusion @>
@i alphas.hx
-
-\closeout\gindex
-\termindexfalse % do not attach indexing entries to the terms in the index, or the section list
-\def\next{\expandafter\eatone\string}
-\edef\unindexable{{\next\the}{\next\nx}{\next\yy}{\next\yylexnext}{\next\else}{\next\fi}{\next\yyBEGIN}{\next\next}}
-\input gindex.sty
-%\indexverbosetrue
-\let\inx\inxmod
-\let\fin\finmod
-\lxrefseparator % start generating section lists
-%\displaytokenrawtrue % so that the `nonstringified' version of the token is displayed as well
-\def\topofcontents{\null\vskip-3\baselineskip\centerline{C{\sc ONTENTS} (\sc\uppercase\expandafter{\title})}\medskip}
+\makeunindexablex{{\csstring\the}{\csstring\nx}{\csstring\yy}{\csstring\yylexnext}%
+ {\csstring\else}{\csstring\fi}{\csstring\yyBEGIN}{\csstring\next}}
diff --git a/support/splint/cweb/ssffo.w b/support/splint/cweb/ssffo.w
deleted file mode 100644
index 315bffc798..0000000000
--- a/support/splint/cweb/ssffo.w
+++ /dev/null
@@ -1,123 +0,0 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
-@q This file is part of SPLinT@>
-
-@q SPLinT is free software: you can redistribute it and/or modify@>
-@q it under the terms of the GNU General Public License as published by@>
-@q the Free Software Foundation, either version 3 of the License, or@>
-@q (at your option) any later version.@>
-
-@q SPLinT is distributed in the hope that it will be useful,@>
-@q but WITHOUT ANY WARRANTY; without even the implied warranty of@>
-@q MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the@>
-@q GNU General Public License for more details.@>
-
-@q You should have received a copy of the GNU General Public License@>
-@q along with SPLinT. If not, see <http://www.gnu.org/licenses/>.@>
-\input limbo.sty
-\def\optimization{5}
-\input yy.sty
-\modenormal
-\let\oldN\N
-\let\N\textN
-\let\M\textM
-% uncomment the next line to leave the typesetting of tokens in its raw state.
-%\def\hostparsernamespace{[unreacheable]}
-\let\hostparsernamespace\mainnamespace
-\input btokenset.sty
-
-@** A simple scanner for \flex\ options.
-This is a `bare-bones' scanner for a subset of the `extended' \bison\
-grammar that parses some of the `extensions', namely, the
-\flex\ state declarations. It does not use the state mechanism
-itself, and is supposed to be used with the bootstrapping parser, even
-though this is not strictly necessary. It parses state declarations as
-long as they are separated into their own \CWEB\ sections and extracts
-the {\it names\/} of the states. The \flex\ scanner output `driver'
-does the rest after including the produced header file.
-
-If reusing the existing scanner for \bison\ were not a priority a
-proper way to design a scanner like this is to make it a subset of the
-existing scanner code. This way portions of the program would be made
-more reusable and the overall design made more consistent.
-@s TeX_ TeX
-@(ssffo.ll@>=
-@G
- @> @<Lexer definitions@> @=
-%{@> @<Lexer \Cee\ preamble@> @=%}
- @> @<Lexer options@> @=
-%%
- @> @<Regular expressions@> @=
-%%
-@g
-
-@ A couple of handy abbreviations to get started. Note that the
-definition of a letter is more restrictive in this case since we only
-need to grab the states of an existing \bison\ lexer. For a
-bootstrapping scanner like this it is beneficial to fail early while
-scanning something that is not in its attention domain: it results in
-faster bootstrapping and lower chance of accidentally parsing
-something that should not have been. Making the syntax and the grammar
-more restrictive helps to acheive this, as well as makes the overall
-design simpler.
-@<Lexer definitions@>=
-@G(fs1)
-letter [_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]
-id {letter}({letter}|[-0-9])*
-@g
-
-@ @<Lexer \Cee\ preamble@>=
-
-#include <stdint.h>
-#include <stdbool.h>
-
- void define_all_states( void ){}
-
-@ A standard combination of options to match the \TeX\ code that
-drives the scanner.
-@<Lexer options@>=
-@G
-%option bison-bridge
-%option noyywrap nounput noinput reentrant
-%option noyy_top_state
-%option debug
-%option stack
-%option outfile="ssffo.c"
-@g
-
-@ There are not that many regular expressions to list, since the range
-of tokens recognized by this routine is not very wide.
-@<Regular expressions@>=
- @<Scan white space@>@;
- @<Scan identifiers@>@;
-
-@ White space skipping.
-@<Scan white space@>=
-@G(fs2)
-[ \f\n\t\v] {@> @[TeX_( "/yylexnext" );@]@=}
-@g
-
-@ The rest of it are either identifiers or \.{\%}-options. The typesetting of
-the appropriate \bison\ tokens below was arranged by inputting \.{btokenset.sty} and
-relying on the pretty-printing macros for {\it \TeX} to do their job.
-@<Scan identifiers@>=
-@G(fs2)
-{id} {@> @<Return an identifier@> @=}
-"%x" {@> @[TeX_( "/yylexreturnptr{FLEX_STATE_X}" );@] @=}
-"%s" {@> @[TeX_( "/yylexreturnptr{FLEX_STATE_S}" );@] @=}
-. {@> @<React to a bad character@> @=}
-@g
-
-@ @<React to a bad character@>=
- @[TeX_( "/iftracebadchars" );@]@;
- @[TeX_( " /yycomplain{invalid character(s): /the/yytext}" );@]@;
- @[TeX_( "/fi" );@]@;
- @[TeX_( "/yylexreturn{$undefined}" );@]@;
-
-@ The lexer returns standard \.{\\yyunion} types.
-@<Return an identifier@>=
- @[TeX_( "/edef/next{/yylval{{/the/yytextpure}{/the/yytext}" );@]@;
- @[TeX_( " {/the/yyfmark}{/the/yysmark}}}/next" );@]@;
- @[TeX_( "/yylexreturn{ID}" );@]@;
-
-@** Index.
-\def\TeXx{\TeX\ material} \ No newline at end of file
diff --git a/support/splint/doc/ldman.pdf b/support/splint/doc/ldman.pdf
index d1d798816a..9e53467d24 100644
--- a/support/splint/doc/ldman.pdf
+++ b/support/splint/doc/ldman.pdf
Binary files differ
diff --git a/support/splint/doc/splint.pdf b/support/splint/doc/splint.pdf
index 76600ea682..9f031110ac 100644
--- a/support/splint/doc/splint.pdf
+++ b/support/splint/doc/splint.pdf
Binary files differ
diff --git a/support/splint/examples/count/count.sty b/support/splint/examples/count/count.sty
index d9fed05f94..d697096141 100644
--- a/support/splint/examples/count/count.sty
+++ b/support/splint/examples/count/count.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/expression/Makefile b/support/splint/examples/expression/Makefile
index 6f306939b6..741e94664c 100644
--- a/support/splint/examples/expression/Makefile
+++ b/support/splint/examples/expression/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2022, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -54,7 +54,7 @@ test.tex ${PARSER}.yy ${LEXER}.ll: expression.x
expression.tex: expression.x
@${CWEAVE} $<
-expression.pdf: expression.tex ${SPLINT_XPTABLES} ${SPLINT_XLTABLES} ${SPLINT_ROOT}cweb/bo.tok ${SPLINT_ROOT}cweb/fo.tok etoks.sty
+expression.pdf: expression.tex ${SPLINT_XTABLES} etoks.sty
@${PDFTEX} $<
test: test.tex ptab.tex ltab.tex
diff --git a/support/splint/examples/expression/etoks.sty b/support/splint/examples/expression/etoks.sty
index 706ad35818..6df6c0d3be 100644
--- a/support/splint/examples/expression/etoks.sty
+++ b/support/splint/examples/expression/etoks.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/expression/expression.sty b/support/splint/examples/expression/expression.sty
index ac0d8ba7e5..8fe0970159 100644
--- a/support/splint/examples/expression/expression.sty
+++ b/support/splint/examples/expression/expression.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/expression/expression.w b/support/splint/examples/expression/expression.w
index 9e96ea44d0..1f6a2f6b61 100644
--- a/support/splint/examples/expression/expression.w
+++ b/support/splint/examples/expression/expression.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2024, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
@@ -16,9 +16,12 @@
\input limbo.sty
\def\optimization{5}
\input yy.sty
+\input dcols.sty
\modenormal
+\initauxstream
-@** Parser file. This is an example parser for expressions. It takes
+@** Parser file.
+This is an example parser for expressions. It takes
advantage of some of the features of \splint\ generated parsers,
although anything that takes more than a straightforward setup is
omitted.
@@ -140,8 +143,6 @@ as they have to be inserted in a place that is aware of the internal definitions
definitions are used.
@<\.{expression} parser \Cee\ postamble@>=
-#define YYPRINT(file, type, value) @[yyprint (file, type, value)@]
- static void yyprint (FILE *file, int type, YYSTYPE value){}
@ Union of types. Empty as well.
@@ -175,7 +176,7 @@ int [0-9]+
void define_all_states( void ){}
@ @<Lexer options@>=
-@G
+@G(fs1)
%option bison-bridge
%option noyywrap nounput noinput reentrant
%option noyy_top_state
@@ -206,13 +207,14 @@ int [0-9]+
@[TeX_( "/iftracebadchars" );@]@;
@[TeX_( " /yycomplain{invalid character(s): /the/yytext}" );@]@;
@[TeX_( "/fi" );@]@;
- @[TeX_( "/yylexreturn{$undefined}" );@]@;
+ @[TeX_( "/yyerrterminate" );@]@;
@*Test file. The test file includes a handy list of debugging options
that can be activated to see the inner workings of the parser and
scanner routines.
@(test.txx@>=
@G
+\chardef\other=12 % needed for some macros to work
\input expression.sty
\iffalse
@@ -240,7 +242,7 @@ scanner routines.
\bye
@g
-@**Index.
-\immediate\closeout\exampletable
+@**Index.\global\let\secrangedisplay\empty% do not show the current section range anymore
+\global\topskip=9pt
\def\Tex{\TeX\ output}
\def\TeXx{\TeX\ output}
diff --git a/support/splint/examples/ld/Makefile b/support/splint/examples/ld/Makefile
index 24bf4a7a9f..8d876e55c9 100644
--- a/support/splint/examples/ld/Makefile
+++ b/support/splint/examples/ld/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2024, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -22,10 +22,11 @@ PARSER = ldp
LEXER = ldl
MANUAL = ldman
-LD_CORE_PREREQS = ${SPLINT_XTEXSTYLES} ${SPLINT_XPTABLES} ${SPLINT_XLTABLES} ${SPLINT_ROOT}cweb/bo.tok ${SPLINT_ROOT}cweb/fo.tok
-LD_DOC_PREREQS = %.tex %.sty ${PARSER}.tok ldunion.sty ldtexlex.sty ldint.sty ldfrontmatter.sty ${LD_CORE_PREREQS}
-LD_DOC_PREREQS += ptab.tex ltab.tex ld_small_tab.tex ld_small_dfa.tex ltokenset.sty lstokenset.sty
-LD_DOC_PREREQS_XREF = ${LD_DOC_PREREQS} %.scn %.idx
+LD_CORE_PREREQS = ${SPLINT_XTEXSTYLES} ${SPLINT_XTABLES}
+LD_DOC_PREREQS_STATIC = ldunion.sty ldtexlex.sty ldint.sty ltokenset.sty lstokenset.sty
+LD_DOC_PREREQS_GEN = ldptab.tex ldltab.tex ld_small_tab.tex ld_small_dfa.tex ${PARSER}.tok ldsetup.sty
+LD_DOC_PREREQS_XREF = ${LD_CORE_PREREQS} %.sty ${LD_DOC_PREREQS_STATIC} %.tex ${LD_DOC_PREREQS_GEN} %.scn %.idx
+LD_DOC_PREREQS_XREF += ldfrontmatter.sty
include ../../makefile.inc
include ${SPLINT_ROOT}makefile.loc
@@ -35,13 +36,13 @@ include ${SPLINT_ROOT}makefile.loc
ptabout: ${SPLINT_ROOT}cweb/mkeparser.c ${PARSER}.c
${CC} ${BISON_STATE} -DPARSER_FILE=\"../examples/ld/$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
-ptab.tex: ptabout
+ldptab.tex: ptabout
$< --optimize-actions --optimize-tables $@
ltabout: ${SPLINT_ROOT}cweb/mkscanner.c ldl_states.h ${LEXER}.c
${CC} -DLEXER_FILE=\"../examples/ld/$(lastword $^)\" -o $@ $<
-ltab.tex: ltabout
+ldltab.tex: ltabout
$< --optimize-actions --optimize-tables $@
${LEXER}.c: ${LEXER}.l
@@ -53,7 +54,8 @@ ${PARSER}.yy : ldgram.x
${LEXER}.ll: ldlex.x
@${CTANGLE} $<
-${MANUAL}.stx: ${MANUAL}.x ldgram.x ldlex.x ldlexo.x ldgramo.x ldnp.x
+${MANUAL}.stx \
+ldsetup.stx: ${MANUAL}.x ldgram.x ldlex.x ldlexo.x ldgramo.x ldnp.x ldexample_l.hx ldexample_t.hx alphas.hx
@${CTANGLE} $<
# term name parser for ld grammar
@@ -101,11 +103,13 @@ ldexample_%.hx: ldexample.hw
alphas.hx:
${MISCCW} --alpha-list --alpha-length=1 $@
-${MANUAL}.tex: ${MANUAL}.x ldgram.x ldlex.x ldlexo.x ldgramo.x ldnp.x ldexample_l.hx ldexample_b.hx alphas.hx
+${MANUAL}.tex: ${MANUAL}.x ldgram.x ldlex.x ldlexo.x ldgramo.x ldnp.x ldexample_l.hx ldexample_t.hx alphas.hx
+ @echo "Preparing the ${MANUAL}.tex file ..."
-${CWEAVE} $<
-${MANUAL}.sty: ${MANUAL}.stx
- ${UNLINE} $< $@
+${MANUAL}.sty \
+ldsetup.sty:%.sty: %.stx
+ ${UNLINE} $< $@
${MANUAL}.gdx: %.gdx: ${LD_DOC_PREREQS_XREF} ${PARSER}.tok
@echo "Making the bison and TeX indices ..."
@@ -116,11 +120,8 @@ ${MANUAL}.gdx: %.gdx: ${LD_DOC_PREREQS_XREF} ${PARSER}.tok
${MANUAL}.gdy: %.gdy: %.gdx
${BINDX} --fine $^ $@
-${MANUAL}.xxr: %.xxr: %.tex
- ${PDFTEX} $*.tex
-
-${MANUAL}.pdf: %.pdf: ${LD_DOC_PREREQS_XREF} %.gdy %.xxr
- ${PDFTEX} $< && touch $*.gdy && touch $*.pdf
+${MANUAL}.pdf: %.pdf: ${LD_DOC_PREREQS_XREF} %.gdy %.aux
+ ${PDFTEX} $*.tex && touch $*.gdy && touch $*.pdf
${PARSER}.tok: ldgram.tex ${MANUAL}.sty ${LD_CORE_PREREQS}
${TEX} ${MODEBOOTSTRAP} \\input $<
@@ -130,15 +131,25 @@ ldl_states.h: ldlex.tex ${MANUAL}.sty ${LD_CORE_PREREQS}
ldgram.tex ldlex.tex: \
%.tex: %.x
- -${CWEAVE} -x $<
+ @echo "Building ldgram.tex and ldlex.tex."
+ -${CWEAVE} -x $*.x
docs: ${MANUAL}.pdf
+install: docs
+ @cp ${LD_DOC_PREREQS_STATIC} ${SPLINT_INSTALL_DIR}/tex/
+ @cp ${LD_DOC_PREREQS_GEN} ${SPLINT_INSTALL_DIR}/cweb/
+
+uninstall:
+ @rm -f $(patsubst %, ${SPLINT_INSTALL_DIR}/tex/%, ${LD_DOC_PREREQS_STATIC})
+ @rm -f $(patsubst %, ${SPLINT_INSTALL_DIR}/cweb/%, ${LD_DOC_PREREQS_GEN})
+
mostlyclean: clean_temp
-rm -f ptabout ltabout ldsmalll_out ldsmallp_out ldnump_out ldnuml_out ${MANUAL}.c
clean: clean_core
- -rm -f ptabout ltabout ldsmalll_out ldsmallp_out ldnump_out ldnuml_out *.stx ldman.sty
+ -rm -f ptabout ltabout ldsmalll_out ldsmallp_out ldnump_out ldnuml_out *.stx \
+ ldman.sty ldsetup.sty
distclean: clean
cd ${SPLINT_ROOT} && ${MAKE} clean
diff --git a/support/splint/examples/ld/ldexample.hw b/support/splint/examples/ld/ldexample.hw
index a5cab97d2a..d9cb732624 100644
--- a/support/splint/examples/ld/ldexample.hw
+++ b/support/splint/examples/ld/ldexample.hw
@@ -4,7 +4,7 @@ MEMORY
{
@> @<Some random portion of \ld\ code@> @=
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
- FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
+ FLASH (rx!w) : ORIGIN = 0x8000000, LENGTH = 128K
ASH (rx) : ORIGIN = 8001000, LENGTH = 128K
@> @<Some random portion of \ld\ code@> @=
CLASH (rx) : ORIGIN = 700000, LENGTH = 128K
@@ -27,6 +27,7 @@ ENTRY(_entry);
SECTIONS
{
@> @<Some random portion of \ld\ code@> @=
+ . = ORIGIN(FLASH);
.isr_vector ALIGN(8) (NOLOAD): AT(.) ALIGN(.) ALIGN_WITH_INPUT SUBALIGN(8) SPECIAL
{
. = ALIGN(4);
@@ -73,5 +74,18 @@ SECTIONS
_ebss = . ;
} >RAM
@> @<Some random portion of \ld\ code@> @=
+ . = ALIGN(0x0001ABCD);
+ _ffbegin = .;
+ OVERLAY : NOCROSSREFS AT ( _ffabs ) {
+ .free_func0
+ {
+ *(.free_func0)
+ . = ALIGN(4);
+ }
+ .free_func1
+ {
+ *(.free_func1)
+ }
+ } >RAM
}
diff --git a/support/splint/examples/ld/ldgram.w b/support/splint/examples/ld/ldgram.w
index 5e7ff73a03..3671ee52ce 100644
--- a/support/splint/examples/ld/ldgram.w
+++ b/support/splint/examples/ld/ldgram.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020 Alexander Shibakov@>
+@q Copyright 2012-2022 Alexander Shibakov@>
@q Copyright 2002-2014 Free Software Foundation, Inc.@>
@q This file is part of SPLinT@>
@@ -18,10 +18,12 @@
@** The parser.
\ifbootstrapmode
\def\tokendeffile{ldp.tok}%
- \input ldman.sty
+ \input ldman.sty
+ \def\bstrapparser{dyytab.tex}% only the full or preamble parser would know how to
+ % parse grammar sections that mix \prodstyle{\%token}
+ % declarations with other \bison\ syntax
+ \def\bstraptokens{bo.tok}% token equivalences for the full lexer
\modebootstrap
- \input dcols.sty
- \setupfootnotes
\def\MRI{}
\def\ld{}
\fi
@@ -76,8 +78,6 @@ is supplied by the \TeX\ macros in \.{ldman.sty}.
@ @<Union of grammar parser types@>=
@ @<\ld\ parser \Cee\ postamble@>=
-#define YYPRINT(file, type, value) yyprint (file, type, value)
- static void yyprint (FILE *file, int type, YYSTYPE value){}
@ @<\ld\ parser productions@>=
@<\GNU\ \ld\ script rules@>@;
@@ -129,13 +129,13 @@ by the \ld\ parser are put in a single list.
%left OROR ANDAND '|' '^' '&' EQ NE '<' '>' LE GE LSHIFT RSHIFT '+' '-' '*' '/' '%' '('
@g
-@*1 Grammar rules, an overview.
+@*1 Grammar rules, an overview.
The first natural step in transforming an existing parser into a
`parser stack' for pretty printing is to understand the `anatomy' of
the grammar. Not every grammar is suitable for such a transformation
and in almost every case, some modifications are needed. The
parser and lexer implementation for \ld\ is not terrible although it does
-have some idiosynchasies that could have been eliminated by a careful
+have some idiosynchrasies that could have been eliminated by a careful
grammar redesign. Instead of invasive rewriting of significant
portions of the grammar, the approach taken here merely omits some
rules and partitions the grammar into several subsets, each of which
@@ -143,7 +143,7 @@ is supposed to handle a well defined logical section of an \ld\ script
file.
One example of a trick used by the \ld\ parser that is not appropriate for a
-pretty printing grammar implements a way of handling the choice of the
+pretty printing grammar is the way the original parser handles the choice of the
format of an input file. After a command line option that selects the
input format has been read (or the format has been determined using
some other method), the first token output by the lexer branches the
@@ -219,12 +219,14 @@ defsym_expr:
@ {\it Syntax within an \MRI\ script file}\footnote{As explained at the
beginning of this chapter, the text in {\it italics\/} was taken from
-the original comments by \ld\ parser and lexer programmers.}. The parser for typesetting
+the original comments by the \ld\ parser and lexer programmers.}. The parser for typesetting
is only intended to process \GNU\ \ld\ scripts and does not concern
itself with any additional compatibility modes. For this reason, all
support for \MRI\ style scripts has been omitted. One use for the
section below is a small demonstration of the formatting tools that
change the output of the \bison\ parser.
+%\checktabletrue
+%\tracingliststrue
@<\MRI\ style script rules@>=
@G
@t}\vb{\inline\flatten}{@>
@@ -315,6 +317,8 @@ casesymlist:
@ {\it Parsed as expressions so that commas separate entries.} The
core of the parser consists of productions describing \GNU\ \ld\ linker
scripts. The first rule is common to both \MRI\ and \GNU\ formats.
+\checktablefalse
+\tracinglistsfalse
@<\GNU\ \ld\ script rules@>=
@G
extern_name_list:
@@ -435,7 +439,7 @@ sections:
sec_or_group_p1:
sec_or_group_p1 section {@>@<Add the next section chunk@>@=}
- | sec_or_group_p1 statement_anywhere {@>@<Add the next section chunk@>@=}
+ | sec_or_group_p1 statement_anywhere {@>@<Add the next section statement@>@=}
| {@>@[TeX_( "/yy0{}" );@]@=}
;
@@ -451,10 +455,20 @@ statement_anywhere:
@[TeX_( "/yy0{/nx/ldinsertcweb/the/yy(1){sect}{/nx/ldsections{/the/yy(3)/nx/ldsectionstash/the/yy(4)}}}" );@]
@ @<Add the next section chunk@>=
- @[TeX_( "/getsecond{/yy(2)}/to/tokse/getthird{/yy(2)}/to/toksf" );@]@;
- @[TeX_( "/getfourth{/yy(2)}/to/toksg/getfifth{/yy(2)}/to/toksh" );@]@;
- @[TeXb( "/yytoksempty{/yy(1)}{/yy0{/nx/ldsectionstash{/the/tokse}{/the/toksf}/the/toksh}}" );@]@;
- @[TeXfo( " {/yy0{/the/yy(1)/nx/ldsectionseparator{/the/tokse}{/the/toksf}/the/toksh}}" );@]@;
+ @[TeX_( "/yytoksempty{/yy(2)}{/yy0{/the/yy(1)}}{" );@]@;
+ @[TeX_( " /getsecond{/yy(2)}/to/tokse/getthird{/yy(2)}/to/toksf" );@]@;
+ @[TeX_( " /getfourth{/yy(2)}/to/toksg/getfifth{/yy(2)}/to/toksh" );@]@;
+ @[TeXb( " /yytoksempty{/yy(1)}{/yy0{/nx/ldsectionstash{/the/tokse}{/the/toksf}/the/toksh}}" );@]@;
+ @[TeXa( " {/yy0{/the/yy(1)/nx/ldsectionseparator{/the/tokse}{/the/toksf}/the/toksh}}" );@]@;
+ @[TeXfo( "}" );@]@;
+
+@ @<Add the next section statement@>=
+ @[TeX_( "/yytoksempty{/yy(2)}{/yy0{/the/yy(1)}}{" );@]@;
+ @[TeX_( " /getsecond{/yy(2)}/to/tokse/getthird{/yy(2)}/to/toksf" );@]@;
+ @[TeX_( " /getfourth{/yy(2)}/to/toksg/getfifth{/yy(2)}/to/toksh" );@]@;
+ @[TeXb( " /yytoksempty{/yy(1)}{/yy0{/nx/ldsectionstash{/the/tokse}{/the/toksf}/nx/ldfreestmt{/the/toksh}}}" );@]@;
+ @[TeXa( " {/yy0{/the/yy(1)/nx/ldsectionseparator{/the/tokse}{/the/toksf}/nx/ldfreestmt{/the/toksh}}}" );@]@;
+ @[TeXfo( "}" );@]@;
@ @<Form an \prodstyle{ENTRY} statement@>=
@[TeX_( "/yy0{/nx/ldinsertcweb/the/yy(1){stmt}{/nx/ldstatement{/nx/ldentry{/nx/ldregexp{/the/yy(3)}}}}}" );@]
@@ -631,14 +645,14 @@ length:
| SHORT {}
| BYTE {}
;
-
+@t}\vb{\resetf\inline}{@>
fill_exp:
mustbe_exp {@>@<Carry on@>@=}
;
-
+@t}\vb{\flatten}{@>
fill_opt:
- '=' fill_exp {@>@[TeX_( "/yy0{/noexpand/ldfill{/the/yy(2)}}" );@]@=}
- | {@>@[TeX_( "/yy0{}" );@]@=}
+ {@>@[TeX_( "/yy0{}" );@]@=}
+ | '=' fill_exp {@>@[TeX_( "/yy0{/noexpand/ldfill{/the/yy(2)}}" );@]@=}
;
@t}\vb{\resetf}{@>
@@ -710,9 +724,7 @@ memory_spec_list:
memory_spec:
NAME {}
- attributes_opt ':'
- origin_spec
-@t}\vb{\breakline}{@>
+ attributes_opt ':' origin_spec
opt_comma length_spec {@>@<Declare a named memory region@>@=}
| INCLUDE filename {@>@<Peek at a file@>@=}
memory_spec_list_opt END {@>@<Close the file@>@=}
@@ -759,8 +771,8 @@ attributes_list:
;
attributes_string:
- NAME {@>@[TeX_( "/yy0{/noexpand/ldattributes{/the/yy(1)}}" );@]@=}
- | '!' NAME {@>@[TeX_( "/yy0{/noexpand/ldattributesneg{/the/yy(2)}}" );@]@=}
+ NAME {@>@[TeX_( "/yy0{/noexpand/ldattrstring/the/yy(1)}" );@]@=}
+ | '!' NAME {@>@[TeX_( "/yy0{/noexpand/ldattrstringneg/the/yy(2)}" );@]@=}
;
startup:
@@ -812,7 +824,7 @@ expressions out of simpler chunks and basic building blocks tied
together by algebraic operations.
@<Grammar rules@>=
@G
-exp :
+exp:
'-' exp %prec UNARY {@>@[TeX_( "/yy0{{-/the/yy(2)}}" );@]@=}
| '(' exp ')' {@>@[TeX_( "/yy0{(/the/yy(2))}" );@]@=}
| NEXT '(' exp ')' %prec UNARY {@>@[TeX_( "/yy0{/hbox{/nx/ssf next}(/the/yy(3))}" );@]@=}
@@ -844,28 +856,28 @@ exp :
@<Grammar rules@>=
@G
exp :
- DEFINED '(' NAME ')' {}
- | INT {}
+ DEFINED '(' NAME ')' {@>@[TeX_( "/def/ldfuncname{defined}" );@]@<Apply a function to a name@>@=}
+ | INT {@>@<Carry on@>@=}
| SIZEOF_HEADERS {}
- | ALIGNOF '(' NAME ')' {}
- | SIZEOF '(' NAME ')' {}
- | ADDR '(' NAME ')' {}
- | LOADADDR '(' NAME ')' {}
- | CONSTANT '(' NAME ')' {}
- | ABSOLUTE '(' exp ')' {}
+ | ALIGNOF '(' NAME ')' {@>@[TeX_( "/def/ldfuncname{alignof}" );@]@<Apply a function to a name@>@=}
+ | SIZEOF '(' NAME ')' {@>@[TeX_( "/def/ldfuncname{sizeof}" );@]@<Apply a function to a name@>@=}
+ | ADDR '(' NAME ')' {@>@[TeX_( "/def/ldfuncname{addr}" );@]@<Apply a function to a name@>@=}
+ | LOADADDR '(' NAME ')' {@>@[TeX_( "/def/ldfuncname{loadaddr}" );@]@<Apply a function to a name@>@=}
+ | CONSTANT '(' NAME ')' {@>@[TeX_( "/def/ldfuncname{constant}" );@]@<Apply a function to a name@>@=}
+ | ABSOLUTE '(' exp ')' {@>@[TeX_( "/yy0{/nx/mathop{/hbox{/nx/ssf absolute}}(/the/yy(3))}" );@]@=}
| ALIGN_K '(' exp ')' {@>@[TeX_( "/yy0{/nx/mathop{/hbox{/nx/ssf align}}(/the/yy(3))}" );@]@=}
| ALIGN_K '(' exp ',' exp ')' {}
| DATA_SEGMENT_ALIGN '(' exp ',' exp ')' {}
| DATA_SEGMENT_RELRO_END '(' exp ',' exp ')' {}
| DATA_SEGMENT_END '(' exp ')' {}
| SEGMENT_START '(' NAME ',' exp ')' {}
- | BLOCK '(' exp ')' {}
+ | BLOCK '(' exp ')' {@>@[TeX_( "/yy0{/nx/mathop{/hbox{/nx/ssf block}}(/the/yy(3))}" );@]@=}
| NAME {@>@[TeX_( "/yy0{/nx/ldregexp{/the/yy(1)}}" );@]@=}
| MAX_K '(' exp ',' exp ')' {}
| MIN_K '(' exp ',' exp ')' {}
| ASSERT_K '(' exp ',' NAME ')' {}
- | ORIGIN '(' NAME ')' {}
- | LENGTH '(' NAME ')' {}
+ | ORIGIN '(' NAME ')' {@>@[TeX_( "/def/ldfuncname{origin}" );@]@<Apply a function to a name@>@=}
+ | LENGTH '(' NAME ')' {@>@[TeX_( "/def/ldfuncname{length}" );@]@<Apply a function to a name@>@=}
| LOG2CEIL '(' exp ')' {}
;
@g
@@ -875,6 +887,9 @@ exp :
@[TeXb( "/yy0{/hbox{/nx/ttl do }/xi(/the/yy(1))/hbox{ /nx/ttl where }" );@]@;
@[TeXfo( " {/let/nx/{/nx/bigbracedel/nx/xi(x)=/nx/cases{/the/yy(5)& if /inmath{x=0}/cr/the/yy(3)& if /inmath{x/nx/not=0}}}}" );@]@;
+@ @<Apply a function to a name@>=
+@[TeX_( "/yy0{/nx/mathop{/hbox{/nx/ssf /ldfuncname}}(/nx/ldregexp{/the/yy(3))}}" );@]
+
@ @<Grammar rules@>=
@G
memspec_at_opt:
@@ -966,6 +981,10 @@ section:
@[TeXfo( " {{/the/yy(15)}{/the/yy(16)}{/the/yy(17)}{/the/yy(18)}}}}" );@]@; /*memory specifiers */
@ @<Record an overlay section@>=
+ @[TeXb( "/getfirst{/yy(1)}/to/toksa/getsecond{/yy(1)}/to/toksb" );@]@;
+ @[TeXf( "/yy0{/nx/ldinsertcweb{/the/toksa}{/the/toksb}{osect}{/nx/ldoverlay{/the/yy(3)}{/the/yy(4)}{/the/yy(5)}{/the/yy(6)}" );@]@;
+ @[TeXf( " {/the/yy(10)}" );@]@;/* sections */
+ @[TeXfo( " {{/the/yy(13)}{/the/yy(14)}{/the/yy(15)}{/the/yy(16)}}}}" );@]@; /*memory specifiers, etc.*/
@ @<Grammar rules@>=
@G
@@ -999,8 +1018,8 @@ opt_exp_with_type:
;
opt_exp_without_type:
- exp ':' {}
- | ':' {}
+ exp ':' {@>@[TeX_( "/yy0{/the/yy(1)}" );@]@=}
+ | ':' {@>@[TeX_( "/yy0{}" );@]@=}
;
opt_nocrossrefs:
@@ -1019,12 +1038,12 @@ phdr_opt:
;
overlay_section:
-
+ {@>@[TeX_( "/yy0{}" );@]@=}
| overlay_section
NAME {@>@[TeX_( "/ldlex@@script" );@]@=}
'{' statement_list_opt '}' {@>@[TeX_( "/ldlex@@popstate/ldlex@@expression" );@]@=}
phdr_opt fill_opt {@>@[TeX_( "/ldlex@@popstate" );@]@=}
- opt_comma
+ opt_comma {@>@<Add a section to the overlay@>@=}
;
@g
@@ -1032,6 +1051,15 @@ overlay_section:
@[TeXb( "/yytoksempty{/yy(1)}{/yy0{{/the/yy(3)}}}" );@]@;
@[TeXao( "{/yy0{/the/yy(1)/noexpand/ldor{/the/yy(3)}}}" );@]@;
+@ @<Add a section to the overlay@>=
+ @[TeXb( "/getthird{/yy(2)}/to/toksa/getfourth{/yy(2)}/to/toksb" );@]@;/* \prodstylens{name}{\ldnamespace} pointers */
+ @[TeXf( "/getfifth{/yy(5)}/to/toksc" );@]@;/* \prodstylens{statement\_list\_opt}{\ldnamespace} contents */
+ @[TeXf( "/yytoksempty{/yy(1)}{" );@]@;
+ @[TeXf( " /yy0{/nx/ldoverlaysection{/the/yy(2)}{/the/toksc}{/the/yy(8)}{/the/yy(9)}}" );@]@;
+ @[TeXf( "}{" );@]@;
+ @[TeXf( " /yy0{/the/yy(1)/nx/ldoverlaysection{/the/yy(2)}{/the/toksc}{/the/yy(8)}{/the/yy(9)}}" );@]@;
+ @[TeXfo( "}" );@]@;
+
@ @<Grammar rules@>=
@G
phdrs:
diff --git a/support/splint/examples/ld/ldgramo.w b/support/splint/examples/ld/ldgramo.w
index 46d46f9a1f..a036c858de 100644
--- a/support/splint/examples/ld/ldgramo.w
+++ b/support/splint/examples/ld/ldgramo.w
@@ -1,4 +1,4 @@
-@q Copyright 2020 Alexander Shibakov@>
+@q Copyright 2012-2022 Alexander Shibakov@>
@q Copyright 2002-2015 Free Software Foundation, Inc.@>
@q This file is part of SPLinT@>
@@ -492,17 +492,20 @@ statement_anywhere:
ENTRY '(' NAME ')'
{ lang_add_entry ($3, FALSE); }
| assignment end
- | ASSERT_K {@>@[ldlex_expression ();@>@=} '(' exp ',' NAME ')'
+ | ASSERT_K {@>@[ldlex_expression ();@]@=} '(' exp ',' NAME ')'
{
@O
ldlex_popstate ();
-@o
lang_add_assignment (exp_assert ($4, $6));
+@o
}
;
@g
+@q using a @@[, @@> pair instead of @@[, @@] may lead to some strange spacing artefacts @>
+@q due to the lack of \6; it is instructive to see its effects after replacing the @@] with @@> @>
+@q in the line containing ASSERT_K @>
@ \tracebadcharstrue
The {\setrulecontext{wildcardname}\prodstyle{'*'}} and \prodstyle{'?'} cases are there because the lexer returns them as
separate tokens rather than as \prodstyle{NAME}.
diff --git a/support/splint/examples/ld/ldint.sty b/support/splint/examples/ld/ldint.sty
index 83f3068dc5..a96003a53d 100644
--- a/support/splint/examples/ld/ldint.sty
+++ b/support/splint/examples/ld/ldint.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -203,9 +203,12 @@
}
\def\displayinteger#1#2#3#4#5#6#7#8{%
- {\def\ldintsep{$\,$}\hbox{\rm#7#8\rlap{${}_{#1}$}$\yystringempty{#2}{}{\lddisplayintsuffix{#2}}$}}%
+ {\def\ldintsep{$\,$}\hbox{\ldintfont#7#8\ldrlap{${}_{#1}$}$\yystringempty{#2}{}{\lddisplayintsuffix{#2}}$}}%
}
+\let\ldrlap\rlap
+\let\ldintfont\rm
+
\def\lddisplayintsuffix#1{%
\expandafter\ifx\csname ldspecialsuffixdisplay#1\endcsname\relax
\,\hbox{\tt#1}%
@@ -216,7 +219,7 @@
\def\ldspecialsuffixdisplayK{{}\cdot2^{10}}
-\def\ldspecialsuffixdisplayK{\,\hbox{\rm Kb}}
+%\def\ldspecialsuffixdisplayK{\,\hbox{\rm Kb}}
\def\displayintegerws#1#2#3#4#5#6#7{%
{\def\ldintsep{$\,$}\hbox{\rm#6#7\rlap{${}_{\yystringempty{#1}{}{\csname ldradix#1\endcsname}}$}}}%
diff --git a/support/splint/examples/ld/ldlex.w b/support/splint/examples/ld/ldlex.w
index 2312fd1027..0add0b0294 100644
--- a/support/splint/examples/ld/ldlex.w
+++ b/support/splint/examples/ld/ldlex.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020 Alexander Shibakov@>
+@q Copyright 2012-2022 Alexander Shibakov@>
@q Copyright 2002-2014 Free Software Foundation, Inc.@>
@q This file is part of SPLinT@>
@@ -17,10 +17,10 @@
@** The lexer.
\ifbootstrapmode
- \input ldman.sty
- \modebootstrap
- \input dcols.sty
- \setupfootnotes
+ \input limbo.sty
+ \input yystype.sty
+ \input grabstates.sty
+ \immediate\openout\stlist=ldl_states.h
\def\MRI{}
\def\ld{}
\fi
@@ -37,7 +37,7 @@ the \bison\ parser which is part of this distribution.
%{@> @<\ld\ lexer \Cee\ preamble@> @=%}
@> @<\ld\ lexer options@> @=
%%
- @> @<\ld\ token regular expressions@> @=
+ @> @<Regular expressions for \ld\ tokens@> @=
%%
@O
void define_all_states( void ) {
@@ -47,7 +47,7 @@ void define_all_states( void ) {
@g
@ @<\ld\ lexer options@>=
-@G
+@G(fs1)
%option bison-bridge
%option noyywrap nounput noinput reentrant
%option noyy_top_state
@@ -57,10 +57,10 @@ void define_all_states( void ) {
@g
@ @<\ld\ lexer \Cee\ preamble@>=
-#include <stdint.h>
-#include <stdbool.h>
-@ @<Collect state definitions for the \ld\ lexer@>=
+@ The file \.{ldl\_states.h} below contains the names of all the start
+conditions@^start conditions@> (or states) collected by the bootstrap parser.
+@<Collect state definitions for the \ld\ lexer@>=
#define _register_name( name ) @[Define_State( #name, name )@]
#include "ldl_states.h"
#undef _register_name
@@ -94,7 +94,7 @@ same section simplifies the job of the
\locallink{bootstrapstates}bootstrap parser\endlink, as well.
\ifbootstrapmode\immediate\openout\stlist=ldl_states.h\fi
@<\ld\ lexer states@>=
-@G
+@G(fs1)
%s SCRIPT
%s EXPRESSION
%s BOTH
@@ -117,8 +117,9 @@ function. The typesetting parser uses the \.{\\ldcomment} macro for
the same purpose. For the curious, here is a \flex\ style regular
expression defining \Cee\ comments\footnote{Taken from W.~McKeeman's site
at
-\url{http://www.cs.dartmouth.edu/~mckeeman/cs118/assignments/comment.html}
-and adapted to \flex\ syntax.}:
+\url{http://www.cs.dartmouth.edu/~mckeeman/cs118/assignments/comment.html} and
+adapted to \flex\ syntax. Here is the same regular expression pretty printed by
+\splint: \flexrestyle{"/*"("/"`[\^*/]`"*"+[\^*/])*"*"+"/"}}:
$$
\hbox{\.{"/*" ("/"\yl[\^*/]\yl"*"+[\^*/])* "*"+ "/"}}
$$
@@ -193,6 +194,15 @@ possible, however, if \.{\\yylextail} is not used inside actions (in the case of
an `optimized' lexer the restriction is even weaker, namely,
\.{\\yylextail} merely has to be absent in the portion of the action
following \.{\\ldcomment}).
+
+Another remark might be in order. It would seem more appropriate to
+employ \TeX's native grouping mechanism to avoid the side effects
+casued by the assignments performed by the macros (such as
+\.{\\let\\oldyyreturn\\yyreturn}). While this is possible with some
+careful macro writing, a na\:\i ve grouping attempt would interfere
+with the assignments performed by \.{\\yymatch}
+(e.g.~\.{\\yyresetstreams}). Avoiding assignments like these is still
+possible although the effort required is bordering on excessive.
@<Additional macros for the \ld\ lexer/parser@>=
@G(t)
\def\ldcomment#1\yylextail{%
@@ -221,14 +231,24 @@ We would like to simulate the file inclusion by inserting the
appropriate end of file marker for the lexer (a double
\.{\\yyeof}). After the relevant production completes, the marker
has to be cleaned up from the input stream (the lexer is designed to
-leave it intact). The macros below are designed to handle this assignment.
+leave it intact to be able to read the end of file multiple times
+while looking for the longest match).
+
+The macro below is designed to handle this task. The idea is to replace
+the double \.{\\yyeof} at the beginning of the input with an appropriate
+lexer action. The \.{\\yyreadinput} handles the input buffer and inserts the
+tail portion of the current \flex\ action in front of it.
@<Additional macros for the \ld\ lexer/parser@>=
@G(t)
\def\ldcleanyyeof#1\yylextail{%
- \let\oldyyinput\yyinput
- \def\yyinput\yyeof\yyeof{\let\yyinput\oldyyinput#1\yylextail}%
- \yymatch
+ \yyreadinput{\ldcl@@anyyeof{#1\yylextail}}{\romannumeral0\yyr@@@@dinput}%
+}
+
+\def\ldcl@@anyyeof#1#2#3{%
+ #3\ldcl@@anyye@@f{#1}#2%
}
+
+\def\ldcl@@anyye@@f#1#2\yyeof\yyeof{#1}
@g
@*1 Regular expressions.
@@ -237,204 +257,166 @@ describe the {\it tokens\/} of the appropriate language. The variey of
tokens recognized by \ld\ is quite extensive and is described in the
sections that follow.
-Variable names and algebraic operations come first.
-@<\ld\ token regular expressions@>=
+Variable names, constants, and algebraic operations come first.
+@<Regular expressions for \ld\ tokens@>=
@G(fs2)
-<BOTH,SCRIPT,EXPRESSION,VERS_START,VERS_NODE,VERS_SCRIPT>"/*" {@> @[TeX_( "/ldcomment/yylexnext" );@]@=}
-<DEFSYMEXP>"-" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<DEFSYMEXP>"+" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
-<DEFSYMEXP>"=" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {@> @<Return an absolute hex constant@> @=}
-<MRI,EXPRESSION>([0-9A-Fa-f])+(H|h|X|x|B|b|O|o|D|d) {@> @<Return a constant in a specific radix@>@=}
-<SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>((("$"|0[xX])([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? {
- @> @<Return a constant with a multiplier@>@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"]" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"[" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"<<=" {@> @[TeX_( "/yylexreturnptr{LSHIFTEQ}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>">>=" {@> @[TeX_( "/yylexreturnptr{RSHIFTEQ}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"||" {@> @[TeX_( "/yylexreturnptr{OROR}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"==" {@> @[TeX_( "/yylexreturnptr{EQ}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"!=" {@> @[TeX_( "/yylexreturnptr{NE}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>">=" {@> @[TeX_( "/yylexreturnptr{GE}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"<=" {@> @[TeX_( "/yylexreturnptr{LE}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"<<" {@> @[TeX_( "/yylexreturnptr{LSHIFT}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>">>" {@> @[TeX_( "/yylexreturnptr{RSHIFT}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"+=" {@> @[TeX_( "/yylexreturnptr{PLUSEQ}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"-=" {@> @[TeX_( "/yylexreturnptr{MINUSEQ}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"*=" {@> @[TeX_( "/yylexreturnptr{MULTEQ}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"/=" {@> @[TeX_( "/yylexreturnptr{DIVEQ}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"&=" {@> @[TeX_( "/yylexreturnptr{ANDEQ}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"|=" {@> @[TeX_( "/yylexreturnptr{OREQ}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"&&" {@> @[TeX_( "/yylexreturnptr{ANDAND}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>">" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"," {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"&" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"|" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"~" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"!" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"?" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"*" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"+" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"-" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"/" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"%" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"<" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"=" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"}" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"{" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>")" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>"(" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>":" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<BOTH,SCRIPT,EXPRESSION,MRI>";" {@> @[TeX_( "/yylexreturnchar" );@]@=}
+<BOTH,SCRIPT,EXPRESSION,VERS_START,VERS_NODE,VERS_SCRIPT>{
+ "/*" {@> @[TeX_( "/ldcomment/yylexnext" );@]@=}
+}
+
+<DEFSYMEXP>{
+ "-" {@> @[TeX_( "/yylexreturnchar" );@]@=}
+ "+" {@> @[TeX_( "/yylexreturnchar" );@]@=}
+ {FILENAMECHAR1}{SYMBOLCHARN}* {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
+ "=" {@> @[TeX_( "/yylexreturnchar" );@]@=}
+}
+
+<MRI,EXPRESSION>{
+ "$"([0-9A-Fa-f])+ {@> @<Return an absolute hex constant@> @=}
+ ([0-9A-Fa-f])+(H|h|X|x|B|b|O|o|D|d) {@> @<Return a constant in a specific radix@>@=}
+}
+
+<SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>{
+ ((("$"|0[xX])([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? {@> @<Return a constant with a multiplier@>@=}
+}
+
+<BOTH,SCRIPT,EXPRESSION,MRI>{
+ "<<=" {@> @[TeX_( "/yylexreturnptr{LSHIFTEQ}" );@]@=}
+ ">>=" {@> @[TeX_( "/yylexreturnptr{RSHIFTEQ}" );@]@=}
+ "||" {@> @[TeX_( "/yylexreturnptr{OROR}" );@]@=}
+ "==" {@> @[TeX_( "/yylexreturnptr{EQ}" );@]@=}
+ "!=" {@> @[TeX_( "/yylexreturnptr{NE}" );@]@=}
+ ">=" {@> @[TeX_( "/yylexreturnptr{GE}" );@]@=}
+ "<=" {@> @[TeX_( "/yylexreturnptr{LE}" );@]@=}
+ "<<" {@> @[TeX_( "/yylexreturnptr{LSHIFT}" );@]@=}
+ ">>" {@> @[TeX_( "/yylexreturnptr{RSHIFT}" );@]@=}
+ "+=" {@> @[TeX_( "/yylexreturnptr{PLUSEQ}" );@]@=}
+ "-=" {@> @[TeX_( "/yylexreturnptr{MINUSEQ}" );@]@=}
+ "*=" {@> @[TeX_( "/yylexreturnptr{MULTEQ}" );@]@=}
+ "/=" {@> @[TeX_( "/yylexreturnptr{DIVEQ}" );@]@=}
+ "&=" {@> @[TeX_( "/yylexreturnptr{ANDEQ}" );@]@=}
+ "|=" {@> @[TeX_( "/yylexreturnptr{OREQ}" );@]@=}
+ "&&" {@> @[TeX_( "/yylexreturnptr{ANDAND}" );@]@=}
+ [&|~!?*+\-/%=<>{}()\[\]:;,] {@> @[TeX_( "/yylexreturnchar" );@]@=}
+}
@g
@ The bulk of tokens produced by the lexer are the keywords used
inside script files. File name syntax is listed as well, along with
-miscellanea such as whitespace and version symbols.
-@<\ld\ token regular expressions@>=
+the miscellanea like whitespace and version symbols.
+@<Regular expressions for \ld\ tokens@>=
@G(fs2)
-<BOTH,SCRIPT>"MEMORY" {@> @[TeX_( "/yylexreturnptr{MEMORY}" );@]@=}
-<BOTH,SCRIPT>"REGION_ALIAS" {@> @[TeX_( "/yylexreturnptr{REGION_ALIAS}" );@]@=}
-<BOTH,SCRIPT>"LD_FEATURE" {@> @[TeX_( "/yylexreturnptr{LD_FEATURE}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION>"ORIGIN" {@> @[TeX_( "/yylexreturnptr{ORIGIN}" );@]@=}
-<BOTH,SCRIPT>"VERSION" {@> @[TeX_( "/yylexreturnptr{VERSIONK}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"BLOCK" {@> @[TeX_( "/yylexreturnptr{BLOCK}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"BIND" {@> @[TeX_( "/yylexreturnptr{BIND}" );@]@=}
-<BOTH,SCRIPT,EXPRESSION>"LENGTH" {@> @[TeX_( "/yylexreturnptr{LENGTH}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"ALIGN" {@> @[TeX_( "/yylexreturnptr{ALIGN_K}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"DATA_SEGMENT_ALIGN" {@> @[TeX_( "/yylexreturnptr{DATA_SEGMENT_ALIGN}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"DATA_SEGMENT_RELRO_END" {@> @[TeX_( "/yylexreturnptr{DATA_SEGMENT_RELRO_END}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"DATA_SEGMENT_END" {@> @[TeX_( "/yylexreturnptr{DATA_SEGMENT_END}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"ADDR" {@> @[TeX_( "/yylexreturnptr{ADDR}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"LOADADDR" {@> @[TeX_( "/yylexreturnptr{LOADADDR}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"ALIGNOF" {@> @[TeX_( "/yylexreturnptr{ALIGNOF}" );@]@=}
-<EXPRESSION,BOTH>"MAX" {@> @[TeX_( "/yylexreturnptr{MAX_K}" );@]@=}
-<EXPRESSION,BOTH>"MIN" {@> @[TeX_( "/yylexreturnptr{MIN_K}" );@]@=}
-<EXPRESSION,BOTH>"LOG2CEIL" {@> @[TeX_( "/yylexreturnptr{LOG2CEIL}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"ASSERT" {@> @[TeX_( "/yylexreturnptr{ASSERT_K}" );@]@=}
-<BOTH,SCRIPT>"ENTRY" {@> @[TeX_( "/yylexreturnptr{ENTRY}" );@]@=}
-<BOTH,SCRIPT,MRI>"EXTERN" {@> @[TeX_( "/yylexreturnptr{EXTERN}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"NEXT" {@> @[TeX_( "/yylexreturnptr{NEXT}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"sizeof_headers" {@> @[TeX_( "/yylexreturnptr{SIZEOF_HEADERS}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"SIZEOF_HEADERS" {@> @[TeX_( "/yylexreturnptr{SIZEOF_HEADERS}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"SEGMENT_START" {@> @[TeX_( "/yylexreturnptr{SEGMENT_START}" );@]@=}
-<BOTH,SCRIPT>"MAP" {@> @[TeX_( "/yylexreturnptr{MAP}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"SIZEOF" {@> @[TeX_( "/yylexreturnptr{SIZEOF}" );@]@=}
-<BOTH,SCRIPT>"TARGET" {@> @[TeX_( "/yylexreturnptr{TARGET_K}" );@]@=}
-<BOTH,SCRIPT>"SEARCH_DIR" {@> @[TeX_( "/yylexreturnptr{SEARCH_DIR}" );@]@=}
-<BOTH,SCRIPT>"OUTPUT" {@> @[TeX_( "/yylexreturnptr{OUTPUT}" );@]@=}
-<BOTH,SCRIPT>"INPUT" {@> @[TeX_( "/yylexreturnptr{INPUT}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"GROUP" {@> @[TeX_( "/yylexreturnptr{GROUP}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"AS_NEEDED" {@> @[TeX_( "/yylexreturnptr{AS_NEEDED}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"DEFINED" {@> @[TeX_( "/yylexreturnptr{DEFINED}" );@]@=}
-<BOTH,SCRIPT>"CREATE_OBJECT_SYMBOLS" {@> @[TeX_( "/yylexreturnptr{CREATE_OBJECT_SYMBOLS}" );@]@=}
-<BOTH,SCRIPT>"CONSTRUCTORS" {@> @[TeX_( "/yylexreturnptr{CONSTRUCTORS}" );@]@=}
-<BOTH,SCRIPT>"FORCE_COMMON_ALLOCATION" {@> @[TeX_( "/yylexreturnptr{FORCE_COMMON_ALLOCATION}" );@]@=}
-<BOTH,SCRIPT>"INHIBIT_COMMON_ALLOCATION" {@> @[TeX_( "/yylexreturnptr{INHIBIT_COMMON_ALLOCATION}" );@]@=}
-<BOTH,SCRIPT>"SECTIONS" {@> @[TeX_( "/yylexreturnptr{SECTIONS}" );@]@=}
-<BOTH,SCRIPT>"INSERT" {@> @[TeX_( "/yylexreturnptr{INSERT_K}" );@]@=}
-<BOTH,SCRIPT>"AFTER" {@> @[TeX_( "/yylexreturnptr{AFTER}" );@]@=}
-<BOTH,SCRIPT>"BEFORE" {@> @[TeX_( "/yylexreturnptr{BEFORE}" );@]@=}
-<BOTH,SCRIPT>"FILL" {@> @[TeX_( "/yylexreturnptr{FILL}" );@]@=}
-<BOTH,SCRIPT>"STARTUP" {@> @[TeX_( "/yylexreturnptr{STARTUP}" );@]@=}
-<BOTH,SCRIPT>"OUTPUT_FORMAT" {@> @[TeX_( "/yylexreturnptr{OUTPUT_FORMAT}" );@]@=}
-<BOTH,SCRIPT>"OUTPUT_ARCH" {@> @[TeX_( "/yylexreturnptr{OUTPUT_ARCH}" );@]@=}
-<BOTH,SCRIPT>"HLL" {@> @[TeX_( "/yylexreturnptr{HLL}" );@]@=}
-<BOTH,SCRIPT>"SYSLIB" {@> @[TeX_( "/yylexreturnptr{SYSLIB}" );@]@=}
-<BOTH,SCRIPT>"FLOAT" {@> @[TeX_( "/yylexreturnptr{FLOAT}" );@]@=}
-<BOTH,SCRIPT>"QUAD" {@> @[TeX_( "/yylexreturnptr{QUAD}" );@]@=}
-<BOTH,SCRIPT>"SQUAD" {@> @[TeX_( "/yylexreturnptr{SQUAD}" );@]@=}
-<BOTH,SCRIPT>"LONG" {@> @[TeX_( "/yylexreturnptr{LONG}" );@]@=}
-<BOTH,SCRIPT>"SHORT" {@> @[TeX_( "/yylexreturnptr{SHORT}" );@]@=}
-<BOTH,SCRIPT>"BYTE" {@> @[TeX_( "/yylexreturnptr{BYTE}" );@]@=}
-<BOTH,SCRIPT>"NOFLOAT" {@> @[TeX_( "/yylexreturnptr{NOFLOAT}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"NOCROSSREFS" {@> @[TeX_( "/yylexreturnptr{NOCROSSREFS}" );@]@=}
-<BOTH,SCRIPT>"OVERLAY" {@> @[TeX_( "/yylexreturnptr{OVERLAY}" );@]@=}
-<BOTH,SCRIPT>"SORT_BY_NAME" {@> @[TeX_( "/yylexreturnptr{SORT_BY_NAME}" );@]@=}
-<BOTH,SCRIPT>"SORT_BY_ALIGNMENT" {@> @[TeX_( "/yylexreturnptr{SORT_BY_ALIGNMENT}" );@]@=}
-<BOTH,SCRIPT>"SORT" {@> @[TeX_( "/yylexreturnptr{SORT_BY_NAME}" );@]@=}
-<BOTH,SCRIPT>"SORT_BY_INIT_PRIORITY" {@> @[TeX_( "/yylexreturnptr{SORT_BY_INIT_PRIORITY}" );@]@=}
-<BOTH,SCRIPT>"SORT_NONE" {@> @[TeX_( "/yylexreturnptr{SORT_NONE}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"NOLOAD" {@> @[TeX_( "/yylexreturnptr{NOLOAD}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"DSECT" {@> @[TeX_( "/yylexreturnptr{DSECT}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"COPY" {@> @[TeX_( "/yylexreturnptr{COPY}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"INFO" {@> @[TeX_( "/yylexreturnptr{INFO}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"OVERLAY" {@> @[TeX_( "/yylexreturnptr{OVERLAY}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RO" {@> @[TeX_( "/yylexreturnptr{ONLY_IF_RO}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RW" {@> @[TeX_( "/yylexreturnptr{ONLY_IF_RW}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"SPECIAL" {@> @[TeX_( "/yylexreturnptr{SPECIAL}" );@]@=}
-<BOTH,SCRIPT>"o" {@> @[TeX_( "/yylexreturnptr{ORIGIN}" );@]@=}
-<BOTH,SCRIPT>"org" {@> @[TeX_( "/yylexreturnptr{ORIGIN}" );@]@=}
-<BOTH,SCRIPT>"l" {@> @[TeX_( "/yylexreturnptr{LENGTH}" );@]@=}
-<BOTH,SCRIPT>"len" {@> @[TeX_( "/yylexreturnptr{LENGTH}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"INPUT_SECTION_FLAGS" {@> @[TeX_( "/yylexreturnptr{INPUT_SECTION_FLAGS}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"INCLUDE" {@> @[TeX_( "/yylexreturnptr{INCLUDE}" );@]@=}
-<BOTH,SCRIPT>"PHDRS" {@> @[TeX_( "/yylexreturnptr{PHDRS}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"AT" {@> @[TeX_( "/yylexreturnptr{AT}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"ALIGN_WITH_INPUT" {@> @[TeX_( "/yylexreturnptr{ALIGN_WITH_INPUT}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"SUBALIGN" {@> @[TeX_( "/yylexreturnptr{SUBALIGN}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"HIDDEN" {@> @[TeX_( "/yylexreturnptr{HIDDEN}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"PROVIDE" {@> @[TeX_( "/yylexreturnptr{PROVIDE}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"PROVIDE_HIDDEN" {@> @[TeX_( "/yylexreturnptr{PROVIDE_HIDDEN}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"KEEP" {@> @[TeX_( "/yylexreturnptr{KEEP}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"EXCLUDE_FILE" {@> @[TeX_( "/yylexreturnptr{EXCLUDE_FILE}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT>"CONSTANT" {@> @[TeX_( "/yylexreturnptr{CONSTANT}" );@]@=}
-<MRI>"#".*\n? {@> @[TeX_( "/yylexnext" );@]@=}
-<MRI>"\n" {@> @[TeX_( "/yylexreturnptr{NEWLINE}" );@]@=}
-<MRI>"*".* {@> @[TeX_( "/yylexnext" );@]@=}
-<MRI>";".* {@> @[TeX_( "/yylexnext" );@]@=}
-<MRI>"END" {@> @[TeX_( "/yylexreturnptr{ENDWORD}" );@]@=}
-<MRI>"ALIGNMOD" {@> @[TeX_( "/yylexreturnptr{ALIGNMOD}" );@]@=}
-<MRI>"ALIGN" {@> @[TeX_( "/yylexreturnptr{ALIGN_K}" );@]@=}
-<MRI>"CHIP" {@> @[TeX_( "/yylexreturnptr{CHIP}" );@]@=}
-<MRI>"BASE" {@> @[TeX_( "/yylexreturnptr{BASE}" );@]@=}
-<MRI>"ALIAS" {@> @[TeX_( "/yylexreturnptr{ALIAS}" );@]@=}
-<MRI>"TRUNCATE" {@> @[TeX_( "/yylexreturnptr{TRUNCATE}" );@]@=}
-<MRI>"LOAD" {@> @[TeX_( "/yylexreturnptr{LOAD}" );@]@=}
-<MRI>"PUBLIC" {@> @[TeX_( "/yylexreturnptr{PUBLIC}" );@]@=}
-<MRI>"ORDER" {@> @[TeX_( "/yylexreturnptr{ORDER}" );@]@=}
-<MRI>"NAME" {@> @[TeX_( "/yylexreturnptr{NAMEWORD}" );@]@=}
-<MRI>"FORMAT" {@> @[TeX_( "/yylexreturnptr{FORMAT}" );@]@=}
-<MRI>"CASE" {@> @[TeX_( "/yylexreturnptr{CASE}" );@]@=}
-<MRI>"START" {@> @[TeX_( "/yylexreturnptr{START}" );@]@=}
-<MRI>"LIST".* {@> @[TeX_( "/yylexreturnptr{LIST}" );@]@=}
-<MRI>"SECT" {@> @[TeX_( "/yylexreturnptr{SECT}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT,MRI>"ABSOLUTE" {@> @[TeX_( "/yylexreturnptr{ABSOLUTE}" );@]@=}
-<MRI>"end" {@> @[TeX_( "/yylexreturnptr{ENDWORD}" );@]@=}
-<MRI>"alignmod" {@> @[TeX_( "/yylexreturnptr{ALIGNMOD}" );@]@=}
-<MRI>"align" {@> @[TeX_( "/yylexreturnptr{ALIGN_K}" );@]@=}
-<MRI>"chip" {@> @[TeX_( "/yylexreturnptr{CHIP}" );@]@=}
-<MRI>"base" {@> @[TeX_( "/yylexreturnptr{BASE}" );@]@=}
-<MRI>"alias" {@> @[TeX_( "/yylexreturnptr{ALIAS}" );@]@=}
-<MRI>"truncate" {@> @[TeX_( "/yylexreturnptr{TRUNCATE}" );@]@=}
-<MRI>"load" {@> @[TeX_( "/yylexreturnptr{LOAD}" );@]@=}
-<MRI>"public" {@> @[TeX_( "/yylexreturnptr{PUBLIC}" );@]@=}
-<MRI>"order" {@> @[TeX_( "/yylexreturnptr{ORDER}" );@]@=}
-<MRI>"name" {@> @[TeX_( "/yylexreturnptr{NAMEWORD}" );@]@=}
-<MRI>"format" {@> @[TeX_( "/yylexreturnptr{FORMAT}" );@]@=}
-<MRI>"case" {@> @[TeX_( "/yylexreturnptr{CASE}" );@]@=}
-<MRI>"extern" {@> @[TeX_( "/yylexreturnptr{EXTERN}" );@]@=}
-<MRI>"start" {@> @[TeX_( "/yylexreturnptr{START}" );@]@=}
-<MRI>"list".* {@> @[TeX_( "/yylexreturnptr{LIST}" );@]@=}
-<MRI>"sect" {@> @[TeX_( "/yylexreturnptr{SECT}" );@]@=}
-<EXPRESSION,BOTH,SCRIPT,MRI>"absolute" {@> @[TeX_( "/yylexreturnptr{ABSOLUTE}" );@]@=}
-<MRI>{FILENAMECHAR1}{NOCFILENAMECHAR}* {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
-<BOTH>{FILENAMECHAR1}{FILENAMECHAR}* {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
-<BOTH>"-l"{FILENAMECHAR}+ {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
-<EXPRESSION>{FILENAMECHAR1}{NOCFILENAMECHAR}* {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
-<EXPRESSION>"-l"{NOCFILENAMECHAR}+ {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
+<BOTH,SCRIPT>{
+ "MEMORY" {@> @[TeX_( "/yylexreturnptr{MEMORY}" );@]@=}
+ "REGION_ALIAS" {@> @[TeX_( "/yylexreturnptr{REGION_ALIAS}" );@]@=}
+ "LD_FEATURE" {@> @[TeX_( "/yylexreturnptr{LD_FEATURE}" );@]@=}
+ "VERSION" {@> @[TeX_( "/yylexreturnptr{VERSIONK}" );@]@=}
+ "TARGET" {@> @[TeX_( "/yylexreturnptr{TARGET_K}" );@]@=}
+ "SEARCH_DIR" {@> @[TeX_( "/yylexreturnptr{SEARCH_DIR}" );@]@=}
+ "OUTPUT" {@> @[TeX_( "/yylexreturnptr{OUTPUT}" );@]@=}
+ "INPUT" {@> @[TeX_( "/yylexreturnptr{INPUT}" );@]@=}
+ "ENTRY" {@> @[TeX_( "/yylexreturnptr{ENTRY}" );@]@=}
+ "MAP" {@> @[TeX_( "/yylexreturnptr{MAP}" );@]@=}
+ "CREATE_OBJECT_SYMBOLS" {@> @[TeX_( "/yylexreturnptr{CREATE_OBJECT_SYMBOLS}" );@]@=}
+ "CONSTRUCTORS" {@> @[TeX_( "/yylexreturnptr{CONSTRUCTORS}" );@]@=}
+ "FORCE_COMMON_ALLOCATION" {@> @[TeX_( "/yylexreturnptr{FORCE_COMMON_ALLOCATION}" );@]@=}
+ "INHIBIT_COMMON_ALLOCATION" {@> @[TeX_( "/yylexreturnptr{INHIBIT_COMMON_ALLOCATION}" );@]@=}
+ "SECTIONS" {@> @[TeX_( "/yylexreturnptr{SECTIONS}" );@]@=}
+ "INSERT" {@> @[TeX_( "/yylexreturnptr{INSERT_K}" );@]@=}
+ "AFTER" {@> @[TeX_( "/yylexreturnptr{AFTER}" );@]@=}
+ "BEFORE" {@> @[TeX_( "/yylexreturnptr{BEFORE}" );@]@=}
+ "FILL" {@> @[TeX_( "/yylexreturnptr{FILL}" );@]@=}
+ "STARTUP" {@> @[TeX_( "/yylexreturnptr{STARTUP}" );@]@=}
+ "OUTPUT_FORMAT" {@> @[TeX_( "/yylexreturnptr{OUTPUT_FORMAT}" );@]@=}
+ "OUTPUT_ARCH" {@> @[TeX_( "/yylexreturnptr{OUTPUT_ARCH}" );@]@=}
+ "HLL" {@> @[TeX_( "/yylexreturnptr{HLL}" );@]@=}
+ "SYSLIB" {@> @[TeX_( "/yylexreturnptr{SYSLIB}" );@]@=}
+ "FLOAT" {@> @[TeX_( "/yylexreturnptr{FLOAT}" );@]@=}
+ "QUAD" {@> @[TeX_( "/yylexreturnptr{QUAD}" );@]@=}
+ "SQUAD" {@> @[TeX_( "/yylexreturnptr{SQUAD}" );@]@=}
+ "LONG" {@> @[TeX_( "/yylexreturnptr{LONG}" );@]@=}
+ "SHORT" {@> @[TeX_( "/yylexreturnptr{SHORT}" );@]@=}
+ "BYTE" {@> @[TeX_( "/yylexreturnptr{BYTE}" );@]@=}
+ "NOFLOAT" {@> @[TeX_( "/yylexreturnptr{NOFLOAT}" );@]@=}
+ "OVERLAY" {@> @[TeX_( "/yylexreturnptr{OVERLAY}" );@]@=}
+ "SORT_BY_NAME" {@> @[TeX_( "/yylexreturnptr{SORT_BY_NAME}" );@]@=}
+ "SORT_BY_ALIGNMENT" {@> @[TeX_( "/yylexreturnptr{SORT_BY_ALIGNMENT}" );@]@=}
+ "SORT" {@> @[TeX_( "/yylexreturnptr{SORT_BY_NAME}" );@]@=}
+ "SORT_BY_INIT_PRIORITY" {@> @[TeX_( "/yylexreturnptr{SORT_BY_INIT_PRIORITY}" );@]@=}
+ "SORT_NONE" {@> @[TeX_( "/yylexreturnptr{SORT_NONE}" );@]@=}
+ "EXTERN" {@> @[TeX_( "/yylexreturnptr{EXTERN}" );@]@=}
+ "o"|"org" {@> @[TeX_( "/yylexreturnptr{ORIGIN}" );@]@=}
+ "l"|"len" {@> @[TeX_( "/yylexreturnptr{LENGTH}" );@]@=}
+ "PHDRS" {@> @[TeX_( "/yylexreturnptr{PHDRS}" );@]@=}
+}
+
+<EXPRESSION,BOTH,SCRIPT>{
+ "BLOCK" {@> @[TeX_( "/yylexreturnptr{BLOCK}" );@]@=}
+ "BIND" {@> @[TeX_( "/yylexreturnptr{BIND}" );@]@=}
+ "LENGTH" {@> @[TeX_( "/yylexreturnptr{LENGTH}" );@]@=}
+ "ORIGIN" {@> @[TeX_( "/yylexreturnptr{ORIGIN}" );@]@=}
+ "ALIGN" {@> @[TeX_( "/yylexreturnptr{ALIGN_K}" );@]@=}
+ "DATA_SEGMENT_ALIGN" {@> @[TeX_( "/yylexreturnptr{DATA_SEGMENT_ALIGN}" );@]@=}
+ "DATA_SEGMENT_RELRO_END" {@> @[TeX_( "/yylexreturnptr{DATA_SEGMENT_RELRO_END}" );@]@=}
+ "DATA_SEGMENT_END" {@> @[TeX_( "/yylexreturnptr{DATA_SEGMENT_END}" );@]@=}
+ "ADDR" {@> @[TeX_( "/yylexreturnptr{ADDR}" );@]@=}
+ "LOADADDR" {@> @[TeX_( "/yylexreturnptr{LOADADDR}" );@]@=}
+ "ALIGNOF" {@> @[TeX_( "/yylexreturnptr{ALIGNOF}" );@]@=}
+ "ASSERT" {@> @[TeX_( "/yylexreturnptr{ASSERT_K}" );@]@=}
+ "NEXT" {@> @[TeX_( "/yylexreturnptr{NEXT}" );@]@=}
+ "sizeof_headers" {@> @[TeX_( "/yylexreturnptr{SIZEOF_HEADERS}" );@]@=}
+ "SIZEOF_HEADERS" {@> @[TeX_( "/yylexreturnptr{SIZEOF_HEADERS}" );@]@=}
+ "SEGMENT_START" {@> @[TeX_( "/yylexreturnptr{SEGMENT_START}" );@]@=}
+ "SIZEOF" {@> @[TeX_( "/yylexreturnptr{SIZEOF}" );@]@=}
+ "GROUP" {@> @[TeX_( "/yylexreturnptr{GROUP}" );@]@=}
+ "AS_NEEDED" {@> @[TeX_( "/yylexreturnptr{AS_NEEDED}" );@]@=}
+ "DEFINED" {@> @[TeX_( "/yylexreturnptr{DEFINED}" );@]@=}
+ "NOCROSSREFS" {@> @[TeX_( "/yylexreturnptr{NOCROSSREFS}" );@]@=}
+ "NOLOAD" {@> @[TeX_( "/yylexreturnptr{NOLOAD}" );@]@=}
+ "DSECT" {@> @[TeX_( "/yylexreturnptr{DSECT}" );@]@=}
+ "COPY" {@> @[TeX_( "/yylexreturnptr{COPY}" );@]@=}
+ "INFO" {@> @[TeX_( "/yylexreturnptr{INFO}" );@]@=}
+ "OVERLAY" {@> @[TeX_( "/yylexreturnptr{OVERLAY}" );@]@=}
+ "ONLY_IF_RO" {@> @[TeX_( "/yylexreturnptr{ONLY_IF_RO}" );@]@=}
+ "ONLY_IF_RW" {@> @[TeX_( "/yylexreturnptr{ONLY_IF_RW}" );@]@=}
+ "SPECIAL" {@> @[TeX_( "/yylexreturnptr{SPECIAL}" );@]@=}
+ "INPUT_SECTION_FLAGS" {@> @[TeX_( "/yylexreturnptr{INPUT_SECTION_FLAGS}" );@]@=}
+ "INCLUDE" {@> @[TeX_( "/yylexreturnptr{INCLUDE}" );@]@=}
+ "AT" {@> @[TeX_( "/yylexreturnptr{AT}" );@]@=}
+ "ALIGN_WITH_INPUT" {@> @[TeX_( "/yylexreturnptr{ALIGN_WITH_INPUT}" );@]@=}
+ "SUBALIGN" {@> @[TeX_( "/yylexreturnptr{SUBALIGN}" );@]@=}
+ "HIDDEN" {@> @[TeX_( "/yylexreturnptr{HIDDEN}" );@]@=}
+ "PROVIDE" {@> @[TeX_( "/yylexreturnptr{PROVIDE}" );@]@=}
+ "PROVIDE_HIDDEN" {@> @[TeX_( "/yylexreturnptr{PROVIDE_HIDDEN}" );@]@=}
+ "KEEP" {@> @[TeX_( "/yylexreturnptr{KEEP}" );@]@=}
+ "EXCLUDE_FILE" {@> @[TeX_( "/yylexreturnptr{EXCLUDE_FILE}" );@]@=}
+ "CONSTANT" {@> @[TeX_( "/yylexreturnptr{CONSTANT}" );@]@=}
+ "\n" {@> @[TeX_( "/yylexnext" );@]@=}
+}
+
+<EXPRESSION,BOTH>{
+ "MAX" {@> @[TeX_( "/yylexreturnptr{MAX_K}" );@]@=}
+ "MIN" {@> @[TeX_( "/yylexreturnptr{MIN_K}" );@]@=}
+ "LOG2CEIL" {@> @[TeX_( "/yylexreturnptr{LOG2CEIL}" );@]@=}
+}
+
+<EXPRESSION,BOTH,SCRIPT,MRI>{
+ "ABSOLUTE"|"absolute" {@> @[TeX_( "/yylexreturnptr{ABSOLUTE}" );@]@=}
+ [ \t\r]+ {@> @[TeX_( "/yylexnext" );@]@=}
+}
+
+<BOTH>{
+ {FILENAMECHAR1}{FILENAMECHAR}* {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
+ "-l"{FILENAMECHAR}+ {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
+}
+
+<EXPRESSION>{
+ {FILENAMECHAR1}{NOCFILENAMECHAR}* {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
+ "-l"{NOCFILENAMECHAR}+ {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
+}
+
<SCRIPT>{WILDCHAR}* {@> @[@<Skip a possible comment and return a \prodstyle{NAME}@>@]@=}
<EXPRESSION,BOTH,SCRIPT,VERS_NODE>"\""[^\"]*"\"" {@> @[@<Return the \prodstyle{NAME} inside quotes@>@]@=}
-<BOTH,SCRIPT,EXPRESSION>"\n" {@> @[TeX_( "/yylexnext" );@]@=}
-<MRI,BOTH,SCRIPT,EXPRESSION>[ \t\r]+ {@> @[TeX_( "/yylexnext" );@]@=}
-<VERS_NODE,VERS_SCRIPT>[:,;] {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<VERS_NODE>global {@> @[TeX_( "/yylexreturnptr{GLOBAL}" );@]@=}
-<VERS_NODE>local {@> @[TeX_( "/yylexreturnptr{LOCAL}" );@]@=}
-<VERS_NODE>extern {@> @[TeX_( "/yylexreturnptr{EXTERN}" );@]@=}
-<VERS_NODE>{V_IDENTIFIER} {@> @[TeX_( "/yylexreturnval{VERS_IDENTIFIER}" );@]@=}
-<VERS_SCRIPT>{V_TAG} {@> @[TeX_( "/yylexreturnval{VERS_TAG}" );@]@=}
-<VERS_START>"{" {@> @[TeX_( "/yyBEGIN{VERS_SCRIPT}/yylexreturnchar" );@]@=}
@g
@ There is a bit of a trick to returning an absolute hex value. The
@@ -455,23 +437,6 @@ macros are looking for a \.{\$} suffix while the contents of
@[TeX_( "{/the/yyfmark}{/the/yysmark}}}/next" );@]@;
@[TeX_( "/yylexreturn{INT}" );@]@;
-@ @<Additional macros for the \ld\ lexer/parser@>=
-@G(t)
-@=\def\matchcomment@@#1/*#2\yyeof#3#4{%@>@;
- \yystringempty{#1}{#3}{#4}%
-}
-\def\matchcomment#1{%
-@= \expandafter\matchcomment@@\the#1/*\yyeof@>@;
-}
-\def\ldstripquotes@@"#1"\yyeof{#1}
-\def\ldstripquotes#1{%
- \yytext\expandafter\expandafter\expandafter
- {\expandafter\ldstripquotes@@\the\yytext\yyeof}%
- \yytextpure\expandafter\expandafter\expandafter
- {\expandafter\ldstripquotes@@\the\yytextpure\yyeof}%
-}
-@g
-
@ {\it Annoyingly, this pattern can match comments, and we have
longest match issues to consider. So if the first two
characters are a comment opening, put the input back and
@@ -485,31 +450,103 @@ try again.}
@<Return the \prodstyle{NAME} inside quotes@>=
@[TeX_( "/ldstripquotes/yylexreturnsym{NAME}" );@]@;
-@ @<Additional macros for the \ld\ lexer/parser@>=
+@ Some syntax specific to version scripts.
+@<Regular expressions for \ld\ tokens@>=
+@G(fs2)
+<VERS_SCRIPT>{
+ "{" {@> @[TeX_( "/yyBEGIN{VERS_NODE}/versnodenesting=/z@@/yylexreturnchar" );@]@=}
+ "}" {@> @[TeX_( "/yylexreturnchar" );@]@=}
+ {V_TAG} {@> @[TeX_( "/yylexreturnval{VERS_TAG}" );@]@=}
+}
+
+<VERS_NODE>{
+ global {@> @[TeX_( "/yylexreturnptr{GLOBAL}" );@]@=}
+ local {@> @[TeX_( "/yylexreturnptr{LOCAL}" );@]@=}
+ extern {@> @[TeX_( "/yylexreturnptr{EXTERN}" );@]@=}
+ {V_IDENTIFIER} {@> @[TeX_( "/yylexreturnval{VERS_IDENTIFIER}" );@]@=}
+ "{" {@> @[TeX_( "/advance/versnodenesting/@@ne /yylexreturnchar" );@]@=}
+ "}" {@> @<Finish the current group, possibly switch to \flexsnstyle{VERS_SCRIPT}@> @=}
+}
+
+<VERS_NODE,VERS_SCRIPT>[:,;] {@> @[TeX_( "/yylexreturnchar" );@]@=}
+<VERS_START>"{" {@> @[TeX_( "/yyBEGIN{VERS_SCRIPT}/yylexreturnchar" );@]@=}
+
+<VERS_START,VERS_NODE,VERS_SCRIPT>{
+ [\n] {@> @[TeX_( "/yylexnext" );@]@=}
+ #.* {@> @[TeX_( "/yylexnext" );@]@=}
+ [ \t\r]+ {@> @[TeX_( "/yylexnext" );@]@=}
+}
+@g
+
+@ @<Finish the current group, possibly switch to \flexsnstyle{VERS_SCRIPT}@>=
+ @[TeX_( "/advance/versnodenesting/m@@ne" );@]@;
+ @[TeX_( "/ifnum/versnodenesting</z@@" );@]@;
+ @[TeX_( " /yyBEGIN{VERS_SCRIPT}" );@]@;
+ @[TeX_( "/fi" );@]@;
+ @[TeX_( "/yylexreturnchar" );@]@;
+
+@ Some syntax specific to \MRI\ scripts.
+@<Regular expressions for \ld\ tokens@>=
+@G(fs2)
+<MRI>{
+ "#".*\n? {@> @[TeX_( "/yylexnext" );@]@=}
+ "\n" {@> @[TeX_( "/yylexreturnptr{NEWLINE}" );@]@=}
+ "*".* {@> @[TeX_( "/yylexnext" );@]@=}
+ ";".* {@> @[TeX_( "/yylexnext" );@]@=}
+ "END"|"end" {@> @[TeX_( "/yylexreturnptr{ENDWORD}" );@]@=}
+ "ALIGNMOD"|"alignmod" {@> @[TeX_( "/yylexreturnptr{ALIGNMOD}" );@]@=}
+ "ALIGN"|"align" {@> @[TeX_( "/yylexreturnptr{ALIGN_K}" );@]@=}
+ "CHIP"|"chip" {@> @[TeX_( "/yylexreturnptr{CHIP}" );@]@=}
+ "BASE"|"base" {@> @[TeX_( "/yylexreturnptr{BASE}" );@]@=}
+ "ALIAS"|"alias" {@> @[TeX_( "/yylexreturnptr{ALIAS}" );@]@=}
+ "TRUNCATE"|"truncate" {@> @[TeX_( "/yylexreturnptr{TRUNCATE}" );@]@=}
+ "LOAD"|"load" {@> @[TeX_( "/yylexreturnptr{LOAD}" );@]@=}
+ "PUBLIC"|"public" {@> @[TeX_( "/yylexreturnptr{PUBLIC}" );@]@=}
+ "ORDER"|"order" {@> @[TeX_( "/yylexreturnptr{ORDER}" );@]@=}
+ "NAME"|"name" {@> @[TeX_( "/yylexreturnptr{NAMEWORD}" );@]@=}
+ "FORMAT"|"format" {@> @[TeX_( "/yylexreturnptr{FORMAT}" );@]@=}
+ "CASE"|"case" {@> @[TeX_( "/yylexreturnptr{CASE}" );@]@=}
+ "START"|"start" {@> @[TeX_( "/yylexreturnptr{START}" );@]@=}
+ ("LIST"|"list").* {@> @[TeX_( "/yylexreturnptr{LIST}" );@]@=}
+ "SECT"|"sect" {@> @[TeX_( "/yylexreturnptr{SECT}" );@]@=}
+ "EXTERN"|"extern" {@> @[TeX_( "/yylexreturnptr{EXTERN}" );@]@=}
+ {FILENAMECHAR1}{NOCFILENAMECHAR}* {@> @[TeX_( "/yylexreturnsym{NAME}" );@]@=}
+}
+@g
+
+@ The macros and the register definitions used to implement the actions above have been collected in this
+section.
+@<Additional macros for the \ld\ lexer/parser@>=
@G(t)
\newcount\versnodenesting
\newcount\includestackptr
+
+\def\matchcomment#1{%
+@= \expandafter\matchcomment@@\the#1/*\yyeof@>@;
+}
+
+@=\def\matchcomment@@#1/*#2\yyeof#3#4{%@>@;
+ \yystringempty{#1}{#3}{#4}%
+}
+
+\def\ldstripquotes#1{%
+ \yytext\expandafter\expandafter\expandafter
+ {\expandafter\ldstripquotes@@\the\yytext\yyeof}%
+ \yytextpure\expandafter\expandafter\expandafter
+ {\expandafter\ldstripquotes@@\the\yytextpure\yyeof}%
+}
+
+\def\ldstripquotes@@"#1"\yyeof{#1}
@g
-@ Some syntax specific to version scripts.
-@<\ld\ token regular expressions@>=
+@ Catchall actions. These react to unexpected characters with (somewhat misleading) error messages. The placement
+of these rules is important, since they may match a token of the same length defined earlier.
+@<Regular expressions for \ld\ tokens@>=
@G(fs2)
-<VERS_SCRIPT>"{" {@> @[TeX_( "/yyBEGIN{VERS_NODE}/versnodenesting=/z@@/yylexreturnchar" );@]@=}
-<VERS_SCRIPT>"}" {@> @[TeX_( "/yylexreturnchar" );@]@=}
-<VERS_NODE>"{" {@> @[TeX_( "/advance/versnodenesting/@@ne /yylexreturnchar" );@]@=}
-<VERS_NODE>"}" {@> @[TeX_( "/advance/versnodenesting/m@@ne" );@]@=
- @> @[TeX_( "/ifnum/versnodenesting</z@@" );@]@=
- @> @[TeX_( " /yyBEGIN{VERS_SCRIPT}" );@]@=
- @> @[TeX_( "/fi" );@]@=
- @> @[TeX_( "/yylexreturnchar" );@]@=}
-<VERS_START,VERS_NODE,VERS_SCRIPT>[\n] {@> @[TeX_( "/yylexnext" );@]@=}
-<VERS_START,VERS_NODE,VERS_SCRIPT>#.* {@> @[TeX_( "/yylexnext" );@]@=}
-<VERS_START,VERS_NODE,VERS_SCRIPT>[ \t\r]+ {@> @[TeX_( "/yylexnext" );@]@=}
+<SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. {@> @[TeX_( "/yyfatal{bad character `/the/yytext' in script}" );@]@=}
+<EXPRESSION,DEFSYMEXP,BOTH>. {@> @[TeX_( "/yyfatal{bad character `/the/yytext' in expression}" );@]@=}
<<EOF>> {@> @[@<Process the end of (possibly included) file@>@]@=}
-
-<SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. {@> @[TeX_( "/yyfatal{bad character `/the/yytext' in script}" );@]@=}
-<EXPRESSION,DEFSYMEXP,BOTH>. {@> @[TeX_( "/yyfatal{bad character `/the/yytext' in expression}" );@]@=}
@g
@ @<Process the end of (possibly included) file@>=
diff --git a/support/splint/examples/ld/ldlexo.w b/support/splint/examples/ld/ldlexo.w
index a1c5d62bb0..eb273ac7e8 100644
--- a/support/splint/examples/ld/ldlexo.w
+++ b/support/splint/examples/ld/ldlexo.w
@@ -1,4 +1,4 @@
-@q Copyright 2015-2020 Alexander Shibakov@>
+@q Copyright 2015-2022 Alexander Shibakov@>
@q Copyright 2002-2015 Free Software Foundation, Inc.@>
@q This file is part of SPLinT@>
@@ -26,11 +26,17 @@ are a leftover from the archaic days of the original scanner generator.}
@G
@> @<Original \ld\ macros@> @=
%{@>@<Original \ld\ preamble@> @=%}
-%option nounput
+ @> @<Miscellaneous \ld\ lexer options@> @=
@> @<Ignored options@> @=
%%
@> @<Original \ld\ regular expressions@> @=
%%
+ @> @<Original \ld\ postamble@> @=
+@g
+
+@ @<Miscellaneous \ld\ lexer options@>=
+@G(fs1)
+%option nounput
@g
@ @<Original \ld\ preamble@>=
@@ -134,7 +140,7 @@ States:
}%
\ifbootstrapmode\else\yyskipparsefalse\fi
@<\ld\ states@>=
-@G
+@G(fs1)
%s SCRIPT
%s EXPRESSION
%s BOTH
@@ -145,7 +151,7 @@ States:
%s VERS_NODE
@g
-@ @<\ld\ postamble@>=
+@ @<Original \ld\ postamble@>=
if (parser_input != input_selected)
{
/* The first token of the input determines the initial parser state. */
diff --git a/support/splint/examples/ld/ldman.w b/support/splint/examples/ld/ldman.w
index b6eb733dbd..af55b19111 100644
--- a/support/splint/examples/ld/ldman.w
+++ b/support/splint/examples/ld/ldman.w
@@ -1,5 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
-% Copyright 2002-2014 Free Software Foundation, Inc.
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -15,27 +14,22 @@
% You should have received a copy of the GNU General Public License
% along with SPLinT. If not, see <http://www.gnu.org/licenses/>.
@s TeX_ TeX
-\def\MRI{{\sc MRI}}
\def\optimization{5}
\input ldman.sty
+\input ldsetup.sty
\modenormal
\input ldfrontmatter.sty
-\input noweb.sty
- \xreflocaltrue
- \readlxrefs % read the reference file if exists before any sections appear
- \newwrite\xrefstream % references for noweb like style of sectioning.
- \immediate\openout\xrefstream=\jobname.xxr
% multi-column output
\input dcols.sty
+\topskip=9pt
\let\oldN\N
\let\N\chapterN
\let\M\textM
+\initauxstream
\showlastactiontrue
-\immediate\openout\gindex=\jobname.gdx
@** Introduction.
-\setupfootnotes
This is a manual documenting the development of a parser that can be
used to typeset \ld\ files (linker scripts) with or without the help
of \CWEB. An existing parser for \ld\ has been adopted as a base, with
@@ -50,14 +44,15 @@ limitations).
Nearly every aspect of the design is discussed, including the
supporting \TeX\ macros that make both the parser and this
documentation possible. The \TeX\ macros presented here are collected
-in \.{ldman.sty} which is later included in the \TeX\ file produced by \CWEAVE.
+in \.{ldman.sty} and \.{ldsetup.sty} which are later included in the
+\TeX\ file produced by \CWEAVE.
@<Set up the generic parser machinery@>=
@G(t)
\ifx\optimization\UNDEFINED %/* this trick is based on the premise that \.{\\UNDEFINED} */
\def\optimization{0} %/* is never defined nor created with \.{\\csname$\ldots$\\endcsname} */
\fi
-\let\nx\noexpand %/* convenient */
+\let\nx\noexpand %/* a convenient shortcut*/
\input limbo.sty %/* general setup macros */
\input yycommon.sty %/* general routines for stack and array access */
@@ -69,23 +64,32 @@ in \.{ldman.sty} which is later included in the \TeX\ file produced by \CWEAVE.
\ifnum\optimization>\tw@
\input yyfaststack.sty
-\else
- \let\stashnext\stashnextwithnothing
\fi
\input yystype.sty %/* scanner auxiliary types and functions */
\input yyunion.sty %/* parser data structures */
-\input yxunion.sty %/* extended parser data structures */
-\expandafter\def %/* adjust the \.{\\yyinput} to recognize \.{\\yyendgame} */
- \expandafter\multicharswitch\expandafter
- {\multicharswitch\yyendgame{\yyinput\yyeof\yyeof\endparseinput\removefinalvb}}
+
+\amendswitch %/* adjust the \.{\\yyinput} to recognize \.{\\yyendgame} */
+ \multicharswitch\near\yyeof\by\yyendgame\to\multicharswitch % /* add a new label */
+\replaceaction\multicharswitch\at\yyendgame % /* replace the new empty action */
+ \by{{\yyinput\yyeof\yyeof\endparseinput\removefinalvb}}\to\multicharswitch
+
+\def\MRI{{\sc MRI}} %/* so we can say that \MRI\ script typesetting is not supported$\ldots$ */
+@g
+
+@ Up to this point, the parser initialization process has been non parser specific (although
+sensitive to the namespace chosen). The next command inputs the data structures used
+by the \ld\ parser. The reader should consult the file below for the details on the \AST\ produced
+by the parser and its semantics.
+@<Define the normal mode@>=
+@G(t)
\input ldunion.sty %@>/* \ld\ parser data structures */@+
@g
@*1 Bootstrapping.
To produce a usable parser/scanner duo, several pieces of code must
be generated. The most important of these are the {\it table files\/}
-(\.{ptab.tex} and \.{ltab.tex}) for the parser and the scanner. These
+(\.{ldptab.tex} and \.{ldltab.tex}) for the parser and the scanner. These
consist of the integer tables defining the operation of the parser and
scanner automata, the values of some constants, and the `action switch'.
@@ -101,10 +105,10 @@ parsing our grammar once again, this time with a \bison\ grammar
designed for typesetting \bison\ files. A special {\it
bootstrapping\/} mode is used to extract the appropriate
information. The name `bootstrapping' notwithstanding, the parser and
-lexer used in the bootstrapping phase are not the minimized versions
+lexer used in the bootstrapping phase are not necessarily the minimized versions
used in bootstrapping the \bison\ parser.
-The first component generated during the bootstrapping pass is a list
+One component generated during the bootstrapping pass is a list
of `token equivalences' (or `aliases') to be used by the lexer. Every
token (to be precise, every {\it named token type}) used in
a \bison\ grammar is declared using one of the
@@ -117,50 +121,44 @@ the token names with their numerical values (accomplished by
\.{\\settokens}). If all tokens are named tokens, no token equivalence
list is necessary to set up the interaction between the lexer and the
parser. In this case (the present \ld\ parser is a typical
-example), the token list serves a secondary role: it provides hints
+example), the token list may also serve a secondary role: to provide hints
for the macros that typeset the grammar terms, after the \.{\\tokeneq}
-macro is redefined to serve this purpose.
+macro is redefined for this purpose.
On the other hand, after a declaration such as `\prodstyle{\%token}
\.{CHAR} \.{"char"}' the string \.{"char"} becomes an alias
for the named token \.{CHAR}. Only the string version gets recorded in
the |yytname| array. Establishing the equivalence between the two
-token forms can now only be accomplished by examining the grammar
+token forms now can be accomplished only by examining the grammar
source file and is delegated to the bootstrapping phase parser.
-\leavevmode\namedspot{bootstrapstates}The other responsibility of the bootstrapping parser is to extract
-the information about \flex\ {\it states\/} used by the lexer from the
-appropriate source file. As is the case with token names, this
-information is output in a rather chaotic fashion by the scanner
-generator and is all but useless for our purposes. The original
-bootstrapping macros were designed to handle \flex's \prodstyle{\%x}
-and \prodstyle{\%s} state declarations and produce a \Cee\ file with the
-appropriate definitions. This file can later be included by the
-`driver' routine to produce the appropriate table file for the lexer.
-To round off the bootstrapping mode we only need to establish the
-output streams for the tokens and the states, supply the appropriate file
-names for the two lists, flag the bootstrapping mode for the
-bootstrapping macros and inline typesetting (\.{\\prodstyle} macros)
-and input the appropriate machinery.
-
-This is done by the macros
-below. The bootstrap lexer setup (\.{\\bootstraplexersetup}) consists
-of inputting the token equivalence table for the \bison\ parser
-(i.e.~the parser that processes the \bison\ grammar file) and defining
-a robust token output function which simply ignores the token values
-the lexer is not aware of (it should not be necessary in our case
-since we are using full featured lexer and parser).
+\leavevmode\namedspot{bootstrapstates}Another (perhaps most important)
+goal of the bootstrapping phase is to extract the information about \flex\
+{\it states\/} used by the lexer from the appropriate source file. As
+is the case with token names, this information is output in a rather
+chaotic fashion by the scanner generator and is all but useless for
+our purposes. The bootstrapping macros are designed to
+handle \flex's \prodstyle{\%x} and \prodstyle{\%s} state declarations
+and produce a \Cee\ file with the appropriate definitions. This file
+can later be included by the `driver' routine to generate the
+appropriate table file for the lexer. To round off the bootstrapping
+mode we only need to establish the output streams for the tokens and
+the states, supply the appropriate file names for the two lists, flag
+the bootstrapping mode for the bootstrapping macros and inline
+typesetting (\.{\\prodstyle} macros) and input the appropriate
+machinery.
+
+This is done by the macros below. The bootstrap lexer setup
+(\.{\\bootstraplexersetup}) consists of inputting the token
+equivalence table for the \bison\ parser (i.e.~the parser that
+processes the \bison\ grammar file) and defining a robust token output
+function which simply ignores the token values the lexer is not aware
+of (it should not be necessary in our case since we are using a full
+featured lexer).
@<Define the bootstrapping mode@>=
@G(t)
-\newwrite\tokendefs %/* token list */
-\newwrite\stlist %/* \flex\ state list */
-\newwrite\gindex %/* index entries */
-
\def\modebootstrap{%
- \edef\bstrapparser{dyytab.tex}%
- \bootstrapmodetrue
\def\bootstraplexersetup{%
- \input bo.tok%
\let\yylexreturn\yylexreturnbootstrap /* only return tokens whose value is known */
%\let\yylexreturn\yylexreturnregular /* should also work */
}%
@@ -173,7 +171,7 @@ since we are using full featured lexer and parser).
Every parser/lexer pair (as well as some other macros) operates
within a set of dedicated {\it namespaces\/}. This simply means that the macros
that output token values, switch lexer states and access various
-tables `tack on' the string of characters representing the current
+tables `tack on' a string of characters representing the current
namespace to the `low level' control sequence name that performs the
actual output or access. Say, \.{\\yytname} becomes an alias of
\.{\\yytname[main]} while in the \.{[main]} namespace. When a parser
@@ -208,16 +206,21 @@ grammar describing prologue declarations uses the \.{[prologue]}
namespace.
\aterm{index}the \.{[index]} namespace is used for typesetting the
-index entries and is not necessarily associated with any parser or
-lexer. Somewhat confusingly, the macros that typeset \TeX\ entries, use
-\.{index} (without the brackets) as a pseudonamespace to display \TeX\
-terms in the index (due to the design of these typesetting macros, many
-of them take parameters, which can lead to chaos in the index). These
-two namespaces are not related but due to `hystorical' reasons (and the
-poorly thought out \TeX\ typesetting macro design) the \.{index} name has
-been retained. In addition, \.{index:visual} is used to adjust the sort order
-of \TeX\ terms (similar to the way \.{\\prettywordpairwvis} macro does).
+index entries for the terms that are automatically inserted by the main parser
+(such as an empty right hand side of a production or an inline action).
+\aterm{index:tex{\rm, }index:visual{\rm, and }texline}
+the macros that typeset \TeX\ entries, use
+\.{index:tex} as a pseudonamespace to display \TeX\
+terms in the index (due to the design of these typesetting macros, many
+of them take parameters, which can lead to chaos in the index).
+The \.{index:visual} pseudonamespace is used for ordering the index entries for
+\TeX\ macros (this is how the entry for \.{\\getsecond} (\texref{/getsecond})
+ends up in the {\ssf P} section of the index). Finally, the \TeX\ typesetting macros
+use the \.{texline} pseudonamespace to process the names of \TeX\ command sequences
+in action code. The reason we refer to these as {\it pseudo\/}namespaces is that
+only the token (or term) names are aliased, and not, say, the finite automata names
+in the case of the \TeX\ typesetting.
\aterm{flexre{\rm, }flexone{, \rm and} flextwo}the parsers for
\flex\ input use the \.{[flexre]}, \.{[flexone]}, and~\.{[flextwo]} namespaces for
@@ -259,14 +262,37 @@ initializing the \bison\ parser (accomplished by inputting
\newtoks\ldcmds
\def\modenormal{%
+ \commonstartup
+ \input ldtexlex.sty% /* \TeX\ typesetting specific to \ld */
+ \expandafter\def\csname index domain translation [L]\endcsname{%
+ {\noexpand\ld\ index}% /* used to typeset the table of contents */
+ {ld index}% /* outline entry */
+ {L\sc D INDEX}% /* index header */
+ }%
+ \def\otherlangindexheader{%
+ B{\sc ISON}, F{\sc LEX}, \TeX, {\sc AND} L{\sc D INDICES}%
+ }% /* modify the index header */
+ @>@[@<Initialize \ld\ parsers@>@]
+ @>@[@<Modified name parser for \ld\ grammar@>@]
+}
+@g
+
+@ @<Common startup routine@>=
+@G(t)
+\def\commonstartup{
\def\appendr##1##2{\edef\appnext{##1{\the##1##2}}\appnext}%
\def\appendl##1##2{\edef\appnext{##1{##2\the##1}}\appnext}%
- \input yyinit.sty%
+ \input yyinit.sty %
\input yytexlex.sty% /* \TeX\ typesetting macros */
- \input ldtexlex.sty% /* \TeX\ typesetting specific to \ld */
+ \input gindex.sty % /* indexing macros specific to \flex, \bison, and \ld */
+ \input noweb.sty % /* \noweb\ style references */
+ \xreflocaltrue
+ \let\sectionlistsetup\lxrefseparator
+ \let\inx\inxmod
+ \let\fin\finmod
+ \termindextrue
+ \immediate\openout\gindex=\jobname.gdx
\let\hostparsernamespace\ldnamespace /* the namespace where tokens are looked up for typesetting purposes */
- @>@[@<Initialize \ld\ parsers@>@]
- @>@[@<Modified name parser for \ld\ grammar@>@]
}
@g
@@ -288,53 +314,88 @@ wreaking havoc on the lexer state stack.
@g
@ This is the \ld\ parser invocation routine. It is coded according to
-a straightforward sequence initialize-invoke-execute-or-fall back.
+a straightforward sequence initialize-invoke-execute-or-fall back. The
+\.{\\preparseld} macro is invoked by \.{\\lsectionbegin} (see \.{limbo.sty}).
+It starts by defining the postprocessing and typesetting macro (\.{\\postparseld})
+followed by the parser setup.
@<Define the normal mode@>=
@G(t)
\def\preparseld{%
\let\postparse\postparseld
- \expandafter\hidecs\expandafter{\ldunion}% /* inhibit expansion so that fewer \.{\\noexpand}s are necessary */
+ \hidecslist\ldunion % /* inhibit expansion so that fewer \.{\\noexpand}s are necessary */
\toldparser
+ \displayrawtable % /* do this after the parser namespaces are setup */
\ldparserinit
\yyparse
}
+@g
+@ The postprocessing macro defines a procedure for typesetting the output and saving the
+parsed result to a file. After that, a generic postprocessing macro is executed.
+@<Define the normal mode@>=
+@G(t)
\def\postparseld{%
- \ifsaveparseoutput
- {\newlinechar=`^^J\immediate\write\exampletable{^^J\harmlesscomment
- parsed table: \the\ldcmds^^J^^J\harmlesscomment
- stashed stream:^^J\the\yystash^^J^^J\harmlesscomment
- format stream: ^^J\the\yyformat}%
- }%
- \fi
- \ifchecktable
- \errmessage{parsed table: \the\ldcmds^^J^^J%
- stashed stream: \the\yystash^^J^^J%
- format stream: \the\yyformat}%
- \fi
- \restorecslist{ld-parser:restash}\ldunion % /* mark variables, preprocess stash */
- \setprodtable
- \the\ldcmds
- \restorecslist{ld-display}\ldunion
- \setprodtable /* use the \bison's parser typesetting definitions */
- \restorecs{ld-display}{\anint\bint\hexint} % /* $\ldots$ except for integer typesetting */
- \the\ldcmds
- \par
- \vskip-\baselineskip
- \the\lddisplay
+ \let\saveparsedtable\saveldtable
+ \let\typesetparsedtables\typesetldtables
+ \postparsegeneric{(ld script)}%
+}
+@g
+
+@ The table output and typesetting macros are responsible for the parsed table output
+to a log file and the typographic representation of the result. The table is output
+after expanding its contents. The commands
+\begindemo
+^\hidecslist\cwebstreamchars
+^\restorecslist{ld-parser-debug}\ldunion
+\enddemo
+are meant to inhibit most expansions so that only the list (iterator) macros are expanded.
+The parser for \ld\ does not currently use the list macros to speed up the parsing process
+but the general set up is here in case it is needed in the future. Unfortunately, the same technique
+cannot be applied to the display of the \.{\\yystash} and \.{\\yyformat} streams (that use linked lists
+by default), since there are too many random sequences that can appear in such streams. Therefore,
+to facilitate debugging, one should expand the lists before displaying them (see \.{yyinput.sty} for
+details; lists with iterators are a bit more convenient due to their flexibility).
+@<Define the normal mode@>=
+@G(t)
+\def\saveldtable#1{{%
+ \hidecslist\cwebstreamchars
+ \restorecslist{ld-parser-debug}\ldunion
+ \expandafter\saveoutputcode\expandafter{\the\ldcmds}\exampletable{#1}%
+}}
+
+\def\typesetldtables{%
+ \begingroup
+ \displayparsedoutput\ldcmds
+ \restorecslist{ld-parser:restash}\ldunion % /* mark variables, preprocess stash */
+ \setprodtable
+ \the\ldcmds
+ \restorecslist{ld-display}\ldunion
+ \setprodtable /* use the \bison's parser typesetting definitions */
+ \restorecs{ld-display}{\anint\bint\hexint} % /* $\ldots$ except for integer typesetting */
+ \the\ldcmds
+ \par
+ \vskip-\baselineskip
+ \the\lddisplay
+ \endgroup
}
+@g
+@ The parsing routine defined above is the first macro in the \ld\ parser stack.
+The only remaining procedure on the stack is an error reporting macro in case
+the parsing pass failed.
+@<Define the normal mode@>=
+@G(t)
\fillpstack{l}{%
\preparseld
{\preparsefallback{++}}% /* skip this section if parsing failed, put \.{++} on the screen */
- \relax % /* this \.{\\relax} serves as a `guard' for the braces */
+ \relax % /* this \.{\\relax} `guards' the braces above during \.{\\poppstack} */
}
@g
@ Unless they are being bootstrapped, the \ld\ parser and its
term parser are initialized by the normal mode. The token typesetting
of \ld\ grammar tokens is adjusted at the same time (see the remarks
-above about the mechanism that is responsible for this). Most nonterminals
+above about the mechanism that is responsible for this). Most terminals
(such as keywords, etc.) may be displayed unchanged (provided the
names used by the lexer agree with their appearance in the script file,
see below), while the typeseting of others is modified in
@@ -358,8 +419,8 @@ examining \.{ltokenset.sty}.
@G(t)
\genericparser
name: ld,
- ptables: ptab.tex,
- ltables: ltab.tex,
+ ptables: ldptab.tex,
+ ltables: ldltab.tex,
tokens: {},
asetup: {},
dsetup: {},
@@ -372,12 +433,28 @@ examining \.{ltokenset.sty}.
host: ld;%
@g
-@ The macros are collected in a single file included at the beginning
-of this documentation.
+@ We also need some modifications to the indexing macros in order to typeset \ld\ terms
+and variables separately.
+@<Additional macros for the \ld\ lexer/parser@>=
+@G(t)
+@g
+
+@ The macros are collected in two files included at the beginning
+of this documentation\footnote{An attentive reader may have noticed that the files
+have the extension \.{.stx} instead of the traditional \.{.sty}. The reason for this
+is the postprocessing step that `cleans' the generated files of various \Cee\
+artifacts output by \CWEB\ and turns \.{ldman.stx} and \.{ldsetup.stx} into
+\.{ldman.sty} and \.{ldsetup.sty} included by \.{ldman.tex}$\ldots$}.
@(ldman.stx@>=
@<Set up the generic parser machinery@>@;
@<Begin namespace setup@>@;
@<Define the bootstrapping mode@>@;
+@<Common startup routine@>@;
+
+@ The macros collected in the file below are not specific to this manual but are needed in
+order to use the \ld\ parser generated and are thus put in a separate which can be included
+by other \TeX\ programs that wish to use them.
+@(ldsetup.stx@>=
@<Define the normal mode@>@;
@<Additional macros for the \ld\ lexer/parser@>@;
@@ -404,23 +481,22 @@ MEMORY
need for a `parser stack' as in the case of the \bison\
parser. If one must be able to display still smaller segments of \ld\
code, using `hidden context' tricks (discussed elsewhere) seems to be
-a better approach.
-%
+a better approach.
+%\saveparseoutputtrue\checktabletrue
+%\saveparseoutputfalse\checktablefalse
@<Example \ld\ script@>=
@i ldexample_l.hx
@ @<The same example of an \ld\ script@>=
-@i ldexample_b.hx
+@i ldexample_t.hx
@ @<Some random portion of \ld\ code@>=
@i ldnp.x
@** Appendix. The original code of the \ld\ parser and lexer is reproduced below. It
-is mostly left intact and is typeset by the pretty printing parser for
-\bison\ input. The lexer (\flex) input is reproduced verbatim and is
-left mostly unformatted with the exception of spacing and the embedded
-\Cee\ code.
+is left mostly intact and is typeset by the pretty printing parser for
+\bison\ input. The lexer (\flex) input is given a similar treatment.
The treatment of comments is a bit more invasive. \CWEB\ silently
assumes that the comment refers to the preceding statement or a group
@@ -446,7 +522,7 @@ creators of \ld.%\checktabletrue\saveparseoutputtrue
@q of index entries depends on the placement of this inclusion @>
@i alphas.hx
-@** Index. \checktablefalse\saveparseoutputtrue
+@** Index. \checktablefalse\saveparseoutputtrue \global\let\secrangedisplay\empty
This section lists the variable names and (in some cases)
the keywords used inside the `language sections' of the \CWEB\
source. It takes advantage of the built-in facility of \CWEB\ to supply
@@ -477,15 +553,8 @@ $$
index entries, as well, mimicking \CWEB's behavior for the
{\it inline \Cee\/} (\.{\yl}$\ldots$\.{\yl}). Such entries are labeled
with $^\circ$, to provide a reminder of their origin.
-\unsetfootnotes
-\def\next{\expandafter\eatone\string}
-\edef\unindexable{{\next\the}{\next\nx}{\next\yy}{\next\yylexnext}{\next\else}{\next\fi}{\next\yyBEGIN}{\next\next}}
-\input gindex.sty
-\closeout\gindex
-\termindexfalse
-\let\inx\inxmod
-\let\fin\finmod
+\makeunindexablex{{\csstring\the}{\csstring\nx}{\csstring\yy}{\csstring\yylexnext}%
+ {\csstring\else}{\csstring\fi}{\csstring\yyBEGIN}{\csstring\next}}
\let\oldMRL\MRL
\def\MRL#1{\smash{\oldMRL{#1}}} % a more sophisticated way to handle it woud be to add a \smash whenever we are
% in the [index] namespace but this is simpler and works as well
-\def\topofcontents{\null\vskip-3\baselineskip\centerline{C{\sc ONTENTS} (\sc\uppercase\expandafter{\title})}\medskip}
diff --git a/support/splint/examples/ld/ldnp.w b/support/splint/examples/ld/ldnp.w
index 0a99d864fd..9a7d86f097 100644
--- a/support/splint/examples/ld/ldnp.w
+++ b/support/splint/examples/ld/ldnp.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2022, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
@@ -181,11 +181,6 @@ qualifier:
@[TeX_( "/getsecond{/yy(1)}/to/toksb" );@]@;
@[TeX_( "/yy0{/nx/idstr{/the/toksa}{/the/toksb}}" );@]@;
-@ @<Start with a tag@>=
- @[TeX_( "/getfirst{/yy(2)}/to/toksa" );@]@;
- @[TeX_( "/getsecond{/yy(2)}/to/toksb" );@]@;
- @[TeX_( "/yy0{/nx/idstr{</the/toksa>}{</the/toksb>}}" );@]@;
-
@ @<Start with a quoted string@>=
@[TeX_( "/getfirst{/yy(2)}/to/toksa" );@]@;
@[TeX_( "/getsecond{/yy(2)}/to/toksb" );@]@;
@@ -197,9 +192,6 @@ qualifier:
@ @<Start with a \prodstyle{'.'} string@>=
@[TeX_( "/yy0{/nx/visflag{/nx/termvstring}{}/nx/chstr{.}{.}}" );@]@;
-@ @<Turn a qualifier into an identifier@>=
- @<Start with an identifier@>@;
-
@ @<Attach an identifier@>=
@[TeX_( "/getsecond{/yy(1)}/to/toksa" );@]@;
@[TeX_( "/appendr/toksa{/noexpand/_}" );@]@;
@@ -213,7 +205,6 @@ qualifier:
@ @<Attach qualifier to a name@>=
-
@ @<Attach an integer@>=
@[TeX_( "/yy0{/nx/dotsp/nx/sfxi/the/yy(1)}" );@]@;
@@ -262,14 +253,15 @@ as they have to be inserted in a place that is aware of the internal definitions
definitions are used.
@<Name parser \Cee\ postamble@>=
-#define YYPRINT(file, type, value) @[yyprint (file, type, value)@]
- static void yyprint (FILE *file, int type, YYSTYPE value){}
@ Union of types.
@<Union of parser types@>=
-@*1 The name scanner.
+@*1 The name scanner. The scanner for \ld\ name parser is essentially identical to that for the
+\bison\ and \flex\ name parser\footnote{And is just as much of an overkill. This should serve as a
+cautionary tale of how suboptimal but convenient choices tend to take root.}. The only exception
+is the scanning of suffixes.
%\checktabletrue
@(ld_small_lexer.ll@>=
@G
@@ -277,7 +269,7 @@ definitions are used.
%{@> @<Lexer \Cee\ preamble@> @=%}
@> @<Lexer options@> @=
%%
- @> @<Regular expressions@> @=
+ @> @<Regular expressions for the name parser@> @=
%%
@O
void define_all_states( void ) {
@@ -306,18 +298,16 @@ int [0-9]+
@ Strings and characters in directives/rules.
@<Lexer states@>=
-@G
+@G(fs1)
%x SC_ESCAPED_STRING SC_ESCAPED_CHARACTER
@g
@ @<Lexer \Cee\ preamble@>=
-
#include <stdint.h>
-#include <stdbool.h>
+#include <stdbool.h>@t}\yyskipparsefalse{@>
-@t}\yyskipparsefalse{@>
@ @<Lexer options@>=
-@G
+@G(fs1)
%option bison-bridge
%option noyywrap nounput noinput reentrant
%option noyy_top_state
@@ -326,11 +316,18 @@ int [0-9]+
%option outfile="ld_small_lexer.c"
@g
-@ @<Regular expressions@>=
+@ @<Regular expressions for the name parser@>=
@<Scan white space@>@;
@<Scan identifiers@>@;
-@ White space skipping.
+@ White space is skipped in names\footnote{How it finds its way {\em into\/} a name deserves
+some investigation for which we do not have the space here.}.
+Note that the input routine produced by \splint\ springs into action
+{\em after\/} the input passes through the scanning mechanism of \TeX\ which makes it very unlikely
+that any of the characters below in the definition of `whitespace' could make it to the scanner.
+They are left in, however, in case a custom input routine is used that produces such
+characters\footnote{Although, in this case, some special processing by the scanner
+would likely be required.}.
\traceparserstatestrue
\tracestackstrue
\tracerulestrue
@@ -356,11 +353,9 @@ int [0-9]+
[ \f\n\t\v] {@> @[TeX_( "/yylexnext" );@]@=}
@g
-@ This collection of regular expressions might seem redundant, and in
-its present state, it certainly is. However, if later on the
-typesetting style for some of the keywords would need to be adjusted,
-such changes would be easy to implement, since the template is already
-here.
+@ Suffixes specific to \ld\ name scanner are defined here, along with some other
+lexical elements. Most of these definitions mimic the ones for the \bison\ name
+scanner.
@<Scan identifiers@>=
@G(fs2)
"%"({aletter}|[0-9]|[-_]|"%"|[<>])+ {@> @[TeX_( "/yylexreturnval{PERCENT_IDENTIFIER}" );@]@=}
@@ -392,4 +387,4 @@ trivial scanning problems.
@[TeX_( "/iftracebadchars" );@]@;
@[TeX_( " /yycomplain{invalid character(s): /the/yytext}" );@]@;
@[TeX_( "/fi" );@]@;
- @[TeX_( "/yylexreturn{$undefined}" );@]@;
+ @[TeX_( "/yyerrterminate" );@]@;
diff --git a/support/splint/examples/ld/ldnump.w b/support/splint/examples/ld/ldnump.w
index 813628c68c..4050374c25 100644
--- a/support/splint/examples/ld/ldnump.w
+++ b/support/splint/examples/ld/ldnump.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2022, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
@@ -182,8 +182,6 @@ as they have to be inserted in a place that is aware of the internal definitions
definitions are used.
@<Name parser \Cee\ postamble@>=
-#define YYPRINT(file, type, value) @[yyprint (file, type, value)@]
- static void yyprint (FILE *file, int type, YYSTYPE value){}
@ Union of types.
@@ -222,7 +220,7 @@ int [0-9]+
@ Strings and characters in directives/rules.
@<Lexer states@>=
-@G
+@G(fs1)
%x SC_ESCAPED_STRING SC_ESCAPED_CHARACTER
@g
@@ -232,7 +230,7 @@ int [0-9]+
#include <stdbool.h>
@ \yyskipparsefalse@<Lexer options@>=
-@G
+@G(fs1)
%option bison-bridge
%option noyywrap nounput noinput reentrant
%option noyy_top_state
@@ -303,4 +301,4 @@ here.
@[TeX_( "/iftracebadchars" );@]@;
@[TeX_( " /yycomplain{invalid character(s): /the/yytext}" );@]@;
@[TeX_( "/fi" );@]@;
- @[TeX_( "/yylexreturn{$undefined}" );@]@;
+ @[TeX_( "/yyerrterminate" );@]@;
diff --git a/support/splint/examples/ld/ldtexlex.sty b/support/splint/examples/ld/ldtexlex.sty
index 01b8873540..878811dee6 100644
--- a/support/splint/examples/ld/ldtexlex.sty
+++ b/support/splint/examples/ld/ldtexlex.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -22,7 +22,7 @@
\def\d@fz#1#2{%
\defx#1{#2}{texline}%
- \d@@z#1{#2}{index}%
+ \d@@z#1{#2}{index:tex}%
}
\def\d@@z#1#2#{%
diff --git a/support/splint/examples/ld/ldunion.sty b/support/splint/examples/ld/ldunion.sty
index 710d4e1725..c59cd601e0 100644
--- a/support/splint/examples/ld/ldunion.sty
+++ b/support/splint/examples/ld/ldunion.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -19,9 +19,9 @@
% of TeX tokens; sptr is a pointer to the stash stream, fptr is a pointer to the format stream
\def\yyuniontag{\ldunion}
-\def\parserstrictnamespace{ld-parser-strict}
-\def\parserprototypesnamespace{ld-parser-strict:headers}
-\def\parserdebugnamespace{ld-parser-debug}
+\def\parserstrictnamespace{ld-parser-strict} % expands to an error message
+\def\parserprototypesnamespace{ld-parser-strict:headers} % the parameter strings
+\def\parserdebugnamespace{ld-parser-debug} % control sequences are \let...=\relax for debugging
\def\ldunion{\currentyyunionnamespace}
\def\currentyyunionnamespace{ld-generic}
@@ -34,11 +34,12 @@
% ld commands
+\defp\ldor{} % item separator :: \ldor, is only needed here for debugging (in the ld-parser-debug namespace)
\defp\ldregexp#1{} % name pattern :: \ldregexp{{name}{name11}{fptr}{sptr}}
\defp\ldregop#1{} % name pattern :: \ldregop{name}
\defp\ldspace{} % space separator :: \ldspace
-\defp\ldattributes#1{} % attributes :: \ldattributes{name}
-\defp\ldattributesneg#1{} % complemented attributes :: \ldattributesneg{name}
+\defp\ldattrstring#1#2#3#4{} % attributes string :: \ldattrstring{name}{name11}{fptr}{sptr}
+\defp\ldattrstringneg#1#2#3#4{} % complemented attributes string :: \ldattrstring{name}{name11}{fptr}{sptr}
\defp\ldfilename#1{} % file name :: \ldfilename{name}
\defp\ldcommandseparator#1#2#3#4{} % command separator :: \ldcommandseparator{fptr}{sptr}{prev command}{next command}
\defp\ldassignment#1#2#3{} % assignment :: \ldassignment{lhs}{op}{rhs}
@@ -59,20 +60,38 @@
\defp\ldsectionseparator#1#2{} % section separator :: \ldsectionseparator{fptr}{sptr}
\defp\ldtype#1{} % section type :: \ldtype{type}
\defp\ldstatement#1{} % statement :: \ldstatement{statement}
+\defp\ldfreestmt#1{} % statement in a section :: \ldfreestmt{\ldstatement{statement}}
\defp\ldsecspec#1{} % section spec :: \ldsecspec{section spec}
\defp\ldinsertcweb#1#2#3#4{} % insert accumulated \CWEB\ material :: \ldinsertcweb
% {fptr}{sptr}{command}{parsed segment} : never defined
\defp\ldnamedsection#1#2#3#4#5#6#7{} % named section :: \ldnamedsection{name}
- % {{expression}{type}}{at}
+ % {expression}{type}}{at}
% {{}{}{}:alignment}
% {constraint}{statements}
% {{}{}{}{}:placement}
+\defp\ldoverlay#1#2#3#4#5#6{} % overlay section list :: \ldoverlay{expression}{crossrefs}{at}{subalign}
+ % {sections}
+ % {{memspec}{memspec_at}{phdr}{fill}}
+\defp\ldoverlaysection#1#2#3#4{} % overlay section :: \ldoverlaysection{name}{statements}{phdr}{fill}
\defp\ldsectionstash#1#2{} % sections spec stash :: \ldsectionstash{fptr}{sptr}
-\savecslist{ld-parser-prototypes}\ldunion
+\savecslist{ld-parser-prototypes}\ldunion % these consume parameters and expand to nothing
\input ldint.sty
+\def\ldidxdomain{L}
+
+\let\writeldidxentry\writeidxentry % mix the \ld\ index with the
+\let\writeldidxhentry\writeidxhentry % \bison\ index for now
+
+\def\writeldidxhentry#1{%
+ \indxe\gindex{{\secno}{{}{\hostparsernamespace}}{\ldidxdomain}{\headeridxrank}#1}%
+}
+
+\def\writeldidxentry#1{%
+ \indxe\gindex{{\secno}{{}{\hostparsernamespace}}{\ldidxdomain}{\termidxrank}#1}%
+}
+
\def\bigbracedel{\delimiter"4266308}
\newtoks\lddisplay
@@ -116,6 +135,10 @@
\edef\next{\toksc{\gidxentry{\termttstring}{#2}{}{\ntt #2}}}\next
}
+\def\ldextractattrs#1#2#3#4{%
+ \edef\next{\toksc{{\ntt #2}}}\next
+}
+
\def\ldextractmemname#1#2#3#4{%
{%
\expandafter\let\expandafter\tosmallparser\csname to\stripbrackets\cwebclinknamespace parser\endcsname
@@ -134,7 +157,6 @@
% \separatorswitcheq and \separatorswitchneq in yyunion.sty
\defc\ldcommandseparator{%
- \restorecs{table-render}{\strm}%
\expandafter\ifx\csname ldstashentry[#2]\endcsname\relax
\yyifsamestring{#3}{#4}{}{\appendrnx\lddisplay{\medskip}}%
\else
@@ -197,16 +219,16 @@
\def\ldreg@xp#1#2#3#4{%
\expandafter\ifx\csname ldvarname[#2]\endcsname\relax
{%
- \let\termindex\writeidxentry
+ \let\termindex\writeldidxentry
\let\hostparsernamespace\cwebclinknamespace% process the variable names as in \CWEB
- \edef\next{\toksc{\gidxentry{\termttstring}{#1}{}}}\next\the\toksc
+ \edef\next{\toksc{\gidxentry{\termttstring}{#1}{}}}\next
\hbox{\ntt@#1}%
\expandafter
}\the\toksc
\else
\yyifsamestring{#2}{.}{% special . name
{%
- \let\termindex\writeidxentry
+ \let\termindex\writeldidxentry
\let\hostparsernamespace\cwebclinknamespace% for consistency
\edef\next{\toksc{\gidxentry{\termexception}{.origin&}{.}}}\next
\hbox{\csname\prettynamecs\hostparsernamespace{.origin&}\endcsname{}}%
@@ -214,14 +236,14 @@
}\the\toksc
}{%
{%
- \let\termindex\writeidxentry
+ \let\termindex\writeldidxentry
\let\hostparsernamespace\cwebclinknamespace% process the variable names as in \CWEB
\edef\next{\toksc{\gidxentry{\termhostidstring}{#1}{}}}\next
\hbox{%
\expandafter\let\expandafter\tosmallparser\csname to\stripbrackets\cwebclinknamespace parser\endcsname
\let\optstrextra\optstrextraesc
\nameproc{#2}\with\parsebin
- \it\the\toksa
+ \\{\the\toksa}%
}%
\expandafter
}\the\toksc
@@ -259,27 +281,34 @@
\defc\ldmemoryspec{%
\toksb{\hfil&}%
- \let\termindex\writeidxhentry
+ \let\termindex\writeldidxhentry
\ldextractmemname#1\concat\toksb\toksc
\let\termindex\eatone
\appendrnx\toksb{&}%
- \toksc{}#2\concat\toksb\toksc
- \toksc{}#3\concat\toksb\toksc
+ \toksc{}#2\appendrnx\toksc{&}\concat\toksb\toksc% attributes
+ \toksc{}#3\appendrnx\toksc{&}\concat\toksb\toksc
\toksc{}#4\concat\toksb\toksc
\concat\toksa\toksb
\toksb{\cr}\concat\toksa\toksb
}
-\defc\ldattributes{%
- \ldextractname#1\appendrnx\toksc{&}%
+\defc\ldattrstring{%
+ \appendrnx\toksc{{\ntt@ #2}}%
+}
+
+\defc\ldattrstringneg{%
+ \appendrnx\toksc{\hbox{$\neg$}{\ntt@ #2}}%
+}
+
+\defc\ldspace{%
}
\defc\ldlengthspec{%
- \toksc{#1}%
+ \toksc{$#1$}%
}
\defc\ldoriginspec{%
- \toksc{#1&}%
+ \toksc{#1}%
}
\defc\ldinclude{%
@@ -290,15 +319,7 @@
\concat\toksa\toksc
}
-\defc\ldmemspecseparator{% TODO: remove after testing is complete
- \restorecs{table-render}{\strm}%
- \expandafter\ifx\csname ldstashentry[#2]\endcsname\relax
- \else
- \expandafter\expandafter\expandafter\yystashlocal\expandafter\expandafter\expandafter{\csname ldstashentry[#2]\endcsname}%
- \edef\next{\toksc{&\noexpand\multispan4\toksa{}\the\yystashlocal
- \noexpand\ldmakestashbox{\cdotfill}\noexpand\quad\cr}}\next\concat\toksa\toksc
- \fi
-}
+% TODO: change the code to use linked lists
\defc\ldmemspecseparator{%
\expandafter\ifx\csname ldstashentry[#2]\endcsname\relax
@@ -309,16 +330,6 @@
}
\defc\ldmemspecstash{%
- \restorecs{table-render}{\strm}%
- \expandafter\ifx\csname ldstashentry[#2]\endcsname\relax
- \else
- \expandafter\expandafter\expandafter\yystashlocal\expandafter\expandafter\expandafter{\csname ldstashentry[#2]\endcsname}%
- \edef\next{\toksc{&\noexpand\multispan4\toksa{}\the\yystashlocal
- \noexpand\ldmakestashbox{\cdotfill}\noexpand\quad\cr}}\next\concat\toksa\toksc
- \fi
-}
-
-\defc\ldmemspecstash{%
\expandafter\ifx\csname ldstashentry[#2]\endcsname\relax
\else
\expandafter\expandafter\expandafter\yystashlocal\expandafter\expandafter\expandafter{\csname ldstashentry[#2]\endcsname}%
@@ -370,7 +381,7 @@
\else
\toksb\expandafter{&}% section header
\advance\tempca\m@ne
- \ldextractitem\tempca{#6}% expression
+ \ldextractitem\tempca{#6}% next statement
\advance\tempca\@ne
\yytoksempty\toksc{%
\ldextractfill#7%
@@ -382,7 +393,7 @@
\fi
\fillextractedtrue
}{%
- \toksc\expandafter{\expandafter\qquad\expandafter$\the\toksc{}$}%
+ \toksc\expandafter{\expandafter\qquad\the\toksc{}}%
}%
\concat\toksb\toksc
\appendrnx\toksb{&}%
@@ -407,7 +418,60 @@
\repeat
}
-\def\ldextractitem#1#2{%
+
+% named section :: \ldnamedsection{name}
+ % {{bind?}{expression}{block?}{expression}{type}}{at}
+ % {{}{}{}:alignment}
+ % {constraint}{statements}
+ % {{memspec}{memspec_at}{phdr}{fill}}
+
+\defc\ldoverlay{% overlay sections :: \ldoverlay{expression}{crossrefs}{at}{subalign}
+ % {sections}
+ % {{memspec}{memspec_at}{phdr}{fill}}
+ \yystringempty{#1}{\tokse{}}{\tokse{ $#1$}}%
+ \yystringempty{#2}{\toksf{}}{\toksf{{ \ttl noxrefs}}}%
+ \yystringempty{#3}{\toksg{}\toksc{}}{\toksg{{\ttl at} $#3$}\toksc{ }}%
+ \yystringempty{#4}{\toksh{}}{\toksh\expandafter{\expandafter{\the\tokc\ttl subalign} $#4$}}%
+ \appendr\toksa{&\hskip-1em\noexpand\ttl overlay\the\tokse\the\toksf&&\the\toksg\the\toksh}%
+ \ldwrapoverlay#6%
+ \appendr\toksa{&\the\toksc&\cr}%
+ #5%
+ \ldoverlayfill#6%
+ \yytoksempty\toksd{}{\appendr\toksa{&\the\toksd&&&&&\cr}}% attach the fill at the end
+ \appendr\toksa{&\hskip-1em{\ttl overlay end}&&&&&\cr}%
+}
+
+\defc\ldoverlaysection{% overlay section :: \ldoverlaysection{name}{statements}{phdr}{fill}
+ \ldnamedsection{#1}%
+ {{}{}{}{}{}}{}%
+ {{}{}{}}%
+ {}{#2}%
+ {{}{}{#3}{#4}}%
+}
+
+\def\ldwrapoverlay#1#2#3#4{% puts memspec... in \toksc and fill in \toksd
+ \toksc{}%
+ \yystringempty{#1}{% any > ?
+ }{%
+ \ldextractname#1%
+ \toksd{{\ttl in }}%
+ \concatl\toksd\toksc
+ }%
+ \yystringempty{#2}{% any AT > ?
+ }{%
+ \yytoksempty\toksc{\toksc{{\ttl as }}}{\appendrnx\toksc{ {\ttl as }}}%
+ \toksd=\toksc
+ \ldextractname#2%
+ \concat\toksd\toksc
+ \toksc=\toksd
+ }%
+}
+
+\def\ldoverlayfill#1#2#3#4{%
+ \ld@xtractfill{#4}%
+}
+
+\def\ldextractitem#1#2{% #1 is a counter, #2 is a list separated by \ldor
\yystringempty{#2}{%
\toksc{}%
}{%
@@ -463,18 +527,23 @@
}
\def\ldextractfill#1#2#3#4{%
+ \toksc{}%
\yystringempty{#4}{%
- \toksc{}%
\fillextractedtrue
}{%
\iffillextracted
- \toksc{}%
\else
- \toksc={\qquad{\ttl fill }$#4$}%
+ \ld@xtractfill{#4}%
+ \appendr\toksc{\noexpand\qquad{\noexpand\ttl fill }$\the\toksd$}%
\fi
}%
}
+\def\ld@xtractfill#1{% #1 must be \ldfill{expression}
+\toksf{#1}%
+ \toksd\expandafter{#1}%
+}
+
\def\ldpushpheaders#1#2#3#4{%
\ldextractitem\tempcc{#3}%
\advance\tempcc\@ne
@@ -491,11 +560,10 @@
\toksd{\hbox{\ttl #1}}%
}
-\defc\ldstatement{{#1}} % the braces form the group for a \toks assignment
-
-\let\ldsecspec\ldstatement
+\defc\ldstatement{{\let\ldrlap\relax\let\ldintfont\ntt@$#1$}} % the braces form the group for a \toks assignment
+\defc\ldfreestmt{\toksb\expandafter{#1}\appendr\toksa{&\the\toksb\cr}}
-\defc\ldsectionseparator{\toksc{&\multispan5\cdotfill\quad\cr}\concat\toksa\toksc}
+\defc\ldsecspec{{$#1$}}
\def\ldboxstash#1{%
\ifchecktrim\errmessage{stash contents: \the\toksa}\fi
@@ -506,16 +574,6 @@
\def\ldmakestashbox#1{\cleanstash\stripstash\ldboxstash{#1}}
\defc\ldsectionseparator{%
- \restorecs{table-render}{\strm}%
- \expandafter\ifx\csname ldstashentry[#2]\endcsname\relax
- \else
- \expandafter\expandafter\expandafter\yystashlocal\expandafter\expandafter\expandafter{\csname ldstashentry[#2]\endcsname}%
- \edef\next{\toksc{&\noexpand\multispan5\toksa{}\the\yystashlocal
- \noexpand\ldmakestashbox{\cdotfill}\noexpand\quad\cr}}\next\concat\toksa\toksc
- \fi
-}
-
-\defc\ldsectionseparator{%
\expandafter\ifx\csname ldstashentry[#2]\endcsname\relax
\else
\expandafter\expandafter\expandafter\yystashlocal\expandafter\expandafter\expandafter{\csname ldstashentry[#2]\endcsname}%
@@ -524,17 +582,6 @@
}
\defc\ldsectionstash{%
- \restorecs{table-render}{\strm}%
- \expandafter\ifx\csname ldstashentry[#2]\endcsname\relax
- \else
- \expandafter\expandafter\expandafter\yystashlocal\expandafter\expandafter\expandafter{\csname ldstashentry[#2]\endcsname}%
- \edef\next{\toksc{\sections@header&\noexpand\multispan5\toksa{}\the\yystashlocal
- \noexpand\ldmakestashbox{\cdotfill}\noexpand\quad\cr}}\next\concat\toksa\toksc
- \def\sections@header{}%
- \fi
-}
-
-\defc\ldsectionstash{%
\expandafter\ifx\csname ldstashentry[#2]\endcsname\relax
\else
\expandafter\expandafter\expandafter\yystashlocal\expandafter\expandafter\expandafter{\csname ldstashentry[#2]\endcsname}%
@@ -546,7 +593,12 @@
\restorecs{ld-display}{\ldregexp\ldassignment\ldfill\ldinsertcweb\ldentry}
\toyyunion{ld-parser:sections}
-% preprocessing macros: collecing stash and marking variables
+% preprocessing macros: collecting stash and marking variables
+% currently these macros do not get inside expressions to extract
+% variable names, consequently if the variable is used before it
+% appears in an assignment, it will not be displayed properly
+% (is this even legal in linker scripts?) although the index will
+% show it correctly
\restorecslist{ld-parser-prototypes}\ldunion
\restorecs{ld-parser-strict}{\insertcweb}
@@ -557,7 +609,8 @@
\readstash{#2}%
\setbox0 \vbox{\toksa\expandafter{\the\yystashlocal}\cleanstash\stripstash\the\toksa}%
\ifdim\ht0=\z@
- \expandafter\let\csname ldstashentry[#2]\endcsname\relax
+ \expandafter\let\csname ldstashentry[#2]\endcsname\relax % this is redundant but we may change \relax to
+ % something else later
\else
\expandafter\edef\csname ldstashentry[#2]\endcsname{\the\yystashlocal}%
\fi
@@ -575,6 +628,12 @@
\defc\ldsections{#1} % ld sections :: \ldsections{sections}
+\defc\ldoverlay{% overlay section :: \ldoverlay{expression}{crossrefs}{at}{subalign}
+ % {sections}
+ % {{memspec}{memspec_at}{phdr}{fill}}
+ #3#5%
+} % TODO: add handling of subalign, memmspec, and memspec_at
+
\defc\ldsectionseparator{%
\readstash{#2}%
\setbox0 \vbox{\toksa\expandafter{\the\yystashlocal}\cleanstash\stripstash\the\toksa}%
@@ -606,37 +665,20 @@
} % command separator :: \ldcommandseparator{fptr}{sptr}{prev command}{next command}
\defc\ldstatement{#1}
-
+\defc\ldfreestmt{#1}
+\defc\ldassignment{#1}
+\defc\ldprovide{#1}
+\defc\ldentry{#1}
+\let\ldhidden\ldprovide
+\let\ldprovidehid\ldprovide
\defc\ldnamedsection{\let\ldor\empty#6}
-\defc\ldassignment{%
- {%
- \let\ldregexp\markldname
- #1%
- }{\errmessage{Not an \\ldregexp!}}%
-}
-\defc\ldprovide{%
- {%
- \let\ldregexp\markldname
- #1%
- }{\errmessage{Not an \\ldregexp!}}%
-}
-
-\defc\ldentry{%
- {%
- \let\ldregexp\markldname
- #1%
- }{\errmessage{Not an \\ldregexp!}}%
+\defc\ldregexp{%
+ \ldr@gexprestash#1%
}
-\def\markldname#1{%
- \markldn@me#1%
+\def\ldr@gexprestash#1#2#3#4{
+ \expandafter\def\csname ldvarname[#2]\endcsname{\errmessage{Not an \\ldregexp!, maybe change the parser namespace?}}%
}
-\def\markldn@me#1#2#3#4{%
- \aftergroup\def\expandafter\aftergroup\csname ldvarname[#2]\endcsname
-}
-
-\let\ldhidden\ldprovide
-\let\ldprovidehid\ldprovide
\toyyunion{ld-parser:restash}
diff --git a/support/splint/examples/ld/lstokenset.sty b/support/splint/examples/ld/lstokenset.sty
index 441bad2543..496fe0f2d3 100644
--- a/support/splint/examples/ld/lstokenset.sty
+++ b/support/splint/examples/ld/lstokenset.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/ld/ltokenset.sty b/support/splint/examples/ld/ltokenset.sty
index 846dead6c8..f980114823 100644
--- a/support/splint/examples/ld/ltokenset.sty
+++ b/support/splint/examples/ld/ltokenset.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/symbols/Makefile b/support/splint/examples/symbols/Makefile
index 964927bc9d..80a6aed0c6 100644
--- a/support/splint/examples/symbols/Makefile
+++ b/support/splint/examples/symbols/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2022, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -18,8 +18,8 @@
# purposes; the main directory (../..) follows a slightly more
# modular organization scheme.
-SYMBOLS_PREREQS = %.tex %.idx ${SPLINT_XTEXSTYLES} ${SPLINT_ROOT}cweb/bo.tok ${SPLINT_ROOT}cweb/fo.tok symtoks.sty
-SYMBOLS_PREREQS += ${SPLINT_XPTABLES} ${SPLINT_XLTABLES} symmap.sty symtricks.sty symfm.sty slimbo.sty
+SYMBOLS_PREREQS = %.tex %.idx ${SPLINT_XTEXSTYLES} ${SPLINT_XTABLES} symtoks.sty
+SYMBOLS_PREREQS += symmap.sty symtricks.sty symfm.sty slimbo.sty
SYMBOLS_PREREQS += ${SPLINT_ROOT}cweb/fil.l ${SPLINT_ROOT}cweb/bg.y ${SPLINT_ROOT}cweb/lo.l
@@ -53,7 +53,7 @@ mostlyclean: clean_temp
distclean: clean
cd ${SPLINT_ROOT} && ${MAKE} clean
-.PRECIOUS: ${SPLINT_ROOT}cweb/fo.tok ${SPLINT_ROOT}cweb/bo.tok ${SPLINT_ROOT}cweb/lo.l \
+.PRECIOUS: ${SPLINT_XOTABLES} ${SPLINT_ROOT}cweb/lo.l \
${SPLINT_ROOT}cweb/fil.l ${SPLINT_ROOT}cweb/dyytab.tex ${SPLINT_ROOT}cweb/gyytab.tex \
${SPLINT_ROOT}cweb/fyytab.tex symbols.gdy
diff --git a/support/splint/examples/symbols/slimbo.sty b/support/splint/examples/symbols/slimbo.sty
index 48da360f55..1dcfe15a84 100644
--- a/support/splint/examples/symbols/slimbo.sty
+++ b/support/splint/examples/symbols/slimbo.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/symbols/symbols.w b/support/splint/examples/symbols/symbols.w
index dc58adc0bd..f680b1bffc 100644
--- a/support/splint/examples/symbols/symbols.w
+++ b/support/splint/examples/symbols/symbols.w
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -13,7 +13,6 @@
%
% You should have received a copy of the GNU General Public License
% along with SPLinT. If not, see <http://www.gnu.org/licenses/>.
-\newwrite\gindex
% the namespace choices below are a bit random as this is a demo only
@@ -21,11 +20,6 @@
\def\optimization{5}
\input yy.sty
\modenormal
-\input noweb.sty
- \xreflocaltrue
- \readlxrefs
- \newwrite\xrefstream
- \immediate\openout\xrefstream=\jobname.xxr
\input dcols.sty
\input symmap.sty
\let\parsernamespace\flexnamespace
@@ -70,7 +64,8 @@
\input symfm.sty
\input slimbo.sty
-\setupfootnotes
+\topskip=9pt
+\initauxstream
@** Introduction.
The manual supplied with \splint\ presents an outline of the main
@@ -243,7 +238,7 @@ the value of \.{\\gaglue} set by a copy of one of the productions.
\insertraw{\let\stashnext\stashnextwithspace}%
line_breaking_and_symbols:
GEN\stashed{|stash!=0|}ERIC '(' expression',' \ ss another es')' \
- \insertraw{\let\stashnext\stashnextwithnothingnx}%
+ \insertraw{\let\stashnext\stashnextwithnothing}%
` inline_\stashed{look: $\rightarrow\,$}c \{ \stashed{\X{$\infty$}:See this example to deduce $\ldots$\X\6}\stashed{|b == a - c|} \}
` more_inline_c \{ \stashed{|func(int a, char b);|} \}
%
@@ -285,7 +280,7 @@ symbol_tricks:
\input symtricks.sty
\noindent The stash chunks, inserted by \.{\\stashed\{}{\it random input\/}\.{\}} are invisible to the parser.
As an example, the stash producing the action in the first rule below (|stash!=0|) was
-inserted in the middle of the first term (\prodstyle{GENERIC}). The space (\.{ }) is a special case.
+inserted in the middle of the first term (\prodstyle{GENERIC}). The space (\.{\ }) is a special case.
\medskip
\beginprod
line_breaking_and_symbols:
@@ -305,7 +300,7 @@ Here is the same set of productions with stash producing a space in the middle o
\insertraw{\let\stashnext\stashnextwithspace}%
line_breaking_and_symbols:
GEN\stashed{|stash!=0|}ERIC '(' expression',' \ ss another es')' \
- \insertraw{\let\stashnext\stashnextwithnothingnx}%
+ \insertraw{\let\stashnext\stashnextwithnothing}%
` inline_\stashed{look: $\rightarrow\,$}c \{ \stashed{\X{$\infty$}:See this example to deduce $\ldots$\X\6}\stashed{|b == a - c|} \}
` more_inline_c \{ \stashed{|func(int a, char b);|} \}
%
@@ -316,7 +311,7 @@ line_breaking_and_symbols:
{\it \flexrestyle{\^\\\\[\\"\\'?\\\\]}}. Portions of \flex\ files may be typeset with the help of
\.{\\beginflex}$\ldots$\.{\\endflex} macros. Just as in the case of \bison\ productions, care must be taken to
escape some symbols that have special meaning to \TeX. The ones that {\it must be\/} escaped when used inside
-regular expressions are `\.{\{}', `\.{\}}', `\.{\\}', and~`\.{\%}'. Others, such as `\.{\^}', `\.{\_}', `\.{\$}', `\.{\#}',
+regular expressions are `\.{\{}', `\.{\}}', `\.{\\}', `\.{\ }' (see more below), and~`\.{\%}'. Others, such as `\.{\^}', `\.{\_}', `\.{\$}', `\.{\#}',
and~`\.{\&}' do not require any special treatment (although they continue to perform their special functions
inside \.{\\stashed} blocks). As a note of caution, `$\ldots$\.{\\\\]}' results
in `$\ldots$\flexrestyle{\\]}' and not
@@ -331,6 +326,9 @@ this character is nearly inaccessible in the \TeX\ mode of \CTANGLE, which resul
`\.{\\`}' instead. If the example is not part of a \CWEB\ input (for example it is included from its own \TeX\ file similar to
\.{symtricks.sty} above) then
one can use the `\.{\yl}' character as intended. However, even inside a `pure \TeX\ file' to get `\.{`}', one must still type `\.{\\`}'.
+Finally, it is worth remembering that a space (\.{\ }) would terminate a regular expression (and produce a syntax error) inside
+\.{\\flexrestyle}. This is part of the regular \flex\ syntax and not a \splint\ specific limitation. To make a space character
+a part of a regular expression it must be escaped.
Many of the points made above may become more transparent after examining the source of the example following this sentence.
\medskip
\cdebugtrue
@@ -371,6 +369,20 @@ LEXOPT [porkacne]
M4QSTART "[["
M4QEND "]]"
+@ Lexer specific options can be typeset as well. Any portion specific to \Cee\ can be relegated
+to \CWEB\ as can be seen below. Adjusting the typesetting of various \Cee\ terms works as expected
+(see the source for this example).
+@s scan_state int
+@<Lexer options@>=
+@G(fs1)
+%option bison-bridge
+%option noyywrap noinput reentrant nounput
+%option header-file="lexer.h"
+%option prefix="main_c"
+%option extra-type="@>struct scan_state *@="
+%option stack
+@g
+
@ The first three lines of the previous section successfully parse as section~2 input.
\parseverbosetrue
@<As section 2@>=
@@ -425,7 +437,8 @@ NOT_WS [^[:blank:]\r\n]
@q of index entries depends on the placement of this inclusion @>
@i alphas.hx
-@** Index. Various identifiers in \bison\ productions and \flex\ sections are put in the index, along with
+@** Index. \global\let\secrangedisplay\empty% do not show the current section range anymore
+Various identifiers in \bison\ productions and \flex\ sections are put in the index, along with
the identifiers from the \Cee\ portions of the \CWEB\ input. The
mechanism used to typeset these identifiers is different from the one
employed by the \CWEB's indexing macros. While the \.{\\I} macros in
@@ -434,16 +447,9 @@ only outputs the context in which the identifier was encountered. By
redefining the macros that interpret this context to typeset the
index, several useful effects can be achieved\footnote{One pretty common use is to redefine
macros that take parameters to take none.}.
-\unsetfootnotes
-\input gindex.sty
\def\otherlangindexseparator{% the index is too short
\toksg{}%
\vskip.5\baselineskip
\centerline{B{\sc ISON}, F{\sc LEX, AND} \TeX\ {\sc INDICES}}%
\vskip.5\baselineskip
}
-\closeout\gindex
-\termindexfalse % do not attach indexing entries to the terms in the index, or the section list
-\let\inx\inxmod
-\let\fin\finmod
-\def\topofcontents{\null\vskip-3\baselineskip\centerline{C{\sc ONTENTS} (\sc\uppercase\expandafter{\title})}\medskip}
diff --git a/support/splint/examples/symbols/symfm.sty b/support/splint/examples/symbols/symfm.sty
index 9cfeacbeaa..985d4148d1 100644
--- a/support/splint/examples/symbols/symfm.sty
+++ b/support/splint/examples/symbols/symfm.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/symbols/symmap.sty b/support/splint/examples/symbols/symmap.sty
index 450dd9a649..0a4afbc50a 100644
--- a/support/splint/examples/symbols/symmap.sty
+++ b/support/splint/examples/symbols/symmap.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -25,7 +25,7 @@
\restorecslist{symbols}\yyunion
\toksa{}\toksb{}\toksc{}\toksd{}%
%\showthe\newsymswitch
- \the\symstream
+ \the\table
\global\newsymswitch\newsymswitch
\else
\newsymswitch{}% otherwise \yysymswitch is trying to expand the wrong names (\namepair is not present to do \csname ... )
@@ -118,7 +118,6 @@
\ifyyparsefail
\errmessage{could not process symbols}%
\else
- \symstream\table
\tointermediateparser % the parsing is finished, so we have two very long strings:
% o the rules of the hosted parser ([intermediate])
% o the rules of the same parser just parsed
diff --git a/support/splint/examples/symbols/symtoks.sty b/support/splint/examples/symbols/symtoks.sty
index 3ab9b142c7..6c1bcff58d 100644
--- a/support/splint/examples/symbols/symtoks.sty
+++ b/support/splint/examples/symbols/symtoks.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/symbols/symtricks.sty b/support/splint/examples/symbols/symtricks.sty
index 04bf5c5ac1..cc29bf7dea 100644
--- a/support/splint/examples/symbols/symtricks.sty
+++ b/support/splint/examples/symbols/symtricks.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/types/Makefile b/support/splint/examples/types/Makefile
index 3dd52abeed..b313a18d0f 100644
--- a/support/splint/examples/types/Makefile
+++ b/support/splint/examples/types/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2022, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/types/basic.sty b/support/splint/examples/types/basic.sty
index ba0decc237..fb9c35ad7f 100644
--- a/support/splint/examples/types/basic.sty
+++ b/support/splint/examples/types/basic.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/types/test.sty b/support/splint/examples/types/test.sty
index 018b299c29..3158482b1a 100644
--- a/support/splint/examples/types/test.sty
+++ b/support/splint/examples/types/test.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/types/tree.sty b/support/splint/examples/types/tree.sty
index 68171e6a2d..9b004dba2c 100644
--- a/support/splint/examples/types/tree.sty
+++ b/support/splint/examples/types/tree.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/xxpression/Makefile b/support/splint/examples/xxpression/Makefile
index 8d8b6877c6..05dbd4fafd 100644
--- a/support/splint/examples/xxpression/Makefile
+++ b/support/splint/examples/xxpression/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2022, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -18,8 +18,7 @@
# purposes; the main directory (../..) contains a slightly more
# modular organization.
-XXPRESSION_PREREQS = %.tex %.scn %.idx %.tok ${SPLINT_XPTABLES} ${SPLINT_XLTABLES}
-XXPRESSION_PREREQS += ${SPLINT_ROOT}cweb/bo.tok ${SPLINT_ROOT}cweb/fo.tok xymmap.sty xtoks.sty
+XXPRESSION_PREREQS = %.tex %.scn %.idx %.tok ${SPLINT_XTABLES} xymmap.sty xtoks.sty
include ../../makefile.inc
include ${SPLINT_ROOT}makefile.loc
@@ -57,8 +56,7 @@ ${PARSER}.yy ${LEXER}.ll: xxpression.x alphas.hx
${UNLINE} test.txx test.tex
${UNLINE} xymbols.txx xymbols.tex
-xymbols.sns: xymbols.tex xxpression.tok ${SPLINT_ROOT}cweb/bo.tok ${SPLINT_ROOT}cweb/fo.tok \
- ${SPLINT_XPTABLES} ${SPLINT_XLTABLES} ptab.tex
+xymbols.sns: xymbols.tex xxpression.tok ${SPLINT_XTABLES} ptab.tex
${PDFTEX} $<
alphas.hx:
diff --git a/support/splint/examples/xxpression/xtoks.sty b/support/splint/examples/xxpression/xtoks.sty
index 60e7dfa7a6..4ffea41f50 100644
--- a/support/splint/examples/xxpression/xtoks.sty
+++ b/support/splint/examples/xxpression/xtoks.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -16,4 +16,3 @@
\prettywordpair{IDENTIFIER}{{$\langle$\rm identifier$\rangle$}}
\prettywordpair{INTEGER}{{\bf int}}
-\prettywordpair{$\ undefined}{{\tt\$undefined}}
diff --git a/support/splint/examples/xxpression/xxpression.sty b/support/splint/examples/xxpression/xxpression.sty
index 1b56c4dce3..7ba9c86535 100644
--- a/support/splint/examples/xxpression/xxpression.sty
+++ b/support/splint/examples/xxpression/xxpression.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/examples/xxpression/xxpression.w b/support/splint/examples/xxpression/xxpression.w
index bdf81b004d..7441b90e0d 100644
--- a/support/splint/examples/xxpression/xxpression.w
+++ b/support/splint/examples/xxpression/xxpression.w
@@ -1,4 +1,4 @@
-@q Copyright 2012-2020, Alexander Shibakov@>
+@q Copyright 2012-2024, Alexander Shibakov@>
@q This file is part of SPLinT@>
@q SPLinT is free software: you can redistribute it and/or modify@>
@@ -32,26 +32,25 @@
% end of the definitions). A more elaborate scheme (similar to how the
% typesetting of rules is set up) using several parsers can be used
% instead.
-\newwrite\gindex
\input limbo.sty
-\input dcols.sty
\def\optimization{5}
\newread\testeof
\immediate\openin\testeof=\jobname.tok
\ifeof\testeof % make the local token equivalence table
\let\nx\noexpand
- \csname newwrite\endcsname\tokendefs
\edef\tokendeffile{\jobname.tok} % where to put the token equivalence table
- \edef\bstrapparser{dyytab.tex}
+ \def\bstrapparser{dyytab.tex}
+ \def\bstraptokens{bo.tok}% use token equivalence table to set the values of non-string tokens
+ % this has to be added if a non-bootstrap parser is used to
+ % extract token information (see the comments above)
\def\bootstraplexersetup{%
\let\yylexreturn\yylexreturnregular
\bootstrapmodetrue
- \input bo.tok % use token equivalence table to set the values of non-string tokens
- % this has to be added if a non-bootstrap parser is used to
- % extract token information (see the comments above)
}
\toks0{%
- \input trt1.sty %/* \TeX\ `runtime': temporary register definitions */
+ \let\fin\finmod % this is necessary since the original modifies \output
+ % in a way that conflicts with the scheme in dcols.sty
+ \input trt1.sty % \TeX\ `runtime': temporary register definitions
\input yycommon.sty % general routines for stack and array access
\input yymisc.sty % helper macros (stack manipulation, table processing, value stack pointers)
% parser initialization, optimization
@@ -85,8 +84,9 @@
\fi
\immediate\closein\testeof
\the\toks0
-
-@**Parser file. \setupfootnotes
+\input dcols.sty
+\initauxstream
+@**Parser file.
This is an enhanced parser for expressions. It takes
advantage of the `symbolic term name' mechanism and extends the basic
expression syntax.
@@ -225,8 +225,6 @@ as they have to be inserted in a place that is aware of the internal definitions
definitions are used.
@<Extended \.{expression} parser \Cee\ postamble@>=
-#define YYPRINT(file, type, value) @[yyprint (file, type, value)@]
- static void yyprint (FILE *file, int type, YYSTYPE value){}
@ Union of types. Empty as well.
@@ -261,7 +259,7 @@ int [0-9]+
void define_all_states( void ){}
@ @<Lexer options@>=
-@G
+@G(fs1)
%option bison-bridge
%option noyywrap nounput noinput reentrant
%option noyy_top_state
@@ -309,7 +307,7 @@ int [0-9]+
@[TeX_( "/iftracebadchars" );@]@;
@[TeX_( " /yycomplain{invalid character(s): /the/yytext}" );@]@;
@[TeX_( "/fi" );@]@;
- @[TeX_( "/yylexreturn{$undefined}" );@]@;
+ @[TeX_( "/yyerrterminate" );@]@;
@**Generating symbols. This is the routine that creates symbolic name
assignments for the grammar. The internal mechanics of creating such
@@ -331,6 +329,7 @@ that can be activated to see the inner workings of the parser and
scanner routines.
@(test.txx@>=
@G
+\chardef\other=12 % needed for some macros to work
\input xxpression.sty
\iftrue
@@ -373,13 +372,7 @@ scanner routines.
@q of index entries depends on the placement of this inclusion @>
@i alphas.hx
-@**Index.
-\unsetfootnotes
-\input gindex.sty
-\closeout\gindex
-\termindexfalse % do not attach indexing entries to the terms in the index, or the section list
-\let\inx\inxmod
-\let\fin\finmod
-\immediate\closeout\exampletable
+@**Index.\global\let\secrangedisplay\empty% do not show the current section range anymore
+\global\topskip=9pt
\def\Tex{\TeX\ output}
\def\TeXx{\TeX\ output}
diff --git a/support/splint/examples/xxpression/xymmap.sty b/support/splint/examples/xxpression/xymmap.sty
index d38d23ca9b..e5576ee9cd 100644
--- a/support/splint/examples/xxpression/xymmap.sty
+++ b/support/splint/examples/xxpression/xymmap.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -19,7 +19,7 @@
\def\makesymbols{%
\restorecslist{symbols}\yyunion
\toksa{}\toksb{}\toksc{}\toksd{}%
- \the\symstream
+ \the\table
\global\newsymswitch\newsymswitch
}
@@ -109,7 +109,6 @@
\ifyyparsefail
\errmessage{could not process symbols}%
\else
- \symstream\table
\tointermediateparser % the parsing is finished, so we have two very long strings:
% o the rules of the hosted parser ([intermediate])
% o the rules of the same parser just parsed
diff --git a/support/splint/makefile.inc b/support/splint/makefile.inc
index 787617da1e..e485ea2c83 100644
--- a/support/splint/makefile.inc
+++ b/support/splint/makefile.inc
@@ -1,4 +1,4 @@
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2024, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -18,30 +18,41 @@ SPLINT_ROOT := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)
# taken from a stackoverflow answer by Xavier Holt
TEXINPUTS := .:${SPLINT_ROOT}cweb/:${SPLINT_ROOT}tex/:${SPLINT_ROOT}:${TEXINPUTS}
+TEXFONTS := .:${SPLINT_ROOT}tex/fonts:${SPLINT_ROOT}:${TEXFONTS}
+VFFONTS := .:${SPLINT_ROOT}tex/fonts:${SPLINT_ROOT}:${VFFONTS}
+TFMFONTS := .:${SPLINT_ROOT}tex/fonts:${SPLINT_ROOT}:${TFMFONTS}
SPLINT_DRIVER_DIR = ${SPLINT_ROOT}cweb
-SPLINT_TEXSTYLES = flex.sty yyfaststack.sty yyparse.sty yyunion.sty yyinput.sty yystype.sty yy.sty
-SPLINT_TEXSTYLES += yyinit.sty yybootstrap.sty dcols.sty limbo.sty yycommon.sty yymisc.sty yytexlex.sty
-SPLINT_TEXSTYLES += yydebug.sty gindex.sty noweb.sty
-SPLINT_BOOTSTRAP_STYLES = grabstates.sty
-SPLINT_PTABLES = byytab.tex dyytab.tex fyytab.tex gyytab.tex fiptab.tex reptab.tex small_tab.tex
-SPLINT_PTABLES += raptab.tex ddptab.tex
-SPLINT_LTABLES = ltab.tex small_dfa.tex filtab.tex
+SPLINT_TEXSTYLES_BASE = yycommon.sty yymisc.sty trt1.sty xarithm.sty yyfaststack.sty
+SPLINT_TEXSTYLES_BASE_PARSER0 = yyinput.sty flex.sty yyparse.sty yystype.sty yydebug.sty
+SPLINT_TEXSTYLES_BASE_PARSER1 = yyinit.sty yybootstrap.sty yyunion.sty yy.sty
+SPLINT_TEXSTYLES_BASE_TOKENS = yypretty.sty $(patsubst %, %tokenset.sty, b f s fre)
+SPLINT_TEXSTYLES_BASE_DISPLAY = limbo.sty dcols.sty gindex.sty noweb.sty yytexlex.sty
+
+SPLINT_TEXSTYLES = ${SPLINT_TEXSTYLES_BASE} ${SPLINT_TEXSTYLES_BASE_PARSER0} ${SPLINT_TEXSTYLES_BASE_PARSER1}
+SPLINT_TEXSTYLES += ${SPLINT_TEXSTYLES_BASE_TOKENS} ${SPLINT_TEXSTYLES_BASE_DISPLAY}
+
+SPLINT_PTABLES = byytab.tex dyytab.tex fyytab.tex gyytab.tex fiptab.tex reptab.tex raptab.tex ddptab.tex
+SPLINT_PTABLES += small_tab.tex
+SPLINT_LTABLES = ltab.tex filtab.tex small_dfa.tex
+SPLINT_OTABLES = bo.tok fo.tok
SPLINT_XTEXSTYLES = $(patsubst %, ${SPLINT_ROOT}tex/%, ${SPLINT_TEXSTYLES})
-SPLINT_XBOOTSTRAP_STYLES = $(patsubst %, ${SPLINT_ROOT}tex/%, ${SPLINT_BOOTSTRAP_STYLES})
SPLINT_XPTABLES = $(patsubst %, ${SPLINT_ROOT}cweb/%, ${SPLINT_PTABLES})
SPLINT_XLTABLES = $(patsubst %, ${SPLINT_ROOT}cweb/%, ${SPLINT_LTABLES})
+SPLINT_XOTABLES = $(patsubst %, ${SPLINT_ROOT}cweb/%, ${SPLINT_OTABLES})
+SPLINT_XTABLES = ${SPLINT_XPTABLES} ${SPLINT_XLTABLES} ${SPLINT_XOTABLES}
+
+SPLINT_DOC_PREREQS = splint.tex ${SPLINT_PTABLES} ${SPLINT_LTABLES} ${SPLINT_OTABLES} ${SPLINT_XTEXSTYLES}
+SPLINT_DOC_PREREQS += ${SPLINT_ROOT}tex/frontmatter.sty
-SPLINT_DOC_PREREQS = %.tex ${SPLINT_PTABLES} ${SPLINT_LTABLES} ${SPLINT_XTEXSTYLES}
-SPLINT_DOC_PREREQS += ${SPLINT_ROOT}tex/btokenset.sty ${SPLINT_ROOT}tex/ftokenset.sty
-SPLINT_DOC_PREREQS += ${SPLINT_ROOT}tex/stokenset.sty ${SPLINT_ROOT}tex/fretokenset.sty
-SPLINT_DOC_PREREQS += bo.tok fo.tok
-SPLINT_DOC_PREREQS_XREF = ${SPLINT_DOC_PREREQS} %.scn %.idx
+SPLINT_DOC_PREREQS_XREF = ${SPLINT_DOC_PREREQS} splint.scn splint.idx
-PDFTEX = export TEXINPUTS=${TEXINPUTS} && pdftex
-TEX = export TEXINPUTS=${TEXINPUTS} && tex
+EXPORT_TEX_ENVIRON = TEXINPUTS=${TEXINPUTS} TEXFONTS=${TEXFONTS} VFFONTS=${VFFONTS} TFMFONTS=${TFMFONTS}
+
+PDFTEX = export ${EXPORT_TEX_ENVIRON} && pdftex -recorder -file-line-error -synctex=1
+TEX = export ${EXPORT_TEX_ENVIRON} && tex
DVIPS = dvips
PDFVIEW = evince
CWEAVE = cweave -bhp
@@ -56,6 +67,8 @@ UNLINE = ${SPLINT_ROOT}scripts/unline.pl
BINDX = ${SPLINT_ROOT}scripts/bindx.pl
MISCCW = ${SPLINT_ROOT}scripts/misccw.pl
+# remove the default implicit rules
+
%.c: %.w
%.c: %.y
%.pdf: %.tex
@@ -63,8 +76,10 @@ MISCCW = ${SPLINT_ROOT}scripts/misccw.pl
%.o: %.c
%.c: %.l
-%.x: %.w
- ${BRACK} $< $@
+# new implicit rules
+
+%.x %.u %.m: %.w
+ ${BRACK} --bison-link=$*.m $< $*.x $*.u
%.c: %.y
${BISON} $^ -o $@
@@ -91,12 +106,13 @@ ${SPLINT_ROOT}cweb/%:
clean_temp:
-rm -f *.o *.tab.* *.dvi *.pdf *.ps *~ *.log *.rli *.rls *.lpg \
- *.output *.lst *.exl *.ftn *.*pk *.gdx
+ *.output *.lst *.exl *.*pk *.gdx *.fls *.synctex.gz
clean_core: clean_temp
- -rm -f *.c *.h *.tex *.idx *.scn *.toc *.tok *.sns *.gdy *.xxr *.x \
- *.hx *.hy *.yy *.ll *.y *.l
+ -rm -f *.c *.h *.tex *.idx *.scn *.toc *.tok *.sns *.aux *.gdy *.x \
+ *.u *.m *.hx *.hy *.yy *.yx *.ll *.y *.l
# to ensure that interrupted and erroneous builds are cleaned up
-.DELETE_ON_ERROR:
+.DELETE_ON_ERROR:
+ -rm -f *.gdx *.gdy *.aux *.tok
diff --git a/support/splint/extras/texmf/macros/protcode.tex b/support/splint/other/texmf/macros/protcode.tex
index 57f735a973..57f735a973 100644
--- a/support/splint/extras/texmf/macros/protcode.tex
+++ b/support/splint/other/texmf/macros/protcode.tex
diff --git a/support/splint/scripts/bindx.pl b/support/splint/scripts/bindx.pl
index beb9719bf8..871612058e 100755
--- a/support/splint/scripts/bindx.pl
+++ b/support/splint/scripts/bindx.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2022, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -126,8 +126,8 @@ while (<FILE>) {
\{([^\{\}]+)\} # domain
\{([0-9]+)\} # rank
\{([^\{\}]*)\} # type1
- \{([^\{\}\s]+)\s*\} # type2
- \{((\{[^\{\}]+\})+)\} # key
+ \{([^\{\}]+)\s*\} # type2
+ \{((\{[^\{\}]+\})+|\\vend.*\\vend\s*)\} # key
\{((\{[^\{\}]+\})*)\} # visual key
(\%.*)*\n/x ) {
# ordinary index entry
@@ -135,8 +135,19 @@ while (<FILE>) {
($section, $pageno, $nspace, $junk0, $domain, $rank, $type1, $type2, $key, $junk1, $vkey) =
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11 );
- $key =~ s/\{([0-9]+)\}/pack "c1", $1/eg;
$term = $key;
+ $key =~ s/\{([0-9]+)\}/pack "c1", $1/eg;
+
+ if ( $term =~ /\\vend/ ) {
+
+ # only process the key if it is not raw
+
+ } else {
+
+ $term = $key;
+
+ }
+
$vkey =~ s/\{([0-9]+)\}/pack "c1", $1/eg;
if ( $vkey ne "" ) {
@@ -206,7 +217,16 @@ foreach $domain (sort keys %index ) {
$term = $index{$domain}{$key}{term};
$term_printable = $term;
- $term =~ s/(.)/"\{".(unpack "c1", $1)."\}"/eg;
+
+ if ( $term =~ /\\vend/ ) {
+
+ $term =~ s/\\vend(.*)\\vend/$1/eg; # unwrap the entry
+
+ } else {
+
+ $term =~ s/(.)/"\{".(unpack "c1", $1)."\}"/eg;
+
+ }
if ( alpha_jump( $key, $last_alpha ) > 0 ) {
$last_alpha = substr $key, 0, 1;
diff --git a/support/splint/scripts/brack.pl b/support/splint/scripts/brack.pl
index 887c6324f0..8db199ad77 100755
--- a/support/splint/scripts/brack.pl
+++ b/support/splint/scripts/brack.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2024, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -22,11 +22,14 @@
# only one style of comments is accepted: /* ... */. note that these are not
# output
+use strict;
use Getopt::Long;
use Pod::Usage;
my $man = 0;
my $help = 0;
+my $replace_only = '';
+my $binterwork = '';
my $elang_start = "\@t}\\lsectionbegin{\%s}\\vb{\@>\n";
my $elang_finish = "\@t}\\vb{\\yyendgame}\\vb{}\\endparse\\postparse{\@>\n";
@@ -35,21 +38,133 @@ my $elang_finish = "\@t}\\vb{\\yyendgame}\\vb{}\\endparse\\postparse{\@>\n";
GetOptions ("help|?" => \$help,
man => \$man,
"startol=s" => \$elang_start, # the string that starts an `other language' region
- "finishol=s" => \$elang_finish # the string that ends an `other language' region
+ "finishol=s" => \$elang_finish, # the string that ends an `other language' region
+ "bison-link=s" => \$binterwork, # whether to produce .z files to allow `$?' notation in \TeX]
+ "replace-only" => \$replace_only, # make reverse substitutions only
) or pod2usage(2);
pod2usage(-exitval => 0, -verbose => 1) if $help;
pod2usage(-exitval => 0, -verbose => 2) if $man;
+my %tex_replacements = ();
+
+if ( $replace_only ) {
+ open FILE, "$ARGV[0]" or die "Cannot open input file $ARGV[0]\n";
+ open FILEOUT, ">$ARGV[1]" or die "Cannot open output file $ARGV[1]\n";
+ open BLINK_IW, "$binterwork" or die "Cannot open link file $binterwork\n";
+
+ while ( <BLINK_IW> ) {
+ $_ =~ m/^(BZ\d+ZB_\d+)=(.*)$/;
+ my ( $key, $value ) = ( $1, $2 );
+ $tex_replacements{$key} = $value;
+ }
+
+ close BLINK_IW;
+
+ while ( <FILE> ) {
+ $_ =~ s/(BZ\d+ZB_\d+)/$tex_replacements{$1}/g;
+ print FILEOUT $_;
+ }
+
+ close FILE;
+ close FILEOUT;
+
+ exit 0;
+}
+
open FILE, "$ARGV[0]" or die "Cannot open input file $ARGV[0]\n";
open FILEOUT, ">$ARGV[1]" or die "Cannot open output file $ARGV[1]\n";
-$state = 0;
-$paused_state = 0;
-while (<FILE>) {
+if ( $binterwork ) {
+ open BLINK_IW, ">$binterwork" or die "Cannot open link file $binterwork\n";
+ open BLINK, ">$ARGV[2]" or die "Cannot open diff file $ARGV[2]\n";
+}
- $inline = $_;
+sub output_all {
+ my $wline = shift;
+ my $bline = shift || [];
+ my @bline = @{$bline};
+ if ( not @bline ) {
+ @bline = @{$wline};
+ }
+
+ printf FILEOUT @{$wline};
+
+ if ( $binterwork ) {
+ printf BLINK @bline;
+ }
+}
+
+my $state = 0;
+my $paused_state = 0;
+
+sub replace_tex {
+ my $prefix = shift;
+ my $tex_string = shift;
+ my $suffix = shift;
+ $prefix =~ s/TeX(a|b|ao|f|fo)_/TeX$1/;
+ $tex_string =~ s{\$\[?(\d+)\]?}{/yy($1)}xg;
+ $tex_string =~ s/\$\[?([a-zA-Z_.][a-zA-Z0-9_.]*)\]?/\/yy\]$1\[/xg;
+
+ return $prefix.$tex_string.$suffix;
+}
+
+sub replace_c {
+ my $prefix = shift;
+ my $c_string = shift;
+ my $suffix = shift;
+ my $marker = shift;
+ my $counter = shift;
+ my @matches = ();
+ my $match_count = 0;
+
+ $$counter++;
+
+ $marker .= "_".$$counter;
+ $prefix =~ s/TeX(a|b|ao|f|fo)_/TeX$1/;
+ $match_count =
+ ($c_string =~ s/
+ \$(
+ \d+|
+ [a-zA-Z0-9_.]+|
+ \[[a-zA-Z0-9_.]+\]
+ )
+ /replace_yy($1, \@matches)/xeg);
+
+ if ( $match_count ) {
+ $tex_replacements{$marker} =
+ "TeX__(\"".$c_string."\",".(join ',', @matches).");";
+ return $marker; # replacement for .c file
+ } else {
+ return $prefix.$c_string.$suffix;
+ }
+}
+
+sub replace_yy{
+ my $match = shift;
+ my $matches = shift;
+ $match =~ s/[\[\]\(\)]//g;
+ $match = "[$match]" if $match !~ m/^\d/;
+ push @{$matches}, "BZ(\$$match,\$1), BZ((yyvsp[0]), \$$match), BZZ((yyvsp[0]),\$1)";
+ return "/yg{\%ld}{\%ld}{\%ld}";
+}
+
+my $line_count = 0;
+
+while (<FILE>) {
+
+ my $inline = $_;
+ my $inline_z = $inline;
+ my ( $string, $string_z, $comment );
+ $line_count++;
+
+ if ( $binterwork && $inline =~ m/TeX(_|a_|b_|ao_|f_|fo_)\b/ ) {
+ my $marker = "BZ$line_count"."ZB";
+ my $counter = 0;
+ $inline_z =~ s/(TeX(_|a_|b_|ao_|f_|fo_)?\b\s*\([^"]*")(([^"]|\\")*)("[^"\)]*\);)/replace_c($1, $3, $5, $marker, \$counter)/eg;
+ $inline =~ s/(TeX(_|a_|b_|ao_|f_|fo_)?\b\s*\([^"]*")(([^"]|\\")*)("[^"\)]*\);)/replace_tex($1, $3, $5)/eg;
+ }
if ( $inline =~ m/^\@G(.*)$/ ) { # @G detected, this line is part of the `other language' region
@@ -58,104 +173,102 @@ while (<FILE>) {
if ( $inline =~ m/^\(([^)]*)\).*/ ) { # language specifier present
$inline = $1;
} else {
- $inline = "b";
+ $inline = "";
}
- printf FILEOUT "\@q Start generic language section\@>\n" . $elang_start, "$inline"; # a parser switcher
+ output_all( ["\@q Start generic language section\@>\n" . $elang_start, "$inline"] ); # a parser switcher
} elsif ( $inline =~ m/^\@[\scp\*0-9].*$/ ) { # @`other' detected, so `other language' region is over
if ($state == 1) {
- printf FILEOUT "\@q%s\@>\n" . $elang_finish, "End of generic language section"; # a parser switcher
+ output_all( ["\@q%s\@>\n" . $elang_finish, "End of generic language section"] ); # a parser switcher
}
$state = 0;
- printf FILEOUT "%s", "$inline";
+ output_all( ["%s", "$inline"] );
} elsif ( $inline =~ m/^\s*\@[=t].*$/ ) { # @= detected, just copy the line
- printf FILEOUT "%s", "$inline";
+ output_all( ["%s", "$inline"] );
} elsif ( $inline =~ m/^\@g(.*)$/ ) { # explicit end of other languge region detected
$inline = $1;
if ($state == 1) {
- printf FILEOUT "\@q%s\@>\n" . $elang_finish, "End of generic language section"; # a parser switcher
+ output_all( ["\@q%s\@>\n" . $elang_finish, "End of generic language section"] ); # a parser switcher
}
$state = 0;
} elsif ( $inline =~ m/^\@O(.*)$/ ) { # @O detected, so `other language' region is paused
- $inline = $1; $paused_state = $state; $state = 0;
+ $paused_state = $state; $state = 0;
- if ( not $inline ) { $inline = "End generic language section"; }
- printf FILEOUT "\@q%s\@>\n", "$inline";
+ $inline = $1 || "End generic language section";
+ output_all( ["\@q%s\@>\n", "$inline"] );
} elsif ( $inline =~ m/^\@o(.*)$/ ) { # @o detected, so `other language' region is resumed
- $inline = $1; $state = $paused_state; $paused_state = 0;
+ $state = $paused_state; $paused_state = 0;
- if ( not $inline ) { $inline = "End generic language section"; }
- printf FILEOUT "\@q%s\@>\n", "$inline";
+ $inline = $1 || "End generic language section";
+ output_all( ["\@q%s\@>\n", "$inline"] );
} elsif ( $state != 0 ) {
if ( $inline =~ m/\/\*.*\*\/\s*$/ ) { # the line contains a comment at the end
- $inline =~ m/^(.*\S|)\s*(\/\*.*\*\/)\s*$/;
+ $inline =~ m/^(.*\S|)\s*(\/\*.*\*\/)\s*$/; # this is not very robust ...
$string = $1; $comment = $2;
+ $inline_z =~ m/^(.*\S|)\s*(\/\*.*\*\/)\s*$/; # this is not very robust ...
+ $string_z = $1;
} else {
-
- $inline =~ m/^(.*)$/;
- $string = $1; $comment = "";
-
- }
-
- if ( $string ) {
-
- printf FILEOUT "\@=%s\@>\@t}\\vb{\\n}{\@>\@;", "$string";
-
- } else {
-
- printf FILEOUT "\@=%s\@>\@t}\\vb{\\n}{\@>\@;", " "; # to keep \CWEB\ happy
-
- }
-
- if ( $comment ) {
-
- printf FILEOUT "%s", "$comment";
+ $string = $inline; $comment = "";
+ $string_z = $inline_z;
+
}
- printf FILEOUT "%s", "\n";
+ $string =~ s/\n//;
+ $string_z =~ s/\n//;
+ output_all( ["\@=%s\@>\@t}\\vb{\\n}{\@>\@;", ( $string || " " )],
+ ["\@=%s\@>\@t}\\vb{\\n}{\@>\@;", ( $string_z || " " )] );
+ output_all( ["%s", "$comment"] ) if $comment;
+ output_all( ["%s", "\n"] );
} else {
- printf FILEOUT "%s", "$inline";
+ output_all( ["%s", "$inline"], ["%s", "$inline_z"] );
}
}
+foreach my $key ( keys %tex_replacements ) {
+ print BLINK_IW "$key=$tex_replacements{$key}\n";
+}
+
__END__
=head1 BRACK
-brack.pl - Preprocess a CWEB file to allow language extensions
+brack.pl - Postprocess a CWEB file to allow language extensions
=head1 SYNOPSIS
-brack.pl [options] input_file output_file
-
+brack.pl [options] --bison-link=<subst file> <input file> <B<CWEAVE>output file> <B<CTANGLE>output file>
+ or
+brack.pl --replace-only --bison-link=<subst file> <B<CTANGLE>output file> <output file>
Options:
--help|-h|-? brief help message
--man|-m full documentation
--startol|-s string to begin a language region
--finishol|-f string to end a language region
+ --bison-link|-b file to write future substitutions to
+ --replace-only|-r replace the result of postprocessing using the subst file
=head1 OPTIONS
@@ -177,6 +290,14 @@ The string to print at the beginning of an other language region
The string to print at the end of an other language region
+=item B<--bison-link>=I<file name>
+
+The file to write future substitutions to
+
+=item B<--replace-only>
+
+Carry out the replacements using the substitution file and quit
+
=back
=head1 DESCRIPTION
@@ -197,4 +318,10 @@ To put the comment inside the verbatim blocks, one may surround it by [@>@=] and
to the spacing, see next). Note the space at the end of the closing construct: this
is necessary to pacify B<CWEAVE>.
+In order to use the `native' bison term references inside TeX code, the
+ brack.pl --bison-link=<subst file> <input file> <B<CWEAVE>output file> <B<CTANGLE>output file>
+form must be used first to create the substitutions file as well as two B<CWEB> files.
+Then B<CTANGLE> is run on the <B<CTANGLE>output file> and finally
+ brack.pl --replace-only --bison-link=<subst file> <B<CTANGLE>output file> <output file>
+to finish the creation of a file suitable for producing a parsing automaton.
=cut
diff --git a/support/splint/scripts/cslist.pl b/support/splint/scripts/cslist.pl
index 9c187517ac..2954e23e03 100755
--- a/support/splint/scripts/cslist.pl
+++ b/support/splint/scripts/cslist.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2022, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/scripts/misccw.pl b/support/splint/scripts/misccw.pl
index b536904df4..a0c53b19c9 100755
--- a/support/splint/scripts/misccw.pl
+++ b/support/splint/scripts/misccw.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2022, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/scripts/unline.pl b/support/splint/scripts/unline.pl
index 36a1b524f5..f335dcac87 100755
--- a/support/splint/scripts/unline.pl
+++ b/support/splint/scripts/unline.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2022, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -23,6 +23,7 @@
use Getopt::Long;
use Pod::Usage;
+use strict;
my $man = 0;
my $help = 0;
@@ -38,10 +39,11 @@ pod2usage(-exitval => 0, -verbose => 2) if $man;
open FILE, "$ARGV[0]" or die "Cannot open input file $ARGV[0]\n";
open FILEOUT, ">$ARGV[1]" or die "Cannot open output file $ARGV[1]\n";
+my $prev_space = 1;
while (<FILE>) {
- $inline = $_;
+ my $inline = $_;
s/^(\#line.*)\n$//g;
@@ -51,14 +53,13 @@ while (<FILE>) {
}
- printf FILEOUT "%s", "$_";
-
-# if ( m/^.*\S.*\n$/ ) {
-
-# printf FILEOUT "%s", "$_";
-
-# }
-
+ if ( m/^.*\S.*\n$/ ) {
+ printf FILEOUT "%s", "$_";
+ $prev_space = '';
+ } else { # squash multiple blank lines together
+ printf FILEOUT "\n" if not $prev_space;
+ $prev_space = 1;
+ }
}
__END__
diff --git a/support/splint/tex/btokenset.sty b/support/splint/tex/btokenset.sty
index 72d3b3394f..3455787d12 100644
--- a/support/splint/tex/btokenset.sty
+++ b/support/splint/tex/btokenset.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -21,14 +21,14 @@
\prettywordpair{PERCENT_NONDETERMINISTIC_PARSER}{{$\langle$nondet. parser$\rangle$}}
\prettywordpairwvis{semi}{{\tt;}}{;}
\prettywordpair{TAG}{{{\tt<}{\it tag\/}{\tt>}}}
-\prettywordpair{$\ undefined}{{\tt\$undefined}}
\prettywordpair{<tag>}{{{\tt<}{\it tag\/}{\tt>}}}
\prettywordpairwvis{FLEX_OPTION}{{$\langle$\bf option$\rangle_{\rm f}$}}{option_f}
-\prettywordpairwvis{FLEX_STATE_X}{{$\langle$\bf state-x$\rangle_{\rm f}$}}{state-x}
-\prettywordpairwvis{FLEX_STATE_S}{{$\langle$\bf state-s$\rangle_{\rm f}$}}{state-s}
+\prettywordpairwvis{XSCDECL}{{$\langle$\bf state-x$\rangle_{\rm f}$}}{state-x}
+\prettywordpairwvis{SCDECL}{{$\langle$\bf state-s$\rangle_{\rm f}$}}{state-s}
\prettywordpair{ID}{{\cyr\lqq{\rm identifier}\rqq}}
\prettywordpair{ID_COLON}{{\cyr\lqq{\rm identifier: }\rqq}}
\prettywordpairwvis{NUL}{{$\Lambda$}}{Lambda}
\prettywordpair{INT}{{\bf int}}
\prettywordpair{CHAR}{{\bf char}}
\prettywordpair{STRING}{{\cyr\lqq{\tt string}\rqq}}
+\prettywordpair{bogus_inline}{{\ntt\char`\$@$n$}} % a term used in `inline action' explanation
diff --git a/support/splint/tex/dcols.sty b/support/splint/tex/dcols.sty
index 71176efd14..44fa97355f 100644
--- a/support/splint/tex/dcols.sty
+++ b/support/splint/tex/dcols.sty
@@ -1,4 +1,4 @@
-% Copyright 2004-2020, Alexander Shibakov
+% Copyright 2004-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -48,9 +48,6 @@
\newbox\migrantbox
{\setbox\migrantbox=\box\migrantbox}
-\newtoks\fromword
-\newtoks\toword
-
\newcount\remaindergaps % the number of gaps between columns after the
% first `footnote column'
\newcount\remaindernonfoots % the number of columns without footnotes
@@ -60,7 +57,7 @@
\newif\iflastpageup
\maxdeadcycles=600 % this should be approximately half the \pageheight in points
- % to handle the case when \enddoublecolumns is called before the
+ % to handle the case when \enddoublecols is called before the
% last doublecolumn page is full
% setup the page length and the column count
@@ -108,7 +105,35 @@
\pagewidth=\hsize
\pageheight=\vsize
-%
+% some debugging tools (rather primitive)
+
+\def\onpage#1#2{%
+ {%
+ \yystringempty{#1}{#2}%
+ {%
+ \ifnum#1=\pageno\relax
+ \showboxbreadth=1000
+ \showboxdepth=1000
+ #2%
+ \fi
+ }%
+ }%
+}
+
+\def\onpageg#1#2{% make global assignments possible
+ \yystringempty{#1}{#2}%
+ {%
+ \ifnum#1=\pageno\relax
+ \showboxbreadth=1000
+ \showboxdepth=1000
+ #2%
+ \fi
+ }%
+}
+
+\ifx\testpageno\UNDEFINED
+ \def\testpageno{-\@M}
+\fi
\def\footnote#1{%
\edef\@sf{\spacefactor\the\spacefactor}\setfnmark
@@ -232,7 +257,11 @@
\dsskip\smallskipamount
-\def\begindoublecols{\begingroup\normalbottom\parindent=0pt
+\def\begindoublecols{%
+ \begingroup
+ %\normalbottom
+ \r@ggedbottomfalse % \normalbottom changes \topskip which we do not want
+ \parindent=0pt
\count\footins=\@m \multiply\count\footins by\fnotesspan
\skip\footins=\fnotesspan\realfootins
\remaindergaps=\noofcolumns
@@ -265,6 +294,7 @@
\fi
%
\output={
+ \settopmark % save the \topmark if this is the top of the page
\ifvoid\partialpage
\else % this is a border case: too much material has been contributed, this routine will be called twice
% so output the full page now
@@ -287,23 +317,25 @@
\lastpageupfalse % not the final page yet
\holdinginserts=\@ne
\let\thepage\pagesofar
- \output={\multcolumnout}
\hsize=\columnwidth
+ \output={\multcolumnout}
+ \mco@computevsize
+ \ifvoid\migrantbox
+ \else
+ \insert\footins{\box\migrantbox}%
+ \fi
+}
+
+\def\mco@computevsize{%
\global\vsize=\pageheight%
\global\advance\vsize by-\ht\partialpage%
\global\divide\vsize\baselineskip
\global\multiply\vsize\baselineskip
\global\multiply\vsize\noofcolumns%
-%\message{starting with vsize at \the\vsize, with pp at \the\ht\partialpage}
\global\advance\vsize by-\noofcolumns\topskip
\global\advance\vsize by\topskip
\global\advance\vsize by\noofcolumns\baselineskip
\global\advance\vsize by-\baselineskip
-%\message{vsize set at \the\vsize}
- \ifvoid\migrantbox
- \else
- \insert\footins{\box\migrantbox}%
- \fi
}
\newif\ifpenultimatepage
@@ -376,6 +408,7 @@
}
\def\multcolumnout{%
+ \settopmark % save the \topmark if this is the top of the page
\splittopskip=\topskip
\splitmaxdepth=\maxdepth
\dimen\z@=\pageheight
@@ -386,16 +419,23 @@
% quickly enough resulting in an infinite \deadcycles loop
\normaloutput{\unvbox\partialpage}\lheader\rheader
\unvbox\@cclv \penalty\lastpenalty
+ \mco@computevsize
+ \else
+ \multcolumnout@split
\fi
+}
+
+\newtoks\fromword % save the marks
+\newtoks\toword
+
+\def\multcolumnout@split{% proceed with splitting and balancing the columns
+ % normalize the max column height of the collected material first
\divide\dimen\z@\baselineskip \multiply\dimen\z@\baselineskip
-%\message{aiming for d0: \the\dimen0}
\dimen\@ne=\pagegoal % we claculate the maximum allowable height of the
% middle column next
\advance\dimen\@ne by-\vsize
\advance\dimen\@ne by \fnotesspan\dimen\z@
\divide\dimen\@ne by\fnotesspan
-%\message{d1: \the\dimen1, d0: \the\dimen0, pageheight: \the\pageheight }%
-%\message{(vsize: \the\vsize, pagegoal: \the\pagegoal\space ppage: \the\ht\partialpage)^^J^^J}%
%
\balanceallcolumns
%
@@ -403,22 +443,23 @@
\global\fromword=\expandafter{\firstmark}
\global\toword=\expandafter{\botmark}
\iflastpageup
+ \onpage{\testpageno}{\message{outputting last page...}}%
\ifnum\outputpenalty<-9999 % this break was forced (most likely by the \break in \enddouble...)
\ifvoid\footins
\else
\ifdim\dp\footins=\z@ \else
{\setbox\footins=\box\footins}% this was a correcion box after which no new real footnotes
- \fi % were cotributed
+ \fi % were contributed
\fi
% a correction (\hbox{}) was added by the \enddouble... command;
% this correction will affect \box\footins (since it will appear
% as a box in \foothhbox, a box that is not a footnote);
% this correction will be translated into an appropriate
% adjustment to \box\footins (since the output routine thinks
- % it is a footnote); however, it does throw off the footnote count in \foothhbox
+ % it is a footnote); however, it does throw the footnote count in \foothhbox
% off by one; kill it here; the footnotes will be inserted from the footins box
\setbox\z@=\vbox{\pagesofar}%
- \unvbox\z@ \penalty\lastpenalty
+ \unvbox\z@ \penalty\lastpenalty %?
% since we could not touch \foothhbox above (to keep the footnote height calculations correct),
% the \footins box is messed up; fix it
{\setbox\footins=\box\footins}%
@@ -432,13 +473,13 @@
\global\outputnowfalse
\global\holdinginserts=\@ne
\fi
- \else % this is not the last page, preform normal multicolumn output
+ \else % this is not the last page, perform normal multicolumn output
\normaloutput\page\lheader\rheader
%
\global\vsize=\longvsize
\global\outputnowfalse
\global\holdinginserts=\@ne
- \ifpenultimatepage % page broken at a penalty inserted by \enddoublecolumns
+ \ifpenultimatepage % page broken at a penalty inserted by \enddoublecols
\global\p@nultimatepagetrue % the next penalty should be removed
\fi
\fi
@@ -450,11 +491,11 @@
\global\outputnowtrue
\global\holdinginserts=\z@
\fi
- \unvbox\@cclv
+ \unvbox\@cclv\relax
\ifnum\outputpenalty=\@M % 10000 the break was not at a penalty item
\else
\ifp@nultimatepage % we already split the page at this penalty
- \global\p@nultimatepagefalse % let \enddoublecolumns insert the penalty
+ \global\p@nultimatepagefalse % let \enddoublecols insert the penalty
\else
\penalty\outputpenalty
\fi
@@ -474,13 +515,55 @@
}
}
+% since the output routine is executed several times for every physical page of output
+% we have to make sure that the \topmark value is saved only once;
+% the mechanism below relies on \normaloutput being the only physical means of outputting the page
+% (more precisely, the only macro that contains the \shipout command and expands \savetopmark)
+
+\newtoks\savedtopmark % keep track of the last mark
+
+\def\settopmark{% this has to be done at the beginning of every \output routine
+ % it would have been a lot easier if there was an \everyoutput type command available
+ \yytoksempty\savedtopmark{\global\savedtopmark\expandafter{\topmark}}{}%
+ \yytoksempty\savedtopmark{\global\savedtopmark{{0}{0}{0}}}{}% make sure the saved topmark is not empty from now on
+}
+
\def\normaloutput#1#2#3{\ifodd\pageno\hoffset=\pageshift\fi
- \shipout\vbox{
- \vbox to\fullpageheight{
- \iftitle\global\titlefalse
- \else\hbox to\pagewidth{\vbox to10pt{}\ifodd\pageno #3\else#2\fi}\fi
- \vfill#1}} % parameter #1 is the page itself
- \global\advance\pageno by1}
+ % this is a convenient (although not very refined) way to ivestigate spacing problems
+ \onpageg{\testpageno}{\tracingoutput=1\relax}%
+ \shipout\vbox{
+ \vbox to\fullpageheight{
+ \iftitle\global\titlefalse
+ \else\hbox to\pagewidth{\vbox to10pt{}\ifodd\pageno #3\else#2\fi}\fi
+ \vfill
+ #1
+ }
+ }% parameter #1 is the page itself
+ \ifnum\outputpenalty=-'10000000000 % this is the \end ...
+ \everyendofjob
+ \fi
+ \global\advance\pageno by1
+ \global\savedtopmark{}% reset the last mark (the only place where this is done)
+}
+
+\def\topsecno{\expandafter\takeone\the\savedtopmark} % the last section on the
+ % previous page
+
+% we change the original output routine from cwebmac.tex to handle the topmark saving
+% mechanism introduced here
+
+% a word of caution about the change below: if dcols.sty is not loaded immediately after
+% cwebmac.tex (or at least before the first page is discarded) the output routine below
+% must be further adjusted to
+% \global\output{\settopmark\normaloutput\page\lheader\rheader}
+% so that any `watsit' nodes on the first page (like \write, \open, etc) have a chance to
+% execute; one possible (although not perfect) way of automating this choice is to detect
+% the horizontal mode here and change the output routine accordingly.
+
+\output{\setbox0=\page % the first page is garbage
+ \openout\cont=\contentsfile
+ \write\cont{\catcode `\noexpand\@=11\relax} % \makeatletter
+ \global\output{\settopmark\normaloutput\page\lheader\rheader}} % make sure the \topmark is nonempty; AS
\let\page\pagebody % this is a cwebmac command but it has to be executed here, after the \pagebody macro is changed
@@ -515,18 +598,20 @@
}
\def\b@lanceallcolumns{
+ \onpage{\testpageno}{\message{normalized (after partial page) max column ht(dimen0): \the\dimen0}}%
\advance\count\@cclv\@ne
\whichcolumn{\count\@cclv}%
\ifinfoots % if the footnotes go under these columns ...
\dimen\tw@=\ht\z@
-%\message{set d2(=ht0): \the\dimen2, d0: \the\dimen0; vs. ph: \the\pageheight}%
+ \onpage{\testpageno}{\message{total height of remaining collected material, in footnotes(dimen2): \the\dimen2}}%
\advance\dimen\tw@ by -\remaindernonfoots\dimen\z@
\advance\dimen\tw@ by -\remaindergaps\baselineskip
\advance\dimen\tw@ by \remaindergaps\topskip
\divide\dimen\tw@ by \fnotesspan
-%\message{set d2: \the\dimen2}%
+ \onpage{\testpageno}{\message{set footnote column ht(dimen2): \the\dimen2}}%
\let\next=\b@l@nceallcolumns
\else % otherwise, split off the columns ...
+ \onpage{\testpageno}{\message{total height of remaining collected material, pre footnotes(ht0): \the\ht0}}%
\ifnum\dimen\z@<\topskip
\setbox\@ne=\vsplit\z@ to \topskip
\else
@@ -543,32 +628,38 @@
\newcount\tcthr
\def\b@l@nceallcolumns{% splitting off the columns after the footnotes start
- \count\@cclv=\fnotesstart
- \setbox3=\copy\z@
- \setbox5=\vbox{}%
- \b@l@nc@allcolumns
+ \count\@cclv=\fnotesstart
+ \setbox3=\copy\z@
+ \setbox5=\vbox{}%
+ \b@l@nc@allcolumns
}
\def\b@l@nc@allcolumns{
+ % box3 contains a copy of the collected material after the pre footnote columns have been split off
\whichcolumn{\count\@cclv}%
\iflastcolumn
-%\message{box3 height: \the\ht3, box3 depth: \the\dp3, d0: \the\dimen0, d2: \the\dimen2}%
\ifnum\ht3>\dimen\ifinfoots \tw@ \else \z@ \fi
+ \onpage{\testpageno}{\message{last \ifinfoots (footnote) \fi column too high: \the\ht3 %
+ \space vs. allowable height(dimen\ifinfoots 2\else 0\fi): \the\dimen\ifinfoots \tw@ \else \z@ \fi}}%
\advance\dimen\tw@ by \@ne pt
\let\next=\b@l@nceallcolumns
\else
\ifinfoots
\else
\ifnum\dimen\z@<\topskip
+ \onpage{\testpageno}{\message{d0<ts--->}}%
\setbox3=\vsplit3 to \topskip
\else
+ \onpage{\testpageno}{\message{d0>=ts--->}}%
\setbox3=\vsplit3 to \dimen\z@
\fi
\fi
-%\message{**box3 height: \the\ht3, d0: \the\dimen0, bs: \the\baselineskip, ts: \the\topskip}%
+ \onpage{\testpageno}{\message{last \ifinfoots footnote \fi column height(ht3): \the\ht3 %
+ \space topskip: \the\topskip, }}%
+ \onpage{\testpageno}{\message{max column height(dimen0): \the\dimen0}}%
\wd3=\hsize
\setbox\tw@=\vbox{\box3 \unvbox5 \unvbox\tw@}%
- %%% \box2 is laterchanged globally
+ %%% \box2 is later changed globally
\vbadness=\tcthr
\let\next=\relax
\fi
@@ -617,16 +708,20 @@
}
\def\footblock{%
+ \onpage{\testpageno}{\message{building footnote columns...}}%
\hbox to \fnoteboxwidth{\f@otblock}%
\count\@cclv=\fnotesstart
\advance\count\@cclv by\fnotesspan
\advance\count\@cclv\m@ne
\whichcolumn{\count\@cclv}%
+ \onpage{\testpageno}{\message{column \the\count\@cclv\space to process...}}%
\iflastcolumn
\let\next=\relax
+ \onpage{\testpageno}{\message{done...}}%
\else
\hfil
\let\next=\p@gesofar
+ \onpage{\testpageno}{\message{process columns after the footnotes...}}%
\fi
\next
}
@@ -634,7 +729,7 @@
\def\f@otblock{%
\whichcolumn{\count\@cclv}%
\ifinfoots
- \iffirstfootcol
+ \iffirstfootcol % put all the footnotes after the first column
\setbox\z@=\rlap{\vbox{
\ifvoid\footins
\else
@@ -659,14 +754,20 @@
\wd\z@=\hsize
\box\z@
\else
+% \onpage{\testpageno}{\showboxbreadth=100 \showboxdepth=100 \showbox\currentcolumn}%
\hfil\setbox\z@=\vbox{
\getnextcolumn\unvbox\currentcolumn\kern-\dimen3
\vskip\adjskip
\hrule width\z@ height \dimen5 depth\z@
}%
- \ifnum\ht\z@>\baselineskip
+ \onpage{\testpageno}{\message{topskip: \the\topskip, adjskip: \the\adjskip, bottom rule: wd=0pt, ht=\the\dimen5, dp=0pt}}%
+ \onpage{\testpageno}{\message{splittopskip: \the\splittopskip}}%
+ \onpage{\testpageno}{\message{last box height (preadjustment): \the\ht0 }}%
+ \ifnum\ht\z@<\topskip%>\baselineskip is another option
+ \else
\setbox\z@=\vbox to \dimen\iflastpageup 6 \else \z@ \fi{\unvbox\z@}%
\fi
+ \onpage{\testpageno}{\message{last box height: \the\ht0 }}%
\wd\z@=\hsize
\box\z@
\fi
@@ -716,7 +817,198 @@
\fi
}
-% footnote counting macros
+% footnote accounting macros using aux stream
+
+\yyuniondeclare\fnoteunion{aux:global:fnotes}
+
+\defp\addfnlabel{}
+\defp\addpgendlabel#1{}
+\defp\setfniteration#1{}
+
+\toyyunion{aux:global:fnotes:neutral}
+
+\defc\addfnlabel{\expandafter\fnstream\expandafter{\the\fnstream*}}
+\defc\addpgendlabel#1{\expandafter\fnstream\expandafter{\the\fnstream|}}
+\defc\setfniteration#1{\fniteration=#1 }
+
+\toyyunion{aux:global:fnotes}
+
+\def\yyuniontag{\auxunionctl}
+\defp\fnoteunionctl{}% sequence to activate/deactivate/take other action for
+ % fnote set of macros
+
+\defc\fnoteunionctl{%
+ \restorecslist{aux:global:fnotes}\fnoteunion
+}
+\savecs{aux:global:activate}\fnoteunionctl
+
+\defc\fnoteunionctl{%
+ \restorecslist{aux:global:fnotes:neutral}\fnoteunion
+}
+\savecs{aux:global:deactivate}\fnoteunionctl
+
+\defc\fnoteunionctl{% this command should not make any page material contributions
+ \message{footnotes...}%
+ \fnstream{}%
+ \restorecslist{aux:global:deactivate}\auxunionctl
+ \auxunionctl % ignore all other sets
+ \restorecslist{aux:global:fnotes}\fnoteunion
+ \restorecs{aux:global:fnotes:neutral}\setfniteration
+ \input\jobname.aux
+ \edef\next{\the\fnstream}%
+ \checkfnprefixx{\savedfnstream}{\the\fnstream}%
+ {\message{Footnotes are stable ...}}%
+ {\message{Footnotes may be set incorrectly ...}}%
+}
+\savecs{aux:global:preend}\fnoteunionctl
+
+\defc\fnoteunionctl{% this command should not make any page material contributions
+ \message{footnotes...}%
+ \let\footthenotes\markbottomofpage
+ \edef\savedfnstream{\the\fnstream}%
+ \advance\fniteration by\@ne
+ \toksa\expandafter{\fnoteunion}%
+ \immediate\write\auxstream{\harmlesscomment\the\toksa}%
+ \immediate\write\auxstream{\noexpand\setfniteration{\the\fniteration}}%
+}
+\savecs{aux:global:prestart}\fnoteunionctl
+
+% end footnote accounting macros
+
+% text crossreferencing setup using the aux stream
+
+\yyuniondeclare\textrefunion{aux:global:textrefs}
+
+\defp\refanchor#1#2\end{}
+
+\toyyunion{aux:global:textrefs:neutral}
+
+\defc\refanchor#1#2\end{%
+ \expandafter\def\csname ref: #1\endcsname{#2}%
+}%
+
+\toyyunion{aux:global:textrefs}
+
+\def\yyuniontag{\auxunionctl}
+\defp\textrefunionctl{}% sequence to activate/deactivate/take other action for
+ % fnote set of macros
+
+\defc\textrefunionctl{%
+ \restorecslist{aux:global:textrefs}\textrefunion
+}
+\savecs{aux:global:activate}\textrefunionctl
+
+\defc\textrefunionctl{%
+ \restorecslist{aux:global:textrefs:neutral}\textrefunion
+}
+\savecs{aux:global:deactivate}\textrefunionctl
+
+\defc\textrefunionctl{% this command should not make any page material contributions
+ \message{text references...}%
+}
+\savecs{aux:global:preend}\textrefunionctl
+
+\defc\textrefunionctl{% this command should not make any page material contributions
+ \message{text references...}%
+ \toksa\expandafter{\textrefunion}%
+ \immediate\write\auxstream{\harmlesscomment\the\toksa}%
+}
+\savecs{aux:global:prestart}\textrefunionctl
+
+% end text cross referencing macros
+
+% macros for adding and using counters for referencing
+
+\def\volatile@counters{1(0){\errmessage{invalid counter!}}}
+\def\delayed@counters{1(0){\errmessage{invalid counter!}}}
+
+\def\addvcounter#1#2{% #1 is the name of the counter
+ % #2 is the access sequence
+ \counterattach\volatile@counters{#2}{#1}%
+}
+
+\def\adddcounter#1#2{% #1 is the name of the counter
+ % #2 is the access sequence
+ \counterattach\delayed@counters{#2}{#1}%
+}
+
+\def\counterattach#1#2{%
+ \expandafter\c@unterattach#1\end{#1}{#2}%
+}
+
+\def\c@unterattach#1(#2\end#3#4#5{% #1 is the counter top index
+ % #2 is the counter array
+ % #3 is the name of the counter array
+ % #4 is the access sequence of the new counter
+ % #5 is the name of the counter
+ \expandafter\def\expandafter#3\expandafter{\number\xincrement{#1}(#2(#1){#4}}% add the counter to the array
+ \expandafter\def\csname ct:\expandafter\eatone\string#3[#5]\endcsname{#1}% save counter index
+ \expandafter\def\csname get ct:\expandafter\eatone\string#3[#5]\endcsname##1(#1)##2##3\end{##2}%
+}
+
+\def\getcountervalue#1#2#3{% #1 is the name
+ % #2 is the name of the array
+ % #3 is the array instance
+ \csname get ct:\expandafter\eatone\string#2[#1]\endcsname#3\end
+}
+
+\addvcounter{section}{\secno}
+\adddcounter{page}{\the\pageno}
+
+\def\fulllabel#1{%
+ {%
+ \edef\next{\toksa{\volatile@counters}}\next % immediate references
+ \toksb\expandafter{\delayed@counters}% references to be processed at the page output stage
+ \edef\next{\write\auxstream{%
+ \string\refanchor{#1}\the\toksa\string\delayed\the\toksb\end}}\next
+ }%
+}
+
+\def\extractref#1{%
+ \ifx#1\relax
+ \yybreak{\ignoreref}%
+ \else
+ \yybreak{\expandafter\extractr@f#1}%
+ \yycontinue
+}%
+
+\def\ignoreref#1\end#2\end{{ref \bf ??}}
+
+\def\extractr@f#1\delayed#2\end#3#4\end{%
+ % #1 is the volatile counters
+ % #2 is the delayed counters
+ % #3 is text for the link
+ % #4 is the reference constructor (like \solrefcompose)
+ #4{#1}{#2}{#3}%
+}
+
+% end crossreferencing setup macros
+
+% helper macros to check if footnotes have been correctly placed
+\def\checkfnprefix#1#2{%
+ \expandafter\ch@ckfnprefix\romannumeral-0\yyprefixmatch{#1}{#2}%
+}
+
+\def\ch@ckfnprefix#1#2#3{% #1 is the common prefix, #2 and #3 are remainders
+ \yystringempty{#2}{%
+ \yyifrepeatedchar|{#3}{\yyfirstoftwo}{\yysecondoftwo}%
+ }{%
+ \yysecondoftwo
+ }
+}
+
+\def\checkfnprefixx#1#2{%
+ \expandafter\ch@ckfnprefixx\expandafter{#1}{#2}%
+}
+
+\def\ch@ckfnprefixx#1#2{%
+ \expandafter\ch@ckfnpr@fixx\expandafter{#2}{#1}%
+}
+
+\def\ch@ckfnpr@fixx#1#2{%
+ \checkfnprefix{#2}{#1}%
+}
+% end footnote prefix checking helper macros
\let\footthenotes\empty
@@ -742,78 +1034,14 @@
\vbox to \ht\z@{\box\@ne\vss}\box\z@
\fi}}
-\def\addfnlabel{\expandafter\fnstream\expandafter{\the\fnstream*}}
-\def\addpgendlabel{\expandafter\fnstream\expandafter{\the\fnstream|}}
-
-% the commands above will be exectuted when the .ftn file is loaded below
-
\newtoks\fnstream % locations of footnotes
\fnstream={}
-
-% before processing the footnotes one by one we have to open an
-% auxiliary file (we have to read it in whole because it will be
-% rewritten as the document is being typeset); this opening has to be
-% done carefully for the file might not be there yet; check for it first.
-% as a side note, one should not use the same stream number (at least the
-% one allocated by a \new... command) for both the input and the output
-% streams, since one might accidentally close a different stream that
-% happened to have the same index but allocated by a \new... command as a
-% stream of a different type.
-
-\newread\tryfnlabels % to check if the file exists
-\newwrite\fnlabels
\newcount\localfn % footnote count
-\newcount\fniteration
-
-\def\setupfootnotes{% this macro should be used at the beginning of the file, after a box (preferably)
- \let\footthenotes\markbottomofpage
- \openin\tryfnlabels=\jobname.ftn\relax
- \ifeof\tryfnlabels
- \closein\tryfnlabels\relax
- \fniteration\z@
- \else
- \closein\tryfnlabels\relax
- \input \jobname.ftn\relax
- \fi
- \edef\savedfnstream{\the\fnstream}%
- % now we open the same file for writing ...
- \openout\fnlabels=\jobname.ftn\relax
- \advance\fniteration\@ne
- \write\fnlabels{\noexpand\fniteration\the\fniteration\space}%
-}
+\newcount\fniteration % current footnote calculation iteration count
+\fniteration\z@
\def\markbottomofpage{%
- \write\fnlabels{\noexpand\addpgendlabel}%
-}
-
-\def\unsetfootnotes{%
- \def\footthenotes{%
- \write\fnlabels{\noexpand\endinput}%
- \closeout\fnlabels
- \global\let\footthenotes\checkfootnotestream%
- % it is tempting to say \input \jobname.ftn
- % at this point to use in the test below but this is not
- % going to work: the \closeout will get invoked during the
- % \shipout, which happens after the page is set and these
- % macros are expanded.
- % note that using another `stream' sequence for this purpose
- % would not work either, since a footnote at the bottom of the
- % page might `fire' but would be put on the next page by
- % the epage builder.
- }%
-}
-
-\def\checkfootnotestream{% this needs at least one extra page to work correctly ...
- \fnstream{}%
- \input\jobname.ftn
- \edef\next{\the\fnstream}%
- \ifx\next\savedfnstream
- \message{Footnotes are stable ...}%
- \else % this test is too strict, a better way would be to check that
- % \next is a prefix in \savedfnstream and the remaining characters are all `|'
- \message{Footnotes may be set incorrectly ...}%
- \fi
- \global\let\footthenotes\empty
+ \write\auxstream{\noexpand\addpgendlabel{\the\pageno}\harmlesscomment\space bottom of page \the\pageno}%
}
\def\setfnmark{{%
@@ -826,13 +1054,14 @@
\fi
\fi
\removewhitespace\kern2pt\fnmark\localfn
- \write\fnlabels{\noexpand\addfnlabel}%
+ \write\auxstream{\noexpand\addfnlabel}%
}}
\def\getfntok{\loop\splitfnstream\if|\nexttok\global\localfn=\z@ \repeat}
-\def\splitfnstream{\edef\tempdefone{\the\fnstream}%
- \ifx\tempdefone\empty
+\def\splitfnstream{%
+ \edef\tempdefone{\the\fnstream}%
+ \ifx\tempdefone\empty % no footnote tokens left, although we are expecting one
\def\nexttok{?}\message{You may have to reposition the footnotes ...}%
\else
\expandafter\splitfnstre@m\tempdefone\end
@@ -840,4 +1069,3 @@
}
\def\splitfnstre@m#1#2\end{\def\nexttok{#1}\global\fnstream={#2}}
-
diff --git a/support/splint/tex/flex.sty b/support/splint/tex/flex.sty
index 59e23785b3..3008bfcb38 100644
--- a/support/splint/tex/flex.sty
+++ b/support/splint/tex/flex.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -40,8 +40,6 @@
}
\newif\ifyylessused
-\newtoks\yylesslastformat
-\newtoks\yylesslaststash
\newcount\yylesslastfmark
\newcount\yylesslastsmark
\newcount\yylesslastchar
@@ -55,8 +53,6 @@
\advance\yycurrentstate\YYATBOL % yy_current_state += YY_AT_BOL();
% save the format and stash streams for \yyless
\ifyylessused
- \yylesslastformat\yyformat
- \yylesslaststash\yystash
\yylesslastfmark\yyfmark
\yylesslastsmark\yysmark
\yylesslastchar\yytextlastchar
@@ -67,23 +63,38 @@
\newif\ifyytextbackup
\newif\iftraceflexbuffers
-\def\yymatch{%
- \ifyytextbackup
- \xskiptofi\yyreinput
- \else
- \xskiptofi\yyinput
- \fi
-}
-
-\def\yyreinput{\expandafter\yyresetstreams\expandafter\yyinput\the\yytext@seen}
+% an implementation of \yymatch with a low level command \yyreadinput
+% that allows for a general input routine to be used at the beginning of the input
+% buffer (see an example of using \yyreadinput in \ldcleanyyeof macro in ldlex.w)
\def\yyresetstreams{%
- \iftraceflexbuffers\ferrmessage{will rescan: <\the\yytext@seen> (stash: \the\yystashseen)}\fi
+ \iftraceflexbuffers\ferrmessage{will rescan: <\the\yytext@seen>}\fi
\yytextseen{}\yytext@seen{}\yytextseenpure{}%
- \yyformatseen{}\yystashseen{}%
\yytextbackupfalse
}
+\def\yyreadinput#1#2{%
+ \expandafter\yyre@dinput\expandafter{#2}{#1}%
+}
+
+\def\yyre@dinput#1#2{%
+ #2#1%
+}
+
+\def\yyr@@dinput{%
+ \ifyytextbackup
+ \yybreak{\expandafter{\the\yytext@seen}{\yyresetstreams}}%
+ \else
+ \yybreak{{}{}}%
+ \yycontinue
+}
+
+\def\yyr@@dinp@t#1#2{%
+ #2\yyinput#1%
+}
+
+\def\yymatch{\yyreadinput{\yyr@@dinp@t}{\romannumeral0\yyr@@dinput}}
+
% \yym@tch is the return point from the low-level input routine
\def\yym@tch{% do {
@@ -93,20 +104,17 @@
\ifyyflexdebug\ferrmessage{match action: \the\yyact\space(yytext: \the\yytext@:^^Jyytextseen: \the\yytext@seen>\the\yybyte)}\fi
\ifnum\yyact=\z@ % if ( yy_accept[yy_current_state] ) {
\else %
- \ifyyflexdebug\ferrmessage{yym@tch: stash seen: \the\yystashseen^^Jsmark: \the\yysmarklast}\fi
+ \ifyyflexdebug\ferrmessage{yym@tch: smark: \the\yysmarklast}\fi
\yyg@yylastacceptingstate=\yycurrentstate % yyg->yy_last_accepting_state = yy_current_state;
\concat\yytext\yytextseen % yyg->yy_last_accepting_cpos = yy_cp;
\concat\yytext@\yytext@seen % ... ...
\concat\yytextpure\yytextseenpure % ... ...
- \concat\yyformat\yyformatseen % ... ...
- \concat\yystash\yystashseen % ... ...
\yytextlastchar=\yytextseenlastchar %
\yyfmark=\yyfmarklast % ... ...
\yysmark=\yysmarklast % ... ...
\yyfmark@accept=\yyfmark
\yysmark@accept=\yysmark
\yytextseen={}\yytext@seen={}\yytextseenpure{}%
- \yyformatseen{}\yystashseen{}%
\fi % }
\yyllwhile
}
@@ -136,19 +144,17 @@
\yycurrentstate=\fgetelemof{yybase}\at\yycurrentstate\relax
\advance\yycurrentstate\yyc %
\yycurrentstate=\fgetelemof{yynxt}\at\yycurrentstate\relax
- \ifyyflexdebug\ferrmessage{yysubtext: (\the\yysubtext),^^Jyysbyte: (\the\yysbyte),^^Jyybyte: (\the\yybyte)}\fi
+ \ifyyflexdebug\ferrmessage{yysubtext: (\the\yysubtext),^^Jyybyte: (\the\yybyte)}\fi
% yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
\concat\yytextseen\yybyte % ++yy_cp;
\concat\yytext@seen\yysubtext \yysubtext{}% % ...
\concat\yytext@seen\yybyte % ...
\concat\yytextseenpure\yybytepure % ...
- \concat\yyformatseen\yyfbyte \yyfbyte{}% % ...
- \concat\yystashseen\yysbyte \yysbyte{}% % ...
\yytextseenlastchar=\yycp@ %
\yyfmarklast=\formatmarker % ...
\yysmarklast=\stashmarker % ...
\yyact=\fgetelemof{yybase}\at\yycurrentstate\relax % ... reusing \yyact ( yy_act = yy_base[yy_current_state] )
- \ifyyflexdebug\ferrmessage{matching the rest: <\the\yytext@seen>^^J(stash: \the\yystash:^^J\the\yystashseen)}\fi
+ \ifyyflexdebug\ferrmessage{matching the rest: <\the\yytext@seen>}\fi
\ifnum\yyact=\YYBASEMAXENTRY\relax % } while ( yy_base[yy_current_state] != max( yy_base ) );
\ifyyflexdebug\ferrmessage{looking for the action}\fi
\yybreak\yyfindaction % ... if ( yy_base[yy_current_state] == max( yy_base ) ) goto yy_find_action;
@@ -177,21 +183,17 @@
\concat\yytext\yytextseen
\concat\yytext@\yytext@seen
\concat\yytextpure\yytextseenpure
- \concat\yyformat\yyformatseen
- \concat\yystash\yystashseen
\yytextlastchar=\yytextseenlastchar
\yyfmark=\yyfmarklast % == \formatmarker
\yysmark=\yysmarklast % == \stashmarker
\yytextseen{}\yytext@seen{}\yytextseenpure{}%
- \yyformatseen{}\yystashseen{}%
%
\fi % }
\YYDOBEFOREACTION % YY_DO_BEFORE_ACTION;
\ifyyflexdebug
\ferrmessage{action: \the\yyact,^^J%
- state: \the\yycurrentstate\space(\the\yytext@:\the\yytext@seen)^^J%
- stash: \the\yystash:\the\yystashseen^^J%
- yysbyte: \the\yysbyte}%
+ state: \the\yycurrentstate\space(\the\yytext@:\the\yytext@seen)%
+ }%
\fi
\doaction
}
@@ -322,7 +324,6 @@
\stashmarker=\yysmark@accept
\yyfmarklast=\formatmarker
\yysmarklast=\stashmarker
- \yyformatseen{}\yystashseen{}%
\let\yyreturn\yygetpreviousstatef@r
\yyinput
}
@@ -368,8 +369,6 @@
\yybyte{}\yybytepure{}%
\yyfmarklast=\formatmarker
\yysmarklast=\stashmarker
- \concat\yyformatseen\yyfbyte \yyfbyte{}%
- \concat\yystashseen\yysbyte \yysbyte{}%
\else %
\ifyyflexdebug
\ferrmessage{possible accepting state.: \the\yycurrentstatelocal:%
@@ -393,10 +392,6 @@
\yysmark@accept=\yysmark
\yyfmarklast=\formatmarker
\yysmarklast=\stashmarker
- \concat\yyformat\yyformatseen
- \concat\yystash\yystashseen
- \yyformatseen\yyfbyte\yyfbyte{}%
- \yystashseen\yysbyte\yysbyte{}%
\fi
\yygpswhile
}
@@ -465,8 +460,6 @@
\concat\yytextpure\yybytepure
\yybyte{}\yybytepure{}%
\yytextseen{}\yytext@seen{}\yytextseenpure{}%
- \concat\yyformat\yyformatseen\yyformatseen{}%
- \concat\yystash\yystashseen\yystashseen{}%
\yytextlastchar=\yytextseenlastchar
\yyfmark=\yyfmarklast
\yysmark=\yysmarklast
@@ -577,40 +570,25 @@
\def\yylexreturnval#1{% return value (yytext) only
\yychar\csname token\parsernamespace #1\endcsname\relax
- \yylval\expandafter{\expandafter{\the\yytext}}%
- \yylval\expandafter\expandafter\expandafter{\expandafter\the\expandafter\yylval\expandafter{\the\yytextpure}}%
- % the above is an equivalent of
- % \edef\next{\yylval{{\the\yytext}{\the\yytextpure}}}\next
- % but does not `pollute' the definition of \next
+ {\edef\next{\yylval{{\the\yytext}{\the\yytextpure}}}\expandafter}\next
\yytext{}\yytext@{}\yytextpure{}\let\yylextail\yyparsetail
}
\def\yylexreturnptr#1{% return stream pointers only
- \yylval\expandafter{\expandafter{\the\yyfmark}}%
- \yylval\expandafter\expandafter\expandafter{\expandafter\the\expandafter\yylval\expandafter{\the\yysmark}}%
- % the above is an equivalent of
- % \edef\next{\yylval{{\the\yyfmark}{\the\yysmark}}}\next
- % but does not `pollute' the definition of \next
+ {\edef\next{\yylval{{\the\yyfmark}{\the\yysmark}}}\expandafter}\next
\yylexreturn{#1}%
}
+\def\yylexreturntext{\yylexreturnptr{\the\yytextpure}}
+
\def\yylexreturnsym#1{% return the value (yytext) followed by the pointers
\yychar\csname token\parsernamespace #1\endcsname\relax
- \yylval\expandafter{\expandafter{\the\yytext}}%
- \yylval\expandafter\expandafter\expandafter{\expandafter\the\expandafter\yylval\expandafter{\the\yytextpure}}%
- \yylval\expandafter\expandafter\expandafter{\expandafter\the\expandafter\yylval\expandafter{\the\yyfmark}}%
- \yylval\expandafter\expandafter\expandafter{\expandafter\the\expandafter\yylval\expandafter{\the\yysmark}}%
- % the above is an equivalent of
- % \edef\next{\yylval{{\the\yytext}{\the\yytextpure}{\the\yyfmark}{\the\yysmark}}}\next
- % but does not `pollute' the definition of \next
+ {\edef\next{\yylval{{\the\yytext}{\the\yytextpure}{\the\yyfmark}{\the\yysmark}}}\expandafter}\next
\yytext{}\yytext@{}\yytextpure{}\let\yylextail\yyparsetail
}
-\def\yylexreturntext{\yylexreturnptr{\the\yytextpure}}
-
\def\yylexreturnraw#1{% return the character, pointers as the value
- \yylval\expandafter{\expandafter{\the\yyfmark}}%
- \yylval\expandafter\expandafter\expandafter{\expandafter\the\expandafter\yylval\expandafter{\the\yysmark}}%
+ {\edef\next{\yylval{{\the\yyfmark}{\the\yysmark}}}\expandafter}\next
\yychar`#1\relax
\yytext{}\yytext@{}\yytextpure{}\let\yylextail\yyparsetail
}
@@ -620,8 +598,7 @@
}
\def\yylexreturnxchar#1{% return the numeric value, pointers as the value
- \yylval\expandafter{\expandafter{\the\yyfmark}}%
- \yylval\expandafter\expandafter\expandafter{\expandafter\the\expandafter\yylval\expandafter{\the\yysmark}}%
+ {\edef\next{\yylval{{\the\yyfmark}{\the\yysmark}}}\expandafter}\next
\yychar#1\relax
\yytext{}\yytext@{}\yytextpure{}\let\yylextail\yyparsetail
}
@@ -629,10 +606,16 @@
\def\yylexnext{\yytext{}\yytext@{}\yytextpure{}} % use this with a trivial \yylexcontinue
\let\yylexnext\empty
-\def\yyterminate{\yychar\YYEOF\yylval{}\yytext{}\yytext@{}\yytextpure{}\let\yylextail\yyparsetail}
-
-\def\yyerrterminate{\yylexreturn{$undefined}} %$
+\def\yyterminate{\yychar\z@\yylval{}\yytext{}\yytext@{}\yytextpure{}\let\yylextail\yyparsetail}
+\def\yyerrterminate{%
+ \expandafter\ifx\csname token\parsernamespace $undefined\endcsname\relax
+ \yybreak{\yylexreturn{"invalid token"}}%
+ \else
+ \yybreak{\yylexreturn{$undefined}}%$
+ \yycontinue
+}
+
\def\yyfatal#1{\yycomplain{#1}\yyerrterminate}
\def\yywarn#1{\yycomplain{#1}\yylexnext}
@@ -654,23 +637,14 @@
}
\def\yyless@backup{%
- \yyformat\yylesslastformat
- \yystash\yylesslaststash
- \yysbyte{}\yyfbyte{}%
\formatmarker\yylesslastfmark
\stashmarker\yylesslastsmark
}
-\def\yyless@updatestreams{%
- \concat\yyformat\yyfbyte\yyfbyte{}%
- \concat\yystash\yysbyte\yysbyte{}%
-}
-
\def\yyskipnchars#1{%
\ifnum\yycp@=\YYENDOFBUFFERCHAR % read \yyeof
\yycomplain{yyless buffer overflow: #1 characters too many}%
\else
- \yyless@updatestreams
\ifnum#1=\@ne % skipped the required number of tokens
\yybreak@\yyl@ss
\else
@@ -683,8 +657,6 @@
\def\yyl@ss#1\yyeof{%
\yyfmark=\formatmarker
\yysmark=\stashmarker
- \yylesslaststash\yystash
- \yylesslastformat\yyformat
\unput{#1}%
\let\yyreturn\oldyyreturn
}
diff --git a/support/splint/tex/fonts/idssbx10.vpl b/support/splint/tex/fonts/idssbx10.vpl
new file mode 100644
index 0000000000..62d6291a24
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx10.vpl
@@ -0,0 +1,911 @@
+(FAMILY CMSSBX)
+(FACE O 352)
+(CODINGSCHEME TEX TEXT)
+(DESIGNSIZE R 10.0)
+(COMMENT DESIGNSIZE IS IN POINTS)
+(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
+(CHECKSUM O 36132640510)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.366669)
+ (STRETCH R 0.183334)
+ (SHRINK R 0.122223)
+ (XHEIGHT R 0.458333)
+ (QUAD R 1.100006)
+ (EXTRASPACE R 0.122223)
+ )
+(LIGTABLE
+ (LABEL O 40)
+ (KRN C l R -0.255557)
+ (KRN C L R -0.293057)
+ (STOP)
+ (LABEL C f)
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ (STOP)
+ (LABEL O 13)
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ (STOP)
+ (LABEL O 140)
+ (LIG O 140 O 134)
+ (STOP)
+ (LABEL O 47)
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ (STOP)
+ (LABEL O 55)
+ (LIG O 55 O 173)
+ (STOP)
+ (LABEL O 173)
+ (LIG O 55 O 174)
+ (STOP)
+ (LABEL O 41)
+ (LIG O 140 O 74)
+ (STOP)
+ (LABEL O 77)
+ (LIG O 140 O 76)
+ (STOP)
+ (LABEL C k)
+ (LABEL C w)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ (STOP)
+ (LABEL C P)
+ (KRN C A R -0.091667)
+ (LABEL C y)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ (STOP)
+ (LABEL C F)
+ (LABEL C V)
+ (LABEL C W)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (LABEL C K)
+ (LABEL C X)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ (STOP)
+ (LABEL C T)
+ (KRN C y R -0.091667)
+ (LABEL C Y)
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ (STOP)
+ (LABEL C D)
+ (LABEL C O)
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ (STOP)
+ (LABEL C b)
+ (LABEL C o)
+ (LABEL C p)
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (LABEL C a)
+ (KRN C r R -0.030556)
+ (LABEL C t)
+ (KRN C y R -0.030556)
+ (LABEL C u)
+ (KRN C w R -0.030556)
+ (STOP)
+ (LABEL C A)
+ (KRN C t R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C O R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C U R -0.030556)
+ (KRN C Q R -0.030556)
+ (LABEL C L)
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ (STOP)
+ (LABEL C g)
+ (KRN C j R 0.030556)
+ (STOP)
+ (LABEL C I)
+ (KRN C I R 0.030556)
+ (STOP)
+ )
+(CHARACTER O 0
+ (CHARWD R 0.580559)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 1
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 2
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 3
+ (CHARWD R 0.672226)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 4
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 5
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 6
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 7
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 10
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 11
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 12
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 13
+ (CHARWD R 0.64167)
+ (CHARHT R 0.694445)
+ (CHARIC R 0.07639)
+ (COMMENT
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ )
+ )
+(CHARACTER O 14
+ (CHARWD R 0.586115)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 15
+ (CHARWD R 0.586115)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 16
+ (CHARWD R 0.891672)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 17
+ (CHARWD R 0.891672)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 20
+ (CHARWD R 0.255557)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER O 21
+ (CHARWD R 0.286113)
+ (CHARHT R 0.458333)
+ (CHARDP R 0.194445)
+ )
+(CHARACTER O 22
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 23
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 24
+ (CHARWD R 0.550003)
+ (CHARHT R 0.635417)
+ )
+(CHARACTER O 25
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 26
+ (CHARWD R 0.550003)
+ (CHARHT R 0.637776)
+ )
+(CHARACTER O 27
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 30
+ (CHARWD R 0.488892)
+ (CHARDP R 0.170138)
+ )
+(CHARACTER O 31
+ (CHARWD R 0.56528)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 32
+ (CHARWD R 0.794449)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER O 33
+ (CHARWD R 0.85556)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER O 34
+ (CHARWD R 0.550003)
+ (CHARHT R 0.555555)
+ (CHARDP R 0.097223)
+ )
+(CHARACTER O 35
+ (CHARWD R 0.9472275)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 36
+ (CHARWD R 1.06945)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 37
+ (CHARWD R 0.85556)
+ (CHARHT R 0.743055)
+ (CHARDP R 0.048612)
+ )
+(CHARACTER O 40
+ (CHARWD R 0.255557)
+ (CHARHT R 0.458333)
+ (COMMENT
+ (KRN C l R -0.255557)
+ (KRN C L R -0.293057)
+ )
+ )
+(CHARACTER O 41
+ (CHARWD R 0.366669)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (LIG O 140 O 74)
+ )
+ )
+(CHARACTER O 42
+ (CHARWD R 0.558336)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 43
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694445)
+ (CHARDP R 0.194443)
+ )
+(CHARACTER O 44
+ (CHARWD R 0.550003)
+ (CHARHT R 0.75)
+ (CHARDP R 0.055555)
+ )
+(CHARACTER O 45
+ (CHARWD R 1.029119)
+ (CHARHT R 0.75)
+ (CHARDP R 0.055555)
+ )
+(CHARACTER O 46
+ (CHARWD R 0.830561)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 47
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ )
+ )
+(CHARACTER O 50
+ (CHARWD R 0.42778)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER O 51
+ (CHARWD R 0.42778)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER O 52
+ (CHARWD R 0.550003)
+ (CHARHT R 0.75)
+ )
+(CHARACTER O 53
+ (CHARWD R 0.85556)
+ (CHARHT R 0.616669)
+ (CHARDP R 0.116669)
+ )
+(CHARACTER O 54
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130556)
+ (CHARDP R 0.105556)
+ )
+(CHARACTER O 55
+ (CHARWD R 0.366669)
+ (CHARHT R 0.458333)
+ (COMMENT
+ (LIG O 55 O 173)
+ )
+ )
+(CHARACTER O 56
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130556)
+ )
+(CHARACTER O 57
+ (CHARWD R 0.550003)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER C 0
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C 1
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C 2
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C 3
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C 4
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C 5
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C 6
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C 7
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C 8
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C 9
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 72
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER O 73
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458333)
+ (CHARDP R 0.105556)
+ )
+(CHARACTER O 74
+ (CHARWD R 0.366669)
+ (CHARHT R 0.5)
+ (CHARDP R 0.194445)
+ )
+(CHARACTER O 75
+ (CHARWD R 0.85556)
+ (CHARHT R 0.40625)
+ (CHARDP R -0.09375)
+ )
+(CHARACTER O 76
+ (CHARWD R 0.519447)
+ (CHARHT R 0.5)
+ (CHARDP R 0.194445)
+ )
+(CHARACTER O 77
+ (CHARWD R 0.519447)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (LIG O 140 O 76)
+ )
+ )
+(CHARACTER O 100
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C A
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C t R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C O R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C U R -0.030556)
+ (KRN C Q R -0.030556)
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ )
+(CHARACTER C B
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C C
+ (CHARWD R 0.702782)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C D
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ )
+ )
+(CHARACTER C E
+ (CHARWD R 0.64167)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C F
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C G
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C H
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C I
+ (CHARWD R 0.330557)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C I R 0.030556)
+ )
+ )
+(CHARACTER C J
+ (CHARWD R 0.519447)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C K
+ (CHARWD R 0.763893)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C L
+ (CHARWD R 0.580559)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ )
+(CHARACTER C M
+ (CHARWD R 0.977783)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C N
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C O
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ )
+ )
+(CHARACTER C P
+ (CHARWD R 0.702782)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C A R -0.091667)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ )
+ )
+(CHARACTER C Q
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694445)
+ (CHARDP R 0.105556)
+ )
+(CHARACTER C R
+ (CHARWD R 0.702782)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C S
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C T
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C y R -0.091667)
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ )
+ )
+(CHARACTER C U
+ (CHARWD R 0.763893)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C V
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C W
+ (CHARWD R 1.038895)
+ (CHARHT R 0.694445)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C X
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C Y
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694445)
+ (CHARIC R 0.027499)
+ (COMMENT
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ )
+ )
+(CHARACTER C Z
+ (CHARWD R 0.672226)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 133
+ (CHARWD R 0.343058)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER O 134
+ (CHARWD R 0.558336)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 135
+ (CHARWD R 0.343058)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER O 136
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 137
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 140
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (LIG O 140 O 134)
+ )
+ )
+(CHARACTER C a
+ (CHARWD R 0.525003)
+ (CHARHT R 0.458333)
+ (COMMENT
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C b
+ (CHARWD R 0.561114)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C c
+ (CHARWD R 0.488892)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER C d
+ (CHARWD R 0.561114)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C e
+ (CHARWD R 0.511114)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER C f
+ (CHARWD R 0.336113)
+ (CHARHT R 0.694445)
+ (CHARIC R 0.07639)
+ (COMMENT
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ )
+ )
+(CHARACTER C g
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458333)
+ (CHARDP R 0.194445)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C j R 0.030556)
+ )
+ )
+(CHARACTER C h
+ (CHARWD R 0.561114)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C i
+ (CHARWD R 0.255557)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C j
+ (CHARWD R 0.286113)
+ (CHARHT R 0.694445)
+ (CHARDP R 0.194445)
+ )
+(CHARACTER C k
+ (CHARWD R 0.530559)
+ (CHARHT R 0.694445)
+ (COMMENT
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ )
+ )
+(CHARACTER C l
+ (CHARWD R 0.255557)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER C m
+ (CHARWD R 0.866672)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER C n
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER C o
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458333)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C p
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458333)
+ (CHARDP R 0.194445)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C q
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458333)
+ (CHARDP R 0.194445)
+ )
+(CHARACTER C r
+ (CHARWD R 0.372225)
+ (CHARHT R 0.458333)
+ (CHARIC R 0.015279)
+ )
+(CHARACTER C s
+ (CHARWD R 0.421669)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER C t
+ (CHARWD R 0.404169)
+ (CHARHT R 0.589289)
+ (COMMENT
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C u
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458333)
+ (COMMENT
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C v
+ (CHARWD R 0.500003)
+ (CHARHT R 0.458333)
+ (CHARIC R 0.015279)
+ )
+(CHARACTER C w
+ (CHARWD R 0.744449)
+ (CHARHT R 0.458333)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ )
+ )
+(CHARACTER C x
+ (CHARWD R 0.500003)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER C y
+ (CHARWD R 0.500003)
+ (CHARHT R 0.458333)
+ (CHARDP R 0.194445)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ )
+ )
+(CHARACTER C z
+ (CHARWD R 0.476392)
+ (CHARHT R 0.458333)
+ )
+(CHARACTER O 173
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458333)
+ (CHARIC R 0.030556)
+ (COMMENT
+ (LIG O 55 O 174)
+ )
+ )
+(CHARACTER O 174
+ (CHARWD R 1.100006)
+ (CHARHT R 0.458333)
+ (CHARIC R 0.030556)
+ )
+(CHARACTER O 175
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 176
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
+(CHARACTER O 177
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694445)
+ )
diff --git a/support/splint/tex/fonts/idssbx12.vpl b/support/splint/tex/fonts/idssbx12.vpl
new file mode 100644
index 0000000000..5d613d3827
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx12.vpl
@@ -0,0 +1,908 @@
+(DESIGNSIZE R 12.0)
+(COMMENT DESIGNSIZE IS IN POINTS)
+(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
+(CHECKSUM O 11763521146)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.366669)
+ (STRETCH R 0.183334)
+ (SHRINK R 0.122223)
+ (XHEIGHT R 0.458332)
+ (QUAD R 1.100006)
+ (EXTRASPACE R 0.122223)
+ )
+(LIGTABLE
+ (LABEL O 40)
+ (KRN C l R -0.255557)
+ (KRN C L R -0.2930565)
+ (STOP)
+ (LABEL C f)
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ (STOP)
+ (LABEL O 13)
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ (STOP)
+ (LABEL O 140)
+ (LIG O 140 O 134)
+ (STOP)
+ (LABEL O 47)
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ (STOP)
+ (LABEL O 55)
+ (LIG O 55 O 173)
+ (STOP)
+ (LABEL O 173)
+ (LIG O 55 O 174)
+ (STOP)
+ (LABEL O 41)
+ (LIG O 140 O 74)
+ (STOP)
+ (LABEL O 77)
+ (LIG O 140 O 76)
+ (STOP)
+ (LABEL C k)
+ (LABEL C w)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ (STOP)
+ (LABEL C P)
+ (KRN C A R -0.091667)
+ (LABEL C y)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ (STOP)
+ (LABEL C F)
+ (LABEL C V)
+ (LABEL C W)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (LABEL C K)
+ (LABEL C X)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ (STOP)
+ (LABEL C T)
+ (KRN C y R -0.091667)
+ (LABEL C Y)
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ (STOP)
+ (LABEL C D)
+ (LABEL C O)
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ (STOP)
+ (LABEL C b)
+ (LABEL C o)
+ (LABEL C p)
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (LABEL C a)
+ (KRN C r R -0.030556)
+ (LABEL C t)
+ (KRN C y R -0.030556)
+ (LABEL C u)
+ (KRN C w R -0.030556)
+ (STOP)
+ (LABEL C A)
+ (KRN C t R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C O R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C U R -0.030556)
+ (KRN C Q R -0.030556)
+ (LABEL C L)
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ (STOP)
+ (LABEL C g)
+ (KRN C j R 0.030556)
+ (STOP)
+ (LABEL C I)
+ (KRN C I R 0.030556)
+ (STOP)
+ )
+(CHARACTER O 0
+ (CHARWD R 0.580559)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 1
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 2
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 3
+ (CHARWD R 0.672226)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 4
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 5
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 6
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 7
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 10
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 11
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 12
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 13
+ (CHARWD R 0.64167)
+ (CHARHT R 0.694443)
+ (CHARIC R 0.076389)
+ (COMMENT
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ )
+ )
+(CHARACTER O 14
+ (CHARWD R 0.586114)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 15
+ (CHARWD R 0.586114)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 16
+ (CHARWD R 0.891671)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 17
+ (CHARWD R 0.891671)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 20
+ (CHARWD R 0.255557)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER O 21
+ (CHARWD R 0.286113)
+ (CHARHT R 0.458332)
+ (CHARDP R 0.194444)
+ )
+(CHARACTER O 22
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 23
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 24
+ (CHARWD R 0.550003)
+ (CHARHT R 0.635415)
+ )
+(CHARACTER O 25
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 26
+ (CHARWD R 0.550003)
+ (CHARHT R 0.637775)
+ )
+(CHARACTER O 27
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 30
+ (CHARWD R 0.488892)
+ (CHARDP R 0.170138)
+ )
+(CHARACTER O 31
+ (CHARWD R 0.565278)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 32
+ (CHARWD R 0.794449)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER O 33
+ (CHARWD R 0.85556)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER O 34
+ (CHARWD R 0.550003)
+ (CHARHT R 0.555554)
+ (CHARDP R 0.097222)
+ )
+(CHARACTER O 35
+ (CHARWD R 0.9472275)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 36
+ (CHARWD R 1.06945)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 37
+ (CHARWD R 0.85556)
+ (CHARHT R 0.743053)
+ (CHARDP R 0.048611)
+ )
+(CHARACTER O 40
+ (CHARWD R 0.255557)
+ (CHARHT R 0.458332)
+ (COMMENT
+ (KRN C l R -0.255557)
+ (KRN C L R -0.2930565)
+ )
+ )
+(CHARACTER O 41
+ (CHARWD R 0.366669)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (LIG O 140 O 74)
+ )
+ )
+(CHARACTER O 42
+ (CHARWD R 0.558335)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 43
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694443)
+ (CHARDP R 0.194443)
+ )
+(CHARACTER O 44
+ (CHARWD R 0.550003)
+ (CHARHT R 0.749999)
+ (CHARDP R 0.055556)
+ )
+(CHARACTER O 45
+ (CHARWD R 1.029117)
+ (CHARHT R 0.749999)
+ (CHARDP R 0.055556)
+ )
+(CHARACTER O 46
+ (CHARWD R 0.83056)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 47
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ )
+ )
+(CHARACTER O 50
+ (CHARWD R 0.42778)
+ (CHARHT R 0.749999)
+ (CHARDP R 0.249997)
+ )
+(CHARACTER O 51
+ (CHARWD R 0.42778)
+ (CHARHT R 0.749999)
+ (CHARDP R 0.249997)
+ )
+(CHARACTER O 52
+ (CHARWD R 0.550003)
+ (CHARHT R 0.749999)
+ )
+(CHARACTER O 53
+ (CHARWD R 0.85556)
+ (CHARHT R 0.616669)
+ (CHARDP R 0.116669)
+ )
+(CHARACTER O 54
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130555)
+ (CHARDP R 0.105556)
+ )
+(CHARACTER O 55
+ (CHARWD R 0.366669)
+ (CHARHT R 0.458332)
+ (COMMENT
+ (LIG O 55 O 173)
+ )
+ )
+(CHARACTER O 56
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130555)
+ )
+(CHARACTER O 57
+ (CHARWD R 0.550003)
+ (CHARHT R 0.749999)
+ (CHARDP R 0.249997)
+ )
+(CHARACTER C 0
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C 1
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C 2
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C 3
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C 4
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C 5
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C 6
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C 7
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C 8
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C 9
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 72
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER O 73
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458332)
+ (CHARDP R 0.105556)
+ )
+(CHARACTER O 74
+ (CHARWD R 0.366669)
+ (CHARHT R 0.499999)
+ (CHARDP R 0.194444)
+ )
+(CHARACTER O 75
+ (CHARWD R 0.85556)
+ (CHARHT R 0.40625)
+ (CHARDP R -0.09375)
+ )
+(CHARACTER O 76
+ (CHARWD R 0.519447)
+ (CHARHT R 0.499999)
+ (CHARDP R 0.194444)
+ )
+(CHARACTER O 77
+ (CHARWD R 0.519447)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (LIG O 140 O 76)
+ )
+ )
+(CHARACTER O 100
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C A
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C t R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C O R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C U R -0.030556)
+ (KRN C Q R -0.030556)
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ )
+(CHARACTER C B
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C C
+ (CHARWD R 0.702782)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C D
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ )
+ )
+(CHARACTER C E
+ (CHARWD R 0.64167)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C F
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C G
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C H
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C I
+ (CHARWD R 0.330556)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C I R 0.030556)
+ )
+ )
+(CHARACTER C J
+ (CHARWD R 0.519447)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C K
+ (CHARWD R 0.763893)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C L
+ (CHARWD R 0.580559)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ )
+(CHARACTER C M
+ (CHARWD R 0.977783)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C N
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C O
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ )
+ )
+(CHARACTER C P
+ (CHARWD R 0.702782)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C A R -0.091667)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ )
+ )
+(CHARACTER C Q
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694443)
+ (CHARDP R 0.105556)
+ )
+(CHARACTER C R
+ (CHARWD R 0.702782)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C S
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C T
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C y R -0.091667)
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ )
+ )
+(CHARACTER C U
+ (CHARWD R 0.763893)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C V
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C W
+ (CHARWD R 1.038895)
+ (CHARHT R 0.694443)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C X
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ )
+(CHARACTER C Y
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694443)
+ (CHARIC R 0.0275)
+ (COMMENT
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ )
+ )
+(CHARACTER C Z
+ (CHARWD R 0.672226)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 133
+ (CHARWD R 0.343057)
+ (CHARHT R 0.749999)
+ (CHARDP R 0.249997)
+ )
+(CHARACTER O 134
+ (CHARWD R 0.558335)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 135
+ (CHARWD R 0.343057)
+ (CHARHT R 0.749999)
+ (CHARDP R 0.249997)
+ )
+(CHARACTER O 136
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 137
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 140
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (LIG O 140 O 134)
+ )
+ )
+(CHARACTER C a
+ (CHARWD R 0.5250025)
+ (CHARHT R 0.458332)
+ (COMMENT
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C b
+ (CHARWD R 0.561114)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C c
+ (CHARWD R 0.488892)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER C d
+ (CHARWD R 0.561114)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C e
+ (CHARWD R 0.511113)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER C f
+ (CHARWD R 0.336113)
+ (CHARHT R 0.694443)
+ (CHARIC R 0.076389)
+ (COMMENT
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ )
+ )
+(CHARACTER C g
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458332)
+ (CHARDP R 0.194444)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C j R 0.030556)
+ )
+ )
+(CHARACTER C h
+ (CHARWD R 0.561114)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C i
+ (CHARWD R 0.255557)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C j
+ (CHARWD R 0.286113)
+ (CHARHT R 0.694443)
+ (CHARDP R 0.194444)
+ )
+(CHARACTER C k
+ (CHARWD R 0.530559)
+ (CHARHT R 0.694443)
+ (COMMENT
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ )
+ )
+(CHARACTER C l
+ (CHARWD R 0.255557)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER C m
+ (CHARWD R 0.866672)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER C n
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER C o
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458332)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C p
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458332)
+ (CHARDP R 0.194444)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C q
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458332)
+ (CHARDP R 0.194444)
+ )
+(CHARACTER C r
+ (CHARWD R 0.372224)
+ (CHARHT R 0.458332)
+ (CHARIC R 0.015278)
+ )
+(CHARACTER C s
+ (CHARWD R 0.421669)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER C t
+ (CHARWD R 0.404168)
+ (CHARHT R 0.589287)
+ (COMMENT
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C u
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458332)
+ (COMMENT
+ (KRN C w R -0.030556)
+ )
+ )
+(CHARACTER C v
+ (CHARWD R 0.500003)
+ (CHARHT R 0.458332)
+ (CHARIC R 0.015278)
+ )
+(CHARACTER C w
+ (CHARWD R 0.744449)
+ (CHARHT R 0.458332)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ )
+ )
+(CHARACTER C x
+ (CHARWD R 0.500003)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER C y
+ (CHARWD R 0.500003)
+ (CHARHT R 0.458332)
+ (CHARDP R 0.194444)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ )
+ )
+(CHARACTER C z
+ (CHARWD R 0.476391)
+ (CHARHT R 0.458332)
+ )
+(CHARACTER O 173
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458332)
+ (CHARIC R 0.030556)
+ (COMMENT
+ (LIG O 55 O 174)
+ )
+ )
+(CHARACTER O 174
+ (CHARWD R 1.100006)
+ (CHARHT R 0.458332)
+ (CHARIC R 0.030556)
+ )
+(CHARACTER O 175
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 176
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
+(CHARACTER O 177
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694443)
+ )
diff --git a/support/splint/tex/fonts/idssbx5.vpl b/support/splint/tex/fonts/idssbx5.vpl
new file mode 100644
index 0000000000..0d5b82cb96
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx5.vpl
@@ -0,0 +1,908 @@
+(DESIGNSIZE R 5.0)
+(COMMENT DESIGNSIZE IS IN POINTS)
+(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
+(CHECKSUM O 15363216213)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.366669)
+ (STRETCH R 0.183334)
+ (SHRINK R 0.122223)
+ (XHEIGHT R 0.458334)
+ (QUAD R 1.100006)
+ (EXTRASPACE R 0.122223)
+ )
+(LIGTABLE
+ (LABEL O 40)
+ (KRN C l R -0.255557)
+ (KRN C L R -0.29306)
+ (STOP)
+ (LABEL C f)
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.076388)
+ (KRN O 77 R 0.076388)
+ (KRN O 41 R 0.076388)
+ (KRN O 51 R 0.076388)
+ (KRN O 135 R 0.076388)
+ (STOP)
+ (LABEL O 13)
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.076388)
+ (KRN O 77 R 0.076388)
+ (KRN O 41 R 0.076388)
+ (KRN O 51 R 0.076388)
+ (KRN O 135 R 0.076388)
+ (STOP)
+ (LABEL O 140)
+ (LIG O 140 O 134)
+ (STOP)
+ (LABEL O 47)
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ (STOP)
+ (LABEL O 55)
+ (LIG O 55 O 173)
+ (STOP)
+ (LABEL O 173)
+ (LIG O 55 O 174)
+ (STOP)
+ (LABEL O 41)
+ (LIG O 140 O 74)
+ (STOP)
+ (LABEL O 77)
+ (LIG O 140 O 76)
+ (STOP)
+ (LABEL C k)
+ (LABEL C w)
+ (KRN C e R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN C o R -0.030558)
+ (KRN C c R -0.030558)
+ (STOP)
+ (LABEL C P)
+ (KRN C A R -0.091669)
+ (LABEL C y)
+ (KRN C o R -0.030558)
+ (KRN C e R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN O 56 R -0.091669)
+ (KRN O 54 R -0.091669)
+ (STOP)
+ (LABEL C F)
+ (LABEL C V)
+ (LABEL C W)
+ (KRN C o R -0.030558)
+ (KRN C e R -0.030558)
+ (KRN C u R -0.030558)
+ (KRN C r R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN C A R -0.091669)
+ (LABEL C K)
+ (LABEL C X)
+ (KRN C O R -0.030558)
+ (KRN C C R -0.030558)
+ (KRN C G R -0.030558)
+ (KRN C Q R -0.030558)
+ (STOP)
+ (LABEL C T)
+ (KRN C y R -0.091669)
+ (LABEL C Y)
+ (KRN C e R -0.091669)
+ (KRN C o R -0.091669)
+ (KRN C r R -0.091669)
+ (KRN C a R -0.091669)
+ (KRN C A R -0.091669)
+ (KRN C u R -0.091669)
+ (STOP)
+ (LABEL C D)
+ (LABEL C O)
+ (KRN C X R -0.030558)
+ (KRN C W R -0.030558)
+ (KRN C A R -0.030558)
+ (KRN C V R -0.030558)
+ (KRN C Y R -0.030558)
+ (STOP)
+ (LABEL C b)
+ (LABEL C o)
+ (LABEL C p)
+ (KRN C e R 0.030558)
+ (KRN C o R 0.030558)
+ (KRN C x R -0.030558)
+ (KRN C d R 0.030558)
+ (KRN C c R 0.030558)
+ (KRN C q R 0.030558)
+ (LABEL C a)
+ (KRN C r R -0.030558)
+ (LABEL C t)
+ (KRN C y R -0.030558)
+ (LABEL C u)
+ (KRN C w R -0.030558)
+ (STOP)
+ (LABEL C A)
+ (KRN C t R -0.030558)
+ (KRN C C R -0.030558)
+ (KRN C O R -0.030558)
+ (KRN C G R -0.030558)
+ (KRN C U R -0.030558)
+ (KRN C Q R -0.030558)
+ (LABEL C L)
+ (KRN C T R -0.091669)
+ (KRN C Y R -0.091669)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ (STOP)
+ (LABEL C g)
+ (KRN C j R 0.030558)
+ (STOP)
+ (LABEL C I)
+ (KRN C I R 0.030558)
+ (STOP)
+ )
+(CHARACTER O 0
+ (CHARWD R 0.580561)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 1
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 2
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 3
+ (CHARWD R 0.672229)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 4
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 5
+ (CHARWD R 0.794452)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 6
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 7
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 10
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 11
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 12
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 13
+ (CHARWD R 0.641672)
+ (CHARHT R 0.694446)
+ (CHARIC R 0.076388)
+ (COMMENT
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.076388)
+ (KRN O 77 R 0.076388)
+ (KRN O 41 R 0.076388)
+ (KRN O 51 R 0.076388)
+ (KRN O 135 R 0.076388)
+ )
+ )
+(CHARACTER O 14
+ (CHARWD R 0.586115)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 15
+ (CHARWD R 0.586115)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 16
+ (CHARWD R 0.891672)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 17
+ (CHARWD R 0.891672)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 20
+ (CHARWD R 0.255557)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER O 21
+ (CHARWD R 0.286115)
+ (CHARHT R 0.458334)
+ (CHARDP R 0.194446)
+ )
+(CHARACTER O 22
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 23
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 24
+ (CHARWD R 0.550003)
+ (CHARHT R 0.635419)
+ )
+(CHARACTER O 25
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 26
+ (CHARWD R 0.550003)
+ (CHARHT R 0.637777)
+ )
+(CHARACTER O 27
+ (CHARWD R 0.73334)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 30
+ (CHARWD R 0.488892)
+ (CHARDP R 0.170141)
+ )
+(CHARACTER O 31
+ (CHARWD R 0.565283)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 32
+ (CHARWD R 0.794449)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER O 33
+ (CHARWD R 0.85556)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER O 34
+ (CHARWD R 0.550003)
+ (CHARHT R 0.555557)
+ (CHARDP R 0.097223)
+ )
+(CHARACTER O 35
+ (CHARWD R 0.947229)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 36
+ (CHARWD R 1.069452)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 37
+ (CHARWD R 0.85556)
+ (CHARHT R 0.743057)
+ (CHARDP R 0.048612)
+ )
+(CHARACTER O 40
+ (CHARWD R 0.255557)
+ (CHARHT R 0.458334)
+ (COMMENT
+ (KRN C l R -0.255557)
+ (KRN C L R -0.29306)
+ )
+ )
+(CHARACTER O 41
+ (CHARWD R 0.366669)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (LIG O 140 O 74)
+ )
+ )
+(CHARACTER O 42
+ (CHARWD R 0.558334)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 43
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694446)
+ (CHARDP R 0.194446)
+ )
+(CHARACTER O 44
+ (CHARWD R 0.550003)
+ (CHARHT R 0.75)
+ (CHARDP R 0.055554)
+ )
+(CHARACTER O 45
+ (CHARWD R 1.029117)
+ (CHARHT R 0.75)
+ (CHARDP R 0.055554)
+ )
+(CHARACTER O 46
+ (CHARWD R 0.830561)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 47
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ )
+ )
+(CHARACTER O 50
+ (CHARWD R 0.42778)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER O 51
+ (CHARWD R 0.42778)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER O 52
+ (CHARWD R 0.550003)
+ (CHARHT R 0.75)
+ )
+(CHARACTER O 53
+ (CHARWD R 0.85556)
+ (CHARHT R 0.616669)
+ (CHARDP R 0.116669)
+ )
+(CHARACTER O 54
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130554)
+ (CHARDP R 0.105555)
+ )
+(CHARACTER O 55
+ (CHARWD R 0.366669)
+ (CHARHT R 0.458334)
+ (COMMENT
+ (LIG O 55 O 173)
+ )
+ )
+(CHARACTER O 56
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130554)
+ )
+(CHARACTER O 57
+ (CHARWD R 0.550003)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER C 0
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C 1
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C 2
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C 3
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C 4
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C 5
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C 6
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C 7
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C 8
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C 9
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 72
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER O 73
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458334)
+ (CHARDP R 0.105555)
+ )
+(CHARACTER O 74
+ (CHARWD R 0.366669)
+ (CHARHT R 0.5)
+ (CHARDP R 0.194446)
+ )
+(CHARACTER O 75
+ (CHARWD R 0.85556)
+ (CHARHT R 0.406253)
+ (CHARDP R -0.093747)
+ )
+(CHARACTER O 76
+ (CHARWD R 0.519449)
+ (CHARHT R 0.5)
+ (CHARDP R 0.194446)
+ )
+(CHARACTER O 77
+ (CHARWD R 0.519449)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (LIG O 140 O 76)
+ )
+ )
+(CHARACTER O 100
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C A
+ (CHARWD R 0.73334)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C t R -0.030558)
+ (KRN C C R -0.030558)
+ (KRN C O R -0.030558)
+ (KRN C G R -0.030558)
+ (KRN C U R -0.030558)
+ (KRN C Q R -0.030558)
+ (KRN C T R -0.091669)
+ (KRN C Y R -0.091669)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ )
+(CHARACTER C B
+ (CHARWD R 0.73334)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C C
+ (CHARWD R 0.702784)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C D
+ (CHARWD R 0.794452)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C X R -0.030558)
+ (KRN C W R -0.030558)
+ (KRN C A R -0.030558)
+ (KRN C V R -0.030558)
+ (KRN C Y R -0.030558)
+ )
+ )
+(CHARACTER C E
+ (CHARWD R 0.641672)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C F
+ (CHARWD R 0.611117)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C o R -0.030558)
+ (KRN C e R -0.030558)
+ (KRN C u R -0.030558)
+ (KRN C r R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN C A R -0.091669)
+ (KRN C O R -0.030558)
+ (KRN C C R -0.030558)
+ (KRN C G R -0.030558)
+ (KRN C Q R -0.030558)
+ )
+ )
+(CHARACTER C G
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C H
+ (CHARWD R 0.794452)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C I
+ (CHARWD R 0.330561)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C I R 0.030558)
+ )
+ )
+(CHARACTER C J
+ (CHARWD R 0.519449)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C K
+ (CHARWD R 0.763898)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C O R -0.030558)
+ (KRN C C R -0.030558)
+ (KRN C G R -0.030558)
+ (KRN C Q R -0.030558)
+ )
+ )
+(CHARACTER C L
+ (CHARWD R 0.580561)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C T R -0.091669)
+ (KRN C Y R -0.091669)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ )
+(CHARACTER C M
+ (CHARWD R 0.977786)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C N
+ (CHARWD R 0.794452)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C O
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C X R -0.030558)
+ (KRN C W R -0.030558)
+ (KRN C A R -0.030558)
+ (KRN C V R -0.030558)
+ (KRN C Y R -0.030558)
+ )
+ )
+(CHARACTER C P
+ (CHARWD R 0.702784)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C A R -0.091669)
+ (KRN C o R -0.030558)
+ (KRN C e R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN O 56 R -0.091669)
+ (KRN O 54 R -0.091669)
+ )
+ )
+(CHARACTER C Q
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694446)
+ (CHARDP R 0.105555)
+ )
+(CHARACTER C R
+ (CHARWD R 0.702784)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C S
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C T
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C y R -0.091669)
+ (KRN C e R -0.091669)
+ (KRN C o R -0.091669)
+ (KRN C r R -0.091669)
+ (KRN C a R -0.091669)
+ (KRN C A R -0.091669)
+ (KRN C u R -0.091669)
+ )
+ )
+(CHARACTER C U
+ (CHARWD R 0.763898)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C V
+ (CHARWD R 0.73334)
+ (CHARHT R 0.694446)
+ (CHARIC R 0.015277)
+ (COMMENT
+ (KRN C o R -0.030558)
+ (KRN C e R -0.030558)
+ (KRN C u R -0.030558)
+ (KRN C r R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN C A R -0.091669)
+ (KRN C O R -0.030558)
+ (KRN C C R -0.030558)
+ (KRN C G R -0.030558)
+ (KRN C Q R -0.030558)
+ )
+ )
+(CHARACTER C W
+ (CHARWD R 1.0388975)
+ (CHARHT R 0.694446)
+ (CHARIC R 0.015277)
+ (COMMENT
+ (KRN C o R -0.030558)
+ (KRN C e R -0.030558)
+ (KRN C u R -0.030558)
+ (KRN C r R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN C A R -0.091669)
+ (KRN C O R -0.030558)
+ (KRN C C R -0.030558)
+ (KRN C G R -0.030558)
+ (KRN C Q R -0.030558)
+ )
+ )
+(CHARACTER C X
+ (CHARWD R 0.73334)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C O R -0.030558)
+ (KRN C C R -0.030558)
+ (KRN C G R -0.030558)
+ (KRN C Q R -0.030558)
+ )
+ )
+(CHARACTER C Y
+ (CHARWD R 0.73334)
+ (CHARHT R 0.694446)
+ (CHARIC R 0.027499)
+ (COMMENT
+ (KRN C e R -0.091669)
+ (KRN C o R -0.091669)
+ (KRN C r R -0.091669)
+ (KRN C a R -0.091669)
+ (KRN C A R -0.091669)
+ (KRN C u R -0.091669)
+ )
+ )
+(CHARACTER C Z
+ (CHARWD R 0.672226)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 133
+ (CHARWD R 0.3430605)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER O 134
+ (CHARWD R 0.558334)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 135
+ (CHARWD R 0.3430605)
+ (CHARHT R 0.75)
+ (CHARDP R 0.25)
+ )
+(CHARACTER O 136
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 137
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 140
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (LIG O 140 O 134)
+ )
+ )
+(CHARACTER C a
+ (CHARWD R 0.525003)
+ (CHARHT R 0.458334)
+ (COMMENT
+ (KRN C r R -0.030558)
+ (KRN C y R -0.030558)
+ (KRN C w R -0.030558)
+ )
+ )
+(CHARACTER C b
+ (CHARWD R 0.561114)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C e R 0.030558)
+ (KRN C o R 0.030558)
+ (KRN C x R -0.030558)
+ (KRN C d R 0.030558)
+ (KRN C c R 0.030558)
+ (KRN C q R 0.030558)
+ (KRN C r R -0.030558)
+ (KRN C y R -0.030558)
+ (KRN C w R -0.030558)
+ )
+ )
+(CHARACTER C c
+ (CHARWD R 0.488892)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER C d
+ (CHARWD R 0.561114)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C e
+ (CHARWD R 0.511114)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER C f
+ (CHARWD R 0.336115)
+ (CHARHT R 0.694446)
+ (CHARIC R 0.076388)
+ (COMMENT
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.076388)
+ (KRN O 77 R 0.076388)
+ (KRN O 41 R 0.076388)
+ (KRN O 51 R 0.076388)
+ (KRN O 135 R 0.076388)
+ )
+ )
+(CHARACTER C g
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458334)
+ (CHARDP R 0.194446)
+ (CHARIC R 0.015277)
+ (COMMENT
+ (KRN C j R 0.030558)
+ )
+ )
+(CHARACTER C h
+ (CHARWD R 0.561114)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C i
+ (CHARWD R 0.255557)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C j
+ (CHARWD R 0.286115)
+ (CHARHT R 0.694446)
+ (CHARDP R 0.194446)
+ )
+(CHARACTER C k
+ (CHARWD R 0.5305605)
+ (CHARHT R 0.694446)
+ (COMMENT
+ (KRN C e R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN C o R -0.030558)
+ (KRN C c R -0.030558)
+ )
+ )
+(CHARACTER C l
+ (CHARWD R 0.255557)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER C m
+ (CHARWD R 0.866672)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER C n
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER C o
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458334)
+ (COMMENT
+ (KRN C e R 0.030558)
+ (KRN C o R 0.030558)
+ (KRN C x R -0.030558)
+ (KRN C d R 0.030558)
+ (KRN C c R 0.030558)
+ (KRN C q R 0.030558)
+ (KRN C r R -0.030558)
+ (KRN C y R -0.030558)
+ (KRN C w R -0.030558)
+ )
+ )
+(CHARACTER C p
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458334)
+ (CHARDP R 0.194446)
+ (COMMENT
+ (KRN C e R 0.030558)
+ (KRN C o R 0.030558)
+ (KRN C x R -0.030558)
+ (KRN C d R 0.030558)
+ (KRN C c R 0.030558)
+ (KRN C q R 0.030558)
+ (KRN C r R -0.030558)
+ (KRN C y R -0.030558)
+ (KRN C w R -0.030558)
+ )
+ )
+(CHARACTER C q
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458334)
+ (CHARDP R 0.194446)
+ )
+(CHARACTER C r
+ (CHARWD R 0.372226)
+ (CHARHT R 0.458334)
+ (CHARIC R 0.015277)
+ )
+(CHARACTER C s
+ (CHARWD R 0.421671)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER C t
+ (CHARWD R 0.404169)
+ (CHARHT R 0.589292)
+ (COMMENT
+ (KRN C y R -0.030558)
+ (KRN C w R -0.030558)
+ )
+ )
+(CHARACTER C u
+ (CHARWD R 0.561114)
+ (CHARHT R 0.458334)
+ (COMMENT
+ (KRN C w R -0.030558)
+ )
+ )
+(CHARACTER C v
+ (CHARWD R 0.500003)
+ (CHARHT R 0.458334)
+ (CHARIC R 0.015277)
+ )
+(CHARACTER C w
+ (CHARWD R 0.744449)
+ (CHARHT R 0.458334)
+ (CHARIC R 0.015277)
+ (COMMENT
+ (KRN C e R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN C o R -0.030558)
+ (KRN C c R -0.030558)
+ )
+ )
+(CHARACTER C x
+ (CHARWD R 0.500003)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER C y
+ (CHARWD R 0.500003)
+ (CHARHT R 0.458334)
+ (CHARDP R 0.194446)
+ (CHARIC R 0.015277)
+ (COMMENT
+ (KRN C o R -0.030558)
+ (KRN C e R -0.030558)
+ (KRN C a R -0.030558)
+ (KRN O 56 R -0.091669)
+ (KRN O 54 R -0.091669)
+ )
+ )
+(CHARACTER C z
+ (CHARWD R 0.476392)
+ (CHARHT R 0.458334)
+ )
+(CHARACTER O 173
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458334)
+ (CHARIC R 0.030558)
+ (COMMENT
+ (LIG O 55 O 174)
+ )
+ )
+(CHARACTER O 174
+ (CHARWD R 1.100006)
+ (CHARHT R 0.458334)
+ (CHARIC R 0.030558)
+ )
+(CHARACTER O 175
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 176
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
+(CHARACTER O 177
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694446)
+ )
diff --git a/support/splint/tex/fonts/idssbx6.tfm b/support/splint/tex/fonts/idssbx6.tfm
new file mode 100644
index 0000000000..d2f8ef2795
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx6.tfm
Binary files differ
diff --git a/support/splint/tex/fonts/idssbx6.vf b/support/splint/tex/fonts/idssbx6.vf
new file mode 100644
index 0000000000..17abea3d67
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx6.vf
Binary files differ
diff --git a/support/splint/tex/fonts/idssbx6.vpl b/support/splint/tex/fonts/idssbx6.vpl
new file mode 100644
index 0000000000..b58987efb8
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx6.vpl
@@ -0,0 +1,1310 @@
+(VTITLE )
+(FAMILY UNSPECIFIED)
+(FACE F MRR)
+(CODINGSCHEME UNSPECIFIED)
+(DESIGNSIZE R 6.0)
+(COMMENT DESIGNSIZE IS IN POINTS)
+(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
+(CHECKSUM O 12577076133)
+(SEVENBITSAFEFLAG TRUE)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.366669)
+ (STRETCH R 0.183334)
+ (SHRINK R 0.122223)
+ (XHEIGHT R 0.458339)
+ (QUAD R 1.100006)
+ (EXTRASPACE R 0.122223)
+ )
+(MAPFONT D 0
+ (FONTNAME cmssbx6)
+ (FONTCHECKSUM O 14127301331)
+ (FONTAT R 1.0)
+ (FONTDSIZE R 6.0)
+ )
+(MAPFONT D 1
+ (FONTNAME cmtt6)
+ (FONTCHECKSUM O 33705443200)
+ (FONTAT R 1.0)
+ (FONTDSIZE R 6.0)
+ )
+(LIGTABLE
+ (LABEL O 40)
+ (KRN C l R -0.255554)
+ (KRN C L R -0.293057)
+ (STOP)
+ (LABEL C f)
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ (STOP)
+ (LABEL O 13)
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ (STOP)
+ (LABEL O 140)
+ (LIG O 140 O 134)
+ (STOP)
+ (LABEL O 47)
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ (STOP)
+ (LABEL O 55)
+ (LIG O 55 O 173)
+ (STOP)
+ (LABEL O 173)
+ (LIG O 55 O 174)
+ (STOP)
+ (LABEL O 41)
+ (LIG O 140 O 74)
+ (STOP)
+ (LABEL O 77)
+ (LIG O 140 O 76)
+ (STOP)
+ (LABEL C k)
+ (LABEL C w)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ (STOP)
+ (LABEL C P)
+ (KRN C A R -0.091667)
+ (LABEL C y)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ (STOP)
+ (LABEL C F)
+ (LABEL C V)
+ (LABEL C W)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (LABEL C K)
+ (LABEL C X)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ (STOP)
+ (LABEL C T)
+ (KRN C y R -0.091667)
+ (LABEL C Y)
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ (STOP)
+ (LABEL C D)
+ (LABEL C O)
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ (STOP)
+ (LABEL C b)
+ (LABEL C o)
+ (LABEL C p)
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (LABEL C a)
+ (KRN C r R -0.030556)
+ (LABEL C t)
+ (KRN C y R -0.030556)
+ (LABEL C u)
+ (KRN C w R -0.030556)
+ (STOP)
+ (LABEL C A)
+ (KRN C t R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C O R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C U R -0.030556)
+ (KRN C Q R -0.030556)
+ (LABEL C L)
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ (STOP)
+ (LABEL C g)
+ (KRN C j R 0.030556)
+ (STOP)
+ (LABEL C I)
+ (KRN C I R 0.030556)
+ (STOP)
+ )
+(CHARACTER O 0
+ (CHARWD R 0.580559)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 0)
+ )
+ )
+(CHARACTER O 1
+ (CHARWD R 0.916672)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 1)
+ )
+ )
+(CHARACTER O 2
+ (CHARWD R 0.85556)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 2)
+ )
+ )
+(CHARACTER O 3
+ (CHARWD R 0.672226)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 3)
+ )
+ )
+(CHARACTER O 4
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 4)
+ )
+ )
+(CHARACTER O 5
+ (CHARWD R 0.794449)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 5)
+ )
+ )
+(CHARACTER O 6
+ (CHARWD R 0.794449)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 6)
+ )
+ )
+(CHARACTER O 7
+ (CHARWD R 0.85556)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 7)
+ )
+ )
+(CHARACTER O 10
+ (CHARWD R 0.794449)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 10)
+ )
+ )
+(CHARACTER O 11
+ (CHARWD R 0.85556)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 11)
+ )
+ )
+(CHARACTER O 12
+ (CHARWD R 0.794449)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 12)
+ )
+ )
+(CHARACTER O 13
+ (CHARWD R 0.64167)
+ (CHARHT R 0.69445)
+ (CHARIC R 0.07639)
+ (COMMENT
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ )
+ (MAP
+ (SETCHAR O 13)
+ )
+ )
+(CHARACTER O 14
+ (CHARWD R 0.586113)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 14)
+ )
+ )
+(CHARACTER O 15
+ (CHARWD R 0.586113)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 15)
+ )
+ )
+(CHARACTER O 16
+ (CHARWD R 0.89167)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 16)
+ )
+ )
+(CHARACTER O 17
+ (CHARWD R 0.89167)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 17)
+ )
+ )
+(CHARACTER O 20
+ (CHARWD R 0.255554)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR O 20)
+ )
+ )
+(CHARACTER O 21
+ (CHARWD R 0.28611)
+ (CHARHT R 0.458339)
+ (CHARDP R 0.194446)
+ (MAP
+ (SETCHAR O 21)
+ )
+ )
+(CHARACTER O 22
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 22)
+ )
+ )
+(CHARACTER O 23
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 23)
+ )
+ )
+(CHARACTER O 24
+ (CHARWD R 0.550003)
+ (CHARHT R 0.635422)
+ (MAP
+ (SETCHAR O 24)
+ )
+ )
+(CHARACTER O 25
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 25)
+ )
+ )
+(CHARACTER O 26
+ (CHARWD R 0.550003)
+ (CHARHT R 0.637784)
+ (MAP
+ (SETCHAR O 26)
+ )
+ )
+(CHARACTER O 27
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 27)
+ )
+ )
+(CHARACTER O 30
+ (CHARWD R 0.488892)
+ (CHARDP R 0.17014)
+ (MAP
+ (SETCHAR O 30)
+ )
+ )
+(CHARACTER O 31
+ (CHARWD R 0.565282)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 31)
+ )
+ )
+(CHARACTER O 32
+ (CHARWD R 0.794449)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR O 32)
+ )
+ )
+(CHARACTER O 33
+ (CHARWD R 0.85556)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR O 33)
+ )
+ )
+(CHARACTER O 34
+ (CHARWD R 0.550003)
+ (CHARHT R 0.555562)
+ (CHARDP R 0.097224)
+ (MAP
+ (SETCHAR O 34)
+ )
+ )
+(CHARACTER O 35
+ (CHARWD R 0.9472275)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 35)
+ )
+ )
+(CHARACTER O 36
+ (CHARWD R 1.06945)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 36)
+ )
+ )
+(CHARACTER O 37
+ (CHARWD R 0.85556)
+ (CHARHT R 0.743062)
+ (CHARDP R 0.048612)
+ (MAP
+ (SETCHAR O 37)
+ )
+ )
+(CHARACTER O 40
+ (CHARWD R 0.255554)
+ (CHARHT R 0.458339)
+ (COMMENT
+ (KRN C l R -0.255554)
+ (KRN C L R -0.293057)
+ )
+ (MAP
+ (SETCHAR O 40)
+ )
+ )
+(CHARACTER O 41
+ (CHARWD R 0.366669)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (LIG O 140 O 74)
+ )
+ (MAP
+ (SETCHAR O 41)
+ )
+ )
+(CHARACTER O 42
+ (CHARWD R 0.558337)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 42)
+ )
+ )
+(CHARACTER O 43
+ (CHARWD R 0.916672)
+ (CHARHT R 0.69445)
+ (CHARDP R 0.194443)
+ (MAP
+ (SETCHAR O 43)
+ )
+ )
+(CHARACTER O 44
+ (CHARWD R 0.550003)
+ (CHARHT R 0.750008)
+ (CHARDP R 0.055557)
+ (MAP
+ (SETCHAR O 44)
+ )
+ )
+(CHARACTER O 45
+ (CHARWD R 1.029124)
+ (CHARHT R 0.750008)
+ (CHARDP R 0.055557)
+ (MAP
+ (SETCHAR O 45)
+ )
+ )
+(CHARACTER O 46
+ (CHARWD R 0.830559)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 46)
+ )
+ )
+(CHARACTER O 47
+ (CHARWD R 0.305557)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ )
+ (MAP
+ (SETCHAR O 47)
+ )
+ )
+(CHARACTER O 50
+ (CHARWD R 0.42778)
+ (CHARHT R 0.750008)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 50)
+ )
+ )
+(CHARACTER O 51
+ (CHARWD R 0.42778)
+ (CHARHT R 0.750008)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 51)
+ )
+ )
+(CHARACTER O 52
+ (CHARWD R 0.550003)
+ (CHARHT R 0.750008)
+ (MAP
+ (SETCHAR O 52)
+ )
+ )
+(CHARACTER O 53
+ (CHARWD R 0.85556)
+ (CHARHT R 0.616672)
+ (CHARDP R 0.116666)
+ (MAP
+ (SETCHAR O 53)
+ )
+ )
+(CHARACTER O 54
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130557)
+ (CHARDP R 0.105557)
+ (MAP
+ (SETCHAR O 54)
+ )
+ )
+(CHARACTER O 55
+ (CHARWD R 0.366669)
+ (CHARHT R 0.458339)
+ (COMMENT
+ (LIG O 55 O 173)
+ )
+ (MAP
+ (SETCHAR O 55)
+ )
+ )
+(CHARACTER O 56
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130557)
+ (MAP
+ (SETCHAR O 56)
+ )
+ )
+(CHARACTER O 57
+ (CHARWD R 0.550003)
+ (CHARHT R 0.750008)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 57)
+ )
+ )
+(CHARACTER C 0
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 0)
+ )
+ )
+(CHARACTER C 1
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 1)
+ )
+ )
+(CHARACTER C 2
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 2)
+ )
+ )
+(CHARACTER C 3
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 3)
+ )
+ )
+(CHARACTER C 4
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 4)
+ )
+ )
+(CHARACTER C 5
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 5)
+ )
+ )
+(CHARACTER C 6
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 6)
+ )
+ )
+(CHARACTER C 7
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 7)
+ )
+ )
+(CHARACTER C 8
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 8)
+ )
+ )
+(CHARACTER C 9
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C 9)
+ )
+ )
+(CHARACTER O 72
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR O 72)
+ )
+ )
+(CHARACTER O 73
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458339)
+ (CHARDP R 0.105557)
+ (MAP
+ (SETCHAR O 73)
+ )
+ )
+(CHARACTER O 74
+ (CHARWD R 0.366669)
+ (CHARHT R 0.500005)
+ (CHARDP R 0.194446)
+ (MAP
+ (SETCHAR O 74)
+ )
+ )
+(CHARACTER O 75
+ (CHARWD R 0.85556)
+ (CHARHT R 0.406255)
+ (CHARDP R -0.09375)
+ (MAP
+ (SETCHAR O 75)
+ )
+ )
+(CHARACTER O 76
+ (CHARWD R 0.519447)
+ (CHARHT R 0.500005)
+ (CHARDP R 0.194446)
+ (MAP
+ (SETCHAR O 76)
+ )
+ )
+(CHARACTER O 77
+ (CHARWD R 0.519447)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (LIG O 140 O 76)
+ )
+ (MAP
+ (SETCHAR O 77)
+ )
+ )
+(CHARACTER O 100
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 100)
+ )
+ )
+(CHARACTER C A
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C t R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C O R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C U R -0.030556)
+ (KRN C Q R -0.030556)
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ (MAP
+ (SETCHAR C A)
+ )
+ )
+(CHARACTER C B
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C B)
+ )
+ )
+(CHARACTER C C
+ (CHARWD R 0.702782)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C C)
+ )
+ )
+(CHARACTER C D
+ (CHARWD R 0.794449)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ )
+ (MAP
+ (SETCHAR C D)
+ )
+ )
+(CHARACTER C E
+ (CHARWD R 0.64167)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C E)
+ )
+ )
+(CHARACTER C F
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C F)
+ )
+ )
+(CHARACTER C G
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C G)
+ )
+ )
+(CHARACTER C H
+ (CHARWD R 0.794449)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C H)
+ )
+ )
+(CHARACTER C I
+ (CHARWD R 0.330559)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C I R 0.030556)
+ )
+ (MAP
+ (SETCHAR C I)
+ )
+ )
+(CHARACTER C J
+ (CHARWD R 0.519447)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C J)
+ )
+ )
+(CHARACTER C K
+ (CHARWD R 0.763893)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C K)
+ )
+ )
+(CHARACTER C L
+ (CHARWD R 0.580559)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ (MAP
+ (SETCHAR C L)
+ )
+ )
+(CHARACTER C M
+ (CHARWD R 0.977783)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C M)
+ )
+ )
+(CHARACTER C N
+ (CHARWD R 0.794449)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C N)
+ )
+ )
+(CHARACTER C O
+ (CHARWD R 0.794449)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ )
+ (MAP
+ (SETCHAR C O)
+ )
+ )
+(CHARACTER C P
+ (CHARWD R 0.702782)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C A R -0.091667)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ )
+ (MAP
+ (SETCHAR C P)
+ )
+ )
+(CHARACTER C Q
+ (CHARWD R 0.794449)
+ (CHARHT R 0.69445)
+ (CHARDP R 0.105557)
+ (MAP
+ (SETCHAR C Q)
+ )
+ )
+(CHARACTER C R
+ (CHARWD R 0.702782)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C R)
+ )
+ )
+(CHARACTER C S
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C S)
+ )
+ )
+(CHARACTER C T
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C y R -0.091667)
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ )
+ (MAP
+ (SETCHAR C T)
+ )
+ )
+(CHARACTER C U
+ (CHARWD R 0.763893)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C U)
+ )
+ )
+(CHARACTER C V
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C V)
+ )
+ )
+(CHARACTER C W
+ (CHARWD R 1.038895)
+ (CHARHT R 0.69445)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C W)
+ )
+ )
+(CHARACTER C X
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C X)
+ )
+ )
+(CHARACTER C Y
+ (CHARWD R 0.733337)
+ (CHARHT R 0.69445)
+ (CHARIC R 0.027499)
+ (COMMENT
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ )
+ (MAP
+ (SETCHAR C Y)
+ )
+ )
+(CHARACTER C Z
+ (CHARWD R 0.672226)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C Z)
+ )
+ )
+(CHARACTER O 133
+ (CHARWD R 0.343059)
+ (CHARHT R 0.750008)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 133)
+ )
+ )
+(CHARACTER O 134
+ (CHARWD R 0.558337)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 134)
+ )
+ )
+(CHARACTER O 135
+ (CHARWD R 0.343059)
+ (CHARHT R 0.750008)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 135)
+ )
+ )
+(CHARACTER O 136
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 136)
+ )
+ )
+(CHARACTER O 137
+ (CHARWD R 0.574997)
+ (CHARDP R 0.095136)
+ (MAP
+ (SELECTFONT D 1)
+ (SETCHAR O 137)
+ )
+ )
+(CHARACTER O 140
+ (CHARWD R 0.305557)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (LIG O 140 O 134)
+ )
+ (MAP
+ (SETCHAR O 140)
+ )
+ )
+(CHARACTER C a
+ (CHARWD R 0.525002)
+ (CHARHT R 0.458339)
+ (COMMENT
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C a)
+ )
+ )
+(CHARACTER C b
+ (CHARWD R 0.561111)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C b)
+ )
+ )
+(CHARACTER C c
+ (CHARWD R 0.488892)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR C c)
+ )
+ )
+(CHARACTER C d
+ (CHARWD R 0.561111)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C d)
+ )
+ )
+(CHARACTER C e
+ (CHARWD R 0.511116)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR C e)
+ )
+ )
+(CHARACTER C f
+ (CHARWD R 0.336113)
+ (CHARHT R 0.69445)
+ (CHARIC R 0.07639)
+ (COMMENT
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ )
+ (MAP
+ (SETCHAR C f)
+ )
+ )
+(CHARACTER C g
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458339)
+ (CHARDP R 0.194446)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C j R 0.030556)
+ )
+ (MAP
+ (SETCHAR C g)
+ )
+ )
+(CHARACTER C h
+ (CHARWD R 0.561111)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C h)
+ )
+ )
+(CHARACTER C i
+ (CHARWD R 0.255554)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C i)
+ )
+ )
+(CHARACTER C j
+ (CHARWD R 0.28611)
+ (CHARHT R 0.69445)
+ (CHARDP R 0.194446)
+ (MAP
+ (SETCHAR C j)
+ )
+ )
+(CHARACTER C k
+ (CHARWD R 0.530556)
+ (CHARHT R 0.69445)
+ (COMMENT
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ )
+ (MAP
+ (SETCHAR C k)
+ )
+ )
+(CHARACTER C l
+ (CHARWD R 0.255554)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR C l)
+ )
+ )
+(CHARACTER C m
+ (CHARWD R 0.866669)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR C m)
+ )
+ )
+(CHARACTER C n
+ (CHARWD R 0.561111)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR C n)
+ )
+ )
+(CHARACTER C o
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458339)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C o)
+ )
+ )
+(CHARACTER C p
+ (CHARWD R 0.561111)
+ (CHARHT R 0.458339)
+ (CHARDP R 0.194446)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C p)
+ )
+ )
+(CHARACTER C q
+ (CHARWD R 0.561111)
+ (CHARHT R 0.458339)
+ (CHARDP R 0.194446)
+ (MAP
+ (SETCHAR C q)
+ )
+ )
+(CHARACTER C r
+ (CHARWD R 0.372223)
+ (CHARHT R 0.458339)
+ (CHARIC R 0.015279)
+ (MAP
+ (SETCHAR C r)
+ )
+ )
+(CHARACTER C s
+ (CHARWD R 0.421669)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR C s)
+ )
+ )
+(CHARACTER C t
+ (CHARWD R 0.40417)
+ (CHARHT R 0.589294)
+ (COMMENT
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C t)
+ )
+ )
+(CHARACTER C u
+ (CHARWD R 0.561111)
+ (CHARHT R 0.458339)
+ (COMMENT
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C u)
+ )
+ )
+(CHARACTER C v
+ (CHARWD R 0.5)
+ (CHARHT R 0.458339)
+ (CHARIC R 0.015279)
+ (MAP
+ (SETCHAR C v)
+ )
+ )
+(CHARACTER C w
+ (CHARWD R 0.744446)
+ (CHARHT R 0.458339)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ )
+ (MAP
+ (SETCHAR C w)
+ )
+ )
+(CHARACTER C x
+ (CHARWD R 0.5)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR C x)
+ )
+ )
+(CHARACTER C y
+ (CHARWD R 0.5)
+ (CHARHT R 0.458339)
+ (CHARDP R 0.194446)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ )
+ (MAP
+ (SETCHAR C y)
+ )
+ )
+(CHARACTER C z
+ (CHARWD R 0.47639)
+ (CHARHT R 0.458339)
+ (MAP
+ (SETCHAR C z)
+ )
+ )
+(CHARACTER O 173
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458339)
+ (CHARIC R 0.030556)
+ (COMMENT
+ (LIG O 55 O 174)
+ )
+ (MAP
+ (SETCHAR O 173)
+ )
+ )
+(CHARACTER O 174
+ (CHARWD R 1.100006)
+ (CHARHT R 0.458339)
+ (CHARIC R 0.030556)
+ (MAP
+ (SETCHAR O 174)
+ )
+ )
+(CHARACTER O 175
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 175)
+ )
+ )
+(CHARACTER O 176
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 176)
+ )
+ )
+(CHARACTER O 177
+ (CHARWD R 0.550003)
+ (CHARHT R 0.69445)
+ (MAP
+ (SETCHAR O 177)
+ )
+ )
diff --git a/support/splint/tex/fonts/idssbx7.tfm b/support/splint/tex/fonts/idssbx7.tfm
new file mode 100644
index 0000000000..25bb930eff
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx7.tfm
Binary files differ
diff --git a/support/splint/tex/fonts/idssbx7.vf b/support/splint/tex/fonts/idssbx7.vf
new file mode 100644
index 0000000000..4c920e9b26
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx7.vf
Binary files differ
diff --git a/support/splint/tex/fonts/idssbx7.vpl b/support/splint/tex/fonts/idssbx7.vpl
new file mode 100644
index 0000000000..db652d489d
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx7.vpl
@@ -0,0 +1,913 @@
+(MAPFONT D 0 (FONTNAME cmssbx7))
+(MAPFONT D 1 (FONTNAME cmtt7))
+(DESIGNSIZE R 7.0)
+(COMMENT DESIGNSIZE IS IN POINTS)
+(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.366669)
+ (STRETCH R 0.183334)
+ (SHRINK R 0.122223)
+ (XHEIGHT R 0.45833)
+ (QUAD R 1.100006)
+ (EXTRASPACE R 0.122223)
+ )
+(LIGTABLE
+ (LABEL O 40)
+ (KRN C l R -0.255556)
+ (KRN C L R -0.293058)
+ (STOP)
+ (LABEL C f)
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ (STOP)
+ (LABEL O 13)
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ (STOP)
+ (LABEL O 140)
+ (LIG O 140 O 134)
+ (STOP)
+ (LABEL O 47)
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ (STOP)
+ (LABEL O 55)
+ (LIG O 55 O 173)
+ (STOP)
+ (LABEL O 173)
+ (LIG O 55 O 174)
+ (STOP)
+ (LABEL O 41)
+ (LIG O 140 O 74)
+ (STOP)
+ (LABEL O 77)
+ (LIG O 140 O 76)
+ (STOP)
+ (LABEL C k)
+ (LABEL C w)
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C o R -0.030557)
+ (KRN C c R -0.030557)
+ (STOP)
+ (LABEL C P)
+ (KRN C A R -0.091668)
+ (LABEL C y)
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN O 56 R -0.091668)
+ (KRN O 54 R -0.091668)
+ (STOP)
+ (LABEL C F)
+ (LABEL C V)
+ (LABEL C W)
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C u R -0.030557)
+ (KRN C r R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C A R -0.091668)
+ (LABEL C K)
+ (LABEL C X)
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ (STOP)
+ (LABEL C T)
+ (KRN C y R -0.091668)
+ (LABEL C Y)
+ (KRN C e R -0.091668)
+ (KRN C o R -0.091668)
+ (KRN C r R -0.091668)
+ (KRN C a R -0.091668)
+ (KRN C A R -0.091668)
+ (KRN C u R -0.091668)
+ (STOP)
+ (LABEL C D)
+ (LABEL C O)
+ (KRN C X R -0.030557)
+ (KRN C W R -0.030557)
+ (KRN C A R -0.030557)
+ (KRN C V R -0.030557)
+ (KRN C Y R -0.030557)
+ (STOP)
+ (LABEL C b)
+ (LABEL C o)
+ (LABEL C p)
+ (KRN C e R 0.030557)
+ (KRN C o R 0.030557)
+ (KRN C x R -0.030557)
+ (KRN C d R 0.030557)
+ (KRN C c R 0.030557)
+ (KRN C q R 0.030557)
+ (LABEL C a)
+ (KRN C r R -0.030557)
+ (LABEL C t)
+ (KRN C y R -0.030557)
+ (LABEL C u)
+ (KRN C w R -0.030557)
+ (STOP)
+ (LABEL C A)
+ (KRN C t R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C O R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C U R -0.030557)
+ (KRN C Q R -0.030557)
+ (LABEL C L)
+ (KRN C T R -0.091668)
+ (KRN C Y R -0.091668)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ (STOP)
+ (LABEL C g)
+ (KRN C j R 0.030557)
+ (STOP)
+ (LABEL C I)
+ (KRN C I R 0.030557)
+ (STOP)
+ )
+(CHARACTER O 0
+ (CHARWD R 0.58056)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 1
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 2
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 3
+ (CHARWD R 0.672228)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 4
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 5
+ (CHARWD R 0.794451)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 6
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 7
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 10
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 11
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 12
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 13
+ (CHARWD R 0.641671)
+ (CHARHT R 0.694441)
+ (CHARIC R 0.07639)
+ (COMMENT
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ )
+ )
+(CHARACTER O 14
+ (CHARWD R 0.586114)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 15
+ (CHARWD R 0.586114)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 16
+ (CHARWD R 0.891671)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 17
+ (CHARWD R 0.891671)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 20
+ (CHARWD R 0.255556)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER O 21
+ (CHARWD R 0.286113)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ )
+(CHARACTER O 22
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 23
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 24
+ (CHARWD R 0.550003)
+ (CHARHT R 0.635413)
+ )
+(CHARACTER O 25
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 26
+ (CHARWD R 0.550003)
+ (CHARHT R 0.6377735)
+ )
+(CHARACTER O 27
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 30
+ (CHARWD R 0.488892)
+ (CHARDP R 0.170137)
+ )
+(CHARACTER O 31
+ (CHARWD R 0.565279)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 32
+ (CHARWD R 0.794449)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER O 33
+ (CHARWD R 0.85556)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER O 34
+ (CHARWD R 0.550003)
+ (CHARHT R 0.5555525)
+ (CHARDP R 0.097222)
+ )
+(CHARACTER O 35
+ (CHARWD R 0.947228)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 36
+ (CHARWD R 1.069451)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 37
+ (CHARWD R 0.85556)
+ (CHARHT R 0.743051)
+ (CHARDP R 0.04861)
+ )
+(CHARACTER O 40
+ (CHARWD R 0.255556)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (KRN C l R -0.255556)
+ (KRN C L R -0.293058)
+ )
+ )
+(CHARACTER O 41
+ (CHARWD R 0.366669)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (LIG O 140 O 74)
+ )
+ )
+(CHARACTER O 42
+ (CHARWD R 0.558334)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 43
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694441)
+ (CHARDP R 0.194441)
+ )
+(CHARACTER O 44
+ (CHARWD R 0.550003)
+ (CHARHT R 0.749998)
+ (CHARDP R 0.055557)
+ )
+(CHARACTER O 45
+ (CHARWD R 1.029116)
+ (CHARHT R 0.749998)
+ (CHARDP R 0.055557)
+ )
+(CHARACTER O 46
+ (CHARWD R 0.83056)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 47
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ )
+ )
+(CHARACTER O 50
+ (CHARWD R 0.42778)
+ (CHARHT R 0.749998)
+ (CHARDP R 0.249995)
+ )
+(CHARACTER O 51
+ (CHARWD R 0.42778)
+ (CHARHT R 0.749998)
+ (CHARDP R 0.249995)
+ )
+(CHARACTER O 52
+ (CHARWD R 0.550003)
+ (CHARHT R 0.749998)
+ )
+(CHARACTER O 53
+ (CHARWD R 0.85556)
+ (CHARHT R 0.616669)
+ (CHARDP R 0.116669)
+ )
+(CHARACTER O 54
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130554)
+ (CHARDP R 0.105556)
+ )
+(CHARACTER O 55
+ (CHARWD R 0.366669)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (LIG O 55 O 173)
+ )
+ )
+(CHARACTER O 56
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130554)
+ )
+(CHARACTER O 57
+ (CHARWD R 0.550003)
+ (CHARHT R 0.749998)
+ (CHARDP R 0.249995)
+ )
+(CHARACTER C 0
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C 1
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C 2
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C 3
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C 4
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C 5
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C 6
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C 7
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C 8
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C 9
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 72
+ (CHARWD R 0.305557)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER O 73
+ (CHARWD R 0.305557)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.105556)
+ )
+(CHARACTER O 74
+ (CHARWD R 0.366669)
+ (CHARHT R 0.499998)
+ (CHARDP R 0.194443)
+ )
+(CHARACTER O 75
+ (CHARWD R 0.85556)
+ (CHARHT R 0.40625)
+ (CHARDP R -0.09375)
+ )
+(CHARACTER O 76
+ (CHARWD R 0.519448)
+ (CHARHT R 0.499998)
+ (CHARDP R 0.194443)
+ )
+(CHARACTER O 77
+ (CHARWD R 0.519448)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (LIG O 140 O 76)
+ )
+ )
+(CHARACTER O 100
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C A
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C t R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C O R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C U R -0.030557)
+ (KRN C Q R -0.030557)
+ (KRN C T R -0.091668)
+ (KRN C Y R -0.091668)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ )
+(CHARACTER C B
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C C
+ (CHARWD R 0.702783)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C D
+ (CHARWD R 0.794451)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C X R -0.030557)
+ (KRN C W R -0.030557)
+ (KRN C A R -0.030557)
+ (KRN C V R -0.030557)
+ (KRN C Y R -0.030557)
+ )
+ )
+(CHARACTER C E
+ (CHARWD R 0.641671)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C F
+ (CHARWD R 0.611116)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C u R -0.030557)
+ (KRN C r R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C A R -0.091668)
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ )
+(CHARACTER C G
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C H
+ (CHARWD R 0.794451)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C I
+ (CHARWD R 0.330558)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C I R 0.030557)
+ )
+ )
+(CHARACTER C J
+ (CHARWD R 0.519448)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C K
+ (CHARWD R 0.763896)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ )
+(CHARACTER C L
+ (CHARWD R 0.58056)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C T R -0.091668)
+ (KRN C Y R -0.091668)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ )
+(CHARACTER C M
+ (CHARWD R 0.977785)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C N
+ (CHARWD R 0.794451)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C O
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C X R -0.030557)
+ (KRN C W R -0.030557)
+ (KRN C A R -0.030557)
+ (KRN C V R -0.030557)
+ (KRN C Y R -0.030557)
+ )
+ )
+(CHARACTER C P
+ (CHARWD R 0.702783)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C A R -0.091668)
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN O 56 R -0.091668)
+ (KRN O 54 R -0.091668)
+ )
+ )
+(CHARACTER C Q
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694441)
+ (CHARDP R 0.105556)
+ )
+(CHARACTER C R
+ (CHARWD R 0.702783)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C S
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C T
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C y R -0.091668)
+ (KRN C e R -0.091668)
+ (KRN C o R -0.091668)
+ (KRN C r R -0.091668)
+ (KRN C a R -0.091668)
+ (KRN C A R -0.091668)
+ (KRN C u R -0.091668)
+ )
+ )
+(CHARACTER C U
+ (CHARWD R 0.763896)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C V
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694441)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C u R -0.030557)
+ (KRN C r R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C A R -0.091668)
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ )
+(CHARACTER C W
+ (CHARWD R 1.038897)
+ (CHARHT R 0.694441)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C u R -0.030557)
+ (KRN C r R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C A R -0.091668)
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ )
+(CHARACTER C X
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ )
+(CHARACTER C Y
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694441)
+ (CHARIC R 0.027501)
+ (COMMENT
+ (KRN C e R -0.091668)
+ (KRN C o R -0.091668)
+ (KRN C r R -0.091668)
+ (KRN C a R -0.091668)
+ (KRN C A R -0.091668)
+ (KRN C u R -0.091668)
+ )
+ )
+(CHARACTER C Z
+ (CHARWD R 0.672226)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 133
+ (CHARWD R 0.343059)
+ (CHARHT R 0.749998)
+ (CHARDP R 0.249995)
+ )
+(CHARACTER O 134
+ (CHARWD R 0.558334)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 135
+ (CHARWD R 0.343059)
+ (CHARHT R 0.749998)
+ (CHARDP R 0.249995)
+ )
+(CHARACTER O 136
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 137
+ (CHARWD R 0.5464325)
+ (CHARDP R 0.098109)
+ (MAP
+ (SELECTFONT D 1)
+ (SETCHAR O 0137)
+ )
+ )
+(CHARACTER O 140
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (LIG O 140 O 134)
+ )
+ )
+(CHARACTER C a
+ (CHARWD R 0.5250025)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (KRN C r R -0.030557)
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ )
+(CHARACTER C b
+ (CHARWD R 0.561113)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C e R 0.030557)
+ (KRN C o R 0.030557)
+ (KRN C x R -0.030557)
+ (KRN C d R 0.030557)
+ (KRN C c R 0.030557)
+ (KRN C q R 0.030557)
+ (KRN C r R -0.030557)
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ )
+(CHARACTER C c
+ (CHARWD R 0.488892)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER C d
+ (CHARWD R 0.561113)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C e
+ (CHARWD R 0.511115)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER C f
+ (CHARWD R 0.336114)
+ (CHARHT R 0.694441)
+ (CHARIC R 0.07639)
+ (COMMENT
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.07639)
+ (KRN O 77 R 0.07639)
+ (KRN O 41 R 0.07639)
+ (KRN O 51 R 0.07639)
+ (KRN O 135 R 0.07639)
+ )
+ )
+(CHARACTER C g
+ (CHARWD R 0.550003)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C j R 0.030557)
+ )
+ )
+(CHARACTER C h
+ (CHARWD R 0.561113)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C i
+ (CHARWD R 0.255556)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C j
+ (CHARWD R 0.286113)
+ (CHARHT R 0.694441)
+ (CHARDP R 0.194443)
+ )
+(CHARACTER C k
+ (CHARWD R 0.530559)
+ (CHARHT R 0.694441)
+ (COMMENT
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C o R -0.030557)
+ (KRN C c R -0.030557)
+ )
+ )
+(CHARACTER C l
+ (CHARWD R 0.255556)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER C m
+ (CHARWD R 0.866671)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER C n
+ (CHARWD R 0.561113)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER C o
+ (CHARWD R 0.550003)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (KRN C e R 0.030557)
+ (KRN C o R 0.030557)
+ (KRN C x R -0.030557)
+ (KRN C d R 0.030557)
+ (KRN C c R 0.030557)
+ (KRN C q R 0.030557)
+ (KRN C r R -0.030557)
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ )
+(CHARACTER C p
+ (CHARWD R 0.561113)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ (COMMENT
+ (KRN C e R 0.030557)
+ (KRN C o R 0.030557)
+ (KRN C x R -0.030557)
+ (KRN C d R 0.030557)
+ (KRN C c R 0.030557)
+ (KRN C q R 0.030557)
+ (KRN C r R -0.030557)
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ )
+(CHARACTER C q
+ (CHARWD R 0.561113)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ )
+(CHARACTER C r
+ (CHARWD R 0.372225)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.015279)
+ )
+(CHARACTER C s
+ (CHARWD R 0.42167)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER C t
+ (CHARWD R 0.404168)
+ (CHARHT R 0.589286)
+ (COMMENT
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ )
+(CHARACTER C u
+ (CHARWD R 0.561113)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (KRN C w R -0.030557)
+ )
+ )
+(CHARACTER C v
+ (CHARWD R 0.500002)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.015279)
+ )
+(CHARACTER C w
+ (CHARWD R 0.744448)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C o R -0.030557)
+ (KRN C c R -0.030557)
+ )
+ )
+(CHARACTER C x
+ (CHARWD R 0.500002)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER C y
+ (CHARWD R 0.500002)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ (CHARIC R 0.015279)
+ (COMMENT
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN O 56 R -0.091668)
+ (KRN O 54 R -0.091668)
+ )
+ )
+(CHARACTER C z
+ (CHARWD R 0.47639)
+ (CHARHT R 0.45833)
+ )
+(CHARACTER O 173
+ (CHARWD R 0.550003)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.030557)
+ (COMMENT
+ (LIG O 55 O 174)
+ )
+ )
+(CHARACTER O 174
+ (CHARWD R 1.100006)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.030557)
+ )
+(CHARACTER O 175
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 176
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
+(CHARACTER O 177
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694441)
+ )
diff --git a/support/splint/tex/fonts/idssbx8.tfm b/support/splint/tex/fonts/idssbx8.tfm
new file mode 100644
index 0000000000..4cea679434
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx8.tfm
Binary files differ
diff --git a/support/splint/tex/fonts/idssbx8.vf b/support/splint/tex/fonts/idssbx8.vf
new file mode 100644
index 0000000000..b7b988e26d
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx8.vf
Binary files differ
diff --git a/support/splint/tex/fonts/idssbx8.vpl b/support/splint/tex/fonts/idssbx8.vpl
new file mode 100644
index 0000000000..57db1d6090
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx8.vpl
@@ -0,0 +1,1310 @@
+(VTITLE )
+(FAMILY UNSPECIFIED)
+(FACE F MRR)
+(CODINGSCHEME UNSPECIFIED)
+(DESIGNSIZE R 8.0)
+(COMMENT DESIGNSIZE IS IN POINTS)
+(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
+(CHECKSUM O 4723356700)
+(SEVENBITSAFEFLAG TRUE)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.366669)
+ (STRETCH R 0.183334)
+ (SHRINK R 0.122223)
+ (XHEIGHT R 0.458336)
+ (QUAD R 1.100006)
+ (EXTRASPACE R 0.122223)
+ )
+(MAPFONT D 0
+ (FONTNAME cmssbx8)
+ (FONTCHECKSUM O 1731613541)
+ (FONTAT R 1.0)
+ (FONTDSIZE R 8.0)
+ )
+(MAPFONT D 1
+ (FONTNAME cmtt8)
+ (FONTCHECKSUM O 33720745163)
+ (FONTAT R 1.0)
+ (FONTDSIZE R 8.0)
+ )
+(LIGTABLE
+ (LABEL O 40)
+ (KRN C l R -0.255558)
+ (KRN C L R -0.293058)
+ (STOP)
+ (LABEL C f)
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ (STOP)
+ (LABEL O 13)
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ (STOP)
+ (LABEL O 140)
+ (LIG O 140 O 134)
+ (STOP)
+ (LABEL O 47)
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ (STOP)
+ (LABEL O 55)
+ (LIG O 55 O 173)
+ (STOP)
+ (LABEL O 173)
+ (LIG O 55 O 174)
+ (STOP)
+ (LABEL O 41)
+ (LIG O 140 O 74)
+ (STOP)
+ (LABEL O 77)
+ (LIG O 140 O 76)
+ (STOP)
+ (LABEL C k)
+ (LABEL C w)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ (STOP)
+ (LABEL C P)
+ (KRN C A R -0.091667)
+ (LABEL C y)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ (STOP)
+ (LABEL C F)
+ (LABEL C V)
+ (LABEL C W)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (LABEL C K)
+ (LABEL C X)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ (STOP)
+ (LABEL C T)
+ (KRN C y R -0.091667)
+ (LABEL C Y)
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ (STOP)
+ (LABEL C D)
+ (LABEL C O)
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ (STOP)
+ (LABEL C b)
+ (LABEL C o)
+ (LABEL C p)
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (LABEL C a)
+ (KRN C r R -0.030556)
+ (LABEL C t)
+ (KRN C y R -0.030556)
+ (LABEL C u)
+ (KRN C w R -0.030556)
+ (STOP)
+ (LABEL C A)
+ (KRN C t R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C O R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C U R -0.030556)
+ (KRN C Q R -0.030556)
+ (LABEL C L)
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ (STOP)
+ (LABEL C g)
+ (KRN C j R 0.030556)
+ (STOP)
+ (LABEL C I)
+ (KRN C I R 0.030556)
+ (STOP)
+ )
+(CHARACTER O 0
+ (CHARWD R 0.580559)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 0)
+ )
+ )
+(CHARACTER O 1
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 1)
+ )
+ )
+(CHARACTER O 2
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 2)
+ )
+ )
+(CHARACTER O 3
+ (CHARWD R 0.672226)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 3)
+ )
+ )
+(CHARACTER O 4
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 4)
+ )
+ )
+(CHARACTER O 5
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 5)
+ )
+ )
+(CHARACTER O 6
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 6)
+ )
+ )
+(CHARACTER O 7
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 7)
+ )
+ )
+(CHARACTER O 10
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 10)
+ )
+ )
+(CHARACTER O 11
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 11)
+ )
+ )
+(CHARACTER O 12
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 12)
+ )
+ )
+(CHARACTER O 13
+ (CHARWD R 0.64167)
+ (CHARHT R 0.694447)
+ (CHARIC R 0.076389)
+ (COMMENT
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ )
+ (MAP
+ (SETCHAR O 13)
+ )
+ )
+(CHARACTER O 14
+ (CHARWD R 0.586115)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 14)
+ )
+ )
+(CHARACTER O 15
+ (CHARWD R 0.586115)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 15)
+ )
+ )
+(CHARACTER O 16
+ (CHARWD R 0.891672)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 16)
+ )
+ )
+(CHARACTER O 17
+ (CHARWD R 0.891672)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 17)
+ )
+ )
+(CHARACTER O 20
+ (CHARWD R 0.255558)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR O 20)
+ )
+ )
+(CHARACTER O 21
+ (CHARWD R 0.286114)
+ (CHARHT R 0.458336)
+ (CHARDP R 0.194445)
+ (MAP
+ (SETCHAR O 21)
+ )
+ )
+(CHARACTER O 22
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 22)
+ )
+ )
+(CHARACTER O 23
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 23)
+ )
+ )
+(CHARACTER O 24
+ (CHARWD R 0.550003)
+ (CHARHT R 0.63542)
+ (MAP
+ (SETCHAR O 24)
+ )
+ )
+(CHARACTER O 25
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 25)
+ )
+ )
+(CHARACTER O 26
+ (CHARWD R 0.550003)
+ (CHARHT R 0.637777)
+ (MAP
+ (SETCHAR O 26)
+ )
+ )
+(CHARACTER O 27
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 27)
+ )
+ )
+(CHARACTER O 30
+ (CHARWD R 0.488892)
+ (CHARDP R 0.170139)
+ (MAP
+ (SETCHAR O 30)
+ )
+ )
+(CHARACTER O 31
+ (CHARWD R 0.565281)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 31)
+ )
+ )
+(CHARACTER O 32
+ (CHARWD R 0.794449)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR O 32)
+ )
+ )
+(CHARACTER O 33
+ (CHARWD R 0.85556)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR O 33)
+ )
+ )
+(CHARACTER O 34
+ (CHARWD R 0.550003)
+ (CHARHT R 0.555559)
+ (CHARDP R 0.097223)
+ (MAP
+ (SETCHAR O 34)
+ )
+ )
+(CHARACTER O 35
+ (CHARWD R 0.9472275)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 35)
+ )
+ )
+(CHARACTER O 36
+ (CHARWD R 1.06945)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 36)
+ )
+ )
+(CHARACTER O 37
+ (CHARWD R 0.85556)
+ (CHARHT R 0.743057)
+ (CHARDP R 0.048611)
+ (MAP
+ (SETCHAR O 37)
+ )
+ )
+(CHARACTER O 40
+ (CHARWD R 0.255558)
+ (CHARHT R 0.458336)
+ (COMMENT
+ (KRN C l R -0.255558)
+ (KRN C L R -0.293058)
+ )
+ (MAP
+ (SETCHAR O 40)
+ )
+ )
+(CHARACTER O 41
+ (CHARWD R 0.366669)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (LIG O 140 O 74)
+ )
+ (MAP
+ (SETCHAR O 41)
+ )
+ )
+(CHARACTER O 42
+ (CHARWD R 0.558336)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 42)
+ )
+ )
+(CHARACTER O 43
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694447)
+ (CHARDP R 0.194443)
+ (MAP
+ (SETCHAR O 43)
+ )
+ )
+(CHARACTER O 44
+ (CHARWD R 0.550003)
+ (CHARHT R 0.750004)
+ (CHARDP R 0.055557)
+ (MAP
+ (SETCHAR O 44)
+ )
+ )
+(CHARACTER O 45
+ (CHARWD R 1.029121)
+ (CHARHT R 0.750004)
+ (CHARDP R 0.055557)
+ (MAP
+ (SETCHAR O 45)
+ )
+ )
+(CHARACTER O 46
+ (CHARWD R 0.830561)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 46)
+ )
+ )
+(CHARACTER O 47
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ )
+ (MAP
+ (SETCHAR O 47)
+ )
+ )
+(CHARACTER O 50
+ (CHARWD R 0.42778)
+ (CHARHT R 0.750004)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 50)
+ )
+ )
+(CHARACTER O 51
+ (CHARWD R 0.42778)
+ (CHARHT R 0.750004)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 51)
+ )
+ )
+(CHARACTER O 52
+ (CHARWD R 0.550003)
+ (CHARHT R 0.750004)
+ (MAP
+ (SETCHAR O 52)
+ )
+ )
+(CHARACTER O 53
+ (CHARWD R 0.85556)
+ (CHARHT R 0.616671)
+ (CHARDP R 0.116667)
+ (MAP
+ (SETCHAR O 53)
+ )
+ )
+(CHARACTER O 54
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130556)
+ (CHARDP R 0.1055565)
+ (MAP
+ (SETCHAR O 54)
+ )
+ )
+(CHARACTER O 55
+ (CHARWD R 0.366669)
+ (CHARHT R 0.458336)
+ (COMMENT
+ (LIG O 55 O 173)
+ )
+ (MAP
+ (SETCHAR O 55)
+ )
+ )
+(CHARACTER O 56
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130556)
+ (MAP
+ (SETCHAR O 56)
+ )
+ )
+(CHARACTER O 57
+ (CHARWD R 0.550003)
+ (CHARHT R 0.750004)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 57)
+ )
+ )
+(CHARACTER C 0
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 0)
+ )
+ )
+(CHARACTER C 1
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 1)
+ )
+ )
+(CHARACTER C 2
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 2)
+ )
+ )
+(CHARACTER C 3
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 3)
+ )
+ )
+(CHARACTER C 4
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 4)
+ )
+ )
+(CHARACTER C 5
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 5)
+ )
+ )
+(CHARACTER C 6
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 6)
+ )
+ )
+(CHARACTER C 7
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 7)
+ )
+ )
+(CHARACTER C 8
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 8)
+ )
+ )
+(CHARACTER C 9
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C 9)
+ )
+ )
+(CHARACTER O 72
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR O 72)
+ )
+ )
+(CHARACTER O 73
+ (CHARWD R 0.305557)
+ (CHARHT R 0.458336)
+ (CHARDP R 0.1055565)
+ (MAP
+ (SETCHAR O 73)
+ )
+ )
+(CHARACTER O 74
+ (CHARWD R 0.366669)
+ (CHARHT R 0.500002)
+ (CHARDP R 0.194445)
+ (MAP
+ (SETCHAR O 74)
+ )
+ )
+(CHARACTER O 75
+ (CHARWD R 0.85556)
+ (CHARHT R 0.406254)
+ (CHARDP R -0.09375)
+ (MAP
+ (SETCHAR O 75)
+ )
+ )
+(CHARACTER O 76
+ (CHARWD R 0.519447)
+ (CHARHT R 0.500002)
+ (CHARDP R 0.194445)
+ (MAP
+ (SETCHAR O 76)
+ )
+ )
+(CHARACTER O 77
+ (CHARWD R 0.519447)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (LIG O 140 O 76)
+ )
+ (MAP
+ (SETCHAR O 77)
+ )
+ )
+(CHARACTER O 100
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 100)
+ )
+ )
+(CHARACTER C A
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C t R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C O R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C U R -0.030556)
+ (KRN C Q R -0.030556)
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ (MAP
+ (SETCHAR C A)
+ )
+ )
+(CHARACTER C B
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C B)
+ )
+ )
+(CHARACTER C C
+ (CHARWD R 0.702782)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C C)
+ )
+ )
+(CHARACTER C D
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ )
+ (MAP
+ (SETCHAR C D)
+ )
+ )
+(CHARACTER C E
+ (CHARWD R 0.64167)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C E)
+ )
+ )
+(CHARACTER C F
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C F)
+ )
+ )
+(CHARACTER C G
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C G)
+ )
+ )
+(CHARACTER C H
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C H)
+ )
+ )
+(CHARACTER C I
+ (CHARWD R 0.330557)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C I R 0.030556)
+ )
+ (MAP
+ (SETCHAR C I)
+ )
+ )
+(CHARACTER C J
+ (CHARWD R 0.519447)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C J)
+ )
+ )
+(CHARACTER C K
+ (CHARWD R 0.763893)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C K)
+ )
+ )
+(CHARACTER C L
+ (CHARWD R 0.580559)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C T R -0.091667)
+ (KRN C Y R -0.091667)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ (MAP
+ (SETCHAR C L)
+ )
+ )
+(CHARACTER C M
+ (CHARWD R 0.977783)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C M)
+ )
+ )
+(CHARACTER C N
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C N)
+ )
+ )
+(CHARACTER C O
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C X R -0.030556)
+ (KRN C W R -0.030556)
+ (KRN C A R -0.030556)
+ (KRN C V R -0.030556)
+ (KRN C Y R -0.030556)
+ )
+ (MAP
+ (SETCHAR C O)
+ )
+ )
+(CHARACTER C P
+ (CHARWD R 0.702782)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C A R -0.091667)
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ )
+ (MAP
+ (SETCHAR C P)
+ )
+ )
+(CHARACTER C Q
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694447)
+ (CHARDP R 0.1055565)
+ (MAP
+ (SETCHAR C Q)
+ )
+ )
+(CHARACTER C R
+ (CHARWD R 0.702782)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C R)
+ )
+ )
+(CHARACTER C S
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C S)
+ )
+ )
+(CHARACTER C T
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C y R -0.091667)
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ )
+ (MAP
+ (SETCHAR C T)
+ )
+ )
+(CHARACTER C U
+ (CHARWD R 0.763893)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C U)
+ )
+ )
+(CHARACTER C V
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C V)
+ )
+ )
+(CHARACTER C W
+ (CHARWD R 1.038895)
+ (CHARHT R 0.694447)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C u R -0.030556)
+ (KRN C r R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C A R -0.091667)
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C W)
+ )
+ )
+(CHARACTER C X
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C O R -0.030556)
+ (KRN C C R -0.030556)
+ (KRN C G R -0.030556)
+ (KRN C Q R -0.030556)
+ )
+ (MAP
+ (SETCHAR C X)
+ )
+ )
+(CHARACTER C Y
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694447)
+ (CHARIC R 0.0275)
+ (COMMENT
+ (KRN C e R -0.091667)
+ (KRN C o R -0.091667)
+ (KRN C r R -0.091667)
+ (KRN C a R -0.091667)
+ (KRN C A R -0.091667)
+ (KRN C u R -0.091667)
+ )
+ (MAP
+ (SETCHAR C Y)
+ )
+ )
+(CHARACTER C Z
+ (CHARWD R 0.672226)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C Z)
+ )
+ )
+(CHARACTER O 133
+ (CHARWD R 0.343058)
+ (CHARHT R 0.750004)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 133)
+ )
+ )
+(CHARACTER O 134
+ (CHARWD R 0.558336)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 134)
+ )
+ )
+(CHARACTER O 135
+ (CHARWD R 0.343058)
+ (CHARHT R 0.750004)
+ (CHARDP R 0.25)
+ (MAP
+ (SETCHAR O 135)
+ )
+ )
+(CHARACTER O 136
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 136)
+ )
+ )
+(CHARACTER O 137
+ (CHARWD R 0.531258)
+ (CHARDP R 0.098606)
+ (MAP
+ (SELECTFONT D 1)
+ (SETCHAR O 137)
+ )
+ )
+(CHARACTER O 140
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (LIG O 140 O 134)
+ )
+ (MAP
+ (SETCHAR O 140)
+ )
+ )
+(CHARACTER C a
+ (CHARWD R 0.525003)
+ (CHARHT R 0.458336)
+ (COMMENT
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C a)
+ )
+ )
+(CHARACTER C b
+ (CHARWD R 0.561115)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C b)
+ )
+ )
+(CHARACTER C c
+ (CHARWD R 0.488892)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR C c)
+ )
+ )
+(CHARACTER C d
+ (CHARWD R 0.561115)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C d)
+ )
+ )
+(CHARACTER C e
+ (CHARWD R 0.511114)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR C e)
+ )
+ )
+(CHARACTER C f
+ (CHARWD R 0.336113)
+ (CHARHT R 0.694447)
+ (CHARIC R 0.076389)
+ (COMMENT
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ )
+ (MAP
+ (SETCHAR C f)
+ )
+ )
+(CHARACTER C g
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458336)
+ (CHARDP R 0.194445)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C j R 0.030556)
+ )
+ (MAP
+ (SETCHAR C g)
+ )
+ )
+(CHARACTER C h
+ (CHARWD R 0.561115)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C h)
+ )
+ )
+(CHARACTER C i
+ (CHARWD R 0.255558)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C i)
+ )
+ )
+(CHARACTER C j
+ (CHARWD R 0.286114)
+ (CHARHT R 0.694447)
+ (CHARDP R 0.194445)
+ (MAP
+ (SETCHAR C j)
+ )
+ )
+(CHARACTER C k
+ (CHARWD R 0.53056)
+ (CHARHT R 0.694447)
+ (COMMENT
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ )
+ (MAP
+ (SETCHAR C k)
+ )
+ )
+(CHARACTER C l
+ (CHARWD R 0.255558)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR C l)
+ )
+ )
+(CHARACTER C m
+ (CHARWD R 0.8666725)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR C m)
+ )
+ )
+(CHARACTER C n
+ (CHARWD R 0.561115)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR C n)
+ )
+ )
+(CHARACTER C o
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458336)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C o)
+ )
+ )
+(CHARACTER C p
+ (CHARWD R 0.561115)
+ (CHARHT R 0.458336)
+ (CHARDP R 0.194445)
+ (COMMENT
+ (KRN C e R 0.030556)
+ (KRN C o R 0.030556)
+ (KRN C x R -0.030556)
+ (KRN C d R 0.030556)
+ (KRN C c R 0.030556)
+ (KRN C q R 0.030556)
+ (KRN C r R -0.030556)
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C p)
+ )
+ )
+(CHARACTER C q
+ (CHARWD R 0.561115)
+ (CHARHT R 0.458336)
+ (CHARDP R 0.194445)
+ (MAP
+ (SETCHAR C q)
+ )
+ )
+(CHARACTER C r
+ (CHARWD R 0.372225)
+ (CHARHT R 0.458336)
+ (CHARIC R 0.015278)
+ (MAP
+ (SETCHAR C r)
+ )
+ )
+(CHARACTER C s
+ (CHARWD R 0.421669)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR C s)
+ )
+ )
+(CHARACTER C t
+ (CHARWD R 0.404169)
+ (CHARHT R 0.589293)
+ (COMMENT
+ (KRN C y R -0.030556)
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C t)
+ )
+ )
+(CHARACTER C u
+ (CHARWD R 0.561115)
+ (CHARHT R 0.458336)
+ (COMMENT
+ (KRN C w R -0.030556)
+ )
+ (MAP
+ (SETCHAR C u)
+ )
+ )
+(CHARACTER C v
+ (CHARWD R 0.500004)
+ (CHARHT R 0.458336)
+ (CHARIC R 0.015278)
+ (MAP
+ (SETCHAR C v)
+ )
+ )
+(CHARACTER C w
+ (CHARWD R 0.74445)
+ (CHARHT R 0.458336)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN C o R -0.030556)
+ (KRN C c R -0.030556)
+ )
+ (MAP
+ (SETCHAR C w)
+ )
+ )
+(CHARACTER C x
+ (CHARWD R 0.500004)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR C x)
+ )
+ )
+(CHARACTER C y
+ (CHARWD R 0.500004)
+ (CHARHT R 0.458336)
+ (CHARDP R 0.194445)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C o R -0.030556)
+ (KRN C e R -0.030556)
+ (KRN C a R -0.030556)
+ (KRN O 56 R -0.091667)
+ (KRN O 54 R -0.091667)
+ )
+ (MAP
+ (SETCHAR C y)
+ )
+ )
+(CHARACTER C z
+ (CHARWD R 0.476391)
+ (CHARHT R 0.458336)
+ (MAP
+ (SETCHAR C z)
+ )
+ )
+(CHARACTER O 173
+ (CHARWD R 0.550003)
+ (CHARHT R 0.458336)
+ (CHARIC R 0.030556)
+ (COMMENT
+ (LIG O 55 O 174)
+ )
+ (MAP
+ (SETCHAR O 173)
+ )
+ )
+(CHARACTER O 174
+ (CHARWD R 1.100006)
+ (CHARHT R 0.458336)
+ (CHARIC R 0.030556)
+ (MAP
+ (SETCHAR O 174)
+ )
+ )
+(CHARACTER O 175
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 175)
+ )
+ )
+(CHARACTER O 176
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 176)
+ )
+ )
+(CHARACTER O 177
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694447)
+ (MAP
+ (SETCHAR O 177)
+ )
+ )
diff --git a/support/splint/tex/fonts/idssbx9.tfm b/support/splint/tex/fonts/idssbx9.tfm
new file mode 100644
index 0000000000..115613ee9e
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx9.tfm
Binary files differ
diff --git a/support/splint/tex/fonts/idssbx9.vf b/support/splint/tex/fonts/idssbx9.vf
new file mode 100644
index 0000000000..6400d32378
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx9.vf
Binary files differ
diff --git a/support/splint/tex/fonts/idssbx9.vpl b/support/splint/tex/fonts/idssbx9.vpl
new file mode 100644
index 0000000000..6aed8d41c9
--- /dev/null
+++ b/support/splint/tex/fonts/idssbx9.vpl
@@ -0,0 +1,1310 @@
+(VTITLE )
+(FAMILY UNSPECIFIED)
+(FACE F MRR)
+(CODINGSCHEME UNSPECIFIED)
+(DESIGNSIZE R 9.0)
+(COMMENT DESIGNSIZE IS IN POINTS)
+(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
+(CHECKSUM O 12247465251)
+(SEVENBITSAFEFLAG TRUE)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.366669)
+ (STRETCH R 0.183334)
+ (SHRINK R 0.122223)
+ (XHEIGHT R 0.45833)
+ (QUAD R 1.100006)
+ (EXTRASPACE R 0.122223)
+ )
+(MAPFONT D 0
+ (FONTNAME cmssbx9)
+ (FONTCHECKSUM O 37341233162)
+ (FONTAT R 1.0)
+ (FONTDSIZE R 9.0)
+ )
+(MAPFONT D 1
+ (FONTNAME cmtt9)
+ (FONTCHECKSUM O 33751047000)
+ (FONTAT R 1.0)
+ (FONTDSIZE R 9.0)
+ )
+(LIGTABLE
+ (LABEL O 40)
+ (KRN C l R -0.255556)
+ (KRN C L R -0.293058)
+ (STOP)
+ (LABEL C f)
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ (STOP)
+ (LABEL O 13)
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ (STOP)
+ (LABEL O 140)
+ (LIG O 140 O 134)
+ (STOP)
+ (LABEL O 47)
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ (STOP)
+ (LABEL O 55)
+ (LIG O 55 O 173)
+ (STOP)
+ (LABEL O 173)
+ (LIG O 55 O 174)
+ (STOP)
+ (LABEL O 41)
+ (LIG O 140 O 74)
+ (STOP)
+ (LABEL O 77)
+ (LIG O 140 O 76)
+ (STOP)
+ (LABEL C k)
+ (LABEL C w)
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C o R -0.030557)
+ (KRN C c R -0.030557)
+ (STOP)
+ (LABEL C P)
+ (KRN C A R -0.091668)
+ (LABEL C y)
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN O 56 R -0.091668)
+ (KRN O 54 R -0.091668)
+ (STOP)
+ (LABEL C F)
+ (LABEL C V)
+ (LABEL C W)
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C u R -0.030557)
+ (KRN C r R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C A R -0.091668)
+ (LABEL C K)
+ (LABEL C X)
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ (STOP)
+ (LABEL C T)
+ (KRN C y R -0.091668)
+ (LABEL C Y)
+ (KRN C e R -0.091668)
+ (KRN C o R -0.091668)
+ (KRN C r R -0.091668)
+ (KRN C a R -0.091668)
+ (KRN C A R -0.091668)
+ (KRN C u R -0.091668)
+ (STOP)
+ (LABEL C D)
+ (LABEL C O)
+ (KRN C X R -0.030557)
+ (KRN C W R -0.030557)
+ (KRN C A R -0.030557)
+ (KRN C V R -0.030557)
+ (KRN C Y R -0.030557)
+ (STOP)
+ (LABEL C b)
+ (LABEL C o)
+ (LABEL C p)
+ (KRN C e R 0.030557)
+ (KRN C o R 0.030557)
+ (KRN C x R -0.030557)
+ (KRN C d R 0.030557)
+ (KRN C c R 0.030557)
+ (KRN C q R 0.030557)
+ (LABEL C a)
+ (KRN C r R -0.030557)
+ (LABEL C t)
+ (KRN C y R -0.030557)
+ (LABEL C u)
+ (KRN C w R -0.030557)
+ (STOP)
+ (LABEL C A)
+ (KRN C t R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C O R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C U R -0.030557)
+ (KRN C Q R -0.030557)
+ (LABEL C L)
+ (KRN C T R -0.091668)
+ (KRN C Y R -0.091668)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ (STOP)
+ (LABEL C g)
+ (KRN C j R 0.030557)
+ (STOP)
+ (LABEL C I)
+ (KRN C I R 0.030557)
+ (STOP)
+ )
+(CHARACTER O 0
+ (CHARWD R 0.58056)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 0)
+ )
+ )
+(CHARACTER O 1
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 1)
+ )
+ )
+(CHARACTER O 2
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 2)
+ )
+ )
+(CHARACTER O 3
+ (CHARWD R 0.672228)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 3)
+ )
+ )
+(CHARACTER O 4
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 4)
+ )
+ )
+(CHARACTER O 5
+ (CHARWD R 0.794451)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 5)
+ )
+ )
+(CHARACTER O 6
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 6)
+ )
+ )
+(CHARACTER O 7
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 7)
+ )
+ )
+(CHARACTER O 10
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 10)
+ )
+ )
+(CHARACTER O 11
+ (CHARWD R 0.85556)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 11)
+ )
+ )
+(CHARACTER O 12
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 12)
+ )
+ )
+(CHARACTER O 13
+ (CHARWD R 0.641671)
+ (CHARHT R 0.694439)
+ (CHARIC R 0.076389)
+ (COMMENT
+ (LIG C i O 16)
+ (LIG C l O 17)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ )
+ (MAP
+ (SETCHAR O 13)
+ )
+ )
+(CHARACTER O 14
+ (CHARWD R 0.586114)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 14)
+ )
+ )
+(CHARACTER O 15
+ (CHARWD R 0.586114)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 15)
+ )
+ )
+(CHARACTER O 16
+ (CHARWD R 0.891671)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 16)
+ )
+ )
+(CHARACTER O 17
+ (CHARWD R 0.891671)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 17)
+ )
+ )
+(CHARACTER O 20
+ (CHARWD R 0.255556)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR O 20)
+ )
+ )
+(CHARACTER O 21
+ (CHARWD R 0.286113)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ (MAP
+ (SETCHAR O 21)
+ )
+ )
+(CHARACTER O 22
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 22)
+ )
+ )
+(CHARACTER O 23
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 23)
+ )
+ )
+(CHARACTER O 24
+ (CHARWD R 0.550003)
+ (CHARHT R 0.635411)
+ (MAP
+ (SETCHAR O 24)
+ )
+ )
+(CHARACTER O 25
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 25)
+ )
+ )
+(CHARACTER O 26
+ (CHARWD R 0.550003)
+ (CHARHT R 0.63777)
+ (MAP
+ (SETCHAR O 26)
+ )
+ )
+(CHARACTER O 27
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 27)
+ )
+ )
+(CHARACTER O 30
+ (CHARWD R 0.488892)
+ (CHARDP R 0.170137)
+ (MAP
+ (SETCHAR O 30)
+ )
+ )
+(CHARACTER O 31
+ (CHARWD R 0.565279)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 31)
+ )
+ )
+(CHARACTER O 32
+ (CHARWD R 0.794449)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR O 32)
+ )
+ )
+(CHARACTER O 33
+ (CHARWD R 0.85556)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR O 33)
+ )
+ )
+(CHARACTER O 34
+ (CHARWD R 0.550003)
+ (CHARHT R 0.5555525)
+ (CHARDP R 0.097222)
+ (MAP
+ (SETCHAR O 34)
+ )
+ )
+(CHARACTER O 35
+ (CHARWD R 0.947228)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 35)
+ )
+ )
+(CHARACTER O 36
+ (CHARWD R 1.069451)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 36)
+ )
+ )
+(CHARACTER O 37
+ (CHARWD R 0.85556)
+ (CHARHT R 0.743051)
+ (CHARDP R 0.048611)
+ (MAP
+ (SETCHAR O 37)
+ )
+ )
+(CHARACTER O 40
+ (CHARWD R 0.255556)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (KRN C l R -0.255556)
+ (KRN C L R -0.293058)
+ )
+ (MAP
+ (SETCHAR O 40)
+ )
+ )
+(CHARACTER O 41
+ (CHARWD R 0.366669)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (LIG O 140 O 74)
+ )
+ (MAP
+ (SETCHAR O 41)
+ )
+ )
+(CHARACTER O 42
+ (CHARWD R 0.558334)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 42)
+ )
+ )
+(CHARACTER O 43
+ (CHARWD R 0.916672)
+ (CHARHT R 0.694439)
+ (CHARDP R 0.194441)
+ (MAP
+ (SETCHAR O 43)
+ )
+ )
+(CHARACTER O 44
+ (CHARWD R 0.550003)
+ (CHARHT R 0.749995)
+ (CHARDP R 0.055555)
+ (MAP
+ (SETCHAR O 44)
+ )
+ )
+(CHARACTER O 45
+ (CHARWD R 1.029114)
+ (CHARHT R 0.749995)
+ (CHARDP R 0.055555)
+ (MAP
+ (SETCHAR O 45)
+ )
+ )
+(CHARACTER O 46
+ (CHARWD R 0.83056)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 46)
+ )
+ )
+(CHARACTER O 47
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (LIG O 47 O 42)
+ (KRN O 77 R 0.122223)
+ (KRN O 41 R 0.122223)
+ )
+ (MAP
+ (SETCHAR O 47)
+ )
+ )
+(CHARACTER O 50
+ (CHARWD R 0.42778)
+ (CHARHT R 0.749995)
+ (CHARDP R 0.249996)
+ (MAP
+ (SETCHAR O 50)
+ )
+ )
+(CHARACTER O 51
+ (CHARWD R 0.42778)
+ (CHARHT R 0.749995)
+ (CHARDP R 0.249996)
+ (MAP
+ (SETCHAR O 51)
+ )
+ )
+(CHARACTER O 52
+ (CHARWD R 0.550003)
+ (CHARHT R 0.749995)
+ (MAP
+ (SETCHAR O 52)
+ )
+ )
+(CHARACTER O 53
+ (CHARWD R 0.85556)
+ (CHARHT R 0.616667)
+ (CHARDP R 0.116671)
+ (MAP
+ (SETCHAR O 53)
+ )
+ )
+(CHARACTER O 54
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130554)
+ (CHARDP R 0.105556)
+ (MAP
+ (SETCHAR O 54)
+ )
+ )
+(CHARACTER O 55
+ (CHARWD R 0.366669)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (LIG O 55 O 173)
+ )
+ (MAP
+ (SETCHAR O 55)
+ )
+ )
+(CHARACTER O 56
+ (CHARWD R 0.305557)
+ (CHARHT R 0.130554)
+ (MAP
+ (SETCHAR O 56)
+ )
+ )
+(CHARACTER O 57
+ (CHARWD R 0.550003)
+ (CHARHT R 0.749995)
+ (CHARDP R 0.249996)
+ (MAP
+ (SETCHAR O 57)
+ )
+ )
+(CHARACTER C 0
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 0)
+ )
+ )
+(CHARACTER C 1
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 1)
+ )
+ )
+(CHARACTER C 2
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 2)
+ )
+ )
+(CHARACTER C 3
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 3)
+ )
+ )
+(CHARACTER C 4
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 4)
+ )
+ )
+(CHARACTER C 5
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 5)
+ )
+ )
+(CHARACTER C 6
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 6)
+ )
+ )
+(CHARACTER C 7
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 7)
+ )
+ )
+(CHARACTER C 8
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 8)
+ )
+ )
+(CHARACTER C 9
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C 9)
+ )
+ )
+(CHARACTER O 72
+ (CHARWD R 0.305557)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR O 72)
+ )
+ )
+(CHARACTER O 73
+ (CHARWD R 0.305557)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.105556)
+ (MAP
+ (SETCHAR O 73)
+ )
+ )
+(CHARACTER O 74
+ (CHARWD R 0.366669)
+ (CHARHT R 0.499996)
+ (CHARDP R 0.194443)
+ (MAP
+ (SETCHAR O 74)
+ )
+ )
+(CHARACTER O 75
+ (CHARWD R 0.85556)
+ (CHARHT R 0.406248)
+ (CHARDP R -0.093748)
+ (MAP
+ (SETCHAR O 75)
+ )
+ )
+(CHARACTER O 76
+ (CHARWD R 0.519448)
+ (CHARHT R 0.499996)
+ (CHARDP R 0.194443)
+ (MAP
+ (SETCHAR O 76)
+ )
+ )
+(CHARACTER O 77
+ (CHARWD R 0.519448)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (LIG O 140 O 76)
+ )
+ (MAP
+ (SETCHAR O 77)
+ )
+ )
+(CHARACTER O 100
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 100)
+ )
+ )
+(CHARACTER C A
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C t R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C O R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C U R -0.030557)
+ (KRN C Q R -0.030557)
+ (KRN C T R -0.091668)
+ (KRN C Y R -0.091668)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ (MAP
+ (SETCHAR C A)
+ )
+ )
+(CHARACTER C B
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C B)
+ )
+ )
+(CHARACTER C C
+ (CHARWD R 0.702783)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C C)
+ )
+ )
+(CHARACTER C D
+ (CHARWD R 0.794451)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C X R -0.030557)
+ (KRN C W R -0.030557)
+ (KRN C A R -0.030557)
+ (KRN C V R -0.030557)
+ (KRN C Y R -0.030557)
+ )
+ (MAP
+ (SETCHAR C D)
+ )
+ )
+(CHARACTER C E
+ (CHARWD R 0.641671)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C E)
+ )
+ )
+(CHARACTER C F
+ (CHARWD R 0.611116)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C u R -0.030557)
+ (KRN C r R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C A R -0.091668)
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ (MAP
+ (SETCHAR C F)
+ )
+ )
+(CHARACTER C G
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C G)
+ )
+ )
+(CHARACTER C H
+ (CHARWD R 0.794451)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C H)
+ )
+ )
+(CHARACTER C I
+ (CHARWD R 0.330558)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C I R 0.030557)
+ )
+ (MAP
+ (SETCHAR C I)
+ )
+ )
+(CHARACTER C J
+ (CHARWD R 0.519448)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C J)
+ )
+ )
+(CHARACTER C K
+ (CHARWD R 0.763896)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ (MAP
+ (SETCHAR C K)
+ )
+ )
+(CHARACTER C L
+ (CHARWD R 0.58056)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C T R -0.091668)
+ (KRN C Y R -0.091668)
+ (KRN C V R -0.122223)
+ (KRN C W R -0.122223)
+ )
+ (MAP
+ (SETCHAR C L)
+ )
+ )
+(CHARACTER C M
+ (CHARWD R 0.977785)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C M)
+ )
+ )
+(CHARACTER C N
+ (CHARWD R 0.794451)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C N)
+ )
+ )
+(CHARACTER C O
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C X R -0.030557)
+ (KRN C W R -0.030557)
+ (KRN C A R -0.030557)
+ (KRN C V R -0.030557)
+ (KRN C Y R -0.030557)
+ )
+ (MAP
+ (SETCHAR C O)
+ )
+ )
+(CHARACTER C P
+ (CHARWD R 0.702783)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C A R -0.091668)
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN O 56 R -0.091668)
+ (KRN O 54 R -0.091668)
+ )
+ (MAP
+ (SETCHAR C P)
+ )
+ )
+(CHARACTER C Q
+ (CHARWD R 0.794449)
+ (CHARHT R 0.694439)
+ (CHARDP R 0.105556)
+ (MAP
+ (SETCHAR C Q)
+ )
+ )
+(CHARACTER C R
+ (CHARWD R 0.702783)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C R)
+ )
+ )
+(CHARACTER C S
+ (CHARWD R 0.6111145)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C S)
+ )
+ )
+(CHARACTER C T
+ (CHARWD R 0.733337)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C y R -0.091668)
+ (KRN C e R -0.091668)
+ (KRN C o R -0.091668)
+ (KRN C r R -0.091668)
+ (KRN C a R -0.091668)
+ (KRN C A R -0.091668)
+ (KRN C u R -0.091668)
+ )
+ (MAP
+ (SETCHAR C T)
+ )
+ )
+(CHARACTER C U
+ (CHARWD R 0.763896)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C U)
+ )
+ )
+(CHARACTER C V
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694439)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C u R -0.030557)
+ (KRN C r R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C A R -0.091668)
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ (MAP
+ (SETCHAR C V)
+ )
+ )
+(CHARACTER C W
+ (CHARWD R 1.038897)
+ (CHARHT R 0.694439)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C u R -0.030557)
+ (KRN C r R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C A R -0.091668)
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ (MAP
+ (SETCHAR C W)
+ )
+ )
+(CHARACTER C X
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C O R -0.030557)
+ (KRN C C R -0.030557)
+ (KRN C G R -0.030557)
+ (KRN C Q R -0.030557)
+ )
+ (MAP
+ (SETCHAR C X)
+ )
+ )
+(CHARACTER C Y
+ (CHARWD R 0.733339)
+ (CHARHT R 0.694439)
+ (CHARIC R 0.0275)
+ (COMMENT
+ (KRN C e R -0.091668)
+ (KRN C o R -0.091668)
+ (KRN C r R -0.091668)
+ (KRN C a R -0.091668)
+ (KRN C A R -0.091668)
+ (KRN C u R -0.091668)
+ )
+ (MAP
+ (SETCHAR C Y)
+ )
+ )
+(CHARACTER C Z
+ (CHARWD R 0.672226)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C Z)
+ )
+ )
+(CHARACTER O 133
+ (CHARWD R 0.343059)
+ (CHARHT R 0.749995)
+ (CHARDP R 0.249996)
+ (MAP
+ (SETCHAR O 133)
+ )
+ )
+(CHARACTER O 134
+ (CHARWD R 0.558334)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 134)
+ )
+ )
+(CHARACTER O 135
+ (CHARWD R 0.343059)
+ (CHARHT R 0.749995)
+ (CHARDP R 0.249996)
+ (MAP
+ (SETCHAR O 135)
+ )
+ )
+(CHARACTER O 136
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 136)
+ )
+ )
+(CHARACTER O 137
+ (CHARWD R 0.524994)
+ (CHARDP R 0.097453)
+ (MAP
+ (SELECTFONT D 1)
+ (SETCHAR O 137)
+ )
+ )
+(CHARACTER O 140
+ (CHARWD R 0.305557)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (LIG O 140 O 134)
+ )
+ (MAP
+ (SETCHAR O 140)
+ )
+ )
+(CHARACTER C a
+ (CHARWD R 0.5250025)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (KRN C r R -0.030557)
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ (MAP
+ (SETCHAR C a)
+ )
+ )
+(CHARACTER C b
+ (CHARWD R 0.561113)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C e R 0.030557)
+ (KRN C o R 0.030557)
+ (KRN C x R -0.030557)
+ (KRN C d R 0.030557)
+ (KRN C c R 0.030557)
+ (KRN C q R 0.030557)
+ (KRN C r R -0.030557)
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ (MAP
+ (SETCHAR C b)
+ )
+ )
+(CHARACTER C c
+ (CHARWD R 0.488892)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR C c)
+ )
+ )
+(CHARACTER C d
+ (CHARWD R 0.561113)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C d)
+ )
+ )
+(CHARACTER C e
+ (CHARWD R 0.511113)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR C e)
+ )
+ )
+(CHARACTER C f
+ (CHARWD R 0.336114)
+ (CHARHT R 0.694439)
+ (CHARIC R 0.076389)
+ (COMMENT
+ (LIG C i O 14)
+ (LIG C f O 13)
+ (LIG C l O 15)
+ (KRN O 47 R 0.076389)
+ (KRN O 77 R 0.076389)
+ (KRN O 41 R 0.076389)
+ (KRN O 51 R 0.076389)
+ (KRN O 135 R 0.076389)
+ )
+ (MAP
+ (SETCHAR C f)
+ )
+ )
+(CHARACTER C g
+ (CHARWD R 0.550003)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C j R 0.030557)
+ )
+ (MAP
+ (SETCHAR C g)
+ )
+ )
+(CHARACTER C h
+ (CHARWD R 0.561113)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C h)
+ )
+ )
+(CHARACTER C i
+ (CHARWD R 0.255556)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C i)
+ )
+ )
+(CHARACTER C j
+ (CHARWD R 0.286113)
+ (CHARHT R 0.694439)
+ (CHARDP R 0.194443)
+ (MAP
+ (SETCHAR C j)
+ )
+ )
+(CHARACTER C k
+ (CHARWD R 0.530559)
+ (CHARHT R 0.694439)
+ (COMMENT
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C o R -0.030557)
+ (KRN C c R -0.030557)
+ )
+ (MAP
+ (SETCHAR C k)
+ )
+ )
+(CHARACTER C l
+ (CHARWD R 0.255556)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR C l)
+ )
+ )
+(CHARACTER C m
+ (CHARWD R 0.866671)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR C m)
+ )
+ )
+(CHARACTER C n
+ (CHARWD R 0.561113)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR C n)
+ )
+ )
+(CHARACTER C o
+ (CHARWD R 0.550003)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (KRN C e R 0.030557)
+ (KRN C o R 0.030557)
+ (KRN C x R -0.030557)
+ (KRN C d R 0.030557)
+ (KRN C c R 0.030557)
+ (KRN C q R 0.030557)
+ (KRN C r R -0.030557)
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ (MAP
+ (SETCHAR C o)
+ )
+ )
+(CHARACTER C p
+ (CHARWD R 0.561113)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ (COMMENT
+ (KRN C e R 0.030557)
+ (KRN C o R 0.030557)
+ (KRN C x R -0.030557)
+ (KRN C d R 0.030557)
+ (KRN C c R 0.030557)
+ (KRN C q R 0.030557)
+ (KRN C r R -0.030557)
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ (MAP
+ (SETCHAR C p)
+ )
+ )
+(CHARACTER C q
+ (CHARWD R 0.561113)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ (MAP
+ (SETCHAR C q)
+ )
+ )
+(CHARACTER C r
+ (CHARWD R 0.372225)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.015278)
+ (MAP
+ (SETCHAR C r)
+ )
+ )
+(CHARACTER C s
+ (CHARWD R 0.42167)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR C s)
+ )
+ )
+(CHARACTER C t
+ (CHARWD R 0.404168)
+ (CHARHT R 0.589284)
+ (COMMENT
+ (KRN C y R -0.030557)
+ (KRN C w R -0.030557)
+ )
+ (MAP
+ (SETCHAR C t)
+ )
+ )
+(CHARACTER C u
+ (CHARWD R 0.561113)
+ (CHARHT R 0.45833)
+ (COMMENT
+ (KRN C w R -0.030557)
+ )
+ (MAP
+ (SETCHAR C u)
+ )
+ )
+(CHARACTER C v
+ (CHARWD R 0.500002)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.015278)
+ (MAP
+ (SETCHAR C v)
+ )
+ )
+(CHARACTER C w
+ (CHARWD R 0.744448)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN C o R -0.030557)
+ (KRN C c R -0.030557)
+ )
+ (MAP
+ (SETCHAR C w)
+ )
+ )
+(CHARACTER C x
+ (CHARWD R 0.500002)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR C x)
+ )
+ )
+(CHARACTER C y
+ (CHARWD R 0.500002)
+ (CHARHT R 0.45833)
+ (CHARDP R 0.194443)
+ (CHARIC R 0.015278)
+ (COMMENT
+ (KRN C o R -0.030557)
+ (KRN C e R -0.030557)
+ (KRN C a R -0.030557)
+ (KRN O 56 R -0.091668)
+ (KRN O 54 R -0.091668)
+ )
+ (MAP
+ (SETCHAR C y)
+ )
+ )
+(CHARACTER C z
+ (CHARWD R 0.476391)
+ (CHARHT R 0.45833)
+ (MAP
+ (SETCHAR C z)
+ )
+ )
+(CHARACTER O 173
+ (CHARWD R 0.550003)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.030557)
+ (COMMENT
+ (LIG O 55 O 174)
+ )
+ (MAP
+ (SETCHAR O 173)
+ )
+ )
+(CHARACTER O 174
+ (CHARWD R 1.100006)
+ (CHARHT R 0.45833)
+ (CHARIC R 0.030557)
+ (MAP
+ (SETCHAR O 174)
+ )
+ )
+(CHARACTER O 175
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 175)
+ )
+ )
+(CHARACTER O 176
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 176)
+ )
+ )
+(CHARACTER O 177
+ (CHARWD R 0.550003)
+ (CHARHT R 0.694439)
+ (MAP
+ (SETCHAR O 177)
+ )
+ )
diff --git a/support/splint/tex/fretokenset.sty b/support/splint/tex/fretokenset.sty
index 6dfba7ea58..258ef932da 100644
--- a/support/splint/tex/fretokenset.sty
+++ b/support/splint/tex/fretokenset.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/tex/ftokenset.sty b/support/splint/tex/ftokenset.sty
index 9eb5fbd70d..efcef1e95e 100644
--- a/support/splint/tex/ftokenset.sty
+++ b/support/splint/tex/ftokenset.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -15,6 +15,7 @@
% along with SPLinT. If not, see <http://www.gnu.org/licenses/>.
% typesetting tokens in \flex's grammar
+\prettywordpair{SECT2PROLOG}{{$\hbox{SECT}_2\, \hbox{PROLOG}$}}
\prettywordpairwvis{CHAR}{{\bf char}}{char}
\prettywordpairwvis{NUMBER}{{\bf num}}{num}
diff --git a/support/splint/tex/gindex.sty b/support/splint/tex/gindex.sty
index 9d8ed2d334..2a449d343b 100644
--- a/support/splint/tex/gindex.sty
+++ b/support/splint/tex/gindex.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -18,19 +18,7 @@
% set up the list of unindexable terms
-\ifx\unindexable\UNDEFINED
- \def\unindexable{{$\TeXx$}{$\TeXa$}{$\TeXb$}{$\TeXf$}{$\TeXao$}{$\TeXfo$}}%
-\else
- \expandafter\def\expandafter\unindexable\expandafter
- {\unindexable{$\TeXx$}{$\TeXa$}{$\TeXb$}{$\TeXf$}{$\TeXao$}{$\TeXfo$}}%
-\fi
-
-\def\TeXx{\hbox{\let\_\UL\tt\TeX\_}}
-\def\TeXa{\hbox{\tt\TeX\rm(a)}}
-\def\TeXb{\hbox{\tt\TeX\rm(b)}}
-\def\TeXf{\hbox{\tt\TeX\rm(f)}}
-\def\TeXao{\hbox{\tt\TeX\rm(ao)}}
-\def\TeXfo{\hbox{\tt\TeX\rm(fo)}}
+\newwrite\gindex
% macros to determine if the current term is indexable
@@ -66,9 +54,21 @@
\def\s@t@nd@xable#1\end{\aftergroup\yyfirstoftwo}
+\def\makeunindexable#1{%
+ \expandafter\m@keunindexable\expandafter{\unindexable}{#1}%
+}
+
+\def\m@keunindexable#1#2{%
+ \def\unindexable{#1#2}%
+}
+
+\def\makeunindexablex#1{%
+ {\edef\unindexable{#1}\expandafter}\expandafter\makeunindexable\expandafter{\unindexable}%
+}
+
% \Cee\ index entry (produced by \CWEAVE\ and typeset directly from the file)
-\def\I#1, #2.{%
+\def\Ii#1, #2.{%
\makeoneindexentry{#1}{#1}{#2}{\setxreflistplain}{\filterxrefsplain}%
}
@@ -124,7 +124,17 @@
#3{#2}%
\par
}{%
- \toksg{#1}%
+ \checkforthree#1\end{%
+ \toksg{#1}%
+ }{%
+ \the\toksg\toksg{}% set the index section header
+ \let\defypreamble\empty
+ \let\defypostamble\defypostambleshowcs
+ \hangindent\inxhangindent\noindent\strut\ninercs#1:%
+ \hskip0pt plus2em\penalty1000\hskip0pt plus-2em\relax\kern\inxaiskip
+ #3{#2}%
+ \par
+ }%
}%
}
@@ -146,6 +156,11 @@
\yystringempty{#2}{\yyfirstoftwo}{\yysecondoftwo}%
}
+\def\checkforthree#1#2#3\end{%
+ \yystringempty{#3}{\yyfirstoftwo}{\yysecondoftwo}%
+}
+% if the term is unindexable, only collect the definitions (i.e. references enclosed in \[ and \])
+
\def\filterdefs#1#2{%
#1{}{}, #2, \[]{}% the last empty braces are not necessary but this way
% both \f@lterdefs and \f@lterdefsplain can be defined
@@ -331,6 +346,13 @@
\def\idxentry{{\def\_{\char`\_}\hbox{\tt$\langle$\the\toksa$\rangle_{\rm f}$}}}%
}%
+\def\termfsscstring#1{% flex sate names
+ \numberstocharsandspaces#1\end
+ \let\optstrextra\optstrextraesc
+ \expandafter\nameproc\expandafter{\the\toksa}\with\parsebin
+ \def\idxentry{{\def\_{\char`\_}\hbox{\flexsnstyle{\the\toksa}}}}%
+}%
+
\def\termstring#1{%
\numberstocharsandspaces#1\end
\let\optstrextra\optstrextraesc
@@ -366,6 +388,55 @@
}%
}%
+\def\termtrivial#1{% trivial index entry for debugging purposes
+ % can also be used as a starting point for other index processors
+ \def\idxentry{%
+ {\rm index entry goes here}%
+ }%
+}%
+
+% the raw/direct macros below should be used sparingly because they potentially introduce
+% style inconsistencies while outputting index terms; a special scheme can be designed to counter
+% that ... or one can just be careful; in addition, \termdirect relies on the exact number of expansions
+% (2) undergone by the entry's contents;
+% of the two options, \termraw is probably preferable as it does not pass any volatile information
+% (such as expandable sequences) in the index entries and thus allows much more elaborate and
+% safe setup of index terms; the only advantage of the \termdirect variation is the lack of global
+% assignments (the \termraw changes the \indexterms array); indices by their nature are global
+% so this should be a secondary consideration in the majority of cases.
+
+\def\termdirect#1{%
+ \def\idxentry{%
+ {\t@rmdirect#1}%
+ }%
+}%
+
+\def\t@rmdirect#1\end\toksa#2\eatone{#2}
+
+\let\vend\relax % the delimeter to let the indexing script know that this is a raw entry
+
+% here is an example of the \termdirect macros in action:
+%
+% the entry setup below is a bit elaborate since parts of the entry must be passed in a safe way
+% in case it contains dangerous characters like _
+% \toksa{\noexpand\tt{\noexpand\rm(}#1{\noexpand\rm)}\noexpand\charstocharsx#2\end}%
+% the \noexpand's above are necessary to block the final expansion by \write
+% the assignment below would also work; note the '0 ' which is required to stop the expansion
+% of \romannumeral which is part of \charstonumberse; in this case \vend can be left undefined
+% \toksa{\end0 \noexpand\noexpand\noexpand\vend(#1)#2\noexpand\noexpand\noexpand\vend\eatone}%
+
+% the setup above works with the following indexing command
+%\ridxentry{\termdirect}{\the\toksa}{#2}%
+
+\def\termraw#1{% raw entry, shows terms saved in a global array, #1 is the index into the array
+ \numberstocharsandspaces#1\end
+ \def\idxentry{%
+ {\let\parsernamespace\empty\getmidstackcs\indexterms{\the\toksa}}%
+ }%
+}%
+
+\setnulstack{indexterms} % the array for the terms processed by \termraw
+
\expandafter\def\csname acharswitch:index\endcsname{% correct reserved \TeX\ characters a la CWEB verbatim
%$\%\\ % unaffected
%\#\ % these never appear
@@ -403,12 +474,23 @@
\def\indexseparator#1#2{%
\vskip.3\baselineskip
- \centerline{\csname index domain translation [#1]\endcsname}%
+ \centerline{%
+ \toksa\expandafter\expandafter\expandafter
+ {\expandafter\yyfirstofthree\romannumeral0\csname index domain translation [#1]\endcsname}%
+ \toksb\expandafter\expandafter\expandafter
+ {\expandafter\yysecondofthree\romannumeral0\csname index domain translation [#1]\endcsname}%
+ \toksc\expandafter\expandafter\expandafter
+ {\expandafter\yythirdofthree\romannumeral0\csname index domain translation [#1]\endcsname}%
+ \the\toksc
+ \edef\next{\write\cont{%\noexpand\noexpand\noexpand\eatone{\noexpand\meaning\noexpand\ZZ}%
+ \noexpand\noexpand\noexpand\YY{\the\toksa}{2}{\secno}% write to contents file
+ {\noexpand\the\pageno}{\the\toksb}}}\next % \YY{title}{depth}{sec}{page}{ss}
+ }%
\vskip.3\baselineskip
}
-\expandafter\def\csname index domain translation [F]\endcsname{{\sc FLEX INDEX}}
-\expandafter\def\csname index domain translation [T]\endcsname{{\sc\TeX\ INDEX}}
+\expandafter\def\csname index domain translation [F]\endcsname{{\noexpand\flex\ index}{flex index}{F{\sc LEX INDEX}}}
+\expandafter\def\csname index domain translation [T]\endcsname{{\noexpand\TeX\ index}{TeX index}{\TeX\ {\sc INDEX}}}
\def\indexsection#1{%
\vskip.3\baselineskip
@@ -429,11 +511,21 @@
\def\otherlangindexseparator{%
\enddoublecols
\vskip.8\baselineskip
- \centerline{B{\sc ISON}, F{\sc LEX, AND} \TeX\ {\sc INDICES}}%
+ \centerline{\otherlangindexheader
+ \edef\next{\write\cont{%\noexpand\noexpand\noexpand\eatone{\noexpand\meaning\noexpand\ZZ}%
+ \noexpand\noexpand\noexpand\YY{\noexpand\noexpand\noexpand\bison\ index}{2}{\secno}% write to contents file
+ {\noexpand\the\pageno}{bison Index}}}\next % \ZZ{title}{depth}{sec}{page}{ss}
+ }%
\vskip.5\baselineskip
\begindoublecols
}
+\def\otherlangindexheader{%
+ B{\sc ISON}, F{\sc LEX, AND} \TeX\ {\sc INDICES}%
+}
+
+%\def\otherlangindexseparator{}
+
% general index entries (generated by bindx.pl)
\def\GI#1#2#3#4.{% raw index entries (standard format, with no page references)
@@ -485,13 +577,32 @@
\def\inxaiskip{.5em}
\def\inxicgap{5pt}
+\ifx\unindexable\UNDEFINED
+ \def\unindexable{{$\TeXx$}{$\TeXa$}{$\TeXb$}{$\TeXf$}{$\TeXao$}{$\TeXfo$}{$\BZ$}}%
+\else
+ \expandafter\def\expandafter\unindexable\expandafter
+ {\unindexable{$\TeXx$}{$\TeXa$}{$\TeXb$}{$\TeXf$}{$\TeXao$}{$\TeXfo$}{$\BZ$}}%
+\fi
+
+\def\idxsafe{% redefine some control sequences to behave safely in the index
+ \def\TeXx{\hbox{\let\_\UL\tt\TeX\_}}
+ \def\TeXa{\hbox{\tt\TeX\rm(a)}}
+ \def\TeXb{\hbox{\tt\TeX\rm(b)}}
+ \def\TeXf{\hbox{\tt\TeX\rm(f)}}
+ \def\TeXao{\hbox{\tt\TeX\rm(ao)}}
+ \def\TeXfo{\hbox{\tt\TeX\rm(fo)}}
+ \def\BZ{\hbox{\tt BZ}}
+}
+
\def\inxmod{% new indexing macro
- \write\cont{} % ensure that the contents file isn't empty
- \write\cont{\catcode `\noexpand\@=12\relax} % \makeatother
- \closeout\cont % the contents information has been fully gathered
+ \closeout\exampletable
+ \termindexfalse
+ \idxsafe
+ \closeout\gindex
\message{Index:}
\medskip
\eightpoint\raggedright
+ \emergencystretch=.1em % for especially tight cases
\fnotesstart=2
\fnotesspan=1
\noofcolumns=3
@@ -504,10 +615,14 @@
\expandafter\let\expandafter\acharswitch\csname acharswitch:index\endcsname
\let\texlexer\texlexerindex
\let\*=\lapstar
+ \let\I\Ii % make \CWEAVE\ generated entries typeset in our style
\begindoublecols
\readindex
- \otherlangindexseparator
\readgindex
+ \write\cont{}% ensure that the contents file isn't empty
+ \write\cont{\catcode `\noexpand\@=12\relax}% \makeatother
+ \closeout\cont % the contents information has been fully gathered
+ \enddoublecols
}
\newread\trygindex
@@ -517,6 +632,7 @@
\ifeof\trygindex
\else
\closein\trygindex
+ \otherlangindexseparator
\input \jobname.gdy
\fi
}
diff --git a/support/splint/tex/grabstates.sty b/support/splint/tex/grabstates.sty
index 1024d99432..7fa259fe7a 100644
--- a/support/splint/tex/grabstates.sty
+++ b/support/splint/tex/grabstates.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -39,16 +39,17 @@
\genericparser
name: grabstates,
- ptables: cweb/byytab.tex,
- ltables: cweb/lstab.tex,
+ ptables: cweb/ddptab.tex, % \flex\ secion 1 parser
+ ltables: cweb/ssfstab.tex, % small scanner for \flex\ options
tokens: {},
asetup: \let\setflexstates\relax,
dsetup: {},
rsetup: {},
- optimization: \optimizeall;%
+ optimization: {};%
\let\parsernamespace\grabstatesnamespace
\let\yylexreturn\yylexreturnregular
+\def\yyBEGIN#1{\yyerrterminate}
% stage two parsing macros
@@ -65,17 +66,12 @@
\yybreak{}%
\else % Stage three, process the parsed table
\yybreak{%
- \restorecslist{bootstrap}\yyunion % TODO: this will not work in fs1 sections
+ \restorecslist{bootstrap-flex}\yyflunion %
\the\table\relax
}%
\yycontinue
}
-\fillpstack{b}{%
- \preparsegrabstates
- \relax
-}
-
\fillpstack{fs1}{%
\preparsegrabstates
\relax
diff --git a/support/splint/tex/hext.sty b/support/splint/tex/hext.sty
index 433d53ac5c..998ace8394 100644
--- a/support/splint/tex/hext.sty
+++ b/support/splint/tex/hext.sty
@@ -1,3 +1,19 @@
+% Copyright 2012-2022, Alexander Shibakov
+% This file is part of SPLinT
+%
+% SPLinT 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.
+%
+% SPLinT 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 SPLinT. If not, see <http://www.gnu.org/licenses/>.
+
% macros to typeset hex values in customized form (useful when typesetting embedded code)
% the line translator: take a sequence of tokens and translate it into another sequence
diff --git a/support/splint/tex/limbo.sty b/support/splint/tex/limbo.sty
index c810cd55da..91ec2c973f 100644
--- a/support/splint/tex/limbo.sty
+++ b/support/splint/tex/limbo.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -164,6 +164,11 @@
\font\sevenfrak=eufm7
\font\sixfrak=eufm6
+\font\nineidss=idssbx9
+\font\eightidss=idssbx8
+\font\sevenidss=idssbx7
+\font\sixidss=idssbx6
+
\font\hv=phvr
\font\dings=pzdr
@@ -230,7 +235,7 @@
\def\ssfb{\fam\ssfam\tenssb}%
\def\ssfbn{\fam\ssbnfam\tenssb}%
\textfont\ssbnfam=\tenssn\scriptfont\ssfam=\sevenssn
- \textfont\ttfam=\tentt
+ \textfont\ttfam=\tentt\scriptfont\ttfam=\seventt
\fam\ttfam\tentt \ttglue=.5em plus.25em minus.15em
\def\Bbb{\fam\msbmfam\tenmsbm}%
\textfont\msbmfam=\tenmsbm\scriptfont\msbmfam=\sevenmsbm \scriptscriptfont\msbmfam=\fivemsbm
@@ -243,6 +248,7 @@
\let\mc=\ninerm
\let\cyr=\tencyr
\let\big=\tenbig
+ \let\idss=\eightidss
\setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width0pt}%
\let\sscmd\sevenpoint
\normalbaselines\rm}
@@ -280,7 +286,7 @@
%no room for another font family
\def\ssfbn{\fam\ssbnfam\ninessn}%
\textfont\ssbnfam=\ninessn\scriptfont\ssbnfam=\sixssn
- \textfont\ttfam=\ninett
+ \textfont\ttfam=\ninett\scriptfont\ttfam=\sixtt
\fam\ttfam\ninett \ttglue=.5em plus.25em minus.15em
\def\Bbb{\fam\msbmfam\ninemsbm}%
\textfont\msbmfam=\ninemsbm\scriptfont\msbmfam=\sixmsbm \scriptscriptfont\msbmfam=\fivemsbm
@@ -293,6 +299,7 @@
\let\mc=\eightrm
\let\cyr=\ninecyr
\let\big=\ninebig
+ \let\idss=\sevenidss
\setbox\strutbox=\hbox{\vrule height8pt depth3pt width0pt}%
\let\sscmd\sixpoint
\normalbaselines\rm}
@@ -340,6 +347,7 @@
\let\mc=\sevenrm
\let\cyr=\eightcyr
\let\big=\eightbig
+ \let\idss=\sixidss
\setbox\strutbox=\hbox{\vrule height7pt depth2pt width0pt}%
\let\sscmd\sixpoint
\normalbaselines\rm}
@@ -381,6 +389,7 @@
\let\sci=\sixit
\let\mc=\sixrm
\let\big=\sevenbig
+ \let\idss=\sixidss
\setbox\strutbox=\hbox{\vrule height6pt depth2pt width0pt}%
\normalbaselines\rm}
@@ -421,6 +430,7 @@
\let\sci=\sixit
\let\mc=\sixrm
\let\big=\sixbig
+ \let\idss=\sixidss
\setbox\strutbox=\hbox{\vrule height5.5pt depth1.5pt width0pt}%
\normalbaselines\rm}
@@ -591,7 +601,8 @@
% demo code display
% **H will produce a `|', **K can be used as an escape character, **L and **N
-% can be used i place of left and right braces to provide some control
+% can be used in place of left and right braces to provide some control **C is
+% a comment character when needed
{\catcode`\ =\active\gdef {\phantom{\char"20\relax}}\catcode`\^^H=\active\gdef^^H{\yl}}%
@@ -607,7 +618,7 @@
\catcode`\^=\active\democodelc=0 \catcode`\*=7
\chardef\*=`\*%
\catcode`\^^H=\active % ^^H
- \catcode`\^^K=0 \catcode`\^^L=1 \catcode`\^^N=2
+ \catcode`\^^K=0 \catcode`\^^L=1 \catcode`\^^N=2 \catcode`\^^C=14
\tabskip=0pt plus 1 fill
\halign \demoastyle\bgroup\linenoup\hskip\demomargin ##\hfil\hskip\demomargin%
\ifnumberlines{\sevenrm\paddednumber\democodelc}\fi\cr%
@@ -615,6 +626,10 @@
\def\enddemo{\egroup\egroup\medskip\noindent}
+% referencing lines from the demo code
+\def\dlbl#1{\expandafter\xdef\csname lncnt_#1\endcsname{\the\democodelc}}%
+\def\dref#1{\csname lncnt_#1\endcsname}%
+
\newskip\demomargin
\demomargin=3em
@@ -645,7 +660,8 @@
\epsfbox{#1.eps}\fi
}
-\let\yl| % to use in \TeX\ mode instead of `|'
+\let\yl| % to use in \TeX\ mode instead of `|'
+\def\vl{|} % same as above but expandable
\def\greaterthan{>} % CTANGLE always leaves a space after `>' in the output which interferes with some macros
% redefinitions of various CWEB macros;
@@ -760,7 +776,7 @@
\def\stripprefix##1>{}\def\gtitletoks{#3}%
\edef\gtitletoks{\expandafter\stripprefix\meaning\gtitletoks}%
\edef\next{\write\cont{%\noexpand\noexpand\noexpand\eatone{\noexpand\meaning\noexpand\ZZ}%
- \noexpand\noexpand\noexpand % AS this is a (sort of) bug in cwebmac.tex
+ \noexpand\noexpand\noexpand % AS: this is a (sort of a) bug in cwebmac.tex
% as long as the index is output (i.e. ...\eject)
% before all the sections this is unnecessary
% uncomment the line after the brace to see what \ZZ
@@ -800,46 +816,74 @@
\ifpdftex\expandafter\xdef\csname curr#1\endcsname{\secno}%
\ifnum#1>0\countB=#1 \advance\countB by-1
\advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}\fi\fi
- \ifpdf\special{pdf: outline #1 << /Title (\the\toksE) /Dest
- [ @thispage /FitH @ypos ] >>}\fi
+ % drop support for pdf specials: AS
\ifon\startsection{\ttl#3}\smallskip\noindent\ignorespaces}
\outer\def\chapterN#1#2#3.{% beginning of starred section in `book' mode
\ifacro{\toksF={}\makeoutlinetoks#3\outlinedone\outlinedone}\fi
\gdepth=#1\gtitle={#3}\MN{#2}%
- \ifon
- \ifnum#1<\tw@
- \vfil\eject % force page break for chapters and major subsections
- \ifodd\pageno
- \else
- \null\vfill\eject
- \fi
- \else
- \vskip0pt plus 3.5\baselineskip
- \penalty-100
- \vskip0pt plus -3.5\baselineskip
- \vskip\intersecskip % no forced page break
- \fi
- \fi
- \message{*\secno} % progress report
+ \ifon\stsecchappreseparator{#1}\fi % before the title
+ \message{*\secno}% progress report
\def\stripprefix##1>{}\def\gtitletoks{#3}%
\edef\gtitletoks{\expandafter\stripprefix\meaning\gtitletoks}%
- \edef\next{\write\cont{%\noexpand\noexpand\noexpand\eatone{\noexpand\meaning\noexpand\ZZ}%
- \noexpand\noexpand\noexpand % AS this is a (sort of) bug in cwebmac.tex
- % as long as the index is output (i.e. ...\eject)
- % before all the sections this is unnecessary
- % uncomment the line after the brace to see what \ZZ
- % expands to in case of weird errors
- \ZZ{\gtitletoks}{#1}{\secno}% write to contents file
- {\noexpand\the\pageno}{\the\toksE}}}\next % \ZZ{title}{depth}{sec}{page}{ss}
- \ifpdftex\expandafter\xdef\csname curr#1\endcsname{\secno}%
- \ifnum#1>0\countB=#1 \advance\countB by-1
- \advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}\fi\fi
- \ifpdf\special{pdf: outline #1 << /Title (\the\toksE) /Dest
- [ @thispage /FitH @ypos ] >>}\fi
+ \edef\next{%
+ \write\cont{%\noexpand\noexpand\noexpand\eatone{\noexpand\meaning\noexpand\ZZ}%
+ \noexpand\noexpand\noexpand % AS this is a (sort of) bug in cwebmac.tex
+ % as long as the index is output (i.e. ...\eject)
+ % before all the sections this is unnecessary
+ % uncomment the line after the brace to see what \ZZ
+ % expands to in case of weird errors
+ \ZZ{\gtitletoks}{#1}{\secno}{\noexpand\the\pageno}{\the\toksE}% \ZZ{title}{depth}{sec}{page}{ss}
+ }}\next % write to contents file
+ \ifpdftex
+ \expandafter\xdef\csname curr#1\endcsname{\secno}%
+ \ifnum#1=\z@
+ \countB=#1 \advance\countB by\@ne
+ \expandafter\xdef\csname curr\the\countB\endcsname{\secno}%
+ \advance\countB by\@ne
+ \expandafter\xdef\csname curr\the\countB\endcsname{\secno}%
+ \advance\countB by\@ne
+ \expandafter\xdef\csname curr\the\countB\endcsname{\secno}%
+ \fi % allow subsection depth to jump up to 3 levels after a chapter: AS
+ \ifnum#1>0\countB=#1 \advance\countB by-1
+ %\message{#3::chunk\the\countB.\expnumber{curr\the\countB}::\expnumber{chunk\the\countB.\expnumber{curr\the\countB}}}%
+ \advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}%
+ \fi
+ \fi
+ % drop support for pdf specials: AS
\ifon\stsecchap{#1}{#3}\ignorespaces
}
+\def\writebookmarkline#1#2#3#4#5{{% the scheme for bookmarks is rather fragile
+ % the proper implementation must involve a stack: AS
+ \let\(=\let \let\)=\let \let\[=\let \let\]=\let \let\/=\let
+ \edef\depth{\expnumber{chunk#2.#3}}%
+ \ifnum\depth=\z@ % allow subsection depth to jump up to 3 levels: AS
+ \countB=#2 \advance\countB\@ne
+ \edef\depth{\expnumber{chunk\the\countB.#3}}%
+ \ifnum\depth=\z@
+ \advance\countB\@ne
+ \edef\depth{\expnumber{chunk\the\countB.#3}}%
+ \fi
+ \fi
+ %\message{bookmark for #5::depth:\depth::#2.#3}%
+ \pdfoutline goto num #3 count -\depth {#5}}}
+
+\def\stsecchappreseparator#1{% separator between the end of the previous section and the current one
+ \ifnum#1<\tw@
+ \vfil\eject % force page break for chapters and major subsections
+ \ifodd\pageno
+ \else
+ \null\vfill\eject
+ \fi
+ \else
+ \vskip0pt plus 3.5\baselineskip
+ \penalty-100
+ \vskip0pt plus -3.5\baselineskip
+ \vskip\intersecskip % no forced page break
+ \fi
+}
+
\def\stsecchap#1#2{\rightskip=0pt % get out of C mode (cf. \B)
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
%
@@ -891,7 +935,7 @@
\newif\ifchapterhead
-% make page and sectoin number hang in the margins; \quad is chosen to
+% make page and section number hang in the margins; \quad is chosen to
% be consistent with section appearance; the page numbers are printed
% in old-style numerals;
@@ -901,7 +945,7 @@
\else
\termindexfalse\headertrue\llap{\mainfont\oldstyle\the\pageno\tentitle\quad}%
\eightpoint\rm\grouptitle\hfill\title
- \rlap{\tentitle\quad\tenpoint$^{\hbox{\sevenrm\topsecno}}_{\hbox{\sevenrm\botsecno}}$}%
+ \rlap{\tentitle\quad\secrangedisplay}%
\fi
} % top line on left-hand pages
@@ -909,23 +953,19 @@
\ifchapterhead
\hfil
\else
- \termindexfalse\headertrue\llap{\tenpoint$^{\hbox{\sevenrm\topsecno}}_{\hbox{\sevenrm\botsecno}}$\tentitle\quad}%
+ \termindexfalse\headertrue\llap{\secrangedisplay\tentitle\quad}%
\eightpoint\rm\title\hfill\grouptitle
\rlap{\tentitle\quad\mainfont\oldstyle\the\pageno}%
\fi
} % top line on right-hand pages
+\def\secrangedisplay{{\tenpoint$^{\hbox{\sevenrm\topsecno}}_{\hbox{\sevenrm\botsecno}}$}}
+
\def\botsecno{\expandafter\takeone\botmark} % the first section on the
% next page
-
-\newwrite\exampletable
-
-\newif\ifsaveparseoutput
-\newif\ifchecktable
+\newif\ifsepsectionchapter % do we put the section list in its own chapter?
\def\finmod{%
- \enddoublecols
- \closeout\exampletable
\parfillskip 0pt plus 1fil
\def\grouptitle{NAMES OF THE SECTIONS}
\let\topsecno=\nullsec
@@ -942,21 +982,18 @@
\let\Xpdf\X
%
\ifpdftex
- \makebookmarks
- \pdfdest name {NOS} fitb
- \pdfoutline goto name {NOS} count -\secno {\outsecname}
- \def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
- {\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
- \pdfoutline goto num \the\toksA \expandafter{\the\toksE}}
- \else
- \ifpdf
- \special{pdf: outline -1 << /Title (\outsecname)
- /Dest [ @thispage /FitH @ypos ] >>}
- \def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
- {\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
- \special{pdf: outline 0 << /Title (\the\toksE)
- /A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}}
- \fi
+ %\makebookmarks
+ % move this to just before the contents so \inxmod has a
+ % chance to close the \cont channel; AS
+ \ifsepsectionchapter\else\pdfdest name {NOS} fith \fi
+ %\pdfoutline goto name {NOS} count -\secno {\outsecname}%
+ %\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
+ %{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
+ %\pdfoutline goto num \the\toksA \expandafter{\the\toksE}%
+ % remove bookmarks for individual sections to avoid unpleasant
+ % pdf navigation artefacts; AS
+ %}
+ % pdf specials are not supported: AS
\fi
\fi
%
@@ -967,10 +1004,48 @@
\centerline{\sc A LIST OF ALL SECTIONS}
\penalty300
\medskip
- \emergencystretch=10pt
+ \emergencystretch=12pt
+ \sectionlistsetup
\readsections
}
+\let\sectionlistsetup\relax
+
+\def\YYcontentsline#1#2#3#4#5{\ifnum#2=0 \smallbreak\fi
+ \line{\consetup{#2}#1
+ \rm\leaders\hbox to .5em{.\hfil}\hfil
+ \ \ifacro
+ \pdfstartlink attr {/Border [0 0 0]} goto page #4 {/FitH} \BlueGreen #3\Black\pdfendlink
+ \else#3\fi\hbox to3em{\hss#4}}}
+
+\def\YYwritebookmarkline#1#2#3#4#5{{%
+ \let\(=\let \let\)=\let \let\[=\let \let\]=\let \let\/=\let
+ \pdfoutline goto page #4 {#4} count 0 {#5}}}
+
+
+\def\makebookmarks{\let\ZZ=\writebookmarkline \let\YY\YYwritebookmarkline \readcontents\relax}
+
+\def\topofcontents{%
+ \null\vskip-3\baselineskip\centerline{C{\sc ONTENTS} (\sc\uppercase\expandafter{\title})}\medskip
+ \ifacro
+ \ifpdftex
+ \makebookmarks
+ \ifsepsectionchapter\else\pdfoutline goto name {NOS} count 0 {\outsecname}\fi% no section listing; AS
+ \pdfdest name {TOC} fith % bookmark for the table of contents
+ \fi
+ \fi
+ \let\YY\YYcontentsline
+}
+
+\def\botofcontents{\vfill
+ \ifpdftex\pdfoutline goto name {TOC} count 0 {Table of Contents}\fi
+ \centerline{\covernote}} % this material will end the table of contents page
+
+\newwrite\exampletable
+
+\newif\ifsaveparseoutput
+\newif\ifchecktable
+
% \Cee\ section macros
% stage one macros for `\B' sections: collecting tokens
@@ -982,17 +1057,13 @@
\let\oldB\B
-\long\def\Bvbpp#1\par{%
- \Bvbp@#1\X\X$\E$\par
-}
-
\long\def\Bvbpp#1\par{% the \vb{\yyendgame}\vb... is inserted by brack.pl
\Bvbp@#1\cleanBtail\X\X$\E$\par
}
\def\cleanBtail\X\X$\E${}
-\long\def\Bvbp@#1\X#2\X$#3\E#4$#5\par{% new version of the above, experimental
+\long\def\Bvbp@#1\X#2\X$#3\E#4$#5\par{%
\yystringempty{#5}%
{% this is a \Cee\ section (@c or @p); it is tempting to assume that the suffix
% is \X\X$\E$\par and forego the invocation of \Bvb@@, however, this is not always
@@ -1086,21 +1157,38 @@
% URL typesetting
-\def\url#1{%
- \hskip0pt plus .3\hsize\penalty100
+\def\urls#1#2{% make it possible to omit the `https://' nonsense
+ \hskip0pt plus .3\hsize\penalty1000
\hskip0pt plus -.3\hsize
{%
\def~{\string~}%
\ifmakepdf
- \pdfURL{{\tt #1}}{#1}%
+ \pdfURL{{\tt #2}}{#1#2}%
\else
- {\tt #1}%
+ {\tt #2}%
\fi
}%
- \hskip0pt plus .2\hsize\penalty100
- \hskip0pt plus -.2\hsize
+ \hskip0pt plus .2\hsize\penalty1000
+ \hskip0pt plus -.2\hsize\relax % this is somewhat of an infidelity in \TeX's syntax
}
+\def\urll#1#2{% make it possible to omit the `https://' nonsense
+ \hskip0pt plus .3\hsize\penalty1000
+ \hskip0pt plus -.3\hsize
+ {%
+ \def~{\string~}%
+ \ifmakepdf
+ \pdfURL{#2}{#1}%
+ \else
+ {\tt #2}%
+ \fi
+ }%
+ \hskip0pt plus .2\hsize\penalty1000
+ \hskip0pt plus -.2\hsize\relax % this is somewhat of an infidelity in \TeX's syntax
+}
+
+\def\url#1{\urls{}{#1}}
+
% commonly used names
\def\CWEB{\.{CWEB}}
@@ -1111,6 +1199,7 @@
\def\noweb{\.{noweb}}
\def\splint{\.{SPLinT}}
\def\POSIX{{\sc POSIX}}
+\def\AST{{\sc AST}}
\def\EAST{{\sc EAST}}
\def\WEST{{\sc WEST}}
\def\ISO{{\mc ISO}}
@@ -1146,13 +1235,130 @@
}%
}
+% a `union' to control command sequences in the .aux files;
+\def\auxunionctl{}% here we add sequences that control namespace switching
+ % although it is handled as a `union', we plan to execute this
+ % sequence rather than use it as a storage list
+\newwrite\auxstream
+
+\def\initauxstream{% this command should be executed only after
+ % all the command sequances have been loaded (i.e. after
+ % noweb.sty, dcols.sty, etc. have been loaded)
+ \immediate\openin\trystream=\jobname.aux
+ \ifeof\trystream
+ \else
+ \restorecslist{aux:global:activate}\auxunionctl
+ \auxunionctl % activate/deactivate individual subsets
+ \immediate\closein\trystream
+ \input \jobname.aux
+ \fi
+ \immediate\openout\auxstream=\jobname.aux
+ \restorecslist{aux:global:prestart}\auxunionctl
+ \auxunionctl
+}
+
+\def\everyendofjob{%
+ \restorecslist{aux:global:precutoff}\auxunionctl
+ \auxunionctl % write delayed data to the stream
+ \immediate\closeout\auxstream
+ \restorecslist{aux:global:preend}\auxunionctl
+ \auxunionctl % do end of run tasks for every command set that writes to aux stream
+ \message{Closed auxilary streams}%
+}
+
+% \end amendment, based on stackexchange question/answer by Bruno LeFloch
+% https://tex.stackexchange.com/questions/39279/test-whether-end-will-really-end-the-run/40894
+% with some simplifications (we do not really need to take care of every possible situation
+% since the \end command appears at a predictable spot)
+
+\def\newend{%
+ \ifdim\pagegoal=\maxdimen
+ \yybreak{\checkdeadcycles}%
+ \else
+ \yybreak{\end}% do nothing, the regular \output will take care of the endgame
+ \yycontinue
+}
+
+\def\checkdeadcycles{%
+ \ifnum\deadcycles=\z@
+ \yybreak{\testpageforstuff}%
+ \else
+ \yybreak{\end}% do nothing, the regular \output will take care of the endgame
+ \yycontinue
+}
+
+% insert the same material \end would insert (see The \TeX book, p.~264)
+\def\forceoutputagain{%
+ \prevdepth=-1000pt
+ \hbox{}\vfill\penalty-'10000000000
+}
+
+\def\testpageforstuff{% temporarily replace the output routine
+ % to check if the page contains stuff other than boxes
+ \begingroup\output{\aftergroup\endgroup\testpageoutput}%
+ \forceoutputagain % call the new output routine
+}
+
+\def\testpageoutput{%
+ \deadcycles=\z@
+ \cleantemppage
+ \yyifpageempty % is there any stuff other than boxes in the vertical list?
+ % this macro is only expanded if \pagegoal=\maxdimen and \deadcycles=0
+ {\everyendofjob}% vertical list is empty
+ {}% whatsit nodes present, let \end take care of them
+ \aftergroup\end
+ \unvbox255
+ \ifnum\outputpenalty=\@M % 10000 the break was not at a penalty item
+ \else
+ \penalty\outputpenalty
+ \fi
+}
+
+\def\cleantemppage{% remove material inserted by \forceoutputagain
+ \setbox255\vbox{%
+ \unvbox255
+ \unskip % remove \vfill
+ \setbox0\lastbox % remove \hbox{}
+ \unskip % remove \topskip
+ }%
+}
+
+\def\yyifpageempty{%
+ \setbox\z@\vbox{%
+ \vbox{}\unvcopy255\setbox0\lastbox
+ \expandafter
+ }%
+ \ifvoid\z@ %\vbox was not the last item, force output again
+ \yybreak{\yysecondoftwo}%
+ \else
+ \yybreak{\yyfirstoftwo}%
+ \yycontinue
+}
+
+\def\con{\par\vfill\eject % finish the section names
+% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
+ \rightskip 0pt \hyphenpenalty 50 \tolerance 200
+ \setpage \output={\normaloutput\page\lheader\rheader}
+ \titletrue % prepare to output the table of contents
+ \pageno=\contentspagenumber
+ \def\grouptitle{TABLE OF CONTENTS}
+ \message{Table of contents:}
+ \topofcontents \startpdf
+ \line{\hfil Section\hbox to3em{\hss Page}}
+ \let\ZZ=\contentsline
+ \readcontents\relax % read the contents info
+ \botofcontents
+ \newend
+} % print the contents page(s) and terminate
+
% sugar
\def\FOREVER{{\bf forever}}
+% microtypography extensions: activate optical alignment
\ifacro
\ifpdftex
- \input extras/texmf/macros/protcode.tex
+ \input other/texmf/macros/protcode.tex
\pdfprotrudechars=2
\setprotcode\tenrm
\setprotcode\ninerm
@@ -1167,10 +1373,104 @@
% do not stretch characters
%\pdfdjustspacing=2
%\pdffontexpand\sevenrm 30 20 10 autoexpand
- % TODO: use \pdfsavepos, \pdflastxpos, and \pdflastypos to
- % save the position of index terms on the page
\fi
\fi
+% TODO: use \pdfsavepos, \pdflastxpos, and \pdflastypos to
+% save the position of index terms on the page
+
+% unstable macros
+
+% two column typesetting for short sections
+% CAUTION: while the macros below seem to work, their use requires a great deal of care
+% o they assume that the sections are narrow so only use them if you are reasonably sure that
+% the width of the sections to be typeset as double column text are stable and not
+% going to change much
+% o sections to be so typeset should not be part of `concatenated' @c sections; otherwise
+% the noweb style section pointers in the margins will clash with the text in the adjacent
+% column (this is not a concern if the traditional \CWEB\ referencing style is used
+
+\def\dcolbM{\expandafter\let\csname M\endcsname\thisM
+ \vskip 0pt plus 3\baselineskip\penalty-100 \vskip 0pt plus -3\baselineskip
+ \vskip\ht\strutbox
+ \vskip-\topskip % negate the \topskip at the beginning of the column box
+ \vskip-\smallskipamount
+ \vskip\intersecskip
+ \begindoublecols
+ \csname M\endcsname
+}
+
+\def\dcolbN{\expandafter\let\csname M\endcsname\thisN
+ \vskip\ht\strutbox
+ \vskip-\topskip % negate the \topskip at the beginning of the column box
+ \vskip-\smallskipamount
+ \vskip\intersecskip
+ \begindoublecols
+ \csname N\endcsname
+}
+
+\def\dcoleM{%
+ \vfil\enddoublecols
+ \crudelet{M}{thisM}%
+ \crudelet{N}{thisN}%
+ \csname M\endcsname
+}
+
+\def\dcoleN{%
+ \vfil\enddoublecols
+ \crudelet{M}{thisM}%
+ \crudelet{N}{thisN}%
+ \csname N\endcsname
+}
+
+\def\beginfoldedsections{% begin double column output starting with the next
+ % \M or \N section
+ \ifbootstrapmode
+ \else
+ \crudelet{thisM}{M}%
+ \crudelet{thisN}{N}%
+ \crudelet{M}{dcolbM}%
+ \crudelet{N}{dcolbN}%
+ \fi
+}
+
+\def\endfoldedsections{% finish double column output starting with the next
+ % \M or \N section
+ \ifbootstrapmode
+ \else
+ \crudelet{M}{dcoleM}%
+ \crudelet{N}{dcoleN}%
+ \fi
+}
+
+\def\crudelet#1#2{% ignore \outer (as a useful side effect these assignments can be skipped
+ % as a part of an \if... statement without producing `incomplete \iftrue'
+ % or like errors
+ \edef\next{\global\let\expandafter\nx\csname#1\endcsname\expandafter\nx\csname#2\endcsname}\next
+}
+
+\def\beginfoldedsectionshere{% similar to \beginfoldedsections but can be used immediately
+ % before the @c portion of the section that will be typeset in two
+ % columns; this way the \TeX\ portion of the section can still be
+ % typeset in a single column
+ % save the current section macro to be restored by \endfoldedsections
+ \ifbootstrapmode
+ \else
+ \crudelet{thisN}{N}% both types of section macros are saved
+ \crudelet{thisM}{M}% just in case the section changes to an \M section
+ \vskip\ht\strutbox
+ \vskip-\topskip % negate the \topskip at the beginning of the column box
+ \vskip-\smallskipamount % undo the skip from \begindoublecols
+ \yskip
+ \begindoublecols
+ \parindent=1em
+ \fi
+}
+
+% support reproducible compilation
+\ifpdftex
+ \pdfinfoomitdate=1
+ \pdftrailerid{}%
+\fi
\tenpoint
diff --git a/support/splint/tex/noweb.sty b/support/splint/tex/noweb.sty
index a0f2c7cf43..b7dce9623b 100644
--- a/support/splint/tex/noweb.sty
+++ b/support/splint/tex/noweb.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -14,6 +14,43 @@
% You should have received a copy of the GNU General Public License
% along with SPLinT. If not, see <http://www.gnu.org/licenses/>.
+\def\yyuniontag{\auxunionctl}
+\defp\xrefunionctl{}% sequence to activate/deactivate/take other action for
+ % xref set of macros
+
+\defc\xrefunionctl{%
+ \restorecslist{aux:global:xrefs}\xrefunion
+}
+\savecs{aux:global:activate}\xrefunionctl
+
+\defc\xrefunionctl{%
+ \restorecslist{aux:global:xrefs:neutral}\xrefunion
+}
+\savecs{aux:global:deactivate}\xrefunionctl
+
+\defc\xrefunionctl{% this command should not make any page material contributions
+ \message{xrefs...}%
+}
+\savecs{aux:global:preend}\xrefunionctl
+
+\defc\xrefunionctl{% writing a header, etc.
+ \message{xrefs...}%
+ \toksa\expandafter{\xrefunion}%
+ \immediate\write\auxstream{\harmlesscomment\the\toksa}%
+}
+\savecs{aux:global:prestart}\xrefunionctl
+
+\yyuniondeclare\xrefunion{aux:global:xrefs}
+
+\defp\MNM#1#2#3#4{}
+\defp\XXX#1#2#3{}
+\defp\BBB#1#2#3#4{}
+\defp\SSS{}
+
+\toyyunion{aux:global:xrefs:neutral}
+
+% end global stream union macros for cross referencing
+
\def\stseclap{\rightskip=0pt % get out of C mode (cf. \B)
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
\noindent{\let\*=\empty\llap{\tentitle\setsafesecno{\secno}\quad}}% push it to the margins
@@ -33,17 +70,25 @@
\fi
}
+\ifx\customchapterstyle\UNDEFINED
+ \def\customchapterstyle{0}
+\fi
+
+\ifx\customsubchapterstyle\UNDEFINED
+ \let\customsubchapterstyle\empty
+\fi
+
\def\stsecchap#1#2{\rightskip=0pt % get out of C mode (cf. \B)
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
%
\ifnum#1>\z@ % the `level' if this section is below that of a chapter
\noindent{\let\*=\empty\llap{\tentitle
- \setsafesecno{\secno}\quad}}{\ttl #2}% push it to the margins
- \putxref{\MNM}{}{}.% generate a location reference for noweb cross referencing style
- \smallskip\noindent
+ \setsafesecno{\secno}\quad}}{\stsecchapttl{#1}#2\stsecchapterminator{#1}}% push it to the margins
+ \putxref{\MNM}{\customsubchapterstyle}{}.% generate a location reference for noweb cross referencing style
+ \stsecchapseparator{#1}%
\else
\setchaptertitle{\secno}{#2}%
- \putxref{\MNM}{0}{}.% generate a chapter location reference for noweb cross referencing style
+ \putxref{\MNM}{\customchapterstyle}{}.% generate a chapter location reference for noweb cross referencing style
\fi
%
\ifpdftex\smash{\raise\baselineskip\hbox to0pt{%
@@ -52,6 +97,13 @@
\let\*=\empty\special{%
pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}}}\fi\fi}
+\def\stsecchapterminator#1{} % for deeply nested sections one may put a dot at the end
+\def\stsecchapseparator#1{%
+ \smallskip
+ \noindent
+}
+\def\stsecchapttl#1{\ttl}
+
\def\setchaptertitle#1#2{%
\global\chapterheadtrue
\null
@@ -71,17 +123,20 @@
}%
\prevdepth=0pt
\bigskip
- \noindent{\let\*=\empty\llap{\tentitle\setsafesecno{\secno}\quad}}%
+ \noindent%{\let\*=\empty\llap{\tentitle\setsafesecno{\secno}\quad}}%
}
\let\startsection\stseclap
\expandafter\def\expandafter\oldB\expandafter{\oldB\global\csectionstarttrue\putxref{\BBB}{}{}.}
+% the command that writes references to the reference stream (file):
+% \<reference name>{page}{section}{param1}{param2}
+%
\def\putxref#1#2.{% it is important that #2 contains at least two braced groups (as in {}{})
% otherwise the parameter scanning mechanism will strip the outside braces
\ifxreflocal
- {\edef\next{\write\xrefstream{\nx\nx\nx#1{\nx\the\nx\pageno}{\secno}#2\harmlesscomment}}\next}%
+ {\edef\next{\write\auxstream{\nx\nx\nx#1{\nx\the\nx\pageno}{\secno}#2\harmlesscomment}}\next}%
\fi
}
@@ -94,7 +149,7 @@
{\def\sname{#2}%
\def\stripprefix##1>{ }%
\let\*\empty
- \edef\next{\write\xrefstream{\nx\nx\nx\XXX{\nx\the\nx\pageno}{\secno}{#1}\harmlesscomment
+ \edef\next{\write\auxstream{\nx\nx\nx\XXX{\nx\the\nx\pageno}{\secno}{#1}\harmlesscomment
\expandafter\stripprefix\meaning\sname}}\next}%
\fi
}
@@ -141,7 +196,7 @@
\def\setdownlink#1#2#3{%
{\setbox0\vtop{
\sevenpoint\halign{#3\cr
- \xref@nowebsection{\csname xchain[#1][#2]down\endcsname}\cr
+ \setsafesecorchapno{\csname xchain[#1][#2]down\endcsname}\cr
\relax\ifacro
\pdflink{\csname xchain[#1][#2]down\endcsname}{\raise3.5pt\hbox{$\scriptscriptstyle\bigtriangledown$}}%
\else
@@ -162,14 +217,16 @@
\lower1.3pt\hbox{$\scriptscriptstyle\bigtriangleup$}%
\fi
\cr
- \xref@nowebsection{\csname xchain[#1][#2]up\endcsname}\cr
+ \setsafesecorchapno{\csname xchain[#1][#2]up\endcsname}\cr
}
}%
\box0}%
}
+% modify \makenote (used by \pdfnote) to use \noweb\ style references.
+
\def\makenote{%
- \addtokens\toksB{\noexpand\pdflink{\the\toksC}{\setsafesecno{\the\toksC}}}%
+ \addtokens\toksB{\noexpand\pdflink{\the\toksC}{\setsafesecorchapno{\the\toksC}}}%
\toksC={}\global\countC=0
}
@@ -195,22 +252,11 @@
\ \ifacro\pdflink{#3}{#3}\else#3\fi\hbox to3em{\hss#4}}}
\newif\ifxreflocal % are we generating references in noweb style (as page no., position pairs)?
-
-\newread\trystream % generic stream to test for an existence of a file
-
-\def\readlxrefs{% see if the local reference file exists
- \openin\trystream=\jobname.xxr
- \ifeof\trystream
- \else
- \closein\trystream
- \input \jobname.xxr
- \fi
-}
-
\newif\ifcsecactive
-\def\BBB#1#2#3#4{% #1 is the page number
- % #2 is the section number
+\defc\BBB#1#2#3#4{% #1 is the page number
+ % #2 is the section number
+ % #3, #4 are reserved
\csecactivetrue
}
@@ -221,10 +267,14 @@
\lxrcurrentindex=\z@
-\def\MNM#1#2#3#4{% #1 is the page number
- % #2 is the section number
- % #3 is the chapter flag or empty
- % #4 is reserved
+% the command that processes the reference stream by setting
+% chapter numbers, etc. based on the section number (which is
+% unique across all sections); see also \BBB\ above
+
+\defc\MNM#1#2#3#4{% #1 is the page number
+ % #2 is the section number
+ % #3 is the chapter flag or empty
+ % #4 is a possible custom reference
\ifnum#1=\lxrcurrentpage
\else
\lxrcurrentindex=\z@
@@ -235,21 +285,25 @@
\def\nnext{\expandafter\noexpand\csname lxref[#2]\endcsname}%
\yystringempty{#3}{%
\let\nnnext\empty
+ \toksa{\advance\lxrcurrentindex\@ne}%
}{%
- \global\advance\chaptercount\@ne
- \def\nnnext{\the\chaptercount}%
+ \ifnum#3=\z@
+ \toksa{\advance\chaptercount\@ne}%
+ \def\nnnext{\the\chaptercount}%
+ \else
+ \processcustomchapterref{#3}{#4}{\nnnext}%
+ \fi
}%
- \edef\next{\def\nnext{{#1}{\next}{\nnnext}}}%
+ \edef\next{\def\nnext{{#1}{\next}{\nnnext}{#3}}\the\toksa}%
\expandafter
}\next
- \advance\lxrcurrentindex\@ne
}
\def\xref@nowebsection#1{% translate the \CWEB\ section number into a \noweb\ reference
\expandafter\xr@f@nowebsection\romannumeral-1\csname lxref[#1]\endcsname.%
}
-\def\xr@f@nowebsection#1#2#3.{%
+\def\xr@f@nowebsection#1#2#3#4.{%
{#1}{#2}%
}
@@ -263,15 +317,45 @@
}%
}
-\def\setsafesecno#1{%
+\def\xref@sectionorchapter#1{% translate the \CWEB\ section number into a chapter number
+ % if the section begins a chapter or a \noweb\ section reference otherwise
+ \expandafter\xr@f@sectionorchapter\romannumeral-1\csname lxref[#1]\endcsname.%
+}
+
+\ifx\customchlabel\UNDEFINED
+ \def\customchlabel#1#2#3#4{%
+ ch#3%
+ }
+\fi
+
+\def\xr@f@sectionorchapter#1#2#3#4.{%
+ \yystringempty{#3}{{#1}{#1#2}}{%
+ {#1}{\customchlabel{#1}{#2}{#3}{#4}}%
+ }%
+}
+
+\def\setsafesecno#1{% extract the noweb style section reference from the \CWEB\ section index
+ % used to typeset marginal section references
\expandafter\ifx\csname lxref[#1]\endcsname\relax
#1%
\else
- \xref@nowebsection{#1}%
+ \expandafter\lmarginref\romannumeral-1\xref@nowebsection{#1}%
\fi
}
-\def\setsafechapno#1{%
+\def\lmarginref#1#2{{\sscmd\rm#1}\rlap{\sscmd\rm#2}\ }
+
+\def\setsafesecorchapno#1{% if the section begins a chapter, extract the chapter reference,
+ % otherwise, extract the \noweb\ style reference
+ \expandafter\ifx\csname lxref[#1]\endcsname\relax
+ #1%
+ \else
+ \expandafter\eatone\romannumeral-1\xref@sectionorchapter{#1}%
+ \fi
+}
+
+\def\setsafechapno#1{% extract the chapter index
+ % used to typeset chapter headers
\expandafter\ifx\csname lxref[#1]\endcsname\relax
#1%
\else
@@ -297,19 +381,29 @@
\repeat
}
-\def\XXX#1#2#3{%
+\defc\XXX#1#2#3{%
\ifcsecactive % previous command was \BBB (produced by the \B macro)
% \expandafter\def\csname lxref[][]\endcsname{}%
\csecactivefalse
\fi
}
-\def\SSS{\let\XXX\xxxchain} % reference separator
+% the next command takes advantage of the format for section references
+% in the list of all sections: instead of a specific section number that
+% points to the section where the given chunk of code started, the
+% references contain ordered lists of all the section numbers that
+% constitute the contents of the named section;
+% this command should be placed in the main .w file before the list
+% of all sections is included but after all the regular section references.
\def\lxrefseparator{%
- \write\xrefstream{\nx\SSS}%
+ \write\auxstream{\nx\SSS}%
}
+% forming chain references to be used for navigation through a given named section
+
+\defc\SSS{\let\XXX\xxxchain} % reference separator
+
\def\xxxchain#1#2#3{%
\xxxch@in{}{}#3, .%
}
@@ -349,7 +443,7 @@
% replace the default reference setting macros in gindex.sty;
% typeset references so that, for example, \(77){8, 9} becomes
-% \(\pdflink{77}{8c}), \(\pdfpagelink{9}) provided section 77
+% \(\compoundlink{77}{8c}), \(\pagelink{9}) provided section 77
% is section 8c by noweb's reckoning.
\def\consumeonexref#1#2{% #1 is the accumulated references
@@ -357,12 +451,12 @@
\expandafter\ifx\csname lxref[#2]\endcsname\relax
\errmessage{Section #2 does not have a local index.}%
\else
- \yybreak{\expandafter\c@nsumeonexref\romannumeral-1\xref@nowebsection{#2}{#2}{#1}}%
+ \yybreak{\expandafter\c@nsumeonexref\romannumeral-1\xref@sectionorchapter{#2}{#2}{#1}}%
\yycontinue
}
\def\c@nsumeonexref#1#2#3#4#5{% #1 is the page number of the beginning of the section
- % #2 is the (\noweb) section number (within the page) where the term appears
+ % #2 is the (\noweb) section or chapter reference where the term appears
% #3 is the (\CWEB) section number there the term appears
% #4 is the accumulated references
% #5 is a list of pages where this term appears
@@ -370,13 +464,13 @@
}
\def\c@nsume@nexref#1#2#3#4#5#6, {% #1 is the page number of the beginning of the section
- % #2 is the (\noweb) section number (within the page) where the term appears
+ % #2 is the (\noweb) section or chapter reference where the term appears
% #3 is the (\CWEB) section number where the term appears
% #4 is a total list of processed references
% #5 is a local list of processed references
% #6 is a page number from the list
\ifnum#1=#6 % the term appears on the same page where the section begins
- \yybreak{\c@nsume@nexr@f{#1}{#2}{#3}#4{#5}{\compoundlink{#3}{#1#2}}}%
+ \yybreak{\c@nsume@nexr@f{#1}{#2}{#3}#4{#5}{\compoundlink{#3}{#2}}}%
\else
\yybreak{\c@nsume@nexr@f{#1}{#2}{#3}#4{#5}{\pagelink{#6}}}%
\yycontinue
@@ -397,3 +491,5 @@
\def\attachlocallist#1#2#3#4#5#6#7{%
\grabfinexrefs{#6#7}%
}
+
+\toyyunion{aux:global:xrefs}
diff --git a/support/splint/tex/stokenset.sty b/support/splint/tex/stokenset.sty
index 9382415f6c..5f2b5345e3 100644
--- a/support/splint/tex/stokenset.sty
+++ b/support/splint/tex/stokenset.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -23,7 +23,6 @@
\prettywordpairwvis{EXTENDED}{{\tt ext}}{ext}%
\prettywordpair{LT}{{\tt l}}%
\prettywordpair{RT}{{\tt r}}%
-\prettywordpairwvis{$\ undefined}{{\tt\$undefined}}{$undefined}
\prettywordpairwvis{INTEGER}{{$[\,0\ldots9\,]\ast$}}{[0...9]}%
\prettywordpairwvis{IDENTIFIER}{{$[\,\hbox{\tt a}\ldots\hbox{\tt Z}\,0\ldots9\,]\ast$}}{[a...Z0...9]*}%
\prettywordpair{META_IDENTIFIER}{{\cyr\lqq{\rm meta identifier}\rqq}}%
diff --git a/support/splint/tex/trt1.sty b/support/splint/tex/trt1.sty
index 7783e15767..541f187916 100644
--- a/support/splint/tex/trt1.sty
+++ b/support/splint/tex/trt1.sty
@@ -1,4 +1,4 @@
-% Copyright 2014-2020, Alexander Shibakov
+% Copyright 2014-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -36,4 +36,6 @@
\newtoks\toksg
\newtoks\toksh
+\newread\trystream % generic stream to test for an existence of a file
+
\expandafter\def\csname loadtexruntime1\endcsname{\endinput}
diff --git a/support/splint/tex/xarithm.sty b/support/splint/tex/xarithm.sty
index d971092043..85987106f2 100644
--- a/support/splint/tex/xarithm.sty
+++ b/support/splint/tex/xarithm.sty
@@ -1,4 +1,4 @@
-% Copyright 2014-2020, Alexander Shibakov
+% Copyright 2014-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -209,7 +209,7 @@
\xbytigid#2#3{#4#5}%
}
-% similar to \xmultiply by digit above by produces the result in the
+% similar to \xmultiply by digit above but produces the result in the
% usual digit order
\def\xsmallmultiple#1#2{%
diff --git a/support/splint/tex/yxunion.sty b/support/splint/tex/yxunion.sty
deleted file mode 100644
index 4d03d83c78..0000000000
--- a/support/splint/tex/yxunion.sty
+++ /dev/null
@@ -1,33 +0,0 @@
-% Copyright 2012-2020, Alexander Shibakov
-% This file is part of SPLinT
-%
-% SPLinT 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.
-%
-% SPLinT 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 SPLinT. If not, see <http://www.gnu.org/licenses/>.
-
-% the original, minimal bootstrapping macros were designed to process
-% \prodstyle{\%token} declarations only and are enough to establish the
-% interface between the \bison\ parser and the \bison\ lexer; to serve
-% the secondary task of providing typesetting information to
-% the \bison\ parser, all forms of token declarations must be processed.
-
-\restorecslist{bootstrap}\yyunion % get the original bootstrap macros
-
-\def\precdecls#1#2#3#4#5{#3}
-
-\def\symbolprec#1#2{%
- \toksa{}\toksb{}%
- #1%
- \yytoksempty\toksb{}{\immediate\write\tokendefs{\noexpand\tokenpp{\the\toksb}}}%
-}
-
-\savecslist{bootstrap}\yyunion
diff --git a/support/splint/tex/yy.sty b/support/splint/tex/yy.sty
index 96769a0fc5..cf842ca3b0 100644
--- a/support/splint/tex/yy.sty
+++ b/support/splint/tex/yy.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -24,7 +24,6 @@
\def\optimization{0}% created with \csname ... \endcsname
\fi
-\newwrite\tokendefs
\let\nx\noexpand
\input yycommon.sty % general routines for stack and array access
@@ -48,8 +47,9 @@
% necessary and is removed by \removefinalvb (see limbo.sty and brack.pl for
% details).
-\expandafter\def\expandafter\multicharswitch\expandafter
-{\multicharswitch\yyendgame{\yyinput\yyeof\yyeof\endparseinput\removefinalvb}}
+\amendswitch\multicharswitch\near\yyeof\by\yyendgame\to\multicharswitch % add a new label
+\replaceaction\multicharswitch\at\yyendgame % replace the new empty action
+ \by{{\yyinput\yyeof\yyeof\endparseinput\removefinalvb}}\to\multicharswitch
\def\indexpseudonamespace{[index]}
@@ -61,11 +61,15 @@
\def\modebootstrap{%
\edef\tokendeffile{\jobname.tok}% so that the name of the token file can track the name of the parser
- \edef\bstrapparser{byytab.tex}% sets \bootstrapmodetrue
+ \ifx\bstrapparser\UNDEFINED\def\bstrapparser{byytab.tex}\fi% sets \bootstrapmodetrue (again)
+ \ifx\bstraptokens\UNDEFINED\def\bstraptokens{}\fi
+ \bootstrapmodetrue % yycommon defines \newif\ifbootstrapmode that sets \ifbootstrapmode to \iffalse
\def\bootstraplexersetup{\let\yylexreturn\yylexreturnbootstrap}% only return tokens whose value is known at bootstrap
\input yybootstrap.sty%
\def\PB##1{}
\def\inlineTeXx##1{}
+ \def\texref##1{}
+ \def\texrefx##1##2{}
}
\def\modenormal{%
@@ -78,8 +82,16 @@
%\def\fgetelemof##1\at##2{% speeds up the lookup
% \csname ##1\parsernamespace\the##2\endcsname
%}%
- \input yyinit.sty%
- \input yytexlex.sty%
+ \input yyinit.sty %
+ \input yytexlex.sty %
+ \input gindex.sty %
+ \input noweb.sty %
+ \xreflocaltrue
+ \let\sectionlistsetup\lxrefseparator
+ \let\inx\inxmod
+ \let\fin\finmod
+ \termindextrue
+ \immediate\openout\gindex=\jobname.gdx
}
\input yydebug.sty
diff --git a/support/splint/tex/yybootstrap.sty b/support/splint/tex/yybootstrap.sty
index 97ddb1a666..898e385b22 100644
--- a/support/splint/tex/yybootstrap.sty
+++ b/support/splint/tex/yybootstrap.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -16,15 +16,18 @@
% token equivalence table does not exist, switch to a bootstrap parser
+\newwrite\tokendefs
+
\ifx\tokendeffile\UNDEFINED
\else
\immediate\openout\tokendefs=\tokendeffile
\fi
+
\genericparser
name: bootstrap,
ptables: \bstrapparser,
ltables: cweb/ltab.tex,
- tokens: {},
+ tokens: \bstraptokens,
asetup: \bootstraplexersetup,
dsetup: \newlexerstateextra\newparserstateextra,
rsetup: {},
diff --git a/support/splint/tex/yycommon.sty b/support/splint/tex/yycommon.sty
index a8144efaa4..9dd249bd76 100644
--- a/support/splint/tex/yycommon.sty
+++ b/support/splint/tex/yycommon.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -14,9 +14,22 @@
% You should have received a copy of the GNU General Public License
% along with SPLinT. If not, see <http://www.gnu.org/licenses/>.
+% basic data manipulation and testing routines; these are not
+% specific to any parsing/lexing task and may be used independently;
+% register definitions from the `\TeX\ runtime' (trt1.sty) are needed
+% by the list and switch macros
+
\catcode`\@=11
-% stacks will be defined as `list' macros, consisting of \sts{...}\sts{...}... type lists
+% a nestable loop, needed by the macros in xarithm.sty, included
+% immediately after the definition
+
+\def\bloop#1\repeat{#1\bl@op{#1}\repeat\fi}
+\def\bl@op#1\repeat\fi{\fi#1\bl@op{#1}\repeat\fi}
+
+\input xarithm.sty
+
+% (unoptimized) stacks will be defined as `list' macros, consisting of \sts{...}\sts{...}... type lists
% in \yypopstack, the second parameter must be a positive number
%
% note: perhaps, replacing \sts with the name of the stack would allow for more economical
@@ -111,55 +124,28 @@
\def\stackfinish#1{\def#1{0\message{:stack empty:}}}
-\def\yyreadvstack#1\upto#2{% assume that #2 > 0
- \edef\sts{\noexpand\splitstack{\number#2}{\expandafter\xincrement\expandafter{\number\toptoks}}}#1\stackend#1%
-}
-
-\long\def\splitstack#1#2#3{%
- \expandafter\def\csname$'#1\endcsname{#3}% $
- \ifnum#2<\@cclvi % we have not reached the maximum allocated number of token registers
- \expandafter\toksdef\csname$$'#1\endcsname=#2
- \toks#2{#3}%
- \fi
- \ifnum#1=\@ne %we have read the values
- \let\sts\scoopupstack
- \else
- \edef\sts{\noexpand\splitstack{\xdecrement{#1}}{\xincrement{#2}}}%
- \fi
-}
+% (unoptimized) arrays of integers are represented by a string of tokens `element0 \or element1 \or ...'
+% #2 is a register (otherwise the case and the integer from the array `coalesce');
+% the following macro was designed to make something like
+% \tempca=\getelemof\yytable\at\yyn\relax possible so it has to expand to a number;
+% incidentally, some care should be taken using the above assignment to make sure that
+% it is not followed by an expandable token (such as \if) as in this case the token might be
+% expanded prematurely while the assignment is looking for the first non-expandable token which
+% is not part of the number; this is the reason for the \relax
-\def\yypeekvstack#1\upto#2{% assume #2 > 0
- \edef\sts{\noexpand\peelstack{\number#2}{\expandafter\xincrement\expandafter{\number\toptoks}}}#1\relax%
+\def\getelemof#1\at#2{% #1 is the name of the token register containing the array, #2 is the index
+ \expandafter\get@l@mof\expandafter{\csname#1\endcsname}{#2}%
}
-\long\def\peelstack#1#2#3{%
- \expandafter\def\csname$'#1\endcsname{#3}% $
- \ifnum#2<\@cclvi % we have not reached the maximum allocated number of token registers
- \expandafter\toksdef\csname$$'#1\endcsname=#2
- \toks#2{#3}%
- \fi
- \ifnum#1=\@ne %we have read the values
- \let\sts\eatone
- \else
- \edef\sts{\noexpand\peelstack{\xdecrement{#1}}{\xincrement{#2}}}%
- \fi
+\def\get@l@mof#1#2{%
+ \expandafter\get@lemof\expandafter{\the#1}{#2}%
}
-% macros to support new printing routines
-
-\def\yypeeksstack#1\upto#2\withprefix#3{% assume #2 > 0
- \edef\sts{\noexpand\peelsstack{\number#2}}%
- \expandafter\def\expandafter\sts\expandafter{\sts{#3}{}}#1\relax%
+\def\get@lemof#1#2{%
+ \ifcase#2 #1\else\fi
}
-\long\def\peelsstack#1#2#3#4{%
- \ifnum#1=\@ne %we have read the values
- #3\let\sts\eatone
- \else
- \edef\sts{\noexpand\peelsstack{\xdecrement{#1}}}%
- \expandafter\def\expandafter\sts\expandafter{\sts{#2}{#2{#4}#3}}%
- \fi
-}
+\let\fgetelemof\getelemof
% token register access
@@ -210,6 +196,29 @@
#3{#1#2}%
}
+% a macro to append new material to an existing control sequence
+
+\def\appendxrt#1#2#3#4{% #1 one of \def, \edef (why?), \gdef, \xdef (why?)
+ % #2 sequence name being appended to
+ % #3 the material appended to the right (expanded once)
+ % #4 the material appended to the right of #3 (not expanded)
+ \expandafter\app@ndxrt\expandafter{\csname #2\endcsname}{#1}{#3}{#4}%
+}
+
+\def\app@ndxrt#1#2#3#4{% #1 is the sequence being appended to
+ % #2 is \?def
+ % #3 is expanded once (appended to the right of #1)
+ % #4 is appended to the right of #3 (not expanded)
+ \expandafter\ap@@ndxrt\expandafter{#3}{#4}{#2}{#1}%
+}
+
+\def\ap@@ndxrt#1#2#3#4{% #1 is expanded once (appended to the right of #4)
+ % #2 is appended to the right of #1 (not expanded)
+ % #3 is \?def
+ % #4 is the sequence being appended to
+ \expandafter#3\expandafter#4\expandafter{#4#1#2}%
+}
+
% the following macros are an expandable way to determine if a token register is empty;
% while a number of different conditionals can be used, including plain \iffalse,
% this choice seems to result in a shortest macro and the fewest number of \expandafter's;
@@ -236,9 +245,10 @@
% non-brace while the parameter scanning mechanism of \TeX\ will try
% to collect the smallest possible balanced input; the `excessive'
% braces will disappear in the expansion of the `\if...' construct;
-% the reason \if or other macros that expand their arguments are so well suited for this
-% `chain expansion' mechanism is in the fact that the expansions for \string and \if... are launched
-% from the same point.
+% the reason \if or other macros that expand their arguments are so
+% well suited for this `chain expansion' mechanism is in the fact
+% that the expansions for \string and \if... are launched from the
+% same point.
\long\def\yytoksempty#1{%
\iffalse{{\fi
@@ -283,7 +293,19 @@
{\expandafter\yythirdofthree\expandafter{\string}}%
}
-% the macros below are a derivation of David Kastrup's magnificent string comparison
+% the macro below can be simplified by reducing the number of braces
+% but then \yytoks@mpty could not be reused
+
+\long\def\yystartsinbrace#1{%
+ \iffalse{\fi
+ \if{\yytoks@mpty#1}}%
+ \yybreak\yysecondoftwo
+ \else
+ \yybreak\yyfirstoftwo
+ \yycontinue
+}
+
+% the macros below are based on David Kastrup's magnificent string comparison
% macros:
% \def\strequal#1{\number\strequalstart{}{}#1\relax}
% \def\strequalstart#1#2#3{\if#3\relax\strequalstop\fi
@@ -318,26 +340,75 @@
\def\yystrcleanup#1\yysecondoftwo{#1\yyfirstoftwo}
-% a `self-propagating \expandafter'; allows building lists like \yysx a\yysx b ...
-% so that a \romannumeral-1 at the beginning of the list would cary the expansion
-% to the last token but leave the list intact; note that #1 should be a single token
+% prefix comparison macros
+% use: \romannumeral-0\yyprefixmatch{string1}{string2}
+% this will expand into {common prefix}{rest of string1}{rest of string2}
-\def\yysx#1#2{%
- \expandafter\space\expandafter\yysx\expandafter#1\romannumeral-1#2%
+\def\yyprefixmatch#1#2{%
+ \yyprefixmatchbegin{#1\end}{#2\relax}{}%
}
-% the macro below can be simplified by reducing the number of braces
-% but then \yytoks@mpty could not be reused
+\def\yyprefixmatchbegin#1#2{%
+ \yypr@fixmatch#1{#2}%
+}
-\long\def\yystartsinbrace#1{%
- \iffalse{\fi
- \if{\yytoks@mpty#1}}%
- \yybreak\yysecondoftwo
+\def\yypr@fixmatch#1#2#{%
+ \yypr@fixm@tch{#1}{#2}%
+}
+
+\def\yypr@fixm@tch#1#2#3{% #2 is the rest of string1, #1 is the first char of string1
+ \yyprefixrematch#3{#1}{#2}%
+}
+
+\def\yyprefixrematch#1#2#{%
+ \yypr@fixrematch{#1}{#2}%
+}
+
+\def\yypr@fixrematch#1#2#3#4#5{%
+ \ifx#1#3%
+ \yybreak{\yyprefixmatchbegin{#4}{#2}{#5#1}}%
\else
- \yybreak\yyfirstoftwo
+ \yybreak{\yyprefixmatchend{#3#4}{#1#2}{#5}}%
\yycontinue
}
+\def\yyprefixmatchend#1#2#3{%
+ \yypr@fixmatchend#1#2{#3}%
+}
+
+\def\yypr@fixmatchend#1\end#2\relax#3{%
+ {#3}{#1}{#2}%
+}
+
+% macros to check if the string matches #1* for some char #1
+% use: \yyifrepeatedchar{char}{string}{true case}{false case}
+
+\def\yyifrepeatedchar#1#2{%
+ \yyifr@peatedchar#1#2\relax
+}
+
+\def\yyifr@peatedchar#1#2{%
+ \ifx#2\relax
+ \yybreak{\yyfirstoftwo}% string complete, match
+ \else
+ \yybreak{\yyifr@p@atedchar#1#2}%
+ \yycontinue
+}
+
+\def\yyifr@p@atedchar#1#2{%
+ \ifx#1#2%
+ \yybreak{\yyifr@peatedchar#1}% next character
+ \else
+ \yybreak{\yyifrepeatedcharmismatch}%
+ \yycontinue
+}
+
+\def\yyifrepeatedcharmismatch#1\relax{%
+ \yysecondoftwo
+}
+
+% end prefix comparison macros
+
% a test to determine whether the argument is a given control sequence
\long\def\yyisthiscs#1#2{%
@@ -362,95 +433,443 @@
\expandafter\yyisthiscs\expandafter{\the#1}%
}
-\long\def\yyfirstoftwo#1#2{#1}
-\long\def\yysecondoftwo#1#2{#2}
-\long\def\yyfirstofthree#1#2#3{#1}
-\long\def\yysecondofthree#1#2#3{#2}
-\long\def\yythirdofthree#1#2#3{#3}
+% a `self-propagating \expandafter'; allows building lists like \yysx a\yysx b ...
+% so that a \romannumeral-1 at the beginning of the list would cary the expansion
+% to the last token but leave the list intact; note that #1 should be a single token
-\long\def\yypioneofthree#1#2#3{{#1}}
-\long\def\yypitwoofthree#1#2#3{{#2}}
-\long\def\yypithreeofthree#1#2#3{{#3}}
+\def\yysx#1#2{%
+ \expandafter\space\expandafter\yysx\expandafter#1\romannumeral-1#2%
+}
-% (unoptimized) arrays of integers are represented by a string of tokens `element0 \or element1 \or ...'
-% #2 is a register (otherwise the case and the integer from the array `coalesce');
-% the following macro was designed to make something like
-% \tempca=\getelemof\yytable\at\yyn\relax possible so it has to expand to a number;
-% incidentally, some care should be taken using the above asignment to make sure that
-% it is not followed by an expandable token (such as \if) as in this case the token might be
-% expanded prematurely while the assignment is looking for the first non-expandable token which
-% is not part of the number; this is the reason for the \relax
+% linked list macros
-\def\getelemof#1\at#2{% #1 is the name of the token register containing the array, #2 is the index
- \expandafter\get@l@mof\expandafter{\csname#1\endcsname}{#2}%
-}
+\newif\iftracinglists
-\def\get@l@mof#1#2{%
- \expandafter\get@lemof\expandafter{\the#1}{#2}%
+\def\initlist#1{% #1 is the list name
+ \iftracinglists
+ \message{init list<#1>}%
+ \fi
+ \expandafter\def\csname list.counter(#1)\endcsname{0}% init the counter
+ \resetlistpointer{#1}%
}
-\def\get@lemof#1#2{%
- \ifcase#2 #1\else\fi
+\def\resetlistpointer#1{%
+ \iftracinglists
+ \message{reset list pointer<#1>}%
+ \fi
+ \expandafter\def\csname list.pointer(#1)\endcsname{0}% init the pointer
+}
+
+% the macro below may fail on some potential elements (the ones that contain #'s);
+% for extra robustness one may use \appendtolistx after storing the list element in
+% a token register.
+% if the list implementation changes, \splitlist@t must change too
+
+\def\appendtolistg#1#2#3{% #1 is the list name
+ % #2 is the list element
+ % #3 is the action on the contents
+ % store the contents in the inner element
+ \expandafter#3\csname list.term.1(#1)[\csname list.counter(#1)\endcsname]\endcsname{ #2}%
+ \iftracinglists
+ {\edef\lname{#1}\toksa\expandafter\expandafter\expandafter
+ {\csname list.term.1(#1)[\csname list.counter(#1)\endcsname]\endcsname}%
+ \message{adding to list<#1> at \showlistcounter{\lname}::\the\toksa.}}%
+ \fi
+ {%
+ \edef\listname{#1}%
+ \tempca\csname list.counter(\listname)\endcsname\relax
+ % outer element name
+ \toksa\expandafter{\csname list.term.0(\listname)[\the\tempca]\endcsname}%
+ % inner element name
+ \toksb\expandafter{\csname list.term.1(\listname)[\the\tempca]\endcsname}%
+ \advance\tempca by\@ne
+ % next outer element name
+ \toksc\expandafter{\csname list.term.0(\listname)[\the\tempca]\endcsname}%
+ \edef\next{%
+ % store the new counter
+ \def\expandafter\noexpand\csname list.counter(\listname)\endcsname{\the\tempca}%
+ % wrap the inner element
+ \def\the\toksa{\noexpand\expandafter\the\toksb\noexpand\romannumeral0\the\toksc}%
+ }\expandafter
+ }\next % \next is not affected by this
}
-\let\fgetelemof\getelemof
+\def\appendtolist#1#2{\appendtolistg{#1}{#2}{\def}}
+\def\appendtolistx#1#2{\appendtolistg{#1}{#2}{\edef}}
+\def\appendtolisti#1#2{\appendtolistg{#1}{#2}{\fdef}}
-% a nestable loop
+% note that lists with \listiterator entries can be executed and spliced
+% but some functions (like \replace...) below do not work properly
-\def\bloop#1\repeat{#1\bl@op{#1}\repeat\fi}
+\def\fdef#1#2{%
+ \def#1{\listiterator{#1}{#2}}% so that #1 knows its name ...
+}
-\def\bl@op#1\repeat\fi{\fi#1\bl@op{#1}\repeat\fi}
+\def\listiteratorsimple#1#2{%
+ #2%
+}
-% optimization macros: currently, the level of optimization has to be consistent throughout the
-% document, i.e. \optimize macros have to be called on the same arrays after loading.
-% the reason is the yyfaststack.sty file that modifies the \newtable macro once for all the tables
+\let\listiterator\listiteratorsimple % expand the list without preprocessing
-\def\optimize#1{%
- \setoptopt{#1}%
- \tempca\z@
- \bloop
- \tempcb=\expandafter\ifcase\expandafter\tempca\the\csname#1\endcsname\else\@MM\fi\relax
- \ifnum\tempcb<\@MM %
- \expandafter\edef\csname #1\parsernamespace\the\tempca\endcsname{\the\tempcb}%
- \advance\tempca\@ne
- \repeat
+% the name of the next macro is misleading: the whole
+% concatenated list starts at the first term of list #1
+% but the only way to append to the resulting list is to append to
+% list #2; any attempt to append a term to list #1 will
+% disconnect the lists (although they can be concatenated again)
+
+\def\concatlists#1#2{%
+ \expandafter\expandafter\expandafter
+ \let\expandafter\expandafter
+ \csname list.term.0(#1)[\csname list.counter(#1)\endcsname]\endcsname
+ \csname list.term.0(#2)[0]\endcsname
}
-\def\optimizetext#1{% optimizing text arrays
- \setoptopt{#1}%
- \tempca\z@
- \@ptimizetext{#1}
+\def\listisempty#1{%
+ \ifnum\csname list.counter(#1)\endcsname=\z@
+ \yybreak\yyfirstoftwo
+ \else
+ \yybreak\yysecondoftwo
+ \yycontinue
}
-\def\@ptimizetext#1{%
- \edef\next{\expandafter\ifcase\expandafter\tempca\the\csname#1\endcsname\else\end\fi}%
- \ifx\next\endcontainer
- \let\next\eatone
+% execute a slice of a list (commonly amended by an iterator)
+
+\def\evallistbetween#1#2#3{% #1 is the list name
+ % #2 is the start marker
+ % #3 is the finish marker
+ \ifnum#3<#2\relax
+ \yybreak{}%
\else
- \expandafter\edef\csname #1\parsernamespace\the\tempca\endcsname{\next}%
- \advance\tempca\@ne
- \let\next\@ptimizetext
+ \yybreak{%
+ \expandafter\expandafter\expandafter\@vallistbetween\csname list.term.0(#1)[#3]\endcsname{#1}{#2}{#3}%
+ }%
+ \yycontinue
+}
+
+\def\@vallistbetween#1#2#3#4#5#6#7#8{% #1 \expandafter
+ % #2 the contents of the element at #6
+ % #3 \romannumeral
+ % #4 0
+ % #5 the next element in the remaining list
+ % #6 the list name
+ % #7 the start marker
+ % #8 the finish marker
+ \expandafter\edef\csname list.term.0(#6)[#8]\endcsname{%
+ \noexpand#1\noexpand#2\noexpand#3#4\noexpand\space
+ }% terminate the list temporarily
+ \executelistat{#6}{#7}% execute the list slice
+ \expandafter\edef\csname list.term.0(#6)[#8]\endcsname{%
+ \noexpand#1\noexpand#2\noexpand#3#4\noexpand#5%
+ }% restore the list
+}
+
+% the macro below cannot be used with iterator amended lists (unless the iterator
+% is purely expandable)
+
+\def\readlistbetween#1#2#3\to#4{% #1 is the list name
+ % #2 is the start marker
+ % #3 is the finish marker
+ % #4 is name of the token register
+ \ifnum#3<#2\relax
+ %\errmessage{trying to read a negative slice (#2->#3) in list #1}%
+ #4{}%
+ \else
+ \expandafter\expandafter\expandafter\r@adlistbetween\csname list.term.0(#1)[#3]\endcsname{#1}{#2}{#3}{#4}%
\fi
- \next{#1}%
}
-\def\uoptimize#1{% same as the macro above but produces nonnegative constants as \mathchardef's
- \setoptopt{#1}%
- \tempca\z@
- \bloop
- \tempcb=\expandafter\ifcase\expandafter\tempca\the\csname#1\endcsname\else\@MM\fi\relax
- \ifnum\tempcb<\@MM %
- \toksa\expandafter{\csname #1\parsernamespace\the\tempca\endcsname}%
- \edef\next{\mathchardef\the\toksa=\the\tempcb\relax}\next
- \advance\tempca\@ne
- \repeat
+\def\r@adlistbetween#1#2#3#4#5#6#7#8#9{% #1 \expandafter
+ % #2 the contents of the element at #6
+ % #3 \romannumeral
+ % #4 0
+ % #5 the next element in the remaining list
+ % #6 the list name
+ % #7 the start marker
+ % #8 the finish marker
+ % #9 the token register
+ \expandafter\edef\csname list.term.0(#6)[#8]\endcsname{%
+ \noexpand#1\noexpand#2\noexpand#3#4\noexpand\space
+ }% terminate the list temporarily
+ #9\expandafter{\romannumeral0\executelistat{#6}{#7}}% store the list slice
+ \expandafter\edef\csname list.term.0(#6)[#8]\endcsname{%
+ \noexpand#1\noexpand#2\noexpand#3#4\noexpand#5%
+ }% restore the list
+}
+
+\def\consumelistupto#1#2\to#3{%
+ \readlistbetween{#1}{\showlistpointer{#1}}{#2}\to{#3}%
+ {%
+ \iftracinglists
+ \message{splice<#1> (\csname list.pointer(#1)\endcsname,#2)}%
+ \fi
+ \tempca=#2\relax
+ \advance\tempca\@ne
+ \ifnum\tempca>\showlistpointer{#1}\relax
+ \edef\next{\def\expandafter\noexpand\csname list.pointer(#1)\endcsname{\the\tempca}}%
+ \else
+ \let\next\empty
+ \fi
+ \expandafter
+ }\next
+}
+
+\def\consumefulllist#1\to#2{%
+ #2\expandafter{\romannumeral0\executelistat{#1}{\showlistpointer{#1}}}%
+}
+
+% the macro below is not aware of the list iterators so it should be used carefully with amended lists
+% (one possible way is to redefine the list iterator before applying this macro).
+
+\def\changelistelem#1#2#3#4{% #1 list name
+ % #2 marker
+ % #3 prefix
+ % #4 suffix
+ \expandafter\ch@ngelistelem\csname list.term.1(#1)[#2]\endcsname{#3}{#4}%
+}
+
+\def\ch@ngelistelem#1#2#3{
+ \expandafter\ch@ng@listelem\expandafter{#1}#1{#2}{#3}%
+}
+
+\def\ch@ng@listelem#1#2#3#4{% remove the space added by the list packaging macros
+ \expandafter\ch@ng@l@stelem\expandafter{\romannumeral0#1}{#2}{#3}{#4}%
+}
+
+\def\ch@ng@l@stelem#1#2#3#4{% assemble everything
+ \def#2{ #3#1#4}%
+}
+
+\def\replacelistelemg#1#2#3#4{% #1 list name
+ % #2 marker
+ % #3 new contents
+ % #4 action (\def, \edef, etc.)
+ \expandafter\expandafter\expandafter\r@placelistelem\csname list.term.0(#1)[#2]\endcsname{#1}{#2}%
+ \expandafter#4\csname list.term.1(#1)[#2]\endcsname{#3}%
+}
+
+\def\r@placelistelem#1#2#3#4#5#6#7{% #1 \expandafter
+ % #2 the contents of the element at #7
+ % #3 \romannumeral
+ % #4 0
+ % #5 the next element in the list
+ % #6 the list name
+ % #7 the marker
+ \expandafter\edef\csname list.term.0(#6)[#7]\endcsname{\noexpand\expandafter
+ \expandafter\noexpand\csname list.term.1(#6)[#7]\endcsname
+ \noexpand\romannumeral0\noexpand#5}%
+}
+
+\def\replacelistelem#1#2#3{%
+ \replacelistelemg{#1}{#2}{#3}{\def}%
+}
+
+\def\replacelistelemx#1#2#3{%
+ \replacelistelemg{#1}{#2}{#3}{\edef}%
+}
+
+% the next macro assumes that the list counter is pointing to the last (currently empty)
+% list element
+
+\def\finishlist#1{% #1 is the list name
+ \expandafter\def\csname list.term.0(#1)[\showlistcounter{#1}]\endcsname{ }%
+}
+
+\def\executelistat#1#2{% #1 is the list name
+ % #2 is the element at which to start execution
+ \csname list.term.0(#1)[#2]\endcsname
+}
+
+\def\executelist#1{% #1 is the list name
+ \romannumeral0\executelistat{#1}{0}%
+}
+
+\def\storelist#1\to#2{% #1 is the list name
+ % #2 is the token register to store it in
+ #2\expandafter{\romannumeral0\csname list.term.0(#1)[0]\endcsname}%
+}
+
+\def\storelistx#1\to#2#3{% #1 is the list name
+ % #2 is the token register to store it in
+ % #3 is the suffix
+ #2\expandafter{\romannumeral0\csname list.term.0(#1)[0]\endcsname#3}%
+}
+
+\def\showlistcounter#1{%
+ \number\csname list.counter(#1)\endcsname
+}
+
+\def\showlistpointer#1{%
+ \number\csname list.pointer(#1)\endcsname
+}
+
+\def\showlistcs#1{%
+ {\toksa\expandafter{\csname list.term.0(#1)[\csname list.counter(#1)\endcsname]\endcsname}%
+ \toksb\expandafter\expandafter\expandafter{\the\toksa}%
+ \message{current cs: \the\toksa is \the\toksb}}%
+}
+
+% use example for the macros above:
+%\initlist{table}
+%\toksa{#}
+%\appendtolistx{table}{\the\toksa,}
+%\appendtolist{table}{a,}
+%\appendtolist{table}{b,}
+%\appendtolist{table}{{c},}
+%\appendtolist{table}{d,}
+%\appendtolist{table}{e,}
+%\appendtolist{table}{{f}}
+%\appendtolist{table}{\space.}
+%\appendtolistx{table}{\space\space\end}
+%\finishlist{table}
+%\storelist{table}\to\toksa
+%\errmessage{full list: \the\toksa}
+
+% use example for the macros above:
+%\initlist{table}
+%\toksa{#}
+%\def\listiteratorxmpl#1#2{%
+% #2{\format}%
+%}
+%\let\listiterator\listiteratorxmpl
+%\appendtolisti{table}{..}
+%\appendtolisti{table}{a,}
+%\appendtolisti{table}{b,}
+%\appendtolisti{table}{{c},}
+%\appendtolisti{table}{d,}
+%\appendtolisti{table}{e,}
+%\appendtolisti{table}{{f}}
+%\appendtolisti{table}{.}
+%\appendtolisti{table}{\end}
+%\finishlist{table}
+%\storelist{table}\to\toksa
+%\errmessage{full list: \the\toksa}
+
+% `data structure access' macros: picking the n-th undelimited parameter
+% in a parameter list inside a token register
+% it is assumed that none of the arguments is \end, and that there are enough
+% parameters to pick the desired one
+
+\def\getfirst#1\to#2{%
+ #2\expandafter\expandafter\expandafter{\expandafter\g@tfirst\the#1\end}%
+}
+
+\def\g@tfirst#1#2\end{#1}
+
+\def\getsecond#1\to#2{%
+ #2\expandafter\expandafter\expandafter{\expandafter\g@tsecond\the#1\end}%
+}
+
+\def\g@tsecond#1#2#3\end{#2}
+
+\def\getthird#1\to#2{%
+ #2\expandafter\expandafter\expandafter{\expandafter\g@tthird\the#1\end}%
+}
+
+\def\g@tthird#1#2#3#4\end{#3}
+
+\def\getfourth#1\to#2{%
+ #2\expandafter\expandafter\expandafter{\expandafter\g@tfourth\the#1\end}%
+}
+
+\def\g@tfourth#1#2#3#4#5\end{#4}
+
+\def\getfifth#1\to#2{%
+ #2\expandafter\expandafter\expandafter{\expandafter\g@tfifth\the#1\end}%
+}
+
+\def\g@tfifth#1#2#3#4#5#6\end{#5}
+
+\def\getsixth#1\to#2{%
+ #2\expandafter\expandafter\expandafter{\expandafter\g@tsixth\the#1\end}%
}
-\def\setoptopt#1{%
- \expandafter\let\csname optopt[#1]\parsernamespace\endcsname\end
+\def\g@tsixth#1#2#3#4#5#6#7\end{#6}
+
+\def\getseventh#1\to#2{%
+ #2\expandafter\expandafter\expandafter{\expandafter\g@tseventh\the#1\end}%
}
-\countdef\toptoks=15 % register responsible for token allocations
+\def\g@tseventh#1#2#3#4#5#6#7#8\end{#7}
+
+\def\geteightth#1\to#2{%
+ #2\expandafter\expandafter\expandafter{\expandafter\g@teightth\the#1\end}%
+}
+
+\def\g@teightth#1#2#3#4#5#6#7#8#9\end{#8}
+
+\def\getninth#1\to#2{% the `.' is necessary since \TeX's scanning mechanism will
+ % strip any potential braces surrounding the last parameter
+ % (assuming there are exactly nine) twice:
+ % o first, expanding \g@tninth,
+ % o second, expanding \g@tfirst
+ #2\expandafter\expandafter\expandafter{\expandafter\g@tninth\the#1.\end}%
+ #2\expandafter\expandafter\expandafter{\the#2}%
+}
+
+\def\g@tninth#1#2#3#4#5#6#7#8#9\end{\g@tfirst#9\end}
+
+\def\gettenth#1\to#2{% no need for `.' (or any other placeholder) here,
+ % since the #9-th parameter to \g@ttenth is a list of
+ % at least two parameters itself, thus any existing braces
+ % have survived intact
+ #2\expandafter\expandafter\expandafter{\expandafter\g@ttenth\the#1\end}%
+ #2\expandafter\expandafter\expandafter{\the#2}%
+}
+
+\def\g@ttenth#1#2#3#4#5#6#7#8#9\end{\g@tsecond#9\end}
+
+% removing the first element of a token register if it has more than one;
+
+\def\sansfirst#1{%
+ \expandafter\s@nsfirst\expandafter{\the#1}{#1}%
+}
+
+\def\s@nsfirst#1#2{%
+ \expandafter\s@nsf@rst\expandafter{\eatone#1}{#2}%
+}
+
+\def\s@nsf@rst#1#2{%
+ \yystringempty{#1}{}{%
+ #2{#1}%
+ }%
+}
+
+% a version of the macro above that expands to the original argument with the first element removed
+
+\def\sansfirstx#1{%
+ \expandafter\yystringempty\expandafter{\eatone#1}{#1}{\eatone#1}%
+}
+
+% string replacement: all arguments are registers, nothing is expanded, no \next is defined
+% note that this is not a greedy replacement: this could be arranged with a more sophisticated macro
+% also note that the string being replaced cannot have any braces in it
+
+\newif\ifyytracereplacements
+\newif\ifyyreplaced
+
+\yytracereplacementstrue
+
+\def\yyreplacestring#1\in#2\with#3{%
+ \expandafter\def\expandafter\r@placestring\expandafter##\expandafter1\the#1##2\end{%
+ \def\r@placestring{##2}% is this the string at the very end?
+ \ifx\r@placestring\empty % then it is the one we inserted,
+ % report
+ \yyreplacedfalse
+ \ifyytracereplacements
+ \errmessage{string <\the#1> not present in \the#2}% do not change the register if the string is not there
+ \fi
+ \else % remove the extra copy of #1\end at the end
+ \yyreplacedtrue
+ \expandafter#2\expandafter\expandafter\expandafter
+ {\expandafter\r@plac@string\expandafter{\the#3}{##1}##2\end}%
+ \fi}% end of \r@placestring definition
+ \expandafter\def\expandafter\r@plac@string
+ \expandafter##\expandafter1%
+ \expandafter##\expandafter2%
+ \expandafter##\expandafter3%
+ \the#1\end{##2##1##3}%
+ \expandafter\expandafter\expandafter\r@placestring\expandafter\the\expandafter#2\the#1\end
+}
% returning token register values from a group
% in such a way that no other register values are affected
@@ -540,7 +959,7 @@
\yystringempty{#2}{\toksa{\taction}}{\toksa{\caction}}%
}
-\def\action#1\in#2{%
+\def\switchonwithtype#1\in#2{%
\begingroup
\checkforcount#1%
\toksb{{#1}\in{#2}}\concat\toksa\toksb
@@ -548,7 +967,6 @@
}%
\let\switchon\taction
-\let\switchonwithtype\action % phase out \action, since it is a rather common name
\let\default\relax
\def\grabaction#1#2\grabaction{\toksa{#1}}
@@ -561,11 +979,16 @@
% the macros are not expandable but can be made such with some
% (rather significant) effort
-% #1 is the label at which to change
-% #2 is the new label
-% #3 is the name of the new switch
-% #4 is the switch
+% #1 is the name of the old switch
+% #2 is the existing label to which the new label will be added
+% #3 is the new label
+% #4 is the name of the new switch
% #5 is the operation to perform if #2 is present and #3 is not
+% this operation takes the following parameters:
+% #1: the expanded original switch
+% #2: the existing label
+% #3: the new label
+% #4: the name of the new switch
\def\matchswitch#1#2#3#4#5{%
\expandafter\matchswitch@a\expandafter{#1}{#2}{#3}{#4}{#1}{\matchswitch@e}{#5}%
}
@@ -630,7 +1053,7 @@
}
\def\matchswitch@f#1#2#3#4#5#6#7{%
- \yystringempty{#1}{% label not present
+ \yystringempty{#1}{% (new) label not present
#7{#2}{#4}{#3}{#5}%
}{%
\errhelp{Switch #6 contents: #2}%
@@ -638,6 +1061,16 @@
}%
}
+% add a new empty action to a switch with a known action (safety feature)
+
+\def\amendswitch#1\near#2\by#3\to#4{%
+ \matchswitch{#1}{#2}{#3}{#4}{\@mendswitch}%
+}
+
+\def\@mendswitch#1#2#3#4{%
+ \def#4{#1#3{}}%
+}
+
% add a label to an existing action
\def\extendswitch#1\at#2\by#3\to#4{%
@@ -661,6 +1094,11 @@
}
% replace an existing action inside a switch
+% this can also be used to add new labels, although no check is performed
+% whether the new label already exists
+% a word of caution: if one is using this command as intended, the
+% action code should be surrounded by an additional pair of braces (see
+% a use example in yy.sty)
\def\replaceaction#1\at#2\by#3\to#4{%
\matchswitch{#1}{#2}{}{#4}{\r@placeaction{#3}}%
@@ -761,16 +1199,22 @@
% adding a \fi before \yycontinue, which will not affect a properly constructed
% conditional
+\long\def\yyfirstoftwo#1#2{#1}
+\long\def\yysecondoftwo#1#2{#2}
+\long\def\yyfirstofthree#1#2#3{#1}
+\long\def\yysecondofthree#1#2#3{#2}
+\long\def\yythirdofthree#1#2#3{#3}
+
+\long\def\yypioneofthree#1#2#3{{#1}}
+\long\def\yypitwoofthree#1#2#3{{#2}}
+\long\def\yypithreeofthree#1#2#3{{#3}}
+
% macros for taking care of extra tokens
-\long\def\yyid#1{#1} % this is misnamed since it changes #1 by stripping braces and spaces
+\long\def\yyid#1{#1} % this is misnamed since it may change #1 by stripping braces and spaces
\long\def\yyswap#1#2{#2#1}
\long\def\eatone#1{}
\long\def\eattwo#1#2{}
\long\def\eatthree#1#2#3{}
\long\def\eattoend#1\end{}
\long\def\eattospace#1 {}
-
-\input xarithm.sty
-
-\newif\ifbootstrapmode
diff --git a/support/splint/tex/yydebug.sty b/support/splint/tex/yydebug.sty
index 0d763aecfa..05aae20a2e 100644
--- a/support/splint/tex/yydebug.sty
+++ b/support/splint/tex/yydebug.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -41,6 +41,9 @@
\yydebugmost
\checktabletrue
\saveparseoutputtrue
+ \indexverbosetrue
+ \displaytokenrawtrue % so that the `nonstringified' version of the token is displayed as well
+
}
\def\yydebugparse{%
@@ -94,6 +97,7 @@
\yyinputdebugtrue
\yytracereplacementstrue
\traceprettytokenstrue
+ \tracingliststrue
}
\def\yydebugnone{% turn all debugging options off
@@ -125,11 +129,14 @@
\yyinputdebugfalse
\yytracereplacementsfalse
\cdebugfalse
+ \indexverbosefalse
+ \displaytokenrawfalse
+ \tracinglistsfalse
}
% miscellaneous shortcuts
-\def\shownethe#1{%
+\def\shownethe#1{% show the token register only if it is not empty
{%
\edef\next{\the#1}%
\ifx\next\empty
@@ -139,10 +146,15 @@
}%
}
-\def\showem#1#2#3{\toksa{#1}\toksb{#2}\toksc{#3}{\newlinechar=`^^J%
+\def\showem#1#2#3{\toksa{#1}\toksb{#2}\toksc{#3}{\newlinechar=`^^J% show the first three arguments
\errmessage{%
arg. 1: \the\toksa^^J%
arg. 2: \the\toksb^^J%
arg. 3: \the\toksc%
}}}
+\def\debugthisbox#1{% show the box with good depth and width
+ \showboxdepth=1000
+ \showboxbreadth=1000
+ \ifcdebug\showbox#1 \fi
+}
diff --git a/support/splint/tex/yyfaststack.sty b/support/splint/tex/yyfaststack.sty
index 9bf46b3d1e..832ef8cfce 100644
--- a/support/splint/tex/yyfaststack.sty
+++ b/support/splint/tex/yyfaststack.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -61,7 +61,7 @@
0\expandafter\noexpand\csname \expandafter\eatone\string#1[#2]\parsernamespace\endcsname
}
-\def\movestackpointer#1\by#2{%
+\def\movestackpointer#1\by#2{% this assumes that #1 is a control sequence
\expandafter\advance\csname \expandafter\eatone\string#1<count>\endcsname#2%
}
@@ -88,6 +88,11 @@
\expandafter\expandafter\expandafter\edef\gettopofstackcs#2{#1}%
}
+\long\def\yypushg#1\on#2{% global push with expand: do not use this for anything other than index macros
+ \expandafter\global\romannumeral0\movestackpointer#2\by\@ne
+ \expandafter\expandafter\expandafter\xdef\gettopofstackcs#2{#1}%
+}
+
% push register contents on a stack: #1 is a register, #2 is a stack
\def\yypushr#1\on#2{%
@@ -176,6 +181,34 @@
\expandafter\yyreadvst@ck\expandafter{\number\xincrement{#2}}{#1}{#3}%
}
+% macros to read the stack from top to bottom (i.e.~in `reverse' order)
+\def\yyreadustack#1{% we do not compute anything unless the postprocessor
+ % detected an implicit rule
+ \ifnum\number\yycomputeilength{\number\yyn}>\z@
+ \yybreak{\expandafter\yyr@@@ust@@k\expandafter{\number\toptoks}{1}{#1}}%
+ \else
+ \yybreak{}%
+ \yycontinue
+}
+
+\def\yyr@@@ust@@k#1#2#3{%
+ \yyr@@dust@@k{#2}{#1}{#3}%
+}
+
+\def\yyreadust@ck#1#2#3{%
+ \expandafter\toksdef\csname$$$'#2\endcsname=#1\relax %
+ \expandafter\yypop\expandafter#3\expandafter\into\csname$$$'#2\endcsname%$
+ \ifnum\number\yycomputeilength{\number\yyn}>#2 %
+ \yybreak{\expandafter\yyr@@dust@@k\expandafter{\number\xincrement{#2}}{#1}{#3}}%
+ \else
+ \yybreak\relax
+ \yycontinue
+}
+
+\def\yyr@@dust@@k#1#2#3{%
+ \expandafter\yyreadust@ck\expandafter{\number\xincrement{#2}}{#1}{#3}%
+}
+
% end of replacement macros
\def\yypeekvstack#1\upto#2{% assume that #2 > 0
@@ -183,6 +216,11 @@
\movestackpointer#1\by#2\relax
}
+\def\yypeekustack#1{%
+ \yyreadustack#1%
+ \movestackpointer#1\by\number\yycomputeilength{\number\yyn}\relax
+}
+
% macros for reading the state stack (needed if using bison version 3.0 and above)
\def\yyreadsstack#1\upto#2\withprefix#3{% assume that #2 > 0
@@ -238,7 +276,7 @@
\def\yn#1#{%
\ifnum#1<\@ne
- \yybreak{\putyyval}%
+ \yybreak{\yyvalx}%
\else
\yybreak{\p@tyyassignment{#1}}%
\yycontinue
@@ -259,7 +297,7 @@
}%
}
-% \bb macro implementation
+% new \bb macro implementation
\def\p@twwassignment#1{%
\expandafter\advance\csname yyvsa<count>\endcsname-#1\relax
@@ -280,8 +318,6 @@
#2\yystringempty{#3}{#1}{#3{#1}}%
}
-\def\putyyval#1{\edef\next{\yyval{#1}}\next}
-
% dysplaying stack contents (\yyparse specific)
\def\showstack#1{%
@@ -338,49 +374,3 @@
\def\appendtoyytname{\appendtoyy@generic{#1}}%
\def\appendtoyytnamelast{\appendtoyy@genericlast{#1}}%
}
-
-% list macros
-
-\def\listx#1{% #1 is the list name
- \expandafter\ifx\csname #1[\the\csname#1<count>\endcsname]\endcsname\relax
- \csname#1<count>\endcsname\z@
- \yybreak\relax
- \else
- \yybreak{\csname #1[\the\csname#1<count>\endcsname]\endcsname
- \expandafter\advance\csname#1<count>\endcsname\@ne
- \listx{#1}}%
- \yycontinue
-}
-
-\def\newlist#1{%
- \toksa{\csname newcount\endcsname}%
- \expandafter\the\expandafter\toksa\csname#1<count>\endcsname
-}
-
-\def\initlistx#1{%
- \csname#1<count>\endcsname\z@
- \expandafter\let\csname #10\endcsname\relax
-}
-
-\def\resetlistx#1{%
- \csname#1<count>\endcsname\z@
-}
-
-\def\listxlastindex#1{%
- \the\csname#1<count>\endcsname
-}
-
-\def\addtolist#1#2{%
- \expandafter\def\csname#1[\the\csname#1<count>\endcsname]\endcsname{#2}%
- \expandafter\advance\csname#1<count>\endcsname\@ne
-}
-
-\def\addxtolist#1#2{%
- \expandafter\edef\csname#1[\the\csname#1<count>\endcsname]\endcsname{#2}%
- \expandafter\advance\csname#1<count>\endcsname\@ne
-}
-
-\def\finishlist#1{%
- \expandafter\advance\csname#1<count>\endcsname\@ne
- \expandafter\let\csname#1[\the\csname#1<count>\endcsname]\endcsname\relax
-}
diff --git a/support/splint/tex/yyinit.sty b/support/splint/tex/yyinit.sty
index 5091c05007..5fdd0ee9a5 100644
--- a/support/splint/tex/yyinit.sty
+++ b/support/splint/tex/yyinit.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -143,30 +143,67 @@
\def\flexparserdatainit{%
\table{}%
+ \let\secttwoprefix\empty
}
-% output parsed tables
+% output parsed tables to a file
-\long\def\displayoutputcode#1#2#3{% #1 is the output code (will be expanded by \write)
+\long\def\saveoutputcode#1#2#3{% #1 is the output code (will be expanded by \write)
% #2 is the output stream
% #3 is the preamble (will be expanded by \write)
- \immediate\write#2{#3#1}%
+ \newlinechar=`^^J%
+ \immediate\write#2{%
+ \harmlesscomment \parsernamespace::parsed table #3:^^J#1^^J^^J%
+ \harmlesscomment \parsernamespace::stashed stream:^^J\yystash^^J^^J% TODO: this just displays the name for now;
+ \harmlesscomment \parsernamespace::format stream:^^J\yyformat^^J^^J% TODO: this just displays the name for now;
+ }%
+}
+
+% display parsed tables and streams
+
+\def\displayparsedoutput#1{%
+ \ifchecktable
+ \ferrmessage{parsed table: \the#1^^J^^J%
+ stashed stream: \yystash^^J^^J% TODO: this just displays the name for now;
+ format stream: \yyformat}% TODO: this just displays the name for now;
+ \fi
+}
+
+% display raw input
+
+\def\displayrawtable{%
+ \ifsaveparseoutput
+ {\newlinechar=`^^J\immediate\write\exampletable{^^J\harmlesscomment
+ table before parsing:^^J\the\Binputtoks}}%
+ \fi
+ \ifchecktable
+ \ferrmessage{table before parsing: \the\Binputtoks}%
+ \fi
}
-\def\displayflextable#1{{%
+\def\displayorsavefulloutput#1#2{%
+ \ifchecktable
+ \ferrmessage{table after processing: \the#1}%
+ \fi
+ \ifsaveparseoutput
+ {\newlinechar=`^^J\immediate\write#2{^^J\harmlesscomment
+ processed table:^^J\the#1}}%
+ \fi
+}
+
+% the macros below make sure that (almost) none of the command sequences produced by the parser are
+% expandable; this makes debugging easier
+
+\def\saveflextable#1{{%
\hidecslist\cwebstreamchars
\restorecslist{flexparser-debug}\yyflunion
- \newlinechar=`^^J%
- \expandafter\displayoutputcode\expandafter{\the\table}\exampletable
- {^^J\harmlesscomment \parsernamespace::parsed table #1:^^J}%
+ \expandafter\saveoutputcode\expandafter{\the\table}\exampletable{#1}%
}}
-\def\displaybisontable#1{{%
+\def\savebisontable#1{{%
\hidecslist\cwebstreamchars
\restorecslist{parser-debug}\yyunion
- \newlinechar=`^^J%
- \expandafter\displayoutputcode\expandafter{\the\table}\exampletable
- {^^J\harmlesscomment \parsernamespace::parsed table #1:^^J}%
+ \expandafter\saveoutputcode\expandafter{\the\table}\exampletable{#1}%
}}
% stage two parsing macros
@@ -229,7 +266,9 @@
\else
\yybreak{%
\ifparseverbose\ferrmessage{#1 parsing successful.}\fi
- \ifsaveparseoutput\displayparsedtable{#1}\fi
+ \ifsaveparseoutput\saveparsedtable{#1}\fi
+ \finishlist\yystash
+ \finishlist\yyformat
\typesetparsedtables
}%
\yycontinue
@@ -242,39 +281,29 @@
}
\def\postparsebisongrammar{%
- \let\displayparsedtable\displaybisontable
+ \let\saveparsedtable\savebisontable
\let\typesetparsedtables\typesetalltables
\postparsegeneric{(grammar)}%
}
\def\postparsebisonprologue{%
- \let\displayparsedtable\displaybisontable
+ \let\saveparsedtable\savebisontable
\let\typesetparsedtables\typesetalltables
\postparsegeneric{(prologue)}%
}
\def\postparseflexone{%
- \let\displayparsedtable\displayflextable
+ \let\saveparsedtable\saveflextable
\let\typesetparsedtables\typesetfsonetables
\postparsegeneric{(section 1)}%
}
\def\postparseflextwo{%
- \let\displayparsedtable\displayflextable
+ \let\saveparsedtable\saveflextable
\let\typesetparsedtables\typesetfstwotables
\postparsegeneric{(section 2)}%
}
-\def\displayrawtable{%
- \ifsaveparseoutput
- {\newlinechar=`^^J\immediate\write\exampletable{^^J\harmlesscomment
- table before parsing:^^J\the\Binputtoks}}%
- \fi
- \ifchecktable
- \ferrmessage{table before parsing: \the\Binputtoks}%
- \fi
-}
-
\fillpstack{}{%
\preparsebisongrammar
\preparsebisonprologue
@@ -286,7 +315,8 @@
\fillpstack{b}{%
\preparsebisongrammar
\preparsebisonprologue
- {\preparsefallback{**}}%
+ \preparseflexone
+ {\preparsefallback{..}}%
\relax % this \relax is necessary so that the braces above
% are not stripped by \poppstack
}
@@ -312,8 +342,6 @@
% stage 3.5 macros: typesetting
-\newtoks\symstream
-
\def\tlskip{\z@}
\def\tfskip{\parindent}
@@ -321,178 +349,77 @@
\def\typesetalltables{%
\begingroup
- \ifsaveparseoutput
- {\newlinechar=`^^J\immediate\write\exampletable{^^J\harmlesscomment
- stashed stream:^^J\the\yystash^^J^^J\harmlesscomment
- format stream: ^^J\the\yyformat}}%
- \fi
- \ifchecktable
- \ferrmessage{parsed table: \the\table^^J^^J%
- stashed stream: \the\yystash^^J^^J%
- format stream: \the\yyformat}%
- \fi
- \extractprodtableinfo
- \symstream\table
- \table{}%
+ \displayparsedoutput\table
+ \extractprodtableinfo
\setprodtable
- \the\symstream\relax
- \postoks{}\pushothertables
- \ifchecktable
- \ferrmessage{table after processing: \the\table}%
- \fi
- \ifsaveparseoutput
- {\newlinechar=`^^J\immediate\write\exampletable{^^J\harmlesscomment
- processed table:^^J\the\table}}%
- \fi
+ \executeast{\postoks{}\pushothertables}%
\parindent1em
- \checkforpropertable\table
+ \checkforpropertable{\executelist\aststream}%
\tabskip\tfskip
\ruletableset
- \ifchecktrailingstash
- \ferrmessage{remaining stash: \the\yystash}%
- \fi
- \unwrapstash\yystash
- \toksa\expandafter{\the\yystash}%
- \cleanstash\stripstash\checkforccode
- \ifchecktrailingstash
- \ferrmessage{stash after cleaning: \the\toksa}%
- \fi
- \ifnum\wd0>\z@
- %\ifchecktable
- % \showboxdepth=1000
- % \showboxbreadth=1000
- % \showbox0
- %\fi
- % currently testing for nontrivial leftover stash involves packaging the stash material
- % into a \vbox; as a result, the stash containing ${}{}$\hbox{} will have a nonzero length
- % which is why the test below is necessary
- \ifnum\ht0>\z@
- \indent\boxstash
- \fi
- \fi
- \expandafter % export the value of the alignment
+ {\edef\next{\write\auxstream{\nx\nx\nx\lodimens{\the\gaglue}{}{}{}\harmlesscomment}}\next}%
+ \finishastoutput % debugging and stash cleanup
+ \expandafter % export the value of the alignment glue
\endgroup
\expandafter\gaglue\the\gaglue\relax
}
\def\typesetfstwotables{%
\begingroup
- \ifchecktable
- \ifsaveparseoutput
- {\newlinechar=`^^J\immediate\write\exampletable{^^J\harmlesscomment
- stashed stream:^^J\the\yystash^^J^^J\harmlesscomment
- format stream: ^^J\the\yyformat}}%
- \else
- \errmessage{parsed table: \the\table^^J^^J%
- stashed stream: \the\yystash^^J^^J%
- format stream: \the\yyformat}%
- \fi
- \fi
- \extractregextableinfo
- \symstream\table
- \table{}%
- \setregextable
- \the\symstream\relax
- \regextableset
- \ifchecktable
- \ifsaveparseoutput
- \else
- \errmessage{table after processing: \the\table}%
- \fi
- \fi
- \ifsaveparseoutput
- {\newlinechar=`^^J\immediate\write\exampletable{^^J\harmlesscomment
- processed table:^^J\the\table}}%
- \fi
- \ifchecktable
- \ifchecktrim
- \ferrmessage{remaining stash: \the\yystash}%
- \fi
- \fi
- \unwrapstash\yystash
- \toksa\expandafter{\the\yystash}%
- \cleanstash\stripstash\checkforccode
- \ifchecktable
- \ifchecktrim
- \ferrmessage{stash after cleaning: \the\toksa}%
- \fi
- \fi
- \ifnum\wd0>\z@
- %\ifchecktable
- % \showboxdepth=1000
- % \showboxbreadth=1000
- % \showbox0
- %\fi
- % currently testing for nontrivial leftover stash involves packaging the stash material
- % into a \vbox; as a result, the stash containing ${}{}$\hbox{} will have a nonzero length
- % which is why the test below is necessary
- \ifnum\ht0>\z@
- \indent\boxstash
- \fi
- \fi
+ \displayparsedoutput\table
+ \extractregextableinfo % preprocess the AST for section 2
+ \setregextable % activate AST control sequences for section 2
+ \executeast{}% execute AST (the output will be collected in the \aststream list)
+ \regextableset % typeset the contents
+ \finishastoutput % debugging and stash cleanup
\endgroup
}
\def\typesetfsonetables{%
\begingroup
- \ifchecktable
- \ifsaveparseoutput
- {\newlinechar=`^^J\immediate\write\exampletable{^^J\harmlesscomment
- stashed stream:^^J\the\yystash^^J^^J\harmlesscomment
- format stream: ^^J\the\yyformat}}%
- \else
- \errmessage{parsed table: \the\table^^J^^J%
- stashed stream: \the\yystash^^J^^J%
- format stream: \the\yyformat}%
- \fi
- \fi
-% \extractregextableinfo
- \symstream\table
- \table{}%
+ \displayparsedoutput\table
+ \extractregextableinfo
\setregexdeftable
- \the\symstream\relax
+ \executeast{}% execute AST (the output will be collected in the \aststream list)
\regexdeftableset
- \ifchecktable
- \ifsaveparseoutput
- \else
- \errmessage{table after processing: \the\table}%
- \fi
- \fi
- \ifsaveparseoutput
- {\newlinechar=`^^J\immediate\write\exampletable{^^J\harmlesscomment
- processed table:^^J\the\table}}%
- \fi
- \ifchecktable
- \ifchecktrim
- \ferrmessage{remaining stash: \the\yystash}%
- \fi
- \fi
- \unwrapstash\yystash
- \toksa\expandafter{\the\yystash}%
- \cleanstash\stripstash\checkforccode
- \ifchecktable
- \ifchecktrim
- \ferrmessage{stash after cleaning: \the\toksa}%
- \fi
- \fi
- \ifnum\wd0>\z@
- %\ifchecktable
- % \showboxdepth=1000
- % \showboxbreadth=1000
- % \showbox0
- %\fi
- % currently testing for nontrivial leftover stash involves packaging the stash material
- % into a \vbox; as a result, the stash containing ${}{}$\hbox{} will have a nonzero length
- % which is why the test below is necessary
- \ifnum\ht0>\z@
- \indent\boxstash
- \fi
- \fi
+ \finishastoutput % debugging and stash cleanup
\endgroup
}
-\let\extractprodtableinfo\empty % we do not preprocess the productions table
+\def\executeast#1{% #1 is an optional postprocessing action
+ % execute AST (the output will be collected in the \aststream list)
+ \initlist\aststream
+ \the\table\relax
+ #1%
+ \finishlist\aststream
+}
+\def\finishastoutput{%
+ % possibly output debugging information,
+ % clean up and typeset any remaining stash
+ \displayorsavefulloutput\table\exampletable
+ \ifchecktrailingstash
+ \ferrmessage{remaining stash: \yystash}% TODO: this just displays the name for now;
+ \fi
+ \consumefulllist\yystash\to\toksa
+ \cleanstash\stripstash\checkforccode
+ \ifchecktrailingstash
+ \ferrmessage{stash after cleaning: \the\toksa}%
+ \fi
+ \ifnum\wd0>\z@
+ %\ifchecktable
+ % \showboxdepth=1000 \showboxbreadth=1000 \showbox0
+ %\fi
+ % currently testing for nontrivial leftover stash involves packaging the stash material
+ % into a \vbox; as a result, the stash containing ${}{}$\hbox{} will have a nonzero length
+ % which is why the test below is necessary
+ \ifnum\ht0>\z@
+ \indent\boxstash
+ \fi
+ \fi
+}
+
+\let\extractprodtableinfo\extractprodrefs % record the rules to be used later as a reference
\let\extractregextableinfo\empty % we do not preprocess the regex table
% setting the rule table: cross-section alignment and other effects are applied here;
@@ -506,14 +433,15 @@
\vskip-\baselineskip
\ifx\gatoks\relax
\else
- \table\expandafter{\the\table\gatoks}%
+ \expandafter\appendtolist\expandafter\aststream\expandafter{\gatoks}%
+ \finishlist\aststream
\fi
\setbox0\vbox\expandafter{\expandafter
\null\expandafter\prevdepth\the\prevdepth
\halign \ifpropertable to \hsize \fi
{\hbox to 2em{##\/$\,${\rm:}\hss}\hfil\tabskip\z@&\setallterms{##}&##\hfil\tabskip0pt plus1fil&%
\toksa{}##\makestashbox\hfil\tabskip\tlskip\cr
- \the\table
+ \executelist\aststream
}
\expandafter
}\expandafter
@@ -534,7 +462,7 @@
\null\expandafter\prevdepth\the\prevdepth
\halign to\hsize
{##\hfil\tabskip0 pt plus1fil\ &\relax\tabskip\tlskip\toksa{}##\makestashbox\hfil\cr
- \the\table
+ \executelist\aststream
}%
\expandafter
}\expandafter
@@ -551,7 +479,7 @@
\null\expandafter\prevdepth\the\prevdepth
\halign to\hsize
{\hskip\parindent##\hfil\tabskip0 pt plus1fil\ &\relax\tabskip\tlskip\tt##\hfil\cr
- \the\table
+ \executelist\aststream
}%
\expandafter
}\expandafter
@@ -559,6 +487,44 @@
\prevdepth\the\prevdepth\relax
}
+% recording alignment layout: the gaglue, etc.
+
+\def\yyuniontag{\auxunionctl}
+\defp\tablorunionctl{}% sequence to activate/deactivate/take other action for
+ % tablor set of macros
+
+\defc\tablorunionctl{%
+ \restorecslist{aux:global:tablors}\tablorunion
+}
+\savecs{aux:global:activate}\tablorunionctl
+
+\defc\tablorunionctl{%
+ \restorecslist{aux:global:tablors:neutral}\tablorunion
+}
+\savecs{aux:global:deactivate}\tablorunionctl
+
+\defc\tablorunionctl{% this command should not make any page material contributions
+ \message{tablors...}%
+}
+\savecs{aux:global:preend}\tablorunionctl
+
+\defc\tablorunionctl{% writing a header, etc.
+ \message{tablors...}%
+ \toksa\expandafter{\tablorunion}%
+ \immediate\write\auxstream{\harmlesscomment\the\toksa}%
+}
+\savecs{aux:global:prestart}\tablorunionctl
+
+\yyuniondeclare\tablorunion{aux:global:tablors}
+
+\defp\lodimens#1#2#3#4{}
+
+\toyyunion{aux:global:tablors:neutral}
+
+\defc\lodimens#1#2#3#4{}% define this to set the layout for tables on a given page
+
+\toyyunion{aux:global:tablors}
+
% quick and dirty global alignment: the size of the last box (and those in between)
% can be chosen automatically after one pass and read in for the final pass;
% in the future this will be the default implementation; for now, the inelegant
@@ -586,147 +552,6 @@
\hidecs{\1\4\5\6\8}%
}
-\newif\ifdisplaytokenraw
-
-\def\toksdefline#1#2#3#4#5{% #1 is the parsed version of the internal bison name
- % #2 is the index entry
- % #3 is the type
- % #4 is the explicit value
- % #5 is the parsed version of the string value
- \ifnum\tempca=\z@
- \tokdectoks\expandafter{\the\tokdectoks&{#2}#1\hfil\cr}%
- \tempca\tempcb
- \else
- \ifnum\tempcb=\tempca
- \tokdectoks\expandafter{\the\tokdectoks{#2}#1\hfil}%
- \else
- \tokdectoks\expandafter{\the\tokdectoks&{#2}#1\hfil}%
- \fi
- \advance\tempca\m@ne
- \fi
-}
-
-\def\attachtokentable{% typesetting the token declarations as part of the grammar
- \tempcb3 \tempca\tempcb
- \expandafter\tokdectoks\expandafter{\expandafter}\the\tokdectoks
- \ifnum\tempca=\tempcb
- \else
- \bloop
- \tokdectoks\expandafter{\the\tokdectoks&\omit\hfil}%
- \ifnum\tempca=\z@
- \else
- \advance\tempca\m@ne
- \repeat
- \tokdectoks\expandafter{\the\tokdectoks\cr}%
- \fi
- \toksa{\tt\strut##\hfil\tabskip=0pt plus 1fil}%
- \bloop
- \toksa\expandafter{\the\toksa&\tt\strut##\hfil}%
- \ifnum\tempcb=\tw@
- \else
- \advance\tempcb\m@ne
- \repeat
- \toksa\expandafter{\the\toksa&\tt\strut##\hfil\tabskip\z@\cr}%
- \concat\toksa\tokdectoks
- \tokdectoks\toksa
- \edef\next{\table{\the\table\noalign{%
- \tabskip\parindent
- %\nx\displaytokenrawtrue % this controls how tokens are displayed
- % in the declarations: if true, the macro names will be shown
- \halign to\hsize{\the\tokdectoks}%
- }%
- }}\next
- \tokdectoks{}%
-}
-
-% typesetting token lists, precedence declaratins, etc
-% these belong to yyunion.sty but they use `global' settings that are
-% too specific to put there
-
-\def\attachtypestable{% typesetting the type declarations as part of the grammar
- \toksa{}\the\typestable
- \edef\next{\table{\the\table\noalign{%
- {%
- \the\toksa
- }%
- }%
- }}\next\typestable{}%
-}
-
-\long\def\onetype#1#2{%
- \toksb{{%
- \hbadness\@M
- \rightskip=\z@
- \tempda\hsize \advance\tempda-1in
- \indent{$\langle$\tt union$\rangle.#1$:}\ \hfill\nobreak\hfill\nobreak\null\penalty1\relax\null\nobreak\hfill
- \hbox to\tempda{$\vtop{\noindent\hsize\tempda\raggedright #2\strut}$}\par
- }}%
- \concat\toksa\toksb
-}
-
-\long\def\flexsstatelist#1{%
- \toksb{{%
- \hbadness\@M
- \rightskip=\z@
- \tempda\hsize \advance\tempda-1in
- \indent{$\langle$\tt states-s$\rangle_{\rm f}$:}\ \hfill\nobreak\hfill\nobreak\null\penalty1\relax\null\nobreak\hfill
- \hbox to\tempda{$\vtop{\noindent\hsize\tempda\raggedright #1\strut}$}\par
- }}%
- \concat\toksa\toksb
-}
-
-\long\def\flexxstatelist#1{%
- \toksb{{%
- \hbadness\@M
- \rightskip=\z@
- \tempda\hsize \advance\tempda-1in
- \indent{$\langle$\tt states-x$\rangle_{\rm f}$:}\ \hfill\nobreak\hfill\nobreak\null\penalty1\relax\null\nobreak\hfill
- \hbox to\tempda{$\vtop{\noindent\hsize\tempda\raggedright #1\strut}$}\par
- }}%
- \concat\toksa\toksb
-}
-
-\def\attachprectable{% typesetting the precedence declarations as part of the grammar
- \toksa{}\the\prectable
- \edef\next{\table{\the\table\noalign{%
- {%
- \the\toksa
- }%
- }%
- }}\next\prectable{}%
-}
-
-\long\def\oneprec#1#2#3{%
- \toksc{%
- \hbadness\@M
- \rightskip=\z@
- \tempda\hsize \advance\tempda-1in
- \indent
- }%
- \toksd{%
- \ \hfill\nobreak\hfill\nobreak\null\penalty1\relax\null\nobreak\hfill
- \hbox to\tempda{$\vtop{\noindent\hsize\tempda\raggedright #3\strut}$}\par
- }
- \def\next{#2}%
- \ifx\next\empty
- \toksb{}%
- \else
- \toksb{${}:{}$#2}%
- \fi
- \edef\next{\toksb{{$\nx\langle$\nx\bf #1\the\toksb$\nx\rangle$}}}\next
- \appendr\toksa{{\the\toksc\the\toksb\the\toksd}}%
-}
-
-\def\attachoptionstable{% typesetting the options as part of the grammar
- \edef\next{\table{\the\table\noalign{%
- \tabskip\parindent
- \halign{####\nx\hfil\tabskip\z@&\nx\qquad\nx\it####\nx\hfil\cr
- \the\opttable
- }%
- }%
- }}\next\opttable{}%
-}
-
\newif\ifpropertable
\def\checkforpropertable#1{{% checking if there is any table material
@@ -738,7 +563,7 @@
\setbox\z@=\vbox{
\halign
{\eatone{##}&\eatone{##}.&\eatone{##}&\eatone{##}\cr
- \the#1%
+ #1%
}%
}%
\ifnum\wd\z@>\z@
@@ -867,8 +692,7 @@
\def\1{\setbox\indentbox\hbox{\box\indentbox\hbox to 3em{\hfil}}}%
\def\2{\setbox\indentbox\hbox{\box\indentbox\hbox to -3em{}}}%
\def\4{\hbox to -3em{}}%
- \def\5{}%
-% \let\6\cr
+ \let\5\ignorespaces % so that @+ does not produce a space
\def\6{%
\edef\setindentbox{%
\setbox\indentbox\hbox to\the\wd\indentbox{\noexpand\hfil}%
@@ -903,10 +727,10 @@
\ifcat\noexpand\next0%
\let\next\pr@dterm
\else
- \if\noexpand\next[%
- \let\next\pr@dterm
+ \ifcat\noexpand\next a%
+ \def\next{\hbox{$\Upsilon$}}% TODO: look for an identifier
\else
- \let\next\oldmathS
+ \let\next\oldmathS% TODO: one more category: control sequence for cases like \$\\{identifier}
\fi
\fi
\fi
@@ -921,13 +745,13 @@
\let\next\seeksym
\else
\ifnum`#1<"3A\relax
- \ifnum`#1>`0\relax
+ \ifnum`#1>"2F\relax % within ['0', '9']
\def\next{\seekno#1}%
\else
- \def\next{\hbox{$\Upsilon$}#1}% TODO: look for an identifier
+ \def\next{\oldmathS#1}%
\fi
\else
- \def\next{\hbox{$\Upsilon$}#1}% TODO: look for an identifier
+ \def\next{\oldmathS#1}%
\fi
\fi
\fi
@@ -970,7 +794,6 @@
\let\extractprodtableinfo\empty % we do not preprocess the table
\showlastactionfalse
\let\actionfiller\empty
- \let\postparsetext\postparsebproduction
\fillpstack{b}{%
\preparsebisongrammar
\preparsebisonprologue
@@ -985,18 +808,18 @@
}
\def\texcharadjust{
- ` {%
+ `{%
\yybyte{|}%
\expandafter\yycp@\expandafter`\the\yybyte\relax
\mkpurebyte
\yyreturn
- }
- _ {%
+ }%
+ _{%
\yybyte{\_}%
\expandafter\yycp@\expandafter`\the\yybyte\relax
\mkpurebyte
\yyreturn
- }
+ }%
}
\def\texcsadjust{
@@ -1016,6 +839,9 @@
}
}%
+% Note that using \setspecialcharsfrom on the switches above is unnecessary (and, indeed, an error)
+% since the characters need to be read as is, with the category codes and all
+
% production typesetting
\def\beginprod{%
@@ -1066,7 +892,6 @@
\let\acharswitch\texcharadjust
%\let\onecharswitch\texcsadjust
\let\extractprodtableinfo\empty % we do not preprocess the table
- \let\postparsetext\postparsefsection
\fillpstack{fs1}{%
\preparseflexone % TODO
\preparseflextwo
@@ -1091,19 +916,6 @@
\expandafter\gaglue\the\gaglue\relax % export the alignment width, TODO: set \gaglue in \flex
}
-
-
-% the following macros assume that \gindex or \xrefstream having been defined implies
-% that all the bookkeeping required for maintaining the custom index and local cross referencing
-% has been taken care of; this way during the bootstrapping mode, index entries or cross references
-% are not generated.
-
-\ifx\gindex\UNDEFINED
-\else
- \termindextrue
- \immediate\openout\gindex=\jobname.gdx
-\fi
-
\let\endcprod\endgroup
\let\endmprod\endgroup
\let\endprod\endgroup
diff --git a/support/splint/tex/yyinput.sty b/support/splint/tex/yyinput.sty
index 0898410c51..4ca9a8617c 100644
--- a/support/splint/tex/yyinput.sty
+++ b/support/splint/tex/yyinput.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -207,14 +207,26 @@
\yyreturn
}%
+% the single character switch `normalizes' the typesetting of underscores, as this
+% is a particularly tricky character to get right; in typewriter fonts there is a
+% `first class' underscore character so \_ may be defined as \char`\_ whereas in other fonts
+% there is no `native' underscore character so \_ may be defined as a rule of an appropriate
+% size
+\def\acharswitch{
+ \raw_\raw\_ {% the name parser will replace _ with \_ in subscripts
+ \yycp@`\_\relax
+ \yybyte{\_}%
+ \mkpurebyte
+ \yyreturn
+ }
+}
+
\def\achardefault{%
\expandafter\yycp@\expandafter`\the\yybyte\relax
\mkpurebyte
\yyreturn
}
-\def\acharswitch{}
-
% the following commands are only here for debugging purposes
% they slow down the input
@@ -222,6 +234,13 @@
\setspecialcharsfrom\multicharswitch
\setspecialcharsfrom\acharswitch
+% care should be taken with using the next command; it will only be executed
+% if the parser (rather the lexer) `sees' it as part of the input; thus if this
+% command is inserted at the end of the parsed text and, say, a bootstrap parser
+% terminates early, the command will not be executed; likewise, it may be executed
+% (more than) twice in case, for example, a parser stack is used and both (several)
+% parsers see it before the parsing is terminated.
+
\def\insertrawnext#1{% insert a command
#1\yyinput
}
@@ -230,62 +249,55 @@
\yyinput#1\stashed{#2}\vb
}
+% stash and format streams (lists)
+
\chardef\stashchar=`\ %
\chardef\formatchar=`\ %
\newcount\stashmarker
\newcount\formatmarker
+\def\yystash{[stash]}
+\def\yyformat{[format]}
+
\def\stashnextwithspace#1{%
\yybytepure{ }\yycp@\stashchar
\yybyte\expandafter{\the\yybyte{#1}}%
\advance\stashmarker\@ne
- \edef\next{\yysbyte{\noexpand\strm[\the\stashmarker]{\the\yybyte}.[\the\stashmarker]}}\next
- % the extra `.' is to avoid the stripping of braces by the parameter scanning mechanism of TeX
+ \ifnum\stashmarker<\showlistcounter\yystash\relax
+ \else
+ \appendtolist\yystash{#1}%
+ \fi
\yyreturn
}
% the mechanism for stash processing making stash invisible
\def\stashnextwithnothing#1{%
- \advance\stashmarker\@ne
\yybyte\expandafter{\the\yybyte{#1}}\concat\yysubtext\yybyte
- \appendr\yysbyte{\noexpand\strm[\the\stashmarker]{\the\yybyte}.[\the\stashmarker]}%
- \ifyyinputdebug
- \immediate\write16{stash byte: \the\yysbyte mid text: \the\yysubtext}%
- \fi
- % the extra `.' is to avoid the stripping of braces by the parameter scanning mechanism of TeX
- \yyinput
-}
-
-% while collecting the stash, the macro below packages the stash contents into a command sequence
-% to add to the \yystash stream; the stash is presented to the lexer unpackaged though; this
-% introduces a minor inefficiency while ensuring that exactly one level of packaging is present
-% (otherwise the lexer may back up and repackage already packaged stash); the inefficiency only
-% persists while the lexer scans the current token (and possibly backs up).
-
-\def\stashnextwithnothingnx#1{%
\advance\stashmarker\@ne
- \yypush{#1}\on\astarray
- \appendr\yysbyte{\noexpand\strm[\the\stashmarker]{\the\yybyte{%
- \expandafter\noexpand\romannumeral\gettopofstackcsx\astarray}}.[\the\stashmarker]}%
- \yybyte\expandafter{\the\yybyte{#1}}% do not package the input
- \concat\yysubtext\yybyte
+ \ifnum\stashmarker<\showlistcounter\yystash\relax
+ \else
+ \appendtolist\yystash{#1}%
+ \fi
\ifyyinputdebug
- \immediate\write16{stash byte: \the\yysbyte mid text: \the\yysubtext}%
+ \immediate\write16{mid text: \the\yysubtext}%
\fi
- % the extra `.' is to avoid the stripping of braces by the parameter scanning mechanism of TeX
\yyinput
}
-\let\stashnext\stashnextwithnothingnx
+% collect the stash in the stash list (stream)
+
+\let\stashnext\stashnextwithnothing
\def\formatnext#1{%
\yybytepure{ }\yycp@\formatchar
\toksa{#1}%
\advance\formatmarker\@ne
- \edef\next{\yyfbyte{\noexpand\strm[\the\formatmarker]{\the\yybyte{\the\toksa}}.[\the\formatmarker]}}\next
- % the extra `.' is to avoid the stripping of braces by the parameter scanning mechanism of TeX
+ \ifnum\formatmarker<\showlistcounter\yyformat\relax
+ \else
+ \expandafter\appendtolisti\expandafter\yyformat\expandafter{\the\yybyte{#1}}% insert the iterator sequence, as well
+ \fi
\yybyte\expandafter{\the\yybyte{#1}}%
\yyreturn
}
@@ -303,155 +315,22 @@
\yyreturn % inserting something here will effectively insert it into the input stream
}
+% the next macro is not implemented correctly (since after a backup the flushed
+% tokens may be reinserted; there needs to be a mechanism to remember that the
+% tokens are already in the stash stream
+
\def\sflushnext#1#2{% #1 is the marker
% #2 is the contents
\yybytepure{ }\yycp@\stashchar
- \edef\next{\toksc{\the\yystash\the\yystashseen}}\next
- \yyfifolastidx\toksc\in\toksc
- \toksa{#1}\toksb{#2}%
- \appendr\yysbyte{\noexpand\strm[\the\toksa]{\the\yybyte{{\nx\it flushing}: ``\the\toksb'',
- {\nx\it last index}: $[\the\toksc]$. }}.[\the\toksa]}%
- % the extra `.' is to avoid the stripping of braces by the parameter scanning mechanism of TeX
+ % `save the flushed code' goes here
\yybyte\expandafter{\the\yybyte{#1}{#2}}%
\concat\yysubtext\yybyte
\ifyyinputdebug
- \immediate\write16{stash byte: \the\yysbyte mid text: \the\yysubtext}%
+ \immediate\write16{mid text: \the\yysubtext}%
\fi
\yyreturn
}
-% the following implementation is marginally cleaner as it does not redefine \yyr@@dfifo
-% it also makes it almost transparent that \yyreadfifo does not modify any token registers
-% except for the two of its parameters
-% TODO: replace \yyr@@dfifo with \yyr@adfifo
-
-\def\yyreadfifo#1\to#2\in#3{%
-%{% to reduce the side effects to the redefinition of the input and output
- % token registers
- \def\yyr@adfifo##1\strm[#2]##2[#2]##3\end{%
- \yystringempty{##3}{#3{}}% there is no such marker in the fifo
- {%
- #3{##1\strm[#2]##2[#2]}%
- \def\yyr@@dfifo####1\strm[#2]####2[#2]\end{#1{####1}}% strip off the inserted string
- \yyr@@dfifo##3\end
-% TODO: \def\yyr@dfifo####1\strm[#2].[#2]\end{#1{####1}}% strip off the inserted string
-% \yyr@dfifo##3\end
- }%
- }%
- \expandafter\yyr@adfifo\the#1\strm[#2].[#2]\end
-%\edef\next{#1{\the#1}#3{\the#3}}\expandafter}\next
-}
-
-\def\yytrimfifo#1\to#2\in#3{% just save the initial segment of #1 in #3
- \def\yyr@adfifo##1\strm[#2]##2[#2]##3\end{%
- \yystringempty{##3}{#3{}}% there is no such marker in the fifo
- {%
- #3{##1\strm[#2]##2[#2]}%
- }%
- }%
- \expandafter\yyr@adfifo\the#1\strm[#2].[#2]\end
-}
-
-\def\yyreadfifox#1\to#2\in#3{% read the fifo to a marker in #2
- \expandafter\yyreadfifo\expandafter#1\expandafter\to\number#2\in#3%
-}
-
-\def\yyreadfifoxx#1\to#2\in#3{% read the fifo to a marker in #2
- \expandafter\yyreadfifo\expandafter#1\expandafter\to#2\in#3%
-}
-
-\def\yyreadfifot#1\to#2\in#3\with#4{% read fifo with a test:
- \def\yyr@adfifo##1\strm[#2]##2[#2]##3\end{% #4 is a \macro[##1]##2.[##3] which
- \def\yyr@@dfifo{##3}% looks at its parameters and fills up
- \ifx\yyr@@dfifo\empty % \othertoks (to be attached at the beginning of #1
- % after the initial segment has been removed)
- % and \fifotoks (to be used by another macro)
- #3{}% there is no such marker in the fifo
- \else
- \let\fifotoks#3%
- \let\othertoks#1
- \let\@@strm\strm
- \let\strm#4%
- \fifotoks{}%
- \othertoks{}%
- ##1\strm[#2]##2[#2]% run all the tests
- \let\strm\@@strm
- \def\yyr@@dfifo####1\strm[#2]####2[#2]\end{#1\expandafter{\the\othertoks####1}}%
- \yyr@@dfifo##3\end
- \fi
- }%
- \expandafter\yyr@adfifo\the#1\strm[#2].[#2]\end
-}
-
-\def\yyreadfifotx#1\to#2\in#3\with#4{% read the fifo to a marker in #2
- \expandafter\yyreadfifot\expandafter#1\expandafter\to\number#2\in#3\with{#4}%
-}
-
-% an example of a sorting macro: extract all the local formatting
-
-\def\formatsort[#1]#2.[#3]{% clobbers \toksb, \toksc
- \formatgrab#2\end
- \toksc{\strm[#1]{#2}.[#3]}%
- \let\default\formatdefaultact
- \switchon{\the\toksb}\in\formatswitch
-}
-
-\def\formatgrab#1#2\end{\toksb{#1}}
-
-\def\formatswitch{%
- \formatlocal {%
- \edef\next{\fifotoks{\the\fifotoks\the\toksc}}\next
- }
-}
-
-\def\formatdefaultact{%
- \edef\next{\othertoks{\the\othertoks\the\toksc}}\next
-}
-
-\def\yygrabfifoelem#1\at#2\in#3{%
- \def\yyr@adfifo##1\strm[#2]##2[#2]##3\end{%
- \def\yyr@@dfifo{##3}%
- \ifx\yyr@@dfifo\empty
- #3{}% there is no such marker in the fifo
- \else
- #3{\strm[#2]##2[#2]}%
- \def\yyr@@dfifo####1\strm[#2]####2[#2]\end{#1{####1}}% strip off the inserted string
- \yyr@@dfifo##1##3\end
- \fi
- }%
- \expandafter\yyr@adfifo\the#1\strm[#2].[#2]\end
-}
-
-\def\yygrabfifoelemx#1\at#2\in#3\with#4{% read the fifo to a marker in #2
- \expandafter\yygrabfifoelem\expandafter#1\expandafter\at\number#2\in#3\with{#4}%
-}
-
-\def\yypeekfifoelem#1\at#2\in#3{% just read the first element that matches the marker
- \def\yyr@adfifo##1\strm[#2]##2[#2]##3\end{%
- \def\yyr@@dfifo{##3}%
- \ifx\yyr@@dfifo\empty
- #3{}% there is no such marker in the fifo
- \else
- #3{##2}% just get the contents
- \fi
- }%
- \expandafter\yyr@adfifo\the#1\strm[#2].[#2]\end
-}
-
-\def\yypeekfifoelemx#1\at#2\in#3\with#4{% read the fifo to a marker in #2
- \expandafter\yypeekfifoelem\expandafter#1\expandafter\at\number#2\in#3\with{#4}%
-}
-
-\def\strmgetfirstidx[#1]#2.[#3]{\toksa{#1}}
-
-\def\yyfifolastidx#1\in#2{%
- \let\next\strm
- \let\strm\strmgetfirstidx
- \toksa{}\the#1%
- #2\toksa
- \let\strm\next
-}
-
\def\z@rotest{0}
\newif\ifchar
diff --git a/support/splint/tex/yymisc.sty b/support/splint/tex/yymisc.sty
index b961135b02..ad9296292d 100644
--- a/support/splint/tex/yymisc.sty
+++ b/support/splint/tex/yymisc.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -14,133 +14,6 @@
% You should have received a copy of the GNU General Public License
% along with SPLinT. If not, see <http://www.gnu.org/licenses/>.
-% `data structure access' macros: picking the n-th undelimited parameter
-% in a parameter list inside a token register
-% it is assumed that none of the arguments is \end, and that there are enough
-% parameters to pick the desired one
-
-\def\getfirst#1\to#2{%
- #2\expandafter\expandafter\expandafter{\expandafter\g@tfirst\the#1\end}%
-}
-
-\def\g@tfirst#1#2\end{#1}
-
-\def\getsecond#1\to#2{%
- #2\expandafter\expandafter\expandafter{\expandafter\g@tsecond\the#1\end}%
-}
-
-\def\g@tsecond#1#2#3\end{#2}
-
-\def\getthird#1\to#2{%
- #2\expandafter\expandafter\expandafter{\expandafter\g@tthird\the#1\end}%
-}
-
-\def\g@tthird#1#2#3#4\end{#3}
-
-\def\getfourth#1\to#2{%
- #2\expandafter\expandafter\expandafter{\expandafter\g@tfourth\the#1\end}%
-}
-
-\def\g@tfourth#1#2#3#4#5\end{#4}
-
-\def\getfifth#1\to#2{%
- #2\expandafter\expandafter\expandafter{\expandafter\g@tfifth\the#1\end}%
-}
-
-\def\g@tfifth#1#2#3#4#5#6\end{#5}
-
-\def\getsixth#1\to#2{%
- #2\expandafter\expandafter\expandafter{\expandafter\g@tsixth\the#1\end}%
-}
-
-\def\g@tsixth#1#2#3#4#5#6#7\end{#6}
-
-\def\getseventh#1\to#2{%
- #2\expandafter\expandafter\expandafter{\expandafter\g@tseventh\the#1\end}%
-}
-
-\def\g@tseventh#1#2#3#4#5#6#7#8\end{#7}
-
-\def\geteightth#1\to#2{%
- #2\expandafter\expandafter\expandafter{\expandafter\g@teightth\the#1\end}%
-}
-
-\def\g@teightth#1#2#3#4#5#6#7#8#9\end{#8}
-
-\def\getninth#1\to#2{% the `.' is necessary since \TeX's scanning mechanism will
- % strip any potential braces surrounding the last parameter
- % (assuming there are exactly nine) twice:
- % o first, expanding \g@tninth,
- % o second, expanding \g@tfirst
- #2\expandafter\expandafter\expandafter{\expandafter\g@tninth\the#1.\end}%
- #2\expandafter\expandafter\expandafter{\the#2}%
-}
-
-\def\g@tninth#1#2#3#4#5#6#7#8#9\end{\g@tfirst#9\end}
-
-\def\gettenth#1\to#2{% no need for `.' (or any other placeholder) here,
- % since the #9-th parameter to \g@ttenth is a list of
- % at least two parameters itself, thus any existing braces
- % have survived intact
- #2\expandafter\expandafter\expandafter{\expandafter\g@ttenth\the#1\end}%
- #2\expandafter\expandafter\expandafter{\the#2}%
-}
-
-\def\g@ttenth#1#2#3#4#5#6#7#8#9\end{\g@tsecond#9\end}
-
-% removing the first element of a token register if it has more than one;
-
-\def\sansfirst#1{%
- \expandafter\s@nsfirst\expandafter{\the#1}{#1}%
-}
-
-\def\s@nsfirst#1#2{%
- \expandafter\s@nsf@rst\expandafter{\eatone#1}{#2}%
-}
-
-\def\s@nsf@rst#1#2{%
- \yystringempty{#1}{}{%
- #2{#1}%
- }%
-}
-
-% a version of the macro above that expands to the original argument with the first element removed
-
-\def\sansfirstx#1{%
- \expandafter\yystringempty\expandafter{\eatone#1}{#1}{\eatone#1}%
-}
-
-% string replacement: all arguments are registers, nothing is expanded, no \next is defined
-% note that this is not a greedy replacement: this could be arranged with a more sophisticated macro
-% also note that the string being replaced cannot have any braces in it
-
-\newif\ifyytracereplacements
-\newif\ifyyreplaced
-
-\yytracereplacementstrue
-
-\def\yyreplacestring#1\in#2\with#3{%
- \expandafter\def\expandafter\r@placestring\expandafter##\expandafter1\the#1##2\end{%
- \def\r@placestring{##2}% is this the string at the very end?
- \ifx\r@placestring\empty % then it is the one we inserted,
- % report
- \yyreplacedfalse
- \ifyytracereplacements
- \errmessage{string <\the#1> not present in \the#2}% do not change the register if the string is not there
- \fi
- \else % remove the extra copy of #1\end at the end
- \yyreplacedtrue
- \expandafter#2\expandafter\expandafter\expandafter
- {\expandafter\r@plac@string\expandafter{\the#3}{##1}##2\end}%
- \fi}% end of \r@placestring definition
- \expandafter\def\expandafter\r@plac@string
- \expandafter##\expandafter1%
- \expandafter##\expandafter2%
- \expandafter##\expandafter3%
- \the#1\end{##2##1##3}%
- \expandafter\expandafter\expandafter\r@placestring\expandafter\the\expandafter#2\the#1\end
-}
-
% creating a sequence containing all pairs from the two given sequences;
% the (long) string produced by the \diagprod macro
% lists all the elements so that each ordered pair ab where a and b are
@@ -287,9 +160,9 @@
}
% namespace management for macros
-% note that if one of the sequences were made \let\name. the macros would break;
+% note that if one of the sequences, say \name, were made \let\name. the macros would break;
% this can be fixed by using a more sophisticated comparison but was decided against
-% in the interest of efficiency; the old version (that used a control sequence
+% in the interests of efficiency; the old version (that used a control sequence
% as a `stop marker') was more prone to this bug.
% the next sequence is not merely a convenient abbreviation; it is useful if one
@@ -480,6 +353,10 @@
}
% dynamic typing macros
+%
+% (1) define a macro prototype, this also defines a few other macros to be used in
+% special circumstances, such as for error checking (strict), and to use where
+% expansion must be suppressed (such as diagnostic output)
\def\defp#1#2#{% flexible dynamic type checking
\toksa\expandafter\expandafter\expandafter{\yyuniontag#1}%
@@ -494,38 +371,53 @@
\def#1#2%
}
-% define the macro with checking of the prototype
+% (2) define the macro (#1) with an automatic prototype (if the parameter list is empty) or
+% with prototype checking; the prototype should have been defined earlier with \.{\\defp}
-\def\defu#1#2#{%
- \restorecs\parserprototypesnamespace#1%
+\def\defc#1#2#{%
+ \restorecs\parserprototypesnamespace#1%
\toksa{#2}%
\edef\next{\the\toksa}%
- \ifx#1\next
- \yybreak{\def#1#2}%
+ \ifx\next\empty
+ \yybreak{\expandafter\def\expandafter#1#1}%
\else
- \toksb\expandafter{#1}%
- \yybreak{%
- {\newlinechar=`^^J%
- \errhelp{the prototype of #1is from <parser-strict:headers>^^J%
- you might want to look for a \defp#1line... somewhere}%
- \errmessage{macro definition of \noexpand#1
- does not match its prototype:^^J
- \the\toksa\space (should be \the\toksb)}%
+ \ifx\next#1%
+ \yybreak@{\expandafter\def\expandafter#1#1}%
+ \else
+ \yybreak@{%
+ \toksb\expandafter{#1}%
+ {%
+ \newlinechar=`^^J%
+ \edef\next{%
+ \errhelp{the prototype of \string#1 is from <\parserprototypesnamespace>^^J%
+ you might want to look for a \expandafter\string\expandafter\defp\string#1... line somewhere}%
+ }\next
+ \errmessage{macro definition of \string#1 does not match its prototype:^^J
+ \the\toksa\space (should be \the\toksb)}%
+ }%
}%
- }%
+ \fi
\yycontinue
}
-% define the macro with an automatic prototype
-
-\def\defc#1{%
- \restorecs\parserprototypesnamespace#1%
- \expandafter\def\expandafter#1#1%
-}
+% (3) once a set of macros have been defined, all current definitions are added to the
+% \.{\\yyunion} list in a namespace of your choosing by the \.{\\toyyunion} command
\def\t@yyunion#1#2{\def\currentyyunionnamespace{#2}\savecslist{#2}#1}
\def\toyyunion#1{\expandafter\t@yyunion\yyuniontag{#1}}
+% this command sequence provides a standard set of parameters for the scheme above
+% to work; note that these settings will stay unchanged till the next command
+
+\def\yyuniondeclare#1#2{% #1 is the command sequence that holds the union
+ % #2 is the root of the namespace
+ \def#1{\currentyyunionnamespace}% subset of the global union that deals with footnotes
+ \def\yyuniontag{#1}%
+ \def\parserstrictnamespace{#2:strict}%
+ \def\parserprototypesnamespace{#2:headers}%
+ \def\parserdebugnamespace{#2:debug}%
+}
+
{\catcode`\ =13 \aftergroup\def\aftergroup\activespace\aftergroup{\aftergroup \aftergroup}}% active space
{\catcode`\% =12 \aftergroup\def\aftergroup\harmlesscomment\aftergroup{\aftergroup%\aftergroup}}% not really a comment
{\catcode`\{ =12 \catcode`\[=1 \aftergroup\def\aftergroup\lbchar\aftergroup[\aftergroup{\aftergroup}}% not really a brace
@@ -662,6 +554,8 @@
\edef\next{\let\the\toksb\the\toksa}\next
}%
+\def\tokenpp#1{} % ignore \prodstyle{\%prec}-like declarations
+
\def\numberstochars#1{%
\ifx\end#1%
\yybreak{}%
@@ -690,6 +584,51 @@
\yycontinue
}
+% packing \write lines to avoid unnecessary expansions; it is \outer
+% because it would be pretty useless inside a macro since all the category
+% codes have already been set
+
+\outer\def\packliteral{%
+ \begingroup
+ \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`\^^M=\other
+ \p@ckliteral
+}
+
+{\catcode`\%=\other\gdef\p@ckliteral#1%{\toksa{#1}\expandafter\endgroup\expandafter\p@ckl@teral\expandafter{\the\toksa}}}
+
+\def\p@ckl@teral#1#2{#2{#1}}
+
+% example of use: \packliteral {\crazy\sequence }% \toksa % this will save ` \crazy...' as cat 12 code characters in \toksa
+
+% a (relatively) safe way to turn a command sequence into its name (sans the escape character) made up of nonletters
+
+\def\csstring{%
+ \ifnum\escapechar>-1
+ \yybreak{\cs@tring}%
+ \else
+ \yybreak{}%
+ \yycontinue
+}
+
+\def\cs@tring{%
+ \ifnum\escapechar>255
+ \yybreak{}%
+ \else
+ \yybreak{\expandafter\eatone\string}%
+ \yycontinue
+}
% other parser and lexer variables
@@ -778,7 +717,6 @@
% \yyval and \yylval will be token registers
\settokreg{yyval}%
\settokreg{yylval}%
- \setnulstack{astarray}% an array of AST nodes
\setnulstack{yyssa}%
\setnulstack{yyvsa}%
}
@@ -796,14 +734,6 @@
\settokreg{yytextseenpure}% % as \yytext et al except they collect characters
\settokreg{yybytepure}% % with category code 11 (letter) and the same character code
%
- \settokreg{yyformat}% % the registers that serve the same role
- \settokreg{yyformatseen}% % as \yytext et al except they collect format
- \settokreg{yyfbyte}% % commands
- %
- \settokreg{yystash}% % the registers that serve the same role
- \settokreg{yystashseen}% % as \yytext et al except they collect stashed
- \settokreg{yysbyte}% % tokens
- %
\setcntreg{yycurrentstate}%
\setcntreg{yycurrentstatelocal}% a state variable used in eob macros
\setcntreg{yyc}%
@@ -841,6 +771,43 @@
% take advantage of the grouping mechanism provided by \TeX; note that the grouping approach seems
% to be the only viable solution if the stack mechanism is `optimized'
+% optimization macros: currently, the level of optimization has to be consistent throughout the
+% document, i.e. \optimize macros have to be called on the same arrays after loading.
+% the reason is the yyfaststack.sty file that modifies the \newtable macro once for all the tables
+
+\def\optimize#1{%
+ \setoptopt{#1}%
+ \tempca\z@
+ \bloop
+ \tempcb=\expandafter\ifcase\expandafter\tempca\the\csname#1\endcsname\else\@MM\fi\relax
+ \ifnum\tempcb<\@MM %
+ \expandafter\edef\csname #1\parsernamespace\the\tempca\endcsname{\the\tempcb}%
+ \advance\tempca\@ne
+ \repeat
+}
+
+\def\optimizetext#1{% optimizing text arrays
+ \setoptopt{#1}%
+ \tempca\z@
+ \@ptimizetext{#1}
+}
+
+\def\@ptimizetext#1{%
+ \edef\next{\expandafter\ifcase\expandafter\tempca\the\csname#1\endcsname\else\end\fi}%
+ \ifx\next\endcontainer
+ \let\next\eatone
+ \else
+ \expandafter\edef\csname #1\parsernamespace\the\tempca\endcsname{\next}%
+ \advance\tempca\@ne
+ \let\next\@ptimizetext
+ \fi
+ \next{#1}%
+}
+
+\def\setoptopt#1{%
+ \expandafter\let\csname optopt[#1]\parsernamespace\endcsname\end
+}
+
% optimization options
\def\optimizeall{%
@@ -869,7 +836,6 @@
\optimize{yycheck}%
\optimize{yyprhs}%
\optimize{yyrhs}%
- \optimize{yytoknum}%
\optimize{yystos}%
\optimizetext{yytname}%
\fi
@@ -886,7 +852,7 @@
\pinittoks{}%
\input #2 % load main parser table
\settokens % set the values of all tokens
- \yystringempty{#4}{}{%
+ \expandafter\yystringempty\expandafter{#4}{}{%
\input #4 % use token equivalence table to set the values of non-string tokens
}%
#5% (a)dditional setups
@@ -1097,11 +1063,11 @@
\expandafter\noexpand\csname (#1)\endcsname}}\next\s@tspecialcharsfrom}
\def\putother#1\in#2{%
- \tempca=\catcode`\^^A\relax
- \tempcb=\uccode`\^^A\relax
- \uccode`\^^A=#1\relax
- \uppercase{\edef\next{#2{^^A}}}\next
- \uccode`\^^A=\tempcb
+ {%
+ \uccode`\^^A=#1\relax
+ \uppercase{\edef\next{#2{^^A}}}%
+ \expandafter
+ }\next
}
% listing all the rules in a macro
@@ -1299,7 +1265,7 @@
\def\termsymname#1#2{% set the symbolic name, if it is nonempty
\def\next{#2}%
\ifx\next\empty
- \else % there is a symolic name
+ \else % there is a symbolic name
\expandafter\ifx\csname$[#2]\endcsname\relax% i$ this name unassigned?
\setnameflag{#2}\end % ... this name has been explicitly set
\setuprefs{#2}{\the\tempca}%
@@ -1438,6 +1404,110 @@
\catcode`\^^A=\tempca
+% the number below (15) is not chosen randomly but is designed to follow the conventions
+% outlined in plain.tex:
+%
+% The following counters are reserved:
+% ...
+% 10 count allocation
+% 11 dimen allocation
+% 12 skip allocation
+% 13 muskip allocation
+% 14 box allocation
+% 15 toks allocation
+% ...
+%
+% Here it is given a symbolic name for convenience. Note that this allocation is
+% needed even if only the yyfaststack.sty stack macros are used (it is used in the
+% mechanism that makes \yy0{\the\yy1\the\yy2} assignments possible).
+
+\countdef\toptoks=15 % register responsible for token allocations
+
+% value and state stack access macros: these may be replaced by the macros in yyfaststack.sty
+
+\def\yyreadvstack#1\upto#2{% assume that #2 > 0
+ \edef\sts{\noexpand\splitstack{\number#2}{\expandafter\xincrement\expandafter{\number\toptoks}}}#1\stackend#1%
+}
+
+\long\def\splitstack#1#2#3{%
+ \expandafter\def\csname$'#1\endcsname{#3}% $
+ \ifnum#2<\@cclvi % we have not reached the maximum allocated number of token registers
+ \expandafter\toksdef\csname$$'#1\endcsname=#2
+ \toks#2{#3}%
+ \fi
+ \ifnum#1=\@ne %we have read the values
+ \let\sts\scoopupstack
+ \else
+ \edef\sts{\noexpand\splitstack{\xdecrement{#1}}{\xincrement{#2}}}%
+ \fi
+}
+
+\def\yypeekvstack#1\upto#2{% assume #2 > 0
+ \edef\sts{\noexpand\peelstack{\number#2}{\expandafter\xincrement\expandafter{\number\toptoks}}}#1\relax%
+}
+
+\long\def\peelstack#1#2#3{%
+ \expandafter\def\csname$'#1\endcsname{#3}% $
+ \ifnum#2<\@cclvi % we have not reached the maximum allocated number of token registers
+ \expandafter\toksdef\csname$$'#1\endcsname=#2
+ \toks#2{#3}%
+ \fi
+ \ifnum#1=\@ne %we have read the values
+ \let\sts\eatone
+ \else
+ \edef\sts{\noexpand\peelstack{\xdecrement{#1}}{\xincrement{#2}}}%
+ \fi
+}
+
+% macros to read the stack in `natural order' (see also yyfaststack.sty)
+\def\yypeekustack#1{% we do not compute anything unless the postprocessor
+ % detected an implicit rule
+ \ifnum\number\yycomputeilength{\number\yyn}>\z@
+ \yybreak{\edef\sts{\noexpand\peelstackreverse{1}{\expandafter
+ \xincrement\expandafter{\number\toptoks}}}#1\relax}%
+ \else
+ \yybreak{}%
+ \yycontinue
+}
+
+\long\def\peelstackreverse#1#2#3{%
+ \ifnum#2<\@cclvi % we have not reached the maximum allocated number of token registers
+ \expandafter\toksdef\csname$$$'#1\endcsname=#2
+ \toks#2{#3}%
+ \fi
+ \ifnum\number\yycomputeilength{\number\yyn}>#1 %
+ \edef\sts{\noexpand\peelstack{\xincrement{#1}}{\xincrement{#2}}}%
+ \else
+ \let\sts\eatone
+ \fi
+}
+
+\def\yyimplicitlengthset#1#2{\expandafter\def\csname ilength$$[#1]\endcsname{#2}}
+
+\def\yycomputeilength#1{%
+ \expandafter\ifx\csname ilength$$[#1]\endcsname\relax
+ \yybreak{0 }%
+ \else
+ \yybreak{\csname ilength$$[#1]\endcsname\space}%
+ \yycontinue
+}
+
+% macros to support new printing routines
+
+\def\yypeeksstack#1\upto#2\withprefix#3{% assume #2 > 0
+ \edef\sts{\noexpand\peelsstack{\number#2}}%
+ \expandafter\def\expandafter\sts\expandafter{\sts{#3}{}}#1\relax%
+}
+
+\long\def\peelsstack#1#2#3#4{%
+ \ifnum#1=\@ne %we have read the values
+ #3\let\sts\eatone
+ \else
+ \edef\sts{\noexpand\peelsstack{\xdecrement{#1}}}%
+ \expandafter\def\expandafter\sts\expandafter{\sts{#2}{#2{#4}#3}}%
+ \fi
+}
+
% stack variable access
\def\ym#1){%
@@ -1516,14 +1586,14 @@
\def\p@twwassignment#1#2{%
\edef\sts{\noexpand\p@@wwassignment{\expandafter\xdecrement\expandafter{\number#1}}}%
- \expandafter\def\expandafter\sts\expandafter{\sts{#2}}%
- \yyvsa\empty
+ \expandafter\def\expandafter\sts\expandafter{\sts{#2}}% define the stack iterator
+ \yyvsa\empty % execute the stack
}
\def\p@@wwassignment#1#2#3{%
- \ifnum#1=\z@ %we have got to the element we need
+ \ifnum#1=\z@ % we have got to the element we need
\yybreak{\yystringempty{#2}{#3}{#2{#3}}\let\sts\eatone}%
- \else
+ \else % keep descending into the stack
\yybreak{\edef\sts{\noexpand\p@@wwassignment{\xdecrement{#1}}}%
\expandafter\def\expandafter\sts\expandafter{\sts{#2}}}%
\yycontinue
@@ -1545,17 +1615,35 @@
\yycontinue
}
-% a macro to access the value stack in direct order, i.e.\ from right to left
+% a macro to access the value stack in the direct order, i.e.\ from right to left
% no \yylen is necessary
\def\bb#1#{%
\ifnum#1<\@ne
- \yybreak{\putyyval}%
+ \yybreak{\yyvalx}%
\else
\yybreak{\p@twwassignment{#1}}%
\yycontinue
}
+% this macro should only be inserted by the preprocessor, it accesses
+% the stack in a `natural' order which is the opposite of how `native'
+% bison does it
+
+\def\yg#1#2#3{% #1 is the `native' bison index (e.g. for a: b c d rule,
+ % b is $1
+ % #2 is the `natural' index (so b would be $3 for the
+ % rule above
+ % #3 is the implicit `yyilen' (see yyparse.sty for more information)
+ \ifnum\yyilen=\z@ % this is probably an inline action, so yyreduce
+ % will only generate the `natural' indexed token
+ % registers
+ \yybreak{\csname $$$'#2\endcsname}%
+ \else
+ \yybreak{\ym#1)}% save one level of expansion ...
+ \yycontinue
+}
+
% symbolic name macros that prepare the environment for the use of the stack access macros above
\def\setsymcs#1#2{%
@@ -1587,3 +1675,4 @@
\def\ferrmessage#1{{\newlinechar`\^^J\immediate\write16{\parsernamespace::#1^^J}}}
+\newif\ifbootstrapmode
diff --git a/support/splint/tex/yynested.sty b/support/splint/tex/yynested.sty
index 2a47c79593..00ce5af324 100644
--- a/support/splint/tex/yynested.sty
+++ b/support/splint/tex/yynested.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
diff --git a/support/splint/tex/yyparse.sty b/support/splint/tex/yyparse.sty
index f6c6dadff8..3599692346 100644
--- a/support/splint/tex/yyparse.sty
+++ b/support/splint/tex/yyparse.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -80,15 +80,15 @@
\newif\iftracelookahead
\def\yyparsetail{% this is where the lexer returns
- \ifnum\yychar>\YYEOF\relax % if (yychar > YYEOF)
+ \ifnum\yychar>\z@\relax % if (yychar > YYEOF)
\yytoken=\fgetelemof{yytranslate}\at\yychar\relax
\iftracelookahead
\derrmessage{lookahead: \tokname, value: \the\yylval^^J}%
\fi
% yytoken = yytranslate[yychar]
\else % else
- \yychar=\YYEOF\relax % yychar = yytoken = YYEOF
- \yytoken=\YYEOF\relax
+ \yychar=\z@\relax % yychar = yytoken = YYEOF
+ \yytoken=\YYSYMBOLxYYEOF\relax
\fi% valid lookahead token
\advance\yyn by\yytoken % yyn = yypact[yystate] + yytoken
\ifnum\yyn<\z@
@@ -148,32 +148,7 @@
\def\yyreduce{%
\yylen=\fgetelemof{yyrtwo}\at\yyn\relax
- \iftracerules
- \ferrmessage{^^Jreducing (rule \the\yyn)}\printrule{\yyn}%
- \fi
- {%
- \iftracestacks
- \iftracerules
- \else
- \ferrmessage{^^J}%
- \fi
- \showstack\yyssa
- \ferrmessage{stack: \stackcs^^Jpopping \the\yylen^^J}%
- \fi
- }%
- \yyilen=\fgetelemof{yyrthree}\at\yyn\relax
- \ifnum\yyilen>\z@ % this is an inline rule
- \ifnum\yylen>\z@
- \errmessage{an inline rule with a nontrivial left hand side: rule \the\yyn}%
- \fi
- \else
- \yyilen\yylen
- \fi
- \ifnum\yyilen>\z@
- \yypeekvstack\yyvsa\upto\yyilen
- \yyval\csname $$'1\endcsname % $$ = $1
- \fi
- %
+ \preparevaluestack
\yyaction % value
%
\yypopstack\yyvsa\by\yylen
@@ -214,6 +189,36 @@
\yynewstate
}
+\def\preparevaluestack{%
+ \iftracerules
+ \ferrmessage{^^Jreducing (rule \the\yyn)}\printrule{\yyn}%
+ \fi
+ {%
+ \iftracestacks
+ \iftracerules
+ \else
+ \ferrmessage{^^J}%
+ \fi
+ \showstack\yyssa
+ \ferrmessage{stack: \stackcs^^Jpopping \the\yylen^^J}%
+ \fi
+ }%
+ \yyilen=\fgetelemof{yyrthree}\at\yyn\relax
+ \ifnum\yyilen>\z@ % this is an inline rule
+ \ifnum\yylen>\z@
+ \errmessage{an inline rule with a nontrivial left hand side: rule \the\yyn}%
+ \fi
+ \else
+ \yyilen\yylen
+ \fi
+ \ifnum\yyilen>\z@
+ \yypeekvstack\yyvsa\upto\yyilen % see yymisc.sty for the definition
+ \yyval\csname $$'1\endcsname % $$ = $1
+ \else
+ \yypeekustack\yyvsa
+ \fi
+}
+
\newif\iftraceparseresults
\def\yypaccept{%
@@ -223,6 +228,9 @@
\finishparse
}
+% most of the error processing mechanisms supplied by the `genuine' \bison\ parsers
+% have been omitted for simplicity
+
\def\yyerr{%
\iftraceparseresults
\ferrmessage{(parse) error^^J}%
@@ -332,13 +340,11 @@
\yytextseen{}%
\yytext@seen{}%
\yybyte{}%
- \yyfbyte{}\yysbyte{}%
- \yystash{}%
- \yystashseen{}%
- \yyformat{}%
- \yyformatseen{}%
+ \initlist\yystash
+ \appendtolist\yystash{}% increment the list counter
+ \initlist\yyformat
+ \appendtolist\yyformat{}% increment the list counter
\yyfutureyytext{}%
- \yyinitstack\astarray % flattened AST to (possibly) speed up the parser
\yyinitstack\yystatestack
\yyfmark=\z@
\yysmark=\z@
diff --git a/support/splint/tex/yypretty.sty b/support/splint/tex/yypretty.sty
index aeb1179b32..559deab67c 100644
--- a/support/splint/tex/yypretty.sty
+++ b/support/splint/tex/yypretty.sty
@@ -1,5 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
-% Copyright 2002-2014 Free Software Foundation, Inc.
+% Copyright 2012-2022, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -21,5 +20,5 @@
% \bison\ names (otherwise \TeX\ will complain about `... name ...
% not exceptional ...')
-\prettywordpair{emptyrhs&}{$\circ$ {\rm(empty rhs)}}%
-\prettywordpair{inline_action&}{$\diamond$ {\rm(inline action)}}%
+\prettywordpair{emptyrhs&}{\emptyrhssymbol\ {\rm(empty rhs)}}%
+\prettywordpair{inline_action&}{\inlineactionsymbol\ {\rm(inline action)}}%
diff --git a/support/splint/tex/yystype.sty b/support/splint/tex/yystype.sty
index 8e4660fb6e..904f5b57f1 100644
--- a/support/splint/tex/yystype.sty
+++ b/support/splint/tex/yystype.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -74,6 +74,9 @@
}
\def\bisonparserdatainit{%
+ \let\rhsesoneprefix\empty % prefix for the list where rhses1 will be stored
+ \let\prologuedeclarationsprefix\empty % prefix for the list where prologue_declarations will be stored
+ \let\grammarprefix\empty % prefix for the list where grammar will be stored
\table{}\typestable{}\prectable{}\opttable{}%
}
diff --git a/support/splint/tex/yytexlex.sty b/support/splint/tex/yytexlex.sty
index 7c149108d3..7f5cfd78ec 100644
--- a/support/splint/tex/yytexlex.sty
+++ b/support/splint/tex/yytexlex.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -247,7 +247,7 @@
% the most common way for a \TeX? macro to appear in in the input is being inserted by
% \CWEB\ itself; in this case \CWEB\ makes sure that the macro is expanded in math mode;
% this assumption is relied upon in the design of these macros, and violating it may
-% result in sume rather puzzling error messages, resulting from the insertion of
+% result in sume rather puzzling error messages due to the insertion of
% \ignorespaces outside of the current group; the warning macro below makes this
% dependence explicit.
@@ -260,16 +260,19 @@
\fi
}
-\def\TeXx(#1)#2;{% TODO
+\def\TeXx(#1);{% TODO
\TeXxwarn
{}$\let\oldttdot\.\relaxcweb
\let\.\dotcollect
\textoks{}%
- #1%
+ \setbox\z@=\hbox{#1\expandafter}\expandafter
+ \textoks\expandafter{\the\textoks}%
\restorecweb\let\.\oldttdot
\expandafter\T@Xx\the\textoks
{}${}\aftergroup\ignorespaces}
+\def\BZ(#1){}
+
\def\mypar{\par}
\def\TeXb(#1)#2;{% TeX material begin
@@ -286,7 +289,7 @@
\dotcollectstripquotes
${}\aftergroup\ignorespaces}
-\def\TeXa(#1)#2;{% TeX material add
+\def\TeXa(#1)#2;{% TeX material add (stitch the \TeX\ chunks together)
\TeXxwarn
{}$\let\oldttdot\.\relaxcweb
\toksa{}\let\.\dotcollectb
@@ -295,7 +298,7 @@
\dotcollectstripquotes
${}\aftergroup\ignorespaces}
-\def\TeXf(#1)#2;{% TeX material add
+\def\TeXf(#1)#2;{% TeX material add (output each chunk on a separate line)
\TeXxwarn
{}$\let\oldttdot\.\relaxcweb
\toksa{}\let\.\dotcollectb
@@ -305,7 +308,7 @@
\dotcollectstripquotes
${}\aftergroup\ignorespaces}
-\def\TeXao(#1)#2;{% TeX material output
+\def\TeXao(#1)#2;{% TeX material output (stitch the \TeX\ chunks together)
\TeXxwarn
{}$\let\oldttdot\.\relaxcweb
\toksa{}\let\.\dotcollectb
@@ -317,7 +320,7 @@
\expandafter\T@Xx\expandafter
"\the\textoks"{}${}\aftergroup\ignorespaces}
-\def\TeXfo(#1)#2;{% TeX material output
+\def\TeXfo(#1)#2;{% TeX material output (output each chunk on a separate line)
\TeXxwarn
{}$\let\oldttdot\.\relaxcweb
\toksa{}\let\.\dotcollectb
@@ -330,8 +333,26 @@
\expandafter\T@Xx\expandafter
"\the\textoks"{}${}\aftergroup\ignorespaces}
+\let\TeXxx\TeXx
+\let\TeXaxx\TeXa
+\let\TeXbxx\TeXb
+\let\TeXaoxx\TeXao
+\let\TeXfxx\TeXf
\let\TeXxi\TeXx
-\def\inlineTeXx#1{$\let\writetexidxentry\writetextxtidxentry\TeXxi(\.{"#1"});$} % for indexing macros
+\def\inlineTeXx#1{{\let\writetexidxentry\writetextxtidxentry$\TeXxi(\.{"#1"});$}} % for indexing macros
+
+\def\texref#1{% convenient shortcut
+ {%
+ \def\texnspace{texline}\def\texispace{index:tex}\inlineTeXx{#1}%
+ }%
+}
+
+\def\texrefx#1#2{% convenient shortcut
+ {%
+ \def\texnspace{#2}\def\texispace{index:tex}\inlineTeXx{#1}%
+ }%
+}
+
\def\TeXlit{\iffalse{\fi}{\setbox0\lastbox}\removewhitespace
\expandafter\.\expandafter{\iffalse}\fi} % to help with \CWEB's @t...@> cleanup
% e.g.\ |TeXao(@t\TeXlit"\hbox{\TeX\ stuff}"@>);|
@@ -367,7 +388,7 @@
\else
\bbbalance{#1}%
\fi
- \iftracetexpp\ferrmessage{TeX_ final pass: \the\texlinetoks}\fi
+ \iftracetexpp\ferrmessage{TeX_ final pass: \the\texlinetoks (idx: \the\texidxtoks)}\fi
\concat\texlinetoks\texidxtoks
\expandafter
\endgroup
@@ -426,8 +447,7 @@
\def\spacecontainer{\ }
\def\texnspace{texline}
-\def\texvspace{texvisline}
-\def\texispace{index}
+\def\texispace{index:tex}
\let\defpostfix\defTpostfix
\let\defprefix\empty
@@ -435,7 +455,7 @@
\let\settgroup\relax
\defx\space{\hbox{$\,$\char`\ $\,$}}{texline}
-\defy\space{\hbox{$\,$\char`\ $\,$}}{index}
+\defy\space{\hbox{$\,$\char`\ $\,$}}{index:tex}
\defx\hspace{% somewhat precarious definition
\hbox{\char`\ }%
@@ -450,7 +470,7 @@
}\grabbalanced
}{texline}
-\defy\hspace{\hbox{$\,$\char`\ $\,$}}{index}
+\defy\hspace{\hbox{$\,$\char`\ $\,$}}{index:tex}
\defx\advance{%
$\mathop{\hbox{\bf add}}$%
@@ -458,7 +478,7 @@
\defy\advance{%
{\bf add}%
-}{index}
+}{index:tex}
\defx\z@{%
$\,0_{\rm R}\,$%
@@ -466,7 +486,7 @@
\defy\z@{%
$0_{\rm R}$%
-}{index}
+}{index:tex}
\defx\z@{0_R}{index:visual}
@@ -476,7 +496,7 @@
\defy\@ne{%
$1_{\rm R}$%
-}{index}
+}{index:tex}
\defx\@ne{1_R}{index:visual}
@@ -486,7 +506,7 @@
\defy\tw@{%
$2_{\rm R}$%
-}{index}
+}{index:tex}
\defx\tw@{2_R}{index:visual}
@@ -496,7 +516,7 @@
\defy\m@ne{%
$-1_{\rm R}$%
-}{index}
+}{index:tex}
\defx\m@ne{-1_R}{index:visual}
@@ -506,7 +526,7 @@
\defy\tempca{%
$t_a$%
-}{index}
+}{index:tex}
\defx\tempca{t_a}{index:visual}
@@ -516,7 +536,7 @@
\defy\tempcb{%
$t_b$%
-}{index}
+}{index:tex}
\defx\tempcb{t_b}{index:visual}
@@ -536,7 +556,7 @@
\defy\toksa{%
$v_a$%
-}{index}
+}{index:tex}
\defx\toksb{%
{}$v_b${}%
@@ -554,7 +574,7 @@
\defy\toksb{%
$v_b$%
-}{index}
+}{index:tex}
\defx\toksc{%
{}$v_c${}%
@@ -572,7 +592,7 @@
\defy\toksc{%
$v_c$%
-}{index}
+}{index:tex}
\defx\toksd{%
{}$v_d${}%
@@ -590,7 +610,7 @@
\defy\toksd{%
$v_d$%
-}{index}
+}{index:tex}
\defx\tokse{%
{}$v_e${}%
@@ -608,7 +628,7 @@
\defy\tokse{%
$v_e$%
-}{index}
+}{index:tex}
\defx\toksf{%
{}$v_f${}%
@@ -624,7 +644,7 @@
\defx\toksf{vf}{index:visual}
-\defy\toksf{$v_f$}{index}
+\defy\toksf{$v_f$}{index:tex}
\defx\toksg{%
{}$v_g${}%
@@ -640,7 +660,7 @@
\defx\toksg{vg}{index:visual}
-\defy\toksg{$v_g$}{index}
+\defy\toksg{$v_g$}{index:tex}
\defx\toksh{%
{}$v_h${}%
@@ -656,7 +676,7 @@
\defx\toksh{vh}{index:visual}
-\defy\toksh{$v_h$}{index}
+\defy\toksh{$v_h$}{index:tex}
\defx\yyval{%
{}$\Upsilon${}%
@@ -672,7 +692,7 @@
\defy\yyval{%
$\Upsilon$%
-}{index}
+}{index:tex}
\defx\yyval{Y}{index:visual}
@@ -706,7 +726,7 @@
\defy\yylexreturnptr{%
{\bf return$_p$}%
-}{index}
+}{index:tex}
\defx\yylexreturnptr{return_p}{index:visual}
@@ -716,7 +736,7 @@
\defy\yylexreturnxchar{%
\hbox{\bf return$_x$}%
-}{index}
+}{index:tex}
\defx\yylexreturnxchar{return_x}{index:visual}
@@ -726,7 +746,7 @@
\defy\yylexreturnchar{%
\hbox{\bf return$_c$}%
-}{index}
+}{index:tex}
\defx\yylexreturnchar{return_c}{index:visual}
@@ -736,7 +756,7 @@
\defy\yylexnext{%
{\bf continue}%
-}{index}
+}{index:tex}
\defx\yylexnext{continue}{index:visual}
@@ -746,7 +766,7 @@
\defy\yylexreturn{%
{\bf return$_l$}%
-}{index}
+}{index:tex}
\defx\yylexreturn{return_l}{index:visual}
@@ -756,7 +776,7 @@
\defy\yylexreturnval{%
{\bf return$_v$}%
-}{index}
+}{index:tex}
\defx\yylexreturnval{return_v}{index:visual}
@@ -766,7 +786,7 @@
\defy\yylexreturnsym{%
{\bf return$_{vp}$}%
-}{index}
+}{index:tex}
\defx\yylexreturnsym{return_vp}{index:visual}
@@ -776,7 +796,7 @@
\defy\yylexreturntext{%
{\bf return$_t$}%
-}{index}
+}{index:tex}
\defx\yylexreturntext{return_t}{index:visual}
@@ -786,7 +806,7 @@
\defy\xcclreturn{%
{\bf set $\Upsilon$ {\rm and} return$^{\rm ccl}$}%
-}{index}
+}{index:tex}
\defx\xcclreturn{set U return^ccl}{index:visual}
@@ -796,7 +816,7 @@
\defy\yyflexoptreturn{%
{\bf return$^{\rm opt}$}%
-}{index}
+}{index:tex}
\defx\yyflexoptreturn{return^opt}{index:visual}
@@ -818,7 +838,7 @@
\defy\yyfatal{%
{\bf fatal}%
-}{index}
+}{index:tex}
\defx\yywarn{%
{}$\mathop{\bf warn}${}%
@@ -836,7 +856,7 @@
\defy\yywarn{%
{\bf warn}%
-}{index}
+}{index:tex}
\defx\yypdeprecated{%
{}$\mathop{\bf deprecated}${}%
@@ -854,17 +874,17 @@
\defy\yypdeprecated{%
{\bf deprecated}%
-}{index}
+}{index:tex}
\defx\table{{}$\Omega${}}{texline}
-\defy\table{$\Omega$}{index}
+\defy\table{$\Omega$}{index:tex}
\defx\table{Omega}{index:visual}
\defx\relax{\hbox{$\circ$}}{texline}
-\defy\relax{\hbox{$\circ$}}{index}
+\defy\relax{\hbox{$\circ$}}{index:tex}
\defx\the#1{%
\toksa{#1}%
@@ -876,7 +896,7 @@
\defy\the{%
$\mathop{\rm val}\cdot$ {\rm or }%
\lcenclose{$\cdot$}%
-}{index}
+}{index:tex}
\defx\the{val}{index:visual}
@@ -908,7 +928,7 @@
\defy\inmath{%
$^\bullet(\,\cdot\,)$%
-}{index}
+}{index:tex}
\defx\ifx{%
{\bf if$_{\rm x}\;$}%
@@ -916,7 +936,7 @@
\defy\ifx{%
{\bf if$_{\rm x}$}%
-}{index}
+}{index:tex}
\defx\ifnum{%
{\bf if$_\omega\;$}%
@@ -924,7 +944,7 @@
\defy\ifnum{%
{\bf if$_\omega$}%
-}{index}
+}{index:tex}
\defx\ifcat{%
{\bf if$_{\rm cat}\;$}%
@@ -932,7 +952,7 @@
\defy\ifcat{%
{\bf if$_{\rm cat}$}%
-}{index}
+}{index:tex}
\defx\iftracebadchars{%
{\bf if$_t$ {\rm[{\tt bad char}]}$\;$}%
@@ -940,7 +960,7 @@
\defy\iftracebadchars{%
{\bf if$_t$ {\rm[{\tt bad char}]}}%
-}{index}
+}{index:tex}
\defx\else{%
{\bf else$\;$}%
@@ -948,7 +968,7 @@
\defy\else{%
{\bf else}%
-}{index}
+}{index:tex}
\defx\fi{%
{\bf fi$\;$}%
@@ -956,7 +976,7 @@
\defy\fi{%
{\bf fi}%
-}{index}
+}{index:tex}
\defx\def{%
{\bf def$\;$}%
@@ -964,7 +984,7 @@
\defy\def{%
{\bf def}%
-}{index}
+}{index:tex}
\defx\edef{%
{\bf def$_{\rm x}\;$}%
@@ -972,7 +992,7 @@
\defy\edef{%
{\bf def$_{\rm x}$}%
-}{index}
+}{index:tex}
\defx\edef{def_x}{index:visual}
@@ -990,7 +1010,7 @@
\defy\empty{%
$\emptyset$%
-}{index}
+}{index:tex}
\defx\ifrhsfull{%
{\bf if {\rm ($\,$rhs${}={}$full$\,$)}$\;$}%
@@ -998,7 +1018,7 @@
\defy\ifrhsfull{%
{\bf if {\rm ($\,$rhs${}={}$full$\,$)}}%
-}{index}
+}{index:tex}
\defx\rhsfulltrue{%
{\rm rhs${}={}$full$\,$}%
@@ -1006,7 +1026,7 @@
\defy\rhsfulltrue{%
{\rm rhs${}={}$full}%
-}{index}
+}{index:tex}
\defx\rhsfullfalse{%
{\rm rhs${}={}$not full$\,$}%
@@ -1014,7 +1034,7 @@
\defy\rhsfullfalse{%
{\rm rhs${}={}$not full}%
-}{index}
+}{index:tex}
\defx\noexpand{%
$^{\rm nox}$%
@@ -1026,11 +1046,11 @@
\defy\noexpand{%
$^{\rm nox}$%
-}{index}
+}{index:tex}
\defy\nx{%
$^{\rm nx}$%
-}{index}
+}{index:tex}
\defx\to{%
${}\mapsto{}$%
@@ -1038,7 +1058,7 @@
\defy\to{%
$\mapsto$%
-}{index}
+}{index:tex}
\defx\emptyterm{%
\hbox{$\ulcorner\ldots\urcorner$}%
@@ -1046,7 +1066,7 @@
\defy\emptyterm{%
\hbox{$\ulcorner\ldots\urcorner$}%
-}{index}
+}{index:tex}
\defx\hfil{\hbox{$\,\Leftrightarrow\,$}}{texline}
\defx\omit{\hbox{$\,{\times\atop\times}$}}{texline}
@@ -1070,7 +1090,7 @@
\defy\yy{%
$\Upsilon\kern-1pt{}_{\rm?}$%
-}{index}
+}{index:tex}
\defx\yy{Y_?}{index:visual}
@@ -1100,7 +1120,16 @@
\def\setpgroup{$\Upsilon\kern-1pt{}_{\rm#1}\langle{}${\tt\the\toksa}${}\rangle\;$}\grabbalanced
}
+%\def\scriptswitch{\the\scriptfont0}
+\def\scriptswitch{%
+ \sscmd\it
+ \let\_\uscore
+% \let\acharswitch\textadustacharswitch
+}
+
\def\seeksymtt#1[{{$\Upsilon\kern-1pt{}_{\rm#1}$}}
+\def\seeksymtt#1[{{$\Upsilon\kern-1pt{}_{\hbox{\scriptswitch\nameproc{#1}\with\parsebin\the\toksa}}$}}
+\def\seeksymtt#1[{{$\Upsilon\kern-1pt{}_{\hbox{\sscmd\prodstyle{#1}}}$}}
\def\seeknott#1){{$\Upsilon\kern-1pt{}_{\rm#1}$}}
@@ -1136,7 +1165,7 @@
\defy\bb{%
${}_{\rm?}\kern-2pt\Upsilon$%
-}{index}
+}{index:tex}
\defx\bb{Y_??}{index:visual}
@@ -1149,7 +1178,7 @@
\defy\switchon{%
\hbox{\bf switch$\;$}%
-}{index}
+}{index:tex}
\defx\in{%
$\,\varepsilon\,$%
@@ -1157,7 +1186,7 @@
\defy\in{%
$\,\varepsilon\,$%
-}{index}
+}{index:tex}
\defx\concat#1#2{%
\hbox{#1${}\leftarrow{}$#1${}+_{\rm s}{}$#2$\;$}%
@@ -1165,7 +1194,7 @@
\defy\concat{%
\hbox{$A\leftarrow A+_{\rm s}B$}%
-}{index}
+}{index:tex}
\defx\appendr#1{%
\hbox{#1${}\leftarrow{}$#1${}+_{\rm sx}{}$}%
@@ -1176,7 +1205,7 @@
\defy\appendr{%
\hbox{$A\leftarrow A+_{\rm sx}B$}%
-}{index}
+}{index:tex}
\defx\default{%
{\tt default}$\;$%
@@ -1197,7 +1226,7 @@
\defy\getfirst{%
$\pi_1$%
-}{index}
+}{index:tex}
\defx\getfirst{pi_1}{index:visual}
@@ -1215,7 +1244,7 @@
\defy\getsecond{%
$\pi_2$%
-}{index}
+}{index:tex}
\defx\getsecond{pi_2}{index:visual}
@@ -1233,7 +1262,7 @@
\defy\getthird{%
$\pi_3$%
-}{index}
+}{index:tex}
\defx\getthird{pi_3}{index:visual}
@@ -1251,7 +1280,7 @@
\defy\getfourth{%
$\pi_4$%
-}{index}
+}{index:tex}
\defx\getfourth{pi_4}{index:visual}
@@ -1269,7 +1298,7 @@
\defy\getfifth{%
$\pi_5$%
-}{index}
+}{index:tex}
\defx\getfifth{pi_5}{index:visual}
@@ -1287,7 +1316,7 @@
\defy\rhscont{%
$\pi_{\{\}}$%
-}{index}
+}{index:tex}
\defx\rhscont{pi_brace}{index:visual}
@@ -1305,7 +1334,7 @@
\defy\rhscnct{%
$\pi_{\leftrightarrow}$%
-}{index}
+}{index:tex}
\defx\rhscnct{pi_arrow}{index:visual}
@@ -1323,7 +1352,7 @@
\defy\rhsbool{%
$\pi_{\vdash}$%
-}{index}
+}{index:tex}
\defx\rhsbool{pi_implies}{index:visual}
@@ -1333,7 +1362,7 @@
\defy\%{%
{\.{\harmlesscomment}}\let\defypostamble\relax%
-}{index}
+}{index:tex}
\defx\%{\%}{index:visual}
@@ -1343,7 +1372,7 @@
\defy\harmlesscomment{%
{\.{\harmlesscomment}}\let\defypostamble\relax%
-}{index}
+}{index:tex}
\defx\harmlesscomment{\%}{index:visual}
@@ -1353,7 +1382,7 @@
\defy\\{%
{\.{\\}}\let\defypostamble\relax%
-}{index}
+}{index:tex}
\defx\\{\\}{index:visual}
@@ -1363,7 +1392,7 @@
\defy\lbchar{%
\.{\{}%
-}{index}
+}{index:tex}
\expandafter\defx\expandafter\lbchar\expandafter{\lbchar lbchar}{index:visual}
@@ -1440,6 +1469,7 @@
\defx\yyBEGIN{%
\def\setegroup{{\bf enter}}%
+ \def\settgroup{{\bf enter}}% for text examples
\def\setpgroup{%
{%
\let\parsernamespace\flexpseudonamespace
@@ -1451,7 +1481,7 @@
\expandafter
}\the\toksd
\let\termindex\writeidxfsentry
- \edef\next{{}$\nx\mathop{\hbox{\nx\bf enter}}(\hbox{\the\toksd})${}%
+ \edef\next{{}$\nx\mathop{\hbox{\nx\bf enter}}(\hbox{\nx\flexsndisplay{\the\toksd}})\,${}%
\gidxentryxb{\termvstring}{\the\toksa}{\the\tokse}}\next
\let\termindex\eatone
}\grabbalanced
@@ -1459,7 +1489,7 @@
\defy\yyBEGIN{%
{\bf enter}%
-}{index}
+}{index:tex}
\defx\yyBEGIN{enter}{index:visual}
@@ -1469,7 +1499,7 @@
\defy\yyBEGINr{%
{\bf enter$_x$}%
-}{index}
+}{index:tex}
\defx\yyBEGINr{enter_x}{index:visual}
@@ -1486,7 +1516,7 @@
\expandafter
}\the\toksd
\let\termindex\writeidxfsentry
- \edef\next{{}$\nx\mathop{\hbox{\nx\bf push state}}(\hbox{\the\toksd})\,${}
+ \edef\next{{}$\nx\mathop{\hbox{\nx\bf push state}}(\hbox{\nx\flexsndisplay{\the\toksd}})\,${}
\gidxentryxb{\termvstring}{\the\toksa}{\the\tokse}}\next
\let\termindex\eatone
}\grabbalanced
@@ -1494,7 +1524,7 @@
\defy\yypushstate{%
{\bf push state}%
-}{index}
+}{index:tex}
\defx\yypushstate{push\_state}{index:visual}
@@ -1519,7 +1549,7 @@
\defy\yypopstate{%
{\bf pop state}%
-}{index}
+}{index:tex}
\defx\yypopstate{pop state}{index:visual}
@@ -1536,7 +1566,7 @@
\expandafter
}\the\toksd
\let\termindex\writeidxfsentry
- \edef\next{{}$\nx\mathop{\hbox{\nx\bf state}}(\hbox{\the\toksd})\,${}%
+ \edef\next{{}$\nx\mathop{\hbox{\nx\bf state}}(\hbox{\nx\flexsndisplay{\the\toksd}})\,${}%
\gidxentryxb{\termvstring}{\the\toksa}{\the\tokse}}\next
\let\termindex\eatone
}\grabbalanced
@@ -1544,6 +1574,6 @@
\defy\yylexstate{%
{\bf state}%
-}{index}
+}{index:tex}
\defx\yylexstate{state}{index:visual}
diff --git a/support/splint/tex/yyunion.sty b/support/splint/tex/yyunion.sty
index 7f4937a4e3..81d69b3789 100644
--- a/support/splint/tex/yyunion.sty
+++ b/support/splint/tex/yyunion.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2020, Alexander Shibakov
+% Copyright 2012-2024, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -34,17 +34,14 @@
\|\`\\\{\}\~\ \_\&\^\$\#\n% the last one is inserted by the preprocessing scripts
}
-
-% insidemost
+% insidemost (level 0)
\long\def\stashed#1{} % stashed material (usually \Cee\ code) :: \stashed{tex_string}
\long\def\sflush#1#2{} % stash flushing marker :: \sflush{tex_string}
\def\format#1{} % format material triggered by braces and the start of production :: \format{tex_string}
\def\formatlocal#1{} % format material triggered by every term :: \formatlocal{tex_string}
-% level 1
-
-\long\def\strm[#1]#2.[#3]{} % a stream element :: \strm[digits]{\stashed|\format|\formatlocal}.[digits]
+% level 1---atoms minimally processed by the parser
% types returned by the lexer; the integer type (hex vs. decimal) is determined at the lexer level so
% these are tagged by the lexer as well
@@ -63,33 +60,32 @@
\defp\midf#1#2{} % *rule separator :: \midf{fptr}{sptr}
\defp\preckind#1#2#3{} % *precedence operator :: \preckind{12string}{fptr}{sptr}
%
-\defp\flexoptionpair#1#2{} % a flex option :: \flexoptoinpair{\idit}{\idit|\stringify}
\defp\termname#1#2{} % a production term :: \termname{\idit|\stringify|\charit}{\idit}
\defp\mergeop#1#2#3{} % merge directive :: \mergeop{\tagit}{fptr}{sptr}
\defp\dprecop#1#2#3{} % dprec directive :: \dprecop{\anint|\hexint}{fptr}{sptr}
\defp\sprecop#1#2#3{} % prec directive :: \sprecop{\idit|\stringify|\charit}{fptr}{sptr}
-\defp\rrhssep#1#2{} % :: \rrhssep{fptr}{sptr}
-\defp\arhssep#1#2{} % :: \arhssep{fptr}{sptr}
-\defp\rarhssep#1#2{} % :: \rarhssep{fptr}{sptr}
+\defp\rrhssep#1#2{} % separator :: \rrhssep{fptr}{sptr}
+\defp\arhssep#1#2{} % separator (between the action and the right hand side) :: \arhssep{fptr}{sptr}
+\defp\rarhssep#1#2{} % separator :: \rarhssep{fptr}{sptr}
\defp\hspace#1#2{} % a space has to take two parameters just like any connector :: \hspace{fptr}{sptr}
-\defp\emptyterm{}
+\defp\emptyterm{} % implicit empty right hand side :: \emptyterm
\defp\onesymbol#1#2#3{} % a symbol definition :: \onesymbol{\idit}{\anint|\hexint}{\stringify}
\defp\bracedvalue#1#2#3{} % a braced variable value :: \bracedvalue{tex_string}{fptr}{sptr}
-%level 1
+% level 2---the structures built by the parser
+\defp\prodheader#1#2#3#4{} % a `left-hand side' of a production :: \prodheader{\idit}{\idit}{fptr}{sptr}
\defp\rhs#1#2#3{} % a `right-hand side' :: \rhs{[\termname\hspace\rarhssep\arhssep\actbraces]+}{\arhssep|<nothing>}{\ifrhsfull}
\defp\actbraces#1#2#3#4#5\bdend{} % action braces :: \actbraces{tex_string}{\idit|<nothing>}{fptr}{sptr}directive*\bdend
\defp\bpredicate#1#2#3#4#5\bdend{} % predicate :: \bpredicate{tex_string}{<nothing>}{fptr}{sptr}directive*\bdend
-% level 2
+% level 3---the structures composed of structures above
-\defp\prodheader#1#2#3#4{} % a `left-hand side' of a production :: \prodheader{\idit}{\idit}{fptr}{sptr}
-\defp\rules#1#2#3{} % a complete right-hand side :: \rules{[\rhs|\rrhssep]}{max fptr}{max sptr}
+\defp\rules#1{} % a complete right-hand side :: \rules{[\rhs|\rrhssep]}
\defp\symbolprec#1#2{} % symbol precedence :: \symbolprec{\idit|\stringify|\charit}{\anint|\hexint}
%\def\pcluster#1#2{} % a production cluster :: \pcluster{\prodheader}{\termname|...} should never appear in the final output
-% level 3
+% level 4---larger structures and top level constructions
\defp\oneproduction#1#2#3{} % a complete production :: \oneproduction{\prodheader\rules}{fptr}{sptr}
\defp\prodprodsepsmall{} % production separator
@@ -102,9 +98,6 @@
\defp\ntermdecls#1#2#3{} % nterm declarations :: \ntermdecls{[\onesymbol]+}{fptr}{sptr}
\defp\typedecls#1#2#3#4{} % type declarations :: \typedecls{\tagit}{[\idit\stringify\charit]+}{fptr}{sptr}
\defp\precdecls#1#2#3#4#5{} % precedence declarations :: \precdecls{left|right|nonassoc|precedence}{\tagit}{[\idit\stringify\charit]+}{fptr}{sptr}
-\defp\flexsstatedecls#1#2#3{} % flex state declarations (nonexlusive) :: \flexsstatedecls{[\idit\stringify]+}{fptr}{sptr}
-\defp\flexxstatedecls#1#2#3{} % flex state declarations (exclusive) :: \flexxstatedecls{[\idit\stringify]+}{fptr}{sptr}
-\defp\flexoptiondecls#1#2#3{} % flex options :: \flexoptiondecls{[\flexoptionpair]+}{fptr}{sptr}
\defp\oneparametricoption#1#2#3#4{} % option :: \oneparametricoption{option-name}{\stringify|\idit}{fptr}{sptr}
\defp\optionflag#1#2#3#4{} % option flag :: \optionflag{flag name}{abbreviated name}{fptr}{sptr}
\defp\paramdef#1#2#3#4{} % parameters :: \paramdef{\braceit}{parameter domain}{fptr}{sptr}
@@ -114,10 +107,6 @@
\defp\vardef#1#2#3#4{} % variable definition :: \vardef{\idit|\stringify}{|\idit|\stringify|\bracedvalue}{fptr}{sptr}
\defp\prologuecode#1#2#3#4#5{} % prologue code :: \prologuecode{tex_string}{fptr}{sptr}{fptr}{sptr}
-% level 4
-
-%\def\grammar#1#2{} % a grammar: should never appear in the final output
-
\savecslist{parser-prototypes}\yyunion
% table construction: the macros run to build the contents of the table of productions to be
@@ -141,6 +130,10 @@
\newtoks\yystashlocal
\newtoks\yyformatlocal
+\def\astappend{\appendtolist\aststream}
+\def\astappendx{\appendtolistx\aststream}
+\def\astisempty{\listisempty\aststream}
+
% index implementation
% note that the rank and domain parameters are handed down by the
% `outer' macro while the `qualifier' (\term...string) is decided
@@ -194,7 +187,7 @@
% must take place)
% o finally, the entries that must be expanded at a specific point between the point
% of invocation and the \shipout
-% the indexing macro below treats the first three cases for the entries that the macro
+% the indexing macro below treats the first three cases for the entries that the macros
% below produce; the last case can be implemented by redefining the \stickycs macro
% at the appropriate point
@@ -256,9 +249,11 @@
\toksa{\ifcase#1<NUL>}
\tempcb=\uccode`.
+% a loop that builds a macro to produce a category 12 character with the given character code
+
\bloop
\uccode`.=\tempca
-\uppercase{\toksb\expandafter{.}}%
+\uppercase{\toksb{.}}%
\toksa\expandafter\expandafter\expandafter{\expandafter\the\expandafter\toksa\expandafter\or\the\toksb}%
\advance\tempca by\@ne
\ifnum\tempca>"FF
@@ -266,6 +261,15 @@
\else
\repeat
+% defining the macro that was built above
+
+\edef\next{\toksa{\def\noexpand\asciiprint##1{\the\toksa}}}\next
+\the\toksa
+
+% return . to its regular state
+
+\uccode`.=\tempcb
+
\def\charstocharsx#1\end{% expandable version of a `safety' macro, ascii characters only, no tricky space characters
\yystartsinspace{#1.}{%
\space\ch@rstocharsx#1\end
@@ -280,9 +284,6 @@
\def\ch@rst@charsx#1#2\end{\asciiprint{`#1}\charstocharsx#2\end}
-\edef\next{\toksa{\def\noexpand\asciiprint##1{\the\toksa}}}\next
-\the\toksa
-
\def\writeidxhentry#1{%
\indxe\gindex{{\secno}{{\currentrulecontext}{\hostparsernamespace}}{\bisonidxdomain}{\headeridxrank}#1}%
}
@@ -304,6 +305,40 @@
\fi
}
+\def\ridxentry#1#2#3{% index entry that allows raw input (see
+ \gidxentry{#1}{\end0 \vend{32}\end\toksa{#2}\noexpand\noexpand\noexpand\eatone\vend\eatone}{#3}%
+ % the first \end and \eatone will be removed by \charsto..., the next (innermost) by \numbersto... inside \FI
+}
+
+\def\didxentry#1#2{% (another) index entry that allows raw input (see \csname flex@ption_other\endcsname below)
+ \gidxentryxb{\termraw}{\number#1}{#2}%
+}
+
+\def\gtextidx#1#2#3{% #1 is the entry
+ % #2 is the visual key
+ % #3 is the domain
+ \expandafter\ifx\csname indexterms<count>\endcsname\relax
+ \else
+ {%
+ \storerawidxentry{#1}%
+ \edef\next{%
+ \noexpand\indxe\gindex{{\secno}{{}{\indexpseudonamespace}}{#3}{\termidxrank}{}%
+ {\noexpand\termraw}{\number\getstackpointer\indexterms}{#2}}%
+ }\next
+ \edef\next{\next}\next
+ }%
+ \fi
+}
+
+% a shortcut to simplify using the macro above
+
+\def\storerawidxentry#1{%
+ {%
+ \toksa{#1}%
+ \let\parsernamespace\empty\yypushg{\the\toksa}\on\indexterms
+ }%
+}
+
% a convenient shortcut, as many visual keys come in a token register
\def\gidxentryxv#1#2#3{% a generic index entry, e(x)pand (v)isual key:
@@ -338,62 +373,152 @@
\edef\next{\tidxentry{\termidstring}{#1}}\next
}
-\def\gatherstash#1#2\strm[#3]#4.[#5]{% #1 contains the stash gathered
- \yystringempty{#3}{ #1}%
- {%
- \expandafter\g@therstash\expandafter{\romannumeral0\unstash#4}{#1}%
- }%
+% stash processing wrapper macros
+
+\def\yyreadstash#1\to#2\in#3\with#4{%
+ \consumelistupto{#1}{#2}\to{#3}%
+ #4{#3}%
+ \mathsplittoks{#3}{\yyr@adstash}{\eatthree}{#1}{#2}{#3}%
}
-% stash processing wrapper macros
+% this macro is based on the assumption that all the math mode
+% changes are introduced by unadulterated $ tokens (as is done in
+% \CWEB); \CWEB's handling of math mode is a mistake so there is
+% no need to introduce another one by using clever math switches;
+% note that this is not affected by \inmath (see somewhere in this file),
+% since (as long as!) it is only inserted in the verbatim mode ...
+% ... or at least it should, so never do something like
+% @t}\inmath{{@> ... @t}}@>
+% unless you really know what you are doing (hint: it is only ok
+% to do this if there are no intervening \vb{...} groups inside
+% the ... portion above.
-\def\g@therstash#1#2{\gatherstash{#2#1}}
+\def\mathsplittoks#1#2#3{% execute actions depending on whether
+ % token register #1 contains
+ % odd (then insert #2)
+ % or even (insert #3) number of $'s
+ \expandafter\evenmathify\the#1$%
+ \evenmather\end$\evenmather\end$\evenmather\end$%
+ \evenmather\end$\evenmather\end$\evenmather\end$%
+ \emo$\eme$\emo$\eme$\emo$\eme$\emo$\eme$\emo$\end
+ {#2}{#3}%
+}
-\def\unstash#1#2{\expandafter\space#2}% #1 is \stashed or \sflush
+\def\evenmathcontainer{\evenmather\end}
-\def\yyreadstash#1\to#2\in#3\with#4{%
- \yyreadfifo#1\to#2\in#3%
- #4{#3}%
- \setbox\z@=\vbox{
- \hsize\maxdimen\emergencystretch\maxdimen
- \rightskip\z@ plus 1fill
- \insertstash{#3}%
- \ifmmode
- {}$\aftergroup\yyr@adstash % $o that the box can be finished
+\def\evenmather#1$#2$#3$#4$#5$#6${}
+
+\def\emo#1\end{\yyfirstoftwo}
+
+\def\eme#1\end{\yysecondoftwo}
+
+\def\evenmathify#1$#2$#3$#4$#5$#6${%
+ {% make all changes to \next local
+ \def\next{#6}%
+ \ifx\next\evenmathcontainer
+ \yybreak{}%
\else
- \aftergroup\eatthree
- \fi
- }{#1}{#2}{#3}%
+ \yybreak{\aftergroup\evenmathify}%
+ \yycontinue
+ }%
}
\def\yyr@adstash#1#2#3{%
- #3\expandafter{\the#3{}$}% $
- \appendlnx#1{\strm[NaN]{\stashed{{}${}}}.[NaN]}% {}, in case \yystash ends with $
+ #3\expandafter{\the#3{}$}% $upply the math mode switch
+ {%
+ \tempca#2\relax
+ \advance\tempca\@ne
+ \edef\next{%
+ \noexpand\changelistelem{#1}{#2}{}{{}$}% change the consumed stash, so it can be read again
+ \noexpand\changelistelem{#1}{\the\tempca}{{}${}}{}%
+ }\expandafter
+ }\next
}
-% the sequence below may be redefined so that the #2 parameter to \yyreadstash may be a list of
-% token registers
-
-\def\insertstash#1{\the#1\relax}
-
-\def\readstash#1{\yyreadstash\yystash\to#1\in\yystashlocal\with\unpackstash}
+\def\readstash#1{%
+ \yyreadstash\yystash\to#1\in\yystashlocal\with\eatone
+}
\def\readstashwredirect#1#2#3{% helper macro to read the stash when the stash and the format pointers appear together
% #1(the format pointer) is ignored
% #2 is the stash marker
% #3 is the local stash register
- \yyreadstash\yystash\to#2\in#3\with\unpackstash
+ \yyreadstash\yystash\to#2\in#3\with\eatone
+}
+
+% format processing wrapper macros
+
+\def\readformat#1{%
+ \let\listiterator\listiteratorsimple
+ \consumelistupto\yyformat{#1}\to\yyformatlocal
+}
+
+\def\readformatlocalonly#1{%
+ \let\listiterator\listiteratorfmtloc
+ \let\wrapupfmtlocal\wrapupyyformatlocal
+ \yyformatlocal{}%
+ \evallistbetween\yyformat{\showlistpointer\yyformat}{#1}%
+}
+
+% iterator to extract \formatlocal
+
+\def\listiteratorfmtloc#1#2{%
+ \lookforfmtloc{#1}{}{}.#2\formatlocal{\formatlocal}%
+}
+
+\def\lookforfmtl@c#1#2#3#4#5{%
+ \isthisfmtlocal#5.\formatlocal{%
+ \wrapupfmtlocal{#2}{#3#1}{#4}%
+ }{%
+ \lookforfmtloc{#2}{#3#1}{#4\formatlocal{#5}}.%
+ }%
}
-\def\unpackstash#1{#1\expandafter{\romannumeral0\expandafter\unp@ckstash\the#1\strm[].[]}}
+\def\lookforfmtloc#1#2#3#4\formatlocal#5{% remove the guard .
+ \expandafter\lookforfmtl@c\expandafter{\eatone#4}{#1}{#2}{#3}{#5}%
+}
-\def\unp@ckstash{\gatherstash{}}
-\def\unwrapstash#1{% to use where only the removal of \strm and \stashed is needed
- #1\expandafter{\romannumeral0\expandafter\unwr@pstash\the#1\strm[].[]}%
+\def\isthisfmtlocal#1\formatlocal{%
+ \yystringempty{#1}{% a match, clean up the inserted \formatlocal
+ \endoffmtlocal
+ }{% not a match yet, \lookforfmtloc again
+ \yysecondoftwo
+ }%
}
-\def\unwr@pstash{\gatherstash{}}
+\def\endoffmtlocal#1\formatlocal{\yyfirstoftwo}
+
+\def\wrapupfmtlocal#1#2#3{% a postprocessing macro, to be changed by the one that
+ % invokes the iterator
+ \fdef#1{#2}%
+}
+
+\def\wrapupyyformatlocal#1#2#3{% macro used to save the \formatlocal contents in \yyformatlocal
+ \fdef#1{#2}\yyformatlocal\expandafter{\the\yyformatlocal#3}%
+}
+
+\let\wrapupfmtlocal\wrapupyyformatlocal
+
+% use example for the macros above:
+%\initlist{table}
+%\toksa{#}
+%\let\listiterator\listiteratorfmtloc
+%\appendtolisti{table}{..}
+%\appendtolisti{table}{a,}
+%\appendtolisti{table}{\formatlocal{}{b}\formatlocal{k} , }
+%\appendtolisti{table}{{c},}
+%\appendtolisti{table}{ \space d,}
+%\appendtolisti{table}{e\formatlocal{d},}
+%\appendtolisti{table}{\format{}{f}\formatlocal{j}}
+%\appendtolisti{table}{.}
+%\appendtolisti{table}{\end}
+%\finishlist{table}
+%\storelist{table}\to\toksa
+%\the\toksa
+%\storelist{table}\to\toksa
+%\message{full list: \the\toksa}
+%\errmessage{separated: \the\yyformatlocal}
% parser invocation
@@ -401,9 +526,12 @@
\def\d@parse#1{\yyparse#1\yyeof\yyeof\endparseinput\endparse}
-\def\astarraylastcs{\expandafter\noexpand\romannumeral\gettopofstackcsx\astarray}
-
-\long\def\strm[#1]#2.[#3]{#2} % this is used with both the format and the stash streams; TODO: deprecate
+% as an alternative to lists, stacks (as arrays) can be used to speed up the parser;
+% the following setup (along with a convenient shortcut to reference the most
+% recent store) can be employed if desired; unlike lists, stacks do not have
+% a built-in mechanism for slice expansion.
+%\yyinitstack\astarray % flattened AST to (possibly) speed up the parser
+%\def\astarraylastcs{\expandafter\noexpand\romannumeral\gettopofstackcsx\astarray}
\long\def\inmath#1{$#1$}
@@ -416,9 +544,14 @@
\def\ntt{\noexpand\ntt@} % a convenient shortcut
\def\ntt@{\tt\let\_\UL}
-\def\prodheader#1#2#3#4{%
- \yyreadfifo\yyformat\to#3\in\yyformatlocal
- \restorecs{table-render}{\strm}\the\yyformatlocal
+% macros that process the bison grammar terms;
+% the higher level macros (like the \prodheader below) set up the sequence in
+% which the processing takes place; the actual typesetting (or whatever other
+% task is desired, like reference creation) is done by the lower level macros
+% like \prodhead@r in this case.
+
+\defc\prodheader{% a `left-hand side' of a production :: \prodheader{\idit}{\idit}{fptr}{sptr}
+ \readformat{#3}\the\yyformatlocal
\let\termindex\writeidxhentry
\prodhead@r{#1}{#2}%
\let\termindex\eatone
@@ -426,53 +559,50 @@
\def\prodhead@r#1#2{%
\let\idit\prodhdridit
- #1\relax\concat\table\toksa\hrhss@p
+ #1\relax\astappendx{\the\toksa}\hrhss@p
}
-\def\hrhss@p{\toksa{&\omit\hfil&\omit\hfil&\omit\hfil\cr\noalign{\penalty100}\omit\hfil&\termspostformat}\concat\table\toksa}
+\def\hrhss@p{\toksa{&\omit\hfil&\omit\hfil&\omit\hfil\cr\noalign{\penalty100}\omit\hfil&\termspostformat}\astappendx{\the\toksa}}
-\def\rrhssep#1#2{%
- \yyreadfifot\yyformat\to#1\in\yyformatlocal\with\formatsort\relax
+\defc\rrhssep{% separator :: \rrhssep{fptr}{sptr}
+ \readformatlocalonly{#1}%
\the\yyformatlocal % this will have a chance to change the definition of \rrhss@p
\rrhss@p
}
-\def\rrhss@p{\toksa{\omit\hfil&}\concat\table\toksa}
+\def\rrhss@p{\toksa{\omit\hfil&}\astappendx{\the\toksa}}
-\def\arhssep#1#2{%
- \yyreadfifo\yyformat\to#1\in\yyformatlocal
+\defc\arhssep{% separator (between the action and the right hand side) :: \arhssep{fptr}{sptr}
+ \readformat{#1}%
\the\yyformatlocal % this will have a chance to change the definition of \arhss@p
\arhss@p
}
%% between the inline action and next term:
-\def\arhss@p{\toksa{\omit\hfil&\hbox to 2em{\hfil}}\concat\table\toksa}
+\def\arhss@p{\toksa{\omit\hfil&\hbox to 2em{\hfil}}\astappendx{\the\toksa}}
-\def\rarhssep#1#2{%
- \yyreadfifo\yyformat\to#1\in\yyformatlocal
+\defc\rarhssep{% separator :: \rarhssep{fptr}{sptr}
+ \readformat{#1}%
\the\yyformatlocal % this will have a chance to change the definition of \rarhss@p
\rarhss@p
}
%% between a term and the following action
-\def\rarhss@p{\appendr\table&}
-
-\newtoks\hstoks
+\def\rarhss@p{\astappend&}
-\def\hspace#1#2{%
- \hstoks\yyformat
- \yyreadfifot\yyformat\to#1\in\yyformatlocal\with\formatsort\relax
+\defc\hspace{% a space has to take two parameters just like any connector :: \hspace{fptr}{sptr}
+ \readformatlocalonly{#1}%
\the\yyformatlocal % may change \hspac@
\hspac@
}
\def\hspac@{%
- \appendr\table{ }%
+ \astappend{ }%
}
-\def\rhs#1#2#3{#1}
+\defc\rhs{#1}% a `right-hand side' :: \rhs{[\termname\hspace\rarhssep\arhssep\actbraces]+}{\arhssep|<nothing>}{\ifrhsfull}
\def\supplybdirective#1#2{%
\edef\next{\nx\s@pplybdirective#1{\the#2}\the#1\nx\bdend}\next
@@ -482,7 +612,7 @@
#1{#3#2\bdend}%
}
-\def\termname#1#2{%
+\defc\termname{% a production term :: \termname{\idit|\stringify|\charit}{\idit}
\let\idit\termnameidit
\let\stringify\termnamestringify
\let\optstrextra\optstrextraesc
@@ -499,7 +629,7 @@
\def\t@rmn@m@#1#2{% the termname is #2, the bracketed part is in #1
\yystringempty{#1}{\toksa{#2}}{\toksa{#2\hbox{$\langle${}#1{}$\rangle$}}}%
- \concat\table\toksa
+ \astappendx{\the\toksa}%
}
\newif\ifbracketedvisible % decide whether to show the bracketed name in productions
@@ -512,16 +642,15 @@
\toksa{#2}%
\fi
}%
- \concat\table\toksa
+ \astappendx{\the\toksa}%
}
%
\newtoks\bdirects
-\def\actbraces#1#2#3#4#5\bdend{%
- \yyreadfifo\yyformat\to#3\in\yyformatlocal
- \restorecs{table-render}{\strm}%
+\defc\actbraces{% action braces :: \actbraces{tex_string}{\idit|<nothing>}{fptr}{sptr}directive*\bdend
+ \readformat{#3}%
#5% accumulate all the directives
\yytoksempty\bdirects{}{%
\edef\next{\bdirects{%
@@ -533,13 +662,12 @@
\def\actbrac@s#1#2#3{%
\readstash{#3}%
- \appendr\table{\the\bdirects&\toksa{\the\yystashlocal}\cr}%
+ \astappendx{\the\bdirects&\toksa{\the\yystashlocal}\cr}%
\bdirects{}%
}
\def\bpredicate#1#2#3#4#5\bdend{%
- \yyreadfifo\yyformat\to#3\in\yyformatlocal
- \restorecs{table-render}{\strm}%
+ \readformat{#3}%
#5% accumulate all the directives
\yytoksempty\bdirects{%
\bdirects{\quad$\dashv\ \nx\vdash$}%
@@ -554,7 +682,7 @@
\def\bpredicat@#1#2#3{%
\readstash{#3}%
- \appendr\table{\the\bdirects&\toksa{\the\yystashlocal}\cr}%
+ \astappendx{\the\bdirects&\toksa{\the\yystashlocal}\cr}%
\bdirects{}%
}
@@ -578,9 +706,9 @@
\bdirective{prec}{#1}{#2}{#3}%
}
-\def\rules#1#2#3{#1}
+\defc\rules{#1}% a complete right-hand side :: \rules{[\rhs|\rrhssep]}
-\def\oneproduction#1#2#3{#1\setrulecontext{}\stopproduction}
+\defc\oneproduction{#1\setrulecontext{}\stopproduction}% a complete production :: \oneproduction{\prodheader\rules}{fptr}{sptr}
% to make it possible to typeset tokens depending on their context
% the context name is passed to the token typeseting macros; the most
@@ -599,10 +727,13 @@
% because of this it would be unnatural to define a \prettywordpair sequence for it in the main
% parser namespace; using a special non-\bison\ name should avoid any confusion with
% the regular grammar terms
-\def\emptyterm{\appendr\table{$\nx\circ$\tidxentry{\termexception}{emptyrhs&}}}
+
+\def\emptyrhssymbol{$\circ$}
+
+\defc\emptyterm{\astappendx{\nx\emptyrhssymbol\tidxentry{\termexception}{emptyrhs&}}}
\def\termnameidit#1#2#3#4{%
- \yyreadfifot\yyformat\to#3\in\yyformatlocal\with\formatsort\relax
+ \readformatlocalonly{#3}%
\the\yyformatlocal
\nameproc{#2}\with\parsebin
\peekstash{#4}% does not clobber \toksa and \toksb
@@ -641,7 +772,7 @@
\newif\ifinheader
\def\prodhdridit#1#2#3#4{%
- \setrulecontext{}% TODO: ?
+ \setrulecontext{}% TODO: perhaps some special context for the left hand side terms is appropriate
\nameproc{#2}\with\parsebin
\setrulecontext{#1}%
\edef\next{\toksa{{%
@@ -650,7 +781,7 @@
}}}\next
}
-\def\charit#1#2#3#4{%
+\defc\charit{% *CHAR :: \charit{12string}{tex_string}{fptr}{sptr}
\expandafter\ifx\csname\prettynamecs\hostparsernamespace{#1}\endcsname\relax
\toksa{#1}\sansfirst\toksa
\edef\next{\toksa{{\ntt\the\toksa}\gidxentryxb{\termvstring}{\the\toksa}{}}}% remove the possible \\
@@ -668,12 +799,12 @@
\next
}
-\def\anint#1#2#3{%
- \appendrnx\table{#1}%
+\defc\anint{% INT :: \anint{digits}{fptr}{sptr}
+ \astappend{#1}%
}
-\def\hexint#1#2#3{%
- \expandafter\appendrnx\expandafter\table\expandafter{\eattwo#1$_{16}$}%
+\defc\hexint{% INT :: \hexint{0[xX][0-9A-F]+}{fptr}{sptr}
+ \expandafter\astappend\expandafter{\eattwo#1$_{16}$}%
}
\def\optoptsepnone{%
@@ -687,17 +818,17 @@
\def\prodprodsepsmall{%
\pushothertables
- \appendrnx\table{\noalign{\penalty-150 \smallskip}}%
+ \astappend{\noalign{\penalty-150 \smallskip}}%
}
\def\prodprodsep{%
\pushothertables
- \appendrnx\table{\noalign{\medskip}}%
+ \astappend{\noalign{\medskip}}%
}
\def\prodprodseplarge{%
\pushothertables
- \appendrnx\table{\noalign{\bigskip}}%
+ \astappend{\noalign{\bigskip}}%
}
\def\separatorswitcheq{%
@@ -730,7 +861,6 @@
\edef\next{\postoks{\nx\posmark{\the\postoks}{\the\toksd}}}\next
}
\prologuecode\ntermdecls\tokendecls
- \flexsstatedecls\flexxstatedecls\flexoptiondecls
{%
\getthird{\yy(2)}\to\postoks % the format marker
\getfourth{\yy(2)}\to\toksd % the stash marker
@@ -762,7 +892,7 @@
}
\def\posmark#1#2{%
-% \yyreadfifo\yyformat\to#1\in\yyformatlocal
+% \readformat{#1}%
% no formatting for locations currently
% \the\yyformatlocal
\posm@rk{#2}%
@@ -798,7 +928,6 @@
\oneparametricoption\vardef\paramdef\optionflag
\codepropstype\codeassoc\prologuecode
\typedecls\tokendecls\precdecls\oneproduction
- \flexsstatedecls\flexxstatedecls\flexoptiondecls
}
\def\emptyoption{\empty}
@@ -840,15 +969,117 @@
\yytoksempty\prectable{}{\attachprectable}%
% options
\yytoksempty\opttable{}{\attachoptionstable}%
- \concat\table\postoks
+ \astappendx{\the\postoks}%
} %
-% the various \attach... macros above are defined elsewhere and are the macros that
-% determine the actual typesetting of the corresponding tables.
+% typesetting token lists, precedence declarations, etc
+
+\def\attachtokentable{% typesetting the token declarations as part of the grammar
+ \tempcb3 \tempca\tempcb
+ \expandafter\tokdectoks\expandafter{\expandafter}\the\tokdectoks
+ \ifnum\tempca=\tempcb
+ \else
+ \bloop
+ \tokdectoks\expandafter{\the\tokdectoks&\omit\hfil}%
+ \ifnum\tempca=\z@
+ \else
+ \advance\tempca\m@ne
+ \repeat
+ \tokdectoks\expandafter{\the\tokdectoks\cr}%
+ \fi
+ \toksa{\tt\strut##\hfil\tabskip=0pt plus 1fil}%
+ \bloop
+ \toksa\expandafter{\the\toksa&\tt\strut##\hfil}%
+ \ifnum\tempcb=\tw@
+ \else
+ \advance\tempcb\m@ne
+ \repeat
+ \toksa\expandafter{\the\toksa&\tt\strut##\hfil\tabskip\z@\cr}%
+ \concat\toksa\tokdectoks
+ \tokdectoks\toksa
+ \astappendx{\noalign{%
+ \tabskip\parindent
+ %\nx\displaytokenrawtrue % this controls how tokens are displayed
+ % in the declarations: if true, the macro names will be shown
+ \halign to\hsize{\the\tokdectoks}%
+ }%
+ }%
+ \tokdectoks{}%
+}
+
+\def\toksdefline#1#2#3#4#5{% #1 is the parsed version of the internal bison name
+ % #2 is the index entry
+ % #3 is the type
+ % #4 is the explicit value
+ % #5 is the parsed version of the string value
+ \ifnum\tempca=\z@
+ \tokdectoks\expandafter{\the\tokdectoks&{#2}#1\hfil\cr}%
+ \tempca\tempcb
+ \else
+ \ifnum\tempcb=\tempca
+ \tokdectoks\expandafter{\the\tokdectoks{#2}#1\hfil}%
+ \else
+ \tokdectoks\expandafter{\the\tokdectoks&{#2}#1\hfil}%
+ \fi
+ \advance\tempca\m@ne
+ \fi
+}
+
+\def\attachtypestable{% typesetting the type declarations as part of the grammar
+ \toksa{}\the\typestable
+ \astappendx{\noalign{{\the\toksa}}}\typestable{}%
+}
+
+\long\def\onetype#1#2{%
+ \toksb{{%
+ \hbadness\@M
+ \rightskip=\z@
+ \tempda\hsize \advance\tempda-1in
+ \indent{$\langle$\tt union$\rangle.#1$:}\ \hfill\nobreak\hfill\nobreak\null\penalty1\relax\null\nobreak\hfill
+ \hbox to\tempda{$\vtop{\noindent\hsize\tempda\raggedright #2\strut}$}\par
+ }}%
+ \concat\toksa\toksb
+}
+
+\def\attachprectable{% typesetting the precedence declarations as part of the grammar
+ \toksa{}\the\prectable
+ \astappendx{\noalign{{\the\toksa}}}\prectable{}%
+}
+
+\long\def\oneprec#1#2#3{%
+ \toksc{%
+ \hbadness\@M
+ \rightskip=\z@
+ \tempda\hsize \advance\tempda-1in
+ \indent
+ }%
+ \toksd{%
+ \ \hfill\nobreak\hfill\nobreak\null\penalty1\relax\null\nobreak\hfill
+ \hbox to\tempda{$\vtop{\noindent\hsize\tempda\raggedright #3\strut}$}\par
+ }
+ \def\next{#2}%
+ \ifx\next\empty
+ \toksb{}%
+ \else
+ \toksb{${}:{}$#2}%
+ \fi
+ \edef\next{\toksb{{$\nx\langle$\nx\bf #1\the\toksb$\nx\rangle$}}}\next
+ \appendr\toksa{{\the\toksc\the\toksb\the\toksd}}%
+}
+
+\def\attachoptionstable{% typesetting the options as part of the grammar
+ \astappendx{\noalign{%
+ \tabskip\parindent
+ \halign{####\nx\hfil\tabskip\z@&\nx\qquad\nx\it####\nx\hfil\cr
+ \the\opttable
+ }%
+ }%
+ }\opttable{}%
+}
\let\stopproduction\relax
-\def\tokendecls#1#2#3{%
+\defc\tokendecls{% token declarations :: \tokendecls{[\onesymbol]+}{fptr}{sptr}
\savecslist{local-namespace}{\yyunion\termindex}%
\restorecslist{table-render:token-declarations}\yyunion
\let\termindex\writetokenidxentry
@@ -856,7 +1087,7 @@
\restorecslist{local-namespace}{\yyunion\termindex}%
}
-\def\typedecls#1#2#3#4{%
+\defc\typedecls{% type declarations :: \typedecls{\tagit}{[\idit\stringify\charit]+}{fptr}{sptr}
\savecslist{local-namespace}{\yyunion\termindex}%
\restorecslist{table-render:type-declarations}\yyunion
\let\termindex\writetokenidxentry
@@ -865,37 +1096,6 @@
\restorecslist{local-namespace}{\yyunion\termindex}%
}
-% \onetype is a typeseting macro defined elsewhere
-% TODO: move these to the \flex\ section
-
-\def\flexsstatedecls#1#2#3{%
- \savecslist{local-namespace}{\yyunion\termindex}%
- \restorecslist{table-render:flex-state-declarations}\yyunion
- \let\termindex\writeidxfsdentry%\writetokenidxentry
- \typesset{}#1\relax
- \appendr\typestable{\nx\flexsstatelist{\the\typesset}}%
- \restorecslist{local-namespace}{\yyunion\termindex}%
-}
-
-\def\flexxstatedecls#1#2#3{%
- \savecslist{local-namespace}{\yyunion\termindex}%
- \restorecslist{table-render:flex-state-declarations}\yyunion
- \let\termindex\writeidxfsdentry%\writetokenidxentry
- \typesset{}#1\relax
- \appendr\typestable{\nx\flexxstatelist{\the\typesset}}%
- \restorecslist{local-namespace}{\yyunion\termindex}%
-}
-
-% \flexsstatelist and \flexxstatelist are typesetting macros defined elsewhere
-
-\def\flexoptiondecls#1#2#3{%
- \savecslist{local-namespace}{\yyunion\termindex}%
- \restorecslist{table-render:flex-option-definitions}\yyunion
- \let\termindex\writeidxfsrnentry%\writetokenidxentry
- \toksa{}#1\relax
- \restorecslist{local-namespace}{\yyunion\termindex}%
-}
-
\def\precdecls#1#2#3#4#5{% #1 type
% #2 tag
% #3 list of symbols
@@ -911,8 +1111,6 @@
\setrulecontext{}%
}
-% \oneprec is a typesetting macro defined elsewhere
-
% options typesetting
\def\oneparametricoption#1#2#3#4{%
@@ -959,9 +1157,7 @@
}
\def\codepropstype#1#2#3#4#5#6#7{%
- \yyreadfifo\yyformat\to#4\in\yyformatlocal
- \restorecs{table-render}{\strm}%
- \the\yyformatlocal % this can change \codepropstyp@
+ \readformat{#4}\the\yyformatlocal % this can change \codepropstyp@
\codepropstyp@{#2}{#3}{#1}{#5}%
}
@@ -981,9 +1177,7 @@
}
\def\codeassoc#1#2#3#4#5#6#7{%
- \yyreadfifo\yyformat\to#4\in\yyformatlocal
- \restorecs{table-render}{\strm}%
- \the\yyformatlocal % this can change \codeass@c
+ \readformat{#4}\the\yyformatlocal % this can change \codeass@c
\codeass@c{#1}{#2}{#3}{#5}%
}
@@ -1001,9 +1195,7 @@
}
\def\vardef#1#2#3#4{%
- \yyreadfifo\yyformat\to#3\in\yyformatlocal
- \restorecs{table-render}{\strm}%
- \the\yyformatlocal % this can change \vard@f
+ \readformat{#3}\the\yyformatlocal % this can change \vard@f
\vard@f{#1}{#2}{#4}%
}
@@ -1022,7 +1214,7 @@
\appendr\opttable{$\nx\langle${\nx\bf define}$\nx\rangle$\nx\quad{\the\toksb}&\the\toksc\cr}%
}
-\def\prologuecode#1#2#3#4#5{% similar to \actbrac@s
+\defc\prologuecode{% prologue code :: \prologuecode{tex_string}{fptr}{sptr}{fptr}{sptr}
\readstash{#5}%
\appendr\opttable{%
\omit\span\omit\nx\cdotfill\cr
@@ -1032,7 +1224,7 @@
}
\def\yyunion@tablerender{%
- \strm\stashed\rarhss@p\rrhss@p\prodhead@r\hrhss@p\arhss@p\termnam@\termn@m@\t@rmn@m@
+ \stashed\rarhss@p\rrhss@p\prodhead@r\hrhss@p\arhss@p\termnam@\termn@m@\t@rmn@m@
\actbrac@s\hspac@\codepropstyp@\vard@f\termmetastyle\peekstash\stopproduction
}
@@ -1040,6 +1232,7 @@
\savecslist{table-render}\yyunion@tablerender
\def\setprodtable{%
+ \def\aststream{bison.rules}% the list where the AST output is gathered
\restorecslist{table-render}\yyunion
\restorecslist{table-render}\yyunion@tablerender
}
@@ -1068,10 +1261,12 @@
\let\rrhss@p\rrhss@p@flatten
\let\arhss@p\relax
\let\rarhss@p\relax
+ \def\flattenactiontrace{}%
}
\def\actbrac@s@flatten#1#2#3{% do everything but add the stash contents to the table
\readstash{#3}%
+ \edef\flattenactiontrace{\flattenactiontrace*}%
\yystashlastcontent\yystashlocal % keep the contents of the braces
% in case we want to show the last action
\futurelet\actsep\actbrac@s@fl@tten
@@ -1079,23 +1274,38 @@
% see the remarks before \emptyterm above for the reasons for choosing the index
% pseudonamespace for this term
+
+\def\inlineactionsymbol{$\diamond$}
+
\def\actbrac@s@fl@tten{%
\ifx\actsep\arhssep
- \appendr\table{$\nx\ \nx\diamond\nx\ $\tidxentry{\termexception}{inline_action&}}%
+ \astappendx{\nx\ \nx\inlineactionsymbol\nx\ \tidxentry{\termexception}{inline_action&}}%
\fi
}
\def\rrhss@p@flatten{%
- \appendrnx\table{$\ \vert\ $}%
+ \astappend{$\ \vert\ $}%
}%
\def\stopproduction@flatten{%
\ifshowlastaction
+ {%
+ \toksa\yystashlastcontent\cleanstash
+ \yytoksempty\toksa{}{% there is a non-empty action
+ \def\next{*}%
+ \ifx\flattenactiontrace\next % if there were more than one action
+ \else % preceeding it, prepend an indicator (ellipsis)
+ \appendlnx\toksa{\hbox{$\ldots\ \vert\ $}{}\ignorespaces}%
+ \fi
+ }%
+ \expandafter
+ }\expandafter\yystashlastcontent\expandafter{\the\toksa}%
\yystashlastcontent\expandafter{\expandafter\toksa\expandafter{\the\yystashlastcontent}}%
\else
\yystashlastcontent{\actionfiller}%
\fi
- \appendr\table{&&\the\yystashlastcontent\nx\cr}%
+ \def\flattenactiontrace{}%
+ \astappendx{&&\the\yystashlastcontent\nx\cr}%
}
% fold: resume normal display
@@ -1117,7 +1327,7 @@
\def\prodhead@r@inline#1#2{%
\let\idit\prodhdridit
#1\relax
- \concat\table\toksa
+ \astappendx{\the\toksa}%
\setbox\z@=\hbox{\strut\the\toksa\/$\,$\rm:\quad}%
\tempda=\wd\z@\relax
\advance\tempda-2em
@@ -1129,7 +1339,7 @@
\def\termspostformat{\ifsquashterms\aftergroup\noexpand\squashtermstrue\fi}
\def\hrhss@p@inline{%
- \appendr\table{&\termspostformat\hbox to \the\tempda{\hss}}%
+ \astappendx{&\termspostformat\hbox to \the\tempda{\hss}}%
}
% breakline: break the production line
@@ -1139,7 +1349,7 @@
}
\def\hspac@@breakline{%
- \appendrnx\table{{$\,\hookleftarrow$}&\omit\hfil&\omit\hfil\cr\omit\hfil&\hbox to 2em{\hfil}}%
+ \astappend{{$\,\hookleftarrow$}&\omit\hfil&\omit\hfil\cr\omit\hfil&\hbox to 2em{\hfil}}%
\restorecs{table-render}\hspac@
}
@@ -1157,7 +1367,7 @@
\def\hspac@@breakahead{%
\ifnum\breakaheadcount=\@ne
\yybreak{%
- \appendrnx\table{{$\,\hookleftarrow$}&\omit\hfil&\omit\hfil\cr\omit\hfil&\hbox to 2em{\hfil}}%
+ \astappend{{$\,\hookleftarrow$}&\omit\hfil&\omit\hfil\cr\omit\hfil&\hbox to 2em{\hfil}}%
\let\hspac@\bahspac@
}%
\else
@@ -1177,7 +1387,7 @@
\hrhss@p
}
-\def\hrhss@p@skipheader{\appendrnx\table{\omit\hbox to 2em{\hfil}&\termspostformat}\restorecs{table-render}{\hrhss@p}}
+\def\hrhss@p@skipheader{\astappend{\omit\hbox to 2em{\hfil}&\termspostformat}\restorecs{table-render}{\hrhss@p}}
\def\stashtoterm#1{% in case one needs to insert previous stash as a term
% usage: \let\peekstash\stashtoterm
@@ -1193,7 +1403,7 @@
\def\resetf{%
\restorecs{table-render}{\prodheader\prodhead@r\hrhss@p\rrhss@p\arhss@p\rhs\termname\actbraces\actbrac@s\rarhss@p\hspac@\rules
- \oneproduction\emptyterm\stringify\idit\charit\prodprodsep\onesymbol\strm\stopproduction}%
+ \oneproduction\emptyterm\stringify\idit\charit\prodprodsep\onesymbol\stopproduction}%
\squashtermsfalse
}
@@ -1263,26 +1473,26 @@
\restorecslist{parser-strict}\yyunion
-\def\idit#1#2#3#4{%
+\defc\idit{% *ID :: \idit{12string}{tex_string}{fptr}{sptr}
\termnameidit{#1}{#2}{#3}{#4}%
\concat\typesset\toksa
}
-\def\stringify#1#2#3#4{%
+\defc\stringify{% *STRING :: \stringify{12string}{tex_string}{fptr}{sptr}
\termnamestringify{#1}{#2}{#3}{#4}%
\concat\typesset\toksa
}
-\def\hspace#1#2{%
+\defc\hspace{% a space has to take two parameters just like any connector :: \hspace{fptr}{sptr}
\appendrnx\typesset{ }%
}
-\def\charit#1#2#3#4{%
+\defc\charit{% *CHAR :: \charit{12string}{tex_string}{fptr}{sptr}
\toksa{\.{#2}}%
\concat\typesset\toksa
}
-\def\tagit#1#2#3#4{%
+\defc\tagit{% *TAG :: \tagit{12string}{tex_string}{fptr}{sptr}
\toksa{\\{#2}}%
}
@@ -1294,19 +1504,19 @@
\restorecslist{parser-strict}\yyunion
-\def\hspace#1#2{}
+\defc\hspace{}
-\def\idit#1#2#3#4{\toksa{#2}}
+\defc\idit{\toksa{#2}}% *ID :: \idit{12string}{tex_string}{fptr}{sptr}
-\def\charit#1#2#3#4{\toksa{'#1'}}
+\defc\charit{\toksa{'#1'}}% *CHAR :: \charit{12string}{tex_string}{fptr}{sptr}
-\def\stringify#1#2#3#4{\toksb{#2}}
+\defc\stringify{\toksb{#2}}% *STRING :: \stringify{12string}{tex_string}{fptr}{sptr}
-\def\anint#1#2#3{\toksc{#1}}
+\defc\anint{\toksc{#1}}% INT :: \anint{digits}{fptr}{sptr}
-\def\hexint#1#2#3{\toksc\expandafter{\eattwo#1$_{16}$}}
+\defc\hexint{\toksc\expandafter{\eattwo#1$_{16}$}}% INT :: \hexint{0[xX][0-9A-F]+}{fptr}{sptr}
-\def\tagit#1#2#3#4{%
+\defc\tagit{% *TAG :: \tagit{12string}{tex_string}{fptr}{sptr}
\def\currenttokentype{#2}%
}
@@ -1323,9 +1533,9 @@
\edef\next{\nx\onesymb@l{\the\toksa}{\the\toksc}{\the\toksb}}\next
}
-\def\onesymb@l#1#2#3{% #1 is the macro name used internally by bison
- % #2 is the integer value
- % #3 is the string value
+\def\onesymb@l#1#2#3{% #1 is the macro name used internally by bison
+ % #2 is the integer value
+ % #3 is the string value
\let\optstrextra\optstrextraesc
\tokse{}\toksf{}\toksg{}% these registers will contain the appropriate visual keys
% and index entry processing control sequences
@@ -1362,17 +1572,17 @@
\restorecslist{parser-strict}\yyunion
-\def\idit#1#2#3#4{%
+\defc\idit{% *ID :: \idit{12string}{tex_string}{fptr}{sptr}
\termnameidit{#1}{#2}{#3}{#4}%
\concat\typesset\toksa
}
-\def\stringify#1#2#3#4{%
+\defc\stringify{% *STRING :: \stringify{12string}{tex_string}{fptr}{sptr}
\termnamestringify{#1}{#2}{#3}{#4}%
\concat\typesset\toksa
}
-\def\charit#1#2#3#4{%
+\defc\charit{% *CHAR :: \charit{12string}{tex_string}{fptr}{sptr}
\expandafter\ifx\csname\prettynamecs\hostparsernamespace{#1}\endcsname\relax
\toksa{#1}\sansfirst\toksa
\edef\next{\toksa{{\ntt\the\toksa}\gidxentryxb{\termvstring}{\the\toksa}{}}}% remove the possible \\
@@ -1391,20 +1601,20 @@
\concat\typesset\toksa
}
-\def\anint#1#2#3{%
+\defc\anint{% INT :: \anint{digits}{fptr}{sptr}
\appendrnx\typesset{${}=\hbox{\ntt#1}$}%
}
-\def\hexint#1#2#3{%
+\defc\hexint{% INT :: \hexint{0[xX][0-9A-F]+}{fptr}{sptr}
\toksa\expandafter{\eattwo#1}%
\appendr\typesset{${}=\hbox{\ntt\the\toksa}_{16}$}%
}
-\def\hspace#1#2{%
+\defc\hspace{%
\appendrnx\typesset{ }%
}
-\def\tagit#1#2#3#4{%
+\defc\tagit{% *TAG :: \tagit{12string}{tex_string}{fptr}{sptr}
\toksa{\\{#2}}%
}
@@ -1418,9 +1628,9 @@
\restorecslist{parser-strict}\yyunion
-\def\idit#1#2#3#4{\toksa{#2}}
+\defc\idit{\toksa{#2}}% *ID :: \idit{12string}{tex_string}{fptr}{sptr}
-\def\stringify#1#2#3#4{\toksa{#2}}
+\defc\stringify{\toksa{#2}}% *STRING :: \stringify{12string}{tex_string}{fptr}{sptr}
\def\bracedvalue#1#2#3{% similar to \actbrac@s
\readstash{#3}%
@@ -1433,79 +1643,33 @@
\restorecslist{parser-strict}\yyunion
-\def\idit#1#2#3#4{%
+\defc\idit{% *ID :: \idit{12string}{tex_string}{fptr}{sptr}
\termnameidit{#1}{#2}{#3}{#4}%
}
-\def\stringify#1#2#3#4{%
+\defc\stringify{% *STRING :: \stringify{12string}{tex_string}{fptr}{sptr}
\termnamestringify{#1}{#2}{#3}{#4}%
}
-\def\tagit#1#2#3#4{%
+\defc\tagit{% *TAG :: \tagit{12string}{tex_string}{fptr}{sptr}
\toksa{\\{#2}}%
}
-\def\anint#1#2#3{%
+\defc\anint{% INT :: \anint{digits}{fptr}{sptr}
\toksa{#1}%
}
-\def\hexint#1#2#3{%
+\defc\hexint{% INT :: \hexint{0[xX][0-9A-F]+}{fptr}{sptr}
\toksa\expandafter{\eattwo#1$_{16}$}%
}
\toyyunion{table-render:directives}
-% flex state declarations
-
-\restorecslist{parser-strict}\yyunion
-
-\def\idit#1#2#3#4{%
- \nameproc{#2}\with\parsebin
- \appendr\typesset{{%
- \gidxentryxv{\termttstring}{#1}{\the\toksb}%
- \ntt\the\toksa
- }}%
-}
-
-\def\hspace#1#2{%
- \appendr\typesset{ }%
-}
-
-\toyyunion{table-render:flex-state-declarations}
-
-% flex option definitions
-
-\restorecslist{parser-strict}\yyunion
-
-\def\flexoptionpair#1#2{%
- #1%
- \yystringempty{#2}{% there is no right hand side
- \appendr\opttable{$\nx\langle${\ntt\the\toksa}$\nx\rangle_{\rm f}\,\star$&\cr}%
- }{%
- \toksb\toksa\toksa{}#2%
- \appendr\opttable{$\nx\langle${\ntt\the\toksb}$\nx\rangle_{\rm f}$&\nx\it\the\toksa\nx\/\nx\cr}%
- }%
-}
-
-\def\idit#1#2#3#4{%
- \toksa{#2}%
- \edef\next{\toksa{{%
- \gidxentry{\termfsopstring}{#2}{}%
- \ntt\the\toksa
- }}}\next
-}
-
-\def\stringify#1#2#3#4{\toksa{{\ntt@"#2"}}}
-
-\def\hspace#1#2{}
-
-\toyyunion{table-render:flex-option-definitions}
-
% rule listing macros
\restorecslist{parser-prototypes}\yyunion % we just want to ignore the non-rule related code
-\def\prodheader#1#2#3#4{%
+\defc\prodheader{% a `left-hand side' of a production :: \prodheader{\idit}{\idit}{fptr}{sptr}
#1\relax
\lastlastname\lastname
\setnumname\numname
@@ -1515,14 +1679,14 @@
}
% the macros below are defined in `parser-prototypes'
-%\def\rrhssep#1#2{}
-%\def\arhssep#1#2{}
-%\def\rarhssep#1#2{}
-%\def\hspace#1#2{}
-%\def\prodprodsep{}
-%\def\onesymbol#1#2#3{}
-
-\def\rhs#1#2#3{%
+%\defp\rrhssep#1#2{}
+%\defp\arhssep#1#2{}
+%\defp\rarhssep#1#2{}
+%\defp\hspace#1#2{}
+%\defp\prodprodsep{}
+%\defp\onesymbol#1#2#3{}
+
+\defc\rhs{% a `right-hand side' :: \rhs{[\termname\hspace\rarhssep\arhssep\actbraces]+}{\arhssep|<nothing>}{\ifrhsfull}
\concat\toksa\toksc
\concat\toksb\toksd
#1\relax
@@ -1536,7 +1700,7 @@
\newtoks\lastname
\newtoks\lastlastname
-\def\termname#1#2{%
+\defc\termname{% a production term :: \termname{\idit|\stringify|\charit}{\idit}
\flushact
#1\relax
\lastlastname\lastname
@@ -1551,7 +1715,7 @@
\ifx\next\relax % this is a terminal that was renamed
\expandafter\ifx\csname token\parsernamespace\the\lastname \endcsname\relax % this is probably a symbol from another grammar
\def#1{-1}%
- \errmessage{token \csname token\parsernamespace\the\lastname \endcsname\space is undefined}%
+ \errmessage{token \the\lastname\space is undefined}%
\else
\expandafter\tempca\csname token\parsernamespace\the\lastname \endcsname
\edef#1{\fgetelemof{yytranslate}\at\tempca}%
@@ -1561,7 +1725,7 @@
\fi
}
-\def\actbraces#1#2#3#4#5\bdend{%
+\defc\actbraces{% action braces :: \actbraces{tex_string}{\idit|<nothing>}{fptr}{sptr}directive*\bdend
\flushact
\lastname{}%
#2\relax
@@ -1569,32 +1733,32 @@
\possibleimplicittrue
}
-\def\rules#1#2#3{#1}
+\defc\rules{#1}% a complete right-hand side :: \rules{[\rhs|\rrhssep]}
-\def\oneproduction#1#2#3{#1}
+\defc\oneproduction{#1}% a complete production :: \oneproduction{\prodheader\rules}{fptr}{sptr}
-\def\emptyterm{%
+\defc\emptyterm{%
\flushact
\lastname{}%
}
-\def\stringify#1#2#3#4{%
+\defc\stringify{% *STRING :: \stringify{12string}{tex_string}{fptr}{sptr}
\lastname{"#1"}%
}
-\def\idit#1#2#3#4{%
+\defc\idit{% *ID :: \idit{12string}{tex_string}{fptr}{sptr}
\lastname{#1}%
}
-\def\charit#1#2#3#4{%
+\defc\charit{% *CHAR :: \charit{12string}{tex_string}{fptr}{sptr}
\lastname{'#1'}%
}
-\def\anint#1#2#3{%
+\defc\anint{% INT :: \anint{digits}{fptr}{sptr}
\lastname{#1}%
}
-\def\hexint#1#2#3{%
+\defc\hexint{% INT :: \hexint{0[xX][0-9A-F]+}{fptr}{sptr}
\lastname\expandafter{\expandafter\number\eattwo#1$_{16}$}%
}
@@ -1626,6 +1790,8 @@
\def\prettywordpair#1#2{\prettywordpair@@{#1}{{\ntt@#2}}}
+\newif\ifdisplaytokenraw
+
\def\prettywordpair@#1#2{% a `weak symbol' version of the above macro, so that the new typesetting can be overriden
\setsafe{#1}\toksa{}\numberstocharsandspaces#2\end\expandafter\nameproc\expandafter{\the\toksa}\with\parsebin
\expandafter\edef\csname\prettynamecs\parsernamespace\saferword\endcsname##1{%
@@ -1686,11 +1852,11 @@
\restorecslist{parser-prototypes}\yyunion
-\def\tokendecls#1#2#3{#1}
+\defc\tokendecls{#1}% token declarations :: \tokendecls{[\onesymbol]+}{fptr}{sptr}
-\def\stringify#1#2#3#4{\toksa{"#1"}}
+\defc\stringify{\toksa{"#1"}}% *STRING :: \stringify{12string}{tex_string}{fptr}{sptr}
-\def\idit#1#2#3#4{\toksb{#1}}
+\defc\idit{\toksb{#1}}% *ID :: \idit{12string}{tex_string}{fptr}{sptr}
%\def\anint#1#2#3{\toksc{#1}}% this definition is not needed as all
% the information is extracted from yytname
@@ -1698,7 +1864,7 @@
% note that the definitions below do not handle cases such as
%token '{' "left brace" since the lexer knows how to return '{'
-\def\onesymbol#1#2#3{%
+\defc\onesymbol{%#1#2#3 % a symbol definition :: \onesymbol{\idit}{\anint|\hexint}{\stringify}
\toksa{}\toksb{}%\toksc{}%
#1#2#3%
\yytoksempty\toksa{\expandafter\charstonumbers\the\toksb\end}%
@@ -1712,24 +1878,27 @@
}%
}
-\def\flexsstatedecls#1#2#3{% bootstrap parser does not produce state declarations so it is fine to share states
- \savecslist{local-namespace}\yyunion
- \restorecslist{bootstrap:flex-state-declarations}\yyunion
- #1\relax
- \restorecslist{local-namespace}\yyunion
-}
-
-\let\flexxstatedecls\flexsstatedecls
-
-\savecslist{bootstrap}\yyunion
-
-\restorecslist{parser-strict}\yyunion
+% the original, minimal bootstrapping macros were designed to process
+% \prodstyle{\%token} declarations only and are enough to establish the
+% interface between the \bison\ parser and the \bison\ lexer; to serve
+% the secondary task of providing typesetting information to
+% the \bison\ parser, all forms of token declarations must be processed;
+%
+% note that the bootstrap parser cannot process these additional declarations
+% so these macros are designed to work with a full or prologue parser
+% in a bootstrap mode; see \.{\\modebootstrap} in ldman.w and
+% its use in \.{ldlex.w} and \.{ldgram.w} for an example of such
+% an arrangement.
-\def\idit#1#2#3#4{{\immediate\write\stlist{_register_name(#1);}}}
+\def\precdecls#1#2#3#4#5{#3}
-\def\hspace#1#2{}
+\def\symbolprec#1#2{%
+ \toksa{}\toksb{}%
+ #1%
+ \yytoksempty\toksb{}{\immediate\write\tokendefs{\noexpand\tokenpp{\the\toksb}}}%
+}
-\savecslist{bootstrap:flex-state-declarations}\yyunion
+\savecslist{bootstrap}\yyunion
% correct a few macros for debugging
@@ -1872,7 +2041,7 @@
\def\ignoreexplicitspace{\yyinput}
% the main name processing routine
-% does not have any side effects;
+% does not have any side effects (other than the ones explicitly produced by the final call of #2);
% the parsed term is returned as #1 of the sequence in #2; #2 of #2 will hold a visual key if
% one exists, otherwise it will be empty; #3 is \yyparsefailtrue or empty
% #4 is the prettyfied version of the term if one exists; #5 is the typesetting hint from \visflag sequences;
@@ -2013,12 +2182,24 @@
% \flex\ regex typesetting routine and \flex\ parser value stack types
+\def\flrecharadjust{
+ `{%
+ \yybyte{|}%
+ \expandafter\yycp@\expandafter`\the\yybyte\relax
+ \mkpurebyte
+ \yyreturn
+ }%
+}
+
+% no need for \setspecialcharsfrom\flrecharadjust
+
\def\frexproc#1\with#2{%
{% keeping all changes local
\iftracenames
\toksa{#1}\ferrmessage{original regex: \the\toksa}%
\fi
\toflexreparser
+ \let\acharswitch\flrecharadjust
\basicparserinit
\flexreparserinit
\flexreparserdatainit
@@ -2054,11 +2235,13 @@
\toksc{#2}%
}
-\def\setregextable{%
+\def\setregextable{% activate the appropriate AST control sequences
+ \def\aststream{flex.sect2}% the list where the AST output is gathered
\restorecslist{flexparser-sect2}\yyflunion
}
\def\setregexdeftable{%
+ \def\aststream{flex.sect1}% the list where the AST output is gathered
\restorecslist{flexparser-sect1}\yyflunion
}
@@ -2113,14 +2296,14 @@
\defp\flbracecclneg#1#2#3{} % negative character class :: \flbracecclneg{{fptr}{sptr}}{ccl}{{fptr}{sptr}}
\defp\flcclunion#1#2{} % union of character classes :: \flcclunion{ccl}{ccl}
\defp\flccldiff#1#2{} % difference of character classes :: \flccldiff{ccl}{ccl}
-\defp\flrepeat#1{} % asterisk operation :: \flrepeat{re}
-\defp\flrepeatstrict#1{} % plus operation :: \flrepeatstrict{re}
+\defp\flrepeat#1{} % * (asterisk) operation :: \flrepeat{re}
+\defp\flrepeatstrict#1{} % + (plus) operation :: \flrepeatstrict{re}
\defp\flrepeatonce#1{} % ? operation :: \flrepeatonce{re}
\defp\flrepeatnm#1#2#3{} % {n, m} operation :: \flrepeatnm{re}{num}{num}
\defp\flrepeatgen#1#2{} % {n,} operation :: \flrepeatgen{re}{num}
\defp\flrepeatn#1#2{} % {n} operation :: \flrepeatn{re}{num}
\defp\flparens#1#2#3#4{} % parenthesized regular expression :: \flparens{{fptr}{sptr}}{re}{{fptr}{sptr}}{formatting command}
-\defp\fldot#1#2{} % dot expression :: \fldot{fptr}{sptr}
+\defp\fldot#1#2{} % . (dot) expression :: \fldot{fptr}{sptr}
\defp\flor#1#2{} % `|' expression :: \flor{fptr}{sptr}
\defp\fltrail#1#2{} % regular expression sans trailing suffix :: \fltrail{re}{{fptr}{sptr}}
\defp\flretrail#1#2#3{} % regular expression with a trailing context :: \flretrail{re}{{fptr}{sptr}}{re}
@@ -2397,10 +2580,13 @@ x
}
\defc\fltrail{%#1#2% regular expression sans trailing suffix :: \fltrail{re}{{fptr}{sptr}}
- \errmessage{\nx\fltrail\space macro has not been implemented (see yyunion.sty).}
+ \errmessage{\nx\fltrail\space macro has should not be expanded.}
}
\defc\flretrail{%#1#2#3% regular expression with a trailing context :: \flretrail{re}{{fptr}{sptr}}{re}
+ % #1 is the regular expression to be matched
+ % #2 is the pointer to the context marker (/)
+ % #3 is the context
\errmessage{\nx\flretrail\space macro has not been implemented (see yyunion.sty).}
}
@@ -2412,7 +2598,7 @@ x
\toyyunion{flexparser-re}
\def\flexsndisplay#1{% state name typesetting style
- \hbox{\tt#1}%
+ {\let\ntt@\relax\idss#1}%
}
\def\flexrendisplay#1{% regular expression name typesetting style
@@ -2429,7 +2615,7 @@ x
% the parsed name goes to \toksd and the visual key is put in \tokse
\let\termindex\writeidxfstextentry
\edef\next{\toksd{\nx\flexsndisplay{\the\toksd}%
- \gidxentryxv{\termvstring}{#1}{\the\tokse}}}\next
+ \gidxentryxv{\termfsscstring}{#1}{\the\tokse}}}\next
\expandafter
}\the\toksd
}
@@ -2458,16 +2644,18 @@ x
\hbox{\textretrue\tt\the\toksc}%
}
+% \flex\ section~2 typesetting
+
\defc\flactiongroup{% #1#2#3#4#5#6% a group of \flex actions :: \flactiongroup{\flsconlist...}{fptr}{sptr}{\flaction...}{fptr}{sptr}
\toksb{}#1% collect all the state name information in \toksb
% gather the preceeding stash
- \readstash{#3}% read stash late, after \flsconslist (ignore it)
+ \readstash{#3}% read stash late, after \flsconlist (ignore it)
\edef\next{%
\toksb{\noalign{\hbox to\nx\hsize{\hskip\the\rgindent
- \nx\flexsndisplay{\the\toksb}:\toksa{\relax\the\toksg}\nx\makestashbox\nx\hfil}}}%
+ \nx\flexsndisplay{\the\toksb$^{++}$}\toksa{\relax\the\toksg}\nx\makestashbox\nx\hfil}}}%
}\next
- \yytoksempty\table{}{\appendrnx\table{\noalign{\medskip}}}%
- \concat\table\toksb
+ \astisempty{}{\astappend{\noalign{\medskip}}}%
+ \astappendx{\the\toksb}%
\advance\rgindent by\parindent
#4%
\advance\rgindent by-\parindent
@@ -2475,84 +2663,75 @@ x
\defc\flsconlist{% #1#2#3% start condition list :: \flsconlist{{fptr}{sptr}}{\flname...}{{fptr}{sptr}}
\readstashwredirect#1\toksg % save the stash preceeding the conditions list to reinsert later
+ \savecslist{local-namespace}\yyflunion
+ \restorecslist{flexparser-sect2:state-name-display}\yyflunion
#2% collect the state names (and the stash in between)
+ \restorecslist{local-namespace}\yyflunion
\readstashwredirect#3\toksf
\appendr\toksb{\nx\rm\toksa{\the\toksf}\nx\makestashbox}%
}
-\defc\flname{% #1#2#3#4% name :: \flname{name}{name12}{fptr}{sptr}
- {%
- \let\parsernamespace\flexpseudonamespace
- \nameproc{#2}\with\parsebin
- \edef\next{%
- \toksd{\toksd{\the\toksa}\tokse{\the\toksb}}%
- }\next % a trick to `reshuffle' the output of \nameproc:
- % the parsed name goes to \toksd and the visual key is put in \tokse
- \expandafter
- }\the\toksd
- \let\termindex\writeidxfsentry
- \readstashwredirect{}{#4}\toksf % do not touch \yystashlocal
- \appendr\toksb{{\nx\rm\toksa{\the\toksf}\nx\makestashbox}%
- \the\toksd\gidxentryxv{\termvstring}{#1}{\the\tokse}}%
- \let\termindex\eatone
-}
-
-\defc\flnamesep{%#1#2% separator between names :: \flnamesep{fptr}{sptr}
- \toksb\expandafter{\the\toksb\ }%
-}
-
\newskip\rgindent
-
\rgindent=\parindent
-\defc\flaction{%#1#2#3#4#5#6#7% \flex action :: \flaction{\flsconlist...}{\fl..rule ...}{fptr}{sptr}{fptr}{sptr}{formatting command}
- \toksb{}#1%
+\def\appendinteractionskip{%
+ \ifnum\prevdepth<\dp\strutbox
+ \vskip-\prevdepth\vskip\dp\strutbox
+ \fi
+ \nointerlineskip
+}
+
+\def\flaction@generic#1#2#3#4#5{% #1 is the #1 of \flaction.*
+ % #2 is the #2 of \flaction.*
+ % #3 is the #6 of \flaction.*
+ % #4 is the #7 of \flaction.*
+ % #5 is the \toksa prefix (should be expandable)
+ \toksb{}#1% collect all the state name information in \toksb
\toksc{}#2%
- #7% apply formatting
- \readstash{#6}% read stash late, after \flsconlist and \fl...rule
- \yytoksempty\toksb{%
- \appendr\table{\hskip\the\rgindent\hbox{\nx\tt\nx\strut\the\toksc}}%
- }{%
- \appendr\table{%
+ #4% apply formatting
+ \readstash{#3}% read stash late, after \flsconlist and \fl...rule
+ \yytoksempty\toksb{% no state names were collected
+ \astappendx{\hskip\the\rgindent\hbox{\nx\tt\nx\strut\the\toksc}}%
+ }{% put state names first
+ \astisempty{}{\astappend{\noalign{\medskip}}}%
+ \astappendx{%
+ \noalign{\nx\appendinteractionskip}%
\hskip\the\rgindent
\vbox{%
- {\nx\sscmd\nx\expandafter}\nx\expandafter\baselineskip\nx\the\baselineskip
+ %{\nx\sscmd\nx\expandafter}\nx\expandafter\baselineskip\nx\the\baselineskip
+ % the line above would allow a smaller vertical skip to be inserted in case
+ % the font for state names is reduced in size;
\halign{&####\hfil\cr
- \hbox to\rgindent{\nx\sscmd\nx\tt\nx\strut\the\toksb\hss}\cr
- \nx\tt\nx\strut\the\toksc\cr
+ \flexstatelisttypeset\cr
+ \hskip\parindent\nx\tt\nx\strut\the\toksc\cr
}%
}%
}%
}%
- \appendr\table{&\toksa{\relax\the\yystashlocal}\nx\cr}%
+ \astappendx{&\toksa{#5\relax\the\yystashlocal}\nx\cr}%
}
-\defc\flactionc{%#1#2#3#4#5#6#7% \flex continued action :: \flaction{\flsconlist...}{\fl..rule ...}{fptr}{sptr}{fptr}{sptr}{formatting command}
- \toksb{}#1%
- \toksc{}#2%
- \readstash{#6}% read stash late, after \flsconlist and \fl...rule
- #7% apply formatting
- \yytoksempty\toksb{%
- \appendr\table{\hskip\the\rgindent\hbox{\nx\tt\nx\strut\the\toksc}}%
- }{%
- \appendr\table{%
- \hskip\the\rgindent
- \vbox{%
- {\nx\sscmd\nx\expandafter}\nx\expandafter\baselineskip\nx\the\baselineskip
- \halign{&####\hfil\cr
- \hbox to\rgindent{\nx\sscmd\nx\tt\nx\strut\the\toksb\hss}\cr
- \nx\tt\nx\strut\the\toksc\cr
- }%
- }%
- }%
+\def\flexstatelisttypeset{%
+ \hbox to\rgindent{%
+ \vbox{\advance\hsize by -\rgindent
+ \noindent
+ \nx\strut\nx\flexsndisplay{\the\toksb$^+$}
+ }\hss
}%
- \appendr\table{&\toksa{{}$\nx\hookleftarrow$\relax\the\yystashlocal}\nx\cr}% in the event \cr has been redefined
+}
+
+\defc\flaction{%#1#2#3#4#5#6#7% \flex action :: \flaction{\flsconlist...}{\fl..rule ...}{fptr}{sptr}{fptr}{sptr}{formatting command}
+ \flaction@generic{#1}{#2}{#6}{#7}{}%
+}
+
+\defc\flactionc{%#1#2#3#4#5#6#7% \flex action :: \flaction{\flsconlist...}{\fl..rule ...}{fptr}{sptr}{fptr}{sptr}{formatting command}
+ \flaction@generic{#1}{#2}{#6}{#7}{{}$\nx\hookleftarrow$}%
}
\def\inscomment#1{%
\def\astformat@flaction{%
\toksd{#1}%
- \appendr\table{\noalign{\nx\smallskip\noindent\hskip\the\rgindent
+ \astappendx{\noalign{\nx\smallskip\noindent\hskip\the\rgindent
$\nx\triangleright\;$\the\toksd\nx\smallskip}}%
}%
}
@@ -2561,9 +2740,34 @@ x
\toyyunion{flexparser-sect2}
-% \flex\ setion~1 typesetting
-% currently, all \flex\state declarations are handled by an extended \bison\ parser
-% to collect the state data; we thus only implement regular expression definitions;
+% flex state names display inside action groups
+
+\restorecslist{flexparser-strict}\yyflunion
+
+\defc\flname{% #1#2#3#4% name :: \flname{name}{name12}{fptr}{sptr}
+ {%
+ \let\parsernamespace\flexpseudonamespace
+ \nameproc{#1}\with\parsebin
+ \edef\next{%
+ \toksd{\toksd{\the\toksa}\tokse{\the\toksb}}%
+ }\next % a trick to `reshuffle' the output of \nameproc:
+ % the parsed name goes to \toksd and the visual key is put in \tokse
+ \expandafter
+ }\the\toksd
+ \let\termindex\writeidxfsentry
+ \readstashwredirect{}{#4}\toksf % do not touch \yystashlocal
+ \appendr\toksb{{\nx\rm\toksa{\the\toksf}\nx\makestashbox}%
+ \the\toksd\gidxentryxv{\termfsscstring}{#1}{\the\tokse}}%
+ \let\termindex\eatone
+}
+
+\defc\flnamesep{%#1#2% separator between names :: \flnamesep{fptr}{sptr}
+ \toksb\expandafter{\the\toksb\ }%
+}
+
+\toyyunion{flexparser-sect2:state-name-display}
+
+% \flex\ section~1 typesetting
\restorecslist{flexparser-strict}\yyflunion
@@ -2579,24 +2783,90 @@ x
\expandafter
}\the\toksd
\frexproc{#5}\with\ppregex
- \appendr\table{{}$\nx\langle\hbox{\ntt\the\toksd}\nx\rangle${}%
- \gidxentryxv{\termfsrestring}{#1}{\the\tokse}&\the\toksc\cr% TODO: make a special type processor for regex names
+ \astappendx{{}$\nx\langle\hbox{\ntt\the\toksd}\nx\rangle${}%
+ \gidxentryxv{\termfsrestring}{#1}{\the\tokse}&\the\toksc\cr
}%
\let\termindex\eatone
}
-\defc\flopt{%#1#2#3#4#5% \flex option :: \flopt{option}{text}{text12}{fptr}{sptr}
- \csname flex@ption_#1\endcsname{#2}{#3}%
+% \flex\ options
+
+\defc\floptions{%#1 \flex options :: \floptions{\flopt ...}
+ #1%
+}
+
+\defc\flopt{%#1#2#3#4#5% \flex option :: \flopt{option}{text:(no||opt_name)}{text12}{fptr}{sptr}
+ \expandafter\ifx\csname flex@ption_#1\endcsname\relax
+ \yybreak{%
+ \errmessage{!option <#1> with value (#3) is not handled.}%
+ }%
+ \else
+ \yybreak{%
+ \csname flex@ption_#1\endcsname{#2}{#3}{#4}{#5}%
+ }%
+ \yycontinue
+}
+
+% specific options
+\expandafter\def\csname flex@ption_other\endcsname#1#2#3#4{%
+ \let\termindex\writeidxfsrnentry
+ \storerawidxentry{\tt{\rm(}#1{\rm)}#2}%
+ \astappendx{$\nx\langle${\ntt option}$\nx\rangle_{\nx\rm f}$%
+ \gidxentryxv{\termfsopstring}{option}{option}%
+ \yystringempty{#1}{%
+ \gidxentry{\termttstring}{#2}{#2}% index the <option> keyword
+ }{%
+ \didxentry{\getstackpointer\indexterms}{#2}% index the parameter
+ }%
+ &\nx\quad{\ntt#1#2}\nx\cr}%
+ \let\termindex\empty
+}
+
+\expandafter\def\csname flex@ption_file\endcsname#1#2#3#4{%
+ \let\termindex\writeidxfsrnentry
+ \astappendx{$\nx\langle${\ntt output to}$\nx\rangle_{\nx\rm f}$%
+ \gidxentry{\termfsopstring}{output to}{output to}%
+ \gidxentryxv{\termttstring}{#2}{\eatone#2}% remove the first quote for sorting
+ &\nx\quad{\ntt#1}\nx\cr}%
+ \let\termindex\empty
}
-\expandafter\def\csname flex@ption_deprecated\endcsname#1#2{%
+\expandafter\def\csname flex@ption_header\endcsname#1#2#3#4{%
+ \let\termindex\writeidxfsrnentry
+ \astappendx{$\nx\langle${\ntt header file}$\nx\rangle_{\nx\rm f}$%
+ \gidxentry{\termfsopstring}{header}{header}%
+ \gidxentryxv{\termttstring}{#2}{\eatone#2}% remove the first quote for sorting
+ &\nx\quad{\ntt#1}\nx\cr}%
+ \let\termindex\empty
+}
+
+\expandafter\def\csname flex@ption_prefix\endcsname#1#2#3#4{%
+ \let\termindex\writeidxfsrnentry
+ \astappendx{$\nx\langle${\ntt prefix}$\nx\rangle_{\nx\rm f}$%
+ \gidxentry{\termfsopstring}{prefix}{prefix}%
+ \gidxentry{\termttstring}{#2}{#2}%
+ &\nx\quad{\ntt#1}\nx\cr}%
+ \let\termindex\empty
+}
+
+% the option below processes the parameter in C mode
+\expandafter\def\csname flex@ption_xtype\endcsname#1#2#3#4{%
+ \readstash{#4}%
+ \let\termindex\writeidxfsrnentry
+ \astappendx{$\nx\langle${\ntt extra type}$\nx\rangle_{\nx\rm f}$%
+ \gidxentry{\termfsopstring}{extra type}{extra type}%
+ &\nx\quad{\toksa{\the\yystashlocal}\nx\makestashbox}\nx\cr}%
+ \let\termindex\empty
+}
+
+\expandafter\def\csname flex@ption_deprecated\endcsname#1#2#3#4{%
\flex@opt@deprecated#2%
}
\def\flex@opt@deprecated#1#2#3^^J{%
\let\termindex\writeidxfsrnentry
- \appendr\table{$\langle${\nx\tt #2}$\rangle_{\rm f}$\gidxentryxv{\termfsopstring}{#2}{#2}%
- \the\toksg&\number\flexgetnumber#3.\nx\cr}%
+ \astappendx{$\nx\langle${\ntt #2}$\nx\rangle_{\nx\rm f}$\gidxentry{\termfsopstring}{#2}{#2}%
+ &\number\flexgetnumber#3.\nx\cr}%
\let\termindex\empty
}
@@ -2620,8 +2890,49 @@ x
\yycontinue
}
+\defc\flscondecl{%#1#2#3#4% start condition declarations :: \flscondecl{x|s}{fptr}{sptr}{\flname ...}
+ \readstashwredirect{#2}{#3}\toksg % save the stash preceeding the conditions list to reinsert later
+ \savecslist{local-namespace}\yyflunion
+ \restorecslist{flexparser-sect1:state-name-display}\yyflunion
+ \toksb{}#4% collect the state names (and the stash in between) in \toksb
+ \restorecslist{local-namespace}\yyflunion
+ %\readstashwredirect#3\toksf
+ %\appendr\toksb{\nx\rm\toksa{\the\toksf}\nx\makestashbox}%
+ \let\termindex\writeidxfsentry
+ \astappendx{$\langle${\bf state-#1}$\rangle_{\rm f}$%
+ \gidxentryxv{\termfsopstring}{state-#1}{state-#1}%
+ \nx\quad\nx\flexsndisplay{\the\toksb}\toksa{\relax\the\toksg}\nx\makestashbox\nx\hfil&\nx\cr}%
+}
+
\toyyunion{flexparser-sect1}
+% inside state name declarations
+
+\restorecslist{flexparser-strict}\yyflunion
+
+\defc\flname{% #1#2#3#4% name :: \flname{name}{name12}{fptr}{sptr}
+ {%
+ \let\parsernamespace\flexpseudonamespace
+ \nameproc{#1}\with\parsebin
+ \edef\next{%
+ \toksd{\toksd{\the\toksa}\tokse{\the\toksb}}%
+ }\next % a trick to `reshuffle' the output of \nameproc:
+ % the parsed name goes to \toksd and the visual key is put in \tokse
+ \expandafter
+ }\the\toksd
+ \let\termindex\writeidxfsdentry
+ \readstashwredirect{}{#4}\toksf % do not touch \yystashlocal
+ \appendr\toksb{{\nx\rm\toksa{\the\toksf}\nx\makestashbox}%
+ \the\toksd\gidxentryxv{\termfsscstring}{#1}{\the\tokse}}%
+ \let\termindex\eatone
+}
+
+\defc\flnamesep{%#1#2% separator between names :: \flnamesep{fptr}{sptr}
+ \toksb\expandafter{\the\toksb\ }%
+}
+
+\toyyunion{flexparser-sect1:state-name-display}
+
% correct a few sequences for debugging purposes
\restorecslist{flexparser-debug}\yyflunion
@@ -2651,3 +2962,286 @@ x
}
\toyyunion{flexparser-debug}
+
+\restorecslist{flexparser-prototypes}\yyflunion
+
+\defc\flscondecl{%#1#2#3#4% start condition declarations :: \flscondecl{x|s}{fptr}{sptr}{\flname ...}
+ #4%
+}
+
+\defc\flname{% #1#2#3#4% name :: \flname{name}{name12}{fptr}{sptr}
+ {\immediate\write\stlist{_register_name(#2);}}%
+}
+
+\defc\flnamesep{%#1#2% separator between names :: \flnamesep{fptr}{sptr}
+}
+
+\toyyunion{bootstrap-flex}
+
+% remembering the rule associated with a specific section reference
+
+\newtoks\currentheader
+\newtoks\currentterm
+\newtoks\singlerule
+\newtoks\ruleset
+\newcount\refrulecount
+
+\restorecslist{parser-prototypes}\yyunion % we just want to ignore the non-rule related code
+\def\parserprototypesnamespace{parser-strict:headers} % make sure the prototypes come from the correct namespace
+
+\defc\prodheader{#1\currentheader\currentterm}
+
+% the macros below are defined in `parser-prototypes'
+%\defp\rrhssep#1#2{}
+%\defp\arhssep#1#2{}
+%\defp\rarhssep#1#2{}
+%\defp\prodprodsep{}
+%\defp\onesymbol#1#2#3{}
+
+\defc\rhs{% a `right-hand side' :: \rhs{[\termname\hspace\rarhssep\arhssep\actbraces]+}{\arhssep|<nothing>}{\ifrhsfull}
+ \singlerule{}#1%
+ \savecs{local-namespace}{\_}%
+ \let\_\uscoreletter
+ \saveruleforheader
+ \restorecs{local-namespace}{\_}%
+}
+
+\defc\termname{% a production term :: \termname{\idit|\stringify|\charit}{\idit}
+ #1\appendr\singlerule{\the\currentterm}\yystringempty{#2}{}{#2\appendr\singlerule{[\the\currentterm] }}%
+}
+
+\defc\actbraces{%
+ \readformat{#3}%
+ \actbraces@refinit
+ \readstash{#4}%
+ \savecs{local-namespace}{\format\formatlocal}%
+ \let\format\formatreinsert
+ \let\formatlocal\formatreinsertlocal
+ \the\yyformatlocal
+ \appendr\singlerule{ \nx\{\nx\stashed{\the\yystashlocal}\nx\} }%
+ \expandafter\lookforX\the\yystashlocal\X:\X\end
+ \expandafter\lookforXmark\the\yystashlocal\Xmark:\Xmark\end
+ \restorecs{local-namespace}{\format\formatlocal}%
+}
+
+\let\actbraces@refinit\empty
+
+% sometimes all format hints have to be erased (an example would be when collecting
+% productions marked by \Xmark and omitting an \inline while keeping a \fold)
+\newif\iferaselocalformat
+\newif\iferaseformat
+
+\def\formatreinsert#1{\iferaseformat\else\appendrnx\singlerule{\format{#1}}\fi}
+\def\formatreinsertlocal#1{\iferaselocalformat\else\appendrnx\singlerule{\formatlocal{#1}}\fi}
+
+% macros below (normally) package each production into an individual rule, complete with the header;
+% there are two ways to avoid this (i.e. to package the whole production set for a single lhs):
+% o using the header term for the label (in this case every production for the given lhs will
+% be collected in the appropriate command sequence, see \saveruleforheader below)
+% o using the \Xmark label with the empty name part (e.g. \Xmark label:\Xmark) to mark the
+% productions one wishes to collect for this term; note that the \Xmark mechanism does not
+% verify that the given production is for the same lhs
+
+\def\lookforX#1\X#2:#3\X#4\end{%
+ \yystringempty{#2}{}{%
+ \expandafter\ifx\csname prodrulefor[#2]\endcsname\relax
+ \yybreak{%
+ \expandafter\xdef\csname prodrulefor[#2]\endcsname{\the\currentheader: }%
+ \addtoprodrulefor{#2}{\the\singlerule}%
+ }%
+ \else
+ \yybreak{%
+ \addtoprodrulefor{#2}{\the\currentheader: }%
+ \addtoprodrulefor{#2}{\the\singlerule}%
+ }%
+ \yycontinue
+ \lookforX#4\end
+ }%
+}
+
+\def\lookforXmark#1\Xmark#2:#3\Xmark#4\end{%
+ \yystringempty{#2}{}{%
+ \expandafter\ifx\csname prodrulefor[#2]\endcsname\relax
+ \yybreak{%
+ \expandafter\xdef\csname prodrulefor[#2]\endcsname{\the\currentheader: }%
+ \addtoprodrulefor{#2}{\the\singlerule}%
+ }%
+ \else
+ \yybreak{%
+ \yystringempty{#3}{%
+ \addtoprodrulefor{#2}{|}%
+ }{%
+ \addtoprodrulefor{#2}{\the\currentheader: }%
+ }%
+ \addtoprodrulefor{#2}{\the\singlerule}%
+ }%
+ \yycontinue
+ \lookforXmark#4\end
+ }%
+}
+
+\def\saveruleforheader{%
+ \expandafter\ifx\csname prodrulefor[\the\currentheader]\endcsname\relax
+ \yybreak{%
+ \expandafter\xdef\csname prodrulefor[\the\currentheader]\endcsname{\the\currentheader: \the\singlerule}%
+ }%
+ \else
+ \yybreak{%
+ \addtoprodrulefor{\the\currentheader}{\expandafter|\the\singlerule}%
+ }%
+ \yycontinue
+}
+
+\def\addtoprodrulefor#1#2{%
+ \appendxrt{\gdef}{prodrulefor[#1]}{#2}{}%
+}
+
+\def\mergeformatting#1{%
+ \readformat{#1}%
+ \savecs{local-namespace}{\format\formatlocal}%
+ \let\format\formatreinsert
+ \let\formatlocal\formatreinsertlocal
+ \the\yyformatlocal
+ \restorecs{local-namespace}{\format\formatlocal}%
+}
+
+\defc\rules{#1}
+\defc\oneproduction{#1}
+\defc\emptyterm{\appendr\singlerule{ }}
+\defc\hspace{\appendr\singlerule{ }}
+\defc\stringify{\mergeformatting{#3}\currentterm{"#2"}}
+\defc\idit{\mergeformatting{#3}\currentterm{#2}}
+\defc\charit{\mergeformatting{#3}\currentterm{'#2'}}
+\defc\anint{\mergeformatting{#3}\currentterm{#1}}
+\defc\hexint{\mergeformatting{#3}\currentterm{#1}}
+
+\savecslist{reference:delayed}\yyunion
+
+% using the macros above
+
+\def\extractprodrefs{% this is the command sequence that performs the preprocessing of the
+ % parsed table to set the rule references
+ \restorecslist{reference:delayed}\yyunion
+ \savecs{local-names}{\*}\let\*\empty % in case the name of the section comes from a change file
+ \the\table
+ \restorecs{local-names}{\*}%
+ \resetlistpointer\yystash
+ \resetlistpointer\yyformat
+}
+
+\def\PB@#1{\PB@@#1\end}
+\def\PB@@$#1$\end{#1}
+\def\X@#1:#2\X{#1}
+\def\Xmark#1\Xmark{}
+
+\def\rulerefrequests{} % here we collect all the reference `requests' for the rules
+ % (parts of) which may be defined later in the file
+
+% referencing previously processed rules:
+% #1 is additional setup code (such as \showlastactiontrue)
+% #2 is formatting commands (typical use is to make it \nx\flatten)
+% #3 is a command sequence that expands to the desired section number
+% (the macros just above make is possible to use |@<Section name@>|
+% for that)
+
+\def\rulereferencex#1#2#3{%
+ \begingroup
+ \savecs{local-names}{\PB\X\Xmark}%
+ \let\PB\PB@ \let\X\X@ \let\Xmark\X@
+ \let\textproductionsetup\rulereftextproductionsetup
+ {%
+ \toksa\expandafter{\rulerefrequests}%
+ \edef\rulerefrequests{\the\toksa{#3}}%
+ \expandafter
+ }\expandafter\gdef\expandafter\rulerefrequests\expandafter{\rulerefrequests}%
+ \expandafter\ifx\csname full.prodrulefor[#3]\endcsname\relax
+ \else
+ \expandafter\expandafter\expandafter
+ \singlerule\expandafter\expandafter
+ \expandafter{\csname full.prodrulefor[#3]\endcsname}%
+ \restorecs{local-names}{\PB\X\Xmark}%
+ #1%
+ \edef\next{\nx\beginprod#2\the\singlerule\nx\endprod}\next
+ \fi
+ \endgroup
+}
+
+\def\rulereftextproductionsetup{%
+ \ninepoint
+ \let\returnexplicitspace\splitexplicitspace
+ %\let\acharswitch\texcharadjust
+ %\let\onecharswitch\texcsadjust% we do not need the adjustments
+ %since the names have already gone through the lexer
+ \let\extractprodtableinfo\empty % we do not prepocess the table
+ \let\actionfiller\empty
+ \fillpstack{b}{%
+ \preparsebisongrammar
+ \preparsebisonprologue
+ {\preparsefallbacktext{**}}%
+ \relax % this \relax is necessary so that the braces above
+ % are not stripped by \poppstack
+ }%
+}
+
+\def\rulereference#1#2{\rulereferencex{\showlastactiontrue}{#1}{#2}}
+
+\def\thisrulereference#1{\rulereference{#1}{\secno}}
+
+% we use lazy evaluation for the references: reference requests are collected
+% and put into the auxilary file at the end of the job
+
+\def\lookupruleref#1{%
+ \yystringempty{#1}{}% done
+ {%
+ \expandafter\expandafter\expandafter
+ \toksa
+ \expandafter\expandafter\expandafter{\csname prodrulefor[#1]\endcsname}%
+ \immediate\write\auxstream{\noexpand\getrulereffor{#1}{\the\toksa}}%
+ \lookupruleref
+ }%
+}
+
+\def\yyuniontag{\auxunionctl}
+\defp\gramrefunionctl{}% sequence to activate/deactivate/take other action for
+ % gramref set of macros
+
+\defc\gramrefunionctl{%
+ \restorecslist{aux:global:gramrefs}\gramrefunion
+}
+\savecs{aux:global:activate}\gramrefunionctl
+
+\defc\gramrefunionctl{%
+ \restorecslist{aux:global:gramrefs:neutral}\gramrefunion
+}
+\savecs{aux:global:deactivate}\gramrefunionctl
+
+\defc\gramrefunionctl{% this command should not make any page material contributions
+ \message{gramrefs...}%
+}
+\savecs{aux:global:preend}\gramrefunionctl
+
+\defc\gramrefunionctl{% this command should not make any page material
+ % contributions
+ \message{gramrefs.store...}%
+ \expandafter\lookupruleref\rulerefrequests{}%
+}
+\savecs{aux:global:precutoff}\gramrefunionctl
+
+\defc\gramrefunionctl{% writing a headers, etc.
+ \message{gramrefs.done...}%
+ \toksa\expandafter{\gramrefunion}%
+ \immediate\write\auxstream{\harmlesscomment\the\toksa}%
+}
+\savecs{aux:global:prestart}\gramrefunionctl
+
+\yyuniondeclare\gramrefunion{aux:global:gramrefs}
+
+\defp\getrulereffor#1#2{}
+
+\toyyunion{aux:global:gramrefs:neutral}
+
+\defc\getrulereffor#1#2{%
+ \expandafter\def\csname full.prodrulefor[#1]\endcsname{#2}%
+}
+
+\toyyunion{aux:global:gramrefs} % do nothing for now