LR Parsing Workbench

CS 432 — LR(0) Item Sets and Automaton · SLR(1) ACTION / GOTO Tables · Shift-Reduce Trace
Generated with the assistance of Claude Code (Opus 5.5)
One rule per line, symbols separated by spaces: S -> a S b | a b. A symbol is a non-terminal iff it appears on some left-hand side; the first rule's left-hand side is the start symbol. Empty right-hand side (or eps / ε) is ε. Grammophone files paste in directly.
item sets: — conflicts: — grammar class: — A → α • βkernel item B → • γnon-kernel (closure) item new this step conflict table cell used by the trace

LR(0) Item Sets — Closure and Goto

Start from “• S”, take the closure, then form new sets by moving the dot

Load a grammar to begin
—

LR(0) Automaton

Each item set is a state; “moving the dot” over a symbol is a transition (and a stack push)

Load a grammar to begin

SLR(1) ACTION / GOTO Tables

Shift on A → β • c γ · reduce A → β • on FOLLOW(A) · goto on A → β • B γ · accept on S •

Load a grammar to begin
—

Parse Trace

Push state 0; look up ACTION(top, next input) until accept or error; on reduce, pop |β| states and push GOTO

Enter an input string and click Trace
Parse tree (built bottom-up)
—