next up previous contents
Next: Constructing LR(1) Item sets Up: BOTTOM-UP PARSING Previous: SLR(1) Parsers   Contents

$LR(1)$ Parsers

In order to introduce lookahead as early as possible into the parser construction, we define the following:

An $LR(1)$ item is an $LR(0)$ item plus some lookahead symbols.

Thus an $LR(1)$ item looks like: $[A\, \rightarrow\,\alpha_1 \alpha_2 \ldots \alpha_i {}_{\triangle} \alpha_{i+1} \ldots \alpha_n,\; a]$

This means that:

[Note: Given that the next input symbol will be following $A$ in the current sentential form, we know that the lookahead symbol `a' must be in $FOLLOW(A)$.]



Subsections

James Power 2002-11-29