pub struct NoSemanticHooks;Expand description
Default hook object used by parsers that do not need user-supplied semantics.
Trait Implementations§
Source§impl Clone for NoSemanticHooks
impl Clone for NoSemanticHooks
Source§fn clone(&self) -> NoSemanticHooks
fn clone(&self) -> NoSemanticHooks
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NoSemanticHooks
Source§impl Debug for NoSemanticHooks
impl Debug for NoSemanticHooks
Source§impl Default for NoSemanticHooks
impl Default for NoSemanticHooks
Source§fn default() -> NoSemanticHooks
fn default() -> NoSemanticHooks
Returns the “default value” for a type. Read more
Source§impl SemanticHooks for NoSemanticHooks
impl SemanticHooks for NoSemanticHooks
Source§const ENABLES_LEXER_LIFECYCLE: bool = false
const ENABLES_LEXER_LIFECYCLE: bool = false
Whether generated lexers should route lifecycle callbacks through this
hook object. Read more
Source§fn observes_parser_predicates(&self) -> bool
fn observes_parser_predicates(&self) -> bool
Whether this hook object may observe parser predicate transitions. Read more
fn sempred<S>(
&mut self,
ctx: &mut ParserSemCtx<'_, S>,
rule_index: usize,
pred_index: usize,
) -> Option<bool>where
S: TokenSource,
fn action<S>(
&mut self,
ctx: &mut ParserSemCtx<'_, S>,
action: ParserAction,
) -> boolwhere
S: TokenSource,
fn lexer_sempred<I>(
&mut self,
ctx: &mut LexerSemCtx<'_, I>,
rule_index: usize,
pred_index: usize,
) -> Option<bool>where
I: CharStream,
Source§fn lexer_action<I>(
&mut self,
ctx: &mut LexerSemCtx<'_, I>,
action: LexerCustomAction,
) -> boolwhere
I: CharStream,
fn lexer_action<I>(
&mut self,
ctx: &mut LexerSemCtx<'_, I>,
action: LexerCustomAction,
) -> boolwhere
I: CharStream,
Runs a lexer custom action on the committed lexing path. Returns whether
the hook handled the action. Read more
Source§fn lexer_reset<I>(&mut self, ctx: &mut LexerLifecycleCtx<'_, I>)where
I: CharStream,
fn lexer_reset<I>(&mut self, ctx: &mut LexerLifecycleCtx<'_, I>)where
I: CharStream,
Runs after runtime-owned lexer state has been reset for reuse. Read more
Source§fn lexer_before_token<I>(&mut self, ctx: &mut LexerLifecycleCtx<'_, I>)where
I: CharStream,
fn lexer_before_token<I>(&mut self, ctx: &mut LexerLifecycleCtx<'_, I>)where
I: CharStream,
Runs before the runtime returns a queued token or starts a new ATN
token match. Read more
Source§fn lexer_after_accept<I>(&mut self, ctx: &mut LexerLifecycleCtx<'_, I>)where
I: CharStream,
fn lexer_after_accept<I>(&mut self, ctx: &mut LexerLifecycleCtx<'_, I>)where
I: CharStream,
Runs after the accepted path’s portable and custom actions, but before
the token span is finalized and emitted. Read more
Source§fn lexer_token_emitted(&mut self, token: TokenView<'_>)
fn lexer_token_emitted(&mut self, token: TokenView<'_>)
Observes a token after committed lexer actions and portable commands
have run and the token has been emitted, immediately before it is
returned to the token stream. Read more
Auto Trait Implementations§
impl Freeze for NoSemanticHooks
impl RefUnwindSafe for NoSemanticHooks
impl Send for NoSemanticHooks
impl Sync for NoSemanticHooks
impl Unpin for NoSemanticHooks
impl UnsafeUnpin for NoSemanticHooks
impl UnwindSafe for NoSemanticHooks
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