%%
%% This is file `listings.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% listings.dtx  (with options: `kernel')
%% 
%% (w)(c) 1996-1998 Carsten Heinz
%% 
%% Please read the software license in listings.dtx or listings.dvi.
%% 
%% This file is distributed freely. You are not allowed to take money for
%% the distribution of this file, except for a nominal charge for copying
%% etc..
%% 
%% This file is free for any non-commercial use. Commercial use needs (i)
%% explicit permission of the author of this package and (ii) the payment
%% of a license fee. This fee is to be determined in each instance by the
%% commercial user and the package author and is to be payed as donation
%% to the LaTeX3 project.
%% 
%% This file is distributed without any warranty, express or implied, as
%% to merchantability or fitness for any particular purpose.
%% 
%% Permission is granted to change this file. You are not allowed to
%% distribute any changed version this file, neither under the same name
%% nor under a different one.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{listings}[1998/11/09 v0.19 by Carsten Heinz]
\RequirePackage{keyval}
\DeclareOption{0.17}{\@namedef{lst@0.17}{}}
\DeclareOption{index}{\@namedef{lst@index}{}}
\DeclareOption{procnames}{\@namedef{lst@prockeywords}{}}
\DeclareOption{ndkeywords}{\@namedef{lst@ndkeywords}{}}
\DeclareOption{rdkeywords}{\@namedef{lst@rdkeywords}{}}
\DeclareOption{doc}{\@namedef{lst@doc}{}}
\ProcessOptions
\def\lst@ReplaceIn#1#2{%
    \bgroup \global\let\@gtempa#1%
    \lst@ReplaceIn@#2\@empty\@empty %
    \egroup \let#1\@gtempa}
\def\lst@ReplaceIn@#1#2{%
    \ifx\@empty#2\else %
        \let#2=a%
        \def\lst@temp##1#1##2{##1%
            \ifx\@empty##2\else %
                #2\expandafter\lst@temp %
            \fi ##2}%
        \xdef\@gtempa{\expandafter\lst@temp\@gtempa#1\@empty}%
        \expandafter\lst@ReplaceIn@ %
    \fi}
\def\lst@DeleteKeysIn#1#2{%
    \bgroup \global\let\@gtempa#1%
    \let\lst@dollar=A\let\lst@minus=B\let\lst@underscore=C%
    \expandafter\lst@DeleteKeysIn@#2,\relax,%
    \egroup \let#1\@gtempa}
\def\lst@DeleteKeysIn@#1,{%
    \ifx\relax#1\@empty %
        \expandafter\@gobble %
    \else %
        \ifx\@empty#1\@empty\else %
            \def\lst@temp##1,#1##2{##1\ifx\@empty##2\else %
                \ifx,##2\else #1\fi \expandafter\lst@temp\fi ##2}%
            \xdef\@gtempa{%
                \expandafter\lst@temp\expandafter,\@gtempa,#1\@empty}%
        \fi %
    \fi %
    \lst@DeleteKeysIn@}
\def\lst@IfNextChars#1#2#3{%
    \let\lst@tofind#1\def\@tempa{#2}\def\@tempb{#3}%
    \let\lst@eaten\@empty \lst@IfNextChars@}
\def\lst@IfNextChars@#1{%
    \lst@lAddTo\lst@eaten{#1}%
    \expandafter\lst@IfNextChars@@\lst@tofind\relax %
    \ifx #1\lst@temp %
        \ifx\lst@tofind\@empty %
            \let\lst@next\@tempa %
        \else %
            \let\lst@next\lst@IfNextChars@ %
        \fi %
        \expandafter\lst@next %
    \else %
        \expandafter\@tempb %
    \fi}
\def\lst@IfNextChars@@#1#2\relax{\let\lst@temp#1\def\lst@tofind{#2}}
\def\lst@IfNextCharsArg#1#2#3{%
    \lst@MakeActive{#1}\let\lst@tofind\lst@arg %
    \def\@tempa{#2}\def\@tempb{#3}%
    \let\lst@eaten\@empty \lst@IfNextChars@}
\def\lst@MakeActive#1{%
    \let\lst@arg\@empty \lst@MakeActive@#1%
    \relax\relax\relax\relax\relax\relax\relax\relax\relax}
\begingroup
\catcode`\^^@=\active \catcode`\^^A=\active \catcode`\^^B=\active %
\catcode`\^^C=\active \catcode`\^^D=\active \catcode`\^^E=\active %
\catcode`\^^F=\active \catcode`\^^G=\active \catcode`\^^H=\active %
\gdef\lst@MakeActive@#1#2#3#4#5#6#7#8#9{\let\lst@next\relax %
    \ifx#1\relax %
    \else \lccode`\^^@=`#1%
    \ifx#2\relax %
        \lowercase{\lst@lAddTo\lst@arg{^^@}}%
    \else \lccode`\^^A=`#2%
    \ifx#3\relax %
        \lowercase{\lst@lAddTo\lst@arg{^^@^^A}}%
    \else \lccode`\^^B=`#3%
    \ifx#4\relax %
        \lowercase{\lst@lAddTo\lst@arg{^^@^^A^^B}}%
    \else \lccode`\^^C=`#4%
    \ifx#5\relax %
        \lowercase{\lst@lAddTo\lst@arg{^^@^^A^^B^^C}}%
    \else \lccode`\^^D=`#5%
    \ifx#6\relax %
        \lowercase{\lst@lAddTo\lst@arg{^^@^^A^^B^^C^^D}}%
    \else \lccode`\^^E=`#6%
    \ifx#7\relax %
        \lowercase{\lst@lAddTo\lst@arg{^^@^^A^^B^^C^^D^^E}}%
    \else \lccode`\^^F=`#7%
    \ifx#8\relax %
        \lowercase{\lst@lAddTo\lst@arg{^^@^^A^^B^^C^^D^^E^^F}}%
    \else \lccode`\^^G=`#8%
    \ifx#9\relax %
        \lowercase{\lst@lAddTo\lst@arg{^^@^^A^^B^^C^^D^^E^^F^^G}}%
    \else \lccode`\^^H=`#9%
        \lowercase{\lst@lAddTo\lst@arg{^^@^^A^^B^^C^^D^^E^^F^^G^^H}}%
        \let\lst@next\lst@MakeActive@ %
    \fi \fi \fi \fi \fi \fi \fi \fi \fi %
    \lst@next}
\endgroup
\def\lst@IfNextCharActive#1#2#3{%
    \bgroup \lccode`\~=`#3\lowercase{\egroup %
    \ifx~}#3%
        \def\lst@next{#1#3}%
    \else %
        \def\lst@next{#2#3}%
    \fi \lst@next}
\def\lstenv@AddArg#1{\lstenv@AddArg@#1 \@empty}
\begingroup \lccode`\~=`\ \relax \lowercase{%
\gdef\lstenv@AddArg@#1 #2{%
    \lst@MakeActive{#1}%
    \ifx\@empty#2\expandafter%
        \lst@lAddTo\expandafter\lstenv@arg\expandafter{\lst@arg}%
    \else \expandafter%
        \lst@lAddTo\expandafter\lstenv@arg\expandafter{\lst@arg~}%
        \expandafter\lstenv@AddArg@ %
    \fi #2}
}\endgroup
\def\lst@Aspect#1{%
    \@ifundefined{KV@lst@#1}%
        {\let\lst@ifnew\iftrue}{\let\lst@ifnew\iffalse}%
    \lst@ifnew %
    \else %
        \expandafter\@gobblefour %
    \fi %
    \lstdefine@key{lst}{#1}}
\def\lstdefine@key#1#2{%
    \@ifnextchar[{\lstKV@def{#1}{#2}}{\global\@namedef{KV@#1@#2}####1}}
\def\lstKV@def#1#2[#3]{%
    \global\@namedef{KV@#1@#2@default\expandafter}\expandafter %
        {\csname KV@#1@#2\endcsname{#3}}%
    \global\@namedef{KV@#1@#2}##1}
\let\lst@ifnew\iftrue % init
\def\lst@AddToHook#1{%
    \lst@ifnew %
        \@ifundefined{lsthk@#1}{%
            \expandafter\gdef\csname lsthk@#1\endcsname{}}{}%
        \def\lst@next{\lst@AddToHook@\lst@AddTo{#1}}%
        \expandafter\lst@next %
    \else %
        \expandafter\@gobble %
    \fi}
\long\def\lst@AddToHook@#1#2#3{%
    \expandafter#1\csname lsthk@#2\endcsname{#3}}
\def\lst@AddToHookAtTop#1{%
    \lst@ifnew %
        \@ifundefined{lsthk@#1}{%
            \expandafter\gdef\csname lsthk@#1\endcsname{}}{}%
        \def\lst@next{\lst@AddToHook@\lst@AddToAtTop{#1}}%
        \expandafter\lst@next %
    \else %
        \expandafter\@gobble %
    \fi}
\long\def\lst@AddTo#1#2{%
    \expandafter\gdef\expandafter#1\expandafter{#1#2}}
\def\lst@AddToAtTop#1#2{\def\lst@temp{#2}%
    \expandafter\expandafter\expandafter\gdef %
    \expandafter\expandafter\expandafter#1%
    \expandafter\expandafter\expandafter{\expandafter\lst@temp#1}}
\def\lst@lAddTo#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
\global\let\lsthk@OutputOther\@empty
\global\let\lsthk@SetStyle\@empty
\global\let\lsthk@SetLanguage\@empty
\global\let\lsthk@PreSet\@empty
\global\let\lsthk@PostSet\@empty
\def\lstKV@SetIfKey#1#2{\lstKV@SetIfKey@#1#2\relax}
\def\lstKV@SetIfKey@#1#2#3\relax{\lowercase{%
    \expandafter\let\expandafter#1%
        \csname \ifx #2t}iftrue\else iffalse\fi\endcsname}
\def\lstKV@OptArg#1[#2]#3{\lstKV@OptArg@{#1}{#2}#3\@}
\def\lstKV@OptArg@#1#2{%
    \@ifnextchar[{\lstKV@OptArg@@{#1}}%
                 {\lstKV@OptArg@@{#1}[#2]}}
\def\lstKV@OptArg@@#1[#2]#3\@{#1[#2]{#3}}
\def\lstset#1{\lsthk@PreSet\setkeys{lst}{#1}\lsthk@PostSet}
\newcount\lst@mode
\def\lst@EnterMode#1#2{%
    \bgroup \lst@mode=#1\relax #2%
    \lst@lAddTo\lst@entermodes{\lst@EnterMode{#1}{#2}}}
\def\lst@LeaveMode{\egroup\lsthk@EndGroup}
\lst@AddToHook{InitVars}{\let\lst@entermodes\@empty}
\def\lst@NewMode#1{%
    \ifx\@undefined#1%
        \global\mathchardef#1=\lst@newmode\relax %
        \lst@mode=\lst@newmode\relax \advance\lst@mode\@ne %
        \edef\lst@newmode{\the\lst@mode}%
    \fi}
\def\lst@newmode{0}
\lst@NewMode\lst@nomode
\lst@AddToHook{InitVars}{\lst@modefalse \lst@mode\lst@nomode}
\lst@NewMode\lst@Pmode
\def\lst@modetrue{\let\lst@ifmode\iftrue}
\def\lst@modefalse{\let\lst@ifmode\iffalse}
\def\lst@InterruptModes{%
    \ifx\lst@entermodes\@empty\else %
        \global\let\lst@reenter\lst@entermodes %
        \lst@LeaveAllModes %
    \fi}
\def\lst@ReenterModes{%
    \ifx\lst@reenter\@empty\else %
        \lst@LeaveAllModes \lst@reenter %
        \global\let\lst@reenter\@empty %
    \fi}
\lst@AddToHook{InitVars}{\global\let\lst@reenter\@empty}
\def\lst@LeaveAllModes{%
    \ifnum\lst@mode=\lst@nomode %
        \expandafter\lsthk@EndGroup %
    \else %
        \expandafter\egroup\expandafter\lst@LeaveAllModes %
    \fi}
\lst@AddToHook{ExitVars}{\lst@LeaveAllModes}
\lst@NewMode\lst@egroupmode
\lst@AddToHook{EOL}
    {\ifnum\lst@mode=\lst@egroupmode \lst@LeaveMode \fi}
\def\lst@Normalize#1{%
    \lowercase\expandafter{\expandafter\edef\expandafter#1%
    \expandafter{\expandafter\zap@space#1 \@empty}}}
\newcommand\lstdefinestyle[2]{%
    \def\lst@temp{lststy@#1}\lst@Normalize\lst@temp %
    \global\@namedef\lst@temp{\setkeys{lst}{#2}}}
\lst@Aspect{style}
    {\def\lst@temp{lststy@#1}\lst@Normalize\lst@temp %
     \@ifundefined\lst@temp %
        {\PackageError{Listings}{Style `#1' undefined}%
         {You might have misspelt the name here or before.^^J%
          Type <RETURN> to proceed without changing the style.}}%
        {\lsthk@SetStyle \csname\lst@temp\endcsname %
        }}
