pub enum ParseTree {
Rule(RuleNode),
Terminal(TerminalNode),
Error(ErrorNode),
}Variants§
Implementations§
Source§impl ParseTree
impl ParseTree
pub fn text(&self) -> String
pub fn to_string_tree(&self, rule_names: &[String]) -> String
Sourcepub fn first_rule(&self, rule_index: usize) -> Option<&Self>
pub fn first_rule(&self, rule_index: usize) -> Option<&Self>
Finds the first rule node with rule_index in a depth-first walk.
Sourcepub fn first_rule_stop(&self, rule_index: usize) -> Option<&CommonToken>
pub fn first_rule_stop(&self, rule_index: usize) -> Option<&CommonToken>
Finds the stop token for the first rule node with rule_index.
Sourcepub fn first_rule_int_return(
&self,
rule_index: usize,
name: &str,
) -> Option<i64>
pub fn first_rule_int_return( &self, rule_index: usize, name: &str, ) -> Option<i64>
Reads an integer return value from the first rule node with
rule_index, matching ANTLR’s $label.value resolution for labeled
rule references in the runtime testsuite.
Sourcepub fn first_error_token(&self) -> Option<&CommonToken>
pub fn first_error_token(&self) -> Option<&CommonToken>
Finds the first recovery error token in a depth-first walk.
Trait Implementations§
impl Eq for ParseTree
impl StructuralPartialEq for ParseTree
Auto Trait Implementations§
impl Freeze for ParseTree
impl RefUnwindSafe for ParseTree
impl Send for ParseTree
impl Sync for ParseTree
impl Unpin for ParseTree
impl UnsafeUnpin for ParseTree
impl UnwindSafe for ParseTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more