%%
%% This is file `rkeyval.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% rkeyval.dtx 
%% 
%%% ====================================================================
%%% @LaTeX-doc-source-file{
%%%   filename  = "rkeyval.dtx",
%%%   version   = "1.05",
%%%   date      = "2001/12/22",
%%%   time      = "15:27:19 PST",
%%%   author    = "Michael J Downes",
%%%   address   = "American Mathematical Society,
%%%                Publications Technical Group,
%%%                PO Box 6248,
%%%                Providence, RI 02940,
%%%                USA",
%%%   email     = "tech-support@ams.org",
%%%   URL       = "http://www.ams.org/",
%%%   abstract  = "Key-value scanning functions with more restrictive
%%%                syntax than the standard keyval package. This permits
%%%                some improvements in the error-checking.",
%%%   checksum  = "31052 512 1833 16121",
%%%   docstring = "The checksum field, produced by Robert Solovay's
%%%                checksum utility, gives CRC-16 checksum, lines,
%%%                words, and characters.",
%%%  }
%%% ====================================================================
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{rkeyval}[2001/12/22 v1.05]
\let\@xp\expandafter \let\@nx\noexpand
\def\@append#1#2#3{\@xp\def\@xp#2\@xp{#2#1{#3}}}
\edef\@tempa{%
  \@nx\AtEndOfPackage{\catcode\number`\'=\number\catcode`\'\relax}%
}
\@tempa
\catcode`\'=12
\def\fsa@l{\futurelet\@let@token\fsa@t}
\def\fsa@b{\afterassignment\fsa@l \let\@let@token= }
\def\fsa@c#1{\aftergroup#1\futurelet\@let@token\fsa@t}
\let\fsa@n\@empty
\let\fsa@t\@empty
\def\rkvIfEmpty#1#2{%
  \@xp\ifx\csname#1'#2\endcsname\@empty \@xp\@firstoftwo
  \else\@xp\@secondoftwo
  \fi
}
\def\rkv@DSAK#1#2{%
  \ifx\relax#1\global\let#1\@empty\fi
  \g@addto@macro#1{\let#2\@empty}%
  \def#2%
}
\def\rkv@DDK#1#2{%
  \ifx\relax#1\global\let#1\@empty\fi
  \g@addto@macro#1{\def#2{\@empty}}%
  \def#2%
}
\newcommand{\DefineSimpleKey}[2]{%
  \@xp\rkv@DSAK\csname #1@reset\@xp\endcsname
    \csname #1'#2\endcsname{\DSK@def}%
}
\newcommand{\DefineSupersedingKey}[2]{%
  \@xp\rkv@DSAK\csname #1@reset\@xp\endcsname
    \csname #1'#2\endcsname{\def}%
}
\def\DSK@def#1{%
  \ifx#1\@empty\else
    \PackageWarningNoLine{rkeyval}%
      {Key \string#1 should not be repeated}%
  \fi
  \def#1%
}
\newcommand{\DefineAdditiveKey}[3]{%
  \@xp\rkv@DSAK\csname #1@reset\@xp\endcsname \csname #1'#2\endcsname
    {\@append#3}%
}
\newcommand{\DefineDummyKey}[2]{%
  \@xp\rkv@DDK\csname #1@reset\@xp\endcsname \csname #1'#2\endcsname{\def}%
}
\newcommand{\RestrictedSetKeys}[3]{
  \global\rsk@toks\@emptytoks
  \def\rsk@finish{#3}%
  \gdef\rsk@set{\@xp\rsk@set@a\csname#2'}%
  #1\relax
  \begingroup \rsk@changecase \aftergroup\rsk@set
  \let\fsa@t\rsk@z \fsa@l
}
\def\rsk@unknown@key#1{%
  \PackageWarning{rkeyval}{Unknown key: \string#1}%
  \def#1{\def}%
}
\newtoks\rsk@toks
\def\rsk@set@a#1#2{%
  \ifx\relax#1\rsk@unknown@key#1\fi
  \toks@\@xp{#1#1{#2}}%
  \edef\@tempa{%
    \global\rsk@toks{\the\rsk@toks \the\toks@}%
  }%
  \@tempa
  \rsk@resume
}
\def\rsk@z{%
  \ifx\bgroup\@let@token \let\fsa@t\rsk@b \let\fsa@n\fsa@b
  \else\ifx\@sptoken\@let@token \let\fsa@n\fsa@b
  \else \rsk@errf
  \fi\fi
  \fsa@n
}
\def\rsk@a{%
  \ifx,\@let@token \endgroup \let\fsa@t\rsk@b \let\fsa@n\fsa@b
  \else\rsk@ab\fi
  \fsa@n
}
\def\rsk@ab{%
  \ifx\@sptoken\@let@token \let\fsa@n\fsa@b
  \else\ifcat\@nx\@let@token .\let\fsa@n\rsk@ac
  \else\ifx\bgroup\@let@token \endgroup
    \let\@let@token\bgroup \let\fsa@n\rsk@erra
  \else\ifx\egroup\@let@token \endgroup \let\fsa@n\rsk@end
  \else\ifx\par\@let@token \endgroup \let\fsa@n\rsk@erraa
  \else \endgroup \let\fsa@n\rsk@erraa
  \fi\fi\fi\fi\fi
}

\def\rsk@ac#1{\csname rsk@q#1\endcsname}
\@namedef{rsk@q@}#1{\typeout{Whoa, the language looks like #1!}%
  \let\fsa@n\rsk@a \fsa@l
}
\def\rsk@b{%
  \ifcat\@nx\@let@token A\let\fsa@t\rsk@c \let\fsa@n\fsa@c
  \else\ifx\@sptoken\@let@token \let\fsa@n\fsa@b
  \else\rsk@bb\fi\fi
  \fsa@n
}
\def\rsk@bb{%
  \ifx,\@let@token \let\fsa@n\fsa@b
  \else\ifx\bgroup\@let@token \let\fsa@n\rsk@errb
  \else\ifx\egroup\@let@token \let\fsa@n\rsk@end
  \else\ifx\par\@let@token \let\fsa@n\fsa@b
  \else \let\fsa@n\rsk@errc
  \fi\fi\fi\fi
}
\def\rsk@c{%
  \ifcat\@nx\@let@token A\let\fsa@n\fsa@c
  \else\ifx\@sptoken\@let@token \let\fsa@t\rsk@d \let\fsa@n\fsa@b
  \else\ifx=\@let@token \let\saw@equal T\let\fsa@t\rsk@d \let\fsa@n\fsa@b
  \else\rsk@cb\fi\fi\fi
  \fsa@n
}
\def\rsk@cb{%
  \ifx,\@let@token \let\fsa@n\rsk@errc
  \else\ifcat\@nx\@let@token .\let\fsa@n\fsa@c
  \else\ifx\bgroup\@let@token \let\fsa@n\rsk@noequal
  \else\ifx\egroup\@let@token \let\fsa@n\rsk@noequal
  \else \let\fsa@n\rsk@errc
  \fi\fi\fi\fi
}
\let\saw@equal=F
\def\rsk@d{%
  \ifx\bgroup\@let@token
    \ifx\saw@equal T%
      \aftergroup\endcsname \rsk@endcase \let\fsa@n\endgroup
    \else
      \let\saw@equal T%
      \let\fsa@n\rsk@noequal
    \fi
  \else\ifx\@sptoken\@let@token \let\fsa@n\fsa@b
  \else\ifx=\@let@token \let\saw@equal T\let\fsa@n\fsa@b
  \else\let\fsa@n\rsk@erre\fi\fi\fi
  \fsa@n
}
\def\rsk@casesensitive{%
  \let\rsk@changecase\@empty
  \let\rsk@endcase\@empty
}
\def\rsk@startlc{\aftergroup\lowercase\aftergroup{\iffalse}\fi}
\def\rsk@endlc{\iffalse{\fi\aftergroup}}
\def\rsk@lowercase{%
  \let\rsk@changecase\rsk@startlc
  \let\rsk@endcase\rsk@endlc
}
\rsk@lowercase
\def\rsk@resume{\begingroup
  \rsk@changecase
  \aftergroup\rsk@set
  \let\fsa@t\rsk@a
  \begingroup
  \catcode\endlinechar=\active \lccode`\~=\endlinechar
  \lowercase{\let~\par}%
  \fsa@l}
