The GATE Grind

GATE 2011 CS (CS1) – Question 29

Compiler Design · Lexical Analysis · 1 mark · Multiple choice

Which machine model is necessary and sufficient for lexical analysis of a modern language such as Java?

  1. Finite-state automata
  2. Deterministic PDA
  3. Nondeterministic PDA
  4. Turing machine

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) Finite-state automata

Explanation

The token patterns recognized in conventional lexical analysis are regular and can be described by regular expressions. Finite automata are sufficient and supply the least listed model with the required recognition power. Parsing nested grammatical structure is a later phase. Thus A.

More Lexical Analysis questions

All Lexical Analysis questions →