in reply to Writing Interpreters, Compilers and Translators in Perl

I look forward to your talk in Vienna.

I presume you are going to cover Damian's Parse::RecDescent - I would hope that you do so in some detail. Although it doesn't cover every situation, it is a tool that can enable parsing applications to be developed rapidly. When it comes to P::RD's autotrees, I wrote a module Parse::RecDescent::Topiary that assists in getting the trees in the shape you want them (properly constructed objects), rather than how Parse::RecDescent generates them.

It may be worth covering the history, and including YACC and LEX in the scope. Knowledge of bottom up parsers and how they differ from top down, is useful.

wetware hacker
(Qualified NLP Practitioner and Hypnotherapist)

  • Comment on Re: Writing Interpreters, Compilers and Translators in Perl

Replies are listed 'Best First'.
Re^2: Writing Interpreters, Compilers and Translators in Perl
by Moron (Curate) on May 24, 2007 at 12:59 UTC
    Thanks very much for your reply

    Yes, Parse::RecDescent is obviously within the scope, but as you also suggest, it's not a panacea for all cases and has a number of non-generic impositions.

    Your own module resolves some of those and so will also get some coverage in my tutorial.

    In the tutorial I will try to represent an unbiased choice of a) programming the relevant software by integration of CPAN modules versus b) from scratch or at least from an unassuming code design basis, although from-scratch takes more time to explain. I'll kick that off during the section "relevant code design", showing the two ways to go, again avoiding bias. I also feel that OO Perl should be a conscious choice during code design rather than a given and I feel I should also give people a free choice between OO and procedural Perl, without me imposing one or other on them. (oops I forgot to define audience-level in the OP -- updating ... )

    I will now add a short section on grammar definition - I was going to downgrade the grammar definition part to below subtopic visibility on the grounds that it's general rather than Perl-specific, but because Parse::RecDescent needs it, I have a good enough excuse after all! (updating contents list ... whirr, click).

    I'll also take your point about covering top-down versus bottom-up - thanks a lot! I was anyway going to go even further back in history than you suggest and very briefly explain the original unix lex and yacc approach (update: actually maybe even further back, because there are kinds of interpreters that can't use yacc) and then work forward from there so that Perl beginners with general programming knowledge gained elsewhere don't feel they just landed on the planet Zartog!


    ^M Free your mind!