stage1_2/iec_bison.yy
changeset 516 8591746fa134
parent 469 9fe6c4633ed6
child 520 fb381d2cd25b
equal deleted inserted replaced
515:fdef852a6565 516:8591746fa134
  8057   if (first_filename == NULL) first_filename = unknown_file;
  8057   if (first_filename == NULL) first_filename = unknown_file;
  8058   if ( last_filename == NULL)  last_filename = unknown_file;
  8058   if ( last_filename == NULL)  last_filename = unknown_file;
  8059 
  8059 
  8060   if (full_token_loc) {
  8060   if (full_token_loc) {
  8061     if (first_filename == last_filename)
  8061     if (first_filename == last_filename)
  8062       fprintf(stderr, "%s:%d-%d..%d-%d: error : %s\n", first_filename, first_line, first_column, last_line, last_column, additional_error_msg);
  8062       fprintf(stderr, "%s:%d-%d..%d-%d: error: %s\n", first_filename, first_line, first_column, last_line, last_column, additional_error_msg);
  8063     else
  8063     else
  8064       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);
  8064       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);
  8065   } else {
  8065   } else {
  8066       fprintf(stderr, "%s:%d: error : %s\n", first_filename, first_line, additional_error_msg);
  8066       fprintf(stderr, "%s:%d: error: %s\n", first_filename, first_line, additional_error_msg);
  8067   }
  8067   }
  8068   //fprintf(stderr, "error %d: %s\n", yynerrs /* a global variable */, additional_error_msg);
  8068   //fprintf(stderr, "error %d: %s\n", yynerrs /* a global variable */, additional_error_msg);
  8069   print_include_stack();
  8069   print_include_stack();
  8070   //fprintf(stderr, "%s(%d-%d): %s\n", current_filename, first_line, last_line, current_error_msg);
  8070   //fprintf(stderr, "%s(%d-%d): %s\n", current_filename, first_line, last_line, current_error_msg);
  8071 }
  8071 }
  8263   current_tracking = GetNewTracking(yyin);
  8263   current_tracking = GetNewTracking(yyin);
  8264   if (yyparse() != 0)
  8264   if (yyparse() != 0)
  8265       ERROR;
  8265       ERROR;
  8266 
  8266 
  8267   if (yynerrs > 0) {
  8267   if (yynerrs > 0) {
  8268     fprintf (stderr, "\nFound %d error(s) in %s. Bailing out!\n", yynerrs /* global variable */, libfilename);
  8268     fprintf (stderr, "\n%d error(s) found in %s. Bailing out!\n", yynerrs /* global variable */, libfilename);
  8269     ERROR;
  8269     ERROR;
  8270   }
  8270   }
  8271   free(libfilename);
  8271   free(libfilename);
  8272   fclose(lib_file);
  8272   fclose(lib_file);
  8273 
  8273 
  8296   		exit(EXIT_FAILURE);
  8296   		exit(EXIT_FAILURE);
  8297   	}
  8297   	}
  8298   }
  8298   }
  8299 
  8299 
  8300   if (yynerrs > 0) {
  8300   if (yynerrs > 0) {
  8301     fprintf (stderr, "\nFound %d error(s). Bailing out!\n", yynerrs /* global variable */);
  8301     fprintf (stderr, "\n%d error(s) found. Bailing out!\n", yynerrs /* global variable */);
  8302     exit(EXIT_FAILURE);
  8302     exit(EXIT_FAILURE);
  8303   }
  8303   }
  8304   
  8304   
  8305   if (tree_root_ref != NULL)
  8305   if (tree_root_ref != NULL)
  8306     *tree_root_ref = tree_root;
  8306     *tree_root_ref = tree_root;