From 05f3cde3e7924c9ffcc1937661b3cc290d89c11a Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 7 Sep 2024 17:53:27 +0200 Subject: Initial bootstrap --- inc/term.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 inc/term.h (limited to 'inc/term.h') diff --git a/inc/term.h b/inc/term.h new file mode 100644 index 0000000..78eb047 --- /dev/null +++ b/inc/term.h @@ -0,0 +1,29 @@ +// Copyright (c) 2024, Marvin Borner +// SPDX-License-Identifier: MIT + +#ifndef TERM_H +#define TERM_H + +#include + +typedef enum { INV, ABS, APP, IDX } TermType; + +typedef struct term { + TermType type; + union { + struct { + struct term *body; + } abs; + struct { + struct term *lhs; + struct term *rhs; + } app; + size_t index; + } u; +} Term; + +struct term *term_new(TermType type); +void term_free(Term *term); +void term_diff(Term *a, Term *b); + +#endif -- cgit v1.2.3