- Is it correct, that LR(0)-Parsers simply reduces, if there is no transition for the next input-symbol (because it has no lookahead) ?
- Is it correct, that SLR(1)-Parsers use the FOLLOW-Set of the productions as lookahead?
- Is it correct, that LR(1)-Parsers use the FIRST-, not the FOLLOW-Set as lookahead?
The algorithm for closure
clearly uses FIRST
closure(S)
For each item [A → α ⋅ B β, t] in S,
For each production B → γ in G,
For each token b in FIRST(βt),
Add [B → ⋅ γ, b] to S
Then again, I am confused about this.
Under paragraph 4.7.1 Canonical LR(1) Items
the Dragon Book says:
Thus, we are compelled to reduce by A → α only on those input symbols a for which [A → α·, a] is an LR(1) item in the state on top of the stack. The set of such a's will always be a subset of FOLLOW(A), but it could be a proper subset, as in Example 4.51.