55 55 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? Finite state automata Deterministic pushdown automata Non-deterministic pushdown automata Turing machine Compiler Design gatecse-2011 compiler-design lexical-analysis easy + – go_editor 20.6k views answer comment Share Follow Print See 1 comment 1 1 comment reply Gajanan Purud commented Sep 15, 2023 reply Follow flag A 0 0 replyShare Please log in or register to add a comment.
Best answer 81 81 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. ankitrokdeonsns answered Nov 23, 2014 • edited Dec 4, 2017 by kenzou ankitrokdeonsns comment Share Follow See all 10 Comments 10 10 Comments reply smartmeet commented Feb 4, 2017 reply Follow flag So where Turing Machine and PDAs are used? 1 1 replyShare Angkit commented Apr 24, 2017 reply Follow flag FA itself is fulfilling everything, so we need not got to TM and PDA at this level. 0 0 replyShare rishu_darkshadow commented Dec 5, 2017 reply Follow flag PDA is use during syntax analysis... 16 16 replyShare talha hashim commented Jul 13, 2018 reply Follow flag Lexical analysis=> DFA Syntax analysis=> PDA Semantic analysis=> Turing machine 32 32 replyShare rajinder singh commented Jul 14, 2018 reply Follow flag Why we need turning machine in semantic analysis? 0 0 replyShare akash.dinkar12 commented Jul 27, 2018 reply Follow flag talha hashim Can u explain how TM used in semantic analysis?? 0 0 replyShare Ashish Goyal commented Oct 2, 2018 reply Follow flag @akash.dinkar12 @rajinder singh we use context sensitive language in semantics analysis phase. So, we need a linear bounded turing machine to implement that. 2 2 replyShare Ayush Upadhyaya commented Jan 8, 2019 reply Follow flag Tokens are recognized using a fixed set of rules called regular expressions.For each regulat expression, we can have a DFA.Hence FA is necessary and both sufficient. PDA and TM would be more than necessary. Power of PDA is needed in the syntax analysis phase. 3 3 replyShare rohith1001 commented Sep 26, 2019 reply Follow flag @talha hashim Lexical analysis=> DFA Syntax analysis=> PDA Semantic analysis=> Turing machine For semantic analysis LBA (which accepts CSL) would suffice. Semantic analysis checks for more meaningful things such as if a variable is declared before it's use, type checking etc. Turing machines are confined to only Theory. Correct me if I'm wrong. 2 2 replyShare Pvkarma commented Sep 18, 2020 reply Follow flag for lexical analysis we use finite automata 0 0 replyShare Please log in or register to add a comment.
5 5 votes During Lexical analysis,the tokens are recognized by FA.So a FA is necessary and sufficient vnc answered Nov 28, 2015 vnc comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes IN lexical phase we use dfa soo dfa = finite automata zgod answered Apr 4, 2025 zgod comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes https://testbook.com/question-answer/the-lexical-analysis-for-a-modern-computer-languag--60b604ae9105dcecbf97cefd Kundan_Kumar answered Feb 6 Kundan_Kumar comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Answer - A We use DFA for doing Lexical Analysis Complete_Analyzer answered Mar 31 Complete_Analyzer comment Share Follow 0 reply Please log in or register to add a comment.