projects
/
bison.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
maint: git now ignores rpcalc
[bison.git]
/
src
/
print-xml.c
diff --git
a/src/print-xml.c
b/src/print-xml.c
index ce71e1584c7db8bc213f575bdcadf98c26f58eff..e5c25c544f80144563fe82e843200ee5185cb203 100644
(file)
--- a/
src/print-xml.c
+++ b/
src/print-xml.c
@@
-1,6
+1,6
@@
/* Print an xml on generated parser, for Bison,
/* Print an xml on generated parser, for Bison,
- Copyright (C) 2007, 2009-201
2
Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-201
3
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This file is part of Bison, the GNU Compiler Compiler.
@@
-45,7
+45,8
@@
struct escape_buf
char *ptr;
size_t size;
};
char *ptr;
size_t size;
};
-static struct escape_buf escape_bufs[3];
+enum { num_escape_bufs = 3 };
+static struct escape_buf escape_bufs[num_escape_bufs];
/*--------------------------------.
/*--------------------------------.
@@
-209,7
+210,7
@@
print_errs (FILE *out, int level, state *s)
/*-------------------------------------------------------------------------.
/*-------------------------------------------------------------------------.
-| Report a reduction of RULE on LOOKAHEAD_TOKEN (which can be
`
default'). |
+| Report a reduction of RULE on LOOKAHEAD_TOKEN (which can be
'
default'). |
| If not ENABLED, the rule is masked by a shift or a reduce (S/R and |
| R/R conflicts). |
`-------------------------------------------------------------------------*/
| If not ENABLED, the rule is masked by a shift or a reduce (S/R and |
| R/R conflicts). |
`-------------------------------------------------------------------------*/
@@
-496,7
+497,6
@@
xml_escape (char const *str)
void
print_xml (void)
{
void
print_xml (void)
{
- state_number i;
int level = 0;
FILE *out = xfopen (spec_xml_file, "w");
int level = 0;
FILE *out = xfopen (spec_xml_file, "w");
@@
-522,8
+522,11
@@
print_xml (void)
/* print automaton */
fputc ('\n', out);
xml_puts (out, level + 1, "<automaton>");
/* print automaton */
fputc ('\n', out);
xml_puts (out, level + 1, "<automaton>");
- for (i = 0; i < nstates; i++)
- print_state (out, level + 2, states[i]);
+ {
+ state_number i;
+ for (i = 0; i < nstates; i++)
+ print_state (out, level + 2, states[i]);
+ }
xml_puts (out, level + 1, "</automaton>");
bitset_free (no_reduce_set);
xml_puts (out, level + 1, "</automaton>");
bitset_free (no_reduce_set);
@@
-531,8
+534,11
@@
print_xml (void)
xml_puts (out, 0, "</bison-xml-report>");
xml_puts (out, 0, "</bison-xml-report>");
- free (escape_bufs[0].ptr);
- free (escape_bufs[1].ptr);
+ {
+ int i;
+ for (i = 0; i < num_escape_bufs; ++i)
+ free (escape_bufs[i].ptr);
+ }
xfclose (out);
}
xfclose (out);
}