pub trait ParserRuleContext<'input>:
ParseTree<'input>
+ RuleContext<'input>
+ Debug
+ Tid<'input> {
Show 13 methods
// Provided methods
fn set_exception(&self, _e: ANTLRError) { ... }
fn set_start(&self, _t: Option<<Self::TF as TokenFactory<'input>>::Tok>) { ... }
fn start<'a>(&'a self) -> Ref<'a, <Self::TF as TokenFactory<'input>>::Inner>
where 'input: 'a { ... }
fn start_mut<'a>(
&'a self,
) -> RefMut<'a, <Self::TF as TokenFactory<'input>>::Tok>
where 'input: 'a { ... }
fn set_stop(&self, _t: Option<<Self::TF as TokenFactory<'input>>::Tok>) { ... }
fn stop<'a>(&'a self) -> Ref<'a, <Self::TF as TokenFactory<'input>>::Inner>
where 'input: 'a { ... }
fn stop_mut<'a>(
&'a self,
) -> RefMut<'a, <Self::TF as TokenFactory<'input>>::Tok>
where 'input: 'a { ... }
fn add_child(&self, _child: Rc<<Self::Ctx as ParserNodeType<'input>>::Type>) { ... }
fn remove_last_child(&self) { ... }
fn child_of_type<T>(&self, pos: usize) -> Option<Rc<T>>
where T: ParserRuleContext<'input, TF = Self::TF, Ctx = Self::Ctx> + 'input,
Self: Sized { ... }
fn children_of_type<T>(&self) -> Vec<Rc<T>>
where T: ParserRuleContext<'input, TF = Self::TF, Ctx = Self::Ctx> + 'input,
Self: Sized { ... }
fn get_token(
&self,
ttype: isize,
pos: usize,
) -> Option<Rc<TerminalNode<'input, Self::Ctx>>> { ... }
fn get_tokens(
&self,
ttype: isize,
) -> Vec<Rc<TerminalNode<'input, Self::Ctx>>> { ... }
}
Expand description
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§
fn set_exception(&self, _e: ANTLRError)
fn set_start(&self, _t: Option<<Self::TF as TokenFactory<'input>>::Tok>)
Sourcefn start<'a>(&'a self) -> Ref<'a, <Self::TF as TokenFactory<'input>>::Inner>where
'input: 'a,
fn start<'a>(&'a self) -> Ref<'a, <Self::TF as TokenFactory<'input>>::Inner>where
'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.
fn start_mut<'a>(
&'a self,
) -> RefMut<'a, <Self::TF as TokenFactory<'input>>::Tok>where
'input: 'a,
fn set_stop(&self, _t: Option<<Self::TF as TokenFactory<'input>>::Tok>)
Sourcefn stop<'a>(&'a self) -> Ref<'a, <Self::TF as TokenFactory<'input>>::Inner>where
'input: 'a,
fn stop<'a>(&'a self) -> Ref<'a, <Self::TF as TokenFactory<'input>>::Inner>where
'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.