Skip to main content

import_abnf

Function import_abnf 

Source
pub fn import_abnf(text: &str) -> Result<Grammar, GrammarImportError>
Expand description

Parses Augmented Backus-Naur Form text into the grammar IR.

Rule names are case-insensitive: =/ extends the rule of the same name, references take the defining rule’s spelling, and RFC 5234 core rules such as ALPHA and DIGIT are appended when referenced but not defined.

§Errors

Returns GrammarImportError when the ABNF text cannot be parsed, when a parsed construct cannot be represented, or when a non-terminal reference does not resolve to an imported or RFC 5234 core rule.