void freeSyntaxTree(SyntaxTree *root) { if (root == NULL) return; freeSyntaxTree(root->next); freeSyntaxTree(root->firstChild); free(root); }
program_node *parse(token_list *tlist){ (void) asdads; //for not causing warning about unused variable global_tlist = tlist; /* * this is for passing error pointer value to memory.o */ freeSyntaxTree(NULL, error); return program(); }