Consider the following statements related to compiler construction: I. Lexical…
2017
Consider the following statements related to compiler construction:
I. Lexical Analysis is specified by context-free grammars and implemented by pushdown automata.
II. Syntax Analysis is specified by regular expressions and implemented by finite-state machine.
Which of the above statement(s) is/are correct?
Answer: D. Neither I nor II — Statement I is incorrect because lexical analysis uses regular expressions and finite automata, not context-free grammars. Statement II is incorrect because…
- A.
Only I
- B.
Only II
- C.
Both I and II
- D.
Neither I nor II
Attempted by 314 students.
Show answer & explanation
Correct answer: D
Statement I is incorrect because lexical analysis uses regular expressions and finite automata, not context-free grammars. Statement II is incorrect because syntax analysis requires context-free grammars and pushdown automata, not regular expressions. Therefore, neither statement is correct.
A video solution is available for this question — log in and enroll to watch it.
Explore the full course: Mppsc Assistant Professor Computer Science Paper 2