diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/tree.h | 25 |
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 |