Skip to main content
lookahead

lookahead

8.2
Ability to see symbols after the current one to decide which rule applies
  • noun
  • /ˈlʊkəˌhɛd/
  • Specialized
translation icon : lookahead
  • Condition register lookahead logic based on the arithmetic operations, rotate zero-detect, and a sign bit can bypass into the conditional branch-taken logic.

Examples

  • In a programming language, the lookahead mechanism helps resolve ambiguities in nested statements.

  • The parser's lookahead allows it to identify syntax errors before reaching them in the code.

  • Using lookahead techniques, the compiler can optimize performance by predicting future input requirements.

Surface Forms

lookahead singular
lookaheads plural

Morphology

lookahead = look (transparent) = ahead + look

The computing sense maps directly to the literal idea of 'looking ahead' at upcoming input to decide parsing actions. [Postprocessing: moved 'ahead' from base_words to prefix]

Etymology

Lookahead comes from the words look and ahead, meaning 'look forward'. In parsing a lookahead means the program checks the symbols a little way ahead of the current place to decide which rule to use, so the name shows it is checking 'ahead' to choose.