[−][src]Struct antlr_rust::tree::LeafNode
Generic leaf AST node
Fields
symbol: <Node::TF as TokenFactory<'input>>::Tok
Token, this leaf consist of
Implementations
impl<'input, Node: ParserNodeType<'input>, T: 'static> LeafNode<'input, Node, T>
[src]
pub fn new(symbol: <Node::TF as TokenFactory<'input>>::Tok) -> Self
[src]
creates new leaf node
Trait Implementations
impl<'input, Node: ParserNodeType<'input>, T: 'static> CustomRuleContext<'input> for LeafNode<'input, Node, T>
[src]
type TF = Node::TF
type Ctx = Node
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, Node: ParserNodeType<'input>, T: 'static> Debug for LeafNode<'input, Node, T>
[src]
impl<'input, Node: ParserNodeType<'input>, T: 'static> NodeText for LeafNode<'input, Node, T>
[src]
impl<'input, Node: ParserNodeType<'input>, T: 'static> ParseTree<'input> for LeafNode<'input, Node, T>
[src]
pub fn get_source_interval(&self) -> Interval
[src]
pub 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, Node: ParserNodeType<'input> + TidAble<'input>, T: 'static + TidAble<'input>> ParserRuleContext<'input> for LeafNode<'input, Node, T>
[src]
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,
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>>>
impl<'input, Node: ParserNodeType<'input>, T: 'static> RuleContext<'input> for LeafNode<'input, Node, T>
[src]
pub fn get_invoking_state(&self) -> isize
[src]
pub fn set_invoking_state(&self, _t: isize)
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn get_parent_ctx(
&self
) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>
[src]
&self
) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>
pub fn set_parent(
&self,
_parent: &Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>
)
[src]
&self,
_parent: &Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>
)
impl<'input, Node: ParserNodeType<'input>, T: 'static> TidAble<'input> for LeafNode<'input, Node, T> where
Node: TidAble<'input>,
[src]
Node: TidAble<'input>,
impl<'input, Node: ParserNodeType<'input>, T: 'static> Tree<'input> for LeafNode<'input, Node, T>
[src]
pub fn get_parent(
&self
) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>
[src]
&self
) -> Option<Rc<<Self::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, Node, T> RefUnwindSafe for LeafNode<'input, Node, T> where
T: RefUnwindSafe,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: RefUnwindSafe,
[src]
T: RefUnwindSafe,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: RefUnwindSafe,
impl<'input, Node, T> Send for LeafNode<'input, Node, T> where
T: Send,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: Send,
[src]
T: Send,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: Send,
impl<'input, Node, T> Sync for LeafNode<'input, Node, T> where
T: Sync,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: Sync,
[src]
T: Sync,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: Sync,
impl<'input, Node, T> Unpin for LeafNode<'input, Node, T> where
T: Unpin,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: Unpin,
[src]
T: Unpin,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: Unpin,
impl<'input, Node, T> UnwindSafe for LeafNode<'input, Node, T> where
T: UnwindSafe,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: UnwindSafe,
[src]
T: UnwindSafe,
<<Node as ParserNodeType<'input>>::TF as TokenFactory<'input>>::Tok: UnwindSafe,
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>,