diff options
Diffstat (limited to 'src/compiler/ast-tree.h')
-rw-r--r-- | src/compiler/ast-tree.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/compiler/ast-tree.h b/src/compiler/ast-tree.h index 0d63252..7ee62ff 100644 --- a/src/compiler/ast-tree.h +++ b/src/compiler/ast-tree.h @@ -71,6 +71,7 @@ typedef enum AstTreeToken { AST_TREE_TOKEN_TYPE_SHAPE_SHIFTER, AST_TREE_TOKEN_TYPE_C_LIBRARY, AST_TREE_TOKEN_TYPE_C_FUNCTION, + AST_TREE_TOKEN_TYPE_MACRO, AST_TREE_TOKEN_TYPE_BOOL, AST_TREE_TOKEN_VALUE_VOID, AST_TREE_TOKEN_STATIC_VARS_END = AST_TREE_TOKEN_VALUE_VOID, @@ -84,6 +85,7 @@ typedef enum AstTreeToken { AST_TREE_TOKEN_VALUE_SHAPE_SHIFTER, AST_TREE_TOKEN_VALUE_C_LIBRARY, AST_TREE_TOKEN_VALUE_C_FUNCTION, + AST_TREE_TOKEN_VALUE_MACRO, AST_TREE_TOKEN_VALUE_INT, AST_TREE_TOKEN_VALUE_FLOAT, AST_TREE_TOKEN_VALUE_BOOL, @@ -161,6 +163,7 @@ extern AstTree AST_TREE_CODE_TYPE; extern AstTree AST_TREE_NAMESPACE_TYPE; extern AstTree AST_TREE_SHAPE_SHIFTER_TYPE; extern AstTree AST_TREE_C_LIBRARY_TYPE; +extern AstTree AST_TREE_MACRO_TYPE; extern AstTree AST_TREE_VOID_VALUE; typedef struct AstTreeVariable { @@ -238,10 +241,14 @@ typedef struct AstTreeFunctionCallParam { AstTree *value; } AstTreeFunctionCallParam; +typedef struct AstTreeFunctionCallParams { + AstTreeFunctionCallParam *data; + size_t size; +} AstTreeFunctionCallParams; + typedef struct AstTreeFunctionCall { AstTree *function; - AstTreeFunctionCallParam *parameters; - size_t parameters_size; + AstTreeFunctionCallParams parameters; } AstTreeFunctionCall; typedef u64 AstTreeInt; @@ -322,7 +329,7 @@ typedef struct AstTreeNamespace { typedef struct AstTreeShapeShifter { AstTreeFunction *function; struct { - AstTreeFunctionCall **calls; + AstTreeFunctionCallParams *calls; AstTreeFunction **functions; size_t size; } generateds; @@ -354,12 +361,17 @@ typedef struct AstTreeCFunction { AstTree *funcType; } AstTreeCFunction; +typedef struct AstTreeMacro { + AstTreeFunction *function; +} AstTreeMacro; + #ifdef PRINT_COMPILE_TREE void astTreePrint(const AstTree *tree, int indent); void astTreeVariablePrint(const AstTreeVariable *variable, int indent); void astTreeRootPrint(const AstTreeRoot *root); #endif +void astTreeTypeFunctionDestroy(AstTreeTypeFunction functionType); void astTreeScopeDestroy(AstTreeScope scope); void astTreeFunctionDestroy(AstTreeFunction function); void astTreeDeleteFunctionCall(AstTreeFunctionCall *functionCall); |