GATE CSE
First time here? Checkout the FAQ!
x
+6 votes
870 views

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?

(A) Finite state automata

(B) Deterministic pushdown automata

(C) Non-deterministic pushdown automata

(D) Turing machine

asked in Compiler Design by Veteran (79.1k points)  
edited | 870 views

2 Answers

+17 votes
Best answer
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.
answered by Boss (9.1k points)  
selected by
So where Turing Machine and PDAs are used?
FA itself is fulfilling everything, so we need not got to TM and PDA at this level.
+1 vote
During Lexical analysis,the tokens are recognized by FA.So a FA is necessary and sufficient
answered by Boss (6.1k points)  


Top Users Aug 2017
  1. ABKUNDAN

    4670 Points

  2. Bikram

    4556 Points

  3. akash.dinkar12

    3420 Points

  4. rahul sharma 5

    3124 Points

  5. manu00x

    2864 Points

  6. makhdoom ghaya

    2450 Points

  7. just_bhavana

    2136 Points

  8. Tesla!

    2042 Points

  9. stblue

    1930 Points

  10. joshi_nitish

    1686 Points


24,970 questions
32,072 answers
74,567 comments
30,150 users