Trait antlr_rust::parser::Parser
source · [−]pub trait Parser<'input>: Recognizer<'input> {
Show 18 methods
fn get_interpreter(&self) -> &ParserATNSimulator;
fn get_token_factory(&self) -> &'input Self::TF;
fn get_parser_rule_context(
&self
) -> &Rc<<Self::Node as ParserNodeType<'input>>::Type>;
fn consume(&mut self, err_handler: &mut impl ErrorStrategy<'input, Self>)
where
Self: Sized;
fn precpred(
&self,
localctx: Option<&<Self::Node as ParserNodeType<'input>>::Type>,
precedence: isize
) -> bool;
fn get_input_stream_mut(
&mut self
) -> &mut dyn TokenStream<'input, TF = Self::TF>;
fn get_input_stream(&self) -> &dyn TokenStream<'input, TF = Self::TF>;
fn get_current_token(&self) -> &<Self::TF as TokenFactory<'input>>::Tok;
fn get_expected_tokens(&self) -> IntervalSet;
fn add_error_listener(
&mut self,
listener: Box<dyn ErrorListener<'input, Self>>
)
where
Self: Sized;
fn remove_error_listeners(&mut self);
fn notify_error_listeners(
&self,
msg: String,
offending_token: Option<isize>,
err: Option<&ANTLRError>
);
fn get_error_lister_dispatch<'a>(
&'a self
) -> Box<dyn ErrorListener<'input, Self> + 'a>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
where
Self: Sized;
fn is_expected_token(&self, symbol: isize) -> bool;
fn get_precedence(&self) -> isize;
fn get_state(&self) -> isize;
fn set_state(&mut self, v: isize);
fn get_rule_invocation_stack(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
;
}
Expand description
parser functionality required for ParserATNSimulator
to work
Required Methods
fn get_interpreter(&self) -> &ParserATNSimulator
fn get_token_factory(&self) -> &'input Self::TF
fn get_parser_rule_context(
&self
) -> &Rc<<Self::Node as ParserNodeType<'input>>::Type>
fn consume(&mut self, err_handler: &mut impl ErrorStrategy<'input, Self>) where
Self: Sized,
fn precpred(
&self,
localctx: Option<&<Self::Node as ParserNodeType<'input>>::Type>,
precedence: isize
) -> bool
fn get_input_stream_mut(
&mut self
) -> &mut dyn TokenStream<'input, TF = Self::TF>
fn get_input_stream(&self) -> &dyn TokenStream<'input, TF = Self::TF>
fn get_current_token(&self) -> &<Self::TF as TokenFactory<'input>>::Tok
fn get_expected_tokens(&self) -> IntervalSet
fn add_error_listener(&mut self, listener: Box<dyn ErrorListener<'input, Self>>) where
Self: Sized,
fn remove_error_listeners(&mut self)
fn notify_error_listeners(
&self,
msg: String,
offending_token: Option<isize>,
err: Option<&ANTLRError>
)
fn get_error_lister_dispatch<'a>(
&'a self
) -> Box<dyn ErrorListener<'input, Self> + 'a>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
where
Self: Sized,
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;