Difference between Left Factoring and Left Recursion

后端 未结 7 1163
长情又很酷
长情又很酷 2020-12-13 06:25

What is the difference between Left Factoring and Left Recursion ? I understand that Left factoring is a predictive top down parsing t

7条回答
  •  轮回少年
    2020-12-13 07:02

    left recursion:= when left hand non terminal is same as right hand non terminal. Example: A->A&|B where & is alpha. We can remove left ricursion using rewrite this production as like.

    A->BA' A'->&A'|€

    Left factor mean productn should not non deterministic. . Example: A->&A|&B|&C

提交回复
热议问题