Produce similar error messages in stage2 and stage3.
authorMario de Sousa <msousa@fe.up.pt>
Tue, 17 Apr 2012 09:58:06 +0100
changeset 516 8591746fa134
parent 515 fdef852a6565
child 517 889f4e577964
Produce similar error messages in stage2 and stage3.
main.cc
stage1_2/iec_bison.yy
stage3/stage3.cc
--- a/main.cc	Mon Apr 16 20:13:58 2012 +0100
+++ b/main.cc	Tue Apr 17 09:58:06 2012 +0100
@@ -198,7 +198,7 @@
     /* moved to bison, although it could perfectly well still be here instead of in bison code. */
   //add_en_eno_param_decl_c::add_to(tree_root);
 
-  /* Only very simple (not yet complete) data type checking currently implemented... */
+  /* Do semantic verification of code (data type and lvalue checking currently implemented) */
   if (stage3(tree_root) < 0)
     return EXIT_FAILURE;
   
--- a/stage1_2/iec_bison.yy	Mon Apr 16 20:13:58 2012 +0100
+++ b/stage1_2/iec_bison.yy	Tue Apr 17 09:58:06 2012 +0100
@@ -8059,11 +8059,11 @@
 
   if (full_token_loc) {
     if (first_filename == last_filename)
-      fprintf(stderr, "%s:%d-%d..%d-%d: error : %s\n", first_filename, first_line, first_column, last_line, last_column, additional_error_msg);
+      fprintf(stderr, "%s:%d-%d..%d-%d: error: %s\n", first_filename, first_line, first_column, last_line, last_column, additional_error_msg);
     else
-      fprintf(stderr, "%s:%d-%d..%s:%d-%d: error : %s\n", first_filename, first_line, first_column, last_filename, last_line, last_column, additional_error_msg);
+      fprintf(stderr, "%s:%d-%d..%s:%d-%d: error: %s\n", first_filename, first_line, first_column, last_filename, last_line, last_column, additional_error_msg);
   } else {
-      fprintf(stderr, "%s:%d: error : %s\n", first_filename, first_line, additional_error_msg);
+      fprintf(stderr, "%s:%d: error: %s\n", first_filename, first_line, additional_error_msg);
   }
   //fprintf(stderr, "error %d: %s\n", yynerrs /* a global variable */, additional_error_msg);
   print_include_stack();
@@ -8265,7 +8265,7 @@
       ERROR;
 
   if (yynerrs > 0) {
-    fprintf (stderr, "\nFound %d error(s) in %s. Bailing out!\n", yynerrs /* global variable */, libfilename);
+    fprintf (stderr, "\n%d error(s) found in %s. Bailing out!\n", yynerrs /* global variable */, libfilename);
     ERROR;
   }
   free(libfilename);
@@ -8298,7 +8298,7 @@
   }
 
   if (yynerrs > 0) {
-    fprintf (stderr, "\nFound %d error(s). Bailing out!\n", yynerrs /* global variable */);
+    fprintf (stderr, "\n%d error(s) found. Bailing out!\n", yynerrs /* global variable */);
     exit(EXIT_FAILURE);
   }
   
--- a/stage3/stage3.cc	Mon Apr 16 20:13:58 2012 +0100
+++ b/stage3/stage3.cc	Tue Apr 17 09:58:06 2012 +0100
@@ -77,7 +77,7 @@
 	error_count += lvalue_check(tree_root);
 	
 	if (error_count > 0) {
-		fprintf(stderr, "%d errors found. Bailing out!\n", error_count); 
+		fprintf(stderr, "%d error(s) found. Bailing out!\n", error_count); 
 		return -1;
 	}
 	return 0;