3#ifndef PRINTLINES_ALLOWED
4#define PRINTLINES_ALLOWED 1
7static const char *FNAME =
"kest_eff_section.c";
14 if (strcmp(str,
"INFO") == 0)
return 1;
15 if (strcmp(str,
"RESOURCES") == 0)
return 1;
16 if (strcmp(str,
"PARAMETERS") == 0)
return 1;
17 if (strcmp(str,
"SETTINGS") == 0)
return 1;
18 if (strcmp(str,
"DEFS") == 0)
return 1;
19 if (strcmp(str,
"CODE") == 0)
return 1;
31 switch (current_score)
43 if (!list || !sect | !ps)
63 kest_parameter_pll_safe_append(list, param);
72 if (!list || !sect | !ps)
94 kest_setting_pll_safe_append(list, setting);
104 if (!list || !sect || !ps)
117 for (
int i = 0; i < dict->
n_entries; i++)
130 kest_dsp_resource_pll_safe_append(list, res);
139 KEST_PRINTF(
"kest_defs_section_extract(ps = %p, scope = %p, sect = %p)\n", ps, scope, sect);
140 if (!scope || !sect || !ps)
156 for (
int i = 0; i < dict->
n_entries; i++)
170 ret_val = kest_named_expression_pll_safe_append(&ps->
def_exprs, nexpr);
268 KEST_PRINTF(
"Parsed dictionary section. Result:\n");
void * kest_alloc(size_t size)
char * kest_strndup(const char *str, size_t n)
int kest_parse_asm(kest_eff_parsing_state *ps)
int kest_dictionary_lookup_dict(kest_dictionary *dict, const char *name, kest_dictionary **result)
int kest_dictionary_lookup_int(kest_dictionary *dict, const char *name, int *result)
void print_dict(kest_dictionary *dict)
int kest_dictionary_lookup_str(kest_dictionary *dict, const char *name, const char **result)
const char * kest_dict_entry_type_to_string(int type)
int kest_dictionary_lookup_expr(kest_dictionary *dict, const char *name, kest_expression **result)
int kest_parse_dictionary(kest_eff_parsing_state *ps, kest_dictionary **result, const char *name)
int kest_dictionary_lookup_float(kest_dictionary *dict, const char *name, float *result)
#define DICT_ENTRY_TYPE_SUBDICT
#define DICT_ENTRY_TYPE_EXPR
void kest_parser_error_at_node(kest_eff_parsing_state *ps, kest_ast_node *node, const char *msg,...)
void kest_parser_error_at_line(kest_eff_parsing_state *ps, int line, const char *msg,...)
#define KEST_AST_NODE_SECTION
int kest_dictionary_section_lookup_int(kest_ast_node *section, const char *name, int *result)
int kest_parse_dictionary_section(kest_eff_parsing_state *ps, kest_ast_node *section)
int kest_resources_section_extract(kest_eff_parsing_state *ps, kest_dsp_resource_pll **list, kest_ast_node *sect)
int kest_parameters_section_extract(kest_eff_parsing_state *ps, kest_parameter_pll **list, kest_ast_node *sect)
int kest_dictionary_section_lookup_str(kest_ast_node *section, const char *name, const char **result)
int kest_parse_code_section(kest_eff_parsing_state *ps, kest_ast_node *section)
int token_is_valid_section_name(char *str)
int kest_settings_section_extract(kest_eff_parsing_state *ps, kest_setting_pll **list, kest_ast_node *sect)
int kest_dictionary_section_lookup_expr(kest_ast_node *section, const char *name, kest_expression **result)
int kest_dictionary_section_lookup_float(kest_ast_node *section, const char *name, float *result)
int kest_defs_section_extract(kest_eff_parsing_state *ps, kest_expr_scope *scope, struct kest_ast_node *sect)
int kest_dictionary_section_lookup_dict(kest_ast_node *section, const char *name, kest_dictionary **result)
int get_section_start_score(char *str, int current_score)
const char * kest_error_code_to_string(int error_code)
int kest_expr_scope_add_expr(kest_expr_scope *scope, const char *name, struct kest_expression *expr)
int token_is_char(char *str, char c)
union kest_dictionary_entry::@135165320273153367332213364063306072146165325153 value
struct kest_dictionary * val_dict
kest_expression * val_expr
kest_dictionary_entry * entries
struct kest_dictionary * dict
kest_token_ll * current_token
kest_named_expression_pll * def_exprs
const char * name_internal
struct kest_token_ll * next