EC_PARSE_STRVEC(3)
β¨ EC_PARSE_STRVEC β¨ (section 3 of the Libecoli Programmer's Manual)
okay bestie, gather round, because today we're parsing string vectors with a grammar tree and honestly? it's giving main character energy π
πΈ NAME πΈ
ec_parse_strvec β parse a string vector using a grammar tree. that's it, that's the whole job, and she does it flawlessly π
π¦ 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 π
so basically: you hand her a grammar tree and an input string vector, and she generates a parsing tree by parsing that string vector with that grammar tree. iconic behaviour, no notes β¨
the parsing tree is made of ec_pnodes, and every single one of them is associated with a ec_node (that's the grammar node), with the string vector that matched the subtree, and with optional attributes. all three, together, like a little friend group π«Ά
here's the part where it gets good: 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. and calling ec_pnode_matches() on this tree returns true. we love a happy ending ππ
but 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. it's fine. it's fine!! she's still valid, she's just sad π
π RETURN VALUE π
a parsing tree, or NULL on error (errno is set). that's the vibe check right there β NULL means something went wrong and errno has the receipts π
β SEE ALSO β
the whole extended universe, fr fr:
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)
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry. periodt π
okay bestie that's the whole page, go parse something gorgeous with it ππ
libecoli Β· 2026-06-11 Β· EC_PARSE_STRVEC(3) β mwah, love u, bye ππ§β¨
π¦ where this page comes from
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms