RuleContext

Trait RuleContext 

Source
pub trait RuleContext<'input>: CustomRuleContext<'input> {
    // Provided methods
    fn get_invoking_state(&self) -> isize { ... }
    fn set_invoking_state(&self, _t: isize) { ... }
    fn is_empty(&self) -> bool { ... }
    fn get_parent_ctx(
        &self,
    ) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>> { ... }
    fn set_parent(
        &self,
        _parent: &Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>,
    ) { ... }
}
Expand description

Minimal rule context functionality required for parser to work properly

Provided Methods§

Source

fn get_invoking_state(&self) -> isize

Internal parser state

Source

fn set_invoking_state(&self, _t: isize)

Sets internal parser state

Source

fn is_empty(&self) -> bool

A context is empty if there is no invoking state; meaning nobody called current context. Which is usually true for the root of the syntax tree

Source

fn get_parent_ctx( &self, ) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>

Get parent context

Source

fn set_parent( &self, _parent: &Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>, )

Set parent context

Implementors§

Source§

impl<'input, Ctx: CustomRuleContext<'input>> RuleContext<'input> for BaseParserRuleContext<'input, Ctx>

Source§

impl<'input, ExtCtx: CustomRuleContext<'input>> RuleContext<'input> for BaseRuleContext<'input, ExtCtx>

Source§

impl<'input, Node: ParserNodeType<'input>, T: 'static> RuleContext<'input> for LeafNode<'input, Node, T>

Source§

impl<'input, T, I> RuleContext<'input> for T
where T: DerefSeal<Target = I> + 'input + Debug + Tid<'input>, I: ParserRuleContext<'input> + 'input + ?Sized,