Using these idea, we are ready to construct a handle-recognising DFA.
DFA states are sets of items; making a transition in the DFA
corresponds to moving the marker one place to the right in an item.
We make things a little easier if we introduce a production rule of the form
to the grammar, where is the start symbol.
Whenever we reduce by this rule, we know
that we are finished. (A grammar which has had this rule added is called an augmented
grammar).
Since our new start symbol is now , the "goal" of the parse will be to recognise an and
reduce this to ; this is represented by the item:
. This item
is called the initial item.