Skip to content
Official PYQ · 2025

GATE CS 2025 Set 2 Q41 — Parsing (LL, LR)

Explain with AI

Consider two grammars G1G_{1} and G2G_{2} with the production rules given below: 


G1:S→G_{1} : S \rightarrow ifif EE thenthen SS ∣| ifif EE thenthen SS elseelse SS ∣| aa

        E→bE \rightarrow b

G2:S→G_{2} :S \rightarrow ifif EE thenthen SS ∣| MM 

        M→M \rightarrow ifif EE thenthen MM elseelse SS ∣| cc

        E→bE \rightarrow b 
 

where if,then,else,a,b,cif, then, else, a, b, c  are the terminals. 

Which of the following option(s) is/are CORRECT? 

Select all correct options
View answer

Answer: C;D

Worked explanation not available yet.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Parsing (LL, LR) questions