aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authors-over-42023-06-23 01:07:48 -0400
committers-over-42023-06-23 01:07:48 -0400
commit76e952ec1756deae78d9a88a67b97eff3550959e (patch)
tree6922d0f97dc89e3961393dca7660125e34b62a97 /src/include
parent0bc9c5bd16475f0d855e5929ea39b2f601564556 (diff)
basic tree init/destroy
Diffstat (limited to 'src/include')
-rw-r--r--src/include/tree.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/include/tree.h b/src/include/tree.h
index 06f4ee3..4ffefcf 100644
--- a/src/include/tree.h
+++ b/src/include/tree.h
@@ -7,22 +7,35 @@ typedef struct TREE_STRUC {
enum {
TREE_DEF,
TREE_CALL,
- TREE_STRING,
- TREE_INT,
+ TREE_TYPE_STR,
+ TREE_TYPE_INT,
} type;
union {
- struct def {
+ struct { // === DEFINITIONS ===
char* name; // name of definition
int mutability; // mutability of definition
struct TREE_STRUC* value; // value of definition
- };
+ } def;
- struct call {
+ struct { // === CALLS ===
char* target; // name of definition being called
struct TREE_STRUC** args; // arguments passed to definition
- };
+ size_t args_size; // size of arguments
+ } call;
+
+ // === TYPES ===
+ struct { // strings
+ char* value;
+ } type_str;
+
+ struct { // integers
+ int* value;
+ } type_int;
} data;
} tree_t;
+tree_t* tree_init(int type);
+void tree_destroy(tree_t*);
+
#endif