Added some simple symbol handling to the Parser.
This commit is contained in:
+8
-8
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user