Discussion
Consider the grammar shown below
\(S \rightarrow AA\)
\(A \rightarrow aA / d\)
The grammar is :
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.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development