I have the following grammar:
S -> aXab
S -> Y
X -> bYa
X -> epsilon
Y -> Sc
I have computed the first and follow sets for this grammar and I would like to know if it is correct. Here is my solution:
First Sets:
S -> {a}
X -> {b,epsilon}
Y -> {a}
Follow Sets:
S -> {$,c}
X -> {a}
Y -> {c,a}
Any help is appreciated. Thanks.