[][src]Trait antlr_rust::tree::ParseTree

pub trait ParseTree: Tree {
    fn get_source_interval(&self) -> Interval;
fn get_text(&self) -> String; fn to_string_tree(&self, r: &dyn Parser) -> String { ... } }

Required methods

fn get_source_interval(&self) -> Interval

Returns interval in input string which corresponds to this subtree

fn get_text(&self) -> String

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.

Loading content...

Provided methods

fn to_string_tree(&self, r: &dyn Parser) -> 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.

Loading content...

Implementors

impl ParseTree for ErrorNode[src]

impl ParseTree for TerminalNode[src]

impl<Ctx: CustomRuleContext> ParseTree for BaseParserRuleContext<Ctx>[src]

impl<T: DerefSeal<Target = I> + Debug + 'static, I: ParserRuleContext + ?Sized> ParseTree for T[src]

Loading content...