On 6/23/06, David Cantrell <[EMAIL PROTECTED]> wrote: > On Fri, Jun 23, 2006 at 09:23:09AM -0400, Ted Zlatanov wrote: > > On 23 Jun 2006, [EMAIL PROTECTED] wrote: > > >> Wasn't there a C grammer for Parse::RecDescent ? > > > Not that worked. Damian has acknowledged elsewhere that it shouldn't > > > have been included. > > It works for simple cases, and may be adequate for the OP's needs. I > > would recommend P::RD, because its grammar definitions are pretty > > similar to the Perl 6 grammar definitions (it will matter, some day), > > and because it's pretty good in general. About the only thing that's > > hard about it is parsing the error messages, which takes practice. > > I've tried P::RD. I didn't like it at all. It seemed to take an awful > lot of work to define a very simple language and I was not impressed by > the documentation. Next time I need a parser I'll try Parse::Yapp.
The bigger reason to not use P::RD is that it uses a lot of memory and is very slow. Unless you're going to be parsing very small files, you will be in trouble. This is not really Damian's fault though, he wrote P::RD before Perl had the /g modifier so he had no choice about making a copy of everything he had left to parse at every step. (If a 10K string has 3K tokens, the result is about 7.5 MB of data. If a 100K string has 30K tokens, change that to 750 MB.) Damian knows how to fix it, and began the project, but ran out of time. > I recommend the OP looks at it. I haven't tried Parse::Yapp. But I understand that you are far less likely to run into problems with infinite recursion, which is another Good Thing. Cheers, Ben _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

