I've some problems to understand the function FOLLOW. I cannot calcule follow functions of a grammar and that's not good. I tried exercises to understand this function and in particulary this exercise, I've this grammar :
S -> E
E -> T E'
E' -> + T E' | minus T E' |
T -> F T'
T' -> * F T' |
F -> id | ( F'
F' -> E ) | n )
Here the results of the calculating of follow function :
S $
E ), $
E' ), $
T +, minus, ), $
T' +, minus, ), $
F *, +, minus, ), $
F' *, +, minus, ), $
I really don't understand why the FOLLOW(T)=FOLLOW(T') = { +, minus, ), $ } In the grammar that I give, theterminal symbols plus and minus never appears on the right of T or T' so if someon can explain me this, it will be cool