pub struct TermParser<I>where
I: FusedIterator<Item = u8>,{ /* private fields */ }Implementations§
Source§impl<I> TermParser<I>where
I: FusedIterator<Item = u8>,
impl<I> TermParser<I>where
I: FusedIterator<Item = u8>,
pub fn try_new(input: I, opers: Option<OperDefs>) -> Result<Self>
pub fn try_collect_terms(&mut self, arena: &mut Arena) -> Result<Vec<Term>>
pub fn try_next_term(&mut self, arena: &mut Arena) -> Result<Option<Term>>
pub fn define_opers<J: FusedIterator<Item = u8>>( &mut self, arena: &mut Arena, defs_input: J, opers: Option<OperDefs>, ) -> Result<()>
Trait Implementations§
Source§impl<I> Parser<Arena> for TermParser<I>where
I: FusedIterator<Item = u8>,
impl<I> Parser<Arena> for TermParser<I>where
I: FusedIterator<Item = u8>,
type Lexer = TermLexer<I>
type ParserData = ParData
fn ctx(&self) -> &ParserCtx<Self::Lexer, Self::ParserData, Arena>
fn ctx_mut(&mut self) -> &mut ParserCtx<Self::Lexer, Self::ParserData, Arena>
fn stats(&self) -> ParserStats
fn resolve_ambiguity( &mut self, _arena: &mut Arena, ambig: AmbigID, tok2: &TermToken, ) -> Result<Action>
fn reduce( &mut self, arena: &mut Arena, prod: ProdID, token: &TermToken, ) -> Result<()>
Source§fn tokens_peek<'a>(
&'a self,
index: usize,
) -> &'a <Self::Lexer as Lexer<U>>::Tokenwhere
U: 'a,
fn tokens_peek<'a>(
&'a self,
index: usize,
) -> &'a <Self::Lexer as Lexer<U>>::Tokenwhere
U: 'a,
Returns a reference to the token counted from the end:
0 = last, 1 = second last, etc.
Panics if
Panics if
index ≥ number of tokens.Source§fn tokens_mut_peek<'a>(
&'a mut self,
index: usize,
) -> &'a mut <Self::Lexer as Lexer<U>>::Tokenwhere
U: 'a,
fn tokens_mut_peek<'a>(
&'a mut self,
index: usize,
) -> &'a mut <Self::Lexer as Lexer<U>>::Tokenwhere
U: 'a,
Returns a mutable reference to the token counted from the end:
0 = last, 1 = second last, etc.
Panics if
Panics if
index ≥ number of tokens.fn tokens_pop(&mut self) -> Result<<Self::Lexer as Lexer<U>>::Token, Error>
fn tokens_push(&mut self, token: <Self::Lexer as Lexer<U>>::Token)
fn dump_state(&self, incoming: &<Self::Lexer as Lexer<U>>::Token)
fn try_collect( &mut self, user_data: &mut U, ) -> Result<Vec<<Self::Lexer as Lexer<U>>::Token>, Error>
fn try_next( &mut self, user_data: &mut U, ) -> Result<Option<<Self::Lexer as Lexer<U>>::Token>, Error>
Auto Trait Implementations§
impl<I> Freeze for TermParser<I>where
I: Freeze,
impl<I> RefUnwindSafe for TermParser<I>where
I: RefUnwindSafe,
impl<I> Send for TermParser<I>where
I: Send,
impl<I> Sync for TermParser<I>where
I: Sync,
impl<I> Unpin for TermParser<I>where
I: Unpin,
impl<I> UnwindSafe for TermParser<I>where
I: UnwindSafe,
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