next up previous contents
Next: Handle-recognising DFAs and LR(0) Up: items Previous: Kernel Items   Contents

The closure and move operations on items

The process of building a handle-recognising DFA from $LR(0)$ items is very similar to converting a NFA to a DFA using the "subset construction" algorithm of section 1. Hence we will need some equivalent of $\varepsilon$-closure and the NFA $move$ function.

To get the closure of a set of items, take all those items which have the marker immediately to the left of a non-terminal, and add in all the non-kernel items for that non-terminal. This operation is very similar to the $\varepsilon$-closure operation since we can ``get to'' all items in the closure set of an item without shifting any symbols (ie. without consuming any input).

The transitions in the DFA will correspond to moves between item-sets based on some symbol. Basically move works as follows:

Let $x$ represent any symbol (terminal or non-terminal), $\alpha$ and $\beta$ are any sequence of symbols, then:

\begin{displaymath}\begin{array}{rcl}
{\sf move}\{A \,\rightarrow\, \alpha {}_{\...
...beta , b\} & = & \{\},\; for\; any\; b \not = x \\
\end{array}\end{displaymath}


next up previous contents
Next: Handle-recognising DFAs and LR(0) Up: items Previous: Kernel Items   Contents
James Power 2002-11-29