\def\rsk@end{%
  \global\let\rsk@set\rsk@terminate
  \rsk@endcase \endgroup \endcsname
  \afterassignment\rsk@finish
  \toks@\bgroup
}
\def\rsk@terminate{\@xp\@gobble\csname}
\def\NoCommaWarning{\PackageWarning{rkeyval}{Missing comma}}%
\def\NoCommaError{\rsk@err{Missing comma}\@ehc}
\def\rsk@nocomma{\NoCommaWarning}
\def\rsk@err{\PackageError{rkeyval}}
\def\rsk@errf{\rsk@err{Missing open brace}\@ehc\rsk@b}
\def\rsk@erra{\rsk@nocomma\rsk@b}
\long\def\rsk@erraa#1{\rsk@nocomma \let\fsa@t\rsk@b \fsa@l}
\def\rsk@errb{\rsk@err{Missing key name}\@ehc\rsk@d}
\def\rsk@errc{\rsk@err{Invalid key name character}\@ehc\fsa@b}
\def\rsk@noequal{\rsk@err{Missing equal sign}\@ehc\rsk@d}
\def\rsk@erre#1,{\rsk@err{Missing open brace for key value}\@ehc
  \iffalse{\fi \endgroup \endcsname \rsk@endcase }{#1},%
}
\endinput
%%
%% End of file `rkeyval.sty'.
