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(
11 AST_NODE_T* node,
12 ast_node_type_T type,
13 position_T start,
14 position_T end,
15 hb_array_T* errors,
16 hb_allocator_T* allocator
17);
18void ast_node_free(AST_NODE_T* node, hb_allocator_T* allocator);
19
20AST_LITERAL_NODE_T* ast_literal_node_init_from_token(const token_T* token, hb_allocator_T* allocator);
21
22size_t ast_node_sizeof(void);
24
26
27void ast_node_set_start(AST_NODE_T* node, position_T position);
28void ast_node_set_end(AST_NODE_T* node, position_T position);
29
30size_t ast_node_errors_count(const AST_NODE_T* node);
31hb_array_T* ast_node_errors(const AST_NODE_T* node);
32void ast_node_append_error(const AST_NODE_T* node, ERROR_T* error);
33
34void ast_node_set_start_from_token(AST_NODE_T* node, const token_T* token);
35void ast_node_set_end_from_token(AST_NODE_T* node, const token_T* token);
36
38
39bool ast_node_is(const AST_NODE_T* node, ast_node_type_T type);
40
41AST_NODE_T* find_erb_content_at_offset(AST_DOCUMENT_NODE_T* document, const char* source, size_t offset);
42
43#endif
size_t ast_node_errors_count(const AST_NODE_T *node)
Definition ast_node.c:55
AST_LITERAL_NODE_T * ast_literal_node_init_from_token(const token_T *token, hb_allocator_T *allocator)
Definition ast_node.c:39
void ast_node_init(AST_NODE_T *node, ast_node_type_T type, position_T start, position_T end, hb_array_T *errors, hb_allocator_T *allocator)
Definition ast_node.c:18
void ast_node_set_start_from_token(AST_NODE_T *node, const token_T *token)
Definition ast_node.c:75
ast_node_type_T ast_node_type(const AST_NODE_T *node)
Definition ast_node.c:51
void ast_node_set_end(AST_NODE_T *node, position_T position)
Definition ast_node.c:71
hb_array_T * ast_node_errors(const AST_NODE_T *node)
Definition ast_node.c:59
size_t ast_node_sizeof(void)
Definition ast_node.c:14
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:110
void ast_node_append_error(const AST_NODE_T *node, ERROR_T *error)
Definition ast_node.c:63
void ast_node_set_positions_from_token(AST_NODE_T *node, const token_T *token)
Definition ast_node.c:83
void ast_node_set_start(AST_NODE_T *node, position_T position)
Definition ast_node.c:67
void ast_node_free(AST_NODE_T *node, hb_allocator_T *allocator)
Definition ast_nodes.c:1226
void ast_node_set_end_from_token(AST_NODE_T *node, const token_T *token)
Definition ast_node.c:79
bool ast_node_is(const AST_NODE_T *node, ast_node_type_T type)
Definition ast_node.c:88
ast_node_type_T
Definition ast_nodes.h:20
Definition ast_nodes.h:69
Definition ast_nodes.h:74
Definition ast_nodes.h:61
Definition errors.h:42
Definition position.h:8
Definition token_struct.h:58