What is Lexical analysis?

The first compiler phase, which splits the characters of source code into tokens such as identifiers, numbers, operators and keywords. Whitespace and comments are removed here.

Field: Compilers

Lexical analysis in the explanations

Questions that mention Lexical analysis (4)

  1. What is the role of lexical analysis in a compiler?
  2. What is commonly used to express the rules for recognizing tokens in lexical analysis?
  3. What is done during syntax analysis (parsing) in a compiler?
  4. Which kind of grammar is used to describe most programming languages and underlies parsing?

Related terms

Syntax analysis (parsing) JIT compilation Abstract syntax tree Basic block Common subexpression elimination Constant folding Control-flow graph Function inlining Instruction scheduling Intermediate representation

Back to the glossary