gemstone/tests/ast/print_node.c

24 lines
403 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>
int main(void) {
2024-05-08 11:49:06 +00:00
AST_init();
2024-05-30 19:43:14 +00:00
const AST_NODE_PTR node = AST_new_node(empty_location(), 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
}