On Mon, 24 Sep 2001, Greg London wrote:
> "[EMAIL PROTECTED]" wrote:
> > does anyone know a way to store either
> > the string or the positions of all text
> > matching a memory slot as upposed
> > to just the last piece?
>
> Jumpin Jehosifat!
> yes, exactly that!
>
> http://www.cpan.org/modules/by-authors/id/G/GS/GSLONDON/
>
> take a look at my module called
> Parse-Nibbler-0.23.tar.gz
got it
> I wrote it as a way to perform regular expressions
> on a "window" of text in a file. (so you don't have
> to load the entire file into a string before
> doing a regular expression on the thing)
> so, it "nibbles" at a file as it parses it.
> hence the name.
okay i havn't "use[d] Parse::Nibler;" yet, but i've been reading through
the code. i can't exactly see where you grab multiple matches of one
memory. i am also very interested in matching on the file, not a file that
i've sluped. i might be interested in helping devlop your module if it
could do what i want. was considering saying the heck with matching the
file as i will be able to do that automatically in perl6, but multiple
matches to one memory is important. if it's possible to use your parser
for the file not string match for now and swap it seemlessly for the perl6
version when availible i'd like that, but that swap cannot effect my
method of grabbing memory. do you have examples of your modules use or
could you provid a breif one here?
> anyway, it is currently a bit messy,
> and I plan on rewriting it as soon as
> I get some time,
>
> but it stores the positions of matches
> on regular expressions in an array.
> the array represents the current rules
> being tried in a grammar. when a rule
> succeeds, all the text pointed to by
> the array is "swallowed".
i don't completly follow the translation of grammer rule to regex as
grammer rule is much more complicated. i don't expect grammer rules as
opposed to regexs being useful to my parser. can i do a simple regex match
on a file and get a 2D array (more or less the way i specified) back from
it?
> but my approach is an example of exactly
> what you're looking for. have a gander.
>
> Greg
>