diff options
Diffstat (limited to 'src/include/tree.h')
-rw-r--r-- | src/include/tree.h | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/include/tree.h b/src/include/tree.h index 88287a4..a240a18 100644 --- a/src/include/tree.h +++ b/src/include/tree.h @@ -3,27 +3,30 @@ #include <stdlib.h> -typedef struct TREE_STRUC { +typedef enum { + LEAF_TYPE_INT, + LEAF_TYPE_STR, +} leaf_t; + +typedef struct ARG_T_STRUCT { + leaf_t type; + char* id; + struct ARG_T_STRUCT* nxt; +} arg_t; + +typedef struct TREE_T_STRUCT { enum TREE_TYPE { - TREE_TYPE_INT, - TREE_TYPE_STR, TREE_TYPE_DEF, TREE_TYPE_CAL, - TREE_TYPE_COND, } type; union { struct { - int val; - } tree_int_t; - - struct { - char* val; - } tree_str_t; - - struct { + leaf_t type; char* id; - } tree_def_t; + arg_t* arg; + struct TREE_T_STRUCT* val; + } tree_def; } data; } tree_t; |