pub fn parse(input: &str) -> Result<Grammar, ParseError<usize, Token<'_>, &str>>
Expand description
Parse the given string as LBNF grammar.
Returns Grammar
if the provided grammar is valid.
Will return Err
if the provided grammar fails to parse.
use lbnf::parse;
let grammar = r#"
EAdd. Exp ::= Exp "+" Exp ;
EInt. Exp ::= Integer ;
"#;
assert!(parse(grammar).is_ok());