+static void
+conclude_red (struct obstack *out, int source, rule_number ruleno,
+ bool enabled, bool first, FILE *fout)
+{
+ /* If no lookahead tokens were valid transitions, this reduction is
+ actually hidden, so cancel everything. */
+ if (first)
+ return (void) obstack_finish0 (out);
+ else
+ {
+ char const *ed = enabled ? "e" : "d";
+ char const *color = enabled ? ruleno ? "3" : "1" : "5";
+
+ /* First, build the edge's head. The name of reduction nodes is "nRm",
+ with n the source state and m the rule number. This is because we
+ don't want all the reductions bearing a same rule number to point to
+ the same state, since that is not the desired format. */
+ fprintf (fout, " %1$d -> \"%1$dR%2$d%3$s\" [",
+ source, ruleno, ed);
+
+ if (! obstack_empty_p (out))
+ /* (The lookahead tokens have been added to the beginning of the
+ obstack, in the caller function.) */
+ fprintf (fout, "label = \"[%s]\" ", obstack_finish0 (out));
+
+ /* Then, the edge's tail. */
+ fprintf (fout, "style = solid]\n");
+
+ /* Build the associated diamond representation of the target rule. */
+ fprintf (fout, " \"%dR%d%s\" [style = filled, "
+ "shape = diamond, fillcolor = %s, ",
+ source, ruleno, ed, color);
+
+ if (ruleno)
+ fprintf (fout, "label = \"R%d\"]\n", ruleno);
+ else
+ fprintf (fout, "label = \"Acc\"]\n");
+
+ }
+}
+