Consider the following context-free grammar where the start symbol is S and the set of terminals is {a,b,c,d}.
$ S \rightarrow AaAb \mid BbBa $
$ A \rightarrow cS \mid \epsilon $
$ B \rightarrow dS \mid \epsilon $
The following is a partially-filled LL(1) parsing table.
a | b | c | d | $ | |
---|---|---|---|---|---|
S | S $\rightarrow$ AaAb | S $\rightarrow$ BbBa | (1) | (2) | |
A | A $\rightarrow \epsilon$ | (3) | A $\rightarrow$ cS | ||
B | (4) | B $\rightarrow \epsilon$ | B $\rightarrow$ dS |
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.
Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is $\{ a, b, c, d, \, \#, \, @ \}$
$S' \rightarrow S$
$S \rightarrow SS \;|\; Aa \;|\; bAc \;|\; Bc \;|\; bBa$
$A \rightarrow d\#\#$
$B \rightarrow @$
Let $I_0 = \text{CLOSURE}( \{ S' \rightarrow \bullet S \} )$. The number of items in the set $GOTO(I_0, \, S)$ is __________.
Consider the following grammar $G$, with $S$ as the start symbol. The grammar $G$ has three incomplete productions denoted by (1), (2), and (3).
$$S \rightarrow d a T \mid \underline{\ (1)}$$
$$T \rightarrow a S \mid b T \mid \ \underline{(2)}$$
$$R \rightarrow \underline{(3)} \mid \epsilon$$
The set of terminals is $\{a, b, c, d, f\}$. The FIRST and FOLLOW sets of the different non-terminals are as follows.
FIRST($S$) = $\{c, d, f\}$, FIRST($T$) = $\{a, b, \epsilon\}$, FIRST($R$) = $\{c, \epsilon\}$
FOLLOW($S$) = FOLLOW($T$) = $\{c, f, \#\}$, FOLLOW($R$) = $\{f\}$
Which one of the following options CORRECTLY fills in the incomplete productions?
Consider the following augmented grammar with {#, @, <, >, a, b, c} as the set of terminals.
S' → S
S → S # cS
S → SS
S → S @
S → < S >
S → a
S → b
S → c
Let I0 = CLOSURE({S' → ∙ S}). The number of items in the set GOTO(GOTO(I0, <), <) is _______