Made use of the Symbols Table, and started the proccess of determining the memory location of opcodes and variables.

This commit is contained in:
2022-08-25 19:06:05 +00:00
parent 64326937b1
commit 4f6d5f652e
2 changed files with 72 additions and 101 deletions
+12 -12
View File
@@ -20,21 +20,21 @@ int main(int argc, char* args[]) {
List* list = GenerateTokenList(source_code);
for(int i = 0; i < list->size; i++) {
Token* t = (Token*) list->content[i];
// for(int i = 0; i < list->size; i++) {
// Token* t = (Token*) list->content[i];
if (t->type == LineEnd) {
if (i - 1 >= 0 && ((Token*) list->content[i - 1])->type != LineEnd)
printf("\n");
continue;
}
// if (t->type == LineEnd) {
// if (i - 1 >= 0 && ((Token*) list->content[i - 1])->type != LineEnd)
// printf("\n");
printf("[%i] '%s' [%i] ", t->type, t->lexeme, t->token_class);
if (t->type == LABEL) printf("* ");
}
// continue;
// }
//ParseTokens(list);
// printf("[%i] '%s' [%i] ", t->type, t->lexeme, t->token_class);
// if (t->type == LABEL) printf("* ");
// }
ParseTokens(list);
free(source_code);
}