GateAI
Lexical Analysis

GATE CSE 2011 · Q19

MCQ1 markEasy

Time

The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) Finite state automata

Lexical Analysis

In compiler construction:

  • Lexical analysis is the phase that converts a sequence of characters into a sequence of tokens (identifiers, keywords, literals, operators, etc.).

  • Tokens in programming languages like Java are specified using regular expressions.

  • The formal computational model that is both necessary and sufficient to recognize languages defined by regular expressions is a Finite State Automaton (DFA/NFA).

  • More powerful automata (like pushdown automata or Turing machines) are not required for lexical analysis because token definitions do not require nesting or arbitrary counting.

Therefore, option (A) is correct.

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 Q19 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 · Q19 · MCQ

The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?

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.