BNF playground
Loading tasks...
Toggle: Shift+T
Examples
Open the top-right menu and expand Examples to load a starter grammar.
Grammar Workspace
Type rules in BNF. Empty string markers entered as "" are converted to ε automatically. You can also span a rule across multiple lines by indenting continuation lines that begin with |.
Rule snippets
Use Shift + right-click in the Grammar Workspace to open the insert menu, then choose Insert digits set, Insert lowercase set, or Insert uppercase set.
Testing
Choose a rule with SELECT TEST RULE, then use ENTER STRING TO TEST to check if the string is accepted, and optionally display the parse tree.
Status
The Status badge shows whether there are grammar issues (red outline) or no issues (white outline).
Syntax Diagram
Use SELECT RULE to switch the displayed diagram between grammar rules.
Clear Workspace
Use the red dustbin button in Grammar Workspace to clear grammar and test input.