lang: ast: convert RPN expression queue to ast and replace generic EXPR node with it

This commit is contained in:
2024-11-28 22:06:25 +00:00
parent 05ced5d5fc
commit ec24e2c327
8 changed files with 212 additions and 58 deletions

View File

@@ -4,9 +4,6 @@
#include <ivy/lang/ast.h>
#include <ivy/lang/lex.h>
#define ast_node_create(type_id, type_struct) \
((type_struct *)ast_node_create_with_size(type_id, sizeof(type_struct)))
struct parser_state;
#define PARSE_RESULT(status, flags) \
@@ -72,8 +69,7 @@ extern const struct ast_node_type *get_ast_node_type(enum ivy_ast_node_type type
extern token_parse_function get_token_parser(
struct ivy_ast_node *context, struct ivy_token *tok);
extern enum token_expr_type get_token_expr_type(struct ivy_token *tok);
extern struct ivy_ast_node *ast_node_create_with_size(
enum ivy_ast_node_type type, size_t size);
extern struct ivy_ast_node *ast_node_create(enum ivy_ast_node_type type);
extern enum ivy_status ast_node_add_child(
struct ivy_ast_node *parent, struct ivy_ast_node *child);