$darkmode
Herb C Reference
ast_node.h
Go to the documentation of this file.
1 #ifndef HERB_AST_H
2 #define HERB_AST_H
3 
4 #include "ast_nodes.h"
5 #include "errors.h"
6 #include "position.h"
7 #include "token_struct.h"
8 
9 void ast_node_init(AST_NODE_T* node, ast_node_type_T type, position_T* start, position_T* end, array_T* errors);
10 void ast_node_free(AST_NODE_T* node);
11 
13 
14 size_t ast_node_sizeof(void);
16 
18 
20 
21 void ast_node_set_start(AST_NODE_T* node, position_T* position);
22 void ast_node_set_end(AST_NODE_T* node, position_T* position);
23 
24 size_t ast_node_errors_count(const AST_NODE_T* node);
25 array_T* ast_node_errors(const AST_NODE_T* node);
26 void ast_node_append_error(const AST_NODE_T* node, ERROR_T* error);
27 
28 void ast_node_set_start_from_token(AST_NODE_T* node, const token_T* token);
29 void ast_node_set_end_from_token(AST_NODE_T* node, const token_T* token);
30 
31 void ast_node_set_positions_from_token(AST_NODE_T* node, const token_T* token);
32 
33 bool ast_node_is(const AST_NODE_T* node, ast_node_type_T type);
34 
35 #endif
size_t ast_node_errors_count(const AST_NODE_T *node)
Definition: ast_node.c:42
void ast_node_set_end(AST_NODE_T *node, position_T *position)
Definition: ast_node.c:60
void ast_node_set_start_from_token(AST_NODE_T *node, const token_T *token)
Definition: ast_node.c:66
ast_node_type_T ast_node_type(const AST_NODE_T *node)
Definition: ast_node.c:38
AST_LITERAL_NODE_T * ast_literal_node_init_from_token(const token_T *token)
Definition: ast_node.c:28
array_T * ast_node_errors(const AST_NODE_T *node)
Definition: ast_node.c:46
void ast_node_free(AST_NODE_T *node)
Definition: ast_nodes.c:976
void ast_node_set_start(AST_NODE_T *node, position_T *position)
Definition: ast_node.c:54
size_t ast_node_sizeof(void)
Definition: ast_node.c:11
size_t ast_node_child_count(AST_NODE_T *node)
void ast_node_append_error(const AST_NODE_T *node, ERROR_T *error)
Definition: ast_node.c:50
void ast_node_set_positions_from_token(AST_NODE_T *node, const token_T *token)
Definition: ast_node.c:74
void ast_node_set_end_from_token(AST_NODE_T *node, const token_T *token)
Definition: ast_node.c:70
void ast_node_init(AST_NODE_T *node, ast_node_type_T type, position_T *start, position_T *end, array_T *errors)
Definition: ast_node.c:15
bool ast_node_is(const AST_NODE_T *node, ast_node_type_T type)
Definition: ast_node.c:79
char * ast_node_name(AST_NODE_T *node)
ast_node_type_T
Definition: ast_nodes.h:18
Definition: array.h:6
Definition: ast_nodes.h:65
Definition: ast_nodes.h:52
Definition: errors.h:26
Definition: position.h:6
Definition: token_struct.h:51