Made use of the Symbols Table, and started the proccess of determining the memory location of opcodes and variables.
This commit is contained in:
+12
-12
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user