GATE CSE
First time here? Checkout the FAQ!
x
+5 votes
619 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 (76k points)  
edited | 619 views

2 Answers

+14 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.2k points)  
selected by
So where Turing Machine and PDAs are used?
+1 vote
During Lexical analysis,the tokens are recognized by FA.So a FA is necessary and sufficient
answered by Boss (6k points)  


Top Users Mar 2017
  1. rude

    4018 Points

  2. sh!va

    2994 Points

  3. Rahul Jain25

    2804 Points

  4. Kapil

    2606 Points

  5. Debashish Deka

    2092 Points

  6. 2018

    1414 Points

  7. Vignesh Sekar

    1318 Points

  8. Bikram

    1218 Points

  9. Akriti sood

    1166 Points

  10. Sanjay Sharma

    1004 Points

Monthly Topper: Rs. 500 gift card

21,439 questions
26,753 answers
60,919 comments
22,929 users