A fundamental unit of the lexicon of a language, i.e., the minimal lexical unit.

For a natural language, a lexeme is equivalent to a root word, that is, a base unit with no inflectional or derivational modification. For example, flood (the noun), flood (the verb), floods, flooded, and flooding are all forms of the lexeme flood.

For a programming language, lexemes are the keywords, literals, identifiers, operators, and punctuation. The lexical analysis phase of the compiler converts strings into a sequence of lexemes, which are then passed to the parser for syntactic analysis.

Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.