Construct LALR(1) parsing tables from any context-free grammar and trace the parse step by step
An implementation of LALR(1) parsing built from scratch in Java. Given any context-free grammar, the system constructs the full canonical LR(1) item sets, merges same-core states into an LALR table, detects conflicts, and parses input strings with a detailed step-by-step trace.
The core algorithms were originally built as a compilers course project, then wrapped in a Spring Boot REST API and this interactive web frontend where you can input any grammar, parse any string, and see the parsing tables and trace in real time.
Enter a start symbol and production rules for your context-free grammar. Use -> for the arrow (dash followed by >).
The system computes FIRST sets and constructs the full canonical LR(1) item collection.
States with the same core are merged, producing a compact LALR parsing table.
Your input is parsed step by step showing the stack, remaining input, and each action taken.
| # | Stack | Input | Action |
|---|