In an LL(1) language, the scanner produces tokens that the parser examines
Aone token, 1-token lookahead
Ball at once
Cbackwards (right to left)
Dwith infinite lookahead
Answer & Solution
Correct answer: A. one token, 1-token lookahead
1. LL(k) parser: Left-to-right scan, Leftmost derivation, with $k$ tokens of LOOKAHEAD.
2. LL(1) — the most common case — looks at the NEXT ONE token to decide which production to apply.
3. Tokens are produced ON DEMAND by the scanner: the parser asks 'give me the next token', the scanner consumes characters until it has one to return.
4. This streaming interaction is memory-efficient and matches modern compiler architecture.
5. Other options don't describe LL(1) parsing.
_Source: Bob Nystrom, "Crafting Interpreters", Ch 6.2 (Recursive Descent Parsing — overview)._
Keep practising Compiler Design
Browse all Compiler Design questions for GATE CSE, or explore more Computer Science topics.
Related questions
The FOLLOW(A) set in LL parsing isThe FIRST(α) set of a string α in LL parsing isAfter the parser produces an AST, the next compiler phase is typicallyA SHIFT/REDUCE CONFLICT in an LR parser occurs whenLL parsers (recursive descent) parse from thePANIC MODE error recovery in a parser works byWhat is a SYNTAX ERROR?How does a parser typically encode OPERATOR PRECEDENCE in the grammar?