Loading...
Searching...
No Matches
Many node
Grammar nodes

A node that matches its child multiple times. More...

Collaboration diagram for Many node:

## Functions

struct ec_node * | ec_node_many (const char *id, struct ec_node *child, unsigned int min, unsigned int max)
| Create a many node that matches its child multiple times.
int | ec_node_many_set_params (struct ec_node *gen_node, struct ec_node *child, unsigned int min, unsigned int max)
| Set the parameters of a many node.

## Detailed Description

A node that matches its child multiple times.

Configuration Schema

schema many {
node child {
description "The child node.";
}
uint64 min {
description "The minimum number of matches (default = 0).";
}
uint64 max {
description "The maximum number of matches. If 0, there is no maximum (default = 0).";
}
}

## Function Documentation

## ec_node_many()

struct ec_node * ec_node_many | ( | const char * | id,
|  | struct ec_node * | child,
|  | unsigned int | min,
|  | unsigned int | max )

Create a many node that matches its child multiple times.

Parameters

  id | The node identifier.
  child | The child node. It is consumed and will be freed when the parent is freed, or immediately on error.
  min | Minimum number of repetitions. Use 0 for no minimum.
  max | Maximum number of repetitions. Use 0 for no maximum.

Returns
  The node, or NULL on error (errno is set).

Examples
  readline/main.c.

## ec_node_many_set_params()

int ec_node_many_set_params | ( | struct ec_node * | gen_node,
|  | struct ec_node * | child,
|  | unsigned int | min,
|  | unsigned int | max )

Set the parameters of a many node.

Parameters

  gen_node | The many node.
  child | The child node. It is consumed and will be freed when the parent is freed, or immediately on error.
  min | Minimum number of repetitions. Use 0 for no minimum.
  max | Maximum number of repetitions. Use 0 for no maximum.

Returns
  0 on success, -1 on error (errno is set).