Enum parol_runtime::parser::parse_tree_stack_entry::ParseTreeStackEntry [−][src]
pub enum ParseTreeStackEntry<'t> {
Nd(Node<ParseTreeType<'t>>),
Id(NodeId),
}Expand description
The type of elements in the parser’s parse tree stack.
- ‘Nd’ references nodes not yet inserted into the parse tree.
- ‘Id’ holds node ids to nodes that are already part of the parse tree.
Variants
Nd(Node<ParseTreeType<'t>>)
Tuple Fields
0: Node<ParseTreeType<'t>>The node is not inserted into the parse tree yet. Thus we can access it directly.
Id(NodeId)
Tuple Fields
0: NodeIdThe node is already inserted into the parse tree. Wee need to lookup the node in the parse tree via the NodeId.
Implementations
pub fn get_parse_tree_type<'a, 'b>(
&'a self,
parse_tree: &'b Tree<ParseTreeType<'t>>
) -> &'a ParseTreeType<'_> where
'b: 'a,
pub fn get_parse_tree_type<'a, 'b>(
&'a self,
parse_tree: &'b Tree<ParseTreeType<'t>>
) -> &'a ParseTreeType<'_> where
'b: 'a,
Abstracts from the actual place where the node exists and returns the inner ParseTreeType.
'a refers to the lifetime of self.
'b refers to the lifetime of the parse tree.
Tries to access the OwnedToken of the ParseTreeStackEntry. Can fail if the entry is no terminal (i.e. a non-terminal).
'a refers to the lifetime of self.
'b refers to the lifetime of the parse tree.
't refers to the lifetime of the scanned text.
Tries to access the text of the ParseTreeStackEntry. Can fail if the entry is no terminal (i.e. a non-terminal).
'a refers to the lifetime of self.
'b refers to the lifetime of the parse tree.
