aboutsummaryrefslogtreecommitdiff
path: root/src/include/tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/tree.h')
-rw-r--r--src/include/tree.h46
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;