fool2fish / dragon-book-exercise-answers

Compilers Principles, Techniques, & Tools (purple dragon book) second edition exercise answers. 编译原理(紫龙书)第2版习题答案。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

4.4.3 FOLLOW(S) issue

x-ji opened this issue · comments

Should be {$, a, +, *} instead of {a, +, *}

Precisely, I think this change has to be made. @fool2fish

what's the reason for 'a' to stay in FOLLOW(S)? If it does, you will get a conflict at M[A, a].

S -> a A
A-> S + A | S * A | ε
(I thought it worked.)

@NoteBookie yeah 'a' should be removed

No! I think 'a' should be put in,it's what the question asked.the @NoteBookie did is how to fix it.Here what we should do is get the follow set by the rule.

'a' shouldn't be in FOLLOW(s) @Yudezhi