Consider the grammar shown below
\(S \rightarrow AA\)
\(A \rightarrow aA / d\)
The grammar is :
MH SET - 2023, SET Exam - 2023,
Answer: A
The grammar is LL(1).
A grammar is LL(1) if, for each non-terminal, the alternatives can be told apart by one symbol of lookahead. S has a single production. For A → aA | d, the alternatives begin with different terminals: FIRST(aA) = {a} and FIRST(d) = {d}, which are disjoint, and neither alternative derives the empty string, so no FOLLOW set is involved.
Every LL(1) grammar without such conflicts is also SLR(1), LALR(1) and LR(1), so the options that say 'but not LL(1)' are all false for this grammar.
Please log in or register to report this question.