in reply to Re: Eliminating Left Recursion in Parse::RecDescent
in thread Eliminating Left Recursion in Parse::RecDescent

all this does is change the expression to
expr : term '+' term | term
which works fine but does not solve the problem. (a+b) + (c+d)

That is because demerphq applied the rule wrongly. After applying the rule, we should get:

expr : term expr_tail expr_tail : '+' term expr_tail | {1}

Abigail

Replies are listed 'Best First'.
Re: Re: Eliminating Left Recursion in Parse::RecDescent
by demerphq (Chancellor) on May 29, 2002 at 14:55 UTC
    Doh. Yes. I did too. And you guys are the first to spot the error as well.

    In my defence, I got it right in one part, here

    A : y R R : x R | e
    But omitted the R element in the example.

    I have updated the node. Thanks for your hawklike eyes.

    Yves / DeMerphq
    ---
    Writing a good benchmark isnt as easy as it might look.