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:


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