A Lexer, also known as a scanner, is the initial phase of a compiler, transforming a stream of input characters into a sequence of meaningful tokens. It identifies fundamental lexical units like keywords, identifiers, and operators, preparing the source code for the next stage of analysis.
See also