Module dynparser::ast

source ·
Expand description

Data information to build the AST And some functions to work with AST

Modules

Data information to build the Flat AST And some functions to work with it

Structs

Context information about an error manipulanting the ast You will have an String with the description, and the node wich produced the error It will have the error description and the string of node info

Enums

Information of a node

Functions

Consume a node if it’s a Rule kind with a specific value and return the rest of nodes and the sub_nodes for the consumed node
Consume a node if it’s a Rule kind with a specific value and return the rest of nodes and the sub_nodes for the consumed node
Consume a node if it’s a Val kind and the vaule is equal to the provider one
Given a slice of nodes, return the value (&str) of first node if it is a Node::Rule and return the rest of nodes
Helper to create an ast::Error
Get the value of the Node If node is not a Node::Val, it will return an error
It will get the node name and a slice to the nodes contained by the node
Sometimes, processing the ast, you will exptect to have an unique child, and it will have to be a simple Node::Val This function will return the val, or error in other case
Return a reference to first node
Given a list of nodes, return the first and the rest on a tuple