aboutsummaryrefslogtreecommitdiff
path: root/interpreter/graphs.h
diff options
context:
space:
mode:
authorCamil Staps2016-08-29 19:55:21 +0200
committerCamil Staps2016-08-29 19:55:21 +0200
commitc62d7748aace9ae1234c53703fe8231236c9e123 (patch)
treec0c6c6017914cfe9b3b8995759a454564bb6faf3 /interpreter/graphs.h
parentmatch EXPR_APP (diff)
Currying arguments and Code applications
Diffstat (limited to 'interpreter/graphs.h')
-rw-r--r--interpreter/graphs.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/interpreter/graphs.h b/interpreter/graphs.h
new file mode 100644
index 0000000..07ca663
--- /dev/null
+++ b/interpreter/graphs.h
@@ -0,0 +1,26 @@
+#ifndef _H_GRAPHS
+#define _H_GRAPHS
+
+#include "syntax.h"
+
+struct node {
+ expr_kind kind;
+ void* var1;
+ void* var2;
+ unsigned int used_count;
+};
+
+typedef struct {
+ unsigned int length;
+ struct node* nodes[1];
+} nodes_array;
+
+void use_node(struct node* node, unsigned int count);
+void free_node(struct node* node, unsigned free_first);
+
+nodes_array* push_node(nodes_array* nodes, struct node* node);
+
+void cpy_expression_to_node(struct node* dst, expression* src);
+void cpy_node_to_expression(expression* dst, struct node* src);
+
+#endif