Trait SyntaxTreeVisitor Copy item path Source pub trait SyntaxTreeVisitor<E> {
Show 20 methods // Required methods
fn visit_function (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_parameters (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_parameter (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_variable (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_group (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_range (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_standard_dice (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_custom_dice (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_custom_faces (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_drop_lowest (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_drop_highest (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_add (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_sub (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_mul (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_div (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_mod (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_exp (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_neg (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_constant (&mut self, node: &Node <'_>) -> Result <() , E>;
fn visit_negative_constant (&mut self, node: &Node <'_>) -> Result <() , E>;
}Expand description A visitor for the syntax tree produced by the dice language parser. Each
method visits a specific type of node in the syntax tree, and is responsible
for visiting any interesting children of that node.
§ Type Parameters
E: The type of error that can occur while visiting the syntax tree.
Visit a “function” node in the syntax tree.
§ Parameters
node: The “function” node.
§ Errors
An error if one occurs while visiting the “function” node.
Visit a “parameters” node in the syntax tree.
§ Parameters
node: The “parameters” node.
§ Errors
An error if one occurs while visiting the “parameters” node.
Visit a “parameter” node in the syntax tree.
§ Parameters
node: The “parameter” node.
§ Errors
An error if one occurs while visiting the “parameter” node.
Visit a “variable” node in the syntax tree.
§ Parameters
node: The “variable” node.
§ Errors
An error if one occurs while visiting the “variable” node.
Visit a “group” node in the syntax tree.
§ Parameters
§ Errors
An error if one occurs while visiting the “group” node.
Visit a “range” node in the syntax tree.
§ Parameters
§ Errors
An error if one occurs while visiting the “range” node.
Visit a “standard_dice” node in the syntax tree.
§ Parameters
node: The “standard_dice” node.
§ Errors
An error if one occurs while visiting the “standard_dice” node.
Visit a “custom_dice” node in the syntax tree.
§ Parameters
node: The “custom_dice” node.
§ Errors
An error if one occurs while visiting the “custom_dice” node.
Visit a “custom_faces” node in the syntax tree.
§ Parameters
node: The “custom_faces” node.
§ Errors
An error if one occurs while visiting the “custom_faces” node.
Visit a “custom_face” node in the syntax tree.
§ Parameters
node: The “custom_face” node.
Visit a “drop_lowest” node in the syntax tree.
§ Parameters
node: The “drop_lowest” node.
§ Errors
An error if one occurs while visiting the “drop_lowest” node.
Visit a “drop_highest” node in the syntax tree.
§ Parameters
node: The “drop_highest” node.
§ Errors
An error if one occurs while visiting the “drop_highest” node.
Visit a “add” node in the syntax tree.
§ Parameters
§ Errors
An error if one occurs while visiting the “add” node.
Visit a “sub” node in the syntax tree.
§ Parameters
§ Errors
An error if one occurs while visiting the “sub” node.
Visit a “mul” node in the syntax tree.
§ Parameters
§ Errors
An error if one occurs while visiting the “mul” node.
Visit a “div” node in the syntax tree.
§ Parameters
§ Errors
An error if one occurs while visiting the “div” node.
Visit a “mod” node in the syntax tree.
§ Parameters
§ Errors
An error if one occurs while visiting the “mod” node.
Visit an “exp” node in the syntax tree.
§ Parameters
§ Errors
An error if one occurs while visiting the “exp” node.
Visit a “neg” node in the syntax tree.
§ Parameters
§ Errors
An error if one occurs while visiting the “neg” node.
Visit a “constant” node in the syntax tree.
§ Parameters
node: The “constant” node.
§ Errors
An error if one occurs while visiting the “constant” node.
Visit a “negative_constant” node in the syntax tree.
§ Parameters
node: The “negative_constant” node.
§ Errors
An error if one occurs while visiting the “negative_constant” node.