Calculating First and Follow of a grammar

66 Views Asked by At

I'm trying to calculate First and Follow of the following grammar:

S -> A B C D E
A -> a
A -> EPSILON
B -> b
B -> EPSILON
C -> c
D -> d
D -> EPSILON
E -> e
E -> EPSILON

I calculated them and got First(S)={a,b,c}. But using this tools, says: First(S)= {a, ε, c, b}. Why epsilon is part of First(S)? As I understand it should not be there. Is it my mistake or a bug? In case it's a bug. Are there other tools I can use to verify my results? In case it's my mistake, it would be helpful to understand why. Printscreen:

enter image description here

Also I got Follow(C)={d,e,$} but their result is Follow(C)={c, d, $}. Why?

0

There are 0 best solutions below