Consider the following grammar G with terminals
a, b, c, d and nonterminals S, A, B, C.
S
CA
A
aBA |
B
bB | Cd
C
cC |
We recall the rules for the computation of the FOLLOW set of each nonterminal.
if
AB
then
: = {}
if
AB
then
: =
if
then
: =
Recall also that if $ denotes the end-of-line symbol and if S is the start symbol of the grammar
(as it is the case above) then we have
$ FOLLOW(S).
Give the parsing table of G (for the non-recursive implementation of predictive parsing).