lang: ast: add stub functions for retrieving, printing, interating, and destroying ast nodes
This commit is contained in:
@@ -59,9 +59,17 @@ enum ivy_ast_msgh_recipient_type {
|
||||
IVY_AST_MSGH_CLASS,
|
||||
};
|
||||
|
||||
struct ivy_ast_node_iterable {
|
||||
b_queue_entry it_entry;
|
||||
unsigned int it_depth;
|
||||
};
|
||||
|
||||
typedef enum ivy_status(*ivy_ast_node_iteration_callback)(struct ivy_ast_node *, unsigned int);
|
||||
|
||||
struct ivy_ast_node {
|
||||
enum ivy_ast_node_type n_type;
|
||||
b_queue_entry n_entry;
|
||||
struct ivy_ast_node_iterable n_it;
|
||||
};
|
||||
|
||||
struct ivy_ast_unit_node {
|
||||
@@ -230,10 +238,15 @@ IVY_API enum ivy_status ivy_parser_create(struct ivy_parser **parser);
|
||||
IVY_API void ivy_parser_destroy(struct ivy_parser *parser);
|
||||
|
||||
IVY_API enum ivy_status ivy_parser_get_status(struct ivy_parser *parser);
|
||||
IVY_API bool ivy_parser_is_node_complete(struct ivy_parser *parser);
|
||||
IVY_API struct ivy_ast_node *ivy_parser_root_node(struct ivy_parser *parser);
|
||||
IVY_API struct ivy_ast_node *ivy_parser_dequeue_node(struct ivy_parser *parser);
|
||||
|
||||
IVY_API enum ivy_status ivy_parser_push_token(
|
||||
struct ivy_parser *parser, struct ivy_token *tok);
|
||||
|
||||
IVY_API void ivy_ast_node_iterate(struct ivy_ast_node *node);
|
||||
IVY_API void ivy_ast_node_print(struct ivy_ast_node *node);
|
||||
IVY_API void ivy_ast_node_destroy(struct ivy_ast_node *node);
|
||||
|
||||
IVY_API const char *ivy_ast_node_type_to_string(enum ivy_ast_node_type v);
|
||||
|
||||
Reference in New Issue
Block a user