Herb C Reference
Loading...
Searching...
No Matches
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#include "util/hb_allocator.h"
9
10void ast_node_init(AST_NODE_T* node, ast_node_type_T type, position_T start, position_T end, hb_array_T* errors);
11void ast_node_free(AST_NODE_T* node, hb_allocator_T* allocator);
12
13AST_LITERAL_NODE_T* ast_literal_node_init_from_token(const token_T* token, hb_allocator_T* allocator);
14
15size_t ast_node_sizeof(void);
17
19
21
22void ast_node_set_start(AST_NODE_T* node, position_T position);
23void ast_node_set_end(AST_NODE_T* node, position_T position);
24
25size_t ast_node_errors_count(const AST_NODE_T* node);
26hb_array_T* ast_node_errors(const AST_NODE_T* node);
27void ast_node_append_error(const AST_NODE_T* node, ERROR_T* error);
28
29void ast_node_set_start_from_token(AST_NODE_T* node, const token_T* token);
30void ast_node_set_end_from_token(AST_NODE_T* node, const token_T* token);
31
33
34bool ast_node_is(const AST_NODE_T* node, ast_node_type_T type);
35
36AST_NODE_T* find_erb_content_at_offset(AST_DOCUMENT_NODE_T* document, const char* source, size_t offset);
37
38#endif
size_t ast_node_errors_count(const AST_NODE_T *node)
Definition ast_node.c:47
AST_LITERAL_NODE_T * ast_literal_node_init_from_token(const token_T *token, hb_allocator_T *allocator)
Definition ast_node.c:31
void ast_node_set_start_from_token(AST_NODE_T *node, const token_T *token)
Definition ast_node.c:67
ast_node_type_T ast_node_type(const AST_NODE_T *node)
Definition ast_node.c:43
void ast_node_set_end(AST_NODE_T *node, position_T position)
Definition ast_node.c:63
hb_array_T * ast_node_errors(const AST_NODE_T *node)
Definition ast_node.c:51
void ast_node_init(AST_NODE_T *node, ast_node_type_T type, position_T start, position_T end, hb_array_T *errors)
Definition ast_node.c:17
size_t ast_node_sizeof(void)
Definition ast_node.c:13
size_t ast_node_child_count(AST_NODE_T *node)
AST_NODE_T * find_erb_content_at_offset(AST_DOCUMENT_NODE_T *document, const char *source, size_t offset)
Definition ast_node.c:102
void ast_node_append_error(const AST_NODE_T *node, ERROR_T *error)
Definition ast_node.c:55
void ast_node_set_positions_from_token(AST_NODE_T *node, const token_T *token)
Definition ast_node.c:75
void ast_node_set_start(AST_NODE_T *node, position_T position)
Definition ast_node.c:59
void ast_node_free(AST_NODE_T *node, hb_allocator_T *allocator)
Definition ast_nodes.c:1128
void ast_node_set_end_from_token(AST_NODE_T *node, const token_T *token)
Definition ast_node.c:71
char * ast_node_name(AST_NODE_T *node)
bool ast_node_is(const AST_NODE_T *node, ast_node_type_T type)
Definition ast_node.c:80
ast_node_type_T
Definition ast_nodes.h:20
Definition ast_nodes.h:65
Definition ast_nodes.h:70
Definition ast_nodes.h:57
Definition errors.h:41
Definition position.h:8
Definition token_struct.h:57