Trait antlr_rust::rule_context::CustomRuleContext
source · [−]pub trait CustomRuleContext<'input> {
type TF: TokenFactory<'input> + 'input;
type Ctx: ParserNodeType<'input, TF = Self::TF>;
fn get_rule_index(&self) -> usize;
fn get_alt_number(&self) -> isize { ... }
fn set_alt_number(&self, _alt_number: isize) { ... }
fn get_node_text(&self, rule_names: &[&str]) -> String { ... }
}
Expand description
Implemented by generated parser for context extension for particular rule
Required Associated Types
type TF: TokenFactory<'input> + 'input
type Ctx: ParserNodeType<'input, TF = Self::TF>
type Ctx: ParserNodeType<'input, TF = Self::TF>
Type that describes type of context nodes, stored in this context
Required Methods
fn get_rule_index(&self) -> usize
fn get_rule_index(&self) -> usize
Rule index that corresponds to this context type
Provided Methods
fn get_alt_number(&self) -> isize
fn set_alt_number(&self, _alt_number: isize)
fn get_node_text(&self, rule_names: &[&str]) -> String
fn get_node_text(&self, rule_names: &[&str]) -> String
Returns text representation of current node type, rule name for context nodes and token text for terminal nodes