[−][src]Trait antlr_rust::tree::ParseTree
Tree that knows about underlying text
Provided methods
pub fn get_source_interval(&self) -> Interval
[src]
Return an {@link Interval} indicating the index in the {@link TokenStream} of the first and last token associated with this subtree. If this node is a leaf, then the interval represents a single token and has interval i..i for token index i.
pub fn get_text(&self) -> String
[src]
Return combined text of this AST node. To create resulting string it does traverse whole subtree, also it includes only tokens added to the parse tree
Since tokens on hidden channels (e.g. whitespace or comments) are not added to the parse trees, they will not appear in the output of this method.
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
Print out a whole tree, not just a node, in LISP format (root child1 .. childN). Print just a node if this is a leaf. We have to know the recognizer so we can get rule names.
Implementors
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]
impl<'input, ExtCtx: CustomRuleContext<'input>> ParseTree<'input> for BaseRuleContext<'input, ExtCtx>
[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]
impl<'input, T, I: ?Sized> ParseTree<'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,