Chapter 4: Syntax Analysis

Start state

. Start state of DFA is an empty stack corresponding to S' .S item

- This means no input has been seen

- The parser expects to see a string derived from S

. Closure of a state adds items for all productions whose LHS occurs in an item in the state, just after "."

- Set of possible productions to be reduced next

- Added items have "." located at the beginning

- No symbol of these items is on the stack as yet

The start state of the parser corresponds to an empty stack corresponding the production S' .S (the production added during the augmentation). This means, that the parser expects to see input which can be reduced to S and then further to S' (in which case, the input is accepted by the parser). Closure is the method to find the set of all productions that can be reduced next. The items added by closure have " . " at the beginning of the RHS of production. To put in simple words, it adds alternate ways to expect further input.