FAQ
My apologies if this question is so basic that it's off-topic for the
list.

As part of my job, I have to do a lot of work munging message files;
each file contains information about multiple messages. After writing a
few programs that get specific bits of information out of these files,
I'm starting to think that a proper parser is what's needed, and any
time I need information out of the message files, I can use this
standard parser to get whatever I need.

My first problem with this theory of mine is that I don't have a formal
computer-science education, and I don't think I understand parsers (and,
more on-topic, Parse::RecDescent) well enough to write one. Can anyone
recommend a good book or tutorial on the subject of parsers, or should I
stick to piecemeal solutions until I find a computer-science degree?

Thank you.

csw
--
/"\
\ / ASCII RIBBON CAMPAIGN
X Against HTML Mail and News
/ \

Search Discussions

  • Randal L. Schwartz at Sep 24, 2001 at 3:36 pm
    "Chris" == Chris Warren writes:
    Chris> As part of my job, I have to do a lot of work munging message
    Chris> files; each file contains information about multiple
    Chris> messages. After writing a few programs that get specific bits
    Chris> of information out of these files, I'm starting to think that a
    Chris> proper parser is what's needed, and any time I need information
    Chris> out of the message files, I can use this standard parser to get
    Chris> whatever I need.

    Chris> My first problem with this theory of mine is that I don't have
    Chris> a formal computer-science education, and I don't think I
    Chris> understand parsers (and, more on-topic, Parse::RecDescent) well
    Chris> enough to write one. Can anyone recommend a good book or
    Chris> tutorial on the subject of parsers, or should I stick to
    Chris> piecemeal solutions until I find a computer-science degree?

    I've heard that the O'Reilly "Yacc and Lex" book offers a good gentle
    introduction for first-timers to parsers and lexers, although I've not
    personally read it. (I haven't read *every* O'Reilly book yet -- they
    keep coming out with too many of them! :)

    And to give you hope, *I* also don't have a formal CS education in the
    slightest. I learned parsers by studying the Unix docs for Yacc some
    20 years ago, and lexers by studying the Unix Lex docs, and wrote a
    program similar to my "spew"
    (<http://www.stonehenge.com/merlyn/LinuxMag/col04.html>, and part of
    the P::RD distro now) in Yacc and Lex as a personal exercise to see if
    I understood. I still haven't a clue what LALR and LL mean, and I can
    barely tell the difference between recursive descent and the rest, but
    I know P::RD rocks cuz it's Damian code. :)

    Of course, the action language for Yacc and Lex is C. You've got it
    tons easier to do the same thing with P::RD, because the action
    language is Perl. :)

    Hope that helps... and if anyone finds something better than
    O'Reilly's book, let *me* know so I can recommend it as well.

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprecdescent @
categoriesperl
postedSep 24, '01 at 1:16p
activeSep 24, '01 at 3:36p
posts2
users2
websitemetacpan.org...

People

Translate

site design / logo © 2018 Grokbase