blob: a577095f353e714d697869806233fcfde5f93bc8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#ifndef _H_GRAPHS
#define _H_GRAPHS
#include <stdbool.h>
#include "syntax.h"
typedef enum {
NODE_INT, /* See expr_kind in syntax.h */
NODE_NAME,
NODE_CODE,
NODE_LIST,
NODE_TUPLE,
NODE_APP,
NODE_REDIRECT /* Redirect to another node */
} node_kind;
struct node {
node_kind kind;
void* var1;
void* var2;
unsigned int used_count;
};
void use_node(struct node* node, unsigned int count);
void free_node(struct node* node, unsigned int count, bool free_first);
void remove_redirects(struct node *node);
void cpy_expression_to_node(struct node* dst, expression* src);
void cpy_node_to_expression(expression* dst, struct node* src);
#endif
|