Kestrel Interface
Loading...
Searching...
No Matches
kest_eff_parser.h
Go to the documentation of this file.
1#ifndef KEST_PARSER_H_
2#define KEST_PARSER_H_
3
4#define KEST_EFF_PARSER_MEM_POOL_SIZE_KB 512
5
6#define KEST_AST_NODE_ROOT 0
7#define KEST_AST_NODE_SECTION 1
8#define KEST_AST_NODE_DICT 2
9
10typedef struct kest_ast_node {
11 int type;
12 int line;
13 void *data;
14
18
19struct kest_asm_line_pll;
20
21typedef struct kest_eff_parsing_state {
22 const char *fname;
23 const char *name;
24 const char *cname;
25 char *content;
27 char **lines;
28
29 int len;
32
34
37
39
40 struct kest_asm_line_pll *asm_lines;
41 kest_block_pll *blocks;
42 kest_parameter_pll *parameters;
43 kest_setting_pll *settings;
44 kest_dsp_resource_pll *resources;
45 kest_named_expression_pll *def_exprs;
46
48
50
51 int errors;
53
54extern const char *ver_str;
55
56struct kest_dictionary;
57
59
61
62void kest_parser_print_info (kest_eff_parsing_state *ps, const char *error_msg, ...);
63void kest_parser_warn(kest_eff_parsing_state *ps, const char *error_msg, ...);
64void kest_parser_error (kest_eff_parsing_state *ps, const char *error_msg, ...);
65
66void kest_parser_print_info_at (kest_eff_parsing_state *ps, kest_token_ll *token, const char *error_msg, ...);
67void kest_parser_warn_at (kest_eff_parsing_state *ps, kest_token_ll *token, const char *error_msg, ...);
68void kest_parser_error_at (kest_eff_parsing_state *ps, kest_token_ll *token, const char *error_msg, ...);
69
70void kest_parser_print_info_at_line(kest_eff_parsing_state *ps, int line, const char *error_msg, ...);
71void kest_parser_warn_at_line (kest_eff_parsing_state *ps, int line, const char *error_msg, ...);
72void kest_parser_error_at_line (kest_eff_parsing_state *ps, int line, const char *error_msg, ...);
73
74void kest_parser_print_info_at_node(kest_eff_parsing_state *ps, kest_ast_node *node, const char *error_msg, ...);
75void kest_parser_warn_at_node (kest_eff_parsing_state *ps, kest_ast_node *node, const char *error_msg, ...);
76void kest_parser_error_at_node (kest_eff_parsing_state *ps, kest_ast_node *node, const char *error_msg, ...);
77
81
82void *kest_parser_alloc(size_t size);
83char *kest_parser_strndup(const char *str, int n);
84
86
87#endif
kest_allocator * kest_parser_allocator
const char * ver_str
char * kest_parser_strndup(const char *str, int n)
void kest_parser_error_at(kest_eff_parsing_state *ps, kest_token_ll *token, const char *error_msg,...)
void kest_parser_error_at_line(kest_eff_parsing_state *ps, int line, const char *error_msg,...)
void kest_parser_error_at_node(kest_eff_parsing_state *ps, kest_ast_node *node, const char *error_msg,...)
void kest_parser_print_info(kest_eff_parsing_state *ps, const char *error_msg,...)
void kest_parser_print_info_at_line(kest_eff_parsing_state *ps, int line, const char *error_msg,...)
void kest_parser_warn_at(kest_eff_parsing_state *ps, kest_token_ll *token, const char *error_msg,...)
void kest_parser_print_info_at_node(kest_eff_parsing_state *ps, kest_ast_node *node, const char *error_msg,...)
int kest_eff_parser_reset_mempool()
void kest_parser_error(kest_eff_parsing_state *ps, const char *error_msg,...)
int kest_eff_parser_init_mempool()
int kest_parse_dictionary(kest_eff_parsing_state *ps, kest_dictionary **result, const char *name)
void kest_parser_warn(kest_eff_parsing_state *ps, const char *error_msg,...)
void kest_parser_warn_at_line(kest_eff_parsing_state *ps, int line, const char *error_msg,...)
void * kest_parser_alloc(size_t size)
kest_effect_desc * kest_read_eff_desc_from_file(char *fname)
int kest_eff_parser_deinit_mempool()
void kest_parser_warn_at_node(kest_eff_parsing_state *ps, kest_ast_node *node, const char *error_msg,...)
void kest_parser_print_info_at(kest_eff_parsing_state *ps, kest_token_ll *token, const char *error_msg,...)
struct kest_ast_node * child
struct kest_ast_node * next
const char * name
kest_effect_desc * result
kest_expr_scope * scope
kest_token_ll * current_token
kest_named_expression_pll * def_exprs
kest_dsp_resource_pll * resources
kest_block_pll * blocks
kest_parameter_pll * parameters
kest_setting_pll * settings
struct kest_asm_line_pll * asm_lines