<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;.

% token equivalence table does not exist, switch to a bootstrap parser

\newwrite\tokendefs

\ifx\tokendeffile\UNDEFINED
\else
    \immediate\openout\tokendefs=\tokendeffile
\fi

\genericparser 
    name: bootstrap, 
    ptables: \bstrapparser, 
    ltables: cweb/ltab.tex, 
    tokens: \bstraptokens, 
    asetup: \bootstraplexersetup, 
    dsetup: \newlexerstateextra\newparserstateextra, 
    rsetup: {},
    optimization: \optimizeall;%

\tobootstrapparser % this saves the current state

% stage two macros: parsing
% note that the bootstrap parser has no way of telling if the \%token declarations
% belong to the current parser or not (for example, the \flex\ parser has its own 
% declarations); it is thus important to make sure that the \%token declarations in 
% the file visible to the parser belong to a single parser (so the file read by the 
% bootstrap parser does not have declarations sections for a a parser other than 
% \bison's.

\def\preparsebootstrap{%
    \let\postparse\postparsebootstrap
    \tobootstrapparser % this is not currently required since there are no namespace switching macros
                  % in the \TeX\ portion of the text; it is left here in case such macros are used in the future
    \basicparserinit
    \bisonparserinit
    \bisonparserdatainit
    \yyparse
}

\def\postparsebootstrap{%
    \ifyyparsefail % do nothing if parsing failed
        \yybreak{}%
    \else % Stage three, process the parsed table
        \yybreak{\initbootstrap\the\table}%
    \yycontinue
}

\fillpstack{b}{%
    \preparsebootstrap
    \relax
}

% sections with no parser tag are assumed to be bison sections

\fillpstack{}{%
    \preparsebootstrap
    \relax
}

% ignore in text production examples (there is no way to parse them anyway)

\long\def\beginprod#1\endprod{}

\let\begincprod\beginprod

\def\nameproc#1\with#2{%
    #2{}{}{}{}{}% pretend the name is empty
}

\def\frexproc#1\with#2{%
    #2{}{}{}% pretend the regex is empty
}

\def\prodstyle#1{}

\input yydebug.sty
</pre></body></html>