Question: Which of the following best describes the relationship between a lexer and a parser?
Options:
Correct Answer: The lexer produces tokens, which the parser uses to build a syntax tree
Solution:
The lexer produces tokens that the parser uses to build a syntax tree, making them complementary components in the compilation process.