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.