https://github.com/ligurio/gromit
is a random text generator based on context-free grammars, it uses a EBNF for grammar definitions.
https://github.com/ligurio/gromit
ebnf fuzzing grammar testing
Last synced: 3 months ago
JSON representation
is a random text generator based on context-free grammars, it uses a EBNF for grammar definitions.
- Host: GitHub
- URL: https://github.com/ligurio/gromit
- Owner: ligurio
- License: mit
- Created: 2017-12-20T12:20:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-05-05T19:47:16.000Z (5 months ago)
- Last Synced: 2025-05-08T02:54:18.502Z (5 months ago)
- Topics: ebnf, fuzzing, grammar, testing
- Language: Go
- Homepage: https://asciinema.org/a/155319
- Size: 19.5 KB
- Stars: 17
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Gromit
[](https://github.com/ligurio/gromit/actions/workflows/test.yml) [](https://goreportcard.com/report/github.com/ligurio/gromit)
is a random text generator based on context-free grammars; it uses
an EBNF for grammar definitions. EBNF is an Extended Backus-Naur
Form. It is the standard format for the specification and
documentation of programming languages; it is defined in the
ISO/IEC 14977 standard.The input is text satisfying the following grammar (represented
itself in EBNF):```
Production = name "=" [ Expression ] "." .
Expression = Alternative { "|" Alternative } .
Alternative = Term { Term } .
Term = name | token [ "…" token ] | Group | Option | Repetition .
Group = "(" Expression ")" .
Option = "[" Expression "]" .
Repetition = "{" Expression "}" .
```## Usage
```
~$ go build -o gromit -v cmd/main.go
~$ ./gromit -filename ebnf/palindrome.ebnf -start palindrome
khbhk
```## See also
- [grammarinator](https://github.com/renatahodovan/grammarinator)
is an ANTLR v4 grammar-based test generator (Python).
- [bnfgen](https://baturin.org/tools/bnfgen/) is a random text
generator based on context-free grammars, it uses a DSL for
grammar definitions that is similar to the familiar BNF,
with two extensions: weighted random selection and deterministic
repetition (OCaml).