Example #1
0
  /**
   * Dumps the parsing errors into a text file.
   *
   * @param filename the file name into which the error will be dumped.
   * @throws Exception if any exception.
   */
  protected void dumpErrors(String filename) throws Exception {
    String outputFolder = getTempFolder() + OUTPUT_FOLDER;
    File f = new File(outputFolder);
    if (!f.exists() && !f.mkdir()) {
      throw new Exception("Can not create the output folder!"); // $NON-NLS-1$
    }
    filename = outputFolder + filename;

    if (design == null) return;
    PrintWriter writer = new PrintWriter(new FileOutputStream(filename));
    List errors = design.getAllErrors();
    ErrorDetail ex = null;
    for (int i = 0; i < errors.size(); i++) {
      ex = (ErrorDetail) errors.get(i);
      writer.print(design.getFileName());
      writer.println(ex);
    }
    writer.close();
  }
Example #2
0
 /**
  * Prints out all semantic errors stored in the error list during parsing the design file.
  *
  * @param design report design
  */
 protected void printSemanticError(ReportDesign design) {
   if (design != null) printErrorList(design.getAllErrors());
 }