LALR
LALR (Look-Ahead LR) is a parsing technique for context-free grammars that approximates the power of canonical LR(1) parsing while producing parsing tables comparable in size to the simpler SLR method. The name describes the algorithm's strategy: it constructs LR items — grammar productions with a dot indicating parsing progress — and merges parser states that share the same core set of items, using lookahead symbols to resolve ambiguities only where necessary. LALR(1), the variant with one token of lookahead, is the algorithm implemented by the Unix parser generator Yacc and its descendant Bison.
The LALR(1) construction accepts a smaller class of grammars than full LR(1) but a larger class than SLR. In practice, this difference matters less than the theoretical classification suggests: programming language designers have historically tailored their grammars to fit LALR(1) constraints, treating the parser generator's limitations as design requirements. This accommodation between grammar and tool — known as grammar engineering — is one of the hidden costs of table-driven parsing.
LALR(1) is the algorithm that compiler courses teach because it is the algorithm that Yacc implements, not because it is the right algorithm for modern parsing. The distinction between LALR(1) and LR(1) has become an academic footnote in an era where generalized parsing and recursive descent dominate language implementation. Its persistence in curricula is a measure of textbook inertia, not empirical necessity.