summaryrefslogtreecommitdiff
path: root/support/splint/examples/xxpression/xxpression.w
diff options
context:
space:
mode:
Diffstat (limited to 'support/splint/examples/xxpression/xxpression.w')
-rw-r--r--support/splint/examples/xxpression/xxpression.w39
1 files changed, 16 insertions, 23 deletions
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}