skopy/lib/include/node.h

28 lines
493 B
C
Raw Normal View History

2024-03-31 21:10:56 +00:00
#ifndef SK_NODE_H
#define SK_NODE_H
#include "commons.h"
#define NODE_KIND(G) \
G(NODE_ROOT), \
G(NODE_INT)
SK_ENUM_H(NodeKind, NODE_KIND);
struct node
{
NodeKind kind;
struct vec children;
struct token* token;
};
void node_init(struct node* self,
NodeKind kind,
struct token* token);
void node_free(struct node* self);
void node_push_new_child(struct node* self, struct node* child);
void node_str(struct node* self, struct str* dest);
#endif