pub trait CustomRuleContext<'input> {
    type TF: TokenFactory<'input> + 'input;
    type Ctx: ParserNodeType<'input, TF = Self::TF>;
    // Required method
    fn get_rule_index(&self) -> usize;
    // 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 { ... }
}Expand description
Implemented by generated parser for context extension for particular rule
Required Associated Types§
type TF: TokenFactory<'input> + 'input
Sourcetype 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§
Sourcefn 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)
Sourcefn 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