Added some simple symbol handling to the Parser.

This commit is contained in:
2022-05-06 18:55:22 +00:00
parent fc47bf2143
commit fbef044905
5 changed files with 90 additions and 57 deletions
+8 -8
View File
@@ -7,8 +7,6 @@
#include "../includes/futil.h"
#include "../includes/scanner.h"
List* get_strings(const char*);
int main(int argc, char* args[]) {
if (argc == 1) {
printf("Usage: assm <file1.asm>\n");
@@ -22,13 +20,15 @@ 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];
printf("[%i] '%s'", t->type, t->lexeme);
if (t->type == NUMBER || t->type == HEX) printf(" NUM: %ld", *((long *) t->value));
printf("\n");
}
// printf("[%i] '%s'", t->type, t->lexeme);
// if (t->type == LABEL) printf("*");
// printf("\n");
// }
ParseTokens(list);
free(source_code);
}