Struct antlr_rust::rule_context::BaseRuleContext[][src]

pub struct BaseRuleContext<'input, ExtCtx: CustomRuleContext<'input>> { /* fields omitted */ }
Expand description

Minimal parse tree node implementation, that stores only data required for correct parsing

Implementations

Trait Implementations

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Type that describes type of context nodes, stored in this context

Rule index that corresponds to this context type

Formats the value using the given formatter. Read more

Return an {@link Interval} indicating the index in the {@link TokenStream} of the first and last token associated with this subtree. If this node is a leaf, then the interval represents a single token and has interval i..i for token index i. Read more

Return combined text of this AST node. To create resulting string it does traverse whole subtree, also it includes only tokens added to the parse tree Read more

Print out a whole tree, not just a node, in LISP format (root child1 .. childN). Print just a node if this is a leaf. We have to know the recognizer so we can get rule names. Read more

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. Read more

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. Read more

Internal parser state

Sets internal parser state

Get parent context

Set parent context

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 Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Returns text representation of current node type, rule name for context nodes and token text for terminal nodes Read more

Returns text representation of current node type, rule name for context nodes and token text for terminal nodes Read more

Prints list of parent rules

Returns type id of the type of self Read more

Returns type id of this type

Returns true if type behind self is equal to the type of T.

Attempts to downcast self to T behind reference

Attempts to downcast self to T behind mutable reference

Attempts to downcast self to T behind Rc pointer

Attempts to downcast self to T behind Arc pointer

Attempts to downcast self to T behind Box pointer

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.