|
Libecoli 0.11.1
Extensible COmmand LIne library
|
A lexer node using regular expressions for tokenization. More...
Functions | |
| struct ec_node * | ec_node_re_lex (const char *id, struct ec_node *child) |
| int | ec_node_re_lex_add (struct ec_node *gen_node, const char *pattern, int keep, const char *attr_name) |
A lexer node using regular expressions for tokenization.
Configuration Schema
Create a regex-based lexer node.
This node tokenizes the input using regular expressions added with ec_node_re_lex_add() and passes the resulting tokens to the child node.
| id | The node identifier. |
| child | The child node. It is consumed and will be freed when the parent is freed, or immediately on error. |
| int ec_node_re_lex_add | ( | struct ec_node * | gen_node, |
| const char * | pattern, | ||
| int | keep, | ||
| const char * | attr_name ) |
Add a token pattern to a regex lexer node.
| gen_node | The regex lexer node. |
| pattern | The regular expression pattern for matching tokens. |
| keep | If non-zero, include matched tokens in the output; if zero, discard them. |
| attr_name | Optional attribute name to attach to matched tokens, or NULL. |