#ifndef BDL_NODES_H #define BDL_NODES_H typedef enum NodeType { NODE_BUILTIN, NODE_NUMBER, NODE_BOOL, NODE_STRING, NODE_SYMBOL, NODE_DEF, NODE_SET, } NodeType; typedef struct Node { NodeType type; union { // Numbers. struct { bool negative; size_t integral; size_t fractional; } number; // String/symbol. StringView string; // Boolean. bool boolean; // Builtin primitive. struct { TokenType type; struct Node **args; } builtin; // Variable definition. struct { struct Node *symbol; struct Node *value; StringView type; } def; struct { struct Node *symbol; struct Node *value; } set; }; } Node; #endif // BDL_NODES_H