Logo Search packages:      
Sourcecode: jasmin-sable version File versions  Download package

static void java_cup::Main::emit_summary ( boolean  output_produced  )  [inline, static, protected]

Emit a long summary message to standard error (System.err) which summarizes what was found in the specification, how many states were produced, how many conflicts were found, etc. A detailed timing summary is also produced if it was requested by the user.

Parameters:
output_produced did the system get far enough to generate code.

Definition at line 609 of file Main.java.

References expect_conflicts, final_time, no_summary, opt_show_timing, plural(), and show_times().

Referenced by main().

    {
      final_time = System.currentTimeMillis();

      if (no_summary) return;

      System.err.println("------- " + version.title_str + 
                   " Parser Generation Summary -------");

      /* error and warning count */
      System.err.println("  " + lexer.error_count + " error" + 
       plural(lexer.error_count) + " and " + lexer.warning_count + 
       " warning" + plural(lexer.warning_count));

      /* basic stats */
      System.err.print("  " + terminal.number() + " terminal" + 
                   plural(terminal.number()) + ", ");
      System.err.print(non_terminal.number() + " non-terminal" + 
                   plural(non_terminal.number()) + ", and ");
      System.err.println(production.number() + " production" + 
                   plural(production.number()) + " declared, ");
      System.err.println("  producing " + lalr_state.number() + 
                   " unique parse states.");

      /* unused symbols */
      System.err.println("  " + emit.unused_term + " terminal" + 
                   plural(emit.unused_term) + " declared but not used.");
      System.err.println("  " + emit.unused_non_term + " non-terminal" + 
                   plural(emit.unused_term) + " declared but not used.");

      /* productions that didn't reduce */
      System.err.println("  " + emit.not_reduced + " production" + 
                   plural(emit.not_reduced) + " never reduced.");

      /* conflicts */
      System.err.println("  " + emit.num_conflicts + " conflict" +
                   plural(emit.num_conflicts) + " detected" +
                       " (" + expect_conflicts + " expected).");

      /* code location */
      if (output_produced)
      System.err.println("  Code written to \"" + emit.parser_class_name + 
              ".java\", and \"" + emit.symbol_const_class_name + ".java\".");
      else
      System.err.println("  No code produced.");

      if (opt_show_timing) show_times();

      System.err.println(
      "---------------------------------------------------- (" + 
       version.version_str + ")");
    }


Generated by  Doxygen 1.6.0   Back to index