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).
Please log in or register to report this question.