+ timevar_push (TV_CONFLICTS);
+ conflicts_solve ();
+ muscle_percent_define_default ("lr.keep_unreachable_states", "false");
+ if (!muscle_percent_define_flag_if ("lr.keep_unreachable_states"))
+ {
+ state_number *old_to_new = xnmalloc (nstates, sizeof *old_to_new);
+ state_number nstates_old = nstates;
+ state_remove_unreachable_states (old_to_new);
+ lalr_update_state_numbers (old_to_new, nstates_old);
+ conflicts_update_state_numbers (old_to_new, nstates_old);
+ free (old_to_new);
+ }
+ conflicts_print ();
+ timevar_pop (TV_CONFLICTS);
+
+ /* Compute the parser tables. */
+ timevar_push (TV_ACTIONS);
+ tables_generate ();
+ timevar_pop (TV_ACTIONS);
+
+ grammar_rules_useless_report
+ (_("rule useless in parser due to conflicts"));
+
+ /* Output file names. */
+ compute_output_file_names ();
+
+ /* Output the detailed report on the grammar. */
+ if (report_flag)
+ {
+ timevar_push (TV_REPORT);
+ print_results ();
+ timevar_pop (TV_REPORT);
+ }
+
+ /* Output the graph. */
+ if (graph_flag)
+ {
+ timevar_push (TV_GRAPH);
+ print_graph ();
+ timevar_pop (TV_GRAPH);
+ }
+
+ /* Output xml. */
+ if (xml_flag)
+ {
+ timevar_push (TV_XML);
+ print_xml ();
+ timevar_pop (TV_XML);
+ }
+
+ /* Stop if there were errors, to avoid trashing previous output
+ files. */
+ if (complaint_issued)
+ goto finish;
+
+ /* Lookahead tokens are no longer needed. */
+ timevar_push (TV_FREE);
+ lalr_free ();
+ timevar_pop (TV_FREE);