@zareen said in CS606 Assignment 2 Solution and Discussion:
Assignment Marks 20
Question:
X -> aZ
X -> c
Y -> bX
Z -> Ya
Z -> XbY
a) Find First sets for above grammar. (10 Marks)
b) Find Follow sets for above grammar. (10 Marks)
Solution:
a) Find First sets for above grammar. (10 Marks)
First (X)= a, c
First (Y)= b
First (Z)= a, b, c
b) Find Follow sets for above grammar. (10 Marks)
Follow (X)= a, b, $
Follow (Y)= a, b, $
Follow(Z)= a, b, $