gemstone/tests/ast/print_node.c

25 lines
445 B
C
Raw Normal View History

2024-05-07 13:22:52 +00:00
//
// Created by servostar on 5/7/24.
//
#include <ast/ast.h>
2024-06-05 18:00:14 +00:00
#include <mem/cache.h>
2024-05-07 13:22:52 +00:00
int main(void) {
2024-06-05 18:00:14 +00:00
mem_init();
2024-05-08 11:49:06 +00:00
AST_init();
2024-07-02 14:43:59 +00:00
const AST_NODE_PTR node = AST_new_node(empty_location(NULL), 0, "value");
2024-05-07 13:22:52 +00:00
for (size_t i = 0; i < AST_ELEMENT_COUNT; i++) {
// set kind
node->kind = i;
// print symbol
printf("%ld %s\n", i, AST_node_to_string(node));
}
AST_delete_node(node);
2024-05-08 11:49:06 +00:00
return 0;
2024-05-07 13:22:52 +00:00
}