From d28f618c0e4c3da57c856a31d9ce3003a086e7ed Mon Sep 17 00:00:00 2001 From: Thing1 Date: Thu, 29 Aug 2024 15:01:34 +0100 Subject: finished the new tokenizer --- comp/lucas-standen-NEA/code2/debug.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 comp/lucas-standen-NEA/code2/debug.c (limited to 'comp/lucas-standen-NEA/code2/debug.c') 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 +#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"); +} -- cgit v1.2.3