summaryrefslogtreecommitdiff
path: root/support/splint/tex/grabstates.sty
diff options
context:
space:
mode:
Diffstat (limited to 'support/splint/tex/grabstates.sty')
-rw-r--r--support/splint/tex/grabstates.sty69
1 files changed, 69 insertions, 0 deletions
diff --git a/support/splint/tex/grabstates.sty b/support/splint/tex/grabstates.sty
new file mode 100644
index 0000000000..6fa805168a
--- /dev/null
+++ b/support/splint/tex/grabstates.sty
@@ -0,0 +1,69 @@
+% Copyright 2012-2015, 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/>.
+
+\def\optimization{5}
+
+\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 yyfaststack.sty % sped up stack access functions
+\input yyboth.sty % parser initialization, optimization
+\input yyunion.sty
+
+\genericparser
+ name: main,
+ ptables: cweb/byytab.tex,
+ ltables: cweb/lstab.tex,
+ tokens: {},
+ asetup: \let\setflexstates\relax,
+ dsetup: {},
+ rsetup: {},
+ optimization: \optimizeall;%
+
+\let\parsernamespace\mainnamespace
+\let\yylexreturn\yylexreturnregular
+
+% main section macro
+
+\let\nx\noexpand
+
+\expandafter\def\csname parserstack[b]\endcsname#1#2{%
+ \basicparserinit\yyparse#1\yyeof\yyeof\endparseinput\endparse
+ \ifyyparsefail % do nothing if parsing failed
+ \yybreak{}%
+ \else % Stage three, process the parsed table
+ \yybreak{%
+ \restorecslist{bootstrap}\yyunion
+ \the\table\relax
+ }%
+ \yycontinue
+}
+
+\expandafter\def\csname parserstack[]\endcsname#1#2{%
+ \basicparserinit\yyparse#1\yyeof\yyeof\endparseinput\endparse
+ \ifyyparsefail % do nothing if parsing failed
+ \yybreak{}%
+ \else % Stage three, process the parsed table
+ \yybreak{%
+ \restorecslist{bootstrap}\yyunion
+ \the\table\relax
+ }%
+ \yycontinue
+}
+
+\newwrite\stlist