Context-Free Grammar Simulator
Grammar is auto-converted to CNF before running.
The grammar as entered, before any transformation.
S appeared on the right-hand side of a rule, so a fresh start symbol _S0 → S was introduced to ensure S is never on a RHS.
Remove rules that derive the empty string. For each rule containing a nullable symbol, add a version with that symbol omitted.
Replace rules of the form A → B (single non-terminal) by copying all non-unit rules reachable from B into A.
Split rules with 3 or more symbols into cascading binary rules using fresh non-terminals.
In binary rules, replace each terminal with a fresh non-terminal that produces exactly that terminal.
Want a specific preset configuration added? Request it by email at contact@csvisualizer.com.