A bottom-up parser builds the parse tree from the leaves up to the root. It starts from the input string and repeatedly replaces a substring that matches the body of a production by the production's head, a step called a reduction, until only the start symbol remains.
10 min readQuick revision
An LR parser is a shift-reduce parser that decides each action from a table indexed by a state on top of its stack and the next input token. The states are the states of a DFA that recognises viable prefixes, so the parser always knows which productions it might be in the middle of.
10 min readQuick revision
SLR places a reduction A → α on every token in FOLLOW(A). FOLLOW is a global set: it collects every token that can follow A anywhere in the grammar, even when, in the particular state the parser is in, only a few of those tokens can actually come next.
10 min readQuick revision