private static String format(final Cfg.Rule<?> rule) {
		return String.format(
			"%s ::= %s",
			format(rule.start()),
			rule.alternatives().stream()
				.map(Bnf::format)
				.collect(Collectors.joining("\n    | "))
		);
	}
Formats the given <em>CFG</em> as BNF grammar string.

@param grammar the CFG to format as BNF
@return the BNF formatted grammar string
@throws NullPointerException if the give {@code grammar} is {@code null}
jenetics.ext/src/main/java/io/jenetics/ext/grammar/Bnf.java