Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Parse::RecDescent and need for speed

by kvale (Monsignor)
on Feb 15, 2005 at 23:41 UTC ( [id://431384]=note: print w/replies, xml ) Need Help??


in reply to Parse::RecDescent and need for speed

Personally, I find that code generated by Parse::RecDescent is generally slower than a hand-coded recursive descent parser. But such comparisons really depend on the skill of the programmer.

Without seeing your language, grammar, or parser, I can't give any specific advice. In perl top-down parsers, nonterminals in your grammar generally correspond to functions and terminals to regular expressions. So eating comments should be a pretty fast operation. An excellent book on parsers and compilers is Compilers: Principles, Techniques, and Tools, by Aho, Sethi and Ullman.

-Mark

  • Comment on Re: Parse::RecDescent and need for speed

Replies are listed 'Best First'.
Re^2: Parse::RecDescent and need for speed
by merlyn (Sage) on Feb 16, 2005 at 01:03 UTC

      At one point, theDamian said he would rewrite it to use pos (which wasn't available in 5.004 when he wrote PRD)

      Bull. pos was available in 5.000, as the perl5.000 manual will tell you.

      At one point, theDamian said he would rewrite it to use pos (which wasn't available in 5.004 when he wrote PRD)
      First non-comment, non-whitespace line of Parse::RecDescent:
      use 5.005;
        In fact, the original was written for 5.004, because it was written on MacPerl, which was only 5.004 at the time.

        The use 5.005 was no doubt added later when some other feature required 5.005.

        -- Randal L. Schwartz, Perl hacker
        Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://431384]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found