Add some fflush() for avoid loosing comme characters
[TP_AL_C.git] / lexer / syntactic_analyzer.c
index 2d3880ff963fa1cccac02f2c3371d9d989b751cd..8d2d2e93837565b1fe4f60085ee01623c377180f 100644 (file)
@@ -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);
 }