1
GATE CSE 2026 Set 2
Numerical
+1
-0

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 \quad 23mm \quad 78\quad$ y $\quad7 z \quad z z 5 \quad 14 A \quad 8 H \quad A a Y c D$

the number of tokens (excluding ws) that will be produced by the lexical analyzer is

$\_\_\_\_$ . (answer in integer)

Your input ____
2
GATE CSE 2026 Set 1
MCQ (More than One Correct Answer)
+1
-0

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

S 1 and S 2 have syntactic errors

B

S 2 has a lexical error and S 3 has a syntactic error

C

S 1 has a lexical error and S 3 has a semantic error

D

S1 has a syntactic error and S3 has a semantic error

3
GATE CSE 2024 Set 2
MCQ (Single Correct Answer)
+1
-0.33

Consider the following two sets:

Set X

P. Lexical Analyzer

Q. Syntax Analyzer

R. Intermediate Code Generator

S. Code Optimizer

Set Y

1. Abstract Syntax Tree

2. Token

3. Parse Tree

4. Constant Folding

Which one of the following options is the correct match from Set X to Set Y?

A

P – 4; Q – 1; R – 3; S – 2

B

P – 2; Q – 3; R – 1; S – 4

C

P – 2; Q – 1; R – 3; S – 4

D

P – 4; Q – 3; R – 2; S – 1

4
GATE CSE 2011
MCQ (Single Correct Answer)
+1
-0.3
In a compiler, keywords of a language are recognized during
A
parsing of the program
B
the code generation
C
the lexical analysis of the program
D
dataflow analysis

GATE CSE Subjects

Browse all chapters by subject

Software Engineering
Web Technologies