Files
bison/src/files.h
Paul Eggert 41d7a5f24d * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
elsewhere.
* src/print-xml.c: Prefer "const" after types; that's more consistent.
(xml_printf): Indent just 1 space for level.
(e_char, xlate_char): Remove.
(xml_escape_string): Rewrite to avoid undefined behavior (used
storage that was freed from the stack).
(xml_escape_n): Don't bother checking for subscript error.

2007-09-21  Wojciech Polak <polak@gnu.org>

Add support for an -x option to generate an XML report.
It is not documented yet.
* src/print-xml.c: New file.
* src/print-xml.h: Likewise.
* lib/timevar.def (TV_XML): New var.
* src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
* src/conflicts.c: Include print-xml.h.
(solved_conflicts_xml_obstack): New var.
(log_resolution, conflicts_solve, conflicts_free):
Add support for XML report.
(conflicts_output_val): New function.
* src/conflicts.h (conflicts_output_val): New decl.
* src/files.c (spec_xml_file): New var.
(compute_output_file_names, output_file_names_free): Add XML support.
* src/files.h (spec_xml_file): New decl.
* src/getargs.c (xml_flag): New var.
(usage, short_options, long_options, getargs): Add XML support.
* src/getargs.h (xml_flag): New decl.
* src/gram.c: Include print-xml.h.
(rule_lhs_print_xml, rule_rhs_print_xml):
(grammar_rules_partial_print_xml, grammar_rules_print_xml):
New functions.
* src/gram.h: Declare external ones.
* src/main.c: Include print-xml.h.
(main): Add XML support.
* src/reduce.c: Include print-xml.h.
(reduce_xml): New function.
* src/reduce.h: Declare it.
* src/state.c: Include print-xml.h.
(state_new): Add XML support.
(state_rule_lookahead_tokens_print_xml): New function.
* src/state.h: Declare it.
(struct state): New member solved_conflicts_xml.
* src/symtab.c (symbol_class_get_string): New function.
* src/symtab.h: Declare it.

2007-09-21  Paul Eggert  <eggert@cs.ucla.edu>
2007-09-21 22:53:58 +00:00

72 lines
2.2 KiB
C

/* File names and variables for bison,
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2006, 2007 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef FILES_H_
# define FILES_H_
# include "uniqstr.h"
/* File name specified with -o for the output file, or 0 if no -o. */
extern char const *spec_outfile;
/* File name for the parser (i.e., the one above, or its default.) */
extern char *parser_file_name;
/* Symbol prefix specified with -p, or 0 if no -p. */
extern const char *spec_name_prefix;
/* File name prefix specified with -b, or 0 if no -b. */
extern char const *spec_file_prefix;
/* --verbose. */
extern char *spec_verbose_file;
/* File name specified for the output graph. */
extern char *spec_graph_file;
/* File name specified for the xml output. */
extern char *spec_xml_file;
/* File name specified with --defines. */
extern char *spec_defines_file;
/* Directory prefix of output file names. */
extern char *dir_prefix;
/* The file name as given on the command line.
Not named "input_file" because Flex uses this name for an argument,
and therefore GCC warns about a name clash. */
extern uniqstr grammar_file;
/* The current file name. Might change with %include, or with #line. */
extern uniqstr current_file;
/* The computed base for output file names. */
extern char *all_but_ext;
void compute_output_file_names (void);
void output_file_names_free (void);
void output_file_name_check (char const *file_name);
FILE *xfopen (const char *name, const char *mode);
void xfclose (FILE *ptr);
#endif /* !FILES_H_ */