Hooked up the program counter in the parser to set the memory offset of symbols, well labels to be more acurrate.
This commit is contained in:
+13
-1
@@ -9,6 +9,7 @@
|
||||
#include "../includes/parser.h"
|
||||
|
||||
List* LIST;
|
||||
SymbolTable* Symbols;
|
||||
|
||||
void print(void);
|
||||
|
||||
@@ -27,12 +28,23 @@ int main(int argc, char* args[]) {
|
||||
|
||||
LIST = GenerateTokenList(source_code);
|
||||
|
||||
ParseTokens(LIST);
|
||||
IRState* state = ParseTokens(LIST);
|
||||
|
||||
Symbols = state->SymbolsTable;
|
||||
|
||||
free(source_code);
|
||||
}
|
||||
|
||||
// void assemble() {
|
||||
// for(int i = 0; i < LIST->size; i++) {
|
||||
// Token* current = LIST->content[i];
|
||||
|
||||
// if (current->Class != MnemonicClass) continue;
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
void print(void) {
|
||||
char mnemonic[12];
|
||||
printf("printing tokens...\n");
|
||||
|
||||
Reference in New Issue
Block a user