LR(1) Workbench — Lookahead-Carrying Item Sets
Build canonical LR(1) item sets, propagate lookaheads through CLOSURE, construct the LR(1) DFA and parsing table, and parse an input one action at a time.
Edit or enter a grammar
ASCII syntax: use ->, |, and epsilon. Separate symbols with spaces. A symbol appearing on a left-hand side is a nonterminal; every other symbol is a terminal.
Canonical collection
LR(1) item sets
Transitions preserve item lookaheads
DFA recognizing viable prefixes
Items with the same LR(0) core are grouped on one line. Their blue set records the lookaheads carried by those LR(1) items. States with identical cores but different lookaheads remain distinct.
Used by LR(1) CLOSURE
FIRST(βa) supplies propagated lookaheadsFIRST
Item-local reduction lookaheads
LR(1) parsing table
Separate tokens with spaces;
$ is appended automatically.
← → step
Unread token highlighted
Input
Top at the right
Grammar symbols and DFA states
Orange cell is consulted now
Current ACTION/GOTO lookup
Built by reductions