diff --git a/bfpcompiler/src/compilefuck.c b/bfpcompiler/src/compilefuck.c index bdb41db..ff74300 100644 --- a/bfpcompiler/src/compilefuck.c +++ b/bfpcompiler/src/compilefuck.c @@ -74,11 +74,20 @@ int main (int argc, char** argv) { exit(EXIT_FAILURE); } - extractTokens(buffer, tokens); + int token_count = extractTokens(buffer, tokens); + if (!token_count) { + (void)printf("WARNING: The program is empty!\n"); + } /* end of lifetime for buffer */ free( buffer ); + /* Analyze the code for errors and warnings. */ + int scan_result = analyze(tokens); + if (scan_result < 0) { + exit(scan_result); + } + /* Just print the tokens as example. */ for (char* index = tokens; *index; index++) { (void)printf("%c", *index);