]> git.saurik.com Git - bison.git/blobdiff - ChangeLog
Consolidate the 4 prologue alternative directives (%code, %requires,
[bison.git] / ChangeLog
index b5e86bcea7e86f2a1af3447eb632ba3254d5618e..d06290e3afb5405bf56b77518468935d19815a7c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,182 @@
+2007-01-04  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       Consolidate the 4 prologue alternative directives (%code, %requires,
+       %provides, and %code-top) into a single %code directive with an
+       optional qualifier field.  Discussed at
+       <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
+       * NEWS (2.3a+): Rewrite the existing entry for the prologue
+       alternatives.
+       * doc/bison.texinfo (Prologue Alternatives): Update.
+       (Decl Summary): Update to %code "requires" and %code "provides".
+       (Calc++ Parser): Update to %code "requires".
+       (Bison Symbols): Remove entries for %requires, %provides, and
+       %code-top.  Rewrite %code entry, and add a %code "QUALIFIER" entry.
+       * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
+       are replaced by b4_percent_code_provides and b4_percent_code_requires,
+       which are skeleton-specific.
+       (b4_check_percent_code_qualifiers): New.  A skeleton can use this to
+       declare what %code qualifiers it supports and to complain if any other
+       qualifiers were used in the grammar.
+       * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
+       and b4_user_code([b4_percent_code_provides]) in place of
+       b4_user_requires and b4_user_provides.
+       * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
+       Add b4_user_code([b4_percent_code_top]) and
+       b4_user_code([b4_percent_code]).
+       Invoke b4_check_percent_code_qualifiers.
+       * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
+       PERCENT_REQUIRES): Remove.
+       (grammar_declaration): Remove RHS's for %code-top, %provides, and
+       %requires.  Rewrite the %code RHS as the unqualified form defining the
+       muscle b4_percent_code.  Add another RHS for the qualified %code form,
+       which defines muscles of the form b4_percent_code_QUALIFIER and the
+       b4_used_percent_code_qualifiers muscle.
+       * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
+       PERCENT_REQUIRES): Remove.
+       * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
+       %code "requires" and %code "provides".
+       * tests/input.at (Reject bad %code qualifiers): New.
+
+2007-01-03  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       Use the new code_props interface for destructors and printers.
+       * src/symtab.h (symbol, semantic_type): Remove destructor_location and
+       printer_location members, and change the type of the destructor and
+       printer members to code_props.
+       (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
+       symbol_printer_get, semantic_type_destructor_set,
+       semantic_type_printer_set, default_tagged_destructor_set,
+       default_tagless_destructor_set, default_tagged_printer_set,
+       default_tagless_printer_set): Use code_props in arguments and return
+       types in place of char const * and location.
+       (symbol_destructor_location_get, symbol_printer_location_get): Remove
+       since the locations are now contained in the return of
+       symbol_destructor_get and symbol_printer_get.
+       * src/output.c (symbol_destructors_output, symbol_printers_output):
+       Replace with...
+       (symbol_code_props_output): ... this to eliminate duplicate code.
+       (output_skeleton): Update to use symbol_code_props_output.
+       * src/reader.c (symbol_should_be_used): Update use of
+       symbol_destructor_get.
+       * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
+       Update uses of the various _destructor_set and _printer_set functions.
+       * src/symtab.c: (default_tagged_destructor_location,
+       default_tagless_destructor_location, default_tagged_printer_location,
+       default_tagless_printer_location): Remove since we...
+       (default_tagged_destructor, default_tagless_destructor,
+       default_tagged_printer, default_tagless_printer): ... change the type
+       of these to code_props.
+       (symbol_new, semantic_type_new, symbol_destructor_set,
+       semantic_type_destructor_set, symbol_destructor_get,
+       symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
+       symbol_check_alias_consistency, default_tagged_destructor_set,
+       default_tagless_destructor_set, default_tagged_printer_set,
+       default_tagless_printer_set): Update.
+       (symbol_destructor_location_get, symbol_printer_location_get): Remove.
+       (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
+       code_props members.
+       (symbol_print): Use SYMBOL_CODE_PRINT.
+
+2007-01-03  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       Use the new code_props interface for rule actions.
+       * src/symlist.h (symbol_list): Replace action, action_location, and
+       used members with a code_props action_props member.
+       * src/reader.c (symbol_should_be_used, grammar_rule_check,
+       grammar_midrule_action, grammar_current_rule_merge_set,
+       grammar_current_rule_symbol_append, packgram): Update.
+       * src/scan-code.h (translate_rule_action): Remove, no longer used.
+       * src/scan-code.l (handle_action_dollar): Update.
+       (translate_rule_action): Remove, no longer used.
+       * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
+
+2007-01-02  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       Use the new code_props interface in parse-gram.y.
+       * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
+       Update all uses of translate_* functions to use the new code_props
+       interface and to use gram_scanner_last_string_free and
+       code_scanner_last_string_free where possible.
+       (grammar_declaration): symbol_list_destructor_set and
+       symbol_list_printer_set now perform the translation, so don't do it
+       here.  Use gram_scanner_last_string_free where possible.
+       * src/scan-code.h, src/scan-code.l (translate_symbol_action,
+       translate_code): Remove, no longer used.
+       * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
+       symbol_list_printer_set): Perform code translation here rather than
+       depending on the caller to do so.
+
+       * src/symlist.h (struct symbol_list): Correct some documentation typos.
+       * src/scan-gram.h (gram_last_string): Remove declaration.
+       * src/scan-gram.l (last_string): Declare it static.
+
+2007-01-02  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       Encapsulate code properties and related functionality for the various
+       destructors, printers, and actions into a code_props structure and
+       interface.  This patch merely implements code_props in scan-code.h and
+       scan-code.l.  Future patches will rewrite other modules to use it.
+       Discussed starting at
+       <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
+       * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
+       consistently initialize const structs that have an empty location
+       field.
+       * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
+       to ensure consistency.
+       * src/scan-code.h (code_props): New structure.
+       (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
+       function, macro, and const global variable for initializing a
+       code_props with no code.
+       (code_props_plain_init, code_props_symbol_action_init,
+       code_props_rule_action_init, code_props_translate_code): The rest of
+       the new code_props functional interface.  Among other things, the init
+       functions set the code_props kind field so that
+       code_props_translate_code will know whether to behave like
+       translate_symbol_action, translate_rule_action, or translate_code.
+       These old translate functions must remain until all other modules are
+       updated to use the new code_props interface.
+       (code_scanner_last_string_free): New function similar to
+       gram_scanner_last_string_free.
+       (code_scanner_free): Add documentation.
+       * src/scan-code.l: Implement the new interface.
+       (code_lex): Make it static, add a code_props* argument, and remove the
+       rule argument.
+       (last_string): New static global similar to the one in scan-gram.l.
+       (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
+       instead of rule.
+       (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
+       code_props since Bison may one day use this information for destructors
+       and printers.
+       (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
+       (handle_action_dollar): Use symbol_list_n_get and set used flag
+       directly since symbol_list_n_used_set is removed.
+       (translate_action): Add a code_props* argument and remove the rule,
+       action, and location arguments.  Pass the code_props* on to code_lex.
+       (translate_rule_action, translate_symbol_action, translate_code):
+       Rewrite as wrappers around the new code_props interface.
+       * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
+       it would eventually need to break the encapsulation of code_props.
+
+2007-01-01  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       * etc/.cvsignore: New.
+
+2007-01-01  Joel E. Denny  <jdenny@ces.clemson.edu>
+
+       Add maintainer-push-check to run maintainer-check using push parsing in
+       place of pull parsing where available.
+       * Makefile.am (maintainer-push-check): New.
+       * data/bison.m4 (b4_use_push_for_pull_if): New.
+       * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
+       appropriately based on their existing values.
+       (yypush_parse): Don't print push-parser-specific diagnostics if push
+       parsing is being used in place of pull parsing.
+       * data/yacc.c: If push parsing should replace pull parsing, redirect to
+       push.c.
+       * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
+       variable, and insert b4_use_push_for_pull_flag into muscles.
+       * tests/Makefile.am (maintainer-push-check): New.
+
 2006-12-31  Joel E. Denny  <jdenny@ces.clemson.edu>
 
        * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
 2006-12-31  Joel E. Denny  <jdenny@ces.clemson.edu>
 
        * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
        -----
 
        Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
        -----
 
        Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
-       1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
-       Software Foundation, Inc.
+       1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+       Free Software Foundation, Inc.
 
        Copying and distribution of this file, with or without
        modification, are permitted provided the copyright notice and this
 
        Copying and distribution of this file, with or without
        modification, are permitted provided the copyright notice and this