What will be the “First” and “Follow” of E and F for the following grammar? E…

2017

What will be the “First” and “Follow” of E and F for the following grammar?

E -> TE'
E' -> +TE' / ε
T -> FT'
T' -> *FT' / ε
F -> id / (E)

  1. A.

    First(E)={id, (, ε}, Follow(E)={ε, )}, First(F)={id, ), $}, Follow(F)={, $, (}

  2. B.

    First(E)={id, (}, Follow(E)={$, )}, First(F)={id, (}, Follow(F)={, $, ), +}

  3. C.

    First(E)={id, ), ε}, Follow(E)={ε, )}, First(F)={id, )}, Follow(F)={, $, (, +}

  4. D.

    First(E)={id, )}, Follow(E)={$, )}, First(F)={id, (, $}, Follow(F)={, $, ), +}

Attempted by 64 students.

Show answer & explanation

Correct answer: B

image.png

Explore the full course: Niacl Ao It Specialist