Question

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?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2011 answer key

Solution

Identify the language class of lexical tokens and the minimal automata model required to scan them.

  1. Tokens in programming languages like Java (keywords, identifiers, numeric literals, punctuation symbols) are described by regular expressions.
  1. Regular languages are accepted by finite state automata (DFA/NFA) and do not require auxiliary stack memory or tape storage.
  1. Thus, a finite state automaton is both necessary (regular expressions cannot be recognized by anything simpler) and sufficient to perform lexical analysis.
Final answer

A

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2011 Computer Science and Information Technology (CS)
Question
19 of 65, printed as CS Q.19
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.