X-Git-Url: https://git.piment-noir.org/?p=TP_AL_C.git;a=blobdiff_plain;f=lexer%2Fsyntactic_analyzer.c;h=8d2d2e93837565b1fe4f60085ee01623c377180f;hp=2d3880ff963fa1cccac02f2c3371d9d989b751cd;hb=6c47be3237ab266b1cba4e3051afaaaa55e07e52;hpb=82220449f3f8d1c25474651379118eda02430a3c diff --git a/lexer/syntactic_analyzer.c b/lexer/syntactic_analyzer.c index 2d3880f..8d2d2e9 100644 --- a/lexer/syntactic_analyzer.c +++ b/lexer/syntactic_analyzer.c @@ -29,6 +29,7 @@ static void analyze_TEXT() { } else if (tokenType != MOTCLE && tokenType != NPARA && tokenType != SECTION && \ tokenType != SSECTION && tokenType != FIN) { fprintf(stderr, "%s follows error on %s\n", __func__, tokenTypestr[tokenType]); + fflush(stderr); exit(EXIT_FAILURE); } #if DEBUG @@ -58,10 +59,12 @@ static void analyze_P() { analyze_P(); } else if (tokenType != SECTION && tokenType != SSECTION && tokenType != FIN) { fprintf(stderr, "%s follows error on %s\n", __func__, tokenTypestr[tokenType]); + fflush(stderr); exit(EXIT_FAILURE); } } else if (tokenType != SECTION && tokenType != SSECTION && tokenType != FIN) { fprintf(stderr, "%s follows error on %s\n", __func__, tokenTypestr[tokenType]); + fflush(stderr); exit(EXIT_FAILURE); } #if DEBUG @@ -91,10 +94,12 @@ static void analyze_HEAD() { analyze_TEXT(); } else if (tokenType != NPARA && tokenType != SECTION && tokenType != FIN) { fprintf(stderr, "%s follows error on %s\n", __func__, tokenTypestr[tokenType]); + fflush(stderr); exit(EXIT_FAILURE); } } else if (tokenType != NPARA && tokenType != SECTION && tokenType != FIN) { fprintf(stderr, "%s follows error on %s\n", __func__, tokenTypestr[tokenType]); + fflush(stderr); exit(EXIT_FAILURE); } #if DEBUG @@ -148,6 +153,7 @@ static void analyze_S2() { analyze_S2(); } else if (tokenType != SECTION && tokenType != FIN) { fprintf(stderr, "%s follows error on %s\n", __func__, tokenTypestr[tokenType]); + fflush(stderr); exit(EXIT_FAILURE); } #if DEBUG @@ -166,6 +172,7 @@ static void analyze_S1() { analyze_S1(); } else if (tokenType != FIN) { fprintf(stderr, "%s follows error on %s\n", __func__, tokenTypestr[tokenType]); + fflush(stderr); exit(EXIT_FAILURE); } #if DEBUG @@ -199,10 +206,12 @@ void analyze_AXIOME() { analyze_BODY(); if (tokenType != FIN) { fprintf(stderr, "%s follows error on %s\n", __func__, tokenTypestr[tokenType]); + fflush(stderr); exit(EXIT_FAILURE); } fprintf(stdout, "successful syntactic analysis\n"); #if DEBUG fprintf(stdout, "leaving %s\n", __func__); #endif + fflush(stdout); }