]> git.saurik.com Git - bison.git/blobdiff - ChangeLog
(item_number): Renamed from item_number_t.
[bison.git] / ChangeLog
index df4d79cf8552d53857ed10c5302ee3d79ff9950e..b96950b0a4091ac7a2a034fb2161dadbc1647f7f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,260 @@
+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/001949.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.
+
+       * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
+       * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
+       and replace all instances of assert with abort.
+       * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
+       * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
+
+       * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
+       yyresolveAction, yyprocessOneStack): Use abort rather than assert.
+       * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
+       hash_find_entry, hash_rehash, hash_insert): Likewise.
+       * src/conflicts.c (resolve_sr_conflict): Likewise.
+       * src/lalr.c (set_goto_map, map_goto): Likewise.
+       * src/nullable.c (nullable_compute): Likewise.
+       * src/output.c (prepare_rules, token_definitions_output): Likewise.
+       * src/reader.c (packgram, reader): Likewise.
+       * src/state.c (state_new, state_free, state_transitions_set,
+       state_reduction_find): Likewise.
+       * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
+       symbol_pack): Likewise.
+       * src/tables.c (conflict_row, pack_vector): Likewise.
+       * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
+       get_layoutalgorithm_str, get_decision_str, get_orientation_str,
+       get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
+       get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
+
+       * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
+       (ARGMATCH_CONSTRAINT): New macro.
+       (ARGMATCH_ASSERT): Use it.
+
+       * src/system.h (verify): New macro.
+       * src/getargs.c (trace_argmatch, report_argmatch): Use verify
+       rather than assert.
+       * src/tables.c (tables_generate): Likewise.
+
+       * src/struniq.c (struniq_assert): Now returns void, and aborts
+       if the assertion is false.
+       (struniq_assert_p): Remove.
+       * src/struniq.h: Likewise.
+
+2002-11-18  Paul Eggert  <eggert@twinsun.com>
+
+       * data/glr.c (yygetLRActions): Replace `yyindex' with
+       `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
+       This fixes the regression with Sun ONE Studio 7 cc that I reported in
+       <http://mail.gnu.org/pipermail/bug-bison/2002-November/001892.html>.
+
 2002-11-18  Akim Demaille  <akim@epita.fr>
 
        * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a