GateAI
Lexical Analysis

GATE CSE 2011 · Q1

MCQ1 markEasy

Time

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

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) the lexical analysis of the program

Lexical Analysis

During lexical analysis (the scanning phase), the compiler reads the stream of characters composing the source program and groups them into meaningful sequences called lexemes. For each lexeme, the lexical analyzer produces a token (such as keywords, identifiers, constants, and operators).

  • Lexical Analysis (C): Identifies keywords, identifiers, operators, and constants.

  • Parsing / Syntax Analysis (A): Checks the grammatical structure against context-free grammar rules.

  • Code Generation (B): Translates intermediate representation into target machine code.

  • Dataflow Analysis (D): Collects runtime information about data values for code optimization.

Therefore, the correct option is (C).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Lexical Analysis previous year question is Q1 of the GATE CSE 2011 paper. Find more GATE CSE PYQs on Lexical Analysis in Compiler Design, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Lexical Analysis PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Lexical Analysis in GATE CSE

Lexical Analysis has 7 GATE CSE PYQs across 6 papers from 2011 to 2026. 5 of them are 1-mark MCQs like this one, and GATE CSE 2011 has 2.

How GATE tests Lexical Analysis

More from GATE CSE 2011

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2011 · Q1 · MCQ

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

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.