Q3Compiler Design
Question
2 marks
Define Lexical Analysis.
Answer
Lexical analysis is the very first phase of a compiler that converts characters into tokens.
Lexical Analysis, mathematically known as scanning, is the first and most fundamental phase of compiler architecture. It aggressively reads the raw source code character by character from left to right, stripping out all whitespace and comments, and logically groups the remaining characters into a rigid sequence of meaningful units called tokens.