Function get_grammar
Source pub fn get_grammar(input: &str) -> Result<Grammar, Err<VerboseError<&str>>>
Expand description
Get and parse EBNF grammar source into Grammar, returns Err when given grammar is invalid.
ยงExample
use kbnf_syntax::get_grammar;
let grammar_literal = r"
term ::= '1';
";
let grammar = get_grammar(grammar_literal)?;