Quick Guide

1
Select a CFG using "Change Grammar"
2
Click red nodes to select them
3
Choose production rules to expand
4
Build tree until string matches target
Controls:

Grammar for balanced parentheses

()()

Production Rules:

Parse Tree

Click red nodes to select, then use production rule buttons above to expand. Target: ()()

Derivation Steps

  • S [Start Symbol]
  • SS [S → SS]
  • (S)S [S → (S)]
  • ()S [S → ε]
  • ()(S) [S → (S)]
  • ()() [S → ε]