+2002-11-03 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
+ AT_CHECK_CALC_GLR invocations to use % directives, instead of
+ command line options.
+ * tests/cxx-type.at: Formatting changes.
+
+2002-11-03 Paul Eggert <eggert@twinsun.com>
+
+ * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
+ to count columns correctly, and to check for invalid inputs.
+
+ Use mbsnwidth to count columns correctly. Account for tabs, too.
+ Include mbswidth.h.
+ (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
+ (extend_location): New function.
+ (YY_LINES): Remove.
+
+ Handle CRLF in C code rather than in Lex code.
+ (YY_INPUT): New macro.
+ (no_cr_read): New function.
+
+ Scan UCNs, even though we don't fully handle them yet.
+ (convert_ucn_to_byte): New function.
+
+ Handle backslash-newline correctly in C code.
+ (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
+ (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
+ all uses changed.
+ (tag, splice): New EREs. Do not allow NUL or newline in tags.
+ Use {splice} wherever C allows backslash-newline.
+ YY_STEP after space, newline, vertical-tab.
+ ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
+
+ (letter, id): Don't assume ASCII; e.g., spell out a-z.
+
+ ({int}, handle_action_dollar, handle_action_at): Check for integer
+ overflow.
+
+ (YY_STEP): Omit trailing semicolon, so that it's more like C.
+
+ (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
+ as well as \000. Check for UCHAR_MAX, not 255.
+ Allow \x with an arbitrary positive number of digits, as in C.
+ Check for overflow here.
+ Allow \? and UCNs, for compatibility with C.
+
+ (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
+ with quote slot used by complain_at.
+
+ * tests/input.at: Add tests for backslash-newline, m4 quotes
+ in symbols, long literals, and funny escapes in strings.
+
+ * configure.ac (jm_PREREQ_MBSWIDTH): Add.
+ * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
+ * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
+ * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
+ * m4/mbswidth.m4: New file, from GNU coreutils.
+
+ * doc/bison.texinfo (Grammar Outline): Document // comments.
+ (Symbols): Document that trigraphs have no special meaning in Bison,
+ nor is backslash-newline allowed.
+ (Actions): Document that trigraphs have no special meaning.
+
+ * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
+ no longer used.
+
+2002-11-02 Paul Eggert <eggert@twinsun.com>
+
+ * src/reader.c: Don't include quote.h; not needed.
+ (get_merge_function): Reword warning to be consistent with
+ type clash diagnostic in grammar_current_rule_check.
+
+ * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
+ bug in trigraph handling.
+
+ * src/output.c (prepare_symbols): When printing token names,
+ escape "[" as "@<:@" and likewise for "]".
+
+ * src/system.h (errno): Remove declaration, as we are now
+ assuming C89 or better, and C89 guarantees errno.
+
+2002-10-30 Paul Eggert <eggert@twinsun.com>
+
+ * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
+ Check for close failures.
+ * src/files.h (xfclose): Return void, not int, since it always
+ returned zero.
+ * src/files.c (xfclose): Likewise. Report I/O error if ferror
+ indicates one.
+ * src/output.c (output_skeleton): Use xfclose rather than fclose
+ and ferror. xfclose now checks ferror.
+
+ * data/glr.c (YYLEFTMOST_STATE): Remove.
+ (yyreportTree): Use a stack-based leftmost state. This avoids
+ our continuing battles with bogus warnings about initializers.
+
+2002-10-30 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
+ #if.
+
+2002-10-24 Paul Eggert <eggert@twinsun.com>
+
+ Version 1.75a.
+
+ * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
+ * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
+ we use malloc. Don't assume 'A' through 'Z' are contiguous.
+ Don't assume strdup exists; POSIX says its an XSI extension.
+ Check for buffer overflow on input.
+
+2002-10-24 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (output_skeleton): Don't disable M4sugar comments
+ too soon: it results in comments being expanded.
+ * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
+ first output.
+
+2002-10-24 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c (m4_int_type): New.
+ * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
+ char' as only yacc.c wants K&R portability.
+ * data/glr.c (yysigned_char): Remove.
+ * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
+ Reported by Quoc Peyrot.
+
+2002-10-23 Paul Eggert <eggert@twinsun.com>
+
+ * src/main.c (main): With --trace=time, report times even if a
+ non-fatal error occurs. Formerly, the times were reported in some
+ such cases but not in others.
+ * src/reader.c (reader): Just return if a complaint has been issued,
+ instead of exiting, so that 'main' can report times.
+
+2002-10-22 Akim Demaille <akim@epita.fr>
+
+ * src/system.h: Include sys/types.
+ Reported by Bert Deknuydt.
+
+2002-10-23 Paul Eggert <eggert@twinsun.com>
+
+ * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
+ Suggested by Art Haas.
+
+2002-10-22 Paul Eggert <eggert@twinsun.com>
+
+ * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
+ decl; not needed any more.
+ * src/main.c (main): Use return to exit, undoing yesterday's change.
+ The last OS that we could find where this wouldn't work is
+ SunOS 3.5, and that's too old to worry about now.
+
+ * data/glr.c (struct yyltype): Define members even when not
+ doing locations. This is more consistent with yacc.c, and it
+ works around the following bug reports:
+ http://mail.gnu.org/pipermail/bug-bison/2002-October/001764.html
+ http://mail.gnu.org/pipermail/bug-bison/2002-October/001769.html
+ and I hope it also fixes this bug report:
+ http://mail.gnu.org/pipermail/bug-bison/2002-October/001748.html
+
+ * doc/bison.texinfo: Minor spelling and typographical fixes. Use
+ @acronym consistently. Standardize on "Yacc" instead of "YACC",
+ "Algol" instead of "ALGOL". Give a bit more history about BNF.
+
+2002-10-22 Akim Demaille <akim@epita.fr>
+
+ * data/README: New.
+
+2002-10-21 Paul Eggert <eggert@twinsun.com>
+
+ Be consistent about 'bool'; the old code used an enum in one
+ module and an int in another, and this violates the C standard.
+ * m4/stdbool.m4: New file, from coreutils 4.5.3.
+ * configure.ac (AC_HEADER_STDBOOL): Add.
+ * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
+ * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
+ * src/symtab.c (hash_compare_symbol_t): Likewise.
+ * src/system.h (bool, false, true): Use a definition consistent
+ with ../lib/hash.c. All uses changed.
+
+ * src/complain.c (warning_issued): Renamed from warn_message_count,
+ so that we needn't worry about integer overflow (!).
+ Now of type bool. All uses changed.
+ (complaint_issued): Renamed from complain_message_count; likewise.
+
+ * src/main.c (main): Use exit to exit with failure.
+
+ * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
+ rather than 1 and 0.
+ * src/main.c (main): Likewise.
+ * src/getargs.c (getargs): Likewise.
+ * src/reader.c (reader): Likewise.
+
+ * src/getarg.c (getargs): Remove duplicate code for
+ "Try `bison --help'".
+
+ * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
+ What was that "2" for?
+
+ * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
+ * src/getargs.c (usage): Likewise.
+
+ * src/getargs.c (getargs): When there are too few operands, report
+ the last one. When there are too many, report the first extra
+ one. This is how diffutils does it.
+
+2002-10-20 Paul Eggert <eggert@twinsun.com>
+
+ Remove K&R vestiges.
+ * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
+ * src/complain.c (VA_START): Remove. Assume prototypes.
+ (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
+ (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
+ fatal): Assume prototypes.
+ * src/complain.h: Assume prototypes.
+ * src/system.h (PARAMS): Remove.
+ Include <limits.h> unconditionally, since it's guaranteeed even
+ for a freestanding C89 compiler.
+ (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
+ * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
+ * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
+ (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
+ (yyresolveStates, yyresolveAction, yyresolveStack)
+ (yyprocessOneStack): Use them.
+ (yy_reduce_print): New.
+ * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * data/c.m4 (b4_c_ansi_args): Recognize functions with no
+ arguments and output `void'.
+ (b4_c_function): Rename as...
+ (b4_c_function_def): this.
+ (b4_c_function_decl, b4_c_ansi_function_def)
+ (b4_c_ansi_function_decl): New.
+ Change the interpretation of the arguments: before `int, foo', now
+ `int foo, foo'.
+ * data/yacc.c (yyparse): Prototype and define thanks to these.
+ Adjust b4_c_function_def uses.
+ * data/glr.c (yyparse): Likewise, but ANSI only.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (prepare): Move the definition of `tokens_number',
+ `nterms_number', `undef_token_number', `user_token_number_max'
+ to...
+ (prepare_tokens): Here.
+ (prepare_tokens): Rename as...
+ (prepare_symbols): this.
+ (prepare): Move the definition of `rules_number' to...
+ (prepare_rules): here.
+ (prepare): Move the definition of `last', `final_state_number',
+ `states_number' to...
+ (prepare_states): here.
+ * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * src/tables.h, src/tables.c, src/output.c: Comment changes.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
+ * data/c.m4: here.
+
+2002-10-20 Akim Demaille <akim@epita.fr>
+
+ * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
+ * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
+ `pair'.
+ (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
+ `name' to...
+ * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
+ (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
+ These.
+
+2002-10-19 Paul Eggert <eggert@twinsun.com>
+
+ Do not create a temporary file, as that involves security and
+ cleanup headaches. Instead, use a pair of pipes.
+ Derived from a suggestion by Florian Krohm.
+ * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
+ * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
+ * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
+ (BISON_PREREQ_SUBPIPE): Add.
+ * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
+ Add subpipe.h, subpipe.c.
+ * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
+ * po/POTFILES.in: Add lib/subpipe.c.
+ * src/output.c: Include "subpipe.h".
+ (m4_invoke): Remove decl.
+ (scan_skel): New decl.
+ (output_skeleton): Use pipe rather than temporary file for m4 input.
+ Check that m4sugar.m4 is readable, to avoid deadlock.
+ Check for pipe I/O error.
+ * src/scan-skel.l (readpipe): Remove decl.
+ (scan_skel): New function, to be used in place of m4_invoke.
+ Read from stream rather than file.
+
+ * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
+ float, as this generates a warning on Solaris 8 + GCC 3.2 with
+ --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
+ this generates a more-accurate value anyway.
+
+ * lib/timevar.c (timervar_accumulate): Rename locals to
+ avoid confusion with similarly-named more-global.
+ * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
+
+ * src/output.c (prepare): Use xstrdup to convert char const *
+ to char *, to avoid GCC warning.
+
+2002-10-19 Akim Demaille <akim@epita.fr>
+
+ * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
+ LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
+ Use them to have `calc.y' ready for %pure-parser.
+ * data/yacc.c (YYLEX): Pass a yylex return type to
+ b4_c_function_call.
+
+2002-10-19 Akim Demaille <akim@epita.fr>
+
+ Prototype support of %lex-param and %parse-param.
+
+ * src/parse-gram.y: Add the definition of the %lex-param and
+ %parse-param tokens, plus their rules.
+ Drop the `_' version of %glr-parser.
+ Add the "," token.
+ * src/scan-gram.l (INITIAL): Scan them.
+ * src/muscle_tab.c: Comment changes.
+ (muscle_insert, muscle_find): Rename `pair' as `probe'.
+ * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
+ (muscle_entry_s): The `value' member is no longer const.
+ Adjust all dependencies.
+ * src/muscle_tab.c (muscle_init): Adjust: use
+ MUSCLE_INSERT_STRING.
+ Initialize the obstack earlier.
+ * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
+ (muscle_pair_list_grow): New.
+ * data/c.m4 (b4_c_function_call, b4_c_args): New.
+ * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
+ * tests/calc.at: Use %locations, not --locations.
+ (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
+
+2002-10-19 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (usage): Take status as argument and exit
+ accordingly.
+ Report the traditional `Try ... --help' message when status != 0.
+ (usage, version): Don't take a FILE * as arg, it is pointless.
+ (getargs): When there is an incorrect number of arguments, make it
+ an error, and report it GNUlically thanks to `usage ()'.
+
+2002-10-18 Paul Eggert <eggert@twinsun.com>
+
+ * data/glr.c (yyreportParseError): Don't assume that sprintf
+ yields the length of the printed string, as this is not true
+ on SunOS 4.1.4. Reported by Peter Klein.
+
+ * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
+ * tests/conflicts.at (%nonassoc and eof): Likewise.
+ Fixes SunOS 4.1.4 test failure reported by Peter Klein.
+