pub struct Parser<'a> { /* private fields */ }Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcepub const MAX_NBR_RECOVERS: u32 = 5u32
pub const MAX_NBR_RECOVERS: u32 = 5u32
Maximum number of error recoveries attempted when meeting a syntax error
pub const MAX_NBR_LEXER_ERRORS: u32 = 3u32
pub fn new( num_nt: usize, num_t: usize, alt_var: &'a [u16], alts: Vec<Alternative>, opcodes: Vec<Vec<OpCode>>, table: &'a [u16], symbol_table: FixedSymTable, start: u16, ) -> Parser<'a>
pub fn get_symbol_table(&self) -> Option<&FixedSymTable>
pub fn set_start(&mut self, start: u16)
pub fn set_try_recover(&mut self, try_recover: bool)
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 an entire stream using the listener, and returns Ok(()) if the whole stream could
be successfully parsed, or an error if it couldn’t.
All errors are reported to the wrapper’s log. Usually, the wrapper simply transmits the reports to the user listener’s log, where the user listener is embedded in the wrapper as one of its fields and is defined by the user (instead of being generated like the wrapper).
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'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
Mutably borrows from an owned value. Read more
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
Converts to this type from the input type.
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].
Source§impl<S, T> TryBuildInto<T> for Swhere
T: TryBuildFrom<S>,
impl<S, T> TryBuildInto<T> for Swhere
T: TryBuildFrom<S>,
Source§type Error = <T as TryBuildFrom<S>>::Error
type Error = <T as TryBuildFrom<S>>::Error
The type returned in the event of a conversion error.
Source§fn try_build_into(self) -> Result<T, <T as TryBuildFrom<S>>::Error>
fn try_build_into(self) -> Result<T, <T as TryBuildFrom<S>>::Error>
Performs the conversion.