retagged by
870 views
4 votes
4 votes

Consider the following grammar given below.
$$
\begin{aligned}
& A \rightarrow B+A \\
& A \rightarrow B \\
& B \rightarrow C B \\
& B \rightarrow C \\
& C \rightarrow D^* \\
& C \rightarrow D \\
& D \rightarrow(A) \\
& D \rightarrow a \mid b
\end{aligned}
$$
What will be the content of the stack of SLR parser immediately after shifting the last character of the string: $a^* b($

  1. $\operatorname{CC}($
  2. $\mathrm{BC}($
  3. $\mathrm{CB}$
  4. $\mathrm{BB}$
retagged by

1 Answer

2 votes
2 votes

If there were options like CB( , CA( Then can they be considered correct answers?

Answer:

Related questions

600
views
1 answers
3 votes
GO Classes asked Jan 13
600 views
Suppose there is a handle on the top of the stack at some point in time while performing $\text{LR(k)}$ parsing. In this context, a ... generating any conflict.The parser may execute a shift operation without generating any conflict.