The lexical analysis phase is the first stage in the compilation process. Its primary purpose is to convert the raw source code written by the programmer into a sequence of tokens that the compiler can easily process. In natural language processing, lexical tokens can include categories such as verbs, nouns, and adjectives, among others.