John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:

I thought there was a Perl5 module available that implemented the Perl 6 patterns, but I can't remember what it's called or find it in cpan. I found a source filter, but don't want to use that.

What's a good module to use for parsing? P:RC is from 2003, and Perl has some newer features and a newer general style now. Regexp::Grammar has an omonous warning about mucking with regex's and conflicting with other modules that do the same. Marpa is "in alpha".

I want to have fun and find something interesting. I want my resulting module to be useful for real apps. I'd like what I learn to carry forward to other problems.

Any other suggestions?

Replies are listed 'Best First'.
Re: Which module for Parsing?
by Limbic~Region (Chancellor) on Apr 14, 2011 at 13:50 UTC
    John M. Dlugosz,
    If you haven't already, you might want to read Breaking The Rules II. I know that Marpa is marked alpha but after following the author's blog - I think that has more to do with no guarantee of backward compatability than it does with robustness. If I were starting a new project today, I would likely give it a whirl.

    Cheers - L~R

Re: Which module for Parsing?
by Khen1950fx (Canon) on Apr 14, 2011 at 11:17 UTC
    Perl6::Rules implements Perl6 patterns in Perl5. With Perl6, when you think "parser", think "Rules" instead...

    For an intro to Rules, see: Perl6 rules.

    The perlcabal has an even better intro: S05.

      "...via a source filter. (And hence suffers from all the usual limitations of a source filter, including the ability to translate complex code spectacularly wrongly)."

      I said in my post that I knew about that and didn't want to use it. Yes, I know where to find information on the Perl6 documentation (I even have a commit bit).

Re: Which module for Parsing?
by Anonymous Monk on Apr 14, 2011 at 11:21 UTC
    Regexp::Grammar has an omonous warning about mucking with regex's and conflicting with other modules that do the same.

    Since Regexp::Grammar is lexically scoped like much of those modules, this is not that important

      So what's it mean by "automagically rewrites regexes"? The effect is localized to the scope of the use? It doesn't fiddle with the parser guts just by being loaded? So the warning really means it would conflict with other modules being used in the same scope, not used at all in the program, right?