Lexical analysis

/ˈlɛksɪkəl əˈnæləsɪs/ noun

Definition

The first phase of compilation that breaks source code into meaningful units called tokens (keywords, identifiers, operators, literals). It's like breaking a sentence into individual words and punctuation marks.

Etymology

'Lexical' from Greek 'lexikos' meaning 'of words,' from 'lexis' (word, speech). 'Analysis' from Greek 'analysis' meaning 'a breaking up.' The term emerged in the 1960s with formal compiler theory, describing the process of breaking code into word-like units.

Kelly Says

Lexical analysis is like how your brain automatically breaks this sentence into individual words when you read - you don't see a stream of letters, but distinct meaningful units. A lexical analyzer does the same thing with code, turning 'int x=42;' into separate tokens: 'int', 'x', '=', '42', ';'

Related Words

Explore More Words

Get the Word Orb API

Complete word intelligence in one call. Free tier — 50 lookups/day.