aboutsummaryrefslogtreecommitdiff
path: root/include/ast.h
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-20 11:31:50 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-20 11:31:50 +0200
commit9cf524df8c94920d7c7058692f2f83a95a4006e0 (patch)
tree526853cc7f935745bf703cbfaf7e5ebe7d32017e /include/ast.h
parent3829a704150a06b2767d542b39179377a592da0f (diff)
downloadimp-9cf524df8c94920d7c7058692f2f83a95a4006e0.tar.gz
imp-9cf524df8c94920d7c7058692f2f83a95a4006e0.zip
hashmap for context
Diffstat (limited to 'include/ast.h')
-rw-r--r--include/ast.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/ast.h b/include/ast.h
index 9c6b6bd..c619c72 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -1,6 +1,7 @@
#ifndef AST_H
#define AST_H
+
typedef enum {
NT_SKIP, NT_ASSIGN, NT_SEQ, NT_IF, NT_WHILE,
NT_INT, NT_VAR, NT_AOP, NT_BOP, NT_NOT, NT_ROP
@@ -26,6 +27,7 @@ typedef struct ASTNode {
} u;
} ASTNode;
+
ASTNode *ast_skip(void);
ASTNode *ast_assign(ASTNode *var, ASTNode *aexp);
ASTNode *ast_seq(ASTNode *stm1, ASTNode *stm2);
@@ -38,7 +40,7 @@ ASTNode *ast_bop(BOp bop, ASTNode *bexp1, ASTNode *bexp2);
ASTNode *ast_not(ASTNode *bexp);
ASTNode *ast_rop(ROp rop, ASTNode *aexp1, ASTNode *aexp2);
-void free_ast(ASTNode *node);
+void ast_free(ASTNode *node);
#endif