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§
Sourcefn get_invoking_state(&self) -> isize
fn get_invoking_state(&self) -> isize
Internal parser state
Sourcefn set_invoking_state(&self, _t: isize)
fn set_invoking_state(&self, _t: isize)
Sets internal parser state
Sourcefn is_empty(&self) -> bool
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
Sourcefn get_parent_ctx(
&self,
) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>
fn get_parent_ctx( &self, ) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>
Get parent context
Sourcefn set_parent(
&self,
_parent: &Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>,
)
fn set_parent( &self, _parent: &Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>, )
Set parent context