[−][src]Trait antlr_rust::parser_rule_context::ParserRuleContext
Syntax tree node for particular parser rule.
Not yet good for custom implementations so currently easiest option
is to just copy BaseParserRuleContext
or BaseRuleContext
and strip/extend them
Provided methods
pub fn set_exception(&self, _e: ANTLRError)
[src]
pub fn set_start(&self, _t: Option<<Self::TF as TokenFactory<'input>>::Tok>)
[src]
pub fn start<'a>(&'a self) -> Ref<'a, <Self::TF as TokenFactory<'input>>::Inner> where
'input: 'a,
[src]
'input: 'a,
Get the initial token in this context. Note that the range from start to stop is inclusive, so for rules that do not consume anything (for example, zero length or error productions) this token may exceed stop.
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<<Self::TF as TokenFactory<'input>>::Tok>)
[src]
pub fn stop<'a>(&'a self) -> Ref<'a, <Self::TF as TokenFactory<'input>>::Inner> where
'input: 'a,
[src]
'input: 'a,
Get the final token in this context. Note that the range from start to stop is inclusive, so for rules that do not consume anything (for example, zero length or error productions) this token may precede start.
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<<Self::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>>>
Implementors
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]
impl<'input, ExtCtx: CustomRuleContext<'input> + TidAble<'input>> ParserRuleContext<'input> for BaseRuleContext<'input, ExtCtx>
[src]
impl<'input, Node: ParserNodeType<'input> + TidAble<'input>, T: 'static + TidAble<'input>> ParserRuleContext<'input> for LeafNode<'input, Node, T>
[src]
impl<'input, T, I: ?Sized> ParserRuleContext<'input> for T where
T: DerefSeal<Target = I> + 'input + Debug + Tid<'input>,
I: ParserRuleContext<'input> + 'input,
[src]
T: DerefSeal<Target = I> + 'input + Debug + Tid<'input>,
I: ParserRuleContext<'input> + 'input,
pub fn set_exception(&self, e: ANTLRError)
[src]
pub fn set_start(&self, t: Option<<Self::TF as TokenFactory<'input>>::Tok>)
[src]
pub fn start<'a>(&'a self) -> Ref<'a, <Self::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<<Self::TF as TokenFactory<'input>>::Tok>)
[src]
pub fn stop<'a>(&'a self) -> Ref<'a, <Self::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,