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: π«Ά
ec_node_check_type(3)ec_node_iter(3)ec_node_attrs(3)ec_node_find(3)ec_node_type_name(3)ec_node_free(3)ec_node_id(3)ec_node_type_dump(3)ec_node_get_config(3)ec_node_schema_dump(3)ec_node_priv(3)ec_node_type_lookup(3)ec_node_clone(3)ec_node_dump(3)ec_node_desc(3)ec_node_iter_free(3)ec_node_iter_get_parent(3)ec_node_type(3)ec_node_iter_next(3)ec_node_type_schema(3)ec_node(3)ec_node_get_children_count(3)ec_node_get_type_name(3)ec_node_type_register(3)ec_node_set_config(3)ec_node_iter_get_node(3)ec_node_get_child(3)
π COPYRIGHT π
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
- 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