33 lines
848 B
C
33 lines
848 B
C
#include "ctx.h"
|
|
#include "iterate.h"
|
|
#include "node.h"
|
|
|
|
static void collect_children(
|
|
struct ivy_ast_node *node, struct ivy_ast_node_iterator *iterator)
|
|
{
|
|
struct ivy_ast_msg_node *msg = (struct ivy_ast_msg_node *)node;
|
|
|
|
if (msg->n_recipient) {
|
|
ast_node_iterator_enqueue_node(iterator, node, msg->n_recipient);
|
|
}
|
|
|
|
if (msg->n_sel) {
|
|
ast_node_iterator_enqueue_node(
|
|
iterator, node, (struct ivy_ast_node *)msg->n_sel);
|
|
}
|
|
|
|
b_queue_entry *entry = b_queue_first(&msg->n_arg);
|
|
while (entry) {
|
|
struct ivy_ast_node *arg
|
|
= b_unbox(struct ivy_ast_node, entry, n_entry);
|
|
ast_node_iterator_enqueue_node(iterator, node, arg);
|
|
entry = b_queue_next(entry);
|
|
}
|
|
}
|
|
|
|
struct ast_node_type msg_node_ops = {
|
|
.n_collect_children = collect_children,
|
|
.n_state_size = sizeof(struct parser_state),
|
|
.n_node_size = sizeof(struct ivy_ast_msg_node),
|
|
};
|