+2002-12-09 Paul Eggert <eggert@twinsun.com>
+
+ Change identifier spellings to avoid collisions with names
+ that are reserved by POSIX.
+
+ Don't use names ending in _t, since POSIX reserves them.
+ For consistency, remove _e and _s endings -- they're weren't
+ needed to remove ambiguity. All uses changed.
+ * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
+ turn was just renamed from struniq_t.
+ * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
+ which in turn was just renamed from struniq_processor_t.
+ (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
+ in turn was renamed from hash_compare_struniq_t.
+ * src/LR0.c (struct state_list): Renamed from struct state_list_s.
+ (state_list): Renamed from state_list_t.
+ * src/assoc.h (assoc): Renamed from assoc_t.
+ * src/conflicts.c (enum conflict_resolution): Renamed from
+ enum conflict_resolution_e.
+ * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
+ (rule_list): Renamed from rule_list_t.
+ * src/getargs.h (enum trace): Renamed from enum trace_e.
+ (enum report): Renamed from enum report_e.
+ * src/gram.h (item_number): Renamed from item_number_t.
+ (rule_number): Renamed from rule_number_t.
+ (struct rule_s): Remove the "rule_s" part; not used.
+ (rule): Renamed from rule_t.
+ (rule_filter): Renamed from rule_filter_t.
+ * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
+ (goto_list): Renamed from goto_list_t.
+ * src/lalr.h (goto_number): Renamed from goto_number_t.
+ * src/location.h (location): Renamed from location_t.
+ * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
+ and moved here from:
+ * src/muscle_tab.h (muscle_entry_t): here.
+ * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
+ (rule_list): Renamed from rule_list_t.
+ * src/print_graph.c (static_graph): Renamed from graph.
+ * src/reader.h (braced_code): Renamed from braced_code_t.
+ Remove brace_code_e tag.
+ * src/relation.h (relation_node): Renamed from relation_node_t.
+ (relation_nodes): Renamed from relation_nodes_t.
+ (relation): Renamed from relation_t.
+ * src/state.h (state_number): Renamed from state_number_t.
+ (struct state): Renamed from struct state_s.
+ (state): Renamed from state_t.
+ (transitions): Renamed from transitions_t. Unused (and
+ misspelled) transtion_s tag removed.
+ (errs): Renamed from errs_t. Unused errs_s tag removed.
+ (reductions): Renamed from reductions_t. Unused tag
+ reductions_s removed.
+ * src/symlist.h (symbol_list): Renamed from symbol_list_t.
+ (struct symbol_list): Renamed from struct symbol_list_s.
+ * src/symtab.h (symbol_number): Renamed from symbol_number_t.
+ (struct symbol): Renamed from struct symbol_s.
+ (symbol): Renamed from symbol_t.
+ * src/tables.c (vector_number): Renamed from vector_number_t.
+ (action_number): Renamed from action_t.
+ * src/tables.h (base_number): Renamed from base_t.
+ * src/vcg.h (enum color): Renamed from enum color_e.
+ (enum textmode): Renamed from enum textmode_e.
+ (enum shape): Renamed from enum shape_e.
+ (struct colorentry): Renamed from struct colorentry_s.
+ (struct classname): Renamed from struct classname_s.
+ (struct infoname): Renamed from struct infoname_s.
+ (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
+ (enum decision): Renamed from enum decision_e.
+ (enum orientation): Renamed from enum orientation_e.
+ (enum alignment): Renamed from enum alignment_e.
+ (enum arrow_mode): Renamed from enum arrow_mode_e.
+ (enum crossing_type): Renamed from enum crossing_type_e.
+ (enum view): Renamed from enum view_e.
+ (struct node): Renamed from struct node_s.
+ (node): Renamed from node_t.
+ (enum linestyle): Renamed from enum linestyle_e.
+ (enum arrowstyle): Renamed from enum arrowstyle_e.
+ (struct edge): Renamed from struct edge.
+ (edge): Renamed from edge_t.
+ (struct graph): Renamed from struct graph_s.
+ (graph): Renamed from graph_t.
+ * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
+ Rename value_t -> value.
+ * tests/input.at (Torturing the Scanner): Rename value_t -> value,
+ value_t_as_yystype -> value_as_yystype.
+
+ Don't include <errno.h> in the mainstream code, since it
+ reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
+ * lib/get-errno.c, lib/get-errno.h: New files.
+ * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
+ get-errno.c.
+ * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
+ * src/output.c (output_skeleton): Likewise.
+ * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
+ instead of errno.
+ (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
+ Likewise.
+ (handle_action_dollar, handle_action_at): Likewise.
+ * src/system.h: Do not include <errno.h>.
+ (TAB_EXT): Renamed from EXT_TAB.
+ (OUTPUT_EXT): Renamed from EXT_OUTPUT.
+
+ Avoid str[a-z]*, since <string.h> reserves that name space.
+ Change all instances of "struniq" in names to "uniqstr", and
+ likewise for "STRUNIQ" and "UNIQSTR".
+ * src/uniqstr.c: Renamed from src/struniq.c.
+ * src/uniqstr.h: Renamed from src/struniq.h.
+ * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
+ * src/files.c (strsuffix): Remove; unused.
+ (concat2): Renamed from stringappend. Now static.
+ * src/files.h (strsuffix, stringappend): Remove; unused.
+ * src/parse-gram.y (<chars>): Renamed from <string>.
+ (<uniqstr>): Renamed from <struniq>.
+ * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
+ * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
+ (struct graph_s.expand): Renamed from struct graph_s.stretch.
+ * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
+ (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
+ (N_EXPAND): Renamed from N_STRETCH.
+
+ Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
+ * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
+ * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
+ Remove; unused.
+ * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
+ * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
+ * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
+ * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
+ (BASE_MAXIMUM): Renamed from BASE_MAX.
+ (BASE_MINIMUM): Renamed from BASE_MIN.
+ (ACTION_MAX): Remove; unused.
+ (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
+ Unnecessary casts removed from above defines.
+
+
+ Fix misspelling in names.
+ * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
+ * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
+ G_NODE_ALIGNEMENT.
+
+
+ * lib/timevar.c (timevar_report): Renamed from time_report,
+ for consistency with other names.
+ * lib/timevar.h (timevar_report): New decl.
+ * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
+
+
+ Sort include-file uses.
+
+ Reorder all include files under src to be in the order "system.h".
+ then the ../lib include files in angle brackets (alphabetized),
+ then the . include files in double-quotes (alphabetized). Fix
+ dependency breakages encountered in this process, as follows:
+ * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
+ * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
+ * src/state.h: Include "symtab.h".
+
+2002-12-08 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
+ since this causes problems when __file__ contains character
+ sequences like "@" that are treated specially by src/scan-skel.l.
+ Instead, just use the file's basename. This fixes the bug
+ reported by Martin Mokrejs in
+ <http://mail.gnu.org/pipermail/bug-bison/2002-December/001945.html>.
+
+2002-12-06 Paul Eggert <eggert@twinsun.com>
+
+ Add support for rules that do not have trailing semicolons, as
+ POSIX requires. Improve the quality of locations in Bison
+ diagnostics.
+
+ * src/location.c: Include <quotearg.h>.
+ (empty_location): Now const.
+ (location_print): New function. Follow the recommendation of the
+ GNU Coding Standards for locations that span file boundaries.
+ * src/location.h: Do not include <quotearg.h>; no longer needed.
+ (boundary): New type.
+ (location_t): Use it. This allows locations to span file boundaries.
+ All member uses changed: file -> start.file or end.file (as needed),
+ first_line -> start.line, first_column -> start.column,
+ last_line -> end.line, last_column -> end.column.
+ (equal_boundaries): New function.
+ (LOCATION_RESET, LOCATION_STEP): Remove.
+ (LOCATION_PRINT): Remove. All callers changed to use location_print.
+ (empty_location): Now const.
+ (location_print): New decl.
+ * src/parse-gram.y (lloc_default): New function, which handles
+ empty locations more accurately.
+ (YYLLOC_DEFAULT): Use it.
+ (%token COLON): Remove.
+ (%token ID_COLON): New token.
+ (rules): Use it.
+ (declarations, rules): Remove trailing semicolon.
+ (declaration, rules_or_grammar_declaration):
+ Allow empty (";") declaration.
+ (symbol_def): Remove empty actions; no longer needed.
+ (rules_or_grammar_declaration): Remove trailing semicolon.
+ (semi_colon.opt): Remove.
+ * src/reader.h: Include location.h.
+ (scanner_cursor): New decl.
+ * src/reduce.c (nonterminals_reduce): Use warn_at rather than
+ rolling our own.
+ * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
+ of *loc.
+ (STEP): Remove. No longer needed, now that adjust_location does
+ the work. All uses removed.
+ (scanner_cursor): New var.
+ (adjust_location): Renamed from extend_location. It now sets
+ *loc and adjusts the scanner cursor. All uses changed.
+ Don't bother testing for CR.
+ (handle_syncline): Remove location arg; now updates scanner cursor.
+ All callers changed.
+ (unexpected_end_of_file): Now accepts start boundary of token or
+ comment, not location. All callers changed. Update scanner cursor,
+ not the location.
+ (SC_AFTER_IDENTIFIER): New state.
+ (context_state): Renamed from c_context. All uses changed.
+ (id_loc, code_start, token_start): New local vars.
+ (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
+ processing of Yacc white space and equivalents here.
+ (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
+ instead of returning ID immediately, since we need to search for
+ a subsequent colon.
+ (<INITIAL>"'", "\""): Save token_start.
+ (<INITIAL>"%{", "{", "%%"): Save code_start.
+ (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
+ (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
+ BEGIN context_state at end, not INITIAL.
+ (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
+ <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
+ Return correct token start.
+ (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
+ the start of a character, string or multiline comment is found.
+ * tests/conflicts.at (S/R in initial, Defaulted Conflicted
+ Reduction): Adjust reported locations to match the more-precise
+ results now expected.
+ * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
+ * tests/reduce.at (Useless Rules, Reduced Automaton,
+ Underivable Rules): Likewise.
+ * tests/regression.at (Invalid inputs): No longer `expecting ";"
+ or "|"' now that so many other tokens are allowed by the new grammar.
+
+ * src/complain.h (current_file): Remove duplicate decl;
+ current_file is now owned by files.h.
+ * src/complain.c, src/scan-gram.l: Include files.h.
+
+2002-12-06 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
+ promotes to int; it might be unsigned int.
+ * data/yacc.c (yy_reduce_print): Likewise.
+
+ * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
+ be #defined in the prologue, not in the Bison declarations.
+ This fixes Debian Bug 102878, reported by Shaul Karl.
+
+2002-12-02 Paul Eggert <eggert@twinsun.com>
+
+ * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
+ * lib/strtoul.c: New file, from gnulib.
+ This fixes a porting bug reported by Peter Klein in
+ <http://mail.gnu.org/pipermail/bug-bison/2002-December/001944.html>.
+
+2002-11-30 Paul Eggert <eggert@twinsun.com>
+
+ * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
+ and put only a forward declaration in the prologue. This is for
+ consistency with the other scanner helper functions.
+
+ Type clashes now generate warnings, not errors, since it
+ appears that POSIX may allow some grammars with type clashes.
+ * src/reader.c (grammar_current_rule_check): Warn about
+ type clashes instead of complaining.
+ * tests/input.at (Type Clashes): Expect warnings, not complaints.
+
+ Add Yacc library, since POSIX requires it.
+ * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
+ * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
+ * lib/main.c, lib/yyerror.c: New files.
+
+ gram_error can be static; it need not be extern.
+ * src/reader.h (gram_error): Remove decl.
+ * src/parse-gram.y (gram_error): Now static. Add static decl.
+ (print_token_value): Omit parameter names from forward decl,
+ for consistency.
+
+2002-11-29 Paul Eggert <eggert@twinsun.com>
+
+ * doc/bison.texinfo: Emphasize that yylex and yyerror must
+ be declared before being used. E.g., one should typically
+ declare them in the prologue. Use GNU coding style in examples.
+ Put "const" consistently after the type it modifies. Mention
+ that C99 supports "inline". Mention that yyerror traditionally
+ returns "int".
+
+ %parse-param and %lex-param now take just one argument, the
+ declaration; the argument name is deduced from the declaration.
+
+ * doc/bison.texinfo (Parser Function, Pure Calling, Error
+ Reporting, Table of Symbols): Document this.
+ * src/parse-gram.y (add_param): New function.
+ (COMMA): Remove.
+ (declaration): Implement new rule for %parse-param and %lex-param.
+ * src/scan-gram.l: "," now elicits a warning, rather than being
+ a token; this is more compatible with byacc.
+ * tests/calc.at (Simple LALR Calculator): Adopt new convention.
+
+2002-11-27 Paul Eggert <eggert@twinsun.com>
+
+ Rename identifiers to avoid real and potential collisions.
+
+ * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
+ to avoid collision with lex macro described by Bruce Lilly in
+ <http://mail.gnu.org/pipermail/bug-bison/2002-November/001929.html>.
+ * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
+ * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
+ * src/parse-gram.y (print_token_value): Renamed from yyprint.
+ All uses changed.
+ (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
+ The name "yycontrol" violates the name space rules, and this stuff
+ wasn't being used anyway.
+ (input): Remove action; this stuff wasn't being used.
+ (gram_error): Rename local variable yylloc -> loc.
+ * src/reader.h (struct gram_control_s, gram_control_t): Remove.
+ (YY_DECL): Don't use "yy" at start of local variables.
+ All uses changed, e.g., yylloc -> loc.
+ * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
+ (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
+ (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
+ (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
+
+ * src/parse-gram.y (gram_error): loc is now const *.
+ * src/reader.h (gram_error): Likewise.
+
+2002-11-24 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.75c.
+
+ * tests/actions.at (Actions after errors): Use an output format
+ more similar to that of the Printers and Destructors test.
+ Test the position of the ';' token too.
+ (Printers and Destructors): Likewise.
+ (Printers and Destructors: %glr-parser): Remove for now, to avoid
+ unnecessarily alarming people when the test fails.
+
+ * data/yacc.c (yyerrlab1): Move this label down, so that the
+ parser does not discard the lookahead token if the user code
+ invokes YYERROR. This change is required for POSIX conformance.
+
+ * lib/error.c: Sync with gnulib.
+
+2002-11-22 Paul Eggert <eggert@twinsun.com>
+
+ * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
+ * lib/mbswidth.c, lib/mbswidth.h: Likewise.
+ * lib/xmalloc.c: Likewise.
+
2002-11-20 Paul Eggert <eggert@twinsun.com>
* lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
2002-11-20 Paul Eggert <eggert@twinsun.com>
-
+
Avoid use of <assert.h>, as the GNU Coding Standards hint that one
should use `if (! x) abort ();' rather than `assert (x);', and
anyway it's one less thing to worry about configuring.