Struct hime_redist::result::ParseResult
source · pub struct ParseResult { /* private fields */ }
Expand description
Represents the output of a parser
Implementations§
source§impl<'a> ParseResult
impl<'a> ParseResult
sourcepub fn new(
terminals: &'static [Symbol],
variables: &'static [Symbol],
virtuals: &'static [Symbol],
text: Text
) -> ParseResult
pub fn new(
terminals: &'static [Symbol],
variables: &'static [Symbol],
virtuals: &'static [Symbol],
text: Text
) -> ParseResult
Initialize a new parse result
sourcepub fn get_terminals(&self) -> &'static [Symbol]
pub fn get_terminals(&self) -> &'static [Symbol]
Gets the grammar terminals
sourcepub fn get_variables(&self) -> &'static [Symbol]
pub fn get_variables(&self) -> &'static [Symbol]
Gets the grammar variables
sourcepub fn get_virtuals(&self) -> &'static [Symbol]
pub fn get_virtuals(&self) -> &'static [Symbol]
Gets the grammar virtuals
sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Gets whether this result denotes a successful parsing
sourcepub fn get_errors(&self) -> &ParseErrors
pub fn get_errors(&self) -> &ParseErrors
Gets the collection of errors
sourcepub fn get_tokens(&self) -> TokenRepository<'_>
pub fn get_tokens(&self) -> TokenRepository<'_>
Gets the token repository associated with this result
sourcepub fn get_parsing_data(
&mut self
) -> (TokenRepository<'_>, &mut ParseErrors, Ast<'_>)
pub fn get_parsing_data(
&mut self
) -> (TokenRepository<'_>, &mut ParseErrors, Ast<'_>)
Gets the mutable data required for parsing