Teaching UGC NET Mock Test Series 2025 (Paper 1 & 2) Compiler Design Syntax Analysis First and Follow
Consider the following grammar:
E - > TE'
E' -> +TE'|\(\epsilon\)
T -> FV
V -> *FV|\(\epsilon\)
F -> (E)|id
The FIRST and FOLLOW sets for the non-terminal F are:
1
FIRST(F) = {(, id}
FOLLOW(F) = {+, *, ), $}
2
FIRST(F) = {(, ), id}
FOLLOW(F) = {+, *, ), $}
3
FIRST(F) = {id}
FOLLOW(F) = {+, *, ), $}
4
FIRST(F) = {(, id}
FOLLOW(F) = {+, *}