[T → • n, )] [T → • n, +] [T → • + T, )] [T → • + T, +] [T → • T + n, )] [T → • T + n, +] · · · From item sets 2, 4 and 5 several more item sets will be produced. The complete list is quite long and thus will not be stated here. Detailed LR(k) treatment of this grammar can e.g. be found in . Goto The lookahead of an LR(1) item is used directly only when considering reduce actions (i.e., when the • marker is at the right end). The core of an LR(1) item [S → a A • B e, c] is the LR(0) item S → a A • B e. Different LR(1) items may share the same core. For example, in item set 2 [E → T •, $] [T → T • + n, $] [T → T • + n, +] the parser is required to perform the reduction [E → T] if the next symbol is '$', but to do a shift if the next symbol is '+'. Note that a LR(0) parser would not be able to make this decision, as it only considers the core of the items, and would thus report a shift/reduce conflict. A state containing [A → α • X β, a] will move to a state containing [A → α X • β, a] with label X. Every state has transitions according to Goto. Shift actions If [A → α • b β, a] is in state Ik and Ik moves to state Im with label b, then we add the action action[Ik, b] = "shift m" Reduce actions If [A→α •, a] is in state Ik, then we add the action action[Ik, a] = "reduce A → α" References External links Practical LR(k) Parser Construction HTML page, David Tribble First & Follow Sets Construction in Python (Narayana Chikkam) Parsing algorithms