Beginner Compilers & Programming Language Theory
Q2 / 100

What is lexical analysis?

Correct! Well done.

Incorrect.

The correct answer is B) The first compiler phase scanning source text and grouping characters into meaningful tokens (identifiers, keywords, literals)

B

Correct Answer

The first compiler phase scanning source text and grouping characters into meaningful tokens (identifiers, keywords, literals)

Explanation

The lexer (scanner) uses regular expressions/DFAs to recognize tokens: IF, id("count"), INT_LIT(42), PLUS(+). Whitespace and comments are discarded. Produces a token stream for the parser.

Progress
2/100