\newcommand\lstdefinelanguage[3][]{%
    \def\@tempa{#2@#1}\lst@Normalize\@tempa %
    \global\@namedef{lstlang@\@tempa}{\lstset{#3}}}
\newcommand\lstdefinedrvlanguage[3][]{%
    \def\@tempa{lstlang@#2@#1}\lst@Normalize\@tempa %
    \ifx\@tempa\lst@requested %
        \global\@namedef{\@tempa}{\lstset{#3}}%
    \fi}
\def\lstloadlanguages#1{\lstloadlanguages@#1,\relax,}
\def\lstloadlanguages@#1,{%
    \ifx\relax#1\@empty \else %
        \lstKV@OptArg\lstloadlanguages@@[]{#1}%
        \expandafter\lstloadlanguages@ %
    \fi}
\def\lstloadlanguages@@[#1]#2{%
    \lst@LocateLanguage[#1]{#2}%
    \@ifundefined{\lst@requested}%
        {{\catcode`\^^M=9\catcode`\"=12\makeatletter %
          \input{\lst@driver.sty}}}%
        {}}
\@onlypreamble\lstloadlanguages
\lst@Aspect{language}{\lstKV@OptArg\lstlanguage@[]{#1}}
\def\lstlanguage@[#1]#2{%
    \lst@LocateLanguage[#1]{#2}%
    \@ifundefined{\lst@requested}%
        {{\catcode`\^^M=9\catcode`\"=12\makeatletter %
          \input{\lst@driver.sty}}}{}%
    \@ifundefined{\lst@requested}%
        {\PackageError{Listings}%
         {\ifx\@empty\lst@dialect@\else \lst@dialect@\space of \fi %
          \lst@language@\space undefined}{The driver file is not
          loadable or doesn't support the language.^^J%
         Type <RETURN> to proceed without changing the language.}}%
        {\lsthk@SetLanguage %
         \csname\lst@requested\endcsname %
         \def\lst@language{#1}\lst@Normalize\lst@language %
         \def\lst@dialect{#2}\lst@Normalize\lst@dialect}}
\lst@Aspect{defaultdialect}{\lstKV@OptArg\lstdefaultdialect@[]{#1}}
\def\lstdefaultdialect@[#1]#2{%
    \def\lst@temp{#2}\lst@Normalize\lst@temp %
    \global\@namedef{lstdd@\lst@temp}{#1}}
\newcommand\lstalias{\@ifnextchar[{\lstalias@}{\lstalias@@}}
\def\lstalias@[#1]#2[#3]#4{%
    \def\lst@temp{lsta@#2@#1}\lst@Normalize\lst@temp %
    \global\@namedef{\lst@temp}{#4@#3}}
\def\lstalias@@#1#2{%
    \def\lst@temp{lstaa@#1}\lst@Normalize\lst@temp %
    \global\@namedef{\lst@temp}{#2}}
\def\lst@DriverLocation#1#2{%
    \def\lst@temp{lstloc@#1}\lst@Normalize\lst@temp %
    \expandafter\gdef\csname\lst@temp\endcsname{#2}%
    \expandafter\lst@Normalize\csname\lst@temp\endcsname}
\def\lst@LocateLanguage[#1]#2{%
    \def\lst@language@{#2}\lst@Normalize\lst@language@ %
    \@ifundefined{lstaa@\lst@language@}{}%
        {\edef\lst@language@{\csname lstaa@\lst@language@\endcsname}%
         \lst@Normalize\lst@language@}%
    \def\lst@dialect@{#1}%
    \ifx\@empty\lst@dialect@ %
        \@ifundefined{lstdd@\lst@language@}{}%
            {\expandafter\let\expandafter\lst@dialect@ %
             \csname lstdd@\lst@language@\endcsname}%
    \fi %
    \lst@Normalize\lst@dialect@ %
    \edef\lst@requested{\lst@language@ @\lst@dialect@}%
    \@ifundefined{lsta@\lst@requested}{}%
        {\expandafter\let\expandafter\lst@requested %
         \csname lsta@\lst@requested\endcsname %
         \lst@Normalize\lst@requested}%
    \expandafter\lst@LocateLanguage@\lst@requested\relax}
\def\lst@LocateLanguage@#1@#2\relax{%
    \edef\lst@driver{\@ifundefined{lstloc@#1}{lst#1}%
        {\csname lstloc@#1\endcsname}}%
    \ifx\@empty#2\@empty %
        \@ifundefined{lstdd@#1}%
            {\def\lst@dialect@{#2}}%
            {\expandafter\let\expandafter\lst@dialect@ %
             \csname lstdd@#1\endcsname}%
    \fi %
    \edef\lst@requested{lstlang@#1@\lst@dialect@}%
    \lst@Normalize\lst@requested}
\newcount\lst@lineno \global\lst@lineno\@ne % \global
\lst@AddToHook{InitVars}
    {\global\lst@lineno\@ne %
     \expandafter\everypar\expandafter{\the\everypar %
         \global\advance\lst@lineno\@ne}}
\lst@AddToHook{ExitVars}
    {\ifx\lst@NewLine\relax\else %
         \global\advance\lst@lineno-2\relax %
         \setbox\@tempboxa\vbox{\lst@NewLine}%
     \fi}
\def\lst@PrintFileName#1{%
    \def\lst@arg{#1}%
    \lst@ReplaceIn\lst@arg{_\textunderscore $\textdollar -\textendash}%
    \lst@arg}
\def\lst@SetName#1{%
    \gdef\lst@intname{#1}\global\let\lstintname\lst@intname %
    \let\lst@arg\lst@intname %
    \lst@ReplaceIn\lst@arg{_\textunderscore $\textdollar -\textendash}%
    \global\let\lstname\lst@arg}
\newcommand\listoflistings{\bgroup %
    \let\contentsname\listlistingsname %
    \let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{lol}}%
    \tableofcontents \egroup}
\newcommand\listlistingsname{Listings}
\newcommand\lst@AddToLOL[2]{%
    \ifx\@empty#1\@empty \else %
        \addtocontents{lol}{\protect\lstlolline{#1}{#2}%
            {\lst@language}{\thepage}}%
    \fi}
\newcommand\lstlolline[4]{%
    \@dottedtocline{1}{1.5em}{2.3em}{\lst@PrintFileName{#1}}{#4}}
\def\lst@Init#1{%
    \begingroup \normalbaselines \smallbreak %
    \def\@currentlabel{\the\lst@lineno}%
    \lst@prelisting %
    \lsthk@BeforeSelectCharTable %
    \normalbaselines \everypar{\lsthk@EveryLine}%
    \lsthk@InitVars \lsthk@InitVarsEOL %
    \csname lstPre@\lst@language\endcsname %
    \csname lstPre@\lst@language @\lst@dialect\endcsname %
    \lstCC@Let{"000D}\lst@MProcessListing %
    \let\lstCC@Backslash#1%
    \lst@EnterMode{\lst@Pmode}{\lst@SelectCharTable}}
\lst@AddToHook{InitVars}
    {\rightskip\z@ \leftskip\z@ \parfillskip=0pt plus 1fil %
     \let\par\@@par}
\def\lst@DeInit{%
    \lst@PrintToken \lst@EOLUpdate \par\removelastskip %
    \lsthk@ExitVars %
    \smallbreak\lst@postlisting %
    \endgroup}
\def\lst@EOLUpdate{\lsthk@EOL \lsthk@InitVarsEOL}%
\def\lst@MProcessListing{%
    \lst@PrintToken \lst@EOLUpdate %
    \ifnum\lst@lastline<\lst@lineno \expandafter\endinput \fi %
    \lst@BOLGobble}
\let\lst@BOLGobble\relax
\lst@Aspect{print}[t]{\lstKV@SetIfKey\lst@ifprint{#1}}
\lst@Aspect{first}{\def\lst@firstline{#1}}
\lst@Aspect{last}{\def\lst@lastline{#1}}
\lstset{print=true}% init
\newcommand\lstinputlisting[2][]{%
    \begingroup %
    \def\lst@firstline{1}\def\lst@lastline{9999999}\lstset{#1}%
    \IfFileExists{#2}{\lst@InputListing{#2}}%
    {\filename@parse{#2}%
     \edef\reserved@a{\noexpand\lst@MissingFileError
         {\filename@area\filename@base}%
         {\ifx\filename@ext\relax tex\else\filename@ext\fi}}%
     \reserved@a}%
    \endgroup %
    \lsthk@OnExit}
\def\lst@MissingFileError#1#2{%
    \typeout{^^J! Package Listings Error: File `#1.#2' not found.^^J^^J%
        Type X to quit or <RETURN> to proceed,^^J%
        or enter new name. (Default extension: #2)^^J}%
    \message{Enter file name: }%
    {\endlinechar\m@ne \global\read\m@ne to\@gtempa}%
    \ifx\@gtempa\@empty \else %
        \def\reserved@a{x}\ifx\reserved@a\@gtempa\batchmode\@@end\fi
        \def\reserved@a{X}\ifx\reserved@a\@gtempa\batchmode\@@end\fi
        \filename@parse\@gtempa %
        \edef\filename@ext{%
            \ifx\filename@ext\relax#2\else\filename@ext\fi}%
        \edef\reserved@a{\noexpand\IfFileExists %
                {\filename@area\filename@base.\filename@ext}%
            {\noexpand\lst@InputListing %
                {\filename@area\filename@base.\filename@ext}}%
            {\noexpand\lst@MissingFileError
                {\filename@area\filename@base}{\filename@ext}}}%
        \expandafter\reserved@a %
    \fi}
\def\lst@InputListing#1{%
    \lst@SetName{#1}%
    \lst@ifprint %
        \lst@AddToLOL{#1}{}%
        \lst@Init\relax \lst@SkipUptoFirst \input{#1}\lst@DeInit %
    \else %
        \lst@AddToLOL{#1$^\bullet$}{}%
        \begin{center}%
        \footnotesize  ---  Listing of #1 has been skipped.  ---
        \end{center}%
    \fi}
\def\lst@SkipUptoFirst{%
    \ifnum\lst@lineno=\lst@firstline\else %
        \bgroup \lst@modetrue %
        \let\lst@Output\relax \let\lst@OutputOther\relax %
        \let\lst@GotoTabStop\relax %
        \lstCC@Let{"000D}\lst@MSkipUptoFirst %
    \fi}
\def\lst@MSkipUptoFirst{\egroup %
    \global\advance\lst@lineno\@ne %
    \ifnum\lst@lineno=\lst@firstline\else %
        \expandafter\lst@MSkipUptoFirst@ %
    \fi}
\begingroup \lccode`\~=`\^^M%
\lowercase{\gdef\lst@MSkipUptoFirst@#1~}{%
    \global\advance\lst@lineno\@ne %
    \ifnum\lst@lineno=\lst@firstline\else %
        \expandafter\lst@MSkipUptoFirst@ %
    \fi}
\endgroup
\def\lst@Environment#1#2\is#3#4{%
    \@ifundefined{#1}{\lst@Environment@{#1}{#2}{#3}{#4}}%
    {%
    }}
\def\lst@Environment@#1#2#3#4{%
    \global\@namedef{end#1}{\lstenv@Error{#1}}%
    \global\@namedef{#1}{%
        \def\lstenv@name{#1}%
        \begingroup \lstCC@Let{"000D}\relax %
        \csname#1@\endcsname}%
    \let\l@ngrel@x\global %
    \expandafter\new@command\csname#1@\endcsname#2%
        {\def\lst@firstline{1}\def\lst@lastline{9999999}%
         #3%
         \ifx\@currenvir\lstenv@name %
             \edef\lst@temp{end\noexpand\{\lstenv@name\noexpand\}}%
         \else %
             \edef\lst@temp{end\lstenv@name}%
         \fi %
         \expandafter\lst@MakeActive\expandafter{\lst@temp}%
         \let\lstenv@endstring\lst@arg %
         \@namedef{end#1}{\lst@DeInit #4\endgroup \lsthk@OnExit}%
         \lstenv@Process}}
\def\lstenv@Error#1{\PackageError{Listings}{Extra \string\end#1}%
    {I'm ignoring this, since I wasn't doing a \csname#1\endcsname.}}
\def\lstenv@backslash{%
    \lst@IfNextChars\lstenv@endstring %
        {\lstenv@End}%
        {\lsts@backslash \lst@eaten}}%
\def\lstenv@End{%
    \ifx\@currenvir\lstenv@name %
        \edef\lst@next{\noexpand\end{\lstenv@name}}%
    \else %
        \def\lst@next{\csname end\lstenv@name\endcsname}%
    \fi %
    \lst@next}
\def\lstenv@Process{%
    \lst@Init\lstenv@backslash %
    \global\lst@lineno\lst@firstline\relax %
    \let\lstenv@ifdropped\iffalse \lstenv@Process@}
\def\lstenv@droppedtrue{\let\lstenv@ifdropped\iftrue}
\begingroup \lccode`\~=`\^^M%
\lowercase{\gdef\lstenv@Process@#1{%
    \ifx~#1%
        \expandafter\lstenv@ProcessM %
    \else\ifx^^J#1%
        \expandafter\expandafter\expandafter\lstenv@ProcessJ %
    \else %
        \lstenv@droppedtrue %
        \expandafter\expandafter\expandafter\lstenv@Process@ %
    \fi \fi}
}\endgroup
\def\lstenv@DroppedWarning{%
    \lstenv@ifdropped %
        \PackageWarning{Listings}{Text dropped after begin of listing}%
    \fi}
\def\lstenv@ProcessM{\lstenv@DroppedWarning \lst@BOLGobble}
\def\lstenv@ProcessJ{%
    \lstenv@DroppedWarning %
    \lst@DontEscapeToLaTeX %
    \let\lstenv@arg\@empty %
    \ifx\@currenvir\lstenv@name %
        \expandafter\lstenv@ProcessJEnv %
    \else %
        \expandafter\def\expandafter\lst@temp\expandafter##1%
        \csname end\lstenv@name\endcsname{%
            \lstenv@AddArg{##1}\lstenv@ProcessJ@}%
        \expandafter\lst@temp %
    \fi}
\begingroup \lccode`\~=`\\ \lccode`\A=`\A
\lowercase{\gdef\lstenv@ProcessJ@{%
    \expandafter\lst@lAddTo\expandafter\lstenv@arg %
        \expandafter{\expandafter\ \expandafter~\lstenv@endstring}%
    \lstCC@Let{"000A}\lst@MProcessListing \def\lst@BOLGobble##1{}%
    \expandafter\lst@BOLGobble\lstenv@arg}
}\endgroup
\def\lstenv@ProcessJEnv#1\end#2{\def\lst@temp{#2}%
    \ifx\lstenv@name\lst@temp %
        \lstenv@AddArg{#1}%
        \expandafter\lstenv@ProcessJ@ %
    \else %
        \lstenv@AddArg{#1\\end\{#2\}}%
        \expandafter\lstenv@ProcessJEnv %
    \fi}
\lst@Environment{lstlisting}[2][]\is
    {\lstenv@TestEOLChar{#2}%
     \expandafter\ifx\csname lstno@\lst@intname\endcsname \relax %
         \ifx\lst@intname\@empty\else \lst@AddToLOL{#2}{}\fi %
     \else %
         \edef\lst@firstline{\csname lstno@\lst@intname\endcsname}%
         \let\lst@prelisting\lst@@prelisting %
         \let\lst@postlisting\lst@@postlisting %
     \fi %
     \lstset{#1}}
    {\ifx\lst@intname\@empty %
         \expandafter\xdef\csname lstno@ \endcsname{\the\lst@lineno}%
     \else %
         \expandafter\xdef\csname lstno@\lst@intname\endcsname %
             {\the\lst@lineno}%
     \fi}
\begingroup \lccode`\~=`\^^M\lowercase{%
\gdef\lstenv@TestEOLChar#1{%
    \lst@SetName{}%
    \ifx~#1\lstenv@EOLCharError \else %
        \ifx^^J#1\lstenv@EOLCharError \else %
            \lst@SetName{#1}%
        \fi %
    \fi}
}\endgroup
\def\lstenv@EOLCharError{%
    \PackageError{Listings}
    {Oops! It seems you've forgotten the argument to\MessageBreak %
     a listing environment. Assuming empty argument}%
    {Type <RETURN> to proceed.}}
\lst@Aspect{advancelineno}
    {\global\lst@lineno\lst@firstline\relax %
     \global\advance\lst@lineno#1\relax %
     \edef\lst@firstline{\the\lst@lineno}}
\lst@Aspect{resetlineno}[1]{\def\lst@firstline{#1}}
\def\lstinline{\hbox\bgroup %
    \let\smallbreak\relax %
    \let\lst@prelisting\relax \let\lst@postlisting\relax %
    \let\lst@ifflexible\iftrue \lst@DontEscapeToLaTeX %
    \def\lst@firstline{1}\def\lst@lastline{1}%
    \lst@Init\relax \everypar{}\global\let\lst@NewLine\relax %
    \lst@IfNextCharActive\lst@InlineM\lst@InlineJ}
\def\lst@InlineM#1{%
    \lstCC@Def{`#1}{\lst@DeInit\egroup}%
    \lstCC@Def{"000D}{\lst@DeInit\egroup %
        \PackageError{Listings}{lstinline ended by EOL}\@ehc}}
\def\lst@InlineJ#1{%
    \def\lst@temp##1#1{%
        \let\lstenv@arg\@empty \lstenv@AddArg{##1}%
        \lstenv@arg \lst@DeInit\egroup}%
    \lst@temp}
\newcommand\lstbox{%
    \hbox\bgroup %
        \let\lst@ifbox\iftrue %
        \let\smallbreak\relax %
        \let\lst@prelisting\relax \let\lst@postlisting\relax %
        \let\lst@@prelisting\relax\let\lst@@postlisting\relax %
        \lst@outerspread\z@ \lst@innerspread\z@ %
        \@ifnextchar[{\lstbox@}{\lstbox@[c]}}
\def\lstbox@[#1]{%
    \hbox to\z@\bgroup %
        $\if#1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi %
        \bgroup}%
\let\lst@ifbox\iffalse
\def\lst@EndBox{%
    \egroup $\hss \egroup %
    \vrule width\lst@maxwidth height\z@ depth\z@ %
    \egroup}
\lst@AddToHook{OnExit}
    {\lst@ifbox %
         \global\advance\lst@maxwidth-\lst@innerspread %
         \global\advance\lst@maxwidth-\lst@outerspread %
         \ifx\@currenvir\lstenv@name %
             \expandafter\expandafter\expandafter\aftergroup %
         \fi %
         \expandafter\lst@EndBox %
     \fi}
\newdimen\lst@maxwidth % \global
\lst@AddToHook{InitVars}{\global\lst@maxwidth\z@}
\lst@AddToHook{InitVarsEOL}
    {\@tempdima \lst@column\lst@width %
     \advance\@tempdima -\lst@pos\lst@width %
     \ifdim\lst@lostspace<\z@ \advance\@tempdima -\lst@lostspace \fi %
     \ifdim\@tempdima>\lst@maxwidth \global\lst@maxwidth\@tempdima \fi}
\def\lst@SetStyleFor#1\relax{%
    \def\lst@temp##1,#1,##2\relax{%
        \ifx\@empty##2\@empty \let\lst@thestyle\lst@nonkeywordstyle %
                        \else \let\lst@thestyle\lst@keywordstyle\fi}%
    \expandafter\lst@temp\expandafter,\lst@keywords,#1,\relax}%
\def\lst@SetStyleForNonSensitive#1\relax{%
    \uppercase{\def\lst@temp##1,#1},##2\relax{%
        \ifx\@empty##2\@empty \let\lst@thestyle\lst@nonkeywordstyle %
                        \else \let\lst@thestyle\lst@keywordstyle\fi}%
    \uppercase{%
        \expandafter\lst@temp\expandafter,\lst@keywords,#1},\relax}%
\lst@AddToHook{Output}
    {\lst@ifmode %
         \let\lst@thestyle\relax %
     \else %
         \expandafter\lst@SetStyleFor\the\lst@token\relax %
     \fi}
\def\lst@IfOneOf#1\relax#2{%
    \def\lst@temp##1,#1,##2\relax{%
        \ifx \@empty##2\@empty \expandafter\@secondoftwo %
        \else \expandafter\@firstoftwo \fi}%
    \expandafter\lst@temp\expandafter,#2,#1,\relax}%
\def\lst@IfOneOfNonSensitive#1\relax#2{%
    \uppercase{\def\lst@temp##1,#1},##2\relax{%
        \ifx \@empty##2\@empty \expandafter\@secondoftwo %
        \else \expandafter\@firstoftwo \fi}%
    \uppercase\expandafter{%
        \expandafter\lst@temp\expandafter,#2,#1},\relax}%
\newcommand\lststorekeywords[2]{\gdef#1{#2}}
\lst@Aspect{sensitive}[t]{\lstKV@SetIfKey\lst@ifsensitive{#1}}
\lst@AddToHook{SetLanguage}{\let\lst@ifsentitive\iftrue}
\lst@Aspect{keywords}
    {\lst@MakeSpecKeywordArg{#1}\let\lst@keywords\lst@arg}
\lst@AddToHook{SetLanguage}{\let\lst@keywords\@empty}
\lst@AddToHook{BeforeSelectCharTable}
    {\lst@ifsensitive\else %
         \let\lst@SetStyleFor\lst@SetStyleForNonSensitive %
         \let\lst@IfOneOf\lst@IfOneOfNonSensitive %
         \lst@MakeMacroUppercase\lst@keywords %
     \fi}
\def\lst@MakeMacroUppercase#1{%
    \ifx#1\@undefined\else \uppercase\expandafter{%
        \expandafter\def\expandafter#1\expandafter{#1}}%
    \fi}
\lst@Aspect{morekeywords}
    {\lst@MakeMoreSpecKeywordArg{,#1}%
     \expandafter\lst@lAddTo\expandafter\lst@keywords %
         \expandafter{\lst@arg}}
\lst@Aspect{deletekeywords}
    {\lst@MakeKeywordArg{#1}%
     \lst@DeleteKeysIn\lst@keywords\lst@arg}
\def\lst@MakeKeywordArg#1{\edef\lst@arg{\zap@space#1 \@empty}%
    \lst@ReplaceIn\lst@arg{_\lst@underscore $\lst@dollar -\lst@minus}}
\def\lst@MakeSpecKeywordArg{%
    \let\lst@ialsodigit\@empty \let\lst@ialsoletter\@empty %
    \lst@MakeMoreSpecKeywordArg}
\def\lst@MakeMoreSpecKeywordArg#1{\edef\lst@arg{\zap@space#1 \@empty}%
    \lstCC@lettertrue %
    \expandafter\lst@SpecialKeywordScan\lst@arg\relax %
    \lst@ReplaceIn\lst@arg{_\lst@underscore $\lst@dollar -\lst@minus}}
\def\lst@SpecialKeywordScan#1{%
    \ifx\relax#1%
        \expandafter\@gobble %
    \else %
        \ifx,#1%
            \lstCC@lettertrue %
        \else %
            \ifnum`#1<"40\relax %
                \ifnum`#1<"30\relax \lst@SKSAdd#1\else %
                \ifnum`#1>"39\relax \lst@SKSAdd#1\else %
                    \lst@SKS@#1%
                \fi \fi %
            \else %
                \ifnum`#1<"5B\relax \else %
                \ifnum`#1="5F\relax \else %
                \ifnum`#1<"61\relax \lst@SKSAdd#1\else %
                \ifnum`#1<"7B\relax \else %
                \ifnum`#1<"80\relax \lst@SKSAdd#1 %
                \fi \fi \fi \fi \fi %
            \fi %
            \lstCC@letterfalse %
        \fi %
    \fi \lst@SpecialKeywordScan}
\def\lst@SKS@#1{\lstCC@ifletter \lst@SKSAdd#1\fi}
\def\lst@SKSAdd#1{%
    \lstCC@ifletter %
        \def\lst@temp##1#1##2\relax{%
            \ifx\@empty##2\@empty %
                \lst@lAddTo\lst@ialsoletter{#1}%
            \fi}%
        \expandafter\lst@temp\lst@ialsoletter#1\relax %
    \else %
        \def\lst@temp##1#1##2\relax{%
            \ifx\@empty##2\@empty %
                \lst@lAddTo\lst@ialsodigit{#1}%
            \fi}%
        \expandafter\lst@temp\lst@ialsodigit#1\relax %
    \fi}
\let\lst@ialsoletter\@empty \let\lst@ialsodigit\@empty % init
\lst@Aspect{alsoletter}{\def\lst@alsoletter{#1}}
\lst@Aspect{alsodigit}{\def\lst@alsodigit{#1}}
\lst@Aspect{alsoother}{\def\lst@alsoother{#1}}
\lst@AddToHook{SetLanguage}
    {\let\lst@alsoletter\@empty %
     \let\lst@alsodigit\@empty %
     \let\lst@alsoother\@empty}
\lst@AddToHook{SelectCharTable}
    {\lstCC@ChangeBasicClass\lstCC@ProcessOther\lst@alsoother %
     \lstCC@ChangeBasicClass\lstCC@ProcessDigit\lst@ialsodigit %
     \lstCC@ChangeBasicClass\lstCC@ProcessDigit\lst@alsodigit %
     \lstCC@ChangeBasicClass\lstCC@ProcessLetter\lst@ialsoletter %
     \lstCC@ChangeBasicClass\lstCC@ProcessLetter\lst@alsoletter}
\def\lst@minus{\ifx\f@family\ttdefault-{}\else$-$\fi}
\def\lst@dollar{\ifx\f@family\ttdefault\textdollar\else\textdollar\fi}
\def\lst@asterisk{\ifx\f@family\ttdefault*\else\textasteriskcentered\fi}
\def\lst@less{\ifx\f@family\ttdefault<\else\textless\fi}
\def\lst@greater{\ifx\f@family\ttdefault>\else\textgreater\fi}
\def\lst@backslash{\ifx\f@family\ttdefault\char92\else\textbackslash\fi}
\def\lst@underscore{%
    \ifx\f@family\ttdefault\char95\else\textunderscore\fi}
\def\lst@lbrace{\ifx\f@family\ttdefault\char123\else\textbraceleft\fi}
\def\lst@bar{\ifx\f@family\ttdefault|\else\textbar\fi}
\def\lst@rbrace{\ifx\f@family\ttdefault\char125\else\textbraceright\fi}
\lst@AddToHook{BeforeSelectCharTable}{\edef\ttdefault{\ttdefault}}
\lst@Aspect{basicstyle}{\def\lst@basicstyle{#1}}
\lst@Aspect{keywordstyle}{\def\lst@keywordstyle{#1}}
\lst@Aspect{nonkeywordstyle}{\def\lst@nonkeywordstyle{#1}}
\lst@AddToHook{BeforeSelectCharTable}
    {\lst@basicstyle %
     \setbox\@tempboxa\hbox{\lst@loadfd %
         {\lst@keywordstyle \lst@loadfd}%
         {\lst@nonkeywordstyle \lst@loadfd}}}
\def\lst@loadfd{a0\lst@asterisk\lst@less}
\@ifundefined{lst@ndkeywords}{}{%
\let\lst@ndkeywords\@empty \let\lst@ndkeywordstyle\@empty % init
\lst@Aspect{ndkeywords}
    {\lst@MakeSpecKeywordArg{#1}\let\lst@ndkeywords\lst@arg}
\lst@AddToHook{SetLanguage}{\let\lst@ndkeywords\@empty}
\lst@AddToHook{BeforeSelectCharTable}
    {\lst@ifsensitive\else %
         \lst@MakeMacroUppercase\lst@ndkeywords %
     \fi}
\lst@Aspect{ndkeywordstyle}{\def\lst@ndkeywordstyle{#1}}
\lst@AddToHook{BeforeSelectCharTable}
    {\setbox\@tempboxa\hbox{{\lst@ndkeywordstyle \lst@loadfd}}}
\lst@Aspect{morendkeywords}
    {\lst@MakeMoreSpecKeywordArg{,#1}%
     \expandafter\lst@lAddTo\expandafter\lst@ndkeywords %
         \expandafter{\lst@arg}}
\lst@Aspect{deletendkeywords}
    {\lst@MakeKeywordArg{#1}%
     \lst@DeleteKeysIn\lst@ndkeywords\lst@arg}
\lst@AddToHook{Output}
    {\lst@ifmode\else %
         \expandafter\lst@IfOneOf\the\lst@token\relax \lst@ndkeywords %
             {\let\lst@thestyle\lst@ndkeywordstyle}{}%
     \fi}
}
\@ifundefined{lst@rdkeywords}{}{%
\let\lst@rdkeywords\@empty \let\lst@rdkeywordstyle\@empty % init
\lst@Aspect{rdkeywords}
    {\lst@MakeSpecKeywordArg{#1}\let\lst@rdkeywords\lst@arg}
\lst@AddToHook{SetLanguage}{\let\lst@rdkeywords\@empty}
\lst@AddToHook{BeforeSelectCharTable}
    {\lst@ifsensitive\else %
         \lst@MakeMacroUppercase\lst@rdkeywords %
     \fi}
\lst@Aspect{rdkeywordstyle}{\def\lst@rdkeywordstyle{#1}}
\lst@AddToHook{BeforeSelectCharTable}
    {\setbox\@tempboxa\hbox{{\lst@rdkeywordstyle \lst@loadfd}}}
\lst@Aspect{morerdkeywords}
    {\lst@MakeMoreSpecKeywordArg{,#1}%
     \expandafter\lst@lAddTo\expandafter\lst@rdkeywords %
         \expandafter{\lst@arg}}
\lst@Aspect{deleterdkeywords}
    {\lst@MakeKeywordArg{#1}%
     \lst@DeleteKeysIn\lst@rdkeywords\lst@arg}
\lst@AddToHook{Output}
    {\lst@ifmode\else %
         \expandafter\lst@IfOneOf\the\lst@token\relax \lst@rdkeywords %
             {\let\lst@thestyle\lst@rdkeywordstyle}{}%
     \fi}
}
\@ifundefined{lst@index}{}{%
\lst@Aspect{index}{\lst@MakeSpecKeywordArg{#1}\let\lst@index\lst@arg}
\lst@AddToHook{BeforeSelectCharTable}
    {\lst@ifsensitive\else %
         \lst@MakeMacroUppercase\lst@index %
     \fi}
\lst@AddToHook{Output}
    {\lst@ifmode\else %
         \expandafter\lst@IfOneOf\the\lst@token\relax \lst@index %
            {\expandafter\lst@indexmacro\expandafter{\the\lst@token}}{}%
     \fi}
\lst@Aspect{indexmacro}{\let\lst@indexmacro#1}
\newcommand\lstindexmacro[1]{\index{{\ttfamily#1}}}
\let\lst@index\@empty \let\lst@indexmacro\lstindexmacro % init
}
\@ifundefined{lst@prockeywords}{}{%
\lst@Aspect{prockeywords}{%
    \lst@MakeSpecKeywordArg{#1}\let\lst@prockeywords\lst@arg}
\lst@Aspect{procnamestyle}{\def\lst@procnamestyle{#1}}
\lst@Aspect{indexprocnames}[t]{\lstKV@SetIfKey\lst@ifindexproc{#1}}
\lst@AddToHook{BeforeSelectCharTable}
    {\setbox\@tempboxa\hbox{\lst@procnamestyle\lst@loadfd}%
     \lst@ifsensitive\else %
         \lst@MakeMacroUppercase\lst@prockeywords %
     \fi %
     \lst@ifindexproc \ifx\lst@indexmacro\@undefined %
         \let\lst@indexmacro\@gobble %
     \fi \fi}
\lst@AddToHook{Output}
    {\lst@ifmode\else %
         \lst@ifprocname %
             \let\lst@thestyle\lst@procnamestyle %
             \expandafter\lst@indexmacro\expandafter{\the\lst@token}%
             \lst@procnamefalse %
         \else \expandafter%
             \lst@IfOneOf\the\lst@token\relax \lst@prockeywords %
                {\lst@procnametrue}{}%
         \fi %
     \fi}
\def\lst@procnametrue{\global\let\lst@ifprocname\iftrue}
\def\lst@procnamefalse{\global\let\lst@ifprocname\iffalse}
\let\lst@prockeywords\@empty % init
\lstset{procnamestyle={},indexprocnames=false}% init
\lst@procnamefalse % init
}
\lst@Aspect{labelstyle}{\def\lst@labelstyle{#1}}
\lst@Aspect{labelsep}{\def\lst@labelsep{#1}}
\lst@Aspect{labelstep}%
    {\ifnum #1>\m@ne %
         \def\lst@labelstep{#1}%
     \else %
         \PackageError{Listings}{Nonnegative integer expected}%
         {You can't use `#1' as step count for labels.^^J%
          I'll forget it and proceed.}%
     \fi}
\lst@AddToHook{BeforeSelectCharTable}
    {\setbox\@tempboxa\hbox{\lst@stringstyle \lst@loadfd}}
\newcount\lst@skiplabels % \global
\lst@AddToHook{BeforeSelectCharTable}
    {\ifnum\lst@labelstep>\z@ %
         \global\lst@skiplabels\lst@firstline\relax %
         \global\divide\lst@skiplabels\lst@labelstep %
         \global\multiply\lst@skiplabels-\lst@labelstep %
         \global\advance\lst@skiplabels\lst@firstline\relax %
         \ifnum\lst@skiplabels>\z@ %
             \global\advance\lst@skiplabels -\lst@labelstep\relax %
         \fi %
     \else %
         \let\lst@SkipOrPrintLabel\relax %
     \fi}
\lst@AddToHook{EveryLine}{\lst@SkipOrPrintLabel}
\def\lst@SkipOrPrintLabel{%
    \ifnum\lst@skiplabels=\z@ %
        \global\advance\lst@skiplabels-\lst@labelstep\relax %
        \llap{\lst@labelstyle{\the\lst@lineno}\kern\lst@labelsep}%
    \fi %
    \global\advance\lst@skiplabels\@ne}
\newdimen\lst@innerspread \newdimen\lst@outerspread
\lst@Aspect{wholeline}[t]{\lstKV@SetIfKey\lst@ifwholeline{#1}}
\lst@Aspect{indent}{\def\lst@indent{#1}}
\lst@Aspect{spread}{\lstspread@#1,,\relax}
\def\lstspread@#1,#2,#3\relax{%
    \lst@innerspread#1\relax %
    \ifx\@empty#2\@empty %
        \divide\lst@innerspread\tw@\relax %
        \lst@outerspread\lst@innerspread %
    \else %
        \lst@outerspread#2\relax %
    \fi}
\lstset{wholeline=false,indent=\z@,spread=\z@}% init
\def\lst@parshape{%
    \parshape\@ne %
        \ifodd\c@page -\lst@innerspread\else -\lst@outerspread\fi %
        \linewidth}
\lst@AddToHookAtTop{EveryLine}{\lst@parshape}
\lst@AddToHookAtTop{EndGroup}{\lst@parshape}
\lst@AddToHook{BeforeSelectCharTable}
    {\advance\linewidth\lst@innerspread %
     \advance\linewidth\lst@outerspread %
     \advance\linewidth-\lst@indent\relax %
     \advance\lst@innerspread-\lst@indent\relax %
     \advance\lst@outerspread-\lst@indent\relax %
     \lst@ifwholeline %
         \advance\linewidth\@totalleftmargin %
     \else %
         \advance\lst@innerspread-\@totalleftmargin %
         \advance\lst@outerspread-\@totalleftmargin %
     \fi %
     \if@twoside\else \lst@outerspread\lst@innerspread \fi}
\lst@Aspect{lineskip}{\def\lst@lineskip{#1}}
\lst@AddToHook{BeforeSelectCharTable}{\parskip\lst@lineskip\relax}
\lstset{lineskip=\z@}% init
\lst@Aspect{framerulewidth}{\def\lst@framewidth{#1}}
\lst@Aspect{framerulesep}{\def\lst@framesep{#1}}
\lst@Aspect{frametextsep}{\def\lst@frametextsep{#1}}
\lstset{framerulewidth=.4pt,framerulesep=2pt,frametextsep=3pt}% init
\lst@Aspect{frame}
    {\def\lst@frame{#1}%
     \lstframe@\relax tlrbTLRB\relax %
     \lstframe@\@empty#1\relax}
\def\lstframe@#1#2{%
    \ifx\relax#2\else %
        \expandafter\let\csname lstf@#2\endcsname#1%
        \expandafter\lstframe@\expandafter#1%
    \fi}
\lstset{frame={}}% init
\def\lst@framev{\hbox{\strut\vrule width\lst@framewidth}}
\def\lst@frameV{\hbox{\strut %
    \vrule width\lst@framewidth\kern\lst@framesep %
    \vrule width\lst@framewidth}}
\lst@AddToHook{EveryLine}{\lst@framelr}
\def\lst@framelr{%
    \llap{\lst@framel\kern\lst@indent\kern\lst@frametextsep}%
    \rlap{\kern\linewidth\kern\lst@frametextsep\lst@framer}}
\def\lst@frameh#1#2#3{%
    \hbox to\z@{%
        \kern\ifodd\c@page -\lst@innerspread\else -\lst@outerspread\fi %
        \kern-\lst@indent %
        \kern-\lst@frametextsep %
        \ifx\lstf@L\@empty %
            \llap{#2#1}%
        \else \ifx\lstf@l\@empty %
            \llap{#20}%
        \fi \fi %
        \vrule\@width\lst@frametextsep %
        \vrule\@width\lst@indent %
        \vrule\@width\linewidth\@height\lst@framewidth %
        \vrule\@width\lst@frametextsep %
        \ifx\lstf@R\@empty %
            \rlap{#3#1}%
        \else \ifx\lstf@r\@empty %
            \rlap{#30}%
        \fi \fi %
        \hss}}
\def\lst@framet{\lst@frameh0\lst@frameTL\lst@frameTR}%
\let\lst@frameb\lst@framet
\def\lst@frameT{%
    \lst@frameh1\lst@frameTL\lst@frameTR %
    \vskip\lst@framesep %
    \lst@frameh0\lst@frameTL\lst@frameTR}
\def\lst@frameB{%
    \lst@frameh0\lst@frameBL\lst@frameBR %
    \vskip\lst@framesep %
    \lst@frameh1\lst@frameBL\lst@frameBR}
\lst@AddToHook{BeforeSelectCharTable}
    {\ifx\lstf@T\@empty %
         \offinterlineskip\par\noindent\lst@frameT %
     \else \ifx\lstf@t\@empty %
         \offinterlineskip\par\noindent\lst@framet %
     \else %
         \let\lst@framet\relax %
     \fi \fi %
     \let\lst@framel\relax \let\lst@framer\relax %
     \ifx\lstf@L\@empty %
         \let\lst@framel\lst@frameV %
     \else %
         \ifx\lstf@l\relax\else \let\lst@framel\lst@framev \fi %
     \fi %
     \ifx\lstf@R\@empty %
         \let\lst@framer\lst@frameV %
     \else %
         \ifx\lstf@r\relax\else \let\lst@framer\lst@framev \fi %
     \fi %
     \ifx\lst@framel\relax \ifx\lst@framer\relax %
         \let\lst@framelr\relax %
     \fi \fi %
     \ifx\lst@framelr\relax\else \ifx\lst@framet\relax\else %
         {\setbox\strutbox\hbox{%
              \vrule\@height0pt\@depth.3\normalbaselineskip\@width\z@}%
          \kern\ifodd\c@page-\lst@innerspread\else-\lst@outerspread\fi %
          \lst@framelr}%
     \fi \fi}
\lst@AddToHook{ExitVars}
    {\ifx\lstf@B\@empty %
         \offinterlineskip\everypar{}\par\noindent\lst@frameB %
     \else \ifx\lstf@b\@empty %
         \offinterlineskip\everypar{}\par\noindent\lst@framet %
     \fi \fi}
\def\lst@frameTL#1{%
    \@tempdima\lst@framesep \advance\@tempdima\lst@framewidth %
    \multiply\@tempdima#1\relax %
    \setbox\@tempboxa\hbox to\z@{%
        \vrule\@width\lst@framewidth\@height\z@\@depth\@tempdima\hss}%
    \dp\@tempboxa\z@ %
    \advance\@tempdima\lst@framewidth %
    \box\@tempboxa \vrule\@width\@tempdima\@height\lst@framewidth}
\def\lst@frameTR#1{%
    \@tempdima\lst@framesep \advance\@tempdima\lst@framewidth %
    \multiply\@tempdima#1\relax %
    \setbox\@tempboxa\hbox to\z@{\hss %
        \vrule\@width\lst@framewidth\@height\z@\@depth\@tempdima}%
    \dp\@tempboxa\z@ %
    \advance\@tempdima\lst@framewidth %
    \vrule\@width\@tempdima\@height\lst@framewidth \box\@tempboxa}
\def\lst@frameBL#1{%
    \@tempdima\lst@framesep \advance\@tempdima\lst@framewidth %
    \multiply\@tempdima#1\relax %
    \advance\@tempdima\lst@framewidth %
    \setbox\@tempboxa\hbox to\z@{%
        \vrule\@width\lst@framewidth\@height\@tempdima\hss}%
    \ht\@tempboxa\z@ %
    \box\@tempboxa \vrule\@width\@tempdima\@height\lst@framewidth}
\def\lst@frameBR#1{%
    \@tempdima\lst@framesep \advance\@tempdima\lst@framewidth %
    \multiply\@tempdima#1\relax %
    \advance\@tempdima\lst@framewidth %
    \setbox\@tempboxa\hbox to\z@{\hss %
        \vrule\@width\lst@framewidth\@height\@tempdima}%
    \ht\@tempboxa\z@ %
    \vrule\@width\@tempdima\@height\lst@framewidth \box\@tempboxa}
\lst@Aspect{pre}{\lstKV@OptArg\lstpre@[]{#1}}
\lst@Aspect{post}{\lstKV@OptArg\lstpost@[]{#1}}
\def\lstpre@[#1]#2{%
    \def\lst@prelisting{#2}\def\lst@@prelisting{#1}}
\def\lstpost@[#1]#2{%
    \def\lst@postlisting{#2}\def\lst@@postlisting{#1}}
\lstset{pre={},post={}}% init
\lst@Aspect{texcl}[t]{\lstKV@SetIfKey\lst@iftexcl{#1}}
\lstset{texcl=false}% init
\lst@NewMode\lst@TeXCLmode
\lst@NewMode\lst@CLmode
\lst@AddToHook{EOL}
    {\ifnum\lst@mode=\lst@TeXCLmode %
         \lst@LeaveAllModes \lst@ReenterModes %
     \fi %
     \ifnum\lst@mode=\lst@CLmode \lst@LeaveMode \fi}
\def\lstCC@BeginCommentLine#1{%
    \lst@NewLine \lst@PrintToken %
    \lst@EnterMode{\lst@CLmode}{\lst@modetrue\lst@commentstyle}%
    #1\relax %
    \lst@iftexcl %
        \lst@PrintToken %
        \lst@LeaveMode \lst@InterruptModes %
        \lst@EnterMode{\lst@TeXCLmode}{\lst@modetrue\lst@commentstyle}%
    \fi}
\def\lstCC@@BeginCommentLine#1#2{%
    \lst@NewLine \lst@PrintToken %
    \lst@EnterMode{\lst@CLmode}{\lst@modetrue\lst@commentstyle}%
    #1\relax#2\relax %
    \lst@iftexcl %
        \lst@PrintToken %
        \lst@LeaveMode \lst@InterruptModes %
        \lst@EnterMode{\lst@TeXCLmode}{\lst@modetrue\lst@commentstyle}%
    \fi}
\lst@Aspect{flexiblecolumns}[t]{\lstKV@SetIfKey\lst@ifflexible{#1}}
\lstset{flexiblecolumns=false}% init
\lst@AddToHook{BeforeSelectCharTable}
    {\lst@ifflexible %
         \let\lst@Output\lst@OutputFlexible %
         \let\lst@OutputOther\lst@OutputOtherFlexible %
         \let\lst@GotoTabStop\lst@GotoTabStopFlexible %
     \fi}
\lst@Aspect{baseem}{\lstbaseem@#1,,\relax}
\def\lstbaseem@#1,#2,#3\relax{%
    \def\lst@next{\PackageError{Listings}%
        {Nonnegative number(s) expected}%
        {Separate one or two such numbers by a comma, next time.^^J%
         Now type <RETURN> to proceed.}}%
    \ifdim #1em<\z@\else %
        \def\lst@baseemfixed{#1}%
        \let\lst@baseemflexible\lst@baseemfixed %
        \ifx\@empty#2\@empty %
            \let\lst@next\relax %
        \else \ifdim #2em<\z@\else %
            \def\lst@baseemflexible{#2}%
            \let\lst@next\relax %
        \fi \fi %
    \fi \lst@next}
\lstset{baseem={0.6,0.45}}% init
\newdimen\lst@width
\lst@AddToHook{InitVars}
    {\lst@width=\lst@ifflexible\lst@baseemflexible %
                          \else\lst@baseemfixed\fi em\relax}
\lst@Aspect{tabsize}
    {\ifnum#1>\z@ %
        \def\lst@tabsize{#1}%
     \else %
         \PackageError{Listings}{Strict positive integer expected}
         {You can't use `#1' as tabulator length.^^J%
          Type <RETURN> to forget it and to proceed.}%
     \fi}
\lstset{tabsize=8}% init
\newtoks\lst@token \newcount\lst@length
\lst@AddToHook{InitVarsEOL}{\lst@token{}\lst@length\z@}
\lst@AddToHook{InitVarsEOL}{\let\lst@lastother\@empty}
\newcount\lst@column \newcount\lst@pos % \global
\lst@AddToHook{InitVarsEOL}{\global\lst@pos\z@ \global\lst@column\z@}
\newdimen\lst@lostspace % \global
\lst@AddToHook{InitVarsEOL}{\global\lst@lostspace\z@}
\def\lst@UseLostSpace{%
    \ifdim\lst@lostspace>\z@ %
        \kern\lst@lostspace \global\lst@lostspace\z@ %
    \fi}
\def\lst@InsertLostSpace{\kern\lst@lostspace \global\lst@lostspace\z@}
\def\lst@InsertHalfLostSpace{%
    \global\lst@lostspace.5\lst@lostspace \kern\lst@lostspace}
\lst@Aspect{outputpos}{\lstoutputpos@#1\relax\relax}
\def\lstoutputpos@#1#2\relax{%
    \ifx #1l%
        \let\lst@lefthss\relax \let\lst@righthss\hss %
        \let\lst@leftinsert\relax %
    \else\ifx #1c%
        \let\lst@lefthss\hss \let\lst@righthss\hss %
        \let\lst@leftinsert\lst@InsertHalfLostSpace %
    \else %
        \let\lst@lefthss\hss \let\lst@righthss\relax %
        \let\lst@leftinsert\lst@InsertLostSpace %
        \ifx #1r\else \PackageWarning{Listings}%
            {Unknown positioning for output boxes}%
        \fi %
    \fi\fi}
\lstset{outputpos=c}% init
\def\lst@NewLineMacro{%
    \global\let\lst@NewLine\relax \par\noindent\hbox{}}
\lst@AddToHook{InitVars}{\global\let\lst@NewLine\lst@NewLineMacro}
\lst@AddToHook{EOL}
    {\ifx\lst@NewLine\relax %
        \global\let\lst@NewLine\lst@NewLineMacro %
     \else %
         \lst@AddTo\lst@NewLine{\par\noindent\hbox{}}%
     \fi}
\def\lst@OutputOther{%
    \ifnum\lst@length=\z@\else %
        \lst@NewLine \lst@UseLostSpace %
        \hbox to \lst@length\lst@width{%
            \lst@lefthss %
            \lsthk@OutputOther %
            \expandafter\lst@FillOutputBox\the\lst@token\relax %
            \lst@righthss}%
        \global\advance\lst@pos -\lst@length %
        \lst@token{}\lst@length\z@ %
    \fi}
\def\lst@Output{%
    \let\lst@lastother\relax %
    \ifnum\lst@length=\z@\else %
        \lst@NewLine \lst@UseLostSpace %
        \hbox to \lst@length\lst@width{%
            \lst@lefthss %
            \lsthk@Output \lst@thestyle{%
                \expandafter\lst@FillOutputBox\the\lst@token\relax}%
            \lst@righthss}%
        \global\advance\lst@pos -\lst@length %
        \lst@token{}\lst@length\z@ %
    \fi}
\def\lst@FillOutputBox#1{%
    \ifx\relax#1\else #1\hss\expandafter\lst@FillOutputBox \fi}
\def\lst@GotoTabStop{%
    \global\advance\lst@lostspace \lst@length\lst@width %
    \global\advance\lst@column\lst@length \lst@length\z@}%
\def\lst@OutputOtherFlexible{%
    \ifnum\lst@length=\z@\else %
        \lst@NewLine \lst@UseLostSpace %
        \setbox\@tempboxa\hbox{\lsthk@OutputOther\the\lst@token}%
        \lst@CalcLostSpaceAndOutput %
    \fi}
\def\lst@OutputFlexible{%
    \let\lst@lastother\relax %
    \ifnum\lst@length=\z@\else %
        \lst@NewLine \lst@UseLostSpace %
        \setbox\@tempboxa\hbox{%
            \lsthk@Output \lst@thestyle{\the\lst@token}}%
        \lst@CalcLostSpaceAndOutput %
    \fi}
\def\lst@GotoTabStopFlexible{%
    \ifx\lst@NewLine\relax %
        \setbox\@tempboxa\hbox{\lst@outputblank}\@tempdima\wd\@tempboxa%
        \setbox\@tempboxa\hbox{}\wd\@tempboxa\@tempdima %
        \lst@CalcLostSpaceAndOutput %
        \global\lst@pos\z@ %
    \else %
        \global\advance\lst@lostspace \lst@length\lst@width %
        \global\advance\lst@column\lst@length \lst@length\z@ %
    \fi}
\def\lst@CalcLostSpaceAndOutput{%
    \global\advance\lst@lostspace \lst@length\lst@width %
    \global\advance\lst@lostspace-\wd\@tempboxa %
    \global\advance\lst@pos -\lst@length %
    \lst@token{}\lst@length\z@ %
    \ifdim\lst@lostspace>\z@ \lst@leftinsert \fi %
    \box\@tempboxa}
\def\lst@BeginDropOutput#1{%
    \let\lst@BDOsave\lst@NewLine %
    \lst@EnterMode{#1}%
        {\lst@modetrue %
         \let\lst@Output\lst@EmptyOutput %
         \let\lst@OutputOther\lst@EmptyOutputOther %
         \let\lst@GotoTabStop\lst@EmptyGotoTabStop %
         \aftergroup\lst@BDORestore}}
\def\lst@BDORestore{\global\let\lst@NewLine\lst@BDOsave}
\def\lst@EmptyOutputOther{%
    \global\advance\lst@pos -\lst@length %
    \lst@token{}\lst@length\z@}
\def\lst@EmptyOutput{\let\lst@lastother\relax \lst@EmptyOutputOther}
\def\lst@EmptyGotoTabStop{%
    \global\advance\lst@column\lst@length \lst@length\z@}
\@ifundefined{lst@doc}{}{%
\newwrite\lstdoc@out
\def\lst@BeginWriteFile#1{%
    \begingroup %
    \lsthk@SetLanguage %
    \let\lstCC@ifec\iffalse %
    \let\lst@Output\lstdoc@Output %
    \let\lst@OutputOther\lstdoc@Output %
    \let\lst@GotoTabStop\lstdoc@GotoTabStop %
    \let\lstCC@ProcessSpace\lstdoc@ProcessSpace %
    \let\lst@MProcessListing\lstdoc@MProcessListing %
    \let\smallbreak\relax %
    \let\lst@prelisting\relax \let\lst@postlisting\relax %
    \let\lst@@prelisting\relax \let\lst@@postlisting\relax %
    \let\lstCC@Use\lstdoc@Use %
    \let\lst@DeInit\lstdoc@DeInit %
    \immediate\openout\lstdoc@out=#1\relax}
\def\lst@EndWriteFile{\immediate\closeout\lstdoc@out \endgroup}
\def\lstdoc@Output{\global\advance\lst@pos -\lst@length \lst@length\z@}
\def\lstdoc@ProcessSpace{\lstCC@Append{ }}
\def\lstdoc@GotoTabStop{%
    \@whilenum \lst@length>\z@ \do %
    {\lstCC@Append{ }\advance\lst@length-2\relax}}
\def\lstdoc@MProcessListing{%
    \immediate\write\lstdoc@out{\the\lst@token}%
    \lst@token{}\lst@length\z@ %
    \lst@BOLGobble}
\def\lstdoc@DeInit{%
    \ifnum\lst@length=\z@\else %
        \immediate\write\lstdoc@out{\the\lst@token}%
    \fi %
    \egroup \smallbreak\lst@postlisting \endgroup}
\def\lstdoc@Use#1#2#3{%
    \ifnum#2=\z@ %
        \expandafter\@gobbletwo %
    \else %
        \catcode#2=\active \lccode`\~=#2\lccode`\/=#2%
        \lowercase{\def~{\lstCC@Append{/}}}%
    \fi %
    \lstdoc@Use#1}
}% of \@ifundefined{lst@doc}{}{%
\def\lstCC@Append#1{\advance\lst@length\@ne %
    \expandafter\lst@token\expandafter{\the\lst@token#1}}
\def\lstCC@AppendOther#1{\advance\lst@length\@ne \let\lst@lastother#1%
    \expandafter\lst@token\expandafter{\the\lst@token#1}}
\def\lstCC@lettertrue{\let\lstCC@ifletter\iftrue}
\def\lstCC@letterfalse{\let\lstCC@ifletter\iffalse}
\lst@AddToHook{InitVars}{\lstCC@letterfalse}
\def\lst@PrintToken{%
    \lstCC@ifletter %
        \lst@Output\lstCC@letterfalse %
    \else %
        \lst@OutputOther \let\lst@lastother\@empty %
    \fi}
\def\lstCC@Def#1{\catcode#1=\active\lccode`\~=#1\lowercase{\def~}}
\def\lstCC@Let#1{\catcode#1=\active\lccode`\~=#1\lowercase{\let~}}
\begingroup \catcode`\"=12
\gdef\lst@SelectCharTable{%
    \lstCC@Tabulator{"09}%
    \lstCC@Space{"20}%
    \lstCC@Use \lstCC@ProcessOther %
        {"21}!{"22}"{"23}\#{"25}\%{"26}\&{"27}'{"28}({"29})%
        {"2A}\lst@asterisk{"2B}+{"2C},{"2D}\lst@minus{"2E}.%
        {"2F}/{"3A}:{"3B};{"3C}\lst@less{"3D}={"3E}\lst@greater{"3F}?%
        {"5B}[{"5C}\lst@backslash{"5D}]{"5E}\textasciicircum{"60}{`}%
        {"7B}\lst@lbrace{"7C}\lst@bar{"7D}\lst@rbrace %
        {"7E}\textasciitilde{"7F}-%
        \z@\@empty %
    \lstCC@Use \lstCC@ProcessDigit %
        {"30}0{"31}1{"32}2{"33}3{"34}4{"35}5{"36}6{"37}7{"38}8{"39}9%
        \z@\@empty %
    \lstCC@Use \lstCC@ProcessLetter %
        {"24}\lst@dollar{"40}@%
        {"41}A{"42}B{"43}C{"44}D{"45}E{"46}F{"47}G{"48}H{"49}I{"4A}J%
        {"4B}K{"4C}L{"4D}M{"4E}N{"4F}O{"50}P{"51}Q{"52}R{"53}S{"54}T%
        {"55}U{"56}V{"57}W{"58}X{"59}Y{"5A}Z{"5F}\lst@underscore %
        {"61}a{"62}b{"63}c{"64}d{"65}e{"66}f{"67}g{"68}h{"69}i{"6A}j%
        {"6B}k{"6C}l{"6D}m{"6E}n{"6F}o{"70}p{"71}q{"72}r{"73}s{"74}t%
        {"75}u{"76}v{"77}w{"78}x{"79}y{"7A}z%
        \z@\@empty %
    \lstCC@ifec \lstCC@DefEC \fi %
    \lsthk@SelectCharTable %
    \csname lstSCT@\lst@language\endcsname %
    \csname lstSCT@\lst@language @\lst@dialect\endcsname %
    \ifx\lstCC@Backslash\relax\else %
        \lccode`\~="5C\lowercase{\let\lsts@backslash~}%
        \lstCC@Let{"5C}\lstCC@Backslash %
    \fi}
\catcode`\^^@=12
\gdef\lstCC@DefEC{%
    \lstCC@ECUse \lstCC@ProcessLetter %
      ^^80^^81^^82^^83^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f%
      ^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d^^9e^^9f%
      ^^a0^^a1^^a2^^a3^^a4^^a5^^a6^^a7^^a8^^a9^^aa^^ab^^ac^^ad^^ae^^af%
      ^^b0^^b1^^b2^^b3^^b4^^b5^^b6^^b7^^b8^^b9^^ba^^bb^^bc^^bd^^be^^bf%
      ^^c0^^c1^^c2^^c3^^c4^^c5^^c6^^c7^^c8^^c9^^ca^^cb^^cc^^cd^^ce^^cf%
      ^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df%
      ^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef%
      ^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff%
      ^^00}
\endgroup
\lst@Aspect{extendedchars}[t]{\lstKV@SetIfKey\lstCC@ifec{#1}}
\lstset{extendedchars=false}% init
\def\lstCC@Use#1#2#3{%
    \ifnum#2=\z@ %
        \expandafter\@gobbletwo %
    \else %
        \catcode#2=\active \lccode`\~=#2\lowercase{\def~}{#1#3}%
    \fi %
    \lstCC@Use#1}
\def\lstCC@ECUse#1#2{%
    \ifnum`#2=\z@ %
        \expandafter\@gobbletwo %
    \else %
        \ifnum\catcode`#2=\active %
            \lccode`\~=`#2\lccode`\/=`#2\lowercase{\lstCC@ECUse@#1~/}%
        \else %
            \catcode`#2=\active \lccode`\~=`#2\lowercase{\def~}{#1#2}%
        \fi %
    \fi %
    \lstCC@ECUse#1}
\def\lstCC@ECUse@#1#2#3{%
   \expandafter\let\csname lsts@EC#3\endcsname #2%
   \edef#2{\noexpand#1\expandafter\noexpand\csname lsts@EC#3\endcsname}}
\def\lstCC@Tabulator#1{\lstCC@Let{#1}\lstCC@ProcessTabulator}
\def\lstCC@Space#1{\lstCC@Let{#1}\lstCC@ProcessSpace}
\def\lstCC@ChangeBasicClass#1#2{%
    \ifx\@empty#2\else %
        \expandafter\lst@MakeActive\expandafter{#2}%
        \expandafter\lstCC@CBC@\expandafter#1\lst@arg\@empty %
    \fi}
\def\lstCC@CBC@#1#2{%
    \ifx\@empty#2%
        \expandafter\@gobbletwo %
    \else %
        \expandafter\lstCC@CBC@@#2\lstCC@CBC@@#1#2%
    \fi %
    \lstCC@CBC@#1}
\def\lstCC@CBC@@#1#2\lstCC@CBC@@#3#4{\def#4{#3#2}}
\def\lstCC@ProcessLetter#1{%
    \lstCC@ifletter\else \lst@OutputOther\lstCC@lettertrue \fi %
    \lstCC@Append{#1}}
\def\lstCC@ProcessOther#1{%
    \lstCC@ifletter \lst@Output\lstCC@letterfalse \fi %
    \lstCC@AppendOther{#1}}
\def\lstCC@ProcessDigit#1{%
    \lstCC@ifletter \lstCC@Append{#1}\else \lstCC@AppendOther{#1}\fi}
\def\lstCC@ProcessTabulator{%
    \lst@PrintToken %
    \global\advance\lst@column -\lst@pos %
    \@whilenum \lst@pos<\@ne \do %
        {\global\advance\lst@pos\lst@tabsize}%
    \lst@length\lst@pos \global\lst@pos\z@ %}
    \lst@GotoTabStop}
\def\lstCC@AppendSpecialSpace{%
    \ifx\lst@lastother\lst@outputblank %
        \lst@OutputOther %
        \global\advance\lst@lostspace\lst@width %
        \global\advance\lst@pos\m@ne %
    \else %
        \lstCC@AppendOther\lst@outputblank %
    \fi}
\def\lst@outputblank{\ }
\def\lstCC@ProcessSpace{%
    \lstCC@ifletter %
        \lst@Output\lstCC@letterfalse %
        \lstCC@AppendOther\lst@outputblank %
    \else \ifnum\lst@mode=\lst@stringmode %
        \lstCC@AppendOther\lst@outputblank %
    \else \ifx\lst@NewLine\relax %
        \lstCC@AppendSpecialSpace %
    \else \ifnum\lst@length=\z@ %
            \global\advance\lst@lostspace\lst@width %
            \global\advance\lst@pos\m@ne %
        \else %
            \lstCC@AppendSpecialSpace %
        \fi %
    \fi \fi \fi}
\def\lst@legalstringizer{d,b,m,bd,db}
\lst@Aspect{stringizer}{\lstKV@OptArg\lststringizer@[d]{#1}}
\def\lststringizer@[#1]#2%
    {\lst@IfOneOf#1\relax \lst@legalstringizer %
         {\def\lst@DefStrings{\lstCC@Stringizer[#1]#2\@empty}}%
         {\PackageError{Listings}{Illegal stringizer type `#1'}%
          {Available types are \lst@legalstringizers.}}}
\lst@AddToHook{SetLanguage}{\let\lst@DefStrings\@empty}
\lst@AddToHook{SelectCharTable}{\lst@DefStrings}
\def\lstCC@Stringizer[#1]{%
    \expandafter\lstCC@Stringizer@ %
        \csname lstCC@ProcessStringizer@#1\endcsname}
\def\lstCC@Stringizer@#1#2{%
    \ifx\@empty#2%
        \expandafter\@gobbletwo %
    \else %
        \catcode`#2=\active \lccode`\~=`#2\lccode`\/=`#2%
        \lowercase{%
           \expandafter\let\csname lsts@s/\endcsname~%
           \def~{#1/}}%
    \fi %
    \lstCC@Stringizer@#1}
\def\lstCC@ProcessStringizer@d#1{%
    \lstCC@ifletter \lst@Output\lstCC@letterfalse \fi %
    \ifnum\lst@mode=\lst@stringmode %
        \csname lsts@s#1\endcsname %
        \ifx\lst@lastother\lstCC@closestring %
            \lstCC@EndString %
        \fi %
    \else %
        \lst@OutputOther %
        \lst@ifmode\else %
            \expandafter\expandafter\expandafter\lstCC@BeginString %
        \fi %
        \csname lsts@s#1\endcsname %
    \fi}
\def\lstCC@ProcessStringizer@b#1{%
    \lstCC@ifletter \lst@Output\lstCC@letterfalse \fi %
    \ifnum\lst@mode=\lst@stringmode %
        \let\lst@temp\lst@lastother \csname lsts@s#1\endcsname %
        \ifx\lst@temp\lst@backslash\else %!def of "005C
        \ifx\lst@lastother\lstCC@closestring %
            \lstCC@EndString %
        \fi \fi %
    \else %
        \lst@OutputOther %
        \lst@ifmode\else %
            \expandafter\expandafter\expandafter\lstCC@BeginString %
        \fi %
        \csname lsts@s#1\endcsname %
    \fi}
\let\lstCC@ProcessStringizer@bd\lstCC@ProcessStringizer@b
\let\lstCC@ProcessStringizer@db\lstCC@ProcessStringizer@bd
\def\lstCC@ProcessStringizer@m#1{%
    \ifnum\lst@mode=\lst@stringmode %
        \lstCC@ifletter \lst@Output\lstCC@letterfalse \fi %
        \csname lsts@s#1\endcsname %
        \ifx\lst@lastother\lstCC@closestring %
            \lstCC@EndString %
        \fi %
    \else %
        \lstCC@ifletter %
            \lst@Output\lstCC@letterfalse %
        \else %
            \lst@OutputOther %
            \let\lstCC@next\relax %
            \ifx\lst@lastother)\else \lst@ifmode\else %
                \let\lstCC@next\lstCC@BeginString %
            \fi \fi %
            \expandafter\expandafter\expandafter\lstCC@next %
        \fi %
        \csname lsts@s#1\endcsname %
    \fi}
\lst@Aspect{stringstyle}{\def\lst@stringstyle{#1}}
\lst@Aspect{blankstring}[t]{\lstKV@SetIfKey\lst@ifblankstring{#1}}
\lstset{blankstring=false}% init
\lst@AddToHook{BeforeSelectCharTable}
    {\setbox\@tempboxa\hbox{\lst@stringstyle \lst@loadfd}}
\lst@NewMode\lst@stringmode
\def\lstCC@BeginString#1{%
    \lst@NewLine %
    \lst@EnterMode{\lst@stringmode}{\lst@modetrue\lst@stringstyle}%
    #1%
    \let\lstCC@closestring\lst@lastother %
    \lst@ifblankstring\else \let\lst@outputblank\textvisiblespace \fi}
\def\lstCC@EndString{%
    \lst@OutputOther \lst@LeaveMode \lst@token{}\lst@length\z@}
\lst@Aspect{stringtest}[t]{\lstKV@SetIfKey\lst@ifstringtest{#1}}
\lst@AddToHook{SetLanguage}{\let\lst@ifstringtest\iftrue}
\lst@AddToHook{BeforeSelectCharTable}
    {\lst@ifstringtest\else \let\lst@TestStringMode\relax \fi}
\def\lst@TestStringMode{%
     \ifnum\lst@mode=\lst@stringmode %
         \PackageWarning{Listings}{String constant exceeds line}%
         \lst@LeaveMode \lst@token{}\lst@length\z@ %
     \fi}
\lst@AddToHook{EOL}{\lst@TestStringMode}
\lst@Aspect{commentstyle}{\def\lst@commentstyle{#1}}
\lst@AddToHook{BeforeSelectCharTable}
    {\setbox\@tempboxa\hbox{\lst@commentstyle \lst@loadfd}}
\def\lstCC@BeginComment#1{%
    \lst@NewLine \lst@PrintToken %
    \lst@EnterMode{#1}{\lst@modetrue\lst@commentstyle}}
\def\lstCC@@BeginComment#1#2#3{%
    \lst@NewLine \lst@PrintToken %
    \lst@EnterMode{#1}{\lst@modetrue\lst@commentstyle}%
    \lst@mode\lst@nomode #2\relax#3\relax \lst@mode#1\relax}
\def\lstCC@EndComment{%
    \lst@PrintToken \lst@LeaveMode \let\lst@lastother\@empty}
\begingroup \catcode`\^^@=\active
\gdef\lstCC@TestCArg#1#2#3\relax#4{%
    \lccode`\~=`#1\lccode`\/=`#1%
    \ifx\@empty#2%
        \lowercase{\def\lst@temp{~\@empty/}}%
    \else \lccode`\^^@=`#2%
        \lowercase{\def\lst@temp{~^^@/}}%
    \fi %
    \ifx\@empty#2\else \ifx\@empty#3\else \lstCC@TestCArgError \fi\fi %
    \expandafter #4\lst@temp}
\endgroup
\def\lstCC@TestCArgError{%
    \PackageError{Listings}{At most 2 characters allowed}%
    {The package doesn't provide more than two characters here.^^J%
     I'll simply use the first two only and proceed.}}
\lst@AddToHook{BeforeSelectCharTable}
    {\let\lstCC@next\relax \let\lstCC@bnext\relax\let\lstCC@enext\relax}
\lst@AddToHook{SetLanguage}
    {\let\lst@DefSC\relax \let\lst@DefNC\relax \let\lst@DefDC\relax %
     \let\lst@DefCL\relax \let\lst@DefFCL\relax}
\lst@AddToHook{SelectCharTable}
    {\lst@DefSC \lst@DefNC \lst@DefDC \lst@DefCL \lst@DefFCL}
\lst@Aspect{commentline}{\def\lst@DefCL{\lstCC@CommentLine{#1}}}
\def\lstCC@CommentLine#1{%
    \ifx\@empty#1\@empty\else %
        \lstCC@TestCArg#1\@empty\relax\lstCC@CommentLine@ %
    \fi}
\def\lstCC@CommentLine@#1#2#3{%
    \expandafter\let\csname lsts@CL#3\endcsname#1%
    \ifx\@empty#2%
        \def#1{%
            \lst@ifmode \let\lstCC@next\relax \else %
                \let\lstCC@next\lstCC@BeginCommentLine %
            \fi %
            \expandafter\lstCC@next \csname lsts@CL#3\endcsname}%
    \else %
        \def#1##1{%
            \let\lstCC@next\relax %
            \lst@ifmode\else \ifx##1#2%
                \let\lstCC@next\lstCC@@BeginCommentLine %
            \fi \fi %
            \expandafter\lstCC@next \csname lsts@CL#3\endcsname##1}%
    \fi}
\lst@Aspect{fixedcommentline}{\lstKV@OptArg\lstfcommentline@[0]{#1}}
\def\lstfcommentline@[#1]#2%
    {\def\lst@DefFCL{\lstCC@FixedCL[#1]#2\@empty}}
\lst@NewMode\lst@FCLmode
\def\lstCC@FixedCL[#1]#2{%
    \ifx\@empty#2\else %
        \lccode`\~=`#2\lccode`\/=`#2%
        \lowercase{\lstCC@FixedCL@~/}{#1}%
        \def\lstCC@next{\lstCC@FixedCL[#1]}%
        \expandafter\lstCC@next %
    \fi}
\def\lstCC@FixedCL@#1#2#3{%
    \expandafter\let\csname lsts@FCL#2\endcsname#1%
    \def#1{\let\lstCC@next\relax %
        \lst@ifmode\else %
            \@tempcnta\lst@column %
            \advance\@tempcnta\lst@length %
            \advance\@tempcnta-\lst@pos %
            \ifnum\@tempcnta=#3%
                \let\lstCC@next\lstCC@BeginCommentLine %
            \fi %
        \fi %
        \expandafter\lstCC@next \csname lsts@FCL#2\endcsname}}
\lst@Aspect{singlecomment}{\def\lst@DefSC{\lstCC@SingleComment#1{}}}
\lst@Aspect{doublecomment}{\def\lst@DefDC{\lstCC@DoubleComment#1{}{}{}}}
\lst@NewMode\lst@SCmode \lst@NewMode\lst@DCmodeA\lst@NewMode\lst@DCmodeB
\def\lstCC@SingleComment#1#2{%
    \ifx\@empty#1\@empty\else %
        \lstCC@TestCArg#1\@empty\relax\lstCC@CommentB{SC}\lst@SCmode %
        \lstCC@TestCArg#2\@empty\relax\lstCC@CommentE{SC}\lst@SCmode %
    \fi}
\def\lstCC@DoubleComment#1#2#3#4{%
    \ifx\@empty#1\@empty\else %
        \lstCC@TestCArg#1\@empty\relax\lstCC@CommentB{DCA}\lst@DCmodeA %
        \lstCC@TestCArg#3\@empty\relax\lstCC@CommentB{DCB}\lst@DCmodeB %
        \lstCC@TestCArg#2\@empty\relax\lstCC@CommentE{DCA}\lst@DCmodeA %
        \lstCC@TestCArg#4\@empty\relax\lstCC@CommentE{DCB}\lst@DCmodeB %
    \fi}
\def\lstCC@CommentB#1#2#3#4#5{%
    \expandafter\let\csname lsts@B#4#3\endcsname#1%
    \ifx\@empty#2%
        \def#1{%
            \lst@ifmode \let\lstCC@bnext\relax \else %
                \def\lstCC@bnext{\lstCC@BeginComment#5}%
            \fi %
            \lstCC@bnext \csname lsts@B#4#3\endcsname}%
    \else %
        \def#1##1{%
            \let\lstCC@bnext\relax %
            \lst@ifmode\else \ifx##1#2%
                \def\lstCC@bnext{\lstCC@@BeginComment#5}%
            \fi \fi %
            \expandafter\lstCC@bnext \csname lsts@B#4#3\endcsname##1}%
    \fi}
\def\lstCC@CommentE#1#2#3#4#5{%
    \expandafter\let\csname lsts@E#4#3\endcsname#1%
    \ifx\@empty#2%
        \def#1{%
            \def\lstCC@enext{\csname lsts@E#4#3\endcsname}%
            \lst@ifmode \ifnum\lst@mode=#5%
                \def\lstCC@enext{\csname lsts@E#4#3\endcsname %
                    \lstCC@EndComment}%
            \fi \fi %
            \lstCC@enext}%
    \else %
        \def#1##1{%
            \def\lstCC@enext{\csname lsts@E#4#3\endcsname ##1}%
            \lst@ifmode \ifnum\lst@mode=#5\ifx##1#2%
                \def\lstCC@enext{\csname lsts@E#4#3\endcsname ##1%
                    \lstCC@EndComment}%
            \fi \fi \fi %
            \lstCC@enext}%
    \fi}
\lst@Aspect{nestedcomment}{\lstnestedcomment@#1}
\def\lstnestedcomment@#1#2%
    {\def\@tempa{#1}\def\@tempb{#2}%
     \ifx\@tempa\@tempb \ifx\@tempa\@empty\else %
         \PackageError{Listings}{Identical delimitors}%
         {These delimitors make no sense with nested comments.}%
     \fi \fi %
     \def\lst@DefNC{\lstCC@NestedComment{#1}{#2}}}
\def\lstCC@NestedComment#1#2{%
    \ifx\@empty#1\@empty\else %
        \lstCC@TestCArg#2\@empty\relax\lstCC@NCommentE %
        \lstCC@TestCArg#1\@empty\relax\lstCC@NCommentB %
    \fi}
\def\lstCC@NCommentB#1#2#3{%
    \let\lsts@BNC #1%
    \ifx\@empty#2%
        \def#1{%
            \let\lstCC@bnext\relax %
            \lst@ifmode %
                \ifnum\lst@mode<\z@ %
                    \advance\lst@mode\m@ne %
                \fi %
            \else %
                \def\lstCC@bnext{\lstCC@BeginComment\m@ne}%
            \fi %
            \lstCC@bnext \lsts@BNC}%
    \else %
        \def#1##1{%
            \let\lstCC@bnext\relax %
            \lst@ifmode %
                \ifnum\lst@mode<\z@ \ifx##1#2%
                    \advance\lst@mode\m@ne %
                \fi \fi %
            \else %
                \ifx##1#2%
                    \def\lstCC@bnext{\lstCC@@BeginComment\m@ne}%
                \fi %
            \fi %
            \lstCC@bnext \lsts@BNC ##1}%
    \fi}
\def\lstCC@NCommentE#1#2#3{%
    \let\lsts@ENC #1%
    \ifx\@empty#2%
        \def#1{%
            \let\lstCC@enext\relax %
            \lst@ifmode \ifnum\lst@mode<\z@ %
                \ifnum\lst@mode=\m@ne %
                    \let\lstCC@enext\lstCC@EndComment %
                \else %
                    \advance\lst@mode\@ne %
                \fi
            \fi \fi %
            \lsts@ENC \lstCC@enext}%
    \else %
        \def#1##1{%
            \def\lstCC@enext{\lsts@ENC ##1}%
            \ifx##1#2%
                \lst@ifmode \ifnum\lst@mode<\z@ %
                    \ifnum\lst@mode=\m@ne %
                        \def\lstCC@enext{%
                            \lsts@ENC ##1\lstCC@EndComment}%
                    \else %
                        \advance\lst@mode\@ne %
                    \fi
                \fi \fi %
            \fi %
            \lstCC@enext}%
    \fi}
\def\lstCC@Escape#1{\lccode`\~=`#1\lowercase{\lstCC@Escape@~}}
\def\lstCC@Escape@#1#2#3{%
    \def#1{%
        \lst@NewLine\lst@UseLostSpace \lst@PrintToken %
        \lst@InterruptModes %
        \lst@EnterMode{\lst@TeXmode}{\lst@modetrue}%
        \catcode`#1=\active %
        \def#1{#3\lst@LeaveAllModes \lst@ReenterModes}%
        #2}}
\lst@NewMode\lst@TeXmode
\lst@Aspect{escapechar}
    {\ifx\@empty#1\@empty %
         \let\lst@DefEsc\relax %
     \else %
         \def\lst@DefEsc{\lstCC@Escape{#1}\@empty\@empty}%
     \fi}
\lstset{escapechar={}}% init
\lst@AddToHook{SelectCharTable}{\lst@DefEsc}
\lst@Aspect{mathescape}[t]{\lstKV@SetIfKey\lst@ifmathescape{#1}}
\lstset{mathescape=false}% init
\lst@AddToHook{SelectCharTable}
    {\lst@ifmathescape \lstCC@Escape{\$}{$}{$}\fi}
\def\lst@DontEscapeToLaTeX{%
    \let\lst@iftexcl\iffalse %
    \let\lst@DefEsc\relax %
    \let\lst@ifmathescape\iffalse}
\lst@Aspect{formfeed}{\def\lst@formfeed{#1}}
\lstset{formfeed=\bigbreak}% init
\lst@AddToHook{SelectCharTable}{\lstCC@Let{`\^^L}\lstCC@FormFeed}
\def\lstCC@FormFeed{%
    \lst@PrintToken %
    \ifx\lst@NewLine\relax %
        \lst@EOLUpdate \lst@formfeed %
    \else %
        \lst@lAddTo\lst@NewLine{\lst@EOLUpdate \lst@formfeed}%
    \fi}
\lstset{labelsep=5pt,sensitive=true}
\lstdefinelanguage{}{}
\lstdefinestyle{}
    {basicstyle={},%
     keywordstyle=\bfseries,nonkeywordstyle={},%
     commentstyle=\itshape,stringstyle={},%
     labelstyle={},labelstep=0}
\lst@mode=\z@
\lstset{language={},style={}}
\@ifundefined{lst@0.17}{}{\input{lst017.sty}}
\InputIfFileExists{lstpatch.sty}{}{}
\InputIfFileExists{listings.cfg}{}{}
\lst@Aspect{fancyvrb}[t]{%
    \lstKV@SetIfKey\lst@iffancyvrb{#1}%
    \lstfancyvrb@}
\def\lstfancyvrb@{\input{lstfvrb.sty}\lstfancyvrb@}
\endinput
%%
%% End of file `listings.sty'.
