aboutsummaryrefslogtreecommitdiff
path: root/include/cu/actualize.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-04-01 10:53:44 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-04-01 10:53:44 +0300
commitad18c24e7223b1c0d48a20ba9b618c4eaf1e3a84 (patch)
tree86f3cba0b5b4bf4b7e49b96ceb61bec8b0be2780 /include/cu/actualize.h
parentb8211cda90f8a9cb14657d3328cfa9ec78722c5c (diff)
downloadek-ad18c24e7223b1c0d48a20ba9b618c4eaf1e3a84.tar.gz
ek-ad18c24e7223b1c0d48a20ba9b618c4eaf1e3a84.zip
fix gitignore
Diffstat (limited to 'include/cu/actualize.h')
-rw-r--r--include/cu/actualize.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/cu/actualize.h b/include/cu/actualize.h
new file mode 100644
index 0000000..ea736ac
--- /dev/null
+++ b/include/cu/actualize.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+
+#ifndef ANALYZE_H
+#define ANALYZE_H
+
+#include <assert.h>
+
+#include "ast.h"
+#include "scope.h"
+
+int types_match(struct ast_node *a, struct ast_node *b);
+
+/* these three might be better off in some ast_utils.c or something */
+void replace_type(struct ast_node *type,
+ struct ast_node *from, struct ast_node *to);
+
+void replace_param_types(struct ast_node *param,
+ struct ast_node *param_type,
+ struct ast_node *arg_type);
+
+void init_template_type(struct ast_node *type, struct ast_node *param_type,
+ struct ast_node *arg_type);
+void init_template_types(struct ast_node *param, struct ast_node *param_type,
+ struct ast_node *arg_type);
+
+struct ast_node *extract_template(struct ast_node *type);
+struct ast_node *extract_typeof(struct ast_node *type);
+
+int analyze_root(struct scope *scope, struct ast_node *tree);
+int actualize_main(struct scope *scope);
+int actualize_temp_type(struct scope *scope, struct ast_node *type);
+
+#endif /* ANALYZE_H */