pub struct LLParser<'a> { /* private fields */ }Expand description
LL(1) parser object. The new(…) method creates a new instance.
Implementations§
Source§impl<'a> LLParser<'a>
impl<'a> LLParser<'a>
Sourcepub const MAX_NBR_PARSER_ERRORS: u32 = 5
pub const MAX_NBR_PARSER_ERRORS: u32 = 5
Maximum number of error recoveries attempted when meeting a syntax error
pub const MAX_NBR_LEXER_ERRORS: u32 = 3
pub fn new( num_nt: usize, num_t: usize, alt_var: &'a [u16], alts: Vec<Alternative>, opcodes: Vec<Vec<OpCode>>, init_opcodes: Vec<OpCode>, table: &'a [u16], symbol_table: FixedSymTable, start: u16, ) -> LLParser<'a>
Sourcepub fn get_symbol_table(&self) -> Option<&FixedSymTable>
pub fn get_symbol_table(&self) -> Option<&FixedSymTable>
Gets a reference to the symbol table, if one is attached.
Sourcepub fn set_start(&mut self, start: u16)
pub fn set_start(&mut self, start: u16)
Sets the top nonterminal. The parser ends the parsing once the corresponding rule has been entirely parsed.
Sourcepub fn set_try_recover(&mut self, try_recover: bool)
pub fn set_try_recover(&mut self, try_recover: bool)
Enables or disables the recovery from syntactic or lexical errors.
See also ParserError::TooManyErrors and ParserError::SyntaxError.
Sourcepub fn parse_stream<I, L>(
&mut self,
wrapper: &mut L,
stream: I,
) -> Result<(), ParserError>
pub fn parse_stream<I, L>( &mut self, wrapper: &mut L, stream: I, ) -> Result<(), ParserError>
Parses the entire stream, calling the (listener) wrapper with the
actions that correspond to the parser events.
Returns Ok(()) if the whole stream could be successfully parsed, or an
error if it couldn’t.
All errors are reported in the wrapper’s log. Usually, the wrapper simply transmits the reports to the user listener’s log (done in the generated code).
Auto Trait Implementations§
impl<'a> Freeze for LLParser<'a>
impl<'a> RefUnwindSafe for LLParser<'a>
impl<'a> Send for LLParser<'a>
impl<'a> Sync for LLParser<'a>
impl<'a> Unpin for LLParser<'a>
impl<'a> UnsafeUnpin for LLParser<'a>
impl<'a> UnwindSafe for LLParser<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<S> BuildFrom<S> for S
impl<S> BuildFrom<S> for S
Source§fn build_from(source: S) -> S
fn build_from(source: S) -> S
Source§impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
Source§fn build_into(self) -> T
fn build_into(self) -> T
Calls T::from(self) to convert a S into a T.