Machine-translated by Google. Questions are authored in English.
Top

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.

  • A.1 and 2 only
  • B.3 only
  • C.1 only
  • D.All of them

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).

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.