#ifndef RZ_NODE_H #define RZ_NODE_H #include "commons.h" #define NODE_TYPE(G) \ G(NODE_MOD), \ G(NODE_NUM), \ G(NODE_BOOL), \ G(NODE_STR) RZ_ENUM_H(NodeType, NODE_TYPE); typedef struct { NodeType type; str_t value; int line; struct { struct node_t** data; size_t size; size_t cap; } children; } node_t; void node_init(node_t* node, NodeType type, char* value, int line); void node_free(node_t* node); void node_add_child(node_t* node, node_t* child); size_t node_str(node_t* node, char* buffer, size_t size); #endif