Skip to content
Official PYQ · 2012

GATE CS 2012 Q53 — Parsing (LL, LR)

Explain with AI

For the grammar below, a partial LL(1)LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1,E2,E1, E2, and E3E3. ε\varepsilon is the empty string, \$ indicates end of input, and, ∣\mid separates alternate right hand sides of productions.

  • S→aAbB∣bAaB∣εS \rightarrow a A b B \mid b A a B \mid \varepsilon
  • A→SA \rightarrow S
  • B→SB \rightarrow S

ab$SE1E2S→εAA→SA→SerrorBB→SB→SE3\begin{array}{|l|l|}\hline \text{} & \textbf{a} & \textbf{b} & \textbf{\$} \\ \hline \text{$S$} & \text{E1} & \text{E2} & \text{$S\rightarrow \varepsilon $} \\ \hline \text{$A$} & \text{$A\rightarrow S$} & \text{$A\rightarrow S$} & \text{error} \\ \hline \text{$B$} & \text{$B\rightarrow S$} & \text{$B\rightarrow S$} & \text{$E3$} \\ \hline \end{array}The appropriate entries for E1,E2,E1, E2, and E3E3 are

Choose one option
View answer

Answer: C

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