Created a tokenizer and the supporting code, currently processes text that is not a string literal.
This commit is contained in:
+19
-1
@@ -1,10 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#include "../includes/futil.h"
|
||||
#include "../includes/tokenizer.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
char* file;
|
||||
size_t count;
|
||||
|
||||
//gcc -o test src/main.c src/futil.c src/dictionary.c src/tokenizer.c src/token.c src/array.c -g
|
||||
|
||||
if (argc <= 1) {
|
||||
printf("Usage: assm <file.asm>\n");
|
||||
|
||||
@@ -17,5 +20,20 @@ int main(int argc, char** argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf(file);
|
||||
Dictionary* variables = DictionaryCreate();
|
||||
|
||||
Array* tokens = Tokenize(file, &variables);
|
||||
|
||||
if (tokens->Size == 0) {
|
||||
printf("No tokens\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
else printf("Found %d tokens.", tokens->Size);
|
||||
|
||||
for(int i = 0; i < tokens->Size; i++) {
|
||||
Token* token = tokens->Items[i];
|
||||
|
||||
printf(TokenStringify(token, false));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user