Multiple choice

The grammar $S \rightarrow SA|A$ $A \rightarrow a$

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

  2. SLR (1) and LL (1)

  3. Not SLR (1), not LL (1)

  4. Not SLR (1), but LL (1)

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

For LL(1) grammar, for no terminal 'a', do both '$\alpha$' and '$\beta$' derive strings beginning with a. Here, the production S $\rightarrow$A and A $\rightarrow$a both derive strings beginning with a. So it is not LL (1).Now, the canonical collection of sets of LR (0) items for grammar is  There is no conflict in the LR (0) items. So, it is in SLR (i). So option (a) is correct.