Consider the following grammar πΊ, with π as the start symbol. The grammar πΊβ¦
PYQ GATE 2024
Consider the following grammar πΊ, with π as the start symbol. The grammar πΊ has three incomplete productions denoted by (1), (2), and (3).
Β Β Β Β Β Β Β Β Β Β Β Β Β π β πππ | (1)
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β π β ππ | ππ | (2)
Β Β Β Β Β Β Β Β Β Β Β Β Β π β (3) | π
The set of terminals is {π, π, π, π, π}. The FIRST and FOLLOW sets of the different non-terminals are as follows.
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β FIRST(π) = {π, π, π}, FIRST(π) = {π, π, π}, FIRST(π ) = {π, π}
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β FOLLOW(π) = FOLLOW(π) = {π, π, $}, FOLLOW(π ) = {π}
Which one of the following options CORRECTLY fills in the incomplete productions?
- A.
(1) π β π π (2) π β π (3) π β πππ
- B.
(1) π β ππ (2) π β π (3) π β πππ
- C.
(1) π β ππ (2) π β ππ (3) π βΒ ππ
- D.
(1) π β π π (2) π β ππ (3) π βΒ ππ
Attempted by 230 students.
Sign up free to check your answer
Sign up freeLoading lessonβ¦

