I'm using Parse::RecDescent now, and though it seems to handle anything I throw at it, it takes it's time :) The grammar for my language is fairly large, and just instantiating the parser takes almost 3 seconds (not to mention actually parsing something). I'm looking for ways to speed this up.
The grammar won't change very often, so I've been trying to use Storable to store and retrieve the RecDescent data structure
# store it
my $parser = new Parse::RecDescent( GetGrammar() );
store( $parser, $PARSER_LOCATION );
...
# retrieve it later
my $parser = retrieve( $PARSER_LOCATION );
The problem I get is this:
Unknown starting rule (Parse::RecDescent::namespace000001::rule) calle
+d
I'm not sure exactly what is happening now... but it doesn't seem that storing the instantiated parser is working. Has anyone tried this / know if what I'm trying to do is possible / feasible?
Thanks in advance,
Brian
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.