dragon-book-exercise-answers icon indicating copy to clipboard operation
dragon-book-exercise-answers copied to clipboard

4.6的题目,完全没必要提取左公因子,或者消除左递归

Open ArchNew opened this issue 8 years ago • 4 comments

因为LR/SLR是自底向上分析法。而提取左公因子,以及消除左递归,是因为自顶向下分析法是基于最左推导的,这导致它无法处理左递归。而自底向上分析法完全没有此类困扰,也就完全没有必要画蛇添足地去搞什么提取左公因子,或者消除左递归。

更何况,通过提取左公因子和消除左递归,会引进更多的非终结符号,从而导致LR表迅速膨胀。

ArchNew avatar Jan 11 '17 08:01 ArchNew

我看了半天 也感觉确实不用的

johanntony avatar Dec 18 '20 06:12 johanntony

嘿嘿嘿,我这个也想了好久的

------------------ 原始邮件 ------------------ 发件人: "fool2fish/dragon-book-exercise-answers" <[email protected]>; 发送时间: 2020年12月18日(星期五) 下午2:51 收件人: "fool2fish/dragon-book-exercise-answers"<[email protected]>; 抄送: "Subscribed"<[email protected]>; 主题: Re: [fool2fish/dragon-book-exercise-answers] 4.6的题目,完全没必要提取左公因子,或者消除左递归 (#109)

我看了半天 也感觉确实不用的

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

moonson324 avatar Dec 18 '20 09:12 moonson324

确实

yuzhi535 avatar Nov 14 '21 16:11 yuzhi535

答案都是错的

StephenChips avatar Jan 04 '22 13:01 StephenChips