Enum commands::parser::Node
[−]
[src]
pub enum Node { Command(CommandNode), Parameter(ParameterNode), ParameterName(ParameterNameNode), Root(RootNode), }
Enumeration of node types used to have vectors of Node
and so on.
Variants
Command(CommandNode)
Node
variant wrapping a CommandNode
.
Parameter(ParameterNode)
Node
variant wrapping a ParameterNode
.
ParameterName(ParameterNameNode)
Node
variant wrapping a ParameterNameNode
.
Root(RootNode)
Node
variant wrapping a RootNode
.
Methods
impl Node
[src]
The node in the tree of commands and parameters used in the parser.
This trait defines the core operations which a node must support.
fn node(&self) -> &TreeNode
Get the TreeNode
data for a given Node
.
fn successors(&self) -> &Vec<Rc<Node>>
Get or calculate successors of this node.
Trait Implementations
impl PartialEq for Node
[src]
fn eq(&self, other: &Self) -> bool
Nodes are equal based on pointer equality.
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl NodeOps for Node
[src]
fn accept<'text>(
&self,
parser: &mut Parser<'text>,
token: Token,
node_ref: &Rc<Node>
)
&self,
parser: &mut Parser<'text>,
token: Token,
node_ref: &Rc<Node>
)
Accept this node with the given token
as data. Read more
fn acceptable(&self, parser: &Parser, node_ref: &Rc<Node>) -> bool
Can this node be accepted in the current parser state? By default, a node can be accepted when it hasn't been seen yet. Read more
fn complete<'text>(&self, token: Option<Token<'text>>) -> Completion<'text>
Given a node and an optional token, provide the completion options. Read more
fn matches(&self, parser: &Parser, token: Token) -> bool
By default, a node matches a token
when the name of the node starts with the token
. Read more