A visual, step-by-step journey through Context-Free Grammar parsing from first principles. Understand the algorithms that power the languages you use every day.
Where does parsing fit into a compiler? Click through the stages below.
Raw text written by the programmer.
Grouping characters into meaningful tokens.
Parsing tokens into a tree structure based on grammar rules. (This Course)
Type checking and verifying meaning.
Improving the code for speed or size.
Translating to target machine code.
Parsing checks whether a sequence of tokens follows the grammatical rules of the language.
As the lexer feeds tokens to the parser, it builds structure.
The foundation of compiler design. Every major language needs a robust parser.
Writing your own language, script engine, or query evaluator starts with parsing text.
Config files, data formats, and specialized tools all rely on grammars and parsers.
Master parser construction step by step.
Top-down vs Bottom-up intuition.
Terminals, non-terminals, and rules.
Leftmost and rightmost expansions.
Hand-written top-down parsing.
Table-driven top-down with lookahead.
The foundation of bottom-up shift/reduce.
Simple LR fixing conflicts via FOLLOW sets.
Full LR(1) with exact lookaheads.
Merged states for practical parsers.
Trade-offs and evolution in one place.
Test your knowledge with step-by-step solutions.