Good luck, this is one of my favourite topics ;)

There is a recent new animal called Parse::Eyapp which deserves having a look. Also Manning has released recently a book on the subject of parsing with Perl.

Would be nice to have a review of table-driven top-down parsing and possible speed advantage of (almost)infinite backtracking: look at packrat parsing in Wikipedia and google for SLK, and then you could tell us how to do a fast version of Parse::RecDescent, and if you start the project maybe i'll even help you ;).

PPI has some interesting comments in its doc about parsing in general. It would be really nice to have a survey of the various techniques used in the various sucessful parsers written in Perl (even the ones with C parts) so that it could be extrapolated a useful set of rules for a generic useful (fast, easy to use) parser generator .

Another interesting line of thought is "chunk parsing" and give the illusion of "stream" regexes. Obviously what is needed is a smart tokenizer. One simple approach is to have various chunk levels, you drive a simple m//gc regex-based lexer with a small chunk (string); if match you add chunk to have always minimum length and if no-match you add it another chunk and some kind of heuristics which enable switching to something faster if parsing comment-like or quotish-like (pretokenizing on big chunks)...some ideas can be taken from IO::Tokenizer, IO::Mark and the such

Cheers --stephan

In reply to Re^3: Writing Interpreters, Compilers and Translators in Perl by sgt
in thread Writing Interpreters, Compilers and Translators in Perl by Moron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.