This circular dependence should not begin with this. this is the algorithm to search for "follow":
Initialize all of the following groups to {}, except for S, which is init, to {$}.
Although there are changes, for each A∈V do:
For each Y → αAβ do:
follow (A) = follow (A) ∪ first (β)
If β ⇒ * ε, then also: follow (A) = follow (A) ∪ follow (Y)
, :
(S) = {, $}
(B) = {, $}
(D) = {, }