blob: a77f144a73e4ba77e8929efca79a9f9d8b0d159f (
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
|
#ifndef TERM_H
#define TERM_H
typedef enum { INV, ABS, APP, VAR, CLO, CACHE } term_type;
struct term {
term_type type;
union {
struct {
int name;
struct term *term;
} abs;
struct {
struct term *lhs;
struct term *rhs;
} app;
struct {
int name;
enum { BRUIJN_INDEX, BARENDREGT_VARIABLE } type;
} var;
void *other;
} u;
};
struct term *new_term(term_type type);
void print_term(struct term *term);
void free_term(struct term *term);
#endif
|