feat: finish implementing analyzer
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user