Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Eliminating Left Recursion in Parse::RecDescent

by Anonymous Monk
on May 29, 2002 at 00:16 UTC ( #169940=note: print w/ replies, xml ) Need Help??


in reply to 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) etc.


Comment on Re: Eliminating Left Recursion in Parse::RecDescent
Re: Eliminating Left Recursion in Parse::RecDescent
by Abigail-II (Bishop) on May 29, 2002 at 10:42 UTC
    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

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://169940]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2015-07-05 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls