CSE331 · Theory of Computation

CFG Simulator

Write your own productions and expand the shortest leftmost derivation one step at a time.

S
0start⇒S

Start from S and try to reach "()" by always expanding the leftmost non-terminal.

step 1 of 4
leftmost non-terminal other non-terminal terminal
deriving…
Derivation length
0
Forms explored
0

Your productions

→
→
→

Capitals are non-terminals, everything else is a terminal. Leave a right-hand side blank for ε.

Target string

Shortest leftmost derivation, found by breadth-first search. ← → step.