summaryrefslogtreecommitdiff
path: root/support/splint/tex/yy.sty
diff options
context:
space:
mode:
Diffstat (limited to 'support/splint/tex/yy.sty')
-rw-r--r--support/splint/tex/yy.sty29
1 files changed, 19 insertions, 10 deletions
diff --git a/support/splint/tex/yy.sty b/support/splint/tex/yy.sty
index 22a7948e9d..96769a0fc5 100644
--- a/support/splint/tex/yy.sty
+++ b/support/splint/tex/yy.sty
@@ -1,4 +1,4 @@
-% Copyright 2012-2014, Alexander Shibakov
+% Copyright 2012-2020, Alexander Shibakov
% This file is part of SPLinT
%
% SPLinT is free software: you can redistribute it and/or modify
@@ -27,14 +27,12 @@
\newwrite\tokendefs
\let\nx\noexpand
-\def\drvname{bo}
-
\input yycommon.sty % general routines for stack and array access
\input yymisc.sty % helper macros (stack manipulation, table processing, value stack pointers)
+ % parser intitialization, optimization
\input yyinput.sty % input functions
\input yyparse.sty % parser machinery
\input flex.sty % lexer functions
-\input yyboth.sty % parser intitialization, optimization
\ifnum\optimization>\tw@
\input yyfaststack.sty
@@ -43,17 +41,31 @@
\input yystype.sty % scanner auxilary types and functions
\input yyunion.sty % parser data structures
+% modify the input routine to recognize \yyendgame; the somewhat verbose end of
+% the section is necessary to gracefully handle parser failures: the \endparse
+% control sequence must appear outside of any \vb block for \cleanupparse
+% to do its job; the \yyinput reads \vb blocks in pairs so the closing \vb{} is
+% 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}}
+
\def\indexpseudonamespace{[index]}
% the main parser
\let\parsernamespace\empty
+% the bootstrapping parser needs the name of the file where token equivalences will appear
+
\def\modebootstrap{%
- \edef\tokendeffile{\drvname.tok}%
+ \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
\def\bootstraplexersetup{\let\yylexreturn\yylexreturnbootstrap}% only return tokens whose value is known at bootstrap
\input yybootstrap.sty%
+ \def\PB##1{}
+ \def\inlineTeXx##1{}
}
\def\modenormal{%
@@ -67,10 +79,7 @@
% \csname ##1\parsernamespace\the##2\endcsname
%}%
\input yyinit.sty%
+ \input yytexlex.sty%
}
-\ifx\modeactive\UNDEFINED
- \def\modeactive{\modenormal}
-\fi
-
-\modeactive
+\input yydebug.sty