[9724df0] | 1 | %%
|
---|
| 2 | %% This is file `lstdoc.sty',
|
---|
| 3 | %% generated with the docstrip utility.
|
---|
| 4 | %%
|
---|
| 5 | %% The original source files were:
|
---|
| 6 | %%
|
---|
| 7 | %% listings.dtx (with options: `doc')
|
---|
| 8 | %%
|
---|
| 9 | %% Please read the software license in listings-1.3.dtx or listings-1.3.pdf.
|
---|
| 10 | %%
|
---|
| 11 | %% (w)(c) 1996--2004 Carsten Heinz and/or any other author listed
|
---|
| 12 | %% elsewhere in this file.
|
---|
| 13 | %% (c) 2006 Brooks Moses
|
---|
| 14 | %% (c) 2013- Jobst Hoffmann
|
---|
| 15 | %%
|
---|
| 16 | %% Send comments and ideas on the package, error reports and additional
|
---|
| 17 | %% programming languages to Jobst Hoffmann at <j.hoffmann@fh-aachen.de>.
|
---|
| 18 | %%
|
---|
| 19 | \def\filedate{2015/06/04}
|
---|
| 20 | \def\fileversion{1.6}
|
---|
| 21 | \ProvidesPackage{lstdoc}
|
---|
| 22 | [\filedate\space\fileversion\space(Carsten Heinz)]
|
---|
| 23 | \let\lstdoc@currversion\fileversion
|
---|
| 24 | \RequirePackage[writefile]{listings}[2004/09/07]
|
---|
| 25 | \newif\iffancyvrb \IfFileExists{fancyvrb.sty}{\fancyvrbtrue}{}
|
---|
| 26 | \newif\ifcolor \IfFileExists{color.sty}{\colortrue}{}
|
---|
| 27 | \lst@false
|
---|
| 28 | \newif\ifhyper
|
---|
| 29 | \@ifundefined{pdfoutput}
|
---|
| 30 | {}
|
---|
| 31 | {\ifnum\pdfoutput>\z@ \lst@true \fi}
|
---|
| 32 | \@ifundefined{VTeXversion}
|
---|
| 33 | {}
|
---|
| 34 | {\ifnum\OpMode>\z@ \lst@true \fi}
|
---|
| 35 | \lst@if \IfFileExists{hyperref.sty}{\hypertrue}{}\fi
|
---|
| 36 | \newif\ifalgorithmicpkg \IfFileExists{algorithmic.sty}{\algorithmicpkgtrue}{}
|
---|
| 37 | \newif\iflgrind \IfFileExists{lgrind.sty}{\lgrindtrue}{}
|
---|
| 38 | \iffancyvrb \RequirePackage{fancyvrb}\fi
|
---|
| 39 | \ifhyper \RequirePackage[colorlinks]{hyperref}\else
|
---|
| 40 | \def\href#1{\texttt}\fi
|
---|
| 41 | \ifcolor \RequirePackage{color}\fi
|
---|
| 42 | \ifalgorithmicpkg \RequirePackage{algorithmic}\fi
|
---|
| 43 | \iflgrind \RequirePackage{lgrind}\fi
|
---|
| 44 | \RequirePackage{nameref}
|
---|
| 45 | \RequirePackage{url}
|
---|
| 46 | \renewcommand\ref{\protect\T@ref}
|
---|
| 47 | \renewcommand\pageref{\protect\T@pageref}
|
---|
| 48 | \def\lst@BeginRemark#1{%
|
---|
| 49 | \begin{quote}\topsep0pt\let\small\footnotesize\small#1:}
|
---|
| 50 | \def\lst@EndRemark{\end{quote}}
|
---|
| 51 | \newenvironment{TODO}
|
---|
| 52 | {\lst@BeginRemark{To do}}{\lst@EndRemark}
|
---|
| 53 | \newenvironment{ALTERNATIVE}
|
---|
| 54 | {\lst@BeginRemark{Alternative}}{\lst@EndRemark}
|
---|
| 55 | \newenvironment{REMOVED}
|
---|
| 56 | {\lst@BeginRemark{Removed}}{\lst@EndRemark}
|
---|
| 57 | \newenvironment{OLDDEF}
|
---|
| 58 | {\lst@BeginRemark{Old definition}}{\lst@EndRemark}
|
---|
| 59 | \def\advise{\par\list\labeladvise
|
---|
| 60 | {\advance\linewidth\@totalleftmargin
|
---|
| 61 | \@totalleftmargin\z@
|
---|
| 62 | \@listi
|
---|
| 63 | \let\small\footnotesize \small\sffamily
|
---|
| 64 | \parsep \z@ \@plus\z@ \@minus\z@
|
---|
| 65 | \topsep6\p@ \@plus1\p@\@minus2\p@
|
---|
| 66 | \def\makelabel##1{\hss\llap{##1}}}}
|
---|
| 67 | \let\endadvise\endlist
|
---|
| 68 | \def\advisespace{\hbox{}\qquad}
|
---|
| 69 | \def\labeladvise{$\to$}
|
---|
| 70 | \newenvironment{syntax}
|
---|
| 71 | {\list{}{\itemindent-\leftmargin
|
---|
| 72 | \def\makelabel##1{\hss\lst@syntaxlabel##1,,,,\relax}}}
|
---|
| 73 | {\endlist}
|
---|
| 74 | \def\lst@syntaxlabel#1,#2,#3,#4\relax{%
|
---|
| 75 | \llap{\scriptsize\itshape#3}%
|
---|
| 76 | \def\lst@temp{#2}%
|
---|
| 77 | \expandafter\lst@syntaxlabel@\meaning\lst@temp\relax
|
---|
| 78 | \rlap{\hskip-\itemindent\hskip\itemsep\hskip\linewidth
|
---|
| 79 | \llap{\ttfamily\lst@temp}\hskip\labelwidth
|
---|
| 80 | \def\lst@temp{#1}%
|
---|
| 81 | \ifx\lst@temp\lstdoc@currversion#1\fi}}
|
---|
| 82 | \def\lst@syntaxlabel@#1>#2\relax
|
---|
| 83 | {\edef\lst@temp{\zap@space#2 \@empty}}
|
---|
| 84 | \newcommand*\syntaxnewline{\newline\hbox{}\kern\labelwidth}
|
---|
| 85 | \newcommand*\syntaxor{\qquad or\qquad}
|
---|
| 86 | \newcommand*\syntaxbreak
|
---|
| 87 | {\hfill\kern0pt\discretionary{}{\kern\labelwidth}{}}
|
---|
| 88 | \let\syntaxfill\hfill
|
---|
| 89 | \def\alternative#1{\lst@true \alternative@#1,\relax,}
|
---|
| 90 | \def\alternative@#1,{%
|
---|
| 91 | \ifx\relax#1\@empty
|
---|
| 92 | \expandafter\@gobble
|
---|
| 93 | \else
|
---|
| 94 | \ifx\@empty#1\@empty\else
|
---|
| 95 | \lst@if \lst@false \else $\vert$\fi
|
---|
| 96 | \textup{\texttt{#1}}%
|
---|
| 97 | \fi
|
---|
| 98 | \fi
|
---|
| 99 | \alternative@}
|
---|
| 100 | \long\def\m@cro@#1#2#3{\endgroup \topsep\MacroTopsep \trivlist
|
---|
| 101 | \edef\saved@macroname{\string#3}%
|
---|
| 102 | \def\makelabel##1{\llap{##1}}%
|
---|
| 103 | \if@inlabel
|
---|
| 104 | \let\@tempa\@empty \count@\macro@cnt
|
---|
| 105 | \loop \ifnum\count@>\z@
|
---|
| 106 | \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat
|
---|
| 107 | \edef\makelabel##1{\llap{\vtop to\baselineskip
|
---|
| 108 | {\@tempa\hbox{##1}\vss}}}%
|
---|
| 109 | \advance \macro@cnt \@ne
|
---|
| 110 | \else \macro@cnt\@ne \fi
|
---|
| 111 | \edef\@tempa{\noexpand\item[%
|
---|
| 112 | #1%
|
---|
| 113 | \noexpand\PrintMacroName
|
---|
| 114 | \else
|
---|
| 115 | \expandafter\noexpand\csname Print#2Name\endcsname % MODIFIED
|
---|
| 116 | \fi
|
---|
| 117 | {\string#3}]}%
|
---|
| 118 | \@tempa
|
---|
| 119 | \global\advance\c@CodelineNo\@ne
|
---|
| 120 | #1%
|
---|
| 121 | \SpecialMainIndex{#3}\nobreak
|
---|
| 122 | \DoNotIndex{#3}%
|
---|
| 123 | \else
|
---|
| 124 | \csname SpecialMain#2Index\endcsname{#3}\nobreak % MODIFIED
|
---|
| 125 | \fi
|
---|
| 126 | \global\advance\c@CodelineNo\m@ne
|
---|
| 127 | \ignorespaces}
|
---|
| 128 | \def\macro{\begingroup
|
---|
| 129 | \catcode`\\12
|
---|
| 130 | \MakePrivateLetters \m@cro@ \iftrue {Macro}}% MODIFIED
|
---|
| 131 | \def\environment{\begingroup
|
---|
| 132 | \catcode`\\12
|
---|
| 133 | \MakePrivateLetters \m@cro@ \iffalse {Env}}% MODIFIED
|
---|
| 134 | \def\newdocenvironment#1#2#3#4{%
|
---|
| 135 | \@namedef{#1}{#3\begingroup \catcode`\\12\relax
|
---|
| 136 | \MakePrivateLetters \m@cro@ \iffalse {#2}}%
|
---|
| 137 | \@namedef{end#1}{#4\endmacro}%
|
---|
| 138 | \@ifundefined{Print#2Name}{\expandafter
|
---|
| 139 | \let\csname Print#2Name\endcsname\PrintMacroName}{}%
|
---|
| 140 | \@ifundefined{SpecialMain#2Index}{\expandafter
|
---|
| 141 | \let\csname SpecialMain#2Index\endcsname\SpecialMainIndex}{}}
|
---|
| 142 | \newdocenvironment{aspect}{Aspect}{}{}
|
---|
| 143 | \def\PrintAspectName#1{}
|
---|
| 144 | \def\SpecialMainAspectIndex#1{%
|
---|
| 145 | \@bsphack
|
---|
| 146 | \index{aspects:\levelchar\protect\aspectname{#1}}%
|
---|
| 147 | \@esphack}
|
---|
| 148 | \newdocenvironment{lstkey}{Key}{}{}
|
---|
| 149 | \def\PrintKeyName#1{\strut\keyname{#1}\ }
|
---|
| 150 | \def\SpecialMainKeyIndex#1{%
|
---|
| 151 | \@bsphack
|
---|
| 152 | \index{keys\levelchar\protect\keyname{#1}}%
|
---|
| 153 | \@esphack}
|
---|
| 154 | \newcounter{argcount}
|
---|
| 155 | \def\labelargcount{\texttt{\#\arabic{argcount}}\hskip\labelsep$=$}
|
---|
| 156 | \def\macroargs{\list\labelargcount
|
---|
| 157 | {\usecounter{argcount}\leftmargin=2\leftmargin
|
---|
| 158 | \parsep \z@ \@plus\z@ \@minus\z@
|
---|
| 159 | \topsep4\p@ \@plus\p@ \@minus2\p@
|
---|
| 160 | \itemsep\z@ \@plus\z@ \@minus\z@
|
---|
| 161 | \def\makelabel##1{\hss\llap{##1}}}}
|
---|
| 162 | \def\endmacroargs{\endlist\@endparenv}
|
---|
| 163 | \lst@RequireAspects{writefile}
|
---|
| 164 | \newbox\lst@samplebox
|
---|
| 165 | \lstnewenvironment{lstsample}[3][]
|
---|
| 166 | {\global\let\lst@intname\@empty
|
---|
| 167 | \gdef\lst@sample{#2}%
|
---|
| 168 | \setbox\lst@samplebox=\hbox\bgroup
|
---|
| 169 | \setkeys{lst}{language={},style={},tabsize=4,gobble=5,%
|
---|
| 170 | basicstyle=\small\ttfamily,basewidth=0.51em,point={#1}}
|
---|
| 171 | #3%
|
---|
| 172 | \lst@BeginAlsoWriteFile{\jobname.tmp}}
|
---|
| 173 | {\lst@EndWriteFile\egroup
|
---|
| 174 | \ifdim \wd\lst@samplebox>.5\linewidth
|
---|
| 175 | \begin{center}%
|
---|
| 176 | \hbox to\linewidth{\box\lst@samplebox\hss}%
|
---|
| 177 | \end{center}%
|
---|
| 178 | \lst@sampleInput
|
---|
| 179 | \else
|
---|
| 180 | \begin{center}%
|
---|
| 181 | \begin{minipage}{0.45\linewidth}\lst@sampleInput\end{minipage}%
|
---|
| 182 | \qquad
|
---|
| 183 | \begin{minipage}{0.45\linewidth}%
|
---|
| 184 | \hbox to\linewidth{\box\lst@samplebox\hss}%
|
---|
| 185 | \end{minipage}%
|
---|
| 186 | \end{center}%
|
---|
| 187 | \fi}
|
---|
| 188 | \lst@InstallKeywords{p}{point}{pointstyle}\relax{keywordstyle}{}ld
|
---|
| 189 | \lstnewenvironment{lstxsample}[1][]
|
---|
| 190 | {\begingroup
|
---|
| 191 | \setkeys{lst}{belowskip=-\medskipamount,language={},style={},%
|
---|
| 192 | tabsize=4,gobble=5,basicstyle=\small\ttfamily,%
|
---|
| 193 | basewidth=0.51em,point={#1}}
|
---|
| 194 | \lst@BeginAlsoWriteFile{\jobname.tmp}}
|
---|
| 195 | {\endgroup
|
---|
| 196 | \endgroup}
|
---|
| 197 | \def\lst@sampleInput{%
|
---|
| 198 | \MakePercentComment\catcode`\^^M=10\relax
|
---|
| 199 | \small\lst@sample
|
---|
| 200 | {\setkeys{lst}{SelectCharTable=\lst@ReplaceInput{\^\^I}%
|
---|
| 201 | {\lst@ProcessTabulator}}%
|
---|
| 202 | \leavevmode \input{\jobname.tmp}}\MakePercentIgnore}
|
---|
| 203 | \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
|
---|
| 204 | {1.25ex \@plus1ex \@minus.2ex}%
|
---|
| 205 | {-1em}%
|
---|
| 206 | {\normalfont\normalsize\bfseries}}
|
---|
| 207 | \def\lstref#1{\emph{\ref{#1} \nameref{#1}}}
|
---|
| 208 | \def\@part[#1]#2{\ifhyper\phantomsection\fi
|
---|
| 209 | \addcontentsline{toc}{part}{#1}%
|
---|
| 210 | {\parindent\z@ \raggedright \interlinepenalty\@M
|
---|
| 211 | \normalfont \huge \bfseries #2\markboth{}{}\par}%
|
---|
| 212 | \nobreak\vskip 3ex\@afterheading}
|
---|
| 213 | \renewcommand*\l@section[2]{%
|
---|
| 214 | \addpenalty\@secpenalty
|
---|
| 215 | \addvspace{.25em \@plus\p@}%
|
---|
| 216 | \setlength\@tempdima{1.5em}%
|
---|
| 217 | \begingroup
|
---|
| 218 | \parindent \z@ \rightskip \@pnumwidth
|
---|
| 219 | \parfillskip -\@pnumwidth
|
---|
| 220 | \leavevmode
|
---|
| 221 | \advance\leftskip\@tempdima
|
---|
| 222 | \hskip -\leftskip
|
---|
| 223 | #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
|
---|
| 224 | \endgroup}
|
---|
| 225 | \renewcommand*\l@subsection{\@dottedtocline{2}{0pt}{2.3em}}
|
---|
| 226 | \renewcommand*\l@subsubsection{\@dottedtocline{3}{0pt}{3.2em}}
|
---|
| 227 | \newcommand\ikeyname[1]{%
|
---|
| 228 | \lstkeyindex{#1}{}%
|
---|
| 229 | \lstaspectindex{#1}{}%
|
---|
| 230 | \keyname{#1}}
|
---|
| 231 | \newcommand\ekeyname[1]{%
|
---|
| 232 | \@bsphack
|
---|
| 233 | \lstkeyindex{#1}{}%
|
---|
| 234 | \lstaspectindex{#1}{}%
|
---|
| 235 | \@esphack}
|
---|
| 236 | \newcommand\rkeyname[1]{%
|
---|
| 237 | \@bsphack
|
---|
| 238 | \lstkeyindex{#1}{}%
|
---|
| 239 | \lstaspectindex{#1}{}%
|
---|
| 240 | \@esphack{\rstyle\keyname{#1}}}
|
---|
| 241 | \newcommand\icmdname[1]{%
|
---|
| 242 | \@bsphack
|
---|
| 243 | \lstaspectindex{#1}{}%
|
---|
| 244 | \@esphack\texttt{\string#1}}
|
---|
| 245 | \newcommand\rcmdname[1]{%
|
---|
| 246 | \@bsphack
|
---|
| 247 | \lstaspectindex{#1}{}%
|
---|
| 248 | \@esphack\texttt{\rstyle\string#1}}
|
---|
| 249 | \def\lstaspectindex#1#2{%
|
---|
| 250 | \global\@namedef{lstkandc@\string#1}{}%
|
---|
| 251 | \@ifundefined{lstisaspect@\string#1}
|
---|
| 252 | {\index{unknown\levelchar
|
---|
| 253 | \protect\texttt{\protect\string\string#1}#2}}%
|
---|
| 254 | {\index{\@nameuse{lstisaspect@\string#1}\levelchar
|
---|
| 255 | \protect\texttt{\protect\string\string#1}#2}}%
|
---|
| 256 | }
|
---|
| 257 | \def\lstkeyindex#1#2{%
|
---|
| 258 | }
|
---|
| 259 | \def\lstisaspect[#1]#2{%
|
---|
| 260 | \global\@namedef{lstaspect@#1}{#2}%
|
---|
| 261 | \lst@AddTo\lst@allkeysandcmds{,#2}%
|
---|
| 262 | \@for\lst@temp:=#2\do
|
---|
| 263 | {\ifx\@empty\lst@temp\else
|
---|
| 264 | \global\@namedef{lstisaspect@\lst@temp}{#1}%
|
---|
| 265 | \fi}}
|
---|
| 266 | \gdef\lst@allkeysandcmds{}
|
---|
| 267 | \def\lstprintaspectkeysandcmds#1{%
|
---|
| 268 | \lst@true
|
---|
| 269 | \expandafter\@for\expandafter\lst@temp
|
---|
| 270 | \expandafter:\expandafter=\csname lstaspect@#1\endcsname\do
|
---|
| 271 | {\lst@if\lst@false\else, \fi \texttt{\lst@temp}}}
|
---|
| 272 | \def\lstcheckreference{%
|
---|
| 273 | \@for\lst@temp:=\lst@allkeysandcmds\do
|
---|
| 274 | {\ifx\lst@temp\@empty\else
|
---|
| 275 | \@ifundefined{lstkandc@\lst@temp}
|
---|
| 276 | {\typeout{\lst@temp\space not in reference guide?}}{}%
|
---|
| 277 | \fi}}
|
---|
| 278 | \newcommand*\lst{\texttt{lst}}
|
---|
| 279 | \newcommand*\Cpp{C\texttt{++}}
|
---|
| 280 | \let\keyname\texttt
|
---|
| 281 | \let\keyvalue\texttt
|
---|
| 282 | \let\hookname\texttt
|
---|
| 283 | \newcommand*\aspectname[1]{{\normalfont\sffamily#1}}
|
---|
| 284 | \DeclareRobustCommand\packagename[1]{%
|
---|
| 285 | {\leavevmode\text@command{#1}%
|
---|
| 286 | \switchfontfamily\sfdefault\rmdefault
|
---|
| 287 | \check@icl #1\check@icr
|
---|
| 288 | \expandafter}}%
|
---|
| 289 | \renewcommand\packagename[1]{{\normalfont\sffamily#1}}
|
---|
| 290 | \def\switchfontfamily#1#2{%
|
---|
| 291 | \begingroup\xdef\@gtempa{#1}\endgroup
|
---|
| 292 | \ifx\f@family\@gtempa\fontfamily#2%
|
---|
| 293 | \else\fontfamily#1\fi
|
---|
| 294 | \selectfont}
|
---|
| 295 | \ifcolor
|
---|
| 296 | \definecolor{darkgreen}{rgb}{0,0.5,0}
|
---|
| 297 | \def\rstyle{\color{darkgreen}}
|
---|
| 298 | \else
|
---|
| 299 | \let\rstyle\empty
|
---|
| 300 | \fi
|
---|
| 301 | \gdef\lst@emails{}
|
---|
| 302 | \newcommand*\lstthanks[2]
|
---|
| 303 | {#1\lst@AddTo\lst@emails{,#1,<#2>}%
|
---|
| 304 | \ifx\@empty#2\@empty\typeout{Missing email for #1}\fi}
|
---|
| 305 | \newcommand*\lsthelper[3]
|
---|
| 306 | {{\let~\ #1}%
|
---|
| 307 | \lst@IfOneOf#1\relax\lst@emails
|
---|
| 308 | {}{\typeout{^^JWarning: Unknown helper #1.^^J}}}
|
---|
| 309 | \lstdefinelanguage[doc]{Pascal}{%
|
---|
| 310 | morekeywords={alfa,and,array,begin,boolean,byte,case,char,const,div,%
|
---|
| 311 | do,downto,else,end,false,file,for,function,get,goto,if,in,%
|
---|
| 312 | integer,label,maxint,mod,new,not,of,or,pack,packed,page,program,%
|
---|
| 313 | procedure,put,read,readln,real,record,repeat,reset,rewrite,set,%
|
---|
| 314 | text,then,to,true,type,unpack,until,var,while,with,write,writeln},%
|
---|
| 315 | sensitive=false,%
|
---|
| 316 | morecomment=[s]{(*}{*)},%
|
---|
| 317 | morecomment=[s]{\{}{\}},%
|
---|
| 318 | morestring=[d]{'}}
|
---|
| 319 | \lstdefinestyle{}
|
---|
| 320 | {basicstyle={},%
|
---|
| 321 | keywordstyle=\bfseries,identifierstyle={},%
|
---|
| 322 | commentstyle=\itshape,stringstyle={},%
|
---|
| 323 | numberstyle={},stepnumber=1,%
|
---|
| 324 | pointstyle=\pointstyle}
|
---|
| 325 | \def\pointstyle{%
|
---|
| 326 | {\let\lst@um\@empty \xdef\@gtempa{\the\lst@token}}%
|
---|
| 327 | \expandafter\lstkeyindex\expandafter{\@gtempa}{}%
|
---|
| 328 | \expandafter\lstaspectindex\expandafter{\@gtempa}{}%
|
---|
| 329 | \rstyle}
|
---|
| 330 | \lstset{defaultdialect=[doc]Pascal,language=Pascal,style={}}
|
---|
| 331 | \def\lstscanlanguages#1#2#3{%
|
---|
| 332 | \begingroup
|
---|
| 333 | \def\lst@DefDriver@##1##2##3##4[##5]##6{%
|
---|
| 334 | \lst@false
|
---|
| 335 | \lst@lAddTo\lst@scan{##6(##5),}%
|
---|
| 336 | \begingroup
|
---|
| 337 | \@ifnextchar[{\lst@XDefDriver{##1}##3}{\lst@DefDriver@@##3}}%
|
---|
| 338 | \def\lst@XXDefDriver[##1]{}%
|
---|
| 339 | \lst@InputCatcodes
|
---|
| 340 | \def\lst@dontinput{#3}%
|
---|
| 341 | \let\lst@scan\@empty
|
---|
| 342 | \lst@for{#2}\do{%
|
---|
| 343 | \lst@IfOneOf##1\relax\lst@dontinput
|
---|
| 344 | {}%
|
---|
| 345 | {\InputIfFileExists{##1}{}{}}}%
|
---|
| 346 | \global\let\@gtempa\lst@scan
|
---|
| 347 | \endgroup
|
---|
| 348 | \let#1\@gtempa}
|
---|
| 349 | \def\lstprintlanguages#1{%
|
---|
| 350 | \def\do##1{\setbox\@tempboxa\hbox{##1\space\space}%
|
---|
| 351 | \ifdim\wd\@tempboxa<.5\linewidth \wd\@tempboxa.5\linewidth
|
---|
| 352 | \else \wd\@tempboxa\linewidth \fi
|
---|
| 353 | \box\@tempboxa\allowbreak}%
|
---|
| 354 | \begin{quote}
|
---|
| 355 | \par\noindent
|
---|
| 356 | \hyphenpenalty=\@M \rightskip=\z@\@plus\linewidth\relax
|
---|
| 357 | \lst@BubbleSort#1%
|
---|
| 358 | \expandafter\lst@NextLanguage#1\relax(\relax),%
|
---|
| 359 | \end{quote}}
|
---|
| 360 | \def\lst@NextLanguage#1(#2),{%
|
---|
| 361 | \ifx\relax#1\else
|
---|
| 362 | \def\lst@language{#1}\def\lst@dialects{(#2),}%
|
---|
| 363 | \expandafter\lst@NextLanguage@
|
---|
| 364 | \fi}
|
---|
| 365 | \def\lst@NextLanguage@#1(#2),{%
|
---|
| 366 | \def\lst@temp{#1}%
|
---|
| 367 | \ifx\lst@temp\lst@language
|
---|
| 368 | \lst@lAddTo\lst@dialects{(#2),}%
|
---|
| 369 | \expandafter\lst@NextLanguage@
|
---|
| 370 | \else
|
---|
| 371 | \do{\lst@language
|
---|
| 372 | \ifx\lst@dialects\lst@emptydialect\else
|
---|
| 373 | \expandafter\lst@NormedDef\expandafter\lst@language
|
---|
| 374 | \expandafter{\lst@language}%
|
---|
| 375 | \space(%
|
---|
| 376 | \lst@BubbleSort\lst@dialects
|
---|
| 377 | \expandafter\lst@PrintDialects\lst@dialects(\relax),%
|
---|
| 378 | )%
|
---|
| 379 | \fi}%
|
---|
| 380 | \def\lst@next{\lst@NextLanguage#1(#2),}%
|
---|
| 381 | \expandafter\lst@next
|
---|
| 382 | \fi}
|
---|
| 383 | \def\lst@emptydialect{(),}
|
---|
| 384 | \def\lst@PrintDialects(#1),{%
|
---|
| 385 | \ifx\@empty#1\@empty empty\else
|
---|
| 386 | \lst@PrintDialect{#1}%
|
---|
| 387 | \fi
|
---|
| 388 | \lst@PrintDialects@}
|
---|
| 389 | \def\lst@PrintDialects@(#1),{%
|
---|
| 390 | \ifx\relax#1\else
|
---|
| 391 | , \lst@PrintDialect{#1}%
|
---|
| 392 | \expandafter\lst@PrintDialects@
|
---|
| 393 | \fi}
|
---|
| 394 | \def\lst@PrintDialect#1{%
|
---|
| 395 | \lst@NormedDef\lst@temp{#1}%
|
---|
| 396 | \expandafter\ifx\csname\@lst dd@\lst@language\endcsname\lst@temp
|
---|
| 397 | \texttt{\underbar{#1}}%
|
---|
| 398 | \else
|
---|
| 399 | \texttt{#1}%
|
---|
| 400 | \fi}
|
---|
| 401 | \def\lst@IfLE#1#2\@empty#3#4\@empty{%
|
---|
| 402 | \ifx #1\relax
|
---|
| 403 | \let\lst@next\@firstoftwo
|
---|
| 404 | \else \ifx #3\relax
|
---|
| 405 | \let\lst@next\@secondoftwo
|
---|
| 406 | \else
|
---|
| 407 | \lowercase{\ifx#1#3}%
|
---|
| 408 | \def\lst@next{\lst@IfLE#2\@empty#4\@empty}%
|
---|
| 409 | \else
|
---|
| 410 | \lowercase{\ifnum`#1<`#3}\relax
|
---|
| 411 | \let\lst@next\@firstoftwo
|
---|
| 412 | \else
|
---|
| 413 | \let\lst@next\@secondoftwo
|
---|
| 414 | \fi
|
---|
| 415 | \fi
|
---|
| 416 | \fi \fi
|
---|
| 417 | \lst@next}
|
---|
| 418 | \def\lst@BubbleSort#1{%
|
---|
| 419 | \ifx\@empty#1\else
|
---|
| 420 | \lst@false
|
---|
| 421 | \expandafter\lst@BubbleSort@#1\relax,\relax,%
|
---|
| 422 | \expandafter\lst@BubbleSort@\expandafter,\lst@sorted
|
---|
| 423 | \relax,\relax,%
|
---|
| 424 | \let#1\lst@sorted
|
---|
| 425 | \lst@if
|
---|
| 426 | \def\lst@next{\lst@BubbleSort#1}%
|
---|
| 427 | \expandafter\expandafter\expandafter\lst@next
|
---|
| 428 | \fi
|
---|
| 429 | \fi}
|
---|
| 430 | \def\lst@BubbleSort@#1,#2,{%
|
---|
| 431 | \ifx\@empty#1\@empty
|
---|
| 432 | \def\lst@sorted{#2,}%
|
---|
| 433 | \def\lst@next{\lst@BubbleSort@@}%
|
---|
| 434 | \else
|
---|
| 435 | \let\lst@sorted\@empty
|
---|
| 436 | \def\lst@next{\lst@BubbleSort@@#1,#2,}%
|
---|
| 437 | \fi
|
---|
| 438 | \lst@next}
|
---|
| 439 | \def\lst@BubbleSort@@#1,#2,{%
|
---|
| 440 | \ifx\relax#1\else
|
---|
| 441 | \ifx\relax#2%
|
---|
| 442 | \lst@lAddTo\lst@sorted{#1,}%
|
---|
| 443 | \expandafter\expandafter\expandafter\lst@BubbleSort@@@
|
---|
| 444 | \else
|
---|
| 445 | \lst@IfLE #1\relax\@empty #2\relax\@empty
|
---|
| 446 | {\lst@lAddTo\lst@sorted{#1,#2,}}%
|
---|
| 447 | {\lst@true \lst@lAddTo\lst@sorted{#2,#1,}}%
|
---|
| 448 | \expandafter\expandafter\expandafter\lst@BubbleSort@@
|
---|
| 449 | \fi
|
---|
| 450 | \fi}
|
---|
| 451 | \def\lst@BubbleSort@@@#1\relax,{}
|
---|
| 452 | \endinput
|
---|
| 453 | %%
|
---|
| 454 | %% End of file `lstdoc.sty'.
|
---|