%%
%% This is file `listings.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% listings.dtx  (with options: `kernel')
%% 
%% Please read the software license in listings.dtx or listings.dvi.
%%
%% (w)(c) 1996/1997/1998/1999 Carsten Heinz and/or any other author
%% listed elsewhere in this file.
%%
%% This file is distributed under the terms of the LaTeX Project Public
%% License from CTAN archives in directory  macros/latex/base/lppl.txt.
%% Either version 1.0 or, at your option, any later version.
%%
%% The listings package is free software.
%%
%% However, if you distribute the package as part of a commercial
%% product or if you use the package to prepare a document and sell the
%% document (books, journals, and so on), I'd like to encourage you to
%% make a donation to the LaTeX3 fund. The size of this `license fee'
%% should depend on the value of the package for your product.
%%
%% If you use the package to typeset a non-commercial document, please
%% send me a copy of the document (hardcopy, .dvi, .ps, .pdf, etc.) to
%% support further development.
%%
%% Permission is granted to change this file. You are not allowed to
%% distribute any changed version of this file, neither under the same
%% name nor under a different one.
%%
%% Send comments and ideas on the package, error reports and additional
%% programming languages to <cheinz@gmx.de>.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{listings}[1999/07/12 v0.20 (Carsten Heinz)]
\def\lst@version{0.20}
\def\lst@InputCatcodes{%
    \makeatletter \catcode`\"=12%
    \catcode`\^^@=\active
    \catcode`\^^I9%
    \catcode`\^^M9%
    \catcode`\~=\active}
\def\lst@RestoreCatcodes#1{%
    \ifx\relax#1\else
        \noexpand\catcode`\noexpand#1\the\catcode`#1\relax
        \expandafter\lst@RestoreCatcodes
    \fi}
\edef\lst@RestoreCatcodes{%
    \lst@RestoreCatcodes\"\^^I\^^M\~\^^@\relax}
\lst@InputCatcodes
\def\lst@IfSubstring#1#2{%
    \def\lst@temp##1#1##2##3\relax{%
        \ifx \@empty##2\expandafter\@secondoftwo
                 \else \expandafter\@firstoftwo \fi}%
    \expandafter\lst@temp#2#1\@empty\relax}
\def\lst@IfOneOf#1\relax#2{%
    \def\lst@temp##1,#1,##2##3\relax{%
        \ifx \@empty##2\expandafter\@secondoftwo
                 \else \expandafter\@firstoftwo \fi}%
    \expandafter\lst@temp\expandafter,#2,#1,\@empty\relax}
\def\lst@DeleteKeysIn#1#2{%
    \expandafter\lst@DeleteKeysIn@\expandafter#1#2,\relax,}
\def\lst@DeleteKeysIn@#1#2,{%
    \ifx\relax#2\@empty
        \expandafter\@firstoftwo\expandafter\lst@RemoveCommas
    \else
        \ifx\@empty#2\@empty\else
            \def\lst@temp##1,#2,##2{%
                \ifx\@empty##2%
                    \lst@lAddTo#1{##1}%
                \else
                    \lst@lAddTo#1{,##1}%
                    \expandafter\lst@temp\expandafter,%
                \fi ##2}%
            \let\@tempa#1\let#1\@empty
            \expandafter\lst@temp\expandafter,\@tempa,#2,\@empty
        \fi
    \fi
    \lst@DeleteKeysIn@#1}
\def\lst@RemoveCommas#1{\expandafter\lst@RC@#1\@empty #1}
\def\lst@RC@#1{%
    \ifx,#1%
        \expandafter\lst@RC@
    \else
        \expandafter\lst@RC@@\expandafter#1%
    \fi}
\def\lst@RC@@#1\@empty#2{\def#2{#1}}
\def\lst@ReplaceIn#1#2{%
    \expandafter\lst@ReplaceIn@\expandafter#1#2\@empty\@empty}
\def\lst@ReplaceInArg#1#2{\lst@ReplaceIn@#1#2\@empty\@empty}
\def\lst@ReplaceIn@#1#2#3{%
    \ifx\@empty#3\relax\else
        \def\lst@temp##1#2##2{%
            \ifx\@empty##2%
                \lst@lAddTo#1{##1}%
            \else
                \lst@lAddTo#1{##1#3}\expandafter\lst@temp
            \fi ##2}%
        \let\@tempa#1\let#1\@empty
        \expandafter\lst@temp\@tempa#2\@empty
        \expandafter\lst@ReplaceIn@\expandafter#1%
    \fi}
