mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 14:23:04 +00:00
Don't let --report affect XML output; always print all information.
Discussed at <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>. * src/conflicts.c (log_resolution): Implement. * src/print-xml.c (print_core): Implement. (print_state): Implement. (print_xml): Implement. * NEWS (2.3a+): Fix quotes. * src/parse-gram.y (prologue_declaration): For consistency with -v, don't let %verbose clear the list specified by --report.
This commit is contained in:
126
src/conflicts.c
126
src/conflicts.c
@@ -135,78 +135,78 @@ log_resolution (rule *r, symbol_number token,
|
||||
}
|
||||
|
||||
obstack_sgrow (&solved_conflicts_obstack, ".\n");
|
||||
}
|
||||
|
||||
/* XML report */
|
||||
if (xml_flag)
|
||||
{
|
||||
/* The description of the resolution. */
|
||||
switch (resolution)
|
||||
{
|
||||
case shift_resolution:
|
||||
case right_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
" <resolution rule=\"%d\" symbol=\"%s\""
|
||||
" type=\"shift\">",
|
||||
r->number,
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
/* XML report */
|
||||
if (xml_flag)
|
||||
{
|
||||
/* The description of the resolution. */
|
||||
switch (resolution)
|
||||
{
|
||||
case shift_resolution:
|
||||
case right_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
" <resolution rule=\"%d\" symbol=\"%s\""
|
||||
" type=\"shift\">",
|
||||
r->number,
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
|
||||
case reduce_resolution:
|
||||
case left_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
" <resolution rule=\"%d\" symbol=\"%s\""
|
||||
" type=\"reduce\">",
|
||||
r->number,
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
case reduce_resolution:
|
||||
case left_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
" <resolution rule=\"%d\" symbol=\"%s\""
|
||||
" type=\"reduce\">",
|
||||
r->number,
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
|
||||
case nonassoc_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
" <resolution rule=\"%d\" symbol=\"%s\""
|
||||
" type=\"error\">",
|
||||
r->number,
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
}
|
||||
case nonassoc_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
" <resolution rule=\"%d\" symbol=\"%s\""
|
||||
" type=\"error\">",
|
||||
r->number,
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
}
|
||||
|
||||
/* The reason. */
|
||||
switch (resolution)
|
||||
{
|
||||
case shift_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
"%s < %s",
|
||||
xml_escape_n (0, r->prec->tag),
|
||||
xml_escape_n (1, symbols[token]->tag));
|
||||
break;
|
||||
/* The reason. */
|
||||
switch (resolution)
|
||||
{
|
||||
case shift_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
"%s < %s",
|
||||
xml_escape_n (0, r->prec->tag),
|
||||
xml_escape_n (1, symbols[token]->tag));
|
||||
break;
|
||||
|
||||
case reduce_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
"%s < %s",
|
||||
xml_escape_n (0, symbols[token]->tag),
|
||||
xml_escape_n (1, r->prec->tag));
|
||||
break;
|
||||
case reduce_resolution:
|
||||
obstack_fgrow2 (&solved_conflicts_xml_obstack,
|
||||
"%s < %s",
|
||||
xml_escape_n (0, symbols[token]->tag),
|
||||
xml_escape_n (1, r->prec->tag));
|
||||
break;
|
||||
|
||||
case left_resolution:
|
||||
obstack_fgrow1 (&solved_conflicts_xml_obstack,
|
||||
"%%left %s",
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
case left_resolution:
|
||||
obstack_fgrow1 (&solved_conflicts_xml_obstack,
|
||||
"%%left %s",
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
|
||||
case right_resolution:
|
||||
obstack_fgrow1 (&solved_conflicts_xml_obstack,
|
||||
"%%right %s",
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
case right_resolution:
|
||||
obstack_fgrow1 (&solved_conflicts_xml_obstack,
|
||||
"%%right %s",
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
|
||||
case nonassoc_resolution:
|
||||
obstack_fgrow1 (&solved_conflicts_xml_obstack,
|
||||
"%%nonassoc %s",
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
}
|
||||
case nonassoc_resolution:
|
||||
obstack_fgrow1 (&solved_conflicts_xml_obstack,
|
||||
"%%nonassoc %s",
|
||||
xml_escape (symbols[token]->tag));
|
||||
break;
|
||||
}
|
||||
|
||||
obstack_sgrow (&solved_conflicts_xml_obstack, "</resolution>\n");
|
||||
}
|
||||
obstack_sgrow (&solved_conflicts_xml_obstack, "</resolution>\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user