the caller can now specify whether the nodes should be printed in pre-order or post-order, and whether the output should be indented.
28 lines
537 B
C
28 lines
537 B
C
#ifndef DEBUG_H_
|
|
#define DEBUG_H_
|
|
|
|
#include <ivy/status.h>
|
|
#include <stdbool.h>
|
|
|
|
struct ivy_token;
|
|
struct ivy_asm_token;
|
|
|
|
struct ivy_ast_node;
|
|
struct ivy_ast_node_iterator;
|
|
|
|
enum ivy_ast_iteration_type;
|
|
|
|
struct print_ast_node_args {
|
|
bool indent;
|
|
bool postorder;
|
|
};
|
|
|
|
extern void print_lex_token(struct ivy_token *tok);
|
|
extern void print_asm_lex_token(struct ivy_asm_token *tok);
|
|
|
|
extern enum ivy_status print_ast_node(
|
|
struct ivy_ast_node *node, enum ivy_ast_iteration_type type,
|
|
struct ivy_ast_node_iterator *it, void *arg);
|
|
|
|
#endif
|