aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-08-09 06:11:47 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-08-09 06:11:47 +0330
commit12b45f728905863adb2e727d6c9c406374675bea (patch)
treef05a3a9ec2d846e4c94de334e2d42b80c4daae5c /src
parent40881a903e00939b647cd85beeacfb8a68b31e6a (diff)
some clean up and attempts to add bbaHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/backend/bba.c17
-rw-r--r--src/backend/bba.h8
-rw-r--r--src/compiler/ast-tree.c4
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;