// Copyright (c) 2023, Marvin Borner // SPDX-License-Identifier: MIT #ifndef CALM_PARSE_H #define CALM_PARSE_H #include typedef enum { INV, ABS, APP, VAR } term_type_t; struct term { term_type_t type; hash_t hash; size_t refs; size_t depth; union { struct { struct term *term; } abs; struct { struct term *lhs; struct term *rhs; } app; struct { int index; } var; } u; }; struct term_handle { struct term *term; hash_t hash; }; struct term_handle parse_blc(char **term, size_t depth); int parse_get_max_depth(void); #endif