Discussion
Consider the following conditions for a grammar to be LL(1).
1. No two alternatives of a nonterminal have overlapping FIRST sets.
2. If an alternative derives epsilon, the others avoid FOLLOW of that nonterminal.
3. The grammar contains no productions with more than two symbols.
Answer: A
Correct answer: 1 and 2 only
Statements 1 and 2 are precisely the LL(1) conditions: the alternatives must be distinguishable on one token of lookahead, and where one derives epsilon the others must avoid whatever may follow the nonterminal. Statement 3 confuses this with a normal form - the length of a right side has nothing to do with whether the grammar is LL(1).
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