Multiple choice

Consider the grammar shown below. S $\rightarrow$ C C C $\rightarrow$ c C | d This grammar is

  1. LL(1)

  2. SLR(1) but not LL(1)

  3. LALR(1) but not SLR(1)

  4. LR(l) but not LALR(1)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Given grammar $$ S \rightarrow CC $$ $$C \rightarrow cC|d$$ it can't be LL since $C \rightarrow cC$ is recursive. LR(1) also known as CLR parse, and every CF grammar is CLR grammar. So (A) is false but (C) & (D) can be ccorrect. This grammar is CLR and also reducible to LALR without any conflicts. So (D) if false. Only need to check for SLR(1) or LR(0) This grammar is not SLR