lang: ast: implement node, parser, and parser state management

This commit is contained in:
2024-11-23 19:28:03 +00:00
parent b630aa009c
commit ed35011931
3 changed files with 153 additions and 4 deletions

View File

@@ -4,9 +4,14 @@
#include <blue/core/queue.h>
#include <ivy/status.h>
struct ivy_parser_state {
struct parser_state {
b_queue_entry s_entry;
struct ivy_ast_node *s_parent;
struct ivy_ast_node *s_node;
};
struct unit_parser_state {
struct parser_state s_base;
};
struct ivy_parser {
@@ -16,4 +21,9 @@ struct ivy_parser {
b_queue p_node_queue;
};
struct ast_node_ops {
enum ivy_status(*n_add_child)(struct ivy_ast_node *, struct ivy_ast_node *);
void(*n_print)(struct ivy_ast_node *);
};
#endif