lang: ast: implement ast iteration

iteration is implementing without recursion, instead using type-specific callbacks to construct a queue of nodes to iterate through. ast priting is implemented using this functionality.
This commit is contained in:
2024-11-24 20:50:12 +00:00
parent 5622073252
commit 1e7e73db21
7 changed files with 188 additions and 7 deletions

9
lang/ast/iterate.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef _AST_ITERATE_H_
#define _AST_ITERATE_H_
extern void ast_node_iterator_enqueue_node(
struct ivy_ast_node_iterator *it,
struct ivy_ast_node *parent,
struct ivy_ast_node *node);
#endif