A lexical analyzer uses the following token definitions
• letter [A - Za - z]
• digit [0 - 9]
• id letter (letter digit)
• number digit
• ws (blank tab newline)
For the string given below,
x1 23 mm 78 y 7z zz5 14A 8H AaYcD
the number of tokens (excluding ws) that will be produced by the lexical analyzer is ________. (answer in integer)
GATE CS 2026 (Afternoon) — Question 35
Compiler DesignLexical Analysis & Parsing Architectures (LL(1), LR(1), LALR)NAT1 markMedium
A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.
More on Lexical Analysis & Parsing Architectures (LL(1), LR(1), LALR)
- GATE CS 2026 (Forenoon) · Q27Consider the following C statements: c char str1 = "Hello; / Statement S1 / char str2 = "Hello;"; / Statement S2 / int str3 = "Hello"; / St…
- GATE CS 2026 (Forenoon) · Q28Which of the following statements is/are true?
- GATE CS 2026 (Afternoon) · Q41Consider the canonical LR(0) parsing of the grammar below using terminals \ a, b, c\ and non-terminals \ A, B, C, S\ with S as the start sy…
- GATE CS 2025 (Forenoon) · Q46Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?
- GATE CS 2025 (Afternoon) · Q40Given a Context-Free Grammar G as follows: S Aa bac dc bda A d Which ONE of the following statements is TRUE?
- GATE CS 2025 (Afternoon) · Q51Consider two grammars G 1 and G 2 with the production rules given below: G 1 : S if E then S if E then S else S a E b G 2 : S if E then S M…

