summaryrefslogtreecommitdiff
path: root/src/gas_assembly_generator.h
diff options
context:
space:
mode:
authorJohnny Richard <johnny@johnnyrichard.com>2023-04-30 03:11:00 -0300
committerJohnny Richard <johnny@johnnyrichard.com>2023-04-30 17:40:01 +0200
commitb1f7b0cccc6986ca107d9eeb1c7d5e5e5a32dc49 (patch)
treefb1eb8192c3f6da14796d59831030dd23935edcd /src/gas_assembly_generator.h
parent090da456910429708ef7ee202b627e3dbce17819 (diff)
gas: Compile variable expression with scope support
This patch adds the variable compilation and uses a scope (a stack of map) to lookup for identities. Today we use a vector + ref_entry structs in order to achieve the scope implementation. The ref_entry lacks memory management, we are still no sure who will be the owner of the pointer. We also want to replace the scope a hashtable_t type as soon as we get one. Signed-off-by: Johnny Richard <johnny@johnnyrichard.com> Co-authored-by: Carlos Maniero <carlosmaniero@gmail.com>
Diffstat (limited to 'src/gas_assembly_generator.h')
-rw-r--r--src/gas_assembly_generator.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gas_assembly_generator.h b/src/gas_assembly_generator.h
index 4d4b28e..044e8ed 100644
--- a/src/gas_assembly_generator.h
+++ b/src/gas_assembly_generator.h
@@ -18,11 +18,14 @@
#define GAS_ASSEMBLY_GENERATOR_H
#include "ast.h"
+#include "vector.h"
#include <stdio.h>
typedef struct gas_assembly_generator_t
{
FILE *stream;
+ vector_t *refs;
+ int stack_offset;
} gas_assembly_generator_t;
void