ec_parse_strvec - Man Page

Parse a string vector using a grammar tree.

Synopsis

#include <ecoli/parse.h>

struct ec_pnode * ec_parse_strvec(
    const struct ec_node     *node,    /* The grammar node. */
    const struct ec_strvec   *strvec   /* The input string vector. */
);

Description

Generate a parsing tree by parsing the input string vector using the given grammar tree.

The parsing tree is composed of ec_pnode, and each of them is associated with a ec_node (the grammar node), to the string vector that matched the subtree, and to optional attributes.

When the input matches the grammar tree, the string vector associated to the root node of the returned parsing tree is the same than the strvec argument. Calling ec_pnode_matches() on this tree returns true.

If the input does not match the grammar tree, the returned parsing tree only contains one root node, with no associated string vector. Calling ec_pnode_matches() on this tree returns false.

Return Value

A parsing tree, or NULL on error (errno is set).

See Also

ec_pnode_len(3), ec_pnode_get_strvec(3), ec_parse(3), ec_pnode(3), ec_pnode_free_children(3), ec_pnode_get_root(3), ec_pnode_get_parent(3), ec_pnode_find_next(3), ec_pnode_get_first_child(3), ec_pnode_free(3), ec_pnode_dup(3), ec_pnode_matches(3), ec_pnode_dump(3), ec_pnode_unlink_child(3), ec_pnode_next(3), ec_pnode_del_last_child(3), ec_pnode_link_child(3), ec_pnode_count(3), ec_pnode_get_attrs(3), ec_pnode_get_last_child(3), ec_pnode_get_node(3), ec_pnode_find(3), ec_parse_child(3)

Referenced By

ec_parse(3), ec_parse_child(3), ec_pnode(3), ec_pnode_count(3), ec_pnode_del_last_child(3), ec_pnode_dump(3), ec_pnode_dup(3), ec_pnode_find(3), ec_pnode_find_next(3), ec_pnode_free(3), ec_pnode_free_children(3), ec_pnode_get_attrs(3), ec_pnode_get_first_child(3), ec_pnode_get_last_child(3), ec_pnode_get_node(3), ec_pnode_get_parent(3), ec_pnode_get_root(3), ec_pnode_get_strvec(3), ec_pnode_len(3), ec_pnode_link_child(3), ec_pnode_matches(3), ec_pnode_next(3), ec_pnode_unlink_child(3).

2026-06-11 Libecoli Programmer's Manual