Struct EarleyParseJob
pub struct EarleyParseJob<'i, 's> {
pub table: &'s Arc<ParseTable>,
pub lexer: EarleyLexerSource<'i>,
pub text: &'i str,
pub start: &'s str,
pub options: ParseOptions,
pub postlex: Option<&'s dyn Postlex>,
}Expand description
The invariant inputs to an Earley parse — the peer to the LALR engine’s
crate::lalr::ParseJob, keeping the two entry surfaces parallel (this
engine’s parse_with deliberately mirrors LALR’s). Bundles what to parse and
how to lex it; the strategy (transform) stays a separate argument.
Two lifetimes, matching the LALR peer: 'i (input — lexer + text) and
's (setup — table / start / postlex). Earley has no interactive
mode, so no borrow escapes the call; the split is still needed because
EarleyLexerSource is invariant (its Custom/dynamic arms) and so cannot
share a lifetime with a short-lived resolved start (the facade’s
resolve_start local) — exactly the LALR situation.
Not Copy (unlike the LALR peer): EarleyLexerSource is not Copy. No
loss — on both engines a job is consumed by exactly one entry (even the LALR
tree vs. no-tree parity A/B deliberately builds two jobs; see the LALR
crate::lalr::ParseJob doc), so a by-value bundle consumed once suffices.
Fields§
§table: &'s Arc<ParseTable>The compiled parse table (Arc::cloned into the recognizer tables).
lexer: EarleyLexerSource<'i>Which lexer drives the parse (EarleyLexerSource: basic / custom / dynamic).
text: &'i strThe input to parse.
start: &'s strThe start rule name.
options: ParseOptionsPer-parse options (ParseOptions, incl. Earley’s ambiguity).
postlex: Option<&'s dyn Postlex>Optional streaming postlex (indenter) interposed between lexer and parser.