public static Cfg<String> parse(final String grammar) {
		final var tokenizer = new BnfTokenizer(grammar);
		final var parser = new BnfParser(tokenizer);

		return parser.parse();
	}
Parses the given BNF {@code grammar} string to a {@link Cfg} object. The
following example shows the grammar of a simple arithmetic expression.

<pre>{@code
<expr> ::= <num> | <var> | '(' <expr> <op> <expr> ')'
<op>   ::= + | - | * | /
<var>  ::= x | y
<num>  ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
}</pre>

@param grammar the BNF {@code grammar} string
@return the parsed {@code BNF} object
@throws ParsingException if the given <em>grammar</em> is invalid
@throws NullPointerException it the given {@code grammar} string is
        {@code null}
jenetics.ext/src/main/java/io/jenetics/ext/grammar/Bnf.java