lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Aug 18, 2008 at 01:15:52PM -0700, Scott Fial wrote:

> I would like to be able to use lpeg to parse a stream of incoming
> data.  I would also like to be able to use it for parsing huge
> files.  In both cases, I won't have the entire input in memory.

If your stream can be interpreted as a sequence of distinct parts,
then you might be able to create a parser that matches only one part
at a time, and call it repeatedly from a higher-level function.  I
haven't ever tried this with Lpeg, but I've used this technique with
other PEG parsers.

                                                  -Dave Dodge