|
Libecoli 0.11.1
Extensible COmmand LIne library
|
A node that matches any subset of its children in any order. More...
Macros | |
| #define | EC_NODE_SUBSET(args...) |
Functions | |
| struct ec_node * | ec_node_subset (const char *id) |
| struct ec_node * | ec_node_subset_min (const char *id, unsigned int min) |
| int | ec_node_subset_add (struct ec_node *node, struct ec_node *child) |
| int | ec_node_subset_set_min (struct ec_node *node, unsigned int min) |
| unsigned int | ec_node_subset_get_min (const struct ec_node *node) |
A node that matches any subset of its children in any order.
Configuration Schema
No configuration schema.
| #define EC_NODE_SUBSET | ( | args... | ) |
Create a subset node from a list of child nodes.
A subset node matches any permutation of a subset of its children. All child nodes passed as arguments are consumed and will be freed when the subset node is freed, or immediately on error.
Example:
Definition at line 30 of file node_subset.h.
| struct ec_node * ec_node_subset | ( | const char * | id | ) |
Create an empty subset node.
Use ec_node_subset_add() to add children.
| id | The node identifier. |
| struct ec_node * ec_node_subset_min | ( | const char * | id, |
| unsigned int | min ) |
Create an empty subset node with a minimum number of children that must match.
Use ec_node_subset_add() to add children.
| id | The node identifier. |
| min | The minimum number of children that must match. |
Add a child to a subset node.
| node | The subset node. |
| child | The child node to add. It is consumed and will be freed when the parent is freed, or immediately on error. |
| int ec_node_subset_set_min | ( | struct ec_node * | node, |
| unsigned int | min ) |
Set the minimum number of children that must match.
By default, a subset node accepts zero matching children. Use this function to require a minimum number of children to match for the parse to succeed.
| node | The subset node. |
| min | The minimum number of children that must match. |
| unsigned int ec_node_subset_get_min | ( | const struct ec_node * | node | ) |
Get the minimum number of children that must match.
| node | The subset node. |