blob: 9823fc112e992bc2bb3e79332ae8de586437f728 (
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
|
// Copyright (c) 2024, Marvin Borner <dev@marvinborner.de>
// SPDX-License-Identifier: MIT
#ifndef BLOCADE_TERM_H
#define BLOCADE_TERM_H
#include <stddef.h>
typedef enum { INV, ABS, APP, VAR, REF } term_type;
struct term {
term_type type;
union {
struct {
struct term *term;
} abs;
struct {
struct term *lhs;
struct term *rhs;
} app;
struct {
int index;
} var;
struct {
size_t index;
} ref;
} u;
};
struct term *new_term(term_type type);
void free_term(struct term *term);
#endif
|