EC_PNODE_GET_STRVEC(3)

πŸ’– EC_PNODE_GET_STRVEC πŸ’–

okay bestie, sit down, hydrate, and let me tell you about ec_pnode_get_strvec from the Libecoli Programmer's Manual β€” she's a little function that hands you back the string vector chillin' inside a parsing node πŸŽ€


✨ NAME ✨

ec_pnode_get_strvec β€” bestie, this one literally gets the string vector associated with a parsing node. that's the whole job. icon behavior πŸ’…


✨ SYNOPSIS ✨

#include <ecoli/parse.h>

const struct ec_strvec * ec_pnode_get_strvec(
    /*
     * The parsing node. If NULL, the function returns NULL.
     */
    const struct ec_pnode   *pnode
);

like, look at her. one parameter. no drama πŸ¦‹


✨ DESCRIPTION ✨

so here's the vibe 🌸

when an input gets parsed successfully β€” meaning the input string vector matches the grammar tree β€” the matching string vector gets copied inside the associated parsing node. it's giving "your results are stored right where you'd expect them" πŸ’–

for instance, say you're parsing the input ["foo", "bar"] on a grammar which is a sequence of strings. the attached string vector will be:

  • ["foo", "bar"] on the root pnode πŸ‘‘
  • ["foo"] on the first leaf πŸ“
  • ["bar"] on the second leaf 🧚

everybody gets a slice, no cap.

🫢 and if the parsing tree does not match (peep ec_pnode_matches() for that situation), the associated string vector is just NULL. nothing there. empty. ghosted 😭

✨ RETURN VALUE ✨

she returns the string vector associated with the parsing node πŸ’œ

or NULL if:

  • the node is not yet parsed β€” this happens when you're building the parsing tree, so like, she's still under construction bestie 🚧
  • the parsing tree does not match the input πŸ’€

✨ SEE ALSO ✨

the whole friend group, fr fr β€” go read these too:


Copyright (C) 2010-2026 Olivier Matz, Robin Jarry. πŸ’–


and that's the whole page, bestie!! 🌈 this lil beauty is from libecoli, dated 2026-06-11, and honestly? she ate. go parse something iconic. periodt βœ¨πŸ’…

πŸ“¦ where this page comes from