diff options
author | c+1 | 2023-10-21 09:10:58 -0400 |
---|---|---|
committer | c+1 | 2023-10-21 09:10:58 -0400 |
commit | 6fc8f91e0d96ae4b4ee59ea562574cc04fdf8abf (patch) | |
tree | f7e1a8041f2808eecc60cae54f5dda3f85850c32 /src/include/tree.h | |
parent | cc7bb40ae5e7f8f345195547b2c5044efc4d61ba (diff) |
⬣
Diffstat (limited to 'src/include/tree.h')
-rw-r--r-- | src/include/tree.h | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/src/include/tree.h b/src/include/tree.h index a2b71da..88287a4 100644 --- a/src/include/tree.h +++ b/src/include/tree.h @@ -4,44 +4,26 @@ #include <stdlib.h> typedef struct TREE_STRUC { - enum { - TREE_COMP, - TREE_DEF, - TREE_CALL, - TREE_TYPE_STR, + enum TREE_TYPE { TREE_TYPE_INT, + TREE_TYPE_STR, + TREE_TYPE_DEF, + TREE_TYPE_CAL, + TREE_TYPE_COND, } type; union { - struct { // === "COMPOUND" === - struct TREE_STRUC** value; - size_t size; - } comp; - - struct { // === DEFINITIONS === - char* type; // the definition type - char** tags; // the definition tags - size_t tags_size; // the number of tags - char* name; // the definition name - struct TREE_STRUC** args; // the arguments the definition will accept - size_t args_size; // the number of arguments - struct TREE_STRUC* value; // value of definition - } def; - - struct { // === CALLS === - char* target; // name of definition being called - struct TREE_STRUC** args; // arguments passed to definition - size_t args_size; // the number of arguments - } call; + struct { + int val; + } tree_int_t; - // === TYPES === - struct { // strings - char* value; - } type_str; + struct { + char* val; + } tree_str_t; - struct { // integers - int value; - } type_int; + struct { + char* id; + } tree_def_t; } data; } tree_t; |