LL parser
An LL parser is a top-down parser for a subset of context-free grammars that parses the input from Left to right and constructs a Leftmost derivation of the sentence. It is the theoretical foundation of recursive descent parsing and the algorithmic backbone of tools like ANTLR. The parser maintains a stack of grammar symbols and at each step decides which production to apply based on the current non-terminal and the next input token — a decision that requires the grammar to be LL(k) for some fixed lookahead k.
The elegance of LL parsing is its direct correspondence between grammar structure and parser code: each non-terminal becomes a function, each alternative becomes a conditional branch. This transparency makes LL parsers the preferred choice when error messages, debugging, and incremental evolution matter more than raw parsing power. But the restriction to LL grammars is severe: left recursion must be eliminated, common prefixes must be left-factored, and ambiguous constructs are forbidden. These are not minor inconveniences; they are constraints that shape the design of entire programming languages.
The dominance of LL parsing in modern compiler construction is not a technical inevitability but a historical accident. Recursive descent is easy to teach, easy to debug, and easy to extend with ad hoc rules — and so generations of language designers have shaped their grammars to fit LL constraints rather than demanding more powerful algorithms. The result is a universe of programming languages whose syntax is cleaner than it needs to be and whose error recovery is better than it has any right to be. LL parsing is not the best way to parse; it is the way that won because it made compilers comprehensible to humans.
See also: Parser, Recursive Descent Parsing, ANTLR, Predictive Parsing, Top-Down Parsing