问题
I have a set of grammar and I need to find the First and Follow from it. So far I've managed to make the First, but now I'm confused as to how to make the Follow.
The set of grammar that I tried to solve:
E -> -E | (E) | VT
T -> -E | ε
V -> id L
L -> (E) | ε
The First that I've come up with. If something's wrong, please inform me:
First (E) = -, (, id
First (T) = -, ε
First (V) = id
First (L) = (, ε
Here's the Follow that I've managed to gather up so far:
Follow (E) = $, )
Follow (T) = $, )
Follow (V) =
Follow (L) =
Right now I'm struggling to find the Follow for (V). And I'm certain once I find the Follow for (V), then I can find the Follow for (L). How do I find the Follow for (V) and what is the Follow for (V)?
来源:https://stackoverflow.com/questions/64841654/finding-first-and-follow-in-top-down-parsing