<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% Copyright 2012-2024, 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 &lt;http://www.gnu.org/licenses/&gt;.

% 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

\let\nx\noexpand

\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

\ifnum\optimization&gt;\tw@
    \input yyfaststack.sty
\fi

\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).

\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]}

% the main parser

\let\parsernamespace\empty

% the bootstrapping parser needs the name of the file where token equivalences will appear

\def\modebootstrap{%
    \edef\tokendeffile{\jobname.tok}% so that the name of the token file can track the name of the parser
    \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{%
    \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 %
    \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
</pre></body></html>