EC_NODE_RE_LEX_ADD(3)

πŸ“¦
version 0.11.7 Β· 4 versions
, in fedora 44

πŸ’– EC_NODE_RE_LEX_ADD(3) πŸ’–

okay bestie, welcome to the Libecoli Programmer's Manual β€” this is the page for ec_node_re_lex_add, and yes it's a 3, so it's a library function, we're in C territory, hydrate and let's go 🫢


✨ NAME ✨

ec_node_re_lex_add β€” bestie, this is literally the function that adds a token pattern to a regex lexer node. that's the whole job. that's the assignment. slay πŸ’…


🌸 SYNOPSIS 🌸

#include <ecoli/node_re_lex.h>

int ec_node_re_lex_add(
    struct ec_node   *gen_node,   /* The regex lexer node. */
    /*
     * The regular expression pattern for matching tokens.
     */
    const char       *pattern,
    /*
     * If non-zero, include matched tokens in the output; if zero, discard
     * them.
     */
    int               keep,
    /*
     * Optional attribute name to attach to matched tokens, or NULL.
     */
    const char       *attr_name
);

so you're passing in gen_node β€” that's the regex lexer node itself, the main character πŸ‘‘ β€” then pattern, which is the regular expression pattern used for matching tokens, then keep, and attr_name. four things. you got this fr fr.


πŸ”₯ RETURN VALUE πŸ”₯

  • 0 β€” success!! you ate, no crumbs, we love to see it ✨
  • -1 β€” error 😭 and errno is set, so go check it, the answer is in there, i promise
not me being dramatic but like β€” always check the return value, bestie. -1 is not a vibe, it's a warning 🚨

πŸ¦‹ SEE ALSO πŸ¦‹

  • ec_node_re_lex(3) β€” the sibling page, the whole lexer node situation, go read it next, iykyk πŸ’œ

Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.


and that's the whole page, periodt ✨ this was the libecoli manual, dated 2026-06-11 β€” mwah, take care of yourself, drink water, and may all your errnos be zero πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from