Lexical Analysis
GATE CSE & IT · 12 questions across 10 years (1988-2026) · 25% recurrence rate
Recurrence sparkline
1988–2026Difficulty mix
Question types
All 12 questions on Lexical Analysis
Consider the following C statements: char str1 = "Hello; / Statement S1 */ char str2 = "Hello;"; / Statement S2 */ int str3 = "Hello"; / Statement S3 */ Which of the following options is/are correct?
A lexical analyzer uses the following token definitions letter → [A - Za - z] digit → [0-9] id → letter (letter $\mid$ digit)* number → digit $^{+}$ ws → (blank | tab | newline) ${ }^{+}$ For the string given below, $x1...
A lexical analyzer uses the following patterns to recognize three tokens $${T_1},{T_2},$$ and $${T_3}$$ over the alphabet $$\left\{ {a,b,c} \right\}.$$ $$\eqalign{ & {T_1}:\,\,\,a?{\left( {b|c} \right)^ * }a \cr & {T_2}:...
Match the following: GROUP - 1 GROUP - 2 (P) Lexical analysis (i) Leftmost derivation (Q) Top down parsing (ii) Type checking (R) Semantic analysis (iii) Regular expressions (S) Runtime environments (iv) Activation recor...
In a compiler, keywords of a language are recognized during
Match all items in Group 1 with correct options from those given in Group 2. Group 1 P. Regular expression Q. Pushdown automata R. Dataflow analysis S. Register allocation Group 2 1. Syntax analysis 2. Code generation 3....
The number of tokens in the following C statement is: printf("i = %d, &i = %x",i, &i);
The number of tokens in the Fortran statement DO 10 I = 1.25 is
Which of the following strings can definitely be said to be tokens without looking at the next input character while compiling a Pascal program? I. begin II. program III. <>
In some programming languages, an identifier is permitted to be a letter following by any number of letters or digits. If L and D denote the sets of letters and digits respectively, which of the following expressions def...
Match the following: List - I (a) Lexical Analysis (b) Code Optimization (c) Code Generation (d) Abelian Group List - II (p) DAG's (q) Syntax trees (r) Push Down automata (s) Finite automata
In a compiler the module that checks every character of the source text is called: