edited by
13,689 views
37 votes
37 votes

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?

  1. Finite state automata
  2. Deterministic pushdown automata
  3. Non-deterministic pushdown automata
  4. Turing machine
edited by

2 Answers

Best answer
57 votes
57 votes

Answer - A

In compiler lexical analyzer categorizes character sequence into lexemes and produces tokens as output for parser. And tokens are expressed in regular expressions so a simple Finite Automata is sufficient for it.

edited by
4 votes
4 votes
During Lexical analysis,the tokens are recognized by FA.So a FA is necessary and sufficient
Answer:

Related questions

44 votes
44 votes
3 answers
1
go_editor asked Sep 29, 2014
17,152 views
In a compiler, keywords of a language are recognized duringparsing of the programthe code generationthe lexical analysis of the programdataflow analysis
14 votes
14 votes
2 answers
3
go_editor asked Sep 29, 2014
4,763 views
Choose the most appropriate word(s) from the options given below to complete the following sentence.I contemplated _________ Singapore for my vacation but decided against...
36 votes
36 votes
6 answers
4
go_editor asked Sep 29, 2014
10,713 views
A deterministic finite automaton ($\text{DFA}$) $D$ with alphabet $\Sigma = \{a, b\}$ is given below.Which of the following finite state machines is a valid minimal $\tex...