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?

  1. A.

    Only I

  2. B.

    Only II

  3. C.

    Both I and II

  4. D.

    Neither I nor II

Attempted by 108 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