Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2024 Set 2
Questions

Q30

MCQ2 marks, −0.67Compiler design

Consider the following context-free grammar where the start symbol is S\text{S} and the set of terminals is {a,b,c,d}\{a, b, c, d\}.

S→AaAb∣BbBaA→cS∣ϵB→dS∣ϵ\begin{array}{l} S \rightarrow A a A b \mid B b B a \\ A \rightarrow c S \mid \epsilon \\ B \rightarrow d S \mid \epsilon \end{array}

The following is a partially-filled LL(1)\text{LL}(1) parsing table. $\begin{array}{|c|c|c|c|c|c|c|}\hline &a&b&c&d&$ \\ \hline S &S\rightarrow AaAb &S\rightarrow BbBa &\text{(1)} & \text{(2)} & \\ \hline A & A \rightarrow \varepsilon &\text{(3)} & A\rightarrow cS& & \\ \hline B & \text{(4)} &{B \rightarrow \varepsilon} & &B\rightarrow dS& \\ \hline \end{array}$ Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table? Note: In the options, "blank" denotes that the corresponding cell is empty.

Sign in to save attempts.

Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.