Struct ParserRecognizer
pub struct ParserRecognizer<'a> { /* private fields */ }
Implementations§
§impl<'a> ParserRecognizer<'a>
impl<'a> ParserRecognizer<'a>
pub fn lexer(&mut self) -> &mut Lexer
pub fn lexer_state(&self) -> StateID
Trait Implementations§
§impl<'a> Recognizer for ParserRecognizer<'a>
impl<'a> Recognizer for ParserRecognizer<'a>
§fn collapse(&mut self)
fn collapse(&mut self)
“Collapse” the stack so that it consists only of its former
top element.
X = stack.top(); stack.empty(); stack.push(X)
§fn special_allowed(&mut self, _tok: SpecialToken) -> bool
fn special_allowed(&mut self, _tok: SpecialToken) -> bool
check if stack.top() transitions via tok to a viable state
§fn trie_started(&mut self)
fn trie_started(&mut self)
Called when iteration over the trie is started
§fn trie_finished(&mut self)
fn trie_finished(&mut self)
Called when iteration over the trie is finished
Stack has exactly one element then, except when iteration started from non-root node.
In that case, the stack may have more than one element, and trie_finished() needs to pop the excessive elements.
§fn try_push_byte(&mut self, byte: u8) -> bool
fn try_push_byte(&mut self, byte: u8) -> bool
This combines
push_byte
and byte_allowed
into one function for performance.§fn byte_allowed(&mut self, byte: u8) -> bool
fn byte_allowed(&mut self, byte: u8) -> bool
check if stack.top() transitions via byte to a viable state
Auto Trait Implementations§
impl<'a> Freeze for ParserRecognizer<'a>
impl<'a> RefUnwindSafe for ParserRecognizer<'a>
impl<'a> Send for ParserRecognizer<'a>
impl<'a> Sync for ParserRecognizer<'a>
impl<'a> Unpin for ParserRecognizer<'a>
impl<'a> !UnwindSafe for ParserRecognizer<'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
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more