What is the primary function of a compiler's lexical analysis phase?
A
Design the user interface
B
Break source code into tokens
C
Manage memory
D
Execute machine code
Correct Answer: Option B — Break source code into tokens
Explanation:
Lexical analysis is the first phase of compilation, where the source code is scanned and broken down into meaningful tokens such as keywords...
Lexical analysis is the first phase of compilation, where the source code is scanned and broken down into meaningful tokens such as keywords, identifiers, and symbols.