in reply to Re: Understanding someone else's parser
in thread Understanding someone else's parser

I also recall japhy noting that the base module doesn't yet support all the really funky things[1] you can do with regexen. It's really a string parser and in general parsing regexes also reduces to requiring a Perl parser in Perl that isn't perl.

[1] - my definition of funky starts at (?{}) / (??{}) so maybe it's good for everything normal programmers use. ;-)


Fun Fun Fun in the Fluffy Chair

  • Comment on Re^2: Understanding someone else's parser

Replies are listed 'Best First'.
Re: Re^2: Understanding someone else's parser
by John M. Dlugosz (Monsignor) on Jan 02, 2003 at 08:11 UTC
    Here's the kind of stuff I'm looking at:
    while ( $line =~ s/([[:alpha:]][[:alpha:]\']{0,44})[_\-,\.\"\' +\)\?!:;\/&]{0,5}([ \t\n\r]|$)/ / ) { update_word($self,$1, $encoded, '', '[_\-,\.\"\'\)\?!:;\/ +&\t\n\r]') if (length $1 >= 3);
    The first line is what POPfile considers a "word", after dealing with some other special cases first. I want to tinker with this program a bit. So, there is nothing funky about it. Just someone else's code to read and understand.

    —John

      You should check the module's (and I forget it's name or I'd mention it here) documentation to see which constructs aren't supported. You'll have it locally once you get that ::Explain module installed since it depends on it.


      Fun Fun Fun in the Fluffy Chair