/go_rebnf

Generate random productions of arbitrary EBNF grammars.

Primary LanguageHTMLMIT LicenseMIT

rebnf is a tool to generate random productions of arbitrary EBNF grammars.

Documentation

Installation

go get chrispennello.com/go/rebnf/cmd/rebnf

Tools

The tools directory contains a Python tool for fetching Unicode character ranges from fileformat.info and consolidating them into EBNF alternative range expressions, suitable for consumption by rebnf.

Test Languages

The testlang directory contains grammars for testing and experimentation. In particular, testlang/go contains a snapshot of the Go Programming Language Specification and an extracted grammar, including one in which the Unicode productions have been defined.

Future Work

  • More reliable termination soon after recursion depth limit exceeded. More reliable terminal path analysis. Graph analysis of grammar productions.
  • Non-uniform production weighting.
  • Mode to prefer non-weird characters (e.g., put it in "ASCII mode").