[−][src]Struct antlr_rust::parser_rule_context::BaseParserRuleContext
Default rule context implementation that keeps everything provided by parser
Fields
exception: Option<Box<ANTLRError>>
error if there was any in this node
Implementations
impl<'input, Ctx: CustomRuleContext<'input> + 'input> BaseParserRuleContext<'input, Ctx>
[src]
pub fn new_parser_ctx(
parent_ctx: Option<Rc<<Ctx::Ctx as ParserNodeType<'input>>::Type>>,
invoking_state: isize,
ext: Ctx
) -> Self
[src]
parent_ctx: Option<Rc<<Ctx::Ctx as ParserNodeType<'input>>::Type>>,
invoking_state: isize,
ext: Ctx
) -> Self
pub fn copy_from<T: ParserRuleContext<'input, TF = Ctx::TF, Ctx = Ctx::Ctx> + ?Sized>(
ctx: &T,
ext: Ctx
) -> Self
[src]
ctx: &T,
ext: Ctx
) -> Self
Trait Implementations
impl<'input, Ctx: CustomRuleContext<'input>> Borrow<Ctx> for BaseParserRuleContext<'input, Ctx>
[src]
impl<'input, Ctx: CustomRuleContext<'input>> BorrowMut<Ctx> for BaseParserRuleContext<'input, Ctx>
[src]
pub fn borrow_mut(&mut self) -> &mut Ctx
[src]
impl<'input, Ctx: CustomRuleContext<'input>> CustomRuleContext<'input> for BaseParserRuleContext<'input, Ctx>
[src]
type TF = Ctx::TF
type Ctx = Ctx::Ctx
Type that describes type of context nodes, stored in this context
pub fn get_rule_index(&self) -> usize
[src]
pub fn get_alt_number(&self) -> isize
[src]
pub fn set_alt_number(&self, _alt_number: isize)
[src]
impl<'input, Ctx: CustomRuleContext<'input>> Debug for BaseParserRuleContext<'input, Ctx>
[src]
impl<'input, Ctx: CustomRuleContext<'input>> Deref for BaseParserRuleContext<'input, Ctx>
[src]
impl<'input, Ctx: CustomRuleContext<'input>> DerefMut for BaseParserRuleContext<'input, Ctx>
[src]
impl<'input, Ctx: CustomRuleContext<'input> + TidAble<'input>> ParseTree<'input> for BaseParserRuleContext<'input, Ctx>
[src]
pub fn get_source_interval(&self) -> Interval
[src]
pub default fn get_text(&self) -> String
[src]
pub fn to_string_tree(
&self,
r: &dyn Recognizer<'input, TF = Self::TF, Node = Self::Ctx>
) -> String
[src]
&self,
r: &dyn Recognizer<'input, TF = Self::TF, Node = Self::Ctx>
) -> String
impl<'input, Ctx: CustomRuleContext<'input> + TidAble<'input>> ParserRuleContext<'input> for BaseParserRuleContext<'input, Ctx>
[src]
pub fn set_exception(&self, _e: ANTLRError)
[src]
pub fn set_start(&self, t: Option<<Ctx::TF as TokenFactory<'input>>::Tok>)
[src]
pub fn start<'a>(&'a self) -> Ref<'a, <Ctx::TF as TokenFactory<'input>>::Inner> where
'input: 'a,
[src]
'input: 'a,
pub fn start_mut<'a>(
&'a self
) -> RefMut<'a, <Self::TF as TokenFactory<'input>>::Tok> where
'input: 'a,
[src]
&'a self
) -> RefMut<'a, <Self::TF as TokenFactory<'input>>::Tok> where
'input: 'a,
pub fn set_stop(&self, t: Option<<Ctx::TF as TokenFactory<'input>>::Tok>)
[src]
pub fn stop<'a>(&'a self) -> Ref<'a, <Ctx::TF as TokenFactory<'input>>::Inner> where
'input: 'a,
[src]
'input: 'a,
pub fn stop_mut<'a>(
&'a self
) -> RefMut<'a, <Self::TF as TokenFactory<'input>>::Tok> where
'input: 'a,
[src]
&'a self
) -> RefMut<'a, <Self::TF as TokenFactory<'input>>::Tok> where
'input: 'a,
pub fn add_child(&self, child: Rc<<Ctx::Ctx as ParserNodeType<'input>>::Type>)
[src]
pub fn remove_last_child(&self)
[src]
pub fn child_of_type<T>(&self, pos: usize) -> Option<Rc<T>> where
T: ParserRuleContext<'input, TF = Self::TF, Ctx = Self::Ctx> + 'input,
Self: Sized,
[src]
T: ParserRuleContext<'input, TF = Self::TF, Ctx = Self::Ctx> + 'input,
Self: Sized,
pub fn children_of_type<T>(&self) -> Vec<Rc<T>> where
T: ParserRuleContext<'input, TF = Self::TF, Ctx = Self::Ctx> + 'input,
Self: Sized,
[src]
T: ParserRuleContext<'input, TF = Self::TF, Ctx = Self::Ctx> + 'input,
Self: Sized,
pub fn get_token(
&self,
ttype: isize,
pos: usize
) -> Option<Rc<TerminalNode<'input, Self::Ctx>>>
[src]
&self,
ttype: isize,
pos: usize
) -> Option<Rc<TerminalNode<'input, Self::Ctx>>>
pub fn get_tokens(
&self,
ttype: isize
) -> Vec<Rc<TerminalNode<'input, Self::Ctx>>>
[src]
&self,
ttype: isize
) -> Vec<Rc<TerminalNode<'input, Self::Ctx>>>
impl<'input, Ctx: CustomRuleContext<'input>> RuleContext<'input> for BaseParserRuleContext<'input, Ctx>
[src]
pub fn get_invoking_state(&self) -> isize
[src]
pub fn set_invoking_state(&self, t: isize)
[src]
pub fn get_parent_ctx(
&self
) -> Option<Rc<<Ctx::Ctx as ParserNodeType<'input>>::Type>>
[src]
&self
) -> Option<Rc<<Ctx::Ctx as ParserNodeType<'input>>::Type>>
pub fn set_parent(
&self,
parent: &Option<Rc<<Ctx::Ctx as ParserNodeType<'input>>::Type>>
)
[src]
&self,
parent: &Option<Rc<<Ctx::Ctx as ParserNodeType<'input>>::Type>>
)
pub fn is_empty(&self) -> bool
[src]
impl<'input, Ctx: CustomRuleContext<'input>> TidAble<'input> for BaseParserRuleContext<'input, Ctx> where
Ctx: TidAble<'input>,
[src]
Ctx: TidAble<'input>,
impl<'input, Ctx: CustomRuleContext<'input>> Tree<'input> for BaseParserRuleContext<'input, Ctx>
[src]
pub fn get_parent(
&self
) -> Option<Rc<<Ctx::Ctx as ParserNodeType<'input>>::Type>>
[src]
&self
) -> Option<Rc<<Ctx::Ctx as ParserNodeType<'input>>::Type>>
pub fn has_parent(&self) -> bool
[src]
pub fn get_payload(&self) -> Box<dyn Any>
[src]
pub fn get_child(
&self,
i: usize
) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>
[src]
&self,
i: usize
) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>
pub fn get_child_count(&self) -> usize
[src]
pub fn get_children<'a>(
&'a self
) -> Box<dyn Iterator<Item = Rc<<Self::Ctx as ParserNodeType<'input>>::Type>> + 'a> where
'input: 'a,
[src]
&'a self
) -> Box<dyn Iterator<Item = Rc<<Self::Ctx as ParserNodeType<'input>>::Type>> + 'a> where
'input: 'a,
Auto Trait Implementations
impl<'input, Ctx> !RefUnwindSafe for BaseParserRuleContext<'input, Ctx>
[src]
impl<'input, Ctx> !Send for BaseParserRuleContext<'input, Ctx>
[src]
impl<'input, Ctx> !Sync for BaseParserRuleContext<'input, Ctx>
[src]
impl<'input, Ctx> Unpin for BaseParserRuleContext<'input, Ctx> where
Ctx: Unpin,
<<Ctx as CustomRuleContext<'input>>::TF as TokenFactory<'input>>::Tok: Unpin,
[src]
Ctx: Unpin,
<<Ctx as CustomRuleContext<'input>>::TF as TokenFactory<'input>>::Tok: Unpin,
impl<'input, Ctx> !UnwindSafe for BaseParserRuleContext<'input, Ctx>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> NodeText for T
[src]
impl<'input, T> NodeText for T where
T: CustomRuleContext<'input>,
[src]
T: CustomRuleContext<'input>,
impl<'input, T> RuleContextExt<'input> for T where
T: 'input + ParserRuleContext<'input> + ?Sized,
[src]
T: 'input + ParserRuleContext<'input> + ?Sized,
pub fn to_string<Z>(&Rc<T>, Option<&[&str]>, Option<Rc<Z>>) -> String where
Z: ParserRuleContext<'input, Ctx = <T as CustomRuleContext<'input>>::Ctx, TF = <T as CustomRuleContext<'input>>::TF> + 'input + ?Sized,
<T as CustomRuleContext<'input>>::Ctx: ParserNodeType<'input>,
Rc<T>: CoerceUnsized<Rc<Z>>,
<<T as CustomRuleContext<'input>>::Ctx as ParserNodeType<'input>>::Type == Z,
[src]
Z: ParserRuleContext<'input, Ctx = <T as CustomRuleContext<'input>>::Ctx, TF = <T as CustomRuleContext<'input>>::TF> + 'input + ?Sized,
<T as CustomRuleContext<'input>>::Ctx: ParserNodeType<'input>,
Rc<T>: CoerceUnsized<Rc<Z>>,
<<T as CustomRuleContext<'input>>::Ctx as ParserNodeType<'input>>::Type == Z,
pub fn accept_children<V>(&Self, &mut V) where
V: ParseTreeVisitor<'input, <T as CustomRuleContext<'input>>::Ctx> + ?Sized,
<<T as CustomRuleContext<'input>>::Ctx as ParserNodeType<'input>>::Type: VisitableDyn<V>,
[src]
V: ParseTreeVisitor<'input, <T as CustomRuleContext<'input>>::Ctx> + ?Sized,
<<T as CustomRuleContext<'input>>::Ctx as ParserNodeType<'input>>::Type: VisitableDyn<V>,
impl<'a, T> Tid<'a> for T where
T: TidAble<'a> + ?Sized,
[src]
T: TidAble<'a> + ?Sized,
impl<'a, X> TidExt<'a> for X where
X: Tid<'a> + ?Sized,
[src]
X: Tid<'a> + ?Sized,
pub fn is<T>(&self) -> bool where
T: Tid<'a>,
[src]
T: Tid<'a>,
pub fn downcast_ref<T>(&'b self) -> Option<&'b T> where
T: Tid<'a>,
[src]
T: Tid<'a>,
pub fn downcast_mut<T>(&'b mut self) -> Option<&'b mut T> where
T: Tid<'a>,
[src]
T: Tid<'a>,
pub fn downcast_rc<T>(self: Rc<X>) -> Result<Rc<T>, Rc<X>> where
T: Tid<'a>,
[src]
T: Tid<'a>,
pub fn downcast_arc<T>(self: Arc<X>) -> Result<Arc<T>, Arc<X>> where
T: Tid<'a>,
[src]
T: Tid<'a>,
pub fn downcast_box<T>(
self: Box<X, Global>
) -> Result<Box<T, Global>, Box<X, Global>> where
T: Tid<'a>,
[src]
self: Box<X, Global>
) -> Result<Box<T, Global>, Box<X, Global>> where
T: Tid<'a>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,