Practice free →
HomeGATE CSEcomputerscienceCompiler Design › In an LL(1) language, the scanner produces token…

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)._
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions