Next: The parsers
Up: Handle-recognising DFAs and LR(0)
Previous: Construction of a handle-recognising
  Contents
Any handle-recognising DFA works as follows:
- Start in state .
- SHIFT: As we read symbols from the input, make the appropriate transitions in the
DFA from the current state.
- REDUCE: If we are in a state that has a production rule of the form
for any non-terminal and r.h.s. ,
then we have recognised the handle , and can reduce by the rule.
We do this as follows:
- move backwards along the DFA transitions for each symbol in
- from the state you end up in, make a forwards transition on
- ACCEPT: The final DFA state is the one containing the item
.
If we reach this state and have consumed all the input, then we accept the string
as being valid.
James Power
2002-11-29