public static String format(final Cfg<?> grammar) {
		return grammar.rules().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