diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/splint/tex/yy.sty |
Initial commit
Diffstat (limited to 'support/splint/tex/yy.sty')
-rw-r--r-- | support/splint/tex/yy.sty | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/support/splint/tex/yy.sty b/support/splint/tex/yy.sty new file mode 100644 index 0000000000..22a7948e9d --- /dev/null +++ b/support/splint/tex/yy.sty @@ -0,0 +1,76 @@ +% Copyright 2012-2014, 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 for typeseting productions + +% these macros carefully orchestrate the startup of the parsing machinery, bootstrapping the parser if +% necessary. they can be used as an example of such macros when different use of the parsing mechanisms +% is desired. + +\ifx\optimization\UNDEFINED % this trick is based on the premise that \UNDEFINED is never defined nor + \def\optimization{0}% created with \csname ... \endcsname +\fi + +\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) +\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 +\fi + +\input yystype.sty % scanner auxilary types and functions +\input yyunion.sty % parser data structures + +\def\indexpseudonamespace{[index]} + +% the main parser + +\let\parsernamespace\empty + +\def\modebootstrap{% + \edef\tokendeffile{\drvname.tok}% + \edef\bstrapparser{byytab.tex}% sets \bootstrapmodetrue + \def\bootstraplexersetup{\let\yylexreturn\yylexreturnbootstrap}% only return tokens whose value is known at bootstrap + \input yybootstrap.sty% +} + +\def\modenormal{% + \def\appendr##1##2{% faster but dirtier + \edef\appnext{##1{\the##1##2}}\appnext + }% + \def\appendl##1##2{% faster but dirtier + \edef\appnext{##1{##2\the##1}}\appnext + }% + %\def\fgetelemof##1\at##2{% speeds up the lookup + % \csname ##1\parsernamespace\the##2\endcsname + %}% + \input yyinit.sty% +} + +\ifx\modeactive\UNDEFINED + \def\modeactive{\modenormal} +\fi + +\modeactive |