wip: working on analyzer
- Feat: now symbols table store node on PUT - Feat: call analyzer with callee resolving and arguments validate - Feat: identifier analyzer - Feat: analyzer utils (types compat, tok-to-type, type-to-string)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <common/fzl_types.h>
|
||||
#include <compiler/fzl_parser.h>
|
||||
#include <compiler/utils/fzl_symtable.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
@@ -21,8 +22,8 @@ fzl_symtable_t *fzl_mksymt()
|
||||
return tbl;
|
||||
}
|
||||
|
||||
fzl_symtable_res_t fzl_symt_put(fzl_symtable_t *symt, char *name,
|
||||
fzl_type_t type, uint64_t ip)
|
||||
fzl_symtable_res_t fzl_symt_put(fzl_symtable_t *symt, fzl_node_t *node,
|
||||
char *name, fzl_type_t type, uint64_t ip)
|
||||
{
|
||||
if (!symt)
|
||||
return FZL_SYMTABLE_RESULT_ERR;
|
||||
@@ -37,8 +38,8 @@ fzl_symtable_res_t fzl_symt_put(fzl_symtable_t *symt, char *name,
|
||||
symt->symbols = realloc(symt->symbols, symt->remainder * sizeof(fzl_sym_t));
|
||||
}
|
||||
|
||||
symt->symbols[symt->size++] =
|
||||
(fzl_sym_t){.name = name, .type = type, .ip = ip, .classname = NULL};
|
||||
symt->symbols[symt->size++] = (fzl_sym_t){
|
||||
.name = name, .node = node, .type = type, .ip = ip, .classname = NULL};
|
||||
return FZL_SYMTABLE_RESULT_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user