diff options
Diffstat (limited to 'support/splint/tex/yytexlex.sty')
-rw-r--r-- | support/splint/tex/yytexlex.sty | 652 |
1 files changed, 528 insertions, 124 deletions
diff --git a/support/splint/tex/yytexlex.sty b/support/splint/tex/yytexlex.sty index a7e7dc3250..7c149108d3 100644 --- a/support/splint/tex/yytexlex.sty +++ b/support/splint/tex/yytexlex.sty @@ -1,4 +1,4 @@ -% Copyright 2012-2015, Alexander Shibakov +% Copyright 2012-2020, Alexander Shibakov % This file is part of SPLinT % % SPLinT is free software: you can redistribute it and/or modify @@ -40,7 +40,7 @@ \appendyybyte} = {% - \appendr\texlinetoks{{}${}={}${}}% + \appendrnx\texlinetoks{{}${}={}${}}% \yygetchar } \{ @@ -62,12 +62,12 @@ \else \def\next{^^A}% \fi - \action\next\in\texdefaultstate + \switchon\next\in\texdefaultstate } ^^A % \yycp@==1 {% \edef\next{\noexpand\noexpand\the\yybyte}% - \action\next\in\texdefaultstate} + \switchon\next\in\texdefaultstate} \raw\hbox\raw {% \appendnext} @@ -151,14 +151,14 @@ \yycp@=`\\% \putother\yycp@\in\yybyte \def\next{escape}% - \action\next\in\currentstate} + \switchon\next\in\currentstate} } \def\texescdefault{% \let\currentstate\esccurrentstate \yycp@=`\ % \yybyte{\ }% - \action\yycp@\in\currentstate + \caction\yycp@\in\currentstate } \def\getcescape{% @@ -189,37 +189,42 @@ \fi \fi \fi - \action\next\in\currentstate + \switchonwithtype\next\in\currentstate } \def\outputtexcs{% - \expandafter\ifx\csname\the\yytext\defTpostfix\endcsname\relax - \putother{`\\}\in\toksa + \expandafter\ifx\csname\defprefix\the\yytext\defpostfix\endcsname\relax + %\putother{`\\}\in\toksa + \toksa{\hbox{\sixpoint\tt\char`\\}}% \concat\texlinetoks\toksa \concat\texlinetoks\yytext - \appendr\texlinetoks{\noexpand\hbox{$\noexpand\,$}}% + \appendrnx\texlinetoks{\hbox{$\,$}}% + \toksb{}% no visual key \else - \appendr\texlinetoks{\expandafter\expandafter\expandafter\noexpand\expandafter\csname\the\yytext xTeXmode\endcsname}% + \appendr\texlinetoks{\expandafter\noexpand\csname\defprefix\the\yytext\defpostfix\endcsname}% + \expandafter\ifx\csname\restorecsxname{index:visual}{.\the\yytext}\endcsname\relax + \toksb{}% no visual key + \else + \toksb\expandafter\expandafter\expandafter{\csname\restorecsxname{index:visual}{.\the\yytext}\endcsname}% + \fi \fi - \appendr\texidxtoks{% - \termindex{{\nx\nx\nx\texcsstring{\expandafter\charstonumberse\the\yytext\end}}{\texnspace}{\nx\the\pageno}{\secno}}% - }% + \appendr\texidxtoks{\gidxentryxb{\texcsstring}{\the\yytext}{\the\toksb}}% } -% the `calling conventions' for indexing \TeX\ control sequences are too different to use canned indexing macros -% (the second parameter is a register so it has to be expanded before the \charstonumberse processes it) -% we therefore invoke the macros by hand +% indexing of \TeX\ control sequences \def\texidxdomain{T} \def\texcsidxrank{2} +\def\texcstxtidxrank{5} -\def\writetexidxentry#1{\iftermindex\write\gindex{\nx\nx\expandafter\nx\csname\texidxdomain TI\endcsname\texcsidxrank#1}\fi} +\def\writetexidxentry#1{\indxe\gindex{{\secno}{{}{\texispace}}{\texidxdomain}{\texcsidxrank}#1}} +\def\writetextxtidxentry#1{\indxe\gindex{{\secno}{{}{\texispace}}{\texidxdomain}{\texcstxtidxrank}#1}} \def\appendyybyte{\concat\texlinetoks\yybyte\yygetchar} \def\appendnext#1{\toksa{#1}\concat\texlinetoks\toksa\yygetchar} -\def\defTpostfix{xTeXmode} +\def\defTpostfix{[xTeXmode]} \def\stripyybyte{% \expandafter\stripyyb@te\the\yybyte @@ -239,57 +244,69 @@ \newif\iftracetexpp \newtoks\textoks +% the most common way for a \TeX? macro to appear in in the input is being inserted by +% \CWEB\ itself; in this case \CWEB\ makes sure that the macro is expanded in math mode; +% this assumption is relied upon in the design of these macros, and violating it may +% result in sume rather puzzling error messages, resulting from the insertion of +% \ignorespaces outside of the current group; the warning macro below makes this +% dependence explicit. + +\def\TeXxwarn{% + \relax + \ifmmode + \else + \errhelp{Check stash collecting macros.}% + \errmessage{\nx\\TeXx macro is used outside of math mode.}% + \fi +} + \def\TeXx(#1)#2;{% TODO - \let\oldttdot\.\relaxcweb - \textoks{}\let\.\dotcollect + \TeXxwarn + {}$\let\oldttdot\.\relaxcweb + \let\.\dotcollect + \textoks{}% #1% \restorecweb\let\.\oldttdot - \expandafter\T@Xx\the\textoks} + \expandafter\T@Xx\the\textoks + {}${}\aftergroup\ignorespaces} \def\mypar{\par} \def\TeXb(#1)#2;{% TeX material begin - {}$% + \TeXxwarn + {}$\let\oldttdot\.\relaxcweb + \toksa{}\let\.\dotcollectb + \textoks{}% \let\oldsix\6% \let\6\ignorespaces \let\oldC\C \let\C\saveCcomments - \let\oldttdot\.\relaxcweb - \textoks{}\toksa{}\let\.\dotcollectb #1% \restorecweb\let\.\oldttdot \dotcollectstripquotes - ${}} + ${}\aftergroup\ignorespaces} \def\TeXa(#1)#2;{% TeX material add - {}$% - \let\oldttdot\.\relaxcweb + \TeXxwarn + {}$\let\oldttdot\.\relaxcweb \toksa{}\let\.\dotcollectb #1% \restorecweb\let\.\oldttdot \dotcollectstripquotes - ${}} + ${}\aftergroup\ignorespaces} \def\TeXf(#1)#2;{% TeX material add - {}$% - \let\oldttdot\.\relaxcweb + \TeXxwarn + {}$\let\oldttdot\.\relaxcweb \toksa{}\let\.\dotcollectb \textoks\expandafter{\the\textoks\hbox{\6}}% #1% \restorecweb\let\.\oldttdot \dotcollectstripquotes - ${}} - -\def\TeXo(#1)#2;{% TeX material output - \let\oldttdot\.\relaxcweb - \let\.\dotcollect - \let\6\oldsix - \let\C\oldC - #1% - \restorecweb\let\.\oldttdot - $\expandafter\T@Xx\expandafter"\the\textoks"$} + ${}\aftergroup\ignorespaces} \def\TeXao(#1)#2;{% TeX material output + \TeXxwarn {}$\let\oldttdot\.\relaxcweb \toksa{}\let\.\dotcollectb \let\6\oldsix @@ -297,9 +314,11 @@ #1% \restorecweb\let\.\oldttdot \dotcollectstripquotes - $\expandafter\T@Xx\expandafter"\the\textoks"${}${}} + \expandafter\T@Xx\expandafter + "\the\textoks"{}${}\aftergroup\ignorespaces} \def\TeXfo(#1)#2;{% TeX material output + \TeXxwarn {}$\let\oldttdot\.\relaxcweb \toksa{}\let\.\dotcollectb \textoks\expandafter{\the\textoks\hbox{\6}}% @@ -308,11 +327,14 @@ #1% \restorecweb\let\.\oldttdot \dotcollectstripquotes - $\expandafter\T@Xx\expandafter"\the\textoks"${}${}} + \expandafter\T@Xx\expandafter + "\the\textoks"{}${}\aftergroup\ignorespaces} \let\TeXxi\TeXx -\def\inlineTeXx#1{$\TeXxi(\.{"#1"});$} % for indexing macros - +\def\inlineTeXx#1{$\let\writetexidxentry\writetextxtidxentry\TeXxi(\.{"#1"});$} % for indexing macros +\def\TeXlit{\iffalse{\fi}{\setbox0\lastbox}\removewhitespace + \expandafter\.\expandafter{\iffalse}\fi} % to help with \CWEB's @t...@> cleanup + % e.g.\ |TeXao(@t\TeXlit"\hbox{\TeX\ stuff}"@>);| \def\dotcollect#1{\toksa{#1}\concat\textoks\toksa} \def\dotcollectb#1{\toksb{#1}\concat\toksa\toksb} \def\dotcollectstripquotes{\expandafter\d@tcollectstripquotes\the\toksa} @@ -322,7 +344,6 @@ \def\restorecweb{\restorecs{local-namespace}{\)}} \def\T@Xx"#1"{% - {}${}%$ \iffalse{\fi % alignment! \begingroup % tune up the standard input routines @@ -336,17 +357,17 @@ \texlinetoks{}\texidxtoks{}\bbalance\z@ \let\bbal\bbalempty \yytextbackupfalse + \let\defpostfix\defTpostfix\let\defprefix\empty \restorecsxlist\texnspace\alltexsymbols \let\termindex\writetexidxentry \yygetchar#1\end - \toksc{#1}% \iftracetexpp{\newlinechar=`^^J% - \errmessage{TeX_ input: \the\toksc^^JTeX_ first pass: \the\texlinetoks}}\fi + \toksc{#1}\ferrmessage{TeX_ input: \the\toksc^^JTeX_ first pass: \the\texlinetoks}}\fi \ifnum\bbalance=\z@ \else - \bbbalance + \bbbalance{#1}% \fi - \iftracetexpp\errmessage{TeX_ final pass: \the\texlinetoks}\fi + \iftracetexpp\ferrmessage{TeX_ final pass: \the\texlinetoks}\fi \concat\texlinetoks\texidxtoks \expandafter \endgroup @@ -356,24 +377,35 @@ % otherwise there is a risk that an output routine is called before % the group is complete and \yyreturn definition is wrong so \yyparse % will not be able to function - \expandafter\texlinetoks\expandafter{\the\texlinetoks}% - \let\bbal\bbalempty\bbalance\z@ - \restorecsxlist\texnspace\alltexsymbols - \let\termindex\writetexidxentry\tt\chardef\_=`\_\the\texlinetoks + \expandafter\T@Xpretypeset\the\texlinetoks \endgroup \iffalse}\fi - {}${}%$ +} + +\def\T@Xpretypeset{% + \let\bbal\bbalempty\bbalance\z@ + \let\defpostfix\defTpostfix\let\defprefix\empty + \restorecsxlist\texnspace\alltexsymbols + \tt\chardef\_=`\_% } \def\alltexsymbols{% - \space\toksa\toksb\toksc\tokse\toksf\the\ifx\ifnum\fi\else - \def\edef\let\empty\next\switchon\in\concat\appendr\default - \noexpand\emptyterm\print\relax\yy\inmath\omit\hfil\getfirst - \getsecond\getthird\getfourth\getfifth\nx\to\hspace\toksd\rhscont - \rhscnct\rhsbool\table\ifrhsfull\rhsfulltrue\rhsfullfalse - \yyval\tempca\tempcb\z@\@ne\tw@\m@ne\advance\ifcat\iftracebadchars - \bb\yylexreturnptr\yylexreturn\yylexreturnval\yylexreturnchar - \yylexreturntext\yylexnext + \space\toksa\toksb\toksc\toksd\tokse\toksf\toksg\toksh\the\ifx + \ifnum\fi\else\def\edef\let\empty\next\switchon\in\concat\appendr + \default\noexpand\emptyterm\print\relax\yy\inmath\omit\hfil\getfirst + \getsecond\getthird\getfourth\getfifth\nx\to\hspace\rhscont\rhscnct + \rhsbool\table\ifrhsfull\rhsfulltrue\rhsfullfalse\yyval\tempca + \tempcb\z@\@ne\tw@\m@ne\advance\ifcat\iftracebadchars\bb + \yylexreturnptr\yylexreturn\yylexreturnval\yylexreturnsym + \yylexreturnchar\yylexreturnxchar\yylexreturntext\yylexnext + \%\harmlesscomment\\\yyfatal\yywarn\yyBEGIN\yypushstate\yypopstate + \yyBEGINr\yylexstate\yypdeprecated +} + +% TODO: make this the mechanism for updating \alltexsymbols + +\def\extendcs#1\with#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% } \def\collectspaces#1{% @@ -394,23 +426,34 @@ \def\spacecontainer{\ } \def\texnspace{texline} +\def\texvspace{texvisline} +\def\texispace{index} \let\defpostfix\defTpostfix \let\defprefix\empty -\let\defypreamble\empty % for indexing macros -\def\defypostamble{ {\rm(\.{\\\thisnamex})}} - \let\settgroup\relax \defx\space{\hbox{$\,$\char`\ $\,$}}{texline} +\defy\space{\hbox{$\,$\char`\ $\,$}}{index} -\defx\hspace{\hbox{$\,$\char`\ $\,$}}{texline} +\defx\hspace{% somewhat precarious definition + \hbox{\char`\ }% + \def\setegroup{{}$\,${}}% + \def\setpgr@up{^{\hbox{\sscmd\the\toksa}}\,$}% + \def\setegr@up{\,$}% + \def\setpgroup{% + ${}_{\hbox{\sscmd\the\toksa}}% + \let\setpgroup\setpgr@up + \let\setegroup\setegr@up + \grabbalanced + }\grabbalanced +}{texline} \defy\hspace{\hbox{$\,$\char`\ $\,$}}{index} \defx\advance{% - $\mathop{\hbox{\bf add}}{}$% + $\mathop{\hbox{\bf add}}$% }{texline} \defy\advance{% @@ -425,6 +468,8 @@ $0_{\rm R}$% }{index} +\defx\z@{0_R}{index:visual} + \defx\@ne{% $\,1_{\rm R}\,$% }{texline} @@ -433,6 +478,8 @@ $1_{\rm R}$% }{index} +\defx\@ne{1_R}{index:visual} + \defx\tw@{% $\,2_{\rm R}\,$% }{texline} @@ -441,6 +488,8 @@ $2_{\rm R}$% }{index} +\defx\tw@{2_R}{index:visual} + \defx\m@ne{% $\,-1_{\rm R}\,$% }{texline} @@ -449,151 +498,208 @@ $-1_{\rm R}$% }{index} +\defx\m@ne{-1_R}{index:visual} + \defx\tempca{% - ${}t_a{}$% + $t_a$% }{texline} \defy\tempca{% $t_a$% }{index} +\defx\tempca{t_a}{index:visual} + \defx\tempcb{% - ${}t_b{}$% + $t_b$% }{texline} \defy\tempcb{% $t_b$% }{index} +\defx\tempcb{t_b}{index:visual} + \defx\toksa{% - {}${}v_a{}${}% + {}$v_a${}% \def\setegroup{}% \def\setpgroup{% $\leftarrow\langle\,\hbox{\the\toksa}% \if\next]% \else - \rangle% + \,\rangle% \fi $}\grabbalanced }{texline} +\defx\toksa{va}{index:visual} + \defy\toksa{% - ${}v_a{}$% + $v_a$% }{index} \defx\toksb{% - {}${}v_b{}${}% + {}$v_b${}% \def\setegroup{}% \def\setpgroup{% $\leftarrow\langle\,\hbox{\the\toksa}% \if\next]% \else - \rangle% + \,\rangle% \fi $}\grabbalanced }{texline} +\defx\toksb{vb}{index:visual} + \defy\toksb{% - ${}v_b{}$% + $v_b$% }{index} \defx\toksc{% - {}${}v_c{}${}% + {}$v_c${}% \def\setegroup{}% \def\setpgroup{% $\leftarrow\langle\,\hbox{\the\toksa}% \if\next]% \else - \rangle% + \,\rangle% \fi $}\grabbalanced }{texline} +\defx\toksc{vc}{index:visual} + \defy\toksc{% - ${}v_c{}$% + $v_c$% }{index} \defx\toksd{% - {}${}v_d{}${}% + {}$v_d${}% \def\setegroup{}% \def\setpgroup{% $\leftarrow\langle\,\hbox{\the\toksa}% \if\next]% \else - \rangle% + \,\rangle% \fi $}\grabbalanced }{texline} +\defx\toksd{vd}{index:visual} + \defy\toksd{% - ${}v_d{}$% + $v_d$% }{index} \defx\tokse{% - {}${}v_e{}${}% + {}$v_e${}% \def\setegroup{}% \def\setpgroup{% $\leftarrow\langle\,\hbox{\the\toksa}% \if\next]% \else - \rangle% + \,\rangle% \fi $}\grabbalanced }{texline} +\defx\tokse{ve}{index:visual} + \defy\tokse{% - ${}v_e{}$% + $v_e$% }{index} \defx\toksf{% - {}${}v_f{}${}% + {}$v_f${}% \def\setegroup{}% \def\setpgroup{% $\leftarrow\langle\,\hbox{\the\toksa}% \if\next]% \else - \rangle% + \,\rangle% \fi $}\grabbalanced }{texline} +\defx\toksf{vf}{index:visual} + \defy\toksf{$v_f$}{index} +\defx\toksg{% + {}$v_g${}% + \def\setegroup{}% + \def\setpgroup{% + $\leftarrow\langle\,\hbox{\the\toksa}% + \if\next]% + \else + \,\rangle% + \fi + $}\grabbalanced +}{texline} + +\defx\toksg{vg}{index:visual} + +\defy\toksg{$v_g$}{index} + +\defx\toksh{% + {}$v_h${}% + \def\setegroup{}% + \def\setpgroup{% + $\leftarrow\langle\,\hbox{\the\toksa}% + \if\next]% + \else + \,\rangle% + \fi + $}\grabbalanced +}{texline} + +\defx\toksh{vh}{index:visual} + +\defy\toksh{$v_h$}{index} + \defx\yyval{% - {}${}\Upsilon{}${}% + {}$\Upsilon${}% \def\setegroup{}% \def\setpgroup{% $\leftarrow\langle\,\the\toksa \if\next]% \else - \rangle% + \,\rangle% \fi $}\grabbalanced }{texline} \defy\yyval{% - ${}\Upsilon{}$% + $\Upsilon$% }{index} -\def\setflexreturn#1{% - \def\setegroup{{\bf return}#1}% +\defx\yyval{Y}{index:visual} + +\def\setcfreturn#1{% more flexible return statement + \def\setegroup{{}$\mathop{\hbox{#1}}${}}% + \let\settgroup\setegroup \def\setpgroup{% {% - \let\texidxdomain\bisonidxdomain - \tokse\toksa - \expandafter\nameproc\expandafter{\the\toksa}% + \let\termindex\writeidxentry % the indexed term is a \bison\ token + \toksc\toksa + \expandafter\nameproc\expandafter{\the\toksa}\with\parsebin \ifyyparsefail \edef\next{\toksa{\termmetastyle{% - \expandafter\gidxentry\expandafter{\expandafter\termvstring\expandafter}\expandafter{\the\toksa}% + \gidxentryxb{\termvstring}{\the\toksa}{}% \let\nx\idxfont\nx\empty\nx\tt\the\toksa\nx\/% }}}\next \else - \expandafter\settermstyle\expandafter{\the\tokse}% + \edef\next{\noexpand\settermstyle{\the\toksb}{\the\toksc}}\next \fi - {}$\mathop{\hbox{{\bf return}#1}}\hbox{\the\toksa}${}}% + {}$\mathop{\hbox{#1}}\hbox{\the\toksa}${}}% }\grabbalanced } +\def\setflexreturn#1{% + \setcfreturn{{\bf return}#1}% +} + \defx\yylexreturnptr{% \setflexreturn{$_p${}}% }{texline} @@ -602,14 +708,28 @@ {\bf return$_p$}% }{index} +\defx\yylexreturnptr{return_p}{index:visual} + +\defx\yylexreturnxchar{% + \setflexreturn{$_x${}}% +}{texline} + +\defy\yylexreturnxchar{% + \hbox{\bf return$_x$}% +}{index} + +\defx\yylexreturnxchar{return_x}{index:visual} + \defx\yylexreturnchar{% - {\bf return$_c$}% + \hbox{\bf return$_c$}% }{texline} \defy\yylexreturnchar{% - {\bf return$_c$}% + \hbox{\bf return$_c$}% }{index} +\defx\yylexreturnchar{return_c}{index:visual} + \defx\yylexnext{% {\bf continue}% }{texline} @@ -618,6 +738,8 @@ {\bf continue}% }{index} +\defx\yylexnext{continue}{index:visual} + \defx\yylexreturn{% \setflexreturn{$_l${}}% }{texline} @@ -626,6 +748,8 @@ {\bf return$_l$}% }{index} +\defx\yylexreturn{return_l}{index:visual} + \defx\yylexreturnval{% \setflexreturn{$_v${}}% }{texline} @@ -634,6 +758,18 @@ {\bf return$_v$}% }{index} +\defx\yylexreturnval{return_v}{index:visual} + +\defx\yylexreturnsym{% + \setflexreturn{$_{vp}${}}% +}{texline} + +\defy\yylexreturnsym{% + {\bf return$_{vp}$}% +}{index} + +\defx\yylexreturnsym{return_vp}{index:visual} + \defx\yylexreturntext{% {\bf return$_t$}% }{texline} @@ -642,10 +778,90 @@ {\bf return$_t$}% }{index} -\defx\table{{}${}\Omega{}${}}{texline} +\defx\yylexreturntext{return_t}{index:visual} + +\defx\xcclreturn{% + \setcfreturn{\bf set $\Upsilon$ {\rm and} return$^{\rm ccl}$}% +}{texline} + +\defy\xcclreturn{% + {\bf set $\Upsilon$ {\rm and} return$^{\rm ccl}$}% +}{index} + +\defx\xcclreturn{set U return^ccl}{index:visual} + +\defx\yyflexoptreturn{% + \setflexreturn{$^{\rm opt}$}% +}{texline} + +\defy\yyflexoptreturn{% + {\bf return$^{\rm opt}$}% +}{index} + +\defx\yyflexoptreturn{return^opt}{index:visual} + +\extendcs\alltexsymbols\with{\xcclreturn\yyflexoptreturn} + +\defx\yyfatal{% + {}$\mathop{\bf fatal}${}% + \def\setegroup{}% + \def\setpgroup{% + $\langle\,\hbox{\the\toksa}% + \if\next]% + \else + \,\rangle% + \fi$% + }\grabbalanced +}{texline} + +\defx\yyfatal{fatal}{index:visual} + +\defy\yyfatal{% + {\bf fatal}% +}{index} + +\defx\yywarn{% + {}$\mathop{\bf warn}${}% + \def\setegroup{}% + \def\setpgroup{% + $\langle\,\hbox{\the\toksa}% + \if\next]% + \else + \,\rangle% + \fi$% + }\grabbalanced +}{texline} + +\defx\yywarn{warn}{index:visual} + +\defy\yywarn{% + {\bf warn}% +}{index} + +\defx\yypdeprecated{% + {}$\mathop{\bf deprecated}${}% + \def\setegroup{}% + \def\setpgroup{% + $\langle\,\hbox{\the\toksa}% + \if\next]% + \else + \,\rangle% + \fi$% + }\grabbalanced +}{texline} + +\defx\yypdeprecated{deprecated}{index:visual} + +\defy\yypdeprecated{% + {\bf deprecated}% +}{index} + +\defx\table{{}$\Omega${}}{texline} \defy\table{$\Omega$}{index} +\defx\table{Omega}{index:visual} + \defx\relax{\hbox{$\circ$}}{texline} \defy\relax{\hbox{$\circ$}}{index} @@ -662,6 +878,8 @@ \lcenclose{$\cdot$}% }{index} +\defx\the{val}{index:visual} + \def\thecomaction{% \raw \toksaxTeXmode\toksbxTeXmode\tokscxTeXmode\toksdxTeXmode\toksexTeXmode\toksfxTeXmode \raw {% @@ -728,10 +946,18 @@ {\bf else$\;$}% }{texline} +\defy\else{% + {\bf else}% +}{index} + \defx\fi{% {\bf fi$\;$}% }{texline} +\defy\fi{% + {\bf fi}% +}{index} + \defx\def{% {\bf def$\;$}% }{texline} @@ -748,6 +974,8 @@ {\bf def$_{\rm x}$}% }{index} +\defx\edef{def_x}{index:visual} + \defx\let{% {\bf let$\;$}% }{texline} @@ -808,6 +1036,10 @@ ${}\mapsto{}$% }{texline} +\defy\to{% + $\mapsto$% +}{index} + \defx\emptyterm{% \hbox{$\ulcorner\ldots\urcorner$}% }{texline} @@ -840,6 +1072,8 @@ $\Upsilon\kern-1pt{}_{\rm?}$% }{index} +\defx\yy{Y_?}{index:visual} + \def\seeknots#1\bbal{% \let\setegroup\relax \ifnum#1>0\relax @@ -904,6 +1138,8 @@ ${}_{\rm?}\kern-2pt\Upsilon$% }{index} +\defx\bb{Y_??}{index:visual} + \defx\switchon{% \hbox{\bf switch$\;$}% \def\setpgroup{{$($}\the\toksa{$)$}$\,$}% @@ -948,7 +1184,7 @@ \defx\getfirst{% - {}${}\pi_1${}% + {}$\pi_1${}% \def\setegroup{\relax}% \def\setpgroup{% ${}(\hbox{\the\toksa}% @@ -960,14 +1196,16 @@ }{texline} \defy\getfirst{% - ${}\pi_1$% + $\pi_1$% }{index} +\defx\getfirst{pi_1}{index:visual} + \defx\getsecond{% - {}${}\pi_2${}% + {}$\pi_2${}% \def\setegroup{\relax}% \def\setpgroup{% - ${}(\hbox{\the\toksa}% + $(\hbox{\the\toksa}% \if\next]% \else )% @@ -976,11 +1214,13 @@ }{texline} \defy\getsecond{% - ${}\pi_2$% + $\pi_2$% }{index} +\defx\getsecond{pi_2}{index:visual} + \defx\getthird{% - {}${}\pi_3${}% + {}$\pi_3${}% \def\setegroup{\relax}% \def\setpgroup{% ${}(\hbox{\the\toksa}% @@ -992,14 +1232,16 @@ }{texline} \defy\getthird{% - ${}\pi_3$% + $\pi_3$% }{index} +\defx\getthird{pi_3}{index:visual} + \defx\getfourth{% - {}${}\pi_4${}% + {}$\pi_4${}% \def\setegroup{\relax}% \def\setpgroup{% - ${}(\hbox{\the\toksa}% + $(\hbox{\the\toksa}% \if\next]% \else )% @@ -1008,14 +1250,16 @@ }{texline} \defy\getfourth{% - ${}\pi_4$% + $\pi_4$% }{index} +\defx\getfourth{pi_4}{index:visual} + \defx\getfifth{% - {}${}\pi_5${}% + {}$\pi_5${}% \def\setegroup{\relax}% \def\setpgroup{% - ${}(\hbox{\the\toksa}% + $(\hbox{\the\toksa}% \if\next]% \else )% @@ -1024,11 +1268,13 @@ }{texline} \defy\getfifth{% - ${}\pi_5$% + $\pi_5$% }{index} +\defx\getfifth{pi_5}{index:visual} + \defx\rhscont{% - {}${}\pi_{\{\}}${}% + {}$\pi_{\{\}}${}% \def\setegroup{\relax}% \def\setpgroup{% ${}(\hbox{\the\toksa}% @@ -1040,11 +1286,13 @@ }{texline} \defy\rhscont{% - ${}\pi_{\{\}}$% + $\pi_{\{\}}$% }{index} +\defx\rhscont{pi_brace}{index:visual} + \defx\rhscnct{% - {}${}\pi_{\leftrightarrow}${}% + {}$\pi_{\leftrightarrow}${}% \def\setegroup{\relax}% \def\setpgroup{% ${}(\hbox{\the\toksa}% @@ -1056,11 +1304,13 @@ }{texline} \defy\rhscnct{% - ${}\pi_{\leftrightarrow}$% + $\pi_{\leftrightarrow}$% }{index} +\defx\rhscnct{pi_arrow}{index:visual} + \defx\rhsbool{% - {}${}\pi_{\vdash}${}% + {}$\pi_{\vdash}${}% \def\setegroup{\relax}% \def\setpgroup{% ${}(\hbox{\the\toksa}% @@ -1072,9 +1322,53 @@ }{texline} \defy\rhsbool{% - ${}\pi_{\vdash}$% + $\pi_{\vdash}$% +}{index} + +\defx\rhsbool{pi_implies}{index:visual} + +\defx\%{% + {\.{\harmlesscomment}}% +}{texline} + +\defy\%{% + {\.{\harmlesscomment}}\let\defypostamble\relax% }{index} +\defx\%{\%}{index:visual} + +\defx\harmlesscomment{% + {\.{\harmlesscomment}}% +}{texline} + +\defy\harmlesscomment{% + {\.{\harmlesscomment}}\let\defypostamble\relax% +}{index} + +\defx\harmlesscomment{\%}{index:visual} + +\defx\\{% + {\.{\\}}% +}{texline} + +\defy\\{% + {\.{\\}}\let\defypostamble\relax% +}{index} + +\defx\\{\\}{index:visual} + +\defx\lbchar{% + \.{\{}% +}{texline} + +\defy\lbchar{% + \.{\{}% +}{index} + +\expandafter\defx\expandafter\lbchar\expandafter{\lbchar lbchar}{index:visual} + +\extendcs\alltexsymbols\with\lbchar + \def\bbalempty[#1]#2{% \ifx#2]\relax \else @@ -1089,7 +1383,7 @@ \fi }% -\def\bbbalance{% +\def\bbbalance#1{% \ifnum\bbalance>0 \loop \advance\bbalance-1\relax @@ -1107,14 +1401,14 @@ \tempca-\bbalance \bbalance\tempca \texlinetoks{}\texidxtoks{}% - \expandafter\yygetchar\the\toksc\end + \yygetchar#1\end % \errmessage{\the\texlinetoks...\the\toksd...\the\bbalance}% - \appendl\texlinetoks{\the\toksd}% + \concatl\toksd\texlinetoks \fi } \def\grabbalanced{% - \futurelet\next\gr@bbalanced + \futurelet\next\gr@bbalanced } \def\gr@bbalanced{% @@ -1143,3 +1437,113 @@ \fi \next } + +\defx\yyBEGIN{% + \def\setegroup{{\bf enter}}% + \def\setpgroup{% + {% + \let\parsernamespace\flexpseudonamespace + \expandafter\nameproc\expandafter{\the\toksa}\with\parsebin + \edef\next{% + \toksd{\toksd{\the\toksa}\tokse{\the\toksb}}% + }\next % a trick to `reshuffle' the output of \nameproc: + % the parsed name goes to \toksd and the visual key is put in \tokse + \expandafter + }\the\toksd + \let\termindex\writeidxfsentry + \edef\next{{}$\nx\mathop{\hbox{\nx\bf enter}}(\hbox{\the\toksd})${}% + \gidxentryxb{\termvstring}{\the\toksa}{\the\tokse}}\next + \let\termindex\eatone + }\grabbalanced +}{texline} + +\defy\yyBEGIN{% + {\bf enter}% +}{index} + +\defx\yyBEGIN{enter}{index:visual} + +\defx\yyBEGINr{% + {\bf enter$_x\,$}% +}{texline} + +\defy\yyBEGINr{% + {\bf enter$_x$}% +}{index} + +\defx\yyBEGINr{enter_x}{index:visual} + +\defx\yypushstate{% + \def\setegroup{{\bf push state}}% + \def\setpgroup{% + {% + \let\parsernamespace\flexpseudonamespace + \expandafter\nameproc\expandafter{\the\toksa}\with\parsebin + \edef\next{% + \toksd{\toksd{\the\toksa}\tokse{\the\toksb}}% + }\next % a trick to `reshuffle' the output of \nameproc: + % the parsed name goes to \toksd and the visual key is put in \tokse + \expandafter + }\the\toksd + \let\termindex\writeidxfsentry + \edef\next{{}$\nx\mathop{\hbox{\nx\bf push state}}(\hbox{\the\toksd})\,${} + \gidxentryxb{\termvstring}{\the\toksa}{\the\tokse}}\next + \let\termindex\eatone + }\grabbalanced +}{texline} + +\defy\yypushstate{% + {\bf push state}% +}{index} + +\defx\yypushstate{push\_state}{index:visual} + +\defx\yypopstate{% + \def\setegroup{{\bf pop state}}% + \def\setpgroup{% + {% + \let\parsernamespace\flexpseudonamespace + \expandafter\nameproc\expandafter{\the\toksa}\with\parsebin + \edef\next{% + \toksd{\toksd{\the\toksa}\tokse{\the\toksb}}% + }\next % a trick to `reshuffle' the output of \nameproc: + % the parsed name goes to \toksd and the visual key is put in \tokse + \expandafter + }\the\toksd + \let\termindex\writeidxfsentry + \edef\next{{}$\nx\mathop{\hbox{\nx\bf pop state}}(\hbox{\the\toksd})\,${} + \gidxentryxb{\termvstring}{\the\toksa}{\the\tokse}}\next + \let\termindex\eatone + }\grabbalanced +}{texline} + +\defy\yypopstate{% + {\bf pop state}% +}{index} + +\defx\yypopstate{pop state}{index:visual} + +\defx\yylexstate{% + \def\setegroup{{\bf state}}% + \def\setpgroup{% + {% + \let\parsernamespace\flexpseudonamespace + \expandafter\nameproc\expandafter{\the\toksa}\with\parsebin + \edef\next{% + \toksd{\toksd{\the\toksa}\tokse{\the\toksb}}% + }\next % a trick to `reshuffle' the output of \nameproc: + % the parsed name goes to \toksd and the visual key is put in \tokse + \expandafter + }\the\toksd + \let\termindex\writeidxfsentry + \edef\next{{}$\nx\mathop{\hbox{\nx\bf state}}(\hbox{\the\toksd})\,${}% + \gidxentryxb{\termvstring}{\the\toksa}{\the\tokse}}\next + \let\termindex\eatone + }\grabbalanced +}{texline} + +\defy\yylexstate{% + {\bf state}% +}{index} + +\defx\yylexstate{state}{index:visual} |