\def\lst@IfNextCharsArg#1{%
    \def\lst@tofind{#1}\lst@IfNextChars\lst@tofind}
\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@{\expandafter\lst@IfNextChars@@\lst@tofind\relax}
\def\lst@IfNextChars@@#1#2\relax#3{%
    \def\lst@tofind{#2}\lst@lAddTo\lst@eaten{#3}%
    \ifx#1#3%
        \ifx\lst@tofind\@empty
            \let\lst@next\@tempa
        \else
            \let\lst@next\lst@IfNextChars@
        \fi
        \expandafter\lst@next
    \else
        \expandafter\@tempb
    \fi}
\def\lst@IfNextCharActive#1#2#3{%
    \begingroup \lccode`\~=`#3\lowercase{\endgroup
    \ifx~}#3%
        \def\lst@next{#1}%
    \else
        \def\lst@next{#2}%
    \fi \lst@next #3}
\def\lst@for#1\do#2{%
    \def\lst@forbody##1{#2}%
    \@for\lst@forvar:=#1\do
    {\expandafter\lst@forbody\expandafter{\lst@forvar}}}
\begingroup \lccode`\~=`\^^M\lowercase{%
\gdef\lst@TestEOLChar#1{%
    \ifx ~#1\@empty \lst@EOLCharError \else
    \ifx^^J#1\@empty \lst@EOLCharError \else
        \gdef\lst@intname{#1}%
    \fi \fi}
}\endgroup
\def\lst@EOLCharError{%
    \PackageError{Listings}%
    {Oops! It seems you've forgotten the argument to\MessageBreak
     a listing environment. Assuming empty argument}%
    {Type <RETURN> to proceed.}}
\def\lst@MakeActive#1{%
    \let\lst@temp\@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@temp{^^@}}%
    \else \lccode`\^^A=`#2%
    \ifx#3\relax %
        \lowercase{\lst@lAddTo\lst@temp{^^@^^A}}%
    \else \lccode`\^^B=`#3%
    \ifx#4\relax %
        \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B}}%
    \else \lccode`\^^C=`#4%
    \ifx#5\relax %
        \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C}}%
    \else \lccode`\^^D=`#5%
    \ifx#6\relax %
        \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D}}%
    \else \lccode`\^^E=`#6%
    \ifx#7\relax %
        \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E}}%
    \else \lccode`\^^F=`#7%
    \ifx#8\relax %
        \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F}}%
    \else \lccode`\^^G=`#8%
    \ifx#9\relax %
        \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F^^G}}%
    \else \lccode`\^^H=`#9%
        \lowercase{\lst@lAddTo\lst@temp{^^@^^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@DefActive#1#2{\lst@MakeActive{#2}\let#1\lst@temp}
\def\lst@DefOther#1#2{%
    \begingroup \def#1{#2}\escapechar\m@ne \expandafter\endgroup
    \expandafter\lst@DefOther@\meaning#1\relax#1}
\def\lst@DefOther@#1->#2\relax#3{\edef#3{\zap@space#2 \@empty}}
\def\lst@InsideConvert#1{\lst@InsideConvert@#1 \@empty}
\begingroup \lccode`\~=`\ \relax \lowercase{%
\gdef\lst@InsideConvert@#1 #2{%
    \lst@MakeActive{#1}%
    \ifx\@empty#2%
        \lst@lExtend\lst@arg{\lst@temp}%
    \else
        \lst@lExtend\lst@arg{\lst@temp~}%
        \expandafter\lst@InsideConvert@
    \fi #2}
}\endgroup
\gdef\lst@FVConvert{%
    \@ifnextchar\bgroup{\lst@FVConvertArg}{\lst@FVConvert@}}%
\gdef\lst@FVConvertArg#1{%
    {\let\lst@arg\@empty \lst@FVConvert#1@\global\let\@gtempa\lst@arg}%
     \lst@lExtend\lst@arg{\expandafter{\@gtempa\lst@PrintToken}}%
     \lst@FVConvert}
\gdef\lst@FVConvert@#1{%
    \ifx @#1\else
        \if\relax\noexpand#1%
            \lst@lAddTo\lst@arg{\lst@UseLostSpace\lst@PrintToken#1}%
        \else
            \lccode`\~=`#1\lowercase{\lst@lAddTo\lst@arg~}%
        \fi
        \expandafter\lst@FVConvert
    \fi}
\global\let\lst@loadedaspects\@empty % init % \global
\newcommand*\lst@BeginAspect[2][]{%
    \ifx\@empty#2\@empty
        \expandafter\lst@GobbleAspect
    \else
        \def\lst@curraspect{#2}%
        \def\lst@next{\lst@AddTo\lst@loadedaspects{,#2}}%
        \lst@IfOneOf#2\relax\lst@loadedaspects
            {\let\lst@next\lst@GobbleAspect}%
            {\ifx\lst@loadaspects\@undefined\else
                 \lst@IfOneOf#2\relax\lst@loadaspects
                     {}{\let\lst@next\lst@GobbleAspect}%
             \fi}%
        \ifx\lst@next\lst@GobbleAspect\else \ifx\@empty#1\@empty\else
            \lst@RequireAspects{#1}%
            \lst@ifRAloaded\else \let\lst@next\lst@GobbleAspect \fi
        \fi \fi
        \expandafter\lst@next
    \fi}
\def\lst@EndAspect{%
    \csname lstpatch@\lst@curraspect\endcsname
    \let\lst@curraspect\@empty}
\long\def\lst@GobbleAspect#1\lst@EndAspect{\let\lst@curraspect\@empty}
\def\lst@RequireAspects#1{%
    \begingroup
    \edef\lst@loadaspects{#1}\lst@ReplaceInArg\lst@loadaspects{{ }{}}%
    \lst@DeleteKeysIn\lst@loadaspects\lst@loadedaspects
    \global\let\lst@ifRAloaded\iftrue
    \ifx\lst@loadaspects\@empty\else
        \lst@InputCatcodes \input{lstmisc.sty}%
        \lst@DeleteKeysIn\lst@loadaspects\lst@loadedaspects
        \ifx\lst@loadaspects\@empty\else
            \global\lst@RAloadedfalse
            \PackageError{Listings}{Couldn't load requested aspects}%
            {The following aspects weren't loadable:^^J\@spaces
             \lst@loadaspects^^JThis may cause errors in the sequel.}%
        \fi
    \fi
    \endgroup}
\def\lst@RAloadedfalse{\let\lst@ifRAloaded\iffalse}
\lst@RAloadedfalse
\let\lstloadaspects\lst@RequireAspects
\let\lst@UserCommand\gdef
\def\lst@Key#1#2{%
    \@ifnextchar[{\lstKV@def{#1}{#2}}%
                 {\def\lst@temp{\lst@Key@{#1}{#2}}
                  \afterassignment\lst@temp
                  \global\@namedef{KV@lst@#1}####1}}
\def\lstKV@def#1#2[#3]{%
    \global\@namedef{KV@lst@#1@default\expandafter}\expandafter
        {\csname KV@lst@#1\endcsname{#3}}%
    \def\lst@temp{\lst@Key@{#1}{#2}}\afterassignment\lst@temp
    \global\@namedef{KV@lst@#1}##1}
\def\lst@Key@#1#2{%
    \ifx\relax#2\@empty\else
        \begingroup \globaldefs\@ne
        \csname KV@lst@#1\endcsname{#2}%
        \endgroup
    \fi}
\def\lst@UseHook#1{\csname lsthk@#1\endcsname}
\def\lst@AddToHook{\lst@ATH@\iffalse\lst@AddTo}
\def\lst@AddToHookExe{\lst@ATH@\iftrue\lst@AddTo}
\def\lst@AddToHookAtTop{\lst@ATH@\iffalse\lst@AddToAtTop}
\long\def\lst@ATH@#1#2#3#4{%
    \@ifundefined{lsthk@#3}{%
        \expandafter\gdef\csname lsthk@#3\endcsname{}}{}%
    \expandafter#2\csname lsthk@#3\endcsname{#4}%
    \def\lst@temp{#4}%
    #1% \iftrue|false
        \begingroup \globaldefs\@ne \lst@temp \endgroup
    \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}}
\def\lst@Extend#1#2{%
    \expandafter\lst@AddTo\expandafter#1\expandafter{#2}}
\def\lst@lExtend#1#2{%
    \expandafter\lst@lAddTo\expandafter#1\expandafter{#2}}
\RequirePackage{keyval}[1997/11/10]
\def\lstKV@TwoArg#1#2{\def\lst@temp##1##2{#2}\lst@temp#1{}{}}
\def\lstKV@ThreeArg#1#2{\def\lst@temp##1##2##3{#2}\lst@temp#1{}{}{}}
\def\lstKV@FourArg#1#2{\def\lst@temp##1##2##3##4{#2}\lst@temp#1{}{}{}{}}
\def\lstKV@OptArg[#1]#2#3{%
    \gdef\@gtempa[##1]##2\@{#3}\lstKV@OptArg@{#1}#2\@}
\def\lstKV@OptArg@#1{\@ifnextchar[\@gtempa{\@gtempa[#1]}}
\def\lstKV@CSTwoArg#1#2{%
    \gdef\@gtempa##1,##2,##3\relax{#2}%
    \@gtempa#1,,\relax}
\def\lstKV@SetIf#1{\lstKV@SetIf@#1\relax}
\def\lstKV@SetIf@#1#2\relax#3{\lowercase{%
    \expandafter\let\expandafter#3%
        \csname \ifx #1t}iftrue\else iffalse\fi\endcsname}
\lst@UserCommand\lstset{\begingroup \lstset@catcodes \lstset@}
\def\lstset@#1{\endgroup \ifx\@empty#1\@empty\else\setkeys{lst}{#1}\fi}
\def\lstset@catcodes{\makeatletter \catcode`\"=12\relax}
\def\lst@NewMode#1{%
    \ifx\@undefined#1%
        \lst@mode\lst@newmode\relax \advance\lst@mode\@ne
        \xdef\lst@newmode{\the\lst@mode}%
        \global\chardef#1=\lst@mode
        \lst@mode\lst@nomode
    \fi}
\newcount\lst@mode
\def\lst@newmode{\m@ne}% init
\lst@NewMode\lst@nomode % init (of \lst@mode :-)
\def\lst@modetrue{\let\lst@ifmode\iftrue \lsthk@ModeTrue}
\let\lst@ifmode\iffalse % init
\lst@AddToHook{ModeTrue}{}% init
\def\lst@EnterMode#1#2{%
    \bgroup \lst@mode=#1\relax #2%
    \lst@iffontadjust \lsthk@FontAdjust \fi
    \lst@lAddTo\lst@entermodes{\lst@EnterMode{#1}{#2}}}
\lst@AddToHook{InitVars}{\let\lst@entermodes\@empty}
\def\lst@LeaveMode{%
    \ifnum\lst@mode=\lst@nomode\else
        \egroup \expandafter\lsthk@EndGroup
    \fi}
\lst@AddToHook{EndGroup}{}% init
\def\lst@InterruptModes{%
    \ifx\lst@entermodes\@empty\else
        \global\let\lst@reenter\lst@entermodes
        \lst@LeaveAllModes
    \fi}
\lst@AddToHook{InitVars}{\global\let\lst@reenter\@empty}
\def\lst@ReenterModes{%
    \ifx\lst@reenter\@empty\else
        \lst@LeaveAllModes \lst@reenter
        \global\let\lst@reenter\@empty
    \fi}
\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@Pmode
\lst@NewMode\lst@GPmode
\newtoks\lst@token \newcount\lst@length
\lst@AddToHook{InitVarsBOL}{\lst@token{}\lst@length\z@}
\lst@AddToHook{InitVarsBOL}{\let\lst@lastother\@empty}
\def\lst@Append#1{\advance\lst@length\@ne
    \expandafter\lst@token\expandafter{\the\lst@token#1}}
\def\lst@AppendOther#1{\let\lst@lastother=#1\advance\lst@length\@ne
    \expandafter\lst@token\expandafter{\the\lst@token#1}}
\def\lst@lettertrue{\let\lst@ifletter\iftrue}
\def\lst@letterfalse{\let\lst@ifletter\iffalse}
\lst@AddToHook{InitVars}{\lst@letterfalse}
\def\lst@PrintToken{%
    \lst@ifletter
        \lst@Output\lst@letterfalse
    \else
        \lst@OutputOther \let\lst@lastother\@empty
    \fi}
\def\lst@CArg#1#2#3\relax{%
    \lst@DefActive\lst@arg{#2#3}%
    \lccode`\/=`#2\lowercase{\def\lst@temp{/}}%
    \lst@CArg@{#1}}
\def\lst@CArg@#1{%
    \expandafter\ifx\csname lsts@#1\lst@temp\endcsname\relax
        \def\lst@next{\expandafter\lst@CArg@@
            \csname lsts@#1\lst@temp\expandafter\endcsname\lst@arg
            \@empty\@empty\relax}%
    \else
        \def\lst@next{\lst@CArg@{#1@}}%
    \fi \lst@next}
\def\lst@CArg@@#1#2#3#4\@empty#5\relax#6{#6#2#3{#4}#1}
\def\lst@ProcessLetter#1{%
    \lst@ifletter\else \lst@OutputOther\lst@lettertrue \fi
    \lst@Append{#1}}
\def\lst@ProcessOther#1{%
    \lst@ifletter \lst@Output\lst@letterfalse \fi
    \lst@AppendOther{#1}}
\def\lst@ProcessDigit#1{%
    \lst@ifletter \lst@Append{#1}\else \lst@AppendOther{#1}\fi}
\lst@AddToHook{OmegaOutputBox}
    {\let\lst@ProcessLetter\@firstofone
     \let\lst@ProcessDigit\@firstofone
     \let\lst@ProcessOther\@firstofone}
\lst@Key{tabsize}{8}
    {\ifnum#1>\z@ \def\lst@tabsize{#1}\else
         \PackageError{Listings}{Strict positive integer expected}%
         {You can't use `#1' as tabulator size.^^J%
          Type <RETURN> to forget it and to proceed.}%
     \fi}
\def\lst@ProcessTabulator{%
    \lst@PrintToken \lst@letterfalse
    \global\advance\lst@column -\lst@pos
    \@whilenum \lst@pos<\@ne \do
        {\global\advance\lst@pos\lst@tabsize}%
    \lst@length\lst@pos
    \lst@PreGotoTabStop}
\def\lst@PreGotoTabStop{%
    \lst@ifvisibletabs
        \setbox\@tempboxa\hbox to\lst@length\lst@width{\hss\lst@tab}%
        \lst@NewLine \lst@CalcLostSpaceAndOutput
    \else
        \lst@ifkeepspaces
            \@tempcnta\lst@length \lst@length\z@
            \@whilenum \@tempcnta>\z@ \do
                {\lst@AppendOther\lst@outputspace
                 \advance\@tempcnta\m@ne}%
            \lst@OutputOther
        \else
            \lst@GotoTabStop
        \fi
    \fi
\global\lst@pos\z@}
\lst@Key{visibletabs}f[t]{\lstKV@SetIf{#1}\lst@ifvisibletabs}
\lst@Key{tab}{\kern.06em\hbox{\vrule\@height.3ex}%
              \hrulefill\hbox{\vrule\@height.3ex}}
    {\def\lst@tab{#1}}
\def\lst@outputspace{\ }
\def\lst@visiblespace{\lst@ttfamily{\char32}\textvisiblespace}
\lst@Key{visiblespaces}{false}[t]{\lstKV@SetIf{#1}\lst@ifkeepspaces}
\lst@AddToHook{Init}
    {\lst@ifkeepspaces \let\lst@outputspace\lst@visiblespace \fi}
\def\lst@ProcessSpace{%
    \lst@ifletter
        \lst@Output\lst@letterfalse
        \lst@AppendOther\lst@outputspace
    \else \lst@ifkeepspaces
        \lst@AppendOther\lst@outputspace
    \else \ifx\lst@NewLine\relax
        \lst@AppendSpecialSpace
    \else \ifnum\lst@length=\z@
            \global\advance\lst@lostspace\lst@width
            \global\advance\lst@pos\m@ne
        \else
            \lst@AppendSpecialSpace
        \fi
    \fi \fi \fi}
\def\lst@AppendSpecialSpace{%
    \ifx\lst@lastother\lst@outputspace
        \lst@OutputOther
        \global\advance\lst@lostspace\lst@width
        \global\advance\lst@pos\m@ne
    \else
        \lst@AppendOther\lst@outputspace
    \fi}
\lst@Key{formfeed}{\bigbreak}{\def\lst@formfeed{#1}}
\def\lst@ProcessFormFeed{%
    \lst@PrintToken
    \ifx\lst@NewLine\relax
        \lst@EOLUpdate \lst@formfeed
    \else
        \lst@lAddTo\lst@NewLine{\lst@EOLUpdate \lst@formfeed}%
    \fi}
\def\lst@Def#1{\lccode`\~=#1\lowercase{\def~}}
\def\lst@Let#1{\lccode`\~=#1\lowercase{\let~}}
\def\lst@SaveDef#1#2{%
    \begingroup \lccode`\~=#1\relax \lowercase{\endgroup\let#2~}}
\def\lst@DefSaveDef#1#2{%
    \begingroup \lccode`\~=#1\relax \lowercase{\endgroup\let#2~\def~}}
\def\lst@LetSaveDef#1#2{%
    \begingroup \lccode`\~=#1\relax \lowercase{\endgroup\let#2~\let~}}
\def\lst@SelectStdCharTable{%
    \lst@Let{9}\lst@ProcessTabulator
    \lst@Let{12}\lst@ProcessFormFeed
    \lst@Let{32}\lst@ProcessSpace}
\def\lst@CCUse#1#2#3{%
    \ifnum#2=\z@
        \expandafter\@gobbletwo
    \else
        \lccode`\~=#2\lowercase{\lst@CCUse@~}{#1#3}%
    \fi
    \lst@CCUse#1}
\def\lst@CCUse@#1#2{\lst@lAddTo\lst@SelectStdCharTable{\def#1{#2}}}
\lst@CCUse \lst@ProcessOther
    {"21}!{"22}"{"27}'{"28}({"29}){"2B}+{"2C},{"2E}.{"2F}/
    {"3A}:{"3B};{"3D}={"3F}?{"5B}[{"5D}]{"60}{`}{"7F}-
    \z@\@empty
\lst@CCUse \lst@ProcessDigit
    {"30}0{"31}1{"32}2{"33}3{"34}4{"35}5{"36}6{"37}7{"38}8{"39}9
    \z@\@empty
\lst@CCUse \lst@ProcessLetter
    {"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
    {"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
\def\lst@CCUseMacro#1#2#3{%
    \ifnum#2=\z@ \else
        \begingroup\lccode`\~=#2\relax \lccode`\/=#2\relax
        \lowercase{\endgroup\expandafter\lst@CCUseMacro@
            \csname lstum@/\expandafter\endcsname
            \csname lstum@/@\endcsname /~}#1{#3}%
        \expandafter\lst@CCUseMacro
    \fi}
\def\lst@CCUseMacro@#1#2#3#4#5#6{%
    \lst@lAddTo\lst@SelectStdCharTable{\def#4{#5#1}}%
    \def#1{\lst@UM#3}%
    \def#2{#6}}
\def\lst@UM#1{\csname lstum@#1@\endcsname}
\lst@CCUseMacro
    \lst@ProcessOther{"23}\#
    \lst@ProcessLetter{"24}\textdollar
    \lst@ProcessOther{"25}\%
    \lst@ProcessOther{"26}\&
    \lst@ProcessOther{"2A}{\lst@ttfamily*\textasteriskcentered}
    \lst@ProcessOther{"2D}{\lst@ttfamily{-{}}{$-$}}
    \lst@ProcessOther{"3C}{\lst@ttfamily<\textless}
    \lst@ProcessOther{"3E}{\lst@ttfamily>\textgreater}
    \lst@ProcessOther{"5C}{\lst@ttfamily{\char92}\textbackslash}
    \lst@ProcessOther{"5E}\textasciicircum
    \lst@ProcessOther{"7B}{\lst@ttfamily{\char123}\textbraceleft}
    \lst@ProcessOther{"7C}{\lst@ttfamily|\textbar}
    \lst@ProcessOther{"7D}{\lst@ttfamily{\char125}\textbraceright}
    \lst@ProcessOther{"7E}\textasciitilde
    \lst@ProcessLetter{"5F}{\lst@ttfamily{\char95}\textunderscore}
    \@empty\z@\@empty
\def\lst@ttfamily#1#2{\ifx\f@family\ttdefault#1\else#2\fi}
\lst@AddToHook{Init}{\edef\ttdefault{\ttdefault}}
\def\lst@SaveOutputDef#1#2{%
    \begingroup \lccode`\~=#1\relax \lowercase{%
    \def\lst@temp##1\def~##2##3\relax}{%
        \global\expandafter\let\expandafter#2\@gobble##2\relax}%
    \expandafter\lst@temp\lst@SelectStdCharTable\relax
    \endgroup}
\lst@SaveOutputDef{"5C}\lstum@backslash
\def\lst@activecharstrue{\let\lst@ifactivechars\iftrue}
\def\lst@activecharsfalse{\let\lst@ifactivechars\iffalse}
\lst@activecharstrue
\def\lst@SelectCharTable{%
    \lst@SelectStdCharTable
    \lst@ifec \lst@DefEC \fi
    \lst@ifactivechars
        \catcode9\active \catcode12\active \catcode13\active
        \@tempcnta=32\relax
        \@whilenum\@tempcnta<128\do
            {\catcode\@tempcnta\active\advance\@tempcnta\@ne}%
    \fi
    \lsthk@SelectCharTable
    \lst@DeveloperSCT
    \ifx\lst@Backslash\relax\else
        \lst@LetSaveDef{"5C}\lsts@backslash\lst@Backslash
    \fi}
\lst@Key{SelectCharTable}{}{\def\lst@DeveloperSCT{#1}}
\lst@Key{MoreSelectCharTable}\relax{\lst@lAddTo\lst@DeveloperSCT{#1}}
\lst@AddToHook{SetLanguage}{\let\lst@DeveloperSCT\@empty}
\lst@AddToHook{Init}
    {\let\lsts@nfss@catcodes\nfss@catcodes
     \let\nfss@catcodes\lst@nfss@catcodes}
\def\lst@nfss@catcodes{%
    \lst@makeletter
        ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\relax
    \@makeother 0\@makeother 1\@makeother 2\@makeother 3\@makeother 4%
    \@makeother 5\@makeother 6\@makeother 7\@makeother 8\@makeother 9%
    \lsts@nfss@catcodes}
\def\lst@makeletter#1{%
    \ifx\relax#1\else\catcode`#111\relax \expandafter\lst@makeletter\fi}
\lst@Key{alsoletter}\relax{\lst@DefOther\lst@arg{#1}%
    \expandafter\lstalso@\lst@also \lst@arg\@empty\@empty}
\lst@Key{alsodigit}\relax{\lst@DefOther\lst@arg{#1}%
    \expandafter\lstalso@\lst@also \@empty\lst@arg\@empty}
\lst@Key{alsoother}\relax{\lst@DefOther\lst@arg{#1}%
    \expandafter\lstalso@\lst@also \@empty\@empty\lst@arg}
\def\lstalso@#1#2#3#4#5#6{%
    \ifx#4\@empty \ifx#5\@empty \ifx#6\@empty \else
        \edef\lst@also{{#1}{#2}{#6}}%
    \fi\else
        \edef\lst@also{{#1}{#5}{#3}}%
    \fi\else
        \edef\lst@also{{#4}{#2}{#3}}%
    \fi}
\lst@AddToHook{SetLanguage}{\def\lst@also{{}{}{}}}
\def\lst@UseBasicClasses{\expandafter\lst@UBC@\lst@also}
\def\lst@UBC@#1#2#3#4#5#6{\def\lst@also{{#1#4}{#2#5}{#3#6}}}
\lst@AddToHook{SelectCharTable}
    {\expandafter\lst@ChangeBasicClasses\lst@also}
\def\lst@ChangeBasicClasses#1#2#3{%
    \lst@CBC@\lst@ProcessOther#3\relax
    \lst@CBC@\lst@ProcessDigit#2\relax
    \lst@CBC@\lst@ProcessLetter#1\relax}
\def\lst@CBC@#1#2{%
    \ifx\relax#2\expandafter\@gobbletwo \else
        \lccode`\~=`#2\lowercase
        {\edef~{\noexpand#1\expandafter\lst@CBC@@~}}%
    \fi
    \lst@CBC@#1}
\def\lst@CBC@@#1#2{\noexpand#2}
\lst@Key{extendedchars}{false}[t]{\lstKV@SetIf{#1}\lst@ifec}
\def\lst@DefEC{%
   \lst@CCECUse \lst@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}
\def\lst@CCECUse#1#2{%
    \ifnum`#2=\z@
        \expandafter\@gobbletwo
    \else
        \ifnum\catcode`#2=\active
            \lccode`\~=`#2\lccode`\/=`#2\lowercase{\lst@CCECUse@#1~/}%
        \else
            \lst@ifactivechars \catcode`#2=\active \fi
            \lccode`\~=`#2\lowercase{\def~}{#1#2}%
        \fi
    \fi
    \lst@CCECUse#1}
\def\lst@CCECUse@#1#2#3{%
   \expandafter\let\csname lst@EC#3\endcsname #2%
   \edef#2{\noexpand#1\expandafter\noexpand\csname lst@EC#3\endcsname}}
\@ifundefined{ocp}{}
    {\lst@AddToHook{OutputBox}{\lsthk@OmegaOutputBox}
     \lst@AddToHook{OmegaOutputBox}{}}
\def\lst@ReplaceInput#1{\lst@CArg{RI}#1\relax\lst@ReplaceInput@}
\def\lst@ReplaceInput@#1#2#3#4#5{%
    \let#4#1%
    \ifx\@empty#2\@empty
        \def#1{#5}%
    \else \ifx\@empty#3\@empty
        \def#1##1{%
            \ifx##1#2%
                \def\lst@next{#5}%
            \else
                \def\lst@next{#4##1}%
            \fi
            \lst@next}%
    \else
        \def#1{\lst@IfNextCharsArg{#2#3}{#5}{\expandafter#4\lst@eaten}}%
    \fi \fi}
\lst@Key{literate}{}{\def\lst@literate{#1}}
\lst@AddToHook{SelectCharTable}
    {\ifx\lst@literate\@empty\else
         \expandafter\lst@Literate\lst@literate{}\relax\z@
     \fi}
\def\lst@Literate#1#2#3{%
    \ifx\relax#2\@empty\else
        \lst@CArg{RI}#1\relax\lst@ReplaceInput@
            {\lst@PrintToken \lst@letterfalse
             \lst@token{#2}\lst@length#3\relax\lst@PrintToken}%
        \expandafter\lst@Literate
    \fi}
\lst@Key{flexiblecolumns}{false}[t]{\lstKV@SetIf{#1}\lst@ifflexible}
\lst@AddToHook{Init}
    {\lst@ifflexible
         \let\lst@Output\lst@OutputFlexible
         \let\lst@OutputOther\lst@OutputOtherFlexible
         \let\lst@GotoTabStop\lst@GotoTabStopFlexible
     \fi}
\lst@Key{identifierstyle}{}{\def\lst@identifierstyle{#1}}
\lst@AddToHook{EmptyStyle}{\let\lst@identifierstyle\@empty}
\lst@Key{fontadjust}{false}[t]{\lstKV@SetIf{#1}\lst@iffontadjust}
\lst@AddToHook{InitVars}{\lsthk@FontAdjust}
\lst@AddToHook{FontAdjust}{}% init
\def\lst@FontAdjustPre{%
    \lst@iffontadjust
        \setbox\@tempboxa\hbox{{\lst@thestyle{\lsthk@FontAdjust
            \xdef\@gtempa{\noexpand\lst@width\the\lst@width\relax}}}}%
        \@gtempa
    \fi}
\def\lst@FontAdjustPost{\lst@iffontadjust \lsthk@FontAdjust \fi}
\lst@Key{basewidth}{0.6em,0.45em}{\lstKV@CSTwoArg{#1}%
    {\def\lst@widthfixed{##1}\def\lst@widthflexible{##2}%
     \ifx\lst@widthflexible\@empty
         \let\lst@widthflexible\lst@widthfixed
     \fi
     \gdef\lst@error{\PackageError{Listings}%
         {Nonnegative value(s) expected}%
         {I'll treat the value(s) as zero.^^J%
          Type <RETURN> to proceed.}}%
     \global\let\@gtempa\relax
     \ifdim \lst@widthfixed<\z@
         \global\let\@gtempa\lst@error \let\lst@widthfixed\z@
     \fi
     \ifdim \lst@widthflexible<\z@
         \global\let\@gtempa\lst@error \let\lst@widthflexible\z@
     \fi
     \@gtempa}}
\newdimen\lst@width
\lst@AddToHook{FontAdjust}
    {\lst@width=\lst@ifflexible\lst@widthflexible
                          \else\lst@widthfixed\fi \relax}
\newdimen\lst@linewidth % \global
\newcount\lst@column \newcount\lst@pos % \global
\lst@AddToHook{InitVarsBOL}
    {\global\lst@linewidth\z@ \global\lst@pos\z@ \global\lst@column\z@}
\def\lst@CalcLineLength{%
            \@tempcnta\lst@column
    \advance\@tempcnta\lst@length
    \advance\@tempcnta-\lst@pos}
\newdimen\lst@lostspace % \global
\lst@AddToHook{InitVarsBOL}{\global\lst@lostspace\z@}
\def\lst@UseLostSpace{%
    \ifdim\lst@lostspace>\z@
        \global\advance\lst@linewidth\lst@lostspace
        \kern\lst@lostspace \global\lst@lostspace\z@
    \fi}
\def\lst@InsertLostSpace{%
    \global\advance\lst@linewidth\lst@lostspace
    \kern\lst@lostspace \global\lst@lostspace\z@}
\def\lst@InsertHalfLostSpace{%
    \global\lst@lostspace.5\lst@lostspace \kern\lst@lostspace
    \global\advance\lst@linewidth\lst@lostspace}
\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}
\lst@Key{outputpos}{c}{\lstoutputpos@#1\relax\relax}
\def\lst@CalcLostSpaceAndOutput{%
    \global\advance\lst@lostspace \lst@length\lst@width
    \global\advance\lst@lostspace-\wd\@tempboxa
    \global\advance\lst@linewidth \wd\@tempboxa
    \global\advance\lst@pos -\lst@length
    \lst@token{}\lst@length\z@
    \ifdim\lst@lostspace>\z@ \lst@leftinsert \fi
    \box\@tempboxa \lsthk@PostOutput}
\lst@AddToHook{PostOutput}{}% 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}
\long\def\lst@RemovePars#1\hbox#2\hbox#3#4\@empty{\gdef\lst@NewLine{#4}}
\def\lst@OutputOther{%
    \ifnum\lst@length=\z@\else
        \lst@NewLine \lst@UseLostSpace
        \lsthk@OutputOther
        \setbox\@tempboxa\hbox to \lst@length\lst@width
            {\lsthk@OutputBox
             \lst@lefthss
             \expandafter\lst@FillOutputBox\the\lst@token\relax
             \lst@righthss}%
        \lst@CalcLostSpaceAndOutput
    \fi}
\lst@AddToHook{OutputOther}{}% init
\lst@AddToHook{OutputBox}{}% init
\def\lst@Output{%
    \ifnum\lst@length=\z@\else
        \lst@NewLine \lst@UseLostSpace
        \let\lst@thestyle\lst@identifierstyle
        \lsthk@Output
        \lst@FontAdjustPre
        \setbox\@tempboxa\hbox to \lst@length\lst@width
            {\lsthk@OutputBox
            {\lst@lefthss
             \lst@thestyle
                 {\expandafter\lst@FillOutputBox\the\lst@token\relax}%
            \lst@righthss}}%
        \lst@CalcLostSpaceAndOutput
        \lst@FontAdjustPost
    \fi
    \let\lst@lastother\relax}
\lst@AddToHook{Output}{}% init
\def\lst@FillOutputBox#1{#1\lst@FillOutputBox@}
\def\lst@FillOutputBox@#1{%
    \ifx\relax#1\else \hss#1\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
        \lsthk@OutputOther
        \setbox\@tempboxa\hbox{\lsthk@OutputBox\the\lst@token}%
        \lst@CalcLostSpaceAndOutput
    \fi}
\def\lst@OutputFlexible{%
    \ifnum\lst@length=\z@\else
        \lst@NewLine \lst@UseLostSpace
        \let\lst@thestyle\lst@identifierstyle
        \lsthk@Output
        \lst@FontAdjustPre
        \setbox\@tempboxa\hbox{\lsthk@OutputBox
            {\lst@thestyle{\the\lst@token}}}%
        \lst@CalcLostSpaceAndOutput
        \lst@FontAdjustPost
    \fi
    \let\lst@lastother\relax}
\def\lst@GotoTabStopFlexible{%
    \ifx\lst@NewLine\relax
        \setbox\@tempboxa\hbox{\lst@outputspace}\@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@BeginDropOutput#1{%
    \let\lst@BDONewLine\lst@NewLine
    \lst@EnterMode{#1}%
        {\lst@modetrue
         \let\lst@Output\lst@EmptyOutput
         \let\lst@OutputOther\lst@EmptyOutputOther
         \let\lst@PreGotoTabStop\lst@EmptyGotoTabStop
         \aftergroup\lst@BDORestore}}
\def\lst@BDORestore{\global\let\lst@NewLine\lst@BDONewLine}
\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@}
\lst@Key{basicstyle}{}{\def\lst@basicstyle{#1}}
\lst@AddToHook{Init}{\lst@basicstyle}
\lst@AddToHook{EmptyStyle}{\let\lst@basicstyle\@empty}
\def\lst@NormedDef#1#2{\lowercase{\edef#1{\zap@space#2 \@empty}}}
\def\lst@NormedNameDef#1#2{%
    \lowercase{\edef\lst@temp{\zap@space#1 \@empty}%
    \expandafter\xdef\csname\lst@temp\endcsname{\zap@space#2 \@empty}}}
\def\lst@parshape{\parshape\@ne \z@ \linewidth}
\lst@AddToHookAtTop{EveryLine}{\lst@parshape}
\lst@AddToHookAtTop{EndGroup}{\lst@parshape}
\lst@Key{pre}{}{\lstKV@OptArg[{#1}]{#1}%
    {\def\lst@prelisting{##2}\def\lst@@prelisting{##1}}}
\lst@Key{post}{}{\lstKV@OptArg[{#1}]{#1}%
    {\def\lst@postlisting{##2}\def\lst@@postlisting{##1}}}
\lst@AddToHook{Init}{\lst@ifcontinue \expandafter\lst@@prelisting
                               \else \expandafter\lst@prelisting\fi}
\lst@AddToHook{DeInit}{\lst@ifcontinue \expandafter\lst@@postlisting
                                 \else \expandafter\lst@postlisting\fi}
\lst@AddToHook{BoxUnsave}
    {\let\lst@prelisting\relax \let\lst@postlisting\relax
     \let\lst@@prelisting\relax\let\lst@@postlisting\relax}
\newcount\lst@lineno % \global
\lst@AddToHook{InitVars}{\global\lst@lineno\@ne}
\lst@Key{print}{true}[t]{\lstKV@SetIf{#1}\lst@ifprint}
\lst@Key{first}\relax{\def\lst@firstline{#1\relax}}
\lst@Key{last}\relax{\def\lst@lastline{#1\relax}}
\lst@AddToHook{PreSet}
    {\let\lst@firstline\@ne \def\lst@lastline{9999999\relax}}
\lst@Key{continue}\relax[t]{\lstKV@SetIf{#1}\lst@ifcontinue}
\def\lst@continuetrue{\let\lst@ifcontinue\iftrue}
\def\lst@continuefalse{\let\lst@ifcontinue\iffalse}
\lst@AddToHook{PreSet}{\let\lst@ifcontinue\@undefined}
\lst@AddToHook{PreInit}
    {\ifx\lst@ifcontinue\@undefined \lst@continuefalse \fi}
\lst@Key{caption}\relax{\lstKV@OptArg[{#1}]{#1}%
    {\def\lst@caption{##2}\def\lst@@caption{##1}}}
\lst@AddToHook{PreSet}{\let\lst@caption\@empty \let\lst@@caption\@empty}
\lst@Key{captionpos}{t}{\def\lst@captionpos{#1}}
\lst@Key{abovecaptionskip}\smallskipamount{\def\lst@abovecaption{#1}}
\lst@Key{belowcaptionskip}\smallskipamount{\def\lst@belowcaption{#1}}
\ifx\chapter\@undefined
    \newcounter{lstlisting}
    \renewcommand\thelstlisting{\@arabic\c@lstlisting}
\else
    \newcounter{lstlisting}[chapter]
    \renewcommand\thelstlisting
         {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@lstlisting}
\fi
\lst@UserCommand\lstlistingname{Listing}
\def\lst@MakeCaption#1{%
    \ifx\lst@caption\@empty\else
        \ifx\lst@@caption\@empty\else
            \if #1t\refstepcounter{lstlisting}\fi
        \fi
        \lst@IfSubstring #1\lst@captionpos
            {\par\@makecaption
                {\noindent\lstlistingname
                 \ifx\lst@@caption\@empty\else~\thelstlisting\fi}%
                \lst@caption}{}%
    \fi}
\lst@Key{boxpos}{c}{\def\lst@boxpos{#1}}
\def\lst@boxtrue{\let\lst@ifbox\iftrue}
\let\lst@ifbox\iffalse
\lst@Key{float}\relax[tbp]{\def\lst@float{#1}}
\lst@AddToHook{PreSet}{\let\lst@float\relax}
\ifx\c@float@type\@undefined
    \edef\ftype@lstlisting{\ifx\c@figure\@undefined 1\else 4\fi}
\else
    \edef\ftype@lstlisting{\the\c@float@type}
    \addtocounter{float@type}{\value{float@type}}
\fi
\def\lst@Init#1{%
    \begingroup
    \ifx\lst@float\relax\else
        \edef\@tempa{\noexpand\@float{lstlisting}[\lst@float]}%
        \expandafter\@tempa
    \fi
    \ifhmode\ifinner \lst@boxtrue \fi\fi
    \lst@ifbox
        \lsthk@BoxUnsave
        \hbox to\z@\bgroup
             $\if t\lst@boxpos \vtop
        \else \if b\lst@boxpos \vbox
        \else \vcenter \fi\fi
        \bgroup
    \else
        \smallbreak
    \fi
    \normalbaselines
    \abovecaptionskip\lst@abovecaption\relax
    \belowcaptionskip\lst@belowcaption\relax
    \lst@MakeCaption t%
    \lsthk@PreInit \lsthk@Init
    \par\nointerlineskip \normalbaselines
    \everypar{\lsthk@EveryLine}%
    \lsthk@InitVars \lsthk@InitVarsBOL
    \lst@Let{13}\lst@MProcessListing
    \let\lst@Backslash#1%
    \lst@EnterMode{\lst@Pmode}{\lst@SelectCharTable}}
\lst@AddToHook{InitVars}
    {\rightskip\z@ \leftskip\z@ \parfillskip=\z@ plus 1fil
     \let\par\@@par}
\lst@Key{showlines}f[t]{\lstKV@SetIf{#1}\lst@ifshowlines}
\def\lst@DeInit{%
    \lst@PrintToken \lst@EOLUpdate
    \ifx\lst@NewLine\lst@NewLineMacro\else
        \expandafter\lst@RemovePars\lst@NewLine\@empty
        \lst@ifshowlines
            \lst@NewLine
        \else
            \setbox\@tempboxa\vbox{\lst@NewLine}%
        \fi
    \fi
    \par\removelastskip
    \lsthk@ExitVars \lsthk@DeInit
    \lst@MakeCaption b%
    \lst@ifbox
        \egroup $\hss \egroup
        \vrule\@width\lst@maxwidth\@height\z@\@depth\z@
    \else
        \smallbreak
    \fi
    \ifx\lst@float\relax\else
        \expandafter\end@float
    \fi
    \endgroup}
\newdimen\lst@maxwidth % \global
\lst@AddToHook{InitVars}{\global\lst@maxwidth\z@}
\lst@AddToHook{InitVarsEOL}
    {\ifdim\lst@linewidth>\lst@maxwidth
         \global\lst@maxwidth\lst@linewidth
     \fi}
\def\lst@EOLUpdate{\lsthk@EOL \lsthk@InitVarsEOL \lsthk@InitVarsBOL}
\def\lst@MProcessListing{%
    \lst@PrintToken \lst@EOLUpdate \global\advance\lst@lineno\@ne
    \ifnum \lst@lineno>\lst@lastline
        \expandafter\lst@EndProcessListing
    \else
        \expandafter\lst@BOLGobble
    \fi}
\let\lst@EndProcessListing\endinput
\lst@Key{gobble}{0}{\def\lst@gobble{#1}}
\def\lst@BOLGobble{%
    \ifnum\lst@gobble>\z@
        \@tempcnta\lst@gobble\relax
        \expandafter\lst@BOLGobble@
\fi}
\def\lst@BOLGobble@@{%
    \ifnum\@tempcnta>\z@
        \expandafter\lst@BOLGobble@
    \fi}
\def\lstenv@BOLGobble@@{%
    \lst@IfNextChars\lstenv@endstring{\lstenv@End}%
    {\advance\@tempcnta\m@ne \expandafter\lst@BOLGobble@@\lst@eaten}}
\def\lst@BOLGobble@#1{%
    \let\lst@next#1%
    \ifx \lst@next\relax\else
    \ifx \lst@next\lst@MProcessListing\else
    \ifx \lst@next\lst@ProcessFormFeed\else
    \ifx \lst@next\lstenv@backslash
        \let\lst@next\lstenv@BOLGobble@@
    \else
        \let\lst@next\lst@BOLGobble@@
        \ifx #1\lst@ProcessTabulator
            \advance\@tempcnta-\lst@tabsize\relax
            \ifnum\@tempcnta<\z@
                \lst@length-\@tempcnta \lst@PreGotoTabStop
            \fi
        \else
            \advance\@tempcnta\m@ne
        \fi
    \fi \fi \fi \fi
    \lst@next}
\lst@AddToHook{PreSet}{\global\let\lst@intname\@empty}
\lst@AddToHook{PreInit}{%
    \global\let\lstintname\lst@intname
    \let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl
    \global\let\lstname\lst@arg}
\global\let\lst@intname\@empty
\def\lst@filenamerpl{_\textunderscore $\textdollar -\textendash}
\def\l@lstlisting#1#2{\@dottedtocline{1}{1.5em}{2.3em}{#1}{#2}}
\lst@AddToHook{Init}
    {\ifx\lst@@caption\@empty
         \ifx\lst@caption\@empty
             \lst@ifcontinue\else
                 \ifx\lst@intname\@empty \else \def\lst@temp{ }%
                 \ifx\lst@intname\lst@temp \else
                     \addcontentsline{lol}{lstlisting}\lstname
                 \fi\fi
             \fi
         \fi
     \else
         \addcontentsline{lol}{lstlisting}%
             {\protect\numberline\thelstlisting\lst@@caption}%
     \fi}
\lst@UserCommand\lstlistlistingname{Listings}
\lst@UserCommand\lstlistoflistings{\bgroup
    \let\contentsname\lstlistlistingname
    \let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{lol}}%
    \tableofcontents \egroup}
\newcommand\lstinline[1][]{%
    \hbox\bgroup
        \def\lst@boxpos{b}\let\lst@ifflexible\iftrue
        \lsthk@PreSet\lstset{#1}%
        \lsthk@InlineUnsave \lst@Init\relax
        \everypar{}%
        \lstinline@}
\def\lstinline@#1{\lst@IfNextCharActive{\lst@InlineM#1}{\lst@InlineJ#1}}
\lst@AddToHook{InlineUnsave}{}
\def\lst@InlineM#1{%
    \lst@Def{`#1}{\lst@DeInit\egroup}%
    \lst@Def{13}{\lst@DeInit\egroup
        \PackageError{Listings}{lstinline ended by EOL}\@ehc}}
\def\lst@InlineJ#1{%
    \def\lst@temp##1#1{%
        \let\lst@arg\@empty \lst@InsideConvert{##1}\lst@arg
        \lst@DeInit\egroup}%
    \lst@temp}
\newcommand\lstinputlisting[2][]{%
    \def\lst@set{#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}%
    \@doendpe \ignorespaces}
\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{%
    \begingroup
    \lsthk@PreSet \gdef\lst@intname{#1}%
    \expandafter\lstset\expandafter{\lst@set}%
    \lst@ifprint
        \lst@Init\relax \lst@SkipToFirst \input{#1}\lst@DeInit
    \else
        \begin{center}%
        \footnotesize  ---  Listing of #1 has been skipped.  ---
        \end{center}%
    \fi
    \endgroup}
\def\lst@SkipToFirst{%
    \ifnum \lst@lineno=\lst@firstline \else
        \bgroup \lst@modetrue
        \let\lst@Output\relax \let\lst@OutputOther\relax
        \let\lst@PreGotoTabStop\relax
        \lst@Let{13}\lst@MSkipToFirst
    \fi}
\def\lst@MSkipToFirst{%
    \egroup \global\lst@lineno\tw@
    \ifnum \lst@lineno=\lst@firstline
        \expandafter\lst@BOLGobble
    \else
        \expandafter\lst@MSkipToFirst@
    \fi}
\begingroup \lccode`\~=`\^^M%
\lowercase{\gdef\lst@MSkipToFirst@#1~}{%
    \global\advance\lst@lineno\@ne
    \ifnum \lst@lineno=\lst@firstline
        \expandafter\lst@BOLGobble
    \else
        \expandafter\lst@MSkipToFirst@
    \fi}
\endgroup
\def\lstenv@SkipToFirst{%
    \ifnum \lst@lineno=\lst@firstline
        \expandafter\lst@BOLGobble
    \else
        \expandafter\lst@MSkipToFirst@
    \fi}
\begingroup\lccode`\~=`\^^J
\lowercase{\gdef\lstenv@JSkipToFirst@#1~}{%
    \global\advance\lst@lineno\@ne
    \ifnum \lst@lineno=\lst@firstline
        \expandafter\lst@BOLGobble
    \else
        \expandafter\lstenv@JSkipToFirst@
    \fi}
\endgroup
\begingroup \lccode`\~=`\\\lowercase{%
\gdef\lstenv@SkipToEnd{%
    \long\expandafter\def\expandafter\lst@temp\expandafter##\expandafter
        1\expandafter~\lstenv@endstring{\lstenv@End}%
    \lst@temp}
}\endgroup
\def\lstenv@DroppedWarning{%
    \ifx\lst@dropped\@undefined\else
        \PackageWarning{Listings}{Text dropped after begin of listing}%
    \fi}
\let\lst@dropped\@undefined % init
\begingroup \lccode`\~=`\^^M\lowercase{%
\gdef\lstenv@Process#1{%
    \ifx~#1%
        \lstenv@DroppedWarning \let\lst@next\lstenv@SkipToFirst
    \else\ifx^^J#1%
        \lstenv@DroppedWarning \let\lst@next\lstenv@ProcessJ
    \else
        \let\lst@dropped#1\let\lst@next\lstenv@Process
    \fi \fi
    \lst@next}
}\endgroup
\def\lstenv@ProcessJ{%
    \let\lst@arg\@empty
    \ifx\@currenvir\lstenv@name
        \expandafter\lstenv@ProcessJEnv
    \else
        \expandafter\def\expandafter\lst@temp\expandafter##1%
            \csname end\lstenv@name\endcsname
                {\lst@InsideConvert{##1}\lstenv@ProcessJ@}%
        \expandafter\lst@temp
    \fi}
\begingroup \lccode`\~=`\\\lowercase{%
\gdef\lstenv@ProcessJ@{%
    \lst@lExtend\lst@arg
        {\expandafter\ \expandafter~\lstenv@endstring}%
    \catcode10=\active \lst@Let{10}\lst@MProcessListing
    \let\lst@MSkipToFirst\lstenv@JSkipToFirst
    \expandafter\lstenv@SkipToFirst\lst@arg}
}\endgroup
\def\lstenv@ProcessJEnv#1\end#2{\def\lst@temp{#2}%
    \ifx\lstenv@name\lst@temp
        \lst@InsideConvert{#1}%
        \expandafter\lstenv@ProcessJ@
    \else
        \lst@InsideConvert{#1\\end\{#2\}}%
        \expandafter\lstenv@ProcessJEnv
    \fi}
\def\lstenv@backslash{%
    \lst@IfNextChars\lstenv@endstring
        {\lstenv@End}%
        {\expandafter\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}
\lst@UserCommand\lstnewenvironment#1#2#{%
    \@ifundefined{#1}%
        {\lstnewenvironment@{#1}{#2}}%
        {\PackageError{Listings}{Environment `#1' already defined}\@eha
         \@gobbletwo}}
\def\lstnewenvironment@#1#2#3#4{%
    \global\@namedef{end#1}{\lstenv@Error{#1}}%
    \global\@namedef{#1}{\def\lstenv@name{#1}%
        \begingroup \catcode\active=\active \csname#1@\endcsname}%
    \let\l@ngrel@x\global %
    \expandafter\new@command\csname#1@\endcsname#2%
        {\lsthk@PreSet #3%
         \ifx\@currenvir\lstenv@name
             \edef\lstenv@endstring{%
                 end\noexpand\{\lstenv@name\noexpand\}}%
         \else
             \edef\lstenv@endstring{end\lstenv@name}%
         \fi
         \expandafter\lst@DefActive\expandafter\lstenv@endstring
             \expandafter{\lstenv@endstring}%
         \@namedef{end#1}{\lst@DeInit #4\endgroup
                          \@doendpe \@ignoretrue}%
         \lst@Init\lstenv@backslash
         \let\lst@EndProcessListing\lstenv@SkipToEnd
         \lst@ifprint
             \expandafter\lstenv@Process
         \else
             \expandafter\lstenv@SkipToEnd
         \fi}}
\def\lstenv@Error#1{\PackageError{Listings}{Extra \string\end#1}%
    {I'm ignoring this, since I wasn't doing a \csname#1\endcsname.}}
\lstnewenvironment{lstlisting}[2][]
    {\lst@TestEOLChar{#2}%
     \lstset{#1}%
     \csname lst@SetFirstLabel\endcsname}
    {\csname lst@SaveFirstLabel\endcsname}
\lst@Key{fancyvrb}\relax[t]{%
    \lstKV@SetIf{#1}\lst@iffancyvrb
    \lstFV@fancyvrb}
\ifx\lstFV@fancyvrb\@undefined
    \gdef\lstFV@fancyvrb{\lst@RequireAspects{fancyvrb}\lstFV@fancyvrb}
\fi
\DeclareOption*{\expandafter\lst@ProcessOption\CurrentOption\relax}
\def\lst@ProcessOption#1#2\relax{%
    \ifx #1!%
        \lst@DeleteKeysIn\lst@loadaspects{#2}%
    \else
        \lst@lAddTo\lst@loadaspects{,#1#2}%
    \fi}
\ifx\lst@loadaspects\@undefined
    \def\lst@loadaspects{strings,comments,escape,style,language,%
        keywords,labels,lineshape,frames}%
\fi
\IfFileExists{lstpatch.sty}
    {\def\lst@topatch{0.19}\input{lstpatch.sty}%
     \let\lst@next\relax
     \ifx\lstlanguage@\@undefined\else \let\lst@next\@empty \fi
     \ifx\lst@version\lst@topatch\else \let\lst@next\@empty \fi
     \ifx\lst@next\relax\else
        \typeout{^^J%
        ***^^J%
        *** Patch file `lstpatch.sty' for version \lst@topatch^^J%
        *** is not suitable for `listings.sty' version \lst@version.^^J%
        *** Please delete old patch files and try again.^^J%
        ***^^J}%
        \batchmode \@@end
     \fi}{}
\ProcessOptions
\lst@RequireAspects\lst@loadaspects
\let\lst@loadaspects\@empty
\lst@UseHook{SetStyle}\lst@UseHook{EmptyStyle}
\lst@UseHook{SetLanguage}\lst@UseHook{EmptyLanguage}
\InputIfFileExists{listings.cfg}{}{}
\lst@RestoreCatcodes
\endinput
%%
%% End of file `listings.sty'.
