pub fn parse(
g: &Grammar,
root_rule_name: &str,
tokens: &[Token],
guards: Rc<HashMap<String, Guard, FxBuildHasher>>,
hooks: Rc<HashMap<String, Hook, FxBuildHasher>>,
) -> Result<ASTNode, String>Expand description
Parse the given token stream (produced by bnf::tokenize) into an AST, using the given bnf::Grammar, and taking the given root rule name as the starting point.
Guards and hooks are for advanced usage (e.g. parsing C).
See also: ASTNode