0

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?

vesii
  • 2,760
  • 4
  • 25
  • 71
  • It's a bug. The "tool" is unreliable. But it's easy to verify your results using the definitions of FIRST and FOLLOW. – rici Feb 16 '21 at 19:54
  • Also see: https://stackoverflow.com/q/43970429/1566221 – rici Feb 17 '21 at 03:58

0 Answers0