Is pyparsing really a recursive descent parser?

Kay Schluehr kay.schluehr at gmx.net
Sun Nov 4 19:50:37 EST 2007


On Nov 4, 10:44 pm, "Just Another Victim of the Ambient Morality"
<ihates... at hotmail.com>

> I believe there is a cure and it's called recursive descent parsing.
> It's slow, obviously, but it's correct and, sometimes (arguably, often),
> that's more important the execution speed.

Recursive decendent parsing is not necessarily slow but from your
remarks above I infer you want a general RD parser with backtracking:
when one rule doesn't match, try another one to derive the current
symbol in the input stream.

I'm not sure one needs to start again with a naive approach just to
avoid any parser theory. For a user of a parser it is quite important
whether she has to wait 50 seconds for a parse to run or 50
milliseconds. I don't like to compromise speed for implementation
simplicity here.





More information about the Python-list mailing list