Next: Unger's Method
Up: Early's Parser
Previous: Early's Items
  Contents
Early's algorithm proceeds as follows:
Given any grammar with start symbol , and some input string of length ,
- Form the start state, which consists of the item
and its closure
- For each new state (for some position ) that we create, and for each item in that state:
- Shift Input (Marker before a terminal)
If the item is of the form
where is a terminal symbol matching the input symbol , create the state formed by taking the closure of:
- Apply Rule (Marker at end of rule)
If the item is of the form
look at all those states for that have the marker to the left of ; ie items of the form
and create new states consisting of the closure of items of the form:
- Keep applying step (2) until all states up to have been generated. If one of these then contains the item
the parse has been successful.
Next: Unger's Method
Up: Early's Parser
Previous: Early's Items
  Contents
James Power
2002-11-29