File labs/ans2-2.html    Author McKeeman    Copyright © 2008    index

Adding S to E.cfg

# FILE:  E.cfg
# PURPOSE: sanity check on LR(1) processor
#
E
  S eof
S
  T
  S + T
T
  F
  T * F
F
  i
  ( S )

The point is that * binds more tightly than +. This can be seen by considering the definition of T: * has already been processed before + can be processed. Sometimes it is easier to see this by drawing a tree of a small example.