mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 06:43:03 +00:00
Merge remote-tracking branch 'origin/maint'
* origin/maint: tests: close files in glr-regression xml: match DOT output and xml2dot.xsl processing xml: factor xslt space template graph: fix a memory leak xml: documentation output: capitalize State
This commit is contained in:
@@ -106,7 +106,7 @@ conclude_red (struct obstack *out, int source, rule_number ruleno,
|
||||
return (void) obstack_finish0 (out);
|
||||
else
|
||||
{
|
||||
char const *ed = enabled ? "e" : "d";
|
||||
char const *ed = enabled ? "" : "d";
|
||||
char const *color = enabled ? ruleno ? "3" : "1" : "5";
|
||||
|
||||
/* First, build the edge's head. The name of reduction nodes is "nRm",
|
||||
@@ -116,24 +116,28 @@ conclude_red (struct obstack *out, int source, rule_number ruleno,
|
||||
fprintf (fout, " %1$d -> \"%1$dR%2$d%3$s\" [",
|
||||
source, ruleno, ed);
|
||||
|
||||
/* (The lookahead tokens have been added to the beginning of the
|
||||
obstack, in the caller function.) */
|
||||
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));
|
||||
{
|
||||
char *label = obstack_finish0 (out);
|
||||
fprintf (fout, "label=\"[%s]\", ", label);
|
||||
obstack_free (out, label);
|
||||
}
|
||||
|
||||
/* Then, the edge's tail. */
|
||||
fprintf (fout, "style = solid]\n");
|
||||
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);
|
||||
fprintf (fout, " \"%dR%d%s\" [label=\"",
|
||||
source, ruleno, ed);
|
||||
if (ruleno)
|
||||
fprintf (fout, "R%d", ruleno);
|
||||
else
|
||||
fprintf (fout, "label = \"Acc\"]\n");
|
||||
fprintf (fout, "Acc");
|
||||
|
||||
fprintf (fout, "\", fillcolor=%s, shape=diamond, style=filled]\n",
|
||||
color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +175,7 @@ output_red (state const *s, reductions const *reds, FILE *fout)
|
||||
bool defaulted = false;
|
||||
bool firstd = true;
|
||||
bool firste = true;
|
||||
rule_number ruleno = reds->rules[j]->user_number;
|
||||
rule_number ruleno = reds->rules[j]->number;
|
||||
rule *default_reduction = NULL;
|
||||
|
||||
if (yydefact[s->number] != 0)
|
||||
@@ -199,11 +203,12 @@ output_red (state const *s, reductions const *reds, FILE *fout)
|
||||
}
|
||||
|
||||
/* Do the actual output. */
|
||||
conclude_red (&eout, source, ruleno, true, firste && !defaulted, fout);
|
||||
conclude_red (&dout, source, ruleno, false, firstd, fout);
|
||||
conclude_red (&eout, source, ruleno, true, firste && !defaulted, fout);
|
||||
}
|
||||
obstack_free (&eout, 0);
|
||||
obstack_free (&dout, 0);
|
||||
obstack_free (&eout, 0);
|
||||
bitset_free (no_reduce_set);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -370,7 +370,7 @@ static void
|
||||
print_state (FILE *out, state *s)
|
||||
{
|
||||
fputs ("\n\n", out);
|
||||
fprintf (out, _("state %d"), s->number);
|
||||
fprintf (out, _("State %d"), s->number);
|
||||
fputc ('\n', out);
|
||||
print_core (out, s);
|
||||
print_actions (out, s);
|
||||
|
||||
@@ -77,7 +77,7 @@ print_core (struct obstack *oout, state *s)
|
||||
}
|
||||
|
||||
obstack_printf (oout, _("State %d"), s->number);
|
||||
obstack_sgrow (oout, "\\n");
|
||||
obstack_sgrow (oout, "\\n\\l");
|
||||
for (i = 0; i < snritems; i++)
|
||||
{
|
||||
item_number *sp;
|
||||
@@ -143,9 +143,6 @@ print_actions (state const *s, FILE *fgraph)
|
||||
transitions const *trans = s->transitions;
|
||||
int i;
|
||||
|
||||
/* Display reductions. */
|
||||
output_red (s, s->reductions, fgraph);
|
||||
|
||||
if (!trans->num && !s->reductions)
|
||||
return;
|
||||
|
||||
@@ -168,6 +165,8 @@ print_actions (state const *s, FILE *fgraph)
|
||||
TRANSITION_IS_ERROR (trans, i) ? NULL : symbols[sym]->tag,
|
||||
style, fgraph);
|
||||
}
|
||||
/* Display reductions. */
|
||||
output_red (s, s->reductions, fgraph);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user