GATE CS 2026, set 2 · Question 35 · Compiler Design · Numerical answer (NAT) · 1 mark · no negative marks
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 23mm 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)
Answer
Answer 13
Answer from the official GATE CS 2026 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes