Which of the following best describes the role of a lexical analyzer in a…

2025

Which of the following best describes the role of a lexical analyzer in a compiler design?

Answer: D. It partitions the source code into tokens and removes comments and white spaces.

  1. A.

    It converts high-level source code into assembly code.

  2. B.

    It checks semantic consistency in the program.

  3. C.

    It builds the symbol table during code generation.

  4. D.

    It partitions the source code into tokens and removes comments and white spaces.

Attempted by 156 students.

Show answer & explanation

Correct answer: D

Explore the full course: Niacl Ao It Specialist

Loading lesson…