diff options
author | Thing1 <thing1@seacrossedlovers.xyz> | 2024-08-29 15:01:34 +0100 |
---|---|---|
committer | Thing1 <thing1@seacrossedlovers.xyz> | 2024-08-29 15:01:34 +0100 |
commit | d28f618c0e4c3da57c856a31d9ce3003a086e7ed (patch) | |
tree | 9edb35867649ba55268f40591015f4ff226f5abf /comp/lucas-standen-NEA/code2/debug.c | |
parent | cfdd3c90877b59dc674cc9f68c0b7b4bb7c14ba8 (diff) |
finished the new tokenizer
Diffstat (limited to 'comp/lucas-standen-NEA/code2/debug.c')
-rw-r--r-- | comp/lucas-standen-NEA/code2/debug.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/comp/lucas-standen-NEA/code2/debug.c b/comp/lucas-standen-NEA/code2/debug.c new file mode 100644 index 0000000..3d2d75b --- /dev/null +++ b/comp/lucas-standen-NEA/code2/debug.c @@ -0,0 +1,24 @@ +#include <stdio.h> +#include "tokenizer.h" + +#include "util.h" + +void printAST(astNode *head){ + printf("\n>>>\nfunc: %s\n", head->func); + printf("args: "); + for (int i = 0; i < 8; i++){ + if (head->children[i] == NULL && head->args[i] == NULL){ + printf("<<<"); + return; + } + + if (head->args[i] != NULL){ + printf("%s ", head->args[i]); + } + if (head->children[i] != NULL){ + printAST(head->children[i]); + } + + } + printf("\n"); +} |