lang: ast: implement node, parser, and parser state management
This commit is contained in:
12
lang/ast.h
12
lang/ast.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user