ABNF grammar test bench
Run reusable pass/fail sample suites against an ABNF grammar, with failure offsets and successful rule spans.
What it does
Run reusable pass/fail sample suites against an ABNF grammar, with failure offsets and successful rule spans.
How to use it
- Paste ABNF, choose a start rule and supply a JSON array of input strings and expected match booleans.
- Run the suite, inspect diagnostics and export the results or a reloadable fixture bundle. Core rules and RFC 7405 strings are supported.
- Processing stays in a bounded local worker. No generated code, external grammar resolution or upload.
Example
The command grammar accepts "GET /docs/start\r\n" and rejects lowercase "get" because the method uses a case-sensitive %s literal.
Methodology
ABNF is compiled into a bounded context-free grammar and recognized with an Earley chart, supporting recursion, alternatives, repetition and nullable rules. Core rules follow RFC 5234; %s/%i follow RFC 7405. Diagnostics show farthest reachable code-point offset and expected terminals; a match includes one derivation, not every ambiguous parse.
Limitations
50,000 grammar characters, 500 definitions, nesting 30, explicit repeat bounds 256, 5,000 productions. Up to 50 samples / 2,048 code points each / 20,000 characters total; 100,000 states per sample, five million operations per batch and 30 seconds. Prose values need explicit replacement rules. Input is Unicode code points, not encoded bytes. LF/CRLF and indented definitions are accepted. No protocol conformance certification or remote grammar loading.
Automation
This tool runs in your browser. No upload API or MCP endpoint is available.
View capabilities and documentationReference updated
Join the conversation
Helpful tips, questions, and ideas for making this tool better.
Loading discussion…