in reply to Parse::RecDescent precompiled grammar != interp'd

It might be worth checking if you use global variables or namespace variables in your grammar rules. Are you setting them up and handling them the same way you did before you compiled your grammar?

How bad is it to live with compiling the grammar at the start of each run? I usually try to keep it in memory anyway, so the startup cost isn't too bad.

And yes, we would need code, or at least the text of the error messages to help you further.

____________________
Jeremy
I didn't believe in evil until I dated it.

  • Comment on Re: Parse::RecDescent precompiled grammar != interp'd

Replies are listed 'Best First'.
Re: Re: Parse::RecDescent precompiled grammar != interp'd
by bear_hwn (Acolyte) on Jun 03, 2003 at 21:03 UTC
    yes, some globals are used, e.g. to construct the instruction words for the machine and keep track of address and lines, etc. these should not have any effect on the parsing, methinks. i've just made a reply, with some code and output samples, to revdiablo. as for startup cost, the beastie is _terribly_ slow. precompiling helps a bit, but what i'd really like to do is to get perlcc to be happy with it, but alas, that's a whole different can of worms: it has serious complaints and gives errors like "compile failed...that cannot happen!" :-/