Multiple choice

In compilers, the syntax analysis is done by

  1. lexical analyzer.

  2. scanner.

  3. parser.

  4. code generator.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Syntax analysis, or parsing, is the stage where the compiler checks if the sequence of tokens conforms to the grammar of the programming language. This task is performed by the parser.