"S. Doaitse Swierstra" <[EMAIL PROTECTED]> wrote,
> At 3:53 PM +1100 9/15/00, Fergus Henderson wrote:
> >
> >Doesn't that technique also solve the problem of left-recursion?
>
> No, this cannot be detected to my knowledge. But by using pChainr and
> pChainl combinators left recursion can easily be circumvented.
> Resulting parsers often resemble better what one wants express than
> left recursive formulations.
I agree that this is the case for
E -> E + E | E * E | ( E )
style grammars often used in examples. However, for real
grammers the result is often quite difficult to understand
(and to come up with in the first place). My favourite
example is the expression syntax of C. It has to handle a
plethora of prefix, infix, and postfix operators with
varying precedences. It took me quite while to figure out
how to do that and my first attempt was subtly wrong. The
left recursive grammar is certainly much easier to
understand in this case.
> Off to ICFP now,
See you there :-)
Cheers,
Manuel