Augment a grammar, build its canonical collection of LR(0) item sets, draw the viable-prefix DFA, derive its ACTION and GOTO 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(0) item sets

Transitions on grammar symbols

DFA recognizing viable prefixes

Every state accepts a viable prefix. Node labels additionally show R for a completed production, A for the accepting parser configuration, and ! for a parsing-table conflict.