|
Typedefs |
| typedef void * | boolexpr_t |
| | Cookie type for an expression tree node.
|
Enumerations |
| enum | bool_operator_t { BOOLSTUFF_VALUE,
BOOLSTUFF_AND,
BOOLSTUFF_OR,
BOOLSTUFF_NOT
} |
| | Possible types of a node. More...
|
| enum | bool_error_t { BOOLSTUFF_OK,
BOOLSTUFF_ERR_GARBAGE_AT_END,
BOOLSTUFF_ERR_RUNAWAY_PARENTHESIS,
BOOLSTUFF_ERR_STRING_EXPECTED
} |
| | Possible error codes returned by the parser. More...
|
Functions |
| boolexpr_t | boolstuff_create_value_node (const char *value) |
| | Creates a node that contains a copy of the designated string as its value.
|
| boolexpr_t | boolstuff_create_operator_node (enum bool_operator_t op, boolexpr_t left, boolexpr_t right) |
| | Creates a node that represents a boolean operator.
|
| boolexpr_t | boolstuff_parse (const char *expr, size_t *error_index, enum bool_error_t *error_code) |
| | Parse a textual boolean expression and creates a binary tree.
|
| void | boolstuff_destroy_tree (boolexpr_t root) |
| | Destroys a tree and all its dynamically allocated nodes.
|
| enum bool_operator_t | boolstuff_get_node_type (boolexpr_t node) |
| | Returns of type of the node (value or operator).
|
| const char * | boolstuff_get_node_value (boolexpr_t node) |
| | Returns the value of node that represents a variable.
|
| boolexpr_t | boolstuff_get_left_subtree (boolexpr_t node) |
| | Returns the root of the left-hand subtree of a node.
|
| boolexpr_t | boolstuff_get_right_subtree (boolexpr_t node) |
| | Returns the root of the right-hand subtree of a node.
|
| void | boolstuff_set_node_type (boolexpr_t node, enum bool_operator_t op) |
| | Sets the type of a node.
|
| void | boolstuff_set_left_subtree (boolexpr_t node, boolexpr_t subtree) |
| | Attaches a subtree as a node's left-hand subtree.
|
| void | boolstuff_set_right_subtree (boolexpr_t node, boolexpr_t subtree) |
| | Attaches a subtree as this node's right-hand subtree.
|
| void | boolstuff_set_node_value (boolexpr_t node, const char *value) |
| | Changes the string value of a node.
|
| void | boolstuff_print_tree (FILE *out, boolexpr_t root) |
| | Prints a boolean expression tree in a file.
|
| char * | boolstuff_print_tree_to_string (boolexpr_t root) |
| void | boolstuff_free_string (char *s) |
| | Frees the memory used by a string created by this library.
|
| boolexpr_t | boolstuff_clone_tree (boolexpr_t root) |
| | Creates a complete copy of a binary tree.
|
| boolexpr_t | boolstuff_get_disjunctive_normal_form (boolexpr_t root) |
| | Transforms a tree into the Disjunctive Normal Form.
|
| int | boolstuff_is_disjunctive_normal_form (boolexpr_t root) |
| | Determines if a tree is in Disjunctive Normal Form.
|
| boolexpr_t * | boolstuff_get_dnf_term_roots (boolexpr_t root, size_t *num) |
| | Returns the terms of a tree in Disjunctive Normal Form.
|
| void | boolstuff_free_node_array (boolexpr_t *array) |
| | Frees an array returned by boolstuff_get_dnf_term_roots().
|
| void | boolstuff_get_tree_variables (boolexpr_t tree, char ***positivesArray, char ***negativesArray) |
| void | boolstuff_free_variables_sets (char **positivesArray, char **negativesArray) |
| | Frees the arrays created by boolstuff_get_tree_variables().
|