EC_NODE_FROM_TYPE(3)

EC_NODE_FROM_TYPE(3) πŸ’– Libecoli Programmer's Manual ✨


✨ NAME ✨

ec_node_from_type β€” bestie, this is the one that creates a brand-new node when you already know the type. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <ecoli/node.h>

struct ec_node * ec_node_from_type(
    const struct ec_node_type   *type,  /* The type of the node to create. */
    const char                  *id     /* The node identifier. */
);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: you're deep in node-constructor land and you already know which type you want. That's literally the whole point of this function. πŸ’…

The manual is very chill about it and just says: this function is typically called from the node constructor. So like β€” constructor girlies, this one's for you. 🫢


πŸŽ€ STRUCTURES πŸŽ€

So there's a struct that describes a grammar node type. Slay. πŸ‘‘

The vibe is that it's usually defined as a static const structure, living right inside the code that defines a new grammar node type. If you wanna see real-life examples, go peek at the ecoli_node_<type>.c files β€” they ate. πŸ”₯

struct ec_node_type {
};
Note: that's the whole struct body as documented here, bestie. Empty. Not a typo on my part, that's genuinely what the page says. πŸ’€

⭐ RETURN VALUE ⭐

  • Success: you get the new node. πŸŽ‰
  • Error: you get NULL. 😭

That's it, that's the deal.


πŸ’œ SEE ALSO πŸ’œ

The friend group, in the exact order the page introduced them: 🫢


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


okay that's the whole page bestie, ily, go build some nodes πŸŽ€βœ¨πŸ¦‹ β€” this was libecoli, dated 2026-06-11, and yes the manual section is 3 because we're fancy like that. periodt. πŸ’…πŸŒˆ

πŸ“¦ where this page comes from