feat: finish implementing analyzer

This commit is contained in:
samsonium
2026-10-27 12:50:58 +03:00
parent a263b6206f
commit aa7a06bd22
8 changed files with 47 additions and 10 deletions
+5
View File
@@ -1,6 +1,7 @@
#include <compiler/fzl_analyzer.h>
#include <compiler/utils/fzl_symtable.h>
#include <stdlib.h>
#include <string.h>
// Nest context
fzl_an_ctx_t *an_nest_ctx(fzl_analyzer_t *analyzer, fzl_an_ctx_type_t type)
@@ -12,9 +13,13 @@ fzl_an_ctx_t *an_nest_ctx(fzl_analyzer_t *analyzer, fzl_an_ctx_type_t type)
if (!ctx)
return NULL;
memset(ctx, 0, sizeof(fzl_an_ctx_t));
ctx->type = type;
if (analyzer->ctx != NULL)
ctx->parent = analyzer->ctx;
else
ctx->parent = NULL;
analyzer->ctx = ctx;
analyzer->symbols[analyzer->symbols_top++] = fzl_mksymt();