Skip to content

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

GateBrew
← GATE CSE 2012
Questions

Q52

MCQ2 marks, −0.67Compiler designMedium

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, $\text{\textdollar} indicates end of input, and, ∣\mid separates alternate right hand sides of productions. S→aAbB∣bAaB∣εS \rightarrow aAbB \mid bAaB \mid \varepsilon A→SA \rightarrow S B→SB \rightarrow S

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

The FIRST and FOLLOW sets for the non-terminals AA and BB are

Sign in to save attempts.

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