diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-08-09 06:11:47 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-08-09 06:11:47 +0330 |
commit | 12b45f728905863adb2e727d6c9c406374675bea (patch) | |
tree | f05a3a9ec2d846e4c94de334e2d42b80c4daae5c /src | |
parent | 40881a903e00939b647cd85beeacfb8a68b31e6a (diff) |
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/bba.c | 17 | ||||
-rw-r--r-- | src/backend/bba.h | 8 | ||||
-rw-r--r-- | src/compiler/ast-tree.c | 4 |
3 files changed, 25 insertions, 4 deletions
diff --git a/src/backend/bba.c b/src/backend/bba.c index fe156c6..64c2984 100644 --- a/src/backend/bba.c +++ b/src/backend/bba.c @@ -1 +1,18 @@ #include "bba.h" + +BBA makeBBA(AstTreeRoots roots) { + BBA bba; + + for (size_t i = 0; i < roots.size; ++i) { + makeBBABack(&bba, roots.data[i]); + } + + return bba; +} + +bool makeBBABack(BBA *bba, AstTreeRoot *root){ + for(size_t i = 0;i < root->variables.size;++i){ + AstTreeVariable *variable = root->variables.data[i]; + + } +} diff --git a/src/backend/bba.h b/src/backend/bba.h index 2e77d78..2fc5741 100644 --- a/src/backend/bba.h +++ b/src/backend/bba.h @@ -55,6 +55,7 @@ typedef enum BBAOperation { typedef union BBAInstructionValue { struct BBAInstruction *instruction; + struct BBABlock *block; u8 u8; i8 i8; @@ -87,4 +88,11 @@ typedef struct BBABlock { } BBABlock; typedef struct BBA { + BBAInstructionValue *globals; + size_t globals_size; + BBABlock blocks; + size_t blocks_size; } BBA; + +BBA makeBBA(AstTreeRoots roots); +bool makeBBABack(BBA *bba, AstTreeRoot *root); diff --git a/src/compiler/ast-tree.c b/src/compiler/ast-tree.c index 057e96d..bc19523 100644 --- a/src/compiler/ast-tree.c +++ b/src/compiler/ast-tree.c @@ -8220,10 +8220,6 @@ AstTreeVariable *setTypesFindVariable(const char *name_begin, } } if (variable.var == NULL) { - printLog("%ld", helper.variables_size); - for (size_t i = 0; i < helper.variables_size; ++i) { - printLog("is %ld", helper.variables[i].size); - } printError(name_begin, name_end, "No candidates found for %.*s", (int)(name_end - name_begin), name_begin); return NULL; |