+2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Clean up b4_check_percent_code_qualifiers a little.
+ * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
+ in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
+ documentation and add examples.
+ * src/parse-gram.y (grammar_declaration): Double-M4-quote those
+ qualifiers here.
+
+2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
+ unreliable -- especially when they're hidden inside another macro.
+ * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
+ data/c.m4: Remove m4_divert(-1).
+ * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
+ data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
+ m4_divert_push(0) and m4_divert_pop(0).
+ * data/output.c (output_skeleton): Don't add an m4_divert_push(0) and
+ an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
+ pushed and popped by m4sugar, should be first on the stack.
+
+ Provide warn, complain, and fatal function callbacks to the skeletons.
+ This provides more flexibility than m4_fatal, improves the error
+ message format, and captures messages for translation. Discussed
+ starting at
+ <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
+ * data/bison.m4 (b4_error): New, invoked by...
+ (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
+ skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
+ directives. Because these M4 macros might be called when the current
+ diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
+ the previous removal of uses of m4_divert, which caused trouble.
+ (b4_check_percent_code_qualifiers): Use b4_complain instead of
+ m4_fatal to report unrecognized %code qualifiers.
+ * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
+ push parser requests.
+ * data/glr.c: Use b4_complain instead of m4_fatal to report
+ non-deterministic push parser requests.
+ Update @output usage to @output(...@) form.
+ * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
+ report missing %defines. Update @output usage to @output(...@) form.
+ * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
+ @output(...@) form.
+ * src/main.c (main): Invoke skel_scanner_free.
+ * src/scan-skel.h (skel_scanner_free): Prototype new function.
+ * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
+ obstack_for_string from flex-scanner.h.
+ (YY_DECL): Use to declare skel_lex static.
+ (decode_at_digraphs): Remove; now handled in the new
+ SC_AT_DIRECTIVE_ARG start condition.
+ (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
+ functions.
+ (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
+ at_directive_argv): New static globals.
+ (INITIAL): Use fail_for_invalid_at.
+ Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
+ recognize the start of a generalized `@directive(...@)' form and
+ start...
+ (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
+ directive args (using the new obstack_for_string), to decode the
+ contained @ diagraphs, and to perform the directive. It recognizes
+ @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
+ @output(...@).
+ (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
+ SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
+ `@,'.
+ (scan_skel): Initialize obstack_for_string on the first call.
+ (skel_scanner_free): New function to free obstack_for_string.
+ * tests/input.at (Reject bad %code qualifiers): Update test output.
+
+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.
-----
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