parse_ebnf

Function parse_ebnf 

Source
pub fn parse_ebnf(
    ebnf_string: &str,
    root_rule_name: &str,
) -> Result<GrammarData, ParseError>
Expand description

Parse a BNF/EBNF grammar string into a GrammarData.

root_rule_name names the start rule (xgrammar’s default is "root"). Returns a ParseError on malformed input rather than panicking.