%%
%% This is file `parselines.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% parselines.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% parselines : 2010/11/20 v1.3 - parselines : catch file between delimiters or tags
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any later
%% version. The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% 
%% This work consists of the main source file parselines.dtx
%% and the derived files
%%    parselines.sty, parselines.pdf, parselines.ins
%% 
%% parselines : a simple line parser for TeX
%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
%% 
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
   [2005/12/01]% LaTeX must be 2005/12/01 or younger
\ProvidesPackage{parselines}
         [2010/11/20 v1.3 - a simple line parser for TeX]
\ifdefined\globtoks  \globtoks\parselin@tk
\else                \newtoks\parselin@tk
\fi
\newcommand\CollectEnvir{}
\protected\def\CollectEnvir#1{%
   \gdef\parselin@Finish{#1%
      \expandafter{\the\parselin@tk}%
      \global\let\parselin@Finish\@undefined}%
   \ifx\parselin@tk#1\else
      \expandafter\def\expandafter\parselin@Finish
         \expandafter{\parselin@Finish\parselin@tk{}}%
      \if \relax
          \expandafter\expandafter\expandafter\parselin@isatoken
            \expandafter\meaning\expandafter#1\string\toks
          \relax
         \expandafter\gdef\expandafter\parselin@Finish
            \expandafter{\expandafter\expandafter
               \expandafter\def\expandafter\expandafter
               \parselin@Finish}%
   \fi\fi
   \parselin@tk{}\def\parselin@stack{b}\parselin@Collect@Body
}% \CollectEnvir
\long\def\parselin@Collect@Body#1\end#2{%
  \edef\parselin@stack{\parselin@PushBegins#1\begin\end
                     \expandafter\@gobble\parselin@stack}%
  \ifx\parselin@stack\@empty
      \global\parselin@tk\expandafter{\the\parselin@tk#1}%
      \aftergroup\parselin@Finish
      \end{#2}%
  \else
      \parselin@tk\expandafter{\the\parselin@tk#1\end#2}%
      \expandafter\parselin@Collect@Body % recurse
  \fi
}% \parselin@Collect@Body
\long\def\parselin@PushBegins#1\begin#2{%
      \ifx\end#2\else b\expandafter\parselin@PushBegins\fi}
\expandafter\def\expandafter\parselin@isatoken
   \expandafter#\expandafter1\string\toks#2\relax{\detokenize{#2}\relax}%
\newenvironment{parse lines}[2][]
{%
   #1%
   \count@\z@\def\row{\number\count@}%
   \def\parselin@ProcessLine##1{\advance\count@\@ne #2}%
   \parselin@endlinechar{%
      \def~##1~{%
         \ifx\parselin@@@@@@##1\relax
         \else \parselin@ProcessLine{##1}\expandafter~%
         \fi}%
   }%
   \catcode\endlinechar\active
   \CollectEnvir\parselin@tk
}
{%
   \parselin@endlinechar{%
      \parselin@tk\expandafter{\the\parselin@tk\parselin@@@@@@~}%
   }\the\parselin@tk
}%
\long\def\parselin@endlinechar#1{\begingroup
   \lccode`\~\endlinechar  \lowercase{\endgroup#1}%
}% \parselin@endlinechar
\def\parselin@@@@@@{\parselin@@@@@@}
\newread\parselin@read
\protected\def\dofilebyline{\let\parselin@Finish\@empty
   \@ifstar
      \parselin@dobyline
      {\edef\parselin@Finish{\endlinechar\the\endlinechar\relax}%
       \endlinechar\m@ne
       \parselin@dobyline}%
}% \dofilebyline
\protected\def\parselin@dobyline#1{% #1 = file name
   \IfFileExists{#1}
      \parselin@do@byline
      {\PackageError{parselines}
         {No file #1 found !
         \MessageBreak Your command \string\dobyline\space was ignored}\@eha
      }%
}% \parselin@dobyline
\def\parselin@do@byline{%
   \openin\parselin@read=\@filef@und%
   \loop
      \ifeof\parselin@read\else
         \read\parselin@read to\@tempa
         \expandafter\do\expandafter{\@tempa}%
   \repeat
   \parselin@Finish
}% \parselin@do@byline
\endinput
%%
%% End of file `parselines.sty'.
