Libecoli 0.11.1
Extensible COmmand LIne library
Loading...
Searching...
No Matches
Shell lexer node

A lexer node using shell-like tokenization rules. More...

Functions

struct ec_nodeec_node_sh_lex (const char *id, struct ec_node *child)
struct ec_nodeec_node_sh_lex_expand (const char *id, struct ec_node *child)

Detailed Description

A lexer node using shell-like tokenization rules.

Configuration Schema

No configuration schema.

Function Documentation

◆ ec_node_sh_lex()

struct ec_node * ec_node_sh_lex ( const char * id,
struct ec_node * child )

Create a shell lexer node.

This node tokenizes the input using shell-like lexing rules (handling quotes, escapes, etc.) and passes the resulting tokens to the child node.

Parameters
idThe node identifier.
childThe child node. It is consumed and will be freed when the parent is freed, or immediately on error.
Returns
The node, or NULL on error (errno is set).
Examples
extension-editline/main.c, parse-yaml/parse-yaml.c, pool-editline/main.c, readline/main.c, and simple-editline/main.c.

◆ ec_node_sh_lex_expand()

struct ec_node * ec_node_sh_lex_expand ( const char * id,
struct ec_node * child )

Create a shell lexer node with variable expansion.

Same as ec_node_sh_lex() but with shell variable expansion enabled.

Parameters
idThe node identifier.
childThe child node. It is consumed and will be freed when the parent is freed, or immediately on error.
Returns
The node, or NULL on error (errno is set).