work on type inference some more
[ccc.git] / ast.h
diff --git a/ast.h b/ast.h
index db69333..635d0c8 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -5,6 +5,7 @@
 #include <stdbool.h>
 
 #include "util.h"
+#include "type.h"
 struct ast;
 #include "parse.h"
 
@@ -32,20 +33,6 @@ struct fundecl {
        struct stmt **body;
 };
 
-enum basictype {btbool, btchar, btint, btvoid};
-struct type {
-       enum {tbasic,tlist,ttuple,tvar} type;
-       union {
-               enum basictype tbasic;
-               struct type *tlist;
-               struct {
-                       struct type *l;
-                       struct type *r;
-               } ttuple;
-               char *tvar;
-       } data;
-};
-
 struct decl {
        //NOTE: DON'T CHANGE THIS ORDER
        enum {dcomp, dvardecl, dfundecl} type;
@@ -158,18 +145,12 @@ struct expr *expr_tuple(struct expr *left, struct expr *right);
 struct expr *expr_string(char *str);
 struct expr *expr_unop(enum unop op, struct expr *l);
 
-struct type *type_basic(enum basictype type);
-struct type *type_list(struct type *type);
-struct type *type_tuple(struct type *l, struct type *r);
-struct type *type_var(char *ident);
-
 void ast_print(struct ast *, FILE *out);
 void vardecl_print(struct vardecl *decl, int indent, FILE *out);
 void fundecl_print(struct fundecl *decl, FILE *out);
 void decl_print(struct decl *ast, FILE *out);
 void stmt_print(struct stmt *ast, int indent, FILE *out);
 void expr_print(struct expr *ast, FILE *out);
-void type_print(struct type *type, FILE *out);
 
 void ast_free(struct ast *);
 void vardecl_free(struct vardecl *decl);
@@ -177,6 +158,5 @@ void fundecl_free(struct fundecl *fundecl);
 void decl_free(struct decl *ast);
 void stmt_free(struct stmt *ast);
 void expr_free(struct expr *ast);
-void type_free(struct type *type);
 
 #endif