What is the primary task of a lexical analyzer in a compiler ?

PYQ TPSC Computer/IT Posts 2024

What is the primary task of a lexical analyzer in a compiler ?

  1. A.

    Identifies tokens based on keywords and identifiers

  2. B.

    Checks the semantic meaning of expressions

  3. C.

    Generates optimized machine code

  4. D.

    Builds the abstract syntax tree of the program

Attempted by 731 students.

Sign up free to check your answer

Sign up free

Explore the full course: Tpsc Assistant Technical Officer

Loading lesson…