[][src]Trait antlr_rust::parser_rule_context::ParserRuleContext

pub trait ParserRuleContext: RuleContext + CustomRuleContext + ParseTree + Any + Debug {
    fn set_exception(&self, e: ANTLRError);
fn set_start(&self, t: Option<OwningToken>);
fn get_start(&self) -> Ref<OwningToken>;
fn set_stop(&self, t: Option<OwningToken>);
fn get_stop(&self) -> Ref<OwningToken>;
fn add_token_node(&self, token: TerminalNode) -> Rc<dyn ParserRuleContext>;
fn add_error_node(&self, bad_token: ErrorNode) -> Rc<dyn ParserRuleContext>;
fn add_child(&self, child: ParserRuleContextType);
fn remove_last_child(&self);
fn enter_rule(&self, listener: &mut dyn Any);
fn exit_rule(&self, listener: &mut dyn Any);
fn upcast_any(&self) -> &dyn Any;
fn upcast(&self) -> &dyn ParserRuleContext; fn child_of_type<T: ParserRuleContext>(&self, pos: usize) -> Option<Rc<T>>
    where
        Self: Sized
, { ... }
fn children_of_type<T: ParserRuleContext>(&self) -> Vec<Rc<T>>
    where
        Self: Sized
, { ... }
fn get_token(&self, ttype: isize, pos: usize) -> Option<Rc<TerminalNode>> { ... }
fn get_tokens(&self, ttype: isize) -> Vec<Rc<TerminalNode>> { ... } }

Required methods

fn set_exception(&self, e: ANTLRError)

fn set_start(&self, t: Option<OwningToken>)

fn get_start(&self) -> Ref<OwningToken>

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 set_stop(&self, t: Option<OwningToken>)

fn get_stop(&self) -> Ref<OwningToken>

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.

fn add_token_node(&self, token: TerminalNode) -> Rc<dyn ParserRuleContext>

fn add_error_node(&self, bad_token: ErrorNode) -> Rc<dyn ParserRuleContext>

fn add_child(&self, child: ParserRuleContextType)

fn remove_last_child(&self)

fn enter_rule(&self, listener: &mut dyn Any)

fn exit_rule(&self, listener: &mut dyn Any)

fn upcast_any(&self) -> &dyn Any

fn upcast(&self) -> &dyn ParserRuleContext

Loading content...

Provided methods

fn child_of_type<T: ParserRuleContext>(&self, pos: usize) -> Option<Rc<T>> where
    Self: Sized

fn children_of_type<T: ParserRuleContext>(&self) -> Vec<Rc<T>> where
    Self: Sized

fn get_token(&self, ttype: isize, pos: usize) -> Option<Rc<TerminalNode>>

fn get_tokens(&self, ttype: isize) -> Vec<Rc<TerminalNode>>

Loading content...

Implementors

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

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

Loading content...