#include #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 \n"); return 2; } if (!ReadAllString(argv[1], &file, &count)) { printf("Failed to read file '%s'.", argv[1]); return 1; } Dictionary* variables = DictionaryCreate(); Array* tokens = Tokenize(file, &variables); if (tokens->Size == 0) { printf("No tokens\n"); return 0; } char* buffer; for(int i = 0; i < tokens->Size; i++) { Token* token = tokens->Items[i]; if (token->Type == LineEnd) { printf("\n"); continue; } buffer = TokenStringify(token); if (buffer) { printf("%s ", buffer); free(buffer); } } printf("\n"); }