diff options
Diffstat (limited to 'support/splint/examples/xxpression')
-rw-r--r-- | support/splint/examples/xxpression/Makefile | 8 | ||||
-rw-r--r-- | support/splint/examples/xxpression/xtoks.sty | 3 | ||||
-rw-r--r-- | support/splint/examples/xxpression/xxpression.sty | 2 | ||||
-rw-r--r-- | support/splint/examples/xxpression/xxpression.w | 39 | ||||
-rw-r--r-- | support/splint/examples/xxpression/xymmap.sty | 5 |
5 files changed, 23 insertions, 34 deletions
